From e6fb3720b55e6b1d21bcdf8e5440a49d9e80d2f6 Mon Sep 17 00:00:00 2001 From: Hank <280630620@qq.com> Date: Wed, 17 Apr 2019 10:28:51 +0800 Subject: [PATCH 0001/1154] hankchow translated --- ...2 Using Square Brackets in Bash- Part 2.md | 168 ------------------ ...2 Using Square Brackets in Bash- Part 2.md | 158 ++++++++++++++++ 2 files changed, 158 insertions(+), 168 deletions(-) delete mode 100644 sources/tech/20190402 Using Square Brackets in Bash- Part 2.md create mode 100644 translated/tech/20190402 Using Square Brackets in Bash- Part 2.md diff --git a/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md b/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md deleted file mode 100644 index cfab28025a..0000000000 --- a/sources/tech/20190402 Using Square Brackets in Bash- Part 2.md +++ /dev/null @@ -1,168 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Square Brackets in Bash: Part 2) -[#]: via: (https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) - -Using Square Brackets in Bash: Part 2 -====== - -![square brackets][1] - -We continue our tour of square brackets in Bash with a look at how they can act as a command. - -[Creative Commons Zero][2] - -Welcome back to our mini-series on square brackets. In the [previous article][3], we looked at various ways square brackets are used at the command line, including globbing. If you've not read that article, you might want to start there. - -Square brackets can also be used as a command. Yep, for example, in: - -``` -[ "a" = "a" ] -``` - -which is, by the way, a valid command that you can execute, `[ ... ]` is a command. Notice that there are spaces between the opening bracket `[` and the parameters `"a" = "a"`, and then between the parameters and the closing bracket `]`. That is precisely because the brackets here act as a command, and you are separating the command from its parameters. - -You would read the above line as " _test whether the string "a" is the same as string "a"_ ". If the premise is true, the `[ ... ]` command finishes with an exit status of 0. If not, the exit status is 1. [We talked about exit statuses in a previous article][4], and there you saw that you could access the value by checking the `$?` variable. - -Try it out: - -``` -[ "a" = "a" ] -echo $? -``` - -And now try: - -``` -[ "a" = "b" ] -echo $? -``` - -In the first case, you will get a 0 (the premise is true), and running the second will give you a 1 (the premise is false). Remember that, in Bash, an exit status from a command that is 0 means it exited normally with no errors, and that makes it `true`. If there were any errors, the exit value would be a non-zero value (`false`). The `[ ... ]` command follows the same rules so that it is consistent with the rest of the other commands. - -The `[ ... ]` command comes in handy in `if ... then` constructs and also in loops that require a certain condition to be met (or not) before exiting, like the `while` and `until` loops. - -The logical operators for testing stuff are pretty straightforward: - -``` -[ STRING1 = STRING2 ] => checks to see if the strings are equal -[ STRING1 != STRING2 ] => checks to see if the strings are not equal -[ INTEGER1 -eq INTEGER2 ] => checks to see if INTEGER1 is equal to INTEGER2 -[ INTEGER1 -ge INTEGER2 ] => checks to see if INTEGER1 is greater than or equal to INTEGER2 -[ INTEGER1 -gt INTEGER2 ] => checks to see if INTEGER1 is greater than INTEGER2 -[ INTEGER1 -le INTEGER2 ] => checks to see if INTEGER1 is less than or equal to INTEGER2 -[ INTEGER1 -lt INTEGER2 ] => checks to see if INTEGER1 is less than INTEGER2 -[ INTEGER1 -ne INTEGER2 ] => checks to see if INTEGER1 is not equal to INTEGER2 -etc... -``` - -You can also test for some very shell-specific things. The `-f` option, for example, tests whether a file exists or not: - -``` -for i in {000..099}; \ - do \ - if [ -f file$i ]; \ - then \ - echo file$i exists; \ - else \ - touch file$i; \ - echo I made file$i; \ - fi; \ -done -``` - -If you run this in your test directory, line 3 will test to whether a file is in your long list of files. If it does exist, it will just print a message; but if it doesn't exist, it will create it, to make sure the whole set is complete. - -You could write the loop more compactly like this: - -``` -for i in {000..099};\ -do\ - if [ ! -f file$i ];\ - then\ - touch file$i;\ - echo I made file$i;\ - fi;\ -done -``` - -The `!` modifier in the condition inverts the premise, thus line 3 would translate to " _if the file`file$i` does not exist_ ". - -Try it: delete some random files from the bunch you have in your test directory. Then run the loop shown above and watch how it rebuilds the list. - -There are plenty of other tests you can try, including `-d` tests to see if the name belongs to a directory and `-h` tests to see if it is a symbolic link. You can also test whether a files belongs to a certain group of users (`-G`), whether one file is older than another (`-ot`), or even whether a file contains something or is, on the other hand, empty. - -Try the following for example. Add some content to some of your files: - -``` -echo "Hello World" >> file023 -echo "This is a message" >> file065 -echo "To humanity" >> file010 -``` - -and then run this: - -``` -for i in {000..099};\ -do\ - if [ ! -s file$i ];\ - then\ - rm file$i;\ - echo I removed file$i;\ - fi;\ -done -``` - -And you'll remove all the files that are empty, leaving only the ones you added content to. - -To find out more, check the manual page for the `test` command (a synonym for `[ ... ]`) with `man test`. - -You may also see double brackets (`[[ ... ]]`) sometimes used in a similar way to single brackets. The reason for this is because double brackets give you a wider range of comparison operators. You can use `==`, for example, to compare a string to a pattern instead of just another string; or < and `>` to test whether a string would come before or after another in a dictionary. - -To find out more about extended operators [check out this full list of Bash expressions][5]. - -### Next Time - -In an upcoming article, we'll continue our tour and take a look at the role of parentheses `()` in Linux command lines. See you then! - -_Read more:_ - - 1. [The Meaning of Dot (`.`)][6] - 2. [Understanding Angle Brackets in Bash (`<...>`)][7] - 3. [More About Angle Brackets in Bash(`<` and `>`)][8] - 4. [And, Ampersand, and & in Linux (`&`)][9] - 5. [Ampersands and File Descriptors in Bash (`&`)][10] - 6. [Logical & in Bash (`&`)][4] - 7. [All about {Curly Braces} in Bash (`{}`)][11] - 8. [Using Square Brackets in Bash: Part 1][3] - - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2 - -作者:[Paul Brown][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/bro66 -[b]: https://github.com/lujun9972 -[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-brackets-3734552_1920.jpg?itok=hv9D6TBy (square brackets) -[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO -[3]: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 -[4]: https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash -[5]: https://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions -[6]: https://www.linux.com/blog/learn/2019/1/linux-tools-meaning-dot -[7]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash -[8]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash -[9]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux -[10]: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash -[11]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash diff --git a/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md b/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md new file mode 100644 index 0000000000..70652f894c --- /dev/null +++ b/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md @@ -0,0 +1,158 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Square Brackets in Bash: Part 2) +[#]: via: (https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) + +在 Bash 中使用[方括号](二) +====== + +![square brackets][1] + +> 我们继续来看方括号的用法,它们甚至还可以在 Bash 当中作为一个命令使用。 + +[Creative Commons Zero][2] + +欢迎回到我们的方括号专题。在[前一篇文章][3]当中,我们介绍了方括号在命令行中可以用于通配操作,如果你已经读过前一篇文章,就可以从这里继续了。 + +方括号还可以以一个命令的形式使用,就像这样: + +``` +[ "a" = "a" ] +``` + +上面这种 `[ ... ]` 的形式就可以看成是一个可执行的命令。要注意,方括号内部的内容 `"a" = "a"` 和方括号 `[`、`]` 之间是有空格隔开的。因为这里的方括号被视作一个命令,因此要用空格将命令和它的参数隔开。 + +上面这个命令的含义是“判断字符串 `"a"` 和字符串 `"a"` 是否相同”,如果判断结果为真,那么 `[ ... ]` 就会以状态码status code 0 退出,否则以状态码 1 退出。在之前的文章中,我们也有介绍过状态码的概念,可以通过 `$?` 变量获取到最近一个命令的状态码。 + +分别执行 + +``` +[ "a" = "a" ] +echo $? +``` + +以及 + +``` +[ "a" = "b" ] +echo $? +``` + +这两段命令中,前者会输出 0(判断结果为真),后者则会输出 1(判断结果为假)。在 Bash 当中,如果一个命令的状态码是 0,表示这个命令正常执行完成并退出,而且其中没有出现错误,对应布尔值 `true`;如果在命令执行过程中出现错误,就会返回一个非零的状态码,对应布尔值 `false`。而 `[ ... ]`也同样遵循这样的规则。 + +因此,`[ ... ]` 很适合在 `if ... then`、`while` 或 `until` 这种在代码块结束前需要判断是否达到某个条件结构中使用。 + +对应使用的逻辑判断运算符也相当直观: + +``` +[ STRING1 = STRING2 ] => checks to see if the strings are equal +[ STRING1 != STRING2 ] => checks to see if the strings are not equal +[ INTEGER1 -eq INTEGER2 ] => checks to see if INTEGER1 is equal to INTEGER2 +[ INTEGER1 -ge INTEGER2 ] => checks to see if INTEGER1 is greater than or equal to INTEGER2 +[ INTEGER1 -gt INTEGER2 ] => checks to see if INTEGER1 is greater than INTEGER2 +[ INTEGER1 -le INTEGER2 ] => checks to see if INTEGER1 is less than or equal to INTEGER2 +[ INTEGER1 -lt INTEGER2 ] => checks to see if INTEGER1 is less than INTEGER2 +[ INTEGER1 -ne INTEGER2 ] => checks to see if INTEGER1 is not equal to INTEGER2 +etc... +``` + +方括号的这种用法也可以很有 shell 风格,例如通过带上 `-f` 参数可以判断某个文件是否存在: + +``` +for i in {000..099}; \ + do \ + if [ -f file$i ]; \ + then \ + echo file$i exists; \ + else \ + touch file$i; \ + echo I made file$i; \ + fi; \ +done +``` + +如果你在上一篇文章使用到的测试目录中运行以上这串命令,其中的第 3 行会判断那几十个文件当中的某个文件是否存在。如果文件存在,会输出一条提示信息;如果文件不存在,就会把对应的文件创建出来。最终,这个目录中会完整存在从 `file000` 到 `file099` 这一百个文件。 + +上面这段命令还可以写得更加简洁: + +``` +for i in {000..099};\ +do\ + if [ ! -f file$i ];\ + then\ + touch file$i;\ + echo I made file$i;\ + fi;\ +done +``` + +其中 `!` 运算符表示将判断结果取反,因此第 3 行的含义就是“如果文件 `file$i` 不存在”。 + +可以尝试一下将测试目录中那几十个文件随意删除几个,然后运行上面的命令,你就可以看到它是如何把被删除的文件重新创建出来的。 + +除了 `-f` 之外,还有很多有用的参数。`-d` 参数可以判断某个目录是否存在,`-h` 参数可以判断某个文件是不是一个符号链接。可以用 `-G` 参数判断某个文件是否属于某个用户组,用 `-ot` 参数判断某个文件的最后更新时间是否早于另一个文件,甚至还可以判断某个文件是否为空文件。 + +运行下面的几条命令,可以向几个文件中写入一些内容: + +``` +echo "Hello World" >> file023 +echo "This is a message" >> file065 +echo "To humanity" >> file010 +``` + +然后运行: + +``` +for i in {000..099};\ +do\ + if [ ! -s file$i ];\ + then\ + rm file$i;\ + echo I removed file$i;\ + fi;\ +done +``` + +你就会发现所有空文件都被删除了,只剩下少数几个非空的文件。 + +如果你还想了解更多别的参数,可以执行 `man test` 来查看 `test` 命令的 man 手册(`test` 是 `[ ... ]` 的命令别名)。 + +有时候你还会看到 `[[ ... ]]` 这种双方括号的形式,使用起来和单方括号差别不大。但双方括号支持的比较运算符更加丰富:例如可以使用 `==` 来判断某个字符串是否符合某个模式pattern,也可以使用 `<`、`>` 来判断两个字符串的出现顺序。 + +可以在 [Bash 表达式文档][5]中了解到双方括号支持的更多运算符。 + +### 下一集 + +在下一篇文章中,我们会开始介绍圆括号 `()` 在 Linux 命令行中的用法,敬请关注! + + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2 + +作者:[Paul Brown][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-brackets-3734552_1920.jpg?itok=hv9D6TBy "square brackets" +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 +[4]: https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash +[5]: https://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions +[6]: https://www.linux.com/blog/learn/2019/1/linux-tools-meaning-dot +[7]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash +[8]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash +[9]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux +[10]: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash +[11]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash + From 5752ba4bf47d2bd7de79391b401ac5909b1b30b9 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:46:26 +0800 Subject: [PATCH 0002/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20HTTP?= =?UTF-8?q?ie=20=E2=80=93=20A=20Modern=20Command=20Line=20HTTP=20Client=20?= =?UTF-8?q?For=20Curl=20And=20Wget=20Alternative=20sources/tech/20190417?= =?UTF-8?q?=20HTTPie=20-=20A=20Modern=20Command=20Line=20HTTP=20Client=20F?= =?UTF-8?q?or=20Curl=20And=20Wget=20Alternative.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...TP Client For Curl And Wget Alternative.md | 312 ++++++++++++++++++ 1 file changed, 312 insertions(+) create mode 100644 sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md diff --git a/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md new file mode 100644 index 0000000000..46298a6fa0 --- /dev/null +++ b/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -0,0 +1,312 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative) +[#]: via: (https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative +====== + +Most of the time we use Curl Command or Wget Command for file download and other purpose. + +We had written **[best command line download manager][1]** in the past. You can navigate those articles by clicking the corresponding URLs. + + * **[aria2 – A Command Line Multi-Protocol Download Tool For Linux][2]** + * **[Axel – A Lightweight Command Line Download Accelerator For Linux][3]** + * **[Wget – A Standard Command Line Download Utility For Linux][4]** + * **[curl – A Nifty Command Line Download Tool For Linux][5]** + + + +Today we are going to discuss about the same kind of topic. The utility name is HTTPie. + +It’s modern command line http client and best alternative for curl and wget commands. + +### What Is HTTPie? + +HTTPie (pronounced aitch-tee-tee-pie) is a command line HTTP client. + +The httpie tool is a modern command line http client which makes CLI interaction with web services. + +It provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized output. + +HTTPie can be used for testing, debugging, and generally interacting with HTTP servers. + +### Main Features + + * Expressive and intuitive syntax + * Formatted and colorized terminal output + * Built-in JSON support + * Forms and file uploads + * HTTPS, proxies, and authentication + * Arbitrary request data + * Custom headers + * Persistent sessions + * Wget-like downloads + * Python 2.7 and 3.x support + + + +### How To Install HTTPie In Linux? + +Most Linux distributions provide a package that can be installed using the system package manager. + +For **`Fedora`** system, use **[DNF Command][6]** to install httpie. + +``` +$ sudo dnf install httpie +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][7]** or **[APT Command][8]** to install httpie. + +``` +$ sudo apt install httpie +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install httpie. + +``` +$ sudo pacman -S httpie +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][10]** to install httpie. + +``` +$ sudo yum install httpie +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][11]** to install httpie. + +``` +$ sudo zypper install httpie +``` + +### 1) How To Request A URL Using HTTPie? + +The basic usage of httpie is to request a website URL as an argument. + +``` +# http 2daygeek.com +HTTP/1.1 301 Moved Permanently +CF-RAY: 4c4a618d0c02ce6d-LHR +Cache-Control: max-age=3600 +Connection: keep-alive +Date: Tue, 09 Apr 2019 06:21:28 GMT +Expires: Tue, 09 Apr 2019 07:21:28 GMT +Location: https://2daygeek.com/ +Server: cloudflare +Transfer-Encoding: chunked +Vary: Accept-Encoding +``` + +### 2) How To Download A File Using HTTPie? + +You can download a file using HTTPie with the `--download` parameter. This is similar to wget command. + +``` +# http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png +HTTP/1.1 200 OK +Accept-Ranges: bytes +CF-Cache-Status: HIT +CF-RAY: 4c4a65d5ca360a66-LHR +Cache-Control: public, max-age=7200 +Connection: keep-alive +Content-Length: 32066 +Content-Type: image/png +Date: Tue, 09 Apr 2019 06:24:23 GMT +Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" +Expires: Tue, 09 Apr 2019 08:24:23 GMT +Last-Modified: Mon, 08 Apr 2019 04:54:25 GMT +Server: cloudflare +Set-Cookie: __cfduid=dd2034b2f95ae42047e082f59f2b964f71554791063; expires=Wed, 08-Apr-20 06:24:23 GMT; path=/; domain=.2daygeek.com; HttpOnly; Secure +Vary: Accept-Encoding + +Downloading 31.31 kB to "Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png" +Done. 31.31 kB in 0.01187s (2.58 MB/s) +``` + +Alternatively you can save the output file with different name by using `-o` parameter. + +``` +# http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png -o Anbox-1.png +HTTP/1.1 200 OK +Accept-Ranges: bytes +CF-Cache-Status: HIT +CF-RAY: 4c4a68194daa0a66-LHR +Cache-Control: public, max-age=7200 +Connection: keep-alive +Content-Length: 32066 +Content-Type: image/png +Date: Tue, 09 Apr 2019 06:25:56 GMT +Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" +Expires: Tue, 09 Apr 2019 08:25:56 GMT +Last-Modified: Mon, 08 Apr 2019 04:54:25 GMT +Server: cloudflare +Set-Cookie: __cfduid=d3eea753081690f9a2d36495a74407dd71554791156; expires=Wed, 08-Apr-20 06:25:56 GMT; path=/; domain=.2daygeek.com; HttpOnly; Secure +Vary: Accept-Encoding + +Downloading 31.31 kB to "Anbox-1.png" +Done. 31.31 kB in 0.01551s (1.97 MB/s) +``` + +### 3) How To Resume Partial Download Using HTTPie? + +You can resume the download using HTTPie with the `-c` parameter. + +``` +# http --download --continue https://speed.hetzner.de/100MB.bin -o 100MB.bin +HTTP/1.1 206 Partial Content +Connection: keep-alive +Content-Length: 100442112 +Content-Range: bytes 4415488-104857599/104857600 +Content-Type: application/octet-stream +Date: Tue, 09 Apr 2019 06:32:52 GMT +ETag: "5253f0fd-6400000" +Last-Modified: Tue, 08 Oct 2013 11:48:13 GMT +Server: nginx +Strict-Transport-Security: max-age=15768000; includeSubDomains + +Downloading 100.00 MB to "100MB.bin" + | 24.14 % 24.14 MB 1.12 MB/s 0:01:07 ETA^C +``` + +You can verify the same in the below output. + +``` +[email protected]:/var/log# ls -lhtr 100MB.bin +-rw-r--r-- 1 root root 25M Apr 9 01:33 100MB.bin +``` + +### 5) How To Upload A File Using HTTPie? + +You can upload a file using HTTPie with the `less-than symbol "<"` symbol. + +``` +$ http https://transfer.sh < Anbox-1.png +``` + +### 6) How To Download A File Using HTTPie With Redirect Symbol ">"? + +You can download a file using HTTPie with the `redirect ">"` symbol. + +``` +# http https://www.2daygeek.com/wp-content/uploads/2019/03/How-To-Install-And-Enable-Flatpak-Support-On-Linux-1.png > Flatpak.png + +# ls -ltrh Flatpak.png +-rw-r--r-- 1 root root 47K Apr 9 01:44 Flatpak.png +``` + +### 7) Send a HTTP GET Method? + +You can send a HTTP GET method in the request. The GET method is used to retrieve information from the given server using a given URI. + +``` +# http GET httpie.org +HTTP/1.1 301 Moved Permanently +CF-RAY: 4c4a83a3f90dcbe6-SIN +Cache-Control: max-age=3600 +Connection: keep-alive +Date: Tue, 09 Apr 2019 06:44:44 GMT +Expires: Tue, 09 Apr 2019 07:44:44 GMT +Location: https://httpie.org/ +Server: cloudflare +Transfer-Encoding: chunked +Vary: Accept-Encoding +``` + +### 8) Submit A Form? + +Use the following format to Submit a forms. A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms. + +``` +# http -f POST Ubuntu18.2daygeek.com hello='World' +HTTP/1.1 200 OK +Accept-Ranges: bytes +Connection: Keep-Alive +Content-Encoding: gzip +Content-Length: 3138 +Content-Type: text/html +Date: Tue, 09 Apr 2019 06:48:12 GMT +ETag: "2aa6-5844bf1b047fc-gzip" +Keep-Alive: timeout=5, max=100 +Last-Modified: Sun, 17 Mar 2019 15:29:55 GMT +Server: Apache/2.4.29 (Ubuntu) +Vary: Accept-Encoding +``` + +Run the following command to see the request that is being sent. + +``` +# http -v Ubuntu18.2daygeek.com +GET / HTTP/1.1 +Accept: */* +Accept-Encoding: gzip, deflate +Connection: keep-alive +Host: ubuntu18.2daygeek.com +User-Agent: HTTPie/0.9.8 + +hello=World + +HTTP/1.1 200 OK +Accept-Ranges: bytes +Connection: Keep-Alive +Content-Encoding: gzip +Content-Length: 3138 +Content-Type: text/html +Date: Tue, 09 Apr 2019 06:48:30 GMT +ETag: "2aa6-5844bf1b047fc-gzip" +Keep-Alive: timeout=5, max=100 +Last-Modified: Sun, 17 Mar 2019 15:29:55 GMT +Server: Apache/2.4.29 (Ubuntu) +Vary: Accept-Encoding +``` + +### 9) HTTP Authentication? + +The currently supported authentication schemes are Basic and Digest + +Basic auth + +``` +$ http -a username:password example.org +``` + +Digest auth + +``` +$ http -A digest -a username:password example.org +``` + +Password prompt + +``` +$ http -a username example.org +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/ + +作者:[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/best-4-command-line-download-managers-accelerators-for-linux/ +[2]: https://www.2daygeek.com/aria2-linux-command-line-download-utility-tool/ +[3]: https://www.2daygeek.com/axel-linux-command-line-download-accelerator/ +[4]: https://www.2daygeek.com/wget-linux-command-line-download-utility-tool/ +[5]: https://www.2daygeek.com/curl-linux-command-line-download-manager/ +[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From d1bd15536a71101f8096bdbcc19108bfabaf064a Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:46:37 +0800 Subject: [PATCH 0003/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Kube?= =?UTF-8?q?rnetes=20on=20Fedora=20IoT=20with=20k3s=20sources/tech/20190415?= =?UTF-8?q?=20Kubernetes=20on=20Fedora=20IoT=20with=20k3s.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...90415 Kubernetes on Fedora IoT with k3s.md | 211 ++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md diff --git a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md new file mode 100644 index 0000000000..5650e80aee --- /dev/null +++ b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md @@ -0,0 +1,211 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kubernetes on Fedora IoT with k3s) +[#]: via: (https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/) +[#]: author: (Lennart Jern https://fedoramagazine.org/author/lennartj/) + +Kubernetes on Fedora IoT with k3s +====== + +![][1] + +Fedora IoT is an upcoming Fedora edition targeted at the Internet of Things. It was introduced last year on Fedora Magazine in the article [How to turn on an LED with Fedora IoT][2]. Since then, it has continued to improve together with Fedora Silverblue to provide an immutable base operating system aimed at container-focused workflows. + +Kubernetes is an immensely popular container orchestration system. It is perhaps most commonly used on powerful hardware handling huge workloads. However, it can also be used on lightweight devices such as the Raspberry Pi 3. Read on to find out how. + +### Why Kubernetes? + +While Kubernetes is all the rage in the cloud, it may not be immediately obvious to run it on a small single board computer. But there are certainly reasons for doing it. First of all it is a great way to learn and get familiar with Kubernetes without the need for expensive hardware. Second, because of its popularity, there are [tons of applications][3] that comes pre-packaged for running in Kubernetes clusters. Not to mention the large community to provide help if you ever get stuck. + +Last but not least, container orchestration may actually make things easier, even at the small scale in a home lab. This may not be apparent when tackling the the learning curve, but these skills will help when dealing with any cluster in the future. It doesn’t matter if it’s a single node Raspberry Pi cluster or a large scale machine learning farm. + +#### K3s – a lightweight Kubernetes + +A “normal” installation of Kubernetes (if such a thing can be said to exist) is a bit on the heavy side for IoT. The recommendation is a minimum of 2 GB RAM per machine! However, there are plenty of alternatives, and one of the newcomers is [k3s][4] – a lightweight Kubernetes distribution. + +K3s is quite special in that it has replaced etcd with SQLite for its key-value storage needs. Another thing to note is that k3s ships as a single binary instead of one per component. This diminishes the memory footprint and simplifies the installation. Thanks to the above, k3s should be able to run k3s with just 512 MB of RAM, perfect for a small single board computer! + +### What you will need + + 1. Fedora IoT in a virtual machine or on a physical device. See the excellent getting started guide [here][5]. One machine is enough but two will allow you to test adding more nodes to the cluster. + 2. [Configure the firewall][6] to allow traffic on ports 6443 and 8472. Or simply disable it for this experiment by running “systemctl stop firewalld”. + + + +### Install k3s + +Installing k3s is very easy. Simply run the installation script: + +``` +curl -sfL https://get.k3s.io | sh - +``` + +This will download, install and start up k3s. After installation, get a list of nodes from the server by running the following command: + +``` +kubectl get nodes +``` + +Note that there are several options that can be passed to the installation script through environment variables. These can be found in the [documentation][7]. And of course, there is nothing stopping you from installing k3s manually by downloading the binary directly. + +While great for experimenting and learning, a single node cluster is not much of a cluster. Luckily, adding another node is no harder than setting up the first one. Just pass two environment variables to the installation script to make it find the first node and avoid running the server part of k3s + +``` +curl -sfL https://get.k3s.io | K3S_URL=https://example-url:6443 \ + K3S_TOKEN=XXX sh - +``` + +The example-url above should be replaced by the IP address or fully qualified domain name of the first node. On that node the token (represented by XXX) is found in the file /var/lib/rancher/k3s/server/node-token. + +### Deploy some containers + +Now that we have a Kubernetes cluster, what can we actually do with it? Let’s start by deploying a simple web server. + +``` +kubectl create deployment my-server --image nginx +``` + +This will create a [Deployment][8] named “my-server” from the container image “nginx” (defaulting to docker hub as registry and the latest tag). You can see the Pod created by running the following command. + +``` +kubectl get pods +``` + +In order to access the nginx server running in the pod, first expose the Deployment through a [Service][9]. The following command will create a Service with the same name as the deployment. + +``` +kubectl expose deployment my-server --port 80 +``` + +The Service works as a kind of load balancer and DNS record for the Pods. For instance, when running a second Pod, we will be able to _curl_ the nginx server just by specifying _my-server_ (the name of the Service). See the example below for how to do this. + +``` +# Start a pod and run bash interactively in it +kubectl run debug --generator=run-pod/v1 --image=fedora -it -- bash +# Wait for the bash prompt to appear +curl my-server +# You should get the "Welcome to nginx!" page as output +``` + +### Ingress controller and external IP + +By default, a Service only get a ClusterIP (only accessible inside the cluster), but you can also request an external IP for the service by setting its type to [LoadBalancer][10]. However, not all applications require their own IP address. Instead, it is often possible to share one IP address among many services by routing requests based on the host header or path. You can accomplish this in Kubernetes with an [Ingress][11], and this is what we will do. Ingresses also provide additional features such as TLS encryption of the traffic without having to modify your application. + +Kubernetes needs an ingress controller to make the Ingress resources work and k3s includes [Traefik][12] for this purpose. It also includes a simple service load balancer that makes it possible to get an external IP for a Service in the cluster. The [documentation][13] describes the service like this: + +> k3s includes a basic service load balancer that uses available host ports. If you try to create a load balancer that listens on port 80, for example, it will try to find a free host in the cluster for port 80. If no port is available the load balancer will stay in Pending. +> +> k3s README + +The ingress controller is already exposed with this load balancer service. You can find the IP address that it is using with the following command. + +``` +$ kubectl get svc --all-namespaces +NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE + default kubernetes ClusterIP 10.43.0.1 443/TCP 33d + default my-server ClusterIP 10.43.174.38 80/TCP 30m + kube-system kube-dns ClusterIP 10.43.0.10 53/UDP,53/TCP,9153/TCP 33d + kube-system traefik LoadBalancer 10.43.145.104 10.0.0.8 80:31596/TCP,443:31539/TCP 33d +``` + +Look for the Service named traefik. In the above example the IP we are interested in is 10.0.0.8. + +### Route incoming requests + +Let’s create an Ingress that routes requests to our web server based on the host header. This example uses [xip.io][14] to avoid having to set up DNS records. It works by including the IP adress as a subdomain, to use any subdomain of 10.0.0.8.xip.io to reach the IP 10.0.0.8. In other words, my-server.10.0.0.8.xip.io is used to reach the ingress controller in the cluster. You can try this right now (with your own IP instead of 10.0.0.8). Without an ingress in place you should reach the “default backend” which is just a page showing “404 page not found”. + +We can tell the ingress controller to route requests to our web server Service with the following Ingress. + +``` +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: my-server +spec: + rules: + - host: my-server.10.0.0.8.xip.io + http: + paths: + - path: / + backend: + serviceName: my-server + servicePort: 80 +``` + +Save the above snippet in a file named _my-ingress.yaml_ and add it to the cluster by running this command: + +``` +kubectl apply -f my-ingress.yaml +``` + +You should now be able to reach the default nginx welcoming page on the fully qualified domain name you chose. In my example this would be my-server.10.0.0.8.xip.io. The ingress controller is routing the requests based on the information in the Ingress. A request to my-server.10.0.0.8.xip.io will be routed to the Service and port defined as backend in the Ingress (my-server and 80 in this case). + +### What about IoT then? + +Imagine the following scenario. You have dozens of devices spread out around your home or farm. It is a heterogeneous collection of IoT devices with various hardware capabilities, sensors and actuators. Maybe some of them have cameras, weather or light sensors. Others may be hooked up to control the ventilation, lights, blinds or blink LEDs. + +In this scenario, you want to gather data from all the sensors, maybe process and analyze it before you finally use it to make decisions and control the actuators. In addition to this, you may want to visualize what’s going on by setting up a dashboard. So how can Kubernetes help us manage something like this? How can we make sure that Pods run on suitable devices? + +The simple answer is labels. You can label the nodes according to capabilities, like this: + +``` +kubectl label nodes = +# Example +kubectl label nodes node2 camera=available +``` + +Once they are labeled, it is easy to select suitable nodes for your workload with [nodeSelectors][15]. The final piece to the puzzle, if you want to run your Pods on _all_ suitable nodes is to use [DaemonSets][16] instead of Deployments. In other words, create one DaemonSet for each data collecting application that uses some unique sensor and use nodeSelectors to make sure they only run on nodes with the proper hardware. + +The service discovery feature that allows Pods to find each other simply by Service name makes it quite easy to handle these kinds of distributed systems. You don’t need to know or configure IP addresses or custom ports for the applications. Instead, they can easily find each other through named Services in the cluster. + +#### Utilize spare resources + +With the cluster up and running, collecting data and controlling your lights and climate control you may feel that you are finished. However, there are still plenty of compute resources in the cluster that could be used for other projects. This is where Kubernetes really shines. + +You shouldn’t have to worry about where exactly those resources are or calculate if there is enough memory to fit an extra application here or there. This is exactly what orchestration solves! You can easily deploy more applications in the cluster and let Kubernetes figure out where (or if) they will fit. + +Why not run your own [NextCloud][17] instance? Or maybe [gitea][18]? You could also set up a CI/CD pipeline for all those IoT containers. After all, why would you build and cross compile them on your main computer if you can do it natively in the cluster? + +The point here is that Kubernetes makes it easier to make use of the “hidden” resources that you often end up with otherwise. Kubernetes handles scheduling of Pods in the cluster based on available resources and fault tolerance so that you don’t have to. However, in order to help Kubernetes make reasonable decisions you should definitely add [resource requests][19] to your workloads. + +### Summary + +While Kubernetes, or container orchestration in general, may not usually be associated with IoT, it certainly makes a lot of sense to have an orchestrator when you are dealing with distributed systems. Not only does is allow you to handle a diverse and heterogeneous fleet of devices in a unified way, but it also simplifies communication between them. In addition, Kubernetes makes it easier to utilize spare resources. + +Container technology made it possible to build applications that could “run anywhere”. Now Kubernetes makes it easier to manage the “anywhere” part. And as an immutable base to build it all on, we have Fedora IoT. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/ + +作者:[Lennart Jern][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/lennartj/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/k3s-1-816x345.png +[2]: https://fedoramagazine.org/turnon-led-fedora-iot/ +[3]: https://hub.helm.sh/ +[4]: https://k3s.io +[5]: https://docs.fedoraproject.org/en-US/iot/getting-started/ +[6]: https://github.com/rancher/k3s#open-ports--network-security +[7]: https://github.com/rancher/k3s#systemd +[8]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[9]: https://kubernetes.io/docs/concepts/services-networking/service/ +[10]: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer +[11]: https://kubernetes.io/docs/concepts/services-networking/ingress/ +[12]: https://traefik.io/ +[13]: https://github.com/rancher/k3s/blob/master/README.md#service-load-balancer +[14]: http://xip.io/ +[15]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +[16]: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ +[17]: https://nextcloud.com/ +[18]: https://gitea.io/en-us/ +[19]: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ From c515cf9e3d57492cf38c8e63ac59df49fd56d9c6 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:46:48 +0800 Subject: [PATCH 0004/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Linu?= =?UTF-8?q?x=20Server=20Hardening=20Using=20Idempotency=20with=20Ansible:?= =?UTF-8?q?=20Part=203=20sources/tech/20190416=20Linux=20Server=20Hardenin?= =?UTF-8?q?g=20Using=20Idempotency=20with=20Ansible-=20Part=203.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Using Idempotency with Ansible- Part 3.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md diff --git a/sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md b/sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md new file mode 100644 index 0000000000..50f4981c08 --- /dev/null +++ b/sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Server Hardening Using Idempotency with Ansible: Part 3) +[#]: via: (https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-3) +[#]: author: (Chris Binnie https://www.linux.com/users/chrisbinnie) + +Linux Server Hardening Using Idempotency with Ansible: Part 3 +====== + +![][1] + +[Creative Commons Zero][2] + +In the previous articles, we introduced idempotency as a way to approach your server’s security posture and looked at some specific Ansible examples, including the kernel, system accounts, and IPtables. In this final article of the series, we’ll look at a few more server-hardening examples and talk a little more about how the idempotency playbook might be used. + +#### **Time** + +Due to its reduced functionality, and therefore attack surface, the preference amongst a number of OSs has been to introduce “chronyd” over “ntpd”. If you’re new to “chrony” then fret not. It’s still using the NTP (Network Time Protocol) that we all know and love but in a more secure fashion. + +The first thing I do with Ansible within the “chrony.conf” file is alter the “bind address” and if my memory serves there’s also a “command port” option. These config options allow Chrony to only listen on the localhost. In other words you are still syncing as usual with other upstream time servers (just as NTP does) but no remote servers can query your time services; only your local machine has access. + +There’s more information on the “bindcmdaddress 127.0.0.1” and “cmdport 0” on this Chrony page () under “2.5. How can I make chronyd more secure?” which you should read for clarity. This premise behind the comment on that page is a good idea: “you can disable the internet command sockets completely by adding cmdport 0 to the configuration file”. + +Additionally I would also focus on securing the file permissions for Chrony and insist that the service starts as expected just like the syslog config above. Otherwise make sure that your time sources are sane, have a degree of redundancy with multiple sources set up and then copy the whole config file over using Ansible. + +#### **Logging** + +You can clearly affect the level of detail included in the logs from a number pieces of software on a server. Thinking back to what we’ve looked at in relation to syslog already you can also tweak that application’s config using Ansible to your needs and then use the example Ansible above in addition. + +#### **PAM** + +Apparently PAM (Pluggable Authentication Modules) has been a part of Linux since 1997. It is undeniably useful (a common use is that you can force SSH to use it for password logins, as per the SSH YAML file above). It is extensible, sophisticated and can perform useful functions such as preventing brute force attacks on password logins using a clever rate limiting system. The syntax varies a little between OSes but if you have the time then getting PAM working well (even if you’re only using SSH keys and not passwords for your logins) is a worthwhile effort. Attackers like their own users on a system with lots of usernames, something innocuous such as “webadmin” or similar might be easy to miss on a server, and PAM can help you out in this respect. + +#### **Auditd** + +We’ve looked at logging a little already but what about capturing every “system call” that a kernel makes. The Linux kernel is a super-busy component of any system and logging almost every single thing that a system does is an excellent way of providing post-event forensics. This article will hopefully shed some light on where to begin: . Note the comments in that article about performance, there’s little point in paying extra for compute and disk IO resource because you’ve misconfigured your logging so spend some time getting it correct would be my advice. + +For concerns over disk space I will usually change a few lines in the file “/etc/audit/auditd.conf” in order to prevent there firstly being too many log files created and secondly logs that grow very large without being rotated. This is also on the proviso that logs are being ingested upstream via another mechanism too. Clearly the files permissions and the service starting are also the basics you need to cover here too. Generally file permissions for auditd are tight as it’s a “root” oriented service so there’s less changes needed here generally. + +#### **Filesystems** + +With a little reading you can discover which filesystems that are made available to your OS by default. You should disable these (at the “modprode.d” file level) with Ansible to prevent weird and wonderful things being attached unwittingly to your servers. You are reducing the attack surface with this approach. The Ansible might look something like this below for example. + +``` +name: Make sure filesystems which are not needed are forced as off + +lineinfile: dest="/etcmodprobe.d/harden.conf" line='install squashfs /bin/true' state=present +``` + +#### **SELinux** + +The old, but sometimes avoided due to complexity, security favourite, SELinux, should be set to “enforcing” mode. Or, at the every least, set to log sensibly using “permissive” mode. Permissive mode will at least fill your auditd logs up with any correct rule matches nicely. In terms of what Ansible looks like it’s simple and is along these lines: + +``` +name: Configure SElinux to be running in permissive mode + +replace: path=”/etc/selinux/config” regexp='SELINUX=disabled' replace='SELINUX=permissive' +``` + +#### **Packages** + +Needless to say the compliance hardening playbook is also a good place to upgrade all the packages (with some selective exclusions) on the system. Pay attention to the section relating to reboots and idempotency in a moment however. With other mechanisms in place you might not want to update packages here but instead as per the Automation Documents article mentioned in a moment. + +### **Idempotency** + +Now we’ve run through some of the aspects you would want to look at when hardening on a server, let’s think a little more about how the playbook might be used. + +When it comes to cloud platforms most of my professional work has been on AWS and therefore, more often than not, a fresh AMI is launched and then a playbook is run over the top of it. There’s a mountain of detail in one way of doing that in this article () which you may be pleased to discover accommodates a mechanism to spawn a script or playbook. + +It is important to note, when it comes to idempotency, that it may take a little more effort initially to get your head around the logic involved in being able to re-run Ansible repeatedly without disturbing the required status quo of your server estate. + +One thing to be absolutely certain of however (barring rare edge cases) is that after you apply your hardening for the very first time, on a new AMI or server build, you will require a reboot. This is an important element due to a number of system facets not being altered correctly without a reboot. These include applying kernel changes so alterations become live, writing auditd rules as immutable config and also starting or stopping services to improve the security posture. + +Note though that you’re probably not going to want to execute all plays in a playbook every twenty or thirty minutes, such as updating all packages and stopping and restarting key customer-facing services. As a result you should factor the logic into your Ansible so that some tasks only run once initially and then maybe write a “completed” placeholder file to the filesystem afterwards for referencing. There’s a million different ways of achieving a status checker. + +The nice thing about Ansible is that the logic for rerunning playbooks is implicit and unlike shell scripts which for this type of task can be arduous to code the logic into. Sometimes, such as updating the GRUB bootloader for example, trying to guess the many permutations of a system change can be painful. + +### **Bedtime Reading** + +I still think that you can’t beat trial and error when it comes to computing. Experience is valued for good reason. + +Be warned that you’ll find contradictory advice sometimes from the vast array of online resources in this area. Advice differs probably because of the different use cases. The only way to harden the varying flavours of OS to my mind is via a bespoke approach. This is thanks to the environments that servers are used within and the requirements of the security framework or standard that an organisation needs to meet. + +For OS hardening details you can check with resources such as the NSA ([https://www.nsa.gov][3]), the Cloud Security Alliance (), proprietary training organisations such as GIAC ([https://www.giac.org][4]) who offer resources (), the diverse CIS Benchmarks ([https://www.cisecurity.org][5]) for industry consensus-based benchmarking, the SANS Institute (), NIST’s Computer Security Research ([https://csrc.nist.gov][6]) and of course print media too. + +### **Conclusion** + +Hopefully, you can see how powerful an idempotent server infrastructure is and are tempted to try it for yourself. + +The ever-present threat of APT (Advanced Persistent Threat) attacks on infrastructure, where a successful attacker will sit silently monitoring events and then when it’s opportune infiltrate deeper into an estate, makes this type of configuration highly valuable. + +The amount of detail that goes into the tests and configuration changes is key to the value that such an approach will bring to an organisation. Like the tests in a CI/CD pipeline they’re only as ever as good as their coverage. + +Chris Binnie’s latest book, Linux Server Security: Hack and Defend, shows you how to make your servers invisible and perform a variety of attacks. You can find out more about DevSecOps, containers and Linux security on his website: [https://www.devsecops.cc][7] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-3 + +作者:[Chris Binnie][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/chrisbinnie +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/tech-1495181_1280.jpg?itok=5WcwApNN +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.nsa.gov/ +[4]: https://www.giac.org/ +[5]: https://www.cisecurity.org/ +[6]: https://csrc.nist.gov/ +[7]: https://www.devsecops.cc/ From 0db46a2024eb5670599a9d855f9d0058e976d7e0 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:46:58 +0800 Subject: [PATCH 0005/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Trou?= =?UTF-8?q?bleshooting=20slow=20WiFi=20on=20Linux=20sources/tech/20190415?= =?UTF-8?q?=20Troubleshooting=20slow=20WiFi=20on=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0415 Troubleshooting slow WiFi on Linux.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sources/tech/20190415 Troubleshooting slow WiFi on Linux.md diff --git a/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md b/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md new file mode 100644 index 0000000000..52af44459a --- /dev/null +++ b/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md @@ -0,0 +1,39 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Troubleshooting slow WiFi on Linux) +[#]: via: (https://www.linux.com/blog/troubleshooting-slow-wifi-linux) +[#]: author: (OpenSource.com https://www.linux.com/USERS/OPENSOURCECOM) + +Troubleshooting slow WiFi on Linux +====== + +I'm no stranger to diagnosing hardware problems on [Linux systems][1]. Even though most of my professional work over the past few years has involved virtualization, I still enjoy crouching under desks and fumbling around with devices and memory modules. Well, except for the "crouching under desks" part. But none of that means that persistent and mysterious bugs aren't frustrating. I recently faced off against one of those bugs on my Ubuntu 18.04 workstation, which remained unsolved for months. + +Here, I'll share my problem and my many attempts to resolve it. Even though you'll probably never encounter my specific issue, the troubleshooting process might be helpful. And besides, you'll get to enjoy feeling smug at how much time and effort I wasted following useless leads. + +Read more at: [OpenSource.com][2] + +I'm no stranger to diagnosing hardware problems on [Linux systems][1]. Even though most of my professional work over the past few years has involved virtualization, I still enjoy crouching under desks and fumbling around with devices and memory modules. Well, except for the "crouching under desks" part. But none of that means that persistent and mysterious bugs aren't frustrating. I recently faced off against one of those bugs on my Ubuntu 18.04 workstation, which remained unsolved for months. + +Here, I'll share my problem and my many attempts to resolve it. Even though you'll probably never encounter my specific issue, the troubleshooting process might be helpful. And besides, you'll get to enjoy feeling smug at how much time and effort I wasted following useless leads. + +Read more at: [OpenSource.com][2] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/troubleshooting-slow-wifi-linux + +作者:[OpenSource.com][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/USERS/OPENSOURCECOM +[b]: https://github.com/lujun9972 +[1]: https://www.manning.com/books/linux-in-action?a_aid=bootstrap-it&a_bid=4ca15fc9&chan=opensource +[2]: https://opensource.com/article/19/4/troubleshooting-wifi-linux From 32fe47d1f95e97150a3ca5f644a53225bd9b2e83 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:47:14 +0800 Subject: [PATCH 0006/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Linu?= =?UTF-8?q?x=20Foundation=20Training=20Courses=20Sale=20&=20Discount=20Cou?= =?UTF-8?q?pon=20sources/tech/20190416=20Linux=20Foundation=20Training=20C?= =?UTF-8?q?ourses=20Sale=20-=20Discount=20Coupon.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Training Courses Sale - Discount Coupon.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md diff --git a/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md new file mode 100644 index 0000000000..04c1feb5ba --- /dev/null +++ b/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Foundation Training Courses Sale & Discount Coupon) +[#]: via: (https://itsfoss.com/linux-foundation-discount-coupon/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Linux Foundation Training Courses Sale & Discount Coupon +====== + +Linux Foundation is the non-profit organization that employs Linux creator Linus Torvalds and manages the development of the Linux kernel. Linux Foundation aims to promote the adoption of Linux and Open Source in the industry and it is doing a great job in this regard. + +Open Source jobs are in demand and no one knows is better than Linux Foundation, the official Linux organization. This is why the Linux Foundation provides a number of training and certification courses on Linux related technology. You can browse the [entire course offering on Linux Foundations’ training webpage][1]. + +### Linux Foundation Latest Offer: 40% off on all courses [Limited Time] + +At present Linux Foundation is offering some great offers for sysadmin, devops and cloud professionals. + +At present, Linux Foundation is offering massive discount of 40% on the entire range of their e-learning courses and certification bundles, including the growing catalog of cloud and devops e-learning courses like Kubernetes! + +Just use coupon code **APRIL40** at checkout to get your discount. + +[Linux Foundation 40% Off (Coupon Code APRIL40)][2] + +_Do note that this offer is valid till 22nd April 2019 only._ + +### Linux Foundation Discount Coupon [Valid all the time] + +You can get a 16% off on any training or certification course provided by The Linux Foundation at any given time. All you have to do is to use the coupon code **FOSS16** at the checkout page. + +Note that it might not be combined with sysadmin day offer. + +[Get 16% off on Linux Foundation Courses with FOSS16 Code][1] + +This article contains affiliate links. Please read our [affiliate policy][3]. + +#### Should you get certified? + +![][4] + +This is the question I have been asked regularly. Are Linux certifications worth it? The short answer is yes. + +As per the [open source jobs report in 2018][5], over 80% of open source professionals said that certifications helped with their careers. Certifications enable you to demonstrate technical knowledge to potential employers and thus certifications make you more employable in general. + +Almost half of the hiring managers said that employing certified open source professionals is a priority for them. + +Certifications from a reputed authority like Linux Foundation, Red Hat, LPIC etc are particularly helpful when you are a fresh graduate or if you want to switch to a new domain in your career. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-foundation-discount-coupon/ + +作者:[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://shareasale.com/u.cfm?d=507759&m=59485&u=747593&afftrack= +[2]: http://shrsl.com/1k5ug +[3]: https://itsfoss.com/affiliate-policy/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/linux-foundation-training-certification-discount.png?ssl=1 +[5]: https://www.linuxfoundation.org/publications/open-source-jobs-report-2018/ From 98791f80324dd11d02c065c763a95f5238c8395a Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:47:32 +0800 Subject: [PATCH 0007/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20How?= =?UTF-8?q?=20to=20Install=20MySQL=20in=20Ubuntu=20Linux=20sources/tech/20?= =?UTF-8?q?190416=20How=20to=20Install=20MySQL=20in=20Ubuntu=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...16 How to Install MySQL in Ubuntu Linux.md | 238 ++++++++++++++++++ 1 file changed, 238 insertions(+) create mode 100644 sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md diff --git a/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md new file mode 100644 index 0000000000..ee3a82ca03 --- /dev/null +++ b/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md @@ -0,0 +1,238 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install MySQL in Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-mysql-ubuntu/) +[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) + +How to Install MySQL in Ubuntu Linux +====== + +_**Brief: This tutorial teaches you to install MySQL in Ubuntu based Linux distributions. You’ll also learn how to verify your install and how to connect to MySQL for the first time.**_ + +**[MySQL][1]** is the quintessential database management system. It is used in many tech stacks, including the popular **[LAMP][2]** (Linux, Apache, MySQL, PHP) stack. It has proven its stability. Another thing that makes **MySQL** so great is that it is **open-source**. + +**MySQL** uses **relational databases** (basically **tabular data** ). It is really easy to store, organize and access data this way. For managing data, **SQL** ( **Structured Query Language** ) is used. + +In this article I’ll show you how to **install** and **use** MySQL 8.0 in Ubuntu 18.04. Let’s get to it! + +### Installing MySQL in Ubuntu + +![][3] + +I’ll be covering two ways you can install **MySQL** in Ubuntu 18.04: + + 1. Install MySQL from the Ubuntu repositories. Very basic, not the latest version (5.7) + 2. Install MySQL using the official repository. There is a bigger step that you’ll have to add to the process, but nothing to worry about. Also, you’ll have the latest version (8.0) + + + +When needed, I’ll provide screenshots to guide you. For most of this guide, I’ll be entering commands in the **terminal** ( **default hotkey** : CTRL+ALT+T). Don’t be scared of it! + +#### Method 1. Installing MySQL from the Ubuntu repositories + +First of all, make sure your repositories are updated by entering: + +``` +sudo apt update +``` + +Now, to install **MySQL 5.7** , simply type: + +``` +sudo apt install mysql-server -y +``` + +That’s it! Simple and efficient. + +#### Method 2. Installing MySQL using the official repository + +Although this method has a few more steps, I’ll go through them one by one and I’ll try writing down clear notes. + +The first step is browsing to the [download page][4] of the official MySQL website. + +![][5] + +Here, go down to the **download link** for the **DEB Package**. + +![][6] + +Scroll down past the info about Oracle Web and right-click on **No thanks, just start my download.** Select **Copy link location**. + +Now go back to the terminal. We’ll [use][7] **[Curl][7]** [command][7] to the download the package: + +``` +curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb +``` + +**** is the link I copied from the website. It might be different based on the current version of MySQL. Let’s use **dpkg** to start installing MySQL: + +``` +sudo dpkg -i mysql-apt-config* +``` + +Update your repositories: + +``` +sudo apt update +``` + +To actually install MySQL, we’ll use the same command as in the first method: + +``` +sudo apt install mysql-server -y +``` + +Doing so will open a prompt in your terminal for **package configuration**. Use the **down arrow** to select the **Ok** option. + +![][8] + +Press **Enter**. This should prompt you to enter a **password** :. Your are basically setting the root password for MySQL. Don’t confuse it with [root password of Ubuntu][9] system. + +![][10] + +Type in a password and press **Tab** to select **< Ok>**. Press **Enter.** You’ll now have to **re-enter** the **password**. After doing so, press **Tab** again to select **< Ok>**. Press **Enter**. + +![][11] + +Some **information** on configuring MySQL Server will be presented. Press **Tab** to select **< Ok>** and **Enter** again: + +![][12] + +Here you need to choose a **default authentication plugin**. Make sure **Use Strong Password Encryption** is selected. Press **Tab** and then **Enter**. + +That’s it! You have successfully installed MySQL. + +#### Verify your MySQL installation + +To **verify** that MySQL installed correctly, use: + +``` +sudo systemctl status mysql.service +``` + +This will show some information about the service: + +![][13] + +You should see **Active: active (running)** in there somewhere. If you don’t, use the following command to start the **service** : + +``` +sudo systemctl start mysql.service +``` + +#### Configuring/Securing MySQL + +For a new install, you should run the provided command for security-related updates. That’s: + +``` +sudo mysql_secure_installation +``` + +Doing so will first of all ask you if you want to use the **VALIDATE PASSWORD COMPONENT**. If you want to use it, you’ll have to select a minimum password strength ( **0 – Low, 1 – Medium, 2 – High** ). You won’t be able to input any password doesn’t respect the selected rules. If you don’t have the habit of using strong passwords (you should!), this could come in handy. If you think it might help, type in **y** or **Y** and press **Enter** , then choose a **strength level** for your password and input the one you want to use. If successful, you’ll continue the **securing** process; otherwise you’ll have to re-enter a password. + +If, however, you do not want this feature (I won’t), just press **Enter** or **any other key** to skip using it. + +For the other options, I suggest **enabling** them (typing in **y** or **Y** and pressing **Enter** for each of them). They are (in this order): **remove anonymous user, disallow root login remotely, remove test database and access to it, reload privilege tables now**. + +#### Connecting to & Disconnecting from the MySQL Server + +To be able to run SQL queries, you’ll first have to connect to the server using MySQL and use the MySQL prompt. The command for doing this is: + +``` +mysql -h host_name -u user -p +``` + + * **-h** is used to specify a **host name** (if the server is located on another machine; if it isn’t, just omit it) + * **-u** mentions the **user** + * **-p** specifies that you want to input a **password**. + + + +Although not recommended (for safety reasons), you can enter the password directly in the command by typing it in right after **-p**. For example, if the password for **test_user** is **1234** and you are trying to connect on the machine you are using, you could use: + +``` +mysql -u test_user -p1234 +``` + +If you successfully inputted the required parameters, you’ll be greeted by the **MySQL shell prompt** ( **mysql >**): + +![][14] + +To **disconnect** from the server and **leave** the mysql prompt, type: + +``` +QUIT +``` + +Typing **quit** (MySQL is case insensitive) or **\q** will also work. Press **Enter** to exit. + +You can also output info about the **version** with a simple command: + +``` +sudo mysqladmin -u root version -p +``` + +If you want to see a **list of options** , use: + +``` +mysql --help +``` + +#### Uninstalling MySQL + +If you decide that you want to use a newer release or just want to stop using MySQL. + +First, disable the service: + +``` +sudo systemctl stop mysql.service && sudo systemctl disable mysql.service +``` + +Make sure you backed up your databases, in case you want to use them later on. You can uninstall MySQL by running: + +``` +sudo apt purge mysql* +``` + +To clean up dependecies: + +``` +sudo apt autoremove +``` + +**Wrapping Up** + +In this article, I’ve covered **installing MySQL** in Ubuntu Linux. I’d be glad if this guide helps struggling users and beginners. + +Tell us in the comments if you found this post to be a useful resource. What do you use MySQL for? We’re eager to receive any feedback, impressions or suggestions. Thanks for reading and have don’t hesitate to experiment with this incredible tool! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-mysql-ubuntu/ + +作者:[Sergiu][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/sergiu/ +[b]: https://github.com/lujun9972 +[1]: https://www.mysql.com/ +[2]: https://en.wikipedia.org/wiki/LAMP_(software_bundle) +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-mysql-ubuntu.png?resize=800%2C450&ssl=1 +[4]: https://dev.mysql.com/downloads/repo/apt/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_apt_download_page.jpg?fit=800%2C280&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_deb_download_link.jpg?fit=800%2C507&ssl=1 +[7]: https://linuxhandbook.com/curl-command-examples/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_package_configuration_ok.jpg?fit=800%2C587&ssl=1 +[9]: https://itsfoss.com/change-password-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_enter_password.jpg?fit=800%2C583&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_information_on_configuring.jpg?fit=800%2C581&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_default_authentication_plugin.jpg?fit=800%2C586&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_service_information.jpg?fit=800%2C402&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_shell_prompt-2.jpg?fit=800%2C423&ssl=1 From bfa5835c255f02ff07fff75c64179e560f8d1631 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:47:44 +0800 Subject: [PATCH 0008/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=2012?= =?UTF-8?q?=20Single=20Board=20Computers:=20Alternative=20to=20Raspberry?= =?UTF-8?q?=20Pi=20sources/tech/20190415=2012=20Single=20Board=20Computers?= =?UTF-8?q?-=20Alternative=20to=20Raspberry=20Pi.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Computers- Alternative to Raspberry Pi.md | 354 ++++++++++++++++++ 1 file changed, 354 insertions(+) create mode 100644 sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md diff --git a/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md new file mode 100644 index 0000000000..c30c286142 --- /dev/null +++ b/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -0,0 +1,354 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) +[#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +12 Single Board Computers: Alternative to Raspberry Pi +====== + +_**Brief: Looking for a Raspberry Pi alternative? Here are some other single board computers to satisfy your DIY cravings.**_ + +Raspberry Pi is the most popular single board computer right now. You can use it for your DIY projects or can use it as a cost effective system to learn coding or maybe utilize a [media server software][1] on it to stream media at your convenience. + +You can do a lot of things with Raspberry Pi but it is not the ultimate solution for all kinds of tinkerers. Some might be looking for a cheaper board and some might be on the lookout for a powerful one. + +Whatever be the case, we do need Raspberry Pi alternatives for a variety of reasons. So, in this article, we will talk about the best ten single board computers that we think are the best Raspberry Pi alternatives. + +![][2] + +### Raspberry Pi alternatives to satisfy your DIY craving + +The list is in no particular order of ranking. Some of the links here are affiliate links. Please read our [affiliate policy][3]. + +#### 1\. Onion Omega2+ + +![][4] + +For just **$13** , the Omega2+ is one of the cheapest IoT single board computers you can find out there. It runs on LEDE (Linux Embedded Development Environment) Linux OS – a distribution based on [OpenWRT][5]. + +Its form factor, cost, and the flexibility that comes from running a customized version of Linux OS makes it a perfect fit for almost any type of IoT applications. + +You can find [Onion Omega kit on Amazon][6] or order from their own website that would cost you extra shipping charges. + +**Key Specifications** + + * MT7688 SoC + * 2.4 GHz IEEE 802.11 b/g/n WiFi + * 128 MB DDR2 RAM + * 32 MB on-board flash storage + * MicroSD Slot + * USB 2.0 + * 12 GPIO Pins + + + +[Visit WEBSITE +][7] + +#### 2\. NVIDIA Jetson Nano Developer Kit + +![][8] + +This is a very unique and interesting Raspberry Pi alternative from NVIDIA for just **$99**. Yes, it’s not something that everyone can make use of – but for a specific group of tinkerers or developers. + +NVIDIA explains it for the following use-case: + +> NVIDIA® Jetson Nano™ Developer Kit is a small, powerful computer that lets you run multiple neural networks in parallel for applications like image classification, object detection, segmentation, and speech processing. All in an easy-to-use platform that runs in as little as 5 watts. +> +> nvidia + +So, basically, if you are into AI and deep learning, you can make use of the developer kit. If you are curious, the production compute module of this will be arriving in June 2019. + +**Key Specifications:** + + * CPU: Quad-core ARM A57 @ 1.43 GHz + * GPU: 128-core Maxwell + * RAM: 4 GB 64-bit LPDDR4 25.6 GB/s + * Display: HDMI 2.0 + * 4 x USB 3.0 and eDP 1.4 + + + +[VISIT WEBSITE +][9] + +#### 3\. ASUS Tinker Board S + +![][10] + +ASUS Tinker Board S isn’t the most affordable Raspberry Pi alternative at **$82** (on [Amazon][11]) but it is a powerful alternative. It features the same 40-pin connector that you’d normally find in the standard Raspberry Pi 3 Model but offers a powerful processor and a GPU.Also, the size of the Tinker Board S is exactly the same as a standard Raspberry Pi 3. + +The main highlight of this board is the presence of 16 GB [eMMC][12] (in layman terms, it has got SSD-like storage on board that makes it faster while working on it). + +**Key Specifications:** + + * Rockchip Quad-Core RK3288 processor + * 2 GB DDR3 RAM + * Integrated Graphics Processor + * ARM® Mali™-T764 GPU + * 16 GB eMMC + * MicroSD Card Slot + * 802.11 b/g/n, Bluetooth V4.0 + EDR + * USB 2.0 + * 28 GPIO pins + * HDMI Interface + + + +[Visit website +][13] + +#### 4\. ClockworkPi + +![][14] + +Clockwork Pi is usually a part of the [GameShell Kit][15] if you are looking to assemble a modular retro gaming console. However, you can purchase the board separately for $49. + +Its compact size, WiFi connectivity, and the presence of micro HDMI port make it a great choice for a lot of things. + +**Key Specifications:** + + * Allwinner R16-J Quad-core Cortex-A7 CPU @1.2GHz + * Mali-400 MP2 GPU + * RAM: 1GB DDR3 + * WiFi & Bluetooth v4.0 + * Micro HDMI output + * MicroSD Card Slot + + + +[visit website +][16] + +#### 5\. Arduino Mega 2560 + +![][17] + +If you are into robotic projects or you want something for a 3D printer – Arduino Mega 2560 will be a handy replacement to Raspberry Pi. Unlike Raspberry Pi, it is based on a microcontroller and not a microprocessor. + +It would cost you $38.50 on their [official site][18] and and around [$33 on Amazon][19]. + +**Key Specifications:** + + * Microcontroller: ATmega2560 + * Clock Speed: 16 MHz + * Digital I/O Pins: 54 + * Analog Input Pins: 16 + * Flash Memory: 256 KB of which 8 KB used by bootloader + + + +[visit website +][18] + +#### 6\. Rock64 Media Board + +![][20] + +For the same investment as you would on a Raspberry Pi 3 B+, you will be getting a faster processor and double the memory on Rock64 Media Board. In addition, it also offers a cheaper alternative to Raspberry Pi if you want the 1 GB RAM model – which would cost $10 less. + +Unlike Raspberry Pi, you do not have wireless connectivity support here but the presence of USB 3.0 and HDMI 2.0 does make a good difference if that matters to you. + +**Key Specifications:** + + * Rockchip RK3328 Quad-Core ARM Cortex A53 64-Bit Processor + * Supports up to 4GB 1600MHz LPDDR3 RAM + * eMMC module socket + * MicroSD Card slot + * USB 3.0 + * HDMI 2.0 + + + +[visit website +][21] + +#### 7\. Odroid-XU4 + +![][22] + +Odroid-XU4 is the perfect alternative to Raspberry Pi if you have room to spend a little more ($80-$100 or even lower, depending on the store/availability). + +It is indeed a powerful replacement and technically a bit smaller in size. The support for eMMC and USB 3.0 makes it faster to work with. + +**Key Specifications:** + + * Samsung Exynos 5422 Octa ARM Cortex™-A15 Quad 2Ghz and Cortex™-A7 Quad 1.3GHz CPUs + * 2Gbyte LPDDR3 RAM + * GPU: Mali-T628 MP6 + * USB 3.0 + * HDMI 1.4a + * eMMC 5.0 module socket + * MicroSD Card Slot + + + +[visit website +][23] + +#### 8\. **PocketBeagle** + +![][24] + +It is an incredibly small SBC – almost similar to the Raspberry Pi Zero. However, it would cost you the same as that of a full-sized Raspberry Pi 3 model. The main highlight here is that you can use it as a USB key-fob and then access the Linux terminal to work on it. + +**Key Specifications:** + + * Processor: Octavo Systems OSD3358 1GHz ARM® Cortex-A8 + * RAM: 512 MB DDR3 + * 72 expansion pin headers + * microUSB + * USB 2.0 + + + +[visit website +][25] + +#### 9\. Le Potato + +![][26] + +Le Potato by [Libre Computer][27], also identified by its model number AML-S905X-CC. It would [cost you $45][28]. + +If you want double the memory along with HDMI 2.0 interface by spending a bit more than a Raspberry Pi – this would be the perfect choice. Although, you won’t find wireless connectivity baked in. + +**Key Specifications:** + + * Amlogic S905X SoC + * 2GB DDR3 SDRAM + * USB 2.0 + * HDMI 2.0 + * microUSB + * MicroSD Card Slot + * eMMC Interface + + + +[visit website +][29] + +#### 10\. Banana Pi M64 + +![][30] + +It comes loaded with 8 Gigs of eMMC – which is the key highlight of this Raspberry Pi alternative. For the very same reason, it would cost you $60. + +The presence of HDMI interface makes it 4K-ready. In addition, Banana Pi offers a lot more variety of open source SBCs as an alternative to Raspberry Pi. + +**Key Specifications:** + + * 1.2 Ghz Quad-Core ARM Cortex A53 64-Bit Processor-R18 + * 2GB DDR3 SDRAM + * 8 GB eMMC + * WiFi & Bluetooth + * USB 2.0 + * HDMI + + + +[visit website +][31] + +#### 11\. Orange Pi Zero + +![][32] + +The Orange Pi Zero is an incredibly cheap alternative to Raspberry Pi. You will be able to get it for almost $10 on Aliexpress or Amazon. For a [little more investment, you can get 512 MB RAM][33]. + +If that isn’t sufficient, you can also go for Orange Pi 3 with better specifications which will cost you around $25. + +**Key Specifications:** + + * H2 Quad-core Cortex-A7 + * Mali400MP2 GPU + * RAM: Up to 512 MB + * TF Card support + * WiFi + * USB 2.0 + + + +[Visit website +][34] + +#### 12\. VIM 2 SBC by Khadas + +![][35] + +VIM 2 by Khadas is one of the latest SBCs that you can grab with Bluetooth 5.0 on board. It [starts from $99 (the basic model) and goes up to $140][36]. + +The basic model includes 2 GB RAM, 16 GB eMMC and Bluetooth 4.1. However, the Pro/Max versions would include Bluetooth 5.0, more memory, and more eMMC storage. + +**Key Specifications:** + + * Amlogic S912 1.5GHz 64-bit Octa-Core CPU + * T820MP3 GPU + * Up to 3 GB DDR4 RAM + * Up to 64 GB eMMC + * Bluetooth 5.0 (Pro/Max) + * Bluetooth 4.1 (Basic) + * HDMI 2.0a + * WiFi + + + +**Wrapping Up** + +We do know that there are different types of single board computers. Some are better than Raspberry Pi – and some scaled down versions of it for a cheaper price tag. Also, SBCs like Jetson Nano have been tailored for a specific use. So, depending on what you require – you should verify the specifications of the single board computer. + +If you think that you know about something that is better than the ones mentioned above, feel free to let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-alternatives/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-linux-media-server/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-alternatives.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/affiliate-policy/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/omega-2-plus-e1555306748755-800x444.jpg?resize=800%2C444&ssl=1 +[5]: https://openwrt.org/ +[6]: https://amzn.to/2Xj8pkn +[7]: https://onion.io/store/omega2p/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Jetson-Nano-e1555306350976-800x590.jpg?resize=800%2C590&ssl=1 +[9]: https://developer.nvidia.com/embedded/buy/jetson-nano-devkit +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/asus-tinker-board-s-e1555304945760-800x450.jpg?resize=800%2C450&ssl=1 +[11]: https://amzn.to/2XfkOFT +[12]: https://en.wikipedia.org/wiki/MultiMediaCard +[13]: https://www.asus.com/in/Single-Board-Computer/Tinker-Board-S/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/clockwork-pi-e1555305016242-800x506.jpg?resize=800%2C506&ssl=1 +[15]: https://itsfoss.com/gameshell-console/ +[16]: https://www.clockworkpi.com/product-page/cpi-v3-1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/arduino-mega-2560-e1555305257633.jpg?ssl=1 +[18]: https://store.arduino.cc/usa/mega-2560-r3 +[19]: https://amzn.to/2KCi041 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ROCK64_board-e1555306092845-800x440.jpg?resize=800%2C440&ssl=1 +[21]: https://www.pine64.org/?product=rock64-media-board-computer +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/odroid-xu4.jpg?fit=800%2C354&ssl=1 +[23]: https://www.hardkernel.com/shop/odroid-xu4-special-price/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/PocketBeagle.jpg?fit=800%2C450&ssl=1 +[25]: https://beagleboard.org/p/products/pocketbeagle +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/aml-libre.-e1555306237972-800x514.jpg?resize=800%2C514&ssl=1 +[27]: https://libre.computer/ +[28]: https://amzn.to/2DpG3xl +[29]: https://libre.computer/products/boards/aml-s905x-cc/ +[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/banana-pi-m6.jpg?fit=800%2C389&ssl=1 +[31]: http://www.banana-pi.org/m64.html +[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/orange-pi-zero.jpg?fit=800%2C693&ssl=1 +[33]: https://amzn.to/2IlI81g +[34]: http://www.orangepi.org/orangepizero/index.html +[35]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/khadas-vim-2-e1555306505640-800x563.jpg?resize=800%2C563&ssl=1 +[36]: https://amzn.to/2UDvrFE From f388493920f45b52e3749824bf0833a65ee5a094 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:48:01 +0800 Subject: [PATCH 0009/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Buil?= =?UTF-8?q?ding=20a=20DNS-as-a-service=20with=20OpenStack=20Designate=20so?= =?UTF-8?q?urces/tech/20190416=20Building=20a=20DNS-as-a-service=20with=20?= =?UTF-8?q?OpenStack=20Designate.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...S-as-a-service with OpenStack Designate.md | 263 ++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md diff --git a/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md new file mode 100644 index 0000000000..2dc628a49c --- /dev/null +++ b/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -0,0 +1,263 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building a DNS-as-a-service with OpenStack Designate) +[#]: via: (https://opensource.com/article/19/4/getting-started-openstack-designate) +[#]: author: (Amjad Yaseen https://opensource.com/users/ayaseen) + +Building a DNS-as-a-service with OpenStack Designate +====== +Learn how to install and configure Designate, a multi-tenant +DNS-as-a-service (DNSaaS) for OpenStack. +![Command line prompt][1] + +[Designate][2] is a multi-tenant DNS-as-a-service that includes a REST API for domain and record management, a framework for integration with [Neutron][3], and integration support for Bind9. + +You would want to consider a DNSaaS for the following: + + * A clean REST API for managing zones and records + * Automatic records generated (with OpenStack integration) + * Support for multiple authoritative name servers + * Hosting multiple projects/organizations + + + +![Designate's architecture][4] + +This article explains how to manually install and configure the latest release of Designate service on CentOS or Red Hat Enterprise Linux 7 (RHEL 7), but you can use the same configuration on other distributions. + +### Install Designate on OpenStack + +I have Ansible roles for bind and Designate that demonstrate the setup in my [GitHub repository][5]. + +This setup presumes bind service is external (even though you can install bind locally) on the OpenStack controller node. + + 1. Install Designate's packages and bind (on OpenStack controller): [code]`# yum install openstack-designate-* bind bind-utils -y` +``` + 2. Create the Designate database and user: [code] MariaDB [(none)]> CREATE DATABASE designate CHARACTER SET utf8 COLLATE utf8_general_ci; + +MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO \ +'designate'@'localhost' IDENTIFIED BY 'rhlab123'; + +MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO 'designate'@'%' \ +IDENTIFIED BY 'rhlab123'; +``` + + + + +Note: Bind packages must be installed on the controller side for Remote Name Daemon Control (RNDC) to function properly. + +### Configure bind (DNS server) + + 1. Generate RNDC files: [code] rndc-confgen -a -k designate -c /etc/rndc.key -r /dev/urandom + +cat < etcrndc.conf +include "/etc/rndc.key"; +options { +default-key "designate"; +default-server {{ DNS_SERVER_IP }}; +default-port 953; +}; +EOF +``` + 2. Add the following into **named.conf** : [code]`include "/etc/rndc.key"; controls { inet {{ DNS_SERVER_IP }} allow { localhost;{{ CONTROLLER_SERVER_IP }}; } keys { "designate"; }; };`[/code] In the **option** section, add: [code] options { +... +allow-new-zones yes; +request-ixfr no; +listen-on port 53 { any; }; +recursion no; +allow-query { 127.0.0.1; {{ CONTROLLER_SERVER_IP }}; }; +}; [/code] Add the right permissions: [code] chown named:named /etc/rndc.key +chown named:named /etc/rndc.conf +chmod 600 /etc/rndc.key +chown -v root:named /etc/named.conf +chmod g+w /var/named + +# systemctl restart named +# setsebool named_write_master_zones 1 +``` + + 3. Push **rndc.key** and **rndc.conf** into the OpenStack controller: [code]`# scp -r /etc/rndc* {{ CONTROLLER_SERVER_IP }}:/etc/` +``` +## Create OpenStack Designate service and endpoints + +Enter: +``` + + +# openstack user create --domain default --password-prompt designate +# openstack role add --project services --user designate admin +# openstack service create --name designate --description "DNS" dns + +# openstack endpoint create --region RegionOne dns public http://{{ CONTROLLER_SERVER_IP }}:9001/ +# openstack endpoint create --region RegionOne dns internal http://{{ CONTROLLER_SERVER_IP }}:9001/ +# openstack endpoint create --region RegionOne dns admin http://{{ CONTROLLER_SERVER_IP }}:9001/ + +``` +## Configure Designate service + + 1. Edit **/etc/designate/designate.conf** : + * In the **[service:api]** section, configure **auth_strategy** : [code] [service:api] +listen = 0.0.0.0:9001 +auth_strategy = keystone +api_base_uri = http://{{ CONTROLLER_SERVER_IP }}:9001/ +enable_api_v2 = True +enabled_extensions_v2 = quotas, reports +``` + * In the **[keystone_authtoken]** section, configure the following options: [code] [keystone_authtoken] +auth_type = password +username = designate +password = rhlab123 +project_name = service +project_domain_name = Default +user_domain_name = Default +www_authenticate_uri = http://{{ CONTROLLER_SERVER_IP }}:5000/ +auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000/ +``` + * In the **[service:worker]** section, enable the worker model: [code] enabled = True +notify = True +``` + * In the **[storage:sqlalchemy]** section, configure database access: [code] [storage:sqlalchemy] +connection = mysql+pymysql://designate:rhlab123@{{ CONTROLLER_SERVER_IP }}/designate +``` +* Populate the Designate database: [code]`# su -s /bin/sh -c "designate-manage database sync" designate` +``` + + + 2. Create Designate's **pools.yaml** file (has target and bind details): + * Edit **/etc/designate/pools.yaml** : [code] - name: default +# The name is immutable. There will be no option to change the name after +# creation and the only way will to change it will be to delete it +# (and all zones associated with it) and recreate it. +description: Default Pool + +attributes: {} + +# List out the NS records for zones hosted within this pool +# This should be a record that is created outside of designate, that +# points to the public IP of the controller node. +ns_records: +\- hostname: {{Controller_FQDN}}. # Thisis mDNS +priority: 1 + +# List out the nameservers for this pool. These are the actual BIND servers. +# We use these to verify changes have propagated to all nameservers. +nameservers: +\- host: {{ DNS_SERVER_IP }} +port: 53 + +# List out the targets for this pool. For BIND there will be one +# entry for each BIND server, as we have to run rndc command on each server +targets: +\- type: bind9 +description: BIND9 Server 1 + +# List out the designate-mdns servers from which BIND servers should +# request zone transfers (AXFRs) from. +# This should be the IP of the controller node. +# If you have multiple controllers you can add multiple masters +# by running designate-mdns on them, and adding them here. +masters: +\- host: {{ CONTROLLER_SERVER_IP }} +port: 5354 + +# BIND Configuration options +options: +host: {{ DNS_SERVER_IP }} +port: 53 +rndc_host: {{ DNS_SERVER_IP }} +rndc_port: 953 +rndc_key_file: /etc/rndc.key +rndc_config_file: /etc/rndc.conf +``` +* Populate Designate's pools: [code]`su -s /bin/sh -c "designate-manage pool update" designate` +``` + + + + 3. Start Designate central and API services: [code]`systemctl enable --now designate-central designate-api` +``` + 4. Verify Designate's services are up: [code] # openstack dns service list + ++--------------+--------+-------+--------------+ +| service_name | status | stats | capabilities | ++--------------+--------+-------+--------------+ +| central | UP | - | - | +| api | UP | - | - | +| mdns | UP | - | - | +| worker | UP | - | - | +| producer | UP | - | - | ++--------------+--------+-------+--------------+ +``` + + + + +### Configure OpenStack Neutron with external DNS + + 1. Configure iptables for Designate services: [code] # iptables -I INPUT -p tcp -m multiport --dports 9001 -m comment --comment "designate incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 5354 -m comment --comment "Designate mdns incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 53 -m comment --comment "bind incoming" -j ACCEPT + + +# iptables -I INPUT -p udp -m multiport --dports 53 -m comment --comment "bind/powerdns incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 953 -m comment --comment "rndc incoming - bind only" -j ACCEPT + +# service iptables save; service iptables restart +# setsebool named_write_master_zones 1 +``` +2. Edit the **[default]** section of **/etc/neutron/neutron.conf** : [code]`external_dns_driver = designate` +``` + + 3. Add the **[designate]** section in **/_etc/_neutron/neutron.conf** : [code] [designate] +url = http://{{ CONTROLLER_SERVER_IP }}:9001/v2 ## This end point of designate +auth_type = password +auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000 +username = designate +password = rhlab123 +project_name = services +project_domain_name = Default +user_domain_name = Default +allow_reverse_dns_lookup = True +ipv4_ptr_zone_prefix_size = 24 +ipv6_ptr_zone_prefix_size = 116 +``` + 4. Edit **dns_domain** in **neutron.conf** : [code] dns_domain = rhlab.dev. + +# systemctl restart neutron-* +``` + + 5. Add **dns** to the list of Modular Layer 2 (ML2) drivers in **/etc/neutron/plugins/ml2/ml2_conf.ini** : [code]`extension_drivers=port_security,qos,dns` +``` +6. Add **zone** in Designate: [code]`# openstack zone create –email=admin@rhlab.dev rhlab.dev.`[/code] Add a new record in **zone rhlab.dev** : [code]`# openstack recordset create --record '192.168.1.230' --type A rhlab.dev. Test` +``` + + + + +Designate should now be installed and configured. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/getting-started-openstack-designate + +作者:[Amjad Yaseen][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/ayaseen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://docs.openstack.org/designate/latest/ +[3]: /article/19/3/openstack-neutron +[4]: https://opensource.com/sites/default/files/uploads/openstack_designate_architecture.png (Designate's architecture) +[5]: https://github.com/ayaseen/designate From 3141b55cf0d19e1a4ebbcaaffea274f81474018d Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:48:15 +0800 Subject: [PATCH 0010/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Dete?= =?UTF-8?q?cting=20malaria=20with=20deep=20learning=20sources/tech/2019041?= =?UTF-8?q?6=20Detecting=20malaria=20with=20deep=20learning.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...16 Detecting malaria with deep learning.md | 792 ++++++++++++++++++ 1 file changed, 792 insertions(+) create mode 100644 sources/tech/20190416 Detecting malaria with deep learning.md diff --git a/sources/tech/20190416 Detecting malaria with deep learning.md b/sources/tech/20190416 Detecting malaria with deep learning.md new file mode 100644 index 0000000000..77df4a561b --- /dev/null +++ b/sources/tech/20190416 Detecting malaria with deep learning.md @@ -0,0 +1,792 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Detecting malaria with deep learning) +[#]: via: (https://opensource.com/article/19/4/detecting-malaria-deep-learning) +[#]: author: (Dipanjan (DJ) Sarkar (Red Hat) https://opensource.com/users/djsarkar) + +Detecting malaria with deep learning +====== +Artificial intelligence combined with open source tools can improve +diagnosis of the fatal disease malaria. +![][1] + +Artificial intelligence (AI) and open source tools, technologies, and frameworks are a powerful combination for improving society. _"Health is wealth"_ is perhaps a cliche, yet it's very accurate! In this article, we will examine how AI can be leveraged for detecting the deadly disease malaria with a low-cost, effective, and accurate open source deep learning solution. + +While I am neither a doctor nor a healthcare researcher and I'm nowhere near as qualified as they are, I am interested in applying AI to healthcare research. My intent in this article is to showcase how AI and open source solutions can help malaria detection and reduce manual labor. + +![Python and TensorFlow][2] + +Python and TensorFlow: A great combo to build open source deep learning solutions + +Thanks to the power of Python and deep learning frameworks like TensorFlow, we can build robust, scalable, and effective deep learning solutions. Because these tools are free and open source, we can build solutions that are very cost-effective and easily adopted and used by anyone. Let's get started! + +### Motivation for the project + +Malaria is a deadly, infectious, mosquito-borne disease caused by _Plasmodium_ parasites that are transmitted by the bites of infected female _Anopheles_ mosquitoes. There are five parasites that cause malaria, but two types— _P. falciparum_ and _P. vivax_ —cause the majority of the cases. + +![Malaria heat map][3] + +This map shows that malaria is prevalent around the globe, especially in tropical regions, but the nature and fatality of the disease is the primary motivation for this project. + +If an infected mosquito bites you, parasites carried by the mosquito enter your blood and start destroying oxygen-carrying red blood cells (RBC). Typically, the first symptoms of malaria are similar to a virus like the flu and they usually begin within a few days or weeks after the mosquito bite. However, these deadly parasites can live in your body for over a year without causing symptoms, and a delay in treatment can lead to complications and even death. Therefore, early detection can save lives. + +The World Health Organization's (WHO) [malaria facts][4] indicate that nearly half the world's population is at risk from malaria, and there are over 200 million malaria cases and approximately 400,000 deaths due to malaria every year. This is a motivatation to make malaria detection and diagnosis fast, easy, and effective. + +### Methods of malaria detection + +There are several methods that can be used for malaria detection and diagnosis. The paper on which our project is based, "[Pre-trained convolutional neural networks as feature extractors toward improved Malaria parasite detection in thin blood smear images][5]," by Rajaraman, et al., introduces some of the methods, including polymerase chain reaction (PCR) and rapid diagnostic tests (RDT). These two tests are typically used where high-quality microscopy services are not readily available. + +The standard malaria diagnosis is typically based on a blood-smear workflow, according to Carlos Ariza's article "[Malaria Hero: A web app for faster malaria diagnosis][6]," which I learned about in Adrian Rosebrock's "[Deep learning and medical image analysis with Keras][7]." I appreciate the authors of these excellent resources for giving me more perspective on malaria prevalence, diagnosis, and treatment. + +![Blood smear workflow for Malaria detection][8] + +A blood smear workflow for Malaria detection + +According to WHO protocol, diagnosis typically involves intensive examination of the blood smear at 100X magnification. Trained people manually count how many red blood cells contain parasites out of 5,000 cells. As the Rajaraman, et al., paper cited above explains: + +> Thick blood smears assist in detecting the presence of parasites while thin blood smears assist in identifying the species of the parasite causing the infection (Centers for Disease Control and Prevention, 2012). The diagnostic accuracy heavily depends on human expertise and can be adversely impacted by the inter-observer variability and the liability imposed by large-scale diagnoses in disease-endemic/resource-constrained regions (Mitiku, Mengistu, and Gelaw, 2003). Alternative techniques such as polymerase chain reaction (PCR) and rapid diagnostic tests (RDT) are used; however, PCR analysis is limited in its performance (Hommelsheim, et al., 2014) and RDTs are less cost-effective in disease-endemic regions (Hawkes, Katsuva, and Masumbuko, 2009). + +Thus, malaria detection could benefit from automation using deep learning. + +### Deep learning for malaria detection + +Manual diagnosis of blood smears is an intensive manual process that requires expertise in classifying and counting parasitized and uninfected cells. This process may not scale well, especially in regions where the right expertise is hard to find. Some advancements have been made in leveraging state-of-the-art image processing and analysis techniques to extract hand-engineered features and build machine learning-based classification models. However, these models are not scalable with more data being available for training and given the fact that hand-engineered features take a lot of time. + +Deep learning models, or more specifically convolutional neural networks (CNNs), have proven very effective in a wide variety of computer vision tasks. (If you would like additional background knowledge on CNNs, I recommend reading [CS231n Convolutional Neural Networks for Visual Recognition][9].) Briefly, the key layers in a CNN model include convolution and pooling layers, as shown in the following figure. + +![A typical CNN architecture][10] + +A typical CNN architecture + +Convolution layers learn spatial hierarchical patterns from data, which are also translation-invariant, so they are able to learn different aspects of images. For example, the first convolution layer will learn small and local patterns, such as edges and corners, a second convolution layer will learn larger patterns based on the features from the first layers, and so on. This allows CNNs to automate feature engineering and learn effective features that generalize well on new data points. Pooling layers helps with downsampling and dimension reduction. + +Thus, CNNs help with automated and scalable feature engineering. Also, plugging in dense layers at the end of the model enables us to perform tasks like image classification. Automated malaria detection using deep learning models like CNNs could be very effective, cheap, and scalable, especially with the advent of transfer learning and pre-trained models that work quite well, even with constraints like less data. + +The Rajaraman, et al., paper leverages six pre-trained models on a dataset to obtain an impressive accuracy of 95.9% in detecting malaria vs. non-infected samples. Our focus is to try some simple CNN models from scratch and a couple of pre-trained models using transfer learning to see the results we can get on the same dataset. We will use open source tools and frameworks, including Python and TensorFlow, to build our models. + +### The dataset + +The data for our analysis comes from researchers at the Lister Hill National Center for Biomedical Communications (LHNCBC), part of the National Library of Medicine (NLM), who have carefully collected and annotated the [publicly available dataset][11] of healthy and infected blood smear images. These researchers have developed a mobile [application for malaria detection][12] that runs on a standard Android smartphone attached to a conventional light microscope. They used Giemsa-stained thin blood smear slides from 150 _P. falciparum_ -infected and 50 healthy patients, collected and photographed at Chittagong Medical College Hospital, Bangladesh. The smartphone's built-in camera acquired images of slides for each microscopic field of view. The images were manually annotated by an expert slide reader at the Mahidol-Oxford Tropical Medicine Research Unit in Bangkok, Thailand. + +Let's briefly check out the dataset's structure. First, I will install some basic dependencies (based on the operating system being used). + +![Installing dependencies][13] + +I am using a Debian-based system on the cloud with a GPU so I can run my models faster. To view the directory structure, we must install the tree dependency (if we don't have it) using **sudo apt install tree**. + +![Installing the tree dependency][14] + +We have two folders that contain images of cells, infected and healthy. We can get further details about the total number of images by entering: + + +``` +import os +import glob + +base_dir = os.path.join('./cell_images') +infected_dir = os.path.join(base_dir,'Parasitized') +healthy_dir = os.path.join(base_dir,'Uninfected') + +infected_files = glob.glob(infected_dir+'/*.png') +healthy_files = glob.glob(healthy_dir+'/*.png') +len(infected_files), len(healthy_files) + +# Output +(13779, 13779) +``` + +It looks like we have a balanced dataset with 13,779 malaria and 13,779 non-malaria (uninfected) cell images. Let's build a data frame from this, which we will use when we start building our datasets. + + +``` +import numpy as np +import pandas as pd + +np.random.seed(42) + +files_df = pd.DataFrame({ +'filename': infected_files + healthy_files, +'label': ['malaria'] * len(infected_files) + ['healthy'] * len(healthy_files) +}).sample(frac=1, random_state=42).reset_index(drop=True) + +files_df.head() +``` + +![Datasets][15] + +### Build and explore image datasets + +To build deep learning models, we need training data, but we also need to test the model's performance on unseen data. We will use a 60:10:30 split for train, validation, and test datasets, respectively. We will leverage the train and validation datasets during training and check the performance of the model on the test dataset. + + +``` +from sklearn.model_selection import train_test_split +from collections import Counter + +train_files, test_files, train_labels, test_labels = train_test_split(files_df['filename'].values, +files_df['label'].values, +test_size=0.3, random_state=42) +train_files, val_files, train_labels, val_labels = train_test_split(train_files, +train_labels, +test_size=0.1, random_state=42) + +print(train_files.shape, val_files.shape, test_files.shape) +print('Train:', Counter(train_labels), '\nVal:', Counter(val_labels), '\nTest:', Counter(test_labels)) + +# Output +(17361,) (1929,) (8268,) +Train: Counter({'healthy': 8734, 'malaria': 8627}) +Val: Counter({'healthy': 970, 'malaria': 959}) +Test: Counter({'malaria': 4193, 'healthy': 4075}) +``` + +The images will not be of equal dimensions because blood smears and cell images vary based on the human, the test method, and the orientation of the photo. Let's get some summary statistics of our training dataset to determine the optimal image dimensions (remember, we don't touch the test dataset at all!). + + +``` +import cv2 +from concurrent import futures +import threading + +def get_img_shape_parallel(idx, img, total_imgs): +if idx % 5000 == 0 or idx == (total_imgs - 1): +print('{}: working on img num: {}'.format(threading.current_thread().name, +idx)) +return cv2.imread(img).shape + +ex = futures.ThreadPoolExecutor(max_workers=None) +data_inp = [(idx, img, len(train_files)) for idx, img in enumerate(train_files)] +print('Starting Img shape computation:') +train_img_dims_map = ex.map(get_img_shape_parallel, +[record[0] for record in data_inp], +[record[1] for record in data_inp], +[record[2] for record in data_inp]) +train_img_dims = list(train_img_dims_map) +print('Min Dimensions:', np.min(train_img_dims, axis=0)) +print('Avg Dimensions:', np.mean(train_img_dims, axis=0)) +print('Median Dimensions:', np.median(train_img_dims, axis=0)) +print('Max Dimensions:', np.max(train_img_dims, axis=0)) + +# Output +Starting Img shape computation: +ThreadPoolExecutor-0_0: working on img num: 0 +ThreadPoolExecutor-0_17: working on img num: 5000 +ThreadPoolExecutor-0_15: working on img num: 10000 +ThreadPoolExecutor-0_1: working on img num: 15000 +ThreadPoolExecutor-0_7: working on img num: 17360 +Min Dimensions: [46 46 3] +Avg Dimensions: [132.77311215 132.45757733 3.] +Median Dimensions: [130. 130. 3.] +Max Dimensions: [385 394 3] +``` + +We apply parallel processing to speed up the image-read operations and, based on the summary statistics, we will resize each image to 125x125 pixels. Let's load up all of our images and resize them to these fixed dimensions. + + +``` +IMG_DIMS = (125, 125) + +def get_img_data_parallel(idx, img, total_imgs): +if idx % 5000 == 0 or idx == (total_imgs - 1): +print('{}: working on img num: {}'.format(threading.current_thread().name, +idx)) +img = cv2.imread(img) +img = cv2.resize(img, dsize=IMG_DIMS, +interpolation=cv2.INTER_CUBIC) +img = np.array(img, dtype=np.float32) +return img + +ex = futures.ThreadPoolExecutor(max_workers=None) +train_data_inp = [(idx, img, len(train_files)) for idx, img in enumerate(train_files)] +val_data_inp = [(idx, img, len(val_files)) for idx, img in enumerate(val_files)] +test_data_inp = [(idx, img, len(test_files)) for idx, img in enumerate(test_files)] + +print('Loading Train Images:') +train_data_map = ex.map(get_img_data_parallel, +[record[0] for record in train_data_inp], +[record[1] for record in train_data_inp], +[record[2] for record in train_data_inp]) +train_data = np.array(list(train_data_map)) + +print('\nLoading Validation Images:') +val_data_map = ex.map(get_img_data_parallel, +[record[0] for record in val_data_inp], +[record[1] for record in val_data_inp], +[record[2] for record in val_data_inp]) +val_data = np.array(list(val_data_map)) + +print('\nLoading Test Images:') +test_data_map = ex.map(get_img_data_parallel, +[record[0] for record in test_data_inp], +[record[1] for record in test_data_inp], +[record[2] for record in test_data_inp]) +test_data = np.array(list(test_data_map)) + +train_data.shape, val_data.shape, test_data.shape + +# Output +Loading Train Images: +ThreadPoolExecutor-1_0: working on img num: 0 +ThreadPoolExecutor-1_12: working on img num: 5000 +ThreadPoolExecutor-1_6: working on img num: 10000 +ThreadPoolExecutor-1_10: working on img num: 15000 +ThreadPoolExecutor-1_3: working on img num: 17360 + +Loading Validation Images: +ThreadPoolExecutor-1_13: working on img num: 0 +ThreadPoolExecutor-1_18: working on img num: 1928 + +Loading Test Images: +ThreadPoolExecutor-1_5: working on img num: 0 +ThreadPoolExecutor-1_19: working on img num: 5000 +ThreadPoolExecutor-1_8: working on img num: 8267 +((17361, 125, 125, 3), (1929, 125, 125, 3), (8268, 125, 125, 3)) +``` + +We leverage parallel processing again to speed up computations pertaining to image load and resizing. Finally, we get our image tensors of the desired dimensions, as depicted in the preceding output. We can now view some sample cell images to get an idea of how our data looks. + + +``` +import matplotlib.pyplot as plt +%matplotlib inline + +plt.figure(1 , figsize = (8 , 8)) +n = 0 +for i in range(16): +n += 1 +r = np.random.randint(0 , train_data.shape[0] , 1) +plt.subplot(4 , 4 , n) +plt.subplots_adjust(hspace = 0.5 , wspace = 0.5) +plt.imshow(train_data[r[0]]/255.) +plt.title('{}'.format(train_labels[r[0]])) +plt.xticks([]) , plt.yticks([]) +``` + +![Malaria cell samples][16] + +Based on these sample images, we can see some subtle differences between malaria and healthy cell images. We will make our deep learning models try to learn these patterns during model training. + +Before can we start training our models, we must set up some basic configuration settings. + + +``` +BATCH_SIZE = 64 +NUM_CLASSES = 2 +EPOCHS = 25 +INPUT_SHAPE = (125, 125, 3) + +train_imgs_scaled = train_data / 255. +val_imgs_scaled = val_data / 255. + +# encode text category labels +from sklearn.preprocessing import LabelEncoder + +le = LabelEncoder() +le.fit(train_labels) +train_labels_enc = le.transform(train_labels) +val_labels_enc = le.transform(val_labels) + +print(train_labels[:6], train_labels_enc[:6]) + +# Output +['malaria' 'malaria' 'malaria' 'healthy' 'healthy' 'malaria'] [1 1 1 0 0 1] +``` + +We fix our image dimensions, batch size, and epochs and encode our categorical class labels. The alpha version of TensorFlow 2.0 was released in March 2019, and this exercise is the perfect excuse to try it out. + + +``` +import tensorflow as tf + +# Load the TensorBoard notebook extension (optional) +%load_ext tensorboard.notebook + +tf.random.set_seed(42) +tf.__version__ + +# Output +'2.0.0-alpha0' +``` + +### Deep learning model training + +In the model training phase, we will build three deep learning models, train them with our training data, and compare their performance using the validation data. We will then save these models and use them later in the model evaluation phase. + +#### Model 1: CNN from scratch + +Our first malaria detection model will build and train a basic CNN from scratch. First, let's define our model architecture. + + +``` +inp = tf.keras.layers.Input(shape=INPUT_SHAPE) + +conv1 = tf.keras.layers.Conv2D(32, kernel_size=(3, 3), +activation='relu', padding='same')(inp) +pool1 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv1) +conv2 = tf.keras.layers.Conv2D(64, kernel_size=(3, 3), +activation='relu', padding='same')(pool1) +pool2 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv2) +conv3 = tf.keras.layers.Conv2D(128, kernel_size=(3, 3), +activation='relu', padding='same')(pool2) +pool3 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv3) + +flat = tf.keras.layers.Flatten()(pool3) + +hidden1 = tf.keras.layers.Dense(512, activation='relu')(flat) +drop1 = tf.keras.layers.Dropout(rate=0.3)(hidden1) +hidden2 = tf.keras.layers.Dense(512, activation='relu')(drop1) +drop2 = tf.keras.layers.Dropout(rate=0.3)(hidden2) + +out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) + +model = tf.keras.Model(inputs=inp, outputs=out) +model.compile(optimizer='adam', +loss='binary_crossentropy', +metrics=['accuracy']) +model.summary() + +# Output +Model: "model" +_________________________________________________________________ +Layer (type) Output Shape Param # +================================================================= +input_1 (InputLayer) [(None, 125, 125, 3)] 0 +_________________________________________________________________ +conv2d (Conv2D) (None, 125, 125, 32) 896 +_________________________________________________________________ +max_pooling2d (MaxPooling2D) (None, 62, 62, 32) 0 +_________________________________________________________________ +conv2d_1 (Conv2D) (None, 62, 62, 64) 18496 +_________________________________________________________________ +... +... +_________________________________________________________________ +dense_1 (Dense) (None, 512) 262656 +_________________________________________________________________ +dropout_1 (Dropout) (None, 512) 0 +_________________________________________________________________ +dense_2 (Dense) (None, 1) 513 +================================================================= +Total params: 15,102,529 +Trainable params: 15,102,529 +Non-trainable params: 0 +_________________________________________________________________ +``` + +Based on the architecture in this code, our CNN model has three convolution and pooling layers, followed by two dense layers, and dropouts for regularization. Let's train our model. + + +``` +import datetime + +logdir = os.path.join('/home/dipanzan_sarkar/projects/tensorboard_logs', +datetime.datetime.now().strftime("%Y%m%d-%H%M%S")) +tensorboard_callback = tf.keras.callbacks.TensorBoard(logdir, histogram_freq=1) +reduce_lr = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.5, +patience=2, min_lr=0.000001) +callbacks = [reduce_lr, tensorboard_callback] + +history = model.fit(x=train_imgs_scaled, y=train_labels_enc, +batch_size=BATCH_SIZE, +epochs=EPOCHS, +validation_data=(val_imgs_scaled, val_labels_enc), +callbacks=callbacks, +verbose=1) + + +# Output +Train on 17361 samples, validate on 1929 samples +Epoch 1/25 +17361/17361 [====] - 32s 2ms/sample - loss: 0.4373 - accuracy: 0.7814 - val_loss: 0.1834 - val_accuracy: 0.9393 +Epoch 2/25 +17361/17361 [====] - 30s 2ms/sample - loss: 0.1725 - accuracy: 0.9434 - val_loss: 0.1567 - val_accuracy: 0.9513 +... +... +Epoch 24/25 +17361/17361 [====] - 30s 2ms/sample - loss: 0.0036 - accuracy: 0.9993 - val_loss: 0.3693 - val_accuracy: 0.9565 +Epoch 25/25 +17361/17361 [====] - 30s 2ms/sample - loss: 0.0034 - accuracy: 0.9994 - val_loss: 0.3699 - val_accuracy: 0.9559 +``` + +We get a validation accuracy of 95.6%, which is pretty good, although our model looks to be overfitting slightly (based on looking at our training accuracy, which is 99.9%). We can get a clear perspective on this by plotting the training and validation accuracy and loss curves. + + +``` +f, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4)) +t = f.suptitle('Basic CNN Performance', fontsize=12) +f.subplots_adjust(top=0.85, wspace=0.3) + +max_epoch = len(history.history['accuracy'])+1 +epoch_list = list(range(1,max_epoch)) +ax1.plot(epoch_list, history.history['accuracy'], label='Train Accuracy') +ax1.plot(epoch_list, history.history['val_accuracy'], label='Validation Accuracy') +ax1.set_xticks(np.arange(1, max_epoch, 5)) +ax1.set_ylabel('Accuracy Value') +ax1.set_xlabel('Epoch') +ax1.set_title('Accuracy') +l1 = ax1.legend(loc="best") + +ax2.plot(epoch_list, history.history['loss'], label='Train Loss') +ax2.plot(epoch_list, history.history['val_loss'], label='Validation Loss') +ax2.set_xticks(np.arange(1, max_epoch, 5)) +ax2.set_ylabel('Loss Value') +ax2.set_xlabel('Epoch') +ax2.set_title('Loss') +l2 = ax2.legend(loc="best") +``` + +![Learning curves for basic CNN][17] + +Learning curves for basic CNN + +We can see after the fifth epoch that things don't seem to improve a whole lot overall. Let's save this model for future evaluation. + + +``` +`model.save('basic_cnn.h5')` +``` + +#### Deep transfer learning + +Just like humans have an inherent capability to transfer knowledge across tasks, transfer learning enables us to utilize knowledge from previously learned tasks and apply it to newer, related ones, even in the context of machine learning or deep learning. If you are interested in doing a deep-dive on transfer learning, you can read my article "[A comprehensive hands-on guide to transfer learning with real-world applications in deep learning][18]" and my book [_Hands-On Transfer Learning with Python_][19]. + +![Ideas for deep transfer learning][20] + +The idea we want to explore in this exercise is: + +> Can we leverage a pre-trained deep learning model (which was trained on a large dataset, like ImageNet) to solve the problem of malaria detection by applying and transferring its knowledge in the context of our problem? + +We will apply the two most popular strategies for deep transfer learning. + + * Pre-trained model as a feature extractor + * Pre-trained model with fine-tuning + + + +We will be using the pre-trained VGG-19 deep learning model, developed by the Visual Geometry Group (VGG) at the University of Oxford, for our experiments. A pre-trained model like VGG-19 is trained on a huge dataset ([ImageNet][21]) with a lot of diverse image categories. Therefore, the model should have learned a robust hierarchy of features, which are spatial-, rotational-, and translation-invariant with regard to features learned by CNN models. Hence, the model, having learned a good representation of features for over a million images, can act as a good feature extractor for new images suitable for computer vision problems like malaria detection. Let's discuss the VGG-19 model architecture before unleashing the power of transfer learning on our problem. + +##### Understanding the VGG-19 model + +The VGG-19 model is a 19-layer (convolution and fully connected) deep learning network built on the ImageNet database, which was developed for the purpose of image recognition and classification. This model was built by Karen Simonyan and Andrew Zisserman and is described in their paper "[Very deep convolutional networks for large-scale image recognition][22]." The architecture of the VGG-19 model is: + +![VGG-19 Model Architecture][23] + +You can see that we have a total of 16 convolution layers using 3x3 convolution filters along with max pooling layers for downsampling and two fully connected hidden layers of 4,096 units in each layer followed by a dense layer of 1,000 units, where each unit represents one of the image categories in the ImageNet database. We do not need the last three layers since we will be using our own fully connected dense layers to predict malaria. We are more concerned with the first five blocks so we can leverage the VGG model as an effective feature extractor. + +We will use one of the models as a simple feature extractor by freezing the five convolution blocks to make sure their weights aren't updated after each epoch. For the last model, we will apply fine-tuning to the VGG model, where we will unfreeze the last two blocks (Block 4 and Block 5) so that their weights will be updated in each epoch (per batch of data) as we train our own model. + +#### Model 2: Pre-trained model as a feature extractor + +For building this model, we will leverage TensorFlow to load up the VGG-19 model and freeze the convolution blocks so we can use them as an image feature extractor. We will plug in our own dense layers at the end to perform the classification task. + + +``` +vgg = tf.keras.applications.vgg19.VGG19(include_top=False, weights='imagenet', +input_shape=INPUT_SHAPE) +vgg.trainable = False +# Freeze the layers +for layer in vgg.layers: +layer.trainable = False + +base_vgg = vgg +base_out = base_vgg.output +pool_out = tf.keras.layers.Flatten()(base_out) +hidden1 = tf.keras.layers.Dense(512, activation='relu')(pool_out) +drop1 = tf.keras.layers.Dropout(rate=0.3)(hidden1) +hidden2 = tf.keras.layers.Dense(512, activation='relu')(drop1) +drop2 = tf.keras.layers.Dropout(rate=0.3)(hidden2) + +out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) + +model = tf.keras.Model(inputs=base_vgg.input, outputs=out) +model.compile(optimizer=tf.keras.optimizers.RMSprop(lr=1e-4), +loss='binary_crossentropy', +metrics=['accuracy']) +model.summary() + +# Output +Model: "model_1" +_________________________________________________________________ +Layer (type) Output Shape Param # +================================================================= +input_2 (InputLayer) [(None, 125, 125, 3)] 0 +_________________________________________________________________ +block1_conv1 (Conv2D) (None, 125, 125, 64) 1792 +_________________________________________________________________ +block1_conv2 (Conv2D) (None, 125, 125, 64) 36928 +_________________________________________________________________ +... +... +_________________________________________________________________ +block5_pool (MaxPooling2D) (None, 3, 3, 512) 0 +_________________________________________________________________ +flatten_1 (Flatten) (None, 4608) 0 +_________________________________________________________________ +dense_3 (Dense) (None, 512) 2359808 +_________________________________________________________________ +dropout_2 (Dropout) (None, 512) 0 +_________________________________________________________________ +dense_4 (Dense) (None, 512) 262656 +_________________________________________________________________ +dropout_3 (Dropout) (None, 512) 0 +_________________________________________________________________ +dense_5 (Dense) (None, 1) 513 +================================================================= +Total params: 22,647,361 +Trainable params: 2,622,977 +Non-trainable params: 20,024,384 +_________________________________________________________________ +``` + +It is evident from this output that we have a lot of layers in our model and we will be using the frozen layers of the VGG-19 model as feature extractors only. You can use the following code to verify how many layers in our model are indeed trainable and how many total layers are present in our network. + + +``` +print("Total Layers:", len(model.layers)) +print("Total trainable layers:", +sum([1 for l in model.layers if l.trainable])) + +# Output +Total Layers: 28 +Total trainable layers: 6 +``` + +We will now train our model using similar configurations and callbacks to the ones we used in our previous model. Refer to [my GitHub repository][24] for the complete code to train the model. We observe the following plots showing the model's accuracy and loss. + +![Learning curves for frozen pre-trained CNN][25] + +Learning curves for frozen pre-trained CNN + +This shows that our model is not overfitting as much as our basic CNN model, but the performance is slightly less than our basic CNN model. Let's save this model for future evaluation. + + +``` +`model.save('vgg_frozen.h5')` +``` + +#### Model 3: Fine-tuned pre-trained model with image augmentation + +In our final model, we will fine-tune the weights of the layers in the last two blocks of our pre-trained VGG-19 model. We will also introduce the concept of image augmentation. The idea behind image augmentation is exactly as the name sounds. We load in existing images from our training dataset and apply some image transformation operations to them, such as rotation, shearing, translation, zooming, and so on, to produce new, altered versions of existing images. Due to these random transformations, we don't get the same images each time. We will leverage an excellent utility called **ImageDataGenerator** in **tf.keras** that can help build image augmentors. + + +``` +train_datagen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255, +zoom_range=0.05, +rotation_range=25, +width_shift_range=0.05, +height_shift_range=0.05, +shear_range=0.05, horizontal_flip=True, +fill_mode='nearest') + +val_datagen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255) + +# build image augmentation generators +train_generator = train_datagen.flow(train_data, train_labels_enc, batch_size=BATCH_SIZE, shuffle=True) +val_generator = val_datagen.flow(val_data, val_labels_enc, batch_size=BATCH_SIZE, shuffle=False) +``` + +We will not apply any transformations on our validation dataset (except for scaling the images, which is mandatory) since we will be using it to evaluate our model performance per epoch. For a detailed explanation of image augmentation in the context of transfer learning, feel free to check out my [article][18] cited above. Let's look at some sample results from a batch of image augmentation transforms. + + +``` +img_id = 0 +sample_generator = train_datagen.flow(train_data[img_id:img_id+1], train_labels[img_id:img_id+1], +batch_size=1) +sample = [next(sample_generator) for i in range(0,5)] +fig, ax = plt.subplots(1,5, figsize=(16, 6)) +print('Labels:', [item[1][0] for item in sample]) +l = [ax[i].imshow(sample[i][0][0]) for i in range(0,5)] +``` + +![Sample augmented images][26] + +You can clearly see the slight variations of our images in the preceding output. We will now build our deep learning model, making sure the last two blocks of the VGG-19 model are trainable. + + +``` +vgg = tf.keras.applications.vgg19.VGG19(include_top=False, weights='imagenet', +input_shape=INPUT_SHAPE) +# Freeze the layers +vgg.trainable = True + +set_trainable = False +for layer in vgg.layers: +if layer.name in ['block5_conv1', 'block4_conv1']: +set_trainable = True +if set_trainable: +layer.trainable = True +else: +layer.trainable = False + +base_vgg = vgg +base_out = base_vgg.output +pool_out = tf.keras.layers.Flatten()(base_out) +hidden1 = tf.keras.layers.Dense(512, activation='relu')(pool_out) +drop1 = tf.keras.layers.Dropout(rate=0.3)(hidden1) +hidden2 = tf.keras.layers.Dense(512, activation='relu')(drop1) +drop2 = tf.keras.layers.Dropout(rate=0.3)(hidden2) + +out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) + +model = tf.keras.Model(inputs=base_vgg.input, outputs=out) +model.compile(optimizer=tf.keras.optimizers.RMSprop(lr=1e-5), +loss='binary_crossentropy', +metrics=['accuracy']) + +print("Total Layers:", len(model.layers)) +print("Total trainable layers:", sum([1 for l in model.layers if l.trainable])) + +# Output +Total Layers: 28 +Total trainable layers: 16 +``` + +We reduce the learning rate in our model since we don't want to make to large weight updates to the pre-trained layers when fine-tuning. The model's training process will be slightly different since we are using data generators, so we will be leveraging the **fit_generator(…)** function. + + +``` +tensorboard_callback = tf.keras.callbacks.TensorBoard(logdir, histogram_freq=1) +reduce_lr = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.5, +patience=2, min_lr=0.000001) + +callbacks = [reduce_lr, tensorboard_callback] +train_steps_per_epoch = train_generator.n // train_generator.batch_size +val_steps_per_epoch = val_generator.n // val_generator.batch_size +history = model.fit_generator(train_generator, steps_per_epoch=train_steps_per_epoch, epochs=EPOCHS, +validation_data=val_generator, validation_steps=val_steps_per_epoch, +verbose=1) + +# Output +Epoch 1/25 +271/271 [====] - 133s 489ms/step - loss: 0.2267 - accuracy: 0.9117 - val_loss: 0.1414 - val_accuracy: 0.9531 +Epoch 2/25 +271/271 [====] - 129s 475ms/step - loss: 0.1399 - accuracy: 0.9552 - val_loss: 0.1292 - val_accuracy: 0.9589 +... +... +Epoch 24/25 +271/271 [====] - 128s 473ms/step - loss: 0.0815 - accuracy: 0.9727 - val_loss: 0.1466 - val_accuracy: 0.9682 +Epoch 25/25 +271/271 [====] - 128s 473ms/step - loss: 0.0792 - accuracy: 0.9729 - val_loss: 0.1127 - val_accuracy: 0.9641 +``` + +This looks to be our best model yet. It gives us a validation accuracy of almost 96.5% and, based on the training accuracy, it doesn't look like our model is overfitting as much as our first model. This can be verified with the following learning curves. + +![Learning curves for fine-tuned pre-trained CNN][27] + +Learning curves for fine-tuned pre-trained CNN + +Let's save this model so we can use it for model evaluation on our test dataset. + + +``` +`model.save('vgg_finetuned.h5')` +``` + +This completes our model training phase. We are now ready to test the performance of our models on the actual test dataset! + +### Deep learning model performance evaluation + +We will evaluate the three models we built in the training phase by making predictions with them on the data from our test dataset—because just validation is not enough! We have also built a nifty utility module called **model_evaluation_utils** , which we can use to evaluate the performance of our deep learning models with relevant classification metrics. The first step is to scale our test data. + + +``` +test_imgs_scaled = test_data / 255. +test_imgs_scaled.shape, test_labels.shape + +# Output +((8268, 125, 125, 3), (8268,)) +``` + +The next step involves loading our saved deep learning models and making predictions on the test data. + + +``` +# Load Saved Deep Learning Models +basic_cnn = tf.keras.models.load_model('./basic_cnn.h5') +vgg_frz = tf.keras.models.load_model('./vgg_frozen.h5') +vgg_ft = tf.keras.models.load_model('./vgg_finetuned.h5') + +# Make Predictions on Test Data +basic_cnn_preds = basic_cnn.predict(test_imgs_scaled, batch_size=512) +vgg_frz_preds = vgg_frz.predict(test_imgs_scaled, batch_size=512) +vgg_ft_preds = vgg_ft.predict(test_imgs_scaled, batch_size=512) + +basic_cnn_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 +for pred in basic_cnn_preds.ravel()]) +vgg_frz_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 +for pred in vgg_frz_preds.ravel()]) +vgg_ft_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 +for pred in vgg_ft_preds.ravel()]) +``` + +The final step is to leverage our **model_evaluation_utils** module and check the performance of each model with relevant classification metrics. + + +``` +import model_evaluation_utils as meu +import pandas as pd + +basic_cnn_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=basic_cnn_pred_labels) +vgg_frz_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=vgg_frz_pred_labels) +vgg_ft_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=vgg_ft_pred_labels) + +pd.DataFrame([basic_cnn_metrics, vgg_frz_metrics, vgg_ft_metrics], +index=['Basic CNN', 'VGG-19 Frozen', 'VGG-19 Fine-tuned']) +``` + +![Model accuracy][28] + +It looks like our third model performs best on the test dataset, giving a model accuracy and an F1-score of 96%, which is pretty good and quite comparable to the more complex models mentioned in the research paper and articles we mentioned earlier. + +### Conclusion + +Malaria detection is not an easy procedure, and the availability of qualified personnel around the globe is a serious concern in the diagnosis and treatment of cases. We looked at an interesting real-world medical imaging case study of malaria detection. Easy-to-build, open source techniques leveraging AI can give us state-of-the-art accuracy in detecting malaria, thus enabling AI for social good. + +I encourage you to check out the articles and research papers mentioned in this article, without which it would have been impossible for me to conceptualize and write it. If you are interested in running or adopting these techniques, all the code used in this article is available on [my GitHub repository][24]. Remember to download the data from the [official website][11]. + +Let's hope for more adoption of open source AI capabilities in healthcare to make it less expensive and more accessible for everyone around the world! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/detecting-malaria-deep-learning + +作者:[Dipanjan (DJ) Sarkar (Red Hat)][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/djsarkar +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opensourcedoctor.png?itok=fk79NwpC +[2]: https://opensource.com/sites/default/files/uploads/malaria1_python-tensorflow.png (Python and TensorFlow) +[3]: https://opensource.com/sites/default/files/uploads/malaria2_malaria-heat-map.png (Malaria heat map) +[4]: https://www.who.int/features/factfiles/malaria/en/ +[5]: https://peerj.com/articles/4568/ +[6]: https://blog.insightdatascience.com/https-blog-insightdatascience-com-malaria-hero-a47d3d5fc4bb +[7]: https://www.pyimagesearch.com/2018/12/03/deep-learning-and-medical-image-analysis-with-keras/ +[8]: https://opensource.com/sites/default/files/uploads/malaria3_blood-smear.png (Blood smear workflow for Malaria detection) +[9]: http://cs231n.github.io/convolutional-networks/ +[10]: https://opensource.com/sites/default/files/uploads/malaria4_cnn-architecture.png (A typical CNN architecture) +[11]: https://ceb.nlm.nih.gov/repositories/malaria-datasets/ +[12]: https://www.ncbi.nlm.nih.gov/pubmed/29360430 +[13]: https://opensource.com/sites/default/files/uploads/malaria5_dependencies.png (Installing dependencies) +[14]: https://opensource.com/sites/default/files/uploads/malaria6_tree-dependency.png (Installing the tree dependency) +[15]: https://opensource.com/sites/default/files/uploads/malaria7_dataset.png (Datasets) +[16]: https://opensource.com/sites/default/files/uploads/malaria8_cell-samples.png (Malaria cell samples) +[17]: https://opensource.com/sites/default/files/uploads/malaria9_learningcurves.png (Learning curves for basic CNN) +[18]: https://towardsdatascience.com/a-comprehensive-hands-on-guide-to-transfer-learning-with-real-world-applications-in-deep-learning-212bf3b2f27a +[19]: https://github.com/dipanjanS/hands-on-transfer-learning-with-python +[20]: https://opensource.com/sites/default/files/uploads/malaria10_transferideas.png (Ideas for deep transfer learning) +[21]: http://image-net.org/index +[22]: https://arxiv.org/pdf/1409.1556.pdf +[23]: https://opensource.com/sites/default/files/uploads/malaria11_vgg-19-model-architecture.png (VGG-19 Model Architecture) +[24]: https://nbviewer.jupyter.org/github/dipanjanS/data_science_for_all/tree/master/os_malaria_detection/ +[25]: https://opensource.com/sites/default/files/uploads/malaria12_learningcurves.png (Learning curves for frozen pre-trained CNN) +[26]: https://opensource.com/sites/default/files/uploads/malaria13_sampleimages.png (Sample augmented images) +[27]: https://opensource.com/sites/default/files/uploads/malaria14_learningcurves.png (Learning curves for fine-tuned pre-trained CNN) +[28]: https://opensource.com/sites/default/files/uploads/malaria15_modelaccuracy.png (Model accuracy) From a2845c04025bc1f63401ba085648fb2106a2c3b5 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:48:27 +0800 Subject: [PATCH 0011/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Can?= =?UTF-8?q?=20schools=20be=20agile=3F=20sources/tech/20190416=20Can=20scho?= =?UTF-8?q?ols=20be=20agile.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190416 Can schools be agile.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/tech/20190416 Can schools be agile.md diff --git a/sources/tech/20190416 Can schools be agile.md b/sources/tech/20190416 Can schools be agile.md new file mode 100644 index 0000000000..065b313c05 --- /dev/null +++ b/sources/tech/20190416 Can schools be agile.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Can schools be agile?) +[#]: via: (https://opensource.com/open-organization/19/4/education-culture-agile) +[#]: author: (Ben Owens https://opensource.com/users/engineerteacher/users/ke4qqq/users/n8chz/users/don-watkins) + +Can schools be agile? +====== +We certainly don't need to run our schools like businesses—but we could +benefit from educational organizations more focused on continuous +improvement. +![][1] + +We've all had those _deja vu_ moments that make us think "I've seen this before!" I experienced them often in the late 1980s, when I first began my career in industry. I was caught up in a wave of organizational change, where the U.S. manufacturing sector was experimenting with various models that asked leaders, managers, and engineers like me to rethink how we approached things like quality, cost, innovation, and shareholder value. It seems as if every year (sometimes, more frequently) we'd study yet another book to identify the "best practices" necessary for making us leaner, flatter, more nimble, and more responsive to the needs of the customer. + +Many of the approaches were so transformational that their core principles still resonate with me today. Specific ideas and methods from thought leaders such as John Kotter, Peter Drucker, Edwards Demming, and Peter Senge were truly pivotal for our ability to rethink our work, as were the adoption of process improvement methods such as Six Sigma and those embodied in the "Toyota Way." + +But others seemed to simply repackage these same ideas with a sexy new twist—hence my _deja vu_. + +And yet when I began my career as a teacher, I encountered a context that _didn't_ give me that feeling: education. In fact, I was surprised to find that "getting better all the time" was _not_ the same high priority in my new profession that it was in my old one (particularly at the level of my role as a classroom teacher). + +Why aren't more educational organizations working to create cultures of continuous improvement? I can think of several reasons, but let me address two. + +### Widgets no more + +The first barrier to a culture of continuous improvement is education's general reticence to look at other professions for ideas it can adapt and adopt—especially ideas from the business community. The second is education's predominant leadership model, which remains predominantly top-down and rooted in hierarchy. Conversations about systemic, continuous improvement tend to be the purview of a relatively small group of school or district leaders: principals, assistant principals, superintendents, and the like. But widespread organizational culture change can't occur if only one small group is involved in it. + +Before unpacking these points a bit further, I'd like to emphasize that there are certainly exceptions to the above generalization (many I have seen first hand) and that there are two basic assumptions that I think any education stakeholder should be able to agree with: + + 1. Continuous improvement must be an essential mindset for _anyone_ involved in the work of providing high-quality and equitable teaching and learning systems for students, and + 2. Decisions by leaders of our schools will more greatly benefit students and the communities in which they live when those decisions are informed and influenced by those who work closest with students. + + + +So why a tendency to ignore (or be outright hostile toward) ideas that come from outside the education space? + +I, for example, have certainly faced criticism in the past for suggesting that we look to other professions for ideas and inspiration that can help us better meet the needs of students. A common refrain is something like: "You're trying to treat our students like widgets!" But how could our students be treated any more like widgets than they already are? They matriculate through school in age-based cohorts, going from siloed class to class each day by the sound of a shrill bell, and receive grades based on arbitrary tests that emphasize sameness over individuality. + +What I'm advocating is a clear-eyed and objective look at any idea from any sector with potential to help us better meet the needs of individual students, not that we somehow run our schools like businesses. + +It may be news to many inside of education, but widgets—abstract units of production that evoke the idea of assembly line standardization—are not a significant part of the modern manufacturing sector. Thanks to the culture of continuous improvement described above, modern, advanced manufacturing delivers just what the individual customer wants, at a competitive price, exactly when she wants it. If we adapted this model to our schools, teachers would be more likely to collaborate and constantly refine their unique paths of growth for all students based on just-in-time needs and desires—regardless of the time, subject, or any other traditional norm. + +What I'm advocating is a clear-eyed and objective look at any idea from any sector with potential to help us better meet the needs of individual students, not that we somehow run our schools like businesses. In order for this to happen effectively, however, we need to scrutinize a leadership structure that has frankly remained stagnant for over 100 years. + +### Toward continuous improvement + +While I certainly appreciate the argument that education is an animal significantly different from other professions, I also believe that rethinking an organizational and leadership structure is an applicable exercise for any entity wanting to remain responsible (and responsive) to the needs of its stakeholders. Most other professions have taken a hard look at their traditional, closed, hierarchical structures and moved to ones that encourage collective autonomy per shared goals of excellence—organizational elements essential for continuous improvement. It's time our schools and districts do the same by expanding their horizon beyond sources that, while well intended, are developed from a lens of the current paradigm. + +Not surprisingly, a go-to resource I recommend to any school wanting to begin or accelerate this process is _The Open Organization_ by Jim Whitehurst. Not only does the book provide a window into how educators can create more open, inclusive leadership structures—where mutual respect enables nimble decisions to be made per real-time data—but it does so in language easily adaptable to the rather strange lexicon that's second nature to educators. Open organization thinking provides pragmatic ways any organization can empower members to be more open: sharing ideas and resources, embracing a culture of collaborative participation as a top priority, developing an innovation mindset through rapid prototyping, valuing ideas based on merit rather than the rank of the person proposing them, and building a strong sense of community that's baked into the organization's DNA. Such an open organization crowd-sources ideas from both inside and outside its formal structure and creates the type of environment that enables localized, student-centered innovations to thrive. + +We simply can't rely on solutions and practices we developed in a factory-model paradigm. + +Here's the bottom line: Essential to a culture of continuous improvement is recognizing that what we've done in the past may not be suitable in a rapidly changing future. For educators, that means we simply can't rely on solutions and practices we developed in a factory-model paradigm. We must acknowledge countless examples of best practices from other sectors—such as non-profits, the military, the medical profession, and yes, even business—that can at least _inform_ how we rethink what we do in the best interest of students. By moving beyond the traditionally sanctioned "eduspeak" world, we create opportunities for considering perspectives. We can better see the forest for the trees, taking a more objective look at the problems we face, as well as acknowledging what we do very well. + +Intentionally considering ideas from all sources—from first year classroom teachers to the latest NYT Business & Management Leadership bestseller—offers us a powerful way to engage existing talent within our schools to help overcome the institutionalized inertia that has prevented more positive change from taking hold in our schools and districts. + +Relentlessly pursuing methods of continuous improvement should not be a behavior confined to organizations fighting to remain competitive in a global, innovation economy, nor should it be left to a select few charged with the operation of our schools. When everyone in an organization is always thinking about what they can do differently _today_ to improve what they did _yesterday_ , then you have an organization living a culture of excellence. That's the kind of radically collaborative and innovative culture we should especially expect for organizations focused on changing the lives of young people. + +I'm eagerly awaiting the day when I enter a school, recognize that spirit, and smile to myself as I say, "I've seen this before." + +Experiential learning using open source is fraught with opportunities for disaster. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/4/education-culture-agile + +作者:[Ben Owens][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/engineerteacher/users/ke4qqq/users/n8chz/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_network.png?itok=ySEHuAQ8 From 0362111d4ef181ffb3586d960a035b5db0433a31 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:48:37 +0800 Subject: [PATCH 0012/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Inte?= =?UTF-8?q?r-process=20communication=20in=20Linux:=20Using=20pipes=20and?= =?UTF-8?q?=20message=20queues=20sources/tech/20190416=20Inter-process=20c?= =?UTF-8?q?ommunication=20in=20Linux-=20Using=20pipes=20and=20message=20qu?= =?UTF-8?q?eues.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n Linux- Using pipes and message queues.md | 531 ++++++++++++++++++ 1 file changed, 531 insertions(+) create mode 100644 sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md diff --git a/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md new file mode 100644 index 0000000000..a2472dbc92 --- /dev/null +++ b/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -0,0 +1,531 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inter-process communication in Linux: Using pipes and message queues) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-channels) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Inter-process communication in Linux: Using pipes and message queues +====== +Learn how processes synchronize with each other in Linux. +![Chat bubbles][1] + +This is the second article in a series about [interprocess communication][2] (IPC) in Linux. The [first article][3] focused on IPC through shared storage: shared files and shared memory segments. This article turns to pipes, which are channels that connect processes for communication. A channel has a _write end_ for writing bytes, and a _read end_ for reading these bytes in FIFO (first in, first out) order. In typical use, one process writes to the channel, and a different process reads from this same channel. The bytes themselves might represent anything: numbers, employee records, digital movies, and so on. + +Pipes come in two flavors, named and unnamed, and can be used either interactively from the command line or within programs; examples are forthcoming. This article also looks at memory queues, which have fallen out of fashion—but undeservedly so. + +The code examples in the first article acknowledged the threat of race conditions (either file-based or memory-based) in IPC that uses shared storage. The question naturally arises about safe concurrency for the channel-based IPC, which will be covered in this article. The code examples for pipes and memory queues use APIs with the POSIX stamp of approval, and a core goal of the POSIX standards is thread-safety. + +Consider the [man pages for the **mq_open**][4] function, which belongs to the memory queue API. These pages include a section on [Attributes][5] with this small table: + +Interface | Attribute | Value +---|---|--- +mq_open() | Thread safety | MT-Safe + +The value **MT-Safe** (with **MT** for multi-threaded) means that the **mq_open** function is thread-safe, which in turn implies process-safe: A process executes in precisely the sense that one of its threads executes, and if a race condition cannot arise among threads in the _same_ process, such a condition cannot arise among threads in different processes. The **MT-Safe** attribute assures that a race condition does not arise in invocations of **mq_open**. In general, channel-based IPC is concurrent-safe, although a cautionary note is raised in the examples that follow. + +### Unnamed pipes + +Let's start with a contrived command line example that shows how unnamed pipes work. On all modern systems, the vertical bar **|** represents an unnamed pipe at the command line. Assume **%** is the command line prompt, and consider this command: + + +``` +`% sleep 5 | echo "Hello, world!" ## writer to the left of |, reader to the right` +``` + +The _sleep_ and _echo_ utilities execute as separate processes, and the unnamed pipe allows them to communicate. However, the example is contrived in that no communication occurs. The greeting _Hello, world!_ appears on the screen; then, after about five seconds, the command line prompt returns, indicating that both the _sleep_ and _echo_ processes have exited. What's going on? + +In the vertical-bar syntax from the command line, the process to the left ( _sleep_ ) is the writer, and the process to the right ( _echo_ ) is the reader. By default, the reader blocks until there are bytes to read from the channel, and the writer—after writing its bytes—finishes up by sending an end-of-stream marker. (Even if the writer terminates prematurely, an end-of-stream marker is sent to the reader.) The unnamed pipe persists until both the writer and the reader terminate. + +In the contrived example, the _sleep_ process does not write any bytes to the channel but does terminate after about five seconds, which sends an end-of-stream marker to the channel. In the meantime, the _echo_ process immediately writes the greeting to the standard output (the screen) because this process does not read any bytes from the channel, so it does no waiting. Once the _sleep_ and _echo_ processes terminate, the unnamed pipe—not used at all for communication—goes away and the command line prompt returns. + +Here is a more useful example using two unnamed pipes. Suppose that the file _test.dat_ looks like this: + + +``` +this +is +the +way +the +world +ends +``` + +The command: + + +``` +`% cat test.dat | sort | uniq` +``` + +pipes the output from the _cat_ (concatenate) process into the _sort_ process to produce sorted output, and then pipes the sorted output into the _uniq_ process to eliminate duplicate records (in this case, the two occurrences of **the** reduce to one): + + +``` +ends +is +the +this +way +world +``` + +The scene now is set for a program with two processes that communicate through an unnamed pipe. + +#### Example 1. Two processes communicating through an unnamed pipe. + + +``` +#include /* wait */ +#include +#include /* exit functions */ +#include /* read, write, pipe, _exit */ +#include + +#define ReadEnd 0 +#define WriteEnd 1 + +void report_and_exit(const char* msg) { +[perror][6](msg); +[exit][7](-1); /** failure **/ +} + +int main() { +int pipeFDs[2]; /* two file descriptors */ +char buf; /* 1-byte buffer */ +const char* msg = "Nature's first green is gold\n"; /* bytes to write */ + +if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); +pid_t cpid = fork(); /* fork a child process */ +if (cpid < 0) report_and_exit("fork"); /* check for failure */ + +if (0 == cpid) { /*** child ***/ /* child process */ +close(pipeFDs[WriteEnd]); /* child reads, doesn't write */ + +while (read(pipeFDs[ReadEnd], &buf, 1) > 0) /* read until end of byte stream */ +write(STDOUT_FILENO, &buf, sizeof(buf)); /* echo to the standard output */ + +close(pipeFDs[ReadEnd]); /* close the ReadEnd: all done */ +_exit(0); /* exit and notify parent at once */ +} +else { /*** parent ***/ +close(pipeFDs[ReadEnd]); /* parent writes, doesn't read */ + +write(pipeFDs[WriteEnd], msg, [strlen][8](msg)); /* write the bytes to the pipe */ +close(pipeFDs[WriteEnd]); /* done writing: generate eof */ + +wait(NULL); /* wait for child to exit */ +[exit][7](0); /* exit normally */ +} +return 0; +} +``` + +The _pipeUN_ program above uses the system function **fork** to create a process. Although the program has but a single source file, multi-processing occurs during (successful) execution. Here are the particulars in a quick review of how the library function **fork** works: + + * The **fork** function, called in the _parent_ process, returns **-1** to the parent in case of failure. In the _pipeUN_ example, the call is: [code]`pid_t cpid = fork(); /* called in parent */`[/code] The returned value is stored, in this example, in the variable **cpid** of integer type **pid_t**. (Every process has its own _process ID_ , a non-negative integer that identifies the process.) Forking a new process could fail for several reasons, including a full _process table_ , a structure that the system maintains to track processes. Zombie processes, clarified shortly, can cause a process table to fill if these are not harvested. + * If the **fork** call succeeds, it thereby spawns (creates) a new child process, returning one value to the parent but a different value to the child. Both the parent and the child process execute the _same_ code that follows the call to **fork**. (The child inherits copies of all the variables declared so far in the parent.) In particular, a successful call to **fork** returns: + * Zero to the child process + * The child's process ID to the parent + * An _if/else_ or equivalent construct typically is used after a successful **fork** call to segregate code meant for the parent from code meant for the child. In this example, the construct is: [code] if (0 == cpid) { /*** child ***/ +... +} +else { /*** parent ***/ +... +} +``` +If forking a child succeeds, the _pipeUN_ program proceeds as follows. There is an integer array: +``` +`int pipeFDs[2]; /* two file descriptors */` +``` +to hold two file descriptors, one for writing to the pipe and another for reading from the pipe. (The array element **pipeFDs[0]** is the file descriptor for the read end, and the array element **pipeFDs[1]** is the file descriptor for the write end.) A successful call to the system **pipe** function, made immediately before the call to **fork** , populates the array with the two file descriptors: +``` +`if (pipe(pipeFDs) < 0) report_and_exit("pipeFD");` +``` +The parent and the child now have copies of both file descriptors, but the _separation of concerns_ pattern means that each process requires exactly one of the descriptors. In this example, the parent does the writing and the child does the reading, although the roles could be reversed. The first statement in the child _if_ -clause code, therefore, closes the pipe's write end: +``` +`close(pipeFDs[WriteEnd]); /* called in child code */` +``` +and the first statement in the parent _else_ -clause code closes the pipe's read end: +``` +`close(pipeFDs[ReadEnd]); /* called in parent code */` +``` +The parent then writes some bytes (ASCII codes) to the unnamed pipe, and the child reads these and echoes them to the standard output. + +One more aspect of the program needs clarification: the call to the **wait** function in the parent code. Once spawned, a child process is largely independent of its parent, as even the short _pipeUN_ program illustrates. The child can execute arbitrary code that may have nothing to do with the parent. However, the system does notify the parent through a signal—if and when the child terminates. + +What if the parent terminates before the child? In this case, unless precautions are taken, the child becomes and remains a _zombie_ process with an entry in the process table. The precautions are of two broad types. One precaution is to have the parent notify the system that the parent has no interest in the child's termination: +``` +`signal(SIGCHLD, SIG_IGN); /* in parent: ignore notification */` +``` +A second approach is to have the parent execute a **wait** on the child's termination, thereby ensuring that the parent outlives the child. This second approach is used in the _pipeUN_ program, where the parent code has this call: +``` +`wait(NULL); /* called in parent */` +``` +This call to **wait** means _wait until the termination of any child occurs_ , and in the _pipeUN_ program, there is only one child process. (The **NULL** argument could be replaced with the address of an integer variable to hold the child's exit status.) There is a more flexible **waitpid** function for fine-grained control, e.g., for specifying a particular child process among several. + +The _pipeUN_ program takes another precaution. When the parent is done waiting, the parent terminates with the call to the regular **exit** function. By contrast, the child terminates with a call to the **_exit** variant, which fast-tracks notification of termination. In effect, the child is telling the system to notify the parent ASAP that the child has terminated. + +If two processes write to the same unnamed pipe, can the bytes be interleaved? For example, if process P1 writes: +``` +`foo bar` +``` +to a pipe and process P2 concurrently writes: +``` +`baz baz` +``` +to the same pipe, it seems that the pipe contents might be something arbitrary, such as: +``` +`baz foo baz bar` +``` +The POSIX standard ensures that writes are not interleaved so long as no write exceeds **PIPE_BUF** bytes. On Linux systems, **PIPE_BUF** is 4,096 bytes in size. My preference with pipes is to have a single writer and a single reader, thereby sidestepping the issue. + +## Named pipes + +An unnamed pipe has no backing file: the system maintains an in-memory buffer to transfer bytes from the writer to the reader. Once the writer and reader terminate, the buffer is reclaimed, so the unnamed pipe goes away. By contrast, a named pipe has a backing file and a distinct API. + +Let's look at another command line example to get the gist of named pipes. Here are the steps: + + * Open two terminals. The working directory should be the same for both. + * In one of the terminals, enter these two commands (the prompt again is **%** , and my comments start with **##** ): [code] % mkfifo tester ## creates a backing file named tester +% cat tester ## type the pipe's contents to stdout [/code] At the beginning, nothing should appear in the terminal because nothing has been written yet to the named pipe. + * In the second terminal, enter the command: [code] % cat > tester ## redirect keyboard input to the pipe +hello, world! ## then hit Return key +bye, bye ## ditto + ## terminate session with a Control-C [/code] Whatever is typed into this terminal is echoed in the other. Once **Ctrl+C** is entered, the regular command line prompt returns in both terminals: the pipe has been closed. + * Clean up by removing the file that implements the named pipe: [code]`% unlink tester` +``` + + + +As the utility's name _mkfifo_ implies, a named pipe also is called a FIFO because the first byte in is the first byte out, and so on. There is a library function named **mkfifo** that creates a named pipe in programs and is used in the next example, which consists of two processes: one writes to the named pipe and the other reads from this pipe. + +#### Example 2. The _fifoWriter_ program + + +``` +#include +#include +#include +#include +#include +#include +#include + +#define MaxLoops 12000 /* outer loop */ +#define ChunkSize 16 /* how many written at a time */ +#define IntsPerChunk 4 /* four 4-byte ints per chunk */ +#define MaxZs 250 /* max microseconds to sleep */ + +int main() { +const char* pipeName = "./fifoChannel"; +mkfifo(pipeName, 0666); /* read/write for user/group/others */ +int fd = open(pipeName, O_CREAT | O_WRONLY); /* open as write-only */ +if (fd < 0) return -1; /* can't go on */ + +int i; +for (i = 0; i < MaxLoops; i++) { /* write MaxWrites times */ +int j; +for (j = 0; j < ChunkSize; j++) { /* each time, write ChunkSize bytes */ +int k; +int chunk[IntsPerChunk]; +for (k = 0; k < IntsPerChunk; k++) +chunk[k] = [rand][9](); +write(fd, chunk, sizeof(chunk)); +} +usleep(([rand][9]() % MaxZs) + 1); /* pause a bit for realism */ +} + +close(fd); /* close pipe: generates an end-of-stream marker */ +unlink(pipeName); /* unlink from the implementing file */ +[printf][10]("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); + +return 0; +} +``` + +The _fifoWriter_ program above can be summarized as follows: + + * The program creates a named pipe for writing: [code] mkfifo(pipeName, 0666); /* read/write perms for user/group/others */ +int fd = open(pipeName, O_CREAT | O_WRONLY); [/code] where **pipeName** is the name of the backing file passed to **mkfifo** as the first argument. The named pipe then is opened with the by-now familiar call to the **open** function, which returns a file descriptor. + * For a touch of realism, the _fifoWriter_ does not write all the data at once, but instead writes a chunk, sleeps a random number of microseconds, and so on. In total, 768,000 4-byte integer values are written to the named pipe. + * After closing the named pipe, the _fifoWriter_ also unlinks the file: [code] close(fd); /* close pipe: generates end-of-stream marker */ +unlink(pipeName); /* unlink from the implementing file */ [/code] The system reclaims the backing file once every process connected to the pipe has performed the unlink operation. In this example, there are only two such processes: the _fifoWriter_ and the _fifoReader_ , both of which do an _unlink_ operation. + + + +The two programs should be executed in different terminals with the same working directory. However, the _fifoWriter_ should be started before the _fifoReader_ , as the former creates the pipe. The _fifoReader_ then accesses the already created named pipe. + +#### Example 3. The _fifoReader_ program + + +``` +#include +#include +#include +#include +#include + +unsigned is_prime(unsigned n) { /* not pretty, but efficient */ +if (n <= 3) return n > 1; +if (0 == (n % 2) || 0 == (n % 3)) return 0; + +unsigned i; +for (i = 5; (i * i) <= n; i += 6) +if (0 == (n % i) || 0 == (n % (i + 2))) return 0; + +return 1; /* found a prime! */ +} + +int main() { +const char* file = "./fifoChannel"; +int fd = open(file, O_RDONLY); +if (fd < 0) return -1; /* no point in continuing */ +unsigned count = 0, total = 0, primes_count = 0; + +while (1) { +int next; +int i; + +ssize_t count = read(fd, &next, sizeof(int)); +if (0 == count) break; /* end of stream */ +else if (count == sizeof(int)) { /* read a 4-byte int value */ +total++; +if (is_prime(next)) primes_count++; +} +} + +close(fd); /* close pipe from read end */ +unlink(file); /* unlink from the underlying file */ +[printf][10]("Received ints: %u, primes: %u\n", total, primes_count); + +return 0; +} +``` + +The _fifoReader_ program above can be summarized as follows: + + * Because the _fifoWriter_ creates the named pipe, the _fifoReader_ needs only the standard call **open** to access the pipe through the backing file: [code] const char* file = "./fifoChannel"; +int fd = open(file, O_RDONLY); [/code] The file opens as read-only. + * The program then goes into a potentially infinite loop, trying to read a 4-byte chunk on each iteration. The **read** call: [code]`ssize_t count = read(fd, &next, sizeof(int));`[/code] returns 0 to indicate end-of-stream, in which case the _fifoReader_ breaks out of the loop, closes the named pipe, and unlinks the backing file before terminating. + * After reading a 4-byte integer, the _fifoReader_ checks whether the number is a prime. This represents the business logic that a production-grade reader might perform on the received bytes. On a sample run, there were 37,682 primes among the 768,000 integers received. + + + +On repeated sample runs, the _fifoReader_ successfully read all of the bytes that the _fifoWriter_ wrote. This is not surprising. The two processes execute on the same host, taking network issues out of the equation. Named pipes are a highly reliable and efficient IPC mechanism and, therefore, in wide use. + +Here is the output from the two programs, each launched from a separate terminal but with the same working directory: + + +``` +% ./fifoWriter +768000 ints sent to the pipe. +### +% ./fifoReader +Received ints: 768000, primes: 37682 +``` + +### Message queues + +Pipes have strict FIFO behavior: the first byte written is the first byte read, the second byte written is the second byte read, and so forth. Message queues can behave in the same way but are flexible enough that byte chunks can be retrieved out of FIFO order. + +As the name suggests, a message queue is a sequence of messages, each of which has two parts: + + * The payload, which is an array of bytes ( **char** in C) + * A type, given as a positive integer value; types categorize messages for flexible retrieval + + + +Consider the following depiction of a message queue, with each message labeled with an integer type: + + +``` ++-+ +-+ +-+ +-+ +sender--->|3|--->|2|--->|2|--->|1|--->receiver ++-+ +-+ +-+ +-+ +``` + +Of the four messages shown, the one labeled 1 is at the front, i.e., closest to the receiver. Next come two messages with label 2, and finally, a message labeled 3 at the back. If strict FIFO behavior were in play, then the messages would be received in the order 1-2-2-3. However, the message queue allows other retrieval orders. For example, the messages could be retrieved by the receiver in the order 3-2-1-2. + +The _mqueue_ example consists of two programs, the _sender_ that writes to the message queue and the _receiver_ that reads from this queue. Both programs include the header file _queue.h_ shown below: + +#### Example 4. The header file _queue.h_ + + +``` +#define ProjectId 123 +#define PathName "queue.h" /* any existing, accessible file would do */ +#define MsgLen 4 +#define MsgCount 6 + +typedef struct { +long type; /* must be of type long */ +char payload[MsgLen + 1]; /* bytes in the message */ +} queuedMessage; +``` + +The header file defines a structure type named **queuedMessage** , with **payload** (byte array) and **type** (integer) fields. This file also defines symbolic constants (the **#define** statements), the first two of which are used to generate a key that, in turn, is used to get a message queue ID. The **ProjectId** can be any positive integer value, and the **PathName** must be an existing, accessible file—in this case, the file _queue.h_. The setup statements in both the _sender_ and the _receiver_ programs are: + + +``` +key_t key = ftok(PathName, ProjectId); /* generate key */ +int qid = msgget(key, 0666 | IPC_CREAT); /* use key to get queue id */ +``` + +The ID **qid** is, in effect, the counterpart of a file descriptor for message queues. + +#### Example 5. The message _sender_ program + + +``` +#include +#include +#include +#include +#include +#include "queue.h" + +void report_and_exit(const char* msg) { +[perror][6](msg); +[exit][7](-1); /* EXIT_FAILURE */ +} + +int main() { +key_t key = ftok(PathName, ProjectId); +if (key < 0) report_and_exit("couldn't get key..."); + +int qid = msgget(key, 0666 | IPC_CREAT); +if (qid < 0) report_and_exit("couldn't get queue id..."); + +char* payloads[] = {"msg1", "msg2", "msg3", "msg4", "msg5", "msg6"}; +int types[] = {1, 1, 2, 2, 3, 3}; /* each must be > 0 */ +int i; +for (i = 0; i < MsgCount; i++) { +/* build the message */ +queuedMessage msg; +msg.type = types[i]; +[strcpy][11](msg.payload, payloads[i]); + +/* send the message */ +msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); /* don't block */ +[printf][10]("%s sent as type %i\n", msg.payload, (int) msg.type); +} +return 0; +} +``` + +The _sender_ program above sends out six messages, two each of a specified type: the first messages are of type 1, the next two of type 2, and the last two of type 3. The sending statement: + + +``` +`msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT);` +``` + +is configured to be non-blocking (the flag **IPC_NOWAIT** ) because the messages are so small. The only danger is that a full queue, unlikely in this example, would result in a sending failure. The _receiver_ program below also receives messages using the **IPC_NOWAIT** flag. + +#### Example 6. The message _receiver_ program + + +``` +#include +#include +#include +#include +#include "queue.h" + +void report_and_exit(const char* msg) { +[perror][6](msg); +[exit][7](-1); /* EXIT_FAILURE */ +} + +int main() { +key_t key= ftok(PathName, ProjectId); /* key to identify the queue */ +if (key < 0) report_and_exit("key not gotten..."); + +int qid = msgget(key, 0666 | IPC_CREAT); /* access if created already */ +if (qid < 0) report_and_exit("no access to queue..."); + +int types[] = {3, 1, 2, 1, 3, 2}; /* different than in sender */ +int i; +for (i = 0; i < MsgCount; i++) { +queuedMessage msg; /* defined in queue.h */ +if (msgrcv(qid, &msg, sizeof(msg), types[i], MSG_NOERROR | IPC_NOWAIT) < 0) +[puts][12]("msgrcv trouble..."); +[printf][10]("%s received as type %i\n", msg.payload, (int) msg.type); +} + +/** remove the queue **/ +if (msgctl(qid, IPC_RMID, NULL) < 0) /* NULL = 'no flags' */ +report_and_exit("trouble removing queue..."); + +return 0; +} +``` + +The _receiver_ program does not create the message queue, although the API suggests as much. In the _receiver_ , the call: + + +``` +`int qid = msgget(key, 0666 | IPC_CREAT);` +``` + +is misleading because of the **IPC_CREAT** flag, but this flag really means _create if needed, otherwise access_. The _sender_ program calls **msgsnd** to send messages, whereas the _receiver_ calls **msgrcv** to retrieve them. In this example, the _sender_ sends the messages in the order 1-1-2-2-3-3, but the _receiver_ then retrieves them in the order 3-1-2-1-3-2, showing that message queues are not bound to strict FIFO behavior: + + +``` +% ./sender +msg1 sent as type 1 +msg2 sent as type 1 +msg3 sent as type 2 +msg4 sent as type 2 +msg5 sent as type 3 +msg6 sent as type 3 + +% ./receiver +msg5 received as type 3 +msg1 received as type 1 +msg3 received as type 2 +msg2 received as type 1 +msg6 received as type 3 +msg4 received as type 2 +``` + +The output above shows that the _sender_ and the _receiver_ can be launched from the same terminal. The output also shows that the message queue persists even after the _sender_ process creates the queue, writes to it, and exits. The queue goes away only after the _receiver_ process explicitly removes it with the call to **msgctl** : + + +``` +`if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */` +``` + +### Wrapping up + +The pipes and message queue APIs are fundamentally _unidirectional_ : one process writes and another reads. There are implementations of bidirectional named pipes, but my two cents is that this IPC mechanism is at its best when it is simplest. As noted earlier, message queues have fallen in popularity—but without good reason; these queues are yet another tool in the IPC toolbox. Part 3 completes this quick tour of the IPC toolbox with code examples of IPC through sockets and signals. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-channels + +作者:[Marty Kalin][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/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://en.wikipedia.org/wiki/Inter-process_communication +[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 +[4]: http://man7.org/linux/man-pages/man2/mq_open.2.html +[5]: http://man7.org/linux/man-pages/man2/mq_open.2.html#ATTRIBUTES +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/rand.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html From 40f861baf382a096edbd3922c2833d7a5d35c0e6 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:48:49 +0800 Subject: [PATCH 0013/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Blen?= =?UTF-8?q?der=20short=20film,=20new=20license=20for=20Chef,=20ethics=20in?= =?UTF-8?q?=20open=20source,=20and=20more=20news=20sources/tech/20190415?= =?UTF-8?q?=20Blender=20short=20film,=20new=20license=20for=20Chef,=20ethi?= =?UTF-8?q?cs=20in=20open=20source,=20and=20more=20news.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...f, ethics in open source, and more news.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md diff --git a/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md b/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md new file mode 100644 index 0000000000..5bc9aaf92f --- /dev/null +++ b/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blender short film, new license for Chef, ethics in open source, and more news) +[#]: via: (https://opensource.com/article/15/4/news-april-15) +[#]: author: (Joshua Allen Holm (Community Moderator) https://opensource.com/users/holmja) + +Blender short film, new license for Chef, ethics in open source, and more news +====== +Here are some of the biggest headlines in open source in the last two +weeks +![][1] + +In this edition of our open source news roundup, we take a look at the 12th Blender short film, Chef shifts away from open core toward a 100% open source license, SuperTuxKart's latest release candidate with online multiplayer support, and more. + +### Blender Animation Studio releases Spring + +[Spring][2], the latest short film from [Blender Animation Studio][3], premiered on April 4th. The [press release on Blender.org][4] describes _Spring_ as "the story of a shepherd girl and her dog, who face ancient spirits in order to continue the cycle of life." The development version of Blender 2.80, as well as other open source tools, were used to create this animated short film. The character and asset files for the film are available from [Blender Cloud][5], and tutorials, walkthroughs, and other instructional material are coming soon. + +### The importance of ethics in open source + +Reuven M. Lerner, writing for [Linux Journal][6], shares his thoughts about need for teaching programmers about ethics in an article titled [Open Source Is Winning, and Now It's Time for People to Win Too][7]. Part retrospective looking back at the history of open source and part call to action for moving forward, Lerner's article discusses many issues relevant to open source beyond just coding. He argues that when we teach kids about open source "[w]e also need to inform them of the societal parts of their work, and the huge influence and power that today's programmers have." He continues by stating "It's sometimes okay—and even preferable—for a company to make less money deliberately, when the alternative would be to do things that are inappropriate or illegal." Overall a very thought-provoking piece, Lerner makes a solid case for making sure to remember that the open source movement is about more than free code. + +### Chef transitions from open core to open source + +Chef, the company behind the well-known DevOps automation tool, [announced][8] that they will be release 100% of their software as open source under an Apache 2.0 license. This move marks a departure from their current [open core model][9]. Given a tendency for companies to try to move in the opposite direction, Chef's move is a big one. By operating under a fully open source model Chef builds a better, stronger relationship with the community, and the community benefits from full access to all the source code. Even developers of competing projects (and the commercial projects based on those products) benefit from being able to learn from Chef's code, as Chef can do from its open source competitors, which is one of the greatest advantages of open source; the best ideas get to win and business relationships are built around trust and quality of service, not proprietary secrets. For a more detailed look at this development, read Steven J. Vaughan-Nichols's [article for ZDNet][10]. + +### SuperTuxKart releases version 0.10 RC1 for testing + +SuperTuxKart, the open source Mario Kart clone featuring open source mascots, is getting very close to releasing a version that supports online multi-player. On April 5th, the SuperTuxKart blog announced the release of [SuperTuxKart 0.10 Release Candidate 1][11], which needs testing before the final release. Users who want to help test the online and LAN multiplayer options can [download the game from SourceForge][12]. In addition to the new online and LAN features, SuperTuxKart 0.10 features a couple new tracks to race on; Ravenbridge Mansion replaces the old Mansion track, and Black Forest, which was an add-on track in earlier versions, is now part of the official track set. + +#### In other news + + * [My code is your code: Embracing the power of open sourcing][13] + * [FOSS means kids can have a big impact][14] + * [Open-source textbooks lighten students’ financial load][15] + * [Developing the ultimate open source radio control transmitter][16] + * [How does open source tech transform Government?][17] + + + +_Thanks, as always, to Opensource.com staff members and moderators for their help this week._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/15/4/news-april-15 + +作者:[Joshua Allen Holm (Community Moderator)][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/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i +[2]: https://www.youtube.com/watch?v=WhWc3b3KhnY (Spring) +[3]: https://blender.studio/ (Blender Animation Studio) +[4]: https://www.blender.org/press/spring-open-movie/ (Spring Open Movie) +[5]: https://cloud.blender.org/p/spring/ (Spring on Blender Cloud) +[6]: https://www.linuxjournal.com/ (Linux Journal) +[7]: https://www.linuxjournal.com/content/open-source-winning-and-now-its-time-people-win-too (Open Source Is Winning, and Now It's Time for People to Win Too) +[8]: https://blog.chef.io/2019/04/02/chef-software-announces-the-enterprise-automation-stack/ (Introducing the New Chef: 100% Open, Always) +[9]: https://en.wikipedia.org/wiki/Open-core_model (Wikipedia: Open-core model) +[10]: https://www.zdnet.com/article/leading-devops-program-chef-goes-all-in-with-open-source/ (Leading DevOps program Chef goes all in with open source) +[11]: http://blog.supertuxkart.net/2019/04/supertuxkart-010-release-candidate-1.html (SuperTuxKart 0.10 Release Candidate 1 Released) +[12]: https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart/0.10-rc1/ (SourceForge: SuperTuxKart) +[13]: https://www.forbes.com/sites/forbestechcouncil/2019/04/10/my-code-is-your-code-embracing-the-power-of-open-sourcing/ (My code is your code: Embracing the power of open sourcing) +[14]: https://www.linuxjournal.com/content/foss-means-kids-can-have-big-impact (FOSS means kids can have a big impact) +[15]: https://www.schoolnewsnetwork.org/2019/04/09/open-source-textbooks-lighten-students-financial-load/ (Open-source textbooks lighten students’ financial load) +[16]: https://hackaday.com/2019/04/03/developing-the-ultimate-open-source-radio-control-transmitter/ (Developing the ultimate open source radio control transmitter) +[17]: https://www.openaccessgovernment.org/open-source-tech-transform/62059/ (How does open source tech transform Government?) From 14e725c85caa504ade46672b1bddf2621a32c563 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:49:10 +0800 Subject: [PATCH 0014/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Gett?= =?UTF-8?q?ing=20started=20with=20Mercurial=20for=20version=20control=20so?= =?UTF-8?q?urces/tech/20190415=20Getting=20started=20with=20Mercurial=20fo?= =?UTF-8?q?r=20version=20control.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rted with Mercurial for version control.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20190415 Getting started with Mercurial for version control.md diff --git a/sources/tech/20190415 Getting started with Mercurial for version control.md b/sources/tech/20190415 Getting started with Mercurial for version control.md new file mode 100644 index 0000000000..c2e451fd06 --- /dev/null +++ b/sources/tech/20190415 Getting started with Mercurial for version control.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Mercurial for version control) +[#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) +[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) + +Getting started with Mercurial for version control +====== +Learn the basics of Mercurial, a distributed version control system +written in Python. +![][1] + +[Mercurial][2] is a distributed version control system written in Python. Because it's written in a high-level language, you can write a Mercurial extension with a few Python functions. + +There are several ways to install Mercurial, which are explained in the [official documentation][3]. My favorite one is not there: using **pip**. This is the most amenable way to develop local extensions! + +For now, Mercurial only supports Python 2.7, so you will need to create a Python 2.7 virtual environment: + + +``` +python2 -m virtualenv mercurial-env +./mercurial-env/bin/pip install mercurial +``` + +To have a short command, and to satisfy everyone's insatiable need for chemistry-based humor, the command is called **hg**. + + +``` +$ source mercurial-env/bin/activate +(mercurial-env)$ mkdir test-dir +(mercurial-env)$ cd test-dir +(mercurial-env)$ hg init +(mercurial-env)$ hg status +(mercurial-env)$ +``` + +The status is empty since you do not have any files. Add a couple of files: + + +``` +(mercurial-env)$ echo 1 > one +(mercurial-env)$ echo 2 > two +(mercurial-env)$ hg status +? one +? two +(mercurial-env)$ hg addremove +adding one +adding two +(mercurial-env)$ hg commit -m 'Adding stuff' +(mercurial-env)$ hg log +changeset: 0:1f1befb5d1e9 +tag: tip +user: Moshe Zadka <[moshez@zadka.club][4]> +date: Fri Mar 29 12:42:43 2019 -0700 +summary: Adding stuff +``` + +The **addremove** command is useful: it adds any new files that are not ignored to the list of managed files and removes any files that have been removed. + +As I mentioned, Mercurial extensions are written in Python—they are just regular Python modules. + +This is an example of a short Mercurial extension: + + +``` +from mercurial import registrar +from mercurial.i18n import _ + +cmdtable = {} +command = registrar.command(cmdtable) + +@command('say-hello', +[('w', 'whom', '', _('Whom to greet'))]) +def say_hello(ui, repo, **opts): +ui.write("hello ", opts['whom'], "\n") +``` + +A simple way to test it is to put it in a file in the virtual environment manually: + + +``` +`$ vi ../mercurial-env/lib/python2.7/site-packages/hello_ext.py` +``` + +Then you need to _enable_ the extension. You can start by enabling it only in the current repository: + + +``` +$ cat >> .hg/hgrc +[extensions] +hello_ext = +``` + +Now, a greeting is possible: + + +``` +(mercurial-env)$ hg say-hello --whom world +hello world +``` + +Most extensions will do more useful stuff—possibly even things to do with Mercurial. The **repo** object is a **mercurial.hg.repository** object. + +Refer to the [official documentation][5] for more about Mercurial's API. And visit the [official repo][6] for more examples and inspiration. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/getting-started-mercurial + +作者:[Moshe Zadka (Community Moderator)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO +[2]: https://www.mercurial-scm.org/ +[3]: https://www.mercurial-scm.org/wiki/UnixInstall +[4]: mailto:moshez@zadka.club +[5]: https://www.mercurial-scm.org/wiki/MercurialApi#Repositories +[6]: https://www.mercurial-scm.org/repo/hg/file/tip/hgext From 2e776e212f573b14b2a07defc3c6a1567d07048f Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:49:21 +0800 Subject: [PATCH 0015/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Inte?= =?UTF-8?q?r-process=20communication=20in=20Linux:=20Shared=20storage=20so?= =?UTF-8?q?urces/tech/20190415=20Inter-process=20communication=20in=20Linu?= =?UTF-8?q?x-=20Shared=20storage.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... communication in Linux- Shared storage.md | 419 ++++++++++++++++++ 1 file changed, 419 insertions(+) create mode 100644 sources/tech/20190415 Inter-process communication in Linux- Shared storage.md diff --git a/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md b/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md new file mode 100644 index 0000000000..bf6c2c07cc --- /dev/null +++ b/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md @@ -0,0 +1,419 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inter-process communication in Linux: Shared storage) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-storage) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Inter-process communication in Linux: Shared storage +====== +Learn how processes synchronize with each other in Linux. +![Filing papers and documents][1] + +This is the first article in a series about [interprocess communication][2] (IPC) in Linux. The series uses code examples in C to clarify the following IPC mechanisms: + + * Shared files + * Shared memory (with semaphores) + * Pipes (named and unnamed) + * Message queues + * Sockets + * Signals + + + +This article reviews some core concepts before moving on to the first two of these mechanisms: shared files and shared memory. + +### Core concepts + +A _process_ is a program in execution, and each process has its own address space, which comprises the memory locations that the process is allowed to access. A process has one or more _threads_ of execution, which are sequences of executable instructions: a _single-threaded_ process has just one thread, whereas a _multi-threaded_ process has more than one thread. Threads within a process share various resources, in particular, address space. Accordingly, threads within a process can communicate straightforwardly through shared memory, although some modern languages (e.g., Go) encourage a more disciplined approach such as the use of thread-safe channels. Of interest here is that different processes, by default, do _not_ share memory. + +There are various ways to launch processes that then communicate, and two ways dominate in the examples that follow: + + * A terminal is used to start one process, and perhaps a different terminal is used to start another. + * The system function **fork** is called within one process (the parent) to spawn another process (the child). + + + +The first examples take the terminal approach. The [code examples][3] are available in a ZIP file on my website. + +### Shared files + +Programmers are all too familiar with file access, including the many pitfalls (non-existent files, bad file permissions, and so on) that beset the use of files in programs. Nonetheless, shared files may be the most basic IPC mechanism. Consider the relatively simple case in which one process ( _producer_ ) creates and writes to a file, and another process ( _consumer_ ) reads from this same file: + + +``` +writes +-----------+ reads +producer-------->| disk file |<\-------consumer ++-----------+ +``` + +The obvious challenge in using this IPC mechanism is that a _race condition_ might arise: the producer and the consumer might access the file at exactly the same time, thereby making the outcome indeterminate. To avoid a race condition, the file must be locked in a way that prevents a conflict between a _write_ operation and any another operation, whether a _read_ or a _write_. The locking API in the standard system library can be summarized as follows: + + * A producer should gain an exclusive lock on the file before writing to the file. An _exclusive_ lock can be held by one process at most, which rules out a race condition because no other process can access the file until the lock is released. + * A consumer should gain at least a shared lock on the file before reading from the file. Multiple _readers_ can hold a _shared_ lock at the same time, but no _writer_ can access a file when even a single _reader_ holds a shared lock. + + + +A shared lock promotes efficiency. If one process is just reading a file and not changing its contents, there is no reason to prevent other processes from doing the same. Writing, however, clearly demands exclusive access to a file. + +The standard I/O library includes a utility function named **fcntl** that can be used to inspect and manipulate both exclusive and shared locks on a file. The function works through a _file descriptor_ , a non-negative integer value that, within a process, identifies a file. (Different file descriptors in different processes may identify the same physical file.) For file locking, Linux provides the library function **flock** , which is a thin wrapper around **fcntl**. The first example uses the **fcntl** function to expose API details. + +#### Example 1. The _producer_ program + + +``` +#include +#include +#include +#include +#include + +#define FileName "data.dat" +#define DataString "Now is the winter of our discontent\nMade glorious summer by this sun of York\n" + +void report_and_exit(const char* msg) { +[perror][4](msg); +[exit][5](-1); /* EXIT_FAILURE */ +} + +int main() { +struct flock lock; +lock.l_type = F_WRLCK; /* read/write (exclusive versus shared) lock */ +lock.l_whence = SEEK_SET; /* base for seek offsets */ +lock.l_start = 0; /* 1st byte in file */ +lock.l_len = 0; /* 0 here means 'until EOF' */ +lock.l_pid = getpid(); /* process id */ + +int fd; /* file descriptor to identify a file within a process */ +if ((fd = open(FileName, O_RDWR | O_CREAT, 0666)) < 0) /* -1 signals an error */ +report_and_exit("open failed..."); + +if (fcntl(fd, F_SETLK, &lock) < 0) /** F_SETLK doesn't block, F_SETLKW does **/ +report_and_exit("fcntl failed to get lock..."); +else { +write(fd, DataString, [strlen][6](DataString)); /* populate data file */ +[fprintf][7](stderr, "Process %d has written to data file...\n", lock.l_pid); +} + +/* Now release the lock explicitly. */ +lock.l_type = F_UNLCK; +if (fcntl(fd, F_SETLK, &lock) < 0) +report_and_exit("explicit unlocking failed..."); + +close(fd); /* close the file: would unlock if needed */ +return 0; /* terminating the process would unlock as well */ +} +``` + +The main steps in the _producer_ program above can be summarized as follows: + + * The program declares a variable of type **struct flock** , which represents a lock, and initializes the structure's five fields. The first initialization: [code]`lock.l_type = F_WRLCK; /* exclusive lock */`[/code] makes the lock an exclusive ( _read-write_ ) rather than a shared ( _read-only_ ) lock. If the _producer_ gains the lock, then no other process will be able to write or read the file until the _producer_ releases the lock, either explicitly with the appropriate call to **fcntl** or implicitly by closing the file. (When the process terminates, any opened files would be closed automatically, thereby releasing the lock.) + * The program then initializes the remaining fields. The chief effect is that the _entire_ file is to be locked. However, the locking API allows only designated bytes to be locked. For example, if the file contains multiple text records, then a single record (or even part of a record) could be locked and the rest left unlocked. + * The first call to **fcntl** : [code]`if (fcntl(fd, F_SETLK, &lock) < 0)`[/code] tries to lock the file exclusively, checking whether the call succeeded. In general, the **fcntl** function returns **-1** (hence, less than zero) to indicate failure. The second argument **F_SETLK** means that the call to **fcntl** does _not_ block: the function returns immediately, either granting the lock or indicating failure. If the flag **F_SETLKW** (the **W** at the end is for _wait_ ) were used instead, the call to **fcntl** would block until gaining the lock was possible. In the calls to **fcntl** , the first argument **fd** is the file descriptor, the second argument specifies the action to be taken (in this case, **F_SETLK** for setting the lock), and the third argument is the address of the lock structure (in this case, **& lock**). + * If the _producer_ gains the lock, the program writes two text records to the file. + * After writing to the file, the _producer_ changes the lock structure's **l_type** field to the _unlock_ value: [code]`lock.l_type = F_UNLCK;`[/code] and calls **fcntl** to perform the unlocking operation. The program finishes up by closing the file and exiting. + + + +#### Example 2. The _consumer_ program + + +``` +#include +#include +#include +#include + +#define FileName "data.dat" + +void report_and_exit(const char* msg) { +[perror][4](msg); +[exit][5](-1); /* EXIT_FAILURE */ +} + +int main() { +struct flock lock; +lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ +lock.l_whence = SEEK_SET; /* base for seek offsets */ +lock.l_start = 0; /* 1st byte in file */ +lock.l_len = 0; /* 0 here means 'until EOF' */ +lock.l_pid = getpid(); /* process id */ + +int fd; /* file descriptor to identify a file within a process */ +if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ +report_and_exit("open to read failed..."); + +/* If the file is write-locked, we can't continue. */ +fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ +if (lock.l_type != F_UNLCK) +report_and_exit("file is still write locked..."); + +lock.l_type = F_RDLCK; /* prevents any writing during the reading */ +if (fcntl(fd, F_SETLK, &lock) < 0) +report_and_exit("can't get a read-only lock..."); + +/* Read the bytes (they happen to be ASCII codes) one at a time. */ +int c; /* buffer for read bytes */ +while (read(fd, &c, 1) > 0) /* 0 signals EOF */ +write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ + +/* Release the lock explicitly. */ +lock.l_type = F_UNLCK; +if (fcntl(fd, F_SETLK, &lock) < 0) +report_and_exit("explicit unlocking failed..."); + +close(fd); +return 0; +} +``` + +The _consumer_ program is more complicated than necessary to highlight features of the locking API. In particular, the _consumer_ program first checks whether the file is exclusively locked and only then tries to gain a shared lock. The relevant code is: + + +``` +lock.l_type = F_WRLCK; +... +fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ +if (lock.l_type != F_UNLCK) +report_and_exit("file is still write locked..."); +``` + +The **F_GETLK** operation specified in the **fcntl** call checks for a lock, in this case, an exclusive lock given as **F_WRLCK** in the first statement above. If the specified lock does not exist, then the **fcntl** call automatically changes the lock type field to **F_UNLCK** to indicate this fact. If the file is exclusively locked, the _consumer_ terminates. (A more robust version of the program might have the _consumer_ **sleep** a bit and try again several times.) + +If the file is not currently locked, then the _consumer_ tries to gain a shared ( _read-only_ ) lock ( **F_RDLCK** ). To shorten the program, the **F_GETLK** call to **fcntl** could be dropped because the **F_RDLCK** call would fail if a _read-write_ lock already were held by some other process. Recall that a _read-only_ lock does prevent any other process from writing to the file, but allows other processes to read from the file. In short, a _shared_ lock can be held by multiple processes. After gaining a shared lock, the _consumer_ program reads the bytes one at a time from the file, prints the bytes to the standard output, releases the lock, closes the file, and terminates. + +Here is the output from the two programs launched from the same terminal with **%** as the command line prompt: + + +``` +% ./producer +Process 29255 has written to data file... + +% ./consumer +Now is the winter of our discontent +Made glorious summer by this sun of York +``` + +In this first code example, the data shared through IPC is text: two lines from Shakespeare's play _Richard III_. Yet, the shared file's contents could be voluminous, arbitrary bytes (e.g., a digitized movie), which makes file sharing an impressively flexible IPC mechanism. The downside is that file access is relatively slow, whether the access involves reading or writing. As always, programming comes with tradeoffs. The next example has the upside of IPC through shared memory, rather than shared files, with a corresponding boost in performance. + +### Shared memory + +Linux systems provide two separate APIs for shared memory: the legacy System V API and the more recent POSIX one. These APIs should never be mixed in a single application, however. A downside of the POSIX approach is that features are still in development and dependent upon the installed kernel version, which impacts code portability. For example, the POSIX API, by default, implements shared memory as a _memory-mapped file_ : for a shared memory segment, the system maintains a _backing file_ with corresponding contents. Shared memory under POSIX can be configured without a backing file, but this may impact portability. My example uses the POSIX API with a backing file, which combines the benefits of memory access (speed) and file storage (persistence). + +The shared-memory example has two programs, named _memwriter_ and _memreader_ , and uses a _semaphore_ to coordinate their access to the shared memory. Whenever shared memory comes into the picture with a _writer_ , whether in multi-processing or multi-threading, so does the risk of a memory-based race condition; hence, the semaphore is used to coordinate (synchronize) access to the shared memory. + +The _memwriter_ program should be started first in its own terminal. The _memreader_ program then can be started (within a dozen seconds) in its own terminal. The output from the _memreader_ is: + + +``` +`This is the way the world ends...` +``` + +Each source file has documentation at the top explaining the link flags to be included during compilation. + +Let's start with a review of how semaphores work as a synchronization mechanism. A general semaphore also is called a _counting semaphore_ , as it has a value (typically initialized to zero) that can be incremented. Consider a shop that rents bicycles, with a hundred of them in stock, with a program that clerks use to do the rentals. Every time a bike is rented, the semaphore is incremented by one; when a bike is returned, the semaphore is decremented by one. Rentals can continue until the value hits 100 but then must halt until at least one bike is returned, thereby decrementing the semaphore to 99. + +A _binary semaphore_ is a special case requiring only two values: 0 and 1. In this situation, a semaphore acts as a _mutex_ : a mutual exclusion construct. The shared-memory example uses a semaphore as a mutex. When the semaphore's value is 0, the _memwriter_ alone can access the shared memory. After writing, this process increments the semaphore's value, thereby allowing the _memreader_ to read the shared memory. + +#### Example 3. Source code for the _memwriter_ process + + +``` +/** Compilation: gcc -o memwriter memwriter.c -lrt -lpthread **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "shmem.h" + +void report_and_exit(const char* msg) { +[perror][4](msg); +[exit][5](-1); +} + +int main() { +int fd = shm_open(BackingFile, /* name from smem.h */ +O_RDWR | O_CREAT, /* read/write, create if needed */ +AccessPerms); /* access permissions (0644) */ +if (fd < 0) report_and_exit("Can't open shared mem segment..."); + +ftruncate(fd, ByteSize); /* get the bytes */ + +caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ +ByteSize, /* how many bytes */ +PROT_READ | PROT_WRITE, /* access protections */ +MAP_SHARED, /* mapping visible to other processes */ +fd, /* file descriptor */ +0); /* offset: start at 1st byte */ +if ((caddr_t) -1 == memptr) report_and_exit("Can't get segment..."); + +[fprintf][7](stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); +[fprintf][7](stderr, "backing file: /dev/shm%s\n", BackingFile ); + +/* semaphore code to lock the shared mem */ +sem_t* semptr = sem_open(SemaphoreName, /* name */ +O_CREAT, /* create the semaphore */ +AccessPerms, /* protection perms */ +0); /* initial value */ +if (semptr == (void*) -1) report_and_exit("sem_open"); + +[strcpy][8](memptr, MemContents); /* copy some ASCII bytes to the segment */ + +/* increment the semaphore so that memreader can read */ +if (sem_post(semptr) < 0) report_and_exit("sem_post"); + +sleep(12); /* give reader a chance */ + +/* clean up */ +munmap(memptr, ByteSize); /* unmap the storage */ +close(fd); +sem_close(semptr); +shm_unlink(BackingFile); /* unlink from the backing file */ +return 0; +} +``` + +Here's an overview of how the _memwriter_ and _memreader_ programs communicate through shared memory: + + * The _memwriter_ program, shown above, calls the **shm_open** function to get a file descriptor for the backing file that the system coordinates with the shared memory. At this point, no memory has been allocated. The subsequent call to the misleadingly named function **ftruncate** : [code]`ftruncate(fd, ByteSize); /* get the bytes */`[/code] allocates **ByteSize** bytes, in this case, a modest 512 bytes. The _memwriter_ and _memreader_ programs access the shared memory only, not the backing file. The system is responsible for synchronizing the shared memory and the backing file. + * The _memwriter_ then calls the **mmap** function: [code] caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ +ByteSize, /* how many bytes */ +PROT_READ | PROT_WRITE, /* access protections */ +MAP_SHARED, /* mapping visible to other processes */ +fd, /* file descriptor */ +0); /* offset: start at 1st byte */ [/code] to get a pointer to the shared memory. (The _memreader_ makes a similar call.) The pointer type **caddr_t** starts with a **c** for **calloc** , a system function that initializes dynamically allocated storage to zeroes. The _memwriter_ uses the **memptr** for the later _write_ operation, using the library **strcpy** (string copy) function. + * At this point, the _memwriter_ is ready for writing, but it first creates a semaphore to ensure exclusive access to the shared memory. A race condition would occur if the _memwriter_ were writing while the _memreader_ was reading. If the call to **sem_open** succeeds: [code] sem_t* semptr = sem_open(SemaphoreName, /* name */ +O_CREAT, /* create the semaphore */ +AccessPerms, /* protection perms */ +0); /* initial value */ [/code] then the writing can proceed. The **SemaphoreName** (any unique non-empty name will do) identifies the semaphore in both the _memwriter_ and the _memreader_. The initial value of zero gives the semaphore's creator, in this case, the _memwriter_ , the right to proceed, in this case, to the _write_ operation. + * After writing, the _memwriter_ increments the semaphore value to 1: [code]`if (sem_post(semptr) < 0) ..`[/code] with a call to the **sem_post** function. Incrementing the semaphore releases the mutex lock and enables the _memreader_ to perform its _read_ operation. For good measure, the _memwriter_ also unmaps the shared memory from the _memwriter_ address space: [code]`munmap(memptr, ByteSize); /* unmap the storage *`[/code] This bars the _memwriter_ from further access to the shared memory. + + + +#### Example 4. Source code for the _memreader_ process + + +``` +/** Compilation: gcc -o memreader memreader.c -lrt -lpthread **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "shmem.h" + +void report_and_exit(const char* msg) { +[perror][4](msg); +[exit][5](-1); +} + +int main() { +int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* empty to begin */ +if (fd < 0) report_and_exit("Can't get file descriptor..."); + +/* get a pointer to memory */ +caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ +ByteSize, /* how many bytes */ +PROT_READ | PROT_WRITE, /* access protections */ +MAP_SHARED, /* mapping visible to other processes */ +fd, /* file descriptor */ +0); /* offset: start at 1st byte */ +if ((caddr_t) -1 == memptr) report_and_exit("Can't access segment..."); + +/* create a semaphore for mutual exclusion */ +sem_t* semptr = sem_open(SemaphoreName, /* name */ +O_CREAT, /* create the semaphore */ +AccessPerms, /* protection perms */ +0); /* initial value */ +if (semptr == (void*) -1) report_and_exit("sem_open"); + +/* use semaphore as a mutex (lock) by waiting for writer to increment it */ +if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ +int i; +for (i = 0; i < [strlen][6](MemContents); i++) +write(STDOUT_FILENO, memptr + i, 1); /* one byte at a time */ +sem_post(semptr); +} + +/* cleanup */ +munmap(memptr, ByteSize); +close(fd); +sem_close(semptr); +unlink(BackingFile); +return 0; +} +``` + +In both the _memwriter_ and _memreader_ programs, the shared-memory functions of main interest are **shm_open** and **mmap** : on success, the first call returns a file descriptor for the backing file, which the second call then uses to get a pointer to the shared memory segment. The calls to **shm_open** are similar in the two programs except that the _memwriter_ program creates the shared memory, whereas the _memreader_ only accesses this already created memory: + + +``` +int fd = shm_open(BackingFile, O_RDWR | O_CREAT, AccessPerms); /* memwriter */ +int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* memreader */ +``` + +With a file descriptor in hand, the calls to **mmap** are the same: + + +``` +`caddr_t memptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);` +``` + +The first argument to **mmap** is **NULL** , which means that the system determines where to allocate the memory in virtual address space. It's possible (but tricky) to specify an address instead. The **MAP_SHARED** flag indicates that the allocated memory is shareable among processes, and the last argument (in this case, zero) means that the offset for the shared memory should be the first byte. The **size** argument specifies the number of bytes to be allocated (in this case, 512), and the protection argument indicates that the shared memory can be written and read. + +When the _memwriter_ program executes successfully, the system creates and maintains the backing file; on my system, the file is _/dev/shm/shMemEx_ , with _shMemEx_ as my name (given in the header file _shmem.h_ ) for the shared storage. In the current version of the _memwriter_ and _memreader_ programs, the statement: + + +``` +`shm_unlink(BackingFile); /* removes backing file */` +``` + +removes the backing file. If the **unlink** statement is omitted, then the backing file persists after the program terminates. + +The _memreader_ , like the _memwriter_ , accesses the semaphore through its name in a call to **sem_open**. But the _memreader_ then goes into a wait state until the _memwriter_ increments the semaphore, whose initial value is 0: + + +``` +`if (!sem_wait(semptr)) { /* wait until semaphore != 0 */` +``` + +Once the wait is over, the _memreader_ reads the ASCII bytes from the shared memory, cleans up, and terminates. + +The shared-memory API includes operations explicitly to synchronize the shared memory segment and the backing file. These operations have been omitted from the example to reduce clutter and keep the focus on the memory-sharing and semaphore code. + +The _memwriter_ and _memreader_ programs are likely to execute without inducing a race condition even if the semaphore code is removed: the _memwriter_ creates the shared memory segment and writes immediately to it; the _memreader_ cannot even access the shared memory until this has been created. However, best practice requires that shared-memory access is synchronized whenever a _write_ operation is in the mix, and the semaphore API is important enough to be highlighted in a code example. + +### Wrapping up + +The shared-file and shared-memory examples show how processes can communicate through _shared storage_ , files in one case and memory segments in the other. The APIs for both approaches are relatively straightforward. Do these approaches have a common downside? Modern applications often deal with streaming data, indeed, with massively large streams of data. Neither the shared-file nor the shared-memory approaches are well suited for massive data streams. Channels of one type or another are better suited. Part 2 thus introduces channels and message queues, again with code examples in C. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-storage + +作者:[Marty Kalin][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/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: https://en.wikipedia.org/wiki/Inter-process_communication +[3]: http://condor.depaul.edu/mkalin +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html From 9183f68968c1504ee3b70a541edfaff33f76bffc Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:49:38 +0800 Subject: [PATCH 0016/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Two?= =?UTF-8?q?=20tools=20to=20help=20visualize=20and=20simplify=20your=20data?= =?UTF-8?q?-driven=20operations=20sources/talk/20190416=20Two=20tools=20to?= =?UTF-8?q?=20help=20visualize=20and=20simplify=20your=20data-driven=20ope?= =?UTF-8?q?rations.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd simplify your data-driven operations.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md diff --git a/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md b/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md new file mode 100644 index 0000000000..8a44c56ca7 --- /dev/null +++ b/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Two tools to help visualize and simplify your data-driven operations) +[#]: via: (https://www.networkworld.com/article/3389756/two-tools-to-help-visualize-and-simplify-your-data-driven-operations.html#tk.rss_all) +[#]: author: (Kent McNeil, Vice President of Software, Ciena Blue Planet ) + +Two tools to help visualize and simplify your data-driven operations +====== +Amidst the rising complexity of networks, and influx of data, service providers are striving to keep operational complexity under control. Blue Planet’s Kent McNeil explains how they can turn this challenge into a huge opportunity, and in fact reduce operational effort by exploiting state-of-the-art graph database visualization and delta-based federation technologies. +![danleap][1] + +**Build the picture: Visualize your data** + +The Internet of Things (IoT), 5G, smart technology, virtual reality – all these applications guarantee one thing for communications service providers (CSPs): more data. As networks become increasingly overwhelmed by mounds of data, CSPs are on the hunt for ways to make the most of the intelligence collected and are looking for ways to monetize their services, provide more customizable offerings, and enhance their network performance. + +Customer analytics has gone some way towards fulfilling this need for greater insights, but with the rise in the volume and variety of consumer and IoT applications, the influx of data will increase at a phenomenal rate. The data includes not only customer-related data, but also device and network data, adding complexity to the picture. CSPs must harness this information to understand the relationships between any two things, to understand the connections within their data and to ultimately, leverage it for a better customer experience. + +**See the upward graphical trend with graph databases** + +Traditional relational databases certainly have their use, but graph databases offer a novel perspective. The visual representation between the component parts enables CSPs to understand and analyze the characteristics, as well as to act in a timely manner when confronted with any discrepancies. + +Graph databases can help CSPs tackle this new challenge, ensuring the data is not just stored, but also processed and analyzed. It enables complex network questions to be asked and answered, ensuring that CSPs are not sidelined as “dumb pipes” in the IoT movement. + +The use of graph databases has started to become more mainstream, as businesses see the benefits. IBM conducted a generic industry study, entitled “The State of Graph Databases Worldwide”, which found that people are moving to graph databases for speed, performance enhancement of applications, and streamlined operations. Ways in which businesses are using, or are planning to use, graph technology is highest for network and IT operations, followed by master data management. Performance is a key factor for CSPs, as is personalization, which enables support for more tailored service offerings. + +Another advantage of graph databases for CSPs is that of unravelling the complexity of network inventory in a clear, visualized picture – this capability gives CSPs a competitive advantage as speed and performance become increasingly paramount. This need for speed and reliability will increase tenfold as IoT continues its impressive global ramp-up. Operational complexity also grows as the influx of generated data produced by IoT will further challenge the scalability of existing operational environments. Graph databases can help CSPs tackle this new challenge, ensuring the data is not just stored, but also processed and analyzed. It enables complex network questions to be asked and answered, ensuring that CSPs are not sidelined as “dumb pipes” in the IoT movement. + +**Change the tide of data with delta-based federation** + +New data, updated data, corrected data, deleted data – all needs to be managed, in line with regulations, and instantaneously. But this capability does not exist in the reality of many CSP’s Operational Support Systems (OSS). Many still battle with updating data and relying on full uploads of network inventory in order to perform key service fulfillment and assurance tasks. This method is time-intensive and risky due to potential conflicts and inaccuracies. With data being accessed from a variety of systems, CSPs must have a way to effectively hone in on only what is required. + +Integrating network data into one simplified system limits the impact on the legacy OSS systems. This allows each OSS to continue its specific role, yet to feed data into a single interface, hence enabling teams to see the complete picture and gain efficiencies while launching new services or pinpointing and resolving service and network issues. + +A delta-based federation model ensures that an accurate picture is presented, and only essential changes are conducted reliably and quickly. This simplified method filters the delta changes, reducing the time involved in updating, and minimizing the system load and risks. A validation process takes place to catch any errors or issues with the data, so CSPs can apply checks and retain control over modifications. Integrating network data into one simplified system limits the impact on the legacy OSS systems. This allows each OSS to continue its specific role, yet to feed data into a single interface, hence enabling teams to see the complete picture and gain efficiencies while launching new services or pinpointing and resolving service and network issues. + +**Ride the wave** + +25 billion connected things are predicted by Gartner on a global scale by 2021 and CSPs are already struggling with the current levels of data, which Gartner estimates at 14.2 billion in 2019. Over the last decade, CSPs have faced significant rises in the levels of data consumed as demand for new services and higher bandwidth applications has taken off. This data wave is set to continue and CSPs have two important tools at their disposal helping them ride the wave. Firstly, CSPs have specialist, legacy OSS already in place which they can leverage as a basis for integrating data and implementing optimized systems. Secondly, they can utilize new technologies in database inventory management: graph databases and delta-based federation. The advantages of effectively integrating network data, visualizing it, and creating a clear map of the inter-connections, enable CSPs to make critical decisions more quickly and accurately, resulting in most optimized and informed service operations. + +[Watch this video to learn more about Blue Planet][2] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389756/two-tools-to-help-visualize-and-simplify-your-data-driven-operations.html#tk.rss_all + +作者:[Kent McNeil, Vice President of Software, Ciena Blue Planet][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-165721901-100793858-large.jpg +[2]: https://www.blueplanet.com/resources/IT-plus-network-now-a-powerhouse-combination.html?utm_campaign=X1058319&utm_source=NWW&utm_term=BPVideo&utm_medium=sponsoredpost4 From ba64b81f285338f08d36a4315ce0e7e0de76b6cb Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:49:51 +0800 Subject: [PATCH 0017/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20What?= =?UTF-8?q?=20SDN=20is=20and=20where=20it=E2=80=99s=20going=20sources/talk?= =?UTF-8?q?/20190416=20What=20SDN=20is=20and=20where=20it-s=20going.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190416 What SDN is and where it-s going.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/talk/20190416 What SDN is and where it-s going.md diff --git a/sources/talk/20190416 What SDN is and where it-s going.md b/sources/talk/20190416 What SDN is and where it-s going.md new file mode 100644 index 0000000000..381c227b65 --- /dev/null +++ b/sources/talk/20190416 What SDN is and where it-s going.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What SDN is and where it’s going) +[#]: via: (https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +What SDN is and where it’s going +====== +Software-defined networking (SDN) established a foothold in cloud computing, intent-based networking, and network security, with Cisco, VMware, Juniper and others leading the charge. +![seedkin / Getty Images][1] + +Hardware reigned supreme in the networking world until the emergence of software-defined networking (SDN), a category of technologies that separate the network control plane from the forwarding plane to enable more automated provisioning and policy-based management of network resources. + +SDN's origins can be traced to a research collaboration between Stanford University and the University of California at Berkeley that ultimately yielded the [OpenFlow][2] protocol in the 2008 timeframe. + +**[Learn more about the[difference between SDN and NFV][3]. Get regularly scheduled insights by [signing up for Network World newsletters][4]]** + +OpenFlow is only one of the first SDN canons, but it's a key component because it started the networking software revolution. OpenFlow defined a programmable network protocol that could help manage and direct traffic among routers and switches no matter which vendor made the underlying router or switch. + +In the years since its inception, SDN has evolved into a reputable networking technology offered by key vendors including Cisco, VMware, Juniper, Pluribus and Big Switch. The Open Networking Foundation develops myriad open-source SDN technologies as well. + +"Datacenter SDN no longer attracts breathless hype and fevered expectations, but the market is growing healthily, and its prospects remain robust," wrote Brad Casemore, IDC research vice president, data center networks, in a recent report, [_Worldwide Datacenter Software-Defined Networking Forecast, 2018–2022_][5]*. "*Datacenter modernization, driven by the relentless pursuit of digital transformation and characterized by the adoption of cloudlike infrastructure, will help to maintain growth, as will opportunities to extend datacenter SDN overlays and fabrics to multicloud application environments." + +SDN will be increasingly perceived as a form of established, conventional networking, Casemore said. + +IDC estimates that the worldwide data center SDN market will be worth more than $12 billion in 2022, recording a CAGR of 18.5% during the 2017–2022 period. The market generated revenue of nearly $5.15 billion in 2017, up more than 32.2% from 2016. + +In 2017, the physical network represented the largest segment of the worldwide datacenter SDN market, accounting for revenue of nearly $2.2 billion, or about 42% of the overall total revenue. In 2022, however, the physical network is expected to claim about $3.65 billion in revenue, slightly less than the $3.68 billion attributable to network virtualization overlays/SDN controller software but more than the $3.18 billion for SDN applications. + +“We're now at a point where SDN is better understood, where its use cases and value propositions are familiar to most datacenter network buyers and where a growing number of enterprises are finding that SDN offerings offer practical benefits,” Casemore said. “With SDN growth and the shift toward software-based network automation, the network is regaining lost ground and moving into better alignment with a wave of new application workloads that are driving meaningful business outcomes.” + +### **What is SDN? ** + +The idea of programmability is the basis for the most precise definition of what SDN is: technology that separates the control plane management of network devices from the underlying data plane that forwards network traffic. + +IDC broadens that definition of SDN by stating: “Datacenter SDN architectures feature software-defined overlays or controllers that are abstracted from the underlying network hardware, offering intent-or policy-based management of the network as a whole. This results in a datacenter network that is better aligned with the needs of application workloads through automated (thereby faster) provisioning, programmatic network management, pervasive application-oriented visibility, and where needed, direct integration with cloud orchestration platforms.” + +The driving ideas behind the development of SDN are myriad. For example, it promises to reduce the complexity of statically defined networks; make automating network functions much easier; and allow for simpler provisioning and management of networked resources, everywhere from the data center to the campus or wide area network. + +Separating the control and data planes is the most common way to think of what SDN is, but it is much more than that, said Mike Capuano, chief marketing officer for [Pluribus][6]. + +“At its heart SDN has a centralized or distributed intelligent entity that has an entire view of the network, that can make routing and switching decisions based on that view,” Capuano said. “Typically, network routers and switches only know about their neighboring network gear. But with a properly configured SDN environment, that central entity can control everything, from easily changing policies to simplifying configuration and automation across the enterprise.” + +### How does SDN support edge computing, IoT and remote access? + +A variety of networking trends have played into the central idea of SDN. Distributing computing power to remote sites, moving data center functions to the [edge][7], adopting cloud computing, and supporting [Internet of Things][8] environments – each of these efforts can be made easier and more cost efficient via a properly configured SDN environment. + +Typically in an SDN environment, customers can see all of their devices and TCP flows, which means they can slice up the network from the data or management plane to support a variety of applications and configurations, Capuano said. So users can more easily segment an IoT application from the production world if they want, for example. + +Some SDN controllers have the smarts to see that the network is getting congested and, in response, pump up bandwidth or processing to make sure remote and edge components don’t suffer latency. + +SDN technologies also help in distributed locations that have few IT personnel on site, such as an enterprise branch office or service provider central office, said Michael Bushong, vice president of enterprise and cloud marketing at Juniper Networks. + +“Naturally these places require remote and centralized delivery of connectivity, visibility and security. SDN solutions that centralize and abstract control and automate workflows across many places in the network, and their devices, improve operational reliability, speed and experience,” Bushong said. + +### **How does SDN support intent-based networking?** + +Intent-based networking ([IBN][9]) has a variety of components, but basically is about giving network administrators the ability to define what they want the network to do, and having an automated network management platform create the desired state and enforce policies to ensure what the business wants happens. + +“If a key tenet of SDN is abstracted control over a fleet of infrastructure, then the provisioning paradigm and dynamic control to regulate infrastructure state is necessarily higher level,” Bushong said. “Policy is closer to declarative intent, moving away from the minutia of individual device details and imperative and reactive commands.” + +IDC says that intent-based networking “represents an evolution of SDN to achieve even greater degrees of operational simplicity, automated intelligence, and closed-loop functionality.” + +For that reason, IBN represents a notable milestone on the journey toward autonomous infrastructure that includes a self-driving network, which will function much like the self-driving car, producing desired outcomes based on what network operators and their organizations wish to accomplish, Casemore stated. + +“While the self-driving car has been designed to deliver passengers safely to their destination with minimal human intervention, the self-driving network, as part of autonomous datacenter infrastructure, eventually will achieve similar outcomes in areas such as network provisioning, management, and troubleshooting — delivering applications and data, dynamically creating and altering network paths, and providing security enforcement with minimal need for operator intervention,” Casemore stated. + +While IBN technologies are relatively young, Gartner says by 2020, more than 1,000 large enterprises will use intent-based networking systems in production, up from less than 15 in the second quarter of 2018. + +### **How does SDN help customers with security?** + +SDN enables a variety of security benefits. A customer can split up a network connection between an end user and the data center and have different security settings for the various types of network traffic. A network could have one public-facing, low security network that does not touch any sensitive information. Another segment could have much more fine-grained remote access control with software-based [firewall][10] and encryption policies on it, which allow sensitive data to traverse over it. + +“For example, if a customer has an IoT group it doesn’t feel is all that mature with regards to security, via the SDN controller you can segment that group off away from the critical high-value corporate traffic,” Capuano stated. “SDN users can roll out security policies across the network from the data center to the edge and if you do all of this on top of white boxes, deployments can be 30 – 60 percent cheaper than traditional gear.” + +The ability to look at a set of workloads and see if they match a given security policy is a key benefit of SDN, especially as data is distributed, said Thomas Scheibe, vice president of product management for Cisco’s Nexus and ACI product lines. + +"The ability to deploy a whitelist security model like we do with ACI [Application Centric Infrastructure] that lets only specific entities access explicit resources across your network fabric is another key security element SDN enables," Scheibe said. + +A growing number of SDN platforms now support [microsegmentation][11], according to Casemore. + +“In fact, micro-segmentation has developed as a notable use case for SDN. As SDN platforms are extended to support multicloud environments, they will be used to mitigate the inherent complexity of establishing and maintaining consistent network and security policies across hybrid IT landscapes,” Casemore said. + +### **What is SDN’s role in cloud computing?** + +SDN’s role in the move toward [private cloud][12] and [hybrid cloud][13] adoption seems a natural. In fact, big SDN players such as Cisco, Juniper and VMware have all made moves to tie together enterprise data center and cloud worlds. + +Cisco's ACI Anywhere package would, for example, let policies configured through Cisco's SDN APIC (Application Policy Infrastructure Controller) use native APIs offered by a public-cloud provider to orchestrate changes within both the private and public cloud environments, Cisco said. + +“As organizations look to scale their hybrid cloud environments, it will be critical to leverage solutions that help improve productivity and processes,” said [Bob Laliberte][14], a senior analyst with Enterprise Strategy Group, in a recent [Network World article][15]. “The ability to leverage the same solution, like Cisco’s ACI, in your own private-cloud environment as well as across multiple public clouds will enable organizations to successfully scale their cloud environments.” + +Growth of public and private clouds and enterprises' embrace of distributed multicloud application environments will have an ongoing and significant impact on data center SDN, representing both a challenge and an opportunity for vendors, said IDC’s Casemore. + +“Agility is a key attribute of digital transformation, and enterprises will adopt architectures, infrastructures, and technologies that provide for agile deployment, provisioning, and ongoing operational management. In a datacenter networking context, the imperative of digital transformation drives adoption of extensive network automation, including SDN,” Casemore said. + +### Where does SD-WAN fit in? + +The software-defined wide area network ([SD-WAN][16]) is a natural application of SDN that extends the technology over a WAN. While the SDN architecture is typically the underpinning in a data center or campus, SD-WAN takes it a step further. + +At its most basic, SD-WAN lets companies aggregate a variety of network connections – including MPLS, 4G LTE and DSL – into a branch or network edge location and have a software management platform that can turn up new sites, prioritize traffic and set security policies. + +SD-WAN's driving principle is to simplify the way big companies turn up new links to branch offices, better manage the way those links are utilized – for data, voice or video – and potentially save money in the process. + +[SD-WAN][17] lets networks route traffic based on centrally managed roles and rules, no matter what the entry and exit points of the traffic are, and with full security. For example, if a user in a branch office is working in Office365, SD-WAN can route their traffic directly to the closest cloud data center for that app, improving network responsiveness for the user and lowering bandwidth costs for the business. + +"SD-WAN has been a promised technology for years, but in 2019 it will be a major driver in how networks are built and re-built," Anand Oswal, senior vice president of engineering in Cisco’s Enterprise Networking Business, said a Network World [article][18] earlier this year. + +It's a profoundly hot market with tons of players including [Cisco][19], VMware, Silver Peak, Riverbed, Aryaka, Fortinet, Nokia and Versa. + +IDC says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40% yearly clip between now and then. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/what-is-sdn_2_where-is-it-going_arrows_fork-in-the-road-100793314-large.jpg +[2]: https://www.networkworld.com/article/2202144/data-center-faq-what-is-openflow-and-why-is-it-needed.html +[3]: https://www.networkworld.com/article/3206709/lan-wan/what-s-the-difference-between-sdn-and-nfv.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.idc.com/getdoc.jsp?containerId=US43862418 +[6]: https://www.networkworld.com/article/3192318/pluribus-recharges-expands-software-defined-network-platform.html +[7]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[8]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[9]: https://www.networkworld.com/article/3202699/what-is-intent-based-networking.html +[10]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[11]: https://www.networkworld.com/article/3247672/what-is-microsegmentation-how-getting-granular-improves-network-security.html +[12]: https://www.networkworld.com/article/2159885/cloud-computing-gartner-5-things-a-private-cloud-is-not.html +[13]: https://www.networkworld.com/article/3233132/what-is-hybrid-cloud-computing.html +[14]: https://www.linkedin.com/in/boblaliberte90/ +[15]: https://www.networkworld.com/article/3336075/cisco-serves-up-flexible-data-center-options.html +[16]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[17]: https://www.networkworld.com/article/3031279/sd-wan/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[18]: https://www.networkworld.com/article/3332027/cisco-touts-5-technologies-that-will-change-networking-in-2019.html +[19]: https://www.networkworld.com/article/3322937/what-will-be-hot-for-cisco-in-2019.html From 9ae34a19864da61ccf031b7c3c54c78cca97d030 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:50:17 +0800 Subject: [PATCH 0018/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20How?= =?UTF-8?q?=20to=20identify=20duplicate=20files=20on=20Linux=20sources/tec?= =?UTF-8?q?h/20190415=20How=20to=20identify=20duplicate=20files=20on=20Lin?= =?UTF-8?q?ux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to identify duplicate files on Linux.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20190415 How to identify duplicate files on Linux.md diff --git a/sources/tech/20190415 How to identify duplicate files on Linux.md b/sources/tech/20190415 How to identify duplicate files on Linux.md new file mode 100644 index 0000000000..9bdc92a591 --- /dev/null +++ b/sources/tech/20190415 How to identify duplicate files on Linux.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to identify duplicate files on Linux) +[#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to identify duplicate files on Linux +====== +Some files on a Linux system can appear in more than one location. Follow these instructions to find and identify these "identical twins" and learn why hard links can be so advantageous. +![Archana Jarajapu \(CC BY 2.0\)][1] + +Identifying files that share disk space relies on making use of the fact that the files share the same inode — the data structure that stores all the information about a file except its name and content. If two or more files have different names and file system locations, yet share an inode, they also share content, ownership, permissions, etc. + +These files are often referred to as "hard links" — unlike symbolic links that simply point to other files by containing their names. Symbolic links are easy to pick out in a file listing by the "l" in the first position and **- >** symbol that refers to the file being referenced. + +``` +$ ls -l my* +-rw-r--r-- 4 shs shs 228 Apr 12 19:37 myfile +lrwxrwxrwx 1 shs shs 6 Apr 15 11:18 myref -> myfile +-rw-r--r-- 4 shs shs 228 Apr 12 19:37 mytwin +``` + +Identifying hard links in a single directory is not as obvious, but it is still quite easy. If you list the files using the **ls -i** command and sort them by inode number, you can pick out the hard links fairly easily. In this type of ls output, the first column shows the inode numbers. + +``` +$ ls -i | sort -n | more + ... + 788000 myfile <== + 788000 mytwin <== + 801865 Name_Labels.pdf + 786692 never leave home angry + 920242 NFCU_Docs + 800247 nmap-notes +``` + +Scan your output looking for identical inode numbers and any matches will tell you what you want to know. + +**[ Also see:[Invaluable tips and tricks for troubleshooting Linux][2] ]** + +If, on the other hand, you simply want to know if one particular file is hard-linked to another file, there's an easier way than scanning through a list of what may be hundreds of files. The find command's **-samefile** option will do the work for you. + +``` +$ find . -samefile myfile +./myfile +./save/mycopy +./mytwin +``` + +Notice that the starting location provided to the find command will determine how much of the file system is scanned for matches. In the above example, we're looking in the current directory and subdirectories. + +Adding output details using find's **-ls** option might be more convincing: + +``` +$ find . -samefile myfile -ls + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./myfile + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./save/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./mytwin +``` + +The first column shows the inode number. Then we see file permissions, links, owner, file size, date information, and the names of the files that refer to the same disk content. Note that the link field in this case is a "4" not the "3" we might expect, telling us that there's another link to this same inode as well (but outside our search range). + +If you want to look for all instances of hard links in a single directory, you could try a script like this that will create the list and look for the duplicates for you: + +``` +#!/bin/bash + +# seaches for files sharing inodes + +prev="" + +# list files by inode +ls -i | sort -n > /tmp/$0 + +# search through file for duplicate inode #s +while read line +do + inode=`echo $line | awk '{print $1}'` + if [ "$inode" == "$prev" ]; then + grep $inode /tmp/$0 + fi + prev=$inode +done < /tmp/$0 + +# clean up +rm /tmp/$0 + +$ ./findHardLinks + 788000 myfile + 788000 mytwin +``` + +You can also use the find command to look for files by inode number as in this command. However, this search could involve more than one file system, so it is possible that you will get false results, since the same inode number might be used in another file system where it would not represent the same file. If that's the case, other file details will not be identical. + +``` +$ find / -inum 788000 -ls 2> /dev/null + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /tmp/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/myfile + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/save/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/mytwin +``` + +Note that error output was shunted off to /dev/null so that we didn't have to look at all the "Permission denied" errors that would have otherwise been displayed for other directories that we're not allowed to look through. + +Also, scanning for files that contain the same content but don't share inodes (i.e., simply file copies) would take considerably more time and effort. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all + +作者:[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/04/reflections-candles-100793651-large.jpg +[2]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From e4be2725ebbb895789e601faea8d4148045fb9dc Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 17 Apr 2019 11:50:35 +0800 Subject: [PATCH 0019/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190415=20Nyan?= =?UTF-8?q?sa=E2=80=99s=20Voyance=20expands=20to=20the=20IoT=20sources/tal?= =?UTF-8?q?k/20190415=20Nyansa-s=20Voyance=20expands=20to=20the=20IoT.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...415 Nyansa-s Voyance expands to the IoT.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md diff --git a/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md b/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md new file mode 100644 index 0000000000..e893c86d53 --- /dev/null +++ b/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Nyansa’s Voyance expands to the IoT) +[#]: via: (https://www.networkworld.com/article/3388301/nyansa-s-voyance-expands-to-the-iot.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Nyansa’s Voyance expands to the IoT +====== + +![Brandon Mowinkel \(CC0\)][1] + +Nyansa announced today that their flagship Voyance product can now apply its AI-based secret sauce to [IoT][2] devices, over and above the networking equipment and IT endpoints it could already manage. + +Voyance – a network management product that leverages AI to automate the discovery of devices on the network and identify unusual behavior – has been around for two years now, and Nyansa says that it’s being used to observe a total of 25 million client devices operating across roughly 200 customer networks. + +**More on IoT:** + + * [Most powerful Internet of Things companies][3] + * [10 Hot IoT startups to watch][4] + * [The 6 ways to make money in IoT][5] + * [][6] [Blockchain, service-centric networking key to IoT success][7] + * [Getting grounded in IoT networking and security][8] + * [Building IoT-ready networks must become a priority][9] + * [What is the Industrial IoT? [And why the stakes are so high]][10] + + + +It’s a software-only product (available either via public SaaS or private cloud) that works by scanning a customer’s network and identifying every device attached to it, then establishing a behavioral baseline that will let it flag suspicious actions (e.g., sending a lot more data than other devices of its kind, connecting to unusual servers) and even perform automated root-cause analysis of network issues. + +The process doesn’t happen instantaneously, particularly the creation of the baseline, but it’s designed to be minimally invasive to existing network management frameworks and easy to implement. + +Nyansa said that the medical field has been one of the key targets for the newly IoT-enabled iteration of Voyance, and one early customer – Baptist Health, a Florida-based healthcare company that runs four hospitals and several other clinics and practices – said that Voyance IoT has offered a new level of visibility into the business’ complex array of connected diagnostic and treatment machines. + +“In the past we didn’t have the ability to identify security concerns in this way, related to rogue devices on the enterprise network, and now we’re able to do that,” said CISO Thad Phillips. + +While spiraling network complexity isn’t an issue confined to the IoT, there’s a strong argument that the number and variety of devices connected to an IoT-enabled network represent a new challenge to network management, particularly in light of the fact that many such devices aren’t particularly secure. + +“They’re not manufactured by networking vendors or security vendors, so for a performance standpoint, they have a lot of quirks … and on the security side, that’s sort of a big problem there as well,” said Anand Srinivas, Nyansa’s co-founder and CTO. + +Enabling the Voyance platform to identify and manage IoT devices along with traditional endpoints seems to be mostly a matter of adding new device signatures to the system, but Enterprise Management Associates research director Shamus McGillicuddy said that, while the system’s designed for automation and ease of use, AIOps products like Voyance do need to be managed to make sure that they’re functioning correctly. + +“Anything based on machine learning is going to take a while to make sure it understands your environment and you might have to retrain it,” he said. “There’s always going to be more and more things connecting to IP networks, and it’s just going to be a question of building up a database.” + +Voyance IoT is available now. Pricing starts at $16,000 per year, and goes up with the number of total devices managed. (Current Voyance users can manage up to 100 IoT devices at no additional cost.) + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388301/nyansa-s-voyance-expands-to-the-iot.html#tk.rss_all + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/geometric_architecture_ceiling_structure_lines_connections_networks_perspective_by_brandon_mowinkel_cc0_via_unsplash_2400x1600-100788530-large.jpg +[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[4]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[5]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[6]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[7]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[8]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[9]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[10]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From 9d952da1de6f797ace72514f3007758366093e6b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 12:14:06 +0800 Subject: [PATCH 0020/1154] PRF:20190413 The Fargate Illusion.md --- .../tech/20190413 The Fargate Illusion.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190413 The Fargate Illusion.md b/translated/tech/20190413 The Fargate Illusion.md index 36fe768e9a..c5591968a3 100644 --- a/translated/tech/20190413 The Fargate Illusion.md +++ b/translated/tech/20190413 The Fargate Illusion.md @@ -30,9 +30,9 @@ 我有一个干净的 AWS 账户,并决定从零到部署一个 webapp。与 AWS 中的其它基础设施一样,我必须首先使基本的基础设施正常工作起来,因此我需要先定义一个 VPC。 -遵循最佳实践,因此我将这个 VPC 划分为跨可用区(AZ)的子网,一个公共子网和私有子网。这时我想到,只要这种设置基础设施的需求存在,我就能找到一份这种工作。AWS 是运维上“免费”这一概念一直让我感到愤怒。开发者社区中的许多人理所当然地认为在设置和定义一个设计良好的 AWS 账户和基础设施是不需要付出多少工作和努力的。在我们甚至开始谈论多帐户架构*之前*(现在我仍然使用单一帐户),我必须已经定义好基础设施和传统的网络设备。 +遵循最佳实践,因此我将这个 VPC 划分为跨可用区(AZ)的子网,一个公共子网和私有子网。这时我想到,只要这种设置基础设施的需求存在,我就能找到一份这种工作。AWS 是"免"运维的这一概念一直让我感到愤怒。开发者社区中的许多人理所当然地认为在设置和定义一个设计良好的 AWS 账户和基础设施是不需要付出多少工作和努力的。而这种想当然甚至发生在开始谈论多帐户架构*之前*就有了——现在我仍然使用单一帐户,我已经必须定义好基础设施和传统的网络设备。 -这里也值得记住,我已经做了很多次,所以我*很清楚*该做什么。我可以在我的帐户中使用默认的 VPC 以及预先提供的子网,我觉得很多刚开始的人也可以使用它。这大概花了我半个小时才运行起来,但我不禁想到,即使我想运行 lambda 函数,我仍然需要某种连接和网络。在 VPC 中定义 NAT 网关和路由根本不会让你觉得很“无服务器”,但要往下进行这就是必须要做的。 +这里也值得记住,我已经做了很多次,所以我*很清楚*该做什么。我可以在我的帐户中使用默认的 VPC 以及预先提供的子网,我觉得很多刚开始的人也可以使用它。这大概花了我半个小时才运行起来,但我不禁想到,即使我想运行 lambda 函数,我仍然需要某种连接和网络。定义 NAT 网关和在 VPC 中路由根本不会让你觉得很“Serverless”,但要往下进行这就是必须要做的。 ### 运行简单的容器 @@ -44,7 +44,7 @@ #### 任务定义 -“任务定义Task Definition”用来定义要运行的实际容器。我在这里遇到的问题是,任务定义这件事非常复杂。这里有很多选项都很简单,比如指定 Docker 镜像和内存限制,但我还必须定义一个网络模型以及我并不熟悉的其它各种选项。真需要这样吗?如果我完全没有 AWS 方面的知识就进入到这个过程里,那么在这个阶段我会感觉非常的不知所措。可以在 AWS 页面上找到这些 [参数][5] 的完整列表,这个列表很长。我知道我的容器需要一些环境变量,它需要暴露一个端口。所以我首先在一个神奇的 [terraform 模块][6] 的帮助下定义了这一点,这真的让这件事更容易了。如果没有这个模块,我就得手工编写 JSON 来定义我的容器定义。 +“任务定义Task Definition”用来定义要运行的实际容器。我在这里遇到的问题是,任务定义这件事非常复杂。这里有很多选项都很简单,比如指定 Docker 镜像和内存限制,但我还必须定义一个网络模型以及我并不熟悉的其它各种选项。真需要这样吗?如果我完全没有 AWS 方面的知识就进入到这个过程里,那么在这个阶段我会感觉非常的不知所措。可以在 AWS 页面上找到这些 [参数][5] 的完整列表,这个列表很长。我知道我的容器需要一些环境变量,它需要暴露一个端口。所以我首先在一个神奇的 [terraform 模块][6] 的帮助下定义了这一点,这真的让这件事更容易了。如果没有这个模块,我就得手写 JSON 来定义我的容器定义。 首先我定义了一些环境变量: @@ -173,7 +173,7 @@ resource "aws_ecs_service" "app" { ##### 负载均衡器从未远离 -老实说,我很满意,我甚至不确定为什么。我已经习惯了 Kubernetes 的服务和 Ingress 对象,我一心认为用 Kubernetes 将我的应用程序放到网上是多么容易。当然,我们在 $work 花了几个月的时间建立一个平台,以便更轻松。我是 [external-dns][8] 和 [cert-manager][9] 的重度用户,它们可以自动填充 Ingress 对象上的 DNS 条目并自动化 TLS 证书,我非常了解进行这些设置所需的工作,但老实说,我认为在 Fargate 上做这件事会更容易。我认识到 Fargate 并没有声称自己是“如何运行应用程序”这件事的全部和最终目的,它只是抽象出节点管理,但我一直被告知这比 Kubernetes *更加容易*。我真的很惊讶。定义负载均衡器(即使你不想使用 Ingress 和 Ingress 控制器)也是向 Kubernetes 部署服务的重要组成部分,我不得不在这里再次做同样的事情。这一切都让人觉得如此熟悉。 +老实说,我很满意,我甚至不确定为什么。我已经习惯了 Kubernetes 的服务和 Ingress 对象,我一心认为用 Kubernetes 将我的应用程序放到网上是多么容易。当然,我们在 $work 花了几个月的时间建立一个平台,以便更轻松。我是 [external-dns][8] 和 [cert-manager][9] 的重度用户,它们可以自动填充 Ingress 对象上的 DNS 条目并自动化 TLS 证书,我非常了解进行这些设置所需的工作,但老实说,我认为在 Fargate 上做这件事会更容易。我认识到 Fargate 并没有声称自己是“如何运行应用程序”这件事的全部和最终目的,它只是抽象出节点管理,但我一直被告知这比 Kubernetes *更加容易*。我真的很惊讶。定义负载均衡器(即使你不想使用 Ingress 和 Ingress Controller)也是向 Kubernetes 部署服务的重要组成部分,我不得不在这里再次做同样的事情。这一切都让人觉得如此熟悉。 我现在意识到我需要: @@ -296,9 +296,9 @@ module "ecs" { ``` 这里让我感到惊讶的是为什么我必须定义一个集群。作为一个相当熟悉 ECS 的人,你会觉得你需要一个集群,但我试图从一个必须经历这个过程的新人的角度来考虑这一点 —— 对我来说,Fargate 标榜自己“ -无服务器”而你仍需要定义集群,这似乎很令人惊讶。当然这是一个小细节,但它确实盘旋在我的脑海里。 +Serverless”而你仍需要定义集群,这似乎很令人惊讶。当然这是一个小细节,但它确实盘旋在我的脑海里。 -### 告诉我你的秘密 +### 告诉我你的 Secret 在这个阶段,我很高兴我成功地运行了一些东西。然而,我的原始的成功标准缺少一些东西。如果我们回到任务定义那里,你会记得我的应用程序有一个存放密码的环境变量: @@ -315,11 +315,11 @@ container_environment_variables = [ ] ``` -如果我在 AWS 控制台中查看我的任务定义,我的密码就在那里,明晃晃的明文。我希望不要这样,所以我开始尝试将其转化为其他东西,类似于 [Kubernetes 的秘密信息管理][11]。 +如果我在 AWS 控制台中查看我的任务定义,我的密码就在那里,明晃晃的明文。我希望不要这样,所以我开始尝试将其转化为其他东西,类似于 [Kubernetes 的Secrets管理][11]。 #### AWS SSM -Fargate / ECS 执行秘密信息管理secret management部分的方式是使用 [AWS SSM][12](此服务的全名是 AWS 系统管理器参数存储库,但我不想使用这个名称,因为坦率地说这个名字太愚蠢了)。 +Fargate / ECS 执行secret 管理secret management部分的方式是使用 [AWS SSM][12](此服务的全名是 AWS 系统管理器参数存储库 Systems Manager Parameter Store,但我不想使用这个名称,因为坦率地说这个名字太愚蠢了)。 AWS 文档很好的[涵盖了这个内容][13],因此我开始将其转换为 terraform。 @@ -335,9 +335,9 @@ resource "aws_ssm_parameter" "app_password" { } ``` -显然,这里的关键部分是 “SecureString” 类型。这会使用默认的 AWS KMS 密钥来加密数据,这对我来说并不是很直观。这比 Kubernetes 的秘密信息管理具有巨大优势,默认情况下,这些秘密信息在 etcd 中是不加密的。 +显然,这里的关键部分是 “SecureString” 类型。这会使用默认的 AWS KMS 密钥来加密数据,这对我来说并不是很直观。这比 Kubernetes 的 Secret 管理具有巨大优势,默认情况下,这些 Secret 在 etcd 中是不加密的。 -然后我为 ECS 指定了另一个本地值映射,并将其作为秘密参数传递: +然后我为 ECS 指定了另一个本地值映射,并将其作为 Secret 参数传递: ``` container_secrets = [ @@ -372,7 +372,7 @@ module "container_definition_app" { ##### 出了个问题 -此刻,我重新部署了我的任务定义,并且非常困惑。为什么任务没有正确拉起?当新的任务定义(版本 8)可用时,我一直在控制台中看到正在运行的应用程序仍在使用先前的任务定义(版本 7)。解决这件事花费的时间比我预期的要长,但是在控制台的事件屏幕上,我注意到了 IAM 错误。我错过了一个步骤,容器无法从 AWS SSM 中读取秘密信息,因为它没有正确的 IAM 权限。这是我第一次真正对整个这件事情感到沮丧。从用户体验的角度来看,这里的反馈非常*糟糕*。如果我没有发觉的话,我会认为一切都很好,因为仍然有一个任务正在运行,我的应用程序仍然可以通过正确的 URL 访问 —— 只不过是旧的配置而已。 +此刻,我重新部署了我的任务定义,并且非常困惑。为什么任务没有正确拉起?当新的任务定义(版本 8)可用时,我一直在控制台中看到正在运行的应用程序仍在使用先前的任务定义(版本 7)。解决这件事花费的时间比我预期的要长,但是在控制台的事件屏幕上,我注意到了 IAM 错误。我错过了一个步骤,容器无法从 AWS SSM 中读取 Secret 信息,因为它没有正确的 IAM 权限。这是我第一次真正对整个这件事情感到沮丧。从用户体验的角度来看,这里的反馈非常*糟糕*。如果我没有发觉的话,我会认为一切都很好,因为仍然有一个任务正在运行,我的应用程序仍然可以通过正确的 URL 访问 —— 只不过是旧的配置而已。 在 Kubernetes 里,我会清楚地看到 pod 定义中的错误。Fargate 可以确保我的应用不会停止,这绝对是太棒了,但作为一名运维,我需要一些关于发生了什么的实际反馈。这真的不够好。我真的希望 Fargate 团队的人能够读到这篇文章,改善这种体验。 @@ -400,7 +400,7 @@ module "container_definition_app" { #### Kubernetes 的争议 -最后就是:如果你将 Kubernetes 纯粹视为一个容器编排工具,你可能会喜欢 Fargate。然而,随着我对 Kubernetes 越来越熟悉,我开始意识到它作为一种技术的重要性 —— 不仅因为它是一个伟大的容器编排工具,而且因为它的设计模式 —— 它是声明性的、API 驱动的平台。 在*整个* Fargate 过程期间发生的一个简单的事情是,如果我删除这里某个东西,Fargate 不一定会为我重新创建它。自动缩放很不错,不需要管理服务器和操作系统的补丁及更新也很棒,但我辉觉得因为无法使用 Kubernetes 自我修复和 API 驱动模型而失去了很多。当然,Kubernetes 有一个学习曲线,但从这里的体验来看,Fargate 也是如此。 +最后就是:如果你将 Kubernetes 纯粹视为一个容器编排工具,你可能会喜欢 Fargate。然而,随着我对 Kubernetes 越来越熟悉,我开始意识到它作为一种技术的重要性 —— 不仅因为它是一个伟大的容器编排工具,而且因为它的设计模式 —— 它是声明性的、API 驱动的平台。 在*整个* Fargate 过程期间发生的一个简单的事情是,如果我删除这里某个东西,Fargate 不一定会为我重新创建它。自动缩放很不错,不需要管理服务器和操作系统的补丁及更新也很棒,但我觉得因为无法使用 Kubernetes 自我修复和 API 驱动模型而失去了很多。当然,Kubernetes 有一个学习曲线,但从这里的体验来看,Fargate 也是如此。 ### 总结 @@ -419,7 +419,7 @@ via: https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html 作者:[Lee Briggs][a] 选题:[lujun9972][b] 译者:[Bestony](https://github.com/Bestony) -校对:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy), 临石(阿里云智能技术专家) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5d4af3ce24b3a9e09a12e3b5b4ce923f2ceef3ad Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 12:14:58 +0800 Subject: [PATCH 0021/1154] PUB:20190413 The Fargate Illusion.md https://linux.cn/article-10740-1.html --- .../tech => published}/20190413 The Fargate Illusion.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190413 The Fargate Illusion.md (99%) diff --git a/translated/tech/20190413 The Fargate Illusion.md b/published/20190413 The Fargate Illusion.md similarity index 99% rename from translated/tech/20190413 The Fargate Illusion.md rename to published/20190413 The Fargate Illusion.md index c5591968a3..ef0cc6153e 100644 --- a/translated/tech/20190413 The Fargate Illusion.md +++ b/published/20190413 The Fargate Illusion.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10740-1.html) [#]: subject: (The Fargate Illusion) [#]: via: (https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html) [#]: author: (Lee Briggs https://leebriggs.co.uk/) From 8a1da3c25dd86987653ef52106f1cd9961f257db Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 12:41:26 +0800 Subject: [PATCH 0022/1154] PRF:20190314 A Look Back at the History of Firefox.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正链接错误 @lujun9972 这个应该是 md 制作过程的问题,可以回头看看。 --- published/20190314 A Look Back at the History of Firefox.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20190314 A Look Back at the History of Firefox.md b/published/20190314 A Look Back at the History of Firefox.md index 6be471d64d..ac9341d9a0 100644 --- a/published/20190314 A Look Back at the History of Firefox.md +++ b/published/20190314 A Look Back at the History of Firefox.md @@ -92,7 +92,7 @@ via: https://itsfoss.com/history-of-firefox [3]: https://en.wikipedia.org/wiki/Tim_Berners-Lee [4]: https://www.w3.org/DesignIssues/TimBook-old/History.html [5]: http://viola.org/ -[6]: https://en.wikipedia.org/wiki/Mosaic_(web_browser +[6]: https://en.wikipedia.org/wiki/Mosaic_(web_browser) [7]: http://www.computinghistory.org.uk/det/1789/Marc-Andreessen/ [8]: http://www.davetitus.com/mozilla/ [9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/Mozilla_boxing.jpg?ssl=1 @@ -110,7 +110,7 @@ via: https://itsfoss.com/history-of-firefox [21]: https://en.wikipedia.org/wiki/Usage_share_of_web_browsers [22]: http://gs.statcounter.com/browser-market-share/desktop/worldwide/#monthly-201901-201901-bar [23]: https://en.wikipedia.org/wiki/Red_panda -[24]: https://en.wikipedia.org/wiki/Flock_(web_browser +[24]: https://en.wikipedia.org/wiki/Flock_(web_browser) [25]: https://www.windowscentral.com/microsoft-building-chromium-powered-web-browser-windows-10 [26]: https://itsfoss.com/why-firefox/ [27]: https://itsfoss.com/firefox-quantum-ubuntu/ From 037724e45e90fd9b4a41660ba4ed580246e0728b Mon Sep 17 00:00:00 2001 From: zgj Date: Wed, 17 Apr 2019 13:21:39 +0800 Subject: [PATCH 0023/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20Why=20DevOps=20is=20the=20most=20important=20=20tech=20strat?= =?UTF-8?q?egy=20today?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... the most important tech strategy today.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 translated/talk/20190327 Why DevOps is the most important tech strategy today.md diff --git a/translated/talk/20190327 Why DevOps is the most important tech strategy today.md b/translated/talk/20190327 Why DevOps is the most important tech strategy today.md new file mode 100644 index 0000000000..fe014a243a --- /dev/null +++ b/translated/talk/20190327 Why DevOps is the most important tech strategy today.md @@ -0,0 +1,129 @@ +[#]: collector: "lujun9972" +[#]: translator: "zgj1024 " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Why DevOps is the most important tech strategy today" +[#]: via: "https://opensource.com/article/19/3/devops-most-important-tech-strategy" +[#]: author: "Kelly AlbrechtWilly-Peter Schaub https://opensource.com/users/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht" + +为何 DevOps 是如今最重要的技术策略 +====== +消除一些关于 DevOps 的疑惑 +![CICD with gears][1] + +很多人初学 [DevOps][2] 时,看到它其中一个结果就问这个是如何得来的。其实理解这部分 Devops 的怎样实现并不重要,重要的是——理解(使用) DevOps 策略的原因——这是做一个行业的领导者还是追随者的差别。 + +你可能会听过些 Devops 的难以置信的成果,例如生产环境非常有弹性,“混世猴子”([Chaos Monkey][3])程序运行时,将周围的连接随机切断,每天仍可以处理数千个版本。这是令人印象深刻的,但就其本身而言,这是一个 DevOps 的无力案例,本质上会被一个[反例][4]困扰:DevOps 环境有弹性是因为没有观察到严重的故障。。。还没有。 + +有很多关于 DevOps 的疑惑,并且许多人还在尝试弄清楚它的意义。下面是来自我 LinkedIn Feed 中的某个人的一个案例: + +> 最近我参加一些 #DevOps 的交流会,那里一些演讲人好像在倡导 #敏捷开发是 DevOps 的子集。不知为何,我的理解洽洽相反。 +> +> 能听一下你们的想法吗?你认为敏捷开发和 DevOps 之间是什么关系呢? +> +> 1. DevOps 是敏捷开发的子集 +> 2. 敏捷开发 是 DevOps 的子集 +> 3. DevOps 是敏捷开发的扩展,从敏捷开发结束的地方开始 +> 4. DevOps 是敏捷开发的新版本 +> + +科技行业的专业人士在那篇 LinkedIn 的帖子上达标各样的答案,你会怎样回复呢? + +### DevOps源于精益和敏捷 + +如果我们从亨利福特的战略和丰田生产系统对福特车型的改进(的历史)开始, DevOps 就更有意义了。精益制造就诞生在那段历史中,人们对精益制作进行了良好的研究。James P. Womack 和 Daniel T. Jones 将精益思维( [Lean Thinking][5])提炼为五个原则: + 1. 指明客户所需的价值 + 2. 确定提供该价值的每个产品的价值流,并对当前提供该价值所需的所有浪费步骤提起挑战 + 3. 使产品通过剩余的增值步骤持续流动 + 4. 在可以连续流动的所有步骤之间引入拉力 + 5. 管理要尽善尽美,以便为客户服务所需的步骤数量和时间以及信息量持续下降 + + +Lean seeks to continuously remove waste and increase the flow of value to the customer. This is easily recognizable and understood through a core tenet of lean: single piece flow. We can do a number of activities to learn why moving single pieces at a time is magnitudes faster than batches of many pieces; the [Penny Game][6] and the [Airplane Game][7] are two of them. In the Penny Game, if a batch of 20 pennies takes two minutes to get to the customer, they get the whole batch after waiting two minutes. If you move one penny at a time, the customer gets the first penny in about five seconds and continues getting pennies until the 20th penny arrives approximately 25 seconds later. + +精益致力于持续消除浪费并增加客户的价值流动。这很容易识别并明白精益的核心原则:单一流。我们可以做一些游戏去了解为何同一时间移动单个比批量移动要快得多。其中的两个游戏是[硬币游戏][6]和[飞机游戏][7]。在硬币游戏中,如果一批 20 个硬币到顾客手中要用 2 分钟,顾客等 2 分钟后能拿到整批硬币。如果一次只移动一个硬币,顾客会在 5 秒内得到第一枚硬币,并会持续获得硬币,直到在大约 25 秒后第 20 个硬币到达。(译者注:有相关的视频的) + +这是巨大的不同,但是不是生活中的所有事都像硬币游戏那样简单并可预测的。这就是敏捷的出现的原因。我们当然看到了高效绩敏捷团队的精益原则,但这些团队需要的不仅仅是精益去做他们要做的事。 + +为了能够处理典型的软件开发任务的不可预见性和变化,敏捷开发的方法论会将重点放在意识、审议、决策和行动上,以便在不断变化的现实中调整。例如,敏捷框架(如 srcum)通过每日站立会议和冲刺评审会议等仪式提高意识。如果 scrum 团队意识到新的事实,框架允许并鼓励他们在必要时及时调整路线。 + +要使团队做出这些类型的决策,他们需要高度信任的环境中的自我组织能力。以这种方式工作的高效绩敏捷团队在不断调整的同时实现快速的价值流,消除错误方向上的浪费。 + +### 最佳批量大小 + +要了解 DevOps 在软件开发中的请强大功能,这会帮助我们理解批处理大小的经济学。请考虑以下来自Donald Reinertsen 的[产品开发流程原则][8]的U曲线优化示例: + +![U-curve optimization illustration of optimal batch size][9] + +这可以类比杂货店购物来解释。假设你需要买一些鸡蛋,而你住的地方离商店只有 30 分的路程。买一个鸡蛋(图种最左边)意味着每次要花 30 分钟的路程,这就是你的_交易成本_。_持有成本_可能是鸡蛋变质和在你的冰箱中持续地占用空间。_总成本_是_交易成本_加上你的_持有成本_。这 U 型曲线解释了为什么对大部分来说,一次买一打鸡蛋是他们的_最佳批量大小_。如果你就住在商店的旁边,步行到那里不会花费你任何的时候,你可能每次只会买一小盒鸡蛋,以此来节省冰箱的空间并享受新鲜的鸡蛋。 + +这 U 型优化曲线可以说明为什么在成功敏捷转换中生产力会显著提高。考虑敏捷转换对组织决策的影响。在传统的分级组织中,决策权是集中的。这会导致较少的人做更大的决策。敏捷方法论会有效地降低组织决策中的交易成本,方法是将决策分散到最被人熟知的认识和信息的位置:跨越高度信任,自组织的敏捷团队。 + +下面的动画演示了降低事务成本后,最佳批量大小是如何向左移动。在更频繁地做出更快的决策方面,你不能低估组织的价值。 + +![U-curve optimization illustration][10] + +### DevOps 适合哪些地方 + +自动化是 DevOps 最知名的事情之一。前面的插图非常详细地展示了自动化的价值。通过自动化,我们将交易成本降低到接近零,实质上是免费进行测试和部署。这使我们可以利用越来越小的批量工作。较小批量的工作更容易理解、提交、测试、审查和知道何时能完成。这些较小的批量大小也包含较少的差异和风险,使其更易于部署,如果出现问题,可以进行故障排除和恢复。通过自动化与扎实的敏捷实践相结合,我们可以使我们的功能开发非常接近单件流程,从而快速,持续地为客户提供价值。 + +更传统地说,DevOps 被理解为一种打破开发团队和运营团队之间混乱局面的方法。在这个模型中,开发团队开发新的功能,而运营团队则保持系统的稳定和平稳运行。摩擦的发生是因为开发过程中的新功能将更改引入到系统中,从而增加了停机的风险,运营团队并不认为要对此负责,但无论如何都必须处理这一问题。DevOps 不仅仅尝试让人们一起工作,更重要的是尝试在复杂的环境中安全地进行更频繁的更改。 + +我们可以向 [Ron Westrum][11] 寻求有关在复杂组织中实现安全性的研究。在研究为什么有些组织比其他组织更安全时,他发现组织的文化可以预测其安全性。他确定了三种文化:病态,官僚主义的和生产式的。他发现病理的可以预测安全性较低,而生产式文化被预测为更安全(例如,在他的主要研究领域中,飞机坠毁或意外住院死亡的数量要少得多)。 + +![Three types of culture identified by Ron Westrum][12] + +高效的 DevOps 团队通过精益和敏捷的实践实现了一种生成性文化,这表明速度和安全性是互补的,或者说是同一个问题的两个方面。通过将决策和功能的最佳批量大小减少到非常小,DevOps 实现了更快的信息流和价值,同时消除了浪费并降低了风险。 + +与 Westrum的研究一致,在提高安全性和可靠性的同时,变化也很容易发生。。当一个敏捷的 DevOps 团队被信任做出自己的决定时,我们将获得 DevOps 目前最为人所知的工具和技术:自动化和持续交付。通过这种自动化,交易成本比以往任何时候都进一步降低,并且实现了近乎单一的精益流程,每天创造数千个决策和发布的潜力,正如我们在高效绩的 DevOps 组织中看到的那样 + +### 流动、反馈、学习 + +DevOps 并不止于此。我们主要讨论了 DevOps 实现了革命性的流程,但通过类似的努力可以进一步放大精益和敏捷实践,从而实现更快的反馈循环和更快的学习。在[_DevOps手册_][13] 中,作者除了详细解释快速流程外, DevOps 如何在整个价值流中实现遥测,从而获得快速且持续的反馈。此外,利用[精益求精的突破][14]和scrum 的[回顾][15],高效的 DevOps 团队将不断推动学习和持续改进深入到他们的组织的基础,实现软件产品开发行业的精益制造革命。 + + +### 从 DevOps 评估开始 + +利用 DevOps 的第一步是,经过大量研究或在 DevOps 顾问和教练的帮助下,对高效绩 DevOps 团队中始终存在的一系列维度进行评估。评估应确定需要改进的薄弱或不存在的团队规范。对评估的结果进行评估,以找到具有高成功机会的快速获胜焦点领域,从而产生高影响力的改进。快速获胜非常重要,能让团队获取解决更具挑战性领域所需的动力。团队应该产生可以快速尝试的想法,并开始关注 DevOps 转型。 + +一段时间后,团队应重新评估相同的维度,以衡量改进并确立新的高影响力重点领域,并再次采纳团队的新想法。一位好的教练将根据需要进行咨询、培训、指导和支持,直到团队拥有自己的持续改进方案,并通过不断地重新评估、试验和学习,在所有维度上实现近乎一致。 + +在本文的[第二部分][16]中,我们将查看 Drupal 社区中 DevOps 调查的结果,并了解最有可能找到快速获胜的位置。 + +* * * + +_Rob_ _Bayliss and Kelly Albrecht will present[DevOps: Why, How, and What][17] and host a follow-up [Birds of a][18]_ [_Feather_][18] _[discussion][18] at [DrupalCon 2019][19] in Seattle, April 8-12._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/devops-most-important-tech-strategy + +作者:[Kelly AlbrechtWilly-Peter Schaub][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/zgj1024) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc "CICD with gears" +[2]: https://opensource.com/resources/devops +[3]: https://github.com/Netflix/chaosmonkey +[4]: https://en.wikipedia.org/wiki/Burden_of_proof_(philosophy)#Proving_a_negative +[5]: https://www.amazon.com/dp/B0048WQDIO/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 +[6]: https://youtu.be/5t6GhcvKB8o?t=54 +[7]: https://www.shmula.com/paper-airplane-game-pull-systems-push-systems/8280/ +[8]: https://www.amazon.com/dp/B00K7OWG7O/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 +[9]: https://opensource.com/sites/default/files/uploads/batch_size_optimal_650.gif "U-curve optimization illustration of optimal batch size" +[10]: https://opensource.com/sites/default/files/uploads/batch_size_650.gif "U-curve optimization illustration" +[11]: https://en.wikipedia.org/wiki/Ron_Westrum +[12]: https://opensource.com/sites/default/files/uploads/information_flow.png "Three types of culture identified by Ron Westrum" +[13]: https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002/ref=sr_1_3?keywords=DevOps+handbook&qid=1553197361&s=books&sr=1-3 +[14]: https://en.wikipedia.org/wiki/Kaizen +[15]: https://www.scrum.org/resources/what-is-a-sprint-retrospective +[16]: https://opensource.com/article/19/3/where-drupal-community-stands-devops-adoption +[17]: https://events.drupal.org/seattle2019/sessions/devops-why-how-and-what +[18]: https://events.drupal.org/seattle2019/bofs/devops-getting-started +[19]: https://events.drupal.org/seattle2019 From 8d756eb35466f3627354f105696c4d5469343336 Mon Sep 17 00:00:00 2001 From: zgj Date: Wed, 17 Apr 2019 13:32:57 +0800 Subject: [PATCH 0024/1154] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... the most important tech strategy today.md | 130 ------------------ 1 file changed, 130 deletions(-) delete mode 100644 sources/talk/20190327 Why DevOps is the most important tech strategy today.md diff --git a/sources/talk/20190327 Why DevOps is the most important tech strategy today.md b/sources/talk/20190327 Why DevOps is the most important tech strategy today.md deleted file mode 100644 index 7ad9db59ea..0000000000 --- a/sources/talk/20190327 Why DevOps is the most important tech strategy today.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (zgj1024 ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why DevOps is the most important tech strategy today) -[#]: via: (https://opensource.com/article/19/3/devops-most-important-tech-strategy) -[#]: author: (Kelly AlbrechtWilly-Peter Schaub https://opensource.com/users/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht) - -Why DevOps is the most important tech strategy today -====== -Clearing up some of the confusion about DevOps. -![CICD with gears][1] - -Many people first learn about [DevOps][2] when they see one of its outcomes and ask how it happened. It's not necessary to understand why something is part of DevOps to implement it, but knowing that—and why a DevOps strategy is important—can mean the difference between being a leader or a follower in an industry. - -Maybe you've heard some the incredible outcomes attributed to DevOps, such as production environments that are so resilient they can handle thousands of releases per day while a "[Chaos Monkey][3]" is running around randomly unplugging things. This is impressive, but on its own, it's a weak business case, essentially burdened with [proving a negative][4]: The DevOps environment is resilient because a serious failure hasn't been observed… yet. - -There is a lot of confusion about DevOps and many people are still trying to make sense of it. Here's an example from someone in my LinkedIn feed: - -> Recently attended few #DevOps sessions where some speakers seemed to suggest #Agile is a subset of DevOps. Somehow, my understanding was just the opposite. -> -> Would like to hear your thoughts. What do you think is the relationship between Agile and DevOps? -> -> 1. DevOps is a subset of Agile -> 2. Agile is a subset of DevOps -> 3. DevOps is an extension of Agile, starts where Agile ends -> 4. DevOps is the new version of Agile -> - - -Tech industry professionals have been weighing in on the LinkedIn post with a wide range of answers. How would you respond? - -### DevOps' roots in lean and agile - -DevOps makes a lot more sense if we start with the strategies of Henry Ford and the Toyota Production System's refinements of Ford's model. Within this history is the birthplace of lean manufacturing, which has been well studied. In [_Lean Thinking_][5], James P. Womack and Daniel T. Jones distill it into five principles: - - 1. Specify the value desired by the customer - 2. Identify the value stream for each product providing that value and challenge all of the wasted steps currently necessary to provide it - 3. Make the product flow continuously through the remaining value-added steps - 4. Introduce pull between all steps where continuous flow is possible - 5. Manage toward perfection so that the number of steps and the amount of time and information needed to serve the customer continually falls - - - -Lean seeks to continuously remove waste and increase the flow of value to the customer. This is easily recognizable and understood through a core tenet of lean: single piece flow. We can do a number of activities to learn why moving single pieces at a time is magnitudes faster than batches of many pieces; the [Penny Game][6] and the [Airplane Game][7] are two of them. In the Penny Game, if a batch of 20 pennies takes two minutes to get to the customer, they get the whole batch after waiting two minutes. If you move one penny at a time, the customer gets the first penny in about five seconds and continues getting pennies until the 20th penny arrives approximately 25 seconds later. - -This is a huge difference, but not everything in life is as simple and predictable as the penny in the Penny Game. This is where agile comes in. We certainly see lean principles on high-performing agile teams, but these teams need more than lean to do what they do. - -To be able to handle the unpredictability and variance of typical software development tasks, agile methodology focuses on awareness, deliberation, decision, and action to adjust course in the face of a constantly changing reality. For example, agile frameworks (like scrum) increase awareness with ceremonies like the daily standup and the sprint review. If the scrum team becomes aware of a new reality, the framework allows and encourages them to adjust course if necessary. - -For teams to make these types of decisions, they need to be self-organizing in a high-trust environment. High-performing agile teams working this way achieve a fast flow of value while continuously adjusting course, removing the waste of going in the wrong direction. - -### Optimal batch size - -To understand the power of DevOps in software development, it helps to understand the economics of batch size. Consider the following U-curve optimization illustration from Donald Reinertsen's _[Principles of Product Development Flow][8]:_ - -![U-curve optimization illustration of optimal batch size][9] - -This can be explained with an analogy about grocery shopping. Suppose you need to buy some eggs and you live 30 minutes from the store. Buying one egg (far left on the illustration) at a time would mean a 30-minute trip each time. This is your _transaction cost_. The _holding cost_ might represent the eggs spoiling and taking up space in your refrigerator over time. The _total cost_ is the _transaction cost_ plus your _holding cost_. This U-curve explains why, for most people, buying a dozen eggs at a time is their _optimal batch size_. If you lived next door to the store, it'd cost you next to nothing to walk there, and you'd probably buy a smaller carton each time to save room in your refrigerator and enjoy fresher eggs. - -This U-curve optimization illustration can shed some light on why productivity increases significantly in successful agile transformations. Consider the effect of agile transformation on decision making in an organization. In traditional hierarchical organizations, decision-making authority is centralized. This leads to larger decisions made less frequently by fewer people. An agile methodology will effectively reduce an organization's transaction cost for making decisions by decentralizing the decisions to where the awareness and information is the best known: across the high-trust, self-organizing agile teams. - -The following animation shows how reducing transaction cost shifts the optimal batch size to the left. You can't understate the value to an organization in making faster decisions more frequently. - -![U-curve optimization illustration][10] - -### Where does DevOps fit in? - -Automation is one of the things DevOps is most known for. The previous illustration shows the value of automation in great detail. Through automation, we reduce our transaction costs to nearly zero, essentially getting our testing and deployments for free. This lets us take advantage of smaller and smaller batch sizes of work. Smaller batches of work are easier to understand, commit to, test, review, and know when they are done. These smaller batch sizes also contain less variance and risk, making them easier to deploy and, if something goes wrong, to troubleshoot and recover from. With automation combined with a solid agile practice, we can get our feature development very close to single piece flow, providing value to customers quickly and continuously. - -More traditionally, DevOps is understood as a way to knock down the walls of confusion between the dev and ops teams. In this model, development teams develop new features, while operations teams keep the system stable and running smoothly. Friction occurs because new features from development introduce change into the system, increasing the risk of an outage, which the operations team doesn't feel responsible for—but has to deal with anyway. DevOps is not just trying to get people working together, it's more about trying to make more frequent changes safely in a complex environment. - -We can look to [Ron Westrum][11] for research about achieving safety in complex organizations. In researching why some organizations are safer than others, he found that an organization's culture is predictive of its safety. He identified three types of culture: Pathological, Bureaucratic, and Generative. He found that the Pathological culture was predictive of less safety and the Generative culture was predictive of more safety (e.g., far fewer plane crashes or accidental hospital deaths in his main areas of research). - -![Three types of culture identified by Ron Westrum][12] - -Effective DevOps teams achieve a Generative culture with lean and agile practices, showing that speed and safety are complementary, or two sides of the same coin. By reducing the optimal batch sizes of decisions and features to become very small, DevOps achieves a faster flow of information and value while removing waste and reducing risk. - -In line with Westrum's research, change can happen easily with safety and reliability improving at the same time. When an agile DevOps team is trusted to make its own decisions, we get the tools and techniques DevOps is most known for today: automation and continuous delivery. Through this automation, transaction costs are reduced further than ever, and a near single piece lean flow is achieved, creating the potential for thousands of decisions and releases per day, as we've seen happen in high-performing DevOps organizations. - -### Flow, feedback, learning - -DevOps doesn't stop there. We've mainly been talking about DevOps achieving a revolutionary flow, but lean and agile practices are further amplified through similar efforts that achieve faster feedback loops and faster learning. In the [_DevOps Handbook_][13], the authors explain in detail how, beyond its fast flow, DevOps achieves telemetry across its entire value stream for fast and continuous feedback. Further, leveraging the [kaizen][14] bursts of lean and the [retrospectives][15] of scrum, high-performing DevOps teams will continuously drive learning and continuous improvement deep into the foundations of their organizations, achieving a lean manufacturing revolution in the software product development industry. - -### Start with a DevOps assessment - -The first step in leveraging DevOps is, either after much study or with the help of a DevOps consultant and coach, to conduct an assessment across a suite of dimensions consistently found in high-performing DevOps teams. The assessment should identify weak or non-existent team norms that need improvement. Evaluate the assessment's results to find quick wins—focus areas with high chances for success that will produce high-impact improvement. Quick wins are important for gaining the momentum needed to tackle more challenging areas. The teams should generate ideas that can be tried quickly and start to move the needle on the DevOps transformation. - -After some time, the team should reassess on the same dimensions to measure improvements and identify new high-impact focus areas, again with fresh ideas from the team. A good coach will consult, train, mentor, and support as needed until the team owns its own continuous improvement and achieves near consistency on all dimensions by continually reassessing, experimenting, and learning. - -In the [second part][16] of this article, we'll look at results from a DevOps survey in the Drupal community and see where the quick wins are most likely to be found. - -* * * - -_Rob_ _Bayliss and Kelly Albrecht will present[DevOps: Why, How, and What][17] and host a follow-up [Birds of a][18]_ [_Feather_][18] _[discussion][18] at [DrupalCon 2019][19] in Seattle, April 8-12._ - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/devops-most-important-tech-strategy - -作者:[Kelly AlbrechtWilly-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/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc (CICD with gears) -[2]: https://opensource.com/resources/devops -[3]: https://github.com/Netflix/chaosmonkey -[4]: https://en.wikipedia.org/wiki/Burden_of_proof_(philosophy)#Proving_a_negative -[5]: https://www.amazon.com/dp/B0048WQDIO/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 -[6]: https://youtu.be/5t6GhcvKB8o?t=54 -[7]: https://www.shmula.com/paper-airplane-game-pull-systems-push-systems/8280/ -[8]: https://www.amazon.com/dp/B00K7OWG7O/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 -[9]: https://opensource.com/sites/default/files/uploads/batch_size_optimal_650.gif (U-curve optimization illustration of optimal batch size) -[10]: https://opensource.com/sites/default/files/uploads/batch_size_650.gif (U-curve optimization illustration) -[11]: https://en.wikipedia.org/wiki/Ron_Westrum -[12]: https://opensource.com/sites/default/files/uploads/information_flow.png (Three types of culture identified by Ron Westrum) -[13]: https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002/ref=sr_1_3?keywords=DevOps+handbook&qid=1553197361&s=books&sr=1-3 -[14]: https://en.wikipedia.org/wiki/Kaizen -[15]: https://www.scrum.org/resources/what-is-a-sprint-retrospective -[16]: https://opensource.com/article/19/3/where-drupal-community-stands-devops-adoption -[17]: https://events.drupal.org/seattle2019/sessions/devops-why-how-and-what -[18]: https://events.drupal.org/seattle2019/bofs/devops-getting-started -[19]: https://events.drupal.org/seattle2019 From 7587de3a6dda21471555f066c8753070d5144892 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 17 Apr 2019 15:36:58 +0800 Subject: [PATCH 0025/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... programming languages should you learn.md | 46 ------------------ ... programming languages should you learn.md | 47 +++++++++++++++++++ 2 files changed, 47 insertions(+), 46 deletions(-) delete mode 100644 sources/talk/20190208 Which programming languages should you learn.md create mode 100644 translated/talk/20190208 Which programming languages should you learn.md diff --git a/sources/talk/20190208 Which programming languages should you learn.md b/sources/talk/20190208 Which programming languages should you learn.md deleted file mode 100644 index ed334b7761..0000000000 --- a/sources/talk/20190208 Which programming languages should you learn.md +++ /dev/null @@ -1,46 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Which programming languages should you learn?) -[#]: via: (https://opensource.com/article/19/2/which-programming-languages-should-you-learn) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) - -Which programming languages should you learn? -====== -Learning a new programming language is a great way to get ahead in your career. But which one? -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0) - -If you want to get started or get ahead in your programming career, learning a new language is a smart idea. But the huge number of languages in active use invites the question: Which programming language is the best one to know? To answer that, let's start with a simplifying question: What sort of programming do you want to do? - -If you want to do web programming on the client side, then the specialized languages HTML, CSS, and JavaScript—in one of its seemingly infinite dialects—are de rigueur. - -If you want to do web programming on the server side, the options include all of the familiar general-purpose languages: C++, Golang, Java, C#, Node.js, Perl, Python, Ruby, and so on. As a matter of course, server-side programs interact with datastores, such as relational and other databases, which means query languages such as SQL may come into play. - -If you're writing native apps for mobile devices, knowing the target platform is important. For Apple devices, Swift has supplanted Objective C as the language of choice. For Android devices, Java (with dedicated libraries and toolsets) remains the dominant language. There are special languages such as Xamarin, used with C#, that can generate platform-specific code for Apple, Android, and Windows devices. - -What about general-purpose languages? There are various choices within the usual pigeonholes. Among the dynamic or scripting languages (e.g., Perl, Python, and Ruby), there are newer offerings such as Node.js. Java and C#, which are more alike than their fans like to admit, remain the dominant statically compiled languages targeted at a virtual machine (the JVM and CLR, respectively). Among languages that compile into native executables, C++ is still in the mix, along with later arrivals such as Golang and Rust. General-purpose functional languages abound (e.g., Clojure, Haskell, Erlang, F#, Lisp, and Scala), often with passionately devoted communities. It's worth noting that object-oriented languages such as Java and C# have added functional constructs (in particular, lambdas), and the dynamic languages have had functional constructs from the start. - -Let me end with a pitch for C, which is a small, elegant, and extensible language not to be confused with C++. Modern operating systems are written mostly in C, with the rest in assembly language. The standard libraries on any platform are likewise mostly in C. For example, any program that issues the Hello, world! greeting does so through a call to the C library function named **write**. - -C serves as a portable assembly language, exposing details about the underlying system that other high-level languages deliberately hide. To understand C is thus to gain a better grasp of how programs contend for the shared system resources (processors, memory, and I/O devices) required for execution. C is at once high-level and close-to-the-metal, so unrivaled in performance—except, of course, for assembly language. Finally, C is the lingua franca among programming languages, and almost every general-purpose language supports C calls in one form or another. - -For a modern introduction to C, consider my book [C Programming: Introducing Portable Assembler][1]. No matter how you go about it, learn C and you'll learn a lot more than just another programming language. - -What programming languages do you think are important to know? Do you agree or disagree with these recommendations? Let us know in the comments! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/which-programming-languages-should-you-learn - -作者:[Marty Kalin][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/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://www.amazon.com/dp/1977056954?ref_=pe_870760_150889320 diff --git a/translated/talk/20190208 Which programming languages should you learn.md b/translated/talk/20190208 Which programming languages should you learn.md new file mode 100644 index 0000000000..8806b8cfc0 --- /dev/null +++ b/translated/talk/20190208 Which programming languages should you learn.md @@ -0,0 +1,47 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Which programming languages should you learn?) +[#]: via: (https://opensource.com/article/19/2/which-programming-languages-should-you-learn) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +应该学习哪种编程语言? +====== +学习一门新的编程语言是在你的职业生涯中继续前进的好方法,但是应该学习哪一门呢? +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0) + +如果你想要在编程生涯中起步或继续前进,那么学习一门新语言是一个聪明的主意。但是,大量活跃使用的语言引发了一个问题:哪种编程语言是最好学习的?要回答这个问题,让我们从一个简单的问题开始:你想做什么样的程序? + +如果你想在客户端进行网络编程,那么特定语言 HTML、CSS 和 JavaScript(一种看似无穷无尽的方言)是必须要学习的。 + + +如果你想在服务器端进行 Web 编程,那么选项包括常见的通用语言:C++, Golang, Java, C#, Node.js, Perl, Python, Ruby 等等。当然,服务器程序与数据存储(例如关系数据库和其他数据库)打交道,这意味着 SQL 等查询语言可能会发挥作用。 + +如果你正在为移动设备编写本地应用程序,那么了解目标平台非常重要。对于 Apple 设备,Swift 已经取代 Objective C 成为首选语言。对于 Android 设备,Java(带有专用库和工具集)仍然是主要语言。有一些特殊语言,如 与 C# 一起使用的 Xamarin,可以为 Apple、Android 和 Windows 设备生成特定于平台的代码。 + +那么通用语言呢?通常有各种各样的选择。在*动态*或*脚本*语言(如 Perl、Python 和 Ruby)中,有一些新东西,如 Node.js。java 和 C# 的相似之处比它们的粉丝愿意承认的还要多,仍然是针对虚拟机(分别是 JVM 和 CLR)的主要*静态编译*语言。在编译为*原生可执行文件*的语言中,C++ 仍然处于混合状态,以及后来的 Golang 和 Rust 等。通用*函数*语言比比皆是(如 Clojure、Haskell、Erlang、F#、Lisp 和 Scala),它们通常都有热情投入的社区。值得注意的是,面向对象语言(如 Java 和 C#)已经添加了函数构造(特别是 lambdas),而动态语言从一开始就有函数构造。 + +让我以 C 语言结尾,它是一种小巧,优雅,可扩展的语言,不要与 C++ 混淆。现代操作系统主要用 C 语言编写,其余的用汇编语言编写。任何平台上的标准库大多数都是用 C 语言编写的。例如,任何打印 `Hello, world!` 这种问候都是通过调用名为 **write** 的 C 库函数来实现的。 + +C 作为一种可移植的汇编语言,公开了其他高级语言有意隐藏的底层系统的详细信息。因此,理解 C 可以更好地掌握程序如何竞争执行所需的共享系统资源(如处理器,内存和 I/O 设备)。C 语言既高级又接近硬件,因此在性能方面无与伦比,当然,汇编语言除外。最后,C 是编程语言中的通用语言,几乎所有通用语言都支持一种或另一种形式的 C 调用。 + +有关现代 C 语言的介绍,参考我的书籍 [C Programming: Introducing Portable Assembler][1]。无论你怎么做,学习 C 语言,你会学到比另一种编程语言多得多的东西。 + +你认为学习哪些编程语言很重要?你是否同意这些建议?在评论告知我们! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/which-programming-languages-should-you-learn + +作者:[Marty Kalin][a] +选题:[lujun9972][b] + --> +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://www.amazon.com/dp/1977056954?ref_=pe_870760_150889320 From b6327abe7f8c57f0275a145ac631b25671c1d756 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 19:26:37 +0800 Subject: [PATCH 0026/1154] PRF:20190405 Streaming internet radio with RadioDroid.md @tomjlw --- ...treaming internet radio with RadioDroid.md | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/translated/tech/20190405 Streaming internet radio with RadioDroid.md b/translated/tech/20190405 Streaming internet radio with RadioDroid.md index 7dcb940ed6..3a70a29b28 100644 --- a/translated/tech/20190405 Streaming internet radio with RadioDroid.md +++ b/translated/tech/20190405 Streaming internet radio with RadioDroid.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Streaming internet radio with RadioDroid) @@ -9,45 +9,48 @@ 使用 RadioDroid 流传输网络广播 ====== -通过简单的设置使用你家中的音响收听你最爱的网络电台 -![编程中的女士][1] -最近在线新闻通讯社对 [Google 的 Chromecast 音频设备的推出][2]发出哀叹。该设备在音频媒体界受到[好评][3],因此我已经在考虑入手一个。基于 Chromecast 毁灭的消息,我决定在它们全部被打包扔进垃圾堆之前以一个合理价位买一个。 +> 通过简单的设置使用你家中的音响收听你最爱的网络电台。 -我在 [MobileFun][4] 上找到一个放进我的订单中。这个设备最终到货了。它被包在一个常用但是最简的 Google 包装袋中,外面打印着非常简短的开始指南。 +![][1] + +最近网络媒体对 [Google 的 Chromecast 音频设备的下架][2]发出叹息。该设备在音频媒体界备受[好评][3],因此我已经在考虑入手一个。基于 Chromecast 退场的消息,我决定在它们全部被打包扔进垃圾堆之前以一个合理价位买一个。 + +我在 [MobileFun][4] 上找到一个放进我的订单中。这个设备最终到货了。它被包在一个普普通通、简简单单的 Google 包装袋中,外面打印着非常简短的使用指南。 ![Google Chromecast 音频][5] -我用光缆把它通过我的数模转换器的光学 S/PDIF 连接接入家庭音响,希望以此能提供最佳的音质。 +我通过我的数模转换器的光纤 S/PDIF 连接接入到家庭音响,希望以此能提供最佳的音质。 -安装过程并无纰漏,在五分钟后我就准备好播放一些音乐了。我知道一些安卓应用支持 Chromecast,因此我决定用 Google Play 音乐测试它。意料之中,它工作得不错,音乐效果听上去也相当好。然而作为一个具有开源精神的人,我决定看看我能找到什么开源播放器能兼容 Chromecast。 +安装过程并无纰漏,在五分钟后我就可以播放一些音乐了。我知道一些安卓应用支持 Chromecast,因此我决定用 Google Play Music 测试它。意料之中,它工作得不错,音乐效果听上去也相当好。然而作为一个具有开源精神的人,我决定看看我能找到什么开源播放器能兼容 Chromecast。 ### RadioDroid 的救赎 -[RadioDroid Android application][6] 满足条件。它开源并且可从 [GitHub][7],Google Play 以及 [F-Droid][8] 上获取。根据帮助文档,RadioDroid 从 [Community Radio Browser][9] 网页寻找播放流。因此我决定在我的手机上安装尝试一下。 + +[RadioDroid 安卓应用][6] 满足条件。它是开源的,并且可从 [GitHub][7]、Google Play 以及 [F-Droid][8] 上获取。根据帮助文档,RadioDroid 从 [Community Radio Browser][9] 网页寻找播放流。因此我决定在我的手机上安装尝试一下。 ![RadioDroid][10] -安装过程快速平滑,RadioDroid 打开展示当地电台十分迅速。你可以在这个屏幕截图的右上方附近看到 Chromecast 按钮(看上去像一个有着波阵面的长方形图标)。 +安装过程快速顺利,RadioDroid 打开展示当地电台十分迅速。你可以在这个屏幕截图的右上方附近看到 Chromecast 按钮(看上去像一个有着波阵面的长方形图标)。 -我尝试了几个当地电台。应用可靠地在我手机喇叭上播放了音乐。但是我不得不摆弄 Chromecast 按钮来通过 Chromecast 把音乐传到流上。但是它确实可以做到流传输。 +我尝试了几个当地电台。这个应用可靠地在我手机喇叭上播放了音乐。但是我不得不摆弄 Chromecast 按钮来通过 Chromecast 把音乐传到流上。但是它确实可以做到流传输。 -我决定找一些我最爱的网络广播电台,在法国马赛的 [格雷诺耶广播电台][11]。在 RadioDroid 上有许多找到电台的方法。其中一种是使用标签——当地,最流行等——就在电台列表上方。其中一个标签是国家,我找到法国,在其1500个电台中划来划去寻找格雷诺耶广播电台。另一种办法是使用屏幕上方的查询按钮;查询迅速找到了那家美妙的电台。我尝试了其它几次查询它们都返回了合理的信息。 +我决定找一下我喜爱的网络广播电台:法国马赛的 [格雷诺耶广播电台][11]。在 RadioDroid 上有许多找到电台的方法。其中一种是使用标签——“当地”、“最流行”等——就在电台列表上方。其中一个标签是国家,我找到法国,在其 1500 个电台中划来划去寻找格雷诺耶广播电台。另一种办法是使用屏幕上方的查询按钮;查询迅速找到了那家美妙的电台。我尝试了其它几次查询它们都返回了合理的信息。 -回到当地标签,我在列表中翻来覆去,发现“当地”的定义似乎是“在同一个国家”。因此尽管西雅图,波特兰,旧金山,洛杉矶和朱诺比多伦多更靠近我的家,我并没有在当地标签中看到它们。然而通过使用查询功能,我可以发现所有名字中带有西雅图的电台。 +回到“当地”标签,我在列表中翻来覆去,发现“当地”的定义似乎是“在同一个国家”。因此尽管西雅图、波特兰、旧金山、洛杉矶和朱诺比多伦多更靠近我的家,我并没有在“当地”标签中看到它们。然而通过使用查询功能,我可以发现所有名字中带有西雅图的电台。 -语言标签使我找到所有用葡语(及葡语方言)播报的电台。我很快发现了另一个最爱的电台 [91 Rock Curitiba][12]。 +“语言”标签使我找到所有用葡语(及葡语方言)播报的电台。我很快发现了另一个最爱的电台 [91 Rock Curitiba][12]。 -接着灵感来了,现在是春天了但又如何呢?让我们听一些圣诞音乐。意料之中,搜寻圣诞把我引到了 [181.FM – Christmas Blender][13]。不错,一两分钟的欣赏对我就够了。 +接着灵感来了,虽然现在是春天了,但又如何呢?让我们听一些圣诞音乐。意料之中,搜寻圣诞把我引到了 [181.FM – Christmas Blender][13]。不错,一两分钟的欣赏对我就够了。 -因此总的来说,我推荐 RadioDroid 和 Chromecast 的组合作为一种用家庭音响以合理价位播放网络电台的良好方式、 +因此总的来说,我推荐把 RadioDroid 和 Chromecast 的组合作为一种用家庭音响以合理价位播放网络电台的良好方式。 -### 对于音乐方面。。。 +### 对于音乐方面…… 最近我从 [Blue Coast Music][16] 商店里选了一个 [Qua Continuum][15] 创作的叫作 [Continuum One][14] 的有趣的氛围(甚至无节拍)音乐专辑。 -Blue Coast 有许多可提供给开源音乐爱好者的。音乐可以无需通过那些奇怪的平台专用下载管理器下载(有时以物理形式)。它通常提供几种形式,包括 WAV,FLAC 和 DSD;为 WAV 和 FLAC 提供不同的字长和比特率,包括 16/44.1,24/96和24/192,针对 DSD 则有2.8,5.6,和11.2 MHz。音乐是用优秀的仪器精心录制的。不幸的是,我并没有找到许多符合我口味的音乐尽管我喜欢 Blue Coast 上能获取的几个艺术家,包括 Qua Continuum,[Art Lande][17] 以及 [Alex De Grassi][18]。 +Blue Coast 有许多可提供给开源音乐爱好者的。音乐可以无需通过那些奇怪的平台专用下载管理器下载(有时以物理形式)。它通常提供几种形式,包括 WAV、FLAC 和 DSD;WAV 和 FLAC 还提供不同的字长和比特率,包括 16/44.1、24/96 和 24/192,针对 DSD 则有 2.8、5.6 和 11.2 MHz。音乐是用优秀的仪器精心录制的。不幸的是,我并没有找到许多符合我口味的音乐,尽管我喜欢 Blue Coast 上能获取的几个艺术家,包括 Qua Continuum,[Art Lande][17] 以及 [Alex De Grassi][18]。 -在 [Bandcamp][19] 上,我挑选了 [Emancipator's Baralku][20] 和 [Framework's Tides][21],两个都是我喜欢的。两位艺术家创作的音乐符合我的口味——电音但又不(总体来说)是舞蹈,他们的音乐旋律优美,副歌也很好听。有许多可以让开源音乐发烧友爱上 Bandcamp 的东西比如买前试听整首歌的服务;没有垃圾软件下载器;大量与音乐家的合作;以及对 [Creative Commons music][22] 的支持。 +在 [Bandcamp][19] 上,我挑选了 [Emancipator's Baralku][20] 和 [Framework's Tides][21],两个都是我喜欢的。两位艺术家创作的音乐符合我的口味——电音但又(总体来说)不是舞蹈,它们的音乐旋律优美,副歌也很好听。有许多可以让开源音乐发烧友爱上 Bandcamp 的东西,比如买前试听整首歌的服务;没有垃圾软件下载器;与大量音乐家的合作;以及对 [Creative Commons music][22] 的支持。 -------------------------------------------------------------------------------- @@ -56,7 +59,7 @@ via: https://opensource.com/article/19/4/radiodroid-internet-radio-player 作者:[Chris Hermansen (Community Moderator)][a] 选题:[lujun9972][b] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b2d2f718c6d4b11d439e3d5efc75b50766dbfd98 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 19:28:12 +0800 Subject: [PATCH 0027/1154] PUB:20190405 Streaming internet radio with RadioDroid.md @tomjlw https://linux.cn/article-10741-1.html --- .../20190405 Streaming internet radio with RadioDroid.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190405 Streaming internet radio with RadioDroid.md (98%) diff --git a/translated/tech/20190405 Streaming internet radio with RadioDroid.md b/published/20190405 Streaming internet radio with RadioDroid.md similarity index 98% rename from translated/tech/20190405 Streaming internet radio with RadioDroid.md rename to published/20190405 Streaming internet radio with RadioDroid.md index 3a70a29b28..801098b3a1 100644 --- a/translated/tech/20190405 Streaming internet radio with RadioDroid.md +++ b/published/20190405 Streaming internet radio with RadioDroid.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10741-1.html) [#]: subject: (Streaming internet radio with RadioDroid) [#]: via: (https://opensource.com/article/19/4/radiodroid-internet-radio-player) [#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen) From 885f38addaf58b68f037b53a3d3846092e9de4d5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 22:24:57 +0800 Subject: [PATCH 0028/1154] PRF:20190402 Parallel computation in Python with Dask.md @geekpi --- ...arallel computation in Python with Dask.md | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/translated/tech/20190402 Parallel computation in Python with Dask.md b/translated/tech/20190402 Parallel computation in Python with Dask.md index ed29af7b9a..a1376d3f8b 100644 --- a/translated/tech/20190402 Parallel computation in Python with Dask.md +++ b/translated/tech/20190402 Parallel computation in Python with Dask.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Parallel computation in Python with Dask) @@ -9,14 +9,17 @@ 使用 Dask 在 Python 中进行并行计算 ====== -Dask 库将 Python 计算扩展到多个核心甚至是多台机器。 + +> Dask 库可以将 Python 计算扩展到多个核心甚至是多台机器。 + ![Pair programming][1] -关于 Python 性能的一个常见抱怨是[全局解释器锁][2](GIL)。由于 GIL,一次只能有一个线程执行 Python 字节码。因此,即使在现代的多核机器上,使用线程也不会加速计算。 +关于 Python 性能的一个常见抱怨是[全局解释器锁][2](GIL)。由于 GIL,同一时刻只能有一个线程执行 Python 字节码。因此,即使在现代的多核机器上,使用线程也不会加速计算。 -但当你需要并行化到多核时,你不需要停止使用 Python:**[Dask][3]** 库可以将计算扩展到多个内核甚至多个机器。某些设置在数千台机器上配置 Dask,每台机器都有多个内核。虽然存在扩展限制,但并不容易达到。 +但当你需要并行化到多核时,你不需要放弃使用 Python:[Dask][3] 库可以将计算扩展到多个内核甚至多个机器。某些设置可以在数千台机器上配置 Dask,每台机器都有多个内核。虽然存在扩展规模的限制,但一般达不到。 虽然 Dask 有许多内置的数组操作,但举一个非内置的例子,我们可以计算[偏度][4]: + ``` import numpy import dask @@ -31,11 +34,12 @@ skewness = ((unnormalized_moment - (3 * mean * stddev ** 2) - mean ** 3) / stddev ** 3) ``` -请注意,每个操作将根据需要使用尽可能多的内核。这将在所有核心上并行化,即使在计算数十亿个元素时也是如此。 +请注意,每个操作将根据需要使用尽可能多的内核。这将在所有核心上并行化执行,即使在计算数十亿个元素时也是如此。 -当然,并不是我们所有的操作都可由库并行化,有时我们需要自己实现并行性。 +当然,并不是我们所有的操作都可由这个库并行化,有时我们需要自己实现并行性。 为此,Dask 有一个“延迟”功能: + ``` import dask @@ -47,9 +51,9 @@ total = dask.delayed(sum)(palindromes) result = total.compute() ``` -这将计算字符串是否是回文并返回回回文的数量。 +这将计算字符串是否是回文并返回回文的数量。 -虽然 Dask 是为数据科学家创建的,但它绝不仅限于数据科学。每当我们需要在 Python 中并行化任务时,我们可以使用 Dask-有 GIL 或没有 GIL。 +虽然 Dask 是为数据科学家创建的,但它绝不仅限于数据科学。每当我们需要在 Python 中并行化任务时,我们可以使用 Dask —— 无论有没有 GIL。 -------------------------------------------------------------------------------- @@ -58,7 +62,7 @@ via: https://opensource.com/article/19/4/parallel-computation-python-dask 作者:[Moshe Zadka (Community Moderator)][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/) 荣誉推出 From 4f939961b7abbd23619f6f50d14f4cd386e20379 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 17 Apr 2019 22:26:02 +0800 Subject: [PATCH 0029/1154] PUB:20190402 Parallel computation in Python with Dask.md @geekpi https://linux.cn/article-10742-1.html --- .../20190402 Parallel computation in Python with Dask.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190402 Parallel computation in Python with Dask.md (97%) diff --git a/translated/tech/20190402 Parallel computation in Python with Dask.md b/published/20190402 Parallel computation in Python with Dask.md similarity index 97% rename from translated/tech/20190402 Parallel computation in Python with Dask.md rename to published/20190402 Parallel computation in Python with Dask.md index a1376d3f8b..818b242cc6 100644 --- a/translated/tech/20190402 Parallel computation in Python with Dask.md +++ b/published/20190402 Parallel computation in Python with Dask.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10742-1.html) [#]: subject: (Parallel computation in Python with Dask) [#]: via: (https://opensource.com/article/19/4/parallel-computation-python-dask) [#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) From 6ed00012baf3ea1b9bebe9803edc08618df45d5a Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Wed, 17 Apr 2019 17:00:52 +0000 Subject: [PATCH 0030/1154] Revert "Translate Request" This reverts commit 8275cae67ee808f56f3fdbcfd0f41a261715af75. --- sources/tech/20180629 100 Best Ubuntu Apps.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20180629 100 Best Ubuntu Apps.md b/sources/tech/20180629 100 Best Ubuntu Apps.md index 487ebd6e7d..581d22b527 100644 --- a/sources/tech/20180629 100 Best Ubuntu Apps.md +++ b/sources/tech/20180629 100 Best Ubuntu Apps.md @@ -1,4 +1,3 @@ -DaivdMax2006 is translating 100 Best Ubuntu Apps ====== From 88f2973806672b1feee8518d73042cbcd4916773 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Wed, 17 Apr 2019 15:24:24 -0500 Subject: [PATCH 0031/1154] Submit Translated Passage for Review Submit Translated Passage for Review --- ...lticloud-hybrid cloud joint development.md | 78 ------------------- ...lticloud-hybrid cloud joint development.md | 78 +++++++++++++++++++ 2 files changed, 78 insertions(+), 78 deletions(-) delete mode 100644 sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md create mode 100644 translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md diff --git a/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md deleted file mode 100644 index 93e135224c..0000000000 --- a/sources/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tomjlw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development) -[#]: via: (https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Cisco, Google reenergize multicloud/hybrid cloud joint development -====== -Cisco, VMware, HPE and others tap into new Google Cloud Athos cloud technology -![Thinkstock][1] - -Cisco and Google have expanded their joint cloud-development activities to help customers more easily build secure multicloud and hybrid applications everywhere from on-premises data centers to public clouds. - -**[Check out[what hybrid cloud computing is][2] and learn [what you need to know about multi-cloud][3]. Get regularly scheduled insights by [signing up for Network World newsletters][4]]** - -The expansion centers around Google’s new open-source hybrid cloud package called Anthos, which was introduced at the company’s Google Next event this week. Anthos is based on – and supplants – the company's existing Google Cloud Service beta. Anthos will let customers run applications, unmodified, on existing on-premises hardware or in the public cloud and will be available on [Google Cloud Platform][5] (GCP) with [Google Kubernetes Engine][6] (GKE), and in data centers with [GKE On-Prem][7], the company says. Anthos will also let customers for the first time manage workloads running on third-party clouds such as AWS and Azure from the Google platform without requiring administrators and developers to learn different environments and APIs, Google said. - -Essentially, Athos offers a single managed service that promises to let customers manage and deploy workloads across clouds, without having to worry about dissimilar environments or APIs. - -As part of the rollout, Google also announced a beta program called[ Anthos Migrate][8] that Google says auto-migrates VMs from on-premises, or other clouds, directly into containers in GKE. “This unique migration technology lets you migrate and modernize your infrastructure in one streamlined motion, without upfront modifications to the original VMs or applications,” Google said. It gives companies the flexibility to move on-prem apps to a cloud environment at the customers pace, Google said. - -### Cisco and Google - -For its part Cisco announced support of Anthos and promised to tightly integrate it with Cisco data center-technologies, such as its HyperFlex hyperconverged package, Application Centric Infrastructure (Cisco’s flagship SDN offering), SD-WAN and Stealthwatch Cloud. The integrations will enable a consistent, cloud-like experience whether on-prem or in the cloud with automatic upgrades to the latest versions and security patches, Cisco stated. - -"Google Cloud’s expertise in containerization and service mesh – Kubernetes and Istio, respectively – as well as their leadership in the developer community, combined with Cisco’s enterprise-class networking, compute, storage and security products and services makes for a winning combination for our customers," [wrote][9] Kip Compton, Cisco senior vice president, Cloud Platform and Solutions Group. “The Cisco integrations for Anthos will help customers build and manage multicloud and hybrid applications across their on-premises datacenters and public clouds and let them focus on innovation and agility without compromising security or increasing complexity.” - -### Google Cloud and Cisco - -Eyal Manor, vice president, engineering at Google Cloud, [wrote][10] that with Cisco’s support for Anthos, customers will be able to: - - * Benefit from a fully-managed service, like GKE, and Cisco’s hyperconverged infrastructure, networking, and security technologies. - * Operate consistently across an enterprise data center and the cloud. - * Consume cloud services from an enterprise data center. - * Modernize now on premises with the latest cloud technologies. - - - -Cisco and Google have been working closely together since October 2017, when the companies said they were working on an open hybrid cloud platform that bridges on-premises and cloud environments. That package, [Cisco Hybrid Cloud Platform for Google Cloud][11], became generally available in September 2018. It lets customer develop enterprise-grade capabilities from Google Cloud-managed Kubernetes containers that include Cisco networking and security technology as well as service mesh monitoring from Istio. - -Google says Istio’s open-source, container- and microservice-optimized technology offers developers a uniform way to connect, secure, manage and monitor microservices across clouds through service-to-service level mTLS [Mutual Transport Layer Security] authentication access control. As a result, customers can easily implement new, portable services and centrally configure and manage those services. - -Cisco wasn’t the only vendor to announce support for Anthos. At least 30 other big Google partners including [VMware][12], [Dell EMC][13], [HPE][14], Intel, and Lenovo committed to delivering Anthos on their own hyperconverged infrastructure for their customers, Google stated. - -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/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2016/12/hybrid_cloud-100700390-large.jpg -[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html -[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: https://cloud.google.com/ -[6]: https://cloud.google.com/kubernetes-engine/ -[7]: https://cloud.google.com/gke-on-prem/ -[8]: https://cloud.google.com/contact/ -[9]: https://blogs.cisco.com/news/next-phase-cisco-google-cloud -[10]: https://cloud.google.com/blog/topics/partners/google-cloud-partners-with-cisco-on-hybrid-cloud-next19?utm_medium=unpaidsocial&utm_campaign=global-googlecloud-liveevent&utm_content=event-next -[11]: https://cloud.google.com/cisco/ -[12]: https://blogs.vmware.com/networkvirtualization/2019/04/vmware-and-google-showcase-hybrid-cloud-deployment.html/ -[13]: https://www.dellemc.com/en-us/index.htm -[14]: https://www.hpe.com/us/en/newsroom/blog-post/2019/04/hpe-and-google-cloud-join-forces-to-accelerate-innovation-with-hybrid-cloud-solutions-optimized-for-containerized-applications.html -[15]: https://www.facebook.com/NetworkWorld/ -[16]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md new file mode 100644 index 0000000000..1fc3d0c230 --- /dev/null +++ b/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development) +[#]: via: (https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +思科、谷歌重新赋能多/混合云共同开发 +====== +思科,VMware,HPE 与其它公司踏入新的 Google Cloud Athos 云技术 +![Thinkstock][1] + +思科与谷歌已扩展它们的混合云开发活动,以帮助其客户在从预置的数据中心到公共云上的任何地方更简便地搭建安全的多云以及混合云应用。 + +**[查看[什么是混合云计算][2]并了解[关于多云你所需要知道的][3]。[注册 Network World 速报][4]]以定时接受资讯** + +这次扩张围绕着谷歌在这周的 Google Next 活动上介绍的新的称作 Anthos 的开源混合云包展开。Anthos 基于并取代了谷歌现有的谷歌云服务测试版。Anthos 将让客户们无须修改就可以在现有的预置硬件或公共云上运行应用。据谷歌说,它可以在[谷歌云平台][5] (GCP) 与 [谷歌 Kubernetes 引擎][6] (GKE) 或者在数据中心中与 [GKE On-Prem][7] 一同被获取。谷歌说,Anthos 首次让客户们可以无需管理员和开发者了解不同的坏境和 API 就能从谷歌平台上管理在第三方云上的工作负荷如 AWS 和 Azure。 + +关键在于,Athos 提供一个单独的受管理的服务,它使得客户们无须忧虑不相似的环境或 API 就能跨云管理、部署工作负荷。 + +作为首秀的一部分,谷歌也宣布一个能够从预置环境或者其它云自动移植虚拟机到 GKE 上的容器的叫做 [Anthos Migrate[8] 的测试项目。谷歌说,“这种独特的移植技术使你无须修改原来的虚拟机或者应用就能以一种行云流水般的方式迁移、更新你的基础架构”。谷歌称它给予了公司按客户节奏转移预置应用到云环境的灵活性。 + +### 思科和谷歌 + +就思科来说,它宣布对 Anthos 的支持并承诺将它紧密集成进思科的数据中心科技中,例如 HyperFlex 超融合包,应用中心基础架构(思科的旗舰 SDN 方案), SD-WAN 和 StealthWatch 云。思科说,无论是预置的还是在云端的,这次集成将通过自动更新到最新版本和安全补丁,给予一种一致的、云般的感觉。 + +“谷歌云在容器和服务网——分别在 Kubernetes 和 Istio——上的专业与它们在开发者社区的领导力,混合思科的企业级网络,计算,存储和安全产品及服务,将为我们的顾客促成一次强强联合。”思科的资深副总裁,云平台和解决方案小组的 Kip Compton 这样[写道][9],“思科对于 Anthos 的集成将会帮助顾客跨预置数据中心和公共云搭建、管理多云/混合云应用,并使得他们无须在安全上让步或者增加复杂性就能集中精力在创新与敏捷上。” + +### 谷歌云和思科 + +Eyal Manor,在谷歌云工作的副总裁,[写道][10] 通过思科对 Anthos 的支持,客户将能够: +* 从完全受管理的服务例如 GKE 以及思科的超融合基础架构,网络和安全科技中收益。 +* 具有一致性地跨企业数据中心和云操作 +* 从一个企业数据中心消耗云服务 +* 用最新的云技术更新预置架构 + + + +思科和谷歌从2017年10月两公司说他们将从事能够连接预置架构和云环境的开放混合云平台就开始紧密合作。那个包,[为谷歌云打造的思科混合云平台],大致在2018年9月可以获取。它使得客户们能通过谷歌云管理的包含思科网络和安全以及来自 Istio 的服务网络监听技术的 Kubernetes 容器拥有企业级开发的能力。 + +谷歌说 Istio 的开源容器和微服务优化科技给开发者提供了通过服务到服务级的 mTLS [双向传输层安全]访问控制认证进行跨云连接,保护,管理和监听微服务的同一方式。其结果就是,客户能够轻松落实新的便携的服务同时也能够中心化地配置管理那些服务。 + +思科不是唯一宣布对 Anthos 的支持的供应商。谷歌宣称至少30家大的谷歌合作商包括 [VMware][12],[Dell EMC][13], [HPE][14], Intel 和 Lenovo 致力于为他们的客户在它们自己的超融合基础架构上分发 Anthos 服务。 + +在 [Facebook][15] 和 [LinkedIn][16] 上加入 Network World 社区以对高端话题评论。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2016/12/hybrid_cloud-100700390-large.jpg +[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html +[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://cloud.google.com/ +[6]: https://cloud.google.com/kubernetes-engine/ +[7]: https://cloud.google.com/gke-on-prem/ +[8]: https://cloud.google.com/contact/ +[9]: https://blogs.cisco.com/news/next-phase-cisco-google-cloud +[10]: https://cloud.google.com/blog/topics/partners/google-cloud-partners-with-cisco-on-hybrid-cloud-next19?utm_medium=unpaidsocial&utm_campaign=global-googlecloud-liveevent&utm_content=event-next +[11]: https://cloud.google.com/cisco/ +[12]: https://blogs.vmware.com/networkvirtualization/2019/04/vmware-and-google-showcase-hybrid-cloud-deployment.html/ +[13]: https://www.dellemc.com/en-us/index.htm +[14]: https://www.hpe.com/us/en/newsroom/blog-post/2019/04/hpe-and-google-cloud-join-forces-to-accelerate-innovation-with-hybrid-cloud-solutions-optimized-for-containerized-applications.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world + From 1a61451939ce69d9d4125b65335b691712e3cbd7 Mon Sep 17 00:00:00 2001 From: "GJ.Zhang" Date: Thu, 18 Apr 2019 05:12:46 +0800 Subject: [PATCH 0032/1154] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rn Command Line HTTP Client For Curl And Wget Alternative.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md index 46298a6fa0..71224c4917 100644 --- a/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md +++ b/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zgj1024) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 19dbb915201fc37940af1cf6600e3f8054785d7a Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 18 Apr 2019 08:52:03 +0800 Subject: [PATCH 0033/1154] translated --- ...iles and Folders in Linux -Beginner Tip.md | 106 ------------------ 1 file changed, 106 deletions(-) delete mode 100644 sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md diff --git a/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md deleted file mode 100644 index d13fd912f8..0000000000 --- a/sources/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip]) -[#]: via: (https://itsfoss.com/linux-zip-folder/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Zip Files and Folders in Linux [Beginner Tip] -====== - -_**Brief: This quick tip shows you how to create a zip folder in Ubuntu and other Linux distributions. Both terminal and GUI methods have been discussed.**_ - -Zip is one of the most popular archive file format out there. With zip, you can compress multiple files into one file. This not only saves disk space, it also saves network bandwidth. This is why you’ll encounter zip files almost all the time. - -As a normal user, mostly you’ll unzip folders in Linux. But how do you zip a folder in Linux? This article helps you answer that question. - -**Prerequisite: Verify if zip is installed** - -Normally [zip][1] support is installed but no harm in verifying. You can run the below command to install zip and unzip support. If it’s not installed already, it will be installed now. - -``` -sudo apt install zip unzip -``` - -Now that you know your system has zip support, you can read on to learn how to zip a directory in Linux. - -![][2] - -### Zip a folder in Linux Command Line - -The syntax for using the zip command is pretty straight forward. - -``` -zip [option] output_file_name input1 input2 -``` - -While there could be several options, I don’t want you to confuse with them. If your only aim is to create a zip folder from a bunch of files and directories, use the command like this: - -``` -zip -r output_file.zip file1 folder1 -``` - -The -r option will recurse into directories and compress its contents as well. The .zip extension in the output files is optional as .zip is added by default. - -You should see the files being added to the compressed folder during the zip operation. - -``` -zip -r myzip abhi-1.txt abhi-2.txt sample_directory - adding: abhi-1.txt (stored 0%) - adding: abhi-2.txt (stored 0%) - adding: sample_directory/ (stored 0%) - adding: sample_directory/newfile.txt (stored 0%) - adding: sample_directory/agatha.txt (deflated 41%) -``` - -You can use the -e option to [create a password protect zip folder in Linux][3]. - -You are not always restricted to the terminal for creating zip archive files. You can do that graphically as well. Here’s how! - -### Zip a folder in Ubuntu Linux Using GUI - -_Though I have used Ubuntu here, the method should be pretty much the same in other distributions using GNOME or other desktop environment._ - -If you want to compress a file or folder in desktop Linux, it’s just a matter of a few clicks. - -Go to the folder where you have the desired files (and folders) you want to compress into one zip folder. - -In here, select the files and folders. Now, right click and select Compress. You can do the same for a single file as well. - -![Select the files, right click and click compress][4] - -Now you can create a compressed archive file in zip, tar xz or 7z format. In case you are wondering, all these three are various compression algorithms that you can use for compressing your files. - -Give it the name you desire and click on Create. - -![Create archive file][5] - -It shouldn’t take long and you should see an archive file in the same directory. - -![][6] - -Well, that’s it. You successfully created a zip folder in Linux. - -I hope this quick little tip helped you with the zip files. Please feel free to share your suggestions. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-zip-folder/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Zip_(file_format) -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-folder-linux.png?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/password-protect-zip-file/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-file-ubuntu.jpg?resize=800%2C428&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-folder-ubuntu-1.jpg?ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-file-created-in-ubuntu.png?resize=800%2C277&ssl=1 From 519702354b6924a6f37ca6892983f400e2bd5875 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 18 Apr 2019 08:52:13 +0800 Subject: [PATCH 0034/1154] translated --- ...iles and Folders in Linux -Beginner Tip.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md diff --git a/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md new file mode 100644 index 0000000000..49857445e1 --- /dev/null +++ b/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip]) +[#]: via: (https://itsfoss.com/linux-zip-folder/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Linux 中 zip 压缩文件和文件夹(初学者提示) +====== + +_ **简介:本文向你展示了如何在 Ubuntu 和其他 Linux 发行版中创建一个 zip 文件夹。终端和 GUI 方法都有。** _ + +zip 是最流行的归档文件格式之一。使用 zip,你可以将多个文件压缩到一个文件中。这不仅节省了磁盘空间,还节省了网络带宽。这就是为什么你几乎一直会看到 zip 文件的原因。 + +作为普通用户,大多数情况下你会在 Linux 中解压缩文件夹。但是如何在 Linux 中压缩文件夹?本文可以帮助你回答这个问题。 + +**先决条件:验证是否安装了 zip** + +通常 [zip][1] 已经安装,但验证下也没坏处。你可以运行以下命令来安装 zip 和 unzip。如果它尚未安装,它将立即安装。 + +``` +sudo apt install zip unzip +``` + +现在你知道你的系统有 zip 支持,你可以继续了解如何在 Linux 中压缩一个目录。 + +![][2] + +### 在 Linux 命令行中压缩文件夹 + +zip 命令的语法非常简单。 + +``` +zip [option] output_file_name input1 input2 +``` + +虽然有几个选项,但我不希望你将它们混淆。如果你只想要将一堆文件变成一个 zip 文件夹,请使用如下命令: + +``` +zip -r output_file.zip file1 folder1 +``` + +-r 选项将递归目录并压缩其内容。输出文件中的 .zip 扩展名是可选的,因为默认情况下会添加 .zip。 + +你应该会在 zip 操作期间看到要添加到压缩文件夹中的文件。 + +``` +zip -r myzip abhi-1.txt abhi-2.txt sample_directory + adding: abhi-1.txt (stored 0%) + adding: abhi-2.txt (stored 0%) + adding: sample_directory/ (stored 0%) + adding: sample_directory/newfile.txt (stored 0%) + adding: sample_directory/agatha.txt (deflated 41%) +``` + +你可以使用 -e 选项[在 Linux 中创建密码保护的 zip 文件夹][3]。 + +你并不是只能通过终端创建 zip 归档文件。你也可以用图形方式做到这一点。下面是如何做的! + +### 在 Ubuntu Linux 中使用 GUI 压缩文件夹 + +_虽然我在这里使用 Ubuntu,但在使用 GNOME 或其他桌面环境的其他发行版中,方法应该基本相同。_ + +如果要在 Linux 桌面中压缩文件或文件夹,只需点击几下即可。 + +进入到你想将文件(和文件夹)压缩到一个 zip 文件夹的所在文件夹。 + +在这里,选择文件和文件夹。现在,右键单击并选择“压缩”。你也可以对单个文件执行相同操作。 + +![Select the files, right click and click compress][4] + +现在,你可以使用 zip、tar xz 或 7z 格式创建压缩归档文件。如果你好奇,这三个都是各种压缩算法,你可以使用它们来压缩文件。 + +输入一个你想要的名字,并点击“创建” + +![Create archive file][5] + +这不会花很长时间,你会同一目录中看到一个归档文件。 + +![][6] + +好了,就是这些。你已经成功地在 Linux 中创建了一个 zip 文件夹。 + +我希望这篇文章能帮助你了解 zip 文件。请随时分享你的建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-zip-folder/ + +作者:[Abhishek Prakash][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/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Zip_(file_format) +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-folder-linux.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/password-protect-zip-file/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-file-ubuntu.jpg?resize=800%2C428&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-folder-ubuntu-1.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-file-created-in-ubuntu.png?resize=800%2C277&ssl=1 From 11c408c17ff76908d6d609adb63cddf8e5791886 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 18 Apr 2019 08:54:38 +0800 Subject: [PATCH 0035/1154] translating --- sources/tech/20190415 Troubleshooting slow WiFi on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md b/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md index 52af44459a..6c3db30f25 100644 --- a/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md +++ b/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From adc9ab3c582c4b295f07c03fb8c404c8be972cee Mon Sep 17 00:00:00 2001 From: MjSeven Date: Thu, 18 Apr 2019 12:55:16 +0800 Subject: [PATCH 0036/1154] Translating by MjSeven --- .../tech/20190415 How to identify duplicate files on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 How to identify duplicate files on Linux.md b/sources/tech/20190415 How to identify duplicate files on Linux.md index 9bdc92a591..3ddbb4baaa 100644 --- a/sources/tech/20190415 How to identify duplicate files on Linux.md +++ b/sources/tech/20190415 How to identify duplicate files on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5e284b1a440dc2a5fa7cd9302183a2d10306cf2e Mon Sep 17 00:00:00 2001 From: zgj Date: Thu, 18 Apr 2019 16:14:33 +0800 Subject: [PATCH 0037/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...TP Client For Curl And Wget Alternative.md | 119 +++++++++--------- 1 file changed, 58 insertions(+), 61 deletions(-) rename {sources => translated}/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md (65%) diff --git a/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md similarity index 65% rename from sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md rename to translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md index 71224c4917..a05948c9af 100644 --- a/sources/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md +++ b/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -7,86 +7,83 @@ [#]: via: (https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative +HTTPie – 替代 Curl 和 Wget 的现代 HTTP 命令行客户端 ====== -Most of the time we use Curl Command or Wget Command for file download and other purpose. +大多数时间我们会使用 Curl 命令或是 Wget 命令下载文件或者做其他事 -We had written **[best command line download manager][1]** in the past. You can navigate those articles by clicking the corresponding URLs. +我们以前曾写过 **[最佳命令行下载管理器][1]** 的文章。你可以点击相应的 URL 连接来浏览这些文章。 - * **[aria2 – A Command Line Multi-Protocol Download Tool For Linux][2]** - * **[Axel – A Lightweight Command Line Download Accelerator For Linux][3]** - * **[Wget – A Standard Command Line Download Utility For Linux][4]** - * **[curl – A Nifty Command Line Download Tool For Linux][5]** + * **[aria2 – Linux 下的多协议命令行下载工具][2]** + * **[Axel – Linux 下的轻量级命令行下载加速器][3]** + * **[Wget – Linux 下的标准命令行下载工具][4]** + * **[curl – Linux 下的实用的命令行下载工具][5]** +今天我们将讨论同样的话题。实用程序名为 HTTPie。 -Today we are going to discuss about the same kind of topic. The utility name is HTTPie. +它是现代命令行 http 客户端,也是curl和wget命令的最佳替代品。 -It’s modern command line http client and best alternative for curl and wget commands. +### 什么是 HTTPie? -### What Is HTTPie? +HTTPie (发音是 aitch-tee-tee-pie) 是一个 Http 命令行客户端。 -HTTPie (pronounced aitch-tee-tee-pie) is a command line HTTP client. +httpie 工具是现代命令的 HTTP 客户端,它能让命令行界面与 Web 服务进行交互。 -The httpie tool is a modern command line http client which makes CLI interaction with web services. +他提供一个简单 Http 命令,运行使用简单而自然的语法发送任意的 HTTP 请求,并会显示彩色的输出。 -It provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized output. +HTTPie 能用于测试、debugging及与 HTTP 服务器交互。 -HTTPie can be used for testing, debugging, and generally interacting with HTTP servers. +### 主要特点 -### Main Features + * 具表达力的和直观语法 + * 格式化的及彩色化的终端输出 + * 内置 JSON 支持 + * 表单和文件上传 + * HTTPS, 代理, 和认证 + * 任意请求数据 + * 自定义头部 + * 持久化会话(sessions) + * 类似 wget 的下载 + * 支持 Python 2.7 和 3.x - * Expressive and intuitive syntax - * Formatted and colorized terminal output - * Built-in JSON support - * Forms and file uploads - * HTTPS, proxies, and authentication - * Arbitrary request data - * Custom headers - * Persistent sessions - * Wget-like downloads - * Python 2.7 and 3.x support +### 在 Linux 下如何安装 HTTPie +大部分 Linux 发行版都提供了系统包管理器,可以用它来安装。 - -### How To Install HTTPie In Linux? - -Most Linux distributions provide a package that can be installed using the system package manager. - -For **`Fedora`** system, use **[DNF Command][6]** to install httpie. +**`Fedora`** 系统,使用 **[DNF 命令][6]** 来安装 httpie ``` $ sudo dnf install httpie ``` -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][7]** or **[APT Command][8]** to install httpie. +**`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][7]** 或 **[APT 命令][8]** 来安装 httpie。 ``` $ sudo apt install httpie ``` -For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install httpie. +基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][9]** 来安装 httpie。 ``` $ sudo pacman -S httpie ``` -For **`RHEL/CentOS`** systems, use **[YUM Command][10]** to install httpie. +**`RHEL/CentOS`** 的系统, 使用 **[YUM 命令][10]** 来安装 httpie。 ``` $ sudo yum install httpie ``` -For **`openSUSE Leap`** system, use **[Zypper Command][11]** to install httpie. +**`openSUSE Leap`** 系统, 使用 **[Zypper 命令][11]** 来安装 httpie。 ``` $ sudo zypper install httpie ``` -### 1) How To Request A URL Using HTTPie? +### 1) 如何使用 HTTPie 请求URL? -The basic usage of httpie is to request a website URL as an argument. +httpie 的基本用法是将网站的 URL 作为参数。 ``` # http 2daygeek.com @@ -102,9 +99,9 @@ Transfer-Encoding: chunked Vary: Accept-Encoding ``` -### 2) How To Download A File Using HTTPie? +### 2) 如何使用 HTTPie 下载文件 -You can download a file using HTTPie with the `--download` parameter. This is similar to wget command. +你可以使用带 `--download` 参数的 HTTPie 命令下载文件。类似于 wget 命令。 ``` # http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png @@ -128,7 +125,7 @@ Downloading 31.31 kB to "Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png" Done. 31.31 kB in 0.01187s (2.58 MB/s) ``` -Alternatively you can save the output file with different name by using `-o` parameter. +你还可以使用 `-o` 参数用不同的名称保存输出文件。 ``` # http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png -o Anbox-1.png @@ -151,11 +148,10 @@ Vary: Accept-Encoding Downloading 31.31 kB to "Anbox-1.png" Done. 31.31 kB in 0.01551s (1.97 MB/s) ``` +如何使用HTTPie恢复部分下载? +### 3) 如何使用 HTTPie 恢复部分下载? -### 3) How To Resume Partial Download Using HTTPie? - -You can resume the download using HTTPie with the `-c` parameter. - +你可以使用带 `-c` 参数的 HTTPie 继续下载。 ``` # http --download --continue https://speed.hetzner.de/100MB.bin -o 100MB.bin HTTP/1.1 206 Partial Content @@ -173,24 +169,24 @@ Downloading 100.00 MB to "100MB.bin" | 24.14 % 24.14 MB 1.12 MB/s 0:01:07 ETA^C ``` -You can verify the same in the below output. - +你根据下面的输出验证是否同一个文件 ``` [email protected]:/var/log# ls -lhtr 100MB.bin -rw-r--r-- 1 root root 25M Apr 9 01:33 100MB.bin ``` -### 5) How To Upload A File Using HTTPie? +### 5) 如何使用 HTTPie 上传文件? +你可以通过使用带有 `小于号 "<"` 的 HTTPie 命令上传文件 You can upload a file using HTTPie with the `less-than symbol "<"` symbol. ``` $ http https://transfer.sh < Anbox-1.png ``` -### 6) How To Download A File Using HTTPie With Redirect Symbol ">"? +### 6) 如何使用带有重定向符号">" 的 HTTPie 下载文件? -You can download a file using HTTPie with the `redirect ">"` symbol. +你可以使用带有 `重定向 ">"` 符号的 HTTPie 命令下载文件。 ``` # http https://www.2daygeek.com/wp-content/uploads/2019/03/How-To-Install-And-Enable-Flatpak-Support-On-Linux-1.png > Flatpak.png @@ -199,9 +195,10 @@ You can download a file using HTTPie with the `redirect ">"` symbol. -rw-r--r-- 1 root root 47K Apr 9 01:44 Flatpak.png ``` -### 7) Send a HTTP GET Method? +### 7) 发送一个 HTTP GET 请求? + +您可以在请求中发送 HTTP GET 方法。GET 方法会使用给定的 URI,从给定服务器检索信息。 -You can send a HTTP GET method in the request. The GET method is used to retrieve information from the given server using a given URI. ``` # http GET httpie.org @@ -217,9 +214,9 @@ Transfer-Encoding: chunked Vary: Accept-Encoding ``` -### 8) Submit A Form? +### 8) 提交表单? -Use the following format to Submit a forms. A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms. +使用以下格式提交表单。POST 请求用于向服务器发送数据,例如客户信息、文件上传等。要使用 HTML 表单。 ``` # http -f POST Ubuntu18.2daygeek.com hello='World' @@ -237,7 +234,7 @@ Server: Apache/2.4.29 (Ubuntu) Vary: Accept-Encoding ``` -Run the following command to see the request that is being sent. +运行下面的指令以查看正在发送的请求。 ``` # http -v Ubuntu18.2daygeek.com @@ -264,24 +261,24 @@ Server: Apache/2.4.29 (Ubuntu) Vary: Accept-Encoding ``` -### 9) HTTP Authentication? +### 9) HTTP 认证? +当前支持的身份验证认证方案是基本认证(Basic)和摘要验证(Digest) The currently supported authentication schemes are Basic and Digest -Basic auth +基本认证 ``` $ http -a username:password example.org ``` -Digest auth +摘要验证 ``` $ http -A digest -a username:password example.org ``` -Password prompt - +提示输入密码 ``` $ http -a username example.org ``` @@ -292,7 +289,7 @@ via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/zgj1024) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -309,4 +306,4 @@ via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/ [8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ [9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ [10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ \ No newline at end of file From 62b9888b3413db756456d575d05c3c2eeaffd244 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Thu, 18 Apr 2019 22:00:51 +0800 Subject: [PATCH 0038/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to identify duplicate files on Linux.md | 127 ------------------ ...ow to identify duplicate files on Linux.md | 124 +++++++++++++++++ 2 files changed, 124 insertions(+), 127 deletions(-) delete mode 100644 sources/tech/20190415 How to identify duplicate files on Linux.md create mode 100644 translated/tech/20190415 How to identify duplicate files on Linux.md diff --git a/sources/tech/20190415 How to identify duplicate files on Linux.md b/sources/tech/20190415 How to identify duplicate files on Linux.md deleted file mode 100644 index 3ddbb4baaa..0000000000 --- a/sources/tech/20190415 How to identify duplicate files on Linux.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to identify duplicate files on Linux) -[#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How to identify duplicate files on Linux -====== -Some files on a Linux system can appear in more than one location. Follow these instructions to find and identify these "identical twins" and learn why hard links can be so advantageous. -![Archana Jarajapu \(CC BY 2.0\)][1] - -Identifying files that share disk space relies on making use of the fact that the files share the same inode — the data structure that stores all the information about a file except its name and content. If two or more files have different names and file system locations, yet share an inode, they also share content, ownership, permissions, etc. - -These files are often referred to as "hard links" — unlike symbolic links that simply point to other files by containing their names. Symbolic links are easy to pick out in a file listing by the "l" in the first position and **- >** symbol that refers to the file being referenced. - -``` -$ ls -l my* --rw-r--r-- 4 shs shs 228 Apr 12 19:37 myfile -lrwxrwxrwx 1 shs shs 6 Apr 15 11:18 myref -> myfile --rw-r--r-- 4 shs shs 228 Apr 12 19:37 mytwin -``` - -Identifying hard links in a single directory is not as obvious, but it is still quite easy. If you list the files using the **ls -i** command and sort them by inode number, you can pick out the hard links fairly easily. In this type of ls output, the first column shows the inode numbers. - -``` -$ ls -i | sort -n | more - ... - 788000 myfile <== - 788000 mytwin <== - 801865 Name_Labels.pdf - 786692 never leave home angry - 920242 NFCU_Docs - 800247 nmap-notes -``` - -Scan your output looking for identical inode numbers and any matches will tell you what you want to know. - -**[ Also see:[Invaluable tips and tricks for troubleshooting Linux][2] ]** - -If, on the other hand, you simply want to know if one particular file is hard-linked to another file, there's an easier way than scanning through a list of what may be hundreds of files. The find command's **-samefile** option will do the work for you. - -``` -$ find . -samefile myfile -./myfile -./save/mycopy -./mytwin -``` - -Notice that the starting location provided to the find command will determine how much of the file system is scanned for matches. In the above example, we're looking in the current directory and subdirectories. - -Adding output details using find's **-ls** option might be more convincing: - -``` -$ find . -samefile myfile -ls - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./myfile - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./save/mycopy - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./mytwin -``` - -The first column shows the inode number. Then we see file permissions, links, owner, file size, date information, and the names of the files that refer to the same disk content. Note that the link field in this case is a "4" not the "3" we might expect, telling us that there's another link to this same inode as well (but outside our search range). - -If you want to look for all instances of hard links in a single directory, you could try a script like this that will create the list and look for the duplicates for you: - -``` -#!/bin/bash - -# seaches for files sharing inodes - -prev="" - -# list files by inode -ls -i | sort -n > /tmp/$0 - -# search through file for duplicate inode #s -while read line -do - inode=`echo $line | awk '{print $1}'` - if [ "$inode" == "$prev" ]; then - grep $inode /tmp/$0 - fi - prev=$inode -done < /tmp/$0 - -# clean up -rm /tmp/$0 - -$ ./findHardLinks - 788000 myfile - 788000 mytwin -``` - -You can also use the find command to look for files by inode number as in this command. However, this search could involve more than one file system, so it is possible that you will get false results, since the same inode number might be used in another file system where it would not represent the same file. If that's the case, other file details will not be identical. - -``` -$ find / -inum 788000 -ls 2> /dev/null - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /tmp/mycopy - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/myfile - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/save/mycopy - 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/mytwin -``` - -Note that error output was shunted off to /dev/null so that we didn't have to look at all the "Permission denied" errors that would have otherwise been displayed for other directories that we're not allowed to look through. - -Also, scanning for files that contain the same content but don't share inodes (i.e., simply file copies) would take considerably more time and effort. - -Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all - -作者:[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/04/reflections-candles-100793651-large.jpg -[2]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html -[3]: https://www.facebook.com/NetworkWorld/ -[4]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190415 How to identify duplicate files on Linux.md b/translated/tech/20190415 How to identify duplicate files on Linux.md new file mode 100644 index 0000000000..033c3d85a1 --- /dev/null +++ b/translated/tech/20190415 How to identify duplicate files on Linux.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to identify duplicate files on Linux) +[#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何识别 Linux 上的重复文件 +====== +Linux 系统上的一些文件可能出现在多个位置。按照本文指示查找并识别这些“同卵双胞胎”,还可以了解为什么硬链接会如此有利。 +![Archana Jarajapu \(CC BY 2.0\)][1] + +识别共享磁盘空间的文件依赖于利用文件共享相同的 `inode` 这一事实。这种数据结构存储除了文件名和内容之外的所有信息。如果两个或多个文件具有不同的名称和文件系统位置,但共享一个 inode,则它们还共享内容、所有权、权限等。 + +这些文件通常被称为“硬链接”,不像符号链接(即软链接)那样仅仅通过包含它们的名称指向其他文件,符号链接很容易在文件列表中通过第一个位置的 “l” 和引用文件的 **->** 符号识别出来。 + +``` +$ ls -l my* +-rw-r--r-- 4 shs shs 228 Apr 12 19:37 myfile +lrwxrwxrwx 1 shs shs 6 Apr 15 11:18 myref -> myfile +-rw-r--r-- 4 shs shs 228 Apr 12 19:37 mytwin +``` + +识别单个目录中的硬链接并不是很明显,但它仍然非常容易。如果使用 **ls -i** 命令列出文件并按 `inode` 编号排序,则可以非常容易地挑选出硬链接。在这种类型的 `ls` 输出中,第一列显示 `inode` 编号。 + +``` +$ ls -i | sort -n | more + ... + 788000 myfile <== + 788000 mytwin <== + 801865 Name_Labels.pdf + 786692 never leave home angry + 920242 NFCU_Docs + 800247 nmap-notes +``` + +扫描输出,查找相同的 `inode` 编号,任何匹配都会告诉你想知道的内容。 + +**[另请参考:[Linux 疑难解答的宝贵提示和技巧][2]]** + +另一方面,如果你只是想知道某个特定文件是否是另一个文件的硬链接,那么有一种方法比浏览数百个文件的列表更简单,即 `find` 命令的 **-samefile** 选项将帮助你完成工作。 +``` +$ find . -samefile myfile +./myfile +./save/mycopy +./mytwin +``` + +注意,提供给 `find` 命令的起始位置决定文件系统会扫描多少来进行匹配。在上面的示例中,我们正在查看当前目录和子目录。 + +使用 find 的 **-ls** 选项添加输出的详细信息可能更有说服力: +``` +$ find . -samefile myfile -ls + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./myfile + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./save/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./mytwin +``` + +第一列显示 `inode` 编号,然后我们会看到文件权限、链接、所有者、文件大小、日期信息以及引用相同磁盘内容的文件的名称。注意,在这种情况下,`link` 字段是 “4” 而不是我们可能期望的 “3”。这告诉我们还有另一个指向同一个 `inode` 的链接(但不在我们的搜索范围内)。 + +如果你想在一个目录中查找所有硬链接的实例,可以尝试以下的脚本来创建列表并为你查找副本: +``` +#!/bin/bash + +# seaches for files sharing inodes + +prev="" + +# list files by inode +ls -i | sort -n > /tmp/$0 + +# search through file for duplicate inode #s +while read line +do + inode=`echo $line | awk '{print $1}'` + if [ "$inode" == "$prev" ]; then + grep $inode /tmp/$0 + fi + prev=$inode +done < /tmp/$0 + +# clean up +rm /tmp/$0 + +$ ./findHardLinks + 788000 myfile + 788000 mytwin +``` + +你还可以使用 `find` 命令按 `inode` 编号查找文件,如命令中所示。但是,此搜索可能涉及多个文件系统,因此可能会得到错误的结果。因为相同的 `inode` 编号可能会在另一个文件系统中使用,代表另一个文件。如果是这种情况,文件的其他详细信息将不相同。 + +``` +$ find / -inum 788000 -ls 2> /dev/null + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /tmp/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/myfile + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/save/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/mytwin +``` + +注意,错误输出被重定向到 `/dev/null`,这样我们就不必查看所有 "Permission denied" 错误,否则这些错误将显示在我们不允许查看的其他目录中。 + +此外,扫描包含相同内容但不共享 `inode` 的文件(即,简单的文本拷贝)将花费更多的时间和精力。 + +加入 [Facebook][3] 和 [LinkedIn][4] 上的网络世界社区,对重要的话题发表评论。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/reflections-candles-100793651-large.jpg +[2]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From aa4be1337cfce506686ca7b0926823afeee400ca Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 18 Apr 2019 22:45:21 +0800 Subject: [PATCH 0039/1154] PRF:20190317 How To Configure sudo Access In Linux.md @liujing97 --- ...7 How To Configure sudo Access In Linux.md | 86 +++++++++---------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/translated/tech/20190317 How To Configure sudo Access In Linux.md b/translated/tech/20190317 How To Configure sudo Access In Linux.md index 1a23afdd69..b4de951c9b 100644 --- a/translated/tech/20190317 How To Configure sudo Access In Linux.md +++ b/translated/tech/20190317 How To Configure sudo Access In Linux.md @@ -1,18 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Configure sudo Access In Linux?) [#]: via: (https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Linux 中如何配置 sudo 访问权限? +如何在 Linux 中配置 sudo 访问权限 ====== -Linux 系统中 root 用户拥有所有的控制权力。 - -Linux 系统中 root 是拥有最高权力的用户,可以在系统中实施任意的行为。 +Linux 系统中 root 用户拥有 Linux 中全部控制权力。Linux 系统中 root 是拥有最高权力的用户,可以在系统中实施任意的行为。 如果其他用户想去实施一些行为,不能为所有人都提供 root 访问权限。因为如果他或她做了一些错误的操作,没有办法去纠正它。 @@ -20,43 +18,40 @@ Linux 系统中 root 是拥有最高权力的用户,可以在系统中实施 我们可以把 sudo 权限发放给相应的用户来克服这种情况。 -sudo 命令提供了一种机制,它可以在不用分享 root 用户的密码的前提下,为信任的用户提供系统的管理权限。 +`sudo` 命令提供了一种机制,它可以在不用分享 root 用户的密码的前提下,为信任的用户提供系统的管理权限。 他们可以执行大部分的管理操作,但又不像 root 一样有全部的权限。 ### 什么是 sudo? -sudo 是一个程序,普通用户可以使用它以超级用户或其他用户的身份执行命令,是由安全策略指定的。 +`sudo` 是一个程序,普通用户可以使用它以超级用户或其他用户的身份执行命令,是由安全策略指定的。 sudo 用户的访问权限是由 `/etc/sudoers` 文件控制的。 ### sudo 用户有什么优点? -在 Linux 系统中,如果你不熟悉一个命令,sudo 是运行它的一个安全方式。 +在 Linux 系统中,如果你不熟悉一个命令,`sudo` 是运行它的一个安全方式。 - * Linux 系统在 `/var/log/secure` 和 `/var/log/auth.log` 文件中保留日志,并且你可以验证 sudo 用户实施了哪些行为操作。 - * 每一次它都为当前的操作提示输入密码。所以,你将会有时间去验证这个操作是不是你想要执行的。如果你发觉它是不正确的行为,你可以安全地退出而且没有执行此操作。 +* Linux 系统在 `/var/log/secure` 和 `/var/log/auth.log` 文件中保留日志,并且你可以验证 sudo 用户实施了哪些行为操作。 +* 每一次它都为当前的操作提示输入密码。所以,你将会有时间去验证这个操作是不是你想要执行的。如果你发觉它是不正确的行为,你可以安全地退出而且没有执行此操作。 +基于 RHEL 的系统(如 Redhat (RHEL)、 CentOS 和 Oracle Enterprise Linux (OEL))和基于 Debian 的系统(如 Debian、Ubuntu 和 LinuxMint)在这点是不一样的。 -基于 RHEL 的系统(如 Redhat (RHEL), CentOS 和 Oracle Enterprise Linux (OEL))和基于 Debian 的系统(如 Debian, Ubuntu 和 LinuxMint)在这点是不一样的。 - -我们将会教你如何在本文中的两种发行版中执行该操作。 +我们将会教你如何在本文中提及的两种发行版中执行该操作。 这里有三种方法可以应用于两个发行版本。 - * 增加用户到相应的组。基于 RHEL 的系统,我们需要添加用户到 `wheel` 组。基于 Debain 的系统,我们添加用户到 `sudo` 或 `admin` 组。 - * 手动添加用户到 `/etc/group` 文件中。 - * 用 visudo 命令添加用户到 `/etc/sudoers` 文件中。 - - +* 增加用户到相应的组。基于 RHEL 的系统,我们需要添加用户到 `wheel` 组。基于 Debain 的系统,我们添加用户到 `sudo` 或 `admin` 组。 +* 手动添加用户到 `/etc/group` 文件中。 +* 用 `visudo` 命令添加用户到 `/etc/sudoers` 文件中。 ### 如何在 RHEL/CentOS/OEL 系统中配置 sudo 访问权限? -在基于 RHEL 的系统中(如 Redhat (RHEL), CentOS 和 Oracle Enterprise Linux (OEL)),使用下面的三个方法就可以做到。 +在基于 RHEL 的系统中(如 Redhat (RHEL)、 CentOS 和 Oracle Enterprise Linux (OEL)),使用下面的三个方法就可以做到。 -### 方法 1:在 Linux 中如何使用 wheel 组为普通用户授予超级用户访问权限? +#### 方法 1:在 Linux 中如何使用 wheel 组为普通用户授予超级用户访问权限? -Wheel 是基于 RHEL 的系统中的一个特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 +wheel 是基于 RHEL 的系统中的一个特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 注意,应该在 `/etc/sudoers` 文件中激活 `wheel` 组来获得该访问权限。 @@ -70,7 +65,7 @@ Wheel 是基于 RHEL 的系统中的一个特殊组,它提供额外的权限 假设我们已经创建了一个用户账号来执行这些操作。在此,我将会使用 `daygeek` 这个用户账号。 -执行下面的命令,添加用户到 wheel 组。 +执行下面的命令,添加用户到 `wheel` 组。 ``` # usermod -aG wheel daygeek @@ -87,10 +82,10 @@ wheel:x:10:daygeek ``` $ tail -5 /var/log/secure -tail: cannot open _/var/log/secure_ for reading: Permission denied +tail: cannot open /var/log/secure for reading: Permission denied ``` -当我试图以普通用户身份访问 `/var/log/secure` 文件时出现错误。 我将使用 sudo 访问同一个文件,让我们看看这个魔术。 +当我试图以普通用户身份访问 `/var/log/secure` 文件时出现错误。 我将使用 `sudo` 访问同一个文件,让我们看看这个魔术。 ``` $ sudo tail -5 /var/log/secure @@ -102,9 +97,9 @@ Mar 17 07:05:10 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=roo Mar 17 07:05:10 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) ``` -### 方法 2:在 RHEL/CentOS/OEL 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? +#### 方法 2:在 RHEL/CentOS/OEL 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? -我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 wheel 组。 +我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 `wheel` 组。 只需打开该文件,并在恰当的组后追加相应的用户就可完成这一点。 @@ -115,7 +110,7 @@ wheel:x:10:daygeek,user1 在该例中,我将使用 `user1` 这个用户账号。 -我将要通过在系统中重启 `Apache` 服务来检查用户 `user1` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 +我将要通过在系统中重启 Apache httpd 服务来检查用户 `user1` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 ``` $ sudo systemctl restart httpd @@ -128,11 +123,11 @@ Mar 17 07:10:40 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; Mar 17 07:12:35 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/grep -i httpd /var/log/secure ``` -### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? +#### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? -sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 wheel 组下的 sudoers 文件中即可。 +sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 `sudoers` 文件中 的 `wheel` 组下即可。 -只需通过 visudo 命令将期望的用户追加到 /etc/sudoers 文件中。 +只需通过 `visudo` 命令将期望的用户追加到 `/etc/sudoers` 文件中。 ``` # grep -i user2 /etc/sudoers @@ -141,7 +136,7 @@ user2 ALL=(ALL) ALL 在该例中,我将使用 `user2` 这个用户账号。 -我将要通过在系统中重启 `MariaDB` 服务来检查用户 `user2` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 +我将要通过在系统中重启 MariaDB 服务来检查用户 `user2` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 ``` $ sudo systemctl restart mariadb @@ -155,11 +150,11 @@ Mar 17 07:26:52 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; ### 在 Debian/Ubuntu 系统中如何配置 sudo 访问权限? -在基于 Debian 的系统中(如 Debian, Ubuntu 和 LinuxMint),使用下面的三个方法就可以做到。 +在基于 Debian 的系统中(如 Debian、Ubuntu 和 LinuxMint),使用下面的三个方法就可以做到。 -### 方法 1:在 Linux 中如何使用 sudo 或 admin 组为普通用户授予超级用户访问权限? +#### 方法 1:在 Linux 中如何使用 sudo 或 admin 组为普通用户授予超级用户访问权限? -sudo 或 admin 是基于 Debian 的系统中的特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 +`sudo` 或 `admin` 是基于 Debian 的系统中的特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 注意,应该在 `/etc/sudoers` 文件中激活 `sudo` 或 `admin` 组来获得该访问权限。 @@ -175,7 +170,7 @@ sudo 或 admin 是基于 Debian 的系统中的特殊组,它提供额外的权 假设我们已经创建了一个用户账号来执行这些操作。在此,我将会使用 `2gadmin` 这个用户账号。 -执行下面的命令,添加用户到 sudo 组。 +执行下面的命令,添加用户到 `sudo` 组。 ``` # usermod -aG sudo 2gadmin @@ -195,7 +190,7 @@ $ less /var/log/auth.log /var/log/auth.log: Permission denied ``` -当我试图以普通用户身份访问 `/var/log/auth.log` 文件时出现错误。 我将要使用 sudo 访问同一个文件,让我们看看这个魔术。 +当我试图以普通用户身份访问 `/var/log/auth.log` 文件时出现错误。 我将要使用 `sudo` 访问同一个文件,让我们看看这个魔术。 ``` $ sudo tail -5 /var/log/auth.log @@ -209,7 +204,7 @@ Mar 17 20:40:48 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user r 或者,我们可以通过添加用户到 `admin` 组来执行相同的操作。 -运行下面的命令,添加用户到 admin 组。 +运行下面的命令,添加用户到 `admin` 组。 ``` # usermod -aG admin user1 @@ -231,9 +226,9 @@ Mar 17 20:53:36 Ubuntu18 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; Mar 17 20:53:36 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user1(uid=0) ``` -### 方法 2:在 Debian/Ubuntu 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? +#### 方法 2:在 Debian/Ubuntu 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? -我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 sudo 组或 admin 组。 +我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 `sudo` 组或 `admin` 组。 只需打开该文件,并在恰当的组后追加相应的用户就可完成这一点。 @@ -244,7 +239,7 @@ sudo:x:27:2gadmin,user2 在该例中,我将使用 `user2` 这个用户账号。 -我将要通过在系统中重启 `Apache` 服务来检查用户 `user2` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 +我将要通过在系统中重启 Apache httpd 服务来检查用户 `user2` 是不是拥有 `sudo` 访问权限。让我们看看这个魔术。 ``` $ sudo systemctl restart apache2 @@ -257,11 +252,11 @@ Mar 17 21:01:04 Ubuntu18 systemd: pam_unix(systemd-user:session): session opened Mar 17 21:01:33 Ubuntu18 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/systemctl restart apache2 ``` -### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? +#### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? -sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 sudo 或 admin 组下的 sudoers 文件中即可。 +sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 `sudoers` 文件中的 `sudo` 或 `admin` 组下即可。 -只需通过 visudo 命令将期望的用户追加到 /etc/sudoers 文件中。 +只需通过 `visudo` 命令将期望的用户追加到 `/etc/sudoers` 文件中。 ``` # grep -i user3 /etc/sudoers @@ -270,7 +265,7 @@ user3 ALL=(ALL:ALL) ALL 在该例中,我将使用 `user3` 这个用户账号。 -我将要通过在系统中重启 `MariaDB` 服务来检查用户 `user3` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 +我将要通过在系统中重启 MariaDB 服务来检查用户 `user3` 是不是拥有 `sudo` 访问权限。让我们看看这个魔术。 ``` $ sudo systemctl restart mariadb @@ -285,6 +280,7 @@ Mar 17 21:12:53 Ubuntu18 sudo: pam_unix(sudo:session): session closed for user r Mar 17 21:13:08 Ubuntu18 sudo: user3 : TTY=pts/0 ; PWD=/home/user3 ; USER=root ; COMMAND=/usr/bin/tail -f /var/log/auth.log Mar 17 21:13:08 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user3(uid=0) ``` + -------------------------------------------------------------------------------- via: https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/ @@ -292,7 +288,7 @@ via: https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[liujing97](https://github.com/liujing97) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4e8f27794c8bf8a0be9162aa1630f14df109a700 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 18 Apr 2019 22:46:58 +0800 Subject: [PATCH 0040/1154] PUB:20190317 How To Configure sudo Access In Linux.md @liujing97 https://linux.cn/article-10746-1.html --- .../20190317 How To Configure sudo Access In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190317 How To Configure sudo Access In Linux.md (99%) diff --git a/translated/tech/20190317 How To Configure sudo Access In Linux.md b/published/20190317 How To Configure sudo Access In Linux.md similarity index 99% rename from translated/tech/20190317 How To Configure sudo Access In Linux.md rename to published/20190317 How To Configure sudo Access In Linux.md index b4de951c9b..efbd663b44 100644 --- a/translated/tech/20190317 How To Configure sudo Access In Linux.md +++ b/published/20190317 How To Configure sudo Access In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (liujing97) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10746-1.html) [#]: subject: (How To Configure sudo Access In Linux?) [#]: via: (https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From ca5a737d86cb018556e7b2dae6d1316f397e9ae3 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Fri, 19 Apr 2019 00:02:10 +0800 Subject: [PATCH 0041/1154] Update and rename sources/tech/20190328 How to run PostgreSQL on Kubernetes.md to translated/tech/20190328 How to run PostgreSQL on Kubernetes.md --- ...328 How to run PostgreSQL on Kubernetes.md | 108 ------------------ ...328 How to run PostgreSQL on Kubernetes.md | 102 +++++++++++++++++ 2 files changed, 102 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20190328 How to run PostgreSQL on Kubernetes.md create mode 100644 translated/tech/20190328 How to run PostgreSQL on Kubernetes.md diff --git a/sources/tech/20190328 How to run PostgreSQL on Kubernetes.md b/sources/tech/20190328 How to run PostgreSQL on Kubernetes.md deleted file mode 100644 index 2d259db48d..0000000000 --- a/sources/tech/20190328 How to run PostgreSQL on Kubernetes.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (arrowfeng) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to run PostgreSQL on Kubernetes) -[#]: via: (https://opensource.com/article/19/3/how-run-postgresql-kubernetes) -[#]: author: (Jonathan S. Katz https://opensource.com/users/jkatz05) - -How to run PostgreSQL on Kubernetes -====== -Create uniformly managed, cloud-native production deployments with the -flexibility to deploy a personalized database-as-a-service. -![cubes coming together to create a larger cube][1] - -By running a [PostgreSQL][2] database on [Kubernetes][3], you can create uniformly managed, cloud-native production deployments with the flexibility to deploy a personalized database-as-a-service tailored to your specific needs. - -Using an Operator allows you to provide additional context to Kubernetes to [manage a stateful application][4]. An Operator is also helpful when using an open source database like PostgreSQL to help with actions including provisioning, scaling, high availability, and user management. - -Let's explore how to get PostgreSQL up and running on Kubernetes. - -### Set up the PostgreSQL operator - -The first step to using PostgreSQL with Kubernetes is installing an Operator. You can get up and running with the open source [Crunchy PostgreSQL Operator][5] on any Kubernetes-based environment with the help of Crunchy's [quickstart script][6] for Linux. - -The quickstart script has a few prerequisites: - - * The [Wget][7] utility installed - * [kubectl][8] installed - * A [StorageClass][9] defined on your Kubernetes cluster - * Access to a Kubernetes user account with cluster-admin privileges. This is required to install the Operator [RBAC][10] rules - * A [namespace][11] to hold the PostgreSQL Operator - - - -Executing the script will give you a default PostgreSQL Operator deployment that assumes [dynamic storage][12] and a StorageClass named **standard**. User-provided values are allowed by the script to override these defaults. - -You can download the quickstart script and set it to be executable with the following commands: - -``` -wget -chmod +x ./quickstart.sh -``` - -Then you can execute the quickstart script: - -``` -./examples/quickstart.sh -``` - -After the script prompts you for some basic information about your Kubernetes cluster, it performs the following operations: - - * Downloads the Operator configuration files - * Sets the **$HOME/.pgouser** file to default settings - * Deploys the Operator as a Kubernetes [Deployment][13] - * Sets your **.bashrc** to include the Operator environmental variables - * Sets your **$HOME/.bash_completion** file to be the **pgo bash_completion** file - - - -During the quickstart's execution, you'll be prompted to set up the RBAC rules for your Kubernetes cluster. In a separate terminal, execute the command the quickstart command tells you to use. - -Once the script completes, you'll get information on setting up a port forward to the PostgreSQL Operator pod. In a separate terminal, execute the port forward; this will allow you to begin executing commands to the PostgreSQL Operator! Try creating a cluster by entering: - -``` -pgo create cluster mynewcluster -``` - -You can test that your cluster is up and running with by entering: - -``` -pgo test mynewcluster -``` - -You can now manage your PostgreSQL databases in your Kubernetes environment! You can find a full reference to commands, including those for scaling, high availability, backups, and more, in the [documentation][14]. - -* * * - -_Parts of this article are based on[Get Started Running PostgreSQL on Kubernetes][15] that the author wrote for the Crunchy blog._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/how-run-postgresql-kubernetes - -作者:[Jonathan S. Katz][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/jkatz05 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) -[2]: https://www.postgresql.org/ -[3]: https://kubernetes.io/ -[4]: https://opensource.com/article/19/2/scaling-postgresql-kubernetes-operators -[5]: https://github.com/CrunchyData/postgres-operator -[6]: https://crunchydata.github.io/postgres-operator/stable/installation/#quickstart-script -[7]: https://www.gnu.org/software/wget/ -[8]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ -[9]: https://kubernetes.io/docs/concepts/storage/storage-classes/ -[10]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ -[11]: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ -[12]: https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/ -[13]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ -[14]: https://crunchydata.github.io/postgres-operator/stable/#documentation -[15]: https://info.crunchydata.com/blog/get-started-runnning-postgresql-on-kubernetes diff --git a/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md b/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md new file mode 100644 index 0000000000..f29110281e --- /dev/null +++ b/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to run PostgreSQL on Kubernetes) +[#]: via: (https://opensource.com/article/19/3/how-run-postgresql-kubernetes) +[#]: author: (Jonathan S. Katz https://opensource.com/users/jkatz05) + +怎样在Kubernetes上运行PostgreSQL +====== +创建统一管理的,具备灵活性的云原生生产部署来部署一个人性化的数据库即服务。 +![cubes coming together to create a larger cube][1] + +通过在[Kubernetes][2]上运行[PostgreSQL][3]数据库,你能创建统一管理的,具备灵活性的云原生生产部署应用来部署一个个性化的数据库即服务为你的特定需求进行量身定制。 + +对于Kubernetes,使用Operator允许你提供额外的上下文去[管理有状态应用][4]。当使用像PostgreSQL这样开源的数据库去执行包括配置,扩张,高可用和用户管理时,Operator也很有帮助。 + +让我们来探索如何在Kubernetes上启动并运行PostgreSQL。 + +### 安装 PostgreSQL Operator + +将PostgreSQL和Kubernetes结合使用的第一步是安装一个Operator。在针对Linux系统的Crunchy's [快速启动脚本][6]的帮助下,你可以在任意基于Kubernetes的环境下启动和运行开源的[Crunchy PostgreSQL Operator][5]。 + +快速启动脚本有一些必要前提: + + * [Wget][7]工具已安装。 + * [kubectl][8]工具已安装。 + * 一个[StorageClass][9]已经定义在你的Kubernetes中。 + * 拥有集群权限的可访问Kubernetes的用户账号。安装Operator的[RBAC][10]规则是必要的。 + * 拥有一个[namespace][11]去管理PostgreSQL Operator。 + + + +执行这个脚本将提供给你一个默认的PostgreSQL Operator deployment,它假设你的[dynamic storage][12]和存储类的名字为**standard**。通过这个脚本允许用户自定义的值去覆盖这些默认值。 + +通过下列命令,你能下载这个快速启动脚本并把它的权限设置为可执行: +``` +wget +chmod +x ./quickstart.sh +``` + +然后你运行快速启动脚本: +``` +./examples/quickstart.sh +``` + +在脚本提示你相关的Kubernetes集群基本信息后,它将执行下列操作: + * 下载Operator配置文件 + * 将 **$HOME/.pgouser** 这个文件设置为默认设置 + * 以Kubernetes [Deployment][13]部署Operator + * 设置你的 **.bashrc** 文件包含Operator环境变量 + * 设置你的 **$HOME/.bash_completion** 文件为 **pgo bash_completion**文件 + +在快速启动脚本的执行期间,你将会被提示在你的Kubernetes集群设置RBAC规则。在另一个终端,执行快速启动命令所提示你的命令。 + +一旦这个脚本执行完成,你将会得到关于打开一个端口转发到PostgreSQL Operator pod的信息。在另一个终端,执行端口转发;这将允许你开始对PostgreSQL Operator执行命令!尝试输入下列命令创建集群: + +``` +pgo create cluster mynewcluster +``` + +你能输入下列命令测试你的集群运行状况: + +``` +pgo test mynewcluster +``` + +现在,你能在Kubernetes环境下管理你的PostgreSQL数据库!你可以在[官方文档][14]找到非常全面的命令,包括扩容,高可用,备份等等。 + +* * * +这篇文章部分参考了该作者为了Crunchy博客而写的[在Kubernetes上开始运行PostgreSQL][15] + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/how-run-postgresql-kubernetes + +作者:[Jonathan S. Katz][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[校对ID](https://github.com/校对ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jkatz05 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) +[2]: https://www.postgresql.org/ +[3]: https://kubernetes.io/ +[4]: https://opensource.com/article/19/2/scaling-postgresql-kubernetes-operators +[5]: https://github.com/CrunchyData/postgres-operator +[6]: https://crunchydata.github.io/postgres-operator/stable/installation/#quickstart-script +[7]: https://www.gnu.org/software/wget/ +[8]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ +[9]: https://kubernetes.io/docs/concepts/storage/storage-classes/ +[10]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ +[11]: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ +[12]: https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/ +[13]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[14]: https://crunchydata.github.io/postgres-operator/stable/#documentation +[15]: https://info.crunchydata.com/blog/get-started-runnning-postgresql-on-kubernetes From d7bad386f8885898634c5b11ae360f261526385b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 19 Apr 2019 00:10:26 +0800 Subject: [PATCH 0042/1154] PRF:20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tomjlw 下回建议选择更熟悉的内容来翻译。 --- ...lticloud-hybrid cloud joint development.md | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md index 1fc3d0c230..51451afcee 100644 --- a/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md +++ b/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development) @@ -9,51 +9,47 @@ 思科、谷歌重新赋能多/混合云共同开发 ====== -思科,VMware,HPE 与其它公司踏入新的 Google Cloud Athos 云技术 +> 思科、VMware、HPE 等公司开始采用了新的 Google Cloud Athos 云技术。 + ![Thinkstock][1] -思科与谷歌已扩展它们的混合云开发活动,以帮助其客户在从预置的数据中心到公共云上的任何地方更简便地搭建安全的多云以及混合云应用。 +思科与谷歌已扩展它们的混合云开发活动,以帮助其客户可以在从本地数据中心到公共云上的任何地方更轻松地搭建安全的多云以及混合云应用。 -**[查看[什么是混合云计算][2]并了解[关于多云你所需要知道的][3]。[注册 Network World 速报][4]]以定时接受资讯** +这次扩张围绕着谷歌被称作 Anthos 的新的开源混合云包展开,它是在这周的 Google Next 活动上推出的。Anthos 基于并取代了谷歌现有的谷歌云服务测试版。Anthos 将让客户们无须修改应用就可以在现有的本地硬件或公共云上运行应用。据谷歌说,它可以在[谷歌云平台][5] (GCP) 与 [谷歌 Kubernetes 引擎][6] (GKE) 或者在数据中心中与 [GKE On-Prem][7] 一同使用。谷歌说,Anthos 首次让客户们可以无需管理员和开发者了解不同的坏境和 API 就能从谷歌平台上管理在第三方云上(如 AWS 和 Azure)的工作负荷。 -这次扩张围绕着谷歌在这周的 Google Next 活动上介绍的新的称作 Anthos 的开源混合云包展开。Anthos 基于并取代了谷歌现有的谷歌云服务测试版。Anthos 将让客户们无须修改就可以在现有的预置硬件或公共云上运行应用。据谷歌说,它可以在[谷歌云平台][5] (GCP) 与 [谷歌 Kubernetes 引擎][6] (GKE) 或者在数据中心中与 [GKE On-Prem][7] 一同被获取。谷歌说,Anthos 首次让客户们可以无需管理员和开发者了解不同的坏境和 API 就能从谷歌平台上管理在第三方云上的工作负荷如 AWS 和 Azure。 +关键在于,Athos 提供了一个单一的托管服务,它使得客户们无须担心不同的环境或 API 就能跨云管理、部署工作负荷。 -关键在于,Athos 提供一个单独的受管理的服务,它使得客户们无须忧虑不相似的环境或 API 就能跨云管理、部署工作负荷。 - -作为首秀的一部分,谷歌也宣布一个能够从预置环境或者其它云自动移植虚拟机到 GKE 上的容器的叫做 [Anthos Migrate[8] 的测试项目。谷歌说,“这种独特的移植技术使你无须修改原来的虚拟机或者应用就能以一种行云流水般的方式迁移、更新你的基础架构”。谷歌称它给予了公司按客户节奏转移预置应用到云环境的灵活性。 +作为首秀的一部分,谷歌也宣布一个叫做 [Anthos Migrate][8] 的测试计划,它能够从本地环境或者其它云自动迁移虚拟机到 GKE 上的容器中。谷歌说,“这种独特的迁移技术使你无须修改原来的虚拟机或者应用就能以一种行云流水般的方式迁移、更新你的基础设施”。谷歌称它给予了公司按客户节奏转移本地应用到云环境的灵活性。 ### 思科和谷歌 -就思科来说,它宣布对 Anthos 的支持并承诺将它紧密集成进思科的数据中心科技中,例如 HyperFlex 超融合包,应用中心基础架构(思科的旗舰 SDN 方案), SD-WAN 和 StealthWatch 云。思科说,无论是预置的还是在云端的,这次集成将通过自动更新到最新版本和安全补丁,给予一种一致的、云般的感觉。 +就思科来说,它宣布对 Anthos 的支持并承诺将它紧密集成进思科的数据中心技术中,例如 HyperFlex 超融合包、应用中心基础设施(思科的旗舰 SDN 方案)、SD-WAN 和 StealthWatch 云。思科说,无论是本地的还是在云端的,这次集成将通过自动更新到最新版本和安全补丁,给予一种一致的、云般的感觉。 -“谷歌云在容器和服务网——分别在 Kubernetes 和 Istio——上的专业与它们在开发者社区的领导力,混合思科的企业级网络,计算,存储和安全产品及服务,将为我们的顾客促成一次强强联合。”思科的资深副总裁,云平台和解决方案小组的 Kip Compton 这样[写道][9],“思科对于 Anthos 的集成将会帮助顾客跨预置数据中心和公共云搭建、管理多云/混合云应用,并使得他们无须在安全上让步或者增加复杂性就能集中精力在创新与敏捷上。” +“谷歌云在容器(Kubernetes)和服务网格service mesh(Istio)上的专业与它们在开发者社区的领导力,再加上思科的企业级网络、计算、存储和安全产品及服务,将为我们的顾客促成一次强强联合。”思科的云平台和解决方案集团资深副总裁 Kip Compton 这样[写道][9],“思科对于 Anthos 的集成将会帮助顾客跨本地数据中心和公共云搭建、管理多云/混合云应用,让他们专注于创新和灵活性,同时不会影响安全性或增加复杂性。” ### 谷歌云和思科 -Eyal Manor,在谷歌云工作的副总裁,[写道][10] 通过思科对 Anthos 的支持,客户将能够: -* 从完全受管理的服务例如 GKE 以及思科的超融合基础架构,网络和安全科技中收益。 -* 具有一致性地跨企业数据中心和云操作 -* 从一个企业数据中心消耗云服务 -* 用最新的云技术更新预置架构 +谷歌云工程副总裁 Eyal Manor [写道][10] 通过思科对 Anthos 的支持,客户将能够: +* 受益于全托管服务例如 GKE 以及思科的超融合基础设施、网络和安全技术; +* 在企业数据中心和云中一致运行 +* 在企业数据中心使用云服务 +* 用最新的云技术更新本地基础设施 +思科和谷歌从 2017 年 10 月就在紧密合作,当时他们表示正在开发一个能够连接本地基础设施和云环境的开放混合云平台。该套件,即[思科为谷歌云打造的混合云平台][11],大致在 2018 年 9 月上市。它使得客户们能通过谷歌云托管 Kubernetes 容器开发企业级功能,包含思科网络和安全技术以及来自 Istio 的服务网格监控。 -思科和谷歌从2017年10月两公司说他们将从事能够连接预置架构和云环境的开放混合云平台就开始紧密合作。那个包,[为谷歌云打造的思科混合云平台],大致在2018年9月可以获取。它使得客户们能通过谷歌云管理的包含思科网络和安全以及来自 Istio 的服务网络监听技术的 Kubernetes 容器拥有企业级开发的能力。 +谷歌说开源的 Istio 的容器和微服务优化技术给开发者提供了一种一致的方式,通过服务级的 mTLS (双向传输层安全)身份验证访问控制来跨云连接、保护、管理和监听微服务。因此,客户能够轻松实施新的可移植的服务,并集中配置和管理这些服务。 -谷歌说 Istio 的开源容器和微服务优化科技给开发者提供了通过服务到服务级的 mTLS [双向传输层安全]访问控制认证进行跨云连接,保护,管理和监听微服务的同一方式。其结果就是,客户能够轻松落实新的便携的服务同时也能够中心化地配置管理那些服务。 - -思科不是唯一宣布对 Anthos 的支持的供应商。谷歌宣称至少30家大的谷歌合作商包括 [VMware][12],[Dell EMC][13], [HPE][14], Intel 和 Lenovo 致力于为他们的客户在它们自己的超融合基础架构上分发 Anthos 服务。 - -在 [Facebook][15] 和 [LinkedIn][16] 上加入 Network World 社区以对高端话题评论。 +思科不是唯一宣布对 Anthos 支持的供应商。谷歌表示,至少 30 家大型合作商包括 [VMware][12]、[Dell EMC][13]、[HPE][14]、Intel 和联想致力于为他们的客户在它们自己的超融合基础设施上提供 Anthos 服务。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all +via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html 作者:[Michael Cooney][a] 选题:[lujun9972][b] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1930b5dda7a88511717a188ffbd50e74c5c9f1d9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 19 Apr 2019 00:11:33 +0800 Subject: [PATCH 0043/1154] PUB:20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @tomjlw https://linux.cn/article-10747-1.html --- ...le reenergize multicloud-hybrid cloud joint development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md (98%) diff --git a/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/published/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md similarity index 98% rename from translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md rename to published/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md index 51451afcee..2e63380c76 100644 --- a/translated/tech/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md +++ b/published/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10747-1.html) [#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development) [#]: via: (https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all) [#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) From 6edc7a63bd012a84ba22fa678f3bc2647a8e943c Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Thu, 18 Apr 2019 17:00:36 +0000 Subject: [PATCH 0044/1154] Revert "Translating by ustblixin" This reverts commit 95894b45db0ce03e5579e7762f2e5af0d59dc571. --- ...stall Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md b/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md index 13b441f85d..7ce1201c4f 100644 --- a/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md +++ b/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (ustblixin) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ac9a01de0c0baa08708d64a9d36fc3cd1c46e928 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 19 Apr 2019 08:41:00 +0800 Subject: [PATCH 0045/1154] translated --- ...0190410 Managing Partitions with sgdisk.md | 94 ------------------- ...0190410 Managing Partitions with sgdisk.md | 94 +++++++++++++++++++ 2 files changed, 94 insertions(+), 94 deletions(-) delete mode 100644 sources/tech/20190410 Managing Partitions with sgdisk.md create mode 100644 translated/tech/20190410 Managing Partitions with sgdisk.md diff --git a/sources/tech/20190410 Managing Partitions with sgdisk.md b/sources/tech/20190410 Managing Partitions with sgdisk.md deleted file mode 100644 index b42fef82af..0000000000 --- a/sources/tech/20190410 Managing Partitions with sgdisk.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Managing Partitions with sgdisk) -[#]: via: (https://fedoramagazine.org/managing-partitions-with-sgdisk/) -[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) - -Managing Partitions with sgdisk -====== - -![][1] - -[Roderick W. Smith][2]‘s _sgdisk_ command can be used to manage the partitioning of your hard disk drive from the command line. The basics that you need to get started with it are demonstrated below. - -The following six parameters are all that you need to know to make use of sgdisk’s most basic features: - - 1. **-p** -_Print_ the partition table: -### sgdisk -p /dev/sda - 2. **-d x** -_Delete_ partition x: -### sgdisk -d 1 /dev/sda - 3. **-n x:y:z** -Create a _new_ partition numbered x, starting at y and ending at z: -### sgdisk -n 1:1MiB:2MiB /dev/sda - 4. **-c x:y** -_Change_ the name of partition x to y: -### sgdisk -c 1:grub /dev/sda - 5. **-t x:y** -Change the _type_ of partition x to y: -### sgdisk -t 1:ef02 /dev/sda - 6. **–list-types** -List the partition type codes: -### sgdisk --list-types - - - -![The SGDisk Command][3] - -As you can see in the above examples, most of the commands require that the [device file name][4] of the hard disk drive to operate on be specified as the last parameter. - -The parameters shown above can be combined so that you can completely define a partition with a single run of the sgdisk command: - -### sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda - -Relative values can be specified for some fields by prefixing the value with a **+** or **–** symbol. If you use a relative value, sgdisk will do the math for you. For example, the above example could be written as: - -### sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda - -The value **0** has a special-case meaning for several of the fields: - - * In the _partition number_ field, 0 indicates that the next available number should be used (numbering starts at 1). - * In the _starting address_ field, 0 indicates that the start of the largest available block of free space should be used. Some space at the start of the hard drive is always reserved for the partition table itself. - * In the _ending address_ field, 0 indicates that the end of the largest available block of free space should be used. - - - -By using **0** and relative values in the appropriate fields, you can create a series of partitions without having to pre-calculate any absolute values. For example, the following sequence of sgdisk commands would create all the basic partitions that are needed for a typical Linux installation if in run sequence against a blank hard drive: - -### sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda -### sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda -### sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda -### sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda - -The above example shows how to partition a hard disk for a BIOS-based computer. The [grub partition][5] is not needed on a UEFI-based computer. Because sgdisk is calculating all the absolute values for you in the above example, you can just skip running the first command on a UEFI-based computer and the remaining commands can be run without modification. Likewise, you could skip creating the swap partition and the remaining commands would not need to be modified. - -There is also a short-cut for deleting all the partitions from a hard disk with a single command: - -### sgdisk --zap-all /dev/sda - -For the most up-to-date and detailed information, check the man page: - -$ man sgdisk - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/managing-partitions-with-sgdisk/ - -作者:[Gregory Bartholomew][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/glb/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/managing-partitions-816x345.png -[2]: https://www.rodsbooks.com/ -[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/sgdisk.jpg -[4]: https://en.wikipedia.org/wiki/Device_file -[5]: https://en.wikipedia.org/wiki/BIOS_boot_partition diff --git a/translated/tech/20190410 Managing Partitions with sgdisk.md b/translated/tech/20190410 Managing Partitions with sgdisk.md new file mode 100644 index 0000000000..19f2752245 --- /dev/null +++ b/translated/tech/20190410 Managing Partitions with sgdisk.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managing Partitions with sgdisk) +[#]: via: (https://fedoramagazine.org/managing-partitions-with-sgdisk/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +使用 sgdisk 管理分区 +====== + +![][1] + +[Roderick W. Smith][2] 的 _sgdisk_ 命令可在命令行中管理硬盘的分区。下面将介绍使用它所需的基础知识。 + +以下六个参数是你使用 sgdisk 大多数基本功能所需了解的: + + 1. **-p** +_打印_ 分区表: +### sgdisk -p /dev/sda + 2. **-d x** +_删除_分区 x: +### sgdisk -d 1 /dev/sda + 3. **-n x:y:z** +创建一个编号 x 的_新_分区,从 y 开始,从 z 结束: +### sgdisk -n 1:1MiB:2MiB /dev/sda + 4. **-c x:y** +_更改_分区 x 的名称为 y: +### sgdisk -c 1:grub /dev/sda + 5. **-t x:y** +将分区 x 的_类型_更改为 y: +### sgdisk -t 1:ef02 /dev/sda + 6. **–list-types** +列出分区类型代码: +### sgdisk --list-types + + + +![The SGDisk Command][3] + +如你在上面的例子中所见,大多数命令都要求将要操作的硬盘的[设备文件名][4]指定为最后一个参数。 + +可以组合上面的参数,这样你可以一次定义所有分区: + +### sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda + +在值的前面加上 **+** 或 **–** 符号,可以为某些字段指定相对值。如果你使用相对值,sgdisk 会为你做数学运算。例如,上面的例子可以写成: + +### sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda + +**0** 值对于以下几个字段是特殊情况: + + * 对于_分区号_字段,0 表示应使用下一个可用编号(编号从 1 开始)。 +  * 对于_起始地址_字段,0 表示使用最大可用空闲块的头。硬盘开头的一些空间始终保留给分区表本身。 +  * 对于_结束地址_字段,0 表示使用最大可用空闲块的末尾。 + + + +通过在适当的字段中使用 **0** 和相对值,你可以创建一系列分区,而无需预先计算任何绝对值。例如,如果在一块空白硬盘中,以下 sgdisk 命令序列将创建典型 Linux 安装所需的所有基本分区: + +### sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda +### sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda +### sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda +### sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda + +上面的例子展示了如何为基于 BIOS 的计算机分区硬盘。基于 UEFI 的计算机上不需要 [grub分区][5]。由于 sgdisk 在上面的示例中为你计算了所有绝对值,因此你可以在基于 UEFI 的计算机上跳过第一个命令,并且可以无需修改即可运行其余命令。同样,你可以跳过创建交换分区,并且不需要修改其余命令。 + +还有使用一个命令删除硬盘上所有分区的快捷方式: + +### sgdisk --zap-all /dev/sda + +关于最新和详细信息,请查看手册页: + +$ man sgdisk + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/managing-partitions-with-sgdisk/ + +作者:[Gregory Bartholomew][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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/managing-partitions-816x345.png +[2]: https://www.rodsbooks.com/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/sgdisk.jpg +[4]: https://en.wikipedia.org/wiki/Device_file +[5]: https://en.wikipedia.org/wiki/BIOS_boot_partition From 1d973dab6e130f862fb76069ee08d4a6de008236 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 19 Apr 2019 08:44:27 +0800 Subject: [PATCH 0046/1154] translating --- ...190415 Getting started with Mercurial for version control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 Getting started with Mercurial for version control.md b/sources/tech/20190415 Getting started with Mercurial for version control.md index c2e451fd06..10812affed 100644 --- a/sources/tech/20190415 Getting started with Mercurial for version control.md +++ b/sources/tech/20190415 Getting started with Mercurial for version control.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b8ceec274aa74cfebbbce2af6dbca9e320b87df5 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Fri, 19 Apr 2019 09:21:58 +0800 Subject: [PATCH 0047/1154] Update 20190416 How to Install MySQL in Ubuntu Linux.md --- sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md index ee3a82ca03..87d7c98172 100644 --- a/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md +++ b/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d1fd268fb4c2e6d4b3df2cb7dd977064c075b75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 19 Apr 2019 09:32:40 +0800 Subject: [PATCH 0048/1154] Translated --- ...ork with Python using the module Pygame.md | 283 ------------------ ...ork with Python using the module Pygame.md | 279 +++++++++++++++++ 2 files changed, 279 insertions(+), 283 deletions(-) delete mode 100644 sources/tech/20171214 Build a game framework with Python using the module Pygame.md create mode 100644 translated/tech/20171214 Build a game framework with Python using the module Pygame.md diff --git a/sources/tech/20171214 Build a game framework with Python using the module Pygame.md b/sources/tech/20171214 Build a game framework with Python using the module Pygame.md deleted file mode 100644 index 1acdd12a7c..0000000000 --- a/sources/tech/20171214 Build a game framework with Python using the module Pygame.md +++ /dev/null @@ -1,283 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Build a game framework with Python using the module Pygame) -[#]: via: (https://opensource.com/article/17/12/game-framework-python) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Build a game framework with Python using the module Pygame -====== -The first part of this series explored Python by creating a simple dice game. Now it's time to make your own game from scratch. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python2-header.png?itok=tEvOVo4A) - -In my [first article in this series][1], I explained how to use Python to create a simple, text-based dice game. This time, I'll demonstrate how to use the Python module Pygame to create a graphical game. It will take several articles to get a game that actually does anything, but by the end of the series, you will have a better understanding of how to find and learn new Python modules and how to build an application from the ground up. - -Before you start, you must install [Pygame][2]. - -### Installing new Python modules - -There are several ways to install Python modules, but the two most common are: - - * From your distribution's software repository - * Using the Python package manager, pip - - - -Both methods work well, and each has its own set of advantages. If you're developing on Linux or BSD, leveraging your distribution's software repository ensures automated and timely updates. - -However, using Python's built-in package manager gives you control over when modules are updated. Also, it is not OS-specific, meaning you can use it even when you're not on your usual development machine. Another advantage of pip is that it allows local installs of modules, which is helpful if you don't have administrative rights to a computer you're using. - -### Using pip - -If you have both Python and Python3 installed on your system, the command you want to use is probably `pip3`, which differentiates it from Python 2.x's `pip` command. If you're unsure, try `pip3` first. - -The `pip` command works a lot like most Linux package managers. You can search for Python modules with `search`, then install them with `install`. If you don't have permission to install software on the computer you're using, you can use the `--user` option to just install the module into your home directory. - -``` -$ pip3 search pygame -[...] -Pygame (1.9.3)                 - Python Game Development -sge-pygame (1.5)               - A 2-D game engine for Python -pygame_camera (0.1.1)          - A Camera lib for PyGame -pygame_cffi (0.2.1)            - A cffi-based SDL wrapper that copies the pygame API. -[...] -$ pip3 install Pygame --user -``` - -Pygame is a Python module, which means that it's just a set of libraries that can be used in your Python programs. In other words, it's not a program that you launch, like [IDLE][3] or [Ninja-IDE][4] are. - -### Getting started with Pygame - -A video game needs a setting; a world in which it takes place. In Python, there are two different ways to create your setting: - - * Set a background color - * Set a background image - - - -Your background is only an image or a color. Your video game characters can't interact with things in the background, so don't put anything too important back there. It's just set dressing. - -### Setting up your Pygame script - -To start a new Pygame project, create a folder on your computer. All your game files go into this directory. It's vitally important that you keep all the files needed to run your game inside of your project folder. - -![](https://opensource.com/sites/default/files/u128651/project.jpg) - -A Python script starts with the file type, your name, and the license you want to use. Use an open source license so your friends can improve your game and share their changes with you: - -``` -#!/usr/bin/env python3 -# by Seth Kenlon - -## GPLv3 -# This program is free software: you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program.  If not, see . -``` - -Then you tell Python what modules you want to use. Some of the modules are common Python libraries, and of course, you want to include the one you just installed, Pygame. - -``` -import pygame  # load pygame keywords -import sys     # let  python use your file system -import os      # help python identify your OS -``` - -Since you'll be working a lot with this script file, it helps to make sections within the file so you know where to put stuff. You do this with block comments, which are comments that are visible only when looking at your source code. Create three blocks in your code. - -``` -''' -Objects -''' - -# put Python classes and functions here - -''' -Setup -''' - -# put run-once code here - -''' -Main Loop -''' - -# put game loop here -``` - -Next, set the window size for your game. Keep in mind that not everyone has a big computer screen, so it's best to use a screen size that fits on most people's computers. - -There is a way to toggle full-screen mode, the way many modern video games do, but since you're just starting out, keep it simple and just set one size. - -``` -''' -Setup -''' -worldx = 960 -worldy = 720 -``` - -The Pygame engine requires some basic setup before you can use it in a script. You must set the frame rate, start its internal clock, and start (`init`) Pygame. - -``` -fps   = 40  # frame rate -ani   = 4   # animation cycles -clock = pygame.time.Clock() -pygame.init() -``` - -Now you can set your background. - -### Setting the background - -Before you continue, open a graphics application and create a background for your game world. Save it as `stage.png` inside a folder called `images` in your project directory. - -There are several free graphics applications you can use. - - * [Krita][5] is a professional-level paint materials emulator that can be used to create beautiful images. If you're very interested in creating art for video games, you can even purchase a series of online [game art tutorials][6]. - * [Pinta][7] is a basic, easy to learn paint application. - * [Inkscape][8] is a vector graphics application. Use it to draw with shapes, lines, splines, and Bézier curves. - - - -Your graphic doesn't have to be complex, and you can always go back and change it later. Once you have it, add this code in the setup section of your file: - -``` -world    = pygame.display.set_mode([worldx,worldy]) -backdrop = pygame.image.load(os.path.join('images','stage.png').convert()) -backdropbox = world.get_rect() -``` - -If you're just going to fill the background of your game world with a color, all you need is: - -``` -world = pygame.display.set_mode([worldx,worldy]) -``` - -You also must define a color to use. In your setup section, create some color definitions using values for red, green, and blue (RGB). - -``` -''' -Setup -''' - -BLUE  = (25,25,200) -BLACK = (23,23,23 ) -WHITE = (254,254,254) -``` - -At this point, you could theoretically start your game. The problem is, it would only last for a millisecond. - -To prove this, save your file as `your-name_game.py` (replace `your-name` with your actual name). Then launch your game. - -If you are using IDLE, run your game by selecting `Run Module` from the Run menu. - -If you are using Ninja, click the `Run file` button in the left button bar. - -![](https://opensource.com/sites/default/files/u128651/ninja_run_0.png) - -You can also run a Python script straight from a Unix terminal or a Windows command prompt. - -``` -$ python3 ./your-name_game.py -``` - -If you're using Windows, use this command: - -``` -py.exe your-name_game.py -``` - -However you launch it, don't expect much, because your game only lasts a few milliseconds right now. You can fix that in the next section. - -### Looping - -Unless told otherwise, a Python script runs once and only once. Computers are very fast these days, so your Python script runs in less than a second. - -To force your game to stay open and active long enough for someone to see it (let alone play it), use a `while` loop. To make your game remain open, you can set a variable to some value, then tell a `while` loop to keep looping for as long as the variable remains unchanged. - -This is often called a "main loop," and you can use the term `main` as your variable. Add this anywhere in your setup section: - -``` -main = True -``` - -During the main loop, use Pygame keywords to detect if keys on the keyboard have been pressed or released. Add this to your main loop section: - -``` -''' -Main loop -''' -while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False - -        if event.type == pygame.KEYDOWN: -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False -``` - -Also in your main loop, refresh your world's background. - -If you are using an image for the background: - -``` -world.blit(backdrop, backdropbox) -``` - -If you are using a color for the background: - -``` -world.fill(BLUE) -``` - -Finally, tell Pygame to refresh everything on the screen and advance the game's internal clock. - -``` -    pygame.display.flip() -    clock.tick(fps) -``` - -Save your file, and run it again to see the most boring game ever created. - -To quit the game, press `q` on your keyboard. - -In the [next article][9] of this series, I'll show you how to add to your currently empty game world, so go ahead and start creating some graphics to use! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/12/game-framework-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 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/17/10/python-101 -[2]: http://www.pygame.org/wiki/about -[3]: https://en.wikipedia.org/wiki/IDLE -[4]: http://ninja-ide.org/ -[5]: http://krita.org -[6]: https://gumroad.com/l/krita-game-art-tutorial-1 -[7]: https://pinta-project.com/pintaproject/pinta/releases -[8]: http://inkscape.org -[9]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player diff --git a/translated/tech/20171214 Build a game framework with Python using the module Pygame.md b/translated/tech/20171214 Build a game framework with Python using the module Pygame.md new file mode 100644 index 0000000000..7ce7402959 --- /dev/null +++ b/translated/tech/20171214 Build a game framework with Python using the module Pygame.md @@ -0,0 +1,279 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build a game framework with Python using the module Pygame) +[#]: via: (https://opensource.com/article/17/12/game-framework-python) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用 Python 和 Pygame 模块构建一个游戏框架 +====== +这系列的第一篇通过创建一个简单的骰子游戏来探究 Python。现在是来从零制作你自己的游戏的时间。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python2-header.png?itok=tEvOVo4A) + +在我的 [这系列的第一篇文章][1] 中, 我已经讲解如何使用 Python 创建一个简单的,基于文本的骰子游戏。这次,我将展示如何使用 Python 和 Pygame 模块来创建一个图形化游戏。它将占用一些文章来得到一个确实完成一些东西的游戏,但是在这系列的结尾,你将有一个更好的理解,如何查找和学习新的 Python 模块和如何从其基础上构建一个应用程序。 + +在开始前,你必须安装 [Pygame][2]。 + +### 安装新的 Python 模块 + +这里有一些方法来安装 Python 模块,但是最通用的两个是: + + * 从你的发行版的软件存储库 + * 使用 Python 的软件包管理器,pip + +两个方法都工作很好,并且每一个都有它自己的一套优势。如果你是在 Linux 或 BSD 上开发,促使你的发行版的软件存储库确保自动及时更新。 + +然而,使用 Python 的内置软件包管理器给予你控制更新模块时间的能力。而且,它不是明确指定操作系统的,意味着,即使当你不是在你常用的开发机器上时,你也可以使用它。pip 的其它的优势是允许模块局部安装,如果你没有一台正在使用的计算机的权限,它是有用的。 + +### 使用 pip + +如果 Python 和 Python3 都安装在你的系统上,你想使用的命令很可能是 `pip3`,它区分来自Python 2.x 的 `pip` 的命令。如果你不确定,先尝试 `pip3`。 + +`pip` 命令有些像大多数 Linux 软件包管理器的工作。你可以使用 `search` 搜索 Pythin 模块,然后使用 `install` 安装它们。如果你没有你正在使用的计算机的权限来安装软件,你可以使用 `--user` 选项来仅仅安装模块到你的 home 目录。 + +``` +$ pip3 search pygame +[...] +Pygame (1.9.3)                 - Python Game Development +sge-pygame (1.5)               - A 2-D game engine for Python +pygame_camera (0.1.1)          - A Camera lib for PyGame +pygame_cffi (0.2.1)            - A cffi-based SDL wrapper that copies the pygame API. +[...] +$ pip3 install Pygame --user +``` + +Pygame 是一个 Python 模块,这意味着它仅仅是一套可以被使用在你的 Python 程序中库。换句话说,它不是一个你启动的程序,像 [IDLE][3] 或 [Ninja-IDE][4] 一样。 + +### Pygame 新手入门 + +一个电子游戏需要一个故事背景;一个发生的地点。在 Python 中,有两种不同的方法来创建你的故事背景: + + * 设置一种背景颜色 + * 设置一张背景图片 + +你的背景仅是一张图片或一种颜色。你的电子游戏人物不能与在背景中的东西相互作用,因此,不要在后面放置一些太重要的东西。它仅仅是设置装饰。 + +### 设置你的 Pygame 脚本 + +为了开始一个新的 Pygame 脚本,在计算机上创建一个文件夹。游戏的全部文件被放在这个目录中。在工程文件夹内部保持所需要的所有的文件来运行游戏是极其重要的。 + +![](https://opensource.com/sites/default/files/u128651/project.jpg) + +一个 Python 脚本以文件类型,你的姓名,和你想使用的协议开始。使用一个开放源码协议,以便你的朋友可以改善你的游戏并与你一起分享他们的更改: + +``` +#!/usr/bin/env python3 +# Seth Kenlon 编写 + +## GPLv3 +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program.  If not, see . +``` + +然后,你告诉 Python 你想使用的模块。一些模块是常见的 Python 库,当然,你想包括一个你刚刚安装的,Pygame 。 + +``` +import pygame  # 加载 pygame 关键字 +import sys     # 让 python 使用你的文件系统 +import os      # 帮助 python 识别你的操作系统 +``` + +由于你将用这个脚本文件工作很多,在文件中制作成段落是有帮助的,以便你知道在哪里放原料。使用语句块注释来做这些,这些注释仅在看你的源文件代码时是可见的。在你的代码中创建三个语句块。 + +``` +''' +Objects +''' + +# 在这里放置 Python 类和函数 + +''' +Setup +''' + +# 在这里放置一次性的运行代码 + +''' +Main Loop +''' + +# 在这里放置游戏的循环代码指令 +``` + +接下来,为你的游戏设置窗口大小。注意,不是每一个人都有大计算机屏幕,所以,最好使用一个适合大多数人的计算机的屏幕大小。 + +这里有一个方法来切换全屏模式,很多现代电子游戏做的方法,但是,由于你刚刚开始,保存它简单和仅设置一个大小。 + +``` +''' +Setup +''' +worldx = 960 +worldy = 720 +``` + +在一个脚本中使用 Pygame 引擎前,你需要一些基本的设置。你必需设置帧频,启动它的内部时钟,然后开始 (`init`) Pygame 。 + +``` +fps   = 40  # 帧频 +ani   = 4   # 动画循环 +clock = pygame.time.Clock() +pygame.init() +``` + +现在你可以设置你的背景。 + +### 设置背景 + +在你继续前,打开一个图形应用程序,并为你的游戏世界创建一个背景。在你的工程目录中的 `images` 文件夹内部保存它为 `stage.png` 。 + +这里有一些你可以使用的自由图形应用程序。 + + * [Krita][5] 是一个专业级绘图原料模拟器,它可以被用于创建漂亮的图片。如果你对电子游戏创建艺术作品非常感兴趣,你甚至可以购买一系列的[游戏艺术作品教程][6]. + * [Pinta][7] 是一个基本的,易于学习的绘图应用程序。 + * [Inkscape][8] 是一个矢量图形应用程序。使用它来绘制形状,线,样条曲线,和 Bézier 曲线。 + + + +你的图像不必很复杂,你可以以后回去更改它。一旦你有它,在你文件的 setup 部分添加这些代码: + +``` +world    = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png').convert()) +backdropbox = world.get_rect() +``` + +如果你仅仅用一种颜色来填充你的游戏的背景,你需要做的全部是: + +``` +world = pygame.display.set_mode([worldx,worldy]) +``` + +你也必需定义一个来使用的颜色。在你的 setup 部分,使用红,绿,蓝 (RGB) 的值来创建一些颜色的定义。 + +``` +''' +Setup +''' + +BLUE  = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +``` + +在这点上,你能理论上启动你的游戏。问题是,它可能仅持续一毫秒。 + +为证明这一点,保存你的文件为 `your-name_game.py` (用你真实的名称替换 `your-name` )。然后启动你的游戏。 + +如果你正在使用 IDLE ,通过选择来自 Run 菜单的 `Run Module` 来运行你的游戏。 + +如果你正在使用 Ninja ,在左侧按钮条中单击 `Run file` 按钮。 + +![](https://opensource.com/sites/default/files/u128651/ninja_run_0.png) + +你也可以直接从一个 Unix 终端或一个 Windows 命令提示符中运行一个 Python 脚本。 + +``` +$ python3 ./your-name_game.py +``` + +如果你正在使用 Windows ,使用这命令: + +``` +py.exe your-name_game.py +``` + +你启动它,不过不要期望很多,因为你的游戏现在仅仅持续几毫秒。你可以在下一部分中修复它。 + +### 循环 + +除非另有说明,一个 Python 脚本运行一次并仅一次。近来计算机的运行速度是非常快的,所以你的 Python 脚本运行时间少于1秒钟。 + +为强制你的游戏来处于足够长的打开和活跃状态来让人看到它(更不要说玩它),使用一个 `while` 循环。为使你的游戏保存打开,你可以设置一个变量为一些值,然后告诉一个 `while` 循环只要变量保持未更改则一直保存循环。 + +这经常被称为一个"主循环",你可以使用术语 `main` 作为你的变量。在你的 setup 部分的任意位置添加这些代码: + +``` +main = True +``` + +在主循环期间,使用 Pygame 关键字来检查是否在键盘上的按键已经被按下或释放。添加这些代码到你的主循环部分: + +``` +''' +Main loop +''' +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False +``` + +也在你的循环中,刷新你世界的背景。 + +如果你使用一个图片作为背景: + +``` +world.blit(backdrop, backdropbox) +``` + +如果你使用一种颜色作为背景: + +``` +world.fill(BLUE) +``` + +最后,告诉 Pygame 来刷新在屏幕上的所有内容并推进游戏的内部时钟。 + +``` +    pygame.display.flip() +    clock.tick(fps) +``` + +保存你的文件,再次运行它来查看曾经创建的最无趣的游戏。 + +退出游戏,在你的键盘上按 `q` 键。 + +在这系列的 [下一篇文章][9] 中,我将向你演示,如何加强你当前空的游戏世界,所以,继续学习并创建一些将要使用的图形! + +-------------------------------------------------------------------------------- + +通过: https://opensource.com/article/17/12/game-framework-python + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者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/article/17/10/python-101 +[2]: http://www.pygame.org/wiki/about +[3]: https://en.wikipedia.org/wiki/IDLE +[4]: http://ninja-ide.org/ +[5]: http://krita.org +[6]: https://gumroad.com/l/krita-game-art-tutorial-1 +[7]: https://pinta-project.com/pintaproject/pinta/releases +[8]: http://inkscape.org +[9]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player From 4b38cff0bd1a12b053551232383cedce019b48b5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 20 Apr 2019 00:09:28 +0800 Subject: [PATCH 0049/1154] PRF:20190409 How To Install And Enable Flatpak Support On Linux.md @MjSeven --- ...all And Enable Flatpak Support On Linux.md | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md b/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md index fe10d72bd7..2256a9497b 100644 --- a/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md +++ b/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Install And Enable Flatpak Support On Linux?) @@ -10,35 +10,30 @@ 如何在 Linux 上安装并启用 Flatpak 支持? ====== - - 目前,我们都在使用 Linux 发行版的官方软件包管理器来安装所需的软件包。 -在 Linux 中,它做得很好,没有任何问题。(它很好地完成了它应该做的工作,同时它没有任何妥协) +在 Linux 中,它做得很好,没有任何问题。(它不打折扣地很好的完成了它应该做的工作) -在一些方面它也有一些限制,所以会让我们考虑其他替代解决方案来解决。 +但在一些方面它也有一些限制,所以会让我们考虑其他替代解决方案来解决。 -是的,默认情况下,我们不会从发行版官方软件包管理器获取最新版本的软件包,因为这些软件包是在构建当前 OS 版本时构建的。它们只会提供安全更新,直到下一个主要版本发布。 +是的,默认情况下,我们不能从发行版官方软件包管理器获取到最新版本的软件包,因为这些软件包是在构建当前 OS 版本时构建的。它们只会提供安全更新,直到下一个主要版本发布。 -那么,这种情况有什么解决办法吗? - -是的,我们有多种解决方案,而且我们大多数人已经开始使用其中的一些了。 +那么,这种情况有什么解决办法吗?是的,我们有多种解决方案,而且我们大多数人已经开始使用其中的一些了。 有些什么呢,它们有什么好处? - * **对于基于 Ubuntu 的系统:** PPAs - * **对于基于 RHEL 的系统:** [EPEL Repository][1]、[ELRepo Repository][2]、[nux-dextop Repository][3]、[IUS Community Repo][4]、[RPMfusion Repository][5] 和 [Remi Repository][6] + * **对于基于 Ubuntu 的系统:** PPA + * **对于基于 RHEL 的系统:** [EPEL 仓库][1]、[ELRepo 仓库][2]、[nux-dextop 仓库][3]、[IUS 社区仓库][4]、[RPMfusion 仓库][5] 和 [Remi 仓库][6] - -使用上面的仓库,我们将获得最新的软件包。这些软件包通常都得到了很好的维护,还有大多数社区的建议。但这对于操作系统来说应该是适当的,因为它们可能并不安全。 +使用上面的仓库,我们将获得最新的软件包。这些软件包通常都得到了很好的维护,还有大多数社区的推荐。但这些只是建议,可能并不总是安全的。 近年来,出现了一下通用软件包封装格式,并且得到了广泛的应用。 - * **`Flatpak:`** 它是独立于发行版的包格式,主要贡献者是 Fedora 项目团队。大多数主要的 Linux 发行版都采用了 Flatpak 框架。 - * **`Snaps:`** Snappy 是一种通用的软件包封装格式,最初由 Canonical 为 Ubuntu 手机及其操作系统设计和构建的。后来,大多数发行版都进行了改编。 - * **`AppImage:`** AppImage 是一种可移植的包格式,可以在不安装或不需要 root 权限的情况下运行。 + * Flatpak:它是独立于发行版的包格式,主要贡献者是 Fedora 项目团队。大多数主要的 Linux 发行版都采用了 Flatpak 框架。 + * Snaps:Snappy 是一种通用的软件包封装格式,最初由 Canonical 为 Ubuntu 手机及其操作系统设计和构建的。后来,更多的发行版都接纳了它。 + * AppImage:AppImage 是一种可移植的包格式,可以在不安装和不需要 root 权限的情况下运行。 -我们之前已经介绍过 **[Snap 包管理器和包封装格式][7]**。今天我们将讨论 Flatpak 包封装格式。 +我们之前已经介绍过 [Snap 包管理器和包封装格式][7]。今天我们将讨论 Flatpak 包封装格式。 ### 什么是 Flatpak? @@ -56,13 +51,13 @@ Flatpak 的一个缺点是不像 Snap 和 AppImage 那样支持服务器操作 大多数 Linux 发行版官方仓库都提供 Flatpak 软件包。因此,可以使用它们来进行安装。 -对于 **`Fedora`** 系统,使用 **[DNF 命令][8]** 来安装 flatpak。 +对于 Fedora 系统,使用 [DNF 命令][8] 来安装 flatpak。 ``` $ sudo dnf install flatpak ``` -对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][9]** 或 **[APT 命令][10]** 来安装 flatpak。 +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][9] 或 [APT 命令][10] 来安装 flatpak。 ``` $ sudo apt install flatpak @@ -76,19 +71,19 @@ $ sudo apt update $ sudo apt install flatpak ``` -对于基于 **`Arch Linux`** 的系统,使用 **[Pacman 命令][11]** 来安装 flatpak。 +对于基于 Arch Linux 的系统,使用 [Pacman 命令][11] 来安装 flatpak。 ``` $ sudo pacman -S flatpak ``` -对于 **`RHEL/CentOS`** 系统,使用 **[YUM 命令][12]** 来安装 flatpak。 +对于 RHEL/CentOS 系统,使用 [YUM 命令][12] 来安装 flatpak。 ``` $ sudo yum install flatpak ``` -对于 **`openSUSE Leap`** 系统,使用 **[Zypper 命令][13]** 来安装 flatpak。 +对于 openSUSE Leap 系统,使用 [Zypper 命令][13] 来安装 flatpak。 ``` $ sudo zypper install flatpak @@ -96,9 +91,7 @@ $ sudo zypper install flatpak ### 如何在 Linux 上启用 Flathub 支持? -Flathub 网站是一个应用程序商店,你可以在其中找到 flatpak。 - -它是一个中央仓库,所有的 flatpak 应用程序都可供用户使用。 +Flathub 网站是一个应用程序商店,你可以在其中找到 flatpak 软件包。它是一个中央仓库,所有的 flatpak 应用程序都可供用户使用。 运行以下命令在 Linux 上启用 Flathub 支持: @@ -226,7 +219,7 @@ org.gnome.Platform/x86_64/3.30 system,runtime ### 如何查看有关已安装应用程序的详细信息? -运行以下命令以查看有关已安装应用程序的详细信息。 +运行以下命令以查看有关已安装应用程序的详细信息: ``` $ flatpak info com.github.muriloventuroso.easyssh @@ -264,6 +257,7 @@ $ flatpak update com.github.muriloventuroso.easyssh ### 如何移除已安装的应用程序? 运行以下命令来移除已安装的应用程序: + ``` $ sudo flatpak uninstall com.github.muriloventuroso.easyssh ``` @@ -281,7 +275,7 @@ via: https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1b5c31cc5c83b15ccdfa55798a5f7c1375a7f9ad Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 20 Apr 2019 00:10:02 +0800 Subject: [PATCH 0050/1154] PUB:20190409 How To Install And Enable Flatpak Support On Linux.md @MjSeven https://linux.cn/article-10751-1.html --- ...0409 How To Install And Enable Flatpak Support On Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 How To Install And Enable Flatpak Support On Linux.md (99%) diff --git a/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md b/published/20190409 How To Install And Enable Flatpak Support On Linux.md similarity index 99% rename from translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md rename to published/20190409 How To Install And Enable Flatpak Support On Linux.md index 2256a9497b..246405796b 100644 --- a/translated/tech/20190409 How To Install And Enable Flatpak Support On Linux.md +++ b/published/20190409 How To Install And Enable Flatpak Support On Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10751-1.html) [#]: subject: (How To Install And Enable Flatpak Support On Linux?) [#]: via: (https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 92cd1f682601b91c84cca0a65c61a4e2496bf867 Mon Sep 17 00:00:00 2001 From: FSSlc Date: Sat, 20 Apr 2019 09:47:55 +0800 Subject: [PATCH 0051/1154] Update 20190415 Inter-process communication in Linux- Shared storage.md --- ...15 Inter-process communication in Linux- Shared storage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md b/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md index bf6c2c07cc..de0a8ffdc1 100644 --- a/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md +++ b/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (FSSlc) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -402,7 +402,7 @@ via: https://opensource.com/article/19/4/interprocess-communication-linux-storag 作者:[Marty Kalin][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[FSSlc](https://github.com/FSSlc) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 23059a4f81299c60114084ad3b9027492fcff56c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=B3=A5?= <24203166+fuzheng1998@users.noreply.github.com> Date: Sat, 20 Apr 2019 10:07:30 +0800 Subject: [PATCH 0052/1154] apply to translate --- sources/tech/20190409 5 open source mobile apps.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20190409 5 open source mobile apps.md b/sources/tech/20190409 5 open source mobile apps.md index 15378c29b8..b606e50526 100644 --- a/sources/tech/20190409 5 open source mobile apps.md +++ b/sources/tech/20190409 5 open source mobile apps.md @@ -1,3 +1,5 @@ +fuzheng1998 applying + [#]: collector: (lujun9972) [#]: translator: ( ) [#]: reviewer: ( ) From b34b63afd3d93655e082528351a004e534fa3293 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 20 Apr 2019 10:45:32 +0800 Subject: [PATCH 0053/1154] PRF:20190325 Getting started with Vim- The basics.md @Modrisco --- ...25 Getting started with Vim- The basics.md | 67 ++++++++++--------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/translated/tech/20190325 Getting started with Vim- The basics.md b/translated/tech/20190325 Getting started with Vim- The basics.md index 87b2ed01f5..db884d298d 100644 --- a/translated/tech/20190325 Getting started with Vim- The basics.md +++ b/translated/tech/20190325 Getting started with Vim- The basics.md @@ -1,28 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (Modrisco) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with Vim: The basics) [#]: via: (https://opensource.com/article/19/3/getting-started-vim) -[#]: author: (Bryant Son (Red Hat, Community Moderator) https://opensource.com/users/brson) +[#]: author: (Bryant Son https://opensource.com/users/brson) Vim 入门:基础 ====== -为工作或者新项目学习足够的 Vim 知识。 +> 为工作或者新项目学习足够的 Vim 知识。 ![Person standing in front of a giant computer screen with numbers, data][1] -我还清晰地记得我第一次接触 Vim 的时候。那时我还是一名大学生,计算机学院的机房里都装着 Ubuntu 系统。尽管我在上大学前也曾接触过不同的 Linux 发行版(比如 RHEL,Red Hat 在百思买出售它的 CD),但这却是我第一次要在日常中频繁使用 Linux 系统,因为我的课程要求我这样做。当我开始使用 Linux 时,正如我的前辈和将来的后继者们一样,我感觉自己像是一名“真正的程序员”了。 +我还清晰地记得我第一次接触 Vim 的时候。那时我还是一名大学生,计算机学院的机房里都装着 Ubuntu 系统。尽管我在上大学前也曾接触过不同的 Linux 发行版(比如 RHEL —— Red Hat 在百思买出售它的 CD),但这却是我第一次要在日常中频繁使用 Linux 系统,因为我的课程要求我这样做。当我开始使用 Linux 时,正如我的前辈和将来的后继者们一样,我感觉自己像是一名“真正的程序员”了。 ![Real Programmers comic][2] -真正的程序员,来自 [xkcd][3] +*真正的程序员,来自 [xkcd][3]* 学生们可以使用像 [Kate][4] 一样的图形文本编辑器,这也安装在学校的电脑上了。对于那些可以使用 shell 但不习惯使用控制台编辑器的学生,最流行的选择是 [Nano][5],它提供了很好的交互式菜单和类似于 Windows 图形文本编辑器的体验。 -我有时会用 Nano,但当我听说 [Vi/Vim][6] 和 [Emacs][7] 能做一些很棒的事情时我决定试一试它们(主要是因为它们看起来很酷,而且我也很好奇它们有什么特别之处)。第一次使用 Vim 时吓到我了 —— 我不想搞砸任何事情!但是,一旦我掌握了它的诀窍,事情就变得容易得多,我可以欣赏编辑器的强大功能。至于 Emacs,呃,我有点放弃了,但我很高兴我坚持和 Vim 在一起。 +我有时会用 Nano,但当我听说 [Vi/Vim][6] 和 [Emacs][7] 能做一些很棒的事情时我决定试一试它们(主要是因为它们看起来很酷,而且我也很好奇它们有什么特别之处)。第一次使用 Vim 时吓到我了 —— 我不想搞砸任何事情!但是,一旦我掌握了它的诀窍,事情就变得容易得多,我就可以欣赏这个编辑器的强大功能了。至于 Emacs,呃,我有点放弃了,但我很高兴我坚持和 Vim 在一起。 在本文中,我将介绍一下 Vim(基于我的个人经验),这样你就可以在 Linux 系统上用它来作为编辑器使用了。这篇文章不会让你变成 Vim 的专家,甚至不会触及 Vim 许多强大功能的皮毛。但是起点总是很重要的,我想让开始的经历尽可能简单,剩下的则由你自己去探索。 @@ -40,23 +40,23 @@ Vim 入门:基础 还记得我一开始说过我不敢使用 Vim 吗?我当时在害怕“如果我改变了一个现有的文件,把事情搞砸了怎么办?”毕竟,一些计算机科学作业要求我修改现有的文件。我想知道:_如何在不保存更改的情况下打开和关闭文件?_ -好消息是你可以使用相同的命令在 Vim 中创建或打开文件:`vim `,其中 **** 表示要创建或修改的目标文件名。让我们通过输入 `vim HelloWorld.java` 来创建一个名为 `HelloWorld.java` 的文件。 +好消息是你可以使用相同的命令在 Vim 中创建或打开文件:`vim `,其中 `` 表示要创建或修改的目标文件名。让我们通过输入 `vim HelloWorld.java` 来创建一个名为 `HelloWorld.java` 的文件。 你好,Vim!现在,讲一下 Vim 中一个非常重要的概念,可能也是最需要记住的:Vim 有多种模式,下面是 Vim 基础中需要知道的的三种: 模式 | 描述 ---|--- 正常模式 | 默认模式,用于导航和简单编辑 -插入模式 | 用于插入和修改文本 -命令模式 | 用于执行如保存,退出等命令 +插入模式 | 用于直接插入和修改文本 +命令行模式 | 用于执行如保存,退出等命令 -Vim 也有其他模式,例如可视模式、选择模式和命令模式。不过上面的三种模式对我们来说已经足够好了。 +Vim 也有其他模式,例如可视模式、选择模式和命令模式。不过上面的三种模式对我们来说已经足够用了。 你现在正处于正常模式,如果有文本,你可以用箭头键移动或使用其他导航键(将在稍后看到)。要确定你正处于正常模式,只需按下 `esc` (Escape)键即可。 -> **提示:** **Esc** 切换到正常模式。即使你已经在正常模式下,点击 **Esc** 只是为了练习。 +> **提示:** `Esc` 切换到正常模式。即使你已经在正常模式下,点击 `Esc` 只是为了练习。 -现在,有趣的事情发生了。输入 `:` (冒号键)并接着 `q!` (完整命令:`:q!`)。你的屏幕将显示如下: +现在,有趣的事情发生了。输入 `:` (冒号键)并接着 `q!` (完整命令:`:q!`)。你的屏幕将显示如下: ![Editing Vim][9] @@ -68,7 +68,7 @@ Vim 也有其他模式,例如可视模式、选择模式和命令模式。不 通过输入 `vim HelloWorld.java` 和回车键来再次打开这个文件。你可以在插入模式中修改文件。首先,通过 `Esc` 键来确定你正处于正常模式。接着输入 `i` 来进入插入模式(没错,就是字母 **i**)。 -在左下角,你将看到 `\-- INSERT --`,这标志着你这处于插入模式。 +在左下角,你将看到 `-- INSERT --`,这标志着你这处于插入模式。 ![Vim insert mode][10] @@ -80,9 +80,10 @@ public class HelloWorld { } } ``` + 非常漂亮!注意文本是如何在 Java 语法中高亮显示的。因为这是个 Java 文件,所以 Vim 将自动检测语法并高亮颜色。 -保存文件:按下 `Esc` 来退出插入模式并进入命令模式。输入 `:` 并接着 `x!` (完整命令:`:x!`),按回车键来保存文件。你也可以输入 `wq` 来执行相同的操作。 +保存文件:按下 `Esc` 来退出插入模式并进入命令行模式。输入 `:` 并接着 `x!` (完整命令:`:x!`),按回车键来保存文件。你也可以输入 `wq` 来执行相同的操作。 现在,你知道了如何使用插入模式输入文本并使用以下命令保存文件:`:x!` 或者 `:wq`。 @@ -96,7 +97,7 @@ public class HelloWorld { ![Showing Line Numbers][12] -好,你也许会说,“这确实很酷,不过我该怎么跳到某一行呢?”再一次的,确认你正处于正常模式。接着输入 `: `,在这里 **< LINE_NUMBER>** 是你想去的那一行的行数。按下回车键来试着移动到第二行。 +好,你也许会说,“这确实很酷,不过我该怎么跳到某一行呢?”再一次的,确认你正处于正常模式。接着输入 `:`,在这里 `` 是你想去的那一行的行数。按下回车键来试着移动到第二行。 ``` :2 @@ -116,17 +117,17 @@ public class HelloWorld { 你现在来到这行的最后一个字节了。在此示例中,高亮左大括号以显示光标移动到的位置,右大括号被高亮是因为它是高亮的左大括号的匹配字符。 -这就是 Vim 中的基本导航功能。等等,别急着退出文件。让我们转到 Vim 中的基本编辑。不过,你可以暂时随便喝杯咖啡或茶休息一下。 +这就是 Vim 中的基本导航功能。等等,别急着退出文件。让我们转到 Vim 中的基本编辑。不过,你可以暂时顺便喝杯咖啡或茶休息一下。 ### 第 4 步:Vim 中的基本编辑 现在,你已经知道如何通过跳到想要的一行来在文件中导航,你可以使用这个技能在 Vim 中进行一些基本编辑。切换到插入模式。(还记得怎么做吗?是不是输入 `i` ?)当然,你可以使用键盘逐一删除或插入字符来进行编辑,但是 Vim 提供了更快捷的方法来编辑文件。 -来到第三行,这里的代码是 **public static void main(String[] args) {**。双击 `d` 键,没错,就是 `dd`。如果你成功做到了,你将会看到,第三行消失了,剩下的所有行都向上移动了一行。(例如,第四行变成了第三行)。 +来到第三行,这里的代码是 `public static void main(String[] args) {`。双击 `d` 键,没错,就是 `dd`。如果你成功做到了,你将会看到,第三行消失了,剩下的所有行都向上移动了一行。(例如,第四行变成了第三行)。 ![Deleting A Line][15] -这就是 _删除_(delete) 命令。不要担心,键入 `u`,你会发现这一行又回来了。喔,这就是 _撤销_(undo) 命令。 +这就是删除delete命令。不要担心,键入 `u`,你会发现这一行又回来了。喔,这就是撤销undo命令。 ![Undoing a change in Vim][16] @@ -134,7 +135,7 @@ public class HelloWorld { ![Highlighting text in Vim][17] -来到第四行,这里的代码是 **System.out.println("Hello, Opensource");**。高亮这一行的所有内容。好了吗?当第四行的内容处于高亮时,按下 `y`。这就叫做 _复制_(yank)模式,文本将会被复制到剪贴板上。接下来,输入 `o` 来创建新的一行。注意,这将让你进入插入模式。通过按 `Esc` 退出插入模式,然后按下 `p`,代表 _粘贴_。这将把复制的文本从第三行粘贴到第四行。 +来到第四行,这里的代码是 `System.out.println("Hello, Opensource");`。高亮这一行的所有内容。好了吗?当第四行的内容处于高亮时,按下 `y`。这就叫做复制yank模式,文本将会被复制到剪贴板上。接下来,输入 `o` 来创建新的一行。注意,这将让你进入插入模式。通过按 `Esc` 退出插入模式,然后按下 `p`,代表粘贴paste。这将把复制的文本从第三行粘贴到第四行。 ![Pasting in Vim][18] @@ -148,50 +149,50 @@ public class HelloWorld { 假设你的团队领导希望你更改项目中的文本字符串。你该如何快速完成任务?你可能希望使用某个关键字来搜索该行。 -Vim 的搜索功能非常有用。通过 `Esc` 键来进入命令模式,然后输入冒号 `:`,我们可以通过输入 `/ ` 来搜索关键词, **< SEARCH_KEYWORD>** 指你希望搜索的字符串。在这里,我们搜索关键字符串 “Hello”。在面的图示中缺少冒号,但这是必需的。 +Vim 的搜索功能非常有用。通过 `Esc` 键来进入命令模式,然后输入冒号 `:`,我们可以通过输入 `/` 来搜索关键词, `` 指你希望搜索的字符串。在这里,我们搜索关键字符串 `Hello`。在下面的图示中没有显示冒号,但这是必须输入的。 ![Searching in Vim][19] -但是,一个关键字可以出现不止一次,而这可能不是你想要的那一个。那么,如何找到下一个匹配项呢?只需按 `n` 键即可,这代表 _下一个_(next)。执行此操作时,请确保你没有处于插入模式! +但是,一个关键字可以出现不止一次,而这可能不是你想要的那一个。那么,如何找到下一个匹配项呢?只需按 `n` 键即可,这代表下一个next。执行此操作时,请确保你没有处于插入模式! -### 附加步骤:Vim中的分割模式 +### 附加步骤:Vim 中的分割模式 -以上几乎涵盖了所有的 Vim 基础知识。但是,作为一个额外奖励,我想给你展示 Vim 一个很酷的特性,叫做 _分割_(split)模式。 +以上几乎涵盖了所有的 Vim 基础知识。但是,作为一个额外奖励,我想给你展示 Vim 一个很酷的特性,叫做分割split模式。 -退出 _HelloWorld.java_ 并创建一个新文件。在控制台窗口中,输入 `vim GoodBye.java` 并按回车键来创建一个名为 _GoodBye.java_ 的新文件。 +退出 `HelloWorld.java` 并创建一个新文件。在控制台窗口中,输入 `vim GoodBye.java` 并按回车键来创建一个名为 `GoodBye.java` 的新文件。 -输入任何你想输入的让内容,我选择输入“Goodbye”。保存文件(记住你可以在命令模式中使用 `:x!` 或者 `:wq`)。 +输入任何你想输入的让内容,我选择输入 `Goodbye`。保存文件(记住你可以在命令模式中使用 `:x!` 或者 `:wq`)。 在命令模式中,输入 `:split HelloWorld.java`,来看看发生了什么。 ![Split mode in Vim][20] -Wow!快看!**split** 命令将控制台窗口水平分割成了两个部分,上面是 _HelloWorld.java_,下面是 _GoodBye.java_。该怎么能在窗口之间切换呢?按住 `Control` 键 (在 Mac 上)或 `Ctrl` 键(在PC上),然后按下 `ww` (即双击 `w` 键)。 +Wow!快看! `split` 命令将控制台窗口水平分割成了两个部分,上面是 `HelloWorld.java`,下面是 `GoodBye.java`。该怎么能在窗口之间切换呢? 按住 `Control` 键(在 Mac 上)或 `Ctrl` 键(在 PC 上),然后按下 `ww` (即双击 `w` 键)。 -作为最后一个练习,尝试通过复制和粘贴 _HelloWorld.java_ 来编辑 _GoodBye.java_ 以匹配下面屏幕上的内容。 +作为最后一个练习,尝试通过复制和粘贴 `HelloWorld.java` 来编辑 `GoodBye.java` 以匹配下面屏幕上的内容。 ![Modify GoodBye.java file in Split Mode][21] 保存两份文件,成功! -> **提示 1:** 如果你想将两个文件窗口垂直分割,使用 `:vsplit ` 命令。(代替 `:split ` 命令,**< FILE_NAME>** 指你想要使用分割模式打开的文件名)。 +> **提示 1:** 如果你想将两个文件窗口垂直分割,使用 `:vsplit ` 命令。(代替 `:split ` 命令,`` 指你想要使用分割模式打开的文件名)。 > -> **提示 2:** 你可以通过调用任意数量的 **split** 或者 **vsplit** 命令来打开两个以上的文件。试一试,看看它效果如何。 +> **提示 2:** 你可以通过调用任意数量的 `split` 或者 `vsplit` 命令来打开两个以上的文件。试一试,看看它效果如何。 ### Vim 速查表 -在本文中,您学会了如何使用 Vim 来完成工作或项目。但这只是你开启 Vim 强大功能之旅的开始。请务必在 Opensource.com 上查看其他很棒的教程和技巧。 +在本文中,您学会了如何使用 Vim 来完成工作或项目,但这只是你开启 Vim 强大功能之旅的开始,可以查看其他很棒的教程和技巧。 -为了让一切变得简单些,我已经将你学到的一切总结到了 [a handy cheat sheet][22] 中。 +为了让一切变得简单些,我已经将你学到的一切总结到了 [一份方便的速查表][22] 中。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/3/getting-started-vim -作者:[Bryant Son (Red Hat, Community Moderator)][a] +作者:[Bryant Son][a] 选题:[lujun9972][b] 译者:[Modrisco](https://github.com/Modrisco) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 18c1d007c9c7692aea7fc3c988d23903290cc760 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 20 Apr 2019 10:46:12 +0800 Subject: [PATCH 0054/1154] PUB:20190325 Getting started with Vim- The basics.md @Modrisco https://linux.cn/article-10752-1.html --- .../20190325 Getting started with Vim- The basics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190325 Getting started with Vim- The basics.md (99%) diff --git a/translated/tech/20190325 Getting started with Vim- The basics.md b/published/20190325 Getting started with Vim- The basics.md similarity index 99% rename from translated/tech/20190325 Getting started with Vim- The basics.md rename to published/20190325 Getting started with Vim- The basics.md index db884d298d..bcdc0ffe20 100644 --- a/translated/tech/20190325 Getting started with Vim- The basics.md +++ b/published/20190325 Getting started with Vim- The basics.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Modrisco) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10752-1.html) [#]: subject: (Getting started with Vim: The basics) [#]: via: (https://opensource.com/article/19/3/getting-started-vim) [#]: author: (Bryant Son https://opensource.com/users/brson) From 65051c17b18367622710a9765056b236676a9b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=B3=A5?= <24203166+fuzheng1998@users.noreply.github.com> Date: Sat, 20 Apr 2019 10:53:06 +0800 Subject: [PATCH 0055/1154] Update 20190409 5 open source mobile apps.md --- sources/tech/20190409 5 open source mobile apps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 5 open source mobile apps.md b/sources/tech/20190409 5 open source mobile apps.md index b606e50526..ef570bc07b 100644 --- a/sources/tech/20190409 5 open source mobile apps.md +++ b/sources/tech/20190409 5 open source mobile apps.md @@ -1,4 +1,4 @@ -fuzheng1998 applying +tranlator:(fuzheng1998) [#]: collector: (lujun9972) [#]: translator: ( ) From 2f96e5fe5a08a0de97abf9f46933776f4a8e33c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=A6=E9=94=8B?= <289716347@qq.com> Date: Sat, 20 Apr 2019 18:09:52 +0800 Subject: [PATCH 0056/1154] finish translated --- ...16 How to Install MySQL in Ubuntu Linux.md | 238 ----------------- ...16 How to Install MySQL in Ubuntu Linux.md | 244 ++++++++++++++++++ 2 files changed, 244 insertions(+), 238 deletions(-) delete mode 100644 sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md create mode 100644 translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md diff --git a/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md deleted file mode 100644 index 87d7c98172..0000000000 --- a/sources/tech/20190416 How to Install MySQL in Ubuntu Linux.md +++ /dev/null @@ -1,238 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (arrowfeng) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Install MySQL in Ubuntu Linux) -[#]: via: (https://itsfoss.com/install-mysql-ubuntu/) -[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) - -How to Install MySQL in Ubuntu Linux -====== - -_**Brief: This tutorial teaches you to install MySQL in Ubuntu based Linux distributions. You’ll also learn how to verify your install and how to connect to MySQL for the first time.**_ - -**[MySQL][1]** is the quintessential database management system. It is used in many tech stacks, including the popular **[LAMP][2]** (Linux, Apache, MySQL, PHP) stack. It has proven its stability. Another thing that makes **MySQL** so great is that it is **open-source**. - -**MySQL** uses **relational databases** (basically **tabular data** ). It is really easy to store, organize and access data this way. For managing data, **SQL** ( **Structured Query Language** ) is used. - -In this article I’ll show you how to **install** and **use** MySQL 8.0 in Ubuntu 18.04. Let’s get to it! - -### Installing MySQL in Ubuntu - -![][3] - -I’ll be covering two ways you can install **MySQL** in Ubuntu 18.04: - - 1. Install MySQL from the Ubuntu repositories. Very basic, not the latest version (5.7) - 2. Install MySQL using the official repository. There is a bigger step that you’ll have to add to the process, but nothing to worry about. Also, you’ll have the latest version (8.0) - - - -When needed, I’ll provide screenshots to guide you. For most of this guide, I’ll be entering commands in the **terminal** ( **default hotkey** : CTRL+ALT+T). Don’t be scared of it! - -#### Method 1. Installing MySQL from the Ubuntu repositories - -First of all, make sure your repositories are updated by entering: - -``` -sudo apt update -``` - -Now, to install **MySQL 5.7** , simply type: - -``` -sudo apt install mysql-server -y -``` - -That’s it! Simple and efficient. - -#### Method 2. Installing MySQL using the official repository - -Although this method has a few more steps, I’ll go through them one by one and I’ll try writing down clear notes. - -The first step is browsing to the [download page][4] of the official MySQL website. - -![][5] - -Here, go down to the **download link** for the **DEB Package**. - -![][6] - -Scroll down past the info about Oracle Web and right-click on **No thanks, just start my download.** Select **Copy link location**. - -Now go back to the terminal. We’ll [use][7] **[Curl][7]** [command][7] to the download the package: - -``` -curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb -``` - -**** is the link I copied from the website. It might be different based on the current version of MySQL. Let’s use **dpkg** to start installing MySQL: - -``` -sudo dpkg -i mysql-apt-config* -``` - -Update your repositories: - -``` -sudo apt update -``` - -To actually install MySQL, we’ll use the same command as in the first method: - -``` -sudo apt install mysql-server -y -``` - -Doing so will open a prompt in your terminal for **package configuration**. Use the **down arrow** to select the **Ok** option. - -![][8] - -Press **Enter**. This should prompt you to enter a **password** :. Your are basically setting the root password for MySQL. Don’t confuse it with [root password of Ubuntu][9] system. - -![][10] - -Type in a password and press **Tab** to select **< Ok>**. Press **Enter.** You’ll now have to **re-enter** the **password**. After doing so, press **Tab** again to select **< Ok>**. Press **Enter**. - -![][11] - -Some **information** on configuring MySQL Server will be presented. Press **Tab** to select **< Ok>** and **Enter** again: - -![][12] - -Here you need to choose a **default authentication plugin**. Make sure **Use Strong Password Encryption** is selected. Press **Tab** and then **Enter**. - -That’s it! You have successfully installed MySQL. - -#### Verify your MySQL installation - -To **verify** that MySQL installed correctly, use: - -``` -sudo systemctl status mysql.service -``` - -This will show some information about the service: - -![][13] - -You should see **Active: active (running)** in there somewhere. If you don’t, use the following command to start the **service** : - -``` -sudo systemctl start mysql.service -``` - -#### Configuring/Securing MySQL - -For a new install, you should run the provided command for security-related updates. That’s: - -``` -sudo mysql_secure_installation -``` - -Doing so will first of all ask you if you want to use the **VALIDATE PASSWORD COMPONENT**. If you want to use it, you’ll have to select a minimum password strength ( **0 – Low, 1 – Medium, 2 – High** ). You won’t be able to input any password doesn’t respect the selected rules. If you don’t have the habit of using strong passwords (you should!), this could come in handy. If you think it might help, type in **y** or **Y** and press **Enter** , then choose a **strength level** for your password and input the one you want to use. If successful, you’ll continue the **securing** process; otherwise you’ll have to re-enter a password. - -If, however, you do not want this feature (I won’t), just press **Enter** or **any other key** to skip using it. - -For the other options, I suggest **enabling** them (typing in **y** or **Y** and pressing **Enter** for each of them). They are (in this order): **remove anonymous user, disallow root login remotely, remove test database and access to it, reload privilege tables now**. - -#### Connecting to & Disconnecting from the MySQL Server - -To be able to run SQL queries, you’ll first have to connect to the server using MySQL and use the MySQL prompt. The command for doing this is: - -``` -mysql -h host_name -u user -p -``` - - * **-h** is used to specify a **host name** (if the server is located on another machine; if it isn’t, just omit it) - * **-u** mentions the **user** - * **-p** specifies that you want to input a **password**. - - - -Although not recommended (for safety reasons), you can enter the password directly in the command by typing it in right after **-p**. For example, if the password for **test_user** is **1234** and you are trying to connect on the machine you are using, you could use: - -``` -mysql -u test_user -p1234 -``` - -If you successfully inputted the required parameters, you’ll be greeted by the **MySQL shell prompt** ( **mysql >**): - -![][14] - -To **disconnect** from the server and **leave** the mysql prompt, type: - -``` -QUIT -``` - -Typing **quit** (MySQL is case insensitive) or **\q** will also work. Press **Enter** to exit. - -You can also output info about the **version** with a simple command: - -``` -sudo mysqladmin -u root version -p -``` - -If you want to see a **list of options** , use: - -``` -mysql --help -``` - -#### Uninstalling MySQL - -If you decide that you want to use a newer release or just want to stop using MySQL. - -First, disable the service: - -``` -sudo systemctl stop mysql.service && sudo systemctl disable mysql.service -``` - -Make sure you backed up your databases, in case you want to use them later on. You can uninstall MySQL by running: - -``` -sudo apt purge mysql* -``` - -To clean up dependecies: - -``` -sudo apt autoremove -``` - -**Wrapping Up** - -In this article, I’ve covered **installing MySQL** in Ubuntu Linux. I’d be glad if this guide helps struggling users and beginners. - -Tell us in the comments if you found this post to be a useful resource. What do you use MySQL for? We’re eager to receive any feedback, impressions or suggestions. Thanks for reading and have don’t hesitate to experiment with this incredible tool! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-mysql-ubuntu/ - -作者:[Sergiu][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/sergiu/ -[b]: https://github.com/lujun9972 -[1]: https://www.mysql.com/ -[2]: https://en.wikipedia.org/wiki/LAMP_(software_bundle) -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-mysql-ubuntu.png?resize=800%2C450&ssl=1 -[4]: https://dev.mysql.com/downloads/repo/apt/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_apt_download_page.jpg?fit=800%2C280&ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_deb_download_link.jpg?fit=800%2C507&ssl=1 -[7]: https://linuxhandbook.com/curl-command-examples/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_package_configuration_ok.jpg?fit=800%2C587&ssl=1 -[9]: https://itsfoss.com/change-password-ubuntu/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_enter_password.jpg?fit=800%2C583&ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_information_on_configuring.jpg?fit=800%2C581&ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_default_authentication_plugin.jpg?fit=800%2C586&ssl=1 -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_service_information.jpg?fit=800%2C402&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_shell_prompt-2.jpg?fit=800%2C423&ssl=1 diff --git a/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md new file mode 100644 index 0000000000..27b2fba58e --- /dev/null +++ b/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md @@ -0,0 +1,244 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install MySQL in Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-mysql-ubuntu/) +[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) + +怎样在Ubuntu Linux上安装MySQL +====== + +_**简要: 本教程教你如何在基于Ubuntu的Linux发行版上安装MySQL。对于首次使用的用户,你将会学习到如何验证你的安装和第一次怎样去连接MySQL。**_ + +**[MySQL][1]** 是一个典型的数据库管理系统。它被用于许多技术栈中,包括流行的 **[LAMP][2]** (Linux, Apache, MySQL, PHP) 技术栈. 它已经被证实了其稳定性。 另一个让**MySQL**受欢迎的原因是它是开源的。 + +**MySQL** 是 **关系型数据库** (基本上是 **表格 数据** ). 以这种方式它很容易去存储,组织和访问数据。它使用**SQL**( **结构化查询语言** )来管理数据。 + +这这篇文章中,我将向你展示如何在Ubuntu 18.04安装和使用MySQL 8.0。让我们一起来看看吧! + + +### 在Ubuntu上安装MySQL + +![][3] + +我将会介绍两种在Ubuntu18.04上安装**MySQL**的方法: + 1. 从Ubuntu仓库上安装MySQL。非常简单,但不是最新版(5.7) + 2. 从官方仓库安装MySQL。你将额外增加一些步处理过程,但不用担心。你将会拥有最新版的MySQL(8.0) + + +有必要的时候,我将会提供屏幕截图去引导你。但这边文章中的大部分步骤,我将直接在**终端**(**默认热键**: CTRL+ALT+T)输入命令。别害怕它! + +#### 方法 1. 从Ubuntu仓库安装MySQL + +首先,输入下列命令确保你的仓库已经被更新: + +``` +sudo apt update +``` + +现在, 安装 **MySQL 5.7** , 简单输入下列命令: + +``` +sudo apt install mysql-server -y +``` + +就是这样!简单且高效。 + +#### 方法 2. 使用官方仓库安装MySQL + +虽然这个方法多了一些步骤,但我将逐一介绍,并尝试写下清晰的笔记。 + +首先浏览官方的MySQL网站[download page][4]。 + +![][5] + +在这,选择**DEB Package**点击**download link**。 + +![][6] + +滑到有关于Oracle网站信息的底部,右键 **No thanks, just start my download.** ,然后选择 **Copy link location**。 + + +现在回到终端,我们将使用 **[Curl][7]** 命令去下载这个软件包: + +Now go back to the terminal. We’ll [use][7] **[Curl][7]** [command][7] to the download the package: + +``` +curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb +``` + +**** 是我刚刚从网页上复制的链接。根据当前的MySQL版本,它有可能不同。让我们使用**dpkg**去开始安装MySQL: + +``` +sudo dpkg -i mysql-apt-config* +``` + +更新你的仓库: + +``` +sudo apt update +``` + +要实际安装MySQL,我们将使用像第一个方法中同样的命令来安装: + +``` +sudo apt install mysql-server -y +``` + +这样做会在你的终端中打开**包配置**的提示。使用**向下箭头**选择 **Ok**选项。 + +![][8] + +点击 **Enter**.这应该会提示你输入**password**:你的基本上是在为MySQL设置root密码。不要与[Ubuntu的root密码混淆][9]。 + +![][10] + +输入密码然后点击**Tab**键去选择 **< Ok>**.点击**Enter**键,你将**重新输入** **password**。操作完之后,再次键入**Tab**去选择 **< Ok>**。按下**Enter**键。 + +![][11] + +一些关于MySQL Server的配置信息将会展示。再次按下**Tab**去选择 **< Ok>** 和按下 **Enter**键: + +![][12] + +这里你需要去选择**default authentication plugin**。确保**Use Strong Password Encryption**被选择。按下**Tab**键和**Enter**键。 + +就是这样!你已经成功地安装了MySQL。 + +#### 验证你的MySQL安装 + +要验证MySQL已经正确安装,使用下列命令: + +``` +sudo systemctl status mysql.service +``` + +这将展示一些关于MySQL服务的信息: + +![][13] + +你应该在那里看到 **Active: active (running)** 。如果你没有看到,使用下列命令去开始这个 **service**: + +``` +sudo systemctl start mysql.service +``` + +#### 配置/保护 MySQL + +对于刚安装的MySQL,你应该运行它提供的安全相关的更新命令。就是: + +``` +sudo mysql_secure_installation +``` + +这样做首先会询问你是否想使用**VALIDATE PASSWORD COMPONENT**.如果你想使用它,你将不得不去选择一个最小密码强度( **0 – Low, 1 – Medium, 2 – High** )。你将无法输入任何不遵守所选规则的密码。如果你没有使用强密码的习惯(本应该使用),这可能会配上用场。如果你认为它可能有帮助,那你就键入**y** 或者 **Y**,按下**Enter**键,然后为你的密码选择一个**强度等级**和输入一个你想使用的。如果成功,你将继续**securing**过程;否则你将重新输入一个密码。 + + +但是,如果你不想要此功能(我不会),只需按**Enter**或**任何其他键**即可跳过使用它。 + +对于其他选项,我建议**开启**他们(对于每一步输入**y** 或者 **Y** 和按下**Enter**)。他们是(以这样的顺序):**remove anonymous user, disallow root login remotely, remove test database and access to it, reload privilege tables now**. +MySQL Server上 +#### 链接与断开MySQL Server + +为了去运行SQL查询,你首先不得不使用MySQL链接到MySQL服务并使用MySQL提示符。 +To be able to run SQL queries, you’ll first have to connect to the server using MySQL and use the MySQL prompt. 执行此操作的命令是: + +``` +mysql -h host_name -u user -p +``` + + * **-h** 被用来指定一个 **主机名** (如果这个服务被安装到其他机器上,那么会有用;如果没有,忽略它) + * **-u** 指定登录的 **用户** + * **-p** 指定你想输入的 **密码**. + + + +你能通过在最右边输入 **-p**后直接输入密码在命令行,但这样做是不建议的(为了安全原因),如果用户**test_user** 的密码是**1234**,那么你可以尝试去连接你正在使用的机器上的mysql,你应该这样使用: + +``` +mysql -u test_user -p1234 +``` + +如果你成功输入了必要的参数,你将会收到由**MySQL shell 提示符**提供的欢迎( **mysql >** ): +![][14] + +要从服务端断开连接和离开mysql提示符,输入: + +``` +QUIT +``` + +输入**quit** (MySQL不区分大小写)或者 **\q**也能工作。按下**Enter**退出。 + +你使用简单的命令也能输出关于版本的信息: + +``` +sudo mysqladmin -u root version -p +``` + +如果你想看 **选项列表**,使用: + +``` +mysql --help +``` + +#### 卸载 MySQL + + + +如果您决定要使用较新版本或只是想停止使用MySQL。 + +首先,关闭服务: + +``` +sudo systemctl stop mysql.service && sudo systemctl disable mysql.service +``` + +确保你备份了你的数据库,以防你之后想使用它们。你可以通过运行下列命令卸载MySQL: + +``` +sudo apt purge mysql* +``` + +清理依赖: + +``` +sudo apt autoremove +``` + +**小结** + +在这边文章中,我已经介绍如何在Ubuntu Linux上**安装 Mysql**。我很高兴如果这篇文章能帮助到那些正为此挣扎的用户或者刚刚开始的用户。 +In this article, I’ve covered **installing MySQL** in Ubuntu Linux. I’d be glad if this guide helps struggling users and beginners. + +如果你发现这篇文章是一个很有用的资源,在评论里告诉我们。你为了什么使用MySQL? 我们渴望收到你的任何反馈,印象和建议。感谢阅读,并毫不犹豫地尝试这个令人难以置信的工具! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-mysql-ubuntu/ + +作者:[Sergiu][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sergiu/ +[b]: https://github.com/lujun9972 +[1]: https://www.mysql.com/ +[2]: https://en.wikipedia.org/wiki/LAMP_(software_bundle) +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-mysql-ubuntu.png?resize=800%2C450&ssl=1 +[4]: https://dev.mysql.com/downloads/repo/apt/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_apt_download_page.jpg?fit=800%2C280&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_deb_download_link.jpg?fit=800%2C507&ssl=1 +[7]: https://linuxhandbook.com/curl-command-examples/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_package_configuration_ok.jpg?fit=800%2C587&ssl=1 +[9]: https://itsfoss.com/change-password-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_enter_password.jpg?fit=800%2C583&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_information_on_configuring.jpg?fit=800%2C581&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_default_authentication_plugin.jpg?fit=800%2C586&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_service_information.jpg?fit=800%2C402&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_shell_prompt-2.jpg?fit=800%2C423&ssl=1 From 8f7b1d2ebff57ce899fa0d02db53603a7eb0a4dd Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 20 Apr 2019 21:29:54 +0800 Subject: [PATCH 0057/1154] patch --- .../tech/20170414 5 projects for Raspberry Pi at home.md | 6 +++--- ... notes.md => 20180718 3 Emacs modes for taking notes.md} | 0 ...15 How to create portable documents with CBZ and DjVu.md | 2 +- ...319 How to set up a homelab from hardware to firewall.md | 2 +- ...ng an open messenger client- Alternatives to WhatsApp.md | 2 +- ...ng started with Jaeger to build an Istio service mesh.md | 2 +- .../20190321 How to use Spark SQL- A hands-on tutorial.md | 2 +- ... 12 open source tools for natural language processing.md | 2 +- .../tech/20190326 How to use NetBSD on a Raspberry Pi.md | 2 +- .../20190329 How to submit a bug report with Bugzilla.md | 2 +- sources/tech/20190401 Build and host a website with Git.md | 2 +- .../tech/20190402 Manage your daily schedule with Git.md | 2 +- sources/tech/20190403 Use Git as the backend for chat.md | 2 +- sources/tech/20190405 File sharing with Git.md | 2 +- sources/tech/20190406 Run a server with Git.md | 2 +- sources/tech/20190407 Manage multimedia files with Git.md | 2 +- ...e to building DevOps pipelines with open source tools.md | 2 +- ...08 Getting started with Python-s cryptography library.md | 2 +- sources/tech/20190409 5 Linux rookie mistakes.md | 2 +- sources/tech/20190409 5 open source mobile apps.md | 2 +- ...0410 How to enable serverless computing in Kubernetes.md | 2 +- sources/tech/20190411 Be your own certificate authority.md | 2 +- ...411 How do you contribute to open source without code.md | 2 +- ...d- 3 dimensions of leadership in an open organization.md | 2 +- .../20190411 Testing Small Scale Scrum in the real world.md | 2 +- .../tech/20190412 How libraries are adopting open source.md | 2 +- ...icense for Chef, ethics in open source, and more news.md | 2 +- ...15 Getting started with Mercurial for version control.md | 2 +- .../tech/20190416 Detecting malaria with deep learning.md | 2 +- 29 files changed, 30 insertions(+), 30 deletions(-) rename sources/tech/{20190718 3 Emacs modes for taking notes.md => 20180718 3 Emacs modes for taking notes.md} (100%) diff --git a/sources/tech/20170414 5 projects for Raspberry Pi at home.md b/sources/tech/20170414 5 projects for Raspberry Pi at home.md index 37c9fde3db..69aeaf32ac 100644 --- a/sources/tech/20170414 5 projects for Raspberry Pi at home.md +++ b/sources/tech/20170414 5 projects for Raspberry Pi at home.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (5 projects for Raspberry Pi at home) [#]: via: (https://opensource.com/article/17/4/5-projects-raspberry-pi-home) -[#]: author: (Ben Nuttall (Community Moderator) ) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) 5 projects for Raspberry Pi at home ====== @@ -100,14 +100,14 @@ Let us know in the comments. via: https://opensource.com/article/17/4/5-projects-raspberry-pi-home -作者:[Ben Nuttall (Community Moderator)][a] +作者:[Ben Nuttall][a] 选题:[lujun9972][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]: +[a]: https://opensource.com/users/bennuttall [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_home_automation.png?itok=2TnmJpD8 (5 projects for Raspberry Pi at home) [2]: https://www.raspberrypi.org/ diff --git a/sources/tech/20190718 3 Emacs modes for taking notes.md b/sources/tech/20180718 3 Emacs modes for taking notes.md similarity index 100% rename from sources/tech/20190718 3 Emacs modes for taking notes.md rename to sources/tech/20180718 3 Emacs modes for taking notes.md diff --git a/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md b/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md index 70f292e827..1700970688 100644 --- a/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md +++ b/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to create portable documents with CBZ and DjVu) [#]: via: (https://opensource.com/article/19/3/comic-book-archive-djvu) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) How to create portable documents with CBZ and DjVu ====== diff --git a/sources/tech/20190319 How to set up a homelab from hardware to firewall.md b/sources/tech/20190319 How to set up a homelab from hardware to firewall.md index 28a50d8a43..d8bb34395b 100644 --- a/sources/tech/20190319 How to set up a homelab from hardware to firewall.md +++ b/sources/tech/20190319 How to set up a homelab from hardware to firewall.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to set up a homelab from hardware to firewall) [#]: via: (https://opensource.com/article/19/3/home-lab) -[#]: author: (Michael Zamot (Red Hat) https://opensource.com/users/mzamot) +[#]: author: (Michael Zamot https://opensource.com/users/mzamot) How to set up a homelab from hardware to firewall ====== diff --git a/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md b/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md index cb590455a5..5f940e9b0b 100644 --- a/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md +++ b/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Choosing an open messenger client: Alternatives to WhatsApp) [#]: via: (https://opensource.com/article/19/3/open-messenger-client) -[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) Choosing an open messenger client: Alternatives to WhatsApp ====== diff --git a/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md b/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md index d8366df720..c4200355e4 100644 --- a/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md +++ b/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Getting started with Jaeger to build an Istio service mesh) [#]: via: (https://opensource.com/article/19/3/getting-started-jaeger) -[#]: author: (Daniel Oh (Red Hat) https://opensource.com/users/daniel-oh) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) Getting started with Jaeger to build an Istio service mesh ====== diff --git a/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md b/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md index fee3a8cc4c..0e4be0aa01 100644 --- a/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md +++ b/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to use Spark SQL: A hands-on tutorial) [#]: via: (https://opensource.com/article/19/3/apache-spark-and-dataframes-tutorial) -[#]: author: (Dipanjan (DJ) Sarkar (Red Hat) https://opensource.com/users/djsarkar) +[#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) How to use Spark SQL: A hands-on tutorial ====== diff --git a/sources/tech/20190322 12 open source tools for natural language processing.md b/sources/tech/20190322 12 open source tools for natural language processing.md index 99031acf68..9d2822926f 100644 --- a/sources/tech/20190322 12 open source tools for natural language processing.md +++ b/sources/tech/20190322 12 open source tools for natural language processing.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (12 open source tools for natural language processing) [#]: via: (https://opensource.com/article/19/3/natural-language-processing-tools) -[#]: author: (Dan Barker (Community Moderator) https://opensource.com/users/barkerd427) +[#]: author: (Dan Barker https://opensource.com/users/barkerd427) 12 open source tools for natural language processing ====== diff --git a/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md b/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md index e3bd5f5e26..37c14fec39 100644 --- a/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md +++ b/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to use NetBSD on a Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/netbsd-raspberry-pi) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) How to use NetBSD on a Raspberry Pi ====== diff --git a/sources/tech/20190329 How to submit a bug report with Bugzilla.md b/sources/tech/20190329 How to submit a bug report with Bugzilla.md index e1fe583d96..ee778410e7 100644 --- a/sources/tech/20190329 How to submit a bug report with Bugzilla.md +++ b/sources/tech/20190329 How to submit a bug report with Bugzilla.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to submit a bug report with Bugzilla) [#]: via: (https://opensource.com/article/19/3/bug-reporting) -[#]: author: (David Both (Community Moderator) https://opensource.com/users/dboth) +[#]: author: (David Both https://opensource.com/users/dboth) How to submit a bug report with Bugzilla ====== diff --git a/sources/tech/20190401 Build and host a website with Git.md b/sources/tech/20190401 Build and host a website with Git.md index 0878047c1d..32a07d3490 100644 --- a/sources/tech/20190401 Build and host a website with Git.md +++ b/sources/tech/20190401 Build and host a website with Git.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Build and host a website with Git) [#]: via: (https://opensource.com/article/19/4/building-hosting-website-git) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) Build and host a website with Git ====== diff --git a/sources/tech/20190402 Manage your daily schedule with Git.md b/sources/tech/20190402 Manage your daily schedule with Git.md index 5d3b7a195e..8f5d7d89bb 100644 --- a/sources/tech/20190402 Manage your daily schedule with Git.md +++ b/sources/tech/20190402 Manage your daily schedule with Git.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Manage your daily schedule with Git) [#]: via: (https://opensource.com/article/19/4/calendar-git) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) Manage your daily schedule with Git ====== diff --git a/sources/tech/20190403 Use Git as the backend for chat.md b/sources/tech/20190403 Use Git as the backend for chat.md index 2a7ac6d28a..e564bbc6e7 100644 --- a/sources/tech/20190403 Use Git as the backend for chat.md +++ b/sources/tech/20190403 Use Git as the backend for chat.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Use Git as the backend for chat) [#]: via: (https://opensource.com/article/19/4/git-based-chat) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) Use Git as the backend for chat ====== diff --git a/sources/tech/20190405 File sharing with Git.md b/sources/tech/20190405 File sharing with Git.md index 6b51d11600..13f95b8287 100644 --- a/sources/tech/20190405 File sharing with Git.md +++ b/sources/tech/20190405 File sharing with Git.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (File sharing with Git) [#]: via: (https://opensource.com/article/19/4/file-sharing-git) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) File sharing with Git ====== diff --git a/sources/tech/20190406 Run a server with Git.md b/sources/tech/20190406 Run a server with Git.md index 650d5672af..2d7749a465 100644 --- a/sources/tech/20190406 Run a server with Git.md +++ b/sources/tech/20190406 Run a server with Git.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Run a server with Git) [#]: via: (https://opensource.com/article/19/4/server-administration-git) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/seth) Run a server with Git ====== diff --git a/sources/tech/20190407 Manage multimedia files with Git.md b/sources/tech/20190407 Manage multimedia files with Git.md index 81bc0d02ca..340c356aa9 100644 --- a/sources/tech/20190407 Manage multimedia files with Git.md +++ b/sources/tech/20190407 Manage multimedia files with Git.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Manage multimedia files with Git) [#]: via: (https://opensource.com/article/19/4/manage-multimedia-files-git) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) Manage multimedia files with Git ====== diff --git a/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md b/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md index e5f772e8ca..2110c17606 100644 --- a/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md +++ b/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (A beginner's guide to building DevOps pipelines with open source tools) [#]: via: (https://opensource.com/article/19/4/devops-pipeline) -[#]: author: (Bryant Son (Red Hat, Community Moderator) https://opensource.com/users/brson/users/milindsingh/users/milindsingh/users/dscripter) +[#]: author: (Bryant Son https://opensource.com/users/brson/users/milindsingh/users/milindsingh/users/dscripter) A beginner's guide to building DevOps pipelines with open source tools ====== diff --git a/sources/tech/20190408 Getting started with Python-s cryptography library.md b/sources/tech/20190408 Getting started with Python-s cryptography library.md index 63eab6104f..9ed9211adf 100644 --- a/sources/tech/20190408 Getting started with Python-s cryptography library.md +++ b/sources/tech/20190408 Getting started with Python-s cryptography library.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Getting started with Python's cryptography library) [#]: via: (https://opensource.com/article/19/4/cryptography-python) -[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) Getting started with Python's cryptography library ====== diff --git a/sources/tech/20190409 5 Linux rookie mistakes.md b/sources/tech/20190409 5 Linux rookie mistakes.md index ae7a0a2969..2e2c25a9cf 100644 --- a/sources/tech/20190409 5 Linux rookie mistakes.md +++ b/sources/tech/20190409 5 Linux rookie mistakes.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (5 Linux rookie mistakes) [#]: via: (https://opensource.com/article/19/4/linux-rookie-mistakes) -[#]: author: (Jen Wike Huger (Red Hat) https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p) 5 Linux rookie mistakes ====== diff --git a/sources/tech/20190409 5 open source mobile apps.md b/sources/tech/20190409 5 open source mobile apps.md index 15378c29b8..e4ca791149 100644 --- a/sources/tech/20190409 5 open source mobile apps.md +++ b/sources/tech/20190409 5 open source mobile apps.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (5 open source mobile apps) [#]: via: (https://opensource.com/article/19/4/mobile-apps) -[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen) 5 open source mobile apps ====== diff --git a/sources/tech/20190410 How to enable serverless computing in Kubernetes.md b/sources/tech/20190410 How to enable serverless computing in Kubernetes.md index 52b75df6e2..75e5a5868d 100644 --- a/sources/tech/20190410 How to enable serverless computing in Kubernetes.md +++ b/sources/tech/20190410 How to enable serverless computing in Kubernetes.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to enable serverless computing in Kubernetes) [#]: via: (https://opensource.com/article/19/4/enabling-serverless-kubernetes) -[#]: author: (Daniel Oh (Red Hat, Community Moderator) https://opensource.com/users/daniel-oh/users/daniel-oh) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh/users/daniel-oh) How to enable serverless computing in Kubernetes ====== diff --git a/sources/tech/20190411 Be your own certificate authority.md b/sources/tech/20190411 Be your own certificate authority.md index de35385097..f6ea26aba4 100644 --- a/sources/tech/20190411 Be your own certificate authority.md +++ b/sources/tech/20190411 Be your own certificate authority.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Be your own certificate authority) [#]: via: (https://opensource.com/article/19/4/certificate-authority) -[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez/users/elenajon123) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/elenajon123) Be your own certificate authority ====== diff --git a/sources/tech/20190411 How do you contribute to open source without code.md b/sources/tech/20190411 How do you contribute to open source without code.md index 0b04f7e87d..659fd9064e 100644 --- a/sources/tech/20190411 How do you contribute to open source without code.md +++ b/sources/tech/20190411 How do you contribute to open source without code.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How do you contribute to open source without code?) [#]: via: (https://opensource.com/article/19/4/contribute-without-code) -[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen/users/don-watkins/users/greg-p/users/petercheer) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen/users/don-watkins/users/greg-p/users/petercheer) How do you contribute to open source without code? ====== diff --git a/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md b/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md index 4efcdd17a7..890b934ef1 100644 --- a/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md +++ b/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Managed, enabled, empowered: 3 dimensions of leadership in an open organization) [#]: via: (https://opensource.com/open-organization/19/4/managed-enabled-empowered) -[#]: author: (Heidi Hess von Ludewig (Red Hat) https://opensource.com/users/heidi-hess-von-ludewig/users/amatlack) +[#]: author: (Heidi Hess von Ludewig https://opensource.com/users/heidi-hess-von-ludewig/users/amatlack) Managed, enabled, empowered: 3 dimensions of leadership in an open organization ====== diff --git a/sources/tech/20190411 Testing Small Scale Scrum in the real world.md b/sources/tech/20190411 Testing Small Scale Scrum in the real world.md index c39a787482..0e4016435e 100644 --- a/sources/tech/20190411 Testing Small Scale Scrum in the real world.md +++ b/sources/tech/20190411 Testing Small Scale Scrum in the real world.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Testing Small Scale Scrum in the real world) [#]: via: (https://opensource.com/article/19/4/next-steps-small-scale-scrum) -[#]: author: (Agnieszka Gancarczyk (Red Hat)Leigh Griffin (Red Hat) https://opensource.com/users/agagancarczyk/users/lgriffin/users/agagancarczyk/users/lgriffin) +[#]: author: (Agnieszka Gancarczyk Leigh Griffin https://opensource.com/users/agagancarczyk/users/lgriffin/users/agagancarczyk/users/lgriffin) Testing Small Scale Scrum in the real world ====== diff --git a/sources/tech/20190412 How libraries are adopting open source.md b/sources/tech/20190412 How libraries are adopting open source.md index 481c317ead..2a8c8806e5 100644 --- a/sources/tech/20190412 How libraries are adopting open source.md +++ b/sources/tech/20190412 How libraries are adopting open source.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How libraries are adopting open source) [#]: via: (https://opensource.com/article/19/4/software-libraries) -[#]: author: (Don Watkins (Community Moderator) https://opensource.com/users/don-watkins) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) How libraries are adopting open source ====== diff --git a/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md b/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md index 5bc9aaf92f..f33d614f86 100644 --- a/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md +++ b/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Blender short film, new license for Chef, ethics in open source, and more news) [#]: via: (https://opensource.com/article/15/4/news-april-15) -[#]: author: (Joshua Allen Holm (Community Moderator) https://opensource.com/users/holmja) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) Blender short film, new license for Chef, ethics in open source, and more news ====== diff --git a/sources/tech/20190415 Getting started with Mercurial for version control.md b/sources/tech/20190415 Getting started with Mercurial for version control.md index 10812affed..a682517b5f 100644 --- a/sources/tech/20190415 Getting started with Mercurial for version control.md +++ b/sources/tech/20190415 Getting started with Mercurial for version control.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Getting started with Mercurial for version control) [#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) -[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) Getting started with Mercurial for version control ====== diff --git a/sources/tech/20190416 Detecting malaria with deep learning.md b/sources/tech/20190416 Detecting malaria with deep learning.md index 77df4a561b..9e6ea2ba01 100644 --- a/sources/tech/20190416 Detecting malaria with deep learning.md +++ b/sources/tech/20190416 Detecting malaria with deep learning.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Detecting malaria with deep learning) [#]: via: (https://opensource.com/article/19/4/detecting-malaria-deep-learning) -[#]: author: (Dipanjan (DJ) Sarkar (Red Hat) https://opensource.com/users/djsarkar) +[#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) Detecting malaria with deep learning ====== From 494af0bc70600ba45857f3a9534592ea5781fc62 Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Sat, 20 Apr 2019 21:46:04 +0800 Subject: [PATCH 0058/1154] Update 20171226 The shell scripting trap.md --- sources/tech/20171226 The shell scripting trap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md index f91620ce98..72a94dc441 100644 --- a/sources/tech/20171226 The shell scripting trap.md +++ b/sources/tech/20171226 The shell scripting trap.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (jdh8383) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3292a83f42b23948e6992b1d97fadac0535fcefe Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Sat, 20 Apr 2019 22:39:15 +0800 Subject: [PATCH 0059/1154] Update 20171226 The shell scripting trap.md --- sources/tech/20171226 The shell scripting trap.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md index 72a94dc441..fe78d5f47a 100644 --- a/sources/tech/20171226 The shell scripting trap.md +++ b/sources/tech/20171226 The shell scripting trap.md @@ -8,19 +8,21 @@ [#]: author: (Martin Tournoij https://arp242.net/) The shell scripting trap +Shell 脚本的陷阱 ====== Shell scripting is great. It is amazingly simple to create something very useful. Even a simple no-brainer command such as: - +Shell 脚本很棒,你可以非常轻轻地写出有用的东西来。甚至是下面这个傻瓜式的命令: ``` # Official way of naming Go-related things: +# 用含有 Go 的词汇起名字: $ grep -i ^go /usr/share/dict/american-english /usr/share/dict/british /usr/share/dict/british-english /usr/share/dict/catala /usr/share/dict/catalan /usr/share/dict/cracklib-small /usr/share/dict/finnish /usr/share/dict/french /usr/share/dict/german /usr/share/dict/italian /usr/share/dict/ngerman /usr/share/dict/ogerman /usr/share/dict/spanish /usr/share/dict/usa /usr/share/dict/words | cut -d: -f2 | sort -R | head -n1 goldfish ``` Takes several lines of code and a lot more brainpower in many programming languages. For example in Ruby: - +如果用其他编程语言,就需要花费更多的脑力用多行代码实现,比如用 Ruby 的话: ``` puts(Dir['/usr/share/dict/*-english'].map do |f| File.open(f) From e1b8d7ca8cf01c2be0826832526798d938734071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=B3=A5?= <24203166+fuzheng1998@users.noreply.github.com> Date: Sun, 21 Apr 2019 08:52:05 +0800 Subject: [PATCH 0060/1154] Update 20190409 5 open source mobile apps.md --- sources/tech/20190409 5 open source mobile apps.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sources/tech/20190409 5 open source mobile apps.md b/sources/tech/20190409 5 open source mobile apps.md index ef570bc07b..875f79947a 100644 --- a/sources/tech/20190409 5 open source mobile apps.md +++ b/sources/tech/20190409 5 open source mobile apps.md @@ -1,7 +1,5 @@ -tranlator:(fuzheng1998) - [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (fuzheng1998 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a4c01b2d4a1388b0288265c30ae69428de8b2f9c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 21 Apr 2019 09:52:19 +0800 Subject: [PATCH 0061/1154] PRF:20190407 Fixing Ubuntu Freezing at Boot Time.md @Raverstern --- ...407 Fixing Ubuntu Freezing at Boot Time.md | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md b/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md index eed2f478ff..08f91944e1 100644 --- a/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md +++ b/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (Raverstern) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Fixing Ubuntu Freezing at Boot Time) @@ -10,9 +10,9 @@ 解决 Ubuntu 在启动时冻结的问题 ====== -_**本文将向您一步步展示如何通过安装 NVIDIA 专有驱动来处理 Ubuntu 在启动过程中冻结的问题。本教程仅在一个新安装的 Ubuntu 系统上操作验证过,不过在其他情况下也理应可用。**_ +> 本文将向你一步步展示如何通过安装 NVIDIA 专有驱动来处理 Ubuntu 在启动过程中冻结的问题。本教程仅在一个新安装的 Ubuntu 系统上操作验证过,不过在其它情况下也理应可用。 -不久前我买了台[宏碁掠夺者][1](此为[广告联盟][2]链接)笔记本电脑来测试各种 Linux 发行版。这台庞大且笨重的机器与我喜欢的,类似[戴尔 XPS][3]那般小巧轻便的笔记本电脑大相径庭。 +不久前我买了台[宏碁掠夺者][1]笔记本电脑来测试各种 Linux 发行版。这台庞大且笨重的机器与我喜欢的,类似[戴尔 XPS][3]那般小巧轻便的笔记本电脑大相径庭。 我即便不打游戏也选择这台电竞笔记本电脑的原因,就是为了 [NVIDIA 的显卡][4]。宏碁掠夺者 Helios 300 上搭载了一块 [NVIDIA Geforce][5] GTX 1050Ti 显卡。 @@ -20,35 +20,35 @@ NVIDIA 那糟糕的 Linux 兼容性为人们所熟知。过去很多 It’s FOSS 所以当我决定搞一台专门的设备来测试 Linux 发行版时,我选择了带有 NVIDIA 显卡的笔记本电脑。 -这台笔记本原装的 Windows 10 系统安装在 120 GB 的固态硬盘上,并另外配有 1 TB 的机械硬盘来存储数据。在此之上我配置好了 [Windows 10 和 Ubuntu 18.04 双系统][6]。整个的安装过程舒适,方便,快捷。 +这台笔记本原装的 Windows 10 系统安装在 120 GB 的固态硬盘上,并另外配有 1 TB 的机械硬盘来存储数据。在此之上我配置好了 [Windows 10 和 Ubuntu 18.04 双系统][6]。整个的安装过程舒适、方便、快捷。 随后我启动了 [Ubuntu][7]。那熟悉的紫色界面展现了出来,然后我就发现它卡在那儿了。鼠标一动不动,我也输入不了任何东西,然后除了长按电源键强制关机以外我啥事儿都做不了。 然后再次尝试启动,结果一模一样。整个系统就一直卡在那个紫色界面,随后的登录界面也出不来。 -这听起来很耳熟吧?下面就让我来告诉您如何解决这个 Ubuntu 在启动过程中冻结的问题。 +这听起来很耳熟吧?下面就让我来告诉你如何解决这个 Ubuntu 在启动过程中冻结的问题。 -要不您考虑考虑抛弃 Ubuntu? +> 如果你用的不是 Ubuntu -请注意,尽管是在 Ubuntu 18.04 上操作的,本教程应该也能用于其他基于 Ubuntu 的发行版,例如 Linux Mint,elementary OS 等等。关于这点我已经在 Zorin OS 上确认过。 +> 请注意,尽管是在 Ubuntu 18.04 上操作的,本教程应该也能用于其他基于 Ubuntu 的发行版,例如 Linux Mint、elementary OS 等等。关于这点我已经在 Zorin OS 上确认过。 ### 解决 Ubuntu 启动中由 NVIDIA 驱动引起的冻结问题 ![][8] -我介绍的解决方案适用于配有 NVIDIA 显卡的系统,因为您所面临的系统冻结问题是由开源的 [NVIDIA Nouveau 驱动][9]所导致的。 +我介绍的解决方案适用于配有 NVIDIA 显卡的系统,因为你所面临的系统冻结问题是由开源的 [NVIDIA Nouveau 驱动][9]所导致的。 事不宜迟,让我们马上来看看如何解决这个问题。 #### 步骤 1:编辑 Grub -在启动系统的过程中,请您在如下图所示的 Grub 界面上停下。如果您没看到这个界面,在启动电脑时请按住 Shift 键。 +在启动系统的过程中,请你在如下图所示的 Grub 界面上停下。如果你没看到这个界面,在启动电脑时请按住 `Shift` 键。 -在这个界面上,按“E”键进入编辑模式。 +在这个界面上,按 `E` 键进入编辑模式。 ![按“E”按键][10] -您应该看到一些如下图所示的代码。此刻您应关注于以 Linux 开头的那一行。 +你应该看到一些如下图所示的代码。此刻你应关注于以 “linux” 开头的那一行。 ![前往 Linux 开头的那一行][11] @@ -56,97 +56,97 @@ NVIDIA 那糟糕的 Linux 兼容性为人们所熟知。过去很多 It’s FOSS 回忆一下,我们的问题出在 NVIDIA 显卡驱动上,是开源版 NVIDIA 驱动的不适配导致了我们的问题。所以此处我们能做的就是禁用这些驱动。 -此刻,您有多种方式可以禁用这些驱动。我最喜欢的方式是通过 nomodeset 来禁用所有显卡的驱动。 +此刻,你有多种方式可以禁用这些驱动。我最喜欢的方式是通过 `nomodeset` 来禁用所有显卡的驱动。 -请把下列文本添加到以 Linux 开头的那一行的末尾。此处您应该可以正常输入。请确保您把这段文本加到了行末。 +请把下列文本添加到以 “linux” 开头的那一行的末尾。此处你应该可以正常输入。请确保你把这段文本加到了行末。 ``` -nomodeset + nomodeset ``` -现在您屏幕上的显示应如下图所示: +现在你屏幕上的显示应如下图所示: ![通过向内核添加 nomodeset 来禁用显卡驱动][12] -按 Ctrl+X 或 F10 保存并退出。下次您就将以修改后的内核参数来启动。 +按 `Ctrl+X` 或 `F10` 保存并退出。下次你就将以修改后的内核参数来启动。 -对以上操作的解释(点击展开) +> 对以上操作的解释 -所以我们究竟做了些啥?那个 nomodeset 又是个什么玩意儿?让我来向您简单地解释一下。 +> 所以我们究竟做了些啥?那个 `nomodeset` 又是个什么玩意儿?让我来向你简单地解释一下。 -通常来说,显卡是在 X 或者是其他显示服务开始执行后才被启用的,也就是在您登录系统并看到图形界面以后。 +> 通常来说,显卡是在 X 或者是其他显示服务器开始执行后才被启用的,也就是在你登录系统并看到图形界面以后。 -但最近,视频模式的设置被移植进了内核。这么做的众多优点之一就是能您看到一个漂亮且高清的启动画面。 +> 但近来,视频模式的设置被移进了内核。这么做的众多优点之一就是能你看到一个漂亮且高清的启动画面。 -若您往内核中加入 nomodeset 参数,它就会指示内核在显示服务启动后才加载显卡驱动。 +> 若你往内核中加入 `nomodeset` 参数,它就会指示内核在显示服务启动后才加载显卡驱动。 -换句话说,您在此时禁止视频驱动的加载,由此产生的冲突也会随之消失。您在登录进系统以后,还是能看到一切如旧,那是因为显卡驱动在随后的过程中被加载了。 +> 换句话说,你在此时禁止视频驱动的加载,由此产生的冲突也会随之消失。你在登录进系统以后,还是能看到一切如旧,那是因为显卡驱动在随后的过程中被加载了。 -#### 步骤 3:更新您的系统并安装 NVIDIA 专有驱动 +#### 步骤 3:更新你的系统并安装 NVIDIA 专有驱动 -别因为现在可以登录系统了就过早地高兴起来。您之前所做的只是临时措施,在下次启动的时候,您的系统依旧会尝试加载 Nouveau 驱动而因此冻结。 +别因为现在可以登录系统了就过早地高兴起来。你之前所做的只是临时措施,在下次启动的时候,你的系统依旧会尝试加载 Nouveau 驱动而因此冻结。 -这是否意味着您将不得不在 Grub 界面上不断地编辑内核?可喜可贺,答案是否定的。 +这是否意味着你将不得不在 Grub 界面上不断地编辑内核?可喜可贺,答案是否定的。 -您可以在 Ubuntu 上为 NVIDIA 显卡[安装额外的驱动][13]。在使用专有驱动后,Ubuntu 将不会在启动过程中冻结。 +你可以在 Ubuntu 上为 NVIDIA 显卡[安装额外的驱动][13]。在使用专有驱动后,Ubuntu 将不会在启动过程中冻结。 -我假设这是您第一次登录到一个新安装的系统。这意味着在做其他事情之前您必须先[更新 Ubuntu][14]。通过 Ubuntu 的 Ctrl+Alt+T [系统快捷键][15]打开一个终端,并输入以下命令: +我假设这是你第一次登录到一个新安装的系统。这意味着在做其他事情之前你必须先[更新 Ubuntu][14]。通过 Ubuntu 的 `Ctrl+Alt+T` [系统快捷键][15]打开一个终端,并输入以下命令: ``` sudo apt update && sudo apt upgrade -y ``` -在上述命令执行完以后,您可以尝试安装额外的驱动。不过根据我的经验,在安装新驱动之前您需要先重启一下您的系统。在您重启时,您还是需要按我们之前做的那样修改内核参数。 +在上述命令执行完以后,你可以尝试安装额外的驱动。不过根据我的经验,在安装新驱动之前你需要先重启一下你的系统。在你重启时,你还是需要按我们之前做的那样修改内核参数。 -当您的系统已经更新和重启完毕,按下 Windows 键打开一个菜单栏,并搜索“软件与更新”(Software & Updates)。 +当你的系统已经更新和重启完毕,按下 `Windows` 键打开一个菜单栏,并搜索“软件与更新Software & Updates”。 ![点击“软件与更新”(Software & Updates)][16] -然后切换到“额外驱动”(Additional Drivers)标签页,并等待数秒。然后您就能看到可供系统使用的专有驱动了。在这个列表上您应该可以找到 NVIDIA。 +然后切换到“额外驱动Additional Drivers”标签页,并等待数秒。然后你就能看到可供系统使用的专有驱动了。在这个列表上你应该可以找到 NVIDIA。 -选择专有驱动并点击“应用更改”(Apply Changes)。 +选择专有驱动并点击“应用更改Apply Changes”。 ![NVIDIA 驱动安装中][17] -新驱动的安装会费点时间。若您的系统启用了 UEFI 安全启动,您将被要求设置一个密码。_您可以将其设置为任何容易记住的密码_。它的用处我将在步骤 4 中说明。 +新驱动的安装会费点时间。若你的系统启用了 UEFI 安全启动,你将被要求设置一个密码。*你可以将其设置为任何容易记住的密码*。它的用处我将在步骤 4 中说明。 -![您可能需要设置一个安全启动密码][18] +![你可能需要设置一个安全启动密码][18] -安装完成后,您会被要求重启系统以令之前的更改生效。 +安装完成后,你会被要求重启系统以令之前的更改生效。 -![在新驱动安装好后重启您的系统][19] +![在新驱动安装好后重启你的系统][19] #### 步骤 4:处理 MOK(仅针对启用了 UEFI 安全启动的设备) -如果您之前被要求设置安全启动密码,此刻您会看到一个蓝色界面,上面写着“MOK management”。这是个复杂的概念,我试着长话短说。 +如果你之前被要求设置安全启动密码,此刻你会看到一个蓝色界面,上面写着 “MOK management”。这是个复杂的概念,我试着长话短说。 -对 MOK([设备所有者密码][20])的要求是因为安全启动的功能要求所有内核模块都必须被签名。Ubuntu 中所有随 ISO 镜像发行的内核模块都已经签了名。由于您安装了一个新模块(也就是那额外的驱动),或者您对内核模块做了修改,您的安全系统可能视之为一个未经验证的外部修改,从而拒绝启动。 +对 MOK([设备所有者密码][20])的要求是因为安全启动的功能要求所有内核模块都必须被签名。Ubuntu 中所有随 ISO 镜像发行的内核模块都已经签了名。由于你安装了一个新模块(也就是那个额外的驱动),或者你对内核模块做了修改,你的安全系统可能视之为一个未经验证的外部修改,从而拒绝启动。 -因此,您可以自己对系统模块进行签名(以告诉 UEFI 系统莫要大惊小怪,这些修改是您做的),或者您也可以简单粗暴地[禁用安全启动][21]。 +因此,你可以自己对系统模块进行签名(以告诉 UEFI 系统莫要大惊小怪,这些修改是你做的),或者你也可以简单粗暴地[禁用安全启动][21]。 -现在你对[安全启动和 MOK ][22]有了一定了解,那咱们就来看看在遇到这个蓝色界面后该做些什么。 +现在你对[安全启动和 MOK][22] 有了一定了解,那咱们就来看看在遇到这个蓝色界面后该做些什么。 -如果您选择“继续启动”,您的系统将有很大概率如往常一样启动,并且您啥事儿也不用做。不过在这种情况下,新驱动的有些功能有可能工作不正常。 +如果你选择“继续启动”,你的系统将有很大概率如往常一样启动,并且你啥事儿也不用做。不过在这种情况下,新驱动的有些功能有可能工作不正常。 -这就是为什么,您应该**选择注册 MOK **。 +这就是为什么,你应该“选择注册 MOK”。 ![][23] -它会在下一个页面让您点击“继续”,然后要您输入一串密码。请输入在上一步中,在安装额外驱动时设置的密码。 +它会在下一个页面让你点击“继续”,然后要你输入一串密码。请输入在上一步中,在安装额外驱动时设置的密码。 -别担心! +> 别担心! -如果您错过了这个关于 MOK 的蓝色界面,或不小心点了“继续启动”而不是“注册 MOK”,不必惊慌。您的主要目的是能够成功启动系统,而通过禁用 Nouveau 显卡驱动,您已经成功地实现了这一点。 +> 如果你错过了这个关于 MOK 的蓝色界面,或不小心点了“继续启动”而不是“注册 MOK”,不必惊慌。你的主要目的是能够成功启动系统,而通过禁用 Nouveau 显卡驱动,你已经成功地实现了这一点。 -最坏的情况也不过就是您的系统切换到 Intel 集成显卡而不再使用 NVIDIA 显卡。您可以之后的任何时间安装 NVIDIA 显卡驱动。您的首要任务是启动系统。 +> 最坏的情况也不过就是你的系统切换到 Intel 集成显卡而不再使用 NVIDIA 显卡。你可以之后的任何时间安装 NVIDIA 显卡驱动。你的首要任务是启动系统。 #### 步骤 5:享受安装了专有 NVIDIA 驱动的 Linux 系统 -当新驱动被安装好后,您需要再次重启系统。别担心!目前的情况应该已经好起来了,并且您不必再去修改内核参数,而是能够直接启动 Ubuntu 系统了。 +当新驱动被安装好后,你需要再次重启系统。别担心!目前的情况应该已经好起来了,并且你不必再去修改内核参数,而是能够直接启动 Ubuntu 系统了。 -我希望本教程帮助您解决了 Ubuntu 系统在启动中冻结的问题,并让您能够成功启动 Ubuntu 系统。 +我希望本教程帮助你解决了 Ubuntu 系统在启动中冻结的问题,并让你能够成功启动 Ubuntu 系统。 -如果您有任何问题或建议,请在下方评论区给我留言。 +如果你有任何问题或建议,请在下方评论区给我留言。 -------------------------------------------------------------------------------- @@ -155,7 +155,7 @@ via: https://itsfoss.com/fix-ubuntu-freezing/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[Raverstern](https://github.com/Raverstern) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6fd35aab7af8f1d5e5d087601a031a7556f33229 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 21 Apr 2019 09:53:20 +0800 Subject: [PATCH 0062/1154] PUB:20190407 Fixing Ubuntu Freezing at Boot Time.md @Raverstern https://linux.cn/article-10756-1.html --- .../20190407 Fixing Ubuntu Freezing at Boot Time.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190407 Fixing Ubuntu Freezing at Boot Time.md (99%) diff --git a/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md b/published/20190407 Fixing Ubuntu Freezing at Boot Time.md similarity index 99% rename from translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md rename to published/20190407 Fixing Ubuntu Freezing at Boot Time.md index 08f91944e1..b19c1a1a42 100644 --- a/translated/tech/20190407 Fixing Ubuntu Freezing at Boot Time.md +++ b/published/20190407 Fixing Ubuntu Freezing at Boot Time.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Raverstern) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10756-1.html) [#]: subject: (Fixing Ubuntu Freezing at Boot Time) [#]: via: (https://itsfoss.com/fix-ubuntu-freezing/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 01020263858ca105177148c3c49269ba416350fa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 21 Apr 2019 10:51:32 +0800 Subject: [PATCH 0063/1154] PRF:20190403 5 useful open source log analysis tools.md @MjSeven --- ...5 useful open source log analysis tools.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/translated/tech/20190403 5 useful open source log analysis tools.md b/translated/tech/20190403 5 useful open source log analysis tools.md index cc80f12590..9a86daff8a 100644 --- a/translated/tech/20190403 5 useful open source log analysis tools.md +++ b/translated/tech/20190403 5 useful open source log analysis tools.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 useful open source log analysis tools) @@ -9,56 +9,56 @@ 5 个有用的开源日志分析工具 ====== -监控网络活动既重要又繁琐,以下这些工具可以使它更容易。 + +> 监控网络活动既重要又繁琐,以下这些工具可以使它更容易。 + ![People work on a computer server][1] -监控网络活动是一项繁琐的工作,但有充分的理由这样做。例如,它允许你查找和调查工作站、连接到网络的设备和服务器上的可疑登录,同时确定管理员滥用了什么。你还可以跟踪软件安装和数据传输,以实时识别潜在问题,而不是在损坏发生后才进行跟踪。 +监控网络活动是一项繁琐的工作,但有充分的理由这样做。例如,它允许你查找和调查工作站和连接到网络的设备及服务器上的可疑登录,同时确定管理员滥用了什么。你还可以跟踪软件安装和数据传输,以实时识别潜在问题,而不是在损坏发生后才进行跟踪。 -这些日志还有助于使你的公司遵守适用于在欧盟范围内运营的任何实体的[通用数据保护条例][2](GFPR)。如果你的网站在欧盟可以浏览,那么你就有资格。 +这些日志还有助于使你的公司遵守适用于在欧盟范围内运营的任何实体的[通用数据保护条例][2](GFPR)。如果你的网站在欧盟可以浏览,那么你就有遵守的该条例的资格。 -日志记录,包括跟踪和分析,应该是任何监控基础设置中的一个基本过程。要从灾难中恢复 SQL Server 数据库,需要事务日志文件。此外,通过跟踪日志文件,DevOps 团队和数据库管理员(DBA)可以保持最佳的数据库性能,或者,在网络攻击的情况下找到未经授权活动的证据。因此,定期监视和分析系统日志非常重要。这是一种可靠的方式来重新创建导致出现任何问题的事件链。 +日志记录,包括跟踪和分析,应该是任何监控基础设置中的一个基本过程。要从灾难中恢复 SQL Server 数据库,需要事务日志文件。此外,通过跟踪日志文件,DevOps 团队和数据库管理员(DBA)可以保持最佳的数据库性能,又或者,在网络攻击的情况下找到未经授权活动的证据。因此,定期监视和分析系统日志非常重要。这是一种重新创建导致出现任何问题的事件链的可靠方式。 -现在有很多开源日志跟踪器和分析工具可供使用,这使得为活动日志选择合适的资源比你想象的更容易。免费和开源软件社区提供的日志设计适用于各种站点和操作系统。以下是五个我用过的最好的,它们并没有特别的顺序。 +现在有很多开源日志跟踪器和分析工具可供使用,这使得为活动日志选择合适的资源比你想象的更容易。自由和开源软件社区提供的日志设计适用于各种站点和操作系统。以下是五个我用过的最好的工具,它们并没有特别的顺序。 ### Graylog -[Graylog][3] 于 2011 年在德国启动,现在作为开源工具或商业解决方案提供。它被设计成一个集中式日志管理系统,接受来自不同服务器或端点的数据流,并允许你快速浏览或分析该信息。 +[Graylog][3] 于 2011 年在德国创立,现在作为开源工具或商业解决方案提供。它被设计成一个集中式日志管理系统,接受来自不同服务器或端点的数据流,并允许你快速浏览或分析该信息。 ![Graylog screenshot][4] -Graylog 在系统管理员中建立了良好的声誉,因为它易于扩展。大多数 Web 项目都是从小规模开始的,‘但它们可能指数级增长。Graylog 可以平衡后端服务网络中的负载,每天可以处理几 TB 的日志数据。 +Graylog 在系统管理员中有着良好的声誉,因为它易于扩展。大多数 Web 项目都是从小规模开始的,但它们可能指数级增长。Graylog 可以均衡后端服务网络中的负载,每天可以处理几 TB 的日志数据。 IT 管理员会发现 Graylog 的前端界面易于使用,而且功能强大。Graylog 是围绕仪表板的概念构建的,它允许你选择你认为最有价值的指标或数据源,并快速查看一段时间内的趋势。 -当发生安全或性能事件时,IT 管理员希望能够尽可能地将症状追根溯源。Graylog 的搜索功能使这变得容易。它有内置的容错功能,可运行多线程搜索,因此你可以同时分析多个潜在的威胁。 +当发生安全或性能事件时,IT 管理员希望能够尽可能地根据症状追根溯源。Graylog 的搜索功能使这变得容易。它有内置的容错功能,可运行多线程搜索,因此你可以同时分析多个潜在的威胁。 ### Nagios -[Nagios][5] 于 1999 年开始由一个开发人员开发,现在已经发展成为管理日志数据最可靠的开源工具之一。当前版本的 Nagios 可以与运行 Microsoft Windows, Linux 或 Unix 的服务器集成。 +[Nagios][5] 始于 1999 年,最初是由一个开发人员开发的,现在已经发展成为管理日志数据最可靠的开源工具之一。当前版本的 Nagios 可以与运行 Microsoft Windows、Linux 或 Unix 的服务器集成。 ![Nagios Core][6] -它的主要产品是日志服务器,旨在简化数据收集并使系统管理员更容易访问信息。Nagios 日志服务器引擎将实时捕获数据并将其提供给一个强大的搜索工具。通过内置的设置向导,可以轻松地与新端点或应用程序集成。 +它的主要产品是日志服务器,旨在简化数据收集并使系统管理员更容易访问信息。Nagios 日志服务器引擎将实时捕获数据,并将其提供给一个强大的搜索工具。通过内置的设置向导,可以轻松地与新端点或应用程序集成。 Nagios 最常用于需要监控其本地网络安全性的组织。它可以审核一系列与网络相关的事件,并帮助自动分发警报。如果满足特定条件,甚至可以将 Nagios 配置为运行预定义的脚本,从而允许你在人员介入之前解决问题。 -作为网络审核的一部分,Nagios 将根据日志数据来源的地理位置过滤日志数据。这意味着你可以使用映射技术构建全面的仪表板,以了解 Web 流量是如何流动的。 +作为网络审计的一部分,Nagios 将根据日志数据来源的地理位置过滤日志数据。这意味着你可以使用地图技术构建全面的仪表板,以了解 Web 流量是如何流动的。 -### Elastic Stack ("ELK Stack") +### Elastic Stack (ELK Stack) [Elastic Stack][7],通常称为 ELK Stack,是需要筛选大量数据并理解其日志系统的组织中最受欢迎的开源工具之一(这也是我个人的最爱)。 ![ELK Stack][8] -它的主要产品由三个独立的产品组成:Elasticsearch, Kibana 和 Logstash: +它的主要产品由三个独立的产品组成:Elasticsearch、Kibana 和 Logstash: - * 顾名思义, _**Elasticsearch**_ 旨在帮助用户使用多种查询语言和类型在数据集中找到匹配项。速度是它最大的优势。它可以扩展成由数百个服务器节点组成的集群,轻松处理 PB 级的数据。 + * 顾名思义, Elasticsearch 旨在帮助用户使用多种查询语言和类型在数据集之中找到匹配项。速度是它最大的优势。它可以扩展成由数百个服务器节点组成的集群,轻松处理 PB 级的数据。 + * Kibana 是一个可视化工具,与 Elasticsearch 一起工作,允许用户分析他们的数据并构建强大的报告。当你第一次在服务器集群上安装 Kibana 引擎时,你会看到一个显示着统计数据、图表甚至是动画的界面。 + * ELK Stack 的最后一部分是 Logstash,它作为一个纯粹的服务端管道进入 Elasticsearch 数据库。你可以将 Logstash 与各种编程语言和 API 集成,这样你的网站和移动应用程序中的信息就可以直接提供给强大的 Elastic Stalk 搜索引擎中。 - * _**Kibana**_ 是一个可视化工具,与 Elasticsearch 一起工作,允许用户分析他们的数据并构建强大的报告。当你第一次在服务器集群上安装 Kibana 引擎时,你将访问一个显示统计数据、图表甚至是动画的界面。 - - * ELK Stack 的最后一部分是 _**Logstash**_ ,它作为一个纯粹的服务端管道进入 Elasticsearch 数据库。你可以将 Logstash 与各种编程语言和 API 集成,这样你的网站和移动应用程序中的信息就可以直接提供给强大的 Elastic Stalk 搜索引擎中。 - -ELK Stack 的一个独特功能是,它允许你监视构建在 WordPress 开源安装上的应用程序。与[跟踪管理员和 PHP 日志][9]的大多数开箱即用的安全审计日志工具相比,ELK Stack 可以筛选 Web 服务器和数据库日志。 +ELK Stack 的一个独特功能是,它允许你监视构建在 WordPress 开源网站上的应用程序。与[跟踪管理日志和 PHP 日志][9]的大多数开箱即用的安全审计日志工具相比,ELK Stack 可以筛选 Web 服务器和数据库日志。 糟糕的日志跟踪和数据库管理是导致网站性能不佳的最常见原因之一。没有定期检查、优化和清空数据库日志,不仅会降低站点的运行速度,还可能导致其完全崩溃。因此,ELK Stack 对于每个 WordPress 开发人员的工具包来说都是一个优秀的工具。 @@ -97,7 +97,7 @@ via: https://opensource.com/article/19/4/log-analysis-tools 作者:[Sam Bocetta][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 51e278eeea79e5137708bd3619cf3f4bf82d5095 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 21 Apr 2019 10:52:20 +0800 Subject: [PATCH 0064/1154] PUB:20190403 5 useful open source log analysis tools.md @MjSeven https://linux.cn/article-10757-1.html --- .../20190403 5 useful open source log analysis tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190403 5 useful open source log analysis tools.md (99%) diff --git a/translated/tech/20190403 5 useful open source log analysis tools.md b/published/20190403 5 useful open source log analysis tools.md similarity index 99% rename from translated/tech/20190403 5 useful open source log analysis tools.md rename to published/20190403 5 useful open source log analysis tools.md index 9a86daff8a..4a87e64f90 100644 --- a/translated/tech/20190403 5 useful open source log analysis tools.md +++ b/published/20190403 5 useful open source log analysis tools.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10757-1.html) [#]: subject: (5 useful open source log analysis tools) [#]: via: (https://opensource.com/article/19/4/log-analysis-tools) [#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) From 990214ae1e320a6f8b8af6b566b73e184a61912a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 21 Apr 2019 15:08:08 +0800 Subject: [PATCH 0065/1154] PRF:20190403 5 useful open source log analysis tools --- published/20190403 5 useful open source log analysis tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20190403 5 useful open source log analysis tools.md b/published/20190403 5 useful open source log analysis tools.md index 4a87e64f90..13618cda41 100644 --- a/published/20190403 5 useful open source log analysis tools.md +++ b/published/20190403 5 useful open source log analysis tools.md @@ -16,7 +16,7 @@ 监控网络活动是一项繁琐的工作,但有充分的理由这样做。例如,它允许你查找和调查工作站和连接到网络的设备及服务器上的可疑登录,同时确定管理员滥用了什么。你还可以跟踪软件安装和数据传输,以实时识别潜在问题,而不是在损坏发生后才进行跟踪。 -这些日志还有助于使你的公司遵守适用于在欧盟范围内运营的任何实体的[通用数据保护条例][2](GFPR)。如果你的网站在欧盟可以浏览,那么你就有遵守的该条例的资格。 +这些日志还有助于使你的公司遵守适用于在欧盟范围内运营的任何实体的[通用数据保护条例][2](GDPR)。如果你的网站在欧盟可以浏览,那么你就有遵守的该条例的资格。 日志记录,包括跟踪和分析,应该是任何监控基础设置中的一个基本过程。要从灾难中恢复 SQL Server 数据库,需要事务日志文件。此外,通过跟踪日志文件,DevOps 团队和数据库管理员(DBA)可以保持最佳的数据库性能,又或者,在网络攻击的情况下找到未经授权活动的证据。因此,定期监视和分析系统日志非常重要。这是一种重新创建导致出现任何问题的事件链的可靠方式。 From d5722e28a8ca937474cc5fba23c05d7bd0edf30f Mon Sep 17 00:00:00 2001 From: sanfusu <34563541+sanfusu@users.noreply.github.com> Date: Sun, 21 Apr 2019 15:39:50 +0800 Subject: [PATCH 0066/1154] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md index 9e85b82f2c..56f8b8d8c1 100644 --- a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md +++ b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (sanfusu) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 05bc043bd0eb675f8bf4dec2e22e457b91b6ed68 Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Sun, 21 Apr 2019 22:14:47 +0800 Subject: [PATCH 0067/1154] Update 20171226 The shell scripting trap.md --- sources/tech/20171226 The shell scripting trap.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md index fe78d5f47a..32bfff26cc 100644 --- a/sources/tech/20171226 The shell scripting trap.md +++ b/sources/tech/20171226 The shell scripting trap.md @@ -13,7 +13,7 @@ Shell 脚本的陷阱 Shell scripting is great. It is amazingly simple to create something very useful. Even a simple no-brainer command such as: -Shell 脚本很棒,你可以非常轻轻地写出有用的东西来。甚至是下面这个傻瓜式的命令: +Shell 脚本很棒,你可以非常轻松地写出有用的东西来。甚至是下面这个傻瓜式的命令: ``` # Official way of naming Go-related things: # 用含有 Go 的词汇起名字: @@ -32,8 +32,10 @@ end.flatten.sample.chomp) ``` The Ruby version isn’t that long, or even especially complicated. But the shell script version was so simple that I didn’t even need to actually test it to make sure it is correct, whereas I did have to test the Ruby version to ensure I didn’t make a mistake. It’s also twice as long and looks a lot more dense. +Ruby 版本的代码虽然不是那么长,也没有那么复杂。但是 Shell 版是如此简单,我甚至不用实际测试就可以确保它是正确的。而 Ruby 版的我就没法确定它不会出错了,必须得测试一下。而且它要长一倍,看起来也更复杂。 This is why people use shell scripts, it’s so easy to make something useful. Here’s is another example: +这就是人们使用 Shell 脚本的原因,它简单却实用。下面是另一个例子: ``` curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | @@ -43,11 +45,14 @@ curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | ``` This gets a list of all Dutch municipalities. I actually wrote this as a quick one-shot script to populate a database years ago, but it still works fine today, and it took me a minimum of effort to make it. Doing this in e.g. Ruby would take a lot more effort. +这个脚本可以从维基百科上获取荷兰基层政权的列表。几年前我写了这个临时的脚本来快速生成一个数据库,到现在它仍然可以正常运行,当时写它并没有花费我多少精力。要使用 Ruby 完成同样的功能则会麻烦地多。 But there’s a downside, as your script grows it will become increasingly harder to maintain, but you also don’t really want to rewrite it to something else, as you’ve already spent so much time on the shell script version. +现在来说说 Shell 的缺点吧。随着代码量的增加,你的脚本会变得越来越难维护,但你也不会想用别的语言来重写一遍,因为你已经在这个 Shell 版上花费了很多时间。 This is what I call ‘the shell script trap’, which is a special case of the [sunk cost fallacy][1]. + And many scripts do grow beyond their original intended size, and often you will spend a lot more time than you should on “fixing that one bug”, or “adding just one small feature”. Rinse, repeat. If you had written it in Python or Ruby or another similar language from the start, you would have spent some more time writing the original version, but would have spent much less time maintaining it, while almost certainly having fewer bugs. From adc00b0b008a251e929b088b4f16feefbe6ea1fe Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 22 Apr 2019 08:54:01 +0800 Subject: [PATCH 0068/1154] translated --- ...0415 Troubleshooting slow WiFi on Linux.md | 39 ------------------- ...0415 Troubleshooting slow WiFi on Linux.md | 33 ++++++++++++++++ 2 files changed, 33 insertions(+), 39 deletions(-) delete mode 100644 sources/tech/20190415 Troubleshooting slow WiFi on Linux.md create mode 100644 translated/tech/20190415 Troubleshooting slow WiFi on Linux.md diff --git a/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md b/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md deleted file mode 100644 index 6c3db30f25..0000000000 --- a/sources/tech/20190415 Troubleshooting slow WiFi on Linux.md +++ /dev/null @@ -1,39 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Troubleshooting slow WiFi on Linux) -[#]: via: (https://www.linux.com/blog/troubleshooting-slow-wifi-linux) -[#]: author: (OpenSource.com https://www.linux.com/USERS/OPENSOURCECOM) - -Troubleshooting slow WiFi on Linux -====== - -I'm no stranger to diagnosing hardware problems on [Linux systems][1]. Even though most of my professional work over the past few years has involved virtualization, I still enjoy crouching under desks and fumbling around with devices and memory modules. Well, except for the "crouching under desks" part. But none of that means that persistent and mysterious bugs aren't frustrating. I recently faced off against one of those bugs on my Ubuntu 18.04 workstation, which remained unsolved for months. - -Here, I'll share my problem and my many attempts to resolve it. Even though you'll probably never encounter my specific issue, the troubleshooting process might be helpful. And besides, you'll get to enjoy feeling smug at how much time and effort I wasted following useless leads. - -Read more at: [OpenSource.com][2] - -I'm no stranger to diagnosing hardware problems on [Linux systems][1]. Even though most of my professional work over the past few years has involved virtualization, I still enjoy crouching under desks and fumbling around with devices and memory modules. Well, except for the "crouching under desks" part. But none of that means that persistent and mysterious bugs aren't frustrating. I recently faced off against one of those bugs on my Ubuntu 18.04 workstation, which remained unsolved for months. - -Here, I'll share my problem and my many attempts to resolve it. Even though you'll probably never encounter my specific issue, the troubleshooting process might be helpful. And besides, you'll get to enjoy feeling smug at how much time and effort I wasted following useless leads. - -Read more at: [OpenSource.com][2] - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/troubleshooting-slow-wifi-linux - -作者:[OpenSource.com][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/USERS/OPENSOURCECOM -[b]: https://github.com/lujun9972 -[1]: https://www.manning.com/books/linux-in-action?a_aid=bootstrap-it&a_bid=4ca15fc9&chan=opensource -[2]: https://opensource.com/article/19/4/troubleshooting-wifi-linux diff --git a/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md b/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md new file mode 100644 index 0000000000..ee78f64d14 --- /dev/null +++ b/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md @@ -0,0 +1,33 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Troubleshooting slow WiFi on Linux) +[#]: via: (https://www.linux.com/blog/troubleshooting-slow-wifi-linux) +[#]: author: (OpenSource.com https://www.linux.com/USERS/OPENSOURCECOM) + +排查 Linux 上的 WiFi 慢速问题 +====== + +我对 [Linux 系统][1]上的硬件问题进行诊断并不陌生。虽然我过去几年大部分工作都都涉及虚拟化,但我仍然喜欢蹲在桌子下,摸索设备和内存模块。好吧,除开“蹲在桌子下”的部分。但这些都不意味着持久而神秘的 bug 不令人沮丧。我最近遇到了我的 Ubuntu 18.04 工作站上的一个 bug,这个 bug 几个月来一直没有解决。 + +在这里,我将分享我的问题和许多我尝试的方法。即使你可能永远不会遇到我的具体问题,但故障排查的过程可能会有所帮助。此外,你会对我在这无用的线索上浪费的时间和精力感到好笑。 + +更多阅读: [OpenSource.com][2] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/troubleshooting-slow-wifi-linux + +作者:[OpenSource.com][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.linux.com/USERS/OPENSOURCECOM +[b]: https://github.com/lujun9972 +[1]: https://www.manning.com/books/linux-in-action?a_aid=bootstrap-it&a_bid=4ca15fc9&chan=opensource +[2]: https://opensource.com/article/19/4/troubleshooting-wifi-linux From 963f6e788b1497431e8f2825654cca760bf9b332 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 22 Apr 2019 09:02:34 +0800 Subject: [PATCH 0069/1154] translating --- ... Linux Foundation Training Courses Sale - Discount Coupon.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md index 04c1feb5ba..73222de0b6 100644 --- a/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md +++ b/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 084fe7ffd4641b88f8f402e8b294506667792787 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 10:10:14 +0800 Subject: [PATCH 0070/1154] PRF:20190402 Using Square Brackets in Bash- Part 2.md @HankChow --- ...2 Using Square Brackets in Bash- Part 2.md | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md b/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md index 70652f894c..b782595c61 100644 --- a/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md +++ b/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using Square Brackets in Bash: Part 2) @@ -14,8 +14,6 @@ > 我们继续来看方括号的用法,它们甚至还可以在 Bash 当中作为一个命令使用。 -[Creative Commons Zero][2] - 欢迎回到我们的方括号专题。在[前一篇文章][3]当中,我们介绍了方括号在命令行中可以用于通配操作,如果你已经读过前一篇文章,就可以从这里继续了。 方括号还可以以一个命令的形式使用,就像这样: @@ -26,7 +24,7 @@ 上面这种 `[ ... ]` 的形式就可以看成是一个可执行的命令。要注意,方括号内部的内容 `"a" = "a"` 和方括号 `[`、`]` 之间是有空格隔开的。因为这里的方括号被视作一个命令,因此要用空格将命令和它的参数隔开。 -上面这个命令的含义是“判断字符串 `"a"` 和字符串 `"a"` 是否相同”,如果判断结果为真,那么 `[ ... ]` 就会以状态码status code 0 退出,否则以状态码 1 退出。在之前的文章中,我们也有介绍过状态码的概念,可以通过 `$?` 变量获取到最近一个命令的状态码。 +上面这个命令的含义是“判断字符串 `"a"` 和字符串 `"a"` 是否相同”,如果判断结果为真,那么 `[ ... ]` 就会以状态码status code 0 退出,否则以状态码 1 退出。在[之前的文章][4]中,我们也有介绍过状态码的概念,可以通过 `$?` 变量获取到最近一个命令的状态码。 分别执行 @@ -42,22 +40,22 @@ echo $? echo $? ``` -这两段命令中,前者会输出 0(判断结果为真),后者则会输出 1(判断结果为假)。在 Bash 当中,如果一个命令的状态码是 0,表示这个命令正常执行完成并退出,而且其中没有出现错误,对应布尔值 `true`;如果在命令执行过程中出现错误,就会返回一个非零的状态码,对应布尔值 `false`。而 `[ ... ]`也同样遵循这样的规则。 +这两段命令中,前者会输出 0(判断结果为真),后者则会输出 1(判断结果为假)。在 Bash 当中,如果一个命令的状态码是 0,表示这个命令正常执行完成并退出,而且其中没有出现错误,对应布尔值 `true`;如果在命令执行过程中出现错误,就会返回一个非零的状态码,对应布尔值 `false`。而 `[ ... ]` 也同样遵循这样的规则。 因此,`[ ... ]` 很适合在 `if ... then`、`while` 或 `until` 这种在代码块结束前需要判断是否达到某个条件结构中使用。 对应使用的逻辑判断运算符也相当直观: ``` -[ STRING1 = STRING2 ] => checks to see if the strings are equal -[ STRING1 != STRING2 ] => checks to see if the strings are not equal -[ INTEGER1 -eq INTEGER2 ] => checks to see if INTEGER1 is equal to INTEGER2 -[ INTEGER1 -ge INTEGER2 ] => checks to see if INTEGER1 is greater than or equal to INTEGER2 -[ INTEGER1 -gt INTEGER2 ] => checks to see if INTEGER1 is greater than INTEGER2 -[ INTEGER1 -le INTEGER2 ] => checks to see if INTEGER1 is less than or equal to INTEGER2 -[ INTEGER1 -lt INTEGER2 ] => checks to see if INTEGER1 is less than INTEGER2 -[ INTEGER1 -ne INTEGER2 ] => checks to see if INTEGER1 is not equal to INTEGER2 -etc... +[ STRING1 = STRING2 ] => 检查字符串是否相等 +[ STRING1 != STRING2 ] => 检查字符串是否不相等 +[ INTEGER1 -eq INTEGER2 ] => 检查整数 INTEGER1 是否等于 INTEGER2 +[ INTEGER1 -ge INTEGER2 ] => 检查整数 INTEGER1 是否大于等于 INTEGER2 +[ INTEGER1 -gt INTEGER2 ] => 检查整数 INTEGER1 是否大于 INTEGER2 +[ INTEGER1 -le INTEGER2 ] => 检查整数 INTEGER1 是否小于等于 INTEGER2 +[ INTEGER1 -lt INTEGER2 ] => 检查整数 INTEGER1 是否小于 INTEGER2 +[ INTEGER1 -ne INTEGER2 ] => 检查整数 INTEGER1 是否不等于 INTEGER2 +等等…… ``` 方括号的这种用法也可以很有 shell 风格,例如通过带上 `-f` 参数可以判断某个文件是否存在: @@ -129,7 +127,16 @@ done 在下一篇文章中,我们会开始介绍圆括号 `()` 在 Linux 命令行中的用法,敬请关注! +### 更多 +- [Linux 工具:点的含义][6] +- [理解 Bash 中的尖括号][7] +- [Bash 中尖括号的更多用法][8] +- [Linux 中的 &][9] +- [Bash 中的 & 符号和文件描述符][10] +- [Bash 中的逻辑和(&)][4] +- [浅析 Bash 中的 {花括号}][11] +- [在 Bash 中使用[方括号] (一)][3] -------------------------------------------------------------------------------- @@ -138,7 +145,7 @@ via: https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2 作者:[Paul Brown][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -146,13 +153,13 @@ via: https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2 [b]: https://github.com/lujun9972 [1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-brackets-3734552_1920.jpg?itok=hv9D6TBy "square brackets" [2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO -[3]: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 -[4]: https://www.linux.com/blog/learn/2019/2/logical-ampersand-bash +[3]: https://linux.cn/article-10717-1.html +[4]: https://linux.cn/article-10596-1.html [5]: https://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions -[6]: https://www.linux.com/blog/learn/2019/1/linux-tools-meaning-dot -[7]: https://www.linux.com/blog/learn/2019/1/understanding-angle-brackets-bash -[8]: https://www.linux.com/blog/learn/2019/1/more-about-angle-brackets-bash -[9]: https://www.linux.com/blog/learn/2019/2/and-ampersand-and-linux -[10]: https://www.linux.com/blog/learn/2019/2/ampersands-and-file-descriptors-bash -[11]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash +[6]: https://linux.cn/article-10465-1.html +[7]: https://linux.cn/article-10502-1.html +[8]: https://linux.cn/article-10529-1.html +[9]: https://linux.cn/article-10587-1.html +[10]: https://linux.cn/article-10591-1.html +[11]: https://linux.cn/article-10624-1.html From f502d04c6ee2f657af6dcac1c6fdf870facfb938 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 10:10:54 +0800 Subject: [PATCH 0071/1154] PUB:20190402 Using Square Brackets in Bash- Part 2.md @HankChow https://linux.cn/article-10761-1.html --- .../20190402 Using Square Brackets in Bash- Part 2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190402 Using Square Brackets in Bash- Part 2.md (98%) diff --git a/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md b/published/20190402 Using Square Brackets in Bash- Part 2.md similarity index 98% rename from translated/tech/20190402 Using Square Brackets in Bash- Part 2.md rename to published/20190402 Using Square Brackets in Bash- Part 2.md index b782595c61..22ca8b3ee9 100644 --- a/translated/tech/20190402 Using Square Brackets in Bash- Part 2.md +++ b/published/20190402 Using Square Brackets in Bash- Part 2.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10761-1.html) [#]: subject: (Using Square Brackets in Bash: Part 2) [#]: via: (https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2) [#]: author: (Paul Brown https://www.linux.com/users/bro66) From 9fb14d92426b45aa33780e74e206fb225540d686 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 10:57:46 +0800 Subject: [PATCH 0072/1154] PRF:20190328 How to run PostgreSQL on Kubernetes.md @arrowfeng --- ...328 How to run PostgreSQL on Kubernetes.md | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md b/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md index f29110281e..f45404efc8 100644 --- a/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md +++ b/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md @@ -1,60 +1,63 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to run PostgreSQL on Kubernetes) [#]: via: (https://opensource.com/article/19/3/how-run-postgresql-kubernetes) [#]: author: (Jonathan S. Katz https://opensource.com/users/jkatz05) -怎样在Kubernetes上运行PostgreSQL +怎样在 Kubernetes 上运行 PostgreSQL ====== -创建统一管理的,具备灵活性的云原生生产部署来部署一个人性化的数据库即服务。 + +> 创建统一管理的,具备灵活性的云原生生产部署来部署一个个性化的数据库即服务(DBaaS)。 + ![cubes coming together to create a larger cube][1] -通过在[Kubernetes][2]上运行[PostgreSQL][3]数据库,你能创建统一管理的,具备灵活性的云原生生产部署应用来部署一个个性化的数据库即服务为你的特定需求进行量身定制。 +通过在 [Kubernetes][2] 上运行 [PostgreSQL][3] 数据库,你能创建统一管理的,具备灵活性的云原生生产部署应用来部署一个个性化的数据库即服务为你的特定需求进行量身定制。 -对于Kubernetes,使用Operator允许你提供额外的上下文去[管理有状态应用][4]。当使用像PostgreSQL这样开源的数据库去执行包括配置,扩张,高可用和用户管理时,Operator也很有帮助。 +对于 Kubernetes,使用 Operator 允许你提供额外的上下文去[管理有状态应用][4]。当使用像PostgreSQL 这样开源的数据库去执行包括配置、扩展、高可用和用户管理时,Operator 也很有帮助。 -让我们来探索如何在Kubernetes上启动并运行PostgreSQL。 +让我们来探索如何在 Kubernetes 上启动并运行 PostgreSQL。 ### 安装 PostgreSQL Operator -将PostgreSQL和Kubernetes结合使用的第一步是安装一个Operator。在针对Linux系统的Crunchy's [快速启动脚本][6]的帮助下,你可以在任意基于Kubernetes的环境下启动和运行开源的[Crunchy PostgreSQL Operator][5]。 +将 PostgreSQL 和 Kubernetes 结合使用的第一步是安装一个 Operator。在针对 Linux 系统的Crunchy 的[快速启动脚本][6]的帮助下,你可以在任意基于 Kubernetes 的环境下启动和运行开源的[Crunchy PostgreSQL Operator][5]。 快速启动脚本有一些必要前提: - * [Wget][7]工具已安装。 - * [kubectl][8]工具已安装。 - * 一个[StorageClass][9]已经定义在你的Kubernetes中。 - * 拥有集群权限的可访问Kubernetes的用户账号。安装Operator的[RBAC][10]规则是必要的。 - * 拥有一个[namespace][11]去管理PostgreSQL Operator。 + * [Wget][7] 工具已安装。 + * [kubectl][8] 工具已安装。 + * 在你的 Kubernetes 中已经定义了一个 [StorageClass][9]。 + * 拥有集群权限的可访问 Kubernetes 的用户账号,以安装 Operator 的 [RBAC][10] 规则。 + * 一个 PostgreSQL Operator 的 [命名空间][11]。 - - -执行这个脚本将提供给你一个默认的PostgreSQL Operator deployment,它假设你的[dynamic storage][12]和存储类的名字为**standard**。通过这个脚本允许用户自定义的值去覆盖这些默认值。 +执行这个脚本将提供给你一个默认的 PostgreSQL Operator 部署,其默认假设你采用 [动态存储][12]和一个名为 `standard` 的 StorageClass。这个脚本允许用户采用自定义的值去覆盖这些默认值。 通过下列命令,你能下载这个快速启动脚本并把它的权限设置为可执行: + ``` wget chmod +x ./quickstart.sh ``` 然后你运行快速启动脚本: + ``` ./examples/quickstart.sh ``` -在脚本提示你相关的Kubernetes集群基本信息后,它将执行下列操作: - * 下载Operator配置文件 - * 将 **$HOME/.pgouser** 这个文件设置为默认设置 - * 以Kubernetes [Deployment][13]部署Operator - * 设置你的 **.bashrc** 文件包含Operator环境变量 - * 设置你的 **$HOME/.bash_completion** 文件为 **pgo bash_completion**文件 - -在快速启动脚本的执行期间,你将会被提示在你的Kubernetes集群设置RBAC规则。在另一个终端,执行快速启动命令所提示你的命令。 +在脚本提示你相关的 Kubernetes 集群基本信息后,它将执行下列操作: -一旦这个脚本执行完成,你将会得到关于打开一个端口转发到PostgreSQL Operator pod的信息。在另一个终端,执行端口转发;这将允许你开始对PostgreSQL Operator执行命令!尝试输入下列命令创建集群: + * 下载 Operator 配置文件 + * 将 `$HOME/.pgouser` 这个文件设置为默认设置 + * 以 Kubernetes [Deployment][13] 部署 Operator + * 设置你的 `.bashrc` 文件包含 Operator 环境变量 + * 设置你的 `$HOME/.bash_completion` 文件为 `pgo bash_completion` 文件 + +在快速启动脚本的执行期间,你将会被提示在你的 Kubernetes 集群设置 RBAC 规则。在另一个终端,执行快速启动命令所提示你的命令。 + +一旦这个脚本执行完成,你将会得到提示设置一个端口以转发到 PostgreSQL Operator pod。在另一个终端,执行这个端口转发操作;这将允许你开始对 PostgreSQL Operator 执行命令!尝试输入下列命令创建集群: ``` pgo create cluster mynewcluster @@ -66,10 +69,9 @@ pgo create cluster mynewcluster pgo test mynewcluster ``` -现在,你能在Kubernetes环境下管理你的PostgreSQL数据库!你可以在[官方文档][14]找到非常全面的命令,包括扩容,高可用,备份等等。 +现在,你能在 Kubernetes 环境下管理你的 PostgreSQL 数据库了!你可以在[官方文档][14]找到非常全面的命令,包括扩容,高可用,备份等等。 -* * * -这篇文章部分参考了该作者为了Crunchy博客而写的[在Kubernetes上开始运行PostgreSQL][15] +这篇文章部分参考了该作者为 Crunchy 博客而写的[在 Kubernetes 上开始运行 PostgreSQL][15]。 -------------------------------------------------------------------------------- @@ -79,7 +81,7 @@ via: https://opensource.com/article/19/3/how-run-postgresql-kubernetes 作者:[Jonathan S. Katz][a] 选题:[lujun9972][b] 译者:[arrowfeng](https://github.com/arrowfeng) -校对:[校对ID](https://github.com/校对ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 801ecd16af9b7e1dbbc2de88e9cc543e5646188f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 10:58:24 +0800 Subject: [PATCH 0073/1154] PUB:20190328 How to run PostgreSQL on Kubernetes.md @arrowfeng https://linux.cn/article-10762-1.html --- .../20190328 How to run PostgreSQL on Kubernetes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190328 How to run PostgreSQL on Kubernetes.md (98%) diff --git a/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md b/published/20190328 How to run PostgreSQL on Kubernetes.md similarity index 98% rename from translated/tech/20190328 How to run PostgreSQL on Kubernetes.md rename to published/20190328 How to run PostgreSQL on Kubernetes.md index f45404efc8..e8c4ceb539 100644 --- a/translated/tech/20190328 How to run PostgreSQL on Kubernetes.md +++ b/published/20190328 How to run PostgreSQL on Kubernetes.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10762-1.html) [#]: subject: (How to run PostgreSQL on Kubernetes) [#]: via: (https://opensource.com/article/19/3/how-run-postgresql-kubernetes) [#]: author: (Jonathan S. Katz https://opensource.com/users/jkatz05) From b36258b9f273e12ec132d30a3781d11c51d735c1 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:12:45 +0800 Subject: [PATCH 0074/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=20How?= =?UTF-8?q?=20To=20Monitor=20Disk=20I/O=20Activity=20Using=20iotop=20And?= =?UTF-8?q?=20iostat=20Commands=20In=20Linux=3F=20sources/tech/20190422=20?= =?UTF-8?q?How=20To=20Monitor=20Disk=20I-O=20Activity=20Using=20iotop=20An?= =?UTF-8?q?d=20iostat=20Commands=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sing iotop And iostat Commands In Linux.md | 341 ++++++++++++++++++ 1 file changed, 341 insertions(+) create mode 100644 sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md diff --git a/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md new file mode 100644 index 0000000000..379aba5be9 --- /dev/null +++ b/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -0,0 +1,341 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) +[#]: via: (https://www.2daygeek.com/monitor-disk-io-activity-using-iotop-iostat-command-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux? +====== + +Do you know what are the tools we can use for troubleshooting or monitoring real-time disk activity in Linux? + +If **[Linux system performance][1]** gets slow down we may use **[top command][2]** to see the system performance. + +It is used to check what are the processes are consuming high utilization on server. + +It’s common for most of the Linux administrator. + +It’s widely used by Linux administrator in the real world. + +If you don’t see much difference in the process output still you have an option to check other things. + +I would like to advise you to check `wa` status in the top output because most of the time the server performance will be degraded due to high I/O Read and Write on hard disk. + +If it’s high or fluctuation, it could be a cause. So, we need to check I/O activity on hard drive. + +We can monitory disk I/O statistics for all disks and file system in Linux system using `iotop` and `iostat` commands. + +### What Is iotop? + +iotop is a top-like utility for displaying real-time disk activity. + +iotop watches I/O usage information output by the Linux kernel and displays a table of current I/O usage by processes or threads on the system. + +It displays the I/O bandwidth read and written by each process/thread. It also displays the percentage of time the thread/process spent while swapping in and while waiting on I/O. + +Total DISK READ and Total DISK WRITE values represent total read and write bandwidth between processes and kernel threads on the one side and kernel block device subsystem on the other. + +Actual DISK READ and Actual DISK WRITE values represent corresponding bandwidths for actual disk I/O between kernel block device subsystem and underlying hardware (HDD, SSD, etc.). + +### How To Install iotop In Linux? + +We can easily install it with help of package manager since the package is available in all the Linux distributions repository. + +For **`Fedora`** system, use **[DNF Command][3]** to install iotop. + +``` +$ sudo dnf install iotop +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install iotop. + +``` +$ sudo apt install iotop +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install iotop. + +``` +$ sudo pacman -S iotop +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install iotop. + +``` +$ sudo yum install iotop +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install iotop. + +``` +$ sudo zypper install iotop +``` + +### How To Monitor Disk I/O Activity/Statistics In Linux Using iotop Command? + +There are many options are available in iotop command to check varies statistics about disk I/O. + +Run the iotop command without any arguments to see each process or thread current I/O usage. + +``` +# iotop +``` + +[![][9]![][9]][10] + +If you would like to check which process are actually doing IO then run the iotop command with `-o` or `--only` option. + +``` +# iotop --only +``` + +[![][9]![][9]][11] + +**Details:** + + * **`IO:`** It shows I/O utilization for each process, which includes disk and swap. + * **`SWAPIN:`** It shows only the swap usage of each process. + + + +### What Is iostat? + +iostat is used to report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions. + +The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. + +The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks. + +All statistics are reported each time the iostat command is run. The report consists of a CPU header row followed by a row of CPU statistics. + +On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of statistics for each device that is configured. + +The iostat command generates two types of reports, the CPU Utilization report and the Device Utilization report. + +### How To Install iostat In Linux? + +iostat tool is part of sysstat package so, We can easily install it with help of package manager since the package is available in all the Linux distributions repository. + +For **`Fedora`** system, use **[DNF Command][3]** to install sysstat. + +``` +$ sudo dnf install sysstat +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install sysstat. + +``` +$ sudo apt install sysstat +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install sysstat. + +``` +$ sudo pacman -S sysstat +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install sysstat. + +``` +$ sudo yum install sysstat +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install sysstat. + +``` +$ sudo zypper install sysstat +``` + +### How To Monitor Disk I/O Activity/Statistics In Linux Using sysstat Command? + +There are many options are available in iostat command to check varies statistics about disk I/O and CPU. + +Run the iostat command without any arguments to see complete statistics of the system. + +``` +# iostat + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.45 0.02 16.47 0.12 0.00 53.94 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.95 124.97 0.00 58420014 57507206 0 +sda 0.18 6.77 80.24 0.00 3115036 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-d` option to see I/O statistics for all the devices + +``` +# iostat -d + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.95 124.97 0.00 58420030 57509090 0 +sda 0.18 6.77 80.24 0.00 3115292 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-p` option to see I/O statistics for all the devices and their partitions. + +``` +# iostat -p + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.42 0.02 16.45 0.12 0.00 53.99 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.94 124.96 0.00 58420062 57512278 0 +nvme0n1p1 6.40 124.46 118.36 0.00 57279753 54474898 0 +nvme0n1p2 0.27 2.47 6.60 0.00 1138069 3037380 0 +sda 0.18 6.77 80.23 0.00 3116060 36924764 0 +sda1 0.00 0.01 0.00 0.00 3224 0 0 +sda2 0.18 6.76 80.23 0.00 3111508 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-x` option to see detailed I/O statistics for all the devices. + +``` +# iostat -x + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.41 0.02 16.45 0.12 0.00 54.00 + +Device r/s rkB/s rrqm/s %rrqm r_await rareq-sz w/s wkB/s wrqm/s %wrqm w_await wareq-sz d/s dkB/s drqm/s %drqm d_await dareq-sz aqu-sz %util +nvme0n1 2.45 126.93 0.60 19.74 0.40 51.74 4.23 124.96 5.12 54.76 3.16 29.54 0.00 0.00 0.00 0.00 0.00 0.00 0.31 30.28 +sda 0.06 6.77 0.00 0.00 8.34 119.20 0.12 80.23 19.94 99.40 31.84 670.73 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.13 +loop0 0.00 0.00 0.00 0.00 0.08 19.64 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +``` + +Run the iostat command with `-d [Device_Name]` option to see I/O statistics of particular device and their partitions. + +``` +# iostat -p [Device_Name] + +# iostat -p sda + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.38 0.02 16.43 0.12 0.00 54.05 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +sda 0.18 6.77 80.21 0.00 3117468 36924764 0 +sda2 0.18 6.76 80.21 0.00 3112916 36924764 0 +sda1 0.00 0.01 0.00 0.00 3224 0 0 +``` + +Run the iostat command with `-m` option to see I/O statistics with `MB` for all the devices instead of `KB`. By default it shows the output with KB. + +``` +# iostat -m + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.36 0.02 16.41 0.12 0.00 54.09 + +Device tps MB_read/s MB_wrtn/s MB_dscd/s MB_read MB_wrtn MB_dscd +nvme0n1 6.68 0.12 0.12 0.00 57050 56176 0 +sda 0.18 0.01 0.08 0.00 3045 36059 0 +loop0 0.00 0.00 0.00 0.00 2 0 0 +loop1 0.00 0.00 0.00 0.00 1 0 0 +loop2 0.00 0.00 0.00 0.00 1 0 0 +``` + +Run the iostat command with certain interval then use the following format. In this example, we are going to capture totally two reports at five seconds interval. + +``` +# iostat [Interval] [Number Of Reports] + +# iostat 5 2 + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.35 0.02 16.41 0.12 0.00 54.10 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.89 124.95 0.00 58420116 57525344 0 +sda 0.18 6.77 80.20 0.00 3118492 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 + +avg-cpu: %user %nice %system %iowait %steal %idle + 3.71 0.00 2.51 0.05 0.00 93.73 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 19.00 0.20 311.40 0.00 1 1557 0 +sda 0.20 25.60 0.00 0.00 128 0 0 +loop0 0.00 0.00 0.00 0.00 0 0 0 +loop1 0.00 0.00 0.00 0.00 0 0 0 +loop2 0.00 0.00 0.00 0.00 0 0 0 +``` + +Run the iostat command with `-N` option to see the LVM disk I/O statistics report. + +``` +# iostat -N + +Linux 4.15.0-47-generic (Ubuntu18.2daygeek.com) Thursday 18 April 2019 _x86_64_ (2 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 0.38 0.07 0.18 0.26 0.00 99.12 + +Device tps kB_read/s kB_wrtn/s kB_read kB_wrtn +sda 3.60 57.07 69.06 968729 1172340 +sdb 0.02 0.33 0.00 5680 0 +sdc 0.01 0.12 0.00 2108 0 +2g-2gvol1 0.00 0.07 0.00 1204 0 +``` + +Run the nfsiostat command to see the I/O statistics for Network File System(NFS). + +``` +# nfsiostat +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/monitor-disk-io-activity-using-iotop-iostat-command-in-linux/ + +作者:[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/monitoring-tools/ +[2]: https://www.2daygeek.com/linux-top-command-linux-system-performance-monitoring-tool/ +[3]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[7]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[8]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[10]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-1.jpg +[11]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-2.jpg From 3133b517e8bf883735e74942f8510e7b48419890 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:12:59 +0800 Subject: [PATCH 0075/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190419=204=20?= =?UTF-8?q?cool=20new=20projects=20to=20try=20in=20COPR=20for=20April=2020?= =?UTF-8?q?19=20sources/tech/20190419=204=20cool=20new=20projects=20to=20t?= =?UTF-8?q?ry=20in=20COPR=20for=20April=202019.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... projects to try in COPR for April 2019.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md diff --git a/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md new file mode 100644 index 0000000000..e8d7dd9f7c --- /dev/null +++ b/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 cool new projects to try in COPR for April 2019) +[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) +[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) + +4 cool new projects to try in COPR for April 2019 +====== + +![][1] + +COPR is a [collection][2] of personal repositories for software that isn’t carried in Fedora. Some software doesn’t conform to standards that allow easy packaging. Or it may not meet other Fedora standards, despite being free and open source. COPR can offer these projects outside the Fedora set of packages. Software in COPR isn’t supported by Fedora infrastructure or signed by the project. However, it can be a neat way to try new or experimental software. + +Here’s a set of new and interesting projects in COPR. + +### Joplin + +[Joplin][3] is a note-taking and to-do app. Notes are written in the Markdown format, and organized by sorting them into various notebooks and using tags. +Joplin can import notes from any Markdown source or exported from Evernote. In addition to the desktop app, there’s an Android version with the ability to synchronize notes between them — using Nextcloud, Dropbox or other cloud services. Finally, there’s a browser extension for Chrome and Firefox to save web pages and screenshots. + +![][4] + +#### Installation instructions + +The [repo][5] currently provides Joplin for Fedora 29 and 30, and for EPEL 7. To install Joplin, use these commands [with sudo][6]: + +``` +sudo dnf copr enable taw/joplin +sudo dnf install joplin +``` + +### Fzy + +[Fzy][7] is a command-line utility for fuzzy string searching. It reads from a standard input and sorts the lines based on what is most likely the sought after text, and then prints the selected line. In addition to command-line, fzy can be also used within vim. You can try fzy in this online [demo][8]. + +#### Installation instructions + +The [repo][9] currently provides fzy for Fedora 29, 30, and Rawhide, and other distributions. To install fzy, use these commands: + +``` +sudo dnf copr enable lehrenfried/fzy +sudo dnf install fzy +``` + +### Fondo + +Fondo is a program for browsing many photographs from the [unsplash.com][10] website. It has a simple interface that allows you to look for pictures of one of several themes, or all of them at once. You can then set a found picture as a wallpaper with a single click, or share it. + + * ![][11] + + + +#### Installation instructions + +The [repo][12] currently provides Fondo for Fedora 29, 30, and Rawhide. To install Fondo, use these commands: + +``` +sudo dnf copr enable atim/fondo +sudo dnf install fondo +``` + +### YACReader + +[YACReader][13] is a digital comic book reader that supports many comics and image formats, such as _cbz_ , _cbr_ , _pdf_ and others. YACReader keeps track of reading progress, and can download comics’ information from [Comic Vine.][14] It also comes with a YACReader Library for organizing and browsing your comic book collection. + + * ![][15] + + + +#### Installation instructions + +The [repo][16] currently provides YACReader for Fedora 29, 30, and Rawhide. To install YACReader, use these commands: + +``` +sudo dnf copr enable atim/yacreader +sudo dnf install yacreader +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/ + +作者:[Dominik Turecek][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/dturecek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg +[2]: https://copr.fedorainfracloud.org/ +[3]: https://joplin.cozic.net/ +[4]: https://fedoramagazine.org/wp-content/uploads/2019/04/joplin.png +[5]: https://copr.fedorainfracloud.org/coprs/taw/joplin/ +[6]: https://fedoramagazine.org/howto-use-sudo/ +[7]: https://github.com/jhawthorn/fzy +[8]: https://jhawthorn.github.io/fzy-demo/ +[9]: https://copr.fedorainfracloud.org/coprs/lehrenfried/fzy/ +[10]: https://unsplash.com/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/04/fondo.png +[12]: https://copr.fedorainfracloud.org/coprs/atim/fondo/ +[13]: https://www.yacreader.com/ +[14]: https://comicvine.gamespot.com/ +[15]: https://fedoramagazine.org/wp-content/uploads/2019/04/yacreader.png +[16]: https://copr.fedorainfracloud.org/coprs/atim/yacreader/ From b20f610abbbf78f0acdf4a0a169e685355e70688 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:13:17 +0800 Subject: [PATCH 0076/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Mana?= =?UTF-8?q?ging=20RAID=20arrays=20with=20mdadm=20sources/tech/20190417=20M?= =?UTF-8?q?anaging=20RAID=20arrays=20with=20mdadm.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190417 Managing RAID arrays with mdadm.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20190417 Managing RAID arrays with mdadm.md diff --git a/sources/tech/20190417 Managing RAID arrays with mdadm.md b/sources/tech/20190417 Managing RAID arrays with mdadm.md new file mode 100644 index 0000000000..5f29608b8a --- /dev/null +++ b/sources/tech/20190417 Managing RAID arrays with mdadm.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managing RAID arrays with mdadm) +[#]: via: (https://fedoramagazine.org/managing-raid-arrays-with-mdadm/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +Managing RAID arrays with mdadm +====== + +![][1] + +Mdadm stands for Multiple Disk and Device Administration. It is a command line tool that can be used to manage software [RAID][2] arrays on your Linux PC. This article outlines the basics you need to get started with it. + +The following five commands allow you to make use of mdadm’s most basic features: + + 1. **Create a RAID array** : +### mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 + 2. **Assemble (and start) a RAID array** : +### mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1 + 3. **Stop a RAID array** : +### mdadm --stop /dev/md/test + 4. **Delete a RAID array** : +### mdadm --zero-superblock /dev/sda1 /dev/sdb1 + 5. **Check the status of all assembled RAID arrays** : +### cat /proc/mdstat + + + +#### Notes on features + +##### `mdadm --create` + +The _create_ command shown above includes the following four parameters in addition to the create parameter itself and the device names: + + 1. **–homehost** : +By default, mdadm stores your computer’s name as an attribute of the RAID array. If your computer name does not match the stored name, the array will not automatically assemble. This feature is useful in server clusters that share hard drives because file system corruption usually occurs if multiple servers attempt to access the same drive at the same time. The name _any_ is reserved and disables the _homehost_ restriction. + 2. **–metadata** : +_mdadm_ reserves a small portion of each RAID device to store information about the RAID array itself. The _metadata_ parameter specifies the format and location of the information. The value _1.0_ indicates to use version-1 formatting and store the metadata at the end of the device. + 3. **–level** : +The _level_ parameter specifies how the data should be distributed among the underlying devices. Level _1_ indicates each device should contain a complete copy of all the data. This level is also known as [disk mirroring][3]. + 4. **–raid-devices** : +The _raid-devices_ parameter specifies the number of devices that will be used to create the RAID array. + + + +By using _level=1_ (mirroring) in combination with _metadata=1.0_ (store the metadata at the end of the device), you create a RAID1 array whose underlying devices appear normal if accessed without the aid of the mdadm driver. This is useful in the case of disaster recovery, because you can access the device even if the new system doesn’t support mdadm arrays. It’s also useful in case a program needs _read-only_ access to the underlying device before mdadm is available. For example, the [UEFI][4] firmware in a computer may need to read the bootloader from the [ESP][5] before mdadm is started. + +##### `mdadm --assemble` + +The _assemble_ command above fails if a member device is missing or corrupt. To force the RAID array to assemble and start when one of its members is missing, use the following command: + +``` +# mdadm --assemble --run /dev/md/test /dev/sda1 +``` + +#### Other important notes + +Avoid writing directly to any devices that underlay a mdadm RAID1 array. That causes the devices to become out-of-sync and mdadm won’t know that they are out-of-sync. If you access a RAID1 array with a device that’s been modified out-of-band, you can cause file system corruption. If you modify a RAID1 device out-of-band and need to force the array to re-synchronize, delete the mdadm metadata from the device to be overwritten and then re-add it to the array as demonstrated below: + +``` +# mdadm --zero-superblock /dev/sdb1 +# mdadm --assemble --run /dev/md/test /dev/sda1 +# mdadm /dev/md/test --add /dev/sdb1 +``` + +These commands completely overwrite the contents of sdb1 with the contents of sda1. + +To specify any RAID arrays to automatically activate when your computer starts, create an _/etc/mdadm.conf_ configuration file. + +For the most up-to-date and detailed information, check the man pages: + +``` +$ man mdadm +$ man mdadm.conf +``` + +The next article of this series will show a step-by-step guide on how to convert an existing single-disk Linux installation to a mirrored-disk installation, that will continue running even if one of its hard drives suddenly stops working! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ + +作者:[Gregory Bartholomew][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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/mdadm-816x345.jpg +[2]: https://en.wikipedia.org/wiki/RAID +[3]: https://en.wikipedia.org/wiki/Disk_mirroring +[4]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface +[5]: https://en.wikipedia.org/wiki/EFI_system_partition From e40b2c8b79525454ad8f731d3b0fbf8a3e794b74 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:13:29 +0800 Subject: [PATCH 0077/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190416=20Move?= =?UTF-8?q?=20Data=20to=20the=20Cloud=20with=20Azure=20Data=20Migration=20?= =?UTF-8?q?sources/tech/20190416=20Move=20Data=20to=20the=20Cloud=20with?= =?UTF-8?q?=20Azure=20Data=20Migration.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... to the Cloud with Azure Data Migration.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md diff --git a/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md b/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md new file mode 100644 index 0000000000..379c53cd97 --- /dev/null +++ b/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md @@ -0,0 +1,34 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Move Data to the Cloud with Azure Data Migration) +[#]: via: (https://www.linux.com/blog/move-data-cloud-azure-data-migration) +[#]: author: (InfoWorld https://www.linux.com/users/infoworld) + +Move Data to the Cloud with Azure Data Migration +====== + +Despite more than a decade of cloud migration, there’s still a vast amount of data running on-premises. That’s not surprising since data migrations, even between similar systems, are complex, slow, and add risk to your day-to-day operations. Moving to the cloud adds additional management overhead, raising questions of network connectivity and bandwidth, as well as the variable costs associated with running cloud databases. + +Read more at: [InfoWorld][1] + +Despite more than a decade of cloud migration, there’s still a vast amount of data running on-premises. That’s not surprising since data migrations, even between similar systems, are complex, slow, and add risk to your day-to-day operations. Moving to the cloud adds additional management overhead, raising questions of network connectivity and bandwidth, as well as the variable costs associated with running cloud databases. + +Read more at: [InfoWorld][1] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/move-data-cloud-azure-data-migration + +作者:[InfoWorld][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/infoworld +[b]: https://github.com/lujun9972 +[1]: https://www.infoworld.com/article/3388312/move-data-to-the-cloud-with-azure-data-migration.html From 90ae80e61740e6fd8b93c58d8fded36a1ff53bdc Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:13:41 +0800 Subject: [PATCH 0078/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190420=20New?= =?UTF-8?q?=20Features=20Coming=20to=20Debian=2010=20Buster=20Release=20so?= =?UTF-8?q?urces/tech/20190420=20New=20Features=20Coming=20to=20Debian=201?= =?UTF-8?q?0=20Buster=20Release.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ures Coming to Debian 10 Buster Release.md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md diff --git a/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md new file mode 100644 index 0000000000..aa1ee9df46 --- /dev/null +++ b/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md @@ -0,0 +1,147 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (New Features Coming to Debian 10 Buster Release) +[#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +New Features Coming to Debian 10 Buster Release +====== + +Debian 10 Buster is nearing its release. The first release candidate is already out and we should see the final release, hopefully, in a few weeks. + +If you are excited about this major new release, let me tell you what’s in it for you. + +### Debian 10 Buster Release Schedule + +There is no set release date for [Debian 10 Buster][1]. Why is that so? Unlike other distributions, [Debian][2] doesn’t do time-based releases. It instead focuses on fixing release-critical bugs. Release-critical bugs are bugs which have either security issues [CVE’s][3] or some other critical issues which prevent Debian from releasing. + +Debian has three parts in its archive, called Main, contrib and non-free. Of the three, Debian Developers and Release Managers are most concerned that the packages which form the bedrock of the distribution i.e. Main is rock stable. So they make sure that there aren’t any major functional or security issues. They are also given priority values such as Essential, Required, Important, Standard, Optional and Extra. More on this in some later Debian article. + +This is necessary because Debian is used as a server in many different environments and people have come to depend on Debian. They also look at upgrade cycles to see nothing breaks for which they look for people to test and see if something breaks while upgrading and inform Debian of the same. + +This commitment to stability is one of the [many reasons why I love to use Debian][4]. + +### What’s new in Debian 10 Buster Release + +Here are a few visual and under the hood changes in the upcoming major release of Debian. + +#### New theme and wallpaper + +The Debian theme for Buster is called [FuturePrototype][5] and can be seen below: + +![Debian Buster FuturePrototype Theme][6] + +#### 1\. GNOME Desktop 3.30 + +The GNOME desktop which was 1.3.22 in Debian Stretch is updated to 1.3.30 in Buster. Some of the new packages included in this GNOME desktop release are gnome-todo, tracker instead of tracker-gui , dependency against gstreamer1.0-packagekit so there is automatic codec installation for playing movies etc. The big move has been all packages being moved from libgtk2+ to libgtk3+ . + +#### 2\. Linux Kernel 4.19.0-4 + +Debian uses LTS Kernel versions so you can expect much better hardware support and long 5 year maintainance and support cycle from Debian. From kernel 4.9.0.3 we have come to 4.19.0-4 . + +``` +$ uname -r +4.19.0-4-amd64 +``` + +#### 3\. OpenJDK 11.0 + +For a long time Debian was stuck on OpenJDK 8.0. Now in Debian Buster we have moved to OpenJDK 11.0 and have a team which will take care of new versions. + +#### 4\. AppArmor Enabled by Default + +In Debian Buster [AppArmor][7] will be enabled by default. While this is a good thing, care would have to be taken care by system administrators to enable correct policies. This is only the first step and would need fixing probably lot of scripts to be as useful as been envisioned for the user. + +#### 5\. Nodejs 10.15.2 + +For a long time Debian had Nodejs 4.8 in the repo. In this cycle Debian has moved to Nodejs 10.15.2 . In fact, Debian Buster has many javascript libraries such as yarnpkg (an npm alternative) and many others. + +Of course, you can [install latest Nodejs in Debian][8] from the project’s repository but it’s good to see newer version in Debian repository. + +#### 6\. NFtables replaces iptables + +Debian buster provides nftables as a full replacement to iptables which means better and easier syntax, better support for dual-stack ipv4-v6 firewalls and more. + +#### 7\. Support for lot of ARM 64 and ARMHF SBC Boards. + +There has been a constant stream of new SBC boards which Debian is supporting, the latest amongst these are pine64_plus, pinebook for ARM64, while Firefly-RK3288, u-boot-rockchip for ARMHF 64 as well as Odroid HC1/HC2 boards, SolidRun Cubox-i Dual/Quad (1.5som), and SolidRun Cubox-i Dual/Quad (1.5som+emmc) boards, Cubietruckplus as well. There is support for Rock 64, Banana Pi M2 Berry, Pine A64 LTS Board, Olimex A64 Teres-1 as well as Raspberry Pi 1, Zero and Pi 3. Support will be out-of-the box for RISC-V systems as well. + +#### 8\. Python 2 is dead, long live Python 3 + +Python 2 will be [deprecated][9] on January 1, 2020 by python.org . While Debian does have Python 2.7 efforts are on to remove after moving all packages to Python 3 to remove it from the repo. This may happen either at Buster release or in a future point release but this is imminent. So Python developers are encouraged to move their code-base to be compatible with Python 3. At the moment of writing, both python2 and python3 are supported in Debian buster. + +#### 9\. Mailman 3 + +Mailman3 is finally available in Debian. While [Mailman][10] has been further sub-divided into components. To install the whole stack, install mailman3-full to get all the components. + +#### 10\. Any existing Postgresql databases used will need to be reindexed + +Due to updates in glibc locale data, the way the information is sorted in put in text indexes will change hence it would be beneficial to reindex the data so no data corruption arises in near future. + +#### 11\. Bash 5.0 by Default + +You probably have already about the [new features in Bash 5.0][11], this version is already in Debian. + +#### 12\. Debian implementing /usr/merge + +An excellent freedesktop [primer][12] on what /usr/merge brings is already shared. Couple of things to note though. While Debian would like to do the whole transition, there is possibility that due to unforseen circumstances, some binaries may not be in a position to do the change. One point to note though, /var and /etc/ will be left alone so people who are using containers or cloud would not have to worry too much :) + +#### 13\. Secure-boot support + +With Buster RC1, Debian now has secure-boot support. Which means machines which have the secure-boot bit turned on in the machine should be easily able to install Debian on such machines. No need to disable or workaround Secure boot anymore :) + +#### 14\. Calameres Live-installer for Debian-Live images + +For Debian buster, Debian Live, Debian introduces [Calameres Installer][13] instead of plain old debian-installer. While the Debian-installer has lot many features than Calameres, for newbies Calameres provides a fresh alternative to install than debian-installer. Some screenshots from the installation process. + +![Calamares Partitioning Stage][14] + +As can be seen it is pretty easy to Install Debian under Calamares, only 5 stages to go through and you can have Debian installed at your end. + +### Download Debian 10 Live Images (only for testing) + +Don’t use it on production machines just yet. Try it on a test machine or a virtual machine. + +You can get Debian 64-bit and 32 bit images from Debian Live [directory][15]. If you want the 64-bit look into 64-bit directory, if you want the 32-bit, you can look into the 32-bit directory. + +[Debian 10 Buster Live Images][15] + +If you upgrade from existing stable and something breaks, see if it is reported against the [upgrade-reports][16] psuedo-package using [reportbug][17] you saw the issue with. If the bug has not reported in the package then report it and share as much information as you can. + +**In Conclusion** + +While thousands of packages have been updated and it is virtually impossible to list them all. I have tired to list some of the major changes that you can look for in Debian buster. What do you think of it? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/new-features-coming-to-debian-10-buster-release/ + +作者:[Shirish][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/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.debian.org/DebianBuster +[2]: https://www.debian.org/ +[3]: https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures +[4]: https://itsfoss.com/reasons-why-i-love-debian/ +[5]: https://wiki.debian.org/DebianArt/Themes/futurePrototype +[6]: https://itsfoss.com/wp-content/uploads/2019/04/debian-buster-theme-800x450.png +[7]: https://wiki.debian.org/AppArmor +[8]: https://itsfoss.com/install-nodejs-ubuntu/ +[9]: https://www.python.org/dev/peps/pep-0373/ +[10]: https://www.list.org/ +[11]: https://itsfoss.com/bash-5-release/ +[12]: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/ +[13]: https://calamares.io/about/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/calamares-partitioning-wizard.jpg?fit=800%2C538&ssl=1 +[15]: https://cdimage.debian.org/cdimage/weekly-live-builds/ +[16]: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=upgrade-reports;dist=unstable +[17]: https://itsfoss.com/bug-report-debian/ From d4714bb04b7678a769e810e39bcc77bf300ae88c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:13:53 +0800 Subject: [PATCH 0079/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Ubun?= =?UTF-8?q?tu=2019.04=20=E2=80=98Disco=20Dingo=E2=80=99=20Has=20Arrived:?= =?UTF-8?q?=20Downloads=20Available=20Now!=20sources/tech/20190418=20Ubunt?= =?UTF-8?q?u=2019.04=20=E2=80=98Disco=20Dingo-=20Has=20Arrived-=20Download?= =?UTF-8?q?s=20Available=20Now.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ngo- Has Arrived- Downloads Available Now.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md diff --git a/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md new file mode 100644 index 0000000000..8098db45f2 --- /dev/null +++ b/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now!) +[#]: via: (https://itsfoss.com/ubuntu-19-04-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now! +====== + +It’s the time to disco! Why? Well, Ubuntu 19.04 ‘Disco Dingo’ is here and finally available to download. Although, we are aware of the [new features in Ubuntu 19.04][1] – I will mention a few important things below and would also point you to the official links to download it and get started. + +### Ubuntu 19.04: What You Need To Know + +Here are a few things you should know about Ubuntu 19.04 Disco Dingo release. + +#### Ubuntu 19.04 is not an LTS Release + +Unlike Ubuntu 18.04 LTS, this will not be [supported for 10 years][2]. Instead, the non-LTS 19.04 will be supported for **9 months until January 2020.** + +So, if you have a production environment, we may not recommend upgrading it right away. For example, if you have a server that runs on Ubuntu 18.04 LTS – it may not be a good idea to upgrade it to 19.04 just because it is an exciting release. + +However, for users who want the latest and greatest installed on their machines can try it out. + +![][3] + +#### Ubuntu 19.04 is a sweet update for NVIDIA GPU Owners + +_Martin Wimpress_ (from Canonical) mentioned that Ubuntu 19.04 is particularly a big deal for NVIDIA GPU owners in the final release notes of Ubuntu MATE 19.04 (one of the Ubuntu flavors) on [GitHub][4]. + +In other words, while installing the proprietary graphics driver – it now selects the best driver compatible with your particular GPU model. + +#### Ubuntu 19.04 Features + +Even though we have already discussed the [best features of Ubuntu 19.04][1] Disco Dingo, it is worth mentioning that I’m exciting about the desktop updates (GNOME 3.32) and the Linux Kernel (5.0) that comes as one of the major changes in this release. + +#### Upgrading from Ubuntu 18.10 to 19.04 + +If you have Ubuntu 18.10 installed, you should upgrade it for obvious reasons. 18.10 will reach its end of life in July 2019 – so we recommend you to upgrade it to 19.04. + +To do that, you can simply head on to the “ **Software and Updates** ” settings and then navigate your way to the “ **Updates** ” tab. + +Now, change the option for – **Notify me of a new Ubuntu version** to “ _For any new version_ “. + +When you run the update manager now, you should see that Ubuntu 19.04 is available now. + +![][5] + +#### Upgrading from Ubuntu 18.04 to 19.04 + +It is not recommended to directly upgrade from 18.04 to 19.04 because you will have to update the OS to 18.10 first and then proceed to get 19.04 on board. + +Instead, you can simply download the official ISO image of Ubuntu 19.04 and then re-install Ubuntu on your system. + +### Ubuntu 19.04: Downloads Available for all flavors + +As per the [release notes][6], Ubuntu 19.04 is available to download now. You can get the torrent or the ISO file on its official release download page. + +[Download Ubuntu 19.04][7] + +If you need a different desktop environment or need something specific, you should check out the official flavors of Ubuntu available: + + * [Ubuntu MATE][8] + * [Kubuntu][9] + * [Lubuntu][10] + * [Ubuntu Budgie][11] + * [Ubuntu Studio][12] + * [Xubuntu][13] + + + +Some of the above mentioned Ubuntu flavors haven’t put the 19.04 release on their download yet. But you can [still find the ISOs on the Ubuntu’s release note webpage][6]. Personally, I use Ubuntu with GNOME desktop. You can choose whatever you like. + +**Wrapping Up** + +What do you think about Ubuntu 19.04 Disco Dingo? Are the new features exciting enough? Have you tried it yet? Let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-19-04-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://itsfoss.com/ubuntu-19-04-release-features/ +[2]: https://itsfoss.com/ubuntu-18-04-ten-year-support/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/ubuntu-19-04-Disco-Dingo-default-wallpaper.jpg?resize=800%2C450&ssl=1 +[4]: https://github.com/ubuntu-mate/ubuntu-mate.org/blob/master/blog/20190418-ubuntu-mate-disco-final-release.md +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-19-04-upgrade-available.jpg?ssl=1 +[6]: https://wiki.ubuntu.com/DiscoDingo/ReleaseNotes +[7]: https://www.ubuntu.com/download/desktop +[8]: https://ubuntu-mate.org/download/ +[9]: https://kubuntu.org/getkubuntu/ +[10]: https://lubuntu.me/cosmic-released/ +[11]: https://ubuntubudgie.org/downloads +[12]: https://ubuntustudio.org/2019/04/ubuntu-studio-19-04-released/ +[13]: https://xubuntu.org/download/ From c0cc9f1bb216bccfb4198dfdc08ba3511135f6db Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:14:05 +0800 Subject: [PATCH 0080/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190419=20Buil?= =?UTF-8?q?ding=20scalable=20social=20media=20sentiment=20analysis=20servi?= =?UTF-8?q?ces=20in=20Python=20sources/tech/20190419=20Building=20scalable?= =?UTF-8?q?=20social=20media=20sentiment=20analysis=20services=20in=20Pyth?= =?UTF-8?q?on.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a sentiment analysis services in Python.md | 294 ++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md diff --git a/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md new file mode 100644 index 0000000000..35321f1c9d --- /dev/null +++ b/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md @@ -0,0 +1,294 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building scalable social media sentiment analysis services in Python) +[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable) +[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) + +Building scalable social media sentiment analysis services in Python +====== +Learn how you can use spaCy, vaderSentiment, Flask, and Python to add +sentiment analysis capabilities to your work. +![Tall building with windows][1] + +The [first part][2] of this series provided some background on how sentiment analysis works. Now let's investigate how to add these capabilities to your designs. + +### Exploring spaCy and vaderSentiment in Python + +#### Prerequisites + + * A terminal shell + * Python language binaries (version 3.4+) in your shell + * The **pip** command for installing Python packages + * (optional) A [Python Virtualenv][3] to keep your work isolated from the system + + + +#### Configure your environment + +Before you begin writing code, you will need to set up the Python environment by installing the [spaCy][4] and [vaderSentiment][5] packages and downloading a language model to assist your analysis. Thankfully, most of this is relatively easy to do from the command line. + +In your shell, type the following command to install the spaCy and vaderSentiment packages: + + +``` +`pip install spacy vaderSentiment` +``` + +After the command completes, install a language model that spaCy can use for text analysis. The following command will use the spaCy module to download and install the English language [model][6]: + + +``` +`python -m spacy download en_core_web_sm` +``` + +With these libraries and models installed, you are now ready to begin coding. + +#### Do a simple text analysis + +Use the [Python interpreter interactive mode][7] to write some code that will analyze a single text fragment. Begin by starting the Python environment: + + +``` +$ python +Python 3.6.8 (default, Jan 31 2019, 09:38:34) +[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> +``` + +_(Your Python interpreter version print might look different than this.)_ + + 1. Import the necessary modules: [code] >>> import spacy +>>> from vaderSentiment import vaderSentiment +``` +2. Load the English language model from spaCy: [code]`>>> english = spacy.load("en_core_web_sm")` +``` + 3. Process a piece of text. This example shows a very simple sentence that we expect to return a slightly positive sentiment: [code]`>>> result = english("I like to eat applesauce with sugar and cinnamon.")` +``` +4. Gather the sentences from the processed result. SpaCy has identified and processed the entities within the phrase; this step generates sentiment for each sentence (even though there is only one sentence in this example): [code]`>>> sentences = [str(s) for s in result.sents]` +``` + 5. Create an analyzer using vaderSentiments: [code]`>>> analyzer = vaderSentiment.SentimentIntensityAnalyzer()` +``` +6. Perform the sentiment analysis on the sentences: [code]`>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences]` +``` + + + +The sentiment variable now contains the polarity scores for the example sentence. Print out the value to see how it analyzed the sentence. + + +``` +>>> print(sentiment) +[{'neg': 0.0, 'neu': 0.737, 'pos': 0.263, 'compound': 0.3612}] +``` + +What does this structure mean? + +On the surface, this is an array with a single dictionary object; had there been multiple sentences, there would be a dictionary for each one. There are four keys in the dictionary that correspond to different types of sentiment. The **neg** key represents negative sentiment, of which none has been reported in this text, as evidenced by the **0.0** value. The **neu** key represents neutral sentiment, which has gotten a fairly high score of **0.737** (with a maximum of **1.0** ). The **pos** key represents positive sentiments, which has a moderate score of **0.263**. Last, the **compound** key represents an overall score for the text; this can range from negative to positive scores, with the value **0.3612** representing a sentiment more on the positive side. + +To see how these values might change, you can run a small experiment using the code you already entered. The following block demonstrates an evaluation of sentiment scores on a similar sentence. + + +``` +>>> result = english("I love applesauce!") +>>> sentences = [str(s) for s in result.sents] +>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] +>>> print(sentiment) +[{'neg': 0.0, 'neu': 0.182, 'pos': 0.818, 'compound': 0.6696}] +``` + +You can see that by changing the example sentence to something overwhelmingly positive, the sentiment values have changed dramatically. + +### Building a sentiment analysis service + +Now that you have assembled the basic building blocks for doing sentiment analysis, let's turn that knowledge into a simple service. + +For this demonstration, you will create a [RESTful][8] HTTP server using the Python [Flask package][9]. This service will accept text data in English and return the sentiment analysis. Please note that this example service is for learning the technologies involved and not something to put into production. + +#### Prerequisites + + * A terminal shell + * The Python language binaries (version 3.4+) in your shell. + * The **pip** command for installing Python packages + * The **curl** command + * A text editor + * (optional) A [Python Virtualenv][3] to keep your work isolated from the system + + + +#### Configure your environment + +This environment is nearly identical to the one in the previous section. The only difference is the addition of the Flask package to Python. + + 1. Install the necessary dependencies: [code]`pip install spacy vaderSentiment flask` +``` +2. Install the English language model for spaCy: [code]`python -m spacy download en_core_web_sm` +``` + + + +#### Create the application file + +Open your editor and create a file named **app.py**. Add the following contents to it _(don't worry, we will review every line)_ : + + +``` +import flask +import spacy +import vaderSentiment.vaderSentiment as vader + +app = flask.Flask(__name__) +analyzer = vader.SentimentIntensityAnalyzer() +english = spacy.load("en_core_web_sm") + +def get_sentiments(text): +result = english(text) +sentences = [str(sent) for sent in result.sents] +sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] +return sentiments + +@app.route("/", methods=["POST", "GET"]) +def index(): +if flask.request.method == "GET": +return "To access this service send a POST request to this URL with" \ +" the text you want analyzed in the body." +body = flask.request.data.decode("utf-8") +sentiments = get_sentiments(body) +return flask.json.dumps(sentiments) +``` + +Although this is not an overly large source file, it is quite dense. Let's walk through the pieces of this application and describe what they are doing. + + +``` +import flask +import spacy +import vaderSentiment.vaderSentiment as vader +``` + +The first three lines bring in the packages needed for performing the language analysis and the HTTP framework. + + +``` +app = flask.Flask(__name__) +analyzer = vader.SentimentIntensityAnalyzer() +english = spacy.load("en_core_web_sm") +``` + +The next three lines create a few global variables. The first variable, **app** , is the main entry point that Flask uses for creating HTTP routes. The second variable, **analyzer** , is the same type used in the previous example, and it will be used to generate the sentiment scores. The last variable, **english** , is also the same type used in the previous example, and it will be used to annotate and tokenize the initial text input. + +You might be wondering why these variables have been declared globally. In the case of the **app** variable, this is standard procedure for many Flask applications. But, in the case of the **analyzer** and **english** variables, the decision to make them global is based on the load times associated with the classes involved. Although the load time might appear minor, when it's run in the context of an HTTP server, these delays can negatively impact performance. + + +``` +def get_sentiments(text): +result = english(text) +sentences = [str(sent) for sent in result.sents] +sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] +return sentiments +``` + +The next piece is the heart of the service—a function for generating sentiment values from a string of text. You can see that the operations in this function correspond to the commands you ran in the Python interpreter earlier. Here they're wrapped in a function definition with the source **text** being passed in as the variable text and finally the **sentiments** variable returned to the caller. + + +``` +@app.route("/", methods=["POST", "GET"]) +def index(): +if flask.request.method == "GET": +return "To access this service send a POST request to this URL with" \ +" the text you want analyzed in the body." +body = flask.request.data.decode("utf-8") +sentiments = get_sentiments(body) +return flask.json.dumps(sentiments) +``` + +The last function in the source file contains the logic that will instruct Flask how to configure the HTTP server for the service. It starts with a line that will associate an HTTP route **/** with the request methods **POST** and **GET**. + +After the function definition line, the **if** clause will detect if the request method is **GET**. If a user sends this request to the service, the following line will return a text message instructing how to access the server. This is largely included as a convenience to end users. + +The next line uses the **flask.request** object to acquire the body of the request, which should contain the text string to be processed. The **decode** function will convert the array of bytes into a usable, formatted string. The decoded text message is now passed to the **get_sentiments** function to generate the sentiment scores. Last, the scores are returned to the user through the HTTP framework. + +You should now save the file, if you have not done so already, and return to the shell. + +#### Run the sentiment service + +With everything in place, running the service is quite simple with Flask's built-in debugging server. To start the service, enter the following command from the same directory as your source file: + + +``` +`FLASK_APP=app.py flask run` +``` + +You will now see some output from the server in your shell, and the server will be running. To test that the server is running, you will need to open a second shell and use the **curl** command. + +First, check to see that the instruction message is printed by entering this command: + + +``` +`curl http://localhost:5000` +``` + +You should see the instruction message: + + +``` +`To access this service send a POST request to this URI with the text you want analyzed in the body.` +``` + +Next, send a test message to see the sentiment analysis by running the following command: + + +``` +`curl http://localhost:5000 --header "Content-Type: application/json" --data "I love applesauce!"` +``` + +The response you get from the server should be similar to the following: + + +``` +`[{"compound": 0.6696, "neg": 0.0, "neu": 0.182, "pos": 0.818}]` +``` + +Congratulations! You have now implemented a RESTful HTTP sentiment analysis service. You can find a link to a [reference implementation of this service and all the code from this article on GitHub][10]. + +### Continue exploring + +Now that you have an understanding of the principles and mechanics behind natural language processing and sentiment analysis, here are some ways to further your discovery of this topic. + +#### Create a streaming sentiment analyzer on OpenShift + +While creating local applications to explore sentiment analysis is a convenient first step, having the ability to deploy your applications for wider usage is a powerful next step. By following the instructions and code in this [workshop from Radanalytics.io][11], you will learn how to create a sentiment analyzer that can be containerized and deployed to a Kubernetes platform. You will also see how Apache Kafka is used as a framework for event-driven messaging and how Apache Spark can be used as a distributed computing platform for sentiment analysis. + +#### Discover live data with the Twitter API + +Although the [Radanalytics.io][12] lab generated synthetic tweets to stream, you are not limited to synthetic data. In fact, anyone with a Twitter account can access the Twitter streaming API and perform sentiment analysis on tweets with the [Tweepy Python][13] package. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable + +作者:[Michael McCune ][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/elmiko/users/jschlessman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-1 +[3]: https://virtualenv.pypa.io/en/stable/ +[4]: https://pypi.org/project/spacy/ +[5]: https://pypi.org/project/vaderSentiment/ +[6]: https://spacy.io/models +[7]: https://docs.python.org/3.6/tutorial/interpreter.html +[8]: https://en.wikipedia.org/wiki/Representational_state_transfer +[9]: http://flask.pocoo.org/ +[10]: https://github.com/elmiko/social-moments-service +[11]: https://github.com/radanalyticsio/streaming-lab +[12]: http://Radanalytics.io +[13]: https://github.com/tweepy/tweepy From fdeb89afe0d5a3b69d9625cb835e2fdd9741093b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:14:19 +0800 Subject: [PATCH 0081/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190419=20Gett?= =?UTF-8?q?ing=20started=20with=20social=20media=20sentiment=20analysis=20?= =?UTF-8?q?in=20Python=20sources/tech/20190419=20Getting=20started=20with?= =?UTF-8?q?=20social=20media=20sentiment=20analysis=20in=20Python.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cial media sentiment analysis in Python.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20190419 Getting started with social media sentiment analysis in Python.md diff --git a/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md b/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md new file mode 100644 index 0000000000..e70b263acc --- /dev/null +++ b/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with social media sentiment analysis in Python) +[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python) +[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) + +Getting started with social media sentiment analysis in Python +====== +Learn the basics of natural language processing and explore two useful +Python packages. +![Raspberry Pi and Python][1] + +Natural language processing (NLP) is a type of machine learning that addresses the correlation between spoken/written languages and computer-aided analysis of those languages. We experience numerous innovations from NLP in our daily lives, from writing assistance and suggestions to real-time speech translation and interpretation. + +This article examines one specific area of NLP: sentiment analysis, with an emphasis on determining the positive, negative, or neutral nature of the input language. This part will explain the background behind NLP and sentiment analysis and explore two open source Python packages. [Part 2][2] will demonstrate how to begin building your own scalable sentiment analysis services. + +When learning sentiment analysis, it is helpful to have an understanding of NLP in general. This article won't dig into the mathematical guts, rather our goal is to clarify key concepts in NLP that are crucial to incorporating these methods into your solutions in practical ways. + +### Natural language and text data + +A reasonable place to begin is defining: "What is natural language?" It is the means by which we, as humans, communicate with one another. The primary modalities for communication are verbal and text. We can take this a step further and focus solely on text communication; after all, living in an age of pervasive Siri, Alexa, etc., we know speech is a group of computations away from text. + +### Data landscape and challenges + +Limiting ourselves to textual data, what can we say about language and text? First, language, particularly English, is fraught with exceptions to rules, plurality of meanings, and contextual differences that can confuse even a human interpreter, let alone a computational one. In elementary school, we learn articles of speech and punctuation, and from speaking our native language, we acquire intuition about which words have less significance when searching for meaning. Examples of the latter would be articles of speech such as "a," "the," and "or," which in NLP are referred to as _stop words_ , since traditionally an NLP algorithm's search for meaning stops when reaching one of these words in a sequence. + +Since our goal is to automate the classification of text as belonging to a sentiment class, we need a way to work with text data in a computational fashion. Therefore, we must consider how to represent text data to a machine. As we know, the rules for utilizing and interpreting language are complicated, and the size and structure of input text can vary greatly. We'll need to transform the text data into numeric data, the form of choice for machines and math. This transformation falls under the area of _feature extraction_. + +Upon extracting numeric representations of input text data, one refinement might be, given an input body of text, to determine a set of quantitative statistics for the articles of speech listed above and perhaps classify documents based on them. For example, a glut of adverbs might make a copywriter bristle, or excessive use of stop words might be helpful in identifying term papers with content padding. Admittedly, this may not have much bearing on our goal of sentiment analysis. + +### Bag of words + +When you assess a text statement as positive or negative, what are some contextual clues you use to assess its polarity (i.e., whether the text has positive, negative, or neutral sentiment)? One way is connotative adjectives: something called "disgusting" is viewed as negative, but if the same thing were called "beautiful," you would judge it as positive. Colloquialisms, by definition, give a sense of familiarity and often positivity, whereas curse words could be a sign of hostility. Text data can also include emojis, which carry inherent sentiments. + +Understanding the polarity influence of individual words provides a basis for the [_bag-of-words_][3] (BoW) model of text. It considers a set of words or vocabulary and extracts measures about the presence of those words in the input text. The vocabulary is formed by considering text where the polarity is known, referred to as _labeled training data_. Features are extracted from this set of labeled data, then the relationships between the features are analyzed and labels are associated with the data. + +The name "bag of words" illustrates what it utilizes: namely, individual words without consideration of spatial locality or context. A vocabulary typically is built from all words appearing in the training set, which tends to be pruned afterward. Stop words, if not cleaned prior to training, are removed due to their high frequency and low contextual utility. Rarely used words can also be removed, given the lack of information they provide for general input cases. + +It is important to note, however, that you can (and should) go further and consider the appearance of words beyond their use in an individual instance of training data, or what is called [_term frequency_][4] (TF). You should also consider the counts of a word through all instances of input data; typically the infrequency of words among all documents is notable, which is called the [_inverse document frequency_][5] (IDF). These metrics are bound to be mentioned in other articles and software packages on this subject, so having an awareness of them can only help. + +BoW is useful in a number of document classification applications; however, in the case of sentiment analysis, things can be gamed when the lack of contextual awareness is leveraged. Consider the following sentences: + + * We are not enjoying this war. + * I loathe rainy days, good thing today is sunny. + * This is not a matter of life and death. + + + +The sentiment of these phrases is questionable for human interpreters, and by strictly focusing on instances of individual vocabulary words, it's difficult for a machine interpreter as well. + +Groupings of words, called _n-grams_ , can also be considered in NLP. A bigram considers groups of two adjacent words instead of (or in addition to) the single BoW. This should alleviate situations such as "not enjoying" above, but it will remain open to gaming due to its loss of contextual awareness. Furthermore, in the second sentence above, the sentiment context of the second half of the sentence could be perceived as negating the first half. Thus, spatial locality of contextual clues also can be lost in this approach. Complicating matters from a pragmatic perspective is the sparsity of features extracted from a given input text. For a thorough and large vocabulary, a count is maintained for each word, which can be considered an integer vector. Most documents will have a large number of zero counts in their vectors, which adds unnecessary space and time complexity to operations. While a number of clever approaches have been proposed for reducing this complexity, it remains an issue. + +### Word embeddings + +Word embeddings are a distributed representation that allows words with a similar meaning to have a similar representation. This is based on using a real-valued vector to represent words in connection with the company they keep, as it were. The focus is on the manner that words are used, as opposed to simply their existence. In addition, a huge pragmatic benefit of word embeddings is their focus on dense vectors; by moving away from a word-counting model with commensurate amounts of zero-valued vector elements, word embeddings provide a more efficient computational paradigm with respect to both time and storage. + +Following are two prominent word embedding approaches. + +#### Word2vec + +The first of these word embeddings, [Word2vec][6], was developed at Google. You'll probably see this embedding method mentioned as you go deeper in your study of NLP and sentiment analysis. It utilizes either a _continuous bag of words_ (CBOW) or a _continuous skip-gram_ model. In CBOW, a word's context is learned during training based on the words surrounding it. Continuous skip-gram learns the words that tend to surround a given word. Although this is more than what you'll probably need to tackle, if you're ever faced with having to generate your own word embeddings, the author of Word2vec advocates the CBOW method for speed and assessment of frequent words, while the skip-gram approach is better suited for embeddings where rare words are more important. + +#### GloVe + +The second word embedding, [_Global Vectors for Word Representation_][7] (GloVe), was developed at Stanford. It's an extension to the Word2vec method that attempts to combine the information gained through classical global text statistical feature extraction with the local contextual information determined by Word2vec. In practice, GloVe has outperformed Word2vec for some applications, while falling short of Word2vec's performance in others. Ultimately, the targeted dataset for your word embedding will dictate which method is optimal; as such, it's good to know the existence and high-level mechanics of each, as you'll likely come across them. + +#### Creating and using word embeddings + +Finally, it's useful to know how to obtain word embeddings; in part 2, you'll see that we are standing on the shoulders of giants, as it were, by leveraging the substantial work of others in the community. This is one method of acquiring a word embedding: namely, using an existing trained and proven model. Indeed, myriad models exist for English and other languages, and it's possible that one does what your application needs out of the box! + +If not, the opposite end of the spectrum in terms of development effort is training your own standalone model without consideration of your application. In essence, you would acquire substantial amounts of labeled training data and likely use one of the approaches above to train a model. Even then, you are still only at the point of acquiring understanding of your input-text data; you then need to develop a model specific for your application (e.g., analyzing sentiment valence in software version-control messages) which, in turn, requires its own time and effort. + +You also could train a word embedding on data specific to your application; while this could reduce time and effort, the word embedding would be application-specific, which would reduce reusability. + +### Available tooling options + +You may wonder how you'll ever get to a point of having a solution for your problem, given the intensive time and computing power needed. Indeed, the complexities of developing solid models can be daunting; however, there is good news: there are already many proven models, tools, and software libraries available that may provide much of what you need. We will focus on [Python][8], which conveniently has a plethora of tooling in place for these applications. + +#### SpaCy + +[SpaCy][9] provides a number of language models for parsing input text data and extracting features. It is highly optimized and touted as the fastest library of its kind. Best of all, it's open source! SpaCy performs tokenization, parts-of-speech classification, and dependency annotation. It contains word embedding models for performing this and other feature extraction operations for over 46 languages. You will see how it can be used for text analysis and feature extraction in the second article in this series. + +#### vaderSentiment + +The [vaderSentiment][10] package provides a measure of positive, negative, and neutral sentiment. As the [original paper][11]'s title ("VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Media Text") indicates, the models were developed and tuned specifically for social media text data. VADER was trained on a thorough set of human-labeled data, which included common emoticons, UTF-8 encoded emojis, and colloquial terms and abbreviations (e.g., meh, lol, sux). + +For given input text data, vaderSentiment returns a 3-tuple of polarity score percentages. It also provides a single scoring measure, referred to as _vaderSentiment's compound metric_. This is a real-valued measurement within the range **[-1, 1]** wherein sentiment is considered positive for values greater than **0.05** , negative for values less than **-0.05** , and neutral otherwise. + +In [part 2][2], you will learn how to use these tools to add sentiment analysis capabilities to your designs. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python + +作者:[Michael McCune ][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/elmiko/users/jschlessman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) +[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-2 +[3]: https://en.wikipedia.org/wiki/Bag-of-words_model +[4]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Term_frequency +[5]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Inverse_document_frequency +[6]: https://en.wikipedia.org/wiki/Word2vec +[7]: https://en.wikipedia.org/wiki/GloVe_(machine_learning) +[8]: https://www.python.org/ +[9]: https://pypi.org/project/spacy/ +[10]: https://pypi.org/project/vaderSentiment/ +[11]: http://comp.social.gatech.edu/papers/icwsm14.vader.hutto.pdf From b09ee31069d3a55f8efdd435a806aedb1add6727 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:14:35 +0800 Subject: [PATCH 0082/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190419=20This?= =?UTF-8?q?=20is=20how=20System76=20does=20open=20hardware=20sources/tech/?= =?UTF-8?q?20190419=20This=20is=20how=20System76=20does=20open=20hardware.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...This is how System76 does open hardware.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/tech/20190419 This is how System76 does open hardware.md diff --git a/sources/tech/20190419 This is how System76 does open hardware.md b/sources/tech/20190419 This is how System76 does open hardware.md new file mode 100644 index 0000000000..7f0ca3e479 --- /dev/null +++ b/sources/tech/20190419 This is how System76 does open hardware.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (This is how System76 does open hardware) +[#]: via: (https://opensource.com/article/19/4/system76-hardware) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +This is how System76 does open hardware +====== +What sets the new Thelio line of desktops apart from the rest. +![metrics and data shown on a computer screen][1] + +Most people know very little about the hardware in their computers. As a long-time Linux user, I've had my share of frustration while getting my wireless cards, video cards, displays, and other hardware working with my chosen distribution. Proprietary hardware often makes it difficult to determine why an Ethernet controller, wireless controller, or mouse performs differently than we expect. As Linux distributions have matured, this has become less of a problem, but we still see some quirks with touchpads and other peripherals, especially when we don't know much—if anything—about our underlying hardware. + +Companies like [System76][2] aim to take these types of problems out of the Linux user experience. System76 manufactures a line of Linux laptops, desktops, and servers, and even offers its own Linux distro, [Pop! OS][3], as an option for buyers, Recently I had the privilege of visiting System76's plant in Denver for [the unveiling][4] of [Thelio][5], its new desktop product line. + +### About Thelio + +System76 says Thelio's open hardware daughterboard, named Thelio Io after the fifth moon of Jupiter, is one thing that makes the computer unique in the marketplace. Thelio Io is certified [OSHWA #us000145][6] and has four SATA ports for storage and an embedded controller for fan and power button control. Thelio Io SAS is certified [OSHWA #us000146][7] and has four U.2 ports for storage and no embedded controller. During a demonstration, System76 showed how these components adjust fans throughout the chassis to optimize the unit's performance. + +The controller also runs the power button and the LED ring around the button, which glows at 100% brightness when it is pressed. This provides both tactile and visual confirmation that the unit is being powered on. While the computer is in use, the button is set to 35% brightness, and when it's in suspend mode, it pulses between 2.35% and 25%. When the computer is off, the LED remains dimly lit so that it's easy to find the power control in a dark room. + +Thelio's embedded controller is a low-power [ATmega32U4][8] microchip, and the controller's setup can be prototyped with an Arduino Micro. The number of Thelio Io boards changes depending on which Thelio model you purchase. + +Thelio is also perhaps the best-designed computer case and system I have ever seen. You'll probably agree if you have ever skinned your knuckles trying to operate inside a typical PC case. I have done this a number of times, and I have the scars to prove it. + +### Why open hardware? + +The boards were designed in [KiCAD][9], and you can access all of Thelio's design files under GPL on [GitHub][10]. So, why would a company that competes with other PC manufacturers design a unique interface then license it openly? It's because the company recognizes the value of open design and the ability to share and adjust an I/O board to your needs, even if you're a competitor in the marketplace. + +![Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.][11] + +Don Watkins speaks with System76 CEO Carl Richell at the [Thelio launch event][12]. + +I asked [Carl Richell][13], System76's founder and CEO, whether the company is concerned that openly licensing its hardware designs means someone could take its unique design and use it to drive System76 out of business. He said: + +> Open hardware benefits all of us. It's how we further advance technology and make it more available to everyone. We welcome anyone who wishes to improve on Thelio's design to do so. Opening the hardware not only helps advance improvements of our computers more quickly, but it also empowers our customers to truly own 100% of their device. Our goal is to remove as much proprietary functioning as we can, while still producing a competitive Linux computer for customers. +> +> We've been working with the Linux community for over 13 years to create a flawless and digestible experience on all of our laptops, desktops, and servers. Our long tenure serving the Linux community, providing our customers with a high level of service, and our personability are what makes System76 unique. + +I also asked Carl why open hardware makes sense for System76 and the PC business in general. He replied: + +> System76 was founded on the idea that technology should be open and accessible to everyone. We're not yet at the point where we can create a computer that is 100% open source, but with open hardware, we're one large, essential step closer to reaching that point. +> +> We live in an era where technology has become a utility. Computers are tools for people at every level of education and across many industries. With everyone's needs specific, each person has their own ideas on how they might improve the computer and its software as their primary tool. Having our computers open allows these ideas to come to fruition, which in turn makes the technology a more powerful tool. In an open environment, we constantly get to iterate a better PC. And that's kind of cool. + +We wrapped up our conversation by talking about System76's roadmap, which includes open hardware mini PCs and, eventually, laptops. Existing mini PCs and laptops sold under the System76 brand are manufactured by other vendors and are not based on open hardware (although their Linux software is, of course, open source). + +Designing and supporting open hardware is a game-changer in the PC business, and it is what sets System76's new Thelio line of desktop computers apart. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/system76-hardware + +作者:[Don Watkins ][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/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://system76.com/ +[3]: https://opensource.com/article/18/1/behind-scenes-popos-linux +[4]: /article/18/11/system76-thelio-desktop-computer +[5]: https://system76.com/desktops +[6]: https://certification.oshwa.org/us000145.html +[7]: https://certification.oshwa.org/us000146.html +[8]: https://www.microchip.com/wwwproducts/ATmega32u4 +[9]: http://kicad-pcb.org/ +[10]: https://github.com/system76/thelio-io +[11]: https://opensource.com/sites/default/files/uploads/don_system76_ceo.jpg (Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.) +[12]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-FKWFxFv +[13]: https://www.linkedin.com/in/carl-richell-9435781 From 44aa6eec02d658a39d82df83af8c9bf95f82091a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:14:49 +0800 Subject: [PATCH 0083/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20How?= =?UTF-8?q?=20to=20organize=20with=20Calculist:=20Ideas,=20events,=20and?= =?UTF-8?q?=20more=20sources/tech/20190418=20How=20to=20organize=20with=20?= =?UTF-8?q?Calculist-=20Ideas,=20events,=20and=20more.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...with Calculist- Ideas, events, and more.md | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md diff --git a/sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md b/sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md new file mode 100644 index 0000000000..7c9d844315 --- /dev/null +++ b/sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to organize with Calculist: Ideas, events, and more) +[#]: via: (https://opensource.com/article/19/4/organize-calculist) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +How to organize with Calculist: Ideas, events, and more +====== +Give structure to your ideas and plans with Calculist, an open source +web app for creating outlines. +![Team checklist][1] + +Thoughts. Ideas. Plans. We all have a few of them. Often, more than a few. And all of us want to make some or all of them a reality. + +Far too often, however, those thoughts and ideas and plans are a jumble inside our heads. They refuse to take a discernable shape, preferring instead to rattle around here, there, and everywhere in our brains. + +One solution to that problem is to put everything into [an outline][2]. An outline can be a great way to organize what you need to organize and give it the shape you need to take it to the next step. + +A number of people I know rely on a popular web-based tool called WorkFlowy for their outlining needs. If you prefer your applications (including web ones) to be open source, you'll want to take a look at [Calculist][3]. + +The brainchild of [Dan Allison][4], Calculist is billed as _the thinking tool for problem solvers_. It does much of what WorkFlowy does, and it has a few features that its rival is missing. + +Let's take a look at using Calculist to organize your ideas (and more). + +### Getting started + +If you have a server, you can try to [install Calculist][5] on it. If, like me, you don't have server or just don't have the technical chops, you can turn to the [hosted version][6] of Calculist. + +[Sign up][7] for a no-cost account, then log in. Once you've done that, you're ready to go. + +### Creating a basic outline + +What you use Calculist for really depends on your needs. I use Calculist to create outlines for articles and essays, to create lists of various sorts, and to plan projects. Regardless of what I'm doing, every outline I create follows the same pattern. + +To get started, click the **New List** button. This creates a blank outline (which Calculist calls a _list_ ). + +![Create a new list in Calculist][8] + +The outline is a blank slate waiting for you to fill it up. Give the outline a name, then press Enter. When you do that, Calculist adds the first blank line for your outline. Use that as your starting point. + +![A new outline in Calculist][9] + +Add a new line by pressing Enter. To indent a line, press the Tab key while on that line. If you need to create a hierarchy, you can indent lines as far as you need to indent them. Press Shift+Tab to outdent a line. + +Keep adding lines until you have a completed outline. Calculist saves your work every few seconds, so you don't need to worry about that. + +![Calculist outline][10] + +### Editing an outline + +Outlines are fluid. They morph. They grow and shrink. Individual items in an outline change. Calculist makes it easy for you to adapt and make those changes. + +You already know how to add an item to an outline. If you don't, go back a few paragraphs for a refresher. To edit text, click on an item and start typing. Don't double-click (more on this in a few moments). If you accidentally double-click on an item, press Esc on your keyboard and all will be well. + +Sometimes you need to move an item somewhere else in the outline. Do that by clicking and holding the bullet for that item. Drag the item and drop it wherever you want it. Anything indented below the item moves with it. + +At the moment, Calculist doesn't support adding notes or comments to an item in an outline. A simple workaround I use is to add a line indented one level deeper than the item where I want to add the note. That's not the most elegant solution, but it works. + +### Let your keyboard do the walking + +Not everyone likes to use their mouse to perform actions in an application. Like a good desktop application, you're not at the mercy of your mouse when you use Calculist. It has many keyboard shortcuts that you can use to move around your outlines and manipulate them. + +The keyboard shortcuts I mentioned a few paragraphs ago are just the beginning. There are a couple of dozen keyboard shortcuts that you can use. + +For example, you can focus on a single portion of an outline by pressing Ctrl+Right Arrow key. To get back to the full outline, press Ctrl+Left Arrow key. There are also shortcuts for moving up and down in your outline, expanding and collapsing lists, and deleting items. + +You can view the list of shortcuts by clicking on your user name in the upper-right corner of the Calculist window and clicking **Preferences**. You can also find a list of [keyboard shortcuts][11] in the Calculist GitHub repository. + +If you need or want to, you can change the shortcuts on the **Preferences** page. Click on the shortcut you want to change—you can, for example, change the shortcut for zooming in on an item to Ctrl+0. + +### The power of commands + +Calculist's keyboard shortcuts are useful, but they're only the beginning. The application has command mode that enables you to perform basic actions and do some interesting and complex tasks. + +To use a command, double-click an item in your outline or press Ctrl+Enter while on it. The item turns black. Type a letter or two, and a list of commands displays. Scroll down to find the command you want to use, then press Enter. There's also a [list of commands][12] in the Calculist GitHub repository. + +![Calclulist commands][13] + +The commands are quite comprehensive. While in command mode, you can, for example, delete an item in an outline or delete an entire outline. You can import or export outlines, sort and group items in an outline, or change the application's theme or font. + +### Final thoughts + +I've found that Calculist is a quick, easy, and flexible way to create and view outlines. It works equally well on my laptop and my phone, and it packs not only the features I regularly use but many others (including support for [LaTeX math expressions][14] and a [table/spreadsheet mode][15]) that more advanced users will find useful. + +That said, Calculist isn't for everyone. If you prefer your outlines on the desktop, then check out [TreeLine][16], [Leo][17], or [Emacs org-mode][18]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/organize-calculist + +作者:[Scott Nesbitt ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://en.wikipedia.org/wiki/Outline_(list) +[3]: https://calculist.io/ +[4]: https://danallison.github.io/ +[5]: https://github.com/calculist/calculist-web +[6]: https://app.calculist.io/ +[7]: https://app.calculist.io/join +[8]: https://opensource.com/sites/default/files/uploads/calculist-new-list.png (Create a new list in Calculist) +[9]: https://opensource.com/sites/default/files/uploads/calculist-getting-started.png (A new outline in Calculist) +[10]: https://opensource.com/sites/default/files/uploads/calculist-outline.png (Calculist outline) +[11]: https://github.com/calculist/calculist/wiki/Keyboard-Shortcuts +[12]: https://github.com/calculist/calculist/wiki/Command-Mode +[13]: https://opensource.com/sites/default/files/uploads/calculist-commands.png (Calculist commands) +[14]: https://github.com/calculist/calculist/wiki/LaTeX-Expressions +[15]: https://github.com/calculist/calculist/issues/32 +[16]: https://opensource.com/article/18/1/creating-outlines-treeline +[17]: http://www.leoeditor.com/ +[18]: https://orgmode.org/ From 70931abd23e3cd13367a787a0b0d5cfb91e3f96f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:14:59 +0800 Subject: [PATCH 0084/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Elec?= =?UTF-8?q?tronics=20designed=20in=205=20different=20countries=20with=20op?= =?UTF-8?q?en=20hardware=20sources/tech/20190418=20Electronics=20designed?= =?UTF-8?q?=20in=205=20different=20countries=20with=20open=20hardware.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... different countries with open hardware.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md diff --git a/sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md b/sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md new file mode 100644 index 0000000000..5c81f2d8bc --- /dev/null +++ b/sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Electronics designed in 5 different countries with open hardware) +[#]: via: (https://opensource.com/article/19/4/hardware-international) +[#]: author: (Michael Weinberg https://opensource.com/users/mweinberg) + +Electronics designed in 5 different countries with open hardware +====== +This month's open source hardware column looks at certified open +hardware from five countries that may surprise you. +![Gadgets and open hardware][1] + +The Open Source Hardware Association's [Hardware Registry][2] lists hardware from 29 different countries on five continents, demonstrating the broad, international footprint of certified open source hardware. + +![Open source hardware map][3] + +In some ways, this international reach shouldn't be a surprise. Like many other open source communities, the open source hardware community is built on top of the internet, not grounded in any specific geographical location. The focus on documentation, sharing, and openness makes it easy for people in different places with different backgrounds to connect and work together to develop new hardware. Even the community-developed open source hardware [definition][4] has been translated into 11 languages from the original English. + +Even if you're familiar with the international nature of open source hardware, it can still be refreshing to step back and remember what it means in practice. While it may not surprise you that there are many certifications from the United States, Germany, and India, some of the other countries boasting certifications might be a bit less expected. Let's look at six such projects from five of those countries. + +### Bulgaria + +Bulgaria may have the highest per-capita open source hardware certification rate of any country on earth. That distinction is mostly due to the work of two companies: [ANAVI Technology][5] and [Olimex][6]. + +ANAVI focuses mostly on IoT projects built on top of the Raspberry Pi and ESP8266. The concept of "creator contribution" means that these projects can be certified open source even though they are built upon non-open bases. That is because all of ANAVI's work to develop the hardware on top of these platforms (ANAVI's "creator contribution") has been open sourced in compliance with the certification requirements. + +The [ANAVI Light pHAT][7] was the first piece of Bulgarian hardware to be certified by OSHWA. The Light pHAT makes it easy to add a 12V RGB LED strip to a Raspberry Pi. + +![ANAVI-Light-pHAT][8] + +[ANAVI-Light-pHAT][9] + +Olimex's first OSHWA certification was for the [ESP32-PRO][10], a highly connectable IoT board built around an ESP32 microcontroller. + +![Olimex ESP32-PRO][11] + +[Olimex ESP32-PRO][12] + +### China + +While most people know China is a hotbed for hardware development, fewer realize that it is also the home to a thriving _open source_ hardware culture. One of the reasons is the tireless advocacy of Naomi Wu (also known as [SexyCyborg][13]). It is fitting that the first piece of certified hardware from China is one she helped develop: the [sino:bit][14]. The sino:bit is designed to help introduce students to programming and includes China-specific features like a LED matrix big enough to represent Chinese characters. + +![sino:bit][15] + +[ sino:bit][16] + +### Mexico + +Mexico has also produced a range of certified open source hardware. A recent certification is the [Meow Meow][17], a capacitive touch interface from [Electronic Cats][18]. Meow Meow makes it easy to use a wide range of objects—bananas are always a favorite—as controllers for your computer. + +![Meow Meow][19] + +[Meow Meow][20] + +### Saudi Arabia + +Saudi Arabia jumped into open source hardware earlier this year with the [M1 Rover][21]. The robot is an unmanned vehicle that you can build (and build upon). It is compatible with a number of different packages designed for specific purposes, so you can customize it for a wide range of applications. + +![M1-Rover ][22] + +[M1-Rover][23] + +### Sri Lanka + +This project from Sri Lanka is part of a larger effort to improve traffic flow in urban areas. The team behind the [Traffic Wave Disruptor][24] read research about how many traffic jams are caused by drivers slamming on their brakes when they drive too close to the car in front of them, producing a ripple of rapid breaking on the road behind them. This stop/start effect can be avoided if cars maintain a consistent, optimal distance from one another. If you reduce the stop/start pattern, you also reduce the number of traffic jams. + +![Traffic Wave Disruptor][25] + +[Traffic Wave Disruptor][26] + +But how can drivers know if they are keeping an optimal distance? The prototype Traffic Wave Disruptor aims to give drivers feedback when they fail to keep optimal spacing. Wider adoption could help increase traffic flow without building new highways nor reducing the number of cars using them. + +* * * + +You may have noticed that all the hardware featured here is based on electronics. In next month's open source hardware column, we will take a look at open source hardware for the outdoors, away from batteries and plugs. Until then, [certify][27] your open source hardware project (especially if your country is not yet on the registry). It might be featured in a future column. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/hardware-international + +作者:[Michael Weinberg][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/mweinberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openhardwaretools_0.png?itok=NUIvc-R1 (Gadgets and open hardware) +[2]: https://certification.oshwa.org/list.html +[3]: https://opensource.com/sites/default/files/uploads/opensourcehardwaremap.jpg (Open source hardware map) +[4]: https://www.oshwa.org/definition/ +[5]: http://anavi.technology/ +[6]: https://www.olimex.com/ +[7]: https://certification.oshwa.org/bg000001.html +[8]: https://opensource.com/sites/default/files/uploads/anavi-light-phat.png (ANAVI-Light-pHAT) +[9]: http://anavi.technology/#products +[10]: https://certification.oshwa.org/bg000010.html +[11]: https://opensource.com/sites/default/files/uploads/olimex-esp32-pro.png (Olimex ESP32-PRO) +[12]: https://www.olimex.com/Products/IoT/ESP32/ESP32-PRO/open-source-hardware +[13]: https://www.youtube.com/channel/UCh_ugKacslKhsGGdXP0cRRA +[14]: https://certification.oshwa.org/cn000001.html +[15]: https://opensource.com/sites/default/files/uploads/sinobit.png (sino:bit) +[16]: https://github.com/sinobitorg/hardware +[17]: https://certification.oshwa.org/mx000003.html +[18]: https://electroniccats.com/ +[19]: https://opensource.com/sites/default/files/uploads/meowmeow.png (Meow Meow) +[20]: https://electroniccats.com/producto/meowmeow/ +[21]: https://certification.oshwa.org/sa000001.html +[22]: https://opensource.com/sites/default/files/uploads/m1-rover.png (M1-Rover ) +[23]: https://www.hackster.io/AhmedAzouz/m1-rover-362c05 +[24]: https://certification.oshwa.org/lk000001.html +[25]: https://opensource.com/sites/default/files/uploads/traffic-wave-disruptor.png (Traffic Wave Disruptor) +[26]: https://github.com/Aightm8/Traffic-wave-disruptor +[27]: https://certification.oshwa.org/ From 3758bd69e6d508c987e19c9436494aee0b4886bf Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:15:11 +0800 Subject: [PATCH 0085/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Leve?= =?UTF-8?q?l=20up=20command-line=20playgrounds=20with=20WebAssembly=20sour?= =?UTF-8?q?ces/tech/20190418=20Level=20up=20command-line=20playgrounds=20w?= =?UTF-8?q?ith=20WebAssembly.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...mmand-line playgrounds with WebAssembly.md | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md diff --git a/sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md b/sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md new file mode 100644 index 0000000000..411adc44fa --- /dev/null +++ b/sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md @@ -0,0 +1,196 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Level up command-line playgrounds with WebAssembly) +[#]: via: (https://opensource.com/article/19/4/command-line-playgrounds-webassembly) +[#]: author: (Robert Aboukhalil https://opensource.com/users/robertaboukhalil) + +Level up command-line playgrounds with WebAssembly +====== +WebAssembly is a powerful tool for bringing command line utilities to +the web and giving people the chance to tinker with tools. +![Various programming languages in use][1] + +[WebAssembly][2] (Wasm) is a new low-level language designed with the web in mind. Its main goal is to enable developers to compile code written in other languages—such as C, C++, and Rust—into WebAssembly and run that code in the browser. In an environment where JavaScript has traditionally been the only option, WebAssembly is an appealing counterpart, and it enables portability along with the promise for near-native runtimes. WebAssembly has also already been used to port lots of tools to the web, including [desktop applications][3], [games][4], and even [data science tools written in Python][5]! + +Another application of WebAssembly is command line playgrounds, where users are free to play with a simulated version of a command line tool. In this article, we'll explore a concrete example of leveraging WebAssembly for this purpose, specifically to port the tool **[jq][6]** —which is normally confined to the command line—to run directly in the browser. + +If you haven't heard, jq is a very powerful command line tool for querying, modifying, and wrangling JSON objects on the command line. + +### Why WebAssembly? + +Aside from WebAssembly, there are two other approaches we can take to build a jq playground: + + 1. **Set up a sandboxed environment** on your server that executes queries and returns the result to the user via API calls. Although this means your users get to play with the real thing, the thought of hosting, securing, and sanitizing user inputs for such an application is worrisome. Aside from security, the other concern is responsiveness; the additional round trips to the server can introduce noticeable latencies and negatively impact the user experience. + 2. **Simulate the command line environment using JavaScript** , where you define a series of steps that the user can take. Although this approach is more secure than option 1, it involves _a lot_ more work, as you need to rewrite the logic of the tool in JavaScript. This method is also limiting: when I'm learning a new tool, I'm not just interested in the "happy path"; I want to break things! + + + +These two solutions are not ideal because we have to choose between security and a meaningful learning experience. Ideally, we could simply run the command line tool directly in the browser, with no servers and no simulations. Lucky for us, WebAssembly is just the solution we need to achieve that. + +### Set up your environment + +In this article, we'll use the [Emscripten tool][7] to port jq from C to WebAssembly. Conveniently, it provides us with drop-in replacements for the most common C/C++ build tools, including gcc, make, and configure. + +Instead of [installing Emscripten from scratch][8] (the build process can take a long time), we'll use a Docker image I put together that comes prepackaged with everything you'll need for this article (and beyond!). + +Let's start by pulling the image and creating a container from it: + + +``` +# Fetch docker image containing Emscripten +docker pull robertaboukhalil/emsdk:1.38.26 + +# Create container from that image +docker run -dt --name wasm robertaboukhalil/emsdk:1.38.26 + +# Enter the container +docker exec -it wasm bash + +# Make sure we can run emcc, Emscripten's wrapper around gcc +emcc --version +``` + +If you see the Emscripten version on the screen, you're good to go! + +### Porting jq to WebAssembly + +Next, let's clone the jq repository: + + +``` +git clone +cd jq +git checkout 9fa2e51 +``` + +Note that we're checking out a specific commit, just in case the jq code changes significantly after this article is published. + +Before we compile jq to WebAssembly, let's first consider how we would normally compile jq to binary for use on the command line. + +From the [README file][9], here is what we need to build jq to binary (don't type this in yet): + + +``` +# Fetch jq dependencies +git submodule update --init + +# Generate ./configure file +autoreconf -fi + +# Run ./configure +./configure \ +\--with-oniguruma=builtin \ +\--disable-maintainer-mode + +# Build jq executable +make LDFLAGS=-all-static +``` + +Instead, to compile jq to WebAssembly, we'll leverage Emscripten's drop-in replacements for the configure and make build tools (note the differences here from the previous entry: **emconfigure** and **emmake** in the Run and Build statements, respectively): + + +``` +# Fetch jq dependencies +git submodule update --init + +# Generate ./configure file +autoreconf -fi + +# Run ./configure +emconfigure ./configure \ +\--with-oniguruma=builtin \ +\--disable-maintainer-mode + +# Build jq executable +emmake make LDFLAGS=-all-static +``` + +If you type the commands above inside the Wasm container we created earlier, you'll notice that emconfigure and emmake will make sure jq is compiled using emcc instead of gcc (Emscripten also has a g++ replacement called em++). + +So far, this was surprisingly easy: we just prepended a handful of commands with Emscripten tools and ported a codebase—comprising tens of thousands of lines—from C to WebAssembly. Note that it won't always be this easy, especially for more complex codebases and graphical applications, but that's for [another article][10]. + +Another advantage of Emscripten is that it can generate some JavaScript glue code for us that handles initializing the WebAssembly module, calling C functions from JavaScript, and even providing a [virtual filesystem][11]. + +Let's generate that glue code from the executable file jq that emmake outputs: + + +``` +# But first, rename the jq executable to a .o file; otherwise, +# emcc complains that the "file has an unknown suffix" +mv jq jq.o + +# Generate .js and .wasm files from jq.o +# Disable errors on undefined symbols to avoid warnings about llvm_fma_f64 +emcc jq.o -o jq.js \ +-s ERROR_ON_UNDEFINED_SYMBOLS=0 +``` + +To make sure it works, let's try an example from the [jq tutorial][12] directly on the command line: + + +``` +# Output the description of the latest commit on the jq repo +$ curl -s "" | \ +node jq.js '.[0].commit.message' +"Restore cfunction arity in builtins/0\n\nCount arguments up-front at definition/invocation instead of doing it at\nbind time, which comes after generating builtins/0 since e843a4f" +``` + +And just like that, we are now ready to run jq in the browser! + +### The result + +Using the output of emcc above, we can put together a user interface that calls jq on a JSON blob the user provides. This is the approach I took to build [jqkungfu][13] (source code [available on GitHub][14]): + +![jqkungfu screenshot][15] + +jqkungfu, a playground built by compiling jq to WebAssembly + +Although there are similar web apps that let you execute arbitrary jq queries in the browser, they are generally implemented as server-side applications that execute user queries in a sandbox (option #1 above). + +Instead, by compiling jq from C to WebAssembly, we get the best of both worlds: the flexibility of the server and the security of the browser. Specifically, the benefits are: + + 1. **Flexibility** : Users can "choose their own adventure" and use the app with fewer limitations + 2. **Speed** : Once the Wasm module is loaded, executing queries is extremely fast because all the magic happens in the browser + 3. **Security** : No backend means we don't have to worry about our servers being compromised or used to mine Bitcoins + 4. **Convenience** : Since we don't need a backend, jqkungfu is simply hosted as static files on a cloud storage platform + + + +### Conclusion + +WebAssembly is a powerful tool for bringing existing command line utilities to the web. When included as part of a tutorial, such playgrounds can become powerful teaching tools. They can even allow your users to test-drive your tool before they bother installing it. + +If you want to dive further into WebAssembly and learn how to build applications like jqkungfu (or games like Pacman!), check out my book [_Level up with WebAssembly_][16]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/command-line-playgrounds-webassembly + +作者:[Robert Aboukhalil][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/robertaboukhalil +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_language_c.png?itok=mPwqDAD9 (Various programming languages in use) +[2]: https://webassembly.org/ +[3]: https://www.figma.com/blog/webassembly-cut-figmas-load-time-by-3x/ +[4]: http://www.continuation-labs.com/projects/d3wasm/ +[5]: https://hacks.mozilla.org/2019/03/iodide-an-experimental-tool-for-scientific-communicatiodide-for-scientific-communication-exploration-on-the-web/ +[6]: https://stedolan.github.io/jq/ +[7]: https://emscripten.org/ +[8]: https://emscripten.org/docs/getting_started/downloads.html +[9]: https://github.com/stedolan/jq/blob/9fa2e51099c55af56e3e541dc4b399f11de74abe/README.md +[10]: https://medium.com/@robaboukhalil/porting-games-to-the-web-with-webassembly-70d598e1a3ec?sk=20c835664031227eae5690b8a12514f0 +[11]: https://emscripten.org/docs/porting/files/file_systems_overview.html +[12]: https://stedolan.github.io/jq/tutorial/ +[13]: http://jqkungfu.com +[14]: https://github.com/robertaboukhalil/jqkungfu/ +[15]: https://opensource.com/sites/default/files/uploads/jqkungfu.gif (jqkungfu screenshot) +[16]: http://levelupwasm.com/ From a1975bb3fe887c458d942c6e05423e62ffb6e1c9 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:15:25 +0800 Subject: [PATCH 0086/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Simp?= =?UTF-8?q?lifying=20organizational=20change:=20A=20guide=20for=20the=20pe?= =?UTF-8?q?rplexed=20sources/tech/20190418=20Simplifying=20organizational?= =?UTF-8?q?=20change-=20A=20guide=20for=20the=20perplexed.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ional change- A guide for the perplexed.md | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md diff --git a/sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md b/sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md new file mode 100644 index 0000000000..e9fa0cb7fd --- /dev/null +++ b/sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md @@ -0,0 +1,167 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Simplifying organizational change: A guide for the perplexed) +[#]: via: (https://opensource.com/open-organization/19/4/simplifying-change) +[#]: author: (Jen Kelchner https://opensource.com/users/jenkelchner) + +Simplifying organizational change: A guide for the perplexed +====== +Here's a 4-step, open process for making change easier—both for you and +your organization. +![][1] + +Most organizational leaders have encountered a certain paralysis around efforts to implement culture change—perhaps because of perceived difficulty or the time necessary for realizing our work. But change is only as difficult as we choose to make it. In order to lead successful change efforts, we must simplify our understanding and approach to change. + +Change isn't something rare. We live everyday life in a continuous state of change—from grappling with the speed of innovation to simply interacting with the environment around us. Quite simply, *change is how we process, disseminate, and adopt new information. *And whether you're leading a team or an organization—or are simply breathing—you'll benefit from a more focused, simplified approach to change. Here's a process that can save you time and reduce frustration. + +### Three interactions with change + +Everyone interacts with change in different ways. Those differences are based on who we are, our own unique experiences, and our core beliefs. In fact, [only 5% of decision making involves conscious processing][2]. Even when you don't _think_ you're making a decision, you are actually making a decision (that is, to not take action). + +So you see, two actors are at play in situations involving change. The first is the human decision maker. The second is the information _coming to_ the decision maker. Both are present in three sets of interactions at varying stages in the decision-making process. + +#### **Engaging change** + +First, we must understand that uncertainty is really the result of "new information" we must process. We must accept where we are, at that moment, while waiting for additional information. Engaging with change requires us to trust—at the very least, ourselves and our capacity to manage—as new information continues to arrive. Everyone will respond to new information differently, and those responses are based on multiple factors: general hardwiring, unconscious needs that need to be met to feel safe, and so on. How do you feel safe in periods of uncertainty? Are you routine driven? Do you need details or need to assess risk? Are you good with figuring it out on the fly? Or does safety feel like creating something brand new? + +#### **Navigating change** + +"Navigating" doesn't necessarily mean "going around" something safely. It's knowing how to "get through it." Navigating change truly requires "all hands on deck" in order to keep everything intact and moving forward as we encounter each oncoming wave of new information. Everyone around you has something to contribute to the process of navigation; leverage them for “smooth sailing." + +#### **Adopting change** + +Only a small set of members in your organization will be truly comfortable with adopting change. But that committed and confident minority can spread the fire of change and help you grow some innovative ideas within your organization. Consider taking advantage of what researchers call "[the pendulum effect][3]," which holds that a group as small as 5% of an organization's population can influence a crowd's direction (the other 95% will follow along without realizing it). Moreover, [scientists at Rensselaer Polytechnic Institute have found][4] that when just 10% of a population holds an unshakable belief, that belief will always be adopted by a majority. Findings from this cognitive study have implications for the spread of innovations and movements within a collective group of people. Opportunities for mass adoption are directly related to your influence with the external parties around you. + +Everyone interacts with change in different ways. Those differences are based on who we are, our own unique experiences, and our core beliefs. + +### A useful matrix to guide culture change + +So far, we've identified three "interactions" every person, team, or department will experience with change: "engaging," "navigating," and "adopting." When we examine the work of _implementing_ change in the broader context of an organization (any kind), we can also identify _three relationships_ that drive the success of each interaction: "people," "capacity," and "information." + +Here's a brief list of considerations you should make—at every moment and with every relationship—to help you build roadmaps thoughtfully. + +#### **Engaging—People** + +Organizational success comes from the overlap of awareness and action of the "I" and the "We." + + * _Individuals (I)_ are aware of and engage based on their [natural response strength][5]. + * _Teams (We)_ are aware of and balance their responsibilities based on the Individual strengths by initiative. + * _Leaders (I/We) l_ everage insight based on knowing their (I) and the collective (We). + + + +#### **Engaging—Capacity** + +"Capacity" applies to skills, processes, and culture that is clearly structured, documented, and accessible with your organization. It is the “space” within which you operate and achieve solutions. + + * _Current state_ awareness allows you to use what and who you have available and accessible through your known operational capacity. + * _Future state_ needs will show you what is required of you to learn, _or stretch_ , in order to bridge any gaps; essentially, you will design the recoding of your organization. + + + +#### **Engaging—Information** + + * _Access to information_ is readily available to all based on appropriate needs within protocols. + * _Communication flows_ easily and is reciprocated at all levels. + * _Communication flow_ is timely and transparent. + + + +#### **Navigating—People** + + * Balance responses from both individuals and the collective will impact your outcomes. + * Balance the _I_ with the _We_. This allows for responses to co-exist in a seamless, collaborative way—which fuels every project. + + + +#### **Navigating—Capacity** + + * _Skills_ : Assuring a continuous state of assessment and learning through various modalities allows you to navigate with ease as each person graduates their understanding in preparation for the next iteration of change. + * _Culture:_ Be clear on goals and mission with a supported ecosystem in which your teams can operate by contributing their best efforts when working together. + * _Processes:_ Review existing processes and let go of anything that prevents you from evolving. Open practices and methodologies do allow for a higher rate of adaptability and decision making. + * _Utilize Talent:_ Discover who is already in your organization and how you can leverage their talent in new ways. Go beyond your known teams and seek out sources of new perspectives. + + + +#### **Navigating—Information** + + * Be clear on your mission. + * Be very clear on your desired endgame so everyone knows what you are navigating toward (without clearly defined and posted directions, it's easy to waste time, money and efforts resulting in missed targets). + + + +#### **Adopting—People** + + * _Behaviors_ have a critical impact on influence and adoption. + * For _internal adoption_ , consider the [pendulum of thought][3] swung by the committed few. + + + +#### **Adopting—Capacity** + + * _Sustainability:_ Leverage people who are more routine and legacy-oriented to help stabilize and embed your new initiatives. + * Allows your innovators and co-creators to move into the next phase of development and begin solving problems while other team members can perform follow-through efforts. + + + +#### **Adopting—Information** + + * Be open and transparent with your external communication. + * Lead the way in _what_ you do and _how_ you do it to create a tidal wave of change. + * Remember that mass adoption has a tipping point of 10%. + + + +[**Download a one-page guide to this model on GitHub.**][6] +--- + +### Four steps to simplify change + +You now understand what change is and how you are processing it. You've seen how you and your organization can reframe various interactions with it. Now, let's examine the four steps to simplify how you interact with and implement change as an individual, team leader, or organizational executive. + +#### **1\. Understand change** + +Change is receiving and processing new information and determining how to respond and participate with it (think personal or organizational operating system). Change is a _reciprocal_ action between yourself and incoming new information (think system interface). Change is an evolutionary process that happens in layers and stages in a continuous cycle (think data processing, bug fixes, and program iterations). + +#### **2\. Know your people** + +Change is personal and responses vary by context. People's responses to change are not indicators of the speed of adoption. Knowing how your people and your teams interact with change allows you to balance and optimize your efforts to solving problems, building solutions and sustaining implementations. Are they change makers, fast followers, innovators, stabilizers? When you know how you, _or others_ , process change, you can leverage your risk mitigators to sweep for potential pitfalls; and, your routine minded folks to be responsible for implementation follow through. + +Only a small set of members in your organization will be truly comfortable with adopting change. But that committed and confident minority can spread the fire of change and help you grow some innovative ideas within your organization. + +#### **3\. Know your capacity** + +Your capacity to implement widespread change will depend on your culture, your processes, and decision-making models. Get familiar with your operational capacity and guardrails (process and policy). + +#### **4\. Prepare for Interaction** + +Each interaction uses your people, capacity (operational), and information flow. Working with the stages of change is not always a linear process and may overlap at certain points along the way. Understand that [_people_ feed all engagement, navigation, and adoption actions][7]. + +Humans are built for adaptation to our environments. Yes, any kind of change can be scary at first. But it need not involve some major new implementation with a large, looming deadline that throws you off. Knowing that you can take a simplified approach to change, hopefully, you're able to engage new information with ease. Using this approach over time—and integrating it as habit—allows for both the _I_ and the _We_ to experience continuous cycles of change without the tensions of old. + +_Want to learn more about simplifying change?[View additional resources on GitHub][8]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/4/simplifying-change + +作者:[Jen Kelchner][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/jenkelchner +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/GOV_2dot0.png?itok=bKJ41T85 +[2]: http://www.simplifyinginterfaces.com/2008/08/01/95-percent-of-brain-activity-is-beyond-our-conscious-awareness/ +[3]: http://www.leeds.ac.uk/news/article/397/sheep_in_human_clothing__scientists_reveal_our_flock_mentality +[4]: https://news.rpi.edu/luwakkey/2902 +[5]: https://opensource.com/open-organization/18/7/transformation-beyond-digital-2 +[6]: https://github.com/jenkelchner/simplifying-change/blob/master/Visual_%20Simplifying%20Change%20(1).pdf +[7]: https://opensource.com/open-organization/17/7/digital-transformation-people-1 +[8]: https://github.com/jenkelchner/simplifying-change From a4101e0540db636d2b96c4bff21fd27f0d22f237 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:15:51 +0800 Subject: [PATCH 0087/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20How?= =?UTF-8?q?=20to=20use=20Ansible=20to=20document=20procedures=20sources/te?= =?UTF-8?q?ch/20190417=20How=20to=20use=20Ansible=20to=20document=20proced?= =?UTF-8?q?ures.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w to use Ansible to document procedures.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/tech/20190417 How to use Ansible to document procedures.md diff --git a/sources/tech/20190417 How to use Ansible to document procedures.md b/sources/tech/20190417 How to use Ansible to document procedures.md new file mode 100644 index 0000000000..51eddfe92c --- /dev/null +++ b/sources/tech/20190417 How to use Ansible to document procedures.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use Ansible to document procedures) +[#]: via: (https://opensource.com/article/19/4/ansible-procedures) +[#]: author: (Marco Bravo https://opensource.com/users/marcobravo/users/shawnhcorey/users/marcobravo) + +How to use Ansible to document procedures +====== +In Ansible, the documentation is the playbook, so the documentation +naturally evolves alongside the code +![][1] + +> "Documentation is a love letter that you write to your future self." —[Damian Conway][2] + +I use [Ansible][3] as my personal notebook for documenting coding procedures—both the ones I use often and the ones I rarely use. This process facilitates my work and reduces the time it takes to do repetitive tasks, the ones where specific commands in a certain sequence are executed to accomplish a specific result. + +By documenting with Ansible, I don't need to memorize all the parameters for each command or all the steps involved with a specific procedure, and it's easy to share the details with my teammates. + +Traditional approaches for documentation, like wikis or shared drives, are useful for general documents, but inevitably they become outdated and can't keep pace with the rapid changes in infrastructure and environments. For specific procedures, it's better to document directly into the code using a tool like Ansible. + +### Ansible's advantages + +Before we begin, let's recap some basic Ansible concepts: a _playbook_ is a high-level organization of procedures using plays; _plays_ are specific procedures for a group of hosts; _tasks_ are specific actions, _modules_ are units of code, and _inventory_ is a list of managed nodes. + +Ansible's great advantage is that the documentation is the playbook itself, so it evolves with and is contained inside the code. This is not only useful; it's also practical because, more than just documenting solutions with Ansible, you're also coding a playbook that permits you to write your procedures and commands, reproduce them, and automate them. This way, you can look back in six months and be able to quickly understand and execute them again. + +It's true that this way of resolving problems could take more time at first, but it will definitely save a lot of time in the long term. By being courageous and disciplined to adopt these new habits, you will improve your skills in each iteration. + +Following are some other important elements and support tools that will facilitate your process. + +### Use source code control + +> "First do it, then do it right, then do it better." —[Addy Osmani][4] + +When working with Ansible playbooks, it's very important to implement a playbook-as-code strategy. A good way to accomplish this is to use a source code control repository that will permit to you start with a simple solution and iterate to improve it. + +A source code control repository provides many advantages as you collaborate with other developers, restore previous versions, and back up your work. But in creating documentation, its main advantages are that you get traceability about what are you doing and can iterate around small changes to improve your work. + +The most popular source control system is [Git][5], but there are [others][6] like [Subversion][7], [Bazaar][8], [BitKeeper][9], and [Mercurial][10]. + +### Keep idempotency in mind + +In infrastructure automation, idempotency means to reach a specific end state that remains the same, no matter how many times the process is executed. So when you are preparing to automate your procedures, keep the desired result in mind and write scripts and commands that will achieve them consistently. + +This concept exists in most Ansible modules because after you specify the desired final state, Ansible will accomplish it. For instance, there are modules for creating filesystems, modifying iptables, and managing cron entries. All of these modules are idempotent by default, so you should give them preference. + +If you are using some of the lower-level modules, like command or shell, or developing your own modules, be careful to write code that will be idempotent and safe to repeat many times to get the same result. + +The idempotency concept is important when you prepare procedures for automation because it permits you to evaluate several scenarios and incorporate the ones that will make your code safer and create an abstraction level that points to the desired result. + +### Test it! + +Testing your deployment workflow creates fewer surprises when your code arrives in production. Ansible's belief that you shouldn't need another framework to validate basic things in your infrastructure is true. But your focus should be on application testing, not infrastructure testing. + +Ansible's documentation offers several [testing strategies for your procedures][11]. For testing Ansible playbooks, you can use [Molecule][12], which is designed to aid in the development and testing of Ansible roles. Molecule supports testing with multiple instances, operating systems/distributions, virtualization providers, test frameworks, and testing scenarios. This means Molecule will run through all the testing steps: linting verifications, checking playbook syntax, building Docker environments, running playbooks against Docker environments, running the playbook again to verify idempotence, and cleaning everything up afterward. [Testing Ansible roles with Molecule][13] is a good introduction to Molecule. + +### Run it! + +Running Ansible playbooks can create logs that are formatted in an unfriendly and difficult-to-read way. In those cases, the Ansible Run Analysis (ARA) is a great complementary tool for running Ansible playbooks, as it provides an intuitive interface to browse them. Read [Analyzing Ansible runs using ARA][14] for more information. + +Remember to protect your passwords and other sensitive information with [Ansible Vault][15]. Vault can encrypt binary files, **group_vars** , **host_vars** , **include_vars** , and **var_files**. But this encrypted data is exposed when you run a playbook in **-v** (verbose) mode, so it's a good idea to combine it with the keyword **no_log** set to **true** to hide any task's information, as it indicates that the value of the argument should not be logged or displayed. + +### A basic example + +Do you need to connect to a server to produce a report file and copy the file to another server? Or do you need a lot of specific parameters to connect? Maybe you're not sure where to store the parameters. Or are your procedures are taking a long time because you need to collect all the parameters from several sources? + +Suppose you have a network topology with some restrictions and you need to copy a file from a server that you can access ( **server1** ) to another server that is managed by a third party ( **server2** ). The parameters to connect are: + + +``` +Source server: server1 +Target server: server2 +Port: 2202 +User: transfers +SSH Key: transfers_key +File to copy: file.log +Remote directory: /logs/server1/ +``` + +In this scenario, you need to connect to **server1** and copy the file using these parameters. You can accomplish this using a one-line command: + + +``` +`ssh server1 "scp -P 2202 -oUser=transfers -i ~/.ssh/transfers_key file.log server2:/logs/server1/"` +``` + +Now your playbook can do the procedure. + +### Useful combinations + +If you produce a lot of Ansible playbooks, you can organize all your procedures with other tools like [AWX][16] (Ansible Works Project), which provides a web-based user interface, a REST API, and a task engine built on top of Ansible so that users can better control their Ansible project use in IT environments. + +Other interesting combinations are Ansible with [Rundeck][17], which provides procedures as self-service jobs, and [Jenkins][18] for continuous integration and continuous delivery processes. + +### Conclusion + +I hope that these tips for using Ansible will help you improve your automation processes, coding, and documentation. If you have more interest, dive in and learn more. And I would like to hear your ideas or questions, so please share them in the comments below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/ansible-procedures + +作者:[Marco Bravo][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/marcobravo/users/shawnhcorey/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 +[2]: https://en.wikipedia.org/wiki/Damian_Conway +[3]: https://www.ansible.com/ +[4]: https://addyosmani.com/ +[5]: https://git-scm.com/ +[6]: https://en.wikipedia.org/wiki/Comparison_of_version_control_software +[7]: https://subversion.apache.org/ +[8]: https://bazaar.canonical.com/en/ +[9]: https://www.bitkeeper.org/ +[10]: https://www.mercurial-scm.org/ +[11]: https://docs.ansible.com/ansible/latest/reference_appendices/test_strategies.html +[12]: https://molecule.readthedocs.io/en/latest/ +[13]: https://opensource.com/article/18/12/testing-ansible-roles-molecule +[14]: https://opensource.com/article/18/5/analyzing-ansible-runs-using-ara +[15]: https://docs.ansible.com/ansible/latest/user_guide/vault.html +[16]: https://github.com/ansible/awx +[17]: https://www.rundeck.com/ansible +[18]: https://www.redhat.com/en/blog/integrating-ansible-jenkins-cicd-process From 760e7a79e9dfa34ede383c6e320a354d1baa0720 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 12:31:17 +0800 Subject: [PATCH 0088/1154] PRF:20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @zgj1024 --- ...TP Client For Curl And Wget Alternative.md | 94 ++++++++++--------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md index a05948c9af..0592564464 100644 --- a/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md +++ b/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -1,38 +1,37 @@ [#]: collector: (lujun9972) [#]: translator: (zgj1024) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative) [#]: via: (https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -HTTPie – 替代 Curl 和 Wget 的现代 HTTP 命令行客户端 +HTTPie:替代 Curl 和 Wget 的现代 HTTP 命令行客户端 ====== -大多数时间我们会使用 Curl 命令或是 Wget 命令下载文件或者做其他事 +大多数时间我们会使用 `curl` 命令或是 `wget` 命令下载文件或者做其他事。 -我们以前曾写过 **[最佳命令行下载管理器][1]** 的文章。你可以点击相应的 URL 连接来浏览这些文章。 +我们以前曾写过 [最佳命令行下载管理器][1] 的文章。你可以点击相应的 URL 连接来浏览这些文章。 - * **[aria2 – Linux 下的多协议命令行下载工具][2]** - * **[Axel – Linux 下的轻量级命令行下载加速器][3]** - * **[Wget – Linux 下的标准命令行下载工具][4]** - * **[curl – Linux 下的实用的命令行下载工具][5]** +* [aria2 – Linux 下的多协议命令行下载工具][2] +* [Axel – Linux 下的轻量级命令行下载加速器][3] +* [Wget – Linux 下的标准命令行下载工具][4] +* [curl – Linux 下的实用的命令行下载工具][5] +今天我们将讨论同样的话题。这个实用程序名为 HTTPie。 -今天我们将讨论同样的话题。实用程序名为 HTTPie。 - -它是现代命令行 http 客户端,也是curl和wget命令的最佳替代品。 +它是现代命令行 http 客户端,也是 `curl` 和 `wget` 命令的最佳替代品。 ### 什么是 HTTPie? -HTTPie (发音是 aitch-tee-tee-pie) 是一个 Http 命令行客户端。 +HTTPie (发音是 aitch-tee-tee-pie) 是一个 HTTP 命令行客户端。 -httpie 工具是现代命令的 HTTP 客户端,它能让命令行界面与 Web 服务进行交互。 +HTTPie 工具是现代的 HTTP 命令行客户端,它能通过命令行界面与 Web 服务进行交互。 -他提供一个简单 Http 命令,运行使用简单而自然的语法发送任意的 HTTP 请求,并会显示彩色的输出。 +它提供一个简单的 `http` 命令,允许使用简单而自然的语法发送任意的 HTTP 请求,并会显示彩色的输出。 -HTTPie 能用于测试、debugging及与 HTTP 服务器交互。 +HTTPie 能用于测试、调试及与 HTTP 服务器交互。 ### 主要特点 @@ -40,50 +39,52 @@ HTTPie 能用于测试、debugging及与 HTTP 服务器交互。 * 格式化的及彩色化的终端输出 * 内置 JSON 支持 * 表单和文件上传 - * HTTPS, 代理, 和认证 + * HTTPS、代理和认证 * 任意请求数据 * 自定义头部 - * 持久化会话(sessions) - * 类似 wget 的下载 + * 持久化会话 + * 类似 `wget` 的下载 * 支持 Python 2.7 和 3.x ### 在 Linux 下如何安装 HTTPie 大部分 Linux 发行版都提供了系统包管理器,可以用它来安装。 -**`Fedora`** 系统,使用 **[DNF 命令][6]** 来安装 httpie +Fedora 系统,使用 [DNF 命令][6] 来安装 httpie: ``` $ sudo dnf install httpie ``` -**`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][7]** 或 **[APT 命令][8]** 来安装 httpie。 +Debian/Ubuntu 系统,使用 [APT-GET 命令][7] 或 [APT 命令][8] 来安装 HTTPie。 ``` $ sudo apt install httpie ``` -基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][9]** 来安装 httpie。 +基于 Arch Linux 的系统,使用 [Pacman 命令][9] 来安装 HTTPie。 ``` $ sudo pacman -S httpie ``` -**`RHEL/CentOS`** 的系统, 使用 **[YUM 命令][10]** 来安装 httpie。 +RHEL/CentOS 的系统,使用 [YUM 命令][10] 来安装 HTTPie。 ``` $ sudo yum install httpie ``` -**`openSUSE Leap`** 系统, 使用 **[Zypper 命令][11]** 来安装 httpie。 +openSUSE Leap 系统,使用 [Zypper 命令][11] 来安装 HTTPie。 ``` $ sudo zypper install httpie ``` -### 1) 如何使用 HTTPie 请求URL? +### 用法 -httpie 的基本用法是将网站的 URL 作为参数。 +#### 如何使用 HTTPie 请求 URL? + +HTTPie 的基本用法是将网站的 URL 作为参数。 ``` # http 2daygeek.com @@ -99,9 +100,9 @@ Transfer-Encoding: chunked Vary: Accept-Encoding ``` -### 2) 如何使用 HTTPie 下载文件 +#### 如何使用 HTTPie 下载文件 -你可以使用带 `--download` 参数的 HTTPie 命令下载文件。类似于 wget 命令。 +你可以使用带 `--download` 参数的 HTTPie 命令下载文件。类似于 `wget` 命令。 ``` # http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png @@ -148,10 +149,11 @@ Vary: Accept-Encoding Downloading 31.31 kB to "Anbox-1.png" Done. 31.31 kB in 0.01551s (1.97 MB/s) ``` -如何使用HTTPie恢复部分下载? -### 3) 如何使用 HTTPie 恢复部分下载? + +#### 如何使用 HTTPie 恢复部分下载? 你可以使用带 `-c` 参数的 HTTPie 继续下载。 + ``` # http --download --continue https://speed.hetzner.de/100MB.bin -o 100MB.bin HTTP/1.1 206 Partial Content @@ -169,24 +171,24 @@ Downloading 100.00 MB to "100MB.bin" | 24.14 % 24.14 MB 1.12 MB/s 0:01:07 ETA^C ``` -你根据下面的输出验证是否同一个文件 +你根据下面的输出验证是否同一个文件: + ``` [email protected]:/var/log# ls -lhtr 100MB.bin -rw-r--r-- 1 root root 25M Apr 9 01:33 100MB.bin ``` -### 5) 如何使用 HTTPie 上传文件? +#### 如何使用 HTTPie 上传文件? -你可以通过使用带有 `小于号 "<"` 的 HTTPie 命令上传文件 -You can upload a file using HTTPie with the `less-than symbol "<"` symbol. +你可以通过使用带有小于号 `<` 的 HTTPie 命令上传文件 ``` $ http https://transfer.sh < Anbox-1.png ``` -### 6) 如何使用带有重定向符号">" 的 HTTPie 下载文件? +#### 如何使用带有重定向符号 > 下载文件? -你可以使用带有 `重定向 ">"` 符号的 HTTPie 命令下载文件。 +你可以使用带有重定向 `>` 符号的 HTTPie 命令下载文件。 ``` # http https://www.2daygeek.com/wp-content/uploads/2019/03/How-To-Install-And-Enable-Flatpak-Support-On-Linux-1.png > Flatpak.png @@ -195,7 +197,7 @@ $ http https://transfer.sh < Anbox-1.png -rw-r--r-- 1 root root 47K Apr 9 01:44 Flatpak.png ``` -### 7) 发送一个 HTTP GET 请求? +#### 发送一个 HTTP GET 请求? 您可以在请求中发送 HTTP GET 方法。GET 方法会使用给定的 URI,从给定服务器检索信息。 @@ -214,7 +216,7 @@ Transfer-Encoding: chunked Vary: Accept-Encoding ``` -### 8) 提交表单? +#### 提交表单? 使用以下格式提交表单。POST 请求用于向服务器发送数据,例如客户信息、文件上传等。要使用 HTML 表单。 @@ -261,24 +263,24 @@ Server: Apache/2.4.29 (Ubuntu) Vary: Accept-Encoding ``` -### 9) HTTP 认证? +#### HTTP 认证? -当前支持的身份验证认证方案是基本认证(Basic)和摘要验证(Digest) -The currently supported authentication schemes are Basic and Digest +当前支持的身份验证认证方案是基本认证(Basic)和摘要验证(Digest)。 -基本认证 +基本认证: ``` $ http -a username:password example.org ``` -摘要验证 +摘要验证: ``` $ http -A digest -a username:password example.org ``` -提示输入密码 +提示输入密码: + ``` $ http -a username example.org ``` @@ -289,8 +291,8 @@ via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/zgj1024) -校对:[校对者ID](https://github.com/校对者ID) +译者:[zgj1024](https://github.com/zgj1024) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -306,4 +308,4 @@ via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/ [8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ [9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ [10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ \ No newline at end of file +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From d1eea1f8b790cc48b24cbe9ee239cc6e3da9eeec Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 12:32:01 +0800 Subject: [PATCH 0089/1154] PUB:20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @zgj1024 https://linux.cn/article-10765-1.html --- ... Command Line HTTP Client For Curl And Wget Alternative.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md (99%) diff --git a/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/published/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md similarity index 99% rename from translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md rename to published/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md index 0592564464..b6d1b5d17b 100644 --- a/translated/tech/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md +++ b/published/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (zgj1024) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10765-1.html) [#]: subject: (HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative) [#]: via: (https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 4bc50b0985e2b50fd25b7496069e75f5114df85e Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:32:34 +0800 Subject: [PATCH 0090/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Fuji?= =?UTF-8?q?tsu=20completes=20design=20of=20exascale=20supercomputer,=20pro?= =?UTF-8?q?mises=20to=20productize=20it=20sources/talk/20190418=20Fujitsu?= =?UTF-8?q?=20completes=20design=20of=20exascale=20supercomputer,=20promis?= =?UTF-8?q?es=20to=20productize=20it.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...upercomputer, promises to productize it.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md diff --git a/sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md b/sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md new file mode 100644 index 0000000000..59978d555c --- /dev/null +++ b/sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fujitsu completes design of exascale supercomputer, promises to productize it) +[#]: via: (https://www.networkworld.com/article/3389748/fujitsu-completes-design-of-exascale-supercomputer-promises-to-productize-it.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Fujitsu completes design of exascale supercomputer, promises to productize it +====== +Fujitsu hopes to be the first to offer exascale supercomputing using Arm processors. +![Riken Advanced Institute for Computational Science][1] + +Fujitsu and Japanese research institute Riken announced the design for the post-K supercomputer, to be launched in 2021, is complete and that they will productize the design for sale later this year. + +The K supercomputer was a massive system, built by Fujitsu and housed at the Riken Advanced Institute for Computational Science campus in Kobe, Japan, with more than 80,000 nodes and using Sparc64 VIIIfx processors, a derivative of the Sun Microsystems Sparc processor developed under a license agreement that pre-dated Oracle buying out Sun in 2010. + +**[ Also read:[10 of the world's fastest supercomputers][2] ]** + +It was ranked as the top supercomputer when it was launched in June 2011 with a computation speed of over 8 petaflops. And in November 2011, K became the first computer to top 10 petaflops. It was eventually surpassed as the world's fastest supercomputer by the IBM’s Sequoia, but even now, eight years later, it’s still in the top 20 of supercomputers in the world. + +### What's in the Post-K supercomputer? + +The new system, dubbed “Post-K,” will feature an Arm-based processor called A64FX, a high-performance CPU developed by Fujitsu, designed for exascale systems. The chip is based off the Arm8 design, which is popular in smartphones, with 48 cores plus four “assistant” cores and the ability to access up to 32GB of memory per chip. + +A64FX is the first CPU to adopt the Scalable Vector Extension (SVE), an instruction set specifically designed for Arm-based supercomputers. Fujitsu claims A64FX will offer a peak double precision (64-bit) floating point operations performance of over 2.7 teraflops per chip. The system will have one CPU per node and 384 nodes per rack. That comes out to one petaflop per rack. + +Contrast that with Summit, the top supercomputer in the world built by IBM for the Oak Ridge National Laboratory using IBM Power9 processors and Nvidia GPUs. A Summit rack has a peak computer of 864 teraflops. + +Let me put it another way: IBM’s Power processor and Nvidia’s Tesla are about to get pwned by a derivative chip to the one in your iPhone. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][3] ]** + +Fujitsu will productize the Post-K design and sell it as the successor to the Fujitsu Supercomputer PrimeHPC FX100. The company said it is also considering measures such as developing an entry-level model that will be easy to deploy, or supplying these technologies to other vendors. + +Post-K will be installed in the Riken Center for Computational Science (R-CCS), where the K computer is currently located. The system will be one of the first exascale supercomputers in the world, although the U.S. and China are certainly gunning to be first if only for bragging rights. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389748/fujitsu-completes-design-of-exascale-supercomputer-promises-to-productize-it.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/06/riken_advanced_institute_for_computational_science_k-computer_supercomputer_1200x800-100762135-large.jpg +[2]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html +[3]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 2b586a1cba07a253cc7edb27619f32d30bc18b86 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:32:47 +0800 Subject: [PATCH 0091/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Cisc?= =?UTF-8?q?o=20warns=20WLAN=20controller,=209000=20series=20router=20and?= =?UTF-8?q?=20IOS/XE=20users=20to=20patch=20urgent=20security=20holes=20so?= =?UTF-8?q?urces/talk/20190418=20Cisco=20warns=20WLAN=20controller,=209000?= =?UTF-8?q?=20series=20router=20and=20IOS-XE=20users=20to=20patch=20urgent?= =?UTF-8?q?=20security=20holes.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...XE users to patch urgent security holes.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md diff --git a/sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md b/sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md new file mode 100644 index 0000000000..5abcb3bcba --- /dev/null +++ b/sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco warns WLAN controller, 9000 series router and IOS/XE users to patch urgent security holes) +[#]: via: (https://www.networkworld.com/article/3390159/cisco-warns-wlan-controller-9000-series-router-and-iosxe-users-to-patch-urgent-security-holes.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco warns WLAN controller, 9000 series router and IOS/XE users to patch urgent security holes +====== +Cisco says unpatched vulnerabilities could lead to DoS attacks, arbitrary code execution, take-over of devices. +![Woolzian / Getty Images][1] + +Cisco this week issued 31 security advisories but directed customer attention to “critical” patches for its IOS and IOS XE Software Cluster Management and IOS software for Cisco ASR 9000 Series routers. A number of other vulnerabilities also need attention if customers are running Cisco Wireless LAN Controllers. + +The [first critical patch][2] has to do with a vulnerability in the Cisco Cluster Management Protocol (CMP) processing code in Cisco IOS and Cisco IOS XE Software that could allow an unauthenticated, remote attacker to send malformed CMP-specific Telnet options while establishing a Telnet session with an affected Cisco device configured to accept Telnet connections. An exploit could allow an attacker to execute arbitrary code and obtain full control of the device or cause a reload of the affected device, Cisco said. + +**[ Also see[What to consider when deploying a next generation firewall][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +The problem has a Common Vulnerability Scoring System number of 9.8 out of 10. + +According to Cisco, the Cluster Management Protocol utilizes Telnet internally as a signaling and command protocol between cluster members. The vulnerability is due to the combination of two factors: + + * The failure to restrict the use of CMP-specific Telnet options only to internal, local communications between cluster members and instead accept and process such options over any Telnet connection to an affected device + * The incorrect processing of malformed CMP-specific Telnet options. + + + +Cisco says the vulnerability can be exploited during Telnet session negotiation over either IPv4 or IPv6. This vulnerability can only be exploited through a Telnet session established _to_ the device; sending the malformed options on Telnet sessions _through_ the device will not trigger the vulnerability. + +The company says there are no workarounds for this problem, but disabling Telnet as an allowed protocol for incoming connections would eliminate the exploit vector. Cisco recommends disabling Telnet and using SSH instead. Information on how to do both can be found on the [Cisco Guide to Harden Cisco IOS Devices][5]. For patch information [go here][6]. + +The second critical patch involves a vulnerability in the sysadmin virtual machine (VM) on Cisco’s ASR 9000 carrier class routers running Cisco IOS XR 64-bit Software could let an unauthenticated, remote attacker access internal applications running on the sysadmin VM, Cisco said in the [advisory][7]. This CVSS also has a 9.8 rating. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][8] ]** + +Cisco said the vulnerability is due to incorrect isolation of the secondary management interface from internal sysadmin applications. An attacker could exploit this vulnerability by connecting to one of the listening internal applications. A successful exploit could result in unstable conditions, including both denial of service (DoS) and remote unauthenticated access to the device, Cisco stated. + +Cisco has released [free software updates][6] that address the vulnerability described in this advisory. + +Lastly, Cisco wrote that [multiple vulnerabilities][9] in the administrative GUI configuration feature of Cisco Wireless LAN Controller (WLC) Software could let an authenticated, remote attacker cause the device to reload unexpectedly during device configuration when the administrator is using this GUI, causing a DoS condition on an affected device. The attacker would need to have valid administrator credentials on the device for this exploit to work, Cisco stated. + +“These vulnerabilities are due to incomplete input validation for unexpected configuration options that the attacker could submit while accessing the GUI configuration menus. An attacker could exploit these vulnerabilities by authenticating to the device and submitting crafted user input when using the administrative GUI configuration feature,” Cisco stated. + +“These vulnerabilities have a Security Impact Rating (SIR) of High because they could be exploited when the software fix for the Cisco Wireless LAN Controller Cross-Site Request Forgery Vulnerability is not in place,” Cisco stated. “In that case, an unauthenticated attacker who first exploits the cross-site request forgery vulnerability could perform arbitrary commands with the privileges of the administrator user by exploiting the vulnerabilities described in this advisory.” + +Cisco has released [software updates][10] that address these vulnerabilities and said that there are no workarounds. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390159/cisco-warns-wlan-controller-9000-series-router-and-iosxe-users-to-patch-urgent-security-holes.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/compromised_data_security_breach_vulnerability_by_woolzian_gettyimages-475563052_2400x1600-100788413-large.jpg +[2]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20170317-cmp +[3]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: http://www.cisco.com/c/en/us/support/docs/ip/access-lists/13608-21.html +[6]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190417-asr9k-exr +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190417-wlc-iapp +[10]: https://www.cisco.com/c/en/us/support/web/tsd-cisco-worldwide-contacts.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From f724bdce99c9351030e557abab89bed2a4d7513f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:32:56 +0800 Subject: [PATCH 0092/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20'Fib?= =?UTF-8?q?er-in-air'=205G=20network=20research=20gets=20funding=20sources?= =?UTF-8?q?/talk/20190418=20-Fiber-in-air-=205G=20network=20research=20get?= =?UTF-8?q?s=20funding.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n-air- 5G network research gets funding.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md diff --git a/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md b/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md new file mode 100644 index 0000000000..4a82248cde --- /dev/null +++ b/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: ('Fiber-in-air' 5G network research gets funding) +[#]: via: (https://www.networkworld.com/article/3389881/extreme-5g-network-research-gets-funding.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +'Fiber-in-air' 5G network research gets funding +====== +A consortium of tech companies and universities plan to aggressively investigate the exploitation of D-Band to develop a new variant of 5G infrastructure. +![Peshkova / Getty Images][1] + +Wireless transmission at data rates of around 45gbps could one day be commonplace, some engineers say. “Fiber-in-air” is how the latest variant of 5G infrastructure is being described. To get there, a Britain-funded consortium of chip makers, universities, and others intend to aggressively investigate the exploitation of D-Band. That part of the radio spectrum is at 151-174.8 GHz in millimeter wavelengths (mm-wave) and hasn’t been used before. + +The researchers intend to do it by riffing on a now roughly 70-year-old gun-like electron-sending device that can trace its roots back through the annals of radio history: The Traveling Wave Tube, or TWT, an electron gun-magnet-combo that was used in the development of television and still brings space images back to Earth. + +**[ Also read:[The time of 5G is almost here][2] ]** + +D-Band, the spectrum the researchers want to use, has the advantage that it’s wide, so theoretically it should be good for fast, copious data rates. The problem with it though, and the reason it hasn’t thus far been used, is that it’s subject to monkey-wrenching from atmospheric conditions such as rain, explains IQE, a semiconductor wafer and materials producer involved in the project, in a [press release][3]. The team says attenuation is fixable, though. Their solution is the now-aging TWTs. + +The group, which includes BT, Filtronic, Glasgow University, Intel, Nokia Bell Labs, Optocap, and Teledyne e2v, has secured funding of the equivalent of $1.12 million USD from the U.K.’s [Engineering and Physical Sciences Research Council (EPSRC)][4]. That’s the principal public funding body for engineering science research there. + +### Tapping the power of TWTs + +The DLINK system, as the team calls it, will use a high-power vacuum TWT with a special, newly developed tunneling diode and a modulator. Two bands of 10 GHz, each will deliver the throughput, [explains Lancaster University on its website][5]. The tubes are, in fact, special amplifiers that produce 10 Watts. That’s 10 times what an equivalent solid-state solution would likely produce at the same spot in the band, they say. Energy is basically sent from the electron beam to an electric field generated by the input signal. + +Despite TWTs being around for eons, “no D-band TWTs are available in the market.” The development of one is key to these fiber-in-air speeds, the researchers say. + +They will include “unprecedented data rate and transmission distance,” IQE writes. + +The TWT device, although used extensively in space wireless communications since its invention in the 1950s, is overlooked as a significant contributor to global communications systems, say a group of French researchers working separately from this project, who recently argue that TWTs should be given more recognition. + +TWT’s are “the unsung heroes of space exploration,” the Aix-Marseille Université researchers say in [an article on publisher Springer’s website][6]. Springer is promoting the group's 2019-published [paper][7] in the European Physical Journal H in which they delve into the history of the simple electron gun and magnet device. + +“Its role in the history of wireless communications and in the space conquest is significant, but largely ignored,” they write in their paper. + +They will be pleased to hear it maybe isn’t going away anytime soon. + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389881/extreme-5g-network-research-gets-funding.html#tk.rss_all + +作者:[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.idgesg.net/images/article/2019/02/abstract_data_coding_matrix_structure_network_connections_by_peshkova_gettyimages-897683944_2400x1600-100788487-large.jpg +[2]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[3]: https://www.iqep.com/media/2019/03/iqe-partners-in-key-wireless-communications-project-for-5g-infrastructure-(1)/ +[4]: https://epsrc.ukri.org/ +[5]: http://wp.lancs.ac.uk/dlink/ +[6]: https://www.springer.com/gp/about-springer/media/research-news/all-english-research-news/traveling-wave-tubes--the-unsung-heroes-of-space-exploration/16578434 +[7]: https://link.springer.com/article/10.1140%2Fepjh%2Fe2018-90023-1 +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From 03007b4249f9bea5d276a9e1ba420de182930f3c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:33:07 +0800 Subject: [PATCH 0093/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190418=20Most?= =?UTF-8?q?=20data=20center=20workers=20happy=20with=20their=20jobs=20--?= =?UTF-8?q?=20despite=20the=20heavy=20demands=20sources/talk/20190418=20Mo?= =?UTF-8?q?st=20data=20center=20workers=20happy=20with=20their=20jobs=20--?= =?UTF-8?q?=20despite=20the=20heavy=20demands.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...their jobs -- despite the heavy demands.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md diff --git a/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md new file mode 100644 index 0000000000..5030e830dc --- /dev/null +++ b/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) +[#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Most data center workers happy with their jobs -- despite the heavy demands +====== +An Informa Engage and Data Center Knowledge survey finds data center workers are content with their jobs, so much so they would encourage their children to go into that line of work. +![Thinkstock][1] + +A [survey conducted by Informa Engage and Data Center Knowledge][2] finds data center workers overall are content with their job, so much so they would encourage their children to go into that line of work despite the heavy demands on time and their brain. + +Overall satisfaction is pretty good, with 72% of respondents generally agreeing with the statement “I love my current job,” while a third strongly agreed. And 75% agreed with the statement, “If my child, niece or nephew asked, I’d recommend getting into IT.” + +**[ Also read:[20 hot jobs ambitious IT pros should shoot for][3] ]** + +And there is a feeling of significance among data center workers, with 88% saying they feel they are very important to the success of their employer. + +That’s despite some challenges, not the least of which is a skills and certification shortage. Survey respondents cite a lack of skills as the biggest area of concern. Only 56% felt they had the training necessary to do their job, and 74% said they had been in the IT industry for more than a decade. + +The industry offers certification programs, every major IT hardware provider has them, but 61% said they have not completed or renewed certificates in the past 12 months. There are several reasons why. + +A third (34%) said it was due to a lack of a training budget at their organization, while 24% cited a lack of time, 16% said management doesn’t see a need for training, and 16% cited no training plans within their workplace. + +That doesn’t surprise me, since tech is one of the most open industries in the world where you can find training or educational materials and teach yourself. It’s already established that [many coders are self-taught][4], including industry giants Bill Gates, Steve Wozniak, John Carmack, and Jack Dorsey. + +**[[Looking to upgrade your career in tech? This comprehensive online course teaches you how.][5] ]** + +### Data center workers' salaries + +Data center workers can’t complain about the pay. Well, most can’t, as 50% make $100,000 per year or more, but 11% make less than $40,000. Two-thirds of those surveyed are in the U.S., so those on the low end might be outside the country. + +There was one notable discrepancy. Steve Brown, managing director of London-based Datacenter People, noted that software engineers get paid a lot better than the hardware people. + +“The software engineering side of the data center is comparable to the highest-earning professions,” Brown said in the report. “On the physical infrastructure — the mechanical/electrical side — it’s not quite the case. It’s more equivalent to mid-level management.” + +### Data center professionals still predominantly male + +The least surprising finding? Nine out of 10 survey respondents were male. The industry is bending over backwards to fix the gender imbalance, but so far nothing has changed. + +The conclusion of the report is a bit ominous, but I also think is wrong: + +> “As data center infrastructure completes its transition to a cloud computing model, and software moves into containers and microservices, the remaining, treasured leaders of the data center workforce — people who acquired their skills in the 20th century — may find themselves with nothing recognizable they can manage and no-one to lead. We may be shocked when the crisis finally hits, but we won’t be able to say we weren’t warned.” + +How many times do I have to say it, [the data center is not going away][6]. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/data_center_thinkstock_879720438-100749725-large.jpg +[2]: https://informa.tradepub.com/c/pubRD.mpl?sr=oc&_t=oc:&qf=w_dats04&ch=datacenterkids +[3]: https://www.networkworld.com/article/3276025/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[4]: https://www.networkworld.com/article/3046178/survey-finds-most-coders-are-self-taught.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fupgrading-your-technology-career +[6]: https://www.networkworld.com/article/3289509/two-studies-show-the-data-center-is-thriving-instead-of-dying.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 27ab35376f1d1e6522641e250c85b36f43d4739a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:33:36 +0800 Subject: [PATCH 0094/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Clea?= =?UTF-8?q?ring=20up=20confusion=20between=20edge=20and=20cloud=20sources/?= =?UTF-8?q?talk/20190417=20Clearing=20up=20confusion=20between=20edge=20an?= =?UTF-8?q?d=20cloud.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing up confusion between edge and cloud.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/talk/20190417 Clearing up confusion between edge and cloud.md diff --git a/sources/talk/20190417 Clearing up confusion between edge and cloud.md b/sources/talk/20190417 Clearing up confusion between edge and cloud.md new file mode 100644 index 0000000000..722051e8a7 --- /dev/null +++ b/sources/talk/20190417 Clearing up confusion between edge and cloud.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Clearing up confusion between edge and cloud) +[#]: via: (https://www.networkworld.com/article/3389364/clearing-up-confusion-between-edge-and-cloud.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +Clearing up confusion between edge and cloud +====== +The benefits of edge computing are not just hype; however, that doesn’t mean you should throw cloud computing initiatives to the wind. +![iStock][1] + +Edge computing and cloud computing are sometimes discussed as if they’re mutually exclusive approaches to network infrastructure. While they may function in different ways, utilizing one does not preclude the use of the other. + +Indeed, [Futurum Research][2] found that, among companies that have deployed edge projects, only 15% intend to separate these efforts from their cloud computing initiatives — largely for security or compartmentalization reasons. + +So then, what’s the difference, and how do edge and cloud work together? + +**Location, location, location** + +Moving data and processing to the cloud, as opposed to on-premises data centers, has enabled the business to move faster, more efficiently, less expensively — and in many cases, more securely. + +Yet cloud computing is not without challenges, particularly: + + * Users will abandon a graphics-heavy website if it doesn’t load quickly. So, imagine the lag for compute-heavy processing associated artificial intelligence or machine learning functions. + + * The strength of network connectivity is crucial for large data sets. As enterprises increasingly generate data, particularly with the adoption of Internet of Things (IoT), traditional cloud connections will be insufficient. + + + + +To make up for the lack of speed and connectivity with cloud, processing for mission-critical applications will need to occur closer to the data source. Maybe that’s a robot on the factory floor, digital signage at a retail store, or an MRI machine in a hospital. That’s edge computing, which reduces the distance the data must travel and thereby boosts the performance and reliability of applications and services. + +**One doesn’t supersede the other** + +That said, the benefits gained by edge computing don’t negate the need for cloud. In many cases, IT will now become a decision-maker in terms of best usage for each. For example, edge might make sense for devices running processing-power-hungry apps such as IoT, artificial intelligence, and machine learning. And cloud will work for apps where time isn’t necessarily of the essence, like inventory or big-data projects. + +> “By being able to triage the types of data processing on the edge versus that heading to the cloud, we can keep both systems running smoothly – keeping our customers and employees safe and happy,” [writes Daniel Newman][3], principal analyst for Futurum Research. + +And in reality, edge will require cloud. “To enable digital transformation, you have to build out the edge computing side and connect it with the cloud,” [Tony Antoun][4], senior vice president of edge and digital at GE Digital, told _Automation World_. “It’s a journey from the edge to the cloud and back, and the cycle keeps continuing. You need both to enrich and boost the business and take advantage of different points within this virtual lifecycle.” + +**Ensuring resiliency of cloud and edge** + +Both edge and cloud computing require careful consideration to the underlying processing power. Connectivity and availability, no matter the application, are always critical measures. + +But especially for the edge, it will be important to have a resilient architecture. Companies should focus on ensuring security, redundancy, connectivity, and remote management capabilities. + +Discover how your edge and cloud computing environments can coexist at [APC.com][5]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389364/clearing-up-confusion-between-edge-and-cloud.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-612507606-100793995-large.jpg +[2]: https://futurumresearch.com/edge-computing-from-edge-to-enterprise/ +[3]: https://futurumresearch.com/edge-computing-data-centers/ +[4]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both +[5]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp From 8a4ce3bf9e19b9b767f82d87bf4494ca924c78ac Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:33:46 +0800 Subject: [PATCH 0095/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Star?= =?UTF-8?q?tup=20MemVerge=20combines=20DRAM=20and=20Optane=20into=20massiv?= =?UTF-8?q?e=20memory=20pool=20sources/talk/20190417=20Startup=20MemVerge?= =?UTF-8?q?=20combines=20DRAM=20and=20Optane=20into=20massive=20memory=20p?= =?UTF-8?q?ool.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...RAM and Optane into massive memory pool.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md diff --git a/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md b/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md new file mode 100644 index 0000000000..71ddf70826 --- /dev/null +++ b/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Startup MemVerge combines DRAM and Optane into massive memory pool) +[#]: via: (https://www.networkworld.com/article/3389358/startup-memverge-combines-dram-and-optane-into-massive-memory-pool.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Startup MemVerge combines DRAM and Optane into massive memory pool +====== +MemVerge bridges two technologies that are already a bridge. +![monsitj / Getty Images][1] + +A startup called MemVerge has announced software to combine regular DRAM with Intel’s Optane DIMM persistent memory into a single clustered storage pool and without requiring any changes to applications. + +MemVerge has been working with Intel in developing this new hardware platform for close to two years. It offers what it calls a Memory-Converged Infrastructure (MCI) to allow existing apps to use Optane DC persistent memory. It's architected to integrate seamlessly with existing applications. + +**[ Read also:[Mass data fragmentation requires a storage rethink][2] ]** + +Optane memory is designed to sit between high-speed memory and [solid-state drives][3] (SSDs) and acts as a cache for the SSD, since it has speed comparable to DRAM but SSD persistence. With Intel’s new Xeon Scalable processors, this can make up to 4.5TB of memory available to a processor. + +Optane runs in one of two modes: Memory Mode and App Direct Mode. In Memory Mode, the Optane memory functions like regular memory and is not persistent. In App Direct Mode, it functions as the SSD cache but apps don’t natively support it. They need to be tweaked to function properly in Optane memory. + +As it was explained to me, apps aren’t designed for persistent storage because the data is already in memory on powerup rather than having to load it from storage. So, the app has to know memory doesn’t go away and that it does not need to shuffle data back and forth between storage and memory. Therefore, apps natively don’t work in persistent memory. + +### Why didn't Intel think of this? + +All of which really begs a question I can’t get answered, at least not immediately: Why didn’t Intel think of this when it created Optane in the first place? + +MemVerge has what it calls Distributed Memory Objects (DMO) hypervisor technology to provide a logical convergence layer to run data-intensive workloads at memory speed with guaranteed data consistency across multiple systems. This allows Optane memory to process and derive insights from the enormous amounts of data in real time. + +That’s because MemVerge’s technology makes random access as fast as sequential access. Normally, random access is slower than sequential because of all the jumping around with random access vs. reading one sequential file. But MemVerge can handle many small files as fast as it handles one large file. + +MemVerge itself is actually software, with a single API for both DRAM and Optane. It’s also available via a hyperconverged server appliance that comes with 2 Cascade Lake processors, up to 512 GB DRAM, 6TB of Optane memory, and 360TB of NVMe physical storage capacity. + +However, all of this is still vapor. MemVerge doesn’t expect to ship a beta product until at least June. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389358/startup-memverge-combines-dram-and-optane-into-massive-memory-pool.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/big_data_center_server_racks_storage_binary_analytics_by_monsitj_gettyimages-951389152_3x2-100787358-large.jpg +[2]: https://www.networkworld.com/article/3323580/mass-data-fragmentation-requires-a-storage-rethink.html +[3]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 4a365a19b165a8ce0cbf8592588ba41803ab4c27 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:33:56 +0800 Subject: [PATCH 0096/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Cisc?= =?UTF-8?q?o=20Talos=20details=20exceptionally=20dangerous=20DNS=20hijacki?= =?UTF-8?q?ng=20attack=20sources/talk/20190417=20Cisco=20Talos=20details?= =?UTF-8?q?=20exceptionally=20dangerous=20DNS=20hijacking=20attack.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tionally dangerous DNS hijacking attack.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md diff --git a/sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md b/sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md new file mode 100644 index 0000000000..db534e4457 --- /dev/null +++ b/sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco Talos details exceptionally dangerous DNS hijacking attack) +[#]: via: (https://www.networkworld.com/article/3389747/cisco-talos-details-exceptionally-dangerous-dns-hijacking-attack.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco Talos details exceptionally dangerous DNS hijacking attack +====== +Cisco Talos says state-sponsored attackers are battering DNS to gain access to sensitive networks and systems +![Peshkova / Getty][1] + +Security experts at Cisco Talos have released a [report detailing][2] what it calls the “first known case of a domain name registry organization that was compromised for cyber espionage operations.” + +Talos calls ongoing cyber threat campaign “Sea Turtle” and said that state-sponsored attackers are abusing DNS to harvest credentials to gain access to sensitive networks and systems in a way that victims are unable to detect, which displays unique knowledge on how to manipulate DNS, Talos stated. + +**More about DNS:** + + * [DNS in the cloud: Why and why not][3] + * [DNS over HTTPS seeks to make internet use more private][4] + * [How to protect your infrastructure from DNS cache poisoning][5] + * [ICANN housecleaning revokes old DNS security key][6] + + + +By obtaining control of victims’ DNS, the attackers can change or falsify any data on the Internet, illicitly modify DNS name records to point users to actor-controlled servers; users visiting those sites would never know, Talos reported. + +DNS, routinely known as the Internet’s phonebook, is part of the global internet infrastructure that translates between familiar names and the numbers computers need to access a website or send an email. + +### Threat to DNS could spread + +At this point Talos says Sea Turtle isn't compromising organizations in the U.S. + +“While this incident is limited to targeting primarily national security organizations in the Middle East and North Africa, and we do not want to overstate the consequences of this specific campaign, we are concerned that the success of this operation will lead to actors more broadly attacking the global DNS system,” Talos stated. + +Talos reports that the ongoing operation likely began as early as January 2017 and has continued through the first quarter of 2019. “Our investigation revealed that approximately 40 different organizations across 13 different countries were compromised during this campaign,” Talos stated. “We assess with high confidence that this activity is being carried out by an advanced, state-sponsored actor that seeks to obtain persistent access to sensitive networks and systems.” + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][7] ]** + +Talos says the attackers directing the Sea Turtle campaign show signs of being highly sophisticated and have continued their attacks despite public reports of their activities. In most cases, threat actors typically stop or slow down their activities once their campaigns are publicly revealed suggesting the Sea Turtle actors are unusually brazen and may be difficult to deter going forward, Talos stated. + +In January the Department of Homeland Security (DHS) [issued an alert][8] about this activity, warning that an attacker could redirect user traffic and obtain valid encryption certificates for an organization’s domain names. + +At that time the DHS’s [Cybersecurity and Infrastructure Security Agency][9] said in its [Emergency Directive][9] that it was tracking a series of incidents targeting DNS infrastructure. CISA wrote that it “is aware of multiple executive branch agency domains that were impacted by the tampering campaign and has notified the agencies that maintain them.” + +### DNS hijacking + +CISA said that attackers have managed to intercept and redirect web and mail traffic and could target other networked services. The agency said the attacks start with compromising user credentials of an account that can make changes to DNS records. Then the attacker alters DNS records, like Address, Mail Exchanger, or Name Server records, replacing the legitimate address of the services with an address the attacker controls. + +To achieve their nefarious goals, Talos stated the Sea Turtle accomplices: + + * Use DNS hijacking through the use of actor-controlled name servers. + * Are aggressive in their pursuit targeting DNS registries and a number of registrars, including those that manage country-code top-level domains (ccTLD). + + + * Use Let’s Encrypts, Comodo, Sectigo, and self-signed certificates in their man-in-the-middle (MitM) servers to gain the initial round of credentials. + + + * Steal victim organization’s legitimate SSL certificate and use it on actor-controlled servers. + + + +Such actions also distinguish Sea Turtle from an earlier DNS exploit known as DNSpionage, which [Talos ​reported][10]​ on in November 2018. + +Talos noted “with high confidence” that these operations are distinctly different and independent from the operations performed by [DNSpionage.][11] + +In that report, Talos said a DNSpionage campaign utilized two fake, malicious websites containing job postings that were used to compromise targets via malicious Microsoft Office documents with embedded macros. The malware supported HTTP and DNS communication with the attackers. + +In a separate DNSpionage campaign, the attackers used the same IP address to redirect the DNS of legitimate .gov and private company domains. During each DNS compromise, the actor carefully generated Let's Encrypt certificates for the redirected domains. These certificates provide X.509 certificates for [Transport Layer Security (TLS)][12] free of charge to the user, Talos said. + +The Sea Turtle campaign gained initial access either by exploiting known vulnerabilities or by sending spear-phishing emails. Talos said it believes the attackers have exploited multiple known common vulnerabilities and exposures (CVEs) to either gain initial access or to move laterally within an affected organization. Talos research further shows the following known exploits of Sea Turtle include: + + * CVE-2009-1151​: PHP code injection vulnerability affecting phpMyAdmin + * CVE-2014-6271​: RCE affecting GNU bash system, specifically the SMTP (this was part of the ​Shellshock​ CVEs) + * CVE-2017-3881​: RCE by unauthenticated user with elevated privileges Cisco switches + * CVE-2017-6736​: Remote Code Exploit (RCE) for Cisco integrated Service Router 2811 + * CVE-2017-12617​: RCE affecting Apache web servers running Tomcat + * CVE-2018-0296​: ​Directory​ traversal allowing unauthorized access to Cisco Adaptive Security Appliances (ASAs) and firewalls + * CVE-2018-7600​: RCE for Website built with Drupal, aka “Drupalgeddon” + + + +“As with any initial access involving a sophisticated actor, we believe this list of CVEs to be incomplete,” Talos stated. “The actor in question can leverage known vulnerabilities as they encounter a new threat surface. This list only represents the observed behavior of the actor, not their complete capabilities.” + +Talos says that the Sea Turtle campaign continues to be highly successful for several reasons. “First, the actors employ a unique approach to gain access to the targeted networks. Most traditional security products such as IDS and IPS systems are not designed to monitor and log DNS requests,” Talos stated. “The threat actors were able to achieve this level of success because the DNS domain space system added security into the equation as an afterthought. Had more ccTLDs implemented security features such as registrar locks, attackers would be unable to redirect the targeted domains.” + +Talos said the attackers also used previously undisclosed techniques such as certificate impersonation. “This technique was successful in part because the SSL certificates were created to provide confidentiality, not integrity. The attackers stole organizations’ SSL certificates associated with security appliances such as [Cisco's Adaptive Security Appliance] to obtain VPN credentials, allowing the actors to gain access to the targeted network, and have long-term persistent access, Talos stated. + +### Cisco Talos DNS attack mitigation strategy + +To protect against Sea Turtle, Cisco recommends: + + * Use a registry lock service, which will require an out-of-band message before any changes can occur to an organization's DNS record. + * If your registrar does not offer a registry-lock service, Talos recommends implementing multi-factor authentication, such as ​DUO​, to access your organization's DNS records. + * If you suspect you were targeted by this type of intrusion, Talos recommends instituting a network-wide password reset, preferably from a computer on a trusted network. + * Apply patches, especially on internet-facing machines. Network administrators can monitor passive DNS records on their domains to check for abnormalities. + + + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389747/cisco-talos-details-exceptionally-dangerous-dns-hijacking-attack.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/man-in-boat-surrounded-by-sharks_risk_fear_decision_attack_threat_by-peshkova-getty-100786972-large.jpg +[2]: https://blog.talosintelligence.com/2019/04/seaturtle.html +[3]: https://www.networkworld.com/article/3273891/hybrid-cloud/dns-in-the-cloud-why-and-why-not.html +[4]: https://www.networkworld.com/article/3322023/internet/dns-over-https-seeks-to-make-internet-use-more-private.html +[5]: https://www.networkworld.com/article/3298160/internet/how-to-protect-your-infrastructure-from-dns-cache-poisoning.html +[6]: https://www.networkworld.com/article/3331606/security/icann-housecleaning-revokes-old-dns-security-key.html +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[8]: https://www.networkworld.com/article/3336201/batten-down-the-dns-hatches-as-attackers-strike-feds.html +[9]: https://cyber.dhs.gov/ed/19-01/ +[10]: https://blog.talosintelligence.com/2018/11/dnspionage-campaign-targets-middle-east.html +[11]: https://krebsonsecurity.com/tag/dnspionage/ +[12]: https://www.networkworld.com/article/2303073/lan-wan-what-is-transport-layer-security-protocol.html +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world From 7d004758328a7adb4193e184f67d9670bf90a32c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 22 Apr 2019 12:34:06 +0800 Subject: [PATCH 0097/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Want?= =?UTF-8?q?=20to=20the=20know=20future=20of=20IoT=3F=20Ask=20the=20develop?= =?UTF-8?q?ers!=20sources/talk/20190417=20Want=20to=20the=20know=20future?= =?UTF-8?q?=20of=20IoT-=20Ask=20the=20developers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... know future of IoT- Ask the developers.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/talk/20190417 Want to the know future of IoT- Ask the developers.md diff --git a/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md b/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md new file mode 100644 index 0000000000..4f96f34b2b --- /dev/null +++ b/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Want to the know future of IoT? Ask the developers!) +[#]: via: (https://www.networkworld.com/article/3389877/want-to-the-know-future-of-iot-ask-the-developers.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Want to the know future of IoT? Ask the developers! +====== +A new survey of IoT developers reveals that connectivity, performance, and standards are growing areas of concern as IoT projects hit production. +![Avgust01 / Getty Images][1] + +It may be a cliché that software developers rule the world, but if you want to know the future of an important technology, it pays to look at what the developers are doing. With that in mind, there are some real, on-the-ground insights for the entire internet of things (IoT) community to be gained in a new [survey of more than 1,700 IoT developers][2] (pdf) conducted by the [Eclipse Foundation][3]. + +### IoT connectivity concerns + +Perhaps not surprisingly, security topped the list of concerns, easily outpacing other IoT worries. But that's where things begin to get interesting. More than a fifth (21%) of IoT developers cited connectivity as a challenge, followed by data collection and analysis (19%), performance (18%), privacy (18%), and standards (16%). + +Connectivity rose to second place after being the number three IoT concern for developers last year. Worries over security and data collection and analysis, meanwhile, actually declined slightly year over year. (Concerns over performance, privacy, and standards also increased significantly from last year.) + +**[ Learn more:[Download a PDF bundle of five essential articles about IoT in the enterprise][4] ]** + +“If you look at the list of developers’ top concerns with IoT in the survey,” said [Mike Milinkovich][5], executive director of the Eclipse Foundation via email, “I think connectivity, performance, and standards stand out — those are speaking to the fact that the IoT projects are getting real, that they’re getting out of sandboxes and into production.” + +“With connectivity in IoT,” Milinkovich continued, “everything seems straightforward until you have a sensor in a corner somewhere — narrowband or broadband — and physical constraints make it hard to connect." + +He also cited a proliferation of incompatible technologies that is driving developer concerns over connectivity. + +![][6] + +### IoT standards and interoperability + +Milinkovich also addressed one of [my personal IoT bugaboos: interoperability][7]. “Standards is a proxy for interoperability” among products from different vendors, he explained, which is an “elusive goal” in industrial IoT (IIoT). + +**[[Learn Java from beginning concepts to advanced design patterns in this comprehensive 12-part course!][8] ]** + +“IIoT is about breaking down the proprietary silos and re-tooling the infrastructure that’s been in our factories and logistics for many years using OSS standards and implementations — standard sets of protocols as opposed to vendor-specific protocols,” he said. + +That becomes a big issue when you’re deploying applications in the field and different manufacturers are using different protocols or non-standard extensions to existing protocols and the machines can’t talk to each other. + +**[ Also read:[Interoperability is the key to IoT success][7] ]** + +“This ties back to the requirement of not just having open standards, but more robust implementations of those standards in open source stacks,” Milinkovich said. “To keep maturing, the market needs not just standards, but out-of-the-box interoperability between devices.” + +“Performance is another production-grade concern,” he said. “When you’re in development, you think you know the bottlenecks, but then you discover the real-world issues when you push to production.” + +### Cloudy developments for IoT + +The survey also revealed that in some ways, IoT is very much aligned with the larger technology community. For example, IoT use of public and hybrid cloud architectures continues to grow. Amazon Web Services (AWS) (34%), Microsoft Azure (23%), and Google Cloud Platform (20%) are the leading IoT cloud providers, just as they are throughout the industry. If anything, AWS’ lead may be smaller in the IoT space than it is in other areas, though reliable cloud-provider market share figures are notoriously hard to come by. + +But Milinkovich sees industrial IoT as “a massive opportunity for hybrid cloud” because many industrial IoT users are very concerned about minimizing latency with their factory data, what he calls “their gold.” He sees factories moving towards hybrid cloud environments, leveraging “modern infrastructure technology like Kubernetes, and building around open protocols like HTTP and MQTT while getting rid of the older proprietary protocols.” + +### How IoT development is different + +In some ways, the IoT development world doesn’t seem much different than wider software development. For example, the top IoT programming languages mirror [the popularity of those languages][9] over all, with C and Java ruling the roost. (C led the way on constrained devices, while Java was the top choice for gateway and edge nodes, as well as the IoT cloud.) + +![][10] + +But Milinkovich noted that when developing for embedded or constrained devices, the programmer’s interface to a device could be through any number of esoteric hardware connectors. + +“You’re doing development using emulators and simulators, and it’s an inherently different and more complex interaction between your dev environment and the target for your application,” he said. “Sometimes hardware and software are developed in tandem, which makes it even more complicated.” + +For example, he explained, building an IoT solution may bring in web developers working on front ends using JavaScript and Angular, while backend cloud developers control cloud infrastructure and embedded developers focus on building software to run on constrained devices. + +No wonder IoT developers have so many things to worry about. + +**More about IoT:** + + * [What is the IoT? How the internet of things works][11] + * [What is edge computing and how it’s changing the network][12] + * [Most powerful Internet of Things companies][13] + * [10 Hot IoT startups to watch][14] + * [The 6 ways to make money in IoT][15] + * [What is digital twin technology? [and why it matters]][16] + * [Blockchain, service-centric networking key to IoT success][17] + * [Getting grounded in IoT networking and security][4] + * [Building IoT-ready networks must become a priority][18] + * [What is the Industrial IoT? [And why the stakes are so high]][19] + + + +Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389877/want-to-the-know-future-of-iot-ask-the-developers.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/iot_internet_of_things_mobile_connections_by_avgust01_gettyimages-1055659210_2400x1600-100788447-large.jpg +[2]: https://drive.google.com/file/d/17WEobD5Etfw5JnoKC1g4IME_XCtPNGGc/view +[3]: https://www.eclipse.org/ +[4]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[5]: https://blogs.eclipse.org/post/mike-milinkovich/measuring-industrial-iot%E2%80%99s-evolution +[6]: https://images.idgesg.net/images/article/2019/04/top-developer-concerns-2019-eclipse-foundation-100793974-large.jpg +[7]: https://www.networkworld.com/article/3204529/interoperability-is-the-key-to-iot-success.html +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fjava +[9]: https://blog.newrelic.com/technology/popular-programming-languages-2018/ +[10]: https://images.idgesg.net/images/article/2019/04/top-iot-programming-languages-eclipse-foundation-100793973-large.jpg +[11]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[12]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[13]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[14]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[15]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[16]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[17]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[18]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[19]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[20]: https://www.facebook.com/NetworkWorld/ +[21]: https://www.linkedin.com/company/network-world From f99ad2010c358d448877c4bcc894d6099de34748 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Mon, 22 Apr 2019 17:59:36 +0800 Subject: [PATCH 0098/1154] Update 20171226 The shell scripting trap.md --- .../tech/20171226 The shell scripting trap.md | 90 ++++++++----------- 1 file changed, 39 insertions(+), 51 deletions(-) diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md index 32bfff26cc..f1fc05dcc9 100644 --- a/sources/tech/20171226 The shell scripting trap.md +++ b/sources/tech/20171226 The shell scripting trap.md @@ -7,22 +7,17 @@ [#]: via: (https://arp242.net/weblog/shell-scripting-trap.html) [#]: author: (Martin Tournoij https://arp242.net/) -The shell scripting trap -Shell 脚本的陷阱 +Shell 脚本陷阱 ====== - -Shell scripting is great. It is amazingly simple to create something very useful. Even a simple no-brainer command such as: -Shell 脚本很棒,你可以非常轻松地写出有用的东西来。甚至是下面这个傻瓜式的命令: +Shell 脚本很棒,你可以非常轻松地写出有用的东西来。甚至像是下面这个傻瓜式的命令: ``` -# Official way of naming Go-related things: # 用含有 Go 的词汇起名字: $ grep -i ^go /usr/share/dict/american-english /usr/share/dict/british /usr/share/dict/british-english /usr/share/dict/catala /usr/share/dict/catalan /usr/share/dict/cracklib-small /usr/share/dict/finnish /usr/share/dict/french /usr/share/dict/german /usr/share/dict/italian /usr/share/dict/ngerman /usr/share/dict/ogerman /usr/share/dict/spanish /usr/share/dict/usa /usr/share/dict/words | cut -d: -f2 | sort -R | head -n1 goldfish ``` -Takes several lines of code and a lot more brainpower in many programming languages. For example in Ruby: -如果用其他编程语言,就需要花费更多的脑力用多行代码实现,比如用 Ruby 的话: +如果用其他编程语言,就需要花费更多的脑力,用多行代码实现,比如用 Ruby 的话: ``` puts(Dir['/usr/share/dict/*-english'].map do |f| File.open(f) @@ -31,10 +26,8 @@ puts(Dir['/usr/share/dict/*-english'].map do |f| end.flatten.sample.chomp) ``` -The Ruby version isn’t that long, or even especially complicated. But the shell script version was so simple that I didn’t even need to actually test it to make sure it is correct, whereas I did have to test the Ruby version to ensure I didn’t make a mistake. It’s also twice as long and looks a lot more dense. -Ruby 版本的代码虽然不是那么长,也没有那么复杂。但是 Shell 版是如此简单,我甚至不用实际测试就可以确保它是正确的。而 Ruby 版的我就没法确定它不会出错了,必须得测试一下。而且它要长一倍,看起来也更复杂。 +Ruby 版本的代码虽然不是那么长,也并不复杂。但是 shell 版是如此简单,我甚至不用实际测试就可以确保它是正确的。而 Ruby 版的我就没法确定它不会出错了,必须得测试一下。而且它要长一倍,看起来也更复杂。 -This is why people use shell scripts, it’s so easy to make something useful. Here’s is another example: 这就是人们使用 Shell 脚本的原因,它简单却实用。下面是另一个例子: ``` @@ -44,51 +37,46 @@ curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | grep -Ev '(^Tabel van|^Lijst van|Nederland)' ``` -This gets a list of all Dutch municipalities. I actually wrote this as a quick one-shot script to populate a database years ago, but it still works fine today, and it took me a minimum of effort to make it. Doing this in e.g. Ruby would take a lot more effort. -这个脚本可以从维基百科上获取荷兰基层政权的列表。几年前我写了这个临时的脚本来快速生成一个数据库,到现在它仍然可以正常运行,当时写它并没有花费我多少精力。要使用 Ruby 完成同样的功能则会麻烦地多。 +这个脚本可以从维基百科上获取荷兰基层政权的列表。几年前我写了这个临时的脚本,用来快速生成一个数据库,到现在它仍然可以正常运行,当时写它并没有花费我多少精力。但要用 Ruby 完成同样的功能则会麻烦得多。 -But there’s a downside, as your script grows it will become increasingly harder to maintain, but you also don’t really want to rewrite it to something else, as you’ve already spent so much time on the shell script version. -现在来说说 Shell 的缺点吧。随着代码量的增加,你的脚本会变得越来越难维护,但你也不会想用别的语言来重写一遍,因为你已经在这个 Shell 版上花费了很多时间。 +现在来说说 shell 的缺点吧。随着代码量的增加,你的脚本会变得越来越难以维护,但你也不会想用别的语言重写一遍,因为你已经在这个 shell 版上花费了很多时间。 -This is what I call ‘the shell script trap’, which is a special case of the [sunk cost fallacy][1]. +我把这种情况称为“Shell 脚本陷阱”,这是[沉没成本谬论][1]的一种特例(沉没成本谬论是一个经济学概念,可以简单理解为,对已经投入的成本可能被浪费而念念不忘)。 + +实际上许多脚本会增长到超出预期的大小,你经常会花费过多的时间来“修复某个 bug”,或者“添加一个小功能”。如此循环往复,让人头大。 + +如果你从一开始就使用 Python、Ruby 或是其他类似的语言来写这个程序,你可能会在写第一版的时候多花些时间,但以后维护起来就容易很多,bug 也肯定会少很多。 + +以我的 [packman.vim][2] 脚本为例。它起初只包含一个简单的用来遍历所有目录的 `for` 循环,外加一个 `git pull`,但在这之后就刹不住车了,它现在有 200 行左右的代码,这肯定不能算是最复杂的脚本,但假如我一上来就按计划用 Go 来编写它的话,那么增加一些像“打印状态”或者“从配置文件里克隆新的 git 库”这样的功能就会轻松很多;添加“并行克隆”的支持也几乎不算个事儿了,而在 shell 脚本里却很难实现(尽管不是不可能)。事后看来,我本可以节省时间,并且获得更好的结果。 + +出于类似的原因,我很后悔写出了许多这样的 shell 脚本,而我在 2018 年的新年誓言就是不要再犯类似的错误了。 + +#### 附录:问题汇总 + +需要指出的是,shell 编程的确存在一些实际的限制。下面是一些例子: + + * 在处理一些包含“空格”或者其他“特殊”字符的文件名时,需要特别注意细节。绝大多数脚本都会犯错,即使是那些经验丰富的作者(比如我)编写的脚本,因为太容易写错了,[只添加引号是不够的][3]。 + + * 有许多所谓“正确”和“错误”的做法。你应该用 `which` 还是 `command`?该用 `$@` 还是 `$*`,是不是得加引号?你是该用 `cmd $arg` 还是 `cmd "$arg"`?等等等等。 + + * 你没法在变量里存储空字节(0x00);shell 脚本处理二进制数据很麻烦。 + + * 虽然你可以非常快速地写出有用的东西,但实现更复杂的算法则要痛苦许多,即使用 ksh/zsh/bash 扩展也是如此。我上面那个解析 HTML 的脚本临时用用是可以的,但你真的不会想在生产环境中使用这种脚本。 + + * 很难写出跨平台的通用型 shell 脚本。`/bin/sh` 可能是 `dash` 或者 `bash`,不同的 shell 有不同的运行方式。外部工具如 `grep`、`sed` 等,不一定能支持同样的参数。你能确定你的脚本可以适用于 Linux、macOS 和 Windows 的所有版本吗(过去、现在和将来)? + + * 调试 shell 脚本会很难,特别是你眼中的语法可能会很快变得模糊起来,并不是所有人都熟悉 shell 编程的语境。 + + * 处理错误会很棘手(检查 `$?` 或是 `set -e`),排查一些超过“出了个小错”级别的复杂错误几乎是不可能的。 + + * 除非你使用了 `set -u`,变量未定义将不会报错,而这会导致一些“搞笑事件”,比如 `rm -r ~/$undefined` 会删除用户的整个家目录([瞅瞅 Github 上的这个悲剧][4])。 + + * 所有东西都是字符串。一些 shell 引入了数组,能用,但是语法非常丑陋和模糊。带分数的数字运算仍然难以应付,并且依赖像 `bc` 或 `dc` 这样的外部工具(`$(( .. ))` 这种方式只能对付一下整数)。 -And many scripts do grow beyond their original intended size, and often you will spend a lot more time than you should on “fixing that one bug”, or “adding just one small feature”. Rinse, repeat. +**反馈** -If you had written it in Python or Ruby or another similar language from the start, you would have spent some more time writing the original version, but would have spent much less time maintaining it, while almost certainly having fewer bugs. - -Take my [packman.vim][2] script for example. It started out as a simple `for` loop over all directories and a `git pull` and has grown from there. At about 200 lines it’s hardly the most complex script, but had I written it in Go as I originally planned then it would have been much easier to add support for printing out the status or cloning new repos from a config file. It would also be almost trivial to add support for parallel clones, which is hard (though not impossible) to do correct in a shell script. In hindsight, I would have saved time, and gotten a better result to boot. - -I regret writing most shell scripts I’ve written for similar reasons, and my 2018 new year’s pledge will be to not write any more. - -#### Appendix: the problems - -And to be clear, shell scripting does come with some real limitation. Some examples: - - * Dealing with filenames that contain spaces or other ‘special’ characters requires careful attention to detail. The vast majority of scripts get this wrong, even when written by experienced authors who care about such things (e.g. me), because it’s so easy to do it wrong. [Adding quotes is not enough][3]. - - * There are many “right” and “wrong” ways to do things. Should you use `which` or `command`? Should you use `$@` or `$*`, and should that be quoted? Should you use `cmd $arg` or `cmd "$arg"`? etc. etc. - - * You cannot store any NULL bytes (0x00) in variables; it is very hard to make shell scripts deal with binary data. - - * While you can make something very useful very quickly, implementing more complex algorithms can be very painful – if not nigh-impossible – even when using the ksh/zsh/bash extensions. My ad-hoc HTML parsing in the example above was okay for a quick one-off script, but you really don’t want to do things like that in a production-script. - - * It can be hard to write shell scripts that work well on all platforms. `/bin/sh` could be `dash` or `bash`, and will behave different. External tools such as `grep`, `sed`, etc. may or may not support certain flags. Are you sure that your script works on all versions (past, present, and future) of Linux, macOS, and Windows equally well? - - * Debugging shell scripts can be hard, especially as the syntax can get fairly obscure quite fast, and not everyone is equally well versed in shell scripting. - - * Error handling can be tricky (check `$?` or `set -e`), and doing something more advanced beyond “an error occurred” is practically impossible. - - * Undefined variables are not an error unless you use `set -u`, leading to “fun stuff” like `rm -r ~/$undefined` deleting user’s home dir ([not a theoretical problem][4]). - - * Everything is a string. Some shells add arrays, which works but the syntax is obscure and ugly. Numeric computations with fractions remain tricky and rely on external tools such as `bc` or `dc` (`$(( .. ))` expansion only works for integers). - - - - -**Feedback** - -You can mail me at [martin@arp242.net][5] or [create a GitHub issue][6] for feedback, questions, etc. +你可以发邮件到 [martin@arp242.net][5],或者[在 GitHub 上创建 issue][6] 来向我反馈,提问等。 -------------------------------------------------------------------------------- From cc953b3f4b3b9da70240c5c223ed3f1b5b141818 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Mon, 22 Apr 2019 18:03:36 +0800 Subject: [PATCH 0099/1154] Update 20171226 The shell scripting trap.md --- sources/tech/20171226 The shell scripting trap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md index f1fc05dcc9..15659760a1 100644 --- a/sources/tech/20171226 The shell scripting trap.md +++ b/sources/tech/20171226 The shell scripting trap.md @@ -84,7 +84,7 @@ via: https://arp242.net/weblog/shell-scripting-trap.html 作者:[Martin Tournoij][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[jdh8383](https://github.com/jdh8383) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5b4a953af351c2f94e2696b90d089061921d4291 Mon Sep 17 00:00:00 2001 From: Jerry Li Date: Mon, 22 Apr 2019 18:12:34 +0800 Subject: [PATCH 0100/1154] commit translation --- {sources => translated}/tech/20171226 The shell scripting trap.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20171226 The shell scripting trap.md (100%) diff --git a/sources/tech/20171226 The shell scripting trap.md b/translated/tech/20171226 The shell scripting trap.md similarity index 100% rename from sources/tech/20171226 The shell scripting trap.md rename to translated/tech/20171226 The shell scripting trap.md From 9af63fad5ce1d6d5ac9c04b9c6043cb2df2729f2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 23:11:16 +0800 Subject: [PATCH 0101/1154] PRF:20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @zero-MK --- ...stem Using Shell Script With nc Command.md | 68 +++++++++---------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md b/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md index a02cd504d5..f5b60aca21 100644 --- a/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md +++ b/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @@ -1,6 +1,6 @@ [#]: collector: "lujun9972" [#]: translator: "zero-MK" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command?" @@ -8,26 +8,20 @@ [#]: author: "Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/" +如何检查多个远程 Linux 系统是否打开了指定端口? +====== -# 如何使用带有 nc 命令的 Shell 脚本来检查多个远程 Linux 系统是否打开了指定端口? +我们最近写了一篇文章关于如何检查远程 Linux 服务器是否打开指定端口。它能帮助你检查单个服务器。 -我们最近写了一篇文章关于如何检查远程 Linux 服务器是否打开指定端口。它能帮助您检查单个服务器。 +如果要检查五个服务器有没有问题,可以使用以下任何一个命令,如 `nc`(netcat)、`nmap` 和 `telnet`。但是如果想检查 50 多台服务器,那么你的解决方案是什么? -如果要检查五个服务器有没有问题,可以使用以下任何一个命令,如 nc(netcat),nmap 和 telnet。 +要检查所有服务器并不容易,如果你一个一个这样做,完全没有必要,因为这样你将会浪费大量的时间。为了解决这种情况,我使用 `nc` 命令编写了一个 shell 小脚本,它将允许我们扫描任意数量服务器给定的端口。 -但是如果想检查 50 多台服务器,那么你的解决方案是什么? +如果你要查找单个服务器扫描,你有多个选择,你只需阅读 [检查远程 Linux 系统上的端口是否打开?][1] 了解更多信息。 -要检查所有服务器并不容易,如果你一个一个这样做,完全没有必要,因为这样你将会浪费大量的时间。 +本教程中提供了两个脚本,这两个脚本都很有用。这两个脚本都用于不同的目的,你可以通过阅读标题轻松理解其用途。 -为了解决这种情况,我使用 nc 命令编写了一个 shell 小脚本,它将允许我们扫描任意数量服务器给定的端口。 - -如果您要查找单个服务器扫描,您有多个选择,你只需导航到到 **[检查远程 Linux 系统上的端口是否打开?][1]** 了解更多信息。 - -本教程中提供了两个脚本,这两个脚本都很有用。 - -这两个脚本都用于不同的目的,您可以通过阅读标题轻松理解其用途。 - -在你阅读这篇文章之前,我会问你几个问题,如果你知道答案或者你可以通过阅读这篇文章来获得答案。 +在你阅读这篇文章之前,我会问你几个问题,如果你不知道答案你可以通过阅读这篇文章来获得答案。 如何检查一个远程 Linux 服务器上指定的端口是否打开? @@ -35,17 +29,17 @@ 如何检查多个远程 Linux 服务器上是否打开了多个指定的端口? -### 什么是nc(netcat)命令? +### 什么是 nc(netcat)命令? -nc 即 netcat 。Netcat 是一个简单实用的 Unix 程序,它使用 TCP 或 UDP 协议进行跨网络连接进行数据读取和写入。 +`nc` 即 netcat。它是一个简单实用的 Unix 程序,它使用 TCP 或 UDP 协议进行跨网络连接进行数据读取和写入。 -它被设计成一个可靠的 “后端” (back-end) 工具,我们可以直接使用或由其他程序和脚本轻松驱动它。 +它被设计成一个可靠的 “后端” 工具,我们可以直接使用或由其他程序和脚本轻松驱动它。 -同时,它也是一个功能丰富的网络调试和探索工具,因为它可以创建您需要的几乎任何类型的连接,并具有几个有趣的内置功能。 +同时,它也是一个功能丰富的网络调试和探索工具,因为它可以创建你需要的几乎任何类型的连接,并具有几个有趣的内置功能。 -Netcat 有三个主要的模式。分别是连接模式,监听模式和隧道模式。 +netcat 有三个主要的模式。分别是连接模式,监听模式和隧道模式。 -**nc(netcat)的通用语法:** +`nc`(netcat)的通用语法: ``` $ nc [-options] [HostName or IP] [PortNumber] @@ -55,9 +49,9 @@ $ nc [-options] [HostName or IP] [PortNumber] 如果要检查多个远程 Linux 服务器上给定端口是否打开,请使用以下 shell 脚本。 -在我的例子中,我们将检查端口 22 是否在以下远程服务器中打开,确保您已经更新文件中的服务器列表而不是还是使用我的服务器列表。 +在我的例子中,我们将检查端口 22 是否在以下远程服务器中打开,确保你已经更新文件中的服务器列表而不是使用我的服务器列表。 -您必须确保已经更新服务器列表 : `server-list.txt file` 。每个服务器(IP)应该在单独的行中。 +你必须确保已经更新服务器列表 :`server-list.txt` 。每个服务器(IP)应该在单独的行中。 ``` # cat server-list.txt @@ -77,12 +71,12 @@ $ nc [-options] [HostName or IP] [PortNumber] #!/bin/sh for server in `more server-list.txt` do -#echo $i -nc -zvw3 $server 22 + #echo $i + nc -zvw3 $server 22 done ``` -设置 `port_scan.sh` 文件的可执行权限。 +设置 `port_scan.sh` 文件的可执行权限。 ``` $ chmod +x port_scan.sh @@ -105,9 +99,9 @@ Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! 如果要检查多个服务器中的多个端口,请使用下面的脚本。 -在我的例子中,我们将检查给定服务器的 22 和 80 端口是否打开。确保您必须替换所需的端口和服务器名称而不使用是我的。 +在我的例子中,我们将检查给定服务器的 22 和 80 端口是否打开。确保你必须替换所需的端口和服务器名称而不使用是我的。 -您必须确保已经将要检查的端口写入 `port-list.txt` 文件中。每个端口应该在一个单独的行中。 +你必须确保已经将要检查的端口写入 `port-list.txt` 文件中。每个端口应该在一个单独的行中。 ``` # cat port-list.txt @@ -115,7 +109,7 @@ Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! 80 ``` -您必须确保已经将要检查的服务器( IP 地址 )写入 `server-list.txt` 到文件中。每个服务器( IP ) 应该在单独的行中。 +你必须确保已经将要检查的服务器(IP 地址)写入 `server-list.txt` 到文件中。每个服务器(IP) 应该在单独的行中。 ``` # cat server-list.txt @@ -135,12 +129,12 @@ Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! #!/bin/sh for server in `more server-list.txt` do -for port in `more port-list.txt` -do -#echo $server -nc -zvw3 $server $port -echo "" -done + for port in `more port-list.txt` + do + #echo $server + nc -zvw3 $server $port + echo "" + done done ``` @@ -180,10 +174,10 @@ via: https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[zero-MK](https://github.com/zero-mk) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/how-to-check-whether-a-port-is-open-on-the-remote-linux-system-server/ +[1]: https://linux.cn/article-10675-1.html From 5c041a17bbf9ff647041f587ec622ff127c51a87 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 22 Apr 2019 23:12:32 +0800 Subject: [PATCH 0102/1154] PUB:20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @zero-MK https://linux.cn/article-10766-1.html --- ... Remote Linux System Using Shell Script With nc Command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md (98%) diff --git a/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md b/published/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md similarity index 98% rename from translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md rename to published/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md index f5b60aca21..073cd7b1b3 100644 --- a/translated/tech/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md +++ b/published/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "zero-MK" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10766-1.html" [#]: subject: "How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command?" [#]: via: "https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/" [#]: author: "Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/" From 5df1f5241a2140f1117dbcb25bf40c3cbc98d3f8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 23 Apr 2019 08:56:10 +0800 Subject: [PATCH 0103/1154] translated --- ...rted with Mercurial for version control.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) rename {sources => translated}/tech/20190415 Getting started with Mercurial for version control.md (57%) diff --git a/sources/tech/20190415 Getting started with Mercurial for version control.md b/translated/tech/20190415 Getting started with Mercurial for version control.md similarity index 57% rename from sources/tech/20190415 Getting started with Mercurial for version control.md rename to translated/tech/20190415 Getting started with Mercurial for version control.md index a682517b5f..078589dd2d 100644 --- a/sources/tech/20190415 Getting started with Mercurial for version control.md +++ b/translated/tech/20190415 Getting started with Mercurial for version control.md @@ -7,17 +7,17 @@ [#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) -Getting started with Mercurial for version control +开始使用 Mercurial 进行版本控制 ====== -Learn the basics of Mercurial, a distributed version control system -written in Python. +了解 Mercurial 的基础知识,它是一个用 Python 写的分布式版本控制系统。 + ![][1] -[Mercurial][2] is a distributed version control system written in Python. Because it's written in a high-level language, you can write a Mercurial extension with a few Python functions. +[Mercurial][2] 是一个用 Python 编写的分布式版本控制系统。因为它是用高级语言编写的,所以你可以用 Python 函数编写一个 Mercurial 扩展。 -There are several ways to install Mercurial, which are explained in the [official documentation][3]. My favorite one is not there: using **pip**. This is the most amenable way to develop local extensions! +在[官方文档中][3]说明了几种安装 Mercurial 的方法。我最喜欢的一种方法不在里面:使用 **pip**。这是开发本地扩展的最合适方式! -For now, Mercurial only supports Python 2.7, so you will need to create a Python 2.7 virtual environment: +目前,Mercurial 仅支持 Python 2.7,因此你需要创建一个 Python 2.7 虚拟环境: ``` @@ -25,7 +25,7 @@ python2 -m virtualenv mercurial-env ./mercurial-env/bin/pip install mercurial ``` -To have a short command, and to satisfy everyone's insatiable need for chemistry-based humor, the command is called **hg**. +为了有一个简短的命令,以及满足人们对化学幽默的无法满足的需求,命令称之为 **hg**。 ``` @@ -37,7 +37,7 @@ $ source mercurial-env/bin/activate (mercurial-env)$ ``` -The status is empty since you do not have any files. Add a couple of files: +由于还没有任何文件,因此状态为空。添加几个文件: ``` @@ -58,11 +58,11 @@ date: Fri Mar 29 12:42:43 2019 -0700 summary: Adding stuff ``` -The **addremove** command is useful: it adds any new files that are not ignored to the list of managed files and removes any files that have been removed. +**addremove** 命令很有用:它将任何未被忽略的新文件添加到托管文件列表中,并移除任何已删除的文件。 -As I mentioned, Mercurial extensions are written in Python—they are just regular Python modules. +如我所说,Mercurial 扩展用 Python 写成,它们只是常规的 Python 模块。 -This is an example of a short Mercurial extension: +这是一个简短的 Mercurial 扩展示例: ``` @@ -78,14 +78,14 @@ def say_hello(ui, repo, **opts): ui.write("hello ", opts['whom'], "\n") ``` -A simple way to test it is to put it in a file in the virtual environment manually: +一个简单的测试方法是将它手动加入虚拟环境中的文件中: ``` `$ vi ../mercurial-env/lib/python2.7/site-packages/hello_ext.py` ``` -Then you need to _enable_ the extension. You can start by enabling it only in the current repository: +然后你需要_启用_扩展。你可以仅在当前仓库中启用它开始: ``` @@ -94,7 +94,7 @@ $ cat >> .hg/hgrc hello_ext = ``` -Now, a greeting is possible: +现在,问候有了: ``` @@ -102,9 +102,9 @@ Now, a greeting is possible: hello world ``` -Most extensions will do more useful stuff—possibly even things to do with Mercurial. The **repo** object is a **mercurial.hg.repository** object. +大多数扩展会做更多有用的东西,甚至可能与 Mercurial 有关。 **repo** 对象是 **mercurial.hg.repository** 的对象。 -Refer to the [official documentation][5] for more about Mercurial's API. And visit the [official repo][6] for more examples and inspiration. +有关 Mercurial API 的更多信息,请参阅[官方文档][5]。并访问[官方仓库][6]获取更多示例和灵感。 -------------------------------------------------------------------------------- @@ -112,7 +112,7 @@ via: https://opensource.com/article/19/4/getting-started-mercurial 作者:[Moshe Zadka (Community Moderator)][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2e7c76df92a7d085164523363f1bb3262e546115 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 23 Apr 2019 08:59:56 +0800 Subject: [PATCH 0104/1154] translating --- ...0190419 4 cool new projects to try in COPR for April 2019.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md index e8d7dd9f7c..1c6cd5ccaa 100644 --- a/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md +++ b/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6f0b23601953ac7497d8e49b7d9a1223ce6da046 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 09:17:07 +0800 Subject: [PATCH 0105/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190419=20Inte?= =?UTF-8?q?l=20follows=20AMD=E2=80=99s=20lead=20(again)=20into=20single-so?= =?UTF-8?q?cket=20Xeon=20servers=20sources/talk/20190419=20Intel=20follows?= =?UTF-8?q?=20AMD-s=20lead=20(again)=20into=20single-socket=20Xeon=20serve?= =?UTF-8?q?rs.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...(again) into single-socket Xeon servers.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md diff --git a/sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md b/sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md new file mode 100644 index 0000000000..9685591b2c --- /dev/null +++ b/sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel follows AMD’s lead (again) into single-socket Xeon servers) +[#]: via: (https://www.networkworld.com/article/3390201/intel-follows-amds-lead-again-into-single-socket-xeon-servers.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Intel follows AMD’s lead (again) into single-socket Xeon servers +====== +Intel's new U series of processors are aimed at the low-end market where one processor is good enough. +![Intel][1] + +I’m really starting to wonder who the leader in x86 really is these days because it seems Intel is borrowing another page out of AMD’s playbook. + +Intel launched a whole lot of new Xeon Scalable processors earlier this month, but they neglected to mention a unique line: the U series of single-socket processors. The folks over at Serve The Home sniffed it out first, and Intel has confirmed the existence of the line, just that they “didn’t broadly promote them.” + +**[ Read also:[Intel makes a play for high-speed fiber networking for data centers][2] ]** + +To backtrack a bit, AMD made a major push for [single-socket servers][3] when it launched the Epyc line of server chips. Epyc comes with up to 32 cores and multithreading, and Intel (and Dell) argued that one 32-core/64-thread processor was enough to handle many loads and a lot cheaper than a two-socket system. + +The new U series isn’t available in the regular Intel [ARK database][4] listing of Xeon Scalable processors, but they do show up if you search. Intel says they are looking into that .There are two processors for now, one with 24 cores and two with 20 cores. + +The 24-core Intel [Xeon Gold 6212U][5] will be a counterpart to the Intel Xeon Platinum 8260, with a 2.4GHz base clock speed and a 3.9GHz turbo clock and the ability to access up to 1TB of memory. The Xeon Gold 6212U will have the same 165W TDP as the 8260 line, but with a single socket that’s 165 fewer watts of power. + +Also, Intel is suggesting a price of about $2,000 for the Intel Xeon Gold 6212U, a big discount over the Xeon Platinum 8260’s $4,702 list price. So, that will translate into much cheaper servers. + +The [Intel Xeon Gold 6210U][6] with 20 cores carries a suggested price of $1,500, has a base clock rate of 2.50GHz with turbo boost to 3.9GHz and a 150 watt TDP. Finally, there is the 20-core Intel [Xeon Gold 6209U][7] with a price of around $1,000 that is identical to the 6210 except its base clock speed is 2.1GHz with a turbo boost of 3.9GHz and a TDP of 125 watts due to its lower clock speed. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][8] ]** + +All of the processors support up to 1TB of DDR4-2933 memory and Intel’s Optane persistent memory. + +In terms of speeds and feeds, AMD has a slight advantage over Intel in the single-socket race, and Epyc 2 is rumored to be approaching completion, which will only further advance AMD’s lead. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390201/intel-follows-amds-lead-again-into-single-socket-xeon-servers.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/06/intel_generic_cpu_background-100760187-large.jpg +[2]: https://www.networkworld.com/article/3307852/intel-makes-a-play-for-high-speed-fiber-networking-for-data-centers.html +[3]: https://www.networkworld.com/article/3253626/amd-lands-dell-as-its-latest-epyc-server-processor-customer.html +[4]: https://ark.intel.com/content/www/us/en/ark/products/series/192283/2nd-generation-intel-xeon-scalable-processors.html +[5]: https://ark.intel.com/content/www/us/en/ark/products/192453/intel-xeon-gold-6212u-processor-35-75m-cache-2-40-ghz.html +[6]: https://ark.intel.com/content/www/us/en/ark/products/192452/intel-xeon-gold-6210u-processor-27-5m-cache-2-50-ghz.html +[7]: https://ark.intel.com/content/www/us/en/ark/products/193971/intel-xeon-gold-6209u-processor-27-5m-cache-2-10-ghz.html +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 1faf614c72c9108e6516aaae6543b7f17804ce75 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 09:53:33 +0800 Subject: [PATCH 0106/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190417=20Inte?= =?UTF-8?q?r-process=20communication=20in=20Linux:=20Sockets=20and=20signa?= =?UTF-8?q?ls=20sources/tech/20190417=20Inter-process=20communication=20in?= =?UTF-8?q?=20Linux-=20Sockets=20and=20signals.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...unication in Linux- Sockets and signals.md | 388 ++++++++++++++++++ 1 file changed, 388 insertions(+) create mode 100644 sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md diff --git a/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md b/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md new file mode 100644 index 0000000000..40f64a2f5a --- /dev/null +++ b/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md @@ -0,0 +1,388 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inter-process communication in Linux: Sockets and signals) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-networking) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Inter-process communication in Linux: Sockets and signals +====== + +Learn how processes synchronize with each other in Linux. + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mesh_networking_dots_connected.png?itok=ovINTRR3) + +This is the third and final article in a series about [interprocess communication][1] (IPC) in Linux. The [first article][2] focused on IPC through shared storage (files and memory segments), and the [second article][3] does the same for basic channels: pipes (named and unnamed) and message queues. This article moves from IPC at the high end (sockets) to IPC at the low end (signals). Code examples flesh out the details. + +### Sockets + +Just as pipes come in two flavors (named and unnamed), so do sockets. IPC sockets (aka Unix domain sockets) enable channel-based communication for processes on the same physical device (host), whereas network sockets enable this kind of IPC for processes that can run on different hosts, thereby bringing networking into play. Network sockets need support from an underlying protocol such as TCP (Transmission Control Protocol) or the lower-level UDP (User Datagram Protocol). + +By contrast, IPC sockets rely upon the local system kernel to support communication; in particular, IPC sockets communicate using a local file as a socket address. Despite these implementation differences, the IPC socket and network socket APIs are the same in the essentials. The forthcoming example covers network sockets, but the sample server and client programs can run on the same machine because the server uses network address localhost (127.0.0.1), the address for the local machine on the local machine. + +Sockets configured as streams (discussed below) are bidirectional, and control follows a client/server pattern: the client initiates the conversation by trying to connect to a server, which tries to accept the connection. If everything works, requests from the client and responses from the server then can flow through the channel until this is closed on either end, thereby breaking the connection. + +An iterative server, which is suited for development only, handles connected clients one at a time to completion: the first client is handled from start to finish, then the second, and so on. The downside is that the handling of a particular client may hang, which then starves all the clients waiting behind. A production-grade server would be concurrent, typically using some mix of multi-processing and multi-threading. For example, the Nginx web server on my desktop machine has a pool of four worker processes that can handle client requests concurrently. The following code example keeps the clutter to a minimum by using an iterative server; the focus thus remains on the basic API, not on concurrency. + +Finally, the socket API has evolved significantly over time as various POSIX refinements have emerged. The current sample code for server and client is deliberately simple but underscores the bidirectional aspect of a stream-based socket connection. Here's a summary of the flow of control, with the server started in a terminal then the client started in a separate terminal: + + * The server awaits client connections and, given a successful connection, reads the bytes from the client. + + * To underscore the two-way conversation, the server echoes back to the client the bytes received from the client. These bytes are ASCII character codes, which make up book titles. + + * The client writes book titles to the server process and then reads the same titles echoed from the server. Both the server and the client print the titles to the screen. Here is the server's output, essentially the same as the client's: + +``` +Listening on port 9876 for clients... +War and Peace +Pride and Prejudice +The Sound and the Fury +``` + + + + +#### Example 1. The socket server + +``` +#include +#include +#include +#include +#include +#include +#include +#include +#include "sock.h" + +void report(const char* msg, int terminate) { +  perror(msg); +  if (terminate) exit(-1); /* failure */ +} + +int main() { +  int fd = socket(AF_INET,     /* network versus AF_LOCAL */ +                  SOCK_STREAM, /* reliable, bidirectional, arbitrary payload size */ +                  0);          /* system picks underlying protocol (TCP) */ +  if (fd < 0) report("socket", 1); /* terminate */ + +  /* bind the server's local address in memory */ +  struct sockaddr_in saddr; +  memset(&saddr, 0, sizeof(saddr));          /* clear the bytes */ +  saddr.sin_family = AF_INET;                /* versus AF_LOCAL */ +  saddr.sin_addr.s_addr = htonl(INADDR_ANY); /* host-to-network endian */ +  saddr.sin_port = htons(PortNumber);        /* for listening */ + +  if (bind(fd, (struct sockaddr *) &saddr, sizeof(saddr)) < 0) +    report("bind", 1); /* terminate */ + +  /* listen to the socket */ +  if (listen(fd, MaxConnects) < 0) /* listen for clients, up to MaxConnects */ +    report("listen", 1); /* terminate */ + +  fprintf(stderr, "Listening on port %i for clients...\n", PortNumber); +  /* a server traditionally listens indefinitely */ +  while (1) { +    struct sockaddr_in caddr; /* client address */ +    int len = sizeof(caddr);  /* address length could change */ + +    int client_fd = accept(fd, (struct sockaddr*) &caddr, &len);  /* accept blocks */ +    if (client_fd < 0) { +      report("accept", 0); /* don't terminate, though there's a problem */ +      continue; +    } + +    /* read from client */ +    int i; +    for (i = 0; i < ConversationLen; i++) { +      char buffer[BuffSize + 1]; +      memset(buffer, '\0', sizeof(buffer)); +      int count = read(client_fd, buffer, sizeof(buffer)); +      if (count > 0) { +        puts(buffer); +        write(client_fd, buffer, sizeof(buffer)); /* echo as confirmation */ +      } +    } +    close(client_fd); /* break connection */ +  }  /* while(1) */ +  return 0; +} +``` + +The server program above performs the classic four-step to ready itself for client requests and then to accept individual requests. Each step is named after a system function that the server calls: + + 1. **socket(…)** : get a file descriptor for the socket connection + 2. **bind(…)** : bind the socket to an address on the server's host + 3. **listen(…)** : listen for client requests + 4. **accept(…)** : accept a particular client request + + + +The **socket** call in full is: + +``` +int sockfd = socket(AF_INET,      /* versus AF_LOCAL */ +                    SOCK_STREAM,  /* reliable, bidirectional */ +                    0);           /* system picks protocol (TCP) */ +``` + +The first argument specifies a network socket as opposed to an IPC socket. There are several options for the second argument, but **SOCK_STREAM** and **SOCK_DGRAM** (datagram) are likely the most used. A stream-based socket supports a reliable channel in which lost or altered messages are reported; the channel is bidirectional, and the payloads from one side to the other can be arbitrary in size. By contrast, a datagram-based socket is unreliable (best try), unidirectional, and requires fixed-sized payloads. The third argument to **socket** specifies the protocol. For the stream-based socket in play here, there is a single choice, which the zero represents: TCP. Because a successful call to **socket** returns the familiar file descriptor, a socket is written and read with the same syntax as, for example, a local file. + +The **bind** call is the most complicated, as it reflects various refinements in the socket API. The point of interest is that this call binds the socket to a memory address on the server machine. However, the **listen** call is straightforward: + +``` +if (listen(fd, MaxConnects) < 0) +``` + +The first argument is the socket's file descriptor and the second specifies how many client connections can be accommodated before the server issues a connection refused error on an attempted connection. ( **MaxConnects** is set to 8 in the header file sock.h.) + +The **accept** call defaults to a blocking wait: the server does nothing until a client attempts to connect and then proceeds. The **accept** function returns **-1** to indicate an error. If the call succeeds, it returns another file descriptor—for a read/write socket in contrast to the accepting socket referenced by the first argument in the **accept** call. The server uses the read/write socket to read requests from the client and to write responses back. The accepting socket is used only to accept client connections. + +By design, a server runs indefinitely. Accordingly, the server can be terminated with a **Ctrl+C** from the command line. + +#### Example 2. The socket client + +``` +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sock.h" + +const char* books[] = {"War and Peace", +                       "Pride and Prejudice", +                       "The Sound and the Fury"}; + +void report(const char* msg, int terminate) { +  perror(msg); +  if (terminate) exit(-1); /* failure */ +} + +int main() { +  /* fd for the socket */ +  int sockfd = socket(AF_INET,      /* versus AF_LOCAL */ +                      SOCK_STREAM,  /* reliable, bidirectional */ +                      0);           /* system picks protocol (TCP) */ +  if (sockfd < 0) report("socket", 1); /* terminate */ + +  /* get the address of the host */ +  struct hostent* hptr = gethostbyname(Host); /* localhost: 127.0.0.1 */ +  if (!hptr) report("gethostbyname", 1); /* is hptr NULL? */ +  if (hptr->h_addrtype != AF_INET)       /* versus AF_LOCAL */ +    report("bad address family", 1); + +  /* connect to the server: configure server's address 1st */ +  struct sockaddr_in saddr; +  memset(&saddr, 0, sizeof(saddr)); +  saddr.sin_family = AF_INET; +  saddr.sin_addr.s_addr = +     ((struct in_addr*) hptr->h_addr_list[0])->s_addr; +  saddr.sin_port = htons(PortNumber); /* port number in big-endian */ + +  if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) +    report("connect", 1); + +  /* Write some stuff and read the echoes. */ +  puts("Connect to server, about to write some stuff..."); +  int i; +  for (i = 0; i < ConversationLen; i++) { +    if (write(sockfd, books[i], strlen(books[i])) > 0) { +      /* get confirmation echoed from server and print */ +      char buffer[BuffSize + 1]; +      memset(buffer, '\0', sizeof(buffer)); +      if (read(sockfd, buffer, sizeof(buffer)) > 0) +        puts(buffer); +    } +  } +  puts("Client done, about to exit..."); +  close(sockfd); /* close the connection */ +  return 0; +} +``` + +The client program's setup code is similar to the server's. The principal difference between the two is that the client neither listens nor accepts, but instead connects: + +``` +if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) +``` + +The **connect** call might fail for several reasons; for example, the client has the wrong server address or too many clients are already connected to the server. If the **connect** operation succeeds, the client writes requests and then reads the echoed responses in a **for** loop. After the conversation, both the server and the client **close** the read/write socket, although a close operation on either side is sufficient to close the connection. The client exits thereafter but, as noted earlier, the server remains open for business. + +The socket example, with request messages echoed back to the client, hints at the possibilities of arbitrarily rich conversations between the server and the client. Perhaps this is the chief appeal of sockets. It is common on modern systems for client applications (e.g., a database client) to communicate with a server through a socket. As noted earlier, local IPC sockets and network sockets differ only in a few implementation details; in general, IPC sockets have lower overhead and better performance. The communication API is essentially the same for both. + +### Signals + +A signal interrupts an executing program and, in this sense, communicates with it. Most signals can be either ignored (blocked) or handled (through designated code), with **SIGSTOP** (pause) and **SIGKILL** (terminate immediately) as the two notable exceptions. Symbolic constants such as **SIGKILL** have integer values, in this case, 9. + +Signals can arise in user interaction. For example, a user hits **Ctrl+C** from the command line to terminate a program started from the command-line; **Ctrl+C** generates a **SIGTERM** signal. **SIGTERM** for terminate, unlike **SIGKILL** , can be either blocked or handled. One process also can signal another, thereby making signals an IPC mechanism. + +Consider how a multi-processing application such as the Nginx web server might be shut down gracefully from another process. The **kill** function: + +``` +int kill(pid_t pid, int signum); /* declaration */ +``` + +can be used by one process to terminate another process or group of processes. If the first argument to function **kill** is greater than zero, this argument is treated as the pid (process ID) of the targeted process; if the argument is zero, the argument identifies the group of processes to which the signal sender belongs. + +The second argument to **kill** is either a standard signal number (e.g., **SIGTERM** or **SIGKILL** ) or 0, which makes the call to **signal** a query about whether the pid in the first argument is indeed valid. The graceful shutdown of a multi-processing application thus could be accomplished by sending a terminate signal—a call to the **kill** function with **SIGTERM** as the second argument—to the group of processes that make up the application. (The Nginx master process could terminate the worker processes with a call to **kill** and then exit itself.) The **kill** function, like so many library functions, houses power and flexibility in a simple invocation syntax. + +#### Example 3. The graceful shutdown of a multi-processing system + +``` +#include +#include +#include +#include +#include + +void graceful(int signum) { +  printf("\tChild confirming received signal: %i\n", signum); +  puts("\tChild about to terminate gracefully..."); +  sleep(1); +  puts("\tChild terminating now..."); +  _exit(0); /* fast-track notification of parent */ +} + +void set_handler() { +  struct sigaction current; +  sigemptyset(¤t.sa_mask);         /* clear the signal set */ +  current.sa_flags = 0;                  /* enables setting sa_handler, not sa_action */ +  current.sa_handler = graceful;         /* specify a handler */ +  sigaction(SIGTERM, ¤t, NULL);    /* register the handler */ +} + +void child_code() { +  set_handler(); + +  while (1) {   /** loop until interrupted **/ +    sleep(1); +    puts("\tChild just woke up, but going back to sleep."); +  } +} + +void parent_code(pid_t cpid) { +  puts("Parent sleeping for a time..."); +  sleep(5); + +  /* Try to terminate child. */ +  if (-1 == kill(cpid, SIGTERM)) { +    perror("kill"); +    exit(-1); +  } +  wait(NULL); /** wait for child to terminate **/ +  puts("My child terminated, about to exit myself..."); +} + +int main() { +  pid_t pid = fork(); +  if (pid < 0) { +    perror("fork"); +    return -1; /* error */ +  } +  if (0 == pid) +    child_code(); +  else +    parent_code(pid); +  return 0;  /* normal */ +} +``` + +The shutdown program above simulates the graceful shutdown of a multi-processing system, in this case, a simple one consisting of a parent process and a single child process. The simulation works as follows: + + * The parent process tries to fork a child. If the fork succeeds, each process executes its own code: the child executes the function **child_code** , and the parent executes the function **parent_code**. + * The child process goes into a potentially infinite loop in which the child sleeps for a second, prints a message, goes back to sleep, and so on. It is precisely a **SIGTERM** signal from the parent that causes the child to execute the signal-handling callback function **graceful**. The signal thus breaks the child process out of its loop and sets up the graceful termination of both the child and the parent. The child prints a message before terminating. + * The parent process, after forking the child, sleeps for five seconds so that the child can execute for a while; of course, the child mostly sleeps in this simulation. The parent then calls the **kill** function with **SIGTERM** as the second argument, waits for the child to terminate, and then exits. + + + +Here is the output from a sample run: + +``` +% ./shutdown +Parent sleeping for a time... +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child confirming received signal: 15  ## SIGTERM is 15 +        Child about to terminate gracefully... +        Child terminating now... +My child terminated, about to exit myself... +``` + +For the signal handling, the example uses the **sigaction** library function (POSIX recommended) rather than the legacy **signal** function, which has portability issues. Here are the code segments of chief interest: + + * If the call to **fork** succeeds, the parent executes the **parent_code** function and the child executes the **child_code** function. The parent waits for five seconds before signaling the child: + +``` + puts("Parent sleeping for a time..."); +sleep(5); +if (-1 == kill(cpid, SIGTERM)) { +...sleepkillcpidSIGTERM... +``` + +If the **kill** call succeeds, the parent does a **wait** on the child's termination to prevent the child from becoming a permanent zombie; after the wait, the parent exits. + + * The **child_code** function first calls **set_handler** and then goes into its potentially infinite sleeping loop. Here is the **set_handler** function for review: + +``` + void set_handler() { +  struct sigaction current;            /* current setup */ +  sigemptyset(¤t.sa_mask);       /* clear the signal set */ +  current.sa_flags = 0;                /* for setting sa_handler, not sa_action */ +  current.sa_handler = graceful;       /* specify a handler */ +  sigaction(SIGTERM, ¤t, NULL);  /* register the handler */ +} +``` + +The first three lines are preparation. The fourth statement sets the handler to the function **graceful** , which prints some messages before calling **_exit** to terminate. The fifth and last statement then registers the handler with the system through the call to **sigaction**. The first argument to **sigaction** is **SIGTERM** for terminate, the second is the current **sigaction** setup, and the last argument ( **NULL** in this case) can be used to save a previous **sigaction** setup, perhaps for later use. + + + + +Using signals for IPC is indeed a minimalist approach, but a tried-and-true one at that. IPC through signals clearly belongs in the IPC toolbox. + +### Wrapping up this series + +These three articles on IPC have covered the following mechanisms through code examples: + + * Shared files + * Shared memory (with semaphores) + * Pipes (named and unnamed) + * Message queues + * Sockets + * Signals + + + +Even today, when thread-centric languages such as Java, C#, and Go have become so popular, IPC remains appealing because concurrency through multi-processing has an obvious advantage over multi-threading: every process, by default, has its own address space, which rules out memory-based race conditions in multi-processing unless the IPC mechanism of shared memory is brought into play. (Shared memory must be locked in both multi-processing and multi-threading for safe concurrency.) Anyone who has written even an elementary multi-threading program with communication via shared variables knows how challenging it can be to write thread-safe yet clear, efficient code. Multi-processing with single-threaded processes remains a viable—indeed, quite appealing—way to take advantage of today's multi-processor machines without the inherent risk of memory-based race conditions. + +There is no simple answer, of course, to the question of which among the IPC mechanisms is the best. Each involves a trade-off typical in programming: simplicity versus functionality. Signals, for example, are a relatively simple IPC mechanism but do not support rich conversations among processes. If such a conversion is needed, then one of the other choices is more appropriate. Shared files with locking is reasonably straightforward, but shared files may not perform well enough if processes need to share massive data streams; pipes or even sockets, with more complicated APIs, might be a better choice. Let the problem at hand guide the choice. + +Although the sample code ([available on my website][4]) is all in C, other programming languages often provide thin wrappers around these IPC mechanisms. The code examples are short and simple enough, I hope, to encourage you to experiment. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-networking + +作者:[Marty Kalin][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/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Inter-process_communication +[2]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 +[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-2 +[4]: http://condor.depaul.edu/mkalin From 376f4dbadfbd92838874f4f1fc3778b3755e54d9 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Tue, 23 Apr 2019 10:08:26 +0800 Subject: [PATCH 0107/1154] translating --- ...0190409 How To Install And Configure Chrony As NTP Client.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md b/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md index 9f7eb5f66e..3988cda330 100644 --- a/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md +++ b/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ed1f0bada64a9a05642d70f9cdb633bf01219c93 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Tue, 23 Apr 2019 10:18:46 +0800 Subject: [PATCH 0108/1154] Update 20190418 Most data center workers happy with their jobs -- despite the heavy demands.md --- ...orkers happy with their jobs -- despite the heavy demands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md index 5030e830dc..af966b072c 100644 --- a/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md +++ b/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1c3d9ceeaa19bedf66b7b32d914e351d0d9b284d Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Tue, 23 Apr 2019 10:21:44 +0800 Subject: [PATCH 0109/1154] translating --- ... Install And Configure NTP Server And NTP Client In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md index f243fad898..5f67996bda 100644 --- a/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md +++ b/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4849ecee3dbc4dcc4aa2f7a0e02946fdd6aaeb17 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:56:17 +0800 Subject: [PATCH 0110/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20Four?= =?UTF-8?q?=20Methods=20To=20Check=20The=20Default=20Gateway=20Or=20Router?= =?UTF-8?q?=20IP=20Address=20In=20Linux=3F=20sources/tech/20190423=20Four?= =?UTF-8?q?=20Methods=20To=20Check=20The=20Default=20Gateway=20Or=20Router?= =?UTF-8?q?=20IP=20Address=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t Gateway Or Router IP Address In Linux.md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md diff --git a/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md new file mode 100644 index 0000000000..9ecb164307 --- /dev/null +++ b/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -0,0 +1,147 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Four Methods To Check The Default Gateway Or Router IP Address In Linux?) +[#]: via: (https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Four Methods To Check The Default Gateway Or Router IP Address In Linux? +====== + +Your default gateway is the IP address of your router that you should aware of that. + +Typically this is automatically detected by your operating system during installation, if not then you may need to change it. + +If your system not able to ping self then probable it could be a gateway issue and you have to fix it. + +This might happen if you have multiple network adapters or routers on the network. + +A gateway is a router that acts as an access point to passes network data from one networks to another networks. + +The below articles will help you to gather some other information which is similar to this topic. + + * **[9 Methods To Check Your Public IP Address In Linux Command Line][1]** + * **[How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?][2]** + + + +This can be done using below Four commands. + + * **`route Command:`** route command is used to show and manipulate the IP routing table. + * **`ip Command:`** IP command is similar to ifconfig, which is very familiar for assigning Static IP Address, Route & Default Gateway, etc.,. + * **`netstat Command:`** netstat (“network statistics”) is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface + * **`routel Command:`** routel command is used to list routes with pretty output format. + + + +### 1) How To Check The Default Gateway Or Router IP Address In Linux Using route Command? + +route command is used to show and manipulate the IP routing table. + +Its primary use is to set up static routes to specific hosts or networks via an interface once the interface was configured. + +When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables. + +``` +# route +or +# route -n + +Kernel IP routing table +Destination Gateway Genmask Flags Metric Ref Use Iface +default www.routerlogin 0.0.0.0 UG 600 0 0 wlp8s0 +192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp8s0 +``` + +### 2) How To Check The Default Gateway Or Router IP Address In Linux Using ip Command? + +**[IP command][3]** is similar to ifconfig, which is very familiar for assigning Static IP Address, Route & Default Gateway, etc.,. + +ifconfig command was deprecated due to no maintenance since so many years, even though it is still available on most Linux distributions. + +ifconfig command has been replaced by IP command which is very powerful and performing several network administration tasks with one command. + +IP command utility bundled with iproute2 package. By default iproute2 utility pre-installed all the major Linux distribution. + +If no, you can install it by issuing iproute2 on your terminal with help of package manager. + +``` +# ip r +or +# ip route +or +# ip route show + +default via 192.168.1.1 dev wlp8s0 proto dhcp metric 600 +192.168.1.0/24 dev wlp8s0 proto kernel scope link src 192.168.1.6 metric 600 +``` + +### 3) How To Check The Default Gateway Or Router IP Address In Linux Using netstat Command? + +netstat stands for Network Statistics, is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface. + +It lists out all the tcp, udp socket connections and the unix socket connections. + +It is used for diagnosing network problems in the network and to determine the amount of traffic on the network as a performance measurement. + +``` +# netstat -r + +Kernel IP routing table +Destination Gateway Genmask Flags MSS Window irtt Iface +default www.routerlogin 0.0.0.0 UG 0 0 0 wlp8s0 +192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp8s0 +``` + +### 4) How To Check The Default Gateway Or Router IP Address In Linux Using routel Command? + +It used to list routes with pretty output format. These programs are a set of helper scripts you can use instead of raw iproute2 commands. + +The routel script will list routes in a format that some might consider easier to interpret then the ip route list equivalent. + +The routef script does not take any arguments and will simply flush the routing table down the drain. Beware! This means deleting all routes which will make your network unusable! + +``` +# routel + target gateway source proto scope dev tbl + default 192.168.1.1 dhcp wlp8s0 + 192.168.1.0/ 24 192.168.1.6 kernel link wlp8s0 + 127.0.0.0 broadcast 127.0.0.1 kernel link lo local + 127.0.0.0/ 8 local 127.0.0.1 kernel host lo local + 127.0.0.1 local 127.0.0.1 kernel host lo local +127.255.255.255 broadcast 127.0.0.1 kernel link lo local + 192.168.1.0 broadcast 192.168.1.6 kernel link wlp8s0 local + 192.168.1.6 local 192.168.1.6 kernel host wlp8s0 local + 192.168.1.255 broadcast 192.168.1.6 kernel link wlp8s0 local + ::1 kernel lo + fe80::/ 64 kernel wlp8s0 + ::1 local kernel lo local +fe80::ad00:2f7e:d882:5add local kernel wlp8s0 local + ff00::/ 8 wlp8s0 local +``` + +If you would like to print only default gateway then use the following format. + +``` +# routel | grep default + default 192.168.1.1 dhcp wlp8s0 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/ + +作者:[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/check-find-server-public-ip-address-linux/ +[2]: https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/ +[3]: https://www.2daygeek.com/ip-command-configure-network-interface-usage-linux/ From 3d0a302d505eb09f2bd35a41d4fce53573943af4 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:56:30 +0800 Subject: [PATCH 0111/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20How?= =?UTF-8?q?=20To=20Monitor=20Disk=20I/O=20Activity=20Using=20iotop=20And?= =?UTF-8?q?=20iostat=20Commands=20In=20Linux=3F=20sources/tech/20190423=20?= =?UTF-8?q?How=20To=20Monitor=20Disk=20I-O=20Activity=20Using=20iotop=20An?= =?UTF-8?q?d=20iostat=20Commands=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sing iotop And iostat Commands In Linux.md | 341 ++++++++++++++++++ 1 file changed, 341 insertions(+) create mode 100644 sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md diff --git a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md new file mode 100644 index 0000000000..f4084302b8 --- /dev/null +++ b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -0,0 +1,341 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) +[#]: via: (https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat-command/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux? +====== + +Do you know what are the tools we can use for troubleshooting or monitoring real-time disk activity in Linux? + +If **[Linux system performance][1]** gets slow down we may use **[top command][2]** to see the system performance. + +It is used to check what are the processes are consuming high utilization on server. + +It’s common for most of the Linux administrator. + +It’s widely used by Linux administrator in the real world. + +If you don’t see much difference in the process output still you have an option to check other things. + +I would like to advise you to check `wa` status in the top output because most of the time the server performance will be degraded due to high I/O Read and Write on hard disk. + +If it’s high or fluctuation, it could be a cause. So, we need to check I/O activity on hard drive. + +We can monitory disk I/O statistics for all disks and file system in Linux system using `iotop` and `iostat` commands. + +### What Is iotop? + +iotop is a top-like utility for displaying real-time disk activity. + +iotop watches I/O usage information output by the Linux kernel and displays a table of current I/O usage by processes or threads on the system. + +It displays the I/O bandwidth read and written by each process/thread. It also displays the percentage of time the thread/process spent while swapping in and while waiting on I/O. + +Total DISK READ and Total DISK WRITE values represent total read and write bandwidth between processes and kernel threads on the one side and kernel block device subsystem on the other. + +Actual DISK READ and Actual DISK WRITE values represent corresponding bandwidths for actual disk I/O between kernel block device subsystem and underlying hardware (HDD, SSD, etc.). + +### How To Install iotop In Linux? + +We can easily install it with help of package manager since the package is available in all the Linux distributions repository. + +For **`Fedora`** system, use **[DNF Command][3]** to install iotop. + +``` +$ sudo dnf install iotop +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install iotop. + +``` +$ sudo apt install iotop +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install iotop. + +``` +$ sudo pacman -S iotop +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install iotop. + +``` +$ sudo yum install iotop +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install iotop. + +``` +$ sudo zypper install iotop +``` + +### How To Monitor Disk I/O Activity/Statistics In Linux Using iotop Command? + +There are many options are available in iotop command to check varies statistics about disk I/O. + +Run the iotop command without any arguments to see each process or thread current I/O usage. + +``` +# iotop +``` + +[![][9]![][9]][10] + +If you would like to check which process are actually doing IO then run the iotop command with `-o` or `--only` option. + +``` +# iotop --only +``` + +[![][9]![][9]][11] + +**Details:** + + * **`IO:`** It shows I/O utilization for each process, which includes disk and swap. + * **`SWAPIN:`** It shows only the swap usage of each process. + + + +### What Is iostat? + +iostat is used to report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions. + +The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. + +The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks. + +All statistics are reported each time the iostat command is run. The report consists of a CPU header row followed by a row of CPU statistics. + +On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of statistics for each device that is configured. + +The iostat command generates two types of reports, the CPU Utilization report and the Device Utilization report. + +### How To Install iostat In Linux? + +iostat tool is part of sysstat package so, We can easily install it with help of package manager since the package is available in all the Linux distributions repository. + +For **`Fedora`** system, use **[DNF Command][3]** to install sysstat. + +``` +$ sudo dnf install sysstat +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install sysstat. + +``` +$ sudo apt install sysstat +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install sysstat. + +``` +$ sudo pacman -S sysstat +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install sysstat. + +``` +$ sudo yum install sysstat +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install sysstat. + +``` +$ sudo zypper install sysstat +``` + +### How To Monitor Disk I/O Activity/Statistics In Linux Using sysstat Command? + +There are many options are available in iostat command to check varies statistics about disk I/O and CPU. + +Run the iostat command without any arguments to see complete statistics of the system. + +``` +# iostat + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.45 0.02 16.47 0.12 0.00 53.94 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.95 124.97 0.00 58420014 57507206 0 +sda 0.18 6.77 80.24 0.00 3115036 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-d` option to see I/O statistics for all the devices + +``` +# iostat -d + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.95 124.97 0.00 58420030 57509090 0 +sda 0.18 6.77 80.24 0.00 3115292 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-p` option to see I/O statistics for all the devices and their partitions. + +``` +# iostat -p + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.42 0.02 16.45 0.12 0.00 53.99 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.94 124.96 0.00 58420062 57512278 0 +nvme0n1p1 6.40 124.46 118.36 0.00 57279753 54474898 0 +nvme0n1p2 0.27 2.47 6.60 0.00 1138069 3037380 0 +sda 0.18 6.77 80.23 0.00 3116060 36924764 0 +sda1 0.00 0.01 0.00 0.00 3224 0 0 +sda2 0.18 6.76 80.23 0.00 3111508 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +Run the iostat command with `-x` option to see detailed I/O statistics for all the devices. + +``` +# iostat -x + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.41 0.02 16.45 0.12 0.00 54.00 + +Device r/s rkB/s rrqm/s %rrqm r_await rareq-sz w/s wkB/s wrqm/s %wrqm w_await wareq-sz d/s dkB/s drqm/s %drqm d_await dareq-sz aqu-sz %util +nvme0n1 2.45 126.93 0.60 19.74 0.40 51.74 4.23 124.96 5.12 54.76 3.16 29.54 0.00 0.00 0.00 0.00 0.00 0.00 0.31 30.28 +sda 0.06 6.77 0.00 0.00 8.34 119.20 0.12 80.23 19.94 99.40 31.84 670.73 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.13 +loop0 0.00 0.00 0.00 0.00 0.08 19.64 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +``` + +Run the iostat command with `-d [Device_Name]` option to see I/O statistics of particular device and their partitions. + +``` +# iostat -p [Device_Name] + +# iostat -p sda + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.38 0.02 16.43 0.12 0.00 54.05 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +sda 0.18 6.77 80.21 0.00 3117468 36924764 0 +sda2 0.18 6.76 80.21 0.00 3112916 36924764 0 +sda1 0.00 0.01 0.00 0.00 3224 0 0 +``` + +Run the iostat command with `-m` option to see I/O statistics with `MB` for all the devices instead of `KB`. By default it shows the output with KB. + +``` +# iostat -m + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.36 0.02 16.41 0.12 0.00 54.09 + +Device tps MB_read/s MB_wrtn/s MB_dscd/s MB_read MB_wrtn MB_dscd +nvme0n1 6.68 0.12 0.12 0.00 57050 56176 0 +sda 0.18 0.01 0.08 0.00 3045 36059 0 +loop0 0.00 0.00 0.00 0.00 2 0 0 +loop1 0.00 0.00 0.00 0.00 1 0 0 +loop2 0.00 0.00 0.00 0.00 1 0 0 +``` + +Run the iostat command with certain interval then use the following format. In this example, we are going to capture totally two reports at five seconds interval. + +``` +# iostat [Interval] [Number Of Reports] + +# iostat 5 2 + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.35 0.02 16.41 0.12 0.00 54.10 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.89 124.95 0.00 58420116 57525344 0 +sda 0.18 6.77 80.20 0.00 3118492 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 + +avg-cpu: %user %nice %system %iowait %steal %idle + 3.71 0.00 2.51 0.05 0.00 93.73 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 19.00 0.20 311.40 0.00 1 1557 0 +sda 0.20 25.60 0.00 0.00 128 0 0 +loop0 0.00 0.00 0.00 0.00 0 0 0 +loop1 0.00 0.00 0.00 0.00 0 0 0 +loop2 0.00 0.00 0.00 0.00 0 0 0 +``` + +Run the iostat command with `-N` option to see the LVM disk I/O statistics report. + +``` +# iostat -N + +Linux 4.15.0-47-generic (Ubuntu18.2daygeek.com) Thursday 18 April 2019 _x86_64_ (2 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 0.38 0.07 0.18 0.26 0.00 99.12 + +Device tps kB_read/s kB_wrtn/s kB_read kB_wrtn +sda 3.60 57.07 69.06 968729 1172340 +sdb 0.02 0.33 0.00 5680 0 +sdc 0.01 0.12 0.00 2108 0 +2g-2gvol1 0.00 0.07 0.00 1204 0 +``` + +Run the nfsiostat command to see the I/O statistics for Network File System(NFS). + +``` +# nfsiostat +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat-command/ + +作者:[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/monitoring-tools/ +[2]: https://www.2daygeek.com/linux-top-command-linux-system-performance-monitoring-tool/ +[3]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[7]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[8]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[10]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-1.jpg +[11]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-2.jpg From 3c3d25ac60962c30debe641bebeeb0fc955b0318 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:57:14 +0800 Subject: [PATCH 0112/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=202=20?= =?UTF-8?q?new=20apps=20for=20music=20tweakers=20on=20Fedora=20Workstation?= =?UTF-8?q?=20sources/tech/20190422=202=20new=20apps=20for=20music=20tweak?= =?UTF-8?q?ers=20on=20Fedora=20Workstation.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...or music tweakers on Fedora Workstation.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md diff --git a/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md new file mode 100644 index 0000000000..8da9ca4795 --- /dev/null +++ b/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -0,0 +1,148 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (2 new apps for music tweakers on Fedora Workstation) +[#]: via: (https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/) +[#]: author: (Justin W. Flory https://fedoramagazine.org/author/jflory7/) + +2 new apps for music tweakers on Fedora Workstation +====== + +![][1] + +Linux operating systems are great for making unique customizations and tweaks to make your computer work better for you. For example, the [i3 window manager][2] encourages users to think about the different components and pieces that make up the modern Linux desktop. + +Fedora has two new packages of interest for music tweakers: **mpris-scrobbler** and **playerctl**. _mpris-scrobbler_ [tracks your music listening history][3] on a music-tracking service like Last.fm and/or ListenBrainz. _playerctl_ is a command-line [music player controller][4]. + +## _mpris-scrobbler_ records your music listening trends + +_mpris-scrobbler_ is a CLI application to submit play history of your music to a service like [Last.fm][5], [Libre.fm][6], or [ListenBrainz][7]. It listens on the [MPRIS D-Bus interface][8] to detect what’s playing. It connects with several different music clients like spotify-client, [vlc][9], audacious, bmp, [cmus][10], and others. + +![Last.fm last week in music report. Generated from user-submitted listening history.][11] + +### Install and configure _mpris-scrobbler_ + +_mpris-scrobbler_ is available for Fedora 28 or later, as well as the EPEL 7 repositories. Run the following command in a terminal to install it: + +``` +sudo dnf install mpris-scrobbler +``` + +Once it is installed, use _systemctl_ to start and enable the service. The following command starts _mpris-scrobbler_ and always starts it after a system reboot: + +``` +systemctl --user enable --now mpris-scrobbler.service +``` + +### Submit plays to ListenBrainz + +This article explains how to link _mpris-scrobbler_ with a ListenBrainz account. To use Last.fm or Libre.fm, see the [upstream documentation][12]. + +To submit plays to a ListenBrainz server, you need a ListenBrainz API token. If you have an account, get the token from your [profile settings page][13]. When you have a token, run this command to authenticate with your ListenBrainz API token: + +``` +$ mpris-scrobbler-signon token listenbrainz +Token for listenbrainz.org: +``` + +Finally, test it by playing a song in your preferred music client on Fedora. The songs you play appear on your ListenBrainz profile. + +![Basic statistics and play history from a user profile on ListenBrainz. The current track is playing on a Fedora Workstation laptop with mpris-scrobbler.][14] + +## _playerctl_ controls your music playback + +_playerctl_ is a CLI tool to control any music player implementing the MPRIS D-Bus interface. You can easily bind it to keyboard shortcuts or media hotkeys. Here’s how to install it, use it in the command line, and create key bindings for the i3 window manager. + +### Install and use _playerctl_ + +_playerctl_ is available for Fedora 28 or later. Run the following command in a terminal to install it: + +``` +sudo dnf install playerctl +``` + +Now that it’s installed, you can use it right away. Open your preferred music player on Fedora. Next, try the following commands to control playback from a terminal. + +To play or pause the currently playing track: + +``` +playerctl play-pause +``` + +If you want to skip to the next track: + +``` +playerctl next +``` + +For a list of all running players: + +``` +playerctl -l +``` + +To play or pause what’s currently playing, only on the spotify-client app: + +``` +playerctl -p spotify play-pause +``` + +### Create _playerctl_ key bindings in i3wm + +Do you use a window manager like the [i3 window manager?][2] Try using _playerctl_ for key bindings. You can bind different commands to different key shortcuts, like the play/pause buttons on your keyboard. Look at the following [i3wm config excerpt][15] to see how: + +``` +# Media player controls +bindsym XF86AudioPlay exec "playerctl play-pause" +bindsym XF86AudioNext exec "playerctl next" +bindsym XF86AudioPrev exec "playerctl previous" +``` + +## Try it out with your favorite music players + +Need to know more about customizing the music listening experience on Fedora? The Fedora Magazine has you covered. Check out these five cool music players on Fedora: + +> [5 cool music player apps][16] + +Bring order to your music library chaos by sorting and organizing it with MusicBrainz Picard: + +> [Picard brings order to your music library][17] + +* * * + +_Photo by _[ _Frank Septillion_][18]_ on _[_Unsplash_][19]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/ + +作者:[Justin W. Flory][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/jflory7/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/2-music-tweak-apps-816x345.jpg +[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ +[3]: https://github.com/mariusor/mpris-scrobbler +[4]: https://github.com/acrisci/playerctl +[5]: https://www.last.fm/ +[6]: https://libre.fm/ +[7]: https://listenbrainz.org/ +[8]: https://specifications.freedesktop.org/mpris-spec/latest/ +[9]: https://www.videolan.org/vlc/ +[10]: https://cmus.github.io/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/02/Screenshot_2019-04-13-jflory7%E2%80%99s-week-in-music2-1024x500.png +[12]: https://github.com/mariusor/mpris-scrobbler#authenticate-to-the-service +[13]: https://listenbrainz.org/profile/ +[14]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot_2019-04-13-User-jflory-ListenBrainz.png +[15]: https://github.com/jwflory/swiss-army/blob/ba6ac0c71855e33e3caa1ee1fe51c05d2df0529d/roles/apps/i3wm/files/config#L207-L210 +[16]: https://fedoramagazine.org/5-cool-music-player-apps/ +[17]: https://fedoramagazine.org/picard-brings-order-music-library/ +[18]: https://unsplash.com/photos/Qrspubmx6kE?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[19]: https://unsplash.com/search/photos/music?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From fc58536c6dd64640327440fdaa403814d82c00d4 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:57:38 +0800 Subject: [PATCH 0113/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=20Stra?= =?UTF-8?q?wberry:=20A=20Fork=20of=20Clementine=20Music=20Player=20sources?= =?UTF-8?q?/tech/20190422=20Strawberry-=20A=20Fork=20of=20Clementine=20Mus?= =?UTF-8?q?ic=20Player.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...erry- A Fork of Clementine Music Player.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md diff --git a/sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md b/sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md new file mode 100644 index 0000000000..66b0345586 --- /dev/null +++ b/sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Strawberry: A Fork of Clementine Music Player) +[#]: via: (https://itsfoss.com/strawberry-music-player/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Strawberry: A Fork of Clementine Music Player +====== + +In this age of streaming music and cloud services, there are still people who need an application to collect and play their music. If you are such a person, this article should interest you. + +We have earlier covered [Sayonara music player][1]. Today, we will be taking a look at the Strawberry Music Player. + +### Strawberry Music Player: A fork of Clementine + +The [Strawberry Music Player][2] is, quite simply, an application to manage and play your music. + +![Strawberry media library][3] + +Strawberry contains the following list of features: + + * Play and organize music + * Supports WAV, FLAC, WavPack, DSF, DSDIFF, Ogg Vorbis, Speex, MPC, TrueAudio, AIFF, MP4, MP3, ASF and Monkey’s Audio Audio CD playback + * Native desktop notifications + * Support for playlists in multiple formats + * Advanced audio output and device configuration for bit-perfect playback on Linux + * Edit tags on music files + * Fetch tags from [MusicBrainz Picard][4] + * Album cover art from [Last.fm][5], MusicBrainz and Discogs + * Song lyrics from [AudD][6] + * Support for multiple backends + * Audio analyzer + * Audio equalizer + * Transfer music to iPod, iPhone, MTP or mass-storage USB player + * Streaming support for Tidal + * Scrobbler with support for Last.fm, Libre.fm and ListenBrainz + + + +If you take a look at the screenshots, they probably look familiar. That is because Strawberry is a fork of the [Clementine Music Player][7]. Clementine has not been updated since 2016, while the most recent version of Strawberry (0.5.3) was released early April 2019. + +Trivia + +You might think that Strawberry music player is named after the fruit. However, its [creator][8] claims that he has named the project after the band [Strawbs][9]. + +### Installing Strawberry Music player + +Now let’s take a look at how you can install Strawberry on your system. + +#### Ubuntu + +The easiest way to install Strawberry on Ubuntu is to install the [official snap][10]. Just type: + +``` +sudo snap install strawberry +``` + +If you are not a fan of snaps, you can download a .deb file from Strawberry’s GitHub [release page][11]. You can [install the .deb file][12] by double-clicking it and opening it via the Software Center. + +Strawberry is not available in the main [Ubuntu repositories][13]. + +#### Fedora + +Installing Strawberry on Fedora is much simpler. Strawberry is in the Fedora repos, so you just have to type `sudo dnf strawberry`. Strawberry is not available on Flatpak. + +#### Arch + +Just like Fedora, Strawberry is in the Arch repos. All you have to type is `sudo pacman -S strawberry`. The same is true for Manjaro. + +You can find a list of Linux distros that have Strawberry in their repos [here][14]. If you have openSUSE or Mageia, click [here][15]. You can also compile Strawberry from source. + +### Experience with Strawberry Music Player + +![Playing an audio book with Strawberry][16] + +I installed Strawberry on Fedora and Windows. I have used Clementine in the past, so I knew what to expect. I downloaded a number of audiobooks and several [Old Time Radio][17] [shows][18] as I don’t listen to a lot of music. Instead of using a dedicated [audiobook player like Cozy][19], I used Strawberry for listening to these radio shows. + +Once I told Strawberry where my files were located, it quickly imported them. I used [EasyTag][20] to fix some of the MP3 information on the old time radio shows. Strawberry has a tag editor, but EasyTag allows you to edit several folders very quickly. Strawberry undated the media library instantaneously. + +The big plus for me was performance. It loaded quickly and ran well. This might have something to do with the fact that it is not another Electron app. Strawberry is written in good-old-fashioned C++ and Qt 5. No need to load a whole web browser every time you want to play music, or in my case listen to audio dramas. + +I was not able to test the Tidal streaming feature because I don’t have an account. Also, I don’t sync music to my iPod. + +### Final Thoughts + +Strawberry is like a standard music player that makes managing and playing your audio library very easy. + +The features that I miss from Clementine include the option to access your media from cloud storage systems (like Box and Dropbox) and the ability to download podcasts. But then, I don’t store my media in the cloud and I mainly listen to podcasts on my iPod. + +I recommend giving Strawberry a try. You just might like it as much as I do. + +Have you ever used Strawberry? What is your favorite music player/manager? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][21]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/strawberry-music-player/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/sayonara-music-player/ +[2]: https://strawbs.org/ +[3]: https://itsfoss.com/wp-content/uploads/2019/04/strawberry1-800x471.png +[4]: https://itsfoss.com/musicbrainz-picard/ +[5]: https://www.last.fm/ +[6]: https://audd.io/ +[7]: https://www.clementine-player.org/ +[8]: https://github.com/jonaski +[9]: https://en.wikipedia.org/wiki/Strawbs +[10]: https://snapcraft.io/strawberry +[11]: https://github.com/jonaski/strawberry/releases +[12]: https://itsfoss.com/install-deb-files-ubuntu/ +[13]: https://itsfoss.com/ubuntu-repositories/ +[14]: https://repology.org/project/strawberry/versions +[15]: https://download.opensuse.org/repositories/home:/jonaski:/audio/ +[16]: https://itsfoss.com/wp-content/uploads/2019/04/strawberry3-800x471.png +[17]: https://en.wikipedia.org/wiki/Golden_Age_of_Radio +[18]: https://zootradio.com/ +[19]: https://itsfoss.com/cozy-audiobook-player/ +[20]: https://wiki.gnome.org/Apps/EasyTAG +[21]: http://reddit.com/r/linuxusersgroup From 0221efc69594b32d10ecff80ccd61b9869c1731c Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:57:54 +0800 Subject: [PATCH 0114/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=209=20?= =?UTF-8?q?ways=20to=20save=20the=20planet=20sources/tech/20190422=209=20w?= =?UTF-8?q?ays=20to=20save=20the=20planet.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190422 9 ways to save the planet.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20190422 9 ways to save the planet.md diff --git a/sources/tech/20190422 9 ways to save the planet.md b/sources/tech/20190422 9 ways to save the planet.md new file mode 100644 index 0000000000..d3301006cc --- /dev/null +++ b/sources/tech/20190422 9 ways to save the planet.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 ways to save the planet) +[#]: via: (https://opensource.com/article/19/4/save-planet) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce) + +9 ways to save the planet +====== +These ideas have an open source twist. +![][1] + +What can be done to help save the planet? The question can seem depressing at a time when it feels like an individual's contribution isn't enough. But, who are we Earth dwellers if not for a collection of individuals? So, I asked our writer community to share ways that open source software or hardware can be used to make a difference. Here's what I heard back. + +### 9 ways to save the planet with an open source twist + +**1.** **Disable the blinking cursor in your terminal.** + +It might sound silly, but the trivial, blinking cursor can cause up to [2 watts per hour of extra power consumption][2]. To disable it, go to Terminal Settings: Edit > Preferences > Cursor > Cursor blinking > Disabled. + +_Recommended by Mars Toktonaliev_ + +**2\. Reduce your consumption of animal products and processed foods.** + +One way to do this is to add these open source apps to your phone: Daily Dozen, OpenFoodFacts, OpenVegeMap, and Food Restrictions. These apps will help you eat a healthy, plant-based diet, find vegan- and vegetarian-friendly restaurants, and communicate your dietary needs to others, even if they do not speak the same language. To learn more about these apps read [_4 open source apps to support eating a plant-based diet_][3]. + +_Recommendation by Joshua Allen Holm_ + +**3\. Recycle old computers.** + +How? With Linux, of course. Pay it forward by giving creating a new computer for someone who can't one and keep a computer out of the landfill. Here's how we do it at [The Asian Penguins][4]. + +_Recommendation by Stu Keroff_ + +**4\. Turn off devices when you're not using them.** + +Use "smart power strips" that have a "master" outlet and several "controlled" outlets. Plug your PC into the master outlet, and when you turn on the computer, your monitor, printer, and anything else plugged into the controlled outlets turns on too. A simpler, low-tech solution is a power strip with a timer. That's what I use at home. You can use switches on the timer to set a handy schedule to turn the power on and off at specific times. Automatically turn off your network printer when no one is at home. Or for my six-year-old laptop, extend the life of the battery with a schedule to alternate when it's running from wall power (outlet is on) and when it's running from the battery (outlet is off). + +_Recommended by Jim Hall_ + +**5\. Reduce the use of your HVAC system.** + +Sunlight shining through windows adds a lot of heat to your home during the summer. Use Home Assistant to [automatically adjust][5] window blinds and awnings [based on the time of day][6], or even based on the angle of the sun. + +_Recommended by Michael Hrivnak_ + +**6\. Turn your thermostat off or to a lower setting while you're away.** + +If your home thermostat has an "Away" feature, activating it on your way out the door is easy to forget. With a touch of automation, any connected thermostat can begin automatically saving energy while you're not home. [Stataway][7] is one such project that uses your phone's GPS coordinates to determine when it should set your thermostat to "Home" or "Away". + +_Recommended by Michael Hrivnak_ + +**7\. Save computing power for later.** + +I have an idea: Create a script that can read the power output from an alternative energy array (wind and solar) and begin turning on servers (taking them from a power-saving sleep mode to an active mode) in a computing cluster until the overload power is used (whatever excess is produced beyond what can be stored/buffered for later use). Then use the overload power during high-production times for compute-intensive projects like rendering. This process would be essentially free of cost because the power can't be buffered for other uses. I'm sure the monitoring, power management, and server array tools must exist to do this. Then, it's just an integration problem, making it all work together. + +_Recommended by Terry Hancock_ + +**8\. Turn off exterior lights.** + +Light pollution affects more than 80% of the world's population, according to the [World Atlas of Artificial Night Sky Brightness][8], published (Creative Commons Attribution-NonCommercial 4.0) in 2016 in the open access journal _Science Advances_. Turning off exterior lights is a quick way to benefit wildlife, human health, our ability to enjoy the night sky, and of course energy consumption. Visit [darksky.org][9] for more ideas on how to reduce the impact of your exterior lighting. + +_Recommended by Michael Hrivnak_ + +**9\. Reduce your CPU count.** + +For me, I remember I used to have a whole bunch of computers running in my basement as my IT playground/lab. I've become more conscious now of power consumption and so have really drastically reduced my CPU count. I like to take advantage of VMs, zones, containers... that type of technology a lot more these days. Also, I'm really glad that small form factor and SoC computers, such as the Raspberry Pi, exist because I can do a lot with one, such as run a DNS or Web server, without heating the room and running up my electricity bill. + +P.S. All of these computers are running Linux, FreeBSD, or Raspbian! + +_Recommended by Alan Formy-Duvall_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/save-planet + +作者:[Jen Wike Huger ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/pixelated-world.png?itok=fHjM6m53 +[2]: https://www.redhat.com/archives/fedora-devel-list/2009-January/msg02406.html +[3]: https://opensource.com/article/19/4/apps-plant-based-diets +[4]: https://opensource.com/article/19/2/asian-penguins-close-digital-divide +[5]: https://www.home-assistant.io/docs/automation/trigger/#sun-trigger +[6]: https://www.home-assistant.io/components/cover/ +[7]: https://github.com/mhrivnak/stataway +[8]: http://advances.sciencemag.org/content/2/6/e1600377 +[9]: http://darksky.org/ From 79571ebd33fecbb55140baf4eb288f7ae1734c5a Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:58:12 +0800 Subject: [PATCH 0115/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=204=20?= =?UTF-8?q?open=20source=20apps=20for=20plant-based=20diets=20sources/tech?= =?UTF-8?q?/20190422=204=20open=20source=20apps=20for=20plant-based=20diet?= =?UTF-8?q?s.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... open source apps for plant-based diets.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20190422 4 open source apps for plant-based diets.md diff --git a/sources/tech/20190422 4 open source apps for plant-based diets.md b/sources/tech/20190422 4 open source apps for plant-based diets.md new file mode 100644 index 0000000000..6d77b66eea --- /dev/null +++ b/sources/tech/20190422 4 open source apps for plant-based diets.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 open source apps for plant-based diets) +[#]: via: (https://opensource.com/article/19/4/apps-plant-based-diets) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) + +4 open source apps for plant-based diets +====== +These apps make it easier for vegetarians and vegans—and omnivores who +want to eat healthier—to find food they can eat. +![][1] + +Reducing your consumption of meat, dairy, and processed foods is better for the planet and better for your health. Changing your diet can be difficult, but several open source Android applications can help you switch to a more plant-based diet. Whether you are taking part in [Meatless Monday][2], following Mark Bittman's [Vegan Before 6:00][3] guidelines, or switching entirely to a [whole-food, plant-based diet][4], these apps can aid you on your journey by helping you figure out what to eat, discover vegan- and vegetarian-friendly restaurants, and easily communicate your dietary preferences to others. All of these apps are open source and available from the [F-Droid repository][5]. + +### Daily Dozen + +![Daily Dozen app][6] + +The [Daily Dozen][7] app provides a checklist of items that Michael Greger, MD, FACLM, recommends as part of a healthy diet and lifestyle. Dr. Greger recommends consuming a whole-food, plant-based diet consisting of diverse foods and supported by daily exercise. This app lets you keep track of how many servings of each type of food you have eaten, how many servings of water (or other approved beverage, such as tea) you drank, and if you exercised each day. Each category of food provides serving sizes and lists of foods that fall under that category; for example, the Cruciferous Vegetable category includes bok choy, broccoli, brussels sprouts, and many other suggestions. + +### Food Restrictions + +![Food Restrictions app][8] + +[Food Restrictions][9] is a simple app that can help you communicate your dietary restrictions to others, even if those people do not speak your language. Users can enter their food restrictions for seven different categories: chicken, beef, pork, fish, cheese, milk, and peppers. There is an "I don't eat" and an "I'm allergic" option for each of those categories. The "don't eat" option shows the icon with a red X over it. The "allergic" option displays the X and a small skull icon. The same information can be displayed using text instead of icons, but the text is only available in English and Portuguese. There is also an option for displaying a text message that says the user is vegetarian or vegan, which summarizes those dietary restrictions more succinctly and more accurately than the pick-and-choose options. The vegan text clearly mentions not eating eggs and honey, which are not options in the pick-and-choose method. However, just like the text version of the pick-and-choose option, these sentences are only available in English and Portuguese. + +### OpenFoodFacts + +![Open Food Facts app][10] + +Avoiding unwanted ingredients when buying groceries can be frustrating, but [OpenFoodFacts][11] can help make the process easier. This app lets you scan the barcodes on products to get a report about the ingredients in a product and how healthy the product is. A product can still be very unhealthy even if it meets the criteria to be a vegan product. Having both the ingredients list and the nutrition facts lets you make informed choices when shopping. The only drawback for this app is that the data is user contributed, so not every product is available, but you can contribute new items, if you want to give back to the project. + +### OpenVegeMap + +![OpenVegeMap app][12] + +Find vegan and vegetarian restaurants in your neighborhood with the [OpenVegeMap][13] app. This app lets you search by either using your phone's current location or by entering an address. Restaurants are classified as Vegan only, Vegan friendly, Vegetarian only, Vegetarian friendly, Non-vegetarian, and Unknown. The app uses data from [OpenStreetMap][14] and user-contributed information about the restaurants, so be sure to double-check to make sure the information provided is up-to-date and accurate. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/apps-plant-based-diets + +作者:[Joshua Allen Holm ][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/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_041x_0.png?itok=tfg6_I78 +[2]: https://www.meatlessmonday.com/ +[3]: https://www.amazon.com/dp/0385344740/ +[4]: https://nutritionstudies.org/whole-food-plant-based-diet-guide/ +[5]: https://f-droid.org/ +[6]: https://opensource.com/sites/default/files/uploads/daily_dozen.png (Daily Dozen app) +[7]: https://f-droid.org/en/packages/org.nutritionfacts.dailydozen/ +[8]: https://opensource.com/sites/default/files/uploads/food_restrictions.png (Food Restrictions app) +[9]: https://f-droid.org/en/packages/br.com.frs.foodrestrictions/ +[10]: https://opensource.com/sites/default/files/uploads/openfoodfacts.png (Open Food Facts app) +[11]: https://f-droid.org/en/packages/openfoodfacts.github.scrachx.openfood/ +[12]: https://opensource.com/sites/default/files/uploads/openvegmap.png (OpenVegeMap app) +[13]: https://f-droid.org/en/packages/pro.rudloff.openvegemap/ +[14]: https://www.openstreetmap.org/ From 7ebfd4c3b8489080b3283854fdc223f02264bc3b Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:58:25 +0800 Subject: [PATCH 0116/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=208=20?= =?UTF-8?q?environment-friendly=20open=20software=20projects=20you=20shoul?= =?UTF-8?q?d=20know=20sources/tech/20190422=208=20environment-friendly=20o?= =?UTF-8?q?pen=20software=20projects=20you=20should=20know.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... open software projects you should know.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20190422 8 environment-friendly open software projects you should know.md diff --git a/sources/tech/20190422 8 environment-friendly open software projects you should know.md b/sources/tech/20190422 8 environment-friendly open software projects you should know.md new file mode 100644 index 0000000000..0c56347440 --- /dev/null +++ b/sources/tech/20190422 8 environment-friendly open software projects you should know.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (8 environment-friendly open software projects you should know) +[#]: via: (https://opensource.com/article/19/4/environment-projects) +[#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger) + +8 environment-friendly open software projects you should know +====== +Celebrate Earth Day by contributing to these projects dedicated to +improving our environment. +![][1] + +For the last few years, I've been helping [Greenpeace][2] build its first fully open source software project, Planet 4. [Planet 4][3] is a global engagement platform where Greenpeace supporters and activists can interact and engage with the organization. The goal is to drive people to action on behalf of our planet. We want to invite participation and use people power to battle global issues like climate change and plastic pollution. Developers, designers, writers, contributors, and others who are looking for an open source way to support environmentalism are more than welcome to [get involved][4]! + +Planet 4 is far from the only open source project focused on the environment. For Earth Day, I thought I'd share seven other open source projects that have our planet in mind. + +**[Eco Hacker Farm][5]** works to support sustainable communities. It advises and supports projects combining hackerspaces/hackbases and permaculture living. The organization also has online software projects. Visit its [wiki][6] or reach out on [Twitter][7] to learn more about what Eco Hacker Farm is doing. + +**[Public Lab][8]** is an open community and nonprofit organization that works to put science in the hands of citizens. Formed after the BP oil disaster in 2010, Public Lab works with open source to aid environmental exploration and investigation. It's a diverse community with lots of ways to [contribute][9]. + +A while back, Don Watkins, a community moderator here on Opensource.com, wrote about **[Open Climate Workbench][10]** , a project from the Apache Foundation. The [OCW][11] provides software to do climate modeling and evaluation, which can have all sorts of applications. + +**[Open Source Ecology][12]** is a project that aims to improve how our economy functions. With an eye on environmental regeneration and social justice, the project seeks to redefine some of our dirty production and distribution techniques to create a more sustainable civilization. + +Fostering collaboration around open source and big data tools to enable research in ocean, atmosphere, land, and climate, " **[Pangeo][13]** is first and foremost a community promoting open, reproducible, and scalable science." Big data can change the world! + +**[**Leaflet**][14]** is a well-known open source JavaScript library. It can be used for all sorts of things, including environmentally friendly projects like the [Arctic Web Map][15], which allows scientists to accurately visualize and analyze the arctic region, a critical ability for climate research. + +And of course, no list would be complete (not that this is a complete list!) without pointing to my friends at Mozilla. The **[Mozilla Science Lab][16]** community is, like all of Mozilla, fiercely open, and it's committed to bringing open source principles to the scientific community. Its projects and communities enable scientists to do the sorts of research our world needs to address some of the most pervasive environmental issues. + +### How you can contribute + +This Earth Day, make a six-month commitment to contribute some of your time to an open source project that helps fight climate change or otherwise encourages people to step up for Mother Earth. There must be scores of environmentally minded open source projects out there, so please leave your favorites in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/environment-projects + +作者:[Laura Hilliger][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/laurahilliger +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE +[2]: http://www.greenpeace.org +[3]: http://medium.com/planet4 +[4]: https://planet4.greenpeace.org/community/#partners-open-sourcers +[5]: https://wiki.ecohackerfarm.org/start +[6]: https://wiki.ecohackerfarm.org/ +[7]: https://twitter.com/EcoHackerFarm +[8]: https://publiclab.org/ +[9]: https://publiclab.org/contribute +[10]: https://opensource.com/article/17/1/apache-open-climate-workbench +[11]: https://climate.apache.org/ +[12]: https://wiki.opensourceecology.org/wiki/Project_needs +[13]: http://pangeo.io/ +[14]: https://leafletjs.com/ +[15]: https://webmap.arcticconnect.ca/#ac_3573/2/20.8/-65.5 +[16]: https://science.mozilla.org/ From e0c4c2c25045dd0229a828ef732ddcdc203b5414 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 23 Apr 2019 12:58:37 +0800 Subject: [PATCH 0117/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190422=20Trac?= =?UTF-8?q?king=20the=20weather=20with=20Python=20and=20Prometheus=20sourc?= =?UTF-8?q?es/tech/20190422=20Tracking=20the=20weather=20with=20Python=20a?= =?UTF-8?q?nd=20Prometheus.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... the weather with Python and Prometheus.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20190422 Tracking the weather with Python and Prometheus.md diff --git a/sources/tech/20190422 Tracking the weather with Python and Prometheus.md b/sources/tech/20190422 Tracking the weather with Python and Prometheus.md new file mode 100644 index 0000000000..0e2409dc56 --- /dev/null +++ b/sources/tech/20190422 Tracking the weather with Python and Prometheus.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tracking the weather with Python and Prometheus) +[#]: via: (https://opensource.com/article/19/4/weather-python-prometheus) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Tracking the weather with Python and Prometheus +====== +Create a custom Prometheus integration to keep track of the biggest +cloud provider of all: Mother Earth. +![Tree clouds][1] + +Open source monitoring system [Prometheus][2] has integrations to track many types of time-series data, but if you want an integration that doesn't yet exist, it's easy to build one. An often-used example is a custom integration with a cloud provider that uses the provider's APIs to grab specific metrics. In this example, though, we will integrate with the biggest cloud provider of all: Earth. + +Luckily, the US government already measures the weather and provides an easy API for integrations. Getting the weather forecast for the next hour at Red Hat headquarters is simple. + + +``` +import requests +HOURLY_RED_HAT = "" +def get_temperature(): +result = requests.get(HOURLY_RED_HAT) +return result.json()["properties"]["periods"][0]["temperature"] +``` + +Now that our integration with Earth is done, it's time to make sure Prometheus can understand what we are saying. We can use the [Prometheus Python library][3] to create a registry with one _gauge_ : the temperature at Red Hat HQ. + + +``` +from prometheus_client import CollectorRegistry, Gauge +def prometheus_temperature(num): +registry = CollectorRegistry() +g = Gauge("red_hat_temp", "Temperature at Red Hat HQ", registry=registry) +g.set(num) +return registry +``` + +Finally, we need to connect this to Prometheus in some way. That depends a little on the network topology for Prometheus: whether it is easier for Prometheus to talk to our service, or whether the reverse is easier. + +The first case is the one usually recommended, if possible, so we need to build a web server exposing the registry and then configure Prometheus to _scrape_ it. + +We can build a simple web server with [Pyramid][4]. + + +``` +from pyramid.config import Configurator +from pyramid.response import Response +from prometheus_client import generate_latest, CONTENT_TYPE_LATEST +def metrics_web(request): +registry = prometheus_temperature(get_temperature()) +return Response(generate_latest(registry), +content_type=CONTENT_TYPE_LATEST) +config = Configurator() +config.add_route('metrics', '/metrics') +config.add_view(metrics_web, route_name='metrics') +app = config.make_wsgi_app() +``` + +This can be run with any Web Server Gateway Interface (WSGI) server. For example, we can use **python -m twisted web --wsgi earth.app** to run it, assuming we put the code in **earth.py**. + +Alternatively, if it is easier for our code to connect to Prometheus, we can push it to Prometheus's [Push gateway][5] periodically. + + +``` +import time +from prometheus_client import push_to_gateway +def push_temperature(url): +while True: +registry = prometheus_temperature(get_temperature()) +push_to_gateway(url, "temperature collector", registry) +time.sleep(60*60) +``` + +The URL is the one for the Push gateway; it often ends in **:9091**. + +Good luck building your own custom Prometheus integration so you can track all the things! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/weather-python-prometheus + +作者:[Moshe Zadka ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds) +[2]: https://prometheus.io/ +[3]: https://github.com/prometheus/client_python +[4]: https://trypyramid.com/ +[5]: https://github.com/prometheus/pushgateway From a4bd28fe3ad395a008d9f02d38091a6e72ff47e0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 23 Apr 2019 13:04:44 +0800 Subject: [PATCH 0118/1154] PRF:20190409 Four Methods To Add A User To Group In Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @NeverKnowsTomorrow 恭喜你,完成了第一篇翻译,是我校对晚了。 --- ...Methods To Add A User To Group In Linux.md | 114 ++++++++---------- 1 file changed, 52 insertions(+), 62 deletions(-) diff --git a/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md b/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md index 23c3a51c9b..0ada08206b 100644 --- a/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md +++ b/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md @@ -1,46 +1,38 @@ [#]: collector: (lujun9972) -[#]: translator: ( NeverKnowsTomorrow ) -[#]: reviewer: ( ) +[#]: translator: (NeverKnowsTomorrow) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Four Methods To Add A User To Group In Linux) [#]: via: (https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -在 Linux 中添加用户到组的四个方法 +在 Linux 中把用户添加到组的四个方法 ====== -Linux 组是用于管理 Linux 中用户帐户的组织单位。 +Linux 组是用于管理 Linux 中用户帐户的组织单位。对于 Linux 系统中的每一个用户和组,它都有惟一的数字标识号。它被称为 用户 ID(UID)和组 ID(GID)。组的主要目的是为组的成员定义一组特权。它们都可以执行特定的操作,但不能执行其他操作。 -对于 Linux 系统中的每一个用户和组,它都有惟一的数字标识号。 +Linux 中有两种类型的默认组。每个用户应该只有一个 主要组primary group 和任意数量的 次要组secondary group。 -它被称为 userid (UID) 和 groupid (GID)。组的主要目的是为组的成员定义一组特权。 - -它们都可以执行特定的操作,但不能执行其他操作。 - -Linux 中有两种类型的默认组可用。每个用户应该只有一个 主要组primary group 和任意数量的 次要组secondary group。 - - * **主要组:** 创建用户帐户时,已将主组添加到用户。它通常是用户的名称。在执行诸如创建新文件(或目录)、修改文件或执行命令等任何操作时,主组将应用于用户。用户主要组信息存储在 `/etc/passwd` 文件中。 - * **次要组:** 它被称为次要组。它允许用户组在同一组成员文件中执行特定操作。 - -例如,如果你希望允许少数用户运行 apache(httpd)服务命令,那么它将非常适合。 +* **主要组:** 创建用户帐户时,已将主要组添加到用户。它通常是用户的名称。在执行诸如创建新文件(或目录)、修改文件或执行命令等任何操作时,主要组将应用于用户。用户的主要组信息存储在 `/etc/passwd` 文件中。 +* **次要组:** 它被称为次要组。它允许用户组在同一组成员文件中执行特定操作。例如,如果你希望允许少数用户运行 Apache(httpd)服务命令,那么它将非常适合。 你可能对以下与用户管理相关的文章感兴趣。 - * 在 Linux 中创建用户帐户的三种方法? - * 如何在 Linux 中创建批量用户? - * 如何在 Linux 中使用不同的方法更新/更改用户密码? +* [在 Linux 中创建用户帐户的三种方法?][1] +* [如何在 Linux 中创建批量用户?][2] +* [如何在 Linux 中使用不同的方法更新/更改用户密码?][3] 可以使用以下四种方法实现。 - * **`usermod:`** usermod 命令修改系统帐户文件,以反映在命令行中指定的更改。 - * **`gpasswd:`** gpasswd 命令用于管理 /etc/group 和 /etc/gshadow。每个组都可以有管理员、成员和密码。 - * **`Shell Script:`** shell 脚本允许管理员自动执行所需的任务。 - * **`Manual Method:`** 我们可以通过编辑 `/etc/group` 文件手动将用户添加到任何组中。 +* `usermod`:修改系统帐户文件,以反映在命令行中指定的更改。 +* `gpasswd`:用于管理 `/etc/group` 和 `/etc/gshadow`。每个组都可以有管理员、成员和密码。 +* Shell 脚本:可以让管理员自动执行所需的任务。 +* 手动方式:我们可以通过编辑 `/etc/group` 文件手动将用户添加到任何组中。 -我假设你已经拥有此活动所需的组和用户。在本例中,我们将使用以下用户和组:`user1`、`user2`、`user3`,group 是 `mygroup` 和 `mygroup1`。 +我假设你已经拥有此操作所需的组和用户。在本例中,我们将使用以下用户和组:`user1`、`user2`、`user3`,另外的组是 `mygroup` 和 `mygroup1`。 -在进行更改之前,我想检查用户和组信息。详见下文。 +在进行更改之前,我希望检查一下用户和组信息。详见下文。 我可以看到下面的用户与他们自己的组关联,而不是与其他组关联。 @@ -65,15 +57,15 @@ mygroup:x:1012: mygroup1:x:1013: ``` -### 方法 1:什么是 usermod 命令? +### 方法 1:使用 usermod 命令 -usermod 命令修改系统帐户文件,以反映命令行上指定的更改。 +`usermod` 命令修改系统帐户文件,以反映命令行上指定的更改。 -### 如何使用 usermod 命令将现有的用户添加到次要组或附加组? +#### 如何使用 usermod 命令将现有的用户添加到次要组或附加组? -要将现有用户添加到辅助组,请使用带有 `-g` 选项和组名称的 usermod 命令。 +要将现有用户添加到辅助组,请使用带有 `-g` 选项和组名称的 `usermod` 命令。 -语法 +语法: ``` # usermod [-G] [GroupName] [UserName] @@ -85,18 +77,18 @@ usermod 命令修改系统帐户文件,以反映命令行上指定的更改。 # usermod -a -G mygroup user1 ``` -让我使用 id 命令查看输出。是的,添加成功。 +让我使用 `id` 命令查看输出。是的,添加成功。 ``` # id user1 uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) ``` -### 如何使用 usermod 命令将现有的用户添加到多个次要组或附加组? +#### 如何使用 usermod 命令将现有的用户添加到多个次要组或附加组? -要将现有用户添加到多个次要组中,请使用带有 `-G` 选项的 usermod 命令和带有逗号分隔的组名称。 +要将现有用户添加到多个次要组中,请使用带有 `-G` 选项的 `usermod` 命令和带有逗号分隔的组名称。 -语法 +语法: ``` # usermod [-G] [GroupName1,GroupName2] [UserName] @@ -115,11 +107,11 @@ uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) uid=1009(user2) gid=1009(user2) groups=1009(user2),1012(mygroup),1013(mygroup1) ``` -### 如何改变用户的主要组? +#### 如何改变用户的主要组? -要更改用户的主要组,请使用带有 `-g` 选项和组名称的 usermod 命令。 +要更改用户的主要组,请使用带有 `-g` 选项和组名称的 `usermod` 命令。 -语法 +语法: ``` # usermod [-g] [GroupName] [UserName] @@ -131,22 +123,22 @@ uid=1009(user2) gid=1009(user2) groups=1009(user2),1012(mygroup),1013(mygroup1) # usermod -g mygroup user3 ``` -让我们看看输出。是的,已成功更改。现在,它将 mygroup 显示为 user3 主要组而不是 user3。 +让我们看看输出。是的,已成功更改。现在,显示`user3` 主要组是 `mygroup` 而不是 `user3`。 ``` # id user3 uid=1010(user3) gid=1012(mygroup) groups=1012(mygroup) ``` -### 方法 2:什么是 gpasswd 命令? +### 方法 2:使用 gpasswd 命令 `gpasswd` 命令用于管理 `/etc/group` 和 `/etc/gshadow`。每个组都可以有管理员、成员和密码。 -### 如何使用 gpasswd 命令将现有用户添加到次要组或者附加组? +#### 如何使用 gpasswd 命令将现有用户添加到次要组或者附加组? -要将现有用户添加到次要组,请使用带有 `-M` 选项和组名称的 gpasswd 命令。 +要将现有用户添加到次要组,请使用带有 `-M` 选项和组名称的 `gpasswd` 命令。 -语法 +语法: ``` # gpasswd [-M] [UserName] [GroupName] @@ -158,18 +150,18 @@ uid=1010(user3) gid=1012(mygroup) groups=1012(mygroup) # gpasswd -M user1 mygroup ``` -让我使用 id 命令查看输出。是的,`user1` 已成功添加到 `mygroup` 中。 +让我使用 `id` 命令查看输出。是的,`user1` 已成功添加到 `mygroup` 中。 ``` # id user1 uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) ``` -### 如何使用 gpasswd 命令添加多个用户到次要组或附加组中? +#### 如何使用 gpasswd 命令添加多个用户到次要组或附加组中? -要将多个用户添加到辅助组中,请使用带有 `-M` 选项和组名称的 gpasswd 命令。 +要将多个用户添加到辅助组中,请使用带有 `-M` 选项和组名称的 `gpasswd` 命令。 -语法 +语法: ``` # gpasswd [-M] [UserName1,UserName2] [GroupName] @@ -181,18 +173,18 @@ uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) # gpasswd -M user2,user3 mygroup1 ``` -让我使用 getent 命令查看输出。是的,`user2` 和 `user3` 已成功添加到 `myGroup1` 中。 +让我使用 `getent` 命令查看输出。是的,`user2` 和 `user3` 已成功添加到 `myGroup1` 中。 ``` # getent group mygroup1 mygroup1:x:1013:user2,user3 ``` -### 如何使用 gpasswd 命令从组中删除一个用户? +#### 如何使用 gpasswd 命令从组中删除一个用户? -要从组中删除用户,请使用带有 `-d` 选项的 gpasswd 命令以及用户和组的名称。 +要从组中删除用户,请使用带有 `-d` 选项的 `gpasswd` 命令以及用户和组的名称。 -语法 +语法: ``` # gpasswd [-d] [UserName] [GroupName] @@ -205,11 +197,9 @@ mygroup1:x:1013:user2,user3 Removing user user1 from group mygroup ``` -### 方法 3:使用 Shell 脚本? +### 方法 3:使用 Shell 脚本 -基于上面的例子,我知道 `usermod` 命令没有能力将多个用户添加到组中,但是可以通过 `gpasswd` 命令完成。 - -但是,它将覆盖当前与组关联的现有用户。 +基于上面的例子,我知道 `usermod` 命令没有能力将多个用户添加到组中,可以通过 `gpasswd` 命令完成。但是,它将覆盖当前与组关联的现有用户。 例如,`user1` 已经与 `mygroup` 关联。如果要使用 `gpasswd` 命令将 `user2` 和 `user3` 添加到 `mygroup` 中,它将不会按预期生效,而是对组进行修改。 @@ -219,9 +209,9 @@ Removing user user1 from group mygroup 因此,我们需要编写一个小的 shell 脚本来实现这一点。 -### 如何使用 gpasswd 命令将多个用户添加到次要组或附加组? +#### 如何使用 gpasswd 命令将多个用户添加到次要组或附加组? -如果要使用 gpasswd 命令将多个用户添加到次要组或附加组,请创建以下小的 shell 脚本。 +如果要使用 `gpasswd` 命令将多个用户添加到次要组或附加组,请创建以下 shell 脚本。 创建用户列表。每个用户应该在单独的行中。 @@ -256,16 +246,16 @@ done # sh group-update.sh ``` -让我看看使用 getent 命令的输出。 是的,`user1`,`user2` 和 `user3` 已成功添加到 `mygroup` 中。 +让我看看使用 `getent` 命令的输出。 是的,`user1`、`user2` 和 `user3` 已成功添加到 `mygroup` 中。 ``` # getent group mygroup mygroup:x:1012:user1,user2,user3 ``` -### 如何使用 gpasswd 命令将多个用户添加到多个次要组或附加组? +#### 如何使用 gpasswd 命令将多个用户添加到多个次要组或附加组? -如果要使用 gpasswd 命令将多个用户添加到多个次要组或附加组中,请创建以下小的 shell 脚本。 +如果要使用 `gpasswd` 命令将多个用户添加到多个次要组或附加组中,请创建以下 shell 脚本。 创建用户列表。每个用户应该在单独的行中。 @@ -308,21 +298,21 @@ done # sh group-update-1.sh ``` -让我看看使用 getent 命令的输出。 是的,`user1`,`user2` 和 `user3` 已成功添加到 `mygroup` 中。 +让我看看使用 `getent` 命令的输出。 是的,`user1`、`user2` 和 `user3` 已成功添加到 `mygroup` 中。 ``` # getent group mygroup mygroup:x:1012:user1,user2,user3 ``` -此外,`user1`,`user2` 和 `user3` 已成功添加到 `mygroup1` 中。 +此外,`user1`、`user2` 和 `user3` 已成功添加到 `mygroup1` 中。 ``` # getent group mygroup1 mygroup1:x:1013:user1,user2,user3 ``` -### 方法 4:在 Linux 中将用户添加到组中的手动方法? +### 方法 4:在 Linux 中将用户添加到组中的手动方法 我们可以通过编辑 `/etc/group` 文件手动将用户添加到任何组中。 @@ -339,7 +329,7 @@ via: https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-us 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[NeverKnowsTomorrow](https://github.com/NeverKnowsTomorrow) -校对:[校对者 ID](https://github.com/校对者 ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 From 3db3d1b4a3318fe69dd15ae20eb49f2dd7747ec8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 23 Apr 2019 13:05:52 +0800 Subject: [PATCH 0119/1154] PUB:20190409 Four Methods To Add A User To Group In Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ NeverKnowsTomorrow 本文首发地址: https://linux.cn/article-10768-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/NeverKnowsTomorrow 请注册领取 LCCN: https://lctt.linux.cn/ --- .../20190409 Four Methods To Add A User To Group In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 Four Methods To Add A User To Group In Linux.md (99%) diff --git a/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md b/published/20190409 Four Methods To Add A User To Group In Linux.md similarity index 99% rename from translated/tech/20190409 Four Methods To Add A User To Group In Linux.md rename to published/20190409 Four Methods To Add A User To Group In Linux.md index 0ada08206b..bb222efdae 100644 --- a/translated/tech/20190409 Four Methods To Add A User To Group In Linux.md +++ b/published/20190409 Four Methods To Add A User To Group In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (NeverKnowsTomorrow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10768-1.html) [#]: subject: (Four Methods To Add A User To Group In Linux) [#]: via: (https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 3a2cbdfb778018200573f8033a04d2fb834a49a2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 00:09:08 +0800 Subject: [PATCH 0120/1154] PRF:20161106 Myths about -dev-urandom.md part --- .../tech/20161106 Myths about -dev-urandom.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/translated/tech/20161106 Myths about -dev-urandom.md b/translated/tech/20161106 Myths about -dev-urandom.md index 118c6426f2..dca61fea30 100644 --- a/translated/tech/20161106 Myths about -dev-urandom.md +++ b/translated/tech/20161106 Myths about -dev-urandom.md @@ -7,31 +7,31 @@ **`/dev/urandom` 不安全。加密用途必须使用 `/dev/random`** -事实:`/dev/urandom` 才是类 Unix 操作系统下推荐的加密种子。 +*事实*:`/dev/urandom` 才是类 Unix 操作系统下推荐的加密种子。 **`/dev/urandom` 是伪随机数生成器pseudo random number generator(PRND),而 `/dev/random` 是“真”随机数生成器。** -事实:它们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。它们之间细微的差别和“真”不“真”随机完全无关 +事实:它们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。它们之间细微的差别和“真”“不真”随机完全无关。 **`/dev/random` 在任何情况下都是密码学应用更好地选择。即便 `/dev/urandom` 也同样安全,我们还是不应该用它。** -事实:`/dev/random` 有个很恶心人的问题:它是阻塞的。(LCTT 译注:意味着请求都得逐个执行,等待前一个请求完成) +*事实*:`/dev/random` 有个很恶心人的问题:它是阻塞的。(LCTT 译注:意味着请求都得逐个执行,等待前一个请求完成) -**但阻塞不是好事吗!`/dev/random` 只会给出电脑收集的信息熵足以支持的随机量。`/dev/urandom` 在用完了所有熵的情况下还会不断吐不安全的随机数给你。** +**但阻塞不是好事吗!`/dev/random` 只会给出电脑收集的信息熵足以支持的随机量。`/dev/urandom` 在用完了所有熵的情况下还会不断吐出不安全的随机数给你。** -事实:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 位的熵就足以生成计算上安全的随机数很长、很长的一段时间了。 +*事实*:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 位的熵就足以生成计算上安全的随机数很长、很长的一段时间了。 问题的关键还在后头:`/dev/random` 怎么知道有系统会*多少*可用的信息熵?接着看! **但密码学家老是讨论重新选种子(re-seeding)。这难道不和上一条冲突吗?** -事实:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。 +*事实*:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。 这样说吧,我没有说引入新的信息熵是坏的。更多的熵肯定更好。我只是说在熵池低的时候阻塞是没必要的。 **好,就算你说的都对,但是 `/dev/(u)random` 的 man 页面和你说的也不一样啊!到底有没有专家同意你说的这堆啊?** -事实:其实 man 页面和我说的不冲突。它看似好像在说 `/dev/urandom` 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道它说的并不是这个意思。 +*事实*:其实 man 页面和我说的不冲突。它看似好像在说 `/dev/urandom` 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道它说的并不是这个意思。 man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也没问题,但绝对不是说必要的),但它也推荐在大多数“一般”的密码学应用下使用 `/dev/urandom` 。 @@ -61,13 +61,13 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 ### 真随机 -什么叫一个随机变量是“真随机的”? +随机数是“真正随机”是什么意思? -我不想搞的太复杂以至于变成哲学范畴的东西。这种讨论很容易走偏因为随机模型大家见仁见智,讨论很快变得毫无意义。 +我不想搞的太复杂以至于变成哲学范畴的东西。这种讨论很容易走偏因为对于随机模型大家见仁见智,讨论很快变得毫无意义。 在我看来“真随机”的“试金石”是量子效应。一个光子穿过或不穿过一个半透镜。或者观察一个放射性粒子衰变。这类东西是现实世界最接近真随机的东西。当然,有些人也不相信这类过程是真随机的,或者这个世界根本不存在任何随机性。这个就百家争鸣了,我也不好多说什么了。 -密码学家一般都会通过不去讨论什么是“真随机”来避免这种争论。它们更关心的是不可预测性 unpredictability。只要没有*任何*方法能猜出下一个随机数就可以了。所以当你以密码学应用为前提讨论一个随机数好不好的时候,在我看来这才是最重要的。 +密码学家一般都会通过不去讨论什么是“真随机”来避免这种哲学辩论。他们更关心的是不可预测性unpredictability。只要没有*任何*方法能猜出下一个随机数就可以了。所以当你以密码学应用为前提讨论一个随机数好不好的时候,在我看来这才是最重要的。 无论如何,我不怎么关心“哲学上安全”的随机数,这也包括别人嘴里的“真”随机数。 @@ -75,23 +75,23 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 但就让我们退一步说,你有了一个“真”随机变量。你下一步做什么呢? -你把它们打印出来然后挂在墙上来展示量子宇宙的美与和谐?牛逼!我很理解你。 +你把它们打印出来然后挂在墙上来展示量子宇宙的美与和谐?牛逼!我支持你。 但是等等,你说你要*用*它们?做密码学用途?额,那这就废了,因为这事情就有点复杂了。 -事情是这样的,你的真随机,量子力学加护的随机数即将被用进不理想的现实世界程序里。 +事情是这样的,你的真随机、量子力学加护的随机数即将被用进不理想的现实世界算法里去。 -因为我们使用的大多数算法并不是理论信息学information-theoretic上安全的。它们“只能”提供 **计算意义上的安全**。我能想到为数不多的例外就只有 Shamir 密钥分享 和 One-time pad 算法。并且就算前者是名副其实的(如果你实际打算用的话),后者则毫无可行性可言。 +因为我们使用的几乎所有的算法都并不是信息论安全性information-theoretic security 的。它们“只能”提供**计算意义上的安全**。我能想到为数不多的例外就只有 Shamir 密钥分享和一次性密码本One-time pad(OTP)算法。并且就算前者是名副其实的(如果你实际打算用的话),后者则毫无可行性可言。 -但所有那些大名鼎鼎的密码学算法,AES、RSA、Diffie-Hellman、椭圆曲线,还有所有那些加密软件包,OpenSSL、GnuTLS、Keyczar、你的操作系统的加密 API,都仅仅是计算意义上的安全的。 +但所有那些大名鼎鼎的密码学算法,AES、RSA、Diffie-Hellman、椭圆曲线,还有所有那些加密软件包,OpenSSL、GnuTLS、Keyczar、你的操作系统的加密 API,都仅仅是计算意义上安全的。 -那区别是什么呢?理论信息学上的安全肯定是安全的,绝对是,其它那些的算法都可能在理论上被拥有无限计算力的穷举破解。我们依然愉快地使用它们因为全世界的计算机加起来都不可能在宇宙年龄的时间里破解,至少现在是这样。而这就是我们文章里说的“不安全”。 +那区别是什么呢?信息论安全的算法肯定是安全的,绝对是,其它那些的算法都可能在理论上被拥有无限计算力的穷举破解。我们依然愉快地使用它们是因为全世界的计算机加起来都不可能在宇宙年龄的时间里破解,至少现在是这样。而这就是我们文章里说的“不安全”。 -除非哪个聪明的家伙破解了算法本身——在只需要极少量计算力的情况下。这也是每个密码学家梦寐以求的圣杯:破解 AES 本身、破解 RSA 本身等等。 +除非哪个聪明的家伙破解了算法本身 —— 在只需要更少量计算力、在今天可实现的计算力的情况下。这也是每个密码学家梦寐以求的圣杯:破解 AES 本身、破解 RSA 本身等等。 所以现在我们来到了更底层的东西:随机数生成器,你坚持要“真随机”而不是“伪随机”。但是没过一会儿你的真随机数就被喂进了你极为鄙视的伪随机算法里了! -真相是,如果我们最先进的 hash 算法被破解了,或者最先进的块加密被破解了,你得到这些那些“哲学上不安全的”甚至无所谓了,因为反正你也没有安全的应用方法了。 +真相是,如果我们最先进的哈希算法被破解了,或者最先进的分组加密算法被破解了,你得到的这些“哲学上不安全”的随机数甚至无所谓了,因为反正你也没有安全的应用方法了。 所以把计算性上安全的随机数喂给你的仅仅是计算性上安全的算法就可以了,换而言之,用 `/dev/urandom`。 @@ -103,7 +103,7 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 ![image: mythical structure of the kernel's random number generator][1] -“真随机数”,尽管可能有点瑕疵,进入操作系统然后它的熵立刻被加入内部熵计数器。然后经过“矫偏”和“漂白”之后它进入内核的熵池,然后 `/dev/random` 和 `/dev/urandom` 从里面生成随机数。 +“真正的随机性”,尽管可能有点瑕疵,进入操作系统然后它的熵立刻被加入内部熵计数器。然后经过“矫偏”和“漂白”之后它进入内核的熵池,然后 `/dev/random` 和 `/dev/urandom` 从里面生成随机数。 “真”随机数生成器,`/dev/random`,直接从池里选出随机数,如果熵计数器表示能满足需要的数字大小,那就吐出数字并且减少熵计数。如果不够的话,它会阻塞程序直至有足够的熵进入系统。 From 699898034104b3abd6116a3be5dee0af5883151e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 08:28:46 +0800 Subject: [PATCH 0121/1154] PRF:20190208 Which programming languages should you learn.md @MjSeven --- ... programming languages should you learn.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/translated/talk/20190208 Which programming languages should you learn.md b/translated/talk/20190208 Which programming languages should you learn.md index 8806b8cfc0..b0dcb5564e 100644 --- a/translated/talk/20190208 Which programming languages should you learn.md +++ b/translated/talk/20190208 Which programming languages should you learn.md @@ -1,33 +1,34 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Which programming languages should you learn?) [#]: via: (https://opensource.com/article/19/2/which-programming-languages-should-you-learn) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) -应该学习哪种编程语言? +你应该学习哪种编程语言? ====== -学习一门新的编程语言是在你的职业生涯中继续前进的好方法,但是应该学习哪一门呢? + +> 学习一门新的编程语言是在你的职业生涯中继续前进的好方法,但是应该学习哪一门呢? + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0) -如果你想要在编程生涯中起步或继续前进,那么学习一门新语言是一个聪明的主意。但是,大量活跃使用的语言引发了一个问题:哪种编程语言是最好学习的?要回答这个问题,让我们从一个简单的问题开始:你想做什么样的程序? +如果你想要开始你的编程生涯或继续前进,那么学习一门新语言是一个聪明的主意。但是,大量活跃使用的语言引发了一个问题:哪种编程语言是最好的?要回答这个问题,让我们从一个简单的问题开始:你想做什么样的程序? -如果你想在客户端进行网络编程,那么特定语言 HTML、CSS 和 JavaScript(一种看似无穷无尽的方言)是必须要学习的。 - +如果你想在客户端进行网络编程,那么特定语言 HTML、CSS 和 JavaScript(看似无穷无尽的方言之一)是必须要学习的。 -如果你想在服务器端进行 Web 编程,那么选项包括常见的通用语言:C++, Golang, Java, C#, Node.js, Perl, Python, Ruby 等等。当然,服务器程序与数据存储(例如关系数据库和其他数据库)打交道,这意味着 SQL 等查询语言可能会发挥作用。 +如果你想在服务器端进行 Web 编程,那么选择包括常见的通用语言:C++、Golang、Java、C#、 Node.js、Perl、Python、Ruby 等等。当然,服务器程序与数据存储(例如关系数据库和其他数据库)打交道,这意味着 SQL 等查询语言可能会发挥作用。 -如果你正在为移动设备编写本地应用程序,那么了解目标平台非常重要。对于 Apple 设备,Swift 已经取代 Objective C 成为首选语言。对于 Android 设备,Java(带有专用库和工具集)仍然是主要语言。有一些特殊语言,如 与 C# 一起使用的 Xamarin,可以为 Apple、Android 和 Windows 设备生成特定于平台的代码。 +如果你正在为移动设备编写原生应用程序,那么了解目标平台非常重要。对于 Apple 设备,Swift 已经取代 Objective C 成为首选语言。对于 Android 设备,Java(带有专用库和工具集)仍然是主要语言。有一些特殊语言,如与 C# 一起使用的 Xamarin,可以为 Apple、Android 和 Windows 设备生成特定于平台的代码。 -那么通用语言呢?通常有各种各样的选择。在*动态*或*脚本*语言(如 Perl、Python 和 Ruby)中,有一些新东西,如 Node.js。java 和 C# 的相似之处比它们的粉丝愿意承认的还要多,仍然是针对虚拟机(分别是 JVM 和 CLR)的主要*静态编译*语言。在编译为*原生可执行文件*的语言中,C++ 仍然处于混合状态,以及后来的 Golang 和 Rust 等。通用*函数*语言比比皆是(如 Clojure、Haskell、Erlang、F#、Lisp 和 Scala),它们通常都有热情投入的社区。值得注意的是,面向对象语言(如 Java 和 C#)已经添加了函数构造(特别是 lambdas),而动态语言从一开始就有函数构造。 +那么通用语言呢?通常有各种各样的选择。在*动态*或*脚本*语言(如 Perl、Python 和 Ruby)中,有一些新东西,如 Node.js。而 Java 和 C# 的相似之处比它们的粉丝愿意承认的还要多,仍然是针对虚拟机(分别是 JVM 和 CLR)的主要*静态编译*语言。在可以编译为*原生可执行文件*的语言中,C++ 仍在使用,还有后来出现的 Golang 和 Rust 等。通用的*函数式*语言比比皆是(如 Clojure、Haskell、Erlang、F#、Lisp 和 Scala),它们通常都有热情投入的社区。值得注意的是,面向对象语言(如 Java 和 C#)已经添加了函数式构造(特别是 lambdas),而动态语言从一开始就有函数式构造。 -让我以 C 语言结尾,它是一种小巧,优雅,可扩展的语言,不要与 C++ 混淆。现代操作系统主要用 C 语言编写,其余的用汇编语言编写。任何平台上的标准库大多数都是用 C 语言编写的。例如,任何打印 `Hello, world!` 这种问候都是通过调用名为 **write** 的 C 库函数来实现的。 +让我以 C 语言结尾,它是一种小巧、优雅、可扩展的语言,不要与 C++ 混淆。现代操作系统主要用 C 语言编写,其余部分用汇编语言编写。任何平台上的标准库大多数都是用 C 语言编写的。例如,任何打印 `Hello, world!` 这种问候都是通过调用名为 `write` 的 C 库函数来实现的。 -C 作为一种可移植的汇编语言,公开了其他高级语言有意隐藏的底层系统的详细信息。因此,理解 C 可以更好地掌握程序如何竞争执行所需的共享系统资源(如处理器,内存和 I/O 设备)。C 语言既高级又接近硬件,因此在性能方面无与伦比,当然,汇编语言除外。最后,C 是编程语言中的通用语言,几乎所有通用语言都支持一种或另一种形式的 C 调用。 +C 作为一种可移植的汇编语言,公开了其他高级语言有意隐藏的底层系统的详细信息。因此,理解 C 可以更好地掌握程序如何竞争执行所需的共享系统资源(如处理器、内存和 I/O 设备)。C 语言既高级又接近硬件,因此在性能方面无与伦比,当然,汇编语言除外。最后,C 是编程语言中的通用语言,几乎所有通用语言都支持某种形式的 C 调用。 -有关现代 C 语言的介绍,参考我的书籍 [C Programming: Introducing Portable Assembler][1]。无论你怎么做,学习 C 语言,你会学到比另一种编程语言多得多的东西。 +有关现代 C 语言的介绍,参考我的书籍 《[C 语言编程:可移植的汇编器介绍][1]》。无论你怎么做,学习 C 语言,你会学到比另一种编程语言多得多的东西。 你认为学习哪些编程语言很重要?你是否同意这些建议?在评论告知我们! @@ -37,8 +38,8 @@ via: https://opensource.com/article/19/2/which-programming-languages-should-you- 作者:[Marty Kalin][a] 选题:[lujun9972][b] - --> -校对:[校对者ID](https://github.com/校对者ID) +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4c07eab74ce995451f83d28f020e96e1428cc6d7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 08:29:46 +0800 Subject: [PATCH 0122/1154] PUB:20190208 Which programming languages should you learn.md @MjSeven https://linux.cn/article-10769-1.html --- .../20190208 Which programming languages should you learn.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190208 Which programming languages should you learn.md (98%) diff --git a/translated/talk/20190208 Which programming languages should you learn.md b/published/20190208 Which programming languages should you learn.md similarity index 98% rename from translated/talk/20190208 Which programming languages should you learn.md rename to published/20190208 Which programming languages should you learn.md index b0dcb5564e..6535e6cd64 100644 --- a/translated/talk/20190208 Which programming languages should you learn.md +++ b/published/20190208 Which programming languages should you learn.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10769-1.html) [#]: subject: (Which programming languages should you learn?) [#]: via: (https://opensource.com/article/19/2/which-programming-languages-should-you-learn) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) From 088ce7f80776f9042d32c6a4f35e091e44083120 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Wed, 24 Apr 2019 08:30:18 +0800 Subject: [PATCH 0123/1154] [Translated] 20190415 Inter-process communication in Linux- Shared storage.md Signed-off-by: Chang Liu --- ... communication in Linux- Shared storage.md | 419 ----------------- ... communication in Linux- Shared storage.md | 435 ++++++++++++++++++ 2 files changed, 435 insertions(+), 419 deletions(-) delete mode 100644 sources/tech/20190415 Inter-process communication in Linux- Shared storage.md create mode 100644 translated/tech/20190415 Inter-process communication in Linux- Shared storage.md diff --git a/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md b/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md deleted file mode 100644 index de0a8ffdc1..0000000000 --- a/sources/tech/20190415 Inter-process communication in Linux- Shared storage.md +++ /dev/null @@ -1,419 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (FSSlc) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Inter-process communication in Linux: Shared storage) -[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-storage) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) - -Inter-process communication in Linux: Shared storage -====== -Learn how processes synchronize with each other in Linux. -![Filing papers and documents][1] - -This is the first article in a series about [interprocess communication][2] (IPC) in Linux. The series uses code examples in C to clarify the following IPC mechanisms: - - * Shared files - * Shared memory (with semaphores) - * Pipes (named and unnamed) - * Message queues - * Sockets - * Signals - - - -This article reviews some core concepts before moving on to the first two of these mechanisms: shared files and shared memory. - -### Core concepts - -A _process_ is a program in execution, and each process has its own address space, which comprises the memory locations that the process is allowed to access. A process has one or more _threads_ of execution, which are sequences of executable instructions: a _single-threaded_ process has just one thread, whereas a _multi-threaded_ process has more than one thread. Threads within a process share various resources, in particular, address space. Accordingly, threads within a process can communicate straightforwardly through shared memory, although some modern languages (e.g., Go) encourage a more disciplined approach such as the use of thread-safe channels. Of interest here is that different processes, by default, do _not_ share memory. - -There are various ways to launch processes that then communicate, and two ways dominate in the examples that follow: - - * A terminal is used to start one process, and perhaps a different terminal is used to start another. - * The system function **fork** is called within one process (the parent) to spawn another process (the child). - - - -The first examples take the terminal approach. The [code examples][3] are available in a ZIP file on my website. - -### Shared files - -Programmers are all too familiar with file access, including the many pitfalls (non-existent files, bad file permissions, and so on) that beset the use of files in programs. Nonetheless, shared files may be the most basic IPC mechanism. Consider the relatively simple case in which one process ( _producer_ ) creates and writes to a file, and another process ( _consumer_ ) reads from this same file: - - -``` -writes +-----------+ reads -producer-------->| disk file |<\-------consumer -+-----------+ -``` - -The obvious challenge in using this IPC mechanism is that a _race condition_ might arise: the producer and the consumer might access the file at exactly the same time, thereby making the outcome indeterminate. To avoid a race condition, the file must be locked in a way that prevents a conflict between a _write_ operation and any another operation, whether a _read_ or a _write_. The locking API in the standard system library can be summarized as follows: - - * A producer should gain an exclusive lock on the file before writing to the file. An _exclusive_ lock can be held by one process at most, which rules out a race condition because no other process can access the file until the lock is released. - * A consumer should gain at least a shared lock on the file before reading from the file. Multiple _readers_ can hold a _shared_ lock at the same time, but no _writer_ can access a file when even a single _reader_ holds a shared lock. - - - -A shared lock promotes efficiency. If one process is just reading a file and not changing its contents, there is no reason to prevent other processes from doing the same. Writing, however, clearly demands exclusive access to a file. - -The standard I/O library includes a utility function named **fcntl** that can be used to inspect and manipulate both exclusive and shared locks on a file. The function works through a _file descriptor_ , a non-negative integer value that, within a process, identifies a file. (Different file descriptors in different processes may identify the same physical file.) For file locking, Linux provides the library function **flock** , which is a thin wrapper around **fcntl**. The first example uses the **fcntl** function to expose API details. - -#### Example 1. The _producer_ program - - -``` -#include -#include -#include -#include -#include - -#define FileName "data.dat" -#define DataString "Now is the winter of our discontent\nMade glorious summer by this sun of York\n" - -void report_and_exit(const char* msg) { -[perror][4](msg); -[exit][5](-1); /* EXIT_FAILURE */ -} - -int main() { -struct flock lock; -lock.l_type = F_WRLCK; /* read/write (exclusive versus shared) lock */ -lock.l_whence = SEEK_SET; /* base for seek offsets */ -lock.l_start = 0; /* 1st byte in file */ -lock.l_len = 0; /* 0 here means 'until EOF' */ -lock.l_pid = getpid(); /* process id */ - -int fd; /* file descriptor to identify a file within a process */ -if ((fd = open(FileName, O_RDWR | O_CREAT, 0666)) < 0) /* -1 signals an error */ -report_and_exit("open failed..."); - -if (fcntl(fd, F_SETLK, &lock) < 0) /** F_SETLK doesn't block, F_SETLKW does **/ -report_and_exit("fcntl failed to get lock..."); -else { -write(fd, DataString, [strlen][6](DataString)); /* populate data file */ -[fprintf][7](stderr, "Process %d has written to data file...\n", lock.l_pid); -} - -/* Now release the lock explicitly. */ -lock.l_type = F_UNLCK; -if (fcntl(fd, F_SETLK, &lock) < 0) -report_and_exit("explicit unlocking failed..."); - -close(fd); /* close the file: would unlock if needed */ -return 0; /* terminating the process would unlock as well */ -} -``` - -The main steps in the _producer_ program above can be summarized as follows: - - * The program declares a variable of type **struct flock** , which represents a lock, and initializes the structure's five fields. The first initialization: [code]`lock.l_type = F_WRLCK; /* exclusive lock */`[/code] makes the lock an exclusive ( _read-write_ ) rather than a shared ( _read-only_ ) lock. If the _producer_ gains the lock, then no other process will be able to write or read the file until the _producer_ releases the lock, either explicitly with the appropriate call to **fcntl** or implicitly by closing the file. (When the process terminates, any opened files would be closed automatically, thereby releasing the lock.) - * The program then initializes the remaining fields. The chief effect is that the _entire_ file is to be locked. However, the locking API allows only designated bytes to be locked. For example, if the file contains multiple text records, then a single record (or even part of a record) could be locked and the rest left unlocked. - * The first call to **fcntl** : [code]`if (fcntl(fd, F_SETLK, &lock) < 0)`[/code] tries to lock the file exclusively, checking whether the call succeeded. In general, the **fcntl** function returns **-1** (hence, less than zero) to indicate failure. The second argument **F_SETLK** means that the call to **fcntl** does _not_ block: the function returns immediately, either granting the lock or indicating failure. If the flag **F_SETLKW** (the **W** at the end is for _wait_ ) were used instead, the call to **fcntl** would block until gaining the lock was possible. In the calls to **fcntl** , the first argument **fd** is the file descriptor, the second argument specifies the action to be taken (in this case, **F_SETLK** for setting the lock), and the third argument is the address of the lock structure (in this case, **& lock**). - * If the _producer_ gains the lock, the program writes two text records to the file. - * After writing to the file, the _producer_ changes the lock structure's **l_type** field to the _unlock_ value: [code]`lock.l_type = F_UNLCK;`[/code] and calls **fcntl** to perform the unlocking operation. The program finishes up by closing the file and exiting. - - - -#### Example 2. The _consumer_ program - - -``` -#include -#include -#include -#include - -#define FileName "data.dat" - -void report_and_exit(const char* msg) { -[perror][4](msg); -[exit][5](-1); /* EXIT_FAILURE */ -} - -int main() { -struct flock lock; -lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ -lock.l_whence = SEEK_SET; /* base for seek offsets */ -lock.l_start = 0; /* 1st byte in file */ -lock.l_len = 0; /* 0 here means 'until EOF' */ -lock.l_pid = getpid(); /* process id */ - -int fd; /* file descriptor to identify a file within a process */ -if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ -report_and_exit("open to read failed..."); - -/* If the file is write-locked, we can't continue. */ -fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ -if (lock.l_type != F_UNLCK) -report_and_exit("file is still write locked..."); - -lock.l_type = F_RDLCK; /* prevents any writing during the reading */ -if (fcntl(fd, F_SETLK, &lock) < 0) -report_and_exit("can't get a read-only lock..."); - -/* Read the bytes (they happen to be ASCII codes) one at a time. */ -int c; /* buffer for read bytes */ -while (read(fd, &c, 1) > 0) /* 0 signals EOF */ -write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ - -/* Release the lock explicitly. */ -lock.l_type = F_UNLCK; -if (fcntl(fd, F_SETLK, &lock) < 0) -report_and_exit("explicit unlocking failed..."); - -close(fd); -return 0; -} -``` - -The _consumer_ program is more complicated than necessary to highlight features of the locking API. In particular, the _consumer_ program first checks whether the file is exclusively locked and only then tries to gain a shared lock. The relevant code is: - - -``` -lock.l_type = F_WRLCK; -... -fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ -if (lock.l_type != F_UNLCK) -report_and_exit("file is still write locked..."); -``` - -The **F_GETLK** operation specified in the **fcntl** call checks for a lock, in this case, an exclusive lock given as **F_WRLCK** in the first statement above. If the specified lock does not exist, then the **fcntl** call automatically changes the lock type field to **F_UNLCK** to indicate this fact. If the file is exclusively locked, the _consumer_ terminates. (A more robust version of the program might have the _consumer_ **sleep** a bit and try again several times.) - -If the file is not currently locked, then the _consumer_ tries to gain a shared ( _read-only_ ) lock ( **F_RDLCK** ). To shorten the program, the **F_GETLK** call to **fcntl** could be dropped because the **F_RDLCK** call would fail if a _read-write_ lock already were held by some other process. Recall that a _read-only_ lock does prevent any other process from writing to the file, but allows other processes to read from the file. In short, a _shared_ lock can be held by multiple processes. After gaining a shared lock, the _consumer_ program reads the bytes one at a time from the file, prints the bytes to the standard output, releases the lock, closes the file, and terminates. - -Here is the output from the two programs launched from the same terminal with **%** as the command line prompt: - - -``` -% ./producer -Process 29255 has written to data file... - -% ./consumer -Now is the winter of our discontent -Made glorious summer by this sun of York -``` - -In this first code example, the data shared through IPC is text: two lines from Shakespeare's play _Richard III_. Yet, the shared file's contents could be voluminous, arbitrary bytes (e.g., a digitized movie), which makes file sharing an impressively flexible IPC mechanism. The downside is that file access is relatively slow, whether the access involves reading or writing. As always, programming comes with tradeoffs. The next example has the upside of IPC through shared memory, rather than shared files, with a corresponding boost in performance. - -### Shared memory - -Linux systems provide two separate APIs for shared memory: the legacy System V API and the more recent POSIX one. These APIs should never be mixed in a single application, however. A downside of the POSIX approach is that features are still in development and dependent upon the installed kernel version, which impacts code portability. For example, the POSIX API, by default, implements shared memory as a _memory-mapped file_ : for a shared memory segment, the system maintains a _backing file_ with corresponding contents. Shared memory under POSIX can be configured without a backing file, but this may impact portability. My example uses the POSIX API with a backing file, which combines the benefits of memory access (speed) and file storage (persistence). - -The shared-memory example has two programs, named _memwriter_ and _memreader_ , and uses a _semaphore_ to coordinate their access to the shared memory. Whenever shared memory comes into the picture with a _writer_ , whether in multi-processing or multi-threading, so does the risk of a memory-based race condition; hence, the semaphore is used to coordinate (synchronize) access to the shared memory. - -The _memwriter_ program should be started first in its own terminal. The _memreader_ program then can be started (within a dozen seconds) in its own terminal. The output from the _memreader_ is: - - -``` -`This is the way the world ends...` -``` - -Each source file has documentation at the top explaining the link flags to be included during compilation. - -Let's start with a review of how semaphores work as a synchronization mechanism. A general semaphore also is called a _counting semaphore_ , as it has a value (typically initialized to zero) that can be incremented. Consider a shop that rents bicycles, with a hundred of them in stock, with a program that clerks use to do the rentals. Every time a bike is rented, the semaphore is incremented by one; when a bike is returned, the semaphore is decremented by one. Rentals can continue until the value hits 100 but then must halt until at least one bike is returned, thereby decrementing the semaphore to 99. - -A _binary semaphore_ is a special case requiring only two values: 0 and 1. In this situation, a semaphore acts as a _mutex_ : a mutual exclusion construct. The shared-memory example uses a semaphore as a mutex. When the semaphore's value is 0, the _memwriter_ alone can access the shared memory. After writing, this process increments the semaphore's value, thereby allowing the _memreader_ to read the shared memory. - -#### Example 3. Source code for the _memwriter_ process - - -``` -/** Compilation: gcc -o memwriter memwriter.c -lrt -lpthread **/ -#include -#include -#include -#include -#include -#include -#include -#include -#include "shmem.h" - -void report_and_exit(const char* msg) { -[perror][4](msg); -[exit][5](-1); -} - -int main() { -int fd = shm_open(BackingFile, /* name from smem.h */ -O_RDWR | O_CREAT, /* read/write, create if needed */ -AccessPerms); /* access permissions (0644) */ -if (fd < 0) report_and_exit("Can't open shared mem segment..."); - -ftruncate(fd, ByteSize); /* get the bytes */ - -caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ -ByteSize, /* how many bytes */ -PROT_READ | PROT_WRITE, /* access protections */ -MAP_SHARED, /* mapping visible to other processes */ -fd, /* file descriptor */ -0); /* offset: start at 1st byte */ -if ((caddr_t) -1 == memptr) report_and_exit("Can't get segment..."); - -[fprintf][7](stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); -[fprintf][7](stderr, "backing file: /dev/shm%s\n", BackingFile ); - -/* semaphore code to lock the shared mem */ -sem_t* semptr = sem_open(SemaphoreName, /* name */ -O_CREAT, /* create the semaphore */ -AccessPerms, /* protection perms */ -0); /* initial value */ -if (semptr == (void*) -1) report_and_exit("sem_open"); - -[strcpy][8](memptr, MemContents); /* copy some ASCII bytes to the segment */ - -/* increment the semaphore so that memreader can read */ -if (sem_post(semptr) < 0) report_and_exit("sem_post"); - -sleep(12); /* give reader a chance */ - -/* clean up */ -munmap(memptr, ByteSize); /* unmap the storage */ -close(fd); -sem_close(semptr); -shm_unlink(BackingFile); /* unlink from the backing file */ -return 0; -} -``` - -Here's an overview of how the _memwriter_ and _memreader_ programs communicate through shared memory: - - * The _memwriter_ program, shown above, calls the **shm_open** function to get a file descriptor for the backing file that the system coordinates with the shared memory. At this point, no memory has been allocated. The subsequent call to the misleadingly named function **ftruncate** : [code]`ftruncate(fd, ByteSize); /* get the bytes */`[/code] allocates **ByteSize** bytes, in this case, a modest 512 bytes. The _memwriter_ and _memreader_ programs access the shared memory only, not the backing file. The system is responsible for synchronizing the shared memory and the backing file. - * The _memwriter_ then calls the **mmap** function: [code] caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ -ByteSize, /* how many bytes */ -PROT_READ | PROT_WRITE, /* access protections */ -MAP_SHARED, /* mapping visible to other processes */ -fd, /* file descriptor */ -0); /* offset: start at 1st byte */ [/code] to get a pointer to the shared memory. (The _memreader_ makes a similar call.) The pointer type **caddr_t** starts with a **c** for **calloc** , a system function that initializes dynamically allocated storage to zeroes. The _memwriter_ uses the **memptr** for the later _write_ operation, using the library **strcpy** (string copy) function. - * At this point, the _memwriter_ is ready for writing, but it first creates a semaphore to ensure exclusive access to the shared memory. A race condition would occur if the _memwriter_ were writing while the _memreader_ was reading. If the call to **sem_open** succeeds: [code] sem_t* semptr = sem_open(SemaphoreName, /* name */ -O_CREAT, /* create the semaphore */ -AccessPerms, /* protection perms */ -0); /* initial value */ [/code] then the writing can proceed. The **SemaphoreName** (any unique non-empty name will do) identifies the semaphore in both the _memwriter_ and the _memreader_. The initial value of zero gives the semaphore's creator, in this case, the _memwriter_ , the right to proceed, in this case, to the _write_ operation. - * After writing, the _memwriter_ increments the semaphore value to 1: [code]`if (sem_post(semptr) < 0) ..`[/code] with a call to the **sem_post** function. Incrementing the semaphore releases the mutex lock and enables the _memreader_ to perform its _read_ operation. For good measure, the _memwriter_ also unmaps the shared memory from the _memwriter_ address space: [code]`munmap(memptr, ByteSize); /* unmap the storage *`[/code] This bars the _memwriter_ from further access to the shared memory. - - - -#### Example 4. Source code for the _memreader_ process - - -``` -/** Compilation: gcc -o memreader memreader.c -lrt -lpthread **/ -#include -#include -#include -#include -#include -#include -#include -#include -#include "shmem.h" - -void report_and_exit(const char* msg) { -[perror][4](msg); -[exit][5](-1); -} - -int main() { -int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* empty to begin */ -if (fd < 0) report_and_exit("Can't get file descriptor..."); - -/* get a pointer to memory */ -caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ -ByteSize, /* how many bytes */ -PROT_READ | PROT_WRITE, /* access protections */ -MAP_SHARED, /* mapping visible to other processes */ -fd, /* file descriptor */ -0); /* offset: start at 1st byte */ -if ((caddr_t) -1 == memptr) report_and_exit("Can't access segment..."); - -/* create a semaphore for mutual exclusion */ -sem_t* semptr = sem_open(SemaphoreName, /* name */ -O_CREAT, /* create the semaphore */ -AccessPerms, /* protection perms */ -0); /* initial value */ -if (semptr == (void*) -1) report_and_exit("sem_open"); - -/* use semaphore as a mutex (lock) by waiting for writer to increment it */ -if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ -int i; -for (i = 0; i < [strlen][6](MemContents); i++) -write(STDOUT_FILENO, memptr + i, 1); /* one byte at a time */ -sem_post(semptr); -} - -/* cleanup */ -munmap(memptr, ByteSize); -close(fd); -sem_close(semptr); -unlink(BackingFile); -return 0; -} -``` - -In both the _memwriter_ and _memreader_ programs, the shared-memory functions of main interest are **shm_open** and **mmap** : on success, the first call returns a file descriptor for the backing file, which the second call then uses to get a pointer to the shared memory segment. The calls to **shm_open** are similar in the two programs except that the _memwriter_ program creates the shared memory, whereas the _memreader_ only accesses this already created memory: - - -``` -int fd = shm_open(BackingFile, O_RDWR | O_CREAT, AccessPerms); /* memwriter */ -int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* memreader */ -``` - -With a file descriptor in hand, the calls to **mmap** are the same: - - -``` -`caddr_t memptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);` -``` - -The first argument to **mmap** is **NULL** , which means that the system determines where to allocate the memory in virtual address space. It's possible (but tricky) to specify an address instead. The **MAP_SHARED** flag indicates that the allocated memory is shareable among processes, and the last argument (in this case, zero) means that the offset for the shared memory should be the first byte. The **size** argument specifies the number of bytes to be allocated (in this case, 512), and the protection argument indicates that the shared memory can be written and read. - -When the _memwriter_ program executes successfully, the system creates and maintains the backing file; on my system, the file is _/dev/shm/shMemEx_ , with _shMemEx_ as my name (given in the header file _shmem.h_ ) for the shared storage. In the current version of the _memwriter_ and _memreader_ programs, the statement: - - -``` -`shm_unlink(BackingFile); /* removes backing file */` -``` - -removes the backing file. If the **unlink** statement is omitted, then the backing file persists after the program terminates. - -The _memreader_ , like the _memwriter_ , accesses the semaphore through its name in a call to **sem_open**. But the _memreader_ then goes into a wait state until the _memwriter_ increments the semaphore, whose initial value is 0: - - -``` -`if (!sem_wait(semptr)) { /* wait until semaphore != 0 */` -``` - -Once the wait is over, the _memreader_ reads the ASCII bytes from the shared memory, cleans up, and terminates. - -The shared-memory API includes operations explicitly to synchronize the shared memory segment and the backing file. These operations have been omitted from the example to reduce clutter and keep the focus on the memory-sharing and semaphore code. - -The _memwriter_ and _memreader_ programs are likely to execute without inducing a race condition even if the semaphore code is removed: the _memwriter_ creates the shared memory segment and writes immediately to it; the _memreader_ cannot even access the shared memory until this has been created. However, best practice requires that shared-memory access is synchronized whenever a _write_ operation is in the mix, and the semaphore API is important enough to be highlighted in a code example. - -### Wrapping up - -The shared-file and shared-memory examples show how processes can communicate through _shared storage_ , files in one case and memory segments in the other. The APIs for both approaches are relatively straightforward. Do these approaches have a common downside? Modern applications often deal with streaming data, indeed, with massively large streams of data. Neither the shared-file nor the shared-memory approaches are well suited for massive data streams. Channels of one type or another are better suited. Part 2 thus introduces channels and message queues, again with code examples in C. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/interprocess-communication-linux-storage - -作者:[Marty Kalin][a] -选题:[lujun9972][b] -译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) -[2]: https://en.wikipedia.org/wiki/Inter-process_communication -[3]: http://condor.depaul.edu/mkalin -[4]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html -[5]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html -[6]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html diff --git a/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md b/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md new file mode 100644 index 0000000000..3ee39094a6 --- /dev/null +++ b/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md @@ -0,0 +1,435 @@ +[#]: collector: (lujun9972) +[#]: translator: (FSSlc) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inter-process communication in Linux: Shared storage) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-storage) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Linux 下的进程间通信:共享存储 +====== + +学习在 Linux 中进程是如何与其他进程进行同步的。 +![Filing papers and documents][1] + +本篇是 Linux 下[进程间通信][2](IPC)系列的第一篇文章。这个系列将使用 C 语言代码示例来阐明以下 IPC 机制: + + * 共享文件 + * 共享内存(使用信号量) + * 管道(命名的或非命名的管道) + * 消息队列 + * 套接字 + * 信号 + +在聚焦上面提到的共享文件和共享内存这两个机制之前,这篇文章将复习一些核心的概念。 + +### 核心概念 +_进程_ 是运行着的程序,每个进程都有着它自己的地址空间,这些空间由进程被允许获取的内存地址组成。进程有一个或多个执行 _线程_,而线程是一系列执行指令的集合: _单线程_ 进程就只有一个线程,而 _多线程_ 的进程则有多个线程。一个进程中的线程共享各种资源,特别是地址空间。另外,一个进程中的线程可以直接通过共享内存来进行通信,尽管某些现代语言(例如 Go)鼓励一种更有序的方式例如使用线程安全的通道。当然对于不同的进程,默认情况下,它们 _不_ 能共享内存。 + +启动进程后进行通信有多种方法,下面所举的例子中主要使用了下面的两种方法: + + * 一个终端被用来启动一个进程,另外一个不同的终端被用来启动另一个。 + * 在一个进程(父进程)中调用系统函数 **fork**,以此生发另一个进程(子进程)。 + +第一个例子采用了上面使用终端的方法。这些[代码示例][3]的 ZIP 压缩包可以从我的网站下载到。 + +### 共享文件 + +程序员对文件获取问题应该都已经很熟识了,包括许多坑(不存在的文件、文件权限损坏等等),这些问题困扰着程序对文件的使用。尽管如此,共享文件可能是最为基础的 IPC 机制了。考虑一下下面这样一个相对简单的例子,其中一个进程(_生产者_)创建和写入一个文件,然后另一个进程(_消费者_)从这个相同的文件中进行读取: + +``` + writes +-----------+ reads +producer-------->| disk file |<-------consumer + +-----------+ +``` + +在使用这个 IPC 机制时最明显的挑战是 _竞争条件_ 可能会发生:生产者和消费者可能恰好在同一时间访问该文件,从而使得输出结果不确定。为了避免竞争条件的发生,该文件在处于 _读_ 或 _写_ 状态时必须以某种方式处于被锁状态,从而阻止在 _写_ 操作执行时和其他操作的冲突。在标准系统库中与锁相关的 API 可以被总结如下: + + * 生产者应该在写入文件时获得一个文件的排斥锁。一个 _排斥_ 锁最多被一个进程所拥有。这样就可以排除掉竞争条件的发生,因为在锁被释放之前没有其他的进程可以访问这个文件。 + * 消费者应该在从文件中读取内容时得到至少一个共享锁。多个 _readers_ 可以同时保有一个 _共享_ 锁,但是没有 _writer_ 可以获取到文件内容,甚至在当一个单独的 _reader_ 保有一个共享锁时。 + +共享锁可以提升效率。假如一个进程只是读入一个文件的内容,而不去改变它的内容,就没有什么原因阻止其他进程来做同样的事。但如果需要写入内容,则很显然需要文件有排斥锁。 + +标准的 I/O 库中包含一个名为 **fcntl** 的实用函数,它可以被用来检查或者操作一个文件上的排斥锁和共享锁。该函数通过一个 _文件描述符_ (一个在进程中的非负整数值)来标记一个文件(在不同的进程中不同的文件描述符可能标记同一个物理文件)。对于文件的锁定, Linux 提供了名为 **flock** 的库函数,它是 **fcntl** 的一个精简包装。第一个例子中使用 **fcntl** 函数来暴露这些 API 细节。 + +#### 示例 1. _生产者_ 程序 + +```c +#include +#include +#include +#include + +#define FileName "data.dat" + +void report_and_exit(const char* msg) { + [perror][4](msg); + [exit][5](-1); /* EXIT_FAILURE */ +} + +int main() { + struct flock lock; + lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ + lock.l_whence = SEEK_SET; /* base for seek offsets */ + lock.l_start = 0; /* 1st byte in file */ + lock.l_len = 0; /* 0 here means 'until EOF' */ + lock.l_pid = getpid(); /* process id */ + + int fd; /* file descriptor to identify a file within a process */ + if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ + report_and_exit("open to read failed..."); + + /* If the file is write-locked, we can't continue. */ + fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ + if (lock.l_type != F_UNLCK) + report_and_exit("file is still write locked..."); + + lock.l_type = F_RDLCK; /* prevents any writing during the reading */ + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("can't get a read-only lock..."); + + /* Read the bytes (they happen to be ASCII codes) one at a time. */ + int c; /* buffer for read bytes */ + while (read(fd, &c, 1) > 0) /* 0 signals EOF */ + write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ + + /* Release the lock explicitly. */ + lock.l_type = F_UNLCK; + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("explicit unlocking failed..."); + + close(fd); + return 0; +} +``` + +上面 _生产者_ 程序的主要步骤可以总结如下: + + * 这个程序首先声明了一个类型为 **struct flock** 的变量,它代表一个锁,并对它的 5 个域做了初始化。第一个初始化 +```c +lock.l_type = F_WRLCK; /* exclusive lock */ +```` +使得这个锁为排斥锁(_read-write_)而不是一个共享锁(_read-only_)。假如 _生产者_ 获得了这个锁,则其他的进程将不能够对文件做读或者写操作,直到 _生产者_ 释放了这个锁,或者显式地调用 **fcntl**,又或者隐式地关闭这个文件。(当进程终止时,所有被它打开的文件都会被自动关闭,从而释放了锁) + * 上面的程序接着初始化其他的域。主要的效果是 _整个_ 文件都将被锁上。但是,有关锁的 API 允许特别指定的字节被上锁。例如,假如文件包含多个文本记录,则单个记录(或者甚至一个记录的一部分)可以被锁,而其余部分不被锁。 + * 第一次调用 **fcntl** +```c +if (fcntl(fd, F_SETLK, &lock) < 0) +``` +尝试排斥性地将文件锁住,并检查调用是否成功。一般来说, **fcntl** 函数返回 **-1** (因此小于 0)意味着失败。第二个参数 **F_SETLK** 意味着 **fcntl** 的调用 _不是_ 堵塞的;函数立即做返回,要么获得锁,要么显示失败了。假如替换地使用 **F_SETLKW**(末尾的 **W** 代指 _等待_),那么对 **fcntl** 的调用将是阻塞的,直到有可能获得锁的时候。在调用 **fcntl** 函数时,它的第一个参数 **fd** 指的是文件描述符,第二个参数指定了将要采取的动作(在这个例子中,**F_SETLK** 指代设置锁),第三个参数为锁结构的地址(在本例中,指的是 **& lock**)。 + * 假如 _生产者_ 获得了锁,这个程序将向文件写入两个文本记录。 + * 在向文件写入内容后,_生产者_ 改变锁结构中的 **l_type** 域为 _unlock_ 值: +```c +lock.l_type = F_UNLCK; +``` +并调用 **fcntl** 来执行解锁操作。最后程序关闭了文件并退出。 + +#### 示例 2. _消费者_ 程序 + +```c +#include +#include +#include +#include + +#define FileName "data.dat" + +void report_and_exit(const char* msg) { + [perror][4](msg); + [exit][5](-1); /* EXIT_FAILURE */ +} + +int main() { + struct flock lock; + lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ + lock.l_whence = SEEK_SET; /* base for seek offsets */ + lock.l_start = 0; /* 1st byte in file */ + lock.l_len = 0; /* 0 here means 'until EOF' */ + lock.l_pid = getpid(); /* process id */ + + int fd; /* file descriptor to identify a file within a process */ + if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ + report_and_exit("open to read failed..."); + + /* If the file is write-locked, we can't continue. */ + fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ + if (lock.l_type != F_UNLCK) + report_and_exit("file is still write locked..."); + + lock.l_type = F_RDLCK; /* prevents any writing during the reading */ + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("can't get a read-only lock..."); + + /* Read the bytes (they happen to be ASCII codes) one at a time. */ + int c; /* buffer for read bytes */ + while (read(fd, &c, 1) > 0) /* 0 signals EOF */ + write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ + + /* Release the lock explicitly. */ + lock.l_type = F_UNLCK; + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("explicit unlocking failed..."); + + close(fd); + return 0; +} +``` + +相比于着重解释锁的 API,_消费者_ 程序会相对复杂一点儿。特别的,_消费者_ 程序首先检查文件是否被排斥性的被锁,然后才尝试去获得一个共享锁。相关的代码为: + +``` +lock.l_type = F_WRLCK; +... +fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ +if (lock.l_type != F_UNLCK) + report_and_exit("file is still write locked..."); +``` + +在 **fcntl** 调用中的 **F_GETLK** 操作指定检查一个锁,在本例中,上面代码的声明中给了一个 **F_WRLCK** 的排斥锁。假如特指的锁不存在,那么 **fcntl** 调用将会自动地改变锁类型域为 **F_UNLCK** 以此来显示当前的状态。假如文件是排斥性地被锁,那么 _消费者_ 将会终止。(一个更健壮的程序版本或许应该让 _消费者_ _睡_ 会儿,然后再尝试几次。) + +假如当前文件没有被锁,那么 _消费者_ 将尝试获取一个共享(_read-only_)锁(**F_RDLCK**)。为了缩短程序,**fcntl** 中的 **F_GETLK** 调用可以丢弃,因为假如其他进程已经保有一个 _读写_ 锁,**F_RDLCK** 的调用就可能会失败。重新调用一个 _只读_ 锁能够阻止其他进程向文件进行写的操作,但可以允许其他进程对文件进行读取。简而言之,共享锁可以被多个进程所保有。在获取了一个共享锁后,_消费者_ 程序将立即从文件中读取字节数据,然后在标准输出中打印这些字节的内容,接着释放锁,关闭文件并终止。 + +下面的 **%** 为命令行提示符,下面展示的是从相同终端开启这两个程序的输出: + +``` +% ./producer +Process 29255 has written to data file... + +% ./consumer +Now is the winter of our discontent +Made glorious summer by this sun of York +``` + +在本次的代码示例中,通过 IPC 传输的数据是文本:它们来自莎士比亚的戏剧《理查三世》中的两行台词。然而,共享文件的内容还可以是纷繁复杂的,任意的字节数据(例如一个电影)都可以,这使得文件共享变成了一个非常灵活的 IPC 机制。但它的缺点是文件获取速度较慢,因为文件的获取涉及到读或者写。同往常一样,编程总是伴随着折中。下面的例子将通过共享内存来做 IPC,而不是通过共享文件,在性能上相应的有极大的提升。 + +### 共享内存 + +对于共享内存,Linux 系统提供了两类不同的 API:传统的 System V API 和更新一点的 POSIX API。在单个应用中,这些 API 不能混用。但是, POSIX 方式的一个坏处是它的特性仍在发展中,并且依赖于安装的内核版本,这非常影响代码的可移植性。例如, 默认情况下,POSIX API 用 _内存映射文件_ 来实现共享内存:对于一个共享的内存段,系统为相应的内容维护一个 _备份文件_。在 POSIX 规范下共享内存可以被配置为不需要备份文件,但这可能会影响可移植性。我的例子中使用的是带有备份文件的 POSIX API,这既结合了内存获取的速度优势,又获得了文件存储的持久性。 + +下面的共享内存例子中包含两个程序,分别名为 _memwriter_ 和 _memreader_,并使用 _信号量_ 来调整它们对共享内存的获取。在任何时候当共享内存进入一个 _writer_ 的版图时,无论是多进程还是多线程,都有遇到基于内存的竞争条件的风险,所以,需要引入信号量来协调(同步)对共享内存的获取。 + +_memwriter_ 程序应当在它自己所处的终端首先启动,然后 _memreader_ 程序才可以在它自己所处的终端启动(在接着的十几秒内)。_memreader_ 的输出如下: + +``` +This is the way the world ends... +``` + +在每个源程序的最上方注释部分都解释了在编译它们时需要添加的链接参数。 + +首先让我们复习一下信号量是如何作为一个同步机制工作的。一般的信号量也被叫做一个 _计数信号量_,因为带有一个可以增加的值(通常初始化为 0)。考虑一家租用自行车的商店,在它的库存中有 100 辆自行车,还有一个供职员用于租赁的程序。每当一辆自行车被租出去,信号量就增加 1;当一辆自行车被还回来,信号量就减 1。在信号量的值为 100 之前都还可以进行租赁业务,但如果等于 100 时,就必须停止业务,直到至少有一辆自行车被还回来,从而信号量减为 99。 + +_二元信号量_ 是一个特例,它只有两个值: 0 和 1。在这种情况下,信号量的表现为 _互斥量_(一个互斥的构造)。下面的共享内存示例将把信号量用作互斥量。当信号量的值为 0 时,只有 _memwriter_ 可以获取共享内存,在写操作完成后,这个进程将增加信号量的值,从而允许 _memreader_ 来读取共享内存。 + +#### 示例 3. _memwriter_ 进程的源程序 + +```c +/** Compilation: gcc -o memwriter memwriter.c -lrt -lpthread **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "shmem.h" + +void report_and_exit(const char* msg) { + [perror][4](msg); + [exit][5](-1); +} + +int main() { + int fd = shm_open(BackingFile, /* name from smem.h */ + O_RDWR | O_CREAT, /* read/write, create if needed */ + AccessPerms); /* access permissions (0644) */ + if (fd < 0) report_and_exit("Can't open shared mem segment..."); + + ftruncate(fd, ByteSize); /* get the bytes */ + + caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ + if ((caddr_t) -1 == memptr) report_and_exit("Can't get segment..."); + + [fprintf][7](stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); + [fprintf][7](stderr, "backing file: /dev/shm%s\n", BackingFile ); + + /* semahore code to lock the shared mem */ + sem_t* semptr = sem_open(SemaphoreName, /* name */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ + if (semptr == (void*) -1) report_and_exit("sem_open"); + + [strcpy][8](memptr, MemContents); /* copy some ASCII bytes to the segment */ + + /* increment the semaphore so that memreader can read */ + if (sem_post(semptr) < 0) report_and_exit("sem_post"); + + sleep(12); /* give reader a chance */ + + /* clean up */ + munmap(memptr, ByteSize); /* unmap the storage */ + close(fd); + sem_close(semptr); + shm_unlink(BackingFile); /* unlink from the backing file */ + return 0; +} +``` + +下面是 _memwriter_ 和 _memreader_ 程序如何通过共享内存来通信的一个总结: + + * 上面展示的 _memwriter_ 程序调用 **shm_open** 函数来得到作为系统协调共享内存的备份文件的文件描述符。此时,并没有内存被分配。接下来调用的是令人误解的名为 **ftruncate** 的函数 +```c +ftruncate(fd, ByteSize); /* get the bytes */ +``` +它将分配 **ByteSize** 字节的内存,在该情况下,一般为大小适中的 512 字节。_memwriter_ 和 _memreader_ 程序都只从共享内存中获取数据,而不是从备份文件。系统将负责共享内存和备份文件之间数据的同步。 + * 接着 _memwriter_ 调用 **mmap** 函数: +```c +caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ +``` +来获得共享内存的指针。(_memreader_ 也做一次类似的调用。) 指针类型 **caddr_t** 以 **c** 开头,它代表 **calloc**,而这是动态初始化分配的内存为 0 的一个系统函数。_memwriter_ 通过库函数 **strcpy**(string copy)来获取后续 _写_ 操作的 **memptr**。 + * 到现在为止, _memwriter_ 已经准备好进行写操作了,但首先它要创建一个信号量来确保共享内存的排斥性。假如 _memwriter_ 正在执行写操作而同时 _memreader_ 在执行读操作,则有可能出现竞争条件。假如调用 **sem_open** + 成功了: +```c +sem_t* semptr = sem_open(SemaphoreName, /* name */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ +``` +那么,接着写操作便可以执行。上面的 **SemaphoreName**(任意一个唯一的非空名称)用来在 _memwriter_ 和 _memreader_ 识别信号量。 初始值 0 将会传递给信号量的创建者,在这个例子中指的是 _memwriter_ 赋予它执行 _写_ 操作的权利。 + * 在写操作完成后,_memwriter_ 通过调用 **sem_post** 函数将信号量的值增加到 1: +```c +if (sem_post(semptr) < 0) .. +``` +增加信号了将释放互斥锁,使得 _memreader_ 可以执行它的 _读_ 操作。为了更好地测量,_memwriter_ 也将从它自己的地址空间中取消映射, +```c +munmap(memptr, ByteSize); /* unmap the storage * +``` +这将使得 _memwriter_ 不能进一步地访问共享内存。 + +#### 示例 4. _memreader_ 进程的源代码 + +```c +/** Compilation: gcc -o memreader memreader.c -lrt -lpthread **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "shmem.h" + +void report_and_exit(const char* msg) { + [perror][4](msg); + [exit][5](-1); +} + +int main() { + int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* empty to begin */ + if (fd < 0) report_and_exit("Can't get file descriptor..."); + + /* get a pointer to memory */ + caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ + if ((caddr_t) -1 == memptr) report_and_exit("Can't access segment..."); + + /* create a semaphore for mutual exclusion */ + sem_t* semptr = sem_open(SemaphoreName, /* name */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ + if (semptr == (void*) -1) report_and_exit("sem_open"); + + /* use semaphore as a mutex (lock) by waiting for writer to increment it */ + if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ + int i; + for (i = 0; i < [strlen][6](MemContents); i++) + write(STDOUT_FILENO, memptr + i, 1); /* one byte at a time */ + sem_post(semptr); + } + + /* cleanup */ + munmap(memptr, ByteSize); + close(fd); + sem_close(semptr); + unlink(BackingFile); + return 0; +} +``` +_memwriter_ 和 _memreader_ 程序中,共享内存的主要着重点都在 **shm_open** 和 **mmap** 函数上:在成功时,第一个调用返回一个备份文件的文件描述符,而第二个调用则使用这个文件描述符从共享内存段中获取一个指针。它们对 **shm_open** 的调用都很相似,除了 _memwriter_ 程序创建共享内存,而 _memreader_ 只获取这个已经创建 +的内存: + +```c +int fd = shm_open(BackingFile, O_RDWR | O_CREAT, AccessPerms); /* memwriter */ +int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* memreader */ +``` + +手握文件描述符,接着对 **mmap** 的调用就是类似的了: + +```c +caddr_t memptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); +``` + +**mmap** 的第一个参数为 **NULL**,这意味着让系统自己决定在虚拟内存地址的哪个地方分配内存,当然也可以指定一个地址(但很有技巧性)。**MAP_SHARED** 标志着被分配的内存在进程中是共享的,最后一个参数(在这个例子中为 0 ) 意味着共享内存的偏移量应该为第一个字节。**size** 参数特别指定了将要分配的字节数目(在这个例子中是 512);另外的保护参数(AccessPerms)暗示着共享内存是可读可写的。 + +当 _memwriter_ 程序执行成功后,系统将创建并维护备份文件,在我的系统中,该文件为 _/dev/shm/shMemEx_,其中的 _shMemEx_ 是我为共享存储命名的(在头文件 _shmem.h_ 中给定)。在当前版本的 _memwriter_ 和 _memreader_ 程序中,下面的语句 + +```c +shm_unlink(BackingFile); /* removes backing file */ +``` + +将会移除备份文件。假如没有 **unlink** 这个词,则备份文件在程序终止后仍然持久地保存着。 + +_memreader_ 和 _memwriter_ 一样,在调用 **sem_open** 函数时,通过信号量的名字来获取信号量。但 _memreader_ 随后将进入等待状态,直到 _memwriter_ 将初始值为 0 的信号量的值增加。 + +```c +if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ +``` + +一旦等待结束,_memreader_ 将从共享内存中读取 ASCII 数据,然后做些清理工作并终止。 + +共享内存 API 包括显式地同步共享内存段和备份文件。在这次的示例中,这些操作都被省略了,以免文章显得杂乱,好让我们专注于内存共享和信号量的代码。 + +即便在信号量代码被移除的情况下,_memwriter_ 和 _memreader_ 程序很大几率也能够正常执行而不会引入竞争条件:_memwriter_ 创建了共享内存段,然后立即向它写入;_memreader_ 不能访问共享内存,直到共享内存段被创建好。然而,当一个 _写操作_ 处于混合状态时,最佳实践需要共享内存被同步。信号量 API 足够重要,值得在代码示例中着重强调。 + +### 总结 + +上面共享文件和共享内存的例子展示了进程是怎样通过 _共享存储_ 来进行通信的,前者通过文件而后者通过内存块。这两种方法的 API 相对来说都很直接。这两种方法有什么共同的缺点吗?现代的应用经常需要处理流数据,而且是非常大规模的数据流。共享文件或者共享内存的方法都不能很好地处理大规模的流数据。按照类型使用管道会更加合适一些。所以这个系列的第二部分将会介绍管道和消息队列,同样的,我们将使用 C 语言写的代码示例来辅助讲解。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-storage + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: https://en.wikipedia.org/wiki/Inter-process_communication +[3]: http://condor.depaul.edu/mkalin +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html From 40e38a059ac342b27b711628e02eebb672ca1e13 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 24 Apr 2019 08:55:45 +0800 Subject: [PATCH 0124/1154] translated --- ...Training Courses Sale - Discount Coupon.md | 68 ------------------- ...Training Courses Sale - Discount Coupon.md | 68 +++++++++++++++++++ 2 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md create mode 100644 translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md diff --git a/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md deleted file mode 100644 index 73222de0b6..0000000000 --- a/sources/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Linux Foundation Training Courses Sale & Discount Coupon) -[#]: via: (https://itsfoss.com/linux-foundation-discount-coupon/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Linux Foundation Training Courses Sale & Discount Coupon -====== - -Linux Foundation is the non-profit organization that employs Linux creator Linus Torvalds and manages the development of the Linux kernel. Linux Foundation aims to promote the adoption of Linux and Open Source in the industry and it is doing a great job in this regard. - -Open Source jobs are in demand and no one knows is better than Linux Foundation, the official Linux organization. This is why the Linux Foundation provides a number of training and certification courses on Linux related technology. You can browse the [entire course offering on Linux Foundations’ training webpage][1]. - -### Linux Foundation Latest Offer: 40% off on all courses [Limited Time] - -At present Linux Foundation is offering some great offers for sysadmin, devops and cloud professionals. - -At present, Linux Foundation is offering massive discount of 40% on the entire range of their e-learning courses and certification bundles, including the growing catalog of cloud and devops e-learning courses like Kubernetes! - -Just use coupon code **APRIL40** at checkout to get your discount. - -[Linux Foundation 40% Off (Coupon Code APRIL40)][2] - -_Do note that this offer is valid till 22nd April 2019 only._ - -### Linux Foundation Discount Coupon [Valid all the time] - -You can get a 16% off on any training or certification course provided by The Linux Foundation at any given time. All you have to do is to use the coupon code **FOSS16** at the checkout page. - -Note that it might not be combined with sysadmin day offer. - -[Get 16% off on Linux Foundation Courses with FOSS16 Code][1] - -This article contains affiliate links. Please read our [affiliate policy][3]. - -#### Should you get certified? - -![][4] - -This is the question I have been asked regularly. Are Linux certifications worth it? The short answer is yes. - -As per the [open source jobs report in 2018][5], over 80% of open source professionals said that certifications helped with their careers. Certifications enable you to demonstrate technical knowledge to potential employers and thus certifications make you more employable in general. - -Almost half of the hiring managers said that employing certified open source professionals is a priority for them. - -Certifications from a reputed authority like Linux Foundation, Red Hat, LPIC etc are particularly helpful when you are a fresh graduate or if you want to switch to a new domain in your career. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-foundation-discount-coupon/ - -作者:[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://shareasale.com/u.cfm?d=507759&m=59485&u=747593&afftrack= -[2]: http://shrsl.com/1k5ug -[3]: https://itsfoss.com/affiliate-policy/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/linux-foundation-training-certification-discount.png?ssl=1 -[5]: https://www.linuxfoundation.org/publications/open-source-jobs-report-2018/ diff --git a/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md new file mode 100644 index 0000000000..67bd84fc31 --- /dev/null +++ b/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Foundation Training Courses Sale & Discount Coupon) +[#]: via: (https://itsfoss.com/linux-foundation-discount-coupon/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Linux 基金会培训课程销售和折扣优惠券 +====== + +Linux 基金会是一家非盈利组织,它雇用 Linux 创建者 Linus Torvalds 并管理 Linux 内核的开发。Linux 基金会旨在促进业界接受 Linux 和开源,并且在这方面做得很好。 + +开源工作是有需求的,这点没人比官方 Linux 组织 Linux 基金会了解更多。这就是为什么 Linux 基金会提供了许多关于 Linux 相关技术的培训和认证课程。你可以浏览 [Linux 基金会培训页面中的所有课程][1]。 + +### Linux 基金会最新优惠:所有课程享受 40% 限时折扣 + +目前,Linux 基金会为系统管理员、devops 和云专业人士提供了一些优惠。 + +目前,Linux 基金会为所有学习课程和认证包提供 40% 的大幅折扣,包括不断增长的云和 devops 的课程目录,如 Kubernetes! + +只需在结账时使用优惠券代码 **APRIL40** 即可获得折扣。 + +[Linux Foundation 40% Off (Coupon Code APRIL40)][2] + +_请注意,此优惠有效期至 2019 年 4 月 22 日。_ + +### Linux 基金会长期优惠券 + +你可以在任何时间获得 Linux 基金会提供的任何培训或认证课程 16% 的折扣。你所要做的就是在结账页面使用优惠码 **FOSS16**。 + +请注意,它也许不可与上面的系统管理员优惠一起使用。 + +[Get 16% off on Linux Foundation Courses with FOSS16 Code][1] + +本文包含推广链接。请阅读我们的[推广政策][3]。 + +#### 你应该获得认证吗? + +![][4] + +这是我经常被问到的问题。Linux 认证值得吗?回答是肯定的。 + +根据 [2018 年的开源职位报告][5],超过 80% 的开源专业人士表示,认证有助于他们的职业生涯。通过认证,你可以向潜在雇主展示技术知识,因此认证可以使你在一般情况下更具就业能力。 + +几乎一半的招聘经理表示,聘用经过认证的开源专业人员是他们的首要任务。 + +来自知名机构(如Linux 基金会、Red Hat、LPIC等)的认证在你刚毕业或者想要在职业生涯中转换到新领域时特别有用。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-foundation-discount-coupon/ + +作者:[Abhishek Prakash][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/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://shareasale.com/u.cfm?d=507759&m=59485&u=747593&afftrack= +[2]: http://shrsl.com/1k5ug +[3]: https://itsfoss.com/affiliate-policy/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/linux-foundation-training-certification-discount.png?ssl=1 +[5]: https://www.linuxfoundation.org/publications/open-source-jobs-report-2018/ From 7bf2f4cbcd888bb4f033fa80b100253e064e94cb Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 24 Apr 2019 09:10:44 +0800 Subject: [PATCH 0125/1154] translating --- ... primary backup strategy for the -home directory in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md b/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md index e51ae79681..03031afc15 100644 --- a/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md +++ b/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c4695a1f3fc45e5cd93247cde4b11ff4d65f8b4f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 11:33:15 +0800 Subject: [PATCH 0126/1154] PRF:20190410 Managing Partitions with sgdisk.md @geekpi --- ...0190410 Managing Partitions with sgdisk.md | 99 ++++++++++++------- 1 file changed, 61 insertions(+), 38 deletions(-) diff --git a/translated/tech/20190410 Managing Partitions with sgdisk.md b/translated/tech/20190410 Managing Partitions with sgdisk.md index 19f2752245..dd1aee1df0 100644 --- a/translated/tech/20190410 Managing Partitions with sgdisk.md +++ b/translated/tech/20190410 Managing Partitions with sgdisk.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Managing Partitions with sgdisk) @@ -12,30 +12,45 @@ ![][1] -[Roderick W. Smith][2] 的 _sgdisk_ 命令可在命令行中管理硬盘的分区。下面将介绍使用它所需的基础知识。 +[Roderick W. Smith][2] 的 `sgdisk` 命令可在命令行中管理硬盘的分区。下面将介绍使用它所需的基础知识。 -以下六个参数是你使用 sgdisk 大多数基本功能所需了解的: +使用 sgdisk 的大多数基本功能只需要了解以下六个参数: - 1. **-p** -_打印_ 分区表: -### sgdisk -p /dev/sda - 2. **-d x** -_删除_分区 x: -### sgdisk -d 1 /dev/sda - 3. **-n x:y:z** -创建一个编号 x 的_新_分区,从 y 开始,从 z 结束: -### sgdisk -n 1:1MiB:2MiB /dev/sda - 4. **-c x:y** -_更改_分区 x 的名称为 y: -### sgdisk -c 1:grub /dev/sda - 5. **-t x:y** -将分区 x 的_类型_更改为 y: -### sgdisk -t 1:ef02 /dev/sda - 6. **–list-types** -列出分区类型代码: -### sgdisk --list-types +1、`-p` *打印* 分区表: +``` +# sgdisk -p /dev/sda +``` +2、 `-d x` *删除* 分区 x: + +``` +# sgdisk -d 1 /dev/sda +``` + +3、 `-n x:y:z` 创建一个编号 x 的*新*分区,从 y 开始,从 z 结束: + +``` +# sgdisk -n 1:1MiB:2MiB /dev/sda +``` + +4、`-c x:y` *更改*分区 x 的名称为 y: + +``` +# sgdisk -c 1:grub /dev/sda +``` + +5、`-t x:y` 将分区 x 的*类型*更改为 y: + +``` +# sgdisk -t 1:ef02 /dev/sda +``` + +6、`–list-types` 列出分区类型代码: + +``` +# sgdisk --list-types +``` ![The SGDisk Command][3] @@ -43,36 +58,44 @@ _更改_分区 x 的名称为 y: 可以组合上面的参数,这样你可以一次定义所有分区: -### sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda +``` +# sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda +``` -在值的前面加上 **+** 或 **–** 符号,可以为某些字段指定相对值。如果你使用相对值,sgdisk 会为你做数学运算。例如,上面的例子可以写成: +在值的前面加上 `+` 或 `–` 符号,可以为某些字段指定相对值。如果你使用相对值,`sgdisk` 会为你做数学运算。例如,上面的例子可以写成: -### sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda +``` +# sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda +``` -**0** 值对于以下几个字段是特殊情况: +`0` 值对于以下几个字段有特殊意义: - * 对于_分区号_字段,0 表示应使用下一个可用编号(编号从 1 开始)。 -  * 对于_起始地址_字段,0 表示使用最大可用空闲块的头。硬盘开头的一些空间始终保留给分区表本身。 -  * 对于_结束地址_字段,0 表示使用最大可用空闲块的末尾。 +* 对于*分区号*字段,0 表示应使用下一个可用编号(编号从 1 开始)。 +* 对于*起始地址*字段,0 表示使用最大可用空闲块的头。硬盘开头的一些空间始终保留给分区表本身。 +* 对于*结束地址*字段,0 表示使用最大可用空闲块的末尾。 +通过在适当的字段中使用 `0` 和相对值,你可以创建一系列分区,而无需预先计算任何绝对值。例如,如果在一块空白硬盘中,以下 `sgdisk` 命令序列将创建典型 Linux 安装所需的所有基本分区: +``` +# sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda +# sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda +# sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda +# sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda +``` -通过在适当的字段中使用 **0** 和相对值,你可以创建一系列分区,而无需预先计算任何绝对值。例如,如果在一块空白硬盘中,以下 sgdisk 命令序列将创建典型 Linux 安装所需的所有基本分区: - -### sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda -### sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda -### sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda -### sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda - -上面的例子展示了如何为基于 BIOS 的计算机分区硬盘。基于 UEFI 的计算机上不需要 [grub分区][5]。由于 sgdisk 在上面的示例中为你计算了所有绝对值,因此你可以在基于 UEFI 的计算机上跳过第一个命令,并且可以无需修改即可运行其余命令。同样,你可以跳过创建交换分区,并且不需要修改其余命令。 +上面的例子展示了如何为基于 BIOS 的计算机分区硬盘。基于 UEFI 的计算机上不需要 [grub 分区][5]。由于 `sgdisk` 在上面的示例中为你计算了所有绝对值,因此你可以在基于 UEFI 的计算机上跳过第一个命令,并且可以无需修改即可运行其余命令。同样,你可以跳过创建交换分区,并且不需要修改其余命令。 还有使用一个命令删除硬盘上所有分区的快捷方式: -### sgdisk --zap-all /dev/sda +``` +# sgdisk --zap-all /dev/sda +``` 关于最新和详细信息,请查看手册页: +``` $ man sgdisk +``` -------------------------------------------------------------------------------- @@ -81,7 +104,7 @@ via: https://fedoramagazine.org/managing-partitions-with-sgdisk/ 作者:[Gregory Bartholomew][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/) 荣誉推出 From e4df45951797e9f17c913f0da2e54868903df863 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 11:37:19 +0800 Subject: [PATCH 0127/1154] PUB:20190410 Managing Partitions with sgdisk.md @geekpi https://linux.cn/article-10771-1.html --- .../20190410 Managing Partitions with sgdisk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190410 Managing Partitions with sgdisk.md (98%) diff --git a/translated/tech/20190410 Managing Partitions with sgdisk.md b/published/20190410 Managing Partitions with sgdisk.md similarity index 98% rename from translated/tech/20190410 Managing Partitions with sgdisk.md rename to published/20190410 Managing Partitions with sgdisk.md index dd1aee1df0..bb8187a940 100644 --- a/translated/tech/20190410 Managing Partitions with sgdisk.md +++ b/published/20190410 Managing Partitions with sgdisk.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10771-1.html) [#]: subject: (Managing Partitions with sgdisk) [#]: via: (https://fedoramagazine.org/managing-partitions-with-sgdisk/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) From 4796e6a72aee50f9064db4692d89eecc3c858f3b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 11:49:07 +0800 Subject: [PATCH 0128/1154] DEL:20190416 Linux Foundation Training Courses Sale - Discount Coupon.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @geekpi @lujun9972 我觉得这篇发布价值不大,就不发布了。 --- ...Training Courses Sale - Discount Coupon.md | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md diff --git a/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md b/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md deleted file mode 100644 index 67bd84fc31..0000000000 --- a/translated/tech/20190416 Linux Foundation Training Courses Sale - Discount Coupon.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Linux Foundation Training Courses Sale & Discount Coupon) -[#]: via: (https://itsfoss.com/linux-foundation-discount-coupon/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Linux 基金会培训课程销售和折扣优惠券 -====== - -Linux 基金会是一家非盈利组织,它雇用 Linux 创建者 Linus Torvalds 并管理 Linux 内核的开发。Linux 基金会旨在促进业界接受 Linux 和开源,并且在这方面做得很好。 - -开源工作是有需求的,这点没人比官方 Linux 组织 Linux 基金会了解更多。这就是为什么 Linux 基金会提供了许多关于 Linux 相关技术的培训和认证课程。你可以浏览 [Linux 基金会培训页面中的所有课程][1]。 - -### Linux 基金会最新优惠:所有课程享受 40% 限时折扣 - -目前,Linux 基金会为系统管理员、devops 和云专业人士提供了一些优惠。 - -目前,Linux 基金会为所有学习课程和认证包提供 40% 的大幅折扣,包括不断增长的云和 devops 的课程目录,如 Kubernetes! - -只需在结账时使用优惠券代码 **APRIL40** 即可获得折扣。 - -[Linux Foundation 40% Off (Coupon Code APRIL40)][2] - -_请注意,此优惠有效期至 2019 年 4 月 22 日。_ - -### Linux 基金会长期优惠券 - -你可以在任何时间获得 Linux 基金会提供的任何培训或认证课程 16% 的折扣。你所要做的就是在结账页面使用优惠码 **FOSS16**。 - -请注意,它也许不可与上面的系统管理员优惠一起使用。 - -[Get 16% off on Linux Foundation Courses with FOSS16 Code][1] - -本文包含推广链接。请阅读我们的[推广政策][3]。 - -#### 你应该获得认证吗? - -![][4] - -这是我经常被问到的问题。Linux 认证值得吗?回答是肯定的。 - -根据 [2018 年的开源职位报告][5],超过 80% 的开源专业人士表示,认证有助于他们的职业生涯。通过认证,你可以向潜在雇主展示技术知识,因此认证可以使你在一般情况下更具就业能力。 - -几乎一半的招聘经理表示,聘用经过认证的开源专业人员是他们的首要任务。 - -来自知名机构(如Linux 基金会、Red Hat、LPIC等)的认证在你刚毕业或者想要在职业生涯中转换到新领域时特别有用。 - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-foundation-discount-coupon/ - -作者:[Abhishek Prakash][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/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://shareasale.com/u.cfm?d=507759&m=59485&u=747593&afftrack= -[2]: http://shrsl.com/1k5ug -[3]: https://itsfoss.com/affiliate-policy/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/linux-foundation-training-certification-discount.png?ssl=1 -[5]: https://www.linuxfoundation.org/publications/open-source-jobs-report-2018/ From 366d1f67a7860cb18e00449d54211d47c0280b7a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 12:15:01 +0800 Subject: [PATCH 0129/1154] PRF:20171226 The shell scripting trap.md @jdh8383 --- .../tech/20171226 The shell scripting trap.md | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/translated/tech/20171226 The shell scripting trap.md b/translated/tech/20171226 The shell scripting trap.md index 15659760a1..141c742fe8 100644 --- a/translated/tech/20171226 The shell scripting trap.md +++ b/translated/tech/20171226 The shell scripting trap.md @@ -1,28 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (jdh8383) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (The shell scripting trap) [#]: via: (https://arp242.net/weblog/shell-scripting-trap.html) [#]: author: (Martin Tournoij https://arp242.net/) -Shell 脚本陷阱 +Shell 脚本编程陷阱 ====== Shell 脚本很棒,你可以非常轻松地写出有用的东西来。甚至像是下面这个傻瓜式的命令: + ``` # 用含有 Go 的词汇起名字: -$ grep -i ^go /usr/share/dict/american-english /usr/share/dict/british /usr/share/dict/british-english /usr/share/dict/catala /usr/share/dict/catalan /usr/share/dict/cracklib-small /usr/share/dict/finnish /usr/share/dict/french /usr/share/dict/german /usr/share/dict/italian /usr/share/dict/ngerman /usr/share/dict/ogerman /usr/share/dict/spanish /usr/share/dict/usa /usr/share/dict/words | cut -d: -f2 | sort -R | head -n1 +$ grep -i ^go /usr/share/dict/* | cut -d: -f2 | sort -R | head -n1 goldfish ``` 如果用其他编程语言,就需要花费更多的脑力,用多行代码实现,比如用 Ruby 的话: + ``` puts(Dir['/usr/share/dict/*-english'].map do |f| - File.open(f) - .readlines - .select { |l| l[0..1].downcase == 'go' } + File.open(f) + .readlines + .select { |l| l[0..1].downcase == 'go' } end.flatten.sample.chomp) ``` @@ -39,9 +41,11 @@ curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | 这个脚本可以从维基百科上获取荷兰基层政权的列表。几年前我写了这个临时的脚本,用来快速生成一个数据库,到现在它仍然可以正常运行,当时写它并没有花费我多少精力。但要用 Ruby 完成同样的功能则会麻烦得多。 +--- + 现在来说说 shell 的缺点吧。随着代码量的增加,你的脚本会变得越来越难以维护,但你也不会想用别的语言重写一遍,因为你已经在这个 shell 版上花费了很多时间。 -我把这种情况称为“Shell 脚本陷阱”,这是[沉没成本谬论][1]的一种特例(沉没成本谬论是一个经济学概念,可以简单理解为,对已经投入的成本可能被浪费而念念不忘)。 +我把这种情况称为“Shell 脚本编程陷阱”,这是[沉没成本谬论][1]的一种特例(LCTT 译注:“沉没成本谬论”是一个经济学概念,可以简单理解为,对已经投入的成本可能被浪费而念念不忘)。 实际上许多脚本会增长到超出预期的大小,你经常会花费过多的时间来“修复某个 bug”,或者“添加一个小功能”。如此循环往复,让人头大。 @@ -51,28 +55,19 @@ curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | 出于类似的原因,我很后悔写出了许多这样的 shell 脚本,而我在 2018 年的新年誓言就是不要再犯类似的错误了。 -#### 附录:问题汇总 +### 附录:问题汇总 需要指出的是,shell 编程的确存在一些实际的限制。下面是一些例子: * 在处理一些包含“空格”或者其他“特殊”字符的文件名时,需要特别注意细节。绝大多数脚本都会犯错,即使是那些经验丰富的作者(比如我)编写的脚本,因为太容易写错了,[只添加引号是不够的][3]。 - * 有许多所谓“正确”和“错误”的做法。你应该用 `which` 还是 `command`?该用 `$@` 还是 `$*`,是不是得加引号?你是该用 `cmd $arg` 还是 `cmd "$arg"`?等等等等。 - * 你没法在变量里存储空字节(0x00);shell 脚本处理二进制数据很麻烦。 - * 虽然你可以非常快速地写出有用的东西,但实现更复杂的算法则要痛苦许多,即使用 ksh/zsh/bash 扩展也是如此。我上面那个解析 HTML 的脚本临时用用是可以的,但你真的不会想在生产环境中使用这种脚本。 - - * 很难写出跨平台的通用型 shell 脚本。`/bin/sh` 可能是 `dash` 或者 `bash`,不同的 shell 有不同的运行方式。外部工具如 `grep`、`sed` 等,不一定能支持同样的参数。你能确定你的脚本可以适用于 Linux、macOS 和 Windows 的所有版本吗(过去、现在和将来)? - - * 调试 shell 脚本会很难,特别是你眼中的语法可能会很快变得模糊起来,并不是所有人都熟悉 shell 编程的语境。 - + * 很难写出跨平台的通用型 shell 脚本。`/bin/sh` 可能是 `dash` 或者 `bash`,不同的 shell 有不同的运行方式。外部工具如 `grep`、`sed` 等,不一定能支持同样的参数。你能确定你的脚本可以适用于 Linux、macOS 和 Windows 的所有版本吗(无论是过去、现在还是将来)? + * 调试 shell 脚本会很难,特别是你眼中的语法可能会很快变得记不清了,并不是所有人都熟悉 shell 编程的语境。 * 处理错误会很棘手(检查 `$?` 或是 `set -e`),排查一些超过“出了个小错”级别的复杂错误几乎是不可能的。 - * 除非你使用了 `set -u`,变量未定义将不会报错,而这会导致一些“搞笑事件”,比如 `rm -r ~/$undefined` 会删除用户的整个家目录([瞅瞅 Github 上的这个悲剧][4])。 - - * 所有东西都是字符串。一些 shell 引入了数组,能用,但是语法非常丑陋和模糊。带分数的数字运算仍然难以应付,并且依赖像 `bc` 或 `dc` 这样的外部工具(`$(( .. ))` 这种方式只能对付一下整数)。 - + * 所有东西都是字符串。一些 shell 引入了数组,能用,但是语法非常丑陋和费解。带分数的数字运算仍然难以应付,并且依赖像 `bc` 或 `dc` 这样的外部工具(`$(( .. ))` 这种方式只能对付一下整数)。 **反馈** @@ -85,7 +80,7 @@ via: https://arp242.net/weblog/shell-scripting-trap.html 作者:[Martin Tournoij][a] 选题:[lujun9972][b] 译者:[jdh8383](https://github.com/jdh8383) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ebedb6c1802ae37b1b8c466b6e4ade13d5a29dfd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 12:16:23 +0800 Subject: [PATCH 0130/1154] PUB:Additional-Red-Racer-4_1024x1024.jpg @jdh8383 https://linux.cn/article-10772-1.html --- .../tech => published}/20171226 The shell scripting trap.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20171226 The shell scripting trap.md (98%) diff --git a/translated/tech/20171226 The shell scripting trap.md b/published/20171226 The shell scripting trap.md similarity index 98% rename from translated/tech/20171226 The shell scripting trap.md rename to published/20171226 The shell scripting trap.md index 141c742fe8..8252874879 100644 --- a/translated/tech/20171226 The shell scripting trap.md +++ b/published/20171226 The shell scripting trap.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (jdh8383) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10772-1.html) [#]: subject: (The shell scripting trap) [#]: via: (https://arp242.net/weblog/shell-scripting-trap.html) [#]: author: (Martin Tournoij https://arp242.net/) From 037e1951d3847aac4f32c11c69a9935d3d45e18a Mon Sep 17 00:00:00 2001 From: FSSlc Date: Wed, 24 Apr 2019 12:31:53 +0800 Subject: [PATCH 0131/1154] Update 20190416 Inter-process communication in Linux- Using pipes and message queues.md --- ...ss communication in Linux- Using pipes and message queues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md index a2472dbc92..c73155aa58 100644 --- a/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md +++ b/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (FSSlc) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 489969fbea253c365539290a394accbda256003f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 22:42:00 +0800 Subject: [PATCH 0132/1154] DEL:20190415 Troubleshooting slow WiFi on Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lujun9972 这篇文章选题有什么意义么? @geekpi 翻译也没啥价值吧? --- ...0415 Troubleshooting slow WiFi on Linux.md | 33 ------------------- 1 file changed, 33 deletions(-) delete mode 100644 translated/tech/20190415 Troubleshooting slow WiFi on Linux.md diff --git a/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md b/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md deleted file mode 100644 index ee78f64d14..0000000000 --- a/translated/tech/20190415 Troubleshooting slow WiFi on Linux.md +++ /dev/null @@ -1,33 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Troubleshooting slow WiFi on Linux) -[#]: via: (https://www.linux.com/blog/troubleshooting-slow-wifi-linux) -[#]: author: (OpenSource.com https://www.linux.com/USERS/OPENSOURCECOM) - -排查 Linux 上的 WiFi 慢速问题 -====== - -我对 [Linux 系统][1]上的硬件问题进行诊断并不陌生。虽然我过去几年大部分工作都都涉及虚拟化,但我仍然喜欢蹲在桌子下,摸索设备和内存模块。好吧,除开“蹲在桌子下”的部分。但这些都不意味着持久而神秘的 bug 不令人沮丧。我最近遇到了我的 Ubuntu 18.04 工作站上的一个 bug,这个 bug 几个月来一直没有解决。 - -在这里,我将分享我的问题和许多我尝试的方法。即使你可能永远不会遇到我的具体问题,但故障排查的过程可能会有所帮助。此外,你会对我在这无用的线索上浪费的时间和精力感到好笑。 - -更多阅读: [OpenSource.com][2] - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/troubleshooting-slow-wifi-linux - -作者:[OpenSource.com][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.linux.com/USERS/OPENSOURCECOM -[b]: https://github.com/lujun9972 -[1]: https://www.manning.com/books/linux-in-action?a_aid=bootstrap-it&a_bid=4ca15fc9&chan=opensource -[2]: https://opensource.com/article/19/4/troubleshooting-wifi-linux From 9a8cdaafb140a391d5c324ca6553e50f60ee3d4a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 23:02:22 +0800 Subject: [PATCH 0133/1154] PRF:20190409 Enhanced security at the edge.md @hopefully2333 --- .../20190409 Enhanced security at the edge.md | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/translated/tech/20190409 Enhanced security at the edge.md b/translated/tech/20190409 Enhanced security at the edge.md index 5062c4b229..2ec884e338 100644 --- a/translated/tech/20190409 Enhanced security at the edge.md +++ b/translated/tech/20190409 Enhanced security at the edge.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Enhanced security at the edge) @@ -9,35 +9,38 @@ 增强边缘计算的安全性 ====== -边缘计算环境带来的安全风险迫使公司必须特别关注它的安全措施。 + +> 边缘计算环境带来的安全风险迫使公司必须特别关注它的安全措施。 + +![](https://images.idgesg.net/images/article/2019/04/istock-1091707448-100793312-large.jpg) 说数据安全是高管们和董事会最关注的问题已经是陈词滥调了。但问题是:数据安全问题不会自己消失。 -骇客和攻击者一直在寻找利用漏洞的新方法。就像公司开始使用人工智能和机器学习等新兴技术来自动化地保护他们的组织一样,攻击者们也在使用这些技术来达成他们的目的。 +骇客和攻击者一直在寻找利用缺陷的新方法。就像公司开始使用人工智能和机器学习等新兴技术来自动化地保护他们的组织一样,那些不良分子们也在使用这些技术来达成他们的目的。 简而言之,安全问题是一定不能忽视的。现在,随着越来越多的公司开始使用边缘计算,如何保护这些边缘计算环境,需要有新的安全考量。 -**边缘计算的风险更高** +### 边缘计算的风险更高 -正如 Network World 中一篇文章所建议的,边缘计算的安全架构应该将重点放在物理安全上。这并不是说要忽视,保护传输过程中的数据这一点。而是说,实际情况里的物理环境和物理设备更加值得关注。 +正如 Network World 的一篇文章所说,边缘计算的安全架构应该将重点放在物理安全上。这并不是说要忽视保护传输过程中的数据。而是说,实际的物理环境和物理设备更加值得关注。 -例如,边缘计算的硬件设备通常位于大公司或者广阔空间中,有时候是在很容易进入的共享办公室和公共区域里。从表面上看,这节省了成本,能更快地访问到相关的数据,而不必在后端的数据中心和前端的设备之间往返。 +例如,边缘计算的硬件设备通常位于较大的公司或者广阔空间中,有时候是在很容易进入的共享办公室和公共区域里。从表面上看,这节省了成本,能更快地访问到相关的数据,而不必在后端的数据中心和前端的设备之间往返。 -但是,如果没有任何级别的访问控制,这台设备就会暴露在恶意操作和简单人为错误的双重风险之下。想象一下办公室的清洁工意外地关掉了设备,以及随之而来的设置停机所造成的后果。 +但是,如果没有任何级别的访问控制,这台设备就会暴露在恶意操作和简单人为错误的双重风险之下。想象一下办公室的清洁工意外地关掉了设备,以及随之而来的停机所造成的后果。 -另一个风险是 “Shadow edge IT”。有时候非 IT 的工作人员会部署一个边缘站点来实现快速启动项目,却没有及时通知 IT 部门这个站点正在连接到网络。例如,零售商店可能会主动安装他们自己的数字标牌,或者,销售团队会将物联网传感器应用到电视中,并在销售演示中实时地部署它们。 +另一个风险是 “影子边缘 IT”。有时候非 IT 人员会部署一个边缘设备来快速启动项目,却没有及时通知 IT 部门这个设备正在连接到网络。例如,零售商店可能会主动安装他们自己的数字标牌,或者,销售团队会将物联网传感器应用到电视中,并在销售演示中实时地部署它们。 -在这种情况下,IT 部门很少甚至完全看不到这些设备和边缘站点,这就使得网络可能暴露在外。 +在这种情况下,IT 部门很少甚至完全看不到这些边缘设备,这就使得网络可能暴露在外。 -**保护边缘计算环境** +### 保护边缘计算环境 -部署微型数据中心是规避上述风险的一个简单方法。(MDC) +部署微型数据中心(MDC)是规避上述风险的一个简单方法。 -“在历史上,大多数这些[边缘]环境都是不受控制的,”施耐德电气安全能源部门的首席技术官和创新高级副总裁 Kevin Brown 说。“它们可能是第一级,但很可能是第 0 级类型的设计-它们就像开放的配件柜。它们现在需要像微型数据中心一样的对待。你管理它需要像管理关键任务数据中心一样” +> “在历史上,大多数这些[边缘]环境都是不受控制的,”施耐德电气安全能源部门的首席技术官和创新高级副总裁 Kevin Brown 说。“它们可能是第 1 级,但很可能是第 0 级类型的设计 —— 它们就像开放的配线柜。它们现在需要像微型数据中心一样的对待。你管理它需要像管理关键任务数据中心一样” -单说听起来的感觉,这个解决方案是一个安全,独立的机箱,它包括在室内和室外运行程序所需的所有存储空间,处理性能和网络资源。它同样包含必要的电源、冷却、安全和管理工具。 +单说听起来的感觉,这个解决方案是一个安全、独立的机箱,它包括在室内和室外运行程序所需的所有存储空间、处理性能和网络资源。它同样包含必要的电源、冷却、安全和管理工具。 -最重要的部分是高级别的安全性。这个装置是封闭的,有上锁的们,以防止非法入侵。通过合适的供应商,DMC 可以进行定制,包括用于远程数字化管理的监控摄像头、传感器和监控技术。 +而它最重要的是高级别的安全性。这个装置是封闭的,有上锁的门,可以防止非法入侵。通过合适的供应商,DMC 可以进行定制,包括用于远程数字化管理的监控摄像头、传感器和监控技术。 随着越来越多的公司开始利用边缘计算的优势,他们必须利用安全解决方案的优势来保护他们的数据和边缘环境。 @@ -45,12 +48,12 @@ -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all +via: https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html 作者:[Anne Taylor][a] 选题:[lujun9972][b] 译者:[hopefully2333](https://github.com/hopefully2333) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bb735e9b978efe9f41eda90e6936c3266badd741 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 23:11:28 +0800 Subject: [PATCH 0134/1154] PUB:20190409 Enhanced security at the edge.md @hopefully2333 https://linux.cn/article-10773-1.html --- .../20190409 Enhanced security at the edge.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 Enhanced security at the edge.md (98%) diff --git a/translated/tech/20190409 Enhanced security at the edge.md b/published/20190409 Enhanced security at the edge.md similarity index 98% rename from translated/tech/20190409 Enhanced security at the edge.md rename to published/20190409 Enhanced security at the edge.md index 2ec884e338..3932005a41 100644 --- a/translated/tech/20190409 Enhanced security at the edge.md +++ b/published/20190409 Enhanced security at the edge.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10773-1.html) [#]: subject: (Enhanced security at the edge) [#]: via: (https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all) [#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) From 8c37a6f2e8e774576c85c52c1930fa9d4547e865 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 23:51:08 +0800 Subject: [PATCH 0135/1154] PRF:20190204 Enjoy Netflix- You Should Thank FreeBSD.md @geekpi --- ...Enjoy Netflix- You Should Thank FreeBSD.md | 47 +++++++++---------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md index 3413c4f65f..206e569db9 100644 --- a/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md +++ b/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md @@ -1,53 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Enjoy Netflix? You Should Thank FreeBSD) [#]: via: (https://itsfoss.com/netflix-freebsd-cdn/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -享受 Netflix 么?你应该感谢 FreeBSD +喜欢 Netflix 么?你应该感谢 FreeBSD ====== -Netflix 是世界上最受欢迎的流媒体服务之一。 +![][7] -但你已经知道了。不是吗? +Netflix 是世界上最受欢迎的流媒体服务之一。对,你已经知道了。但你可能不知道的是 Netflix 使用 [FreeBSD][1] 向你提供内容。 -你可能不知道的是 Netflix 使用 [FreeBSD][1] 向你提供内容。 - -是的。Netflix 依靠 FreeBSD 来构建其内部内容交付网络 (CDN)。 +是的。Netflix 依靠 FreeBSD 来构建其内部内容交付网络(CDN)。 [CDN][2] 是一组位于世界各地的服务器。它主要用于向终端用户分发像图像和视频这样的“大文件”。 Netflix 没有选择商业 CDN 服务,而是建立了自己的内部 CDN,名为 [Open Connect][3]。 -Open Connect 使用[自定义硬件][4],Open Connect Appliance。你可以在下面的图片中看到它。它可以处理 40Gb/s 的数据,存储容量为 248 TB。 +Open Connect 使用[自定义硬件][4]:Open Connect Appliance。你可以在下面的图片中看到它。它可以每秒处理 40Gb 的数据,存储容量为 248 TB。 ![Netflix’s Open Connect Appliance runs FreeBSD][5] -Netflix 免费为合格的互联网服务提供商 (ISP) 提供 Open Connect Appliance。通过这种方式,大量的 Netflix 流量得到了本地化,ISP 可以更高效地提供 Netflix 内容。 +Netflix 免费为合格的互联网服务提供商(ISP) 提供 Open Connect Appliance。通过这种方式,大量的 Netflix 流量得到了本地化,ISP 可以更高效地提供 Netflix 内容。 Open Connect Appliance 运行在 FreeBSD 操作系统上,并且[几乎完全运行开源软件][6]。 -### Open Connect 使用 FreeBSD “头” - -![][7] - -你或许会期望 Netflix 在这样一个关键基础设施上使用 FreeBSD 的稳定版本,但 Netflix 会跟踪 [FreeBSD 头/当前版本][8]。Netflix 表示,跟踪“头”让他们“保持前瞻性,专注于创新”。 - -以下是 Netflix 跟踪 FreeBSD 的好处: - - * 更快的功能迭代 -  * 更快地使用 FreeBSD 的新功能 -  * 更快的 bug 修复 -  * 实现协作 -  * 尽量减少合并冲突 -  * 摊销合并“成本” +### Open Connect 使用最新版 FreeBSD +你或许会觉得 Netflix 会在这样一个关键基础设施上使用 FreeBSD 的稳定版本,但 Netflix 会跟踪 [FreeBSD 最新/当前版本][8]。Netflix 表示,跟踪“最新版”可以让他们“保持前瞻性,专注于创新”。 -> 运行 FreeBSD “head” 可以让我们非常高效地向用户分发大量数据,同时保持高速的功能开发。 +以下是 Netflix 跟踪最新版 FreeBSD 的好处: + +* 更快的功能迭代 +* 更快地使用 FreeBSD 的新功能 +* 更快的 bug 修复 +* 实现协作 +* 尽量减少合并冲突 +* 摊销合并“成本” + +> 运行 FreeBSD “最新版” 可以让我们非常高效地向用户分发大量数据,同时保持高速的功能开发。 > > Netflix @@ -57,7 +52,7 @@ Open Connect Appliance 运行在 FreeBSD 操作系统上,并且[几乎完全 那么 Netflix 用 FreeBSD 实现了什么?以下是一些统计数据: -> 使用 FreeBSD 和商业硬件,我们在 16 核 2.6GHz CPU 上使用约 55% 的 CPU,实现了 90 Gb/s 的 TLS 加密连接,。 +> 使用 FreeBSD 和商业硬件,我们在 16 核 2.6 GHz CPU 上使用约 55% 的 CPU,实现了 90 Gb/s 的 TLS 加密连接。 > > Netflix @@ -72,7 +67,7 @@ via: https://itsfoss.com/netflix-freebsd-cdn/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e5465814e0ba7763ea2c121e12e9ffaa1a0cef42 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 24 Apr 2019 23:51:38 +0800 Subject: [PATCH 0136/1154] PUB:20190204 Enjoy Netflix- You Should Thank FreeBSD.md @geekpi https://linux.cn/article-10774-1.html --- .../20190204 Enjoy Netflix- You Should Thank FreeBSD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190204 Enjoy Netflix- You Should Thank FreeBSD.md (98%) diff --git a/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/published/20190204 Enjoy Netflix- You Should Thank FreeBSD.md similarity index 98% rename from translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md rename to published/20190204 Enjoy Netflix- You Should Thank FreeBSD.md index 206e569db9..2d1f6bcb35 100644 --- a/translated/tech/20190204 Enjoy Netflix- You Should Thank FreeBSD.md +++ b/published/20190204 Enjoy Netflix- You Should Thank FreeBSD.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10774-1.html) [#]: subject: (Enjoy Netflix? You Should Thank FreeBSD) [#]: via: (https://itsfoss.com/netflix-freebsd-cdn/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 6eee09a15790b0ee88a5129234cfdac366d7606d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 08:55:36 +0800 Subject: [PATCH 0137/1154] translated --- ... projects to try in COPR for April 2019.md | 110 ------------------ ... projects to try in COPR for April 2019.md | 109 +++++++++++++++++ 2 files changed, 109 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md create mode 100644 translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md diff --git a/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md deleted file mode 100644 index 1c6cd5ccaa..0000000000 --- a/sources/tech/20190419 4 cool new projects to try in COPR for April 2019.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 cool new projects to try in COPR for April 2019) -[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) -[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) - -4 cool new projects to try in COPR for April 2019 -====== - -![][1] - -COPR is a [collection][2] of personal repositories for software that isn’t carried in Fedora. Some software doesn’t conform to standards that allow easy packaging. Or it may not meet other Fedora standards, despite being free and open source. COPR can offer these projects outside the Fedora set of packages. Software in COPR isn’t supported by Fedora infrastructure or signed by the project. However, it can be a neat way to try new or experimental software. - -Here’s a set of new and interesting projects in COPR. - -### Joplin - -[Joplin][3] is a note-taking and to-do app. Notes are written in the Markdown format, and organized by sorting them into various notebooks and using tags. -Joplin can import notes from any Markdown source or exported from Evernote. In addition to the desktop app, there’s an Android version with the ability to synchronize notes between them — using Nextcloud, Dropbox or other cloud services. Finally, there’s a browser extension for Chrome and Firefox to save web pages and screenshots. - -![][4] - -#### Installation instructions - -The [repo][5] currently provides Joplin for Fedora 29 and 30, and for EPEL 7. To install Joplin, use these commands [with sudo][6]: - -``` -sudo dnf copr enable taw/joplin -sudo dnf install joplin -``` - -### Fzy - -[Fzy][7] is a command-line utility for fuzzy string searching. It reads from a standard input and sorts the lines based on what is most likely the sought after text, and then prints the selected line. In addition to command-line, fzy can be also used within vim. You can try fzy in this online [demo][8]. - -#### Installation instructions - -The [repo][9] currently provides fzy for Fedora 29, 30, and Rawhide, and other distributions. To install fzy, use these commands: - -``` -sudo dnf copr enable lehrenfried/fzy -sudo dnf install fzy -``` - -### Fondo - -Fondo is a program for browsing many photographs from the [unsplash.com][10] website. It has a simple interface that allows you to look for pictures of one of several themes, or all of them at once. You can then set a found picture as a wallpaper with a single click, or share it. - - * ![][11] - - - -#### Installation instructions - -The [repo][12] currently provides Fondo for Fedora 29, 30, and Rawhide. To install Fondo, use these commands: - -``` -sudo dnf copr enable atim/fondo -sudo dnf install fondo -``` - -### YACReader - -[YACReader][13] is a digital comic book reader that supports many comics and image formats, such as _cbz_ , _cbr_ , _pdf_ and others. YACReader keeps track of reading progress, and can download comics’ information from [Comic Vine.][14] It also comes with a YACReader Library for organizing and browsing your comic book collection. - - * ![][15] - - - -#### Installation instructions - -The [repo][16] currently provides YACReader for Fedora 29, 30, and Rawhide. To install YACReader, use these commands: - -``` -sudo dnf copr enable atim/yacreader -sudo dnf install yacreader -``` - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/ - -作者:[Dominik Turecek][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/dturecek/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg -[2]: https://copr.fedorainfracloud.org/ -[3]: https://joplin.cozic.net/ -[4]: https://fedoramagazine.org/wp-content/uploads/2019/04/joplin.png -[5]: https://copr.fedorainfracloud.org/coprs/taw/joplin/ -[6]: https://fedoramagazine.org/howto-use-sudo/ -[7]: https://github.com/jhawthorn/fzy -[8]: https://jhawthorn.github.io/fzy-demo/ -[9]: https://copr.fedorainfracloud.org/coprs/lehrenfried/fzy/ -[10]: https://unsplash.com/ -[11]: https://fedoramagazine.org/wp-content/uploads/2019/04/fondo.png -[12]: https://copr.fedorainfracloud.org/coprs/atim/fondo/ -[13]: https://www.yacreader.com/ -[14]: https://comicvine.gamespot.com/ -[15]: https://fedoramagazine.org/wp-content/uploads/2019/04/yacreader.png -[16]: https://copr.fedorainfracloud.org/coprs/atim/yacreader/ diff --git a/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md new file mode 100644 index 0000000000..bbaa9cfb60 --- /dev/null +++ b/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 cool new projects to try in COPR for April 2019) +[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) +[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) + +2019 年 4 月在 COPR 值得尝试的 4 个很酷的新项目 +====== + +![][1] + +COPR 是个人软件仓库[集合][1],它不在 Fedora 中。这是因为某些软件不符合轻松打包的标准。或者它可能不符合其他 Fedora 标准,尽管它是自由而开源的。COPR 可以在 Fedora 套件之外提供这些项目。COPR 中的软件不受 Fedora 基础设施的支持,或者是由项目自己背书的。但是,这是一种尝试新的或实验性的软件的一种巧妙的方式。 + +这是 COPR 中一组新的有趣项目。 + +### Joplin + +[Joplin][3] 是一个笔记和待办事项应用。笔记以 Markdown 格式编写,并通过将它们分类到各种笔记本中并使用标签进行组织。Joplin 可以从任何 Markdown 源导入笔记或从 Evernote 导出笔记。除了桌面应用之外,还有一个 Android 版本,通过使用 Nextcloud、Dropbox 或其他云服务同步笔记。最后,它还有 Chrome 和 Firefox 的浏览器扩展程序,用于保存网页和屏幕截图。 + +![][4] + +#### 安装说明 + +[仓库][5]目前为 Fedora 29 和 30 以及 EPEL 7 提供 Joplin。要安装 Joplin,请[带上 sudo][6] 使用这些命令: + +``` +sudo dnf copr enable taw/joplin +sudo dnf install joplin +``` + +### Fzy + +[Fzy][7] 是用于模糊字符串搜索的命令行程序。它从标准输入读取并根据最有可能的搜索结果进行排序,然后打印所选行。除了命令行,fzy 也可以在 vim 中使用。你可以在这个在线 [demo][8] 中尝试 fzy。 + +#### 安装说明 + +[仓库][9]目前为 Fedora 29、30 和 Rawhide 以及其他发行版提供了 fzy。要安装 fzy,请使用以下命令: + +``` +sudo dnf copr enable lehrenfried/fzy +sudo dnf install fzy +``` + +### Fondo + +Fondo 是一个浏览 [unsplash.com][10] 网站照片的程序。它有一个简单的界面,允许你一次查找某个主题或所有主题的图片。然后,你可以通过单击将找到的图片设置为壁纸,或者共享它。 + + * ![][11] + + + +#### 安装说明 + +[仓库][12]目前为 Fedora 29、30 和 Rawhide 提供 Fondo。要安装 Fondo,请使用以下命令: + +``` +sudo dnf copr enable atim/fondo +sudo dnf install fondo +``` + +### YACReader + +[YACReader][13] 是一款数字漫画阅读器,它支持许多漫画和图像格式,例如 _cbz_、_cbr_、_pdf_ 等。YACReader 会跟踪阅读进度,并可以从 [Comic Vine][14] 下载漫画信息。它还有一个 YACReader 库,用于组织和浏览你的漫画集。 + + * ![][15] + + + +#### 安装说明 + +[仓库][16]目前为 Fedora 29、30 和 Rawhide 提供 YACReader。要安装 YACReader,请使用以下命令: + +``` +sudo dnf copr enable atim/yacreader +sudo dnf install yacreader +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/ + +作者:[Dominik Turecek][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/dturecek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg +[2]: https://copr.fedorainfracloud.org/ +[3]: https://joplin.cozic.net/ +[4]: https://fedoramagazine.org/wp-content/uploads/2019/04/joplin.png +[5]: https://copr.fedorainfracloud.org/coprs/taw/joplin/ +[6]: https://fedoramagazine.org/howto-use-sudo/ +[7]: https://github.com/jhawthorn/fzy +[8]: https://jhawthorn.github.io/fzy-demo/ +[9]: https://copr.fedorainfracloud.org/coprs/lehrenfried/fzy/ +[10]: https://unsplash.com/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/04/fondo.png +[12]: https://copr.fedorainfracloud.org/coprs/atim/fondo/ +[13]: https://www.yacreader.com/ +[14]: https://comicvine.gamespot.com/ +[15]: https://fedoramagazine.org/wp-content/uploads/2019/04/yacreader.png +[16]: https://copr.fedorainfracloud.org/coprs/atim/yacreader/ From 50fa73fc813ff3b41b558d4f358ae013fd166d5d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 08:57:40 +0800 Subject: [PATCH 0138/1154] delete 20190416 Move Data to the Cloud with Azure Data Migration.md --- ... to the Cloud with Azure Data Migration.md | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md diff --git a/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md b/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md deleted file mode 100644 index 379c53cd97..0000000000 --- a/sources/tech/20190416 Move Data to the Cloud with Azure Data Migration.md +++ /dev/null @@ -1,34 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Move Data to the Cloud with Azure Data Migration) -[#]: via: (https://www.linux.com/blog/move-data-cloud-azure-data-migration) -[#]: author: (InfoWorld https://www.linux.com/users/infoworld) - -Move Data to the Cloud with Azure Data Migration -====== - -Despite more than a decade of cloud migration, there’s still a vast amount of data running on-premises. That’s not surprising since data migrations, even between similar systems, are complex, slow, and add risk to your day-to-day operations. Moving to the cloud adds additional management overhead, raising questions of network connectivity and bandwidth, as well as the variable costs associated with running cloud databases. - -Read more at: [InfoWorld][1] - -Despite more than a decade of cloud migration, there’s still a vast amount of data running on-premises. That’s not surprising since data migrations, even between similar systems, are complex, slow, and add risk to your day-to-day operations. Moving to the cloud adds additional management overhead, raising questions of network connectivity and bandwidth, as well as the variable costs associated with running cloud databases. - -Read more at: [InfoWorld][1] - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/move-data-cloud-azure-data-migration - -作者:[InfoWorld][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/infoworld -[b]: https://github.com/lujun9972 -[1]: https://www.infoworld.com/article/3388312/move-data-to-the-cloud-with-azure-data-migration.html From d0bae13219988052efbb51119cab4e2b336164c5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:01:02 +0800 Subject: [PATCH 0139/1154] translating --- ....2 is Here- This is the Last Release with 32-bit Binaries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md b/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md index ad4bcee236..365db1f21a 100644 --- a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md +++ b/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 959645f2233fb1d292cb3d5efe2846f7787a4c85 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:10:20 +0800 Subject: [PATCH 0140/1154] What-s your primary backup strategy for the -home directory in Linux.md --- ...rategy for the -home directory in Linux.md | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md diff --git a/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md b/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md deleted file mode 100644 index 03031afc15..0000000000 --- a/sources/tech/20190412 What-s your primary backup strategy for the -home directory in Linux.md +++ /dev/null @@ -1,36 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What's your primary backup strategy for the /home directory in Linux?) -[#]: via: (https://opensource.com/poll/19/4/backup-strategy-home-directory-linux) -[#]: author: ( https://opensource.com/users/dboth/users/don-watkins/users/greg-p) - -What's your primary backup strategy for the /home directory in Linux? -====== - -![Linux keys on the keyboard for a desktop computer][1] - -I frequently upgrade to newer releases of Fedora, which is my primary distribution. I also upgrade other distros but much less frequently. I have also had many crashes of various types over the years, including a large portion of self-inflicted ones. Past experience with data loss has made me very aware of the need for good backups. - -I back up many parts of my Linux hosts but my **/home** directory is especially important. Losing any of the data in **/home** on my primary workstation due to a crash or an upgrade could be disastrous. - -My backup strategy for **/home** is to back up everything every day. There are other things on every Linux system to back up but **/home **is the center of everything I do on my workstation. I keep my documents and financial records there as well as off-line emails, address books for different apps, calendar and task data, and most importantly for me these days, the working copies of my next two Linux books. - -I can think of a number of approaches to doing backups and restores of **/home** which would allow an easy and complete recovery after a data loss ranging from a single file to the entire directory. Which approach do you take? Which tools do you use? - --------------------------------------------------------------------------------- - -via: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dboth/users/don-watkins/users/greg-p -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) From ac33225de30eb62c96d09fef0eb91c2021ddb4a9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:13:44 +0800 Subject: [PATCH 0141/1154] translating --- .../tech/20190402 Announcing the release of Fedora 30 Beta.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md index 19b5926e27..82a1d300da 100644 --- a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md +++ b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2c55bd26df22a5812313749b1b163aa559b4e6d6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:16:06 +0800 Subject: [PATCH 0142/1154] delete LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md --- ...s the Last Release with 32-bit Binaries.md | 114 ------------------ 1 file changed, 114 deletions(-) delete mode 100644 sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md diff --git a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md b/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md deleted file mode 100644 index ad4bcee236..0000000000 --- a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (LibreOffice 6.2 is Here: This is the Last Release with 32-bit Binaries) -[#]: via: (https://itsfoss.com/libreoffice-drops-32-bit-support/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -LibreOffice 6.2 is Here: This is the Last Release with 32-bit Binaries -====== - -LibreOffice is my favorite office suite as a free and powerful [alternative to Microsoft Office tools on Linux][1]. Even when I use my Windows machine – I prefer to have LibreOffice installed instead of Microsoft Office tools any day. - -Now, with the recent [LibreOffice][2] 6.2 update, there’s a lot of good stuff to talk about along with a bad news. - -### What’s New in LibreOffice 6.2? - -Let’s have a quick look at the major new features in the [latest release of LibreOffice][3]. - -If you like Linux videos, don’t forget to [subscribe to our YouTube channel][4] as well. - -#### The new NotebookBar - -![][5] - -A new addition to the interface that is optional and not enabled by default. In order to enable it, go to **View - > User Interface -> Tabbed**. - -You can either set it as a tabbed layout or a grouped compact layout. - -While it is not something that is mind blowing – but it still counts as a significant user interface update considering a variety of user preferences. - -#### Icon Theme - -![][6] - -A new set of icons is now available to choose from. I will definitely utilize the new set of icons – they look good! - -#### Platform Compatibility - -With the new update, the compatibility has been improved across all the platforms (Mac, Windows, and Linux). - -#### Performance Improvements - -This shouldn’t concern you if you didn’t have any issues. But, still, the better they work on this – it is a win-win for all. - -They have removed unnecessary animations, worked on latency reduction, avoided repeated re-layout, and more such things to improve the performance. - -#### More fixes and improvements - -A lot of bugs have been fixed in this new update along with little tweaks here and there for all the tools (Writer, Calc, Draw, Impress). - -To get to know all the technical details, you should check out their [release notes. -][7] - -### The Sad News: Dropping the support for 32-bit binaries - -Of course, this is not a feature. But, this was bound to happen – because it was anticipated a few months ago. LibreOffice will no more provide 32-bit binary releases. - -This is inevitable. [Ubuntu has dropped 32-bit support][8]. Many other Linux distributions have also stopped supporting 32-bit processors. The number of [Linux distributions still supporting a 32-bit architecture][9] is fast dwindling. - -For the future versions of LibreOffice on 32-bit systems, you’ll have to rely on your distribution to provide it to you. You cannot download the binaries anymore. - -### Installing LibreOffice 6.2 - -![][10] - -Your Linux distribution should be providing this update sooner or later. - -Arch-based Linux users should be getting it already while Ubuntu and Debian users would have to wait a bit longer. - -If you cannot wait, you should download it and [install it from the deb file][11]. Do remove the existing LibreOffice install before using the DEB file. - -[Download LibreOffice 6.2][12] - -If you don’t want to use the deb file, you may use the official PPA should provide you LibreOffice 6.2 before Ubuntu (it doesn’t have 6.2 release at the moment). It will update your existing LibreOffice install. - -``` -sudo add-apt-repository ppa:libreoffice/ppa -sudo apt update -sudo apt install libreoffice -``` - -### Wrapping Up - -LibreOffice 6.2 is definitely a major step up to keep it as a better alternative to Microsoft Office for Linux users. - -Do you happen to use LibreOffice? Do these updates matter to you? Let us know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/libreoffice-drops-32-bit-support/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ -[2]: https://www.libreoffice.org/ -[3]: https://itsfoss.com/libreoffice-6-0-released/ -[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/libreoffice-tabbed.png?resize=800%2C434&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/Libreoffice-style-elementary.png?ssl=1 -[7]: https://wiki.documentfoundation.org/ReleaseNotes/6.2 -[8]: https://itsfoss.com/ubuntu-drops-32-bit-desktop/ -[9]: https://itsfoss.com/32-bit-os-list/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/libre-office-6-2-release.png?resize=800%2C450&ssl=1 -[11]: https://itsfoss.com/install-deb-files-ubuntu/ -[12]: https://www.libreoffice.org/download/download/ From 083045684e600c99353e14333710367df28fd087 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:22:23 +0800 Subject: [PATCH 0143/1154] fix conflict --- ...s the Last Release with 32-bit Binaries.md | 114 ------------------ 1 file changed, 114 deletions(-) delete mode 100644 sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md diff --git a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md b/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md deleted file mode 100644 index 365db1f21a..0000000000 --- a/sources/tech/20190209 LibreOffice 6.2 is Here- This is the Last Release with 32-bit Binaries.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (LibreOffice 6.2 is Here: This is the Last Release with 32-bit Binaries) -[#]: via: (https://itsfoss.com/libreoffice-drops-32-bit-support/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -LibreOffice 6.2 is Here: This is the Last Release with 32-bit Binaries -====== - -LibreOffice is my favorite office suite as a free and powerful [alternative to Microsoft Office tools on Linux][1]. Even when I use my Windows machine – I prefer to have LibreOffice installed instead of Microsoft Office tools any day. - -Now, with the recent [LibreOffice][2] 6.2 update, there’s a lot of good stuff to talk about along with a bad news. - -### What’s New in LibreOffice 6.2? - -Let’s have a quick look at the major new features in the [latest release of LibreOffice][3]. - -If you like Linux videos, don’t forget to [subscribe to our YouTube channel][4] as well. - -#### The new NotebookBar - -![][5] - -A new addition to the interface that is optional and not enabled by default. In order to enable it, go to **View - > User Interface -> Tabbed**. - -You can either set it as a tabbed layout or a grouped compact layout. - -While it is not something that is mind blowing – but it still counts as a significant user interface update considering a variety of user preferences. - -#### Icon Theme - -![][6] - -A new set of icons is now available to choose from. I will definitely utilize the new set of icons – they look good! - -#### Platform Compatibility - -With the new update, the compatibility has been improved across all the platforms (Mac, Windows, and Linux). - -#### Performance Improvements - -This shouldn’t concern you if you didn’t have any issues. But, still, the better they work on this – it is a win-win for all. - -They have removed unnecessary animations, worked on latency reduction, avoided repeated re-layout, and more such things to improve the performance. - -#### More fixes and improvements - -A lot of bugs have been fixed in this new update along with little tweaks here and there for all the tools (Writer, Calc, Draw, Impress). - -To get to know all the technical details, you should check out their [release notes. -][7] - -### The Sad News: Dropping the support for 32-bit binaries - -Of course, this is not a feature. But, this was bound to happen – because it was anticipated a few months ago. LibreOffice will no more provide 32-bit binary releases. - -This is inevitable. [Ubuntu has dropped 32-bit support][8]. Many other Linux distributions have also stopped supporting 32-bit processors. The number of [Linux distributions still supporting a 32-bit architecture][9] is fast dwindling. - -For the future versions of LibreOffice on 32-bit systems, you’ll have to rely on your distribution to provide it to you. You cannot download the binaries anymore. - -### Installing LibreOffice 6.2 - -![][10] - -Your Linux distribution should be providing this update sooner or later. - -Arch-based Linux users should be getting it already while Ubuntu and Debian users would have to wait a bit longer. - -If you cannot wait, you should download it and [install it from the deb file][11]. Do remove the existing LibreOffice install before using the DEB file. - -[Download LibreOffice 6.2][12] - -If you don’t want to use the deb file, you may use the official PPA should provide you LibreOffice 6.2 before Ubuntu (it doesn’t have 6.2 release at the moment). It will update your existing LibreOffice install. - -``` -sudo add-apt-repository ppa:libreoffice/ppa -sudo apt update -sudo apt install libreoffice -``` - -### Wrapping Up - -LibreOffice 6.2 is definitely a major step up to keep it as a better alternative to Microsoft Office for Linux users. - -Do you happen to use LibreOffice? Do these updates matter to you? Let us know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/libreoffice-drops-32-bit-support/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ -[2]: https://www.libreoffice.org/ -[3]: https://itsfoss.com/libreoffice-6-0-released/ -[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/libreoffice-tabbed.png?resize=800%2C434&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/Libreoffice-style-elementary.png?ssl=1 -[7]: https://wiki.documentfoundation.org/ReleaseNotes/6.2 -[8]: https://itsfoss.com/ubuntu-drops-32-bit-desktop/ -[9]: https://itsfoss.com/32-bit-os-list/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/libre-office-6-2-release.png?resize=800%2C450&ssl=1 -[11]: https://itsfoss.com/install-deb-files-ubuntu/ -[12]: https://www.libreoffice.org/download/download/ From 671f4bebcd4b54ffd09de1503e4266ad4f682760 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:44:02 +0800 Subject: [PATCH 0144/1154] Revert "translating" This reverts commit ac33225de30eb62c96d09fef0eb91c2021ddb4a9. --- .../tech/20190402 Announcing the release of Fedora 30 Beta.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md index 82a1d300da..19b5926e27 100644 --- a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md +++ b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (geekpi) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 60d64c7f770cbe51480bd56753b8a30a8ea342cc Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 25 Apr 2019 09:47:08 +0800 Subject: [PATCH 0145/1154] translating --- sources/tech/20190417 Managing RAID arrays with mdadm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190417 Managing RAID arrays with mdadm.md b/sources/tech/20190417 Managing RAID arrays with mdadm.md index 5f29608b8a..2d5d5f5983 100644 --- a/sources/tech/20190417 Managing RAID arrays with mdadm.md +++ b/sources/tech/20190417 Managing RAID arrays with mdadm.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From faa6b685f93f4444522925bcb10e43921236b411 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 25 Apr 2019 23:58:56 +0800 Subject: [PATCH 0146/1154] PRF:20190415 How to identify duplicate files on Linux.md @MjSeven --- ...ow to identify duplicate files on Linux.md | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/translated/tech/20190415 How to identify duplicate files on Linux.md b/translated/tech/20190415 How to identify duplicate files on Linux.md index 033c3d85a1..f71939213a 100644 --- a/translated/tech/20190415 How to identify duplicate files on Linux.md +++ b/translated/tech/20190415 How to identify duplicate files on Linux.md @@ -1,20 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -[#]: subject: (How to identify duplicate files on Linux) +[#]: subject: (How to identify duplicate files on Linux) [#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -如何识别 Linux 上的重复文件 +如何识别 Linux 上的文件分身 ====== -Linux 系统上的一些文件可能出现在多个位置。按照本文指示查找并识别这些“同卵双胞胎”,还可以了解为什么硬链接会如此有利。 + +> Linux 系统上的一些文件可能出现在多个位置。按照本文指示查找并识别这些“同卵双胞胎”,还可以了解为什么硬链接会如此有利。 + ![Archana Jarajapu \(CC BY 2.0\)][1] -识别共享磁盘空间的文件依赖于利用文件共享相同的 `inode` 这一事实。这种数据结构存储除了文件名和内容之外的所有信息。如果两个或多个文件具有不同的名称和文件系统位置,但共享一个 inode,则它们还共享内容、所有权、权限等。 +识别使用同一个磁盘空间的文件依赖于利用文件使用相同的 inode 这一事实。这种数据结构存储除了文件名和内容之外的所有信息。如果两个或多个文件具有不同的名称和文件系统位置,但共享一个 inode,则它们还共享内容、所有权、权限等。 -这些文件通常被称为“硬链接”,不像符号链接(即软链接)那样仅仅通过包含它们的名称指向其他文件,符号链接很容易在文件列表中通过第一个位置的 “l” 和引用文件的 **->** 符号识别出来。 +这些文件通常被称为“硬链接”,不像符号链接(即软链接)那样仅仅通过包含它们的名称指向其他文件,符号链接很容易在文件列表中通过第一个位置的 `l` 和引用文件的 `->` 符号识别出来。 ``` $ ls -l my* @@ -23,7 +25,7 @@ lrwxrwxrwx 1 shs shs 6 Apr 15 11:18 myref -> myfile -rw-r--r-- 4 shs shs 228 Apr 12 19:37 mytwin ``` -识别单个目录中的硬链接并不是很明显,但它仍然非常容易。如果使用 **ls -i** 命令列出文件并按 `inode` 编号排序,则可以非常容易地挑选出硬链接。在这种类型的 `ls` 输出中,第一列显示 `inode` 编号。 +在单个目录中的硬链接并不是很明显,但它仍然非常容易找到。如果使用 `ls -i` 命令列出文件并按 inode 编号排序,则可以非常容易地挑选出硬链接。在这种类型的 `ls` 输出中,第一列显示 inode 编号。 ``` $ ls -i | sort -n | more @@ -36,11 +38,10 @@ $ ls -i | sort -n | more 800247 nmap-notes ``` -扫描输出,查找相同的 `inode` 编号,任何匹配都会告诉你想知道的内容。 +扫描输出,查找相同的 inode 编号,任何匹配都会告诉你想知道的内容。 -**[另请参考:[Linux 疑难解答的宝贵提示和技巧][2]]** +另一方面,如果你只是想知道某个特定文件是否是另一个文件的硬链接,那么有一种方法比浏览数百个文件的列表更简单,即 `find` 命令的 `-samefile` 选项将帮助你完成工作。 -另一方面,如果你只是想知道某个特定文件是否是另一个文件的硬链接,那么有一种方法比浏览数百个文件的列表更简单,即 `find` 命令的 **-samefile** 选项将帮助你完成工作。 ``` $ find . -samefile myfile ./myfile @@ -50,7 +51,8 @@ $ find . -samefile myfile 注意,提供给 `find` 命令的起始位置决定文件系统会扫描多少来进行匹配。在上面的示例中,我们正在查看当前目录和子目录。 -使用 find 的 **-ls** 选项添加输出的详细信息可能更有说服力: +使用 `find` 的 `-ls` 选项添加输出的详细信息可能更有说服力: + ``` $ find . -samefile myfile -ls 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./myfile @@ -58,9 +60,10 @@ $ find . -samefile myfile -ls 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./mytwin ``` -第一列显示 `inode` 编号,然后我们会看到文件权限、链接、所有者、文件大小、日期信息以及引用相同磁盘内容的文件的名称。注意,在这种情况下,`link` 字段是 “4” 而不是我们可能期望的 “3”。这告诉我们还有另一个指向同一个 `inode` 的链接(但不在我们的搜索范围内)。 +第一列显示 inode 编号,然后我们会看到文件权限、链接、所有者、文件大小、日期信息以及引用相同磁盘内容的文件的名称。注意,在这种情况下,链接字段是 “4” 而不是我们可能期望的 “3”。这告诉我们还有另一个指向同一个 inode 的链接(但不在我们的搜索范围内)。 如果你想在一个目录中查找所有硬链接的实例,可以尝试以下的脚本来创建列表并为你查找副本: + ``` #!/bin/bash @@ -83,13 +86,15 @@ done < /tmp/$0 # clean up rm /tmp/$0 +``` +``` $ ./findHardLinks 788000 myfile 788000 mytwin ``` -你还可以使用 `find` 命令按 `inode` 编号查找文件,如命令中所示。但是,此搜索可能涉及多个文件系统,因此可能会得到错误的结果。因为相同的 `inode` 编号可能会在另一个文件系统中使用,代表另一个文件。如果是这种情况,文件的其他详细信息将不相同。 +你还可以使用 `find` 命令按 inode 编号查找文件,如命令中所示。但是,此搜索可能涉及多个文件系统,因此可能会得到错误的结果。因为相同的 inode 编号可能会在另一个文件系统中使用,代表另一个文件。如果是这种情况,文件的其他详细信息将不相同。 ``` $ find / -inum 788000 -ls 2> /dev/null @@ -99,20 +104,18 @@ $ find / -inum 788000 -ls 2> /dev/null 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/mytwin ``` -注意,错误输出被重定向到 `/dev/null`,这样我们就不必查看所有 "Permission denied" 错误,否则这些错误将显示在我们不允许查看的其他目录中。 +注意,错误输出被重定向到 `/dev/null`,这样我们就不必查看所有 “Permission denied” 错误,否则这些错误将显示在我们不允许查看的其他目录中。 -此外,扫描包含相同内容但不共享 `inode` 的文件(即,简单的文本拷贝)将花费更多的时间和精力。 - -加入 [Facebook][3] 和 [LinkedIn][4] 上的网络世界社区,对重要的话题发表评论。 +此外,扫描包含相同内容但不共享 inode 的文件(即,简单的文本拷贝)将花费更多的时间和精力。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all +via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0927144ab6d2ccf99445351c29a5b6a039c98cfb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 25 Apr 2019 23:59:33 +0800 Subject: [PATCH 0147/1154] PUB:20190415 How to identify duplicate files on Linux.md @MjSeven https://linux.cn/article-10777-1.html --- .../20190415 How to identify duplicate files on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 How to identify duplicate files on Linux.md (98%) diff --git a/translated/tech/20190415 How to identify duplicate files on Linux.md b/published/20190415 How to identify duplicate files on Linux.md similarity index 98% rename from translated/tech/20190415 How to identify duplicate files on Linux.md rename to published/20190415 How to identify duplicate files on Linux.md index f71939213a..f723c02a16 100644 --- a/translated/tech/20190415 How to identify duplicate files on Linux.md +++ b/published/20190415 How to identify duplicate files on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10777-1.html) [#]: subject: (How to identify duplicate files on Linux) [#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From fdf389bc2992c69f2ac3d23c1414ae3d452c595b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 26 Apr 2019 00:11:27 +0800 Subject: [PATCH 0148/1154] PRF:20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @geekpi --- ...iles and Folders in Linux -Beginner Tip.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md index 49857445e1..77e63bc10c 100644 --- a/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md +++ b/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @@ -1,16 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip]) [#]: via: (https://itsfoss.com/linux-zip-folder/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何在 Linux 中 zip 压缩文件和文件夹(初学者提示) +初级:如何在 Linux 中 zip 压缩文件和文件夹 ====== -_ **简介:本文向你展示了如何在 Ubuntu 和其他 Linux 发行版中创建一个 zip 文件夹。终端和 GUI 方法都有。** _ +> 本文向你展示了如何在 Ubuntu 和其他 Linux 发行版中创建一个 zip 文件夹。终端和 GUI 方法都有。 zip 是最流行的归档文件格式之一。使用 zip,你可以将多个文件压缩到一个文件中。这不仅节省了磁盘空间,还节省了网络带宽。这就是为什么你几乎一直会看到 zip 文件的原因。 @@ -18,7 +18,7 @@ zip 是最流行的归档文件格式之一。使用 zip,你可以将多个文 **先决条件:验证是否安装了 zip** -通常 [zip][1] 已经安装,但验证下也没坏处。你可以运行以下命令来安装 zip 和 unzip。如果它尚未安装,它将立即安装。 +通常 [zip][1] 已经安装,但验证下也没坏处。你可以运行以下命令来安装 `zip` 和 `unzip`。如果它尚未安装,它将立即安装。 ``` sudo apt install zip unzip @@ -30,7 +30,7 @@ sudo apt install zip unzip ### 在 Linux 命令行中压缩文件夹 -zip 命令的语法非常简单。 +`zip` 命令的语法非常简单。 ``` zip [option] output_file_name input1 input2 @@ -42,7 +42,7 @@ zip [option] output_file_name input1 input2 zip -r output_file.zip file1 folder1 ``` --r 选项将递归目录并压缩其内容。输出文件中的 .zip 扩展名是可选的,因为默认情况下会添加 .zip。 +`-r` 选项将递归目录并压缩其内容。输出文件中的 .zip 扩展名是可选的,因为默认情况下会添加 .zip。 你应该会在 zip 操作期间看到要添加到压缩文件夹中的文件。 @@ -55,13 +55,13 @@ zip -r myzip abhi-1.txt abhi-2.txt sample_directory adding: sample_directory/agatha.txt (deflated 41%) ``` -你可以使用 -e 选项[在 Linux 中创建密码保护的 zip 文件夹][3]。 +你可以使用 `-e` 选项[在 Linux 中创建密码保护的 zip 文件夹][3]。 你并不是只能通过终端创建 zip 归档文件。你也可以用图形方式做到这一点。下面是如何做的! ### 在 Ubuntu Linux 中使用 GUI 压缩文件夹 -_虽然我在这里使用 Ubuntu,但在使用 GNOME 或其他桌面环境的其他发行版中,方法应该基本相同。_ +*虽然我在这里使用 Ubuntu,但在使用 GNOME 或其他桌面环境的其他发行版中,方法应该基本相同。* 如果要在 Linux 桌面中压缩文件或文件夹,只需点击几下即可。 @@ -73,7 +73,7 @@ _虽然我在这里使用 Ubuntu,但在使用 GNOME 或其他桌面环境的 现在,你可以使用 zip、tar xz 或 7z 格式创建压缩归档文件。如果你好奇,这三个都是各种压缩算法,你可以使用它们来压缩文件。 -输入一个你想要的名字,并点击“创建” +输入一个你想要的名字,并点击“创建”。 ![Create archive file][5] @@ -92,7 +92,7 @@ via: https://itsfoss.com/linux-zip-folder/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e2466ec732290a7e8eb2f54575b29d2be5c17ff9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 26 Apr 2019 00:12:01 +0800 Subject: [PATCH 0149/1154] PUB:20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @geekpi https://linux.cn/article-10778-1.html --- ...413 How to Zip Files and Folders in Linux -Beginner Tip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md (98%) diff --git a/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/published/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md similarity index 98% rename from translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md rename to published/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md index 77e63bc10c..d852b7036e 100644 --- a/translated/tech/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md +++ b/published/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10778-1.html) [#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip]) [#]: via: (https://itsfoss.com/linux-zip-folder/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From d9a0821f1f4a0e70e4317391c3f1caaa193245a0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 26 Apr 2019 08:20:49 +0800 Subject: [PATCH 0150/1154] PRF:20190415 Getting started with Mercurial for version control.md @geekpi --- ...rted with Mercurial for version control.md | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/translated/tech/20190415 Getting started with Mercurial for version control.md b/translated/tech/20190415 Getting started with Mercurial for version control.md index 078589dd2d..a8cef88003 100644 --- a/translated/tech/20190415 Getting started with Mercurial for version control.md +++ b/translated/tech/20190415 Getting started with Mercurial for version control.md @@ -1,32 +1,31 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with Mercurial for version control) [#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -开始使用 Mercurial 进行版本控制 +Mercurial 版本控制入门 ====== -了解 Mercurial 的基础知识,它是一个用 Python 写的分布式版本控制系统。 + +> 了解 Mercurial 的基础知识,它是一个用 Python 写的分布式版本控制系统。 ![][1] [Mercurial][2] 是一个用 Python 编写的分布式版本控制系统。因为它是用高级语言编写的,所以你可以用 Python 函数编写一个 Mercurial 扩展。 -在[官方文档中][3]说明了几种安装 Mercurial 的方法。我最喜欢的一种方法不在里面:使用 **pip**。这是开发本地扩展的最合适方式! +在[官方文档中][3]说明了几种安装 Mercurial 的方法。我最喜欢的一种方法不在里面:使用 `pip`。这是开发本地扩展的最合适方式! 目前,Mercurial 仅支持 Python 2.7,因此你需要创建一个 Python 2.7 虚拟环境: - ``` python2 -m virtualenv mercurial-env ./mercurial-env/bin/pip install mercurial ``` -为了有一个简短的命令,以及满足人们对化学幽默的无法满足的需求,命令称之为 **hg**。 - +为了让命令简短一些,以及满足人们对化学幽默的渴望,该命令称之为 `hg`。 ``` $ source mercurial-env/bin/activate @@ -39,7 +38,6 @@ $ source mercurial-env/bin/activate 由于还没有任何文件,因此状态为空。添加几个文件: - ``` (mercurial-env)$ echo 1 > one (mercurial-env)$ echo 2 > two @@ -58,13 +56,12 @@ date: Fri Mar 29 12:42:43 2019 -0700 summary: Adding stuff ``` -**addremove** 命令很有用:它将任何未被忽略的新文件添加到托管文件列表中,并移除任何已删除的文件。 +`addremove` 命令很有用:它将任何未被忽略的新文件添加到托管文件列表中,并移除任何已删除的文件。 如我所说,Mercurial 扩展用 Python 写成,它们只是常规的 Python 模块。 这是一个简短的 Mercurial 扩展示例: - ``` from mercurial import registrar from mercurial.i18n import _ @@ -74,19 +71,17 @@ command = registrar.command(cmdtable) @command('say-hello', [('w', 'whom', '', _('Whom to greet'))]) -def say_hello(ui, repo, **opts): +def say_hello(ui, repo, `opts): ui.write("hello ", opts['whom'], "\n") ``` -一个简单的测试方法是将它手动加入虚拟环境中的文件中: - +简单的测试方法是将它手动加入虚拟环境中的文件中: ``` `$ vi ../mercurial-env/lib/python2.7/site-packages/hello_ext.py` ``` -然后你需要_启用_扩展。你可以仅在当前仓库中启用它开始: - +然后你需要*启用*扩展。你可以仅在当前仓库中启用它: ``` $ cat >> .hg/hgrc @@ -96,13 +91,12 @@ hello_ext = 现在,问候有了: - ``` (mercurial-env)$ hg say-hello --whom world hello world ``` -大多数扩展会做更多有用的东西,甚至可能与 Mercurial 有关。 **repo** 对象是 **mercurial.hg.repository** 的对象。 +大多数扩展会做更多有用的东西,甚至可能与 Mercurial 有关。 `repo` 对象是 `mercurial.hg.repository` 的对象。 有关 Mercurial API 的更多信息,请参阅[官方文档][5]。并访问[官方仓库][6]获取更多示例和灵感。 @@ -110,10 +104,10 @@ hello world via: https://opensource.com/article/19/4/getting-started-mercurial -作者:[Moshe Zadka (Community Moderator)][a] +作者:[Moshe Zadka][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/) 荣誉推出 From f21c7a4b279b9b9ae75b16f5bcca87fe66fa58bb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 26 Apr 2019 08:21:19 +0800 Subject: [PATCH 0151/1154] PUB:20190415 Getting started with Mercurial for version control.md @geekpi https://linux.cn/article-10780-1.html --- ...0415 Getting started with Mercurial for version control.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 Getting started with Mercurial for version control.md (98%) diff --git a/translated/tech/20190415 Getting started with Mercurial for version control.md b/published/20190415 Getting started with Mercurial for version control.md similarity index 98% rename from translated/tech/20190415 Getting started with Mercurial for version control.md rename to published/20190415 Getting started with Mercurial for version control.md index a8cef88003..e95ac5fb98 100644 --- a/translated/tech/20190415 Getting started with Mercurial for version control.md +++ b/published/20190415 Getting started with Mercurial for version control.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10780-1.html) [#]: subject: (Getting started with Mercurial for version control) [#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 48f07e8a7a2d16f681c380a8828ae4c3190f9b78 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 26 Apr 2019 08:45:41 +0800 Subject: [PATCH 0152/1154] translated --- ...0190417 Managing RAID arrays with mdadm.md | 99 ----------------- ...0190417 Managing RAID arrays with mdadm.md | 105 ++++++++++++++++++ 2 files changed, 105 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20190417 Managing RAID arrays with mdadm.md create mode 100644 translated/tech/20190417 Managing RAID arrays with mdadm.md diff --git a/sources/tech/20190417 Managing RAID arrays with mdadm.md b/sources/tech/20190417 Managing RAID arrays with mdadm.md deleted file mode 100644 index 2d5d5f5983..0000000000 --- a/sources/tech/20190417 Managing RAID arrays with mdadm.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Managing RAID arrays with mdadm) -[#]: via: (https://fedoramagazine.org/managing-raid-arrays-with-mdadm/) -[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) - -Managing RAID arrays with mdadm -====== - -![][1] - -Mdadm stands for Multiple Disk and Device Administration. It is a command line tool that can be used to manage software [RAID][2] arrays on your Linux PC. This article outlines the basics you need to get started with it. - -The following five commands allow you to make use of mdadm’s most basic features: - - 1. **Create a RAID array** : -### mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 - 2. **Assemble (and start) a RAID array** : -### mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1 - 3. **Stop a RAID array** : -### mdadm --stop /dev/md/test - 4. **Delete a RAID array** : -### mdadm --zero-superblock /dev/sda1 /dev/sdb1 - 5. **Check the status of all assembled RAID arrays** : -### cat /proc/mdstat - - - -#### Notes on features - -##### `mdadm --create` - -The _create_ command shown above includes the following four parameters in addition to the create parameter itself and the device names: - - 1. **–homehost** : -By default, mdadm stores your computer’s name as an attribute of the RAID array. If your computer name does not match the stored name, the array will not automatically assemble. This feature is useful in server clusters that share hard drives because file system corruption usually occurs if multiple servers attempt to access the same drive at the same time. The name _any_ is reserved and disables the _homehost_ restriction. - 2. **–metadata** : -_mdadm_ reserves a small portion of each RAID device to store information about the RAID array itself. The _metadata_ parameter specifies the format and location of the information. The value _1.0_ indicates to use version-1 formatting and store the metadata at the end of the device. - 3. **–level** : -The _level_ parameter specifies how the data should be distributed among the underlying devices. Level _1_ indicates each device should contain a complete copy of all the data. This level is also known as [disk mirroring][3]. - 4. **–raid-devices** : -The _raid-devices_ parameter specifies the number of devices that will be used to create the RAID array. - - - -By using _level=1_ (mirroring) in combination with _metadata=1.0_ (store the metadata at the end of the device), you create a RAID1 array whose underlying devices appear normal if accessed without the aid of the mdadm driver. This is useful in the case of disaster recovery, because you can access the device even if the new system doesn’t support mdadm arrays. It’s also useful in case a program needs _read-only_ access to the underlying device before mdadm is available. For example, the [UEFI][4] firmware in a computer may need to read the bootloader from the [ESP][5] before mdadm is started. - -##### `mdadm --assemble` - -The _assemble_ command above fails if a member device is missing or corrupt. To force the RAID array to assemble and start when one of its members is missing, use the following command: - -``` -# mdadm --assemble --run /dev/md/test /dev/sda1 -``` - -#### Other important notes - -Avoid writing directly to any devices that underlay a mdadm RAID1 array. That causes the devices to become out-of-sync and mdadm won’t know that they are out-of-sync. If you access a RAID1 array with a device that’s been modified out-of-band, you can cause file system corruption. If you modify a RAID1 device out-of-band and need to force the array to re-synchronize, delete the mdadm metadata from the device to be overwritten and then re-add it to the array as demonstrated below: - -``` -# mdadm --zero-superblock /dev/sdb1 -# mdadm --assemble --run /dev/md/test /dev/sda1 -# mdadm /dev/md/test --add /dev/sdb1 -``` - -These commands completely overwrite the contents of sdb1 with the contents of sda1. - -To specify any RAID arrays to automatically activate when your computer starts, create an _/etc/mdadm.conf_ configuration file. - -For the most up-to-date and detailed information, check the man pages: - -``` -$ man mdadm -$ man mdadm.conf -``` - -The next article of this series will show a step-by-step guide on how to convert an existing single-disk Linux installation to a mirrored-disk installation, that will continue running even if one of its hard drives suddenly stops working! - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ - -作者:[Gregory Bartholomew][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/glb/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/mdadm-816x345.jpg -[2]: https://en.wikipedia.org/wiki/RAID -[3]: https://en.wikipedia.org/wiki/Disk_mirroring -[4]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface -[5]: https://en.wikipedia.org/wiki/EFI_system_partition diff --git a/translated/tech/20190417 Managing RAID arrays with mdadm.md b/translated/tech/20190417 Managing RAID arrays with mdadm.md new file mode 100644 index 0000000000..ecb488b0ce --- /dev/null +++ b/translated/tech/20190417 Managing RAID arrays with mdadm.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managing RAID arrays with mdadm) +[#]: via: (https://fedoramagazine.org/managing-raid-arrays-with-mdadm/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +使用 mdadm 管理 RAID 阵列 +====== + +![][1] + +mdadm 代表多磁盘和设备管理 (Multiple Disk and Device Administration)。它是一个命令行工具,可用于管理 Linux 上的软件 [RAID][2] 阵列。本文概述了使用它的基础知识。 + +以下 5 个命令是你使用 mdadm 的基础功能: + + 1. **创建 RAID 阵列**: +### mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 + + 2. **组合(并启动)RAID 阵列**: +### mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1 + + 3. **停止 RAID 阵列**: +### mdadm --stop /dev/md/test + + 4. **删除 RAID 阵列**: +### mdadm --zero-superblock /dev/sda1 /dev/sdb1 + + 5. **检查所有已组合的 RAID 阵列的状态**: +### cat /proc/mdstat + + + +#### 功能说明 + +##### `mdadm --create` + +上面的 _create_ 命令除了 create 参数自身和设备名之外,还包括了四个参数: + + 1. **–homehost** : +默认情况下,mdadm 将你的计算机名保存为 RAID 阵列的属性。如果你的计算机名与存储的名称不匹配,则阵列将不会自动组合。此功能在共享硬盘的服务器群集中很有用,因为如果多个服务器同时尝试访问同一驱动器,通常会发生文件系统损坏。名称 _any_ 是保留字段并禁用 _homehost_ 限制。 + + 2. **–metadata** : +_mdadm_ 保存每个 RAID 设备的一小部分,以存储有关 RAID 阵列本身的信息。 _metadata_ 参数指定信息的格式和位置。_1.0_ 表示使用版本 1 格式并将元数据存储在设备的末尾。 + + 3. **–level** : +_level_ 参数指定数据应如何在底层设备之间分布。级别 _1_ 表示每个设备应包含所有数据的完整副本。此级别也称为[磁盘镜像] [3]。 + + 4. **–raid-devices** : +_raid-devices_ 参数指定将用于创建 RAID 阵列的设备数。 + + +通过将 _level=1_ (镜像)与 _metadata=1.0_ (将元数据存储在设备末尾)结合使用,可以创建一个 RAID1 阵列,如果不通过 mdadm 驱动访问,那么它的底层设备会正常显示。这在灾难恢复的情况下很有用,因为即使新系统不支持 mdadm 阵列,你也可以访问该设备。如果程序需要在 mdadm 可用之前以_只读_访问底层设备时也很有用。例如,计算机中的 [UEFI][4] 固件可能需要在启动 mdadm 之前从 [ESP][5] 读取引导加载程序。 + +##### `mdadm --assemble` + +如果成员设备丢失或损坏,上面的 _assemble_ 命令将失败。要强制 RAID 阵列在其中一个成员丢失时进行组合并启动,请使用以下命令: + +``` +# mdadm --assemble --run /dev/md/test /dev/sda1 +``` + +#### 其他重要说明 + +避免直接写入底层是 RAID1 的设备。这导致设备不同步,并且 mdadm 不会知道它们不同步。如果你访问了某个在其他地方被修改的设备的 RAID1 阵列,则可能导致文件系统损坏。如果你在其他地方修改 RAID1 设备并需要强制阵列重新同步,请从要覆盖的设备中删除 mdadm 元数据,然后将其重新添加到阵列,如下所示: + +``` +# mdadm --zero-superblock /dev/sdb1 +# mdadm --assemble --run /dev/md/test /dev/sda1 +# mdadm /dev/md/test --add /dev/sdb1 +``` + +以上用 sda1 的内容完全覆盖 sdb1 的内容。 + +要指定在计算机启动时自动激活的 RAID 阵列,请创建 _/etc/mdadm.conf_ 配置。 + +有关最新和详细信息,请查看手册页: + +``` +$ man mdadm +$ man mdadm.conf +``` + +本系列的下一篇文章将展示如何将现有的单磁盘 Linux 安装变为镜像磁盘安装,这意味着即使其中一个硬盘突然停止工作,系统仍将继续运行! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ + +作者:[Gregory Bartholomew][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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/mdadm-816x345.jpg +[2]: https://en.wikipedia.org/wiki/RAID +[3]: https://en.wikipedia.org/wiki/Disk_mirroring +[4]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface +[5]: https://en.wikipedia.org/wiki/EFI_system_partition From 0c48e8876001967d6beb0a013c6d02ea47b20acb Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 26 Apr 2019 08:50:50 +0800 Subject: [PATCH 0153/1154] translated --- ... 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md index 8098db45f2..a74b63303a 100644 --- a/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md +++ b/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2a708143cc57d072f5fdefe9262af42f07d0d5f7 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 27 Apr 2019 11:25:30 +0800 Subject: [PATCH 0154/1154] Translating by MjSeven --- ...405 Command line quick tips- Cutting content out of files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190405 Command line quick tips- Cutting content out of files.md b/sources/tech/20190405 Command line quick tips- Cutting content out of files.md index cd72985532..78b8216eca 100644 --- a/sources/tech/20190405 Command line quick tips- Cutting content out of files.md +++ b/sources/tech/20190405 Command line quick tips- Cutting content out of files.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ff828a9ee968394c7929a016f55d5b11278a6b92 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 26 Apr 2019 22:26:53 -0500 Subject: [PATCH 0155/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20=E7=94=A8=E6=9D=A5=E8=AE=B0=E7=AC=94=E8=AE=B0=E7=9A=84?= =?UTF-8?q?=E4=B8=89=E4=B8=AA=20Emacs=20modes=20(#13419)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * translating by lujun9972 * translate done: 20180718 3 Emacs modes for taking notes.md --- ...20180718 3 Emacs modes for taking notes.md | 74 ------------------ ...20180718 3 Emacs modes for taking notes.md | 75 +++++++++++++++++++ 2 files changed, 75 insertions(+), 74 deletions(-) delete mode 100644 sources/tech/20180718 3 Emacs modes for taking notes.md create mode 100644 translated/tech/20180718 3 Emacs modes for taking notes.md diff --git a/sources/tech/20180718 3 Emacs modes for taking notes.md b/sources/tech/20180718 3 Emacs modes for taking notes.md deleted file mode 100644 index 2627357182..0000000000 --- a/sources/tech/20180718 3 Emacs modes for taking notes.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 Emacs modes for taking notes) -[#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -3 Emacs modes for taking notes -====== -Keep track of information easily with these Emacs modes. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/notebook-writing-pen.jpg?itok=uA3dCfu_) - -No matter what line of work you're in, it's inevitable you have to take a few notes. Often, more than a few. If you're like many people in this day and age, you take your notes digitally. - -Open source enthusiasts have a variety of options for jotting down their ideas, thoughts, and research in electronic format. You might use a [web-based tool][1]. You might go for a [desktop application][2]. Or, you might [turn to the command line][3]. - -If you use [Emacs][4], that wonderful operating system disguised as a text editor, there are modes that can help you take notes more efficiently. Let's look at three of them. - -### Deft -![](https://opensource.com/sites/default/files/uploads/deft.png) - -On those rare occasions I'm forced to use a Mac, there's one tool I can't do without: the [nvALT][5] note-taking application. [Deft mode][6] brings the nvALT experience to Emacs. - -Deft stores your notes as text files in a single folder on your computer. When you enter Deft mode, it displays a list of your notes along with a short summary. The summary is taken from the first line of the text file. If you add, say, Markdown, LaTeX, or even Emacs Org mode formatting to the first line, Deft ignores the formatting and displays only the text. - -To open a note, just scroll down to it and press Enter. Deft does a bit more, though. According to Deft's developer, Jason Blevins, its _primary operation is searching and filtering_. Deft does that simply but efficiently. Type a keyword and Deft displays only the notes that have that keyword in their title. That's useful if you have a lot of notes and want to find one quickly. - -### Org mode -![](https://opensource.com/sites/default/files/uploads/orgmode.png) - -There would be a couple or three people who would have jumped all over me if I didn't include [Org mode][7] in this article. Why? It's arguably the most flexible and the most widely used Emacs mode for taking notes. Used in the right way, Org mode can supercharge your note-taking. - -Org mode's main strength is how it organizes your notes. In Org mode, a note file is set up as a large outline. Each section is a node in the outline, which you can expand and collapse. Those sections can have subsections, which also expand and collapse. That not only lets you focus on one section at a time, but it also gives you an at-a-glance overview of the information you have. - -You can [link][8] between sections of your notes, quickly move sections without cutting and pasting, and [attach files][9] to your notes. Org mode supports character formatting and tables. If you need to convert your notes to something else, Org mode has a number of [export options][10]. - -### Howm - -![](https://opensource.com/sites/default/files/uploads/howm.png) - -When I started using Emacs regularly, [howm][11] quickly became one of the modes I leaned heavily on. And even though I'm deep into using Org mode, I still have a soft spot for howm. - -Howm acts like a small wiki. You can create notes and task lists and link between them. By typing or clicking a link, you can jump between notes. If you need to, you can also tag your notes with a keyword. On top of that, you can search, sort, and concatenate your notes. - -Howm isn't the prettiest Emacs mode, and it doesn't have the best UX. It takes a bit of getting used to. Once you do, taking and maneuvering around notes is a breeze. - -Do you have a favorite Emacs mode for taking notes? Feel free to share it by leaving a comment. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/7/emacs-modes-note-taking - -作者:[Scott Nesbitt][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/alternatives/evernote -[2]: https://opensource.com/life/16/9/4-desktop-note-taking-applications -[3]: https://opensource.com/article/18/3/command-line-note-taking-applications -[4]: https://www.gnu.org/software/emacs/ -[5]: http://brettterpstra.com/projects/nvalt/ -[6]: https://jblevins.org/projects/deft/ -[7]: https://orgmode.org/ -[8]: https://orgmode.org/org.html#Hyperlinks -[9]: https://orgmode.org/org.html#Attachments -[10]: https://orgmode.org/org.html#Exporting -[11]: https://howm.osdn.jp/ diff --git a/translated/tech/20180718 3 Emacs modes for taking notes.md b/translated/tech/20180718 3 Emacs modes for taking notes.md new file mode 100644 index 0000000000..0ec05b8674 --- /dev/null +++ b/translated/tech/20180718 3 Emacs modes for taking notes.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 Emacs modes for taking notes) +[#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +用来记笔记的三个 Emacs modes +====== +借助这些 Emacs mode 轻松记录信息。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/notebook-writing-pen.jpg?itok=uA3dCfu_) + + +不管你从事哪种工作,你都无可避免地需要记笔记。而且可能还不是一点点。现在这年头,大家都开始以数字的形式来记笔记了。 + +开源软件爱好者有多种途径来以电子的方式记下他们的创意,想法和研究过程。你可以使用 [网页工具 ][[1]]。你可以使用 [桌面应用 ][2]。或者,你也可以 [使用命令行工具 ][3]。 + +如果你使用 [Emacs][4]( 伪装成文本编辑器的强力操作系统),有多个 mode 可以帮你有效地记录笔记。我们这里列举三个例子。 + +### Deft +![](https://opensource.com/sites/default/files/uploads/deft.png) + +在少数情况下,我被迫需要使用 Mac,有一个工具是我不能缺少的:[nvALT][5] 笔记应用。[Deft mode][6] 为 Emacs 带来了 nvALT 式的体验。 + +Deft 将你的笔记以文本文件的形式存储在电脑中的某个文件夹中。当你进入 Deft mode,你会看到一系列的笔记及其摘要。这些摘要其实就是文本文件的第一行。若第一行是 Markdown,LaTeX,甚至 Emacs Org mode 格式的话,Deft 会忽略掉这些格式而只显示文本内容。 + +要打开笔记,只需要向下滚动到该笔记的位置然后按下回车即可。然而 Deft 不仅仅只是这样。根据 Deft 开发者 Jason Blevins 的说法,它的 /主要操作时搜索和过滤/。 +Deft 的实现方式简单而有效。输入关键字然后 Deft 会只显示标题中包含关键字的笔记。这在你要从大量笔记中找到某条笔记时非常有用。 + +### Org mode +![](https://opensource.com/sites/default/files/uploads/orgmode.png) + +如果本文没有包含 [Org mode][7] 的话,那么我可能会被人所诟病。为什么?它可以说是 Emacs 中最灵活、使用最广泛的记录笔记的方式了。以正确的方式使用它,Org mode 可以极大地增强记笔记的能力。 + +Org mode 的主要优势在于它组织笔记的方式。在 Org mode 中,一个笔记文件被组织成一个巨大的大纲。每个章节就是大纲里的一个节点,你可以对它进行展开和折叠。这些章节又可以有子章节,这些子章节也可以暂开和折叠。这不仅使你一次只关注于某个章节,而且可以让你浏览整个大纲。 + +你可以在多个章节之间 [进行互联 ][8],无需通过剪切和复制就能快速移动章节,以及 [附加文件 ][9] 到笔记中。Org mode 支持带格式的字符和表格。如果你需要转换笔记到其他格式,Org mode 也有大量的[导出选项 ][10]。 + + +### Howm + +![](https://opensource.com/sites/default/files/uploads/howm.png) + +当我使用 Emacs 已经成为一种习惯时,[howm][11] 马上就成为我严重依赖的 mode 之一了。虽然我特别喜欢使用 Org mode,但 howm 依然占有一席之地。 + +Howm 就好像时一个小维基似得。你可以创建笔记和任务列表,还能在他们之间创建链接。通过输入或点击某个链接,你可以在笔记之间跳转。如果你需要,还可以使用关键字为笔记添加标签。不仅如此,你可以对笔记进行搜索、排序和合并。 + +Howm 不是最漂亮的 Emacs mode,它也没有最好的用户体验。它需要你花一点时间来适应它。而一旦你适应了它,记录和查找笔记就是轻而易举的事情了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/7/emacs-modes-note-taking + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/alternatives/evernote +[2]: https://opensource.com/life/16/9/4-desktop-note-taking-applications +[3]: https://opensource.com/article/18/3/command-line-note-taking-applications +[4]: https://www.gnu.org/software/emacs/ +[5]: http://brettterpstra.com/projects/nvalt/ +[6]: https://jblevins.org/projects/deft/ +[7]: https://orgmode.org/ +[8]: https://orgmode.org/org.html#Hyperlinks +[9]: https://orgmode.org/org.html#Attachments +[10]: https://orgmode.org/org.html#Exporting +[11]: https://howm.osdn.jp/ From 194fd004617909776a124a71f9840bff0bda8cd1 Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Sat, 27 Apr 2019 12:43:10 +0800 Subject: [PATCH 0156/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20180828 Linux for Beginners- Moving Things Around.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180828 Linux for Beginners- Moving Things Around.md b/sources/tech/20180828 Linux for Beginners- Moving Things Around.md index abefc7c6f5..013cd3a738 100644 --- a/sources/tech/20180828 Linux for Beginners- Moving Things Around.md +++ b/sources/tech/20180828 Linux for Beginners- Moving Things Around.md @@ -1,3 +1,4 @@ +warmfrog is translating Linux for Beginners: Moving Things Around ====== From 662de761529fdc746ca4492a3902d671af73cc17 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 27 Apr 2019 12:50:08 +0800 Subject: [PATCH 0157/1154] PRF:20190409 Four Methods To Add A User To Group In Linux.md --- .../20190409 Four Methods To Add A User To Group In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20190409 Four Methods To Add A User To Group In Linux.md b/published/20190409 Four Methods To Add A User To Group In Linux.md index bb222efdae..96d54fd161 100644 --- a/published/20190409 Four Methods To Add A User To Group In Linux.md +++ b/published/20190409 Four Methods To Add A User To Group In Linux.md @@ -63,7 +63,7 @@ mygroup1:x:1013: #### 如何使用 usermod 命令将现有的用户添加到次要组或附加组? -要将现有用户添加到辅助组,请使用带有 `-g` 选项和组名称的 `usermod` 命令。 +要将现有用户添加到辅助组,请使用带有 `-G` 选项和组名称的 `usermod` 命令。 语法: From dc5f26c70fcbfd15eea96cfec3947685ee6073b9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 27 Apr 2019 13:17:40 +0800 Subject: [PATCH 0158/1154] PRF:20180823 Getting started with Sensu monitoring.md @MjSeven --- ...3 Getting started with Sensu monitoring.md | 74 +++++++++++-------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/translated/tech/20180823 Getting started with Sensu monitoring.md b/translated/tech/20180823 Getting started with Sensu monitoring.md index 16d6a473e5..8f3996145c 100644 --- a/translated/tech/20180823 Getting started with Sensu monitoring.md +++ b/translated/tech/20180823 Getting started with Sensu monitoring.md @@ -1,16 +1,18 @@ Sensu 监控入门 ====== +> 这个开源解决方案可以简单而有效地监控你的云基础设施。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e) -Sensu 是一个开源基础设施和应用程序监控解决方案,它监控服务器、相关服务和应用程序健康状况,并通过第三方集成发送警报和通知。Sensu 用 Ruby 编写,可以使用 [RabbitMQ][1] 或 [Redis][2] 来处理消息,它使用 Redis 来存储数据。 +Sensu 是一个开源的基础设施和应用程序监控解决方案,它可以监控服务器、相关服务和应用程序健康状况,并通过第三方集成发送警报和通知。Sensu 用 Ruby 编写,可以使用 [RabbitMQ][1] 或 [Redis][2] 来处理消息,它使用 Redis 来存储数据。 -如果你想以一种简单而有效的方式监控云基础设施,Sensu 是一个不错的选择。它可以与你组织已经使用的许多现代 DevOps 堆栈集成,比如 [Slack][3]、[HipChat][4 ] 或 [IRC][5],它甚至可以用 [PagerDuty][6] 发送移动或寻呼机警报。 +如果你想以一种简单而有效的方式监控云基础设施,Sensu 是一个不错的选择。它可以与你的组织已经使用的许多现代 DevOps 组件集成,比如 [Slack][3]、[HipChat][4] 或 [IRC][5],它甚至可以用 [PagerDuty][6] 发送移动或寻呼机的警报。 Sensu 的[模块化架构][7]意味着每个组件都可以安装在同一台服务器上或者在完全独立的机器上。 ### 结构 -Sensu 的主要通信机制是 `Transport`。每个 Sensu 组件必须连接到 `Transport` 才能相互发送消息。`Transport` 可以使用 RabbitMQ(在生产中推荐使用)或 Redis。 +Sensu 的主要通信机制是 Transport。每个 Sensu 组件必须连接到 Transport 才能相互发送消息。Transport 可以使用 RabbitMQ(在生产环境中推荐使用)或 Redis。 Sensu 服务器处理事件数据并采取行动。它注册客户端并使用过滤器、增变器和处理程序检查结果和监视事件。服务器向客户端发布检查说明,Sensu API 提供 RESTful API,提供对监控数据和核心功能的访问。 @@ -22,34 +24,33 @@ Sensu 服务器处理事件数据并采取行动。它注册客户端并使用 #### 条件 - * 一个 Linux 系统作为服务器节点(本文使用了 CentOS 7) - * 要监控的一台或多台 Linux 机器(客户机) +* 一个 Linux 系统作为服务器节点(本文使用了 CentOS 7) +* 要监控的一台或多台 Linux 机器(客户机) #### 服务器侧 Sensu 需要安装 Redis。要安装 Redis,启用 EPEL 仓库: + ``` $ sudo yum install epel-release -y - ``` 然后安装 Redis: + ``` $ sudo yum install redis -y - ``` 修改 `/etc/redis.conf` 来禁用保护模式,监听每个地址并设置密码: + ``` $ sudo sed -i 's/^protected-mode yes/protected-mode no/g' /etc/redis.conf - $ sudo sed -i 's/^bind 127.0.0.1/bind 0.0.0.0/g' /etc/redis.conf - $ sudo sed -i 's/^# requirepass foobared/requirepass password123/g' /etc/redis.conf - ``` 启用并启动 Redis 服务: + ``` $ sudo systemctl enable redis $ sudo systemctl start redis @@ -60,6 +61,7 @@ Redis 现在已经安装并准备好被 Sensu 使用。 现在让我们来安装 Sensu。 首先,配置 Sensu 仓库并安装软件包: + ``` $ sudo tee /etc/yum.repos.d/sensu.repo << EOF [sensu] @@ -73,6 +75,7 @@ $ sudo yum install sensu uchiwa -y ``` 让我们为 Sensu 创建最简单的配置文件: + ``` $ sudo tee /etc/sensu/conf.d/api.json << EOF { @@ -85,6 +88,7 @@ EOF ``` 然后,配置 `sensu-api` 在本地主机上使用端口 4567 监听: + ``` $ sudo tee /etc/sensu/conf.d/redis.json << EOF { @@ -107,6 +111,7 @@ EOF ``` 在这两个文件中,我们将 Sensu 配置为使用 Redis 作为传输机制,还有 Reids 监听的地址。客户端需要直接连接到传输机制。每台客户机都需要这两个文件。 + ``` $ sudo tee /etc/sensu/uchiwa.json << EOF { @@ -125,14 +130,16 @@ $ sudo tee /etc/sensu/uchiwa.json << EOF EOF ``` -在这个文件中,我们配置 `Uchiwa` 监听端口 3000 上的每个地址(0.0.0.0)。我们还配置 `Uchiwa` 使用 `sensu-api`(已配置好)。 +在这个文件中,我们配置 Uchiwa 监听每个地址(0.0.0.0)的端口 3000。我们还配置 Uchiwa 使用 `sensu-api`(已配置好)。 出于安全原因,更改刚刚创建的配置文件的所有者: + ``` $ sudo chown -R sensu:sensu /etc/sensu ``` 启用并启动 Sensu 服务: + ``` $ sudo systemctl enable sensu-server sensu-api sensu-client $ sudo systemctl start sensu-server sensu-api sensu-client @@ -140,15 +147,16 @@ $ sudo systemctl enable uchiwa $ sudo systemctl start uchiwa ``` -尝试访问 `Uchiwa` 网站:http://<服务器的 IP 地址>:3000 +尝试访问 Uchiwa 网站:`http://<服务器的 IP 地址>:3000` -对于生产环境,建议运行 RabbitMQ 集群作为 Transport 而不是 Redis(虽然 Redis 集群也可以用于生产),运行多个 Sensu 服务器实例和 API 实例,以实现负载均衡和高可用性。 +对于生产环境,建议运行 RabbitMQ 集群作为 Transport 而不是 Redis(虽然 Redis 集群也可以用于生产环境),运行多个 Sensu 服务器实例和 API 实例,以实现负载均衡和高可用性。 Sensu 现在安装完成,让我们来配置客户端。 #### 客户端侧 要添加一个新客户端,你需要通过创建 `/etc/yum.repos.d/sensu.repo` 文件在客户机上启用 Sensu 仓库。 + ``` $ sudo tee /etc/yum.repos.d/sensu.repo << EOF [sensu] @@ -160,11 +168,13 @@ EOF ``` 启用仓库后,安装 Sensu: + ``` $ sudo yum install sensu -y ``` 要配置 `sensu-client`,创建在服务器中相同的 `redis.json` 和 `transport.json`,还有 `client.json` 配置文件: + ``` $ sudo tee /etc/sensu/conf.d/client.json << EOF { @@ -179,9 +189,10 @@ $ sudo tee /etc/sensu/conf.d/client.json << EOF EOF ``` -在 `name` 字段中,指定一个名称来标识此客户机(通常是主机名)。`environment` 字段可以帮助你过滤,订阅定义客户机将执行哪些监视检查。 +在 `name` 字段中,指定一个名称来标识此客户机(通常是主机名)。`environment` 字段可以帮助你过滤,而 `subscriptions` 定义了客户机将执行哪些监视检查。 + +最后,启用并启动服务并签入 Uchiwa,因为客户机会自动注册: -最后,启用并启动服务并检查 `Uchiwa`,因为客户机会自动注册: ``` $ sudo systemctl enable sensu-client $ sudo systemctl start sensu-client @@ -191,21 +202,23 @@ $ sudo systemctl start sensu-client Sensu 检查有两个组件:一个插件和一个定义。 -Sensu 与 [Nagios 检查插件规范][12]兼容,因此无需修改即可使用针对 Nagios 的任何检查。检查是可执行文件,由 Sensu 客户机运行。 +Sensu 与 [Nagios 检查插件规范][12]兼容,因此无需修改即可使用用于 Nagios 的任何检查。检查是可执行文件,由 Sensu 客户机运行。 -检查定义让 Sensu 知道如何、在哪以及何时运行插件。 +检查定义可以让 Sensu 知道如何、在哪以及何时运行插件。 #### 客户端侧 让我们在客户机上安装一个检查插件。请记住,此插件将在客户机上执行。 -启用 EPEL 并安装 `nagios-plugins-http` : +启用 EPEL 并安装 `nagios-plugins-http`: + ``` $ sudo yum install -y epel-release $ sudo yum install -y nagios-plugins-http ``` -现在让我们通过手动执行它来研究这个插件。尝试检查客户机上运行的 Web 服务器的状态。它应该会失败,因为我们并没有运行 Web 服务器: +现在让我们通过手动执行它来了解这个插件。尝试检查客户机上运行的 Web 服务器的状态。它应该会失败,因为我们并没有运行 Web 服务器: + ``` $ /usr/lib64/nagios/plugins/check_http -I 127.0.0.1 connect to address 127.0.0.1 and port 80: Connection refused @@ -213,26 +226,27 @@ HTTP CRITICAL - Unable to open TCP socket ``` 不出所料,它失败了。检查执行的返回值: + ``` $ echo $? 2 - ``` Nagios 检查插件规范定义了插件执行的四个返回值: -| **Plugin return code** | **State** | -|------------------------|-----------| -| 0 | OK | -| 1 | WARNING | -| 2 | CRITICAL | -| 3 | UNKNOWN | +| 插件返回码 | 状态 | +|----------|-----------| +| 0 | OK | +| 1 | WARNING | +| 2 | CRITICAL | +| 3 | UNKNOWN | 有了这些信息,我们现在可以在服务器上创建检查定义。 #### 服务器侧 在服务器机器上,创建 `/etc/sensu/conf.d/check_http.json` 文件: + ``` {   "checks": { @@ -247,9 +261,9 @@ Nagios 检查插件规范定义了插件执行的四个返回值: } ``` -在 `command ` 字段中,使用我们之前测试过的命令。`Interval` 会告诉 Sensu 这个检查的频率,以秒为单位。最后,`subscribers` 将定义执行检查的客户机。 +在 `command` 字段中,使用我们之前测试过的命令。`interval` 会告诉 Sensu 这个检查的频率,以秒为单位。最后,`subscribers` 将定义执行检查的客户机。 -重新启动 sensu-api 和 sensu-server 并确认新检查在 Uchiwa 中可用。 +重新启动 `sensu-api` 和 `sensu-server` 并确认新检查在 Uchiwa 中可用。 ``` $ sudo systemctl restart sensu-api sensu-server @@ -265,8 +279,8 @@ via: https://opensource.com/article/18/8/getting-started-sensu-monitoring-soluti 作者:[Michael Zamot][a] 选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 973f5da15ecedf34078bb61b2dfb6be48e6ed2a4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 27 Apr 2019 13:18:33 +0800 Subject: [PATCH 0159/1154] PUB:20180823 Getting started with Sensu monitoring.md @MjSeven https://linux.cn/article-10783-1.html --- .../20180823 Getting started with Sensu monitoring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {translated/tech => published}/20180823 Getting started with Sensu monitoring.md (99%) diff --git a/translated/tech/20180823 Getting started with Sensu monitoring.md b/published/20180823 Getting started with Sensu monitoring.md similarity index 99% rename from translated/tech/20180823 Getting started with Sensu monitoring.md rename to published/20180823 Getting started with Sensu monitoring.md index 8f3996145c..a92b168a1d 100644 --- a/translated/tech/20180823 Getting started with Sensu monitoring.md +++ b/published/20180823 Getting started with Sensu monitoring.md @@ -18,7 +18,7 @@ Sensu 服务器处理事件数据并采取行动。它注册客户端并使用 [Sensu 客户端][8]执行 Sensu 服务器安排的检查或本地检查定义。Sensu 使用数据存储(Redis)来保存所有的持久数据。最后,[Uchiwa][9] 是与 Sensu API 进行通信的 Web 界面。 -![sensu_system.png][11] +![][11] ### 安装 Sensu From 1f135a44b9ef4a95d044fb2ef3a6a26ca743baf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sat, 27 Apr 2019 15:02:13 +0800 Subject: [PATCH 0160/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nux for Beginners- Moving Things Around.md | 202 ------------------ 1 file changed, 202 deletions(-) delete mode 100644 sources/tech/20180828 Linux for Beginners- Moving Things Around.md diff --git a/sources/tech/20180828 Linux for Beginners- Moving Things Around.md b/sources/tech/20180828 Linux for Beginners- Moving Things Around.md deleted file mode 100644 index 013cd3a738..0000000000 --- a/sources/tech/20180828 Linux for Beginners- Moving Things Around.md +++ /dev/null @@ -1,202 +0,0 @@ -warmfrog is translating -Linux for Beginners: Moving Things Around -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/filesystem-linux.jpg?itok=NQCoYl1f) - -In previous installments of this series, [you learned about directories][1] and how [permissions to access directories work][2]. Most of what you learned in those articles can be applied to files, except how to make a file executable. - -So let's deal with that before moving on. - -### No _.exe_ Needed - -In other operating systems, the nature of a file is often determined by its extension. If a file has a _.jpg_ extension, the OS guesses it is an image; if it ends in _.wav_ , it is an audio file; and if it has an _.exe_ tacked onto the end of the file name, it is a program you can execute. - -This leads to serious problems, like trojans posing as documents. Fortunately, that is not how things work in Linux. Sure, you may see occasional executable file endings in _.sh_ that indicate they are runnable shell scripts, but this is mostly for the benefit of humans eyeballing files, the same way when you use `ls --color`, the names of executable files show up in bright green. - -The fact is most applications have no extension at all. What determines whether a file is really program is the _x_ (for _executable_ ) bit. You can make any file executable by running -``` -chmod a+x some_program - -``` - -regardless of its extension or lack thereof. The `x` in the command above sets the _x_ bit and the `a` says you are setting it for _all_ users. You could also set it only for the group of users that own the file (`g+x`), or for only one user, the owner (`u+x`). - -Although we will be covering creating and running scripts from the command line later in this series, know that you can run a program by writing the path to it and then tacking on the name of the program on the end: -``` -path/to/directory/some_program - -``` - -Or, if you are currently in the same directory, you can use: -``` -./some_program - -``` - -There are other ways of making your program available from anywhere in the directory tree (hint: look up the `$PATH` environment variable), but you will be reading about those when we talk about shell scripting. - -### Copying, Moving, Linking - -Obviously, there are more ways of modifying and handling files from the command line than just playing around with their permissions. Most applications will create a new file if you still try to open a file that doesn't exist. Both -``` -nano test.txt - -``` - -and -``` -vim test.txt - -``` - -([nano][3] and [vim][4] being to popular command line text editors) will create an empty _test.txt_ file for you to edit if _test.txt_ didn't exist beforehand. - -You can also create an empty file by _touching_ it: -``` -touch test.txt - -``` - -Will create a file, but not open it in any application. - -You can use `cp` to make a copy of a file in another location or under a new name: -``` -cp test.txt copy_of_test.txt - -``` - -You can also copy a whole bunch of files: -``` -cp *.png /home/images - -``` - -The instruction above copies all the PNG files in the current directory into an _images/_ directory hanging off of your home directory. The _images/_ directory has to exist before you try this, or `cp` will show an error. Also, be warned that, if you copy a file to a directory that contains another file with the same name, `cp` will silently overwrite the old file with the new one. - -You can use -``` -cp -i *.png /home/images - -``` - -If you want `cp` to warn you of any dangers (the `-i` options stands for _interactive_ ). - -You can also copy whole directories, but you need the `-r` option for that: -``` -cp -rv directory_a/ directory_b - -``` - -The `-r` option stands for _recursive_ , meaning that `cp` will drill down into _directory_a_ , copying over all the files and subdirectories contained within. I personally like to include the `-v` option, as it makes `cp` _verbose_ , meaning that it will show you what it is doing instead of just copying silently and then exiting. - -The `mv` command moves stuff. That is, it changes files from one location to another. In its simplest form, `mv` looks a lot like `cp`: -``` -mv test.txt new_test.txt - -``` - -The command above makes _new_test.txt_ appear and _test.txt_ disappear. -``` -mv *.png /home/images - -``` - -Moves all the PNG files in the current directory to a directory called _images/_ hanging of your home directory. Again you have to be careful you do not overwrite existing files by accident. Use -``` -mv -i *.png /home/images - -``` - -the same way you would with `cp` if you want to be on the safe side. - -Apart from moving versus copying, another difference between `mv` and `cp`is when you move a directory: -``` -mv directory_a/ directory_b - -``` - -No need for a recursive flag here. This is because what you are really doing is renaming the directory, the same way in the first example, you were renaming the file*. In fact, even when you "move" a file from one directory to another, as long as both directories are on the same storage device and partition, you are renaming the file. - -You can do an experiment to prove it. `time` is a tool that lets you measure how long a command takes to execute. Look for a hefty file, something that weighs several hundred MBs or even some GBs (say, something like a long video) and try copying it from one directory to another like this: -``` -$ time cp hefty_file.mkv another_directory/ -real 0m3,868s -user 0m0,016s -sys 0m0,887s - -``` - -In bold is what you have to type into the terminal and below what `time` outputs. The number to focus on is the one on the first line, _real_ time. It takes nearly 4 seconds to copy the 355 MBs of _hefty_file.mkv_ to _another_directory/_. - -Now let's try moving it: -``` -$ time mv hefty_file.mkv another_directory/ -real 0m0,004s -user 0m0,000s -sys 0m0,003s - -``` - -Moving is nearly instantaneous! This is counterintuitive, since it would seem that `mv` would have to copy the file and then delete the original. That is two things `mv` has to do versus `cp`'s one. But, somehow, `mv` is 1000 times faster. - -That is because the file system's structure, with all its tree of directories, only exists for the users convenience. At the beginning of each partition there is something called a _partition table_ that tells the operating system where to find each file on the actual physical disk. On the disk, data is not split up into directories or even files. [There are tracks, sectors and clusters instead][5]. When you "move" a file within the same partition, what the operating system does is just change the entry for that file in the partition table, but it still points to the same cluster of information on the disk. - -Yes! Moving is a lie! At least within the same partition that is. If you try and move a file to a different partition or a different device, `mv` is still fast, but is noticeably slower than moving stuff around within the same partition. That is because this time there is actually copying and erasing of data going on. - -### Renaming - -There are several distinct command line `rename` utilities around. None are fixtures like `cp` or `mv` and they can work in slightly different ways. What they all have in common is that they are used to change _parts_ of the names of files. - -In Debian and Ubuntu, the default `rename` utility uses [regular expressions][6] (patterns of strings of characters) to mass change files in a directory. The instruction: -``` -rename 's/\.JPEG$/.jpg/' * - -``` - -will change all the extensions of files with the extension _JPEG_ to _jpg_. The file _IMG001.JPEG_ becomes _IMG001.jpg_ , _my_pic.JPEG_ becomes _my_pic.jpg_ , and so on. - -Another version of `rename` available by default in Manjaro, a derivative of Arch, is much simpler, but arguably less powerful: -``` -rename .JPEG .jpg * - -``` - -This does the same renaming as you saw above. In this version, `.JPEG` is the string of characters you want to change, `.jpg` is what you want to change it to, and `*` represents all the files in the current directory. - -The bottom line is that you are better off using `mv` if all you want to do is rename one file or directory, and that's because `mv` is realiably the same in all distributions everywhere. - -### Learning more - -Check out the both `mv` and `cp`'s _man_ pages to learn more. Run -``` -man cp - -``` - -or -``` -man mv - -``` - -to read about all the options these commands come with and which make them more powerful and safer to use. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/2018/8/linux-beginners-moving-things-around - -作者:[Paul Brown][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/bro66 -[1]: https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux -[2]: https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2 -[3]: https://www.nano-editor.org/ -[4]: https://www.vim.org/ -[5]: https://en.wikipedia.org/wiki/Disk_sector -[6]: https://en.wikipedia.org/wiki/Regular_expression From dab7bc545d886c8ba8d136e3b2da6c8a69e4acb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sat, 27 Apr 2019 15:03:12 +0800 Subject: [PATCH 0161/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nux for Beginners- Moving Things Around.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 translated/tech/20180828 Linux for Beginners- Moving Things Around.md diff --git a/translated/tech/20180828 Linux for Beginners- Moving Things Around.md b/translated/tech/20180828 Linux for Beginners- Moving Things Around.md new file mode 100644 index 0000000000..a2c10150f1 --- /dev/null +++ b/translated/tech/20180828 Linux for Beginners- Moving Things Around.md @@ -0,0 +1,202 @@ +Linux 初学者: 移动文件 +===================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/filesystem-linux.jpg?itok=NQCoYl1f) + +在之前的该系列的部分中,[你学习了有关目录][1]和[访问目录的权限是如何工作的][2]。你在这些文章中学习的大多数都可应用于文件,除了如何让一个文件变得可执行。 + +因此让我们在开始之前先解决这个问题。 + +### 不需要 .exe 文件 + +在其他操作系统中,一个文件的性质通常由它的后缀决定。如果一个文件有一个 _.jpg_ 扩展,操作系统会认为它是一幅图像;如果它以 _.wav_ 结尾, 它是一个音频文件; 如果它在文件名末尾 以 _.exe_ 结尾, 它就是一个你可以执行的程序。 + +这导致了严重的问题,像木马伪装成文件。幸运的是,在 Linux 下事务不是这样运行的。可以确定的是,你可能会看到有些可执行文件是以 _.sh_ 结尾暗示他们是可执行的脚本,但是这大部分是为了利于人类识别的文件,和你使用 `ls --color` 的方式相同,可执行文件的名字以亮绿色显示。 + +事实上大多数应用根本没有扩展。决定一个文件是否是一个真正程序的是 _x_ (用于_可执行的_) 位。你可以通过运行以下命令使任何文件变得可执行: +``` +chmod a+x some_program + +``` + +而不管它的扩展名是什么或者是否存在。在上面命令中的 `x` 设置了 _x_ 位,`a` 说明你为_所有_用户设置它。你同样可以为一组用户设置成拥有这个文件 (`g+x`),或者设置为只有一个用户,拥有着 (`u+x`)。 + +尽管我们会在该系列之后部分包含从命令行创建和运行脚本的内容,并学习到你可以通过输入它的路径并在结尾加上程序名的方式运行一个程序: +``` +path/to/directory/some_program + +``` + +或者,如果你当前在相同目录,你可以使用: +``` +./some_program + +``` + +还有其他方式可以使你的程序在目录树的任意位置运行 (提示:查询 `$PATH` 环境变量),但是当我们讨论 shell 脚本的时候你会读到这些。 + +### 复制,移动,链接 + +明显地,有更多的方式来从命令行修改和处理文件,而不仅仅是处理它们的权限。当你试图打开一个不存在的文件是,大多数应用会创建一个新文件。如果 _test.txt_ 当前并不存在,下列命令 + +``` +nano test.txt + +``` + +``` +vim test.txt + +``` + +([nano][3] 和 [vim][4] 是流行的命令行文本编辑器) 都将为你创建一个空的 _test.txt_ 文件来编辑。 + +你可以通过 “触摸” (touching, 触摸)来创建一个空的文件: +``` +touch test.txt + +``` + +会创建一个文件,但是不会在任何应用中打开它。 + +你可以使用 `cp` 来拷贝一个文件到另一个位置或者使用一个不同的名字: +``` +cp test.txt copy_of_test.txt + +``` + +你也可以拷贝一堆文件: +``` +cp *.png /home/images + +``` + +上面的命令拷贝当前目录下的所有 PNG 文件到相对你的 home 目录下的 _images/_ 目录。在你尝试之前 _images/_ 目录必须存在, 不然 `cp` 将显示一个错误。同样的,警惕,当你复制一个文件到一个已经包含相同名字的文件的目录时, `cp` 会静默地用新文件覆盖老的文件。 + +你可以使用 +``` +cp -i *.png /home/images + +``` + +如果你想要 `cp` 命令在有任何危险时警告你 (`-i` 选项代表 _交互式的_)。 + +你同样可以复制整个目录,但是为了做到这样,你需要 `-r` 选项: +``` +cp -rv directory_a/ directory_b + +``` + +`-r` 选项代表 _递归_,意味着 `cp` 会向下探索目录 _directory_a_,复制所有的文件和子目录下内部包含的。我个人喜欢包含 `-v` 选项,因为它使 `cp` 冗长而啰嗦,意味着它会显示你当前它正在做什么而不是仅仅静默的复制然后存在。 + +`mv` 命令移动东西。也就是说,它移动文件从一个位置到另一个位置。最简单的形式,`mv` 表现的更像 `cp`: +``` +mv test.txt new_test.txt + +``` + +上面的命令使 _new_test.txt_ 出现, _test.txt_ 消失。 +``` +mv *.png /home/images + +``` + +移动当前目录下所有的 PNG 文件到相对于你的 home 目录的 _images/_ 目录。同样的你必须小心你没有意外的覆盖已存在的文件。使用 +``` +mv -i *.png /home/images + +``` + +如果你想站在安全的角度,你可以使用与 `cp` 相同的方式。 + +除了移动与拷贝的不同外,另一个 `mv` 和 `cp` 之间的不同是当你移动目录时: +``` +mv directory_a/ directory_b + +``` + +不需要添加递归的标志。这是因为你实际做的是重命名一个目录,与第一个例子相同,你做的是重命名文件。实际上,即使你 “移动” 一个文件从一个目录到另一个目录,只要两个目录在相同的存储设备和分区,你就是在重命名文件。 + +你可以做一个实验来证明。 `time` 是一个工具来让你测量一个命令花费多久来执行。找一个非常大的文件,可以是几百 MBs 甚至 几 GBs (例如一个长视频),像下方这样尝试拷贝到另一个目录: +``` +$ time cp hefty_file.mkv another_directory/ +real 0m3,868s +user 0m0,016s +sys 0m0,887s + +``` + +黑体是你必须输入命令行的,下面是 `time` 的输出。需要关注的是第一行, _real_ 时间。它花费了几乎 4 秒来拷贝 355 MBs 的 _hefty_file.mkv_ 到 _another_directory/_ 目录。 + +现在让我们尝试移动它: +``` +$ time mv hefty_file.mkv another_directory/ +real 0m0,004s +user 0m0,000s +sys 0m0,003s + +``` + +移动几乎是瞬时的!这是违反直觉的,因为看起来 `mv` 必须复制这个文件然后删除原来的。这是 `mv` 对比 `cp` 命令必须做的两件事。但是,实际上,`mv` 扩了 1000 倍。 + +这是因为文件系统结构中,它的所有目录树,只为了让用户便利而存在。在每个分区的开始,有一个称作 _分区表_ 的东西告诉操作系统在实际的物理磁盘上去哪找每个文件。在磁盘上,数据没有分为目录甚至是文件。[作为替代的是轨道,扇区和簇][5]。当你在相同分区 “移动” 一个文件时,操作系统实际做的仅仅是在分区表中改变了那个文件的入口,但它仍然指向磁盘上相同的簇信息。 + +是的!移动是一个谎言!至少在相同分区下是。如果你试图移动一个文件到一个不同的分区或者不同的设备, `mv` 仍然很快,但可以察觉到它比在相同分区下移动文件慢了。这是因为实际上发生了复制和清除数据。 + +### 重命名 + +有几个不同的命令行 `rename` 工具。没有一个像 `cp` 和 `mv` 那样固定并且他们工作的方式都有一点不同。他们相同的一点是他们被用来改变文件名的部分。 + +在 Debian 和 Ubuntu 中, 默认的 `rename` 工具使用 [正则表达式][6] (字符组成的字符串图案)来大量的改变目录中的文件。命令: +``` +rename 's/\.JPEG$/.jpg/' * + +``` + +将改变所有扩展为 _JPEG_ 的文件为 _jpg_ 。文件 _IMG001.JPEG_ 变成 _IMG001.jpg_, _my_pic.JPEG_ 变成 _my_pic.jpg_ , 等等。 + +另一个 `rename` 版本默认在 Manjaro 上可获得,一个 Arch 的衍生版,更简单,但是可能没有那么强大: +``` rename .JPEG .jpg * + +``` + +这和你之前看到的上面做相同的重命名操作。在这个版本,`.JPEG` 是你想改变的字符组成的字符串,`.jpg` 是你想要改变成为的,`*` 表示当前目录下的所有文件。 + +基本原则是如果你所做的仅仅是重命名一个文件或者目录,你最好用 `mv`,这是因为 `mv` 在所有分发版上都是可靠一致的。 + +### 了解更多 + +查看 `mv` 和 `cp` 的 man 页面了解更多。运行 +``` +man cp + +``` + + 或者 + ``` + man mv + + ``` + + 来阅读这些命令自带的所有选项,这些使他们使用起来更强大和安全。 + + ---------------------------------------------------------------------------- + + via: https://www.linux.com/blog/2018/8/linux-beginners-moving-things-around + +作者:[Paul Brown][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[1]: https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux +[2]: https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2 +[3]: https://www.nano-editor.org/ +[4]: https://www.vim.org/ +[5]: https://en.wikipedia.org/wiki/Disk_sector +[6]: https://en.wikipedia.org/wiki/Regular_expression + + From dc5d4c7f7c69ce687cdcfbe4298887e50c2e28c3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 27 Apr 2019 15:48:47 +0800 Subject: [PATCH 0162/1154] PRF:20190417 Managing RAID arrays with mdadm.md @geekpi --- ...0190417 Managing RAID arrays with mdadm.md | 60 ++++++++----------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/translated/tech/20190417 Managing RAID arrays with mdadm.md b/translated/tech/20190417 Managing RAID arrays with mdadm.md index ecb488b0ce..2d0e823a10 100644 --- a/translated/tech/20190417 Managing RAID arrays with mdadm.md +++ b/translated/tech/20190417 Managing RAID arrays with mdadm.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Managing RAID arrays with mdadm) @@ -12,59 +12,51 @@ ![][1] -mdadm 代表多磁盘和设备管理 (Multiple Disk and Device Administration)。它是一个命令行工具,可用于管理 Linux 上的软件 [RAID][2] 阵列。本文概述了使用它的基础知识。 +mdadm 是多磁盘和设备管理Multiple Disk and Device Administration 的缩写。它是一个命令行工具,可用于管理 Linux 上的软件 [RAID][2] 阵列。本文概述了使用它的基础知识。 以下 5 个命令是你使用 mdadm 的基础功能: - 1. **创建 RAID 阵列**: -### mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 +1. **创建 RAID 阵列**:`mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1` +2. **组合(并启动)RAID 阵列**:`mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1` +3. **停止 RAID 阵列**:`mdadm --stop /dev/md/test` +4. **删除 RAID 阵列**:`mdadm --zero-superblock /dev/sda1 /dev/sdb1` +5. **检查所有已组合的 RAID 阵列的状态**:`cat /proc/mdstat` - 2. **组合(并启动)RAID 阵列**: -### mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1 +### 功能说明 - 3. **停止 RAID 阵列**: -### mdadm --stop /dev/md/test +#### mdadm --create - 4. **删除 RAID 阵列**: -### mdadm --zero-superblock /dev/sda1 /dev/sdb1 +上面的创建命令除了 `-create` 参数自身和设备名之外,还包括了四个参数: - 5. **检查所有已组合的 RAID 阵列的状态**: -### cat /proc/mdstat +1、`–homehost`: +默认情况下,`mdadm` 将你的计算机名保存为 RAID 阵列的属性。如果你的计算机名与存储的名称不匹配,则阵列将不会自动组合。此功能在共享硬盘的服务器群集中很有用,因为如果多个服务器同时尝试访问同一驱动器,通常会发生文件系统损坏。名称 `any` 是保留字段,并禁用 `-homehost` 限制。 +2、 `–metadata`: -#### 功能说明 +`-mdadm` 保留每个 RAID 设备的一小部分空间,以存储有关 RAID 阵列本身的信息。 `-metadata` 参数指定信息的格式和位置。`1.0` 表示使用版本 1 格式,并将元数据存储在设备的末尾。 -##### `mdadm --create` +3、`–level`: -上面的 _create_ 命令除了 create 参数自身和设备名之外,还包括了四个参数: +`-level` 参数指定数据应如何在底层设备之间分布。级别 `1` 表示每个设备应包含所有数据的完整副本。此级别也称为[磁盘镜像] [3]。 - 1. **–homehost** : -默认情况下,mdadm 将你的计算机名保存为 RAID 阵列的属性。如果你的计算机名与存储的名称不匹配,则阵列将不会自动组合。此功能在共享硬盘的服务器群集中很有用,因为如果多个服务器同时尝试访问同一驱动器,通常会发生文件系统损坏。名称 _any_ 是保留字段并禁用 _homehost_ 限制。 +4、`–raid-devices`: - 2. **–metadata** : -_mdadm_ 保存每个 RAID 设备的一小部分,以存储有关 RAID 阵列本身的信息。 _metadata_ 参数指定信息的格式和位置。_1.0_ 表示使用版本 1 格式并将元数据存储在设备的末尾。 +`-raid-devices` 参数指定将用于创建 RAID 阵列的设备数。 - 3. **–level** : -_level_ 参数指定数据应如何在底层设备之间分布。级别 _1_ 表示每个设备应包含所有数据的完整副本。此级别也称为[磁盘镜像] [3]。 +通过将 `-level=1`(镜像)与 `-metadata=1.0` (将元数据存储在设备末尾)结合使用,可以创建一个 RAID1 阵列,如果不通过 mdadm 驱动访问,那么它的底层设备会正常显示。这在灾难恢复的情况下很有用,因为即使新系统不支持 mdadm 阵列,你也可以访问该设备。如果程序需要在 mdadm 可用之前以*只读*访问底层设备时也很有用。例如,计算机中的 [UEFI][4] 固件可能需要在启动 mdadm 之前从 [ESP][5] 读取引导加载程序。 - 4. **–raid-devices** : -_raid-devices_ 参数指定将用于创建 RAID 阵列的设备数。 +#### mdadm --assemble - -通过将 _level=1_ (镜像)与 _metadata=1.0_ (将元数据存储在设备末尾)结合使用,可以创建一个 RAID1 阵列,如果不通过 mdadm 驱动访问,那么它的底层设备会正常显示。这在灾难恢复的情况下很有用,因为即使新系统不支持 mdadm 阵列,你也可以访问该设备。如果程序需要在 mdadm 可用之前以_只读_访问底层设备时也很有用。例如,计算机中的 [UEFI][4] 固件可能需要在启动 mdadm 之前从 [ESP][5] 读取引导加载程序。 - -##### `mdadm --assemble` - -如果成员设备丢失或损坏,上面的 _assemble_ 命令将失败。要强制 RAID 阵列在其中一个成员丢失时进行组合并启动,请使用以下命令: +如果成员设备丢失或损坏,上面的组合命令将会失败。要强制 RAID 阵列在其中一个成员丢失时进行组合并启动,请使用以下命令: ``` # mdadm --assemble --run /dev/md/test /dev/sda1 ``` -#### 其他重要说明 +### 其他重要说明 -避免直接写入底层是 RAID1 的设备。这导致设备不同步,并且 mdadm 不会知道它们不同步。如果你访问了某个在其他地方被修改的设备的 RAID1 阵列,则可能导致文件系统损坏。如果你在其他地方修改 RAID1 设备并需要强制阵列重新同步,请从要覆盖的设备中删除 mdadm 元数据,然后将其重新添加到阵列,如下所示: +避免直接写入底层是 RAID1 的设备。这导致设备不同步,并且 mdadm 不会知道它们不同步。如果你访问了在其他地方被修改了设备的某个 RAID1 阵列,则可能导致文件系统损坏。如果你在其他地方修改 RAID1 设备并需要强制阵列重新同步,请从要覆盖的设备中删除 mdadm 元数据,然后将其重新添加到阵列,如下所示: ``` # mdadm --zero-superblock /dev/sdb1 @@ -74,7 +66,7 @@ _raid-devices_ 参数指定将用于创建 RAID 阵列的设备数。 以上用 sda1 的内容完全覆盖 sdb1 的内容。 -要指定在计算机启动时自动激活的 RAID 阵列,请创建 _/etc/mdadm.conf_ 配置。 +要指定在计算机启动时自动激活的 RAID 阵列,请创建 `/etc/mdadm.conf` 配置。 有关最新和详细信息,请查看手册页: @@ -83,7 +75,7 @@ $ man mdadm $ man mdadm.conf ``` -本系列的下一篇文章将展示如何将现有的单磁盘 Linux 安装变为镜像磁盘安装,这意味着即使其中一个硬盘突然停止工作,系统仍将继续运行! +本系列的下一篇文章将展示如何将现有的单磁盘 Linux 系统变为镜像磁盘安装,这意味着即使其中一个硬盘突然停止工作,系统仍将继续运行! -------------------------------------------------------------------------------- @@ -92,7 +84,7 @@ via: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ 作者:[Gregory Bartholomew][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/) 荣誉推出 From 666f9e7c3e946e1bb699db86e37d124489405dc4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 27 Apr 2019 15:49:18 +0800 Subject: [PATCH 0163/1154] PUB:20190417 Managing RAID arrays with mdadm.md @geekpi https://linux.cn/article-10785-1.html --- .../20190417 Managing RAID arrays with mdadm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190417 Managing RAID arrays with mdadm.md (98%) diff --git a/translated/tech/20190417 Managing RAID arrays with mdadm.md b/published/20190417 Managing RAID arrays with mdadm.md similarity index 98% rename from translated/tech/20190417 Managing RAID arrays with mdadm.md rename to published/20190417 Managing RAID arrays with mdadm.md index 2d0e823a10..d1365aa03b 100644 --- a/translated/tech/20190417 Managing RAID arrays with mdadm.md +++ b/published/20190417 Managing RAID arrays with mdadm.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10785-1.html) [#]: subject: (Managing RAID arrays with mdadm) [#]: via: (https://fedoramagazine.org/managing-raid-arrays-with-mdadm/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) From 667a7a9811e989765c605cfcb1498d09963b8d5a Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 27 Apr 2019 22:22:55 +0800 Subject: [PATCH 0164/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020180831=20Get?= =?UTF-8?q?=20desktop=20notifications=20from=20Emacs=20shell=20commands=20?= =?UTF-8?q?=C2=B7=20sources/tech/20180831=20Get=20desktop=20notifications?= =?UTF-8?q?=20from=20Emacs=20shell=20commands=20.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...otifications from Emacs shell commands .md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20180831 Get desktop notifications from Emacs shell commands .md diff --git a/sources/tech/20180831 Get desktop notifications from Emacs shell commands .md b/sources/tech/20180831 Get desktop notifications from Emacs shell commands .md new file mode 100644 index 0000000000..7d04e6d0a7 --- /dev/null +++ b/sources/tech/20180831 Get desktop notifications from Emacs shell commands .md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get desktop notifications from Emacs shell commands ·) +[#]: via: (https://blog.hoetzel.info/post/eshell-notifications/) +[#]: author: (Jürgen Hötzel https://blog.hoetzel.info) + +Get desktop notifications from Emacs shell commands · +====== +When interacting with the operating systems I always use [Eshell][1] because it integrates seamlessly with Emacs, supports (remote) [TRAMP][2] file names and also works nice on Windows. + +After starting shell commands (like long running build jobs) I often lose track the task when switching buffers. + +Thanks to Emacs [hooks][3] mechanism you can customize Emacs to call a elisp function when an external command finishes. + +I use [John Wiegleys][4] excellent [alert][5] package to send desktop notifications: + +``` +(require 'alert) + +(defun eshell-command-alert (process status) + "Send `alert' with severity based on STATUS when PROCESS finished." + (let* ((cmd (process-command process)) + (buffer (process-buffer process)) + (msg (format "%s: %s" (mapconcat 'identity cmd " ") status))) + (if (string-prefix-p "finished" status) + (alert msg :buffer buffer :severity 'normal) + (alert msg :buffer buffer :severity 'urgent)))) + +(add-hook 'eshell-kill-hook #'eshell-command-alert) +``` + +[alert][5] rules can be setup programmatically. In my case I only want to get notified if the corresponding buffer is not visible: + +``` +(alert-add-rule :status '(buried) ;only send alert when buffer not visible + :mode 'eshell-mode + :style 'notifications) +``` + +This even works on [TRAMP][2] buffers. Below is a screenshot showing a Gnome desktop notification of a failed `make` command. + +![../../img/eshell.png][6] + +-------------------------------------------------------------------------------- + +via: https://blog.hoetzel.info/post/eshell-notifications/ + +作者:[Jürgen Hötzel][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.hoetzel.info +[b]: https://github.com/lujun9972 +[1]: https://www.gnu.org/software/emacs/manual/html_mono/eshell.html (Eshell) +[2]: https://www.gnu.org/software/tramp/ (TRAMP) +[3]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html (hooks) +[4]: https://github.com/jwiegley (John Wiegleys) +[5]: https://github.com/jwiegley/alert (alert) +[6]: https://blog.hoetzel.info/img/eshell.png (../../img/eshell.png) From 480972fea5e53e49b40fce45b63e69a74406991f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Sat, 27 Apr 2019 22:54:47 +0800 Subject: [PATCH 0165/1154] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 44d5531d83..3217d1cb5e 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (bodhix) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0761f24917201fb4cc8e026f01fb1ca9e98e3692 Mon Sep 17 00:00:00 2001 From: LuMing <784315443@qq.com> Date: Sat, 27 Apr 2019 23:18:07 +0800 Subject: [PATCH 0166/1154] LuuMing translating --- .../tech/20170410 Writing a Time Series Database from Scratch.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20170410 Writing a Time Series Database from Scratch.md b/sources/tech/20170410 Writing a Time Series Database from Scratch.md index a7f8289b63..7fb7fe9a6a 100644 --- a/sources/tech/20170410 Writing a Time Series Database from Scratch.md +++ b/sources/tech/20170410 Writing a Time Series Database from Scratch.md @@ -1,3 +1,4 @@ +LuMing Translating Writing a Time Series Database from Scratch ============================================================ From b84cdd7ef04a4aab883e21984fb862784abc5eaa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 08:09:25 +0800 Subject: [PATCH 0167/1154] PRF:20190419 4 cool new projects to try in COPR for April 2019.md @geekpi --- ... projects to try in COPR for April 2019.md | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md index bbaa9cfb60..f17114ca8d 100644 --- a/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md +++ b/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md @@ -1,13 +1,13 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 cool new projects to try in COPR for April 2019) [#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) [#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) -2019 年 4 月在 COPR 值得尝试的 4 个很酷的新项目 +COPR 仓库中 4 个很酷的新软件(2019.4) ====== ![][1] @@ -18,13 +18,13 @@ COPR 是个人软件仓库[集合][1],它不在 Fedora 中。这是因为某 ### Joplin -[Joplin][3] 是一个笔记和待办事项应用。笔记以 Markdown 格式编写,并通过将它们分类到各种笔记本中并使用标签进行组织。Joplin 可以从任何 Markdown 源导入笔记或从 Evernote 导出笔记。除了桌面应用之外,还有一个 Android 版本,通过使用 Nextcloud、Dropbox 或其他云服务同步笔记。最后,它还有 Chrome 和 Firefox 的浏览器扩展程序,用于保存网页和屏幕截图。 +[Joplin][3] 是一个笔记和待办事项应用。笔记以 Markdown 格式编写,并通过使用标签和将它们分类到各种笔记本中进行组织。Joplin 可以从任何 Markdown 源导入笔记或从 Evernote 导出笔记。除了桌面应用之外,还有一个 Android 版本,通过使用 Nextcloud、Dropbox 或其他云服务同步笔记。最后,它还有 Chrome 和 Firefox 的浏览器扩展程序,用于保存网页和屏幕截图。 ![][4] #### 安装说明 -[仓库][5]目前为 Fedora 29 和 30 以及 EPEL 7 提供 Joplin。要安装 Joplin,请[带上 sudo][6] 使用这些命令: +[COPR 仓库][5]目前为 Fedora 29 和 30 以及 EPEL 7 提供 Joplin。要安装 Joplin,请[带上 sudo][6] 使用这些命令: ``` sudo dnf copr enable taw/joplin @@ -33,11 +33,11 @@ sudo dnf install joplin ### Fzy -[Fzy][7] 是用于模糊字符串搜索的命令行程序。它从标准输入读取并根据最有可能的搜索结果进行排序,然后打印所选行。除了命令行,fzy 也可以在 vim 中使用。你可以在这个在线 [demo][8] 中尝试 fzy。 +[Fzy][7] 是用于模糊字符串搜索的命令行程序。它从标准输入读取并根据最有可能的搜索结果进行排序,然后打印所选行。除了命令行,`fzy` 也可以在 vim 中使用。你可以在这个在线 [demo][8] 中尝试 `fzy`。 #### 安装说明 -[仓库][9]目前为 Fedora 29、30 和 Rawhide 以及其他发行版提供了 fzy。要安装 fzy,请使用以下命令: +[COPR 仓库][9]目前为 Fedora 29、30 和 Rawhide 以及其他发行版提供了 `fzy`。要安装 `fzy`,请使用以下命令: ``` sudo dnf copr enable lehrenfried/fzy @@ -48,13 +48,11 @@ sudo dnf install fzy Fondo 是一个浏览 [unsplash.com][10] 网站照片的程序。它有一个简单的界面,允许你一次查找某个主题或所有主题的图片。然后,你可以通过单击将找到的图片设置为壁纸,或者共享它。 - * ![][11] - - +![][11] #### 安装说明 -[仓库][12]目前为 Fedora 29、30 和 Rawhide 提供 Fondo。要安装 Fondo,请使用以下命令: +[COPR 仓库][12]目前为 Fedora 29、30 和 Rawhide 提供 Fondo。要安装 Fondo,请使用以下命令: ``` sudo dnf copr enable atim/fondo @@ -63,15 +61,13 @@ sudo dnf install fondo ### YACReader -[YACReader][13] 是一款数字漫画阅读器,它支持许多漫画和图像格式,例如 _cbz_、_cbr_、_pdf_ 等。YACReader 会跟踪阅读进度,并可以从 [Comic Vine][14] 下载漫画信息。它还有一个 YACReader 库,用于组织和浏览你的漫画集。 - - * ![][15] - +[YACReader][13] 是一款数字漫画阅读器,它支持许多漫画和图像格式,例如 cbz、cbr、pdf 等。YACReader 会跟踪阅读进度,并可以从 [Comic Vine][14] 下载漫画信息。它还有一个 YACReader 库,用于组织和浏览你的漫画集。 +![][15] #### 安装说明 -[仓库][16]目前为 Fedora 29、30 和 Rawhide 提供 YACReader。要安装 YACReader,请使用以下命令: +[COPR 仓库][16]目前为 Fedora 29、30 和 Rawhide 提供 YACReader。要安装 YACReader,请使用以下命令: ``` sudo dnf copr enable atim/yacreader @@ -85,7 +81,7 @@ via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-201 作者:[Dominik Turecek][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/) 荣誉推出 From eb18ab981dc957030c0583585b643257b113e0b9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 08:11:13 +0800 Subject: [PATCH 0168/1154] PUB:20190419 4 cool new projects to try in COPR for April 2019.md @geekpi https://linux.cn/article-10787-1.html --- ...90419 4 cool new projects to try in COPR for April 2019.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190419 4 cool new projects to try in COPR for April 2019.md (98%) diff --git a/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md b/published/20190419 4 cool new projects to try in COPR for April 2019.md similarity index 98% rename from translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md rename to published/20190419 4 cool new projects to try in COPR for April 2019.md index f17114ca8d..dee3920eb0 100644 --- a/translated/tech/20190419 4 cool new projects to try in COPR for April 2019.md +++ b/published/20190419 4 cool new projects to try in COPR for April 2019.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10787-1.html) [#]: subject: (4 cool new projects to try in COPR for April 2019) [#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) [#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) From 1a9dbd282a94e63d01e19966210fe20d4c518d4f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 08:48:57 +0800 Subject: [PATCH 0169/1154] PRF:20190416 How to Install MySQL in Ubuntu Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @arrowfeng 翻译完应该自己复核一遍,请参照我的校对来提升你的贡献质量。 --- ...16 How to Install MySQL in Ubuntu Linux.md | 116 ++++++++---------- 1 file changed, 54 insertions(+), 62 deletions(-) diff --git a/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md index 27b2fba58e..78c1497476 100644 --- a/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md +++ b/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md @@ -1,36 +1,35 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Install MySQL in Ubuntu Linux) [#]: via: (https://itsfoss.com/install-mysql-ubuntu/) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) -怎样在Ubuntu Linux上安装MySQL +怎样在 Ubuntu Linux 上安装 MySQL ====== -_**简要: 本教程教你如何在基于Ubuntu的Linux发行版上安装MySQL。对于首次使用的用户,你将会学习到如何验证你的安装和第一次怎样去连接MySQL。**_ +> 本教程教你如何在基于 Ubuntu 的 Linux 发行版上安装 MySQL。对于首次使用的用户,你将会学习到如何验证你的安装和第一次怎样去连接 MySQL。 -**[MySQL][1]** 是一个典型的数据库管理系统。它被用于许多技术栈中,包括流行的 **[LAMP][2]** (Linux, Apache, MySQL, PHP) 技术栈. 它已经被证实了其稳定性。 另一个让**MySQL**受欢迎的原因是它是开源的。 +[MySQL][1] 是一个典型的数据库管理系统。它被用于许多技术栈中,包括流行的 [LAMP][2] (Linux、Apache、MySQL、PHP)技术栈。它已经被证实了其稳定性。另一个让 MySQL 受欢迎的原因是它是开源的。 -**MySQL** 是 **关系型数据库** (基本上是 **表格 数据** ). 以这种方式它很容易去存储,组织和访问数据。它使用**SQL**( **结构化查询语言** )来管理数据。 +MySQL 是关系型数据库(基本上是表格数据)。以这种方式它很容易去存储、组织和访问数据。它使用SQL(结构化查询语言)来管理数据。 -这这篇文章中,我将向你展示如何在Ubuntu 18.04安装和使用MySQL 8.0。让我们一起来看看吧! +这这篇文章中,我将向你展示如何在 Ubuntu 18.04 安装和使用 MySQL 8.0。让我们一起来看看吧! - -### 在Ubuntu上安装MySQL +### 在 Ubuntu 上安装 MySQL ![][3] -我将会介绍两种在Ubuntu18.04上安装**MySQL**的方法: - 1. 从Ubuntu仓库上安装MySQL。非常简单,但不是最新版(5.7) - 2. 从官方仓库安装MySQL。你将额外增加一些步处理过程,但不用担心。你将会拥有最新版的MySQL(8.0) +我将会介绍两种在 Ubuntu 18.04 上安装 MySQL 的方法: + 1. 从 Ubuntu 仓库上安装 MySQL。非常简单,但不是最新版(5.7) + 2. 从官方仓库安装 MySQL。你将额外增加一些步处理过程,但不用担心。你将会拥有最新版的MySQL(8.0) -有必要的时候,我将会提供屏幕截图去引导你。但这边文章中的大部分步骤,我将直接在**终端**(**默认热键**: CTRL+ALT+T)输入命令。别害怕它! +有必要的时候,我将会提供屏幕截图去引导你。但这篇文章中的大部分步骤,我将直接在终端(默认热键: `CTRL+ALT+T`)输入命令。别害怕! -#### 方法 1. 从Ubuntu仓库安装MySQL +#### 方法 1、从 Ubuntu 仓库安装 MySQL 首先,输入下列命令确保你的仓库已经被更新: @@ -38,7 +37,7 @@ _**简要: 本教程教你如何在基于Ubuntu的Linux发行版上安装MySQL sudo apt update ``` -现在, 安装 **MySQL 5.7** , 简单输入下列命令: +现在,安装 MySQL 5.7,简单输入下列命令: ``` sudo apt install mysql-server -y @@ -46,80 +45,77 @@ sudo apt install mysql-server -y 就是这样!简单且高效。 -#### 方法 2. 使用官方仓库安装MySQL +#### 方法 2、使用官方仓库安装 MySQL 虽然这个方法多了一些步骤,但我将逐一介绍,并尝试写下清晰的笔记。 -首先浏览官方的MySQL网站[download page][4]。 +首先浏览 MySQL 官方网站的[下载页面][4]。 ![][5] -在这,选择**DEB Package**点击**download link**。 +在这里,选择 DEB 软件包,点击“Download”链接。 ![][6] -滑到有关于Oracle网站信息的底部,右键 **No thanks, just start my download.** ,然后选择 **Copy link location**。 +滑到有关于 Oracle 网站信息的底部,右键 “No thanks, just start my download.”,然后选择 “Copy link location”。 - -现在回到终端,我们将使用 **[Curl][7]** 命令去下载这个软件包: - -Now go back to the terminal. We’ll [use][7] **[Curl][7]** [command][7] to the download the package: +现在回到终端,我们将使用 [Curl][7] 命令去下载这个软件包: ``` curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb ``` -**** 是我刚刚从网页上复制的链接。根据当前的MySQL版本,它有可能不同。让我们使用**dpkg**去开始安装MySQL: +`https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb` 是我刚刚从网页上复制的链接。根据当前的 MySQL 版本,它有可能不同。让我们使用 `dpkg` 去开始安装 MySQL: ``` sudo dpkg -i mysql-apt-config* ``` -更新你的仓库: +更新你的仓库: ``` sudo apt update ``` -要实际安装MySQL,我们将使用像第一个方法中同样的命令来安装: +要实际安装 MySQL,我们将使用像第一个方法中同样的命令来安装: ``` sudo apt install mysql-server -y ``` -这样做会在你的终端中打开**包配置**的提示。使用**向下箭头**选择 **Ok**选项。 +这样做会在你的终端中打开包配置的提示。使用向下箭头选择“Ok”选项。 ![][8] -点击 **Enter**.这应该会提示你输入**password**:你的基本上是在为MySQL设置root密码。不要与[Ubuntu的root密码混淆][9]。 +点击回车。这应该会提示你输入密码:这是在为 MySQL 设置 root 密码。不要与 [Ubuntu 的 root 密码混淆][9]。 ![][10] -输入密码然后点击**Tab**键去选择 **< Ok>**.点击**Enter**键,你将**重新输入** **password**。操作完之后,再次键入**Tab**去选择 **< Ok>**。按下**Enter**键。 +输入密码然后点击 Tab 键去选择“Ok“。点击回车键,你将重新输入密码。操作完之后,再次键入 Tab 去选择 “Ok”。按下回车键。 ![][11] -一些关于MySQL Server的配置信息将会展示。再次按下**Tab**去选择 **< Ok>** 和按下 **Enter**键: +将会展示一些关于 MySQL Server 的配置信息。再次按下 Tab 去选择 “Ok” 和按下回车键: ![][12] -这里你需要去选择**default authentication plugin**。确保**Use Strong Password Encryption**被选择。按下**Tab**键和**Enter**键。 +这里你需要去选择默认验证插件。确保选择了“Use Strong Password Encryption”。按下 Tab 键和回车键。 -就是这样!你已经成功地安装了MySQL。 +就是这样!你已经成功地安装了 MySQL。 -#### 验证你的MySQL安装 +#### 验证你的 MySQL 安装 -要验证MySQL已经正确安装,使用下列命令: +要验证 MySQL 已经正确安装,使用下列命令: ``` sudo systemctl status mysql.service ``` -这将展示一些关于MySQL服务的信息: +这将展示一些关于 MySQL 服务的信息: ![][13] -你应该在那里看到 **Active: active (running)** 。如果你没有看到,使用下列命令去开始这个 **service**: +你应该在那里看到 “Active: active (running)”。如果你没有看到,使用下列命令去开始这个服务: ``` sudo systemctl start mysql.service @@ -127,50 +123,49 @@ sudo systemctl start mysql.service #### 配置/保护 MySQL -对于刚安装的MySQL,你应该运行它提供的安全相关的更新命令。就是: +对于刚安装的 MySQL,你应该运行它提供的安全相关的更新命令。就是: ``` sudo mysql_secure_installation ``` -这样做首先会询问你是否想使用**VALIDATE PASSWORD COMPONENT**.如果你想使用它,你将不得不去选择一个最小密码强度( **0 – Low, 1 – Medium, 2 – High** )。你将无法输入任何不遵守所选规则的密码。如果你没有使用强密码的习惯(本应该使用),这可能会配上用场。如果你认为它可能有帮助,那你就键入**y** 或者 **Y**,按下**Enter**键,然后为你的密码选择一个**强度等级**和输入一个你想使用的。如果成功,你将继续**securing**过程;否则你将重新输入一个密码。 +这样做首先会询问你是否想使用 “密码有效强度validate password component”。如果你想使用它,你将必须选择一个最小密码强度(0 – 低,1 – 中,2 – 高)。你将无法输入任何不遵守所选规则的密码。如果你没有使用强密码的习惯(本应该使用),这可能会配上用场。如果你认为它可能有帮助,那你就键入 `y` 或者 `Y`,按下回车键,然后为你的密码选择一个强度等级和输入一个你想使用的密码。如果成功,你将继续强化过程;否则你将重新输入一个密码。 +但是,如果你不想要此功能(我不会),只需按回车或任何其他键即可跳过使用它。 -但是,如果你不想要此功能(我不会),只需按**Enter**或**任何其他键**即可跳过使用它。 +对于其他选项,我建议开启它们(对于每一步输入 `y` 或者 `Y` 和按下回车)。它们(依序)是:“移除匿名用户remove anonymous user”,“禁止 root 远程登录disallow root login remotely”,“移除测试数据库及其访问remove test database and access to it”。“重新载入权限表reload privilege tables now”。 -对于其他选项,我建议**开启**他们(对于每一步输入**y** 或者 **Y** 和按下**Enter**)。他们是(以这样的顺序):**remove anonymous user, disallow root login remotely, remove test database and access to it, reload privilege tables now**. -MySQL Server上 -#### 链接与断开MySQL Server +#### 链接与断开 MySQL Server -为了去运行SQL查询,你首先不得不使用MySQL链接到MySQL服务并使用MySQL提示符。 -To be able to run SQL queries, you’ll first have to connect to the server using MySQL and use the MySQL prompt. 执行此操作的命令是: +为了运行 SQL 查询,你首先必须使用 MySQL 连到服务器并在 MySQL 提示符使用。 + +执行此操作的命令是: ``` mysql -h host_name -u user -p ``` - * **-h** 被用来指定一个 **主机名** (如果这个服务被安装到其他机器上,那么会有用;如果没有,忽略它) - * **-u** 指定登录的 **用户** - * **-p** 指定你想输入的 **密码**. +* `-h` 用来指定一个主机名(如果这个服务被安装到其他机器上,那么会有用;如果没有,忽略它) +* `-u` 指定登录的用户 +* `-p` 指定你想输入的密码. - - -你能通过在最右边输入 **-p**后直接输入密码在命令行,但这样做是不建议的(为了安全原因),如果用户**test_user** 的密码是**1234**,那么你可以尝试去连接你正在使用的机器上的mysql,你应该这样使用: +虽然出于安全原因不建议,但是你可以在命令行最右边的 `-p` 后直接输入密码。例如,如果用户`test_user` 的密码是 `1234`,那么你可以在你使用的机器上尝试去连接,你可以这样使用: ``` mysql -u test_user -p1234 ``` -如果你成功输入了必要的参数,你将会收到由**MySQL shell 提示符**提供的欢迎( **mysql >** ): +如果你成功输入了必要的参数,你将会收到由 MySQL shell 提示符提供的欢迎(`mysql >`): + ![][14] -要从服务端断开连接和离开mysql提示符,输入: +要从服务端断开连接和离开 MySQL 提示符,输入: ``` QUIT ``` -输入**quit** (MySQL不区分大小写)或者 **\q**也能工作。按下**Enter**退出。 +输入 `quit` (MySQL 不区分大小写)或者 `\q` 也能工作。按下回车退出。 你使用简单的命令也能输出关于版本的信息: @@ -178,7 +173,7 @@ QUIT sudo mysqladmin -u root version -p ``` -如果你想看 **选项列表**,使用: +如果你想看命令行选项列表,使用: ``` mysql --help @@ -186,9 +181,7 @@ mysql --help #### 卸载 MySQL - - -如果您决定要使用较新版本或只是想停止使用MySQL。 +如果您决定要使用较新版本或只是想停止使用 MySQL。 首先,关闭服务: @@ -196,7 +189,7 @@ mysql --help sudo systemctl stop mysql.service && sudo systemctl disable mysql.service ``` -确保你备份了你的数据库,以防你之后想使用它们。你可以通过运行下列命令卸载MySQL: +确保你备份了你的数据库,以防你之后想使用它们。你可以通过运行下列命令卸载 MySQL: ``` sudo apt purge mysql* @@ -208,12 +201,11 @@ sudo apt purge mysql* sudo apt autoremove ``` -**小结** +### 小结 -在这边文章中,我已经介绍如何在Ubuntu Linux上**安装 Mysql**。我很高兴如果这篇文章能帮助到那些正为此挣扎的用户或者刚刚开始的用户。 -In this article, I’ve covered **installing MySQL** in Ubuntu Linux. I’d be glad if this guide helps struggling users and beginners. +在这篇文章中,我已经介绍如何在 Ubuntu Linux 上安装 Mysql。我很高兴如果这篇文章能帮助到那些正为此挣扎的用户或者刚刚开始的用户。 -如果你发现这篇文章是一个很有用的资源,在评论里告诉我们。你为了什么使用MySQL? 我们渴望收到你的任何反馈,印象和建议。感谢阅读,并毫不犹豫地尝试这个令人难以置信的工具! +如果你发现这篇文章是一个很有用的资源,在评论里告诉我们。你为了什么使用 MySQL? 我们渴望收到你的任何反馈、印象和建议。感谢阅读,并毫不犹豫地尝试这个很棒的工具! -------------------------------------------------------------------------------- @@ -222,7 +214,7 @@ via: https://itsfoss.com/install-mysql-ubuntu/ 作者:[Sergiu][a] 选题:[lujun9972][b] 译者:[arrowfeng](https://github.com/arrowfeng) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1273635cfee775a7934854e32fb007e3a670e3df Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 08:49:49 +0800 Subject: [PATCH 0170/1154] PUB:20190416 How to Install MySQL in Ubuntu Linux.md @arrowfeng https://linux.cn/article-10789-1.html --- .../20190416 How to Install MySQL in Ubuntu Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190416 How to Install MySQL in Ubuntu Linux.md (99%) diff --git a/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md b/published/20190416 How to Install MySQL in Ubuntu Linux.md similarity index 99% rename from translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md rename to published/20190416 How to Install MySQL in Ubuntu Linux.md index 78c1497476..af456e45a0 100644 --- a/translated/tech/20190416 How to Install MySQL in Ubuntu Linux.md +++ b/published/20190416 How to Install MySQL in Ubuntu Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10789-1.html) [#]: subject: (How to Install MySQL in Ubuntu Linux) [#]: via: (https://itsfoss.com/install-mysql-ubuntu/) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) From 21b1bf1c1249bf758e331b779d568728dc867529 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 28 Apr 2019 08:51:11 +0800 Subject: [PATCH 0171/1154] translated --- ...ngo- Has Arrived- Downloads Available Now.md | 105 ------------------ ...ngo- Has Arrived- Downloads Available Now.md | 105 ++++++++++++++++++ 2 files changed, 105 insertions(+), 105 deletions(-) delete mode 100644 sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md create mode 100644 translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md diff --git a/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md deleted file mode 100644 index a74b63303a..0000000000 --- a/sources/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now!) -[#]: via: (https://itsfoss.com/ubuntu-19-04-release/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now! -====== - -It’s the time to disco! Why? Well, Ubuntu 19.04 ‘Disco Dingo’ is here and finally available to download. Although, we are aware of the [new features in Ubuntu 19.04][1] – I will mention a few important things below and would also point you to the official links to download it and get started. - -### Ubuntu 19.04: What You Need To Know - -Here are a few things you should know about Ubuntu 19.04 Disco Dingo release. - -#### Ubuntu 19.04 is not an LTS Release - -Unlike Ubuntu 18.04 LTS, this will not be [supported for 10 years][2]. Instead, the non-LTS 19.04 will be supported for **9 months until January 2020.** - -So, if you have a production environment, we may not recommend upgrading it right away. For example, if you have a server that runs on Ubuntu 18.04 LTS – it may not be a good idea to upgrade it to 19.04 just because it is an exciting release. - -However, for users who want the latest and greatest installed on their machines can try it out. - -![][3] - -#### Ubuntu 19.04 is a sweet update for NVIDIA GPU Owners - -_Martin Wimpress_ (from Canonical) mentioned that Ubuntu 19.04 is particularly a big deal for NVIDIA GPU owners in the final release notes of Ubuntu MATE 19.04 (one of the Ubuntu flavors) on [GitHub][4]. - -In other words, while installing the proprietary graphics driver – it now selects the best driver compatible with your particular GPU model. - -#### Ubuntu 19.04 Features - -Even though we have already discussed the [best features of Ubuntu 19.04][1] Disco Dingo, it is worth mentioning that I’m exciting about the desktop updates (GNOME 3.32) and the Linux Kernel (5.0) that comes as one of the major changes in this release. - -#### Upgrading from Ubuntu 18.10 to 19.04 - -If you have Ubuntu 18.10 installed, you should upgrade it for obvious reasons. 18.10 will reach its end of life in July 2019 – so we recommend you to upgrade it to 19.04. - -To do that, you can simply head on to the “ **Software and Updates** ” settings and then navigate your way to the “ **Updates** ” tab. - -Now, change the option for – **Notify me of a new Ubuntu version** to “ _For any new version_ “. - -When you run the update manager now, you should see that Ubuntu 19.04 is available now. - -![][5] - -#### Upgrading from Ubuntu 18.04 to 19.04 - -It is not recommended to directly upgrade from 18.04 to 19.04 because you will have to update the OS to 18.10 first and then proceed to get 19.04 on board. - -Instead, you can simply download the official ISO image of Ubuntu 19.04 and then re-install Ubuntu on your system. - -### Ubuntu 19.04: Downloads Available for all flavors - -As per the [release notes][6], Ubuntu 19.04 is available to download now. You can get the torrent or the ISO file on its official release download page. - -[Download Ubuntu 19.04][7] - -If you need a different desktop environment or need something specific, you should check out the official flavors of Ubuntu available: - - * [Ubuntu MATE][8] - * [Kubuntu][9] - * [Lubuntu][10] - * [Ubuntu Budgie][11] - * [Ubuntu Studio][12] - * [Xubuntu][13] - - - -Some of the above mentioned Ubuntu flavors haven’t put the 19.04 release on their download yet. But you can [still find the ISOs on the Ubuntu’s release note webpage][6]. Personally, I use Ubuntu with GNOME desktop. You can choose whatever you like. - -**Wrapping Up** - -What do you think about Ubuntu 19.04 Disco Dingo? Are the new features exciting enough? Have you tried it yet? Let us know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-19-04-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://itsfoss.com/ubuntu-19-04-release-features/ -[2]: https://itsfoss.com/ubuntu-18-04-ten-year-support/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/ubuntu-19-04-Disco-Dingo-default-wallpaper.jpg?resize=800%2C450&ssl=1 -[4]: https://github.com/ubuntu-mate/ubuntu-mate.org/blob/master/blog/20190418-ubuntu-mate-disco-final-release.md -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-19-04-upgrade-available.jpg?ssl=1 -[6]: https://wiki.ubuntu.com/DiscoDingo/ReleaseNotes -[7]: https://www.ubuntu.com/download/desktop -[8]: https://ubuntu-mate.org/download/ -[9]: https://kubuntu.org/getkubuntu/ -[10]: https://lubuntu.me/cosmic-released/ -[11]: https://ubuntubudgie.org/downloads -[12]: https://ubuntustudio.org/2019/04/ubuntu-studio-19-04-released/ -[13]: https://xubuntu.org/download/ diff --git a/translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md new file mode 100644 index 0000000000..caa893dfbc --- /dev/null +++ b/translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now!) +[#]: via: (https://itsfoss.com/ubuntu-19-04-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Ubuntu 19.04 “Disco Dingo” 已经发布:立即下载! +====== + +现在可以下载 Disco 了!为什么?Ubuntu 19.04 “Disco Dingo” 就在这里,终于可以下载了。虽然我们已经知道 [Ubuntu 19.04 中的新功能][1] - 我将在下面提到一些重要的事情,还会给出官方的下载链接。 + +### Ubuntu 19.04:你需要知道什么 + +以下是你应该了解的有关 Ubuntu 19.04 Disco Dingo 发布的一些内容。 + +#### Ubuntu 19.04 不是 LTS 版本 + +与 Ubuntu 18.04 LTS 不同,它不会[受支持 10 年][2]。相反,非 LTS 的 19.04 将支持 **9 个月,直到 2020 年 1 月。** + +因此,如果你有生产环境,我们可能不会立即建议你进行升级。例如,如果你有一台运行在 Ubuntu 18.04 LTS 上的服务器 - 将它升级到 19.04 可能不是一个好主意,因为它是一个令人兴奋的版本。 + +但是,对于希望在计算机上安装最新版本的用户,可以尝试一下。 + +![][3] + +#### Ubuntu 19.04 对 NVIDIA GPU 用户是个不错的更新 + +_Martin Wimpress_(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之一)的 [GitHub][4] 的最终发布说明中提到 Ubuntu 19.04 对 NVIDIA GPU 用户来说特别重要。 + +换句话说,在安装专有图形驱动时 - 它现在会选择与你特定 GPU 型号兼容最佳的驱动程序。 + +#### Ubuntu 19.04 功能 + +尽管我们已经讨论过 [Ubuntu 19.04][1] Disco Dingo 的[最佳功能][1],但值得一提的是,我对本次发布的主要变化:桌面更新 (GNOME 3.32) 和 Linux 内核 (5.0) 感到兴奋。。 + +#### 从 Ubuntu 18.10 升级到 19.04 + +显而易见,如果你安装了 Ubuntu 18.10,你应该升级它。18.10 将于 2019 年 7 月停止支持 - 所以我们建议你将其升级到 19.04。 + +要做到这一点,你可以直接进入“**软件和更新**”设置,然后选择“**更新**”选项卡。 + +现在将选项从**通知我新的 Ubuntu 版本** 变成 “_任何新版本都通知我_” + +现在运行更新管理器时,你应该会看到 Ubuntu 19.04。 + +![][5] + +#### 从 Ubuntu 18.04 升级到 19.04 + +建议不要直接从 18.04 升级到 19.04,因为你需要先将操作系统更新到 18.10,然后再继续升级到 19.04。 + +相反,你只需下载 Ubuntu 19.04 的官方 ISO 映像,然后在你的系统上重新安装 Ubuntu。 + +### Ubuntu 19.04:所有版本都可下载 + +根据[发行说明][6],现在可以下载 Ubuntu 19.04。你可以在其官方发布下载页面上获取种子或 ISO 文件。 + +[Download Ubuntu 19.04][7] + +如果你需要不同的桌面环境或需要特定的东西,你应该查看 Ubuntu 的官方版本: + + * [Ubuntu MATE][8] + * [Kubuntu][9] + * [Lubuntu][10] + * [Ubuntu Budgie][11] + * [Ubuntu Studio][12] + * [Xubuntu][13] + + + +上面提到的一些 Ubuntu 版本还没有在页面提供 19.04。但你可以[仍然在 Ubuntu 的发行说明网页上找到 ISO][6]。就个人而言,我使用带 GNOME 桌面的 Ubuntu。你可以选择你喜欢的。 + +**总结** + +你如何看待 Ubuntu 19.04 Disco Dingo?这些新功能是否足够令人兴奋?你试过了吗?请在下面的评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-19-04-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://itsfoss.com/ubuntu-19-04-release-features/ +[2]: https://itsfoss.com/ubuntu-18-04-ten-year-support/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/ubuntu-19-04-Disco-Dingo-default-wallpaper.jpg?resize=800%2C450&ssl=1 +[4]: https://github.com/ubuntu-mate/ubuntu-mate.org/blob/master/blog/20190418-ubuntu-mate-disco-final-release.md +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-19-04-upgrade-available.jpg?ssl=1 +[6]: https://wiki.ubuntu.com/DiscoDingo/ReleaseNotes +[7]: https://www.ubuntu.com/download/desktop +[8]: https://ubuntu-mate.org/download/ +[9]: https://kubuntu.org/getkubuntu/ +[10]: https://lubuntu.me/cosmic-released/ +[11]: https://ubuntubudgie.org/downloads +[12]: https://ubuntustudio.org/2019/04/ubuntu-studio-19-04-released/ +[13]: https://xubuntu.org/download/ From 77ed51fda6ead3f0a6aff26d7cedfdd970da087c Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 28 Apr 2019 09:00:40 +0800 Subject: [PATCH 0172/1154] delete article --- ... Linux Foundation-s New Training Course.md | 104 ------------------ 1 file changed, 104 deletions(-) delete mode 100644 sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md diff --git a/sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md b/sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md deleted file mode 100644 index e99c5e1edf..0000000000 --- a/sources/tech/20190221 DevOps for Network Engineers- Linux Foundation-s New Training Course.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (DevOps for Network Engineers: Linux Foundation’s New Training Course) -[#]: via: (https://itsfoss.com/devops-for-network-engineers/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -DevOps for Network Engineers: Linux Foundation’s New Training Course -====== - -_**Linux Foundation has launched a[DevOps course for sysadmins][1] and network engineers. They are also offering a limited time 40% discount on the launch.**_ - -DevOps is no longer a buzzword. It has become the necessity for any IT company. - -The role and responsibility of a sysadmin and a network engineer have changed as well. They are required to have knowledge of the DevOps tools popular in the IT industry. - -If you are a sysadmin or a network engineer, you can no longer laugh off DevOps anymore. It’s time to learn new skills to stay relevant in today’s rapidly changing IT industry otherwise the ‘automation’ trend might cost you your job. - -And who knows it better than Linux Foundation, the official organization behind Linux project and the employer of Linux-creator Linus Torvalds? - -[Linux Foundation has a number of courses on Linux and related technologies][2] that help you in getting a job or improving your existing skills at work. - -The [latest course offering][1] from Linux Foundation specifically focuses on sysadmins who would like to familiarize with DevOps tools. - -### DevOps for Network Engineers Course - -![][3] - -[This course][1] is intended for existing sysadmins and network engineers. So you need to have some knowledge of Linux system administration, shell scripting and Python. - -The course will help you with: - - * Integrating into a DevOps/Agile environment - * Familiarizing with commonly used DevOps tools - * Collaborating on projects as DevOps - * Confidently working with software and configuration files in version control - * Recognizing the roles of SCRUM team members - * Confidently applying Agile principles in an organization - - - -This is the course outline: - - * Chapter 1. Course Introduction - * Chapter 2. Modern Project Management - * Chapter 3. The DevOps Process: A Network Engineer’s Perspective - * Chapter 4. Network Simulation and Testing with [Mininet][4] - * Chapter 5. [OpenFlow][5] and [ONOS][6] - * Chapter 6. Infrastructure as Code ([Ansible][7] Basics) - * Chapter 7. Version Control ([Git][8]) - * Chapter 8. Continuous Integration and Continuous Delivery ([Jenkins][9]) - * Chapter 9. Using [Gerrit][10] in DevOps - * Chapter 10. Jenkins, Gerrit and Code Review for DevOps - * Chapter 11. The DevOps Process and Tools (Review) - - - -Altogether, you get 25-30 hours of course material. The online course is self-paced and you can access the material for one year from the date of purchase. - -_**Unlike most other courses on Linux Foundation, this is NOT a video course.**_ - -There is no certification for this course because it is more focused on learning and improving skills. - -#### Get the course at a 40% discount (limited time) - -The course costs $299 but since it’s just launched, they are offering 40% discount till March 1st, 2019. You can get the discount by using the **DEVOPSNET** coupon code at checkout. - -[DevOps for Network Engineers][1] - -By the way, if you are interested in Open Source development, you can benefit from the “[Introduction to Open Source Development, Git, and Linux][11]” video course. You can get a limited time 50% discount using **OSDEV50** code at the checkout. - -Staying relevant is absolutely necessary in any industry, not just IT industry. Learning new skills that are in-demand in your industry is perhaps the best way in this regard. - -What do you think? What are your views on the current automation trend? How would you go about it? - -_Disclaimer: This post contains affiliate links. Please read our_ [_affiliate policy_][12] _for more details._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/devops-for-network-engineers/ - -作者:[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]: http://shrsl.com/1glcb -[2]: https://shareasale.com/r.cfm?b=1074561&u=747593&m=59485&urllink=&afftrack= -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/DevOps-for-Network-Engineers-800x450.png?resize=800%2C450&ssl=1 -[4]: http://mininet.org/ -[5]: https://en.wikipedia.org/wiki/OpenFlow -[6]: https://onosproject.org/ -[7]: https://www.ansible.com/ -[8]: https://itsfoss.com/basic-git-commands-cheat-sheet/ -[9]: https://jenkins.io/ -[10]: https://www.gerritcodereview.com/ -[11]: https://shareasale.com/r.cfm?b=1193750&u=747593&m=59485&urllink=&afftrack= -[12]: https://itsfoss.com/affiliate-policy/ From 0f1df7b00343872a4b8878d0647c7f2ab79ff19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 09:03:03 +0800 Subject: [PATCH 0173/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...15 12 Single Board Computers- Alternative to Raspberry Pi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md index c30c286142..84a10b6570 100644 --- a/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md +++ b/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 267fe4494d7f46defd1dabe36cfc66493e134a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 09:05:31 +0800 Subject: [PATCH 0174/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190420 New Features Coming to Debian 10 Buster Release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md index aa1ee9df46..95d2139b3c 100644 --- a/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md +++ b/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5ce07bbd1b34837baa990022cdeb3ce92c123c41 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 28 Apr 2019 09:05:38 +0800 Subject: [PATCH 0175/1154] translating --- .../20190422 Tracking the weather with Python and Prometheus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190422 Tracking the weather with Python and Prometheus.md b/sources/tech/20190422 Tracking the weather with Python and Prometheus.md index 0e2409dc56..884853c42c 100644 --- a/sources/tech/20190422 Tracking the weather with Python and Prometheus.md +++ b/sources/tech/20190422 Tracking the weather with Python and Prometheus.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6e2d59f7a3ab0f059d405a3546090e36be6ddb6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 09:20:05 +0800 Subject: [PATCH 0176/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Computers- Alternative to Raspberry Pi.md | 354 ------------------ 1 file changed, 354 deletions(-) delete mode 100644 sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md diff --git a/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md deleted file mode 100644 index 84a10b6570..0000000000 --- a/sources/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md +++ /dev/null @@ -1,354 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) -[#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -12 Single Board Computers: Alternative to Raspberry Pi -====== - -_**Brief: Looking for a Raspberry Pi alternative? Here are some other single board computers to satisfy your DIY cravings.**_ - -Raspberry Pi is the most popular single board computer right now. You can use it for your DIY projects or can use it as a cost effective system to learn coding or maybe utilize a [media server software][1] on it to stream media at your convenience. - -You can do a lot of things with Raspberry Pi but it is not the ultimate solution for all kinds of tinkerers. Some might be looking for a cheaper board and some might be on the lookout for a powerful one. - -Whatever be the case, we do need Raspberry Pi alternatives for a variety of reasons. So, in this article, we will talk about the best ten single board computers that we think are the best Raspberry Pi alternatives. - -![][2] - -### Raspberry Pi alternatives to satisfy your DIY craving - -The list is in no particular order of ranking. Some of the links here are affiliate links. Please read our [affiliate policy][3]. - -#### 1\. Onion Omega2+ - -![][4] - -For just **$13** , the Omega2+ is one of the cheapest IoT single board computers you can find out there. It runs on LEDE (Linux Embedded Development Environment) Linux OS – a distribution based on [OpenWRT][5]. - -Its form factor, cost, and the flexibility that comes from running a customized version of Linux OS makes it a perfect fit for almost any type of IoT applications. - -You can find [Onion Omega kit on Amazon][6] or order from their own website that would cost you extra shipping charges. - -**Key Specifications** - - * MT7688 SoC - * 2.4 GHz IEEE 802.11 b/g/n WiFi - * 128 MB DDR2 RAM - * 32 MB on-board flash storage - * MicroSD Slot - * USB 2.0 - * 12 GPIO Pins - - - -[Visit WEBSITE -][7] - -#### 2\. NVIDIA Jetson Nano Developer Kit - -![][8] - -This is a very unique and interesting Raspberry Pi alternative from NVIDIA for just **$99**. Yes, it’s not something that everyone can make use of – but for a specific group of tinkerers or developers. - -NVIDIA explains it for the following use-case: - -> NVIDIA® Jetson Nano™ Developer Kit is a small, powerful computer that lets you run multiple neural networks in parallel for applications like image classification, object detection, segmentation, and speech processing. All in an easy-to-use platform that runs in as little as 5 watts. -> -> nvidia - -So, basically, if you are into AI and deep learning, you can make use of the developer kit. If you are curious, the production compute module of this will be arriving in June 2019. - -**Key Specifications:** - - * CPU: Quad-core ARM A57 @ 1.43 GHz - * GPU: 128-core Maxwell - * RAM: 4 GB 64-bit LPDDR4 25.6 GB/s - * Display: HDMI 2.0 - * 4 x USB 3.0 and eDP 1.4 - - - -[VISIT WEBSITE -][9] - -#### 3\. ASUS Tinker Board S - -![][10] - -ASUS Tinker Board S isn’t the most affordable Raspberry Pi alternative at **$82** (on [Amazon][11]) but it is a powerful alternative. It features the same 40-pin connector that you’d normally find in the standard Raspberry Pi 3 Model but offers a powerful processor and a GPU.Also, the size of the Tinker Board S is exactly the same as a standard Raspberry Pi 3. - -The main highlight of this board is the presence of 16 GB [eMMC][12] (in layman terms, it has got SSD-like storage on board that makes it faster while working on it). - -**Key Specifications:** - - * Rockchip Quad-Core RK3288 processor - * 2 GB DDR3 RAM - * Integrated Graphics Processor - * ARM® Mali™-T764 GPU - * 16 GB eMMC - * MicroSD Card Slot - * 802.11 b/g/n, Bluetooth V4.0 + EDR - * USB 2.0 - * 28 GPIO pins - * HDMI Interface - - - -[Visit website -][13] - -#### 4\. ClockworkPi - -![][14] - -Clockwork Pi is usually a part of the [GameShell Kit][15] if you are looking to assemble a modular retro gaming console. However, you can purchase the board separately for $49. - -Its compact size, WiFi connectivity, and the presence of micro HDMI port make it a great choice for a lot of things. - -**Key Specifications:** - - * Allwinner R16-J Quad-core Cortex-A7 CPU @1.2GHz - * Mali-400 MP2 GPU - * RAM: 1GB DDR3 - * WiFi & Bluetooth v4.0 - * Micro HDMI output - * MicroSD Card Slot - - - -[visit website -][16] - -#### 5\. Arduino Mega 2560 - -![][17] - -If you are into robotic projects or you want something for a 3D printer – Arduino Mega 2560 will be a handy replacement to Raspberry Pi. Unlike Raspberry Pi, it is based on a microcontroller and not a microprocessor. - -It would cost you $38.50 on their [official site][18] and and around [$33 on Amazon][19]. - -**Key Specifications:** - - * Microcontroller: ATmega2560 - * Clock Speed: 16 MHz - * Digital I/O Pins: 54 - * Analog Input Pins: 16 - * Flash Memory: 256 KB of which 8 KB used by bootloader - - - -[visit website -][18] - -#### 6\. Rock64 Media Board - -![][20] - -For the same investment as you would on a Raspberry Pi 3 B+, you will be getting a faster processor and double the memory on Rock64 Media Board. In addition, it also offers a cheaper alternative to Raspberry Pi if you want the 1 GB RAM model – which would cost $10 less. - -Unlike Raspberry Pi, you do not have wireless connectivity support here but the presence of USB 3.0 and HDMI 2.0 does make a good difference if that matters to you. - -**Key Specifications:** - - * Rockchip RK3328 Quad-Core ARM Cortex A53 64-Bit Processor - * Supports up to 4GB 1600MHz LPDDR3 RAM - * eMMC module socket - * MicroSD Card slot - * USB 3.0 - * HDMI 2.0 - - - -[visit website -][21] - -#### 7\. Odroid-XU4 - -![][22] - -Odroid-XU4 is the perfect alternative to Raspberry Pi if you have room to spend a little more ($80-$100 or even lower, depending on the store/availability). - -It is indeed a powerful replacement and technically a bit smaller in size. The support for eMMC and USB 3.0 makes it faster to work with. - -**Key Specifications:** - - * Samsung Exynos 5422 Octa ARM Cortex™-A15 Quad 2Ghz and Cortex™-A7 Quad 1.3GHz CPUs - * 2Gbyte LPDDR3 RAM - * GPU: Mali-T628 MP6 - * USB 3.0 - * HDMI 1.4a - * eMMC 5.0 module socket - * MicroSD Card Slot - - - -[visit website -][23] - -#### 8\. **PocketBeagle** - -![][24] - -It is an incredibly small SBC – almost similar to the Raspberry Pi Zero. However, it would cost you the same as that of a full-sized Raspberry Pi 3 model. The main highlight here is that you can use it as a USB key-fob and then access the Linux terminal to work on it. - -**Key Specifications:** - - * Processor: Octavo Systems OSD3358 1GHz ARM® Cortex-A8 - * RAM: 512 MB DDR3 - * 72 expansion pin headers - * microUSB - * USB 2.0 - - - -[visit website -][25] - -#### 9\. Le Potato - -![][26] - -Le Potato by [Libre Computer][27], also identified by its model number AML-S905X-CC. It would [cost you $45][28]. - -If you want double the memory along with HDMI 2.0 interface by spending a bit more than a Raspberry Pi – this would be the perfect choice. Although, you won’t find wireless connectivity baked in. - -**Key Specifications:** - - * Amlogic S905X SoC - * 2GB DDR3 SDRAM - * USB 2.0 - * HDMI 2.0 - * microUSB - * MicroSD Card Slot - * eMMC Interface - - - -[visit website -][29] - -#### 10\. Banana Pi M64 - -![][30] - -It comes loaded with 8 Gigs of eMMC – which is the key highlight of this Raspberry Pi alternative. For the very same reason, it would cost you $60. - -The presence of HDMI interface makes it 4K-ready. In addition, Banana Pi offers a lot more variety of open source SBCs as an alternative to Raspberry Pi. - -**Key Specifications:** - - * 1.2 Ghz Quad-Core ARM Cortex A53 64-Bit Processor-R18 - * 2GB DDR3 SDRAM - * 8 GB eMMC - * WiFi & Bluetooth - * USB 2.0 - * HDMI - - - -[visit website -][31] - -#### 11\. Orange Pi Zero - -![][32] - -The Orange Pi Zero is an incredibly cheap alternative to Raspberry Pi. You will be able to get it for almost $10 on Aliexpress or Amazon. For a [little more investment, you can get 512 MB RAM][33]. - -If that isn’t sufficient, you can also go for Orange Pi 3 with better specifications which will cost you around $25. - -**Key Specifications:** - - * H2 Quad-core Cortex-A7 - * Mali400MP2 GPU - * RAM: Up to 512 MB - * TF Card support - * WiFi - * USB 2.0 - - - -[Visit website -][34] - -#### 12\. VIM 2 SBC by Khadas - -![][35] - -VIM 2 by Khadas is one of the latest SBCs that you can grab with Bluetooth 5.0 on board. It [starts from $99 (the basic model) and goes up to $140][36]. - -The basic model includes 2 GB RAM, 16 GB eMMC and Bluetooth 4.1. However, the Pro/Max versions would include Bluetooth 5.0, more memory, and more eMMC storage. - -**Key Specifications:** - - * Amlogic S912 1.5GHz 64-bit Octa-Core CPU - * T820MP3 GPU - * Up to 3 GB DDR4 RAM - * Up to 64 GB eMMC - * Bluetooth 5.0 (Pro/Max) - * Bluetooth 4.1 (Basic) - * HDMI 2.0a - * WiFi - - - -**Wrapping Up** - -We do know that there are different types of single board computers. Some are better than Raspberry Pi – and some scaled down versions of it for a cheaper price tag. Also, SBCs like Jetson Nano have been tailored for a specific use. So, depending on what you require – you should verify the specifications of the single board computer. - -If you think that you know about something that is better than the ones mentioned above, feel free to let us know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/raspberry-pi-alternatives/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/best-linux-media-server/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-alternatives.png?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/affiliate-policy/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/omega-2-plus-e1555306748755-800x444.jpg?resize=800%2C444&ssl=1 -[5]: https://openwrt.org/ -[6]: https://amzn.to/2Xj8pkn -[7]: https://onion.io/store/omega2p/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Jetson-Nano-e1555306350976-800x590.jpg?resize=800%2C590&ssl=1 -[9]: https://developer.nvidia.com/embedded/buy/jetson-nano-devkit -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/asus-tinker-board-s-e1555304945760-800x450.jpg?resize=800%2C450&ssl=1 -[11]: https://amzn.to/2XfkOFT -[12]: https://en.wikipedia.org/wiki/MultiMediaCard -[13]: https://www.asus.com/in/Single-Board-Computer/Tinker-Board-S/ -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/clockwork-pi-e1555305016242-800x506.jpg?resize=800%2C506&ssl=1 -[15]: https://itsfoss.com/gameshell-console/ -[16]: https://www.clockworkpi.com/product-page/cpi-v3-1 -[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/arduino-mega-2560-e1555305257633.jpg?ssl=1 -[18]: https://store.arduino.cc/usa/mega-2560-r3 -[19]: https://amzn.to/2KCi041 -[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ROCK64_board-e1555306092845-800x440.jpg?resize=800%2C440&ssl=1 -[21]: https://www.pine64.org/?product=rock64-media-board-computer -[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/odroid-xu4.jpg?fit=800%2C354&ssl=1 -[23]: https://www.hardkernel.com/shop/odroid-xu4-special-price/ -[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/PocketBeagle.jpg?fit=800%2C450&ssl=1 -[25]: https://beagleboard.org/p/products/pocketbeagle -[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/aml-libre.-e1555306237972-800x514.jpg?resize=800%2C514&ssl=1 -[27]: https://libre.computer/ -[28]: https://amzn.to/2DpG3xl -[29]: https://libre.computer/products/boards/aml-s905x-cc/ -[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/banana-pi-m6.jpg?fit=800%2C389&ssl=1 -[31]: http://www.banana-pi.org/m64.html -[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/orange-pi-zero.jpg?fit=800%2C693&ssl=1 -[33]: https://amzn.to/2IlI81g -[34]: http://www.orangepi.org/orangepizero/index.html -[35]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/khadas-vim-2-e1555306505640-800x563.jpg?resize=800%2C563&ssl=1 -[36]: https://amzn.to/2UDvrFE From 5f6fa12b2ebdfa6d425fe91a0c9737a274b73cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 09:20:48 +0800 Subject: [PATCH 0177/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Computers- Alternative to Raspberry Pi.md | 351 ++++++++++++++++++ 1 file changed, 351 insertions(+) create mode 100644 translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md diff --git a/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md new file mode 100644 index 0000000000..4e1fc6a6e9 --- /dev/null +++ b/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -0,0 +1,351 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) +[#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +12 个可替换 Raspberry Pi 的单片机 +================================ + +_**简介: 正在寻找 Raspberry Pi 的替代品? 这里有一些单片机可以满足你的 DIY 渴求**_ + +Raspberry Pi 是当前最流行的单片机。你可以在你的 DIY 项目中使用它,或者用它作为一个成本效益高的系统来学习编代码,或者为了你的便利,利用一个[流媒体软件][1]运行在上面作为流媒体设备。 + +你可以使用 Raspberry Pi 做很多事,但它不是各种极客的最终解决方案。一些人可能在寻找更便宜的开发板,一些可能在寻找更强大的。 + +无论是哪种情况,我们都有很多原因需要 Raspberry Pi 的替代品。因此,在这片文章里,我们将讨论最好的十个我们认为能够替代 Raspberry Pi 的单片机。 + +![][2] + +### 满足你 DIY 渴望的 Raspberry Pi 替代品 + +这个列表没有特定的顺序排名。链接的一部分是附属链接。请阅读我们的[附属政策][3]. + +#### 1\. Onion Omega2+ + +![][4] + +只要 **$13**,Omega2+ 是这里你可以找到的最便宜的 IoT 单片机设备。它运行 LEDE(Linux 嵌入式开发环境)Linux 系统 - 一个基于 [OpenWRT][5] 的分发版。 + +由于运行一个自定义 Linux 系统,它的组成因素,花费,和灵活性使它完美适合几乎所有类型的 IoT 应用。 + +你可以在[亚马逊商城的 Onion Omega 装备][6]或者从他们的网站下单,可能会收取额外的邮费。 + +**关键参数:** + + * MT7688 SoC + * 2.4 GHz IEEE 802.11 b/g/n WiFi + * 128 MB DDR2 RAM + * 32 MB on-board flash storage + * MicroSD Slot + * USB 2.0 + * 12 GPIO Pins + + [查看官网][7] + +#### 2\. NVIDIA Jetson Nano Developer Kit + +这是来自 NVIDIA 的只要 **$99** 的非常独特和有趣的 Raspberry Pi 替代品。是的,它不是每个人都能充分利用的设备 - 只为特定的一组极客或者开发者。 + +NVIDIA 使用下面的用例解释它: + +> NVIDIA® Jetson Nano™ Developer Kit 是一个小的,强大的让你并行运行多个神经网络的应用像图像分类,对象侦察,分段,语音处理。全部在一个易于使用的运行功率只有 5 瓦特平台。 +> +> nvidia + +因此,基本上,如果你正在研究 AI 或者深度学习,你可以充分利用开发设备。如果你很好奇,该设备的产品计算模块将在 2019 年 7 月到来。 + +**关键参数:** + + * CPU: Quad-core ARM A57 @ 1.43 GHz + * GPU: 128-core Maxwell + * RAM: 4 GB 64-bit LPDDR4 25.6 GB/s + * Display: HDMI 2.0 + * 4 x USB 3.0 and eDP 1.4 + + + +[查看官网 +][9] + +#### 3\. ASUS Tinker Board S + +![][10] + +ASUS Tinker Board S 不是大多数可负担得起的可替代 Raspberry Pi 的替换设备 (**$82**, [亚马逊商城][11]),但是它是一个强大的替代品。它的特点是有你通常可以发现与标准 Raspberry Pi 3 Model 一样的 40 针脚的连接器,但是提供了强大的处理器和 GPU。同样的,Tinker Board S 的大小恰巧和标准的 Raspberry Pi 3 一样大。 + +这个板子的主要亮点是 16 GB [eMMC][12] (用外行术语说,它的板上有一个类似 SSD 的存储单元使它工作时运行的更快。) 的存在。 + +**关键参数** + + * Rockchip Quad-Core RK3288 processor + * 2 GB DDR3 RAM + * Integrated Graphics Processor + * ARM® Mali™-T764 GPU + * 16 GB eMMC + * MicroSD Card Slot + * 802.11 b/g/n, Bluetooth V4.0 + EDR + * USB 2.0 + * 28 GPIO pins + * HDMI Interface + + + +[查看网站 +][13] + +#### 4\. ClockworkPi + +![][14] + +如果你在想方设法组装一个模块化的复古的游戏控制台,Clockwork Pi 通常是 [GameShell Kit][15] 的一部分。然而,你可以 使用 $49 单独购买板子。 + +它紧凑的大小,WiFi 连接性,和 micro HDMI 端口的存在使它成为很多事物的选择。 + +**关键参数** + + * Allwinner R16-J Quad-core Cortex-A7 CPU @1.2GHz + * Mali-400 MP2 GPU + * RAM: 1GB DDR3 + * WiFi & Bluetooth v4.0 + * Micro HDMI output + * MicroSD Card Slot + + + +[查看官网 +][16] + +#### 5\. Arduino Mega 2560 + +![][17] + +如果你正在研究机器人项目或者你想要一个 3D 打印机 - Arduino Mega 2560 将是 Raspberry Pi 的便利的替代品。不像 Raspberry Pi,它是基于微控制器而不是微处理器的。 + +在他们的[官网][18],它会花费你 $38.50 或者在[在亚马逊商城 $33][19]。 + +**关键参数:** + +**Key Specifications:** + + * Microcontroller: ATmega2560 + * Clock Speed: 16 MHz + * Digital I/O Pins: 54 + * Analog Input Pins: 16 + * Flash Memory: 256 KB of which 8 KB used by bootloader + + + +[查看官网 +][18] + +#### 6\. Rock64 Media Board + +![][20] + +对于与你可能想要 Raspberry Pi 3 B+ 相同的投资,你将在 Rock64 Media Board 上获得更快的处理器和双倍的内存。除此之外,如果你想要 1 GB RAM 版的,它提供了一个 Raspberry Pi 的 更便宜的替代,花费更少,只要 $10 。 + +不像 Raspberry Pi,这里没有无线连接支持,但是 USB 3.0 和 HDMI 2.0 的存在使它与众不同,如果它对你很重要的话。 + +**关键参数:** + + * Rockchip RK3328 Quad-Core ARM Cortex A53 64-Bit Processor + * Supports up to 4GB 1600MHz LPDDR3 RAM + * eMMC module socket + * MicroSD Card slot + * USB 3.0 + * HDMI 2.0 + + + +[查看官网 +][21] + +#### 7\. Odroid-XU4 + +![][22] + +Odroid-XU4 是一个完美的 Raspberry Pi 的替代,如果你有能够稍微提高预算的空间($80-$100 甚至更低,取决于存储的容量)。 + +它确实是一个强大的替代并且体积更小。 支持 eMMC 和 USB 3.0 使它工作起来更快。 + +**关键参数:** + * Samsung Exynos 5422 Octa ARM Cortex™-A15 Quad 2Ghz and Cortex™-A7 Quad 1.3GHz CPUs + * 2Gbyte LPDDR3 RAM + * GPU: Mali-T628 MP6 + * USB 3.0 + * HDMI 1.4a + * eMMC 5.0 module socket + * MicroSD Card Slot + + + +[查看官网 +][23] + +#### 8\. **PocketBeagle** + +![][24] + +它是一个难以置信的小的单片机 - 几乎和 Raspberry Pi Zero 相似。然而它会花费完全大小的 Raspberry Pi 3 相同的价格。主要的亮点是你可以用它作为一个 USB 便携式信息终端 并且进入 Linux 命令行工作。 + +**关键参数:** + + * Processor: Octavo Systems OSD3358 1GHz ARM® Cortex-A8 + * RAM: 512 MB DDR3 + * 72 expansion pin headers + * microUSB + * USB 2.0 + + + +[查看官网 +][25] + +#### 9\. Le Potato + +![][26] + +由 [Libre Computer][27] 出品的 Le Potato,同样被它的型号 AML-S905X-CC 标识。它花费你 [$45][28]。 + +如果你花费的比 Raspberry Pi 更多的钱,你就能得到想要双倍内存和 HDMI 2.0 接口,这可能是一个完美的选择。尽管,你还是不能发现嵌入的无线连接。 + +**关键参数:** + + + * Amlogic S905X SoC + * 2GB DDR3 SDRAM + * USB 2.0 + * HDMI 2.0 + * microUSB + * MicroSD Card Slot + * eMMC Interface + + + +[查看官网 +][29] + +#### 10\. Banana Pi M64 + +![][30] + +它自带了 8 Gigs 的 eMMC - 是替代 Raspberry Pi 的主要亮点。由于相同的原因,它花费 $60。 + +HDMI 接口的存在使它胜任 4K。除此之外,Banana Pi 提供了更多种类的开源单片机作为 Raspberry Pi 的替代。 + +**关键参数:** + + * 1.2 Ghz Quad-Core ARM Cortex A53 64-Bit Processor-R18 + * 2GB DDR3 SDRAM + * 8 GB eMMC + * WiFi & Bluetooth + * USB 2.0 + * HDMI + + + +[查看官网 +][31] + +#### 11\. Orange Pi Zero + +![][32] + +Orange Pi Zero 相对于 Raspberry Pi 难以置信的便宜。你可以在 Aliexpress 或者亚马逊上以最多 $10 就能够获得。如果[稍微投资多点,你能够获得 512 MB RAM][33]。 + +如果这还不够充分,你可以花费大概 $25 获得更好的配置像 Orange Pi 3。 + +**关键参数:** + + * H2 Quad-core Cortex-A7 + * Mali400MP2 GPU + * RAM: Up to 512 MB + * TF Card support + * WiFi + * USB 2.0 + + + +[查看官网 +][34] + +#### 12\. VIM 2 SBC by Khadas + +![][35] + +由 Khadas 出品的 VIM 2 是最新的单片机,因此你能够在板上获取到蓝牙 5.0。[从 $99 的基础款到上限 $140][36]. + +基础款包含 2 GB RAM,16 GB eMMC 和蓝牙 4.1。然而,Pro/Max 版包含蓝牙 5.0,更多的内存,更多的 eMMC 存储。 + +**关键参数:** + + * Amlogic S912 1.5GHz 64-bit Octa-Core CPU + * T820MP3 GPU + * Up to 3 GB DDR4 RAM + * Up to 64 GB eMMC + * Bluetooth 5.0 (Pro/Max) + * Bluetooth 4.1 (Basic) + * HDMI 2.0a + * WiFi + + + +**总结** + +我们知道有很多不同种类的单片机电脑。一些比 Raspberry Pi 更好 - 它的一些小规格的版本有更便宜的价格。同样的,单片机像 Jetson Nano 已经被裁剪用于特定用途。因此,取决于你需要什么 - 你应该验证单片机的配置。 + +如果你认为你知道比上述提到的更好的东西,请随意在下方评论来让我们知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-alternatives/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-linux-media-server/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-alternatives.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/affiliate-policy/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/omega-2-plus-e1555306748755-800x444.jpg?resize=800%2C444&ssl=1 +[5]: https://openwrt.org/ +[6]: https://amzn.to/2Xj8pkn +[7]: https://onion.io/store/omega2p/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Jetson-Nano-e1555306350976-800x590.jpg?resize=800%2C590&ssl=1 +[9]: https://developer.nvidia.com/embedded/buy/jetson-nano-devkit +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/asus-tinker-board-s-e1555304945760-800x450.jpg?resize=800%2C450&ssl=1 +[11]: https://amzn.to/2XfkOFT +[12]: https://en.wikipedia.org/wiki/MultiMediaCard +[13]: https://www.asus.com/in/Single-Board-Computer/Tinker-Board-S/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/clockwork-pi-e1555305016242-800x506.jpg?resize=800%2C506&ssl=1 +[15]: https://itsfoss.com/gameshell-console/ +[16]: https://www.clockworkpi.com/product-page/cpi-v3-1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/arduino-mega-2560-e1555305257633.jpg?ssl=1 +[18]: https://store.arduino.cc/usa/mega-2560-r3 +[19]: https://amzn.to/2KCi041 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ROCK64_board-e1555306092845-800x440.jpg?resize=800%2C440&ssl=1 +[21]: https://www.pine64.org/?product=rock64-media-board-computer +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/odroid-xu4.jpg?fit=800%2C354&ssl=1 +[23]: https://www.hardkernel.com/shop/odroid-xu4-special-price/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/PocketBeagle.jpg?fit=800%2C450&ssl=1 +[25]: https://beagleboard.org/p/products/pocketbeagle +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/aml-libre.-e1555306237972-800x514.jpg?resize=800%2C514&ssl=1 +[27]: https://libre.computer/ +[28]: https://amzn.to/2DpG3xl +[29]: https://libre.computer/products/boards/aml-s905x-cc/ +[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/banana-pi-m6.jpg?fit=800%2C389&ssl=1 +[31]: http://www.banana-pi.org/m64.html +[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/orange-pi-zero.jpg?fit=800%2C693&ssl=1 +[33]: https://amzn.to/2IlI81g +[34]: http://www.orangepi.org/orangepizero/index.html +[35]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/khadas-vim-2-e1555306505640-800x563.jpg?resize=800%2C563&ssl=1 +[36]: https://amzn.to/2UDvrFE From 3508456ef64990da83e10695ca6352dd14b300e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 11:09:19 +0800 Subject: [PATCH 0178/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ures Coming to Debian 10 Buster Release.md | 147 ------------------ ...ures Coming to Debian 10 Buster Release.md | 146 +++++++++++++++++ 2 files changed, 146 insertions(+), 147 deletions(-) delete mode 100644 sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md create mode 100644 translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md diff --git a/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md deleted file mode 100644 index 95d2139b3c..0000000000 --- a/sources/tech/20190420 New Features Coming to Debian 10 Buster Release.md +++ /dev/null @@ -1,147 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (New Features Coming to Debian 10 Buster Release) -[#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) -[#]: author: (Shirish https://itsfoss.com/author/shirish/) - -New Features Coming to Debian 10 Buster Release -====== - -Debian 10 Buster is nearing its release. The first release candidate is already out and we should see the final release, hopefully, in a few weeks. - -If you are excited about this major new release, let me tell you what’s in it for you. - -### Debian 10 Buster Release Schedule - -There is no set release date for [Debian 10 Buster][1]. Why is that so? Unlike other distributions, [Debian][2] doesn’t do time-based releases. It instead focuses on fixing release-critical bugs. Release-critical bugs are bugs which have either security issues [CVE’s][3] or some other critical issues which prevent Debian from releasing. - -Debian has three parts in its archive, called Main, contrib and non-free. Of the three, Debian Developers and Release Managers are most concerned that the packages which form the bedrock of the distribution i.e. Main is rock stable. So they make sure that there aren’t any major functional or security issues. They are also given priority values such as Essential, Required, Important, Standard, Optional and Extra. More on this in some later Debian article. - -This is necessary because Debian is used as a server in many different environments and people have come to depend on Debian. They also look at upgrade cycles to see nothing breaks for which they look for people to test and see if something breaks while upgrading and inform Debian of the same. - -This commitment to stability is one of the [many reasons why I love to use Debian][4]. - -### What’s new in Debian 10 Buster Release - -Here are a few visual and under the hood changes in the upcoming major release of Debian. - -#### New theme and wallpaper - -The Debian theme for Buster is called [FuturePrototype][5] and can be seen below: - -![Debian Buster FuturePrototype Theme][6] - -#### 1\. GNOME Desktop 3.30 - -The GNOME desktop which was 1.3.22 in Debian Stretch is updated to 1.3.30 in Buster. Some of the new packages included in this GNOME desktop release are gnome-todo, tracker instead of tracker-gui , dependency against gstreamer1.0-packagekit so there is automatic codec installation for playing movies etc. The big move has been all packages being moved from libgtk2+ to libgtk3+ . - -#### 2\. Linux Kernel 4.19.0-4 - -Debian uses LTS Kernel versions so you can expect much better hardware support and long 5 year maintainance and support cycle from Debian. From kernel 4.9.0.3 we have come to 4.19.0-4 . - -``` -$ uname -r -4.19.0-4-amd64 -``` - -#### 3\. OpenJDK 11.0 - -For a long time Debian was stuck on OpenJDK 8.0. Now in Debian Buster we have moved to OpenJDK 11.0 and have a team which will take care of new versions. - -#### 4\. AppArmor Enabled by Default - -In Debian Buster [AppArmor][7] will be enabled by default. While this is a good thing, care would have to be taken care by system administrators to enable correct policies. This is only the first step and would need fixing probably lot of scripts to be as useful as been envisioned for the user. - -#### 5\. Nodejs 10.15.2 - -For a long time Debian had Nodejs 4.8 in the repo. In this cycle Debian has moved to Nodejs 10.15.2 . In fact, Debian Buster has many javascript libraries such as yarnpkg (an npm alternative) and many others. - -Of course, you can [install latest Nodejs in Debian][8] from the project’s repository but it’s good to see newer version in Debian repository. - -#### 6\. NFtables replaces iptables - -Debian buster provides nftables as a full replacement to iptables which means better and easier syntax, better support for dual-stack ipv4-v6 firewalls and more. - -#### 7\. Support for lot of ARM 64 and ARMHF SBC Boards. - -There has been a constant stream of new SBC boards which Debian is supporting, the latest amongst these are pine64_plus, pinebook for ARM64, while Firefly-RK3288, u-boot-rockchip for ARMHF 64 as well as Odroid HC1/HC2 boards, SolidRun Cubox-i Dual/Quad (1.5som), and SolidRun Cubox-i Dual/Quad (1.5som+emmc) boards, Cubietruckplus as well. There is support for Rock 64, Banana Pi M2 Berry, Pine A64 LTS Board, Olimex A64 Teres-1 as well as Raspberry Pi 1, Zero and Pi 3. Support will be out-of-the box for RISC-V systems as well. - -#### 8\. Python 2 is dead, long live Python 3 - -Python 2 will be [deprecated][9] on January 1, 2020 by python.org . While Debian does have Python 2.7 efforts are on to remove after moving all packages to Python 3 to remove it from the repo. This may happen either at Buster release or in a future point release but this is imminent. So Python developers are encouraged to move their code-base to be compatible with Python 3. At the moment of writing, both python2 and python3 are supported in Debian buster. - -#### 9\. Mailman 3 - -Mailman3 is finally available in Debian. While [Mailman][10] has been further sub-divided into components. To install the whole stack, install mailman3-full to get all the components. - -#### 10\. Any existing Postgresql databases used will need to be reindexed - -Due to updates in glibc locale data, the way the information is sorted in put in text indexes will change hence it would be beneficial to reindex the data so no data corruption arises in near future. - -#### 11\. Bash 5.0 by Default - -You probably have already about the [new features in Bash 5.0][11], this version is already in Debian. - -#### 12\. Debian implementing /usr/merge - -An excellent freedesktop [primer][12] on what /usr/merge brings is already shared. Couple of things to note though. While Debian would like to do the whole transition, there is possibility that due to unforseen circumstances, some binaries may not be in a position to do the change. One point to note though, /var and /etc/ will be left alone so people who are using containers or cloud would not have to worry too much :) - -#### 13\. Secure-boot support - -With Buster RC1, Debian now has secure-boot support. Which means machines which have the secure-boot bit turned on in the machine should be easily able to install Debian on such machines. No need to disable or workaround Secure boot anymore :) - -#### 14\. Calameres Live-installer for Debian-Live images - -For Debian buster, Debian Live, Debian introduces [Calameres Installer][13] instead of plain old debian-installer. While the Debian-installer has lot many features than Calameres, for newbies Calameres provides a fresh alternative to install than debian-installer. Some screenshots from the installation process. - -![Calamares Partitioning Stage][14] - -As can be seen it is pretty easy to Install Debian under Calamares, only 5 stages to go through and you can have Debian installed at your end. - -### Download Debian 10 Live Images (only for testing) - -Don’t use it on production machines just yet. Try it on a test machine or a virtual machine. - -You can get Debian 64-bit and 32 bit images from Debian Live [directory][15]. If you want the 64-bit look into 64-bit directory, if you want the 32-bit, you can look into the 32-bit directory. - -[Debian 10 Buster Live Images][15] - -If you upgrade from existing stable and something breaks, see if it is reported against the [upgrade-reports][16] psuedo-package using [reportbug][17] you saw the issue with. If the bug has not reported in the package then report it and share as much information as you can. - -**In Conclusion** - -While thousands of packages have been updated and it is virtually impossible to list them all. I have tired to list some of the major changes that you can look for in Debian buster. What do you think of it? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/new-features-coming-to-debian-10-buster-release/ - -作者:[Shirish][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/shirish/ -[b]: https://github.com/lujun9972 -[1]: https://wiki.debian.org/DebianBuster -[2]: https://www.debian.org/ -[3]: https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures -[4]: https://itsfoss.com/reasons-why-i-love-debian/ -[5]: https://wiki.debian.org/DebianArt/Themes/futurePrototype -[6]: https://itsfoss.com/wp-content/uploads/2019/04/debian-buster-theme-800x450.png -[7]: https://wiki.debian.org/AppArmor -[8]: https://itsfoss.com/install-nodejs-ubuntu/ -[9]: https://www.python.org/dev/peps/pep-0373/ -[10]: https://www.list.org/ -[11]: https://itsfoss.com/bash-5-release/ -[12]: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/ -[13]: https://calamares.io/about/ -[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/calamares-partitioning-wizard.jpg?fit=800%2C538&ssl=1 -[15]: https://cdimage.debian.org/cdimage/weekly-live-builds/ -[16]: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=upgrade-reports;dist=unstable -[17]: https://itsfoss.com/bug-report-debian/ diff --git a/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md new file mode 100644 index 0000000000..8dd870fe2d --- /dev/null +++ b/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (New Features Coming to Debian 10 Buster Release) +[#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +Debian 10 Buster 发布即将到来的新特点 +======================================= + +Debian 10 Buster 即将发布。第一版发布日期已经确定,我们应该期待最终版,希望在几周内。 + +如果你对这个主要的新发布版本感到激动,让我告诉你里面有什么。 + +### Debian 10 Buster 发布计划 + +[Debian 10 Buster][1] 的发布日期并没有确定。为什么这样呢?不像其他分发版,[Debian][2] 不是基于时间的发布版。相反地它主要关注于修复 release-critical 的 Bug。Release-critical 的 bug 不是有严重安全问题就是一些其他组织 Debian 发布的严重问题。 + +Debian 在它的文档总分文三部分,叫做 Main,contrib,和 non-free。在这三者之中,Debian 开发者和发布管理者最关心的包组成了该分发版的基石。Main 是像石头一样稳定的。因此他们确保那里没有主要的基础或者安全问题。他们同样给了优先级的值例如 Essential, Required,Importanct,Standard,Optional 和 Extra。更多关于此方面的知识参考后续的 Debian 文章。 + +这是必要的,因为 Debian 在很多环境中被用作服务器,人们已经变得依赖 Debian。他们同样看重升级周期是否有破环,因此他们寻找人们来测试,来查看当升级的时候是否有破坏并通知 Debian 这样的问题。 + +这种提交方式带来的稳定性[是我喜欢 Debian 的众多原因之一][4]。 + +这里是在即将到来的主要的 Debian 发布版的少量的视觉上的改变和内部的改变。 + +#### 新的主题和壁纸 + +Buster 的 Debian 主题被称为 [FuturePrototype][5] 并且看起来如下图: + +![Debian Buster FuturePrototype Theme][6] + +#### 1\. GNOME 桌面 3.30 + +Debian Stretch 版中的 GNOME 桌面在 Buster 中从 1.3.22 升级到了 1.3.30。在 GNOME 桌面发布版中新包含的一些包是 gnome-todo, tracker 替代了 tracker-gui,gstreamer1.0-packagekit 的依赖,因此可以通过自动地编码解码器安装来做播放电影之类的事。对于所有包来说一个大的改变是从 libgtk2+ 到 libgtk3+。 + +#### 2\. Linux 内核 4.19.0-4 + +Debian 使用 LTS 内核版本,因此你可以期待更好的硬件支持和长达5年的维持和 Debian 的支持周期。我们已经从内核 4.9.0.3 到 4.19.0-4。 + +``` +$ uname -r +4.19.0-4-amd64 +``` + +#### 3\. OpenJDK 11.0 + +Debian 在很长时间里都是 OpenJDK 8.0。现在在 Debian Buster 里我们已经升级为 OpenJDK 11.0 并且会有一个团队维护新的版本。 + +#### 4\. 默认地允许 AppArmor + +在 Debian Buster 中 [AppArmor][7] 默认是允许地。这是一个好事,谨慎是系统管理员必须考虑的事来允许正确的策略。这仅仅是第一步并且可能需要修复很多对用户来说与预期一样有用的脚本。 + +#### 5\. Nodejs 10.15.2 + +在很长一段时间里 Debian 在仓库中都只有 Nodejs 4.8。这这个周期里 Debian 已经移到 Nodejs 10.15.2。事实上,Debian Buster 有很多 javascript 库例如 yarnpkg (一个 nmp 的替代品)和很多其它的。 + +当然,你可以从项目仓库中[在 Debian 中安装最新的 Nodejs][8],但是从 Debian 仓库中看到更新的版本是很棒的。 + +#### 6\. NFtables 替代了 iptables + +Debian Buster 提供了 nftables 作为 iptables 的完整替代,因为它有更好的更简单的语法,更好的支持双栈 ipv4-v6 防火墙并且还有更多。 + +#### 7\. 支持更多的 ARM 64 和 ARMHF 的单片机。 + +Debian 已经支持一些常见的新的单片机,在这些之间最新的是 pine64_plus,ARM64 的 pinebook,Firefly-RK3288, ARMHF 64 的 u-boot-rockchip 和 Odroid + HC1/HC2 板,SolidRun Cubox-i 双核/四核 (1.5som),和 SolidRun Cubox-i 双核/四核 (1.5som+emmc)板,Cubietruckplus。同样支持 Rock 64,Banana Pi M2 Berry,Pine A64 LTS Board, Olimex A64 Teres-1 与 Rapberry Pi 1,Zero 和 Pi 3。对于 RISC-V 系统同样支持开箱即用。 + + #### 8\. Python 2 死了,Python 3 长期存活 + + 在 2020 年 1 月 1 日,Python 2 将被 python.org 遗弃。在 Debian 将所有的软件包从 Python 2.7 移到 Python 3 以后,Python 2.7 将从软件仓库中移除。这可能发生在 Buster 发布版或者将来的某个发布版,这是即将来临的。因此 Python 开发者被鼓励移植他们的代码库来兼容 Python 3。在写的时候,在 Debian Buster 中同时支持 python2 和 pythone3。 + + #### 9\. Mailman 3 + + 在 Debian 中最终可以获得 Mailman3。同时 [Mailman][10] 已经被细分成为组件。为了安装整个软件栈,安装 mailman3-full 来获取所有组件。 + + #### 10\. 任意已存在的 Postgresql 数据库将被重新索引 + + 由于 glibc 本地数据的更新,放入文本索引中的信息排序的方式将会改变,因为重新索引是有益的,这样在将来就不会有数据破坏发生。 + + #### 11\. 默认的 Bash 5.0 + + 你可能已经了解了 [Bash 5.0 的新特点][11],在 Debian 中已经是该版本了。 + + #### 12\. Debian 实现 /usr/merge + + /user/merge 带来的一个优秀的自由桌面[初级读物][12]已经被分享了。有一些事项需要注意。当 Debian 想要做整个过度时,可能由于未预见的情况,一些文件可能并没有做这些改变。有一点需要注意的是,/var 和 /etc 将不被干涉,因此使用容器或者云的不需要考虑太多 :)。 + + #### 13\. 安全启动支持 + + 在 Buster RC1 中,Debian 现在支持安全启动。意味着有安全启动位并且打开的机器应该能够轻松安装 Debian。不再需要禁止或者处理安全启动的事 :) + + #### \14. Debian-Live 镜像的 Calameres Live-installer + + 对于 Debian buster 来说,Debian Live,Debian 引入了 [Calameres 安装器][13]来替代老的 debian-installer。当 Debian-安装器 比 Calameres 有更多特点时,对于初学者,Calameres 相对于 debian-installer 提供了可替换的一个全新的安装方式。安装国政的一些截图。 + + ![Calamares Partitioning Stage][14] + + 如图所见,在 Calamares 下安装 Debian 相当简单,只要经历 5 步骤你就能在你的终端上安装 Debian。 + +### 下载 Debian 10 Live 镜像 (只用于测试) + +现在还不要将它用于生产机器。在测试机上尝试或者一个虚拟机。 + +你可以获取 Debian 64-bit 和 32 位的镜像从 Debian Live [目录][15]。如果你想要 64-bit 的进入 64-bit 目录,如果你想要 32-bit 的,你可以进入 32-bit 目录。 + +[Debian 10 Buster Live Images][15] + +如果你从已存在的稳定版升级并且一些东西被破坏,查看它是否在[升级报告][16]中报道,使用预安装的包 [reportbug][17] 报告你看到的问题。如果 bug 没有在包中被报道,那么请尽可能地报告和分享更多地信息。 + +**总结** + +当上千个包被升级时,在视觉上是不可能全部列出的。我已经列出了一些你在 Debian buster 可以找到的一些主要的改变。你怎么看呢? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/new-features-coming-to-debian-10-buster-release/ + +作者:[Shirish][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/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.debian.org/DebianBuster +[2]: https://www.debian.org/ +[3]: https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures +[4]: https://itsfoss.com/reasons-why-i-love-debian/ +[5]: https://wiki.debian.org/DebianArt/Themes/futurePrototype +[6]: https://itsfoss.com/wp-content/uploads/2019/04/debian-buster-theme-800x450.png +[7]: https://wiki.debian.org/AppArmor +[8]: https://itsfoss.com/install-nodejs-ubuntu/ +[9]: https://www.python.org/dev/peps/pep-0373/ +[10]: https://www.list.org/ +[11]: https://itsfoss.com/bash-5-release/ +[12]: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/ +[13]: https://calamares.io/about/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/calamares-partitioning-wizard.jpg?fit=800%2C538&ssl=1 +[15]: https://cdimage.debian.org/cdimage/weekly-live-builds/ +[16]: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=upgrade-reports;dist=unstable +[17]: https://itsfoss.com/bug-report-debian/ From 6f93a29b9d49f1a700dfb02ce3747fffd80efbec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 11:23:25 +0800 Subject: [PATCH 0179/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o Check The Default Gateway Or Router IP Address In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md index 9ecb164307..233cd8ef74 100644 --- a/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md +++ b/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8148a60e9ee4d24f1bf626b426fe1f87f66c0447 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 12:12:54 +0800 Subject: [PATCH 0180/1154] PRF:20190420 New Features Coming to Debian 10 Buster Release.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @warmfrog 恭喜你完成了第一篇贡献。不过请在完成后自行校对一遍再提交比较好。 --- ...ures Coming to Debian 10 Buster Release.md | 97 ++++++++++--------- 1 file changed, 49 insertions(+), 48 deletions(-) diff --git a/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md index 8dd870fe2d..368d1cde72 100644 --- a/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md +++ b/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md @@ -1,30 +1,32 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (New Features Coming to Debian 10 Buster Release) [#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) [#]: author: (Shirish https://itsfoss.com/author/shirish/) -Debian 10 Buster 发布即将到来的新特点 +即将到来的 Debian 10 Buster 发布版的新特点 ======================================= -Debian 10 Buster 即将发布。第一版发布日期已经确定,我们应该期待最终版,希望在几周内。 +Debian 10 Buster 即将发布。第一个发布候选版已经发布,我们预期可以在几周内见到待最终版。 -如果你对这个主要的新发布版本感到激动,让我告诉你里面有什么。 +如果你期待对这个新的主要发布版本,让我告诉你里面有什么。 ### Debian 10 Buster 发布计划 -[Debian 10 Buster][1] 的发布日期并没有确定。为什么这样呢?不像其他分发版,[Debian][2] 不是基于时间的发布版。相反地它主要关注于修复 release-critical 的 Bug。Release-critical 的 bug 不是有严重安全问题就是一些其他组织 Debian 发布的严重问题。 +[Debian 10 Buster][1] 的发布日期并没有确定。为什么这样呢?不像其他分发版,[Debian][2] 并不基于时间发布。相反地它主要关注于修复发布版重要 Bugrelease-critical bug。发布版重要 Bug 要么是严重的安全问题([CVE][3]),要么是一些其他阻止 Debian 发布的严重问题。 -Debian 在它的文档总分文三部分,叫做 Main,contrib,和 non-free。在这三者之中,Debian 开发者和发布管理者最关心的包组成了该分发版的基石。Main 是像石头一样稳定的。因此他们确保那里没有主要的基础或者安全问题。他们同样给了优先级的值例如 Essential, Required,Importanct,Standard,Optional 和 Extra。更多关于此方面的知识参考后续的 Debian 文章。 +Debian 在它的软件归档中分为三个部分,叫做 Main、contrib 和 non-free。在这三者之中,Debian 开发者和发布管理者最关心的包组成了该分发版的基石。Main 是像石头一样稳定的。因此他们要确保那里没有主要的功能或者安全问题。他们同样给予了不同的优先级,例如 Essential、Required、Important、Standard、Optional 和 Extra。更多关于此方面的知识参考后续的 Debian 文章。 -这是必要的,因为 Debian 在很多环境中被用作服务器,人们已经变得依赖 Debian。他们同样看重升级周期是否有破环,因此他们寻找人们来测试,来查看当升级的时候是否有破坏并通知 Debian 这样的问题。 +这是必要的,因为 Debian 在很多环境中被用作服务器,人们已经变得依赖 Debian。他们同样看重升级周期是否有破环,因此他们寻找人们来测试,来查看当升级的时候是否有破坏并通知 Debian 有这样的问题。 这种提交方式带来的稳定性[是我喜欢 Debian 的众多原因之一][4]。 -这里是在即将到来的主要的 Debian 发布版的少量的视觉上的改变和内部的改变。 +### Debian 10 Buster 版本的新内容 + +这里是即将到来的 Debian 主要发布版的一些视觉上和内部的改变。 #### 新的主题和壁纸 @@ -32,87 +34,86 @@ Buster 的 Debian 主题被称为 [FuturePrototype][5] 并且看起来如下图 ![Debian Buster FuturePrototype Theme][6] -#### 1\. GNOME 桌面 3.30 +#### 1、GNOME 桌面 3.30 -Debian Stretch 版中的 GNOME 桌面在 Buster 中从 1.3.22 升级到了 1.3.30。在 GNOME 桌面发布版中新包含的一些包是 gnome-todo, tracker 替代了 tracker-gui,gstreamer1.0-packagekit 的依赖,因此可以通过自动地编码解码器安装来做播放电影之类的事。对于所有包来说一个大的改变是从 libgtk2+ 到 libgtk3+。 +Debian Stretch 版中的 GNOME 桌面在 Buster 中从 1.3.22 升级到了 1.3.30。在 GNOME 桌面发布版中新包含的一些包是 gnome-todo、tracker 替代了 tracker-gui、gstreamer1.0-packagekit 的依赖,因此可以通过自动地安装编码解码器来做播放电影之类的事。对于所有包来说一个大的改变是从 libgtk2+ 到 libgtk3+。 -#### 2\. Linux 内核 4.19.0-4 +#### 2、Linux 内核 4.19.0-4 -Debian 使用 LTS 内核版本,因此你可以期待更好的硬件支持和长达5年的维持和 Debian 的支持周期。我们已经从内核 4.9.0.3 到 4.19.0-4。 +Debian 使用 LTS 内核版本,因此你可以期待更好的硬件支持和长达 5 年的维护和支持周期。我们已经从内核 4.9.0.3 到 4.19.0-4。 ``` $ uname -r 4.19.0-4-amd64 ``` -#### 3\. OpenJDK 11.0 +#### 3、OpenJDK 11.0 -Debian 在很长时间里都是 OpenJDK 8.0。现在在 Debian Buster 里我们已经升级为 OpenJDK 11.0 并且会有一个团队维护新的版本。 +Debian 在很长时间里都是 OpenJDK 8.0。现在在 Debian Buster 里我们已经升级为 OpenJDK 11.0,并且会有一个团队维护新的版本。 -#### 4\. 默认地允许 AppArmor +#### 4、默认启用 AppArmor -在 Debian Buster 中 [AppArmor][7] 默认是允许地。这是一个好事,谨慎是系统管理员必须考虑的事来允许正确的策略。这仅仅是第一步并且可能需要修复很多对用户来说与预期一样有用的脚本。 +在 Debian Buster 中是默认启用 [AppArmor][7] 的。这是一个好事,谨慎是系统管理员必须采取的正确策略。这仅仅是第一步,并且可能需要修复很多对用户觉得有用的脚本。 -#### 5\. Nodejs 10.15.2 +#### 5、Nodejs 10.15.2 -在很长一段时间里 Debian 在仓库中都只有 Nodejs 4.8。这这个周期里 Debian 已经移到 Nodejs 10.15.2。事实上,Debian Buster 有很多 javascript 库例如 yarnpkg (一个 nmp 的替代品)和很多其它的。 +在很长一段时间里 Debian 在仓库中都只有 Nodejs 4.8。在这个周期里 Debian 已经移到 Nodejs 10.15.2。事实上,Debian Buster 有很多 javascript 库例如 yarnpkg (一个 nmp 的替代品)等等。 -当然,你可以从项目仓库中[在 Debian 中安装最新的 Nodejs][8],但是从 Debian 仓库中看到更新的版本是很棒的。 +当然,你可以从该项目仓库[在 Debian 中安装最新的 Nodejs][8],但是从 Debian 仓库中看到更新的版本是很棒的。 -#### 6\. NFtables 替代了 iptables +#### 6、NFtables 替代了 iptables -Debian Buster 提供了 nftables 作为 iptables 的完整替代,因为它有更好的更简单的语法,更好的支持双栈 ipv4-v6 防火墙并且还有更多。 +Debian Buster 提供了 nftables 来完整地替代了 iptables,因为它有更好、更简单的语法,更好的支持双栈 ipv4/v6 防火墙等等。 -#### 7\. 支持更多的 ARM 64 和 ARMHF 的单片机。 +#### 7、支持更多的 ARM 64 和 ARMHF 的单板机。 -Debian 已经支持一些常见的新的单片机,在这些之间最新的是 pine64_plus,ARM64 的 pinebook,Firefly-RK3288, ARMHF 64 的 u-boot-rockchip 和 Odroid - HC1/HC2 板,SolidRun Cubox-i 双核/四核 (1.5som),和 SolidRun Cubox-i 双核/四核 (1.5som+emmc)板,Cubietruckplus。同样支持 Rock 64,Banana Pi M2 Berry,Pine A64 LTS Board, Olimex A64 Teres-1 与 Rapberry Pi 1,Zero 和 Pi 3。对于 RISC-V 系统同样支持开箱即用。 +Debian 已经支持一些常见的新的单板机,其中最新的包括 pine64_plus、ARM64 的 pinebook、Firefly-RK3288、ARMHF 64 的 u-boot-rockchip 以及 Odroid HC1/HC2 板、SolidRun Cubox-i 双核/四核(1.5som)和 SolidRun Cubox-i 双核/四核(1.5som+emmc)板、Cubietruckplus 等。同样支持 Rock 64、Banana Pi M2 Berry、Pine A64 LTS Board、Olimex A64 Teres-1 与 Rapberry Pi 1、Zero 和 Pi 3。对于 RISC-V 系统同样支持开箱即用。 - #### 8\. Python 2 死了,Python 3 长期存活 +#### 8、Python 2 已死,Python 3 长存 - 在 2020 年 1 月 1 日,Python 2 将被 python.org 遗弃。在 Debian 将所有的软件包从 Python 2.7 移到 Python 3 以后,Python 2.7 将从软件仓库中移除。这可能发生在 Buster 发布版或者将来的某个发布版,这是即将来临的。因此 Python 开发者被鼓励移植他们的代码库来兼容 Python 3。在写的时候,在 Debian Buster 中同时支持 python2 和 pythone3。 +在 2020 年 1 月 1 日,Python 2 将被 python.org 废弃。在 Debian 将所有的软件包从 Python 2.7 移到 Python 3 以后,Python 2.7 将从软件仓库中移除。这可能发生在 Buster 发布版或者将来的某个发布版,这是肯定要来临的。因此 Python 开发者被鼓励移植他们的代码库来兼容 Python 3。在写本文的时候,在 Debian Buster 中同时支持 python2 和 pythone3。 - #### 9\. Mailman 3 +#### 9、Mailman 3 - 在 Debian 中最终可以获得 Mailman3。同时 [Mailman][10] 已经被细分成为组件。为了安装整个软件栈,安装 mailman3-full 来获取所有组件。 +在 Debian 中终于可以使用 Mailman3 了。同时 [Mailman][10] 已经被细分成为组件。要安装整个软件栈,可以安装 mailman3-full 来获取所有组件。 - #### 10\. 任意已存在的 Postgresql 数据库将被重新索引 +#### 10、任意已有的 Postgresql 数据库将需要重新索引 - 由于 glibc 本地数据的更新,放入文本索引中的信息排序的方式将会改变,因为重新索引是有益的,这样在将来就不会有数据破坏发生。 +由于 glibc 本地数据的更新,放入文本索引中的信息排序的方式将会改变,因为重新索引是有益的,这样在将来就不会有数据破坏发生。 - #### 11\. 默认的 Bash 5.0 +#### 11、默认 Bash 5.0 - 你可能已经了解了 [Bash 5.0 的新特点][11],在 Debian 中已经是该版本了。 +你可能已经了解了 [Bash 5.0 的新特点][11],在 Debian 中已经是该版本了。 - #### 12\. Debian 实现 /usr/merge +#### 12、Debian 实现 /usr/merge - /user/merge 带来的一个优秀的自由桌面[初级读物][12]已经被分享了。有一些事项需要注意。当 Debian 想要做整个过度时,可能由于未预见的情况,一些文件可能并没有做这些改变。有一点需要注意的是,/var 和 /etc 将不被干涉,因此使用容器或者云的不需要考虑太多 :)。 +我们已经分享过一个优秀的 freedesktop [读物][12],介绍了 `/usr/merge` 带来了什么。有一些事项需要注意。当 Debian 想要整个过渡时,可能由于未预见的情况,一些二进制文件可能并没有做这些改变。需要指出的一点是,`/var` 和 `/etc` 不会被触及,因此使用容器或者云技术的不需要考虑太多 :)。 - #### 13\. 安全启动支持 +#### 13、支持安全启动 - 在 Buster RC1 中,Debian 现在支持安全启动。意味着有安全启动位并且打开的机器应该能够轻松安装 Debian。不再需要禁止或者处理安全启动的事 :) +在 Buster RC1 中,Debian 现在支持安全启动secure-boot。这意味着打开了安全启动设置的机器应该能够轻松安装 Debian。不再需要禁止或者处理安全启动的事 :) - #### \14. Debian-Live 镜像的 Calameres Live-installer +#### 14、Debian-Live 镜像的 Calameres Live-installer - 对于 Debian buster 来说,Debian Live,Debian 引入了 [Calameres 安装器][13]来替代老的 debian-installer。当 Debian-安装器 比 Calameres 有更多特点时,对于初学者,Calameres 相对于 debian-installer 提供了可替换的一个全新的安装方式。安装国政的一些截图。 +对于 Debian Buster 的 Live 版,Debian 引入了 [Calameres 安装器][13]来替代老的 Debian-installer。Debian-installer 比 Calameres 功能更多,但对于初学者,Calameres 相对于 Debian-installer 提供了另外一种全新的安装方式。安装过程的截图: - ![Calamares Partitioning Stage][14] +![Calamares Partitioning Stage][14] - 如图所见,在 Calamares 下安装 Debian 相当简单,只要经历 5 步骤你就能在你的终端上安装 Debian。 +如图所见,在 Calamares 下安装 Debian 相当简单,只要经历 5 个步骤你就能在你的机器上安装 Debian。 ### 下载 Debian 10 Live 镜像 (只用于测试) -现在还不要将它用于生产机器。在测试机上尝试或者一个虚拟机。 +现在还不要将它用于生产机器。可以在测试机上尝试或者一个虚拟机。 -你可以获取 Debian 64-bit 和 32 位的镜像从 Debian Live [目录][15]。如果你想要 64-bit 的进入 64-bit 目录,如果你想要 32-bit 的,你可以进入 32-bit 目录。 +你可以从 Debian Live [目录][15]获取 Debian 64 位和 32 位的镜像。如果你想要 64 位的就进入 `64-bit` 目录,如果你想要 32 位的,就进入 `32-bit` 目录。 -[Debian 10 Buster Live Images][15] +- [下载 Debian 10 Buster Live Images][15] -如果你从已存在的稳定版升级并且一些东西被破坏,查看它是否在[升级报告][16]中报道,使用预安装的包 [reportbug][17] 报告你看到的问题。如果 bug 没有在包中被报道,那么请尽可能地报告和分享更多地信息。 +如果你从已存在的稳定版升级并且出现了一些问题,查看它是否在预安装的[升级报告][16]中提及了,使用 [reportbug][17] 报告你看到的问题。如果 bug 没有被报告,那么请尽可能地报告和分享更多地信息。 -**总结** +### 总结 -当上千个包被升级时,在视觉上是不可能全部列出的。我已经列出了一些你在 Debian buster 可以找到的一些主要的改变。你怎么看呢? +当上千个包被升级时,看起来不可能一一列出。我已经列出了一些你在 Debian Buster 可以找到的一些主要的改变。你怎么看呢? -------------------------------------------------------------------------------- @@ -120,8 +121,8 @@ via: https://itsfoss.com/new-features-coming-to-debian-10-buster-release/ 作者:[Shirish][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From dcde84c9b0687d5e43eaeb97fd16f8fa2c4cf4a8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 28 Apr 2019 12:14:42 +0800 Subject: [PATCH 0181/1154] PUB:20190420 New Features Coming to Debian 10 Buster Release.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @warmforg 本文首发地址: https://linux.cn/article-10790-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/warmfrog 请注册领取 LCCN: https://lctt.linux.cn/ --- ...0190420 New Features Coming to Debian 10 Buster Release.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190420 New Features Coming to Debian 10 Buster Release.md (99%) diff --git a/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md b/published/20190420 New Features Coming to Debian 10 Buster Release.md similarity index 99% rename from translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md rename to published/20190420 New Features Coming to Debian 10 Buster Release.md index 368d1cde72..83e9c640bd 100644 --- a/translated/tech/20190420 New Features Coming to Debian 10 Buster Release.md +++ b/published/20190420 New Features Coming to Debian 10 Buster Release.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10790-1.html) [#]: subject: (New Features Coming to Debian 10 Buster Release) [#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) [#]: author: (Shirish https://itsfoss.com/author/shirish/) From c1786ee342887595c10bc62bf7a78ccabc4904b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 13:41:52 +0800 Subject: [PATCH 0182/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... To Check The Default Gateway Or Router IP Address In Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md (100%) diff --git a/sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md similarity index 100% rename from sources/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md rename to translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md From 17fa028a1387527938dbd6eb878a746c0a2c3a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 13:48:15 +0800 Subject: [PATCH 0183/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t Gateway Or Router IP Address In Linux.md | 67 ++++++++++--------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md index 233cd8ef74..f2cf168fcb 100644 --- a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md +++ b/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -7,42 +7,42 @@ [#]: via: (https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Four Methods To Check The Default Gateway Or Router IP Address In Linux? -====== +在 Linux 中检查默认网关或者路由 IP 地址的四个方法? +============================================== -Your default gateway is the IP address of your router that you should aware of that. +你应该意识到你的默认网关是你的路由器的 IP 地址。 -Typically this is automatically detected by your operating system during installation, if not then you may need to change it. +典型地这是在安装过程中由操作系统自动检测的,如果没有,你可能需要改变它。 -If your system not able to ping self then probable it could be a gateway issue and you have to fix it. +如果你的系统不能 ping 自身,那么很可能是一个网关问题,你必须修复它。 -This might happen if you have multiple network adapters or routers on the network. +在网络中,当你有多个网络适配器或路由器时,这种情况可能会发生。 -A gateway is a router that acts as an access point to passes network data from one networks to another networks. +一个网关是一个路由器扮演着一个入口点角色,从一个网络传递网络数据到另一个网络。 -The below articles will help you to gather some other information which is similar to this topic. +下面是一些可能帮助你收集到的与该话题相似的一些信息。 * **[9 Methods To Check Your Public IP Address In Linux Command Line][1]** * **[How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?][2]** -This can be done using below Four commands. +这可以通过下面的四个命令完成。 - * **`route Command:`** route command is used to show and manipulate the IP routing table. - * **`ip Command:`** IP command is similar to ifconfig, which is very familiar for assigning Static IP Address, Route & Default Gateway, etc.,. - * **`netstat Command:`** netstat (“network statistics”) is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface - * **`routel Command:`** routel command is used to list routes with pretty output format. +* **`route 命令`** route 命令被用来显示和操作 IP 路由表。 +* **`ip 命令:`** IP 命令类似于 ifconfig, 非常熟悉赋值静态 IP 地址,路由 & 默认网关,等等。 +* **`netstat 命令`** netstat (“network statistics”)是一个命令行工具来显示网络连接相关的信息(包括入口和出口的)例如路由表,伪装连接,多播成员和很多网络接口。 +* **`routel 命令`** routel 命令被用来以好看的输出格式列出路由。 -### 1) How To Check The Default Gateway Or Router IP Address In Linux Using route Command? +### 1)在 Linux 中如何使用 route 命令检查默认的网关或者路由 IP 地址? -route command is used to show and manipulate the IP routing table. +route 命令被用来显示和操作 IP 路由表。 -Its primary use is to set up static routes to specific hosts or networks via an interface once the interface was configured. +它主要用于通过一个已经配置的接口给特定的主机或者网络设置静态的路由。 -When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables. +当 add 或者 del 选项被使用时,route 修改路由表。没有这些选项,route 显示路由表的当前内容。 ``` # route @@ -55,17 +55,17 @@ default www.routerlogin 0.0.0.0 UG 600 0 0 wlp8s0 192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp8s0 ``` -### 2) How To Check The Default Gateway Or Router IP Address In Linux Using ip Command? +### 2)如何在 Linux 中使用 ip 命令检查默认网关或者路由 IP 地址? -**[IP command][3]** is similar to ifconfig, which is very familiar for assigning Static IP Address, Route & Default Gateway, etc.,. +**[IP 命令][3]** 相似于 ifconfig,非常熟悉配置静态 IP 地址,路由 & 默认网关,等等。 -ifconfig command was deprecated due to no maintenance since so many years, even though it is still available on most Linux distributions. +ifconfig 命令因为多年没有维持被遗弃了,即使它仍然在大多数 Linux 分发版上可获得。 -ifconfig command has been replaced by IP command which is very powerful and performing several network administration tasks with one command. +ifconfig 命令已经被 IP 命令替代了,IP 命令是非常强大的,只要一个命令就能执行几个网络管理任务。 -IP command utility bundled with iproute2 package. By default iproute2 utility pre-installed all the major Linux distribution. +IP 命令工具附带在 iproute2 包中。默认 iproute2 预安装在主要的 Linux 分发版中。 -If no, you can install it by issuing iproute2 on your terminal with help of package manager. +如果没有,你可以在你的终端中在包管理器的帮助下通过输入 iproute2 并安装它。 ``` # ip r @@ -78,13 +78,13 @@ default via 192.168.1.1 dev wlp8s0 proto dhcp metric 600 192.168.1.0/24 dev wlp8s0 proto kernel scope link src 192.168.1.6 metric 600 ``` -### 3) How To Check The Default Gateway Or Router IP Address In Linux Using netstat Command? +### 3)如何在 Linux 中使用 netstat 命令检查默认网关或者路由 IP 地址? -netstat stands for Network Statistics, is a command-line tool that displays network connections related information (both incoming and outgoing) such as routing tables, masquerade connections, multicast memberships and a number of network interface. +netstat 代表 Network Statistics,是一个命令行工具来显示网络连接相关的信息(包括入口和出口的)例如路由表,伪装连接,多播成员和很多网络接口。 -It lists out all the tcp, udp socket connections and the unix socket connections. +它列出所有的 tcp, udp 套接字连接和 unix 套接字连接。 -It is used for diagnosing network problems in the network and to determine the amount of traffic on the network as a performance measurement. +它在网络中被用来诊断网络问题并判断网络中的交通总量来作为性能测量指标。 ``` # netstat -r @@ -95,13 +95,13 @@ default www.routerlogin 0.0.0.0 UG 0 0 0 wlp8s0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp8s0 ``` -### 4) How To Check The Default Gateway Or Router IP Address In Linux Using routel Command? +### 4)如何在 Linux 中使用 routel 命令检查默认网关或者路由 IP 地址? -It used to list routes with pretty output format. These programs are a set of helper scripts you can use instead of raw iproute2 commands. +它用来以好看的输出格式列出路由信息。这些程序是一系列你可以用来替代 iproute2 的帮助脚本。 -The routel script will list routes in a format that some might consider easier to interpret then the ip route list equivalent. +routel 脚本以一种被认为更容易解释并且等价于 route 输出列表的格式来输出路由信息。 -The routef script does not take any arguments and will simply flush the routing table down the drain. Beware! This means deleting all routes which will make your network unusable! +如果 routef 脚本不加任何参数,将仅仅简单的将路由表清空。小心!这意味着删除所有的路由,让你的网络不再可用。 ``` # routel @@ -122,7 +122,8 @@ fe80::ad00:2f7e:d882:5add local kernel w ff00::/ 8 wlp8s0 local ``` -If you would like to print only default gateway then use the following format. +如果你只想打印默认的网关那么使用下面的格式。 + ``` # routel | grep default @@ -135,7 +136,7 @@ via: https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[warmfrog](https://github.com/warmfrog) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e62b72889aa907fc8a171ddb2ac8431f1ef3fdde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 28 Apr 2019 14:20:36 +0800 Subject: [PATCH 0184/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md index 494f85923f..96e0b520cd 100644 --- a/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md +++ b/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f205a543d0c7c79fbb658fbc04c3052455dc08a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Mon, 29 Apr 2019 00:09:31 +0800 Subject: [PATCH 0185/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=86=85=E5=AE=B91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...art a Network in Ubuntu -Beginner-s Tip.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 3217d1cb5e..790c990dfa 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -7,30 +7,30 @@ [#]: via: (https://itsfoss.com/restart-network-ubuntu) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) -How to Restart a Network in Ubuntu [Beginner’s Tip] +如何在 Ubuntu 中重启网络服务 [新手提示] ====== -You’re [using an Ubuntu-based system and you just can’t seem to connect to your network][1]? You’d be surprised how many problems can a simple restart fix. +你 [using an Ubuntu-based system and you just can’t seem to connect to your network][1]? 你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决. -In this article, I’ll go over multiple ways you can restart network in Ubuntu and other Linux distributions, so you can use whatever suits your needs. The methods are basically divided into two parts: +在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络服务的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: ![Ubuntu Restart Network][2] -### Restart network in Ubuntu using command line +### 通过命令行方式重启网络 -If you are using Ubuntu server edition, you are already in the terminal. If you are using the desktop edition, you can access the terminal using Ctrl+Alt+T [keyboard shortcut in Ubuntu][3]. +如果你使用的 Ubuntu 服务器版,那么你已经在使用命令行终端了。如果你使用的是桌面版,那么你可以通过快捷键 Ctrl+Alt+T [Ubuntu 键盘快捷键][3] 打开命令行终端。 -Now you have several commands at your disposal to restart network in Ubuntu. Some (or perhaps most) commands mentioned here should be applicable for restarting network in Debian and other Linux distributions as well. +在 Ubuntu 中,你有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 #### 1\. network manager service -This is the easiest way to restart your network using the command line. It’s equivalent to the graphical way of doing it (restarts the Network-Manager service). +这是通过命令行方式重启网络最简单的方法. 它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 ``` sudo service network-manager restart ``` -The network icon should disappear for a moment and then reappear. +此时,网络图标会消失一会儿然后重新显示。 #### 2\. systemd @@ -40,29 +40,29 @@ The **service** command is just a wrapper for this method (and also for init.d s sudo systemctl restart NetworkManager.service ``` -The network icon (again) should disappear for a moment. To check out other **systemctl** options, you can refer to its man page. +这是,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考帮助文档(man page). #### 3\. nmcli -This is yet another tool for handling networks on a Linux machine. It is a pretty powerful tool that I find very practical. Many sysadmins prefer it since it is easy to use. +这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为很容易使用。 -There are two steps to this method: turning the network off, and then turning it back on. +这种方法有两个操作步骤:关闭网络,重新开启网络。 ``` sudo nmcli networking off ``` -The network will shut down and the icon will disappear. To turn it back on: +这样就会关闭网络,网络图标会消失。接下来,再开启网络: ``` sudo nmcli networking on ``` -You can check out the man page of nmcli for more options. +你可以通过帮助文档(man page)了解 nmcli 的更多使用方法。 #### 4\. ifup & ifdown -This commands handle a network interface directly, changing it’s state to one in which it either can or can not transmit and receive data. It’s one of the [must know networking commands in Linux][4]. +这两个命令是直接操作网卡,, changing it’s state to one in which it either can or can not transmit and receive data. It’s one of the [must know networking commands in Linux][4]. To shut down all network interfaces, use ifdown and then use ifup to turn all network interfaces back on. @@ -82,7 +82,7 @@ This is another method often used by system administrators. It is a text menu fo nmtui ``` -This should open up the following menu: +这样会打开如下菜单: ![nmtui Menu][5] @@ -112,23 +112,23 @@ Press **Enter**. This should reactivate the selected connection. ![nmtui Connections Menu][11] -Press **Tab** twice to select **Back** : +双击 **Tab** 键,选择到 **Back** : ![Select "Back" in the nmtui connections menu.][12] -Press **Enter**. This should bring you back to the **nmtui** main menu. +按下 **Enter**。这样就会回到 **nmtui** 主菜单。 ![nmtui Main Menu][13] -Select **Quit** : +选择 **Quit** : ![nmtui Quit Main Menu][14] -This should exit the application and bring you back to your terminal. +这样就会退出该界面,返回到命令行终端。 -That’s it! You have successfully restarted your network +就这样,你已经成功重启网络了。 -### Restart network in Ubuntu graphically +### 通过图形化界面重启网络 This is, of course, the easiest way of restarting the network for Ubuntu desktop users. If this one doesn’t work, you can of course check the command line options mentioned in the previous section. From 2ae231ba25284999998c424a54d7572e920517cd Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Apr 2019 08:43:17 +0800 Subject: [PATCH 0186/1154] translated --- ... the weather with Python and Prometheus.md | 98 ------------------- ... the weather with Python and Prometheus.md | 97 ++++++++++++++++++ 2 files changed, 97 insertions(+), 98 deletions(-) delete mode 100644 sources/tech/20190422 Tracking the weather with Python and Prometheus.md create mode 100644 translated/tech/20190422 Tracking the weather with Python and Prometheus.md diff --git a/sources/tech/20190422 Tracking the weather with Python and Prometheus.md b/sources/tech/20190422 Tracking the weather with Python and Prometheus.md deleted file mode 100644 index 884853c42c..0000000000 --- a/sources/tech/20190422 Tracking the weather with Python and Prometheus.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Tracking the weather with Python and Prometheus) -[#]: via: (https://opensource.com/article/19/4/weather-python-prometheus) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Tracking the weather with Python and Prometheus -====== -Create a custom Prometheus integration to keep track of the biggest -cloud provider of all: Mother Earth. -![Tree clouds][1] - -Open source monitoring system [Prometheus][2] has integrations to track many types of time-series data, but if you want an integration that doesn't yet exist, it's easy to build one. An often-used example is a custom integration with a cloud provider that uses the provider's APIs to grab specific metrics. In this example, though, we will integrate with the biggest cloud provider of all: Earth. - -Luckily, the US government already measures the weather and provides an easy API for integrations. Getting the weather forecast for the next hour at Red Hat headquarters is simple. - - -``` -import requests -HOURLY_RED_HAT = "" -def get_temperature(): -result = requests.get(HOURLY_RED_HAT) -return result.json()["properties"]["periods"][0]["temperature"] -``` - -Now that our integration with Earth is done, it's time to make sure Prometheus can understand what we are saying. We can use the [Prometheus Python library][3] to create a registry with one _gauge_ : the temperature at Red Hat HQ. - - -``` -from prometheus_client import CollectorRegistry, Gauge -def prometheus_temperature(num): -registry = CollectorRegistry() -g = Gauge("red_hat_temp", "Temperature at Red Hat HQ", registry=registry) -g.set(num) -return registry -``` - -Finally, we need to connect this to Prometheus in some way. That depends a little on the network topology for Prometheus: whether it is easier for Prometheus to talk to our service, or whether the reverse is easier. - -The first case is the one usually recommended, if possible, so we need to build a web server exposing the registry and then configure Prometheus to _scrape_ it. - -We can build a simple web server with [Pyramid][4]. - - -``` -from pyramid.config import Configurator -from pyramid.response import Response -from prometheus_client import generate_latest, CONTENT_TYPE_LATEST -def metrics_web(request): -registry = prometheus_temperature(get_temperature()) -return Response(generate_latest(registry), -content_type=CONTENT_TYPE_LATEST) -config = Configurator() -config.add_route('metrics', '/metrics') -config.add_view(metrics_web, route_name='metrics') -app = config.make_wsgi_app() -``` - -This can be run with any Web Server Gateway Interface (WSGI) server. For example, we can use **python -m twisted web --wsgi earth.app** to run it, assuming we put the code in **earth.py**. - -Alternatively, if it is easier for our code to connect to Prometheus, we can push it to Prometheus's [Push gateway][5] periodically. - - -``` -import time -from prometheus_client import push_to_gateway -def push_temperature(url): -while True: -registry = prometheus_temperature(get_temperature()) -push_to_gateway(url, "temperature collector", registry) -time.sleep(60*60) -``` - -The URL is the one for the Push gateway; it often ends in **:9091**. - -Good luck building your own custom Prometheus integration so you can track all the things! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/weather-python-prometheus - -作者:[Moshe Zadka ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds) -[2]: https://prometheus.io/ -[3]: https://github.com/prometheus/client_python -[4]: https://trypyramid.com/ -[5]: https://github.com/prometheus/pushgateway diff --git a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md new file mode 100644 index 0000000000..8e906250cc --- /dev/null +++ b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tracking the weather with Python and Prometheus) +[#]: via: (https://opensource.com/article/19/4/weather-python-prometheus) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +使用 Python 和 Prometheus 跟踪天气 +====== +创建自定义 Prometheus 集成以跟踪最大的云提供者:地球母亲。 +![Tree clouds][1] + +开源监控系统 [Prometheus][2] 有跟踪多种类型的时间序列数据的集成,但如果不存在你想要的集成,那么很容易构建一个。一个经常使用的例子使用云提供商的自定义集成,它使用提供商的 API 抓取特定的指标。但是,在这个例子中,我们将与最大云提供商集成:地球。 + +幸运的是,美国政府已经测量了天气并为集成提供了一个简单的 API。获取红帽总部下一个小时的天气预报很简单。 + + +``` +import requests +HOURLY_RED_HAT = "" +def get_temperature(): + result = requests.get(HOURLY_RED_HAT) + return result.json()["properties"]["periods"][0]["temperature"] +``` + +现在我们已经完成了与地球的整合,现在是确保 Prometheus 能够理解我们想要内容的时候了。我们可以使用 [Prometheus Python 库][3]中的 _gauge_ 创建一个注册:红帽总部的温度。 + + +``` +from prometheus_client import CollectorRegistry, Gauge +def prometheus_temperature(num): + registry = CollectorRegistry() + g = Gauge("red_hat_temp", "Temperature at Red Hat HQ", registry=registry) + g.set(num) + return registry +``` + +最后,我们需要以某种方式将它连接到 Prometheus。这有点依赖 Prometheus 的网络拓扑:Prometheus 与我们的服务通信更容易,还是反向更容易。 + +第一种是通常建议的情况,如果可能的话,我们需要构建一个公开注册入口的 Web 服务器,并配置 Prometheus _收刮_(scrape)它。 + +我们可以使用 [Pyramid][4] 构建一个简单的 Web 服务器。 + + +``` +from pyramid.config import Configurator +from pyramid.response import Response +from prometheus_client import generate_latest, CONTENT_TYPE_LATEST +def metrics_web(request): + registry = prometheus_temperature(get_temperature()) + return Response(generate_latest(registry), + content_type=CONTENT_TYPE_LATEST) +config = Configurator() +config.add_route('metrics', '/metrics') +config.add_view(metrics_web, route_name='metrics') +app = config.make_wsgi_app() +``` + +这可以使用任何 Web 网关接口 (WSGI) 服务器运行。例如,假设我们将代码放在 **earth.py** 中,我们可以使用 **python -m twisted web --wsgi earth.app** 来运行它。 + +或者,如果我们的代码连接到 Prometheus 更容易,我们可以定期将其推送到 Prometheus 的[推送网关][5]。 + + +``` +import time +from prometheus_client import push_to_gateway +def push_temperature(url): +while True: +registry = prometheus_temperature(get_temperature()) +push_to_gateway(url, "temperature collector", registry) +time.sleep(60*60) +``` + +URL 是推送网关的 URL。它通常以 **:9091** 结尾。 + +祝你构建自定义 Prometheus 集成成功,以便跟踪一切! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/weather-python-prometheus + +作者:[Moshe Zadka ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds) +[2]: https://prometheus.io/ +[3]: https://github.com/prometheus/client_python +[4]: https://trypyramid.com/ +[5]: https://github.com/prometheus/pushgateway From 7c458f5b704ebac94f56b8a8fec032442b9c41a4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Apr 2019 08:45:52 +0800 Subject: [PATCH 0187/1154] translated --- ...422 Tracking the weather with Python and Prometheus.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md index 8e906250cc..0acfb240ef 100644 --- a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md +++ b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md @@ -67,10 +67,10 @@ app = config.make_wsgi_app() import time from prometheus_client import push_to_gateway def push_temperature(url): -while True: -registry = prometheus_temperature(get_temperature()) -push_to_gateway(url, "temperature collector", registry) -time.sleep(60*60) + while True: + registry = prometheus_temperature(get_temperature()) + push_to_gateway(url, "temperature collector", registry) + time.sleep(60*60) ``` URL 是推送网关的 URL。它通常以 **:9091** 结尾。 From 317374381d9c5fe2d9550b5f0639d4300f637dfe Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Apr 2019 08:51:17 +0800 Subject: [PATCH 0188/1154] new --- ...vironment-friendly open software projects you should know.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190422 8 environment-friendly open software projects you should know.md b/sources/tech/20190422 8 environment-friendly open software projects you should know.md index 0c56347440..11885c8d2a 100644 --- a/sources/tech/20190422 8 environment-friendly open software projects you should know.md +++ b/sources/tech/20190422 8 environment-friendly open software projects you should know.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 648721774cf5422ed7bddbbca1aeac56d11c5bde Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 29 Apr 2019 10:25:10 +0800 Subject: [PATCH 0189/1154] PRF:20180718 3 Emacs modes for taking notes.md @lujun9972 --- ...20180718 3 Emacs modes for taking notes.md | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/translated/tech/20180718 3 Emacs modes for taking notes.md b/translated/tech/20180718 3 Emacs modes for taking notes.md index 0ec05b8674..d6626be8ba 100644 --- a/translated/tech/20180718 3 Emacs modes for taking notes.md +++ b/translated/tech/20180718 3 Emacs modes for taking notes.md @@ -1,53 +1,56 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 Emacs modes for taking notes) [#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) -用来记笔记的三个 Emacs modes +用来记笔记的三个 Emacs 模式 ====== -借助这些 Emacs mode 轻松记录信息。 + +> 借助这些 Emacs 模式轻松记录信息。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/notebook-writing-pen.jpg?itok=uA3dCfu_) 不管你从事哪种工作,你都无可避免地需要记笔记。而且可能还不是一点点。现在这年头,大家都开始以数字的形式来记笔记了。 -开源软件爱好者有多种途径来以电子的方式记下他们的创意,想法和研究过程。你可以使用 [网页工具 ][[1]]。你可以使用 [桌面应用 ][2]。或者,你也可以 [使用命令行工具 ][3]。 +开源软件爱好者有多种途径来以电子的方式记下他们的创意、想法和研究过程。你可以使用 [网页工具][1],可以使用 [桌面应用][2],或者你也可以 [使用命令行工具][3]。 -如果你使用 [Emacs][4]( 伪装成文本编辑器的强力操作系统),有多个 mode 可以帮你有效地记录笔记。我们这里列举三个例子。 +如果你使用 [Emacs][4](伪装成文本编辑器的强力操作系统),有多个模式mode可以帮你有效地记录笔记。我们这里列举三个例子。 ### Deft + ![](https://opensource.com/sites/default/files/uploads/deft.png) -在少数情况下,我被迫需要使用 Mac,有一个工具是我不能缺少的:[nvALT][5] 笔记应用。[Deft mode][6] 为 Emacs 带来了 nvALT 式的体验。 +在少数情况下,我只能使用 Mac时,有一个工具是我不能缺少的:[nvALT][5] 笔记应用。[Deft 模式][6] 为 Emacs 带来了 nvALT 式的体验。 -Deft 将你的笔记以文本文件的形式存储在电脑中的某个文件夹中。当你进入 Deft mode,你会看到一系列的笔记及其摘要。这些摘要其实就是文本文件的第一行。若第一行是 Markdown,LaTeX,甚至 Emacs Org mode 格式的话,Deft 会忽略掉这些格式而只显示文本内容。 +Deft 将你的笔记以文本文件的形式存储在电脑中的某个文件夹中。当你进入 Deft 模式,你会看到一系列的笔记及其摘要。这些摘要其实就是文本文件的第一行。若第一行是 Markdown、LaTeX,甚至 Emacs Org 模式的格式的话,Deft 会忽略掉这些格式而只显示文本内容。 -要打开笔记,只需要向下滚动到该笔记的位置然后按下回车即可。然而 Deft 不仅仅只是这样。根据 Deft 开发者 Jason Blevins 的说法,它的 /主要操作时搜索和过滤/。 -Deft 的实现方式简单而有效。输入关键字然后 Deft 会只显示标题中包含关键字的笔记。这在你要从大量笔记中找到某条笔记时非常有用。 +要打开笔记,只需要向下滚动到该笔记的位置然后按下回车即可。然而 Deft 不仅仅只是这样。根据 Deft 开发者 Jason Blevins 的说法,它的*主要操作是搜索和过滤*。Deft 的实现方式简单而有效。输入关键字然后 Deft 会只显示标题中包含关键字的笔记。这在你要从大量笔记中找到某条笔记时非常有用。 + +### Org 模式 -### Org mode ![](https://opensource.com/sites/default/files/uploads/orgmode.png) -如果本文没有包含 [Org mode][7] 的话,那么我可能会被人所诟病。为什么?它可以说是 Emacs 中最灵活、使用最广泛的记录笔记的方式了。以正确的方式使用它,Org mode 可以极大地增强记笔记的能力。 +如果本文没有包含 [Org 模式][7] 的话,那么我可能会被人所诟病。为什么?它可以说是 Emacs 中最灵活、使用最广泛的记录笔记的方式了。以正确的方式使用它,Org 模式可以极大地增强记笔记的能力。 -Org mode 的主要优势在于它组织笔记的方式。在 Org mode 中,一个笔记文件被组织成一个巨大的大纲。每个章节就是大纲里的一个节点,你可以对它进行展开和折叠。这些章节又可以有子章节,这些子章节也可以暂开和折叠。这不仅使你一次只关注于某个章节,而且可以让你浏览整个大纲。 +Org 模式的主要优势在于它组织笔记的方式。在 Org 模式中,一个笔记文件会被组织成一个巨大的大纲。每个章节就是大纲里的一个节点,你可以对它进行展开和折叠。这些章节又可以有子章节,这些子章节也可以展开和折叠。这不仅使你一次只关注于某个章节,而且可以让你浏览整个大纲。 -你可以在多个章节之间 [进行互联 ][8],无需通过剪切和复制就能快速移动章节,以及 [附加文件 ][9] 到笔记中。Org mode 支持带格式的字符和表格。如果你需要转换笔记到其他格式,Org mode 也有大量的[导出选项 ][10]。 +你可以在多个章节之间 [进行互联][8],无需通过剪切和复制就能快速移动章节,以及 [附加文件][9] 到笔记中。Org 模式支持带格式的字符和表格。如果你需要转换笔记到其他格式,Org 模式也有大量的[导出选项][10]。 ### Howm ![](https://opensource.com/sites/default/files/uploads/howm.png) -当我使用 Emacs 已经成为一种习惯时,[howm][11] 马上就成为我严重依赖的 mode 之一了。虽然我特别喜欢使用 Org mode,但 howm 依然占有一席之地。 +当我使用 Emacs 已经成为一种习惯时,[howm][11] 马上就成为我严重依赖的模式之一了。虽然我特别喜欢使用 Org 模式,但 howm 依然占有一席之地。 -Howm 就好像时一个小维基似得。你可以创建笔记和任务列表,还能在他们之间创建链接。通过输入或点击某个链接,你可以在笔记之间跳转。如果你需要,还可以使用关键字为笔记添加标签。不仅如此,你可以对笔记进行搜索、排序和合并。 +Howm 就好像是一个小型维基。你可以创建笔记和任务列表,还能在它们之间创建链接。通过输入或点击某个链接,你可以在笔记之间跳转。如果你需要,还可以使用关键字为笔记添加标签。不仅如此,你可以对笔记进行搜索、排序和合并。 -Howm 不是最漂亮的 Emacs mode,它也没有最好的用户体验。它需要你花一点时间来适应它。而一旦你适应了它,记录和查找笔记就是轻而易举的事情了。 +Howm 不是最漂亮的 Emacs 模式,它的用户体验也不是最佳。它需要你花一点时间来适应它,而一旦你适应了它,记录和查找笔记就是轻而易举的事情了。 -------------------------------------------------------------------------------- @@ -56,7 +59,7 @@ via: https://opensource.com/article/18/7/emacs-modes-note-taking 作者:[Scott Nesbitt][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b58631ccf74bb90d4765bf39755d88ddb2ae6525 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 29 Apr 2019 10:25:46 +0800 Subject: [PATCH 0190/1154] PUB:20180718 3 Emacs modes for taking notes.md @lujun9972 https://linux.cn/article-10792-1.html --- .../20180718 3 Emacs modes for taking notes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20180718 3 Emacs modes for taking notes.md (98%) diff --git a/translated/tech/20180718 3 Emacs modes for taking notes.md b/published/20180718 3 Emacs modes for taking notes.md similarity index 98% rename from translated/tech/20180718 3 Emacs modes for taking notes.md rename to published/20180718 3 Emacs modes for taking notes.md index d6626be8ba..234175c375 100644 --- a/translated/tech/20180718 3 Emacs modes for taking notes.md +++ b/published/20180718 3 Emacs modes for taking notes.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10792-1.html) [#]: subject: (3 Emacs modes for taking notes) [#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) From 601032f5095a71becca47b5e94c0b29ce1b82c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 10:43:00 +0800 Subject: [PATCH 0191/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nstalling Ubuntu MATE on a Raspberry Pi.md | 135 ----------------- ...nstalling Ubuntu MATE on a Raspberry Pi.md | 138 ++++++++++++++++++ 2 files changed, 138 insertions(+), 135 deletions(-) delete mode 100644 sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md create mode 100644 translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md diff --git a/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md deleted file mode 100644 index 96e0b520cd..0000000000 --- a/sources/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md +++ /dev/null @@ -1,135 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Installing Ubuntu MATE on a Raspberry Pi) -[#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/) -[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) - -Installing Ubuntu MATE on a Raspberry Pi -====== - -_**Brief: This quick tutorial shows you how to install Ubuntu MATE on Raspberry Pi devices.**_ - -[Raspberry Pi][1] is by far the most popular SBC (Single Board Computer) and the go-to board for makers. [Raspbian][2] which is based on Debian is the official operating system for the Pi. It is lightweight, comes bundled with educational tools and gets the job done for most scenarios. - -[Installing Raspbian][3] is easy as well but the problem with [Debian][4] is its slow upgrade cycles and older packages. - -Running Ubuntu on the Raspberry Pi gives you a richer experience and up to date software. We have a few options when it comes to running Ubuntu on your Pi. - - 1. [Ubuntu MATE][5] : Ubuntu MATE is the only distribution which natively supports the Raspberry Pi with a complete desktop environment. - 2. [Ubuntu Server 18.04][6] \+ Installing a desktop environment manually. - 3. Using Images built by the [Ubuntu Pi Flavor Maker][7] community, _these images only support the Raspberry Pi 2B and 3B variants_ and are **not** updated to the latest LTS release. - - - -The first option is the easiest and the quickest to set up while the second option gives you the freedom to install the desktop environment of your choice. I recommend going with either of the first two options. - -Here are the links to download the Disc Images. In this article I’ll be covering Ubuntu MATE installation only. - -### Installing Ubuntu MATE on Raspberry Pi - -Go to the download page of Ubuntu MATE and get the recommended images. - -![][8] - -The experimental ARM64 version should only be used if you need to run 64-bit only applications like MongoDB on a Raspberry Pi server. - -[Download Ubuntu MATE for Raspberry Pi][9] - -#### Step 1: Setting Up the SD Card - -The image file needs to be decompressed once downloaded. You can simply right click on it to extract it. - -Alternatively, the following command will do the job. - -``` -xz -d ubuntu-mate***.img.xz -``` - -Alternatively you can use [7-zip][10] if you are on Windows. - -Install **[Balena Etcher][11]** , we’ll use this tool to write the image to the SD card. Make sure that your SD card is at least 8 GB capacity. - -Launch Etcher and select the image file and your SD card. - -![][12] - -Once the flashing process is complete the SD card is ready. - -#### Step 2: Setting Up the Raspberry Pi - -You probably already know that you need a few things to get started with Raspberry Pi such as a mouse, keyboard, HDMI cable etc. You can also [install Raspberry Pi headlessly without keyboard and mouse][13] but this tutorial is not about that. - - * Plug in a mouse and a keyboard. - * Connect the HDMI cable. - * Insert the SD card into the SD card slot. - - - -Power it on by plugging in the power cable. Make sure you have a good power supply (5V, 3A minimum). A bad power supply can reduce the performance. - -#### Ubuntu MATE installation - -Once you power on the Raspberry Pi, you’ll be greeted with a very familiar Ubuntu installation process. The process is pretty much straight forward from here. - -![Select your keyboard layout][14] - -![Select Your Timezone][15] - -Select your WiFi network and enter the password in the network connection screen. - -![Add Username and Password][16] - -After setting the keyboard layout, timezone and user credentials you’ll be taken to the login screen after a few minutes. And voila! you are almost done. - -![][17] - -Once logged in, the first thing you should do is to [update Ubuntu][18]. You can use the command line for that. - -``` -sudo apt update -sudo apt upgrade -``` - -You can also use the Software Updater. - -![][19] - -Once the updates are finished installing you are good to go. You can also go ahead and install Raspberry Pi specific packages for GPIO and other I/O depending on your needs. - -What made you think about installing Ubuntu on the Raspberry and how has your experience been with Raspbian? Let me know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-mate-raspberry-pi/ - -作者:[Chinmay][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/chinmay/ -[b]: https://github.com/lujun9972 -[1]: https://www.raspberrypi.org/ -[2]: https://www.raspberrypi.org/downloads/ -[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ -[4]: https://www.debian.org/ -[5]: https://ubuntu-mate.org/ -[6]: https://wiki.ubuntu.com/ARM/RaspberryPi#Recovering_a_system_using_the_generic_kernel -[7]: https://ubuntu-pi-flavour-maker.org/download/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-mate-raspberry-pi-download.jpg?ssl=1 -[9]: https://ubuntu-mate.org/download/ -[10]: https://www.7-zip.org/download.html -[11]: https://www.balena.io/etcher/ -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Screenshot-from-2019-04-08-01-36-16.png?ssl=1 -[13]: https://linuxhandbook.com/raspberry-pi-headless-setup/ -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Keyboard-layout-ubuntu.jpg?fit=800%2C467&ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/select-time-zone-ubuntu.jpg?fit=800%2C468&ssl=1 -[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Credentials-ubuntu.jpg?fit=800%2C469&ssl=1 -[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?fit=800%2C600&ssl=1 -[18]: https://itsfoss.com/update-ubuntu/ -[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/update-software.png?ssl=1 diff --git a/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md new file mode 100644 index 0000000000..74d0ac4d2e --- /dev/null +++ b/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md @@ -0,0 +1,138 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing Ubuntu MATE on a Raspberry Pi) +[#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +在 Raspberry Pi 上安装 Ubuntu MATE +================================= + +_**简介: 这篇快速指南告诉你如何在 Raspberry Pi 设备上安装 Ubuntu MATE。**_ + +[Raspberry Pi][1] 是目前最流行的单板机并且是制造商的首选。[Raspbian][2] 是基于 Debian 的 Pi 的官方操作系统。它是轻量级的,内置了教育工具和能在大部分场景下完成工作的工具。 + +[安装 Raspbian][3] 安装同样简单,但是与 [Debian][4] 一起的问题是慢的升级周期和旧的软件包。 + +在 Raspberry Pi 上运行 Ubuntu 给你带来一个更丰富的体验和最新的软件。当在你的 Pi 上运行 Ubuntu 时我们有几个选择。 + + 1. [Ubuntu MATE][5] :Ubuntu MATE 是仅有的原生支持 Raspberry Pi 包含一个完整的桌面环境的分发版。 + 2. [Ubuntu Server 18.04][6] \+ 手动安装一个桌面环境。 + 3. 使用 [Ubuntu Pi Flavor Maker][7] 社区构建的镜像,_这些镜像只支持 Raspberry Pi 2B 和 3B 的变种_并且**不能**更新到最新的 LTS 发布版。 + + + + +第一个选择安装是最简单和快速的,而第二个选择给了你自由选择安装桌面环境的机会。我推荐选择前两个中的任一个。 + +这里是一些磁盘镜像下载链接。在这篇文章里我只会提及 Ubuntu MATE 的安装。 + +### 在 Raspberry Pi 上安装 Ubuntu MATE + +去 Ubuntu MATE 的下载页面获取推荐的镜像。 + +![][8] + +试验 ARM64 版只应在你需要在 Raspberry Pi 服务器上运行像 MongoDB 这样的 64-bit 应用时使用。 + +[ 下载为 Raspberry Pi 准备的 Ubuntu MATE][9] + +#### 第 1 步:设置 SD 卡 + +镜像文件一旦下载完成后需要解压。你应该简单的右击来提取它。 + +可替换地,下面命令做同样的事。 + +``` +xz -d ubuntu-mate***.img.xz +``` + +如果你在 Windows 上你可以使用 [7-zip][10] 替代。 + +安装 **[Balena Etcher][11]**,我们将使用这个工具将镜像写入 SD 卡。确保你的 SD 卡有至少 8 GB 的容量。 + +启动 Etcher,选择镜像文件和 SD 卡。 + +![][12] + +一旦进度完成 SD 卡就准备好了。 + +#### 第 2 步:设置 Raspberry Pi + +你可能已经知道你需要一些外设才能使用 Raspberry Pi 例如 鼠标,键盘, HDMI 线等等。你同样可以[不用键盘和鼠标安装 Raspberry Pi][13] 但是这篇指南不是那样。 + + * 插入一个鼠标和一个键盘。 + * 连接 HDMI 线缆。 + * 插入 SD 卡 到 SD 卡槽。 + + + +插入电源线给它供电。确保你有一个好的电源供应(5V,3A 至少)。一个不好的电源供应可能降低性能。 + +#### Ubuntu MATE 安装 + +一旦你给 Raspberry Pi 供电,你将遇到非常熟悉的 Ubuntu 安装过程。在这里的安装过程相当直接。 + +![选择你的键盘布局][14] + +![选择你的时区][15] + +选择你的 WiFi 网络并且在网络连接中输入密码。 + +![添加用户名和密码][16] + +在设置了键盘布局,时区和用户凭证后,在几分钟后你将被带到登录界面。瞧!你快要完成了。 + +![][17] + +一旦登录,第一件事你应该做的是[更新 Ubuntu][18]。你应该使用下列命令。 + +``` +sudo apt update +sudo apt upgrade +``` + +你同样可以使用软件更新器。 + +![][19] + +一旦更新完成安装你就可以开始了。你可以根据你的需要继续安装 Raspberry Pi 平台的为 GPIO 和其他 I/O 准备的特定软件包。 + +是什么让你考虑在 Raspberry 上安装 Ubuntu,你对 Raspbian 的体验如何呢?在下方评论来让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-mate-raspberry-pi/ + +作者:[Chinmay][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://www.raspberrypi.org/downloads/ +[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[4]: https://www.debian.org/ +[5]: https://ubuntu-mate.org/ +[6]: https://wiki.ubuntu.com/ARM/RaspberryPi#Recovering_a_system_using_the_generic_kernel +[7]: https://ubuntu-pi-flavour-maker.org/download/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-mate-raspberry-pi-download.jpg?ssl=1 +[9]: https://ubuntu-mate.org/download/ +[10]: https://www.7-zip.org/download.html +[11]: https://www.balena.io/etcher/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Screenshot-from-2019-04-08-01-36-16.png?ssl=1 +[13]: https://linuxhandbook.com/raspberry-pi-headless-setup/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Keyboard-layout-ubuntu.jpg?fit=800%2C467&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/select-time-zone-ubuntu.jpg?fit=800%2C468&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Credentials-ubuntu.jpg?fit=800%2C469&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?fit=800%2C600&ssl=1 +[18]: https://itsfoss.com/update-ubuntu/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/update-software.png?ssl=1 + + From 9a22b74beb9e42a8ea7fc2b6ac701f1731793155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 12:11:10 +0800 Subject: [PATCH 0192/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190401 What is 5G- How is it better than 4G.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190401 What is 5G- How is it better than 4G.md b/sources/tech/20190401 What is 5G- How is it better than 4G.md index f4ad51b8ae..a5472f9e6e 100644 --- a/sources/tech/20190401 What is 5G- How is it better than 4G.md +++ b/sources/tech/20190401 What is 5G- How is it better than 4G.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 244f9a5a97d2997f99351f39e0b40e836f1a54fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 12:16:39 +0800 Subject: [PATCH 0193/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190401 What is 5G- How is it better than 4G.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190401 What is 5G- How is it better than 4G.md b/sources/tech/20190401 What is 5G- How is it better than 4G.md index f4ad51b8ae..a5472f9e6e 100644 --- a/sources/tech/20190401 What is 5G- How is it better than 4G.md +++ b/sources/tech/20190401 What is 5G- How is it better than 4G.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2b44201130f9c91888a16956b26abfb163aef76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 15:31:50 +0800 Subject: [PATCH 0194/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...01 What is 5G- How is it better than 4G.md | 171 ------------------ ...01 What is 5G- How is it better than 4G.md | 169 +++++++++++++++++ 2 files changed, 169 insertions(+), 171 deletions(-) delete mode 100644 sources/tech/20190401 What is 5G- How is it better than 4G.md create mode 100644 translated/tech/20190401 What is 5G- How is it better than 4G.md diff --git a/sources/tech/20190401 What is 5G- How is it better than 4G.md b/sources/tech/20190401 What is 5G- How is it better than 4G.md deleted file mode 100644 index a5472f9e6e..0000000000 --- a/sources/tech/20190401 What is 5G- How is it better than 4G.md +++ /dev/null @@ -1,171 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What is 5G? How is it better than 4G?) -[#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) -[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) - -What is 5G? How is it better than 4G? -====== - -### 5G networks will boost wireless throughput by a factor of 10 and may replace wired broadband. But when will they be available, and why are 5G and IoT so linked together? - -![Thinkstock][1] - -[5G wireless][2] is an umbrella term to describe a set of standards and technologies for a radically faster wireless internet that ideally is up to 20 times faster with 120 times less latency than 4G, setting the stage for IoT networking advances and support for new high-bandwidth applications. - -## What is 5G? Technology or buzzword? - -It will be years before the technology reaches its full potential worldwide, but meanwhile some 5G network services are being rolled out today. 5G is as much a marketing buzzword as a technical term, and not all services marketed as 5G are standard. - -**[From Mobile World Congress:[The time of 5G is almost here][3].]** - -## 5G speed vs 4G - -With every new generation of wireless technology, the biggest appeal is increased speed. 5G networks have potential peak download speeds of [20 Gbps, with 10 Gbps being seen as typical][4]. That's not just faster than current 4G networks, which currently top out at around 1 Gbps, but also faster than cable internet connections that deliver broadband to many people's homes. 5G offers network speeds that rival optical-fiber connections. - -Throughput alone isn't 5G's only important speed improvement; it also features a huge reduction in network latency*.* That's an important distinction: throughput measures how long it would take to download a large file, while latency is determined by network bottlenecks and delays that slow down responses in back-and-forth communication. - -Latency can be difficult to quantify because it varies based on myriad network conditions, but 5G networks are capable of latency rates that are less than a millisecond in ideal conditions. Overall, 5G latency will be lower than 4G's by a factor of 60 to 120. That will make possible a number of applications such as virtual reality that delay makes impractical today. - -## 5G technology - -The technology underpinnings of 5G are defined by a series of standards that have been in the works for the better part of a decade. One of the most important of these is 5G New Radio, or 5G NR*,* formalized by the 3rd Generation Partnership Project, a standards organization that develops protocols for mobile telephony. 5G NR will dictate many of the ways in which consumer 5G devices will operate, and was [finalized in June of 2018][5]. - -**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** - -A number of individual technologies have come together to make the speed and latency improvements of 5G possible, and below are some of the most important. - -## Millimeter waves - -5G networks will for the most part use frequencies in the 30 to 300 GHz range. (Wavelengths at these frequencies are between 1 and 10 millimeters, thus the name.) This high-frequency band can [carry much more information per unit of time than the lower-frequency signals][7] currently used by 4G LTE, which is generally below 1 GHz, or Wi-Fi, which tops out at 6 GHz. - -Millimeter-wave technology has traditionally been expensive and difficult to deploy. Technical advances have overcome those difficulties, which is part of what's made 5G possible today. - -## Small cells - -One drawback of millimeter wave transmission is that it's more prone to interference than Wi-Fi or 4G signals as they pass through physical objects. - -To overcome this, the model for 5G infrastructure will be different from 4G's. Instead of the large cellular-antenna masts we've come to accept as part of the landscape, 5G networks will be powered by [much smaller base stations spread throughout cities about 250 meters apart][8], creating cells of service that are also smaller. - -These 5G base stations have lower power requirements than those for 4G and can be attached to buildings and utility poles more easily. - -## Massive MIMO - -Despite 5G base stations being much smaller than their 4G counterparts, they pack in many more antennas. These antennas are [multiple-input multiple-output (MIMO)][9], meaning that they can handle multiple two-way conversations over the same data signal simultaneously. 5G networks can handle more than [20 times more conversations in this way than 4G networks][10]. - -Massive MIMO promises to [radically improve on base station capacity limits][11], allowing individual base stations to have conversations with many more devices. This in particular is why 5G may drive wider adoption of IoT. In theory, a lot more internet-connected wireless gadgets will be able to be deployed in the same space without overwhelming the network. - -## Beamforming - -Making sure all these conversations go back and forth to the right places is tricky, especially with the aforementioned problems millimeter-wave signals have with interference. To overcome those issues, 5G stations deploy advanced beamforming techniques, which use constructive and destructive radio interference to make signals directional rather than broadcast. That effectively boosts signal strength and range in a particular direction. - -## 5G availability - -The first commercial 5G network was [rolled out in Qatar in May 2018][12]. Since then, networks have been popping up across the world, from Argentina to Vietnam. [Lifewire has a good, frequently updated list][13]. - -One thing to keep in mind, though, is that not all 5G networks deliver on all the technology's promises yet. Some early 5G offerings piggyback on existing 4G infrastructure, which reduces the potential speed gains; other services dubbed 5G for marketing purposes don't even comply with the standard. A closer look at offerings from U.S. wireless carriers will demonstrate some of the pitfalls. - -## Wireless carriers and 5G - -Technically, 5G is available in the U.S. today. But the caveats involved in that statement vary from carrier to carrier, demonstrating the long road that still lies ahead before 5G becomes omnipresent. - -Verizon is making probably the biggest early 5G push. It announced [5G Home][14] in parts of four cities in October of 2018, a service that requires using a special 5G hotspot to connect to the network and feed it to your other devices via Wi-Fi. - -Verizon planned an April rollout of a [mobile service in Minneapolis and Chicago][15], which will spread to other cities over the course of the year. Accessing the 5G network will cost customers an extra monthly fee plus what they’ll have to spend on a phone that can actually connect to it (more on that in a moment). As an added wrinkle, Verizon is deploying what it calls [5G TF][16], which doesn't match up with the 5G NR standard. - -AT&T [announced the availability of 5G in 12 U.S. cities in December 2018][17], with nine more coming by the end of 2019, but even in those cities, availability is limited to the downtown areas. To use the network requires a special Netgear hotspot that connects to the service, then provides a Wi-Fi signal to phones and other devices. - -Meanwhile, AT&T is also rolling out speed boosts to its 4G network, which it's dubbed 5GE even though these improvements aren't related to 5G networking. ([This is causing backlash][18].) - -Sprint will have 5G service in parts of four cities by May of 2019, and five more by the end of the year. But while Sprint's 5G offering makes use of massive MIMO cells, they [aren't using millimeter-wave signals][19], meaning that Sprint users won't see as much of a speed boost as customers of other carriers. - -T-Mobile is pursuing a similar model,and it [won't roll out its service until the end of 2019][20] because there won't be any phones to connect to it. - -One kink that might stop a rapid spread of 5G is the need to spread out all those small-cell base stations. Their small size and low power requirements make them easier to deploy than current 4G tech in a technical sense, but that doesn't mean it's simple to convince governments and property owners to install dozens of them everywhere. Verizon actually set up a [website that you can use to petition your local elected officials][21] to speed up 5G base station deployment. - -## **5G phones: When available? When to buy?** - -The first major 5G phone to be announced is the Samsung Galaxy S10 5G, which should be available by the end of the summer of 2019. You can also order a "[Moto Mod][22]" from Verizon, which [transforms Moto Z3 phones into 5G-compatible device][23]s. - -But unless you can't resist the lure of being an early adopter, you may wish to hold off for a bit; some of the quirks and looming questions about carrier rollout may mean that you end up with a phone that [isn't compatible with your carrier's entire 5G network][24]. - -One laggard that may surprise you is Apple: analysts believe that there won't be a [5G-compatible iPhone until 2020 at the earliest][25]. But this isn't out of character for the company; Apple [also lagged behind Samsung in releasing 4G-compatible phones][26] in back in 2012. - -Still, the 5G flood is coming. 5G-compatible devices [dominated Barcelona's Mobile World Congress in 2019][3], so expect to have a lot more choice on the horizon. - -## Why are people talking about 6G already? - -Some experts say [5G won’t be able to meet the latency and reliability targets][27] it is shooting for. These skeptics are already looking ahead to 6G, which they say will try to address these projected shortcomings. - -There is [a group that is researching new technologies that can be rolled into 6G][28] that calls itself - -The Center for Converged TeraHertz Communications and Sensing (ComSenTer). Part of the spec they’re working on calls for 100Gbps speed for every device. - -In addition to adding reliability, overcoming reliability and boosting speed, 6G is also trying to enable thousands of simultaneous connections. If successful, this feature could help to network IoT devices, which can be deployed in the thousands as sensors in a variety of industrial settings. - -Even in its embryonic form, 6G may already be facing security concerns due to the emergence of newly discovered [potential for man-in-the-middle attacks in tera-hertz based networks][29]. The good news is that there’s plenty of time to find solutions to the problem. 6G networks aren’t expected to start rolling out until 2030. - -**More about 5g networks:** - - * [How enterprises can prep for 5G networks][30] - * [5G vs 4G: How speed, latency and apps support differ][31] - * [Private 5G networks are coming][32] - * [5G and 6G wireless have security issues][33] - * [How millimeter-wave wireless could help support 5G and IoT][34] - - - -Join the Network World communities on [Facebook][35] and [LinkedIn][36] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all - -作者:[Josh Fruhlinger][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/Josh-Fruhlinger/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2017/04/5g-100718139-large.jpg -[2]: https://www.networkworld.com/article/3203489/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html -[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html -[5]: https://www.theverge.com/2018/6/15/17467734/5g-nr-standard-3gpp-standalone-finished -[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture -[7]: https://www.networkworld.com/article/3291323/millimeter-wave-wireless-could-help-support-5g-and-iot.html -[8]: https://spectrum.ieee.org/video/telecom/wireless/5g-bytes-small-cells-explained -[9]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html -[10]: https://spectrum.ieee.org/tech-talk/telecom/wireless/5g-researchers-achieve-new-spectrum-efficiency-record -[11]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html -[12]: https://venturebeat.com/2018/05/14/worlds-first-commercial-5g-network-launches-in-qatar/ -[13]: https://www.lifewire.com/5g-availability-world-4156244 -[14]: https://www.digitaltrends.com/computing/verizon-5g-home-promises-up-to-gigabit-internet-speeds-for-50/ -[15]: https://lifehacker.com/heres-your-cheat-sheet-for-verizons-new-5g-data-plans-1833278817 -[16]: https://www.theverge.com/2018/10/2/17927712/verizon-5g-home-internet-real-speed-meaning -[17]: https://www.cnn.com/2018/12/18/tech/5g-mobile-att/index.html -[18]: https://www.networkworld.com/article/3339720/like-4g-before-it-5g-is-being-hyped.html?nsdr=true -[19]: https://www.digitaltrends.com/mobile/sprint-5g-rollout/ -[20]: https://www.cnet.com/news/t-mobile-delays-full-600-mhz-5g-launch-until-second-half/ -[21]: https://lets5g.com/ -[22]: https://www.verizonwireless.com/support/5g-moto-mod-faqs/?AID=11365093&SID=100098X1555750Xbc2e857934b22ebca1a0570d5ba93b7c&vendorid=CJM&PUBID=7105813&cjevent=2e2150cb478c11e98183013b0a1c0e0c -[23]: https://www.digitaltrends.com/cell-phone-reviews/moto-z3-review/ -[24]: https://www.businessinsider.com/samsung-galaxy-s10-5g-which-us-cities-have-5g-networks-2019-2 -[25]: https://www.cnet.com/news/why-apples-in-no-rush-to-sell-you-a-5g-iphone/ -[26]: https://mashable.com/2012/09/09/iphone-5-4g-lte/#hYyQUelYo8qq -[27]: https://www.networkworld.com/article/3305359/6g-will-achieve-terabits-per-second-speeds.html -[28]: https://www.networkworld.com/article/3285112/get-ready-for-upcoming-6g-wireless-too.html -[29]: https://www.networkworld.com/article/3315626/5g-and-6g-wireless-technologies-have-security-issues.html -[30]: https://%20https//www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html -[31]: https://%20https//www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html -[32]: https://%20https//www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html -[33]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html -[34]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html -[35]: https://www.facebook.com/NetworkWorld/ -[36]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190401 What is 5G- How is it better than 4G.md b/translated/tech/20190401 What is 5G- How is it better than 4G.md new file mode 100644 index 0000000000..7465d4b495 --- /dev/null +++ b/translated/tech/20190401 What is 5G- How is it better than 4G.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is 5G? How is it better than 4G?) +[#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) +[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) + +什么是 5G?它如何比 4G 更快? +========================== + +### 5G 网络将使无限网络吞吐量提高 10 倍并且能够替代有线宽带。但是它们什么时候能够投入使用呢,为什么 5G 和物联网如此紧密地联系在一起呢? + +![Thinkstock][1] + +[5G 无线][2] 是一个概括的术语,用来描述一系列更快的无线网络的标准和技术,理想上比 4G 快了 20 倍并且延迟降低了 120 倍,为物联网的发展和对新高带宽应用的支持奠定了基础。 + +## 什么是 5G?科技还是流行词? + +技术在世界范围内完全发挥它的潜能需要数年时间,但同时当今一些 5G 网络服务已经投入使用。5G 不仅是一个技术术语,也是一个营销术语,并不是市场上的所有 5G 服务是标准的。 + +**[来自世界移动大会:[The time of 5G is almost here][3].]** + +## 5G 速度 vs 4G + +无线技术的每一代,最大的呼吁是增加速度。5G 网络潜在的的峰值下载速度达到[20 Gbps,一般在 10 Gbps][4]。这不仅仅是比当前 4G 网络更快,4G 目前峰值大约 1 Gbps,并且比更多家庭的有线网络连接更快。5G 提供的网络速度能够与光纤一较高下。 + +吞吐量不是 5G 仅有的速度提升;它还有的特点是极大降低了网络延迟*。* 这是一个重要的区分:吞吐量用来测量花费多久来下载一个大文件,而延迟由网络瓶颈决定,延迟在来回的沟通中减慢了响应速度。 + +延迟很难量化,因为它在无数的网络状态中变化,但是 5G 网络在理想情况下有能力使延迟率在 1 ms 内。总的来说,5G 延迟将比 4G 降低 60 到 120 倍。这会使很多应用变得可能,例如当前虚拟现实的延迟使它变得不实际。 + +## 5G 技术 + +5G 技术的基础有一系列标准定义,在过去的 10 年里一直在研究更好的部分。这些里面最重要的是 5G New Radio,或者 5G NR*,* 由 3GPP(一个为移动电话开发协议的标准化组织) 组织标准化。5G NR 规定了很多 5G 设备操作的方式,于 2018 年 7 月 完成终版。 + +**[[从 PluralSight 上移动设备管理的课程并且学习如何在你的公司在不降低用户体验的情况下保护设备][6]]** + +很多独特的技术同时出现来尽可能地提升 5G 的速度并降低延迟,下面是一些重要的。 + +## 毫米波 + +5G 网络大部分使用在 30 到 300 GHz 范围的频率。(正如名称一样,这些频率的波长在 1 到 10 毫米之间)这些高频范围能够[在每个时间单元比低频信号携带更多的信息][7],4G 当前使用的就是通常频率在 1 GHz 以下的低频信号,或者 WiFi,最高 6 GHz。 + +毫米波技术传统上是昂贵并且难于部署的。科技进步已经克服了这些困难,这也是 5G 在如今成为了可能。 + +## 小的单元 + +毫米波传输的一个缺点是当他们传输通过物理对象的时候更容易被干扰。 + +为了克服这些,5G 基础设施的模型将不同于 4G。替代了大的移动天线桅杆,我们开始接受作为景观的一部分,5G 网络将由[穿越城市大概间距 250 米的更小的基站]提供支持,创建更小的服务区域。 + +## 大量的 MIMO + +尽管 5G 基站比 4G 的对应部分小多了,但他们却打包了更多的天线。这些天线是[多输入多输出的(MIMO)][9],意味着在相同的数据信道能够同时处理多个双向会话。5G 网络能够处理比 4G 网络超过 20 倍的会话。 + +大量的 MIMO 保证了[基站容量限制下的彻底的提升],允许单个基站承载更多的设备会话。这就是 5G 可能推动物联网更广泛应用的原因。理论上,更多的网络连接的无限设备能够部署在相同的空间而不会使网络被压垮。 + +## 波束成形 + +确保所有的会话来回地到达正确的地方是比较棘手的,尤其是前面提到的毫米波信号的干涉问题。为了克服这些问题,5G 基站部署了更高级的波束技术,使用建设性和破坏性的无线电干扰来使信号有向而不是广播。这在一个特定的方向上有效地加强了信号强度和范围。 + +## 5G 可获得性 + +第一个 5G 商用网络 [2018 年 5 月在卡塔尔推出][12]。自那以后,网络已经扩展到全世界,从阿根廷到越南。[Lifewire 有一个不错的,经常更新的列表][13]. + +牢记一点的是,尽管这样,目前不是所有的 5G 网络都履行了所有的技术承诺。一些早期的 5G 产品依赖于现有的 4G 基础设施,减少了可以获得的潜在速度;其他服务为了市场目的标榜 5G 但是并不符合标准。仔细观察美国无限运营商的产品都会表现出一些陷阱。 + +## 无线运营商和 5G + +技术上讲,5G 服务如今在美国已经可获得了。但声明中包含的注意事项因运营商而异,表明 5G 普及之前还有很长的路要走。 + +Verizon 可能是早期 5G 最大的推动者。它宣告到 2018 年 10 月 将有 4 个城市成为 [5G 家庭][14]的一部分, 一项需要你的其他设备通过 WiFi 来连接特定的 5G 热点,由热点连接到网络服务。 + +Verizon 计划四月在 Minneapolis 和 Chicago 首次展示 5G 移动服务,该服务将在这一年内传播到其他城市。访问 5G 网络将会花费消费者每月额外的费用加上购买能够实际访问 5G 的手机花费(稍后会详细介绍)。作为附加,Verizon 的部署被称作 [5G TF][16],实际上不符合 5G NR 的标准。 + +AT&T [声明在 2018 年 12 月将有美国的 12 个城市可以使用 5G][17],在 2019 年的末尾将增加 9 个城市,但最终在这些城市里,只有商业区能够访问。为了访问 5G 网络,需要一个特定的 Netgear 热点来连接到 5G 服务,然后为手机和其他设备提供一个 Wi-Fi 信号。 + +与此同时,AT&T 也在推出 4G 网络的速度提升计划,被成为 5GE,即使这些提升和 5G 网络没有关系。([这会向后兼容][18]。) + +Sprint 将在 2019 年 5 月之前在四个城市提供 5G 服务,在年末将有更多。但是 Sprint 的 5G 产品充分利用了 MIMO 单元,他们[没有使用毫米波信道][19],意味着 Sprint 的用户不会看到像其他运营商一样的速度提升。 + +T-Mobile 追求一个相似的模型,它[在 2019 年年底之前不会推出 5G 服务][20]因为他们没有手机能够连接到它。 + +一个障碍可能阻止 5G 速度的迅速传播是需要铺开所有这些小的单元基站。他们小的尺寸和较低的功耗需求使它们技术上比 4G 技术更容易部署,但这不意味着它能够很简单的使政府和财产拥有者信服来到处安装一堆基站。Verizon 实际上建立了[向本地民选官员请愿的网站][21]来加速 5G 基站的部署。 + +## ** 5G 手机:何时可获得?何时可以买?** + +第一部声称为 5G 手机的是 Samsung Galaxy S10 5G,将在 2019 年夏末首发。你可以从 Verizon 订阅一个“[Moto Mod][22]”,用来[转换 Moto Z3 手机为 5G 兼容设备][23]。 + +但是除非你不能忍受作为一个早期使用者的诱惑,你会希望再等待一下;一些奇怪和隐约的关于运营商的问题意味着可能你的手机[不兼容你的运营商的整个 5G 网络][24]。 + +一个可能令你吃惊的落后者是苹果:分析者坚信最早直到 2020 年以前 iPhone 不会与 5G 兼容。但这符合该公司的特点;苹果在 2012 年末也落后于三星发布兼容 4G 的手机。 + +不可否认,5G 洪流已经到来。5G 兼容的设备[在 2019 年统治了巴塞罗那世界移动大会][3],因此期待视野里有更多的选择。 + +## 为什么人们已经在讨论 6G 了? + +一些专家说缺点是[5G 不能够达到延迟和可靠性的目标][27]。这些完美主义者已经在探寻 6G,来试图解决这些缺点。 + +这是一个[研究新的能够融入 6G 技术的小组],它们自称 + +The Center for Converged TeraHertz Communications and Sensing (ComSenTer)。根据说明,他们努力让每个设备的带宽达到 100Gbps。 + +除了增加可靠性,还突破了可靠性并增加速度,6G 同样试图允许上千的并发连接。如果成功的话,这个特点将帮助物联网设备联网,使在工业设置中部署上千个传感器。 + +即使仍在胚胎当中,6G 已经由于新发现的 [tera-hretz 中基于网络的潜在的中间人攻击][29]的紧迫性面临安全的考虑。好消息是有大量时间来解决这个问题。6G 网络直到 2030 之前才可能出现。 + +**阅读更多关于 5G 网络:** + + * [How enterprises can prep for 5G networks][30] + * [5G vs 4G: How speed, latency and apps support differ][31] + * [Private 5G networks are coming][32] + * [5G and 6G wireless have security issues][33] + * [How millimeter-wave wireless could help support 5G and IoT][34] + + +在 [Facebook][35] 和 [LinkedIn][36] 上加入网络世界社区来评论当前最热门的话题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all + +作者:[Josh Fruhlinger][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Josh-Fruhlinger/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/04/5g-100718139-large.jpg +[2]: https://www.networkworld.com/article/3203489/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html +[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[5]: https://www.theverge.com/2018/6/15/17467734/5g-nr-standard-3gpp-standalone-finished +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.networkworld.com/article/3291323/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[8]: https://spectrum.ieee.org/video/telecom/wireless/5g-bytes-small-cells-explained +[9]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html +[10]: https://spectrum.ieee.org/tech-talk/telecom/wireless/5g-researchers-achieve-new-spectrum-efficiency-record +[11]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html +[12]: https://venturebeat.com/2018/05/14/worlds-first-commercial-5g-network-launches-in-qatar/ +[13]: https://www.lifewire.com/5g-availability-world-4156244 +[14]: https://www.digitaltrends.com/computing/verizon-5g-home-promises-up-to-gigabit-internet-speeds-for-50/ +[15]: https://lifehacker.com/heres-your-cheat-sheet-for-verizons-new-5g-data-plans-1833278817 +[16]: https://www.theverge.com/2018/10/2/17927712/verizon-5g-home-internet-real-speed-meaning +[17]: https://www.cnn.com/2018/12/18/tech/5g-mobile-att/index.html +[18]: https://www.networkworld.com/article/3339720/like-4g-before-it-5g-is-being-hyped.html?nsdr=true +[19]: https://www.digitaltrends.com/mobile/sprint-5g-rollout/ +[20]: https://www.cnet.com/news/t-mobile-delays-full-600-mhz-5g-launch-until-second-half/ +[21]: https://lets5g.com/ +[22]: https://www.verizonwireless.com/support/5g-moto-mod-faqs/?AID=11365093&SID=100098X1555750Xbc2e857934b22ebca1a0570d5ba93b7c&vendorid=CJM&PUBID=7105813&cjevent=2e2150cb478c11e98183013b0a1c0e0c +[23]: https://www.digitaltrends.com/cell-phone-reviews/moto-z3-review/ +[24]: https://www.businessinsider.com/samsung-galaxy-s10-5g-which-us-cities-have-5g-networks-2019-2 +[25]: https://www.cnet.com/news/why-apples-in-no-rush-to-sell-you-a-5g-iphone/ +[26]: https://mashable.com/2012/09/09/iphone-5-4g-lte/#hYyQUelYo8qq +[27]: https://www.networkworld.com/article/3305359/6g-will-achieve-terabits-per-second-speeds.html +[28]: https://www.networkworld.com/article/3285112/get-ready-for-upcoming-6g-wireless-too.html +[29]: https://www.networkworld.com/article/3315626/5g-and-6g-wireless-technologies-have-security-issues.html +[30]: https://%20https//www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html +[31]: https://%20https//www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[32]: https://%20https//www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html +[33]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html +[34]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[35]: https://www.facebook.com/NetworkWorld/ +[36]: https://www.linkedin.com/company/network-world + From 22ba8a508688b44f85b32458b7c99e066ff25e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 18:24:43 +0800 Subject: [PATCH 0195/1154] delete 5G --- ...01 What is 5G- How is it better than 4G.md | 171 ------------------ 1 file changed, 171 deletions(-) delete mode 100644 sources/tech/20190401 What is 5G- How is it better than 4G.md diff --git a/sources/tech/20190401 What is 5G- How is it better than 4G.md b/sources/tech/20190401 What is 5G- How is it better than 4G.md deleted file mode 100644 index a5472f9e6e..0000000000 --- a/sources/tech/20190401 What is 5G- How is it better than 4G.md +++ /dev/null @@ -1,171 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What is 5G? How is it better than 4G?) -[#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) -[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) - -What is 5G? How is it better than 4G? -====== - -### 5G networks will boost wireless throughput by a factor of 10 and may replace wired broadband. But when will they be available, and why are 5G and IoT so linked together? - -![Thinkstock][1] - -[5G wireless][2] is an umbrella term to describe a set of standards and technologies for a radically faster wireless internet that ideally is up to 20 times faster with 120 times less latency than 4G, setting the stage for IoT networking advances and support for new high-bandwidth applications. - -## What is 5G? Technology or buzzword? - -It will be years before the technology reaches its full potential worldwide, but meanwhile some 5G network services are being rolled out today. 5G is as much a marketing buzzword as a technical term, and not all services marketed as 5G are standard. - -**[From Mobile World Congress:[The time of 5G is almost here][3].]** - -## 5G speed vs 4G - -With every new generation of wireless technology, the biggest appeal is increased speed. 5G networks have potential peak download speeds of [20 Gbps, with 10 Gbps being seen as typical][4]. That's not just faster than current 4G networks, which currently top out at around 1 Gbps, but also faster than cable internet connections that deliver broadband to many people's homes. 5G offers network speeds that rival optical-fiber connections. - -Throughput alone isn't 5G's only important speed improvement; it also features a huge reduction in network latency*.* That's an important distinction: throughput measures how long it would take to download a large file, while latency is determined by network bottlenecks and delays that slow down responses in back-and-forth communication. - -Latency can be difficult to quantify because it varies based on myriad network conditions, but 5G networks are capable of latency rates that are less than a millisecond in ideal conditions. Overall, 5G latency will be lower than 4G's by a factor of 60 to 120. That will make possible a number of applications such as virtual reality that delay makes impractical today. - -## 5G technology - -The technology underpinnings of 5G are defined by a series of standards that have been in the works for the better part of a decade. One of the most important of these is 5G New Radio, or 5G NR*,* formalized by the 3rd Generation Partnership Project, a standards organization that develops protocols for mobile telephony. 5G NR will dictate many of the ways in which consumer 5G devices will operate, and was [finalized in June of 2018][5]. - -**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** - -A number of individual technologies have come together to make the speed and latency improvements of 5G possible, and below are some of the most important. - -## Millimeter waves - -5G networks will for the most part use frequencies in the 30 to 300 GHz range. (Wavelengths at these frequencies are between 1 and 10 millimeters, thus the name.) This high-frequency band can [carry much more information per unit of time than the lower-frequency signals][7] currently used by 4G LTE, which is generally below 1 GHz, or Wi-Fi, which tops out at 6 GHz. - -Millimeter-wave technology has traditionally been expensive and difficult to deploy. Technical advances have overcome those difficulties, which is part of what's made 5G possible today. - -## Small cells - -One drawback of millimeter wave transmission is that it's more prone to interference than Wi-Fi or 4G signals as they pass through physical objects. - -To overcome this, the model for 5G infrastructure will be different from 4G's. Instead of the large cellular-antenna masts we've come to accept as part of the landscape, 5G networks will be powered by [much smaller base stations spread throughout cities about 250 meters apart][8], creating cells of service that are also smaller. - -These 5G base stations have lower power requirements than those for 4G and can be attached to buildings and utility poles more easily. - -## Massive MIMO - -Despite 5G base stations being much smaller than their 4G counterparts, they pack in many more antennas. These antennas are [multiple-input multiple-output (MIMO)][9], meaning that they can handle multiple two-way conversations over the same data signal simultaneously. 5G networks can handle more than [20 times more conversations in this way than 4G networks][10]. - -Massive MIMO promises to [radically improve on base station capacity limits][11], allowing individual base stations to have conversations with many more devices. This in particular is why 5G may drive wider adoption of IoT. In theory, a lot more internet-connected wireless gadgets will be able to be deployed in the same space without overwhelming the network. - -## Beamforming - -Making sure all these conversations go back and forth to the right places is tricky, especially with the aforementioned problems millimeter-wave signals have with interference. To overcome those issues, 5G stations deploy advanced beamforming techniques, which use constructive and destructive radio interference to make signals directional rather than broadcast. That effectively boosts signal strength and range in a particular direction. - -## 5G availability - -The first commercial 5G network was [rolled out in Qatar in May 2018][12]. Since then, networks have been popping up across the world, from Argentina to Vietnam. [Lifewire has a good, frequently updated list][13]. - -One thing to keep in mind, though, is that not all 5G networks deliver on all the technology's promises yet. Some early 5G offerings piggyback on existing 4G infrastructure, which reduces the potential speed gains; other services dubbed 5G for marketing purposes don't even comply with the standard. A closer look at offerings from U.S. wireless carriers will demonstrate some of the pitfalls. - -## Wireless carriers and 5G - -Technically, 5G is available in the U.S. today. But the caveats involved in that statement vary from carrier to carrier, demonstrating the long road that still lies ahead before 5G becomes omnipresent. - -Verizon is making probably the biggest early 5G push. It announced [5G Home][14] in parts of four cities in October of 2018, a service that requires using a special 5G hotspot to connect to the network and feed it to your other devices via Wi-Fi. - -Verizon planned an April rollout of a [mobile service in Minneapolis and Chicago][15], which will spread to other cities over the course of the year. Accessing the 5G network will cost customers an extra monthly fee plus what they’ll have to spend on a phone that can actually connect to it (more on that in a moment). As an added wrinkle, Verizon is deploying what it calls [5G TF][16], which doesn't match up with the 5G NR standard. - -AT&T [announced the availability of 5G in 12 U.S. cities in December 2018][17], with nine more coming by the end of 2019, but even in those cities, availability is limited to the downtown areas. To use the network requires a special Netgear hotspot that connects to the service, then provides a Wi-Fi signal to phones and other devices. - -Meanwhile, AT&T is also rolling out speed boosts to its 4G network, which it's dubbed 5GE even though these improvements aren't related to 5G networking. ([This is causing backlash][18].) - -Sprint will have 5G service in parts of four cities by May of 2019, and five more by the end of the year. But while Sprint's 5G offering makes use of massive MIMO cells, they [aren't using millimeter-wave signals][19], meaning that Sprint users won't see as much of a speed boost as customers of other carriers. - -T-Mobile is pursuing a similar model,and it [won't roll out its service until the end of 2019][20] because there won't be any phones to connect to it. - -One kink that might stop a rapid spread of 5G is the need to spread out all those small-cell base stations. Their small size and low power requirements make them easier to deploy than current 4G tech in a technical sense, but that doesn't mean it's simple to convince governments and property owners to install dozens of them everywhere. Verizon actually set up a [website that you can use to petition your local elected officials][21] to speed up 5G base station deployment. - -## **5G phones: When available? When to buy?** - -The first major 5G phone to be announced is the Samsung Galaxy S10 5G, which should be available by the end of the summer of 2019. You can also order a "[Moto Mod][22]" from Verizon, which [transforms Moto Z3 phones into 5G-compatible device][23]s. - -But unless you can't resist the lure of being an early adopter, you may wish to hold off for a bit; some of the quirks and looming questions about carrier rollout may mean that you end up with a phone that [isn't compatible with your carrier's entire 5G network][24]. - -One laggard that may surprise you is Apple: analysts believe that there won't be a [5G-compatible iPhone until 2020 at the earliest][25]. But this isn't out of character for the company; Apple [also lagged behind Samsung in releasing 4G-compatible phones][26] in back in 2012. - -Still, the 5G flood is coming. 5G-compatible devices [dominated Barcelona's Mobile World Congress in 2019][3], so expect to have a lot more choice on the horizon. - -## Why are people talking about 6G already? - -Some experts say [5G won’t be able to meet the latency and reliability targets][27] it is shooting for. These skeptics are already looking ahead to 6G, which they say will try to address these projected shortcomings. - -There is [a group that is researching new technologies that can be rolled into 6G][28] that calls itself - -The Center for Converged TeraHertz Communications and Sensing (ComSenTer). Part of the spec they’re working on calls for 100Gbps speed for every device. - -In addition to adding reliability, overcoming reliability and boosting speed, 6G is also trying to enable thousands of simultaneous connections. If successful, this feature could help to network IoT devices, which can be deployed in the thousands as sensors in a variety of industrial settings. - -Even in its embryonic form, 6G may already be facing security concerns due to the emergence of newly discovered [potential for man-in-the-middle attacks in tera-hertz based networks][29]. The good news is that there’s plenty of time to find solutions to the problem. 6G networks aren’t expected to start rolling out until 2030. - -**More about 5g networks:** - - * [How enterprises can prep for 5G networks][30] - * [5G vs 4G: How speed, latency and apps support differ][31] - * [Private 5G networks are coming][32] - * [5G and 6G wireless have security issues][33] - * [How millimeter-wave wireless could help support 5G and IoT][34] - - - -Join the Network World communities on [Facebook][35] and [LinkedIn][36] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all - -作者:[Josh Fruhlinger][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/Josh-Fruhlinger/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2017/04/5g-100718139-large.jpg -[2]: https://www.networkworld.com/article/3203489/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html -[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html -[5]: https://www.theverge.com/2018/6/15/17467734/5g-nr-standard-3gpp-standalone-finished -[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture -[7]: https://www.networkworld.com/article/3291323/millimeter-wave-wireless-could-help-support-5g-and-iot.html -[8]: https://spectrum.ieee.org/video/telecom/wireless/5g-bytes-small-cells-explained -[9]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html -[10]: https://spectrum.ieee.org/tech-talk/telecom/wireless/5g-researchers-achieve-new-spectrum-efficiency-record -[11]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html -[12]: https://venturebeat.com/2018/05/14/worlds-first-commercial-5g-network-launches-in-qatar/ -[13]: https://www.lifewire.com/5g-availability-world-4156244 -[14]: https://www.digitaltrends.com/computing/verizon-5g-home-promises-up-to-gigabit-internet-speeds-for-50/ -[15]: https://lifehacker.com/heres-your-cheat-sheet-for-verizons-new-5g-data-plans-1833278817 -[16]: https://www.theverge.com/2018/10/2/17927712/verizon-5g-home-internet-real-speed-meaning -[17]: https://www.cnn.com/2018/12/18/tech/5g-mobile-att/index.html -[18]: https://www.networkworld.com/article/3339720/like-4g-before-it-5g-is-being-hyped.html?nsdr=true -[19]: https://www.digitaltrends.com/mobile/sprint-5g-rollout/ -[20]: https://www.cnet.com/news/t-mobile-delays-full-600-mhz-5g-launch-until-second-half/ -[21]: https://lets5g.com/ -[22]: https://www.verizonwireless.com/support/5g-moto-mod-faqs/?AID=11365093&SID=100098X1555750Xbc2e857934b22ebca1a0570d5ba93b7c&vendorid=CJM&PUBID=7105813&cjevent=2e2150cb478c11e98183013b0a1c0e0c -[23]: https://www.digitaltrends.com/cell-phone-reviews/moto-z3-review/ -[24]: https://www.businessinsider.com/samsung-galaxy-s10-5g-which-us-cities-have-5g-networks-2019-2 -[25]: https://www.cnet.com/news/why-apples-in-no-rush-to-sell-you-a-5g-iphone/ -[26]: https://mashable.com/2012/09/09/iphone-5-4g-lte/#hYyQUelYo8qq -[27]: https://www.networkworld.com/article/3305359/6g-will-achieve-terabits-per-second-speeds.html -[28]: https://www.networkworld.com/article/3285112/get-ready-for-upcoming-6g-wireless-too.html -[29]: https://www.networkworld.com/article/3315626/5g-and-6g-wireless-technologies-have-security-issues.html -[30]: https://%20https//www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html -[31]: https://%20https//www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html -[32]: https://%20https//www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html -[33]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html -[34]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html -[35]: https://www.facebook.com/NetworkWorld/ -[36]: https://www.linkedin.com/company/network-world From 01fd88b8848c9028a9022adee5f151424155c0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 18:31:01 +0800 Subject: [PATCH 0196/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...isk I-O Activity Using iotop And iostat Commands In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index f4084302b8..bb1fd109b0 100644 --- a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 03d87fd8673fddc20c185cfb66c0520244b8fd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 18:32:14 +0800 Subject: [PATCH 0197/1154] no --- ...isk I-O Activity Using iotop And iostat Commands In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index bb1fd109b0..f4084302b8 100644 --- a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (warmfrog) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b93b14a6fc3a958df858cde3010589e8714ffc1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 18:47:36 +0800 Subject: [PATCH 0198/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190419 This is how System76 does open hardware.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190419 This is how System76 does open hardware.md b/sources/tech/20190419 This is how System76 does open hardware.md index 7f0ca3e479..9fc742ad30 100644 --- a/sources/tech/20190419 This is how System76 does open hardware.md +++ b/sources/tech/20190419 This is how System76 does open hardware.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1bd3eb8cb529cffb640a221ebc9bc707e2d4a321 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 29 Apr 2019 20:04:53 +0800 Subject: [PATCH 0199/1154] =?UTF-8?q?PRF&PUB:20190418=20Ubuntu=2019.04=20?= =?UTF-8?q?=E2=80=98Disco=20Dingo=20=20Has=20Arrived=20=20Downloads=20Avai?= =?UTF-8?q?lable=20Now=20(#13451)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * PRF:20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @geekpi * PUB:20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @geekpi https://linux.cn/article-10795-1.html --- ...ngo- Has Arrived- Downloads Available Now.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) rename {translated/tech => published}/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md (70%) diff --git a/translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/published/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md similarity index 70% rename from translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md rename to published/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md index caa893dfbc..3f1647eccb 100644 --- a/translated/tech/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md +++ b/published/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @@ -1,16 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10795-1.html) [#]: subject: (Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now!) [#]: via: (https://itsfoss.com/ubuntu-19-04-release/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Ubuntu 19.04 “Disco Dingo” 已经发布:立即下载! +下载安装 Ubuntu 19.04 “Disco Dingo” ====== -现在可以下载 Disco 了!为什么?Ubuntu 19.04 “Disco Dingo” 就在这里,终于可以下载了。虽然我们已经知道 [Ubuntu 19.04 中的新功能][1] - 我将在下面提到一些重要的事情,还会给出官方的下载链接。 +Ubuntu 19.04 “Disco Dingo” 已经发布,可以下载了。虽然我们已经知道 [Ubuntu 19.04 中的新功能][1] —— 我将在下面提到一些重要的地方,还会给出官方的下载链接。 ### Ubuntu 19.04:你需要知道什么 @@ -18,9 +18,9 @@ Ubuntu 19.04 “Disco Dingo” 已经发布:立即下载! #### Ubuntu 19.04 不是 LTS 版本 -与 Ubuntu 18.04 LTS 不同,它不会[受支持 10 年][2]。相反,非 LTS 的 19.04 将支持 **9 个月,直到 2020 年 1 月。** +与 Ubuntu 18.04 LTS 不同,它不会[支持 10 年][2]。相反,非 LTS 的 19.04 将支持 **9 个月,直到 2020 年 1 月。** -因此,如果你有生产环境,我们可能不会立即建议你进行升级。例如,如果你有一台运行在 Ubuntu 18.04 LTS 上的服务器 - 将它升级到 19.04 可能不是一个好主意,因为它是一个令人兴奋的版本。 +因此,如果你有生产环境,我们可能不会立即建议你进行升级。例如,如果你有一台运行在 Ubuntu 18.04 LTS 上的服务器 —— 只是因为它是一个新的版本就将它升级到 19.04 可能不是一个好主意。 但是,对于希望在计算机上安装最新版本的用户,可以尝试一下。 @@ -28,23 +28,25 @@ Ubuntu 19.04 “Disco Dingo” 已经发布:立即下载! #### Ubuntu 19.04 对 NVIDIA GPU 用户是个不错的更新 -_Martin Wimpress_(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之一)的 [GitHub][4] 的最终发布说明中提到 Ubuntu 19.04 对 NVIDIA GPU 用户来说特别重要。 +Martin Wimpress(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之一)的 [GitHub][4] 的最终发布说明中提到 Ubuntu 19.04 对 NVIDIA GPU 用户来说特别重要。 -换句话说,在安装专有图形驱动时 - 它现在会选择与你特定 GPU 型号兼容最佳的驱动程序。 +换句话说,在安装专有图形驱动时 —— 它现在会选择与你特定 GPU 型号兼容最佳的驱动程序。 #### Ubuntu 19.04 功能 -尽管我们已经讨论过 [Ubuntu 19.04][1] Disco Dingo 的[最佳功能][1],但值得一提的是,我对本次发布的主要变化:桌面更新 (GNOME 3.32) 和 Linux 内核 (5.0) 感到兴奋。。 +- https://youtu.be/sbbPYdpdMb8 + +尽管我们已经讨论过 [Ubuntu 19.04][1] Disco Dingo 的[最佳功能][1],但值得一提的是,我对本次发布的主要变化:桌面更新 (GNOME 3.32) 和 Linux 内核 (5.0)感到兴奋。 #### 从 Ubuntu 18.10 升级到 19.04 -显而易见,如果你安装了 Ubuntu 18.10,你应该升级它。18.10 将于 2019 年 7 月停止支持 - 所以我们建议你将其升级到 19.04。 +显而易见,如果你安装了 Ubuntu 18.10,你应该升级它。18.10 将于 2019 年 7 月停止支持 —— 所以我们建议你将其升级到 19.04。 -要做到这一点,你可以直接进入“**软件和更新**”设置,然后选择“**更新**”选项卡。 +要做到这一点,你可以直接进入“软件和更新”设置,然后选择“更新”选项卡。 -现在将选项从**通知我新的 Ubuntu 版本** 变成 “_任何新版本都通知我_” +现在将选项从“通知我新的 Ubuntu 版本” 变成 “任何新版本都通知我”。 -现在运行更新管理器时,你应该会看到 Ubuntu 19.04。 +现在再次运行更新管理器时,你应该会看到 Ubuntu 19.04。 ![][5] @@ -58,7 +60,7 @@ _Martin Wimpress_(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之 根据[发行说明][6],现在可以下载 Ubuntu 19.04。你可以在其官方发布下载页面上获取种子或 ISO 文件。 -[Download Ubuntu 19.04][7] +- [下载 Ubuntu 19.04][7] 如果你需要不同的桌面环境或需要特定的东西,你应该查看 Ubuntu 的官方版本: @@ -69,11 +71,9 @@ _Martin Wimpress_(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之 * [Ubuntu Studio][12] * [Xubuntu][13] - - 上面提到的一些 Ubuntu 版本还没有在页面提供 19.04。但你可以[仍然在 Ubuntu 的发行说明网页上找到 ISO][6]。就个人而言,我使用带 GNOME 桌面的 Ubuntu。你可以选择你喜欢的。 -**总结** +### 总结 你如何看待 Ubuntu 19.04 Disco Dingo?这些新功能是否足够令人兴奋?你试过了吗?请在下面的评论中告诉我们。 @@ -84,7 +84,7 @@ via: https://itsfoss.com/ubuntu-19-04-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/) 荣誉推出 From 3eec48d42c603ba4a52dad6ad5bb9d7bdb65bb44 Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Mon, 29 Apr 2019 20:13:10 +0800 Subject: [PATCH 0200/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20(#13452)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 申领翻译 * delete 5G * 申领翻译 --- ...isk I-O Activity Using iotop And iostat Commands In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index f4084302b8..bb1fd109b0 100644 --- a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c48cccb32f6dc69e9b665a525db5c4b795be8a0f Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Mon, 29 Apr 2019 20:14:06 +0800 Subject: [PATCH 0201/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20(#13453)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 申领翻译 * delete 5G * 申领翻译 * no * 申领翻译 --- .../tech/20190419 This is how System76 does open hardware.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190419 This is how System76 does open hardware.md b/sources/tech/20190419 This is how System76 does open hardware.md index 7f0ca3e479..9fc742ad30 100644 --- a/sources/tech/20190419 This is how System76 does open hardware.md +++ b/sources/tech/20190419 This is how System76 does open hardware.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From dc1f6188edd16b83311b58ea1ae5c066851b678b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=A6=E9=94=8B?= <289716347@qq.com> Date: Mon, 29 Apr 2019 22:30:01 +0800 Subject: [PATCH 0202/1154] translated --- ...their jobs -- despite the heavy demands.md | 73 ----------------- ...their jobs -- despite the heavy demands.md | 81 +++++++++++++++++++ 2 files changed, 81 insertions(+), 73 deletions(-) delete mode 100644 sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md create mode 100644 translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md diff --git a/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md deleted file mode 100644 index af966b072c..0000000000 --- a/sources/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (arrowfeng) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) -[#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Most data center workers happy with their jobs -- despite the heavy demands -====== -An Informa Engage and Data Center Knowledge survey finds data center workers are content with their jobs, so much so they would encourage their children to go into that line of work. -![Thinkstock][1] - -A [survey conducted by Informa Engage and Data Center Knowledge][2] finds data center workers overall are content with their job, so much so they would encourage their children to go into that line of work despite the heavy demands on time and their brain. - -Overall satisfaction is pretty good, with 72% of respondents generally agreeing with the statement “I love my current job,” while a third strongly agreed. And 75% agreed with the statement, “If my child, niece or nephew asked, I’d recommend getting into IT.” - -**[ Also read:[20 hot jobs ambitious IT pros should shoot for][3] ]** - -And there is a feeling of significance among data center workers, with 88% saying they feel they are very important to the success of their employer. - -That’s despite some challenges, not the least of which is a skills and certification shortage. Survey respondents cite a lack of skills as the biggest area of concern. Only 56% felt they had the training necessary to do their job, and 74% said they had been in the IT industry for more than a decade. - -The industry offers certification programs, every major IT hardware provider has them, but 61% said they have not completed or renewed certificates in the past 12 months. There are several reasons why. - -A third (34%) said it was due to a lack of a training budget at their organization, while 24% cited a lack of time, 16% said management doesn’t see a need for training, and 16% cited no training plans within their workplace. - -That doesn’t surprise me, since tech is one of the most open industries in the world where you can find training or educational materials and teach yourself. It’s already established that [many coders are self-taught][4], including industry giants Bill Gates, Steve Wozniak, John Carmack, and Jack Dorsey. - -**[[Looking to upgrade your career in tech? This comprehensive online course teaches you how.][5] ]** - -### Data center workers' salaries - -Data center workers can’t complain about the pay. Well, most can’t, as 50% make $100,000 per year or more, but 11% make less than $40,000. Two-thirds of those surveyed are in the U.S., so those on the low end might be outside the country. - -There was one notable discrepancy. Steve Brown, managing director of London-based Datacenter People, noted that software engineers get paid a lot better than the hardware people. - -“The software engineering side of the data center is comparable to the highest-earning professions,” Brown said in the report. “On the physical infrastructure — the mechanical/electrical side — it’s not quite the case. It’s more equivalent to mid-level management.” - -### Data center professionals still predominantly male - -The least surprising finding? Nine out of 10 survey respondents were male. The industry is bending over backwards to fix the gender imbalance, but so far nothing has changed. - -The conclusion of the report is a bit ominous, but I also think is wrong: - -> “As data center infrastructure completes its transition to a cloud computing model, and software moves into containers and microservices, the remaining, treasured leaders of the data center workforce — people who acquired their skills in the 20th century — may find themselves with nothing recognizable they can manage and no-one to lead. We may be shocked when the crisis finally hits, but we won’t be able to say we weren’t warned.” - -How many times do I have to say it, [the data center is not going away][6]. - -Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/02/data_center_thinkstock_879720438-100749725-large.jpg -[2]: https://informa.tradepub.com/c/pubRD.mpl?sr=oc&_t=oc:&qf=w_dats04&ch=datacenterkids -[3]: https://www.networkworld.com/article/3276025/20-hot-jobs-ambitious-it-pros-should-shoot-for.html -[4]: https://www.networkworld.com/article/3046178/survey-finds-most-coders-are-self-taught.html -[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fupgrading-your-technology-career -[6]: https://www.networkworld.com/article/3289509/two-studies-show-the-data-center-is-thriving-instead-of-dying.html -[7]: https://www.facebook.com/NetworkWorld/ -[8]: https://www.linkedin.com/company/network-world diff --git a/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md new file mode 100644 index 0000000000..0a7eedfffb --- /dev/null +++ b/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) +[#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +许多数据中心的工作者很满意他们的工作 -- 尽管要求很高 +====== +一份从事和数据中心知识的报告调查发现,在数据中心工作的人很满意他们的工作,因此他们将会鼓励他们的孩子从事这份工作。 +![Thinkstock][1] + + +一份由[从事和数据中心知识][2]主导的调查报告显示,数据中心的工作者总体上对他们的工作很满意。尽管对时间和大脑的要求很高,但是他们还是鼓励自己的孩子能从事这项工作。 + +总体满意度非常好,72%的受访者普遍同意“我喜欢我目前的工作”这一说法,三分之一的受访者则表示非常同意。 75%的人同意声明,“如果我的孩子,侄女或侄子问,我将建议他们进入IT行业。” + +**[ 另请阅读:[雄心壮志的IT专业人士为之奋斗的20个热门职位][3] ]** + +在数据中心工作的员工之中,有一种很重要的感觉,88%的人觉得他们自己对于雇主的成功非常重要。 + +尽管存在一些挑战,其中最主要的是技能和认证的缺乏。 调查的受访者认为缺乏技能是最受关注的领域。 只有56%的人认为他们有完成工作所需的培训,74%的人表示他们已经在IT行业工作了十多年。 + +这个行业提供认证计划,每个主要的IT硬件供应商都有它们,但是61%的人表示在过去的12月里他们并没有完成或者重新续订证书。有几个原因。 + + +三分之一(34%)说是由于他们工作的组织缺乏培训预算,而24%的人认为是缺乏时间,16%的人表示管理者认为不需要培训,和另外16%的人表示在他们的工作地点没有培训计划。 + + +这并不让我感到惊讶,因为科技是世界上最开放的行业之一,在那里你可以找到培训和教育材料并自学。已经证实了[许多程序员是自学成才][4],包括行业巨头比尔盖茨,史蒂夫沃兹尼亚克,约翰卡马克和杰克多尔西。 + +**[[需要去提升你的技术职业生涯?这个全面的在线课程将教你如何去做。][5]** + + +### 数据中心工作者们的薪水 + +数据中心工作者不会抱怨酬劳。当然,大部分不会。50%的人每年可以赚到$100,000甚至更多,然而11%的人赚的少于$40,000。三分之二的受访者来自于美国,因此那些低端人士可能在国外。 + +有一个值得注意的差异。史蒂夫布朗是伦敦数据中心人力资源的总经理,他说软件工程师获得的薪水比硬件工程师多。 + + +布朗在这篇报道中说,“数据中心软件工程方面的工作可以与高收入的职业媲美,在物理基础设施——机械/电气方面的工作——情况并非如此。它更像是中层管理” + + +### 数据中心的专业人士仍然主要是男性 + +最不令人惊讶的发现?10个受访者中有9个是男性。该行业正在调整解决性别歧视问题,但是现在没什么改变。 + + +这篇报告的结论有一点不详,但是我认为是错的: +> "随着数据中心基础设施完成云计算模式的过渡,软件进入到容器和微服务时代,数据中心剩下来的珍贵领导者——在20世界获得技能的人——可能会发现没有任何他们认识的东西能管理和没人去领导。当危机最终来临时,我们可能会感到震惊,但是我们不能说我们没有受到警告。" + + + +多少次我不得不说,[数据中心不会消失][6]。 + +加入[Facebook][7]和[Facebook][7]的网络世界社区,评论最重要的话题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/data_center_thinkstock_879720438-100749725-large.jpg +[2]: https://informa.tradepub.com/c/pubRD.mpl?sr=oc&_t=oc:&qf=w_dats04&ch=datacenterkids +[3]: https://www.networkworld.com/article/3276025/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[4]: https://www.networkworld.com/article/3046178/survey-finds-most-coders-are-self-taught.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fupgrading-your-technology-career +[6]: https://www.networkworld.com/article/3289509/two-studies-show-the-data-center-is-thriving-instead-of-dying.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 053d91206e89a39090e9515b67712f50d3fc0f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 29 Apr 2019 23:27:19 +0800 Subject: [PATCH 0203/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sing iotop And iostat Commands In Linux.md | 114 +++++++++--------- 1 file changed, 56 insertions(+), 58 deletions(-) rename {sources => translated}/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md (63%) diff --git a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md similarity index 63% rename from sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md rename to translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index bb1fd109b0..ffececb666 100644 --- a/sources/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -7,78 +7,76 @@ [#]: via: (https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat-command/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux? -====== +在 Linux 中如何使用 iotop 和 iostat 监控磁盘 I/O 活动? +=================================================== -Do you know what are the tools we can use for troubleshooting or monitoring real-time disk activity in Linux? +你知道在 Linux 中我们使用什么工具检修和监控实时的磁盘活动吗? -If **[Linux system performance][1]** gets slow down we may use **[top command][2]** to see the system performance. +如果 **[Linux 系统性能][1]**变慢,我们会用 **[top 命令][12]** 来查看系统性能。 -It is used to check what are the processes are consuming high utilization on server. +它被用来检查是什么进程在服务器上占有如此高的使用率。 -It’s common for most of the Linux administrator. +对于大多数 Linux 系统管理员来说很常见。 -It’s widely used by Linux administrator in the real world. +现实世界中被 Linux 系统管理员广泛采用。 -If you don’t see much difference in the process output still you have an option to check other things. +如果在进程输出中你没有看到很大的不同,你仍然有选择查看其他东西。 -I would like to advise you to check `wa` status in the top output because most of the time the server performance will be degraded due to high I/O Read and Write on hard disk. +我会建议你在 top 输出中检查 `wa` 状态因为大多数时间服务器性能由于在硬盘上的高 I/O 读和写降低了性能。 -If it’s high or fluctuation, it could be a cause. So, we need to check I/O activity on hard drive. +如果它很高或者波动,很可能就是它造成的。因此,我们需要检查硬盘上的 I/O 活动。 -We can monitory disk I/O statistics for all disks and file system in Linux system using `iotop` and `iostat` commands. +我们可以在 Linux 中使用 `iotop` 和 `iostat` 命令监控所有的磁盘和文件系统的磁盘 I/O 统计。 -### What Is iotop? +### 什么是 iotop? -iotop is a top-like utility for displaying real-time disk activity. +iotop 是一个类似 top 的工具来显示实时的磁盘活动。 -iotop watches I/O usage information output by the Linux kernel and displays a table of current I/O usage by processes or threads on the system. +iotop 监控 Linux 内核输出的 I/O 使用信息并且显示一个系统中进程或线程的当前 I/O 使用情况。 -It displays the I/O bandwidth read and written by each process/thread. It also displays the percentage of time the thread/process spent while swapping in and while waiting on I/O. +它显示每个进程/线程读写 I/O 带宽。它同样显示当等待换入和等待 I/O 的线程/进程 时间花费的百分比。 -Total DISK READ and Total DISK WRITE values represent total read and write bandwidth between processes and kernel threads on the one side and kernel block device subsystem on the other. +Total DISK READ 和 Total DISK WRITE 的值表示了一方面进程和内核线程之间的总的读写带宽,另一方面表示内核块设备子系统的。 -Actual DISK READ and Actual DISK WRITE values represent corresponding bandwidths for actual disk I/O between kernel block device subsystem and underlying hardware (HDD, SSD, etc.). +Actual DISK READ 和 Actual DISK WRITE 的值表示在内核块设备子系统和下面硬件(HDD,SSD,等等。)对应的实际磁盘 I/O 带宽。 -### How To Install iotop In Linux? +### 如何在 Linux 中安装 iotop ? -We can easily install it with help of package manager since the package is available in all the Linux distributions repository. +我们可以轻松在包管理器的帮助下安装,因为该软件包在所有的 Linux 发行版仓库中都可以获得。 -For **`Fedora`** system, use **[DNF Command][3]** to install iotop. +对于 **`Fedora`** 系统,使用 **[DNF 命令][3]** 来安装 iotop。 ``` $ sudo dnf install iotop ``` -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install iotop. +对于 **`Debian/Ubuntu`** 系统,使用 **[API-GET 命令][4]** 或者 **[APT 命令][5]** 来安装 iotop。 ``` $ sudo apt install iotop ``` -For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install iotop. +对于基于 **`Arch Linux`** 的系统,使用 **[Pacman Command][6]** 来安装 iotop。 ``` $ sudo pacman -S iotop ``` -For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install iotop. +对于 **`RHEL/CentOS`** 的系统,使用 **[YUM Command][7]** 来安装 iotop。 ``` $ sudo yum install iotop ``` -For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install iotop. +对于使用 **`openSUSE Leap`** 的系统,使用 **[Zypper Command][8]** 来安装 iotop。 ``` $ sudo zypper install iotop ``` -### How To Monitor Disk I/O Activity/Statistics In Linux Using iotop Command? +### 在 Linux 中如何使用 iotop 命令来监控磁盘 I/O 活动/统计? -There are many options are available in iotop command to check varies statistics about disk I/O. - -Run the iotop command without any arguments to see each process or thread current I/O usage. +iotop 命令有很多参数来检查关于磁盘 I/O 的变化 ``` # iotop @@ -86,7 +84,7 @@ Run the iotop command without any arguments to see each process or thread curren [![][9]![][9]][10] -If you would like to check which process are actually doing IO then run the iotop command with `-o` or `--only` option. +如果你想检查那个进程实际在做 I/O,那么运行 iotop 命令加上 `-o` 或者 `--only` 参数。 ``` # iotop --only @@ -94,66 +92,66 @@ If you would like to check which process are actually doing IO then run the ioto [![][9]![][9]][11] -**Details:** +**细节:** - * **`IO:`** It shows I/O utilization for each process, which includes disk and swap. - * **`SWAPIN:`** It shows only the swap usage of each process. + * **`IO:`** 它显示每个进程的 I/O 利用率,包含磁盘和交换。 + * **`SWAPIN:`** 它只显示每个进程的交换使用率。 -### What Is iostat? +### 什么是 iostat? -iostat is used to report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions. +iostat 被用来报告中央处理单元(CPU)的统计和设备与分区的输出/输出的统计。 -The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. +iostat 命令通过观察与他们平均传输率相关的设备活跃时间来监控系统输入/输出设备载入。 -The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks. +iostat 命令生成的报告可以被用来改变系统配置来更好的平衡物理磁盘之间的输入/输出负载。 -All statistics are reported each time the iostat command is run. The report consists of a CPU header row followed by a row of CPU statistics. +所有的统计都在 iostat 命令每次运行时被报告。该报告包含一个 CPU 头部,后面是一行 CPU 统计。 -On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of statistics for each device that is configured. +在多处理器系统中,CPU 统计被计算为系统层面的所有处理器的平均值。一个设备头行显示后紧跟一行每个配置设备的统计。 -The iostat command generates two types of reports, the CPU Utilization report and the Device Utilization report. +iostat 命令生成两种类型的报告,CPU 利用率报告和设备利用率报告。 -### How To Install iostat In Linux? +### 在 Linux 中怎样安装 iostat? -iostat tool is part of sysstat package so, We can easily install it with help of package manager since the package is available in all the Linux distributions repository. +iostat 工具是 sysstat 包的一部分,所以我们可以轻松地在包管理器地帮助下安装因为在所有的 Linux 发行版的仓库都是可以获得的。 -For **`Fedora`** system, use **[DNF Command][3]** to install sysstat. +对于 **`Fedora`** 系统,使用 **[DNF Command][3]** 来安装 sysstat。 ``` $ sudo dnf install sysstat ``` -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install sysstat. +对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET Command][4]** 或者 **[APT Command][5]** 来安装 sysstat。 ``` $ sudo apt install sysstat ``` -For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install sysstat. +对于基于 **`Arch Linux`** 的系统,使用 **[Pacman Command][6]** 来安装 sysstat。 ``` $ sudo pacman -S sysstat ``` -For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install sysstat. +对于 **`RHEL/CentOS`** 系统,使用 **[YUM Command][7]** 来安装 sysstat。 ``` $ sudo yum install sysstat ``` -For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install sysstat. +对于 **`openSUSE Leap`** 系统,使用 **[Zypper Command][8]** 来安装 sysstat。 ``` $ sudo zypper install sysstat ``` -### How To Monitor Disk I/O Activity/Statistics In Linux Using sysstat Command? +### 在 Linux 中如何使用 sysstat 命令监控磁盘 I/O 活动/统计? -There are many options are available in iostat command to check varies statistics about disk I/O and CPU. +在 iostat 命令中有很多参数来检查关于 I/O 和 CPU 的变化统计信息。 -Run the iostat command without any arguments to see complete statistics of the system. +不加参数运行 iostat 命令会看到完整的系统统计。 ``` # iostat @@ -171,7 +169,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -Run the iostat command with `-d` option to see I/O statistics for all the devices +运行 iostat 命令加上 `-d` 参数查看所有设备的 I/O 统计。 ``` # iostat -d @@ -186,7 +184,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -Run the iostat command with `-p` option to see I/O statistics for all the devices and their partitions. +运行 iostat 命令加上 `-p` 参数查看所有的设备和分区的 I/O 统计。 ``` # iostat -p @@ -208,7 +206,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -Run the iostat command with `-x` option to see detailed I/O statistics for all the devices. +运行 iostat 命令加上 `-x` 参数显示所有设备的详细的 I/O 统计信息。 ``` # iostat -x @@ -226,7 +224,7 @@ loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0. loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ``` -Run the iostat command with `-d [Device_Name]` option to see I/O statistics of particular device and their partitions. +运行 iostat 命令加上 `-d [设备名]` 参数查看具体设备和它的分区的 I/O 统计信息。 ``` # iostat -p [Device_Name] @@ -244,7 +242,7 @@ sda2 0.18 6.76 80.21 0.00 3112916 36924 sda1 0.00 0.01 0.00 0.00 3224 0 0 ``` -Run the iostat command with `-m` option to see I/O statistics with `MB` for all the devices instead of `KB`. By default it shows the output with KB. +运行 iostat 命令加上 `-m` 参数以 `MB` 为单位而不是 `KB` 查看所有设备的统计。默认以 KB 显示输出。 ``` # iostat -m @@ -262,7 +260,7 @@ loop1 0.00 0.00 0.00 0.00 1 loop2 0.00 0.00 0.00 0.00 1 0 0 ``` -Run the iostat command with certain interval then use the following format. In this example, we are going to capture totally two reports at five seconds interval. +运行 iostat 命令使用特定的间隔使用如下的格式。在这个例子中,我们打算以 5 秒捕获的间隔捕获两个报告。 ``` # iostat [Interval] [Number Of Reports] @@ -292,7 +290,7 @@ loop1 0.00 0.00 0.00 0.00 0 loop2 0.00 0.00 0.00 0.00 0 0 0 ``` -Run the iostat command with `-N` option to see the LVM disk I/O statistics report. +运行 iostat 命令 与 `-N` 参数来查看 LVM 磁盘 I/O 统计报告。 ``` # iostat -N @@ -309,7 +307,7 @@ sdc 0.01 0.12 0.00 2108 0 2g-2gvol1 0.00 0.07 0.00 1204 0 ``` -Run the nfsiostat command to see the I/O statistics for Network File System(NFS). +运行 nfsiostat 命令来查看 Network File System(NFS)的 I/O 统计。 ``` # nfsiostat @@ -321,7 +319,7 @@ via: https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[warmfrog](https://github.com/warmfrog) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 278504d64355063affe539e72a583cf91544aa2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Tue, 30 Apr 2019 00:01:59 +0800 Subject: [PATCH 0204/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=86=85=E5=AE=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成command line restart network --- ...art a Network in Ubuntu -Beginner-s Tip.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 790c990dfa..23e93927d1 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -12,7 +12,7 @@ 你 [using an Ubuntu-based system and you just can’t seem to connect to your network][1]? 你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决. -在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络服务的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: +在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: ![Ubuntu Restart Network][2] @@ -34,19 +34,19 @@ sudo service network-manager restart #### 2\. systemd -The **service** command is just a wrapper for this method (and also for init.d scripts and Upstart commands). The **systemctl** command is much more versatile than **service**. This is what I usually prefer. +**service** 命令仅仅是该命令的一个封装命令(同样的还有 init.d 系列脚本和 Upstart 相关命令)。 **systemctl** 命令的功能远多于 **service** 命令。通常我更喜欢使用这个命令。 ``` sudo systemctl restart NetworkManager.service ``` -这是,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考帮助文档(man page). +这时,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考 man 帮助文档。 #### 3\. nmcli -这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为很容易使用。 +这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为它非常容易使用。 -这种方法有两个操作步骤:关闭网络,重新开启网络。 +这种方法有两个操作步骤:关闭网络,再开启网络。 ``` sudo nmcli networking off @@ -58,7 +58,7 @@ sudo nmcli networking off sudo nmcli networking on ``` -你可以通过帮助文档(man page)了解 nmcli 的更多使用方法。 +你可以通过 man 帮助文档了解 nmcli 的更多用法。 #### 4\. ifup & ifdown @@ -76,47 +76,47 @@ sudo ifdown -a && sudo ifup -a **Bonus tool: nmtui (click to expand)** -This is another method often used by system administrators. It is a text menu for managing networks right in your terminal. +这是系统管理员们常用的另外一种方法。它是在命令行终端中管理网络的文本菜单工具。 ``` nmtui ``` -这样会打开如下菜单: +这样就会打开如下菜单: ![nmtui Menu][5] -**Note** that in **nmtui** , you can select another option by using the **up** and **down arrow keys**. +**注意** 在 **nmtui** 中,你可以通过 **up** 和 **down 方向键** 选择选项。 -Select **Activate a connection** : +选择 **Activate a connection** : ![nmtui Menu Select "Activate a connection"][6] -Press **Enter**. This should now open the **connections** menu. +按下 **Enter** 键,打开 **connections** 菜单。 ![nmtui Connections Menu][7] -Here, go ahead and select the network with a **star (*)** next to it. In my case, it’s MGEO72. +接下来,选择前面带 **星号 (*)** 的网络。在这个例子中,就是 MGEO72 。 ![Select your connection in the nmtui connections menu.][8] -Press **Enter**. This should **deactivate** your connection. +按下 **Enter** 键。这样就 **关闭** 你的网络连接。 ![nmtui Connections Menu with no active connection][9] -Select the connection you want to activate: +选择你要连接的网络: ![Select the connection you want in the nmtui connections menu.][10] -Press **Enter**. This should reactivate the selected connection. +按下 **Enter** 键。这样就重启了所选择的网络连接。 ![nmtui Connections Menu][11] -双击 **Tab** 键,选择到 **Back** : +双击 **Tab** 键,选择 **Back** : ![Select "Back" in the nmtui connections menu.][12] -按下 **Enter**。这样就会回到 **nmtui** 主菜单。 +按下 **Enter** 键。这样就会回到 **nmtui** 的主菜单。 ![nmtui Main Menu][13] From d8cb23cae3f8b270a14275f97249969ed50c73d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Tue, 30 Apr 2019 00:30:57 +0800 Subject: [PATCH 0205/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E9=83=A8=E5=88=862?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成command line restart network --- ...w to Restart a Network in Ubuntu -Beginner-s Tip.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 23e93927d1..d599988024 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -10,7 +10,7 @@ 如何在 Ubuntu 中重启网络服务 [新手提示] ====== -你 [using an Ubuntu-based system and you just can’t seem to connect to your network][1]? 你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决. +你 [是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: @@ -62,17 +62,17 @@ sudo nmcli networking on #### 4\. ifup & ifdown -这两个命令是直接操作网卡,, changing it’s state to one in which it either can or can not transmit and receive data. It’s one of the [must know networking commands in Linux][4]. +这两个命令是直接操作网口,将网口状态xxx。这是 [Linux 中最应该了解的网络命令][4] 之一。 -To shut down all network interfaces, use ifdown and then use ifup to turn all network interfaces back on. +使用 ifdown 关闭所有网口,再使用 ifup 重新启用网口。 -A good practice would be to combine both of these commands: +通常推荐的做法是将这两个命令一起使用。 ``` sudo ifdown -a && sudo ifup -a ``` -**Note:** This method will not make the network icon in your systray disappear, and yet you won’t be able to have a connection of any sort. +**注意:** 这种方法不会让网络图标从系统托盘中消失,另外,你也无法进行网络连接。 **Bonus tool: nmtui (click to expand)** From a137fb3a30652826af907fe07eda9e4cd33141d5 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Mon, 29 Apr 2019 17:00:20 +0000 Subject: [PATCH 0206/1154] Revert "RHSNOW is going to translating this article. (#12941)" This reverts commit a32eca9bdca0d8e201d7f25fc4321b3cdf57ea65. --- .../tech/20180116 How To Create A Bootable Zorin OS USB Drive.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md b/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md index 15043628e0..4ab7fea3f6 100644 --- a/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md +++ b/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md @@ -1,4 +1,3 @@ -RHSNOW is translating. How To Create A Bootable Zorin OS USB Drive ====== ![Zorin OS][17] From 12d918c61e1ee9580c546695bfe56407355fa8a0 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Mon, 29 Apr 2019 17:00:35 +0000 Subject: [PATCH 0207/1154] Revert "Update 20181231 Troubleshooting hardware problems in Linux.md" This reverts commit 1d9bf6f10e767a7159cec8615fbb0c28f99fffd8. --- .../tech/20181231 Troubleshooting hardware problems in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181231 Troubleshooting hardware problems in Linux.md b/sources/tech/20181231 Troubleshooting hardware problems in Linux.md index 724a1c35a3..dcc89034db 100644 --- a/sources/tech/20181231 Troubleshooting hardware problems in Linux.md +++ b/sources/tech/20181231 Troubleshooting hardware problems in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (suphgcm) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 570770450855129cc167b9ca43a029eada874177 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 30 Apr 2019 08:45:33 +0800 Subject: [PATCH 0208/1154] translated --- ... open software projects you should know.md | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/sources/tech/20190422 8 environment-friendly open software projects you should know.md b/sources/tech/20190422 8 environment-friendly open software projects you should know.md index 11885c8d2a..9d5378ddc2 100644 --- a/sources/tech/20190422 8 environment-friendly open software projects you should know.md +++ b/sources/tech/20190422 8 environment-friendly open software projects you should know.md @@ -7,33 +7,32 @@ [#]: via: (https://opensource.com/article/19/4/environment-projects) [#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger) -8 environment-friendly open software projects you should know +8 个你应该了解的环保开源项目 ====== -Celebrate Earth Day by contributing to these projects dedicated to -improving our environment. +通过给这些致力于提升环境的项目做贡献来庆祝地球日。 ![][1] -For the last few years, I've been helping [Greenpeace][2] build its first fully open source software project, Planet 4. [Planet 4][3] is a global engagement platform where Greenpeace supporters and activists can interact and engage with the organization. The goal is to drive people to action on behalf of our planet. We want to invite participation and use people power to battle global issues like climate change and plastic pollution. Developers, designers, writers, contributors, and others who are looking for an open source way to support environmentalism are more than welcome to [get involved][4]! +在过去的几年里,我一直在帮助 [Greenpeace][2] 建立其第一个完全开源的项目,Planet 4. [Planet 4][3] 是一个全球参与平台,Greenpeace 的支持者和活动家可以互动并参与组织。它的目标是让人们代表我们的星球采取行动。我们希望邀请参与并利用人力来应对气候变化和塑料污染等全球性问题。它们正在寻找开发者、设计师、作者、贡献者和其他通过开源支持环保主义的人都非常欢迎[参与进来][4]! -Planet 4 is far from the only open source project focused on the environment. For Earth Day, I thought I'd share seven other open source projects that have our planet in mind. +Planet 4 远非唯一关注环境的开源项目。对于地球日,我会分享其他七个关注我们星球的开源项目。 -**[Eco Hacker Farm][5]** works to support sustainable communities. It advises and supports projects combining hackerspaces/hackbases and permaculture living. The organization also has online software projects. Visit its [wiki][6] or reach out on [Twitter][7] to learn more about what Eco Hacker Farm is doing. +**[Eco Hacker Farm][5]** 致力于支持可持续社区。它建议并支持将黑客空间/黑客基地和永续农业生活结合在一起的项目。该组织还有在线项目。访问其 [wiki][6] 或 [Twitter][7] 了解有关 Eco Hacker Farm 正在做的更多信息。 -**[Public Lab][8]** is an open community and nonprofit organization that works to put science in the hands of citizens. Formed after the BP oil disaster in 2010, Public Lab works with open source to aid environmental exploration and investigation. It's a diverse community with lots of ways to [contribute][9]. +**[Public Lab][8]** 是一个开放社区和非营利组织,它致力于将科学掌握在公民手中。它于 2010 年在 BP 石油灾难后形成,Public Lab 与开源合作,协助环境勘探和调查。它是一个多元化的社区,有很多方法可以做[贡献][9]。 -A while back, Don Watkins, a community moderator here on Opensource.com, wrote about **[Open Climate Workbench][10]** , a project from the Apache Foundation. The [OCW][11] provides software to do climate modeling and evaluation, which can have all sorts of applications. +不久前,Opensource.com 的管理 Don Watkins 撰写了一篇 **[Open Climate Workbench][10]** 的文章,该项目来自 Apache 基金会。 [OCW][11] 提供了进行气候建模和评估的软件,可用于各种应用。 -**[Open Source Ecology][12]** is a project that aims to improve how our economy functions. With an eye on environmental regeneration and social justice, the project seeks to redefine some of our dirty production and distribution techniques to create a more sustainable civilization. +**[Open Source Ecology][12]** 是一个旨在改善经济运作方式的项目。该项目着眼于环境再生和社会公正,它旨在重新定义我们的一些肮脏的生产和分配技术,以创造一个更可持续的文明。 -Fostering collaboration around open source and big data tools to enable research in ocean, atmosphere, land, and climate, " **[Pangeo][13]** is first and foremost a community promoting open, reproducible, and scalable science." Big data can change the world! +促进开源和大数据工具之间的合作,以实现海洋、大气、土地和气候的研究,“ **[Pangeo][13]** 是第一个推广开放、可重复和可扩展科学的社区。”大数据可以改变世界! -**[**Leaflet**][14]** is a well-known open source JavaScript library. It can be used for all sorts of things, including environmentally friendly projects like the [Arctic Web Map][15], which allows scientists to accurately visualize and analyze the arctic region, a critical ability for climate research. +**[Leaflet][14]** 是一个著名的开源 JavaScript 库。它可以做各种各样的事情,包括环保项目,如 [Arctic Web Map][15],它能让科学家准确地可视化和分析北极地区,这是气候研究的关键能力。 -And of course, no list would be complete (not that this is a complete list!) without pointing to my friends at Mozilla. The **[Mozilla Science Lab][16]** community is, like all of Mozilla, fiercely open, and it's committed to bringing open source principles to the scientific community. Its projects and communities enable scientists to do the sorts of research our world needs to address some of the most pervasive environmental issues. +当然,没有我在 Mozilla 的朋友就没有这个列表(不是这个完整的列表!)。**[Mozilla Science Lab][16]** 社区就像所有 Mozilla 项目一样,非常开放,它致力于将开源原则带给科学界。它的项目和社区使科学家能够进行我们世界所需的各种研究,以解决一些最普遍的环境问题。 -### How you can contribute +### 如何贡献 -This Earth Day, make a six-month commitment to contribute some of your time to an open source project that helps fight climate change or otherwise encourages people to step up for Mother Earth. There must be scores of environmentally minded open source projects out there, so please leave your favorites in the comments! +在这个地球日,做为期六个月的承诺,将一些时间贡献给一个有助于应对气候变化的开源项目,或以其他方式鼓励人们保护地球母亲。肯定还有许多关注环境的开源项目,所以请在评论中留言! -------------------------------------------------------------------------------- @@ -41,7 +40,7 @@ via: https://opensource.com/article/19/4/environment-projects 作者:[Laura Hilliger][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 37d64b8c9f031379454d9aa565b6d6be43160aec Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 30 Apr 2019 08:46:15 +0800 Subject: [PATCH 0209/1154] translated --- ...environment-friendly open software projects you should know.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190422 8 environment-friendly open software projects you should know.md (100%) diff --git a/sources/tech/20190422 8 environment-friendly open software projects you should know.md b/translated/tech/20190422 8 environment-friendly open software projects you should know.md similarity index 100% rename from sources/tech/20190422 8 environment-friendly open software projects you should know.md rename to translated/tech/20190422 8 environment-friendly open software projects you should know.md From e433c27dbba39ffe0872045d4216de94726b91ec Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 30 Apr 2019 08:53:59 +0800 Subject: [PATCH 0210/1154] translating --- .../20180605 How to use autofs to mount NFS shares.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sources/tech/20180605 How to use autofs to mount NFS shares.md b/sources/tech/20180605 How to use autofs to mount NFS shares.md index 815cb53708..69325a0670 100644 --- a/sources/tech/20180605 How to use autofs to mount NFS shares.md +++ b/sources/tech/20180605 How to use autofs to mount NFS shares.md @@ -1,3 +1,12 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use autofs to mount NFS shares) +[#]: via: (https://opensource.com/article/18/6/using-autofs-mount-nfs-shares) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + How to use autofs to mount NFS shares ====== From 19ef81248d2b803af7ef4efa3046cd2fd182583d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 30 Apr 2019 12:22:17 +0800 Subject: [PATCH 0211/1154] PRF:20180828 Linux for Beginners- Moving Things Around.md @warmfrog --- ...nux for Beginners- Moving Things Around.md | 117 +++++++++--------- 1 file changed, 58 insertions(+), 59 deletions(-) diff --git a/translated/tech/20180828 Linux for Beginners- Moving Things Around.md b/translated/tech/20180828 Linux for Beginners- Moving Things Around.md index a2c10150f1..9ae8f5d3bf 100644 --- a/translated/tech/20180828 Linux for Beginners- Moving Things Around.md +++ b/translated/tech/20180828 Linux for Beginners- Moving Things Around.md @@ -1,107 +1,106 @@ -Linux 初学者: 移动文件 +Linux 初学者:移动文件 ===================== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/filesystem-linux.jpg?itok=NQCoYl1f) -在之前的该系列的部分中,[你学习了有关目录][1]和[访问目录的权限是如何工作的][2]。你在这些文章中学习的大多数都可应用于文件,除了如何让一个文件变得可执行。 +在之前的该系列的部分中,[你学习了有关目录][1]和[访问目录][2][的权限][7]是如何工作的。你在这些文章中学习的大多数内容都可应用于文件,除了如何让一个文件变成可执行文件。 因此让我们在开始之前先解决这个问题。 -### 不需要 .exe 文件 +### 不需要 .exe 扩展名 -在其他操作系统中,一个文件的性质通常由它的后缀决定。如果一个文件有一个 _.jpg_ 扩展,操作系统会认为它是一幅图像;如果它以 _.wav_ 结尾, 它是一个音频文件; 如果它在文件名末尾 以 _.exe_ 结尾, 它就是一个你可以执行的程序。 +在其他操作系统中,一个文件的性质通常由它的后缀决定。如果一个文件有一个 .jpg 扩展,操作系统会认为它是一幅图像;如果它以 .wav 结尾,它是一个音频文件;如果它在文件名末尾以 .exe 结尾,它就是一个你可以执行的程序。 -这导致了严重的问题,像木马伪装成文件。幸运的是,在 Linux 下事务不是这样运行的。可以确定的是,你可能会看到有些可执行文件是以 _.sh_ 结尾暗示他们是可执行的脚本,但是这大部分是为了利于人类识别的文件,和你使用 `ls --color` 的方式相同,可执行文件的名字以亮绿色显示。 +这导致了严重的问题,比如说木马可以伪装成文档文件。幸运的是,在 Linux 下事物不是这样运行的。可以确定的是,你可能会看到有些可执行文件是以 .sh 结尾暗示它们是可执行的脚本,但是这大部分是为了便于人眼找到文件,就像你使用 `ls --color` 将可执行文件的名字以亮绿色显示的方式相同。 + +事实上大多数应用根本没有扩展名。决定一个文件是否是一个真正程序的是 `x` (指*可执行的*)位。你可以通过运行以下命令使任何文件变得可执行, -事实上大多数应用根本没有扩展。决定一个文件是否是一个真正程序的是 _x_ (用于_可执行的_) 位。你可以通过运行以下命令使任何文件变得可执行: ``` chmod a+x some_program - ``` -而不管它的扩展名是什么或者是否存在。在上面命令中的 `x` 设置了 _x_ 位,`a` 说明你为_所有_用户设置它。你同样可以为一组用户设置成拥有这个文件 (`g+x`),或者设置为只有一个用户,拥有着 (`u+x`)。 +而不管它的扩展名是什么或者是否存在。在上面命令中的 `x` 设置了 `x` 位,`a` 说明你为*所有*用户设置它。你同样可以为一组用户设置成拥有这个文件(`g+x`),或者只为一个用户——拥有者——设置 (`u+x`)。 + +尽管我们会在该系列之后的部分包含从命令行创建和运行脚本的内容,并学习通过输入它的路径并在结尾加上程序名的方式运行一个程序: -尽管我们会在该系列之后部分包含从命令行创建和运行脚本的内容,并学习到你可以通过输入它的路径并在结尾加上程序名的方式运行一个程序: ``` path/to/directory/some_program - ``` 或者,如果你当前在相同目录,你可以使用: + ``` ./some_program - ``` 还有其他方式可以使你的程序在目录树的任意位置运行 (提示:查询 `$PATH` 环境变量),但是当我们讨论 shell 脚本的时候你会读到这些。 -### 复制,移动,链接 +### 复制、移动、链接 -明显地,有更多的方式来从命令行修改和处理文件,而不仅仅是处理它们的权限。当你试图打开一个不存在的文件是,大多数应用会创建一个新文件。如果 _test.txt_ 当前并不存在,下列命令 +明显地,从命令行修改和处理文件有很多的方式,而不仅仅是处理它们的权限。当你试图打开一个不存在的文件是,大多数应用会创建一个新文件。如果 `test.txt` 当前并不存在,下列命令: ``` nano test.txt - ``` ``` vim test.txt - ``` -([nano][3] 和 [vim][4] 是流行的命令行文本编辑器) 都将为你创建一个空的 _test.txt_ 文件来编辑。 +([nano][3] 和 [vim][4] 是流行的命令行文本编辑器)都将为你创建一个空的 `test.txt` 文件来编辑。 + +你可以通过 “触摸” (`touch`)来创建一个空的文件, -你可以通过 “触摸” (touching, 触摸)来创建一个空的文件: ``` touch test.txt - ``` 会创建一个文件,但是不会在任何应用中打开它。 -你可以使用 `cp` 来拷贝一个文件到另一个位置或者使用一个不同的名字: +你可以使用 `cp` 来拷贝一个文件到另一个位置,或者使用一个不同的名字: + ``` cp test.txt copy_of_test.txt - ``` 你也可以拷贝一堆文件: + ``` cp *.png /home/images - ``` -上面的命令拷贝当前目录下的所有 PNG 文件到相对你的 home 目录下的 _images/_ 目录。在你尝试之前 _images/_ 目录必须存在, 不然 `cp` 将显示一个错误。同样的,警惕,当你复制一个文件到一个已经包含相同名字的文件的目录时, `cp` 会静默地用新文件覆盖老的文件。 +上面的命令拷贝当前目录下的所有 PNG 文件到相对你的主目录下的 `images/` 目录。在你尝试之前 `images/` 目录必须存在, 不然 `cp` 将显示一个错误。同样的,警惕,当你复制一个文件到一个已经包含相同名字的文件的目录时,`cp` 会静默地用新文件覆盖老的文件。 + +你可以使用: -你可以使用 ``` cp -i *.png /home/images - ``` -如果你想要 `cp` 命令在有任何危险时警告你 (`-i` 选项代表 _交互式的_)。 +如果你想要 `cp` 命令在有任何危险时警告你 (`-i` 选项代表*交互式的*)。 你同样可以复制整个目录,但是为了做到这样,你需要 `-r` 选项: + ``` cp -rv directory_a/ directory_b - ``` -`-r` 选项代表 _递归_,意味着 `cp` 会向下探索目录 _directory_a_,复制所有的文件和子目录下内部包含的。我个人喜欢包含 `-v` 选项,因为它使 `cp` 冗长而啰嗦,意味着它会显示你当前它正在做什么而不是仅仅静默的复制然后存在。 +`-r` 选项代表*递归*,意味着 `cp` 会向下探索目录 `directory_a`,复制所有的文件和子目录下内部包含的。我个人喜欢包含 `-v` 选项,因为它使 `cp` 冗长而啰嗦,意味着它会显示你当前它正在做什么而不是仅仅静默的复制然后存在。 `mv` 命令移动东西。也就是说,它移动文件从一个位置到另一个位置。最简单的形式,`mv` 表现的更像 `cp`: + ``` mv test.txt new_test.txt - ``` -上面的命令使 _new_test.txt_ 出现, _test.txt_ 消失。 +上面的命令使 `new_test.txt` 出现,`test.txt` 消失。 + ``` mv *.png /home/images - ``` -移动当前目录下所有的 PNG 文件到相对于你的 home 目录的 _images/_ 目录。同样的你必须小心你没有意外的覆盖已存在的文件。使用 +移动当前目录下所有的 PNG 文件到相对于你的主目录的 `images/` 目录。同样的你必须小心你没有意外的覆盖已存在的文件。使用 + ``` mv -i *.png /home/images @@ -109,55 +108,56 @@ mv -i *.png /home/images 如果你想站在安全的角度,你可以使用与 `cp` 相同的方式。 -除了移动与拷贝的不同外,另一个 `mv` 和 `cp` 之间的不同是当你移动目录时: +除了移动与拷贝的不同外,另一个 `mv` 和 `cp` 之间的不同是当你移动目录时: + ``` mv directory_a/ directory_b - ``` -不需要添加递归的标志。这是因为你实际做的是重命名一个目录,与第一个例子相同,你做的是重命名文件。实际上,即使你 “移动” 一个文件从一个目录到另一个目录,只要两个目录在相同的存储设备和分区,你就是在重命名文件。 +不需要添加递归的标志。这是因为你实际做的是重命名一个目录,与第一个例子相同,你做的是重命名文件。实际上,即使你从一个目录到另一个目录 “移动” 一个文件,只要两个目录在相同的存储设备和分区,你就是在重命名文件。 + +你可以做一个实验来证明。 `time` 是一个工具来让你测量一个命令花费多久来执行。找一个非常大的文件,可以是几百 MB 甚至 几 GB (例如一个长视频),像下方这样尝试拷贝到另一个目录: -你可以做一个实验来证明。 `time` 是一个工具来让你测量一个命令花费多久来执行。找一个非常大的文件,可以是几百 MBs 甚至 几 GBs (例如一个长视频),像下方这样尝试拷贝到另一个目录: ``` $ time cp hefty_file.mkv another_directory/ real 0m3,868s user 0m0,016s sys 0m0,887s - ``` -黑体是你必须输入命令行的,下面是 `time` 的输出。需要关注的是第一行, _real_ 时间。它花费了几乎 4 秒来拷贝 355 MBs 的 _hefty_file.mkv_ 到 _another_directory/_ 目录。 +下面是 `time` 的输出。需要关注的是第一行, real 时间。它花费了几乎 4 秒来拷贝 355 MB 的 `hefty_file.mkv` 到 `another_directory/` 目录。 现在让我们尝试移动它: + ``` $ time mv hefty_file.mkv another_directory/ real 0m0,004s user 0m0,000s sys 0m0,003s - ``` -移动几乎是瞬时的!这是违反直觉的,因为看起来 `mv` 必须复制这个文件然后删除原来的。这是 `mv` 对比 `cp` 命令必须做的两件事。但是,实际上,`mv` 扩了 1000 倍。 +移动几乎是瞬时的!这是违反直觉的,因为看起来 `mv` 必须复制这个文件然后删除原来的。这是 `mv` 对比 `cp` 命令必须做的两件事。但是,实际上,`mv` 快了 1000 倍。 -这是因为文件系统结构中,它的所有目录树,只为了让用户便利而存在。在每个分区的开始,有一个称作 _分区表_ 的东西告诉操作系统在实际的物理磁盘上去哪找每个文件。在磁盘上,数据没有分为目录甚至是文件。[作为替代的是轨道,扇区和簇][5]。当你在相同分区 “移动” 一个文件时,操作系统实际做的仅仅是在分区表中改变了那个文件的入口,但它仍然指向磁盘上相同的簇信息。 +这是因为文件系统结构中,它的所有目录树,只为了让用户便利而存在。在每个分区的开始,有一个称作*分区表*的东西告诉操作系统在实际的物理磁盘上去哪找每个文件。在磁盘上,数据没有分为目录甚至是文件。[作为替代的是轨道、扇区和簇][5]。当你在相同分区 “移动” 一个文件时,操作系统实际做的仅仅是在分区表中改变了那个文件的入口,但它仍然指向磁盘上相同的簇信息。 是的!移动是一个谎言!至少在相同分区下是。如果你试图移动一个文件到一个不同的分区或者不同的设备, `mv` 仍然很快,但可以察觉到它比在相同分区下移动文件慢了。这是因为实际上发生了复制和清除数据。 ### 重命名 -有几个不同的命令行 `rename` 工具。没有一个像 `cp` 和 `mv` 那样固定并且他们工作的方式都有一点不同。他们相同的一点是他们被用来改变文件名的部分。 +有几个不同的命令行 `rename` 工具。没有一个像 `cp` 和 `mv` 那样固定,并且它们工作的方式都有一点不同,相同的一点是它们都被用来改变文件名的部分。 + +在 Debian 和 Ubuntu 中, 默认的 `rename` 工具使用 [正则表达式][6](字符组成的字符串模式)来大量的改变目录中的文件。命令: -在 Debian 和 Ubuntu 中, 默认的 `rename` 工具使用 [正则表达式][6] (字符组成的字符串图案)来大量的改变目录中的文件。命令: ``` rename 's/\.JPEG$/.jpg/' * - ``` -将改变所有扩展为 _JPEG_ 的文件为 _jpg_ 。文件 _IMG001.JPEG_ 变成 _IMG001.jpg_, _my_pic.JPEG_ 变成 _my_pic.jpg_ , 等等。 +将改变所有扩展名为 `JPEG` 的文件为 `jpg`。文件 `IMG001.JPEG` 变成 `IMG001.jpg`、 `my_pic.JPEG` 变成 `my_pic.jpg`,等等。 -另一个 `rename` 版本默认在 Manjaro 上可获得,一个 Arch 的衍生版,更简单,但是可能没有那么强大: -``` rename .JPEG .jpg * +另一个 `rename` 版本默认在 Manjaro 上可获得,这是一个 Arch 的衍生版,更简单,但是可能没有那么强大: +``` +rename .JPEG .jpg * ``` 这和你之前看到的上面做相同的重命名操作。在这个版本,`.JPEG` 是你想改变的字符组成的字符串,`.jpg` 是你想要改变成为的,`*` 表示当前目录下的所有文件。 @@ -167,36 +167,35 @@ rename 's/\.JPEG$/.jpg/' * ### 了解更多 查看 `mv` 和 `cp` 的 man 页面了解更多。运行 + ``` man cp - ``` - 或者 - ``` - man mv +或者 +``` +man mv +``` - ``` +来阅读这些命令自带的所有选项,这些使他们使用起来更强大和安全。 - 来阅读这些命令自带的所有选项,这些使他们使用起来更强大和安全。 +---------------------------------------------------------------------------- - ---------------------------------------------------------------------------- - - via: https://www.linux.com/blog/2018/8/linux-beginners-moving-things-around +via: https://www.linux.com/blog/2018/8/linux-beginners-moving-things-around 作者:[Paul Brown][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.linux.com/users/bro66 -[1]: https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux -[2]: https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2 +[1]: https://linux.cn/article-10066-1.html +[2]: https://linux.cn/article-10399-1.html [3]: https://www.nano-editor.org/ [4]: https://www.vim.org/ [5]: https://en.wikipedia.org/wiki/Disk_sector [6]: https://en.wikipedia.org/wiki/Regular_expression - +[7]: https://linux.cn/article-10370-1.html From 9c37a5bda98cd324946f175857d015b5031a0022 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 30 Apr 2019 12:22:47 +0800 Subject: [PATCH 0212/1154] PUB:20180828 Linux for Beginners- Moving Things Around.md @warmfrog https://linux.cn/article-10796-1.html --- .../20180828 Linux for Beginners- Moving Things Around.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180828 Linux for Beginners- Moving Things Around.md (100%) diff --git a/translated/tech/20180828 Linux for Beginners- Moving Things Around.md b/published/20180828 Linux for Beginners- Moving Things Around.md similarity index 100% rename from translated/tech/20180828 Linux for Beginners- Moving Things Around.md rename to published/20180828 Linux for Beginners- Moving Things Around.md From 0fe16a81b08fb691b9c485803d6afc879ce60343 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 30 Apr 2019 13:39:45 +0800 Subject: [PATCH 0213/1154] PRF:20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @arrowfeng --- ...their jobs -- despite the heavy demands.md | 54 ++++++++----------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md index 0a7eedfffb..bc5aa708a0 100644 --- a/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md +++ b/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -1,71 +1,59 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) [#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) -许多数据中心的工作者很满意他们的工作 -- 尽管要求很高 +许多数据中心的工作者很满意他们的工作,将鼓励他们的孩子继续从事这份工作 ====== -一份从事和数据中心知识的报告调查发现,在数据中心工作的人很满意他们的工作,因此他们将会鼓励他们的孩子从事这份工作。 + +> 一份 Informa Engage 和 Data Center Knowledge 的报告调查发现,在数据中心工作的人很满意他们的工作,因此他们将会鼓励他们的孩子从事这份工作。 + ![Thinkstock][1] +一份由 [Informa Engage 和 Data Center Knowledge][2] 主导的调查报告显示,数据中心的工作者总体上对他们的工作很满意。尽管对时间和大脑的要求很高,但是他们还是鼓励自己的孩子能从事这项工作。 -一份由[从事和数据中心知识][2]主导的调查报告显示,数据中心的工作者总体上对他们的工作很满意。尽管对时间和大脑的要求很高,但是他们还是鼓励自己的孩子能从事这项工作。 +总体满意度非常好,72% 的受访者普遍同意“我喜欢我目前的工作”这一说法,三分之一的受访者则表示非常同意。75% 的人同意声明,“如果我的孩子、侄女或侄子问,我将建议他们进入 IT 行业。” -总体满意度非常好,72%的受访者普遍同意“我喜欢我目前的工作”这一说法,三分之一的受访者则表示非常同意。 75%的人同意声明,“如果我的孩子,侄女或侄子问,我将建议他们进入IT行业。” +在数据中心工作的员工之中,有一种很重要的感觉,88% 的人觉得他们自己对于雇主的成功非常重要。 -**[ 另请阅读:[雄心壮志的IT专业人士为之奋斗的20个热门职位][3] ]** +尽管存在一些挑战,其中最主要的是技能和认证的缺乏。调查的受访者认为缺乏技能是最受关注的领域。只有 56% 的人认为他们需要完成工作所需的培训,74% 的人表示他们已经在 IT 行业工作了十多年。 -在数据中心工作的员工之中,有一种很重要的感觉,88%的人觉得他们自己对于雇主的成功非常重要。 +这个行业提供认证计划,每个主要的 IT 硬件供应商都有,但是 61% 的人表示在过去的 12 个月里他们并没有完成或者重新续订证书。有几个原因: -尽管存在一些挑战,其中最主要的是技能和认证的缺乏。 调查的受访者认为缺乏技能是最受关注的领域。 只有56%的人认为他们有完成工作所需的培训,74%的人表示他们已经在IT行业工作了十多年。 - -这个行业提供认证计划,每个主要的IT硬件供应商都有它们,但是61%的人表示在过去的12月里他们并没有完成或者重新续订证书。有几个原因。 - - -三分之一(34%)说是由于他们工作的组织缺乏培训预算,而24%的人认为是缺乏时间,16%的人表示管理者认为不需要培训,和另外16%的人表示在他们的工作地点没有培训计划。 - - -这并不让我感到惊讶,因为科技是世界上最开放的行业之一,在那里你可以找到培训和教育材料并自学。已经证实了[许多程序员是自学成才][4],包括行业巨头比尔盖茨,史蒂夫沃兹尼亚克,约翰卡马克和杰克多尔西。 - -**[[需要去提升你的技术职业生涯?这个全面的在线课程将教你如何去做。][5]** +三分之一(34%)说是由于他们工作的组织缺乏培训预算,而 24% 的人认为是缺乏时间,16% 的人表示管理者认为不需要培训,以及另外 16% 的人表示在他们的工作地点没有培训计划。 +这并不让我感到惊讶,因为科技是世界上最开放的行业之一,在那里你可以找到培训和教育材料并自学。已经证实了[许多程序员是自学成才][4],包括行业巨头比尔·盖茨、史蒂夫·沃兹尼亚克、约翰·卡马克和杰克·多尔西。 ### 数据中心工作者们的薪水 -数据中心工作者不会抱怨酬劳。当然,大部分不会。50%的人每年可以赚到$100,000甚至更多,然而11%的人赚的少于$40,000。三分之二的受访者来自于美国,因此那些低端人士可能在国外。 +数据中心工作者不会抱怨酬劳。当然,大部分不会。50% 的人每年可以赚到 $100,000 甚至更多,然而 11% 的人赚的少于 $40,000。三分之二的受访者来自于美国,因此那些低端收入人士可能在国外。 -有一个值得注意的差异。史蒂夫布朗是伦敦数据中心人力资源的总经理,他说软件工程师获得的薪水比硬件工程师多。 - - -布朗在这篇报道中说,“数据中心软件工程方面的工作可以与高收入的职业媲美,在物理基础设施——机械/电气方面的工作——情况并非如此。它更像是中层管理” +有一个值得注意的差异。史蒂夫·布朗是伦敦数据中心人力资源的总经理,他说软件工程师获得的薪水比硬件工程师多。 +布朗在这篇报道中说,“数据中心软件工程方面的工作可以与高收入的职业媲美,而在物理基础设施——机械/电气方面的工作——情况并非如此。它更像是中层管理。” ### 数据中心的专业人士仍然主要是男性 -最不令人惊讶的发现?10个受访者中有9个是男性。该行业正在调整解决性别歧视问题,但是现在没什么改变。 +最不令人惊讶的发现?10 个受访者中有 9 个是男性。该行业正在调整解决性别歧视问题,但是现在没什么改变。 +这篇报告的结论有一点不太好,但是我认为是错的: -这篇报告的结论有一点不详,但是我认为是错的: -> "随着数据中心基础设施完成云计算模式的过渡,软件进入到容器和微服务时代,数据中心剩下来的珍贵领导者——在20世界获得技能的人——可能会发现没有任何他们认识的东西能管理和没人去领导。当危机最终来临时,我们可能会感到震惊,但是我们不能说我们没有受到警告。" +> “随着数据中心基础设施完成云计算模式的过渡,软件进入到容器和微服务时代,数据中心剩下来的珍贵领导者——在 20 世纪获得技能的人——可能会发现没有任何他们了解的东西需要管理,也没有人需要他们领导。当危机最终来临时,我们可能会感到震惊,但是我们不能说我们没有受到警告。" - - -多少次我不得不说,[数据中心不会消失][6]。 - -加入[Facebook][7]和[Facebook][7]的网络世界社区,评论最重要的话题。 +我说过了很多次,[数据中心不会消失][6]。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all +via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html 作者:[Andy Patrizio][a] 选题:[lujun9972][b] 译者:[arrowfeng](https://github.com/arrowfeng) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 466f16105f6f76c44ddf4f2efbbac348d426278b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 30 Apr 2019 13:40:23 +0800 Subject: [PATCH 0214/1154] PUB:20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @arrowfeng https://linux.cn/article-10797-1.html --- ...kers happy with their jobs -- despite the heavy demands.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md (98%) diff --git a/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/published/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md similarity index 98% rename from translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md rename to published/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md index bc5aa708a0..01999af416 100644 --- a/translated/talk/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md +++ b/published/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10797-1.html) [#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) [#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) From c6b41b9750cdcb1f0371ac3e396095d7b2956e78 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 May 2019 00:11:01 +0800 Subject: [PATCH 0215/1154] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201904?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...50616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md | 0 ...50616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md | 0 .../20160301 How To Set Password Policies In Linux.md | 0 ...ntralized Peer To Peer File Sharing Commandline Application.md | 0 .../20171117 5 open source fonts ideal for programmers.md | 0 published/{ => 201904}/20171226 The shell scripting trap.md | 0 .../20180118 Rediscovering make- the power behind rules.md | 0 .../20180205 Rancher - Container Management Application.md | 0 ...12 Best GTK Themes for Ubuntu and other Linux Distributions.md | 0 published/{ => 201904}/20180718 3 Emacs modes for taking notes.md | 0 .../20180823 Getting started with Sensu monitoring.md | 0 .../20180828 Linux for Beginners- Moving Things Around.md | 0 ...003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md | 0 published/{ => 201904}/20181108 My Google-free Android life.md | 0 ...o Browse The Arch Wiki Pages As Linux Man Page from Offline.md | 0 .../20190104 Take to the virtual skies with FlightGear.md | 0 ...20190108 How To Understand And Identify File types in Linux.md | 0 ...0190118 Secure Email Service Tutanota Has a Desktop App Now.md | 0 ...Methods To Identify Disk Partition-FileSystem UUID On Linux.md | 0 .../20190204 Enjoy Netflix- You Should Thank FreeBSD.md | 0 .../20190208 Which programming languages should you learn.md | 0 ...tu 14.04 is Reaching the End of Life. Here are Your Options.md | 0 ...190309 Emulators and Native Linux games on the Raspberry Pi.md | 0 ...et-s get physical- How to use GPIO pins on the Raspberry Pi.md | 0 .../20190311 7 resources for learning to use your Raspberry Pi.md | 0 ...90311 Blockchain 2.0- Redefining Financial Services -Part 3.md | 0 ...bout computer security with the Raspberry Pi and Kali Linux.md | 0 ...90312 Do advanced math with Mathematica on the Raspberry Pi.md | 0 .../20190313 How to contribute to the Raspberry Pi community.md | 0 .../20190314 14 days of celebrating the Raspberry Pi.md | 0 .../20190314 A Look Back at the History of Firefox.md | 0 ...- An open source tool to help you decide on your dream home.md | 0 .../20190317 How To Configure sudo Access In Linux.md | 0 .../{ => 201904}/20190318 10 Python image manipulation tools.md | 0 ... To Check Whether A Port Is Open On The Remote Linux System.md | 0 ...ck To A Specific Parent Directory Using bd Command In Linux.md | 0 ...iple Remote Linux System Using Shell Script With nc Command.md | 0 .../{ => 201904}/20190325 Getting started with Vim- The basics.md | 0 .../20190326 Using Square Brackets in Bash- Part 1.md | 0 ...190327 Setting kernel command line arguments with Fedora 30.md | 0 .../{ => 201904}/20190328 How to run PostgreSQL on Kubernetes.md | 0 .../{ => 201904}/20190401 3 cool text-based email clients.md | 0 ... create a filesystem on a Linux partition or logical volume.md | 0 .../20190402 Parallel computation in Python with Dask.md | 0 .../20190402 Using Square Brackets in Bash- Part 2.md | 0 .../20190403 5 useful open source log analysis tools.md | 0 .../20190405 Streaming internet radio with RadioDroid.md | 0 .../{ => 201904}/20190407 Fixing Ubuntu Freezing at Boot Time.md | 0 ...0407 Happy 14th anniversary Git- What do you love about Git.md | 0 .../20190408 Bash vs. Python- Which language should you use.md | 0 ...Google reenergize multicloud-hybrid cloud joint development.md | 0 published/{ => 201904}/20190409 Enhanced security at the edge.md | 0 .../20190409 Four Methods To Add A User To Group In Linux.md | 0 ...20190409 How To Install And Enable Flatpak Support On Linux.md | 0 .../20190410 How To Check The List Of Open Ports In Linux.md | 0 .../{ => 201904}/20190410 Managing Partitions with sgdisk.md | 0 ...0190413 How to Zip Files and Folders in Linux -Beginner Tip.md | 0 published/{ => 201904}/20190413 The Fargate Illusion.md | 0 ...20190415 Getting started with Mercurial for version control.md | 0 .../20190415 How to identify duplicate files on Linux.md | 0 .../{ => 201904}/20190416 How to Install MySQL in Ubuntu Linux.md | 0 ...dern Command Line HTTP Client For Curl And Wget Alternative.md | 0 .../{ => 201904}/20190417 Managing RAID arrays with mdadm.md | 0 ... workers happy with their jobs -- despite the heavy demands.md | 0 ...tu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md | 0 .../20190419 4 cool new projects to try in COPR for April 2019.md | 0 .../20190420 New Features Coming to Debian 10 Buster Release.md | 0 67 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201904}/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md (100%) rename published/{ => 201904}/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md (100%) rename published/{ => 201904}/20160301 How To Set Password Policies In Linux.md (100%) rename published/{ => 201904}/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md (100%) rename published/{ => 201904}/20171117 5 open source fonts ideal for programmers.md (100%) rename published/{ => 201904}/20171226 The shell scripting trap.md (100%) rename published/{ => 201904}/20180118 Rediscovering make- the power behind rules.md (100%) rename published/{ => 201904}/20180205 Rancher - Container Management Application.md (100%) rename published/{ => 201904}/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md (100%) rename published/{ => 201904}/20180718 3 Emacs modes for taking notes.md (100%) rename published/{ => 201904}/20180823 Getting started with Sensu monitoring.md (100%) rename published/{ => 201904}/20180828 Linux for Beginners- Moving Things Around.md (100%) rename published/{ => 201904}/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md (100%) rename published/{ => 201904}/20181108 My Google-free Android life.md (100%) rename published/{ => 201904}/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md (100%) rename published/{ => 201904}/20190104 Take to the virtual skies with FlightGear.md (100%) rename published/{ => 201904}/20190108 How To Understand And Identify File types in Linux.md (100%) rename published/{ => 201904}/20190118 Secure Email Service Tutanota Has a Desktop App Now.md (100%) rename published/{ => 201904}/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md (100%) rename published/{ => 201904}/20190204 Enjoy Netflix- You Should Thank FreeBSD.md (100%) rename published/{ => 201904}/20190208 Which programming languages should you learn.md (100%) rename published/{ => 201904}/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md (100%) rename published/{ => 201904}/20190309 Emulators and Native Linux games on the Raspberry Pi.md (100%) rename published/{ => 201904}/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md (100%) rename published/{ => 201904}/20190311 7 resources for learning to use your Raspberry Pi.md (100%) rename published/{ => 201904}/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md (100%) rename published/{ => 201904}/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md (100%) rename published/{ => 201904}/20190312 Do advanced math with Mathematica on the Raspberry Pi.md (100%) rename published/{ => 201904}/20190313 How to contribute to the Raspberry Pi community.md (100%) rename published/{ => 201904}/20190314 14 days of celebrating the Raspberry Pi.md (100%) rename published/{ => 201904}/20190314 A Look Back at the History of Firefox.md (100%) rename published/{ => 201904}/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md (100%) rename published/{ => 201904}/20190317 How To Configure sudo Access In Linux.md (100%) rename published/{ => 201904}/20190318 10 Python image manipulation tools.md (100%) rename published/{ => 201904}/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md (100%) rename published/{ => 201904}/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md (100%) rename published/{ => 201904}/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md (100%) rename published/{ => 201904}/20190325 Getting started with Vim- The basics.md (100%) rename published/{ => 201904}/20190326 Using Square Brackets in Bash- Part 1.md (100%) rename published/{ => 201904}/20190327 Setting kernel command line arguments with Fedora 30.md (100%) rename published/{ => 201904}/20190328 How to run PostgreSQL on Kubernetes.md (100%) rename published/{ => 201904}/20190401 3 cool text-based email clients.md (100%) rename published/{ => 201904}/20190401 How to create a filesystem on a Linux partition or logical volume.md (100%) rename published/{ => 201904}/20190402 Parallel computation in Python with Dask.md (100%) rename published/{ => 201904}/20190402 Using Square Brackets in Bash- Part 2.md (100%) rename published/{ => 201904}/20190403 5 useful open source log analysis tools.md (100%) rename published/{ => 201904}/20190405 Streaming internet radio with RadioDroid.md (100%) rename published/{ => 201904}/20190407 Fixing Ubuntu Freezing at Boot Time.md (100%) rename published/{ => 201904}/20190407 Happy 14th anniversary Git- What do you love about Git.md (100%) rename published/{ => 201904}/20190408 Bash vs. Python- Which language should you use.md (100%) rename published/{ => 201904}/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md (100%) rename published/{ => 201904}/20190409 Enhanced security at the edge.md (100%) rename published/{ => 201904}/20190409 Four Methods To Add A User To Group In Linux.md (100%) rename published/{ => 201904}/20190409 How To Install And Enable Flatpak Support On Linux.md (100%) rename published/{ => 201904}/20190410 How To Check The List Of Open Ports In Linux.md (100%) rename published/{ => 201904}/20190410 Managing Partitions with sgdisk.md (100%) rename published/{ => 201904}/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md (100%) rename published/{ => 201904}/20190413 The Fargate Illusion.md (100%) rename published/{ => 201904}/20190415 Getting started with Mercurial for version control.md (100%) rename published/{ => 201904}/20190415 How to identify duplicate files on Linux.md (100%) rename published/{ => 201904}/20190416 How to Install MySQL in Ubuntu Linux.md (100%) rename published/{ => 201904}/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md (100%) rename published/{ => 201904}/20190417 Managing RAID arrays with mdadm.md (100%) rename published/{ => 201904}/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md (100%) rename published/{ => 201904}/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md (100%) rename published/{ => 201904}/20190419 4 cool new projects to try in COPR for April 2019.md (100%) rename published/{ => 201904}/20190420 New Features Coming to Debian 10 Buster Release.md (100%) diff --git a/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md b/published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md similarity index 100% rename from published/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md rename to published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md diff --git a/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md b/published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md similarity index 100% rename from published/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md rename to published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md diff --git a/published/20160301 How To Set Password Policies In Linux.md b/published/201904/20160301 How To Set Password Policies In Linux.md similarity index 100% rename from published/20160301 How To Set Password Policies In Linux.md rename to published/201904/20160301 How To Set Password Policies In Linux.md diff --git a/published/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md b/published/201904/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md similarity index 100% rename from published/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md rename to published/201904/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md diff --git a/published/20171117 5 open source fonts ideal for programmers.md b/published/201904/20171117 5 open source fonts ideal for programmers.md similarity index 100% rename from published/20171117 5 open source fonts ideal for programmers.md rename to published/201904/20171117 5 open source fonts ideal for programmers.md diff --git a/published/20171226 The shell scripting trap.md b/published/201904/20171226 The shell scripting trap.md similarity index 100% rename from published/20171226 The shell scripting trap.md rename to published/201904/20171226 The shell scripting trap.md diff --git a/published/20180118 Rediscovering make- the power behind rules.md b/published/201904/20180118 Rediscovering make- the power behind rules.md similarity index 100% rename from published/20180118 Rediscovering make- the power behind rules.md rename to published/201904/20180118 Rediscovering make- the power behind rules.md diff --git a/published/20180205 Rancher - Container Management Application.md b/published/201904/20180205 Rancher - Container Management Application.md similarity index 100% rename from published/20180205 Rancher - Container Management Application.md rename to published/201904/20180205 Rancher - Container Management Application.md diff --git a/published/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md b/published/201904/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md similarity index 100% rename from published/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md rename to published/201904/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md diff --git a/published/20180718 3 Emacs modes for taking notes.md b/published/201904/20180718 3 Emacs modes for taking notes.md similarity index 100% rename from published/20180718 3 Emacs modes for taking notes.md rename to published/201904/20180718 3 Emacs modes for taking notes.md diff --git a/published/20180823 Getting started with Sensu monitoring.md b/published/201904/20180823 Getting started with Sensu monitoring.md similarity index 100% rename from published/20180823 Getting started with Sensu monitoring.md rename to published/201904/20180823 Getting started with Sensu monitoring.md diff --git a/published/20180828 Linux for Beginners- Moving Things Around.md b/published/201904/20180828 Linux for Beginners- Moving Things Around.md similarity index 100% rename from published/20180828 Linux for Beginners- Moving Things Around.md rename to published/201904/20180828 Linux for Beginners- Moving Things Around.md diff --git a/published/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md b/published/201904/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md similarity index 100% rename from published/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md rename to published/201904/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md diff --git a/published/20181108 My Google-free Android life.md b/published/201904/20181108 My Google-free Android life.md similarity index 100% rename from published/20181108 My Google-free Android life.md rename to published/201904/20181108 My Google-free Android life.md diff --git a/published/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md b/published/201904/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md similarity index 100% rename from published/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md rename to published/201904/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md diff --git a/published/20190104 Take to the virtual skies with FlightGear.md b/published/201904/20190104 Take to the virtual skies with FlightGear.md similarity index 100% rename from published/20190104 Take to the virtual skies with FlightGear.md rename to published/201904/20190104 Take to the virtual skies with FlightGear.md diff --git a/published/20190108 How To Understand And Identify File types in Linux.md b/published/201904/20190108 How To Understand And Identify File types in Linux.md similarity index 100% rename from published/20190108 How To Understand And Identify File types in Linux.md rename to published/201904/20190108 How To Understand And Identify File types in Linux.md diff --git a/published/20190118 Secure Email Service Tutanota Has a Desktop App Now.md b/published/201904/20190118 Secure Email Service Tutanota Has a Desktop App Now.md similarity index 100% rename from published/20190118 Secure Email Service Tutanota Has a Desktop App Now.md rename to published/201904/20190118 Secure Email Service Tutanota Has a Desktop App Now.md diff --git a/published/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/published/201904/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md similarity index 100% rename from published/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md rename to published/201904/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md diff --git a/published/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/published/201904/20190204 Enjoy Netflix- You Should Thank FreeBSD.md similarity index 100% rename from published/20190204 Enjoy Netflix- You Should Thank FreeBSD.md rename to published/201904/20190204 Enjoy Netflix- You Should Thank FreeBSD.md diff --git a/published/20190208 Which programming languages should you learn.md b/published/201904/20190208 Which programming languages should you learn.md similarity index 100% rename from published/20190208 Which programming languages should you learn.md rename to published/201904/20190208 Which programming languages should you learn.md diff --git a/published/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md b/published/201904/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md similarity index 100% rename from published/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md rename to published/201904/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md diff --git a/published/20190309 Emulators and Native Linux games on the Raspberry Pi.md b/published/201904/20190309 Emulators and Native Linux games on the Raspberry Pi.md similarity index 100% rename from published/20190309 Emulators and Native Linux games on the Raspberry Pi.md rename to published/201904/20190309 Emulators and Native Linux games on the Raspberry Pi.md diff --git a/published/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md b/published/201904/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md similarity index 100% rename from published/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md rename to published/201904/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md diff --git a/published/20190311 7 resources for learning to use your Raspberry Pi.md b/published/201904/20190311 7 resources for learning to use your Raspberry Pi.md similarity index 100% rename from published/20190311 7 resources for learning to use your Raspberry Pi.md rename to published/201904/20190311 7 resources for learning to use your Raspberry Pi.md diff --git a/published/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md b/published/201904/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md similarity index 100% rename from published/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md rename to published/201904/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md diff --git a/published/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md b/published/201904/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md similarity index 100% rename from published/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md rename to published/201904/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md diff --git a/published/20190312 Do advanced math with Mathematica on the Raspberry Pi.md b/published/201904/20190312 Do advanced math with Mathematica on the Raspberry Pi.md similarity index 100% rename from published/20190312 Do advanced math with Mathematica on the Raspberry Pi.md rename to published/201904/20190312 Do advanced math with Mathematica on the Raspberry Pi.md diff --git a/published/20190313 How to contribute to the Raspberry Pi community.md b/published/201904/20190313 How to contribute to the Raspberry Pi community.md similarity index 100% rename from published/20190313 How to contribute to the Raspberry Pi community.md rename to published/201904/20190313 How to contribute to the Raspberry Pi community.md diff --git a/published/20190314 14 days of celebrating the Raspberry Pi.md b/published/201904/20190314 14 days of celebrating the Raspberry Pi.md similarity index 100% rename from published/20190314 14 days of celebrating the Raspberry Pi.md rename to published/201904/20190314 14 days of celebrating the Raspberry Pi.md diff --git a/published/20190314 A Look Back at the History of Firefox.md b/published/201904/20190314 A Look Back at the History of Firefox.md similarity index 100% rename from published/20190314 A Look Back at the History of Firefox.md rename to published/201904/20190314 A Look Back at the History of Firefox.md diff --git a/published/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md b/published/201904/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md similarity index 100% rename from published/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md rename to published/201904/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md diff --git a/published/20190317 How To Configure sudo Access In Linux.md b/published/201904/20190317 How To Configure sudo Access In Linux.md similarity index 100% rename from published/20190317 How To Configure sudo Access In Linux.md rename to published/201904/20190317 How To Configure sudo Access In Linux.md diff --git a/published/20190318 10 Python image manipulation tools.md b/published/201904/20190318 10 Python image manipulation tools.md similarity index 100% rename from published/20190318 10 Python image manipulation tools.md rename to published/201904/20190318 10 Python image manipulation tools.md diff --git a/published/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md b/published/201904/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md similarity index 100% rename from published/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md rename to published/201904/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md diff --git a/published/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md b/published/201904/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md similarity index 100% rename from published/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md rename to published/201904/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md diff --git a/published/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md b/published/201904/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md similarity index 100% rename from published/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md rename to published/201904/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md diff --git a/published/20190325 Getting started with Vim- The basics.md b/published/201904/20190325 Getting started with Vim- The basics.md similarity index 100% rename from published/20190325 Getting started with Vim- The basics.md rename to published/201904/20190325 Getting started with Vim- The basics.md diff --git a/published/20190326 Using Square Brackets in Bash- Part 1.md b/published/201904/20190326 Using Square Brackets in Bash- Part 1.md similarity index 100% rename from published/20190326 Using Square Brackets in Bash- Part 1.md rename to published/201904/20190326 Using Square Brackets in Bash- Part 1.md diff --git a/published/20190327 Setting kernel command line arguments with Fedora 30.md b/published/201904/20190327 Setting kernel command line arguments with Fedora 30.md similarity index 100% rename from published/20190327 Setting kernel command line arguments with Fedora 30.md rename to published/201904/20190327 Setting kernel command line arguments with Fedora 30.md diff --git a/published/20190328 How to run PostgreSQL on Kubernetes.md b/published/201904/20190328 How to run PostgreSQL on Kubernetes.md similarity index 100% rename from published/20190328 How to run PostgreSQL on Kubernetes.md rename to published/201904/20190328 How to run PostgreSQL on Kubernetes.md diff --git a/published/20190401 3 cool text-based email clients.md b/published/201904/20190401 3 cool text-based email clients.md similarity index 100% rename from published/20190401 3 cool text-based email clients.md rename to published/201904/20190401 3 cool text-based email clients.md diff --git a/published/20190401 How to create a filesystem on a Linux partition or logical volume.md b/published/201904/20190401 How to create a filesystem on a Linux partition or logical volume.md similarity index 100% rename from published/20190401 How to create a filesystem on a Linux partition or logical volume.md rename to published/201904/20190401 How to create a filesystem on a Linux partition or logical volume.md diff --git a/published/20190402 Parallel computation in Python with Dask.md b/published/201904/20190402 Parallel computation in Python with Dask.md similarity index 100% rename from published/20190402 Parallel computation in Python with Dask.md rename to published/201904/20190402 Parallel computation in Python with Dask.md diff --git a/published/20190402 Using Square Brackets in Bash- Part 2.md b/published/201904/20190402 Using Square Brackets in Bash- Part 2.md similarity index 100% rename from published/20190402 Using Square Brackets in Bash- Part 2.md rename to published/201904/20190402 Using Square Brackets in Bash- Part 2.md diff --git a/published/20190403 5 useful open source log analysis tools.md b/published/201904/20190403 5 useful open source log analysis tools.md similarity index 100% rename from published/20190403 5 useful open source log analysis tools.md rename to published/201904/20190403 5 useful open source log analysis tools.md diff --git a/published/20190405 Streaming internet radio with RadioDroid.md b/published/201904/20190405 Streaming internet radio with RadioDroid.md similarity index 100% rename from published/20190405 Streaming internet radio with RadioDroid.md rename to published/201904/20190405 Streaming internet radio with RadioDroid.md diff --git a/published/20190407 Fixing Ubuntu Freezing at Boot Time.md b/published/201904/20190407 Fixing Ubuntu Freezing at Boot Time.md similarity index 100% rename from published/20190407 Fixing Ubuntu Freezing at Boot Time.md rename to published/201904/20190407 Fixing Ubuntu Freezing at Boot Time.md diff --git a/published/20190407 Happy 14th anniversary Git- What do you love about Git.md b/published/201904/20190407 Happy 14th anniversary Git- What do you love about Git.md similarity index 100% rename from published/20190407 Happy 14th anniversary Git- What do you love about Git.md rename to published/201904/20190407 Happy 14th anniversary Git- What do you love about Git.md diff --git a/published/20190408 Bash vs. Python- Which language should you use.md b/published/201904/20190408 Bash vs. Python- Which language should you use.md similarity index 100% rename from published/20190408 Bash vs. Python- Which language should you use.md rename to published/201904/20190408 Bash vs. Python- Which language should you use.md diff --git a/published/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/published/201904/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md similarity index 100% rename from published/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md rename to published/201904/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md diff --git a/published/20190409 Enhanced security at the edge.md b/published/201904/20190409 Enhanced security at the edge.md similarity index 100% rename from published/20190409 Enhanced security at the edge.md rename to published/201904/20190409 Enhanced security at the edge.md diff --git a/published/20190409 Four Methods To Add A User To Group In Linux.md b/published/201904/20190409 Four Methods To Add A User To Group In Linux.md similarity index 100% rename from published/20190409 Four Methods To Add A User To Group In Linux.md rename to published/201904/20190409 Four Methods To Add A User To Group In Linux.md diff --git a/published/20190409 How To Install And Enable Flatpak Support On Linux.md b/published/201904/20190409 How To Install And Enable Flatpak Support On Linux.md similarity index 100% rename from published/20190409 How To Install And Enable Flatpak Support On Linux.md rename to published/201904/20190409 How To Install And Enable Flatpak Support On Linux.md diff --git a/published/20190410 How To Check The List Of Open Ports In Linux.md b/published/201904/20190410 How To Check The List Of Open Ports In Linux.md similarity index 100% rename from published/20190410 How To Check The List Of Open Ports In Linux.md rename to published/201904/20190410 How To Check The List Of Open Ports In Linux.md diff --git a/published/20190410 Managing Partitions with sgdisk.md b/published/201904/20190410 Managing Partitions with sgdisk.md similarity index 100% rename from published/20190410 Managing Partitions with sgdisk.md rename to published/201904/20190410 Managing Partitions with sgdisk.md diff --git a/published/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/published/201904/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md similarity index 100% rename from published/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md rename to published/201904/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md diff --git a/published/20190413 The Fargate Illusion.md b/published/201904/20190413 The Fargate Illusion.md similarity index 100% rename from published/20190413 The Fargate Illusion.md rename to published/201904/20190413 The Fargate Illusion.md diff --git a/published/20190415 Getting started with Mercurial for version control.md b/published/201904/20190415 Getting started with Mercurial for version control.md similarity index 100% rename from published/20190415 Getting started with Mercurial for version control.md rename to published/201904/20190415 Getting started with Mercurial for version control.md diff --git a/published/20190415 How to identify duplicate files on Linux.md b/published/201904/20190415 How to identify duplicate files on Linux.md similarity index 100% rename from published/20190415 How to identify duplicate files on Linux.md rename to published/201904/20190415 How to identify duplicate files on Linux.md diff --git a/published/20190416 How to Install MySQL in Ubuntu Linux.md b/published/201904/20190416 How to Install MySQL in Ubuntu Linux.md similarity index 100% rename from published/20190416 How to Install MySQL in Ubuntu Linux.md rename to published/201904/20190416 How to Install MySQL in Ubuntu Linux.md diff --git a/published/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/published/201904/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md similarity index 100% rename from published/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md rename to published/201904/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md diff --git a/published/20190417 Managing RAID arrays with mdadm.md b/published/201904/20190417 Managing RAID arrays with mdadm.md similarity index 100% rename from published/20190417 Managing RAID arrays with mdadm.md rename to published/201904/20190417 Managing RAID arrays with mdadm.md diff --git a/published/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/published/201904/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md similarity index 100% rename from published/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md rename to published/201904/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md diff --git a/published/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/published/201904/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md similarity index 100% rename from published/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md rename to published/201904/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md diff --git a/published/20190419 4 cool new projects to try in COPR for April 2019.md b/published/201904/20190419 4 cool new projects to try in COPR for April 2019.md similarity index 100% rename from published/20190419 4 cool new projects to try in COPR for April 2019.md rename to published/201904/20190419 4 cool new projects to try in COPR for April 2019.md diff --git a/published/20190420 New Features Coming to Debian 10 Buster Release.md b/published/201904/20190420 New Features Coming to Debian 10 Buster Release.md similarity index 100% rename from published/20190420 New Features Coming to Debian 10 Buster Release.md rename to published/201904/20190420 New Features Coming to Debian 10 Buster Release.md From f14b09236b84561700f320c92c7ef04c9815a809 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 May 2019 00:43:42 +0800 Subject: [PATCH 0216/1154] PRF:20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @warmfrog --- ...t Gateway Or Router IP Address In Linux.md | 66 ++++++++----------- 1 file changed, 28 insertions(+), 38 deletions(-) diff --git a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md index f2cf168fcb..bbdcb47d54 100644 --- a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md +++ b/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -1,52 +1,42 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Four Methods To Check The Default Gateway Or Router IP Address In Linux?) [#]: via: (https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -在 Linux 中检查默认网关或者路由 IP 地址的四个方法? +4 种在 Linux 中检查默认网关或者路由器 IP 地址的方法 ============================================== -你应该意识到你的默认网关是你的路由器的 IP 地址。 +你应该意识到你的默认网关是你的路由器的 IP 地址。一般这是在安装过程中由操作系统自动检测的,如果没有,你可能需要改变它。如果你的系统不能 ping 自身,那么很可能是一个网关问题,你必须修复它。在网络中,当你有多个网络适配器或路由器时,这种情况可能会发生。 -典型地这是在安装过程中由操作系统自动检测的,如果没有,你可能需要改变它。 - -如果你的系统不能 ping 自身,那么很可能是一个网关问题,你必须修复它。 - -在网络中,当你有多个网络适配器或路由器时,这种情况可能会发生。 - -一个网关是一个路由器扮演着一个入口点角色,从一个网络传递网络数据到另一个网络。 - -下面是一些可能帮助你收集到的与该话题相似的一些信息。 - - * **[9 Methods To Check Your Public IP Address In Linux Command Line][1]** - * **[How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?][2]** +网关是一个扮演着入口点角色的路由器,可以从一个网络传递网络数据到另一个网络。 +下面是一些可能帮助你收集到与该话题相似的一些信息。 +* [在 Linux 命令行检查你的公网 IP 地址的 9 种方法][1] +* [如何在 Linux 启用和禁用网卡?][2] 这可以通过下面的四个命令完成。 -* **`route 命令`** route 命令被用来显示和操作 IP 路由表。 -* **`ip 命令:`** IP 命令类似于 ifconfig, 非常熟悉赋值静态 IP 地址,路由 & 默认网关,等等。 -* **`netstat 命令`** netstat (“network statistics”)是一个命令行工具来显示网络连接相关的信息(包括入口和出口的)例如路由表,伪装连接,多播成员和很多网络接口。 -* **`routel 命令`** routel 命令被用来以好看的输出格式列出路由。 - - +* `route` 命令:被用来显示和操作 IP 路由表。 +* `ip` 命令:类似于 `ifconfig`,常用于设置静态 IP 地址、路由 & 默认网关,等等。 +* `netstat` 命令:是一个命令行工具,用来显示网络连接相关的信息(包括入站和出站的),例如路由表、伪装连接、多播成员和网络接口。 +* `routel` 命令:被用来以好看的输出格式列出路由。 ### 1)在 Linux 中如何使用 route 命令检查默认的网关或者路由 IP 地址? -route 命令被用来显示和操作 IP 路由表。 +`route` 命令被用来显示和操作 IP 路由表。 它主要用于通过一个已经配置的接口给特定的主机或者网络设置静态的路由。 -当 add 或者 del 选项被使用时,route 修改路由表。没有这些选项,route 显示路由表的当前内容。 +当使用 `add` 或者 `del` 选项时,`route` 修改路由表。没有这些选项,`route` 显示路由表的当前内容。 ``` # route -or +或 # route -n Kernel IP routing table @@ -57,21 +47,21 @@ default www.routerlogin 0.0.0.0 UG 600 0 0 wlp8s0 ### 2)如何在 Linux 中使用 ip 命令检查默认网关或者路由 IP 地址? -**[IP 命令][3]** 相似于 ifconfig,非常熟悉配置静态 IP 地址,路由 & 默认网关,等等。 +[IP 命令][3] 类似于 `ifconfig`,常用于配置静态 IP 地址、路由 & 默认网关,等等。 -ifconfig 命令因为多年没有维持被遗弃了,即使它仍然在大多数 Linux 分发版上可获得。 +`ifconfig` 命令因为多年没有维护而被遗弃了,即使它仍然在大多数 Linux 发行版上可获得。 -ifconfig 命令已经被 IP 命令替代了,IP 命令是非常强大的,只要一个命令就能执行几个网络管理任务。 +`ifconfig` 命令已经被 `ip` 命令替代了,`ip` 命令是非常强大的,只要一个命令就能执行几个网络管理任务。 -IP 命令工具附带在 iproute2 包中。默认 iproute2 预安装在主要的 Linux 分发版中。 +`ip` 命令工具附带在 iproute2 包中。在主要的 Linux 发行版中都默认预装了 iproute2 。 -如果没有,你可以在你的终端中在包管理器的帮助下通过输入 iproute2 并安装它。 +如果没有,你可以在你的终端中在包管理器的帮助下通过指定 iproute2 来安装它。 ``` # ip r -or +或 # ip route -or +或 # ip route show default via 192.168.1.1 dev wlp8s0 proto dhcp metric 600 @@ -80,11 +70,11 @@ default via 192.168.1.1 dev wlp8s0 proto dhcp metric 600 ### 3)如何在 Linux 中使用 netstat 命令检查默认网关或者路由 IP 地址? -netstat 代表 Network Statistics,是一个命令行工具来显示网络连接相关的信息(包括入口和出口的)例如路由表,伪装连接,多播成员和很多网络接口。 +`netstat` 代表 Network Statistics,是一个用来显示网络连接相关的信息(包括入站和出站)的命令行工具,例如路由表、伪装连接,多播成员和网络接口。 -它列出所有的 tcp, udp 套接字连接和 unix 套接字连接。 +它列出所有的 tcp、udp 套接字连接和 unix 套接字连接。 -它在网络中被用来诊断网络问题并判断网络中的交通总量来作为性能测量指标。 +它在网络中被用来诊断网络问题并判断网络中的流量总量来作为性能测量指标。 ``` # netstat -r @@ -97,11 +87,11 @@ default www.routerlogin 0.0.0.0 UG 0 0 0 wlp8s0 ### 4)如何在 Linux 中使用 routel 命令检查默认网关或者路由 IP 地址? -它用来以好看的输出格式列出路由信息。这些程序是一系列你可以用来替代 iproute2 的帮助脚本。 +它用来以好看的输出格式列出路由信息。这些程序是一系列你可以用来替代 iproute2 的帮助脚本(`routel` 和 `routef`)。 -routel 脚本以一种被认为更容易解释并且等价于 route 输出列表的格式来输出路由信息。 +`routel` 脚本以一种被认为更容易解释并且等价于 `route` 输出列表的格式来输出路由信息。 -如果 routef 脚本不加任何参数,将仅仅简单的将路由表清空。小心!这意味着删除所有的路由,让你的网络不再可用。 +如果 `routef` 脚本不加任何参数,将仅仅简单的将路由表清空。小心!这意味着删除所有的路由,让你的网络不再可用。 ``` # routel @@ -137,7 +127,7 @@ via: https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 100de97ce995b838d55fc638db47d4e375a36f68 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 May 2019 00:44:15 +0800 Subject: [PATCH 0217/1154] PUB:20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @warmfrog https://linux.cn/article-10800-1.html --- ...Check The Default Gateway Or Router IP Address In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md (98%) diff --git a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/published/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md similarity index 98% rename from translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md rename to published/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md index bbdcb47d54..7f0f184e52 100644 --- a/translated/tech/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md +++ b/published/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10800-1.html) [#]: subject: (Four Methods To Check The Default Gateway Or Router IP Address In Linux?) [#]: via: (https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From b955722215caecc21c709832b1670743d5fef0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 1 May 2019 09:49:44 +0800 Subject: [PATCH 0218/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...This is how System76 does open hardware.md | 78 ------------------ ...This is how System76 does open hardware.md | 80 +++++++++++++++++++ 2 files changed, 80 insertions(+), 78 deletions(-) delete mode 100644 sources/tech/20190419 This is how System76 does open hardware.md create mode 100644 translated/tech/20190419 This is how System76 does open hardware.md diff --git a/sources/tech/20190419 This is how System76 does open hardware.md b/sources/tech/20190419 This is how System76 does open hardware.md deleted file mode 100644 index 9fc742ad30..0000000000 --- a/sources/tech/20190419 This is how System76 does open hardware.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (This is how System76 does open hardware) -[#]: via: (https://opensource.com/article/19/4/system76-hardware) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -This is how System76 does open hardware -====== -What sets the new Thelio line of desktops apart from the rest. -![metrics and data shown on a computer screen][1] - -Most people know very little about the hardware in their computers. As a long-time Linux user, I've had my share of frustration while getting my wireless cards, video cards, displays, and other hardware working with my chosen distribution. Proprietary hardware often makes it difficult to determine why an Ethernet controller, wireless controller, or mouse performs differently than we expect. As Linux distributions have matured, this has become less of a problem, but we still see some quirks with touchpads and other peripherals, especially when we don't know much—if anything—about our underlying hardware. - -Companies like [System76][2] aim to take these types of problems out of the Linux user experience. System76 manufactures a line of Linux laptops, desktops, and servers, and even offers its own Linux distro, [Pop! OS][3], as an option for buyers, Recently I had the privilege of visiting System76's plant in Denver for [the unveiling][4] of [Thelio][5], its new desktop product line. - -### About Thelio - -System76 says Thelio's open hardware daughterboard, named Thelio Io after the fifth moon of Jupiter, is one thing that makes the computer unique in the marketplace. Thelio Io is certified [OSHWA #us000145][6] and has four SATA ports for storage and an embedded controller for fan and power button control. Thelio Io SAS is certified [OSHWA #us000146][7] and has four U.2 ports for storage and no embedded controller. During a demonstration, System76 showed how these components adjust fans throughout the chassis to optimize the unit's performance. - -The controller also runs the power button and the LED ring around the button, which glows at 100% brightness when it is pressed. This provides both tactile and visual confirmation that the unit is being powered on. While the computer is in use, the button is set to 35% brightness, and when it's in suspend mode, it pulses between 2.35% and 25%. When the computer is off, the LED remains dimly lit so that it's easy to find the power control in a dark room. - -Thelio's embedded controller is a low-power [ATmega32U4][8] microchip, and the controller's setup can be prototyped with an Arduino Micro. The number of Thelio Io boards changes depending on which Thelio model you purchase. - -Thelio is also perhaps the best-designed computer case and system I have ever seen. You'll probably agree if you have ever skinned your knuckles trying to operate inside a typical PC case. I have done this a number of times, and I have the scars to prove it. - -### Why open hardware? - -The boards were designed in [KiCAD][9], and you can access all of Thelio's design files under GPL on [GitHub][10]. So, why would a company that competes with other PC manufacturers design a unique interface then license it openly? It's because the company recognizes the value of open design and the ability to share and adjust an I/O board to your needs, even if you're a competitor in the marketplace. - -![Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.][11] - -Don Watkins speaks with System76 CEO Carl Richell at the [Thelio launch event][12]. - -I asked [Carl Richell][13], System76's founder and CEO, whether the company is concerned that openly licensing its hardware designs means someone could take its unique design and use it to drive System76 out of business. He said: - -> Open hardware benefits all of us. It's how we further advance technology and make it more available to everyone. We welcome anyone who wishes to improve on Thelio's design to do so. Opening the hardware not only helps advance improvements of our computers more quickly, but it also empowers our customers to truly own 100% of their device. Our goal is to remove as much proprietary functioning as we can, while still producing a competitive Linux computer for customers. -> -> We've been working with the Linux community for over 13 years to create a flawless and digestible experience on all of our laptops, desktops, and servers. Our long tenure serving the Linux community, providing our customers with a high level of service, and our personability are what makes System76 unique. - -I also asked Carl why open hardware makes sense for System76 and the PC business in general. He replied: - -> System76 was founded on the idea that technology should be open and accessible to everyone. We're not yet at the point where we can create a computer that is 100% open source, but with open hardware, we're one large, essential step closer to reaching that point. -> -> We live in an era where technology has become a utility. Computers are tools for people at every level of education and across many industries. With everyone's needs specific, each person has their own ideas on how they might improve the computer and its software as their primary tool. Having our computers open allows these ideas to come to fruition, which in turn makes the technology a more powerful tool. In an open environment, we constantly get to iterate a better PC. And that's kind of cool. - -We wrapped up our conversation by talking about System76's roadmap, which includes open hardware mini PCs and, eventually, laptops. Existing mini PCs and laptops sold under the System76 brand are manufactured by other vendors and are not based on open hardware (although their Linux software is, of course, open source). - -Designing and supporting open hardware is a game-changer in the PC business, and it is what sets System76's new Thelio line of desktop computers apart. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/system76-hardware - -作者:[Don Watkins ][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/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) -[2]: https://system76.com/ -[3]: https://opensource.com/article/18/1/behind-scenes-popos-linux -[4]: /article/18/11/system76-thelio-desktop-computer -[5]: https://system76.com/desktops -[6]: https://certification.oshwa.org/us000145.html -[7]: https://certification.oshwa.org/us000146.html -[8]: https://www.microchip.com/wwwproducts/ATmega32u4 -[9]: http://kicad-pcb.org/ -[10]: https://github.com/system76/thelio-io -[11]: https://opensource.com/sites/default/files/uploads/don_system76_ceo.jpg (Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.) -[12]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-FKWFxFv -[13]: https://www.linkedin.com/in/carl-richell-9435781 diff --git a/translated/tech/20190419 This is how System76 does open hardware.md b/translated/tech/20190419 This is how System76 does open hardware.md new file mode 100644 index 0000000000..fabbf20083 --- /dev/null +++ b/translated/tech/20190419 This is how System76 does open hardware.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (This is how System76 does open hardware) +[#]: via: (https://opensource.com/article/19/4/system76-hardware) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +这就是 System76 如何打造开源硬件的 +================================ +是什么让新的 Thelio 台式机系列与众不同。 +![在计算机上显示度量和数据][1] + +大多数人对他们电脑的硬件一无所知。作为一个长期的 Linux 用户,我分享了对此的失望,就是当我想让我的无线网卡,视频卡,显示器,和其他硬件与我选择的发行版共同运行时。自主品牌的硬件通常使判断这些问题变得很困难,就是:为什么以太网驱动,无线驱动,或者鼠标驱动和我们预期的不太一样?。当 Linux 分发版已经成熟,这可能不再是问题,但是我们仍能发现触控板和其他外部设备的怪异行为,尤其是当我们对下面的硬件知道的不多时。 + +像 [System76][2] 的公司目标是解决这些问题,来提升 Linux 用户体验。System76 生产了一些列的 Linux 笔记本,台式机,和服务器,甚至提供了它自己的 Linux 发行版 [Pop! OS][3] 作为客户的一个选择。最近我有幸参观了 System76 在 Devnver 的工厂并揭开 [Thelio][5] [神秘的面纱][5],它的新的台式机产品线。 + +### 关于 Thelio + +System76 宣称 Thelio 的开源硬件子板,被命名为木星之后的第 5 个卫星的名字 Thelio Io,这是它在市场上独特的特点之一。Thelio Io 被证实为 [OSHWA #us000145][6],并且有 4 个用于存储的 SATA 端口和一个控制风扇和用于电源按钮控制的嵌入式控制器。Thelio IO SAS 被证实 是 [OSHWA #us000146][7],并且有 4 个用于存储的 U.2 端口,没有嵌入式控制器。在展示时,System76 显示了这些组件如何调整风扇通过底盘来优化部件的性能。 + +该控制器还管理电源键,和围绕该电源键的 LED 光环,当被按下时它以 100% 的亮度发光。这提供了触觉和视觉上的确认:该主机已经启动电源了。当电脑在使用中,该按钮被设置为 35% 的亮度,当在睡眠模式,它的亮度在 2.35% 和 25% 之间跳动。当计算机关闭后,LED 保持朦胧的亮度,因此能够在黑暗的房间里找到电源控制。 + +Thelio 的嵌入式控制器是一个低功耗的 [ATmega32U4][8] 微控制器,并且控制器的设置可以使用 Arduino Micro 进行原型设计。Thelio Io 主板变化的多少取决于你购买哪种 Thelio 型号。 + +Thelio 可能是我见过的设计的最好的电脑样例和系统。如果你曾经亲身体验过在一个常规的 PC 的内部进行操作的话,你可能会同意我的观点。我已经做了很多次了,因此我能以自己过往的糟糕经历来证明这点。 + +### 为什么做开源硬件? + +该主板是在 [KiCAD][9] 设计的,你可以在 [GitHub][10] 上的 GPL 证书下访问 Thelio 所有的设计文件。因此,为什么一个与其他 PC 制造商竞争的公司会设计一个独特的接口并公开授权呢?可能是该公司认识到开源设计的价值和分享的能力,并且根据你的需要调整一个 I/O 主板,即便你是市场上的竞争者。 + +![在 Thelio 启动时 Don Watkins 与 System76 的 CEO Carl Richell 谈话][11] + +在 [Thelio 启动时][12] Don Watkins 与 System76 的 CEO Carl Richell 谈话。 + +我问 [Carl Richell][13],System76 的设计者和 CEO,该公司是否考虑到开放它的硬件设计意味着有人采取它的独特设计并用它来将 System76 驱逐出市场。他说: + +> 开源硬件对我们所有人都有益。这是我们未来提升技术的方式并且使得每个人获取技术更容易。我们欢迎任何想要提高 Thelio 设计的人来这么做。开源硬件不仅更快的帮助我们的电脑提升技术,并且能够使我们的消费者 100% 信任他们的设备。我们的目标是尽可能地移除专利授权,并且仍然能够为消费者提供一个有竞争力的 Linux 主机。 +> +> 我们已经与 Linux 社区一起工作超过 13 年来为我们的笔记本,台式机,服务器创造一个完美的顺滑的体验。我们长期专注于为 Linux 社区提供服务,提供给我们的客户高水准的服务,我们的个性使 System76 变得独特。 + +我问 Carl 为什么通常来说开源硬件对 System76 和 PC 市场是有意义的。他回复道: + +> System76 创立之初的想法是技术应该对每个人是开放和可获取的。我们还没有到达 100% 开源创造一个电脑的程度,但是有了开源硬件,我们是接近目标的必不可少的一大步。 +> +> 我们生活在技术变成工具的时代。计算机在每一层教育和在很多工业当中是人们的工具。由于每个人特定的需要,每个人对于如何提升电脑和软件作为他们的主要工具有他们自己的想法。开源我们的计算机允许这些想法完成,反过来促进技术成为一个更强大的工具。在一个开源环境中,我们持续迭代来获取一个更好的 PC。这有点酷。 + +我们总结了我们讨论的关于 System76 技术路线的对话,包含了开源硬件 mini PC,最终还包含了笔记本。在 System76 品牌下的已售出的 mini PC 和笔记本是由其他供应商制造的,并不是基于开源硬件的(尽管他们的 Linux 软件,当然是开源的)。 + +设计和支持开放式硬件是PC业务中改变游戏规则的因素,也正是它造就了 System76 的新 Thelio 台式机电脑产品线的不同。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/system76-hardware + +作者:[Don Watkins ][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://system76.com/ +[3]: https://opensource.com/article/18/1/behind-scenes-popos-linux +[4]: /article/18/11/system76-thelio-desktop-computer +[5]: https://system76.com/desktops +[6]: https://certification.oshwa.org/us000145.html +[7]: https://certification.oshwa.org/us000146.html +[8]: https://www.microchip.com/wwwproducts/ATmega32u4 +[9]: http://kicad-pcb.org/ +[10]: https://github.com/system76/thelio-io +[11]: https://opensource.com/sites/default/files/uploads/don_system76_ceo.jpg (Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.) +[12]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-FKWFxFv +[13]: https://www.linkedin.com/in/carl-richell-9435781 + + From bae993ea2b9cf6a968905fd8a395b2937a32fa06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 1 May 2019 10:09:26 +0800 Subject: [PATCH 0219/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190416 Detecting malaria with deep learning.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 Detecting malaria with deep learning.md b/sources/tech/20190416 Detecting malaria with deep learning.md index 9e6ea2ba01..37ced688a1 100644 --- a/sources/tech/20190416 Detecting malaria with deep learning.md +++ b/sources/tech/20190416 Detecting malaria with deep learning.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d0314e7425dd85e7bc3897ead7d48dc151918492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 12:30:22 +0800 Subject: [PATCH 0220/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=86=85=E5=AE=B94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...art a Network in Ubuntu -Beginner-s Tip.md | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index d599988024..d1c7cc4828 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -7,7 +7,7 @@ [#]: via: (https://itsfoss.com/restart-network-ubuntu) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) -如何在 Ubuntu 中重启网络服务 [新手提示] +如何在 Ubuntu 中重启网络服务 【新手提示】 ====== 你 [是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 @@ -24,7 +24,7 @@ #### 1\. network manager service -这是通过命令行方式重启网络最简单的方法. 它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 +这是通过命令行方式重启网络最简单的方法。它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 ``` sudo service network-manager restart @@ -62,7 +62,7 @@ sudo nmcli networking on #### 4\. ifup & ifdown -这两个命令是直接操作网口,将网口状态xxx。这是 [Linux 中最应该了解的网络命令][4] 之一。 +这两个命令是直接操作网口,切换网口是否可以收发包的状态。这是 [Linux 中最应该了解的网络命令][4] 之一。 使用 ifdown 关闭所有网口,再使用 ifup 重新启用网口。 @@ -130,25 +130,27 @@ nmtui ### 通过图形化界面重启网络 -This is, of course, the easiest way of restarting the network for Ubuntu desktop users. If this one doesn’t work, you can of course check the command line options mentioned in the previous section. +显然,这是 Ubuntu 桌面版用户重启网络最简单的方法。如果不生效,你可以尝试使用前文提到的命令行方式重启网络。 -NM-applet is the system tray applet indicator for [NetworkManager][15]. That’s what we’re going to use to restart our network. +NM 程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 -First of all, check out your top panel. You should find a network icon in your system tray (in my case, it is a Wi-Fi icon, since that’s what I use). +首先,查看顶部面板。 你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 -Go ahead and click on that icon (or the sound or battery icon). This will open up the menu. Select “Turn Off” here. +接下来,点击该图标(也可以点击声音图标或电池图标)。这会打开菜单。选择“Turn Off”。 -![Restart network in Ubuntu][16]Turn off your network +![Restart network in Ubuntu][16] +关闭你的网络。 -The network icon should now disappear from the top panel. This means the network has been successfully turned off. +网络图标会在面板中消失,这表示你已经成功关闭网络了。 -Click again on your systray to reopen the menu. Select “Turn On”. +再次点击系统托盘重新打开菜单,选择“Turn On”。 -![Restarting network in Ubuntu][17]Turn the network back on +![Restarting network in Ubuntu][17] +重新开启网络。 -Congratulations! You have now restarted your network. +恭喜!你现在已经重启你的网络了。 -#### Bonus Tip: Refresh available network list +#### Bonus Tip: 刷新可用网络列表 Suppose you are connected to a network already but you want to connect to another network. How do you refresh the WiFi to see what other networks are available? Let me show you that. @@ -164,13 +166,13 @@ Now, you won’t see the list of available wireless networks immediately. When y And here, you can select the network of your choice and click connect. That’s it. -**Wrapping Up** +**总结** -Restarting your network or connection is something that every Linux user has to go through at some point in their experience. +重启网络连接是每个 Linux 用户在使用过程中必须经历的事情。 -We hope that we helped you with plenty of methods for handling such issues! +我们希望这些方法可以帮助你处理这样的问题! -What do you use to restart/handle your network? Is there something we missed? Leave us a comment below. +你是如何重启或管理你的网络的?我们是否还有遗漏?请在下方留言。 -------------------------------------------------------------------------------- From e48e306ddbd9682dbba08cc2913bd415f1a92705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 15:15:12 +0800 Subject: [PATCH 0221/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=EF=BC=8C?= =?UTF-8?q?=E5=BE=85=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...art a Network in Ubuntu -Beginner-s Tip.md | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index d1c7cc4828..6c95699d3d 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -10,7 +10,7 @@ 如何在 Ubuntu 中重启网络服务 【新手提示】 ====== -你 [是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 +你[是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: @@ -134,37 +134,43 @@ nmtui NM 程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 -首先,查看顶部面板。 你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 +首先,查看顶部状态栏。 你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 -接下来,点击该图标(也可以点击声音图标或电池图标)。这会打开菜单。选择“Turn Off”。 +接下来,点击该图标(也可以点击声音图标或电池图标)。这会打开菜单。选择 “Turn Off” 。 ![Restart network in Ubuntu][16] + 关闭你的网络。 -网络图标会在面板中消失,这表示你已经成功关闭网络了。 +网络图标会在状态栏中消失,这表示你已经成功关闭网络了。 -再次点击系统托盘重新打开菜单,选择“Turn On”。 +再次点击系统托盘重新打开菜单,选择 “Turn On” 。 ![Restarting network in Ubuntu][17] + 重新开启网络。 恭喜!你现在已经重启你的网络了。 #### Bonus Tip: 刷新可用网络列表 -Suppose you are connected to a network already but you want to connect to another network. How do you refresh the WiFi to see what other networks are available? Let me show you that. +如果你已经连接上一个网络,但是你想连接到另外一个网络,你如何刷新 WiFi 列表,查找其他可用的网络呢?我来向你展示一下。 -Ubuntu doesn’t have a ‘refresh wifi networks’ option directly. It’s sort of hidden. +Ubuntu 没有可以直接 “刷新 WiFi 网络” 的选项,它有点隐蔽。 -You’ll have to open the setting menu again and this time, click on “Select Network”. +你需要再次打开配置菜单,然后点击 “Select Network” 。 -![Refresh wifi network list in Ubuntu][18]Select Network to change your WiFi connection +![Refresh wifi network list in Ubuntu][18] -Now, you won’t see the list of available wireless networks immediately. When you open the networks list, it takes around 5 seconds to refresh and show up other available wireless networks. +选择对应的网络修改你的 WiFi 连接。 -![Select another wifi network in Ubuntu][19]Wait for around 5- seconds to see other available networks +你无法马上看到可用的无线网络列表。打开网络列表之后,大概需要 5 秒才会显示其他可用的无线网络。 -And here, you can select the network of your choice and click connect. That’s it. +![Select another wifi network in Ubuntu][19] + +等待大概 5 秒钟,看到其他可用的网络。 + +现在,你就可以选择你想要连接的网络,点击连接。这样就完成了。 **总结** @@ -172,7 +178,7 @@ And here, you can select the network of your choice and click connect. That’s 我们希望这些方法可以帮助你处理这样的问题! -你是如何重启或管理你的网络的?我们是否还有遗漏?请在下方留言。 +你是如何重启或管理你的网络的?我们是否还有遗漏的?请在下方留言。 -------------------------------------------------------------------------------- @@ -181,7 +187,7 @@ via: https://itsfoss.com/restart-network-ubuntu 作者:[Sergiu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[bodhix](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a91659492f5b0b010ef85687f2a99bdd6bc99865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 1 May 2019 16:26:01 +0800 Subject: [PATCH 0222/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...16 Detecting malaria with deep learning.md | 179 +++++++++--------- 1 file changed, 89 insertions(+), 90 deletions(-) rename {sources => translated}/tech/20190416 Detecting malaria with deep learning.md (51%) diff --git a/sources/tech/20190416 Detecting malaria with deep learning.md b/translated/tech/20190416 Detecting malaria with deep learning.md similarity index 51% rename from sources/tech/20190416 Detecting malaria with deep learning.md rename to translated/tech/20190416 Detecting malaria with deep learning.md index 37ced688a1..2089636e6a 100644 --- a/sources/tech/20190416 Detecting malaria with deep learning.md +++ b/translated/tech/20190416 Detecting malaria with deep learning.md @@ -7,79 +7,78 @@ [#]: via: (https://opensource.com/article/19/4/detecting-malaria-deep-learning) [#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) -Detecting malaria with deep learning -====== -Artificial intelligence combined with open source tools can improve -diagnosis of the fatal disease malaria. +使用深度学习检测疟疾 +================== +人工智能结合开源硬件工具能够提升严重传染病疟疾的诊断。 ![][1] -Artificial intelligence (AI) and open source tools, technologies, and frameworks are a powerful combination for improving society. _"Health is wealth"_ is perhaps a cliche, yet it's very accurate! In this article, we will examine how AI can be leveraged for detecting the deadly disease malaria with a low-cost, effective, and accurate open source deep learning solution. +人工智能(AI)和开源工具,技术,和框架是促进社会进步的强有力的结合。_“健康就是财富”_可能有点陈词滥调,但它却是非常准确的!在本篇文章,我们将测试 AI 是如何与低花费,有效,精确的开源深度学习方法一起被利用来检测致死的传染病疟疾。 -While I am neither a doctor nor a healthcare researcher and I'm nowhere near as qualified as they are, I am interested in applying AI to healthcare research. My intent in this article is to showcase how AI and open source solutions can help malaria detection and reduce manual labor. +我既不是一个医生,也不是一个医疗保健研究者,我也绝不像他们那样合格,我只是对将 AI 应用到医疗保健研究感兴趣。在这片文章中我的想法是展示 AI 和开源解决方案如何帮助疟疾检测和减少人工劳动的方法。 ![Python and TensorFlow][2] -Python and TensorFlow: A great combo to build open source deep learning solutions +Python and TensorFlow: 一个构建开源深度学习方法的很棒的结合 -Thanks to the power of Python and deep learning frameworks like TensorFlow, we can build robust, scalable, and effective deep learning solutions. Because these tools are free and open source, we can build solutions that are very cost-effective and easily adopted and used by anyone. Let's get started! +感谢 Python 的强大 和像 TensorFlow 这样的深度学习框架,我们能够构建鲁棒的,大规模的,有效的深度学习方法。因为这些工具是自由和开源的,我们能够构建低成本的能够轻易被任何人采纳和使用的解决方案。让我们开始吧! -### Motivation for the project +### 项目动机 -Malaria is a deadly, infectious, mosquito-borne disease caused by _Plasmodium_ parasites that are transmitted by the bites of infected female _Anopheles_ mosquitoes. There are five parasites that cause malaria, but two types— _P. falciparum_ and _P. vivax_ —cause the majority of the cases. +疟疾是由_疟原虫_造成的致死的,有传染性的,蚊子传播的疾病,主要通过受感染的雌性按蚊叮咬传播。共有五种寄生虫能够造成疟疾,但是样例中的大多数是这两种类型- _恶性疟原虫_ 和 _间日疟原虫_ 造成的。 -![Malaria heat map][3] +![疟疾热图][3] -This map shows that malaria is prevalent around the globe, especially in tropical regions, but the nature and fatality of the disease is the primary motivation for this project. +这个地图显示了疟疾在全球传播分布形势,尤其在热带地区,但疾病的性质和致命性是该项目的主要动机。 -If an infected mosquito bites you, parasites carried by the mosquito enter your blood and start destroying oxygen-carrying red blood cells (RBC). Typically, the first symptoms of malaria are similar to a virus like the flu and they usually begin within a few days or weeks after the mosquito bite. However, these deadly parasites can live in your body for over a year without causing symptoms, and a delay in treatment can lead to complications and even death. Therefore, early detection can save lives. +如果一个雌性蚊子咬了你,蚊子携带的寄生虫进入你的血液并且开始破坏携带氧气的红细胞(RBC)。通常,疟疾的最初症状类似于流感病毒,在蚊子叮咬后,他们通常在几天或几周内发作。然而,这些致死的寄生虫可以在你的身体里生存长达一年并且不会造成任何症状,延迟治疗可能造成并发症甚至死亡。因此,早期的检查能够挽救生命。 -The World Health Organization's (WHO) [malaria facts][4] indicate that nearly half the world's population is at risk from malaria, and there are over 200 million malaria cases and approximately 400,000 deaths due to malaria every year. This is a motivatation to make malaria detection and diagnosis fast, easy, and effective. +世界健康组织(WHO)的[疟疾事件][4]暗示世界近乎一半的人口面临疟疾的风险,有超过 2 亿 的疟疾病例,每年由于疟疾造成的死亡近乎 40 万。这是使疟疾检测和诊断快速,简单和有效的一个动机。 -### Methods of malaria detection +### 检测疟疾的方法 -There are several methods that can be used for malaria detection and diagnosis. The paper on which our project is based, "[Pre-trained convolutional neural networks as feature extractors toward improved Malaria parasite detection in thin blood smear images][5]," by Rajaraman, et al., introduces some of the methods, including polymerase chain reaction (PCR) and rapid diagnostic tests (RDT). These two tests are typically used where high-quality microscopy services are not readily available. +有几种方法能够用来检测和诊断疟疾。该文中的项目就是基于 Rajaraman,et al. 的论文:“[预先训练的卷积神经网络作为特征提取器,用于改善薄血涂片图像中的疟疾寄生虫检测][5]”,介绍了一些方法,包含聚合酶链反应(PCR)和快速诊断测试(RDT)。这两种测试通常在高质量的显微镜下使用,但这样的设备不是轻易能够获得的。 -The standard malaria diagnosis is typically based on a blood-smear workflow, according to Carlos Ariza's article "[Malaria Hero: A web app for faster malaria diagnosis][6]," which I learned about in Adrian Rosebrock's "[Deep learning and medical image analysis with Keras][7]." I appreciate the authors of these excellent resources for giving me more perspective on malaria prevalence, diagnosis, and treatment. +标准的疟疾诊断通常使基于血液涂片工作流的,根据 Carlos Ariza 的文章“[Malaria Hero: 一个更快诊断疟原虫的网络应用][6]”,我从中了解到 Adrian Rosebrock 的“[使用 Keras 的深度学习和医学图像分析][7]”。我感激这些优秀的资源的作者,让我在疟原虫预防,诊断和治疗方面有了更多的想法。 -![Blood smear workflow for Malaria detection][8] +![疟原虫检测的血涂片工作流程][8] -A blood smear workflow for Malaria detection +一个疟原虫检测的血涂片工作流程 -According to WHO protocol, diagnosis typically involves intensive examination of the blood smear at 100X magnification. Trained people manually count how many red blood cells contain parasites out of 5,000 cells. As the Rajaraman, et al., paper cited above explains: +根据 WHO 草案,诊断通常包括对放大 100 倍的血涂片的集中检测。训练人们人工计数在 5000 个细胞中有多少红细胞中包含疟原虫。正如上述解释中引用的 Rajaraman, et al. 的论文: -> Thick blood smears assist in detecting the presence of parasites while thin blood smears assist in identifying the species of the parasite causing the infection (Centers for Disease Control and Prevention, 2012). The diagnostic accuracy heavily depends on human expertise and can be adversely impacted by the inter-observer variability and the liability imposed by large-scale diagnoses in disease-endemic/resource-constrained regions (Mitiku, Mengistu, and Gelaw, 2003). Alternative techniques such as polymerase chain reaction (PCR) and rapid diagnostic tests (RDT) are used; however, PCR analysis is limited in its performance (Hommelsheim, et al., 2014) and RDTs are less cost-effective in disease-endemic regions (Hawkes, Katsuva, and Masumbuko, 2009). +> 薄血涂片帮助检测疟原虫的存在性并且帮助识别造成传染(疾病控制和抑制中心,2012)的物种。诊断准确性在很大程度上取决于人类的专业知识,并且可能受到观察者间差异和疾病流行/资源受限区域大规模诊断所造成的不利影响(Mitiku, Mengistu, and Gelaw, 2003)。可替代的技术是使用聚合酶链反应(PCR)和快速诊断测试(RDT);然而,PCR 分析受限于它的性能(Hommelsheim, et al., 2014),RDT 在疾病流行的地区成本效益低(Hawkes,Katsuva, and Masumbuko, 2009)。 -Thus, malaria detection could benefit from automation using deep learning. +因此,疟疾检测可能受益于使用机器学习的自动化。 -### Deep learning for malaria detection +### 疟原虫检测的深度学习 -Manual diagnosis of blood smears is an intensive manual process that requires expertise in classifying and counting parasitized and uninfected cells. This process may not scale well, especially in regions where the right expertise is hard to find. Some advancements have been made in leveraging state-of-the-art image processing and analysis techniques to extract hand-engineered features and build machine learning-based classification models. However, these models are not scalable with more data being available for training and given the fact that hand-engineered features take a lot of time. +人工诊断血涂片是一个加强的人工过程,需要专业知识来分类和计数被寄生虫感染的和未感染的细胞。这个过程可能不能很好的规模化,尤其在那些专业人士不足的地区。在利用最先进的图像处理和分析技术提取人工选取特征和构建基于机器学习的分类模型方面取得了一些进展。然而,这些模型不能大规模推广,因为没有更多的数据用来训练,并且人工选取特征需要花费很长时间。 -Deep learning models, or more specifically convolutional neural networks (CNNs), have proven very effective in a wide variety of computer vision tasks. (If you would like additional background knowledge on CNNs, I recommend reading [CS231n Convolutional Neural Networks for Visual Recognition][9].) Briefly, the key layers in a CNN model include convolution and pooling layers, as shown in the following figure. +深度学习模型,或者更具体地讲,卷积神经网络(CNNs),已经被证明在各种计算机视觉任务中非常有效。(如果你想有额外的关于 CNNs 的背景知识,我推荐你阅读[视觉识别的 CS2331n 卷积神经网络][9]。)简单地讲,CNN 模型的关键层包含卷积和池化层,正如下面图像显示。 ![A typical CNN architecture][10] -A typical CNN architecture +一个典型的 CNN 架构 -Convolution layers learn spatial hierarchical patterns from data, which are also translation-invariant, so they are able to learn different aspects of images. For example, the first convolution layer will learn small and local patterns, such as edges and corners, a second convolution layer will learn larger patterns based on the features from the first layers, and so on. This allows CNNs to automate feature engineering and learn effective features that generalize well on new data points. Pooling layers helps with downsampling and dimension reduction. +卷积层从数据中学习空间层级模式,它是平移不变的,因此它们能够学习不同方面的图像。例如,第一个卷积层将学习小的和本地图案,例如边缘和角落,第二个卷积层学习基于第一层的特征的更大的图案,等等。这允许 CNNs 自动化提取特征并且学习对于新数据点通用的有效的特征。池化层帮助下采样和降维。 -Thus, CNNs help with automated and scalable feature engineering. Also, plugging in dense layers at the end of the model enables us to perform tasks like image classification. Automated malaria detection using deep learning models like CNNs could be very effective, cheap, and scalable, especially with the advent of transfer learning and pre-trained models that work quite well, even with constraints like less data. +因此,CNNs 帮助自动化和规模化的特征工程。同样,在模型末尾加上密集层允许我们执行像图像分类这样的任务。使用像 CNNs 者的深度学习模型自动的疟疾检测可能非常有效,便宜和具有规模性,尤其是迁移学习和预训练模型效果非常好,甚至在少量数据的约束下。 -The Rajaraman, et al., paper leverages six pre-trained models on a dataset to obtain an impressive accuracy of 95.9% in detecting malaria vs. non-infected samples. Our focus is to try some simple CNN models from scratch and a couple of pre-trained models using transfer learning to see the results we can get on the same dataset. We will use open source tools and frameworks, including Python and TensorFlow, to build our models. +Rajaraman, et al. 的论文在一个数据集上利用六个预训练模型在检测疟疾 vs 无感染样本获取到令人吃惊的 95.9% 的准确率。我们的关注点是从头开始尝试一些简单的 CNN 模型和用一个预训练的训练模型使用迁移学习来查看我们能够从相同的数据集中得到什么。我们将使用开源工具和框架,包括 Python 和 TensorFlow,来构建我们的模型。 -### The dataset +### 数据集 -The data for our analysis comes from researchers at the Lister Hill National Center for Biomedical Communications (LHNCBC), part of the National Library of Medicine (NLM), who have carefully collected and annotated the [publicly available dataset][11] of healthy and infected blood smear images. These researchers have developed a mobile [application for malaria detection][12] that runs on a standard Android smartphone attached to a conventional light microscope. They used Giemsa-stained thin blood smear slides from 150 _P. falciparum_ -infected and 50 healthy patients, collected and photographed at Chittagong Medical College Hospital, Bangladesh. The smartphone's built-in camera acquired images of slides for each microscopic field of view. The images were manually annotated by an expert slide reader at the Mahidol-Oxford Tropical Medicine Research Unit in Bangkok, Thailand. +我们分析的数据来自 Lister Hill 国家生物医学交流中心(LHNCBC),国家医学图书馆(NLM)的一部分,他们细心收集和标记了健康和受感染的血涂片图像的[公众可获得的数据集][11]。这些研究者已经开发了一个运行在 Android 智能手机的移动[疟疾检测应用][12],连接到一个传统的光学显微镜。它们使用 吉姆萨染液 将 150 个受恶性疟原虫感染的和 50 个健康病人的薄血涂片染色,这些薄血涂片是在孟加拉的吉大港医学院附属医院收集和照相的。使用智能手机的内置相机获取每个显微镜视窗内的图像。这些图片由在泰国曼谷的马希多-牛津热带医学研究所的一个专家使用幻灯片阅读器标记的。 -Let's briefly check out the dataset's structure. First, I will install some basic dependencies (based on the operating system being used). +让我们简洁的查看数据集的结构。首先,我将安装一些基础的依赖(基于使用的操作系统)。 ![Installing dependencies][13] -I am using a Debian-based system on the cloud with a GPU so I can run my models faster. To view the directory structure, we must install the tree dependency (if we don't have it) using **sudo apt install tree**. +我使用的是云上的带有一个 GPU 的基于 Debian 的操作系统,这样我能更快的运行我的模型。为了查看目录结构,我们必须安装 tree 依赖(如果我们没有安装的话)使用 **sudo apt install tree**。 ![Installing the tree dependency][14] -We have two folders that contain images of cells, infected and healthy. We can get further details about the total number of images by entering: +我们有两个文件夹包含血细胞的图像,包括受感染的和健康的。我们可以获取关于图像总数更多的细节通过输入: ``` @@ -98,7 +97,7 @@ len(infected_files), len(healthy_files) (13779, 13779) ``` -It looks like we have a balanced dataset with 13,779 malaria and 13,779 non-malaria (uninfected) cell images. Let's build a data frame from this, which we will use when we start building our datasets. +看起来我们有一个平衡的 13,779 张疟疾的 和 13,779 张非疟疾的(健康的)血细胞图像。让我们根据这些构建数据帧,我们将用这些数据帧来构建我们的数据集。 ``` @@ -117,9 +116,9 @@ files_df.head() ![Datasets][15] -### Build and explore image datasets +### 构建和参所图像数据集 -To build deep learning models, we need training data, but we also need to test the model's performance on unseen data. We will use a 60:10:30 split for train, validation, and test datasets, respectively. We will leverage the train and validation datasets during training and check the performance of the model on the test dataset. +为了构建深度学习模型,我们需要训练数据,但是我们还需要使用不可见的数据测试模型的性能。相应的,我们将使用 60:10:30 的划分用于训练,验证和测试数据集。我们将在训练期间应用训练和验证数据集并用测试数据集来检查模型的性能。 ``` @@ -143,7 +142,7 @@ Val: Counter({'healthy': 970, 'malaria': 959}) Test: Counter({'malaria': 4193, 'healthy': 4075}) ``` -The images will not be of equal dimensions because blood smears and cell images vary based on the human, the test method, and the orientation of the photo. Let's get some summary statistics of our training dataset to determine the optimal image dimensions (remember, we don't touch the test dataset at all!). +这些图片维度并不相同,因此血涂片和细胞图像是基于人类,测试方法,图片的朝向。让我们总结我们的训练数据集的统计信息来决定最佳的图像维度(牢记,我们根本不会碰测试数据集)。 ``` @@ -183,7 +182,7 @@ Median Dimensions: [130. 130. 3.] Max Dimensions: [385 394 3] ``` -We apply parallel processing to speed up the image-read operations and, based on the summary statistics, we will resize each image to 125x125 pixels. Let's load up all of our images and resize them to these fixed dimensions. +我们应用并行处理来加速图像读取,并且在总结统计时,我们将重新调整每幅图片到 125x125 像素。让我们载入我们所有的图像并重新调整它们为这些固定的大小。 ``` @@ -246,7 +245,7 @@ ThreadPoolExecutor-1_8: working on img num: 8267 ((17361, 125, 125, 3), (1929, 125, 125, 3), (8268, 125, 125, 3)) ``` -We leverage parallel processing again to speed up computations pertaining to image load and resizing. Finally, we get our image tensors of the desired dimensions, as depicted in the preceding output. We can now view some sample cell images to get an idea of how our data looks. +我们再次应用并行处理来加速有关图像载入和重新调整大小。最终,我们获得了想要的维度的图片张量,正如之前描述的。我们现在查看一些血细胞图像样本来对我们的数据什么样有个印象。 ``` @@ -267,9 +266,9 @@ plt.xticks([]) , plt.yticks([]) ![Malaria cell samples][16] -Based on these sample images, we can see some subtle differences between malaria and healthy cell images. We will make our deep learning models try to learn these patterns during model training. +基于这些样本图像,我们看到一些疟疾和健康细胞图像的细微不同。我们将使我们的深度学习模型试图在模型训练中学习这些模式。 -Before can we start training our models, we must set up some basic configuration settings. +开始我们的模型训练前,我们必须建立一些基础的配置设置。 ``` @@ -295,7 +294,7 @@ print(train_labels[:6], train_labels_enc[:6]) ['malaria' 'malaria' 'malaria' 'healthy' 'healthy' 'malaria'] [1 1 1 0 0 1] ``` -We fix our image dimensions, batch size, and epochs and encode our categorical class labels. The alpha version of TensorFlow 2.0 was released in March 2019, and this exercise is the perfect excuse to try it out. +我们修复我们的图像维度,批大小,和历元并编码我们的分类类标签。TensorFlow 2.0 于 2019 年三月发布,这个练习是非常好的借口来试用它。 ``` @@ -311,13 +310,13 @@ tf.__version__ '2.0.0-alpha0' ``` -### Deep learning model training +### 深度学习训练 -In the model training phase, we will build three deep learning models, train them with our training data, and compare their performance using the validation data. We will then save these models and use them later in the model evaluation phase. +在模型训练阶段,我们将构建三个深度训练模型,使用我们的训练集训练,使用验证数据比较它们的性能。我们然后保存这些模型并在之后的模型评估阶段使用它们。 -#### Model 1: CNN from scratch +#### 模型 1:从头开始的 CNN -Our first malaria detection model will build and train a basic CNN from scratch. First, let's define our model architecture. +我们的第一个疟疾检测模型将从头开始构建和训练一个基础的 CNN。首先,让我们定义我们的模型架构, ``` @@ -376,7 +375,7 @@ Non-trainable params: 0 _________________________________________________________________ ``` -Based on the architecture in this code, our CNN model has three convolution and pooling layers, followed by two dense layers, and dropouts for regularization. Let's train our model. +基于这些代码的架构,我们的 CNN 模型有三个卷积和一个池化层,跟随两个致密层,以及用于正则化的丢失。让我们训练我们的模型。 ``` @@ -411,7 +410,7 @@ Epoch 25/25 17361/17361 [====] - 30s 2ms/sample - loss: 0.0034 - accuracy: 0.9994 - val_loss: 0.3699 - val_accuracy: 0.9559 ``` -We get a validation accuracy of 95.6%, which is pretty good, although our model looks to be overfitting slightly (based on looking at our training accuracy, which is 99.9%). We can get a clear perspective on this by plotting the training and validation accuracy and loss curves. +我们获得了 95.6% 的验证精确率,这很好,尽管我们的模型看起来有些过拟合(通过查看我们的训练精确度,是 99.9%)。通过绘制训练和验证的精度和损失曲线,我们可以清楚地看到这一点。 ``` @@ -440,47 +439,47 @@ l2 = ax2.legend(loc="best") ![Learning curves for basic CNN][17] -Learning curves for basic CNN +基础 CNN 学习曲线 -We can see after the fifth epoch that things don't seem to improve a whole lot overall. Let's save this model for future evaluation. +我们可以看在在第五个历元,情况并没有改善很多。让我们保存这个模型用于将来的评估。 ``` `model.save('basic_cnn.h5')` ``` -#### Deep transfer learning +#### 深度迁移学习 -Just like humans have an inherent capability to transfer knowledge across tasks, transfer learning enables us to utilize knowledge from previously learned tasks and apply it to newer, related ones, even in the context of machine learning or deep learning. If you are interested in doing a deep-dive on transfer learning, you can read my article "[A comprehensive hands-on guide to transfer learning with real-world applications in deep learning][18]" and my book [_Hands-On Transfer Learning with Python_][19]. +就像人类有与生俱来的能力在不同任务间传输知识,迁移学习允许我们利用从以前任务学到的知识用到新的任务,相关的任务,甚至在机器学习或深度学习的上下文中。如果想深入探究迁移学习,你应该看我的文章“[一个易于理解与现实应用一起学习深度学习中的迁移学习的指导实践][18]”和我的书[ Python 迁移学习实践][19]。 -![Ideas for deep transfer learning][20] +![深度迁移学习的想法][20] -The idea we want to explore in this exercise is: +在这篇实践中我们想要探索的想法是: -> Can we leverage a pre-trained deep learning model (which was trained on a large dataset, like ImageNet) to solve the problem of malaria detection by applying and transferring its knowledge in the context of our problem? +> 在我们的问题上下文中,我们能够利用一个预训练深度学习模型(在大数据集上训练的,像 ImageNet)通过应用和迁移知识来解决疟疾检测的问题吗? -We will apply the two most popular strategies for deep transfer learning. +我们将应用两个深度迁移学习的最流行的策略。 - * Pre-trained model as a feature extractor - * Pre-trained model with fine-tuning + * 预训练模型作为特征提取器 + * 微调的预训练模型 -We will be using the pre-trained VGG-19 deep learning model, developed by the Visual Geometry Group (VGG) at the University of Oxford, for our experiments. A pre-trained model like VGG-19 is trained on a huge dataset ([ImageNet][21]) with a lot of diverse image categories. Therefore, the model should have learned a robust hierarchy of features, which are spatial-, rotational-, and translation-invariant with regard to features learned by CNN models. Hence, the model, having learned a good representation of features for over a million images, can act as a good feature extractor for new images suitable for computer vision problems like malaria detection. Let's discuss the VGG-19 model architecture before unleashing the power of transfer learning on our problem. +我们将使用预训练的 VGG-19 深度训练模型,由剑桥大学的视觉几何组(VGG)开发,作为我们的实验。一个像 VGG-19 的预训练模型在一个大的数据集上使用了很多不同的图像分类训练([Imagenet][21])。因此,这个模型应该已经学习到了鲁棒的特征层级结构,相对于你的 CNN 模型学到的特征,是空间不变的,转动不变的,平移不变的。因此,这个模型,已经从百万幅图片中学习到了一个好的特征显示,对于像疟疾检测这样的计算机视觉问题,可以作为一个好的合适新图像的特征提取器。在我们的问题中释放迁移学习的能力之前,让我们先讨论 VGG-19 模型。 -##### Understanding the VGG-19 model +##### 理解 VGG-19 模型 -The VGG-19 model is a 19-layer (convolution and fully connected) deep learning network built on the ImageNet database, which was developed for the purpose of image recognition and classification. This model was built by Karen Simonyan and Andrew Zisserman and is described in their paper "[Very deep convolutional networks for large-scale image recognition][22]." The architecture of the VGG-19 model is: +VGG-19 模型是一个构建在 ImageNet 数据库之上的 19 层(卷积和全连接的)的深度学习网络,该数据库为了图像识别和分类的目的而开发。该模型由 Karen Simonyan 和 Andrew Zisserman 构建,在它们的论文”[大规模图像识别的非常深的卷积网络][22]“中描述。VGG-19 的架构模型是: -![VGG-19 Model Architecture][23] +![VGG-19 模型架构][23] -You can see that we have a total of 16 convolution layers using 3x3 convolution filters along with max pooling layers for downsampling and two fully connected hidden layers of 4,096 units in each layer followed by a dense layer of 1,000 units, where each unit represents one of the image categories in the ImageNet database. We do not need the last three layers since we will be using our own fully connected dense layers to predict malaria. We are more concerned with the first five blocks so we can leverage the VGG model as an effective feature extractor. +你可以看到我们总共有 16 个使用 3x3 卷积过滤器的卷积层,与最大的池化层来下采样,和由 4096 个单元组成的两个全连接的隐藏层,每个隐藏层之后跟随一个由 1000 个单元组成的致密层,每个单元代表 ImageNet 数据库中的一个分类。我们不需要最后三层,因为我们将使用我们自己的全连接致密层来预测疟疾。我们更关心前五块,因此我们可以利用 VGG 模型作为一个有效的特征提取器。 -We will use one of the models as a simple feature extractor by freezing the five convolution blocks to make sure their weights aren't updated after each epoch. For the last model, we will apply fine-tuning to the VGG model, where we will unfreeze the last two blocks (Block 4 and Block 5) so that their weights will be updated in each epoch (per batch of data) as we train our own model. +我们将使用模型之一作为一个简单的特征提取器通过冻结五个卷积块的方式来确保它们的位权在每个时期后不会更新。对于最后一个模型,我们会应用微调到 VGG 模型,我们会解冻最后两个块(第 4 和第 5)因此当我们训练我们的模型时,它们的位权在每个时期(每批数据)被更新。 -#### Model 2: Pre-trained model as a feature extractor +#### 模型 2:预训练的模型作为一个特征提取器 -For building this model, we will leverage TensorFlow to load up the VGG-19 model and freeze the convolution blocks so we can use them as an image feature extractor. We will plug in our own dense layers at the end to perform the classification task. +为了构建这个模型,我们将利用 TensorFlow 载入 VGG-19 模型并且冻结卷积块因此我们用够将他们用作特征提取器。我们插入我们自己的致密层在末尾来执行分类任务。 ``` @@ -541,7 +540,7 @@ Non-trainable params: 20,024,384 _________________________________________________________________ ``` -It is evident from this output that we have a lot of layers in our model and we will be using the frozen layers of the VGG-19 model as feature extractors only. You can use the following code to verify how many layers in our model are indeed trainable and how many total layers are present in our network. +输出是很明白的,在我们的模型中我们有了很多层,我们将只利用 VGG-19 模型的冻结层作为特征提取器。你可以使用下列代码来验证我们的模型有多少层是实际训练的,我们的网络中总共存在多少层。 ``` @@ -554,22 +553,22 @@ Total Layers: 28 Total trainable layers: 6 ``` -We will now train our model using similar configurations and callbacks to the ones we used in our previous model. Refer to [my GitHub repository][24] for the complete code to train the model. We observe the following plots showing the model's accuracy and loss. +我们将使用和我们之前的模型相似的配置和回调来训练我们的模型。参考 [我的 GitHub 仓库][24] 获取训练模型的完整代码。我们观察下列显示模型精确度和损失曲线。 ![Learning curves for frozen pre-trained CNN][25] -Learning curves for frozen pre-trained CNN +冻结的预训练的 CNN 的学习曲线 -This shows that our model is not overfitting as much as our basic CNN model, but the performance is slightly less than our basic CNN model. Let's save this model for future evaluation. +这显示了我们的模型没有像我们的基础 CNN 模型那样过拟合,但是性能有点不如我们的基础的 CNN 模型。让我们保存这个模型用户将来的评估。 ``` `model.save('vgg_frozen.h5')` ``` -#### Model 3: Fine-tuned pre-trained model with image augmentation +#### 模型 3:使用图像增强来微调预训练的模型 -In our final model, we will fine-tune the weights of the layers in the last two blocks of our pre-trained VGG-19 model. We will also introduce the concept of image augmentation. The idea behind image augmentation is exactly as the name sounds. We load in existing images from our training dataset and apply some image transformation operations to them, such as rotation, shearing, translation, zooming, and so on, to produce new, altered versions of existing images. Due to these random transformations, we don't get the same images each time. We will leverage an excellent utility called **ImageDataGenerator** in **tf.keras** that can help build image augmentors. +在我们的最后一个模型中,我们微调预定义好的 VGG-19 模型的最后两个块中层的位权。我们同样引入图像增强的概念。图像增强背后的想法和名字一样。我们从训练数据集中载入已存在的图像,并且应用转换操作,例如旋转,裁剪,转换,放大缩小,等等,来产生新的,改变的版本。由于这些随机的转换,我们每次获取到的图像不一样。我们将应用一个在 **tf.keras** 的优秀的工具叫做 **ImageDataGenerator** 来帮助构建图像增强器。 ``` @@ -588,7 +587,7 @@ train_generator = train_datagen.flow(train_data, train_labels_enc, batch_size=BA val_generator = val_datagen.flow(val_data, val_labels_enc, batch_size=BATCH_SIZE, shuffle=False) ``` -We will not apply any transformations on our validation dataset (except for scaling the images, which is mandatory) since we will be using it to evaluate our model performance per epoch. For a detailed explanation of image augmentation in the context of transfer learning, feel free to check out my [article][18] cited above. Let's look at some sample results from a batch of image augmentation transforms. +我们不会应用任何转换在我们的验证数据集上(除非是调整大小,它是强制性适应的)因为我们将在每个时期来评估我们的模型性能。对于在传输学习上下文中的图像增强的详细解释,请自由查看我们上述引用的[文章][18]。让我们从一批图像增强转换中查看一些样本结果。 ``` @@ -603,7 +602,7 @@ l = [ax[i].imshow(sample[i][0][0]) for i in range(0,5)] ![Sample augmented images][26] -You can clearly see the slight variations of our images in the preceding output. We will now build our deep learning model, making sure the last two blocks of the VGG-19 model are trainable. +你可以清晰的看到与之前的输出中我们图像的轻微变化。我们现在构建我们的学习模型,确保 VGG-19 模型的最后两块是可以训练的。 ``` @@ -644,7 +643,7 @@ Total Layers: 28 Total trainable layers: 16 ``` -We reduce the learning rate in our model since we don't want to make to large weight updates to the pre-trained layers when fine-tuning. The model's training process will be slightly different since we are using data generators, so we will be leveraging the **fit_generator(…)** function. +在我们的模型中我们降低了学习率,因为我们微调的时候不想在预训练的数据集上做大的位权更新。模型的训练过程可能有轻微的不同,因为我们使用了数据生成器,因此我们应用了 **fit_generator(...)** 函数。 ``` @@ -672,24 +671,24 @@ Epoch 25/25 271/271 [====] - 128s 473ms/step - loss: 0.0792 - accuracy: 0.9729 - val_loss: 0.1127 - val_accuracy: 0.9641 ``` -This looks to be our best model yet. It gives us a validation accuracy of almost 96.5% and, based on the training accuracy, it doesn't look like our model is overfitting as much as our first model. This can be verified with the following learning curves. +这看起来是我们的最好的模型。它给了我们近乎 96.5% 的验证精确率,基于训练精度,它看起来不像我们的第一个模型那样过拟合。这可以通过下列的学习曲线验证。 ![Learning curves for fine-tuned pre-trained CNN][27] -Learning curves for fine-tuned pre-trained CNN +微调预训练的 CNN 的学习曲线 -Let's save this model so we can use it for model evaluation on our test dataset. +让我们保存这个模型,因此我们能够在测试集上使用。 ``` `model.save('vgg_finetuned.h5')` ``` -This completes our model training phase. We are now ready to test the performance of our models on the actual test dataset! +这完成了我们的模型训练阶段。我们准备好在测试集上测试我们模型的性能。 -### Deep learning model performance evaluation +### 深度学习模型性能评估 -We will evaluate the three models we built in the training phase by making predictions with them on the data from our test dataset—because just validation is not enough! We have also built a nifty utility module called **model_evaluation_utils** , which we can use to evaluate the performance of our deep learning models with relevant classification metrics. The first step is to scale our test data. +我们将评估我们在训练阶段构建的三个模型,通过在我们的测试集上做预测,因为仅仅验证是不够的!我们同样构建了一个检测工具模块叫做 **model_evaluation_utils**,我们可以使用相关分类指标用来评估使用我们深度学习模型的性能。第一步是测量我们的数据集。 ``` @@ -700,7 +699,7 @@ test_imgs_scaled.shape, test_labels.shape ((8268, 125, 125, 3), (8268,)) ``` -The next step involves loading our saved deep learning models and making predictions on the test data. +下一步包括载入我们保存的深度学习模型,在测试集上预测。 ``` @@ -722,7 +721,7 @@ vgg_ft_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 for pred in vgg_ft_preds.ravel()]) ``` -The final step is to leverage our **model_evaluation_utils** module and check the performance of each model with relevant classification metrics. +下一步是应用我们的 **model_evaluation_utils** 模块根据相应分类指标来检查每个模块的性能。 ``` @@ -739,15 +738,15 @@ index=['Basic CNN', 'VGG-19 Frozen', 'VGG-19 Fine-tuned']) ![Model accuracy][28] -It looks like our third model performs best on the test dataset, giving a model accuracy and an F1-score of 96%, which is pretty good and quite comparable to the more complex models mentioned in the research paper and articles we mentioned earlier. +看起来我们的第三个模型在我们的测试集上执行的最好,给出了一个模型精确性为 96% 的 F1得分,比起上述我们早期引用的研究论文和文章中提及的复杂的模型是相当好的。 -### Conclusion +### 总结 -Malaria detection is not an easy procedure, and the availability of qualified personnel around the globe is a serious concern in the diagnosis and treatment of cases. We looked at an interesting real-world medical imaging case study of malaria detection. Easy-to-build, open source techniques leveraging AI can give us state-of-the-art accuracy in detecting malaria, thus enabling AI for social good. +疟疾检测不是一个简单的程序,全球的合格的人员的可获得性在样例诊断和治疗当中是一个严重的问题。我们看到一个关于疟疾的有趣的真实世界的医学影像案例。易于构建的,开源的技术利用 AI 在检测疟疾方面可以给我们最先进的精确性,因此允许 AI 对社会是有益的。 -I encourage you to check out the articles and research papers mentioned in this article, without which it would have been impossible for me to conceptualize and write it. If you are interested in running or adopting these techniques, all the code used in this article is available on [my GitHub repository][24]. Remember to download the data from the [official website][11]. +我鼓励你检查这片文章中提到的文章和研究论文,没有它们,我就不能形成概念并写出来。如果你对运行和采纳这些技术感兴趣,本篇文章所有的代码都可以在[我的 GitHub 仓库][24]获得。记得从[官方网站][11]下载数据。 -Let's hope for more adoption of open source AI capabilities in healthcare to make it less expensive and more accessible for everyone around the world! +让我们希望在健康医疗方面更多的采纳开源的 AI 能力,使它在世界范围内变得便宜些,易用些。 -------------------------------------------------------------------------------- @@ -755,7 +754,7 @@ via: https://opensource.com/article/19/4/detecting-malaria-deep-learning 作者:[Dipanjan (DJ) Sarkar (Red Hat)][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[warmfrog](https://github.com/warmfrog) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c77489c0986c9f2fbe129d80e3583bd17fb47893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 1 May 2019 17:49:47 +0800 Subject: [PATCH 0223/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...This is how System76 does open hardware.md | 78 ------------------- 1 file changed, 78 deletions(-) delete mode 100644 sources/tech/20190419 This is how System76 does open hardware.md diff --git a/sources/tech/20190419 This is how System76 does open hardware.md b/sources/tech/20190419 This is how System76 does open hardware.md deleted file mode 100644 index 9fc742ad30..0000000000 --- a/sources/tech/20190419 This is how System76 does open hardware.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (This is how System76 does open hardware) -[#]: via: (https://opensource.com/article/19/4/system76-hardware) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -This is how System76 does open hardware -====== -What sets the new Thelio line of desktops apart from the rest. -![metrics and data shown on a computer screen][1] - -Most people know very little about the hardware in their computers. As a long-time Linux user, I've had my share of frustration while getting my wireless cards, video cards, displays, and other hardware working with my chosen distribution. Proprietary hardware often makes it difficult to determine why an Ethernet controller, wireless controller, or mouse performs differently than we expect. As Linux distributions have matured, this has become less of a problem, but we still see some quirks with touchpads and other peripherals, especially when we don't know much—if anything—about our underlying hardware. - -Companies like [System76][2] aim to take these types of problems out of the Linux user experience. System76 manufactures a line of Linux laptops, desktops, and servers, and even offers its own Linux distro, [Pop! OS][3], as an option for buyers, Recently I had the privilege of visiting System76's plant in Denver for [the unveiling][4] of [Thelio][5], its new desktop product line. - -### About Thelio - -System76 says Thelio's open hardware daughterboard, named Thelio Io after the fifth moon of Jupiter, is one thing that makes the computer unique in the marketplace. Thelio Io is certified [OSHWA #us000145][6] and has four SATA ports for storage and an embedded controller for fan and power button control. Thelio Io SAS is certified [OSHWA #us000146][7] and has four U.2 ports for storage and no embedded controller. During a demonstration, System76 showed how these components adjust fans throughout the chassis to optimize the unit's performance. - -The controller also runs the power button and the LED ring around the button, which glows at 100% brightness when it is pressed. This provides both tactile and visual confirmation that the unit is being powered on. While the computer is in use, the button is set to 35% brightness, and when it's in suspend mode, it pulses between 2.35% and 25%. When the computer is off, the LED remains dimly lit so that it's easy to find the power control in a dark room. - -Thelio's embedded controller is a low-power [ATmega32U4][8] microchip, and the controller's setup can be prototyped with an Arduino Micro. The number of Thelio Io boards changes depending on which Thelio model you purchase. - -Thelio is also perhaps the best-designed computer case and system I have ever seen. You'll probably agree if you have ever skinned your knuckles trying to operate inside a typical PC case. I have done this a number of times, and I have the scars to prove it. - -### Why open hardware? - -The boards were designed in [KiCAD][9], and you can access all of Thelio's design files under GPL on [GitHub][10]. So, why would a company that competes with other PC manufacturers design a unique interface then license it openly? It's because the company recognizes the value of open design and the ability to share and adjust an I/O board to your needs, even if you're a competitor in the marketplace. - -![Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.][11] - -Don Watkins speaks with System76 CEO Carl Richell at the [Thelio launch event][12]. - -I asked [Carl Richell][13], System76's founder and CEO, whether the company is concerned that openly licensing its hardware designs means someone could take its unique design and use it to drive System76 out of business. He said: - -> Open hardware benefits all of us. It's how we further advance technology and make it more available to everyone. We welcome anyone who wishes to improve on Thelio's design to do so. Opening the hardware not only helps advance improvements of our computers more quickly, but it also empowers our customers to truly own 100% of their device. Our goal is to remove as much proprietary functioning as we can, while still producing a competitive Linux computer for customers. -> -> We've been working with the Linux community for over 13 years to create a flawless and digestible experience on all of our laptops, desktops, and servers. Our long tenure serving the Linux community, providing our customers with a high level of service, and our personability are what makes System76 unique. - -I also asked Carl why open hardware makes sense for System76 and the PC business in general. He replied: - -> System76 was founded on the idea that technology should be open and accessible to everyone. We're not yet at the point where we can create a computer that is 100% open source, but with open hardware, we're one large, essential step closer to reaching that point. -> -> We live in an era where technology has become a utility. Computers are tools for people at every level of education and across many industries. With everyone's needs specific, each person has their own ideas on how they might improve the computer and its software as their primary tool. Having our computers open allows these ideas to come to fruition, which in turn makes the technology a more powerful tool. In an open environment, we constantly get to iterate a better PC. And that's kind of cool. - -We wrapped up our conversation by talking about System76's roadmap, which includes open hardware mini PCs and, eventually, laptops. Existing mini PCs and laptops sold under the System76 brand are manufactured by other vendors and are not based on open hardware (although their Linux software is, of course, open source). - -Designing and supporting open hardware is a game-changer in the PC business, and it is what sets System76's new Thelio line of desktop computers apart. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/system76-hardware - -作者:[Don Watkins ][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/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) -[2]: https://system76.com/ -[3]: https://opensource.com/article/18/1/behind-scenes-popos-linux -[4]: /article/18/11/system76-thelio-desktop-computer -[5]: https://system76.com/desktops -[6]: https://certification.oshwa.org/us000145.html -[7]: https://certification.oshwa.org/us000146.html -[8]: https://www.microchip.com/wwwproducts/ATmega32u4 -[9]: http://kicad-pcb.org/ -[10]: https://github.com/system76/thelio-io -[11]: https://opensource.com/sites/default/files/uploads/don_system76_ceo.jpg (Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.) -[12]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-FKWFxFv -[13]: https://www.linkedin.com/in/carl-richell-9435781 From 00e5f25b299daef958eb602dbb47ca50cb26c06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 19:51:53 +0800 Subject: [PATCH 0224/1154] =?UTF-8?q?=E6=A0=A1=E5=AF=B91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...art a Network in Ubuntu -Beginner-s Tip.md | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 6c95699d3d..e29bc55323 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -7,7 +7,7 @@ [#]: via: (https://itsfoss.com/restart-network-ubuntu) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) -如何在 Ubuntu 中重启网络服务 【新手提示】 +如何在 Ubuntu 中重启网络【新手提示】 ====== 你[是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 @@ -62,7 +62,7 @@ sudo nmcli networking on #### 4\. ifup & ifdown -这两个命令是直接操作网口,切换网口是否可以收发包的状态。这是 [Linux 中最应该了解的网络命令][4] 之一。 +这两个命令直接操作网口,切换网口是否可以收发包的状态。这是 [Linux 中最应该了解的网络命令][4] 之一。 使用 ifdown 关闭所有网口,再使用 ifup 重新启用网口。 @@ -74,7 +74,7 @@ sudo ifdown -a && sudo ifup -a **注意:** 这种方法不会让网络图标从系统托盘中消失,另外,你也无法进行网络连接。 -**Bonus tool: nmtui (click to expand)** +**其他工具: nmtui (点击展开)** 这是系统管理员们常用的另外一种方法。它是在命令行终端中管理网络的文本菜单工具。 @@ -82,13 +82,13 @@ sudo ifdown -a && sudo ifup -a nmtui ``` -这样就会打开如下菜单: +打开如下菜单: ![nmtui Menu][5] -**注意** 在 **nmtui** 中,你可以通过 **up** 和 **down 方向键** 选择选项。 +**注意** 在 **nmtui** 中,可以通过 **up** 和 **down 方向键** 选择选项。 -选择 **Activate a connection** : +选择 **Activate a connection** : ![nmtui Menu Select "Activate a connection"][6] @@ -100,7 +100,7 @@ nmtui ![Select your connection in the nmtui connections menu.][8] -按下 **Enter** 键。这样就 **关闭** 你的网络连接。 +按下 **Enter** 键。 **关闭** 你的网络连接。 ![nmtui Connections Menu with no active connection][9] @@ -116,7 +116,7 @@ nmtui ![Select "Back" in the nmtui connections menu.][12] -按下 **Enter** 键。这样就会回到 **nmtui** 的主菜单。 +按下 **Enter** 键,回到 **nmtui** 的主菜单。 ![nmtui Main Menu][13] @@ -124,35 +124,31 @@ nmtui ![nmtui Quit Main Menu][14] -这样就会退出该界面,返回到命令行终端。 +退出该界面,返回到命令行终端。 就这样,你已经成功重启网络了。 ### 通过图形化界面重启网络 -显然,这是 Ubuntu 桌面版用户重启网络最简单的方法。如果不生效,你可以尝试使用前文提到的命令行方式重启网络。 +显然,这是 Ubuntu 桌面版用户重启网络最简单的方法。如果这个方法不生效,你可以尝试使用前文提到的命令行方式重启网络。 NM 程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 首先,查看顶部状态栏。 你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 -接下来,点击该图标(也可以点击声音图标或电池图标)。这会打开菜单。选择 “Turn Off” 。 +接下来,点击该图标(也可以点击音量图标或电池图标)。打开菜单。选择 “Turn Off” 关闭网络。 ![Restart network in Ubuntu][16] -关闭你的网络。 - 网络图标会在状态栏中消失,这表示你已经成功关闭网络了。 -再次点击系统托盘重新打开菜单,选择 “Turn On” 。 +再次点击系统托盘重新打开菜单,选择 “Turn On”,重新开启网络。 ![Restarting network in Ubuntu][17] -重新开启网络。 - 恭喜!你现在已经重启你的网络了。 -#### Bonus Tip: 刷新可用网络列表 +#### 其他提示:刷新可用网络列表 如果你已经连接上一个网络,但是你想连接到另外一个网络,你如何刷新 WiFi 列表,查找其他可用的网络呢?我来向你展示一下。 From 43d39683ecfc03f1cbce5a8736a4ffddebdbc90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 20:03:45 +0800 Subject: [PATCH 0225/1154] =?UTF-8?q?=E6=A0=A1=E5=AF=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ok --- ...to Restart a Network in Ubuntu -Beginner-s Tip.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index e29bc55323..bb36bf83f8 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -20,9 +20,9 @@ 如果你使用的 Ubuntu 服务器版,那么你已经在使用命令行终端了。如果你使用的是桌面版,那么你可以通过快捷键 Ctrl+Alt+T [Ubuntu 键盘快捷键][3] 打开命令行终端。 -在 Ubuntu 中,你有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 +在 Ubuntu 中,有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 -#### 1\. network manager service +#### 1\、 network manager service 这是通过命令行方式重启网络最简单的方法。它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 @@ -32,9 +32,9 @@ sudo service network-manager restart 此时,网络图标会消失一会儿然后重新显示。 -#### 2\. systemd +#### 2\、 systemd -**service** 命令仅仅是该命令的一个封装命令(同样的还有 init.d 系列脚本和 Upstart 相关命令)。 **systemctl** 命令的功能远多于 **service** 命令。通常我更喜欢使用这个命令。 +**service** 命令仅仅是该命令的一个封装(同样的还有 init.d 系列脚本和 Upstart 相关命令)。 **systemctl** 命令的功能远多于 **service** 命令。通常我更喜欢使用这个命令。 ``` sudo systemctl restart NetworkManager.service @@ -42,7 +42,7 @@ sudo systemctl restart NetworkManager.service 这时,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考 man 帮助文档。 -#### 3\. nmcli +#### 3\、 nmcli 这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为它非常容易使用。 @@ -96,7 +96,7 @@ nmtui ![nmtui Connections Menu][7] -接下来,选择前面带 **星号 (*)** 的网络。在这个例子中,就是 MGEO72 。 +接下来,选择前面带 **星号 (*)** 的网络。在这个例子中,就是 MGEO72。 ![Select your connection in the nmtui connections menu.][8] From 8341c0bc252fcfa66c0b694bcd533df94fa886d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 20:05:05 +0800 Subject: [PATCH 0226/1154] =?UTF-8?q?=E6=A0=A1=E5=AF=B93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ok --- ...07 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index bb36bf83f8..90babd017c 100644 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -22,7 +22,7 @@ 在 Ubuntu 中,有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 -#### 1\、 network manager service +#### 1\. network manager service 这是通过命令行方式重启网络最简单的方法。它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 @@ -32,7 +32,7 @@ sudo service network-manager restart 此时,网络图标会消失一会儿然后重新显示。 -#### 2\、 systemd +#### 2\. systemd **service** 命令仅仅是该命令的一个封装(同样的还有 init.d 系列脚本和 Upstart 相关命令)。 **systemctl** 命令的功能远多于 **service** 命令。通常我更喜欢使用这个命令。 @@ -42,7 +42,7 @@ sudo systemctl restart NetworkManager.service 这时,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考 man 帮助文档。 -#### 3\、 nmcli +#### 3\. nmcli 这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为它非常容易使用。 From 84c1c9f756bd28f9002df9e523db0a86f6c55235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 20:09:24 +0800 Subject: [PATCH 0227/1154] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=91=E6=96=87?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md (100%) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md similarity index 100% rename from sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md rename to translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md From a7a9247a0bb37d8ab75bb6567610f08dc5f6b8b7 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 1 May 2019 17:10:58 +0800 Subject: [PATCH 0228/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...uick tips- Cutting content out of files.md | 91 ------------------- ...uick tips- Cutting content out of files.md | 89 ++++++++++++++++++ 2 files changed, 89 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20190405 Command line quick tips- Cutting content out of files.md create mode 100644 translated/tech/20190405 Command line quick tips- Cutting content out of files.md diff --git a/sources/tech/20190405 Command line quick tips- Cutting content out of files.md b/sources/tech/20190405 Command line quick tips- Cutting content out of files.md deleted file mode 100644 index 78b8216eca..0000000000 --- a/sources/tech/20190405 Command line quick tips- Cutting content out of files.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Command line quick tips: Cutting content out of files) -[#]: via: (https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/) -[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) - -Command line quick tips: Cutting content out of files -====== - -![][1] - -The Fedora distribution is a full featured operating system with an excellent graphical desktop environment. A user can point and click their way through just about any typical task easily. All of this wonderful ease of use masks the details of a powerful command line under the hood. This article is part of a series that shows you some common command line utilities. So let’s drop into the shell, and have a look at **cut**. - -Often when you work in the command line, you are working with text files. Sometimes these files may be quite long. Reading them in their entirety, while feasible, can be time consuming and prone to errors. In this installment you’ll learn how to extract content from text files, and get the information you want from them. - -It’s important to recognize that there are many ways to accomplish similar command line tasks in Fedora. The Fedora repositories include entire language systems for parsing and working with text, as an example. Also, there are multiple command line utilities available for just about any purpose conceivable in the shell. This article will only focus on using a few of those utility choices, to extract some information from a file and present it in a readable format. - -### Making the cut - -To illustrate this example use a standard sizable file on the system like _/etc/passwd_. As seen in a prior article in this series, you can execute the _cat_ command to view an entire file: - -``` -$ cat /etc/passwd -root:x:0:0:root:/root:/bin/bash -bin:x:1:1:bin:/bin:/sbin/nologin -daemon:x:2:2:daemon:/sbin:/sbin/nologin -adm:x:3:4:adm:/var/adm:/sbin/nologin -... -``` - -This file contains information on all accounts present on the system. It has a specific format: - -``` -name:password:user-id:group-id:comment:home-directory:shell -``` - -Imagine that you want to simply have a list of all the account names on the system. If you could only cut out the _name_ value from each line. This is where the _cut_ command comes in handy! This command treats any input one line at a time, and extracts a specific part of the line. - -The _cut_ command provides options for selecting parts of a line differently, and in this example two of them are needed, _-d_ which is an option to specify a delimiter type to use, and _-f_ which is an option to specify which field of the line to cut. The _-d_ option lets you declare the _delimiter_ that separates values in a line. In this case a colon (:) is used to separate values. The _-f_ option lets you choose which field value or values to extract. So for this example the command entered would be: - -``` -$ cut -d: -f1 /etc/passwd -root -bin -daemon -adm -... -``` - -That’s great, it worked! But you get the printout to the standard output, which in a terminal session at least means the screen. What if you needed the information for another task to be done later? It would be really nice if there was a way to put the output of the _cut_ command into a text file to save it. There is an easy builtin shell function for such a task, the redirect function ( _>_ ). - -``` -$ cut -d: -f1 /etc/passwd > names.txt -``` - -This will place the output of cut into a file called _names.txt_ and you can check the contents with _cat:_ - -``` -$ cat names.txt -root -bin -daemon -adm -... -``` - -With two commands and one shell function, it was easy to identify using _cat_ , extract using _cut_ , and redirect the extracted information from one file, saving it to another file for later use. - -* * * - -_Photo by _[ _Joel Mbugua_][2]_ on _[_Unsplash_][3]_._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/ - -作者:[Stephen Snow][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/jakfrost/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/commandline-cutting-816x345.jpg -[2]: https://unsplash.com/photos/tA5eSY_hay8?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/search/photos/command-line?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20190405 Command line quick tips- Cutting content out of files.md b/translated/tech/20190405 Command line quick tips- Cutting content out of files.md new file mode 100644 index 0000000000..63c8e2b223 --- /dev/null +++ b/translated/tech/20190405 Command line quick tips- Cutting content out of files.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Command line quick tips: Cutting content out of files) +[#]: via: (https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/) +[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) + +命令行技巧:分割文件内容 +====== + +![][1] + +Fedora 发行版是一个功能齐全的操作系统,有出色的图形化桌面环境。用户可以很容易地通过单击动作来完成任何典型任务。所有这些美妙的易用性掩盖了其底层强大的命令行细节。本文是向你展示一些常见命令行实用程序的系列文章的一部分。让我们进入 shell 来看看 **cut**。 + +通常,当你在命令行中工作时,你处理的是文本文件。有时这些文件可能很长,虽然可以完整地阅读它们,但是可能会耗费大量时间,并且容易出错。在本文中,你将学习如何从文本文件中提取内容,并从中获取你所需的信息。 + +重要的是要意识到,在 Fedora 中有许多方法可以完成类似的命令行任务。例如,Fedora 仓库含有用于解析和处理文本的完整语言系统。此外,还有多个命令行实用程序可用于 shell 中任何可能的用途。本文只关注使用其中几个实用程序选项,从文件中提取一些信息并以可读的格式呈现。 + +### cut 使用 + +为了演示这个例子,在系统上使用一个标准的大文件,如 _/etc/passwd_。正如本系列的前一篇文章所示,你可以执行 _cat_ 命令来查看整个文件: +``` +$ cat /etc/passwd +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/bin:/sbin/nologin +daemon:x:2:2:daemon:/sbin:/sbin/nologin +adm:x:3:4:adm:/var/adm:/sbin/nologin +... +``` + +此文件包含系统上所有所有账户的信息。它有一个特定的格式: + +``` +name:password:user-id:group-id:comment:home-directory:shell +``` +假设你只想要系统上所有账户名的列表,如果你只能从每一行中删除 _name_ 值。这就是 _cut_ 命令派上用场的地方!它一次处理一行输入,并提取该行的特定部分。 + +_cut_ 命令提供了以不同方式选择一行的部分的选项,在本示例中需要两个,_d_ 是指定要使用的分隔符类型,_f_ 是指定要删除行的哪个字段。_-d_ 选项允许你声明用于分隔行中值的 _delimiter_。在本例中,冒号(:)用于分隔值。_-f_ 选项允许你选择要提取哪个字段或哪些字段值。因此,在本例中,输入的命令是: + +``` +$ cut -d: -f1 /etc/passwd +root +bin +daemon +adm +... +``` + +太棒了,成功了!但是你将输出打印到标准输出,在终端会话中意味着它需要占据屏幕。如果你需要稍后完成另一项任务所需的信息,这该怎么办?如果有办法将 _cut_ 命令的输出保存到文本文件中,那就太好了。对于这样的任务,shell 有一个简单的内置功能,重定向功能(_>_)。 + +``` +$ cut -d: -f1 /etc/passwd > names.txt +``` + +这会将 cut 的输出放到一个名为 _names.txt_ 的文件中,你可以使用 _cat_ 来查看它的内容: + +``` +$ cat names.txt +root +bin +daemon +adm +... +``` + +使用两个命令和一个 shell 功能,可以很容易地使用 _cat_ 从一个文件进行识别、提取和重定向一些信息,并将其保存到另一个文件以供以后使用。 + +* * * + +_[ _Joel Mbugua_][2]_ 在 _[_Unsplash_][3] 上的照片._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/ + +作者:[Stephen Snow][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/jakfrost/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/commandline-cutting-816x345.jpg +[2]: https://unsplash.com/photos/tA5eSY_hay8?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/search/photos/command-line?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From a31c6cf6737f2bd870785edeba9a8ca4f3f3b874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BA=AF=E5=BD=AC?= Date: Wed, 1 May 2019 22:13:07 +0800 Subject: [PATCH 0229/1154] =?UTF-8?q?=E8=A1=A5=E5=85=85Git=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 90babd017c..be3bc98535 100644 --- a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -183,7 +183,7 @@ via: https://itsfoss.com/restart-network-ubuntu 作者:[Sergiu][a] 选题:[lujun9972][b] -译者:[bodhix](https://github.com/译者ID) +译者:[bodhix](https://github.com/bodhix) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9ab409b83938ff1b1826b704c09f7e781b7e03b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=A6=E9=94=8B?= <289716347@qq.com> Date: Wed, 1 May 2019 22:21:07 +0800 Subject: [PATCH 0230/1154] translated --- ...gure NTP Server And NTP Client In Linux.md | 262 ------------------ ...gure NTP Server And NTP Client In Linux.md | 262 ++++++++++++++++++ 2 files changed, 262 insertions(+), 262 deletions(-) delete mode 100644 sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md create mode 100644 translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md diff --git a/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md deleted file mode 100644 index 5f67996bda..0000000000 --- a/sources/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md +++ /dev/null @@ -1,262 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (arrowfeng) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?) -[#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Install And Configure NTP Server And NTP Client In Linux? -====== - -You might heard this word many times and also you might had worked on this. - -However, i will tell you clearly in this article about NTP Server setup and NTP Client setup - -We will see about **[Chrony NTP Client setup][1]** later. - -### What Is NTP Server? - -NTP stands for Network Time Protocol. - -It is a networking protocol that synchronize the clock between computer systems over the network. - -In other hand I can say. It will keep the same time (It keep an accurate time) to all the systems which are connected to NTP server through NTP or Chrony client. - -NTP can usually maintain time to within tens of milliseconds over the public Internet, and can achieve better than one millisecond accuracy in local area networks under ideal conditions. - -It uses User Datagram Protocol (UDP) on port number 123 for send and receive timestamps. It’s a client/server application. - -It send and receive timestamps using the User Datagram Protocol (UDP) on port number 123. - -### What Is NTP Client? - -NTP client will synchronize its clock to the network time server. - -### What Is Chrony Client? - -Chrony is replacement of NTP client. It can synchronize the system clock faster with better time accuracy and it can be particularly useful for the systems which are not online all the time. - -### Why We Need NTP Server? - -To keep all the servers in your organization in-sync with an accurate time to perform time based jobs. - -To clarify this, I will tell you a scenario. Say for example, we have two servers (Server1 and Server2). The server1 usually complete the batch jobs at 10:55 then the server2 needs to run another job at 11:00 based on the server1 job completion report. - -If both the system is using in a different time (if one system is ahead of the others, the others are behind that particular one) then we can’t perform this. To achieve this, we should setup NTP. Hope it cleared your doubts about NTP. - -In this article, we are going to use the following setup to test this. - - * **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.8, OS:CentOS 7 - * **`NTP Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.5, OS:Ubuntu 18.04 - - - -### NTP SERVER SIDE: How To Install NTP Server In Linux? - -There is no different packages for NTP server and NTP client since it’s a client/server model. The NTP package is available in distribution official repository so, use the distribution package manger to install it. - -For **`Fedora`** system, use **[DNF Command][2]** to install ntp. - -``` -$ sudo dnf install ntp -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ntp. - -``` -$ sudo apt install ntp -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install ntp. - -``` -$ sudo pacman -S ntp -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install ntp. - -``` -$ sudo yum install ntp -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install ntp. - -``` -$ sudo zypper install ntp -``` - -### How To Configure The NTP Server In Linux? - -Once you have installed the NTP package, make sure you have to uncomment the following configuration in the `/etc/ntp.conf` file on server side. - -By default the NTP server configuration relies on `X.distribution_name.pool.ntp.org`. If you want you can use the default configuration or you can change it as per your location (country specific) by visiting site. - -Say for example. If you are in India then your NTP server will be `0.in.pool.ntp.org` and it will work for most of the countries. - -``` -# vi /etc/ntp.conf - -restrict default kod nomodify notrap nopeer noquery -restrict -6 default kod nomodify notrap nopeer noquery -restrict 127.0.0.1 -restrict -6 ::1 -server 0.asia.pool.ntp.org -server 1.asia.pool.ntp.org -server 2.asia.pool.ntp.org -server 3.asia.pool.ntp.org -restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap -driftfile /var/lib/ntp/drift -keys /etc/ntp/keys -``` - -We have allowed only `192.168.1.0/24` subnet clients to access the NTP server. - -Since firewall is enabled by default on RHEL 7 based distributions so, allow the ntp server/service. - -``` -# firewall-cmd --add-service=ntp --permanent -# firewall-cmd --reload -``` - -Bounce the service once you update the configuration. - -For sysvinit systems. For Debian based system we need to run `ntp` instead of ntpd. - -``` -# service ntpd restart - -# chkconfig ntpd on -``` - -For systemctl systems. For Debian based system we need to run `ntp` instead of ntpd. - -``` -# systemctl restart ntpd - -# systemctl enable ntpd -``` - -### NTP CLIENT SIDE: How To Install NTP Client On Linux? - -As I mentioned earlier in this article. There is no specific package for NTP server and client. So, install the same package on client also. - -For **`Fedora`** system, use **[DNF Command][2]** to install ntp. - -``` -$ sudo dnf install ntp -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ntp. - -``` -$ sudo apt install ntp -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install ntp. - -``` -$ sudo pacman -S ntp -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install ntp. - -``` -$ sudo yum install ntp -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install ntp. - -``` -$ sudo zypper install ntp -``` - -I have installed and configured the NTP server on `CentOS7.2daygeek.com` so, append the same into all the client machines. - -``` -# vi /etc/ntp.conf - -restrict default kod nomodify notrap nopeer noquery -restrict -6 default kod nomodify notrap nopeer noquery -restrict 127.0.0.1 -restrict -6 ::1 -server CentOS7.2daygeek.com prefer iburst -driftfile /var/lib/ntp/drift -keys /etc/ntp/keys -``` - -Bounce the service once you update the configuration. - -For sysvinit systems. For Debian based system we need to run `ntp` instead of ntpd. - -``` -# service ntpd restart - -# chkconfig ntpd on -``` - -For systemctl systems. For Debian based system we need to run `ntp` instead of ntpd. - -``` -# systemctl restart ntpd - -# systemctl enable ntpd -``` - -Wait for few minutes post restart of the NTP service to get synchronize time from the NTP server. - -Run the following commands to verify the NTP server synchronization status on Linux. - -``` -# ntpq –p -Or -# ntpq -pn - - remote refid st t when poll reach delay offset jitter -============================================================================== -*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 -``` - -Run the following command to get the current status of ntpd. - -``` -# ntpstat -synchronised to NTP server (192.168.1.8) at stratum 3 - time correct to within 508 ms - polling server every 64 s -``` - -Finally run the `date` command. - -``` -# date -Tue Mar 26 23:17:05 CDT 2019 -``` - -If you are observing a significant offset in the NTP output. Run the following command to sync clock manually from the NTP server. Make sure that your NTP client should be inactive state when you perform the command. - -``` -# ntpdate –uv CentOS7.2daygeek.com -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/ - -作者:[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/configure-ntp-client-using-chrony-in-linux/ -[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ diff --git a/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md new file mode 100644 index 0000000000..1c43f50626 --- /dev/null +++ b/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @@ -0,0 +1,262 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?) +[#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在Linux上安装、配置NTP服务和NTP客户端? +====== + +你也许听说过这个词很多次或者你可能已经在使用它了。 +但是,在这篇文章中我将会清晰的告诉你NTP服务和NTP客户端的安装。 + +之后我们将会了解 **[Chrony NTP 客户端的安装][1]**。 + + +### 什么是NTP服务? + +NTP 表示为网络时间协议。 + +它是通过网络在电脑系统之间进行时钟同步的网络协议。 + +另一方面,我可以说,它可以让那些通过NTP或者Chrony客户端连接到NTP服务的系统保持时间上的一致(它能保持一个精确的时间)。 + + +NTP在公共互联网上通常能够保持时间延迟在几十毫秒以内的精度,并在理想条件下,它能在局域网下达到优于一毫秒的延迟精度。 + +它使用用户数据报协议(UDP)在端口123上发送和接受时间戳。它是C/S架构的应用程序。 + + + +### 什么是NTP客户端? + +NTP客户端将其时钟与网络时间服务器同步。 + +### 什么是Chrony客户端? +Chrony是NTP客户端的替代品。它能以更精确的时间更快的同步系统时钟,并且它对于那些不总是在线的系统很有用。 + +### 为什么我们需要NTP服务? + +为了使你组织中的所有服务器与基于时间的作业保持精确的时间同步。 + +为了说明这点,我将告诉你一个场景。比如说,我们有两个服务器(服务器1和服务器2)。服务器1通常在10:55完成离线作业,然后服务器2在11:00需要基于服务器1完成的作业报告去运行其他作业。 + +如果两个服务器正在使用不同的时间(如果服务器2时间比服务器1提前,服务器1的时间就落后于服务器2),然后我们就不能去执行这个作业。为了达到时间一致,我们应该安装NTP。 +希望上述能清除你对于NTP的疑惑。 + + +在这篇文章中,我们将使用下列设置去测试。 + + * **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.8, OS:CentOS 7 + * **`NTP Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.5, OS:Ubuntu 18.04 + + + +### NTP服务端: 如何在Linux上安装NTP? + +因为它是c/s架构,所以NTP服务端和客户端的安装包没有什么不同。在发行版的官方仓库中都有NTP安装包,因此可以使用发行版的包管理器安装它。 + +对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装ntp. + +``` +$ sudo dnf install ntp +``` + +对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装 ntp. + +``` +$ +``` + +对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装 ntp. + +``` +$ sudo pacman -S ntp +``` + +对 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装 ntp. + +``` +$ sudo yum install ntp +``` + +对于 **`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装 ntp. + +``` +$ sudo zypper install ntp +``` + +### 如何在Linux上配置NTP服务? + +安装NTP软件包后,请确保在服务器端的`/etc/ntp.conf`文件中,必须取消以下配置的注释。 + +默认情况下,NTP服务器配置依赖于`X.distribution_name.pool.ntp.org`。 如果有必要,可以使用默认配置,也可以访问站点,根据你所在的位置(特定国家/地区)进行更改。 + +比如说如果你在印度,然后你的NTP服务器将是`0.in.pool.ntp.org`,并且这个地址适用于大多数国家。 + +``` +# vi /etc/ntp.conf + +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery +restrict 127.0.0.1 +restrict -6 ::1 +server 0.asia.pool.ntp.org +server 1.asia.pool.ntp.org +server 2.asia.pool.ntp.org +server 3.asia.pool.ntp.org +restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap +driftfile /var/lib/ntp/drift +keys /etc/ntp/keys +``` + +我们仅允许`192.168.1.0/24`子网的客户端访问NTP服务器。 + +由于默认情况下基于RHEL7的发行版的防火墙是打开的,因此允许ntp服务通过。 + +``` +# firewall-cmd --add-service=ntp --permanent +# firewall-cmd --reload +``` + +更新配置后重启服务。 + +对于基于Debian的sysvinit系统,我们需要去运行`ntp`而不是`ntpd`。 + +``` +# service ntpd restart + +# chkconfig ntpd on +``` +对于基于Debian的systemctl系统,我们需要去运行`ntp`和`ntpd`。 + +``` +# systemctl restart ntpd + +# systemctl enable ntpd +``` + +### NTP客户端:如何在Linux上安装NTP客户端? + +正如我在这篇文章中前面所说的。NTP服务端和客户端的安装包没有什么不同。因此在客户端上也安装同样的软件包。 + +对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装ntp. + +``` +$ sudo dnf install ntp +``` + +对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装 ntp. + +``` +$ +``` + +对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装 ntp. + +``` +$ sudo pacman -S ntp +``` + +对 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装 ntp. + +``` +$ sudo yum install ntp +``` + +对于 **`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装 ntp. + +``` +$ sudo zypper install ntp +``` + +我已经在`CentOS7.2daygeek.com`这台主机上安装和配置了NTP服务器,因此将其附加到所有的客户端机器上。 + +``` +# vi /etc/ntp.conf + +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery +restrict 127.0.0.1 +restrict -6 ::1 +server CentOS7.2daygeek.com prefer iburst +driftfile /var/lib/ntp/drift +keys /etc/ntp/keys +``` + +更新配置后重启服务。 + +对于基于Debian的sysvinit系统,我们需要去运行`ntp`而不是`ntpd`。 + +``` +# service ntpd restart + +# chkconfig ntpd on +``` +对于基于Debian的systemctl系统,我们需要去运行`ntp`和`ntpd`。 + +``` +# systemctl restart ntpd + +# systemctl enable ntpd +``` + +重新启动NTP服务后等待几分钟以便从NTP服务器获取同步的时间。 + +在Linux上运行下列命令去验证NTP服务的同步状态。 + +``` +# ntpq –p +或 +# ntpq -pn + + remote refid st t when poll reach delay offset jitter +============================================================================== +*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 +``` + +运行下列命令去得到ntpd的当前状态。 + +``` +# ntpstat +synchronised to NTP server (192.168.1.8) at stratum 3 + time correct to within 508 ms + polling server every 64 s +``` + +最后运行`date`命令。 + +``` +# date +Tue Mar 26 23:17:05 CDT 2019 +``` + +如果你观察到NTP中输出的偏移很大。运行下列命令从NTP服务器手动同步时钟。当你执行下列命令的时候,确保你的NTP客户端应该为未激活状态。 + +``` +# ntpdate –uv CentOS7.2daygeek.com +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[校对者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/configure-ntp-client-using-chrony-in-linux/ +[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From 216f20b630a82782c2207d807965ad890ac03255 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 May 2019 23:21:39 +0800 Subject: [PATCH 0231/1154] PRF:20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @bodhix 恭喜你,完成了第一篇贡献! --- ...art a Network in Ubuntu -Beginner-s Tip.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index be3bc98535..6a5dfabeb9 100644 --- a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -1,16 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (bodhix) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Restart a Network in Ubuntu [Beginner’s Tip]) [#]: via: (https://itsfoss.com/restart-network-ubuntu) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) -如何在 Ubuntu 中重启网络【新手提示】 +Linux 初学者:如何在 Ubuntu 中重启网络 ====== -你[是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多很多的问题都可以简单地通过重启服务解决。 +你[是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多的问题都可以简单地通过重启服务解决。 在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: @@ -18,11 +18,11 @@ ### 通过命令行方式重启网络 -如果你使用的 Ubuntu 服务器版,那么你已经在使用命令行终端了。如果你使用的是桌面版,那么你可以通过快捷键 Ctrl+Alt+T [Ubuntu 键盘快捷键][3] 打开命令行终端。 +如果你使用的 Ubuntu 服务器版,那么你已经在使用命令行终端了。如果你使用的是桌面版,那么你可以通过快捷键 `Ctrl+Alt+T` [Ubuntu 键盘快捷键][3] 打开命令行终端。 在 Ubuntu 中,有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 -#### 1\. network manager service +#### 1、network manager 服务 这是通过命令行方式重启网络最简单的方法。它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 @@ -32,17 +32,17 @@ sudo service network-manager restart 此时,网络图标会消失一会儿然后重新显示。 -#### 2\. systemd +#### 2、systemd -**service** 命令仅仅是该命令的一个封装(同样的还有 init.d 系列脚本和 Upstart 相关命令)。 **systemctl** 命令的功能远多于 **service** 命令。通常我更喜欢使用这个命令。 +`service` 命令仅仅是这个方式的一个封装(同样的也是 init.d 系列脚本和 Upstart 相关命令的封装)。`systemctl` 命令的功能远多于 `service` 命令。通常我更喜欢使用这个命令。 ``` sudo systemctl restart NetworkManager.service ``` -这时,网络图标又会消失一会儿。 如果你想了解 **systemctl** 的其他选项, 可以参考 man 帮助文档。 +这时,网络图标又会消失一会儿。 如果你想了解 `systemctl` 的其他选项, 可以参考 man 帮助文档。 -#### 3\. nmcli +#### 3、nmcli 这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为它非常容易使用。 @@ -60,11 +60,11 @@ sudo nmcli networking on 你可以通过 man 帮助文档了解 nmcli 的更多用法。 -#### 4\. ifup & ifdown +#### 4、ifup & ifdown 这两个命令直接操作网口,切换网口是否可以收发包的状态。这是 [Linux 中最应该了解的网络命令][4] 之一。 -使用 ifdown 关闭所有网口,再使用 ifup 重新启用网口。 +使用 `ifdown` 关闭所有网口,再使用 `ifup` 重新启用网口。 通常推荐的做法是将这两个命令一起使用。 @@ -72,9 +72,9 @@ sudo nmcli networking on sudo ifdown -a && sudo ifup -a ``` -**注意:** 这种方法不会让网络图标从系统托盘中消失,另外,你也无法进行网络连接。 +注意:这种方法不会让网络图标从系统托盘中消失,另外,各种网络连接也会断。 -**其他工具: nmtui (点击展开)** +#### 补充工具: nmtui 这是系统管理员们常用的另外一种方法。它是在命令行终端中管理网络的文本菜单工具。 @@ -86,21 +86,21 @@ nmtui ![nmtui Menu][5] -**注意** 在 **nmtui** 中,可以通过 **up** 和 **down 方向键** 选择选项。 +注意:在 nmtui 中,可以通过 `up` 和 `down` 方向键选择选项。 -选择 **Activate a connection** : +选择 “Activate a connection”: ![nmtui Menu Select "Activate a connection"][6] -按下 **Enter** 键,打开 **connections** 菜单。 +按下回车键,打开 “connections” 菜单。 ![nmtui Connections Menu][7] -接下来,选择前面带 **星号 (*)** 的网络。在这个例子中,就是 MGEO72。 +接下来,选择前面带星号(*)的网络。在这个例子中,就是 MGEO72。 ![Select your connection in the nmtui connections menu.][8] -按下 **Enter** 键。 **关闭** 你的网络连接。 +按下回车键。 这就将“停用”你的网络连接。 ![nmtui Connections Menu with no active connection][9] @@ -108,19 +108,19 @@ nmtui ![Select the connection you want in the nmtui connections menu.][10] -按下 **Enter** 键。这样就重启了所选择的网络连接。 +按下回车键。这样就重新激活了所选择的网络连接。 ![nmtui Connections Menu][11] -双击 **Tab** 键,选择 **Back** : +按下 `Tab` 键两次,选择 “Back”: ![Select "Back" in the nmtui connections menu.][12] -按下 **Enter** 键,回到 **nmtui** 的主菜单。 +按下回车键,回到 nmtui 的主菜单。 ![nmtui Main Menu][13] -选择 **Quit** : +选择 “Quit” : ![nmtui Quit Main Menu][14] @@ -132,9 +132,9 @@ nmtui 显然,这是 Ubuntu 桌面版用户重启网络最简单的方法。如果这个方法不生效,你可以尝试使用前文提到的命令行方式重启网络。 -NM 程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 +NM 小程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 -首先,查看顶部状态栏。 你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 +首先,查看顶部状态栏。你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 接下来,点击该图标(也可以点击音量图标或电池图标)。打开菜单。选择 “Turn Off” 关闭网络。 @@ -160,7 +160,7 @@ Ubuntu 没有可以直接 “刷新 WiFi 网络” 的选项,它有点隐蔽 选择对应的网络修改你的 WiFi 连接。 -你无法马上看到可用的无线网络列表。打开网络列表之后,大概需要 5 秒才会显示其他可用的无线网络。 +你无法马上看到可用的无线网络列表。打开网络列表之后,大概需要 5 秒才会显示其它可用的无线网络。 ![Select another wifi network in Ubuntu][19] @@ -168,7 +168,7 @@ Ubuntu 没有可以直接 “刷新 WiFi 网络” 的选项,它有点隐蔽 现在,你就可以选择你想要连接的网络,点击连接。这样就完成了。 -**总结** +### 总结 重启网络连接是每个 Linux 用户在使用过程中必须经历的事情。 @@ -184,7 +184,7 @@ via: https://itsfoss.com/restart-network-ubuntu 作者:[Sergiu][a] 选题:[lujun9972][b] 译者:[bodhix](https://github.com/bodhix) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6bc87d5fbff7479303decbb70c3eb5d38e87c908 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 May 2019 23:23:31 +0800 Subject: [PATCH 0232/1154] PUB:20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @bodhix 本文首发地址: https://linux.cn/article-10804-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/bodhix 请注册领取 LCCN: https://lctt.linux.cn/ --- ...0307 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md (99%) diff --git a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/published/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md similarity index 99% rename from translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md rename to published/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md index 6a5dfabeb9..5da1acbdd0 100644 --- a/translated/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ b/published/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (bodhix) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10804-1.html) [#]: subject: (How to Restart a Network in Ubuntu [Beginner’s Tip]) [#]: via: (https://itsfoss.com/restart-network-ubuntu) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) From 82fb6dca191b37707c0dbb11ee42fbf69acbca47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Thu, 2 May 2019 09:08:30 +0800 Subject: [PATCH 0233/1154] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87,?= =?UTF-8?q?=E4=B8=8E=E5=B7=B2=E7=BF=BB=E8=AF=91=E6=96=87=E7=AB=A0=E9=87=8D?= =?UTF-8?q?=E5=A4=8D,=E5=B7=B2=E7=BF=BB=E8=AF=91=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E4=B8=BA20190423=20How=20To**?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sing iotop And iostat Commands In Linux.md | 341 ------------------ 1 file changed, 341 deletions(-) delete mode 100644 sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md diff --git a/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md deleted file mode 100644 index 379aba5be9..0000000000 --- a/sources/tech/20190422 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ /dev/null @@ -1,341 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) -[#]: via: (https://www.2daygeek.com/monitor-disk-io-activity-using-iotop-iostat-command-in-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux? -====== - -Do you know what are the tools we can use for troubleshooting or monitoring real-time disk activity in Linux? - -If **[Linux system performance][1]** gets slow down we may use **[top command][2]** to see the system performance. - -It is used to check what are the processes are consuming high utilization on server. - -It’s common for most of the Linux administrator. - -It’s widely used by Linux administrator in the real world. - -If you don’t see much difference in the process output still you have an option to check other things. - -I would like to advise you to check `wa` status in the top output because most of the time the server performance will be degraded due to high I/O Read and Write on hard disk. - -If it’s high or fluctuation, it could be a cause. So, we need to check I/O activity on hard drive. - -We can monitory disk I/O statistics for all disks and file system in Linux system using `iotop` and `iostat` commands. - -### What Is iotop? - -iotop is a top-like utility for displaying real-time disk activity. - -iotop watches I/O usage information output by the Linux kernel and displays a table of current I/O usage by processes or threads on the system. - -It displays the I/O bandwidth read and written by each process/thread. It also displays the percentage of time the thread/process spent while swapping in and while waiting on I/O. - -Total DISK READ and Total DISK WRITE values represent total read and write bandwidth between processes and kernel threads on the one side and kernel block device subsystem on the other. - -Actual DISK READ and Actual DISK WRITE values represent corresponding bandwidths for actual disk I/O between kernel block device subsystem and underlying hardware (HDD, SSD, etc.). - -### How To Install iotop In Linux? - -We can easily install it with help of package manager since the package is available in all the Linux distributions repository. - -For **`Fedora`** system, use **[DNF Command][3]** to install iotop. - -``` -$ sudo dnf install iotop -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install iotop. - -``` -$ sudo apt install iotop -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install iotop. - -``` -$ sudo pacman -S iotop -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install iotop. - -``` -$ sudo yum install iotop -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install iotop. - -``` -$ sudo zypper install iotop -``` - -### How To Monitor Disk I/O Activity/Statistics In Linux Using iotop Command? - -There are many options are available in iotop command to check varies statistics about disk I/O. - -Run the iotop command without any arguments to see each process or thread current I/O usage. - -``` -# iotop -``` - -[![][9]![][9]][10] - -If you would like to check which process are actually doing IO then run the iotop command with `-o` or `--only` option. - -``` -# iotop --only -``` - -[![][9]![][9]][11] - -**Details:** - - * **`IO:`** It shows I/O utilization for each process, which includes disk and swap. - * **`SWAPIN:`** It shows only the swap usage of each process. - - - -### What Is iostat? - -iostat is used to report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions. - -The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. - -The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks. - -All statistics are reported each time the iostat command is run. The report consists of a CPU header row followed by a row of CPU statistics. - -On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of statistics for each device that is configured. - -The iostat command generates two types of reports, the CPU Utilization report and the Device Utilization report. - -### How To Install iostat In Linux? - -iostat tool is part of sysstat package so, We can easily install it with help of package manager since the package is available in all the Linux distributions repository. - -For **`Fedora`** system, use **[DNF Command][3]** to install sysstat. - -``` -$ sudo dnf install sysstat -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install sysstat. - -``` -$ sudo apt install sysstat -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][6]** to install sysstat. - -``` -$ sudo pacman -S sysstat -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][7]** to install sysstat. - -``` -$ sudo yum install sysstat -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][8]** to install sysstat. - -``` -$ sudo zypper install sysstat -``` - -### How To Monitor Disk I/O Activity/Statistics In Linux Using sysstat Command? - -There are many options are available in iostat command to check varies statistics about disk I/O and CPU. - -Run the iostat command without any arguments to see complete statistics of the system. - -``` -# iostat - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.45 0.02 16.47 0.12 0.00 53.94 - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -nvme0n1 6.68 126.95 124.97 0.00 58420014 57507206 0 -sda 0.18 6.77 80.24 0.00 3115036 36924764 0 -loop0 0.00 0.00 0.00 0.00 2160 0 0 -loop1 0.00 0.00 0.00 0.00 1093 0 0 -loop2 0.00 0.00 0.00 0.00 1077 0 0 -``` - -Run the iostat command with `-d` option to see I/O statistics for all the devices - -``` -# iostat -d - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -nvme0n1 6.68 126.95 124.97 0.00 58420030 57509090 0 -sda 0.18 6.77 80.24 0.00 3115292 36924764 0 -loop0 0.00 0.00 0.00 0.00 2160 0 0 -loop1 0.00 0.00 0.00 0.00 1093 0 0 -loop2 0.00 0.00 0.00 0.00 1077 0 0 -``` - -Run the iostat command with `-p` option to see I/O statistics for all the devices and their partitions. - -``` -# iostat -p - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.42 0.02 16.45 0.12 0.00 53.99 - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -nvme0n1 6.68 126.94 124.96 0.00 58420062 57512278 0 -nvme0n1p1 6.40 124.46 118.36 0.00 57279753 54474898 0 -nvme0n1p2 0.27 2.47 6.60 0.00 1138069 3037380 0 -sda 0.18 6.77 80.23 0.00 3116060 36924764 0 -sda1 0.00 0.01 0.00 0.00 3224 0 0 -sda2 0.18 6.76 80.23 0.00 3111508 36924764 0 -loop0 0.00 0.00 0.00 0.00 2160 0 0 -loop1 0.00 0.00 0.00 0.00 1093 0 0 -loop2 0.00 0.00 0.00 0.00 1077 0 0 -``` - -Run the iostat command with `-x` option to see detailed I/O statistics for all the devices. - -``` -# iostat -x - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.41 0.02 16.45 0.12 0.00 54.00 - -Device r/s rkB/s rrqm/s %rrqm r_await rareq-sz w/s wkB/s wrqm/s %wrqm w_await wareq-sz d/s dkB/s drqm/s %drqm d_await dareq-sz aqu-sz %util -nvme0n1 2.45 126.93 0.60 19.74 0.40 51.74 4.23 124.96 5.12 54.76 3.16 29.54 0.00 0.00 0.00 0.00 0.00 0.00 0.31 30.28 -sda 0.06 6.77 0.00 0.00 8.34 119.20 0.12 80.23 19.94 99.40 31.84 670.73 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.13 -loop0 0.00 0.00 0.00 0.00 0.08 19.64 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 -``` - -Run the iostat command with `-d [Device_Name]` option to see I/O statistics of particular device and their partitions. - -``` -# iostat -p [Device_Name] - -# iostat -p sda - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.38 0.02 16.43 0.12 0.00 54.05 - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -sda 0.18 6.77 80.21 0.00 3117468 36924764 0 -sda2 0.18 6.76 80.21 0.00 3112916 36924764 0 -sda1 0.00 0.01 0.00 0.00 3224 0 0 -``` - -Run the iostat command with `-m` option to see I/O statistics with `MB` for all the devices instead of `KB`. By default it shows the output with KB. - -``` -# iostat -m - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.36 0.02 16.41 0.12 0.00 54.09 - -Device tps MB_read/s MB_wrtn/s MB_dscd/s MB_read MB_wrtn MB_dscd -nvme0n1 6.68 0.12 0.12 0.00 57050 56176 0 -sda 0.18 0.01 0.08 0.00 3045 36059 0 -loop0 0.00 0.00 0.00 0.00 2 0 0 -loop1 0.00 0.00 0.00 0.00 1 0 0 -loop2 0.00 0.00 0.00 0.00 1 0 0 -``` - -Run the iostat command with certain interval then use the following format. In this example, we are going to capture totally two reports at five seconds interval. - -``` -# iostat [Interval] [Number Of Reports] - -# iostat 5 2 - -Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 29.35 0.02 16.41 0.12 0.00 54.10 - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -nvme0n1 6.68 126.89 124.95 0.00 58420116 57525344 0 -sda 0.18 6.77 80.20 0.00 3118492 36924764 0 -loop0 0.00 0.00 0.00 0.00 2160 0 0 -loop1 0.00 0.00 0.00 0.00 1093 0 0 -loop2 0.00 0.00 0.00 0.00 1077 0 0 - -avg-cpu: %user %nice %system %iowait %steal %idle - 3.71 0.00 2.51 0.05 0.00 93.73 - -Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd -nvme0n1 19.00 0.20 311.40 0.00 1 1557 0 -sda 0.20 25.60 0.00 0.00 128 0 0 -loop0 0.00 0.00 0.00 0.00 0 0 0 -loop1 0.00 0.00 0.00 0.00 0 0 0 -loop2 0.00 0.00 0.00 0.00 0 0 0 -``` - -Run the iostat command with `-N` option to see the LVM disk I/O statistics report. - -``` -# iostat -N - -Linux 4.15.0-47-generic (Ubuntu18.2daygeek.com) Thursday 18 April 2019 _x86_64_ (2 CPU) - -avg-cpu: %user %nice %system %iowait %steal %idle - 0.38 0.07 0.18 0.26 0.00 99.12 - -Device tps kB_read/s kB_wrtn/s kB_read kB_wrtn -sda 3.60 57.07 69.06 968729 1172340 -sdb 0.02 0.33 0.00 5680 0 -sdc 0.01 0.12 0.00 2108 0 -2g-2gvol1 0.00 0.07 0.00 1204 0 -``` - -Run the nfsiostat command to see the I/O statistics for Network File System(NFS). - -``` -# nfsiostat -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/monitor-disk-io-activity-using-iotop-iostat-command-in-linux/ - -作者:[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/monitoring-tools/ -[2]: https://www.2daygeek.com/linux-top-command-linux-system-performance-monitoring-tool/ -[3]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[5]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[7]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[8]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ -[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[10]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-1.jpg -[11]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-2.jpg From e985234f022c5a50e269fceb73c6cf57c86ef144 Mon Sep 17 00:00:00 2001 From: bodhix Date: Thu, 2 May 2019 11:41:25 +0800 Subject: [PATCH 0234/1154] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index e9e764b440..677fce8e35 100644 --- a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (bodhix) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7ac5ff5eb65e67fe35d82f9aee053dbb8495b86e Mon Sep 17 00:00:00 2001 From: bodhix Date: Thu, 2 May 2019 14:29:06 +0800 Subject: [PATCH 0235/1154] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20(#13474)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index e9e764b440..677fce8e35 100644 --- a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (bodhix) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 03b6aadac540b86b7a5aa58722f80a3cb07cb30e Mon Sep 17 00:00:00 2001 From: bodhix Date: Thu, 2 May 2019 19:38:22 +0800 Subject: [PATCH 0236/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=86=85=E5=AE=B91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...A Network Interface Port (NIC) In Linux.md | 87 +++++++++---------- 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index 677fce8e35..4a3d87a488 100644 --- a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -7,16 +7,14 @@ [#]: via: (https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux? +Linux 中如何启用禁用网口? ====== You may need to run these commands based on your requirements. I can tell you few examples, where you would be needed this. -When you add a new network interface or when you create a new virtual network interface from the original physical interface. - -you may need to bounce these commands to bring up the new interface. +当你添加一个网卡或者从一个物理网口创建出一个虚拟网口的时候,你可能需要使用这些命令将新网口启用起来。 Also, if you made any changes or if it’s down then you need to run one of the below commands to bring them up. @@ -24,15 +22,15 @@ It can be done on many ways and we would like to add best five method which we u It can be done using the below five methods. - * **`ifconfig Command:`** The ifconfig command is used configure a network interface. It provides so many information about NIC. - * **`ifdown/up Command:`** The ifdown command take a network interface down and the ifup command bring a network interface up. - * **`ip Command:`** ip command is used to manage NIC. It’s replacement of old and deprecated ifconfig command. It’s similar to ifconfig command but has many powerful features which isn’t available in ifconfig command. - * **`nmcli Command:`** nmcli is a command-line tool for controlling NetworkManager and reporting network status. - * **`nmtui Command:`** nmtui is a curses‐based TUI application for interacting with NetworkManager. + * **`ifconfig 命令:`** ifconfig 命令用于配置网口。 它可以提供网口的很多信息。 + * **`ifdown/up 命令:`** ifdown 命令用于禁用网口,ifup 命令用于启用网口。 + * **`ip 命令:`** ip 命令用于管理网口,用于替代老的、不推荐使用的 ifconfig 命令。它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 + * **`nmcli 命令:`** nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 + * **`nmtui 命令:`** nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 -The below output shows the available network interface card (NIC) information in my Linux system. +以下显示的是我的 Linux 系统中可用网口的信息。 ``` # ip a @@ -56,25 +54,24 @@ The below output shows the available network interface card (NIC) information in valid_lft forever preferred_lft forever ``` -### 1) How To Bring UP And Bring Down A Network Interface In Linux Using ifconfig Command? +### 1) 如何使用 ifconfig 命令启用禁用网口? -The ifconfig command is used configure a network interface. +ifconfig 命令用于配置网口。 -It is used at boot time to set up interfaces as necessary. It provides so many information about NIC. We can use ifconfig command when we need to make any changes on NIC. +系统启动过程中如果需要启用网口,调用的命令就是 ifconfig。它可以提供很多网口的信息。不管我们想修改网口的什么配置,都可以使用该命令。 -Common Syntax for ifconfig: +ifconfig 的常用语法: ``` # ifconfig [NIC_NAME] Down/Up ``` -Run the following command to bring down the `enp0s3` interface in Linux. Make a note, you have to input your interface name instead of us. - +执行以下命令禁用 `enp0s3` 网口。注意,这里你需要输入你自己的网口名字。 ``` # ifconfig enp0s3 down ``` -Yes, the given interface is down now as per the following output. +现在,从以下输出结果可以看到网口已经被禁用了。 ``` # ip a | grep -A 1 "enp0s3:" @@ -82,13 +79,13 @@ Yes, the given interface is down now as per the following output. link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff ``` -Run the following command to bring down the `enp0s3` interface in Linux. +执行以下命令启用 `enp0s3` 网口。 ``` # ifconfig enp0s3 up ``` -Yes, the given interface is up now as per the following output. +现在,从以下输出结果可以看到网口已经启用了。 ``` # ip a | grep -A 5 "enp0s3:" @@ -100,13 +97,13 @@ Yes, the given interface is up now as per the following output. valid_lft forever preferred_lft forever ``` -### 2) How To Enable And Disable A Network Interface In Linux Using ifdown/up Command? +### 2) 如何使用 ifdown/up 命令启用禁用网口? -The ifdown command take a network interface down and the ifup command bring a network interface up. +ifdown 命令用于禁用网口,ifup 命令用于启用网口。 -**Note:**It doesn’t work on new interface device name like `enpXXX` +**注意:** 这两个命令不支持以 `enpXXX` 命名的新的网络设备。 -Common Syntax for ifdown/ifup: +ifdown/ifup 的常用语法: ``` # ifdown [NIC_NAME] @@ -114,13 +111,13 @@ Common Syntax for ifdown/ifup: # ifup [NIC_NAME] ``` -Run the following command to bring down the `eth1` interface in Linux. +执行以下命令禁用 `eth1` 网口。 ``` # ifdown eth0 ``` -Run the following command to bring down the `eth1` interface in Linux. +从以下输出结果可以看到网口已经被禁用了。 ``` # ip a | grep -A 3 "eth1:" @@ -128,13 +125,13 @@ Run the following command to bring down the `eth1` interface in Linux. link/ether 08:00:27:d5:a0:18 brd ff:ff:ff:ff:ff:ff ``` -Run the following command to bring down the `eth1` interface in Linux. +执行以下命令启用 `eth1` 网口。 ``` # ifup eth0 ``` -Yes, the given interface is up now as per the following output. +从以下输出结果可以看到网口已经启用了。 ``` # ip a | grep -A 5 "eth1:" @@ -145,32 +142,32 @@ Yes, the given interface is up now as per the following output. valid_lft forever preferred_lft forever ``` -ifup and ifdown doesn’t supporting the latest interface device `enpXXX` names. I got the below message when i ran the command. +ifup 和 ifdown 不支持以 `enpXXX` 命名的新的网口。当我执行该命令的时候得到的结果如下: ``` # ifdown enp0s8 Unknown interface enp0s8 ``` -### 3) How To Bring UP/Bring Down A Network Interface In Linux Using ip Command? +### 3) 如何使用 ip 命令启用禁用网口? -ip command is used to manage Network Interface Card (NIC). It’s replacement of old and deprecated ifconfig command on modern Linux systems. +ip 命令用于管理网口,用于替代老的、不推荐使用的 ifconfig 命令。 -It’s similar to ifconfig command but has many powerful features which isn’t available in ifconfig command. +它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 -Common Syntax for ip: +ip 的常用语法: ``` # ip link set Down/Up ``` -Run the following command to bring down the `enp0s3` interface in Linux. +执行以下命令禁用 `enp0s3` 网口。 ``` # ip link set enp0s3 down ``` -Yes, the given interface is down now as per the following output. +从以下输出结果可以看到网口已经被禁用了。 ``` # ip a | grep -A 1 "enp0s3:" @@ -178,13 +175,13 @@ Yes, the given interface is down now as per the following output. link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff ``` -Run the following command to bring down the `enp0s3` interface in Linux. +执行以下命令启用 `enp0s3` 网口。 ``` # ip link set enp0s3 up ``` -Yes, the given interface is up now as per the following output. +从以下输出结果可以看到网口已经启用了。 ``` # ip a | grep -A 5 "enp0s3:" @@ -196,13 +193,11 @@ Yes, the given interface is up now as per the following output. valid_lft forever preferred_lft forever ``` -### 4) How To Enable And Disable A Network Interface In Linux Using nmcli Command? +### 4) 如何使用 nmcli 命令启用禁用网口? -nmcli is a command-line tool for controlling NetworkManager and reporting network status. +nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 -It can be utilized as a replacement for nm-applet or other graphical clients. nmcli is used to create, display, edit, delete, activate, and deactivate network - -connections, as well as control and display network device status. +它可以用做 nm-applet 或者其他图形化客户端的替代品。 nmcli 可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,还可以用来管理和展示网络设备状态。 Run the following command to identify the interface name because nmcli command is perform most of the task using `profile name` instead of `device name`. @@ -213,7 +208,7 @@ Wired connection 1 3d5afa0a-419a-3d1a-93e6-889ce9c6a18c ethernet enp0s3 Wired connection 2 a22154b7-4cc4-3756-9d8d-da5a4318e146 ethernet enp0s8 ``` -Common Syntax for ip: +nmcli 的常用语法: ``` # nmcli con Down/Up @@ -253,9 +248,9 @@ enp0s3 ethernet connected Wired connection 1 lo loopback unmanaged -- ``` -### 5) How To Bring UP/Bring Down A Network Interface In Linux Using nmtui Command? +### 5) 如何使用 nmtui 命令启用禁用网口? -nmtui is a curses based TUI application for interacting with NetworkManager. +nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 When starting nmtui, the user is prompted to choose the activity to perform unless it was specified as the first argument. @@ -267,7 +262,7 @@ Run the following command launch the nmtui interface. Select “Active a connect [![][1]![][1]][2] -Select the interface which you want to bring down then hit “Deactivate” button. +选择你要禁用的网口,然后点击 “Deactivate” 按钮。 [![][1]![][1]][3] For activation do the same above procedure. @@ -279,7 +274,7 @@ via: https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[bodhix](https://github.com/bodhix) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bfcd4f3f2be86acab62562b533b20d739f132f18 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Thu, 2 May 2019 21:06:23 +0800 Subject: [PATCH 0237/1154] Translating by MjSeven --- ...alable social media sentiment analysis services in Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md index 35321f1c9d..436b65d0ba 100644 --- a/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md +++ b/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 931b0f9b48adcc0071c6e05fed720764e6f800f1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 13:17:25 +0800 Subject: [PATCH 0238/1154] PRF:20190422 Tracking the weather with Python and Prometheus.md @geekpi --- ... the weather with Python and Prometheus.md | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md index 0acfb240ef..ee76e5ef89 100644 --- a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md +++ b/translated/tech/20190422 Tracking the weather with Python and Prometheus.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Tracking the weather with Python and Prometheus) @@ -9,14 +9,15 @@ 使用 Python 和 Prometheus 跟踪天气 ====== -创建自定义 Prometheus 集成以跟踪最大的云提供者:地球母亲。 + +> 创建自定义 Prometheus 集成以跟踪最大的云端提供商:地球母亲。 + ![Tree clouds][1] -开源监控系统 [Prometheus][2] 有跟踪多种类型的时间序列数据的集成,但如果不存在你想要的集成,那么很容易构建一个。一个经常使用的例子使用云提供商的自定义集成,它使用提供商的 API 抓取特定的指标。但是,在这个例子中,我们将与最大云提供商集成:地球。 +开源监控系统 [Prometheus][2] 集成了跟踪多种类型的时间序列数据,但如果没有集成你想要的数据,那么很容易构建一个。一个经常使用的例子使用云端提供商的自定义集成,它使用提供商的 API 抓取特定的指标。但是,在这个例子中,我们将与最大云端提供商集成:地球。 幸运的是,美国政府已经测量了天气并为集成提供了一个简单的 API。获取红帽总部下一个小时的天气预报很简单。 - ``` import requests HOURLY_RED_HAT = "" @@ -25,7 +26,7 @@ def get_temperature(): return result.json()["properties"]["periods"][0]["temperature"] ``` -现在我们已经完成了与地球的整合,现在是确保 Prometheus 能够理解我们想要内容的时候了。我们可以使用 [Prometheus Python 库][3]中的 _gauge_ 创建一个注册:红帽总部的温度。 +现在我们已经完成了与地球的集成,现在是确保 Prometheus 能够理解我们想要内容的时候了。我们可以使用 [Prometheus Python 库][3]中的 gauge 创建一个注册项:红帽总部的温度。 ``` @@ -37,13 +38,12 @@ def prometheus_temperature(num): return registry ``` -最后,我们需要以某种方式将它连接到 Prometheus。这有点依赖 Prometheus 的网络拓扑:Prometheus 与我们的服务通信更容易,还是反向更容易。 +最后,我们需要以某种方式将它连接到 Prometheus。这有点依赖 Prometheus 的网络拓扑:是 Prometheus 与我们的服务通信更容易,还是反向更容易。 -第一种是通常建议的情况,如果可能的话,我们需要构建一个公开注册入口的 Web 服务器,并配置 Prometheus _收刮_(scrape)它。 +第一种是通常建议的情况,如果可能的话,我们需要构建一个公开注册入口的 Web 服务器,并配置 Prometheus 收刮(scrape)它。 我们可以使用 [Pyramid][4] 构建一个简单的 Web 服务器。 - ``` from pyramid.config import Configurator from pyramid.response import Response @@ -58,11 +58,10 @@ config.add_view(metrics_web, route_name='metrics') app = config.make_wsgi_app() ``` -这可以使用任何 Web 网关接口 (WSGI) 服务器运行。例如,假设我们将代码放在 **earth.py** 中,我们可以使用 **python -m twisted web --wsgi earth.app** 来运行它。 +这可以使用任何 Web 网关接口(WSGI)服务器运行。例如,假设我们将代码放在 `earth.py` 中,我们可以使用 `python -m twisted web --wsgi earth.app` 来运行它。 或者,如果我们的代码连接到 Prometheus 更容易,我们可以定期将其推送到 Prometheus 的[推送网关][5]。 - ``` import time from prometheus_client import push_to_gateway @@ -73,7 +72,7 @@ def push_temperature(url): time.sleep(60*60) ``` -URL 是推送网关的 URL。它通常以 **:9091** 结尾。 +这里的 URL 是推送网关的 URL。它通常以 `:9091` 结尾。 祝你构建自定义 Prometheus 集成成功,以便跟踪一切! @@ -81,10 +80,10 @@ URL 是推送网关的 URL。它通常以 **:9091** 结尾。 via: https://opensource.com/article/19/4/weather-python-prometheus -作者:[Moshe Zadka ][a] +作者:[Moshe Zadka][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 45749c691612a201b133501d4398380ae3242d80 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 13:18:17 +0800 Subject: [PATCH 0239/1154] PUB:20190422 Tracking the weather with Python and Prometheus.md @geekpi https://linux.cn/article-10807-1.html --- ...0190422 Tracking the weather with Python and Prometheus.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190422 Tracking the weather with Python and Prometheus.md (98%) diff --git a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md b/published/20190422 Tracking the weather with Python and Prometheus.md similarity index 98% rename from translated/tech/20190422 Tracking the weather with Python and Prometheus.md rename to published/20190422 Tracking the weather with Python and Prometheus.md index ee76e5ef89..82ed567a80 100644 --- a/translated/tech/20190422 Tracking the weather with Python and Prometheus.md +++ b/published/20190422 Tracking the weather with Python and Prometheus.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10807-1.html) [#]: subject: (Tracking the weather with Python and Prometheus) [#]: via: (https://opensource.com/article/19/4/weather-python-prometheus) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From b16e1d9efa418e6fe5d4de6888c059828abdc17f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 14:08:19 +0800 Subject: [PATCH 0240/1154] PRF:20190419 This is how System76 does open hardware.md @warmfrog --- ...This is how System76 does open hardware.md | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/translated/tech/20190419 This is how System76 does open hardware.md b/translated/tech/20190419 This is how System76 does open hardware.md index fabbf20083..6d555354b0 100644 --- a/translated/tech/20190419 This is how System76 does open hardware.md +++ b/translated/tech/20190419 This is how System76 does open hardware.md @@ -1,63 +1,65 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (This is how System76 does open hardware) [#]: via: (https://opensource.com/article/19/4/system76-hardware) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) -这就是 System76 如何打造开源硬件的 +System76 是如何打造开源硬件的 ================================ -是什么让新的 Thelio 台式机系列与众不同。 + +> 是什么让新的 Thelio 台式机系列与众不同。 + ![在计算机上显示度量和数据][1] -大多数人对他们电脑的硬件一无所知。作为一个长期的 Linux 用户,我分享了对此的失望,就是当我想让我的无线网卡,视频卡,显示器,和其他硬件与我选择的发行版共同运行时。自主品牌的硬件通常使判断这些问题变得很困难,就是:为什么以太网驱动,无线驱动,或者鼠标驱动和我们预期的不太一样?。当 Linux 分发版已经成熟,这可能不再是问题,但是我们仍能发现触控板和其他外部设备的怪异行为,尤其是当我们对下面的硬件知道的不多时。 +大多数人对他们电脑的硬件一无所知。作为一个长期的 Linux 用户,当我想让我的无线网卡、视频卡、显示器和其他硬件与我选择的发行版共同运行时,也一样遇到了挫折。商业品牌的硬件通常使判断这些问题变得很困难:为什么以太网驱动、无线驱动或者鼠标驱动和我们预期的不太一样?随着 Linux 发行版变得成熟,这可能不再是问题,但是我们仍能发现触控板和其它外部设备的怪异行为,尤其是当我们对底层的硬件知道的不多时。 -像 [System76][2] 的公司目标是解决这些问题,来提升 Linux 用户体验。System76 生产了一些列的 Linux 笔记本,台式机,和服务器,甚至提供了它自己的 Linux 发行版 [Pop! OS][3] 作为客户的一个选择。最近我有幸参观了 System76 在 Devnver 的工厂并揭开 [Thelio][5] [神秘的面纱][5],它的新的台式机产品线。 +像 [System76][2] 这样的公司致力于解决这些问题,以提升 Linux 用户体验。System76 生产了一系列的 Linux 笔记本、台式机和服务器,甚至提供了它自己的 Linux 发行版 [Pop! OS][3] 作为客户的一个选择。最近我有幸参观了 System76 在 Devnver 的工厂并揭开它的新台式机产品线 [Thelio][5] [的神秘面纱][5]。 ### 关于 Thelio -System76 宣称 Thelio 的开源硬件子板,被命名为木星之后的第 5 个卫星的名字 Thelio Io,这是它在市场上独特的特点之一。Thelio Io 被证实为 [OSHWA #us000145][6],并且有 4 个用于存储的 SATA 端口和一个控制风扇和用于电源按钮控制的嵌入式控制器。Thelio IO SAS 被证实 是 [OSHWA #us000146][7],并且有 4 个用于存储的 U.2 端口,没有嵌入式控制器。在展示时,System76 显示了这些组件如何调整风扇通过底盘来优化部件的性能。 +System76 宣称 Thelio 的开源硬件子板(被命名为木星之后的第 5 个卫星的名字 Thelio Io)是它在市场上独特的特点之一。Thelio Io 取得了开源硬件协会的认证 [OSHWA #us000145][6],并且有 4 个用于存储的 SATA 端口和一个控制风扇和用于电源按钮控制的嵌入式控制器。Thelio IO SAS 取得了 [OSHWA #us000146][7] 认证,并且有 4 个用于存储的 U.2 端口,没有嵌入式控制器。在展示时,System76 显示了这些组件如何调整风扇通过底盘来优化部件的性能。 该控制器还管理电源键,和围绕该电源键的 LED 光环,当被按下时它以 100% 的亮度发光。这提供了触觉和视觉上的确认:该主机已经启动电源了。当电脑在使用中,该按钮被设置为 35% 的亮度,当在睡眠模式,它的亮度在 2.35% 和 25% 之间跳动。当计算机关闭后,LED 保持朦胧的亮度,因此能够在黑暗的房间里找到电源控制。 Thelio 的嵌入式控制器是一个低功耗的 [ATmega32U4][8] 微控制器,并且控制器的设置可以使用 Arduino Micro 进行原型设计。Thelio Io 主板变化的多少取决于你购买哪种 Thelio 型号。 -Thelio 可能是我见过的设计的最好的电脑样例和系统。如果你曾经亲身体验过在一个常规的 PC 的内部进行操作的话,你可能会同意我的观点。我已经做了很多次了,因此我能以自己过往的糟糕经历来证明这点。 +Thelio 可能是我见过的设计的最好的电脑机箱和系统。如果你曾经亲身体验过在一个常规的 PC 的内部进行操作的话,你可能会同意我的观点。我已经做了很多次了,因此我能以自己过往的糟糕经历来证明这点。 ### 为什么做开源硬件? -该主板是在 [KiCAD][9] 设计的,你可以在 [GitHub][10] 上的 GPL 证书下访问 Thelio 所有的设计文件。因此,为什么一个与其他 PC 制造商竞争的公司会设计一个独特的接口并公开授权呢?可能是该公司认识到开源设计的价值和分享的能力,并且根据你的需要调整一个 I/O 主板,即便你是市场上的竞争者。 +该主板是在 [KiCAD][9] 设计的,你可以在 [GitHub][10] 上按 GPL 许可证访问 Thelio 所有的设计文件。因此,为什么一个与其他 PC 制造商竞争的公司会设计一个独特的接口并公开授权呢?可能是该公司认识到开源设计及根据你的需要调整和分享一个 I/O 主板设计的能力的价值,即便你是市场上的竞争者。 ![在 Thelio 启动时 Don Watkins 与 System76 的 CEO Carl Richell 谈话][11] -在 [Thelio 启动时][12] Don Watkins 与 System76 的 CEO Carl Richell 谈话。 +*在 [Thelio 发布会][12] Don Watkins 与 System76 的 CEO Carl Richell 谈话。* -我问 [Carl Richell][13],System76 的设计者和 CEO,该公司是否考虑到开放它的硬件设计意味着有人采取它的独特设计并用它来将 System76 驱逐出市场。他说: +我问 System76 的设计者和 CEO [Carl Richell][13],该公司是否担心过公开许可它的硬件设计意味着有人可以采取它的独特设计并用它来将 System76 驱逐出市场。他说: -> 开源硬件对我们所有人都有益。这是我们未来提升技术的方式并且使得每个人获取技术更容易。我们欢迎任何想要提高 Thelio 设计的人来这么做。开源硬件不仅更快的帮助我们的电脑提升技术,并且能够使我们的消费者 100% 信任他们的设备。我们的目标是尽可能地移除专利授权,并且仍然能够为消费者提供一个有竞争力的 Linux 主机。 +> 开源硬件对我们所有人都有益。这是我们未来提升技术的方式,并且使得每个人获取技术更容易。我们欢迎任何想要提高 Thelio 设计的人来这么做。开源该硬件不仅可以帮助我们更快的改进我们的电脑,并且能够使我们的消费者 100% 信任他们的设备。我们的目标是尽可能地移除专利功能,同时仍然能够为消费者提供一个有竞争力的 Linux 主机。 > -> 我们已经与 Linux 社区一起工作超过 13 年来为我们的笔记本,台式机,服务器创造一个完美的顺滑的体验。我们长期专注于为 Linux 社区提供服务,提供给我们的客户高水准的服务,我们的个性使 System76 变得独特。 +> 我们已经与 Linux 社区一起合作了 13 年之久,来为我们的笔记本、台式机、服务器创造一个完美顺滑的体验。我们长期专注于为 Linux 社区提供服务,提供给我们的客户高水准的服务,我们的个性使 System76 变得独特。 -我问 Carl 为什么通常来说开源硬件对 System76 和 PC 市场是有意义的。他回复道: +我还问 Carl 为什么开源硬件对 System76 和 PC 市场是有意义的。他回复道: -> System76 创立之初的想法是技术应该对每个人是开放和可获取的。我们还没有到达 100% 开源创造一个电脑的程度,但是有了开源硬件,我们是接近目标的必不可少的一大步。 +> System76 创立之初的想法是技术应该对每个人是开放和可获取的。我们还没有到达 100% 开源创造一个电脑的程度,但是有了开源硬件,我们迈出了接近目标的必不可少的一大步。 > -> 我们生活在技术变成工具的时代。计算机在每一层教育和在很多工业当中是人们的工具。由于每个人特定的需要,每个人对于如何提升电脑和软件作为他们的主要工具有他们自己的想法。开源我们的计算机允许这些想法完成,反过来促进技术成为一个更强大的工具。在一个开源环境中,我们持续迭代来获取一个更好的 PC。这有点酷。 +> 我们生活在技术变成工具的时代。计算机在各级教育和很多行业当中是人们的工具。由于每个人特定的需要,每个人对于如何提升电脑和软件作为他们的主要工具有他们自己的想法。开源我们的计算机可以让这些想法成为现实,从而反过来促进技术成为一个更强大的工具。在一个开源环境中,我们持续迭代来生产更好的 PC。这有点酷。 -我们总结了我们讨论的关于 System76 技术路线的对话,包含了开源硬件 mini PC,最终还包含了笔记本。在 System76 品牌下的已售出的 mini PC 和笔记本是由其他供应商制造的,并不是基于开源硬件的(尽管他们的 Linux 软件,当然是开源的)。 +我们总结了我们讨论的关于 System76 技术路线的对话,包含了开源硬件 mini PC,甚至是笔记本。在 System76 品牌下的已售出的 mini PC 和笔记本是由其他供应商制造的,并不是基于开源硬件的(尽管它们用的是 Linux 软件,是开源的)。 -设计和支持开放式硬件是PC业务中改变游戏规则的因素,也正是它造就了 System76 的新 Thelio 台式机电脑产品线的不同。 +设计和支持开放式硬件是 PC 产业中的变革者,也正是它造就了 System76 的新 Thelio 台式机电脑产品线的不同。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/4/system76-hardware -作者:[Don Watkins ][a] +作者:[Don Watkins][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c3f7b3e0bd3144b94f980c0e773b82cfdb366139 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 14:09:02 +0800 Subject: [PATCH 0241/1154] PUB:20190419 This is how System76 does open hardware.md @warmfrog https://linux.cn/article-10808-1.html --- .../20190419 This is how System76 does open hardware.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190419 This is how System76 does open hardware.md (98%) diff --git a/translated/tech/20190419 This is how System76 does open hardware.md b/published/20190419 This is how System76 does open hardware.md similarity index 98% rename from translated/tech/20190419 This is how System76 does open hardware.md rename to published/20190419 This is how System76 does open hardware.md index 6d555354b0..27887b1486 100644 --- a/translated/tech/20190419 This is how System76 does open hardware.md +++ b/published/20190419 This is how System76 does open hardware.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10808-1.html) [#]: subject: (This is how System76 does open hardware) [#]: via: (https://opensource.com/article/19/4/system76-hardware) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) From 8ca9901c49d1b540d2ee3656059da82034b99588 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 16:23:50 +0800 Subject: [PATCH 0242/1154] PRF:20190405 Command line quick tips- Cutting content out of files.md @MjSeven --- ...uick tips- Cutting content out of files.md | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190405 Command line quick tips- Cutting content out of files.md b/translated/tech/20190405 Command line quick tips- Cutting content out of files.md index 63c8e2b223..15dcadbd74 100644 --- a/translated/tech/20190405 Command line quick tips- Cutting content out of files.md +++ b/translated/tech/20190405 Command line quick tips- Cutting content out of files.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Command line quick tips: Cutting content out of files) @@ -12,7 +12,7 @@ ![][1] -Fedora 发行版是一个功能齐全的操作系统,有出色的图形化桌面环境。用户可以很容易地通过单击动作来完成任何典型任务。所有这些美妙的易用性掩盖了其底层强大的命令行细节。本文是向你展示一些常见命令行实用程序的系列文章的一部分。让我们进入 shell 来看看 **cut**。 +Fedora 发行版是一个功能齐全的操作系统,有出色的图形化桌面环境。用户可以很容易地通过单击动作来完成任何典型任务。所有这些美妙的易用性掩盖了其底层强大的命令行细节。本文是向你展示一些常见命令行实用程序的系列文章的一部分。让我们进入 shell 来看看 `cut`。 通常,当你在命令行中工作时,你处理的是文本文件。有时这些文件可能很长,虽然可以完整地阅读它们,但是可能会耗费大量时间,并且容易出错。在本文中,你将学习如何从文本文件中提取内容,并从中获取你所需的信息。 @@ -20,7 +20,8 @@ Fedora 发行版是一个功能齐全的操作系统,有出色的图形化桌 ### cut 使用 -为了演示这个例子,在系统上使用一个标准的大文件,如 _/etc/passwd_。正如本系列的前一篇文章所示,你可以执行 _cat_ 命令来查看整个文件: +为了演示这个例子,在系统上使用一个标准的大文件,如 `/etc/passwd`。正如本系列的前一篇文章所示,你可以执行 `cat` 命令来查看整个文件: + ``` $ cat /etc/passwd root:x:0:0:root:/root:/bin/bash @@ -35,9 +36,10 @@ adm:x:3:4:adm:/var/adm:/sbin/nologin ``` name:password:user-id:group-id:comment:home-directory:shell ``` -假设你只想要系统上所有账户名的列表,如果你只能从每一行中删除 _name_ 值。这就是 _cut_ 命令派上用场的地方!它一次处理一行输入,并提取该行的特定部分。 -_cut_ 命令提供了以不同方式选择一行的部分的选项,在本示例中需要两个,_d_ 是指定要使用的分隔符类型,_f_ 是指定要删除行的哪个字段。_-d_ 选项允许你声明用于分隔行中值的 _delimiter_。在本例中,冒号(:)用于分隔值。_-f_ 选项允许你选择要提取哪个字段或哪些字段值。因此,在本例中,输入的命令是: +假设你只想要系统上所有账户名的列表,如果你只能从每一行中删除 “name” 值。这就是 `cut` 命令派上用场的地方!它一次处理一行输入,并提取该行的特定部分。 + +`cut` 命令提供了以不同方式选择一行的部分的选项,在本示例中需要两个,`-d` 和 `-f`。`-d` 选项允许你声明用于分隔行中值的分隔符。在本例中,冒号(`:`)用于分隔值。`-f` 选项允许你选择要提取哪些字段值。因此,在本例中,输入的命令是: ``` $ cut -d: -f1 /etc/passwd @@ -48,13 +50,13 @@ adm ... ``` -太棒了,成功了!但是你将输出打印到标准输出,在终端会话中意味着它需要占据屏幕。如果你需要稍后完成另一项任务所需的信息,这该怎么办?如果有办法将 _cut_ 命令的输出保存到文本文件中,那就太好了。对于这样的任务,shell 有一个简单的内置功能,重定向功能(_>_)。 +太棒了,成功了!但是你将输出打印到标准输出,在终端会话中意味着它需要占据屏幕。如果你需要稍后完成另一项任务所需的信息,这该怎么办?如果有办法将 `cut` 命令的输出保存到文本文件中,那就太好了。对于这样的任务,shell 有一个简单的内置功能,重定向功能(`>`)。 ``` $ cut -d: -f1 /etc/passwd > names.txt ``` -这会将 cut 的输出放到一个名为 _names.txt_ 的文件中,你可以使用 _cat_ 来查看它的内容: +这会将 `cut` 的输出放到一个名为 `names.txt` 的文件中,你可以使用 `cat` 来查看它的内容: ``` $ cat names.txt @@ -65,11 +67,7 @@ adm ... ``` -使用两个命令和一个 shell 功能,可以很容易地使用 _cat_ 从一个文件进行识别、提取和重定向一些信息,并将其保存到另一个文件以供以后使用。 - -* * * - -_[ _Joel Mbugua_][2]_ 在 _[_Unsplash_][3] 上的照片._ +使用两个命令和一个 shell 功能,可以很容易地使用 `cat` 从一个文件进行识别、提取和重定向一些信息,并将其保存到另一个文件以供以后使用。 -------------------------------------------------------------------------------- @@ -78,7 +76,7 @@ via: https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-f 作者:[Stephen Snow][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From dcdab62c7f96b550bf266cf013a3070b7df0077c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 3 May 2019 16:24:21 +0800 Subject: [PATCH 0243/1154] PUB:20190405 Command line quick tips- Cutting content out of files.md @MjSeven https://linux.cn/article-10809-1.html --- ...5 Command line quick tips- Cutting content out of files.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190405 Command line quick tips- Cutting content out of files.md (98%) diff --git a/translated/tech/20190405 Command line quick tips- Cutting content out of files.md b/published/20190405 Command line quick tips- Cutting content out of files.md similarity index 98% rename from translated/tech/20190405 Command line quick tips- Cutting content out of files.md rename to published/20190405 Command line quick tips- Cutting content out of files.md index 15dcadbd74..a1b5ae3893 100644 --- a/translated/tech/20190405 Command line quick tips- Cutting content out of files.md +++ b/published/20190405 Command line quick tips- Cutting content out of files.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10809-1.html) [#]: subject: (Command line quick tips: Cutting content out of files) [#]: via: (https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/) [#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) From 3799e924a04ab47d2c8ae7da1ed83369a07aa95e Mon Sep 17 00:00:00 2001 From: MjSeven Date: Fri, 3 May 2019 20:25:20 +0800 Subject: [PATCH 0244/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a sentiment analysis services in Python.md | 294 ------------------ ...a sentiment analysis services in Python.md | 290 +++++++++++++++++ 2 files changed, 290 insertions(+), 294 deletions(-) delete mode 100644 sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md create mode 100644 translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md diff --git a/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md deleted file mode 100644 index 436b65d0ba..0000000000 --- a/sources/tech/20190419 Building scalable social media sentiment analysis services in Python.md +++ /dev/null @@ -1,294 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Building scalable social media sentiment analysis services in Python) -[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable) -[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) - -Building scalable social media sentiment analysis services in Python -====== -Learn how you can use spaCy, vaderSentiment, Flask, and Python to add -sentiment analysis capabilities to your work. -![Tall building with windows][1] - -The [first part][2] of this series provided some background on how sentiment analysis works. Now let's investigate how to add these capabilities to your designs. - -### Exploring spaCy and vaderSentiment in Python - -#### Prerequisites - - * A terminal shell - * Python language binaries (version 3.4+) in your shell - * The **pip** command for installing Python packages - * (optional) A [Python Virtualenv][3] to keep your work isolated from the system - - - -#### Configure your environment - -Before you begin writing code, you will need to set up the Python environment by installing the [spaCy][4] and [vaderSentiment][5] packages and downloading a language model to assist your analysis. Thankfully, most of this is relatively easy to do from the command line. - -In your shell, type the following command to install the spaCy and vaderSentiment packages: - - -``` -`pip install spacy vaderSentiment` -``` - -After the command completes, install a language model that spaCy can use for text analysis. The following command will use the spaCy module to download and install the English language [model][6]: - - -``` -`python -m spacy download en_core_web_sm` -``` - -With these libraries and models installed, you are now ready to begin coding. - -#### Do a simple text analysis - -Use the [Python interpreter interactive mode][7] to write some code that will analyze a single text fragment. Begin by starting the Python environment: - - -``` -$ python -Python 3.6.8 (default, Jan 31 2019, 09:38:34) -[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux -Type "help", "copyright", "credits" or "license" for more information. ->>> -``` - -_(Your Python interpreter version print might look different than this.)_ - - 1. Import the necessary modules: [code] >>> import spacy ->>> from vaderSentiment import vaderSentiment -``` -2. Load the English language model from spaCy: [code]`>>> english = spacy.load("en_core_web_sm")` -``` - 3. Process a piece of text. This example shows a very simple sentence that we expect to return a slightly positive sentiment: [code]`>>> result = english("I like to eat applesauce with sugar and cinnamon.")` -``` -4. Gather the sentences from the processed result. SpaCy has identified and processed the entities within the phrase; this step generates sentiment for each sentence (even though there is only one sentence in this example): [code]`>>> sentences = [str(s) for s in result.sents]` -``` - 5. Create an analyzer using vaderSentiments: [code]`>>> analyzer = vaderSentiment.SentimentIntensityAnalyzer()` -``` -6. Perform the sentiment analysis on the sentences: [code]`>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences]` -``` - - - -The sentiment variable now contains the polarity scores for the example sentence. Print out the value to see how it analyzed the sentence. - - -``` ->>> print(sentiment) -[{'neg': 0.0, 'neu': 0.737, 'pos': 0.263, 'compound': 0.3612}] -``` - -What does this structure mean? - -On the surface, this is an array with a single dictionary object; had there been multiple sentences, there would be a dictionary for each one. There are four keys in the dictionary that correspond to different types of sentiment. The **neg** key represents negative sentiment, of which none has been reported in this text, as evidenced by the **0.0** value. The **neu** key represents neutral sentiment, which has gotten a fairly high score of **0.737** (with a maximum of **1.0** ). The **pos** key represents positive sentiments, which has a moderate score of **0.263**. Last, the **compound** key represents an overall score for the text; this can range from negative to positive scores, with the value **0.3612** representing a sentiment more on the positive side. - -To see how these values might change, you can run a small experiment using the code you already entered. The following block demonstrates an evaluation of sentiment scores on a similar sentence. - - -``` ->>> result = english("I love applesauce!") ->>> sentences = [str(s) for s in result.sents] ->>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] ->>> print(sentiment) -[{'neg': 0.0, 'neu': 0.182, 'pos': 0.818, 'compound': 0.6696}] -``` - -You can see that by changing the example sentence to something overwhelmingly positive, the sentiment values have changed dramatically. - -### Building a sentiment analysis service - -Now that you have assembled the basic building blocks for doing sentiment analysis, let's turn that knowledge into a simple service. - -For this demonstration, you will create a [RESTful][8] HTTP server using the Python [Flask package][9]. This service will accept text data in English and return the sentiment analysis. Please note that this example service is for learning the technologies involved and not something to put into production. - -#### Prerequisites - - * A terminal shell - * The Python language binaries (version 3.4+) in your shell. - * The **pip** command for installing Python packages - * The **curl** command - * A text editor - * (optional) A [Python Virtualenv][3] to keep your work isolated from the system - - - -#### Configure your environment - -This environment is nearly identical to the one in the previous section. The only difference is the addition of the Flask package to Python. - - 1. Install the necessary dependencies: [code]`pip install spacy vaderSentiment flask` -``` -2. Install the English language model for spaCy: [code]`python -m spacy download en_core_web_sm` -``` - - - -#### Create the application file - -Open your editor and create a file named **app.py**. Add the following contents to it _(don't worry, we will review every line)_ : - - -``` -import flask -import spacy -import vaderSentiment.vaderSentiment as vader - -app = flask.Flask(__name__) -analyzer = vader.SentimentIntensityAnalyzer() -english = spacy.load("en_core_web_sm") - -def get_sentiments(text): -result = english(text) -sentences = [str(sent) for sent in result.sents] -sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] -return sentiments - -@app.route("/", methods=["POST", "GET"]) -def index(): -if flask.request.method == "GET": -return "To access this service send a POST request to this URL with" \ -" the text you want analyzed in the body." -body = flask.request.data.decode("utf-8") -sentiments = get_sentiments(body) -return flask.json.dumps(sentiments) -``` - -Although this is not an overly large source file, it is quite dense. Let's walk through the pieces of this application and describe what they are doing. - - -``` -import flask -import spacy -import vaderSentiment.vaderSentiment as vader -``` - -The first three lines bring in the packages needed for performing the language analysis and the HTTP framework. - - -``` -app = flask.Flask(__name__) -analyzer = vader.SentimentIntensityAnalyzer() -english = spacy.load("en_core_web_sm") -``` - -The next three lines create a few global variables. The first variable, **app** , is the main entry point that Flask uses for creating HTTP routes. The second variable, **analyzer** , is the same type used in the previous example, and it will be used to generate the sentiment scores. The last variable, **english** , is also the same type used in the previous example, and it will be used to annotate and tokenize the initial text input. - -You might be wondering why these variables have been declared globally. In the case of the **app** variable, this is standard procedure for many Flask applications. But, in the case of the **analyzer** and **english** variables, the decision to make them global is based on the load times associated with the classes involved. Although the load time might appear minor, when it's run in the context of an HTTP server, these delays can negatively impact performance. - - -``` -def get_sentiments(text): -result = english(text) -sentences = [str(sent) for sent in result.sents] -sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] -return sentiments -``` - -The next piece is the heart of the service—a function for generating sentiment values from a string of text. You can see that the operations in this function correspond to the commands you ran in the Python interpreter earlier. Here they're wrapped in a function definition with the source **text** being passed in as the variable text and finally the **sentiments** variable returned to the caller. - - -``` -@app.route("/", methods=["POST", "GET"]) -def index(): -if flask.request.method == "GET": -return "To access this service send a POST request to this URL with" \ -" the text you want analyzed in the body." -body = flask.request.data.decode("utf-8") -sentiments = get_sentiments(body) -return flask.json.dumps(sentiments) -``` - -The last function in the source file contains the logic that will instruct Flask how to configure the HTTP server for the service. It starts with a line that will associate an HTTP route **/** with the request methods **POST** and **GET**. - -After the function definition line, the **if** clause will detect if the request method is **GET**. If a user sends this request to the service, the following line will return a text message instructing how to access the server. This is largely included as a convenience to end users. - -The next line uses the **flask.request** object to acquire the body of the request, which should contain the text string to be processed. The **decode** function will convert the array of bytes into a usable, formatted string. The decoded text message is now passed to the **get_sentiments** function to generate the sentiment scores. Last, the scores are returned to the user through the HTTP framework. - -You should now save the file, if you have not done so already, and return to the shell. - -#### Run the sentiment service - -With everything in place, running the service is quite simple with Flask's built-in debugging server. To start the service, enter the following command from the same directory as your source file: - - -``` -`FLASK_APP=app.py flask run` -``` - -You will now see some output from the server in your shell, and the server will be running. To test that the server is running, you will need to open a second shell and use the **curl** command. - -First, check to see that the instruction message is printed by entering this command: - - -``` -`curl http://localhost:5000` -``` - -You should see the instruction message: - - -``` -`To access this service send a POST request to this URI with the text you want analyzed in the body.` -``` - -Next, send a test message to see the sentiment analysis by running the following command: - - -``` -`curl http://localhost:5000 --header "Content-Type: application/json" --data "I love applesauce!"` -``` - -The response you get from the server should be similar to the following: - - -``` -`[{"compound": 0.6696, "neg": 0.0, "neu": 0.182, "pos": 0.818}]` -``` - -Congratulations! You have now implemented a RESTful HTTP sentiment analysis service. You can find a link to a [reference implementation of this service and all the code from this article on GitHub][10]. - -### Continue exploring - -Now that you have an understanding of the principles and mechanics behind natural language processing and sentiment analysis, here are some ways to further your discovery of this topic. - -#### Create a streaming sentiment analyzer on OpenShift - -While creating local applications to explore sentiment analysis is a convenient first step, having the ability to deploy your applications for wider usage is a powerful next step. By following the instructions and code in this [workshop from Radanalytics.io][11], you will learn how to create a sentiment analyzer that can be containerized and deployed to a Kubernetes platform. You will also see how Apache Kafka is used as a framework for event-driven messaging and how Apache Spark can be used as a distributed computing platform for sentiment analysis. - -#### Discover live data with the Twitter API - -Although the [Radanalytics.io][12] lab generated synthetic tweets to stream, you are not limited to synthetic data. In fact, anyone with a Twitter account can access the Twitter streaming API and perform sentiment analysis on tweets with the [Tweepy Python][13] package. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable - -作者:[Michael McCune ][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/elmiko/users/jschlessman -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) -[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-1 -[3]: https://virtualenv.pypa.io/en/stable/ -[4]: https://pypi.org/project/spacy/ -[5]: https://pypi.org/project/vaderSentiment/ -[6]: https://spacy.io/models -[7]: https://docs.python.org/3.6/tutorial/interpreter.html -[8]: https://en.wikipedia.org/wiki/Representational_state_transfer -[9]: http://flask.pocoo.org/ -[10]: https://github.com/elmiko/social-moments-service -[11]: https://github.com/radanalyticsio/streaming-lab -[12]: http://Radanalytics.io -[13]: https://github.com/tweepy/tweepy diff --git a/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md new file mode 100644 index 0000000000..a216ce8495 --- /dev/null +++ b/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md @@ -0,0 +1,290 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building scalable social media sentiment analysis services in Python) +[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable) +[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) + +使用 Python 构建可扩展的社交媒体情感分析服务 +====== +学习如何使用 spaCy、vaderSentiment、Flask 和 Python 来为你的工作添加情感分析能力。 +![Tall building with windows][1] + +本系列的[第一部分][2]提供了情感分析工作原理的一些背景知识,现在让我们研究如何将这些功能添加到你的设计中。 + +### 探索 Python 库 spaCy 和 vaderSentiment + +#### 前提条件 + + * 一个终端 shell + * shell 中的 Python 语言二进制文件(3.4+ 版本) + * 用于安装 Python 包的 **pip** 命令 + * (可选)一个 [Python 虚拟环境][3]使你的工作与系统隔离开来 + +#### 配置环境 + +在开始编写代码之前,你需要安装 [spaCy][4] 和 [vaderSentiment][5] 包来设置 Python 环境,同时下载一个语言模型来帮助你分析。幸运的是,大部分操作都容易在命令行中完成。 + +在 shell 中,输入以下命令来安装 spaCy 和 vaderSentiment 包: + +``` +pip install spacy vaderSentiment +``` + +命令安装完成后,安装 spaCy 可用于文本分析的语言模型。以下命令将使用 spaCy 模块下载并安装英语[模型][6]: + +``` +python -m spacy download en_core_web_sm +``` + +安装了这些库和模型之后,就可以开始编码了。 + +#### 一个简单的文本分析 + +使用 [Python 解释器交互模式][7] 编写一些代码来分析单个文本片段。首先启动 Python 环境: + +``` +$ python +Python 3.6.8 (default, Jan 31 2019, 09:38:34) +[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> +``` + +_(你的 Python 解释器版本打印可能与此不同。)_ + + 1. 导入所需模块: + ``` + >>> import spacy + >>> from vaderSentiment import vaderSentiment + ``` +2. 从 spaCy 加载英语语言模型: + ``` + >>> english = spacy.load("en_core_web_sm") + ``` + 3. 处理一段文本。本例展示了一个非常简单的句子,我们希望它能给我们带来些许积极的情感: + ``` + >>> result = english("I like to eat applesauce with sugar and cinnamon.") + ``` +4. 从处理后的结果中收集句子。SpaCy 已识别并处理短语中的实体,这一步为每个句子生成情感(即时在本例中只有一个句子): + ``` + >>> sentences = [str(s) for s in result.sents] + ``` + 5. 使用 vaderSentiments 创建一个分析器: + ``` + >>> analyzer = vaderSentiment.SentimentIntensityAnalyzer() + ``` + 6. 对句子进行情感分析: + ``` + >>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] + ``` + +`sentiment` 变量现在包含例句的极性分数。打印出这个值,看看它是如何分析这个句子的。 + +``` +>>> print(sentiment) +[{'neg': 0.0, 'neu': 0.737, 'pos': 0.263, 'compound': 0.3612}] +``` + +这个结构是什么意思? + +表面上,这是一个只有一个字典对象的数组。如果有多个句子,那么每个句子都会对应一个字典对象。字典中有四个键对应不同类型的情感。**neg** 键表示负面情感,因为在本例中没有报告任何负面情感,**0.0** 值证明了这一点。**neu** 键表示中性情感,它的得分相当高,为**0.737**(最高为 **1.0**)。**pos** 键代表积极情感,得分适中,为 **0.263**。最后,**cmpound** 键代表文本的总体得分,它可以从负数到正数,**0.3612** 表示积极方面的情感多一点。 + +要查看这些值可能如何变化,你可以使用已输入的代码做一个小实验。以下代码块显示了如何对类似句子的情感评分的评估。 + +``` +>>> result = english("I love applesauce!") +>>> sentences = [str(s) for s in result.sents] +>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] +>>> print(sentiment) +[{'neg': 0.0, 'neu': 0.182, 'pos': 0.818, 'compound': 0.6696}] +``` + +你可以看到,通过将例句改为非常积极的句子,`sentiment` 的值发生了巨大变化。 + +### 建立一个情感分析服务 + +现在你已经为情感分析组装了基本的代码块,让我们将这些东西转化为一个简单的服务。 + +在这个演示中,你将使用 Python [Flask 包][9] 创建一个 [RESTful][8] HTTP 服务器。此服务将接受英文文本数据并返回情感分析结果。请注意,此示例服务是用于学习所涉及的技术,而不是用于投入生产的东西。 + +#### 前提条件 + + * 一个终端 shell + * shell 中的 Python 语言二进制文件(3.4+版本) + * 安装 Python 包的 **pip** 命令 + * **curl** 命令 + * 一个文本编辑器 + * (可选) 一个 [Python 虚拟环境][3]使你的工作与系统隔离开来 + +#### 配置环境 + +这个环境几乎与上一节中的环境相同,唯一的区别是在 Python 环境中添加了 Flask 包。 + + 1. 安装所需依赖项: + ``` + pip install spacy vaderSentiment flask + ``` +2. 安装 spaCy 的英语语言模型: + ``` + python -m spacy download en_core_web_sm + ``` + + +#### 创建应用程序文件 + +打开编辑器,创建一个名为 **app.py** 的文件。添加以下内容 _(不用担心,我们将解释每一行)_ : + + +``` +import flask +import spacy +import vaderSentiment.vaderSentiment as vader + +app = flask.Flask(__name__) +analyzer = vader.SentimentIntensityAnalyzer() +english = spacy.load("en_core_web_sm") + +def get_sentiments(text): + result = english(text) + sentences = [str(sent) for sent in result.sents] + sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] + return sentiments + +@app.route("/", methods=["POST", "GET"]) +def index(): + if flask.request.method == "GET": + return "To access this service send a POST request to this URL with" \ + " the text you want analyzed in the body." + body = flask.request.data.decode("utf-8") + sentiments = get_sentiments(body) + return flask.json.dumps(sentiments) +``` + +虽然这个源文件不是很大,但它非常密集。让我们来看看这个应用程序的各个部分,并解释它们在做什么。 + +``` +import flask +import spacy +import vaderSentiment.vaderSentiment as vader +``` + +前三行引入了执行语言分析和 HTTP 框架所需的包。 + +``` +app = flask.Flask(__name__) +analyzer = vader.SentimentIntensityAnalyzer() +english = spacy.load("en_core_web_sm") +``` + +接下来的三行代码创建了一些全局变量。第一个变量 **app**,它是 Flask 用于创建 HTTP 路由的主要入口点。第二个变量 **analyzer** 与上一个示例中使用的类型相同,它将用于生成情感分数。最后一个变量 **english** 也与上一个示例中使用的类型相同,它将用于注释和标记初始文本输入。 + +你可能想知道为什么全局声明这些变量。对于 **app** 变量,这是许多 Flask 应用程序的标准过程。但是,对于 **analyzer** 和 **english** 变量,将它们设置为全局变量的决定是基于与所涉及的类关联的加载时间。虽然加载时间可能看起来很短,但是当它在 HTTP 服务器的上下文中运行时,这些延迟会对性能产生负面影响。 + + +``` +def get_sentiments(text): + result = english(text) + sentences = [str(sent) for sent in result.sents] + sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] + return sentiments +``` + +这部分是服务的核心 -- 一个用于从一串文本生成情感值的函数。你可以看到此函数中的操作对应于你之前在 Python 解释器中运行的命令。这里它们被封装在一个函数定义中,**text** 源作为文本变量传入,最后 **sentiments** 变量返回给调用者。 + + +``` +@app.route("/", methods=["POST", "GET"]) +def index(): + if flask.request.method == "GET": + return "To access this service send a POST request to this URL with" \ + " the text you want analyzed in the body." + body = flask.request.data.decode("utf-8") + sentiments = get_sentiments(body) + return flask.json.dumps(sentiments) +``` + +源文件的最后一个函数包含了指导 Flask 如何为服务配置 HTTP 服务器的逻辑。它从一行开始,该行将 HTTP 路由 **/** 与请求方法 **POST** 和 **GET** 相关联。 + +在函数定义行之后,**if** 子句将检测请求方法是否为 **GET**。如果用户向服务发送此请求,那么下面的行将返回一条指示如何访问服务器的文本消息。这主要是为了方便最终用户。 + +下一行使用 **flask.request** 对象来获取请求的主体,该主体应包含要处理的文本字符串。**decode** 函数将字节数组转换为可用的格式化字符串。经过解码的文本消息被传递给 **get_sentiments** 函数以生成情感分数。最后,分数通过 HTTP 框架返回给用户。 + +你现在应该保存文件,如果尚未保存,那么返回 shell。 + +#### 运行情感服务 + +一切就绪后,使用 Flask 的内置调试服务器运行服务非常简单。要启动该服务,请从与源文件相同的目录中输入以下命令: + +``` +FLASK_APP=app.py flask run +``` + +现在,你将在 shell 中看到来自服务器的一些输出,并且服务器将处于运行状态。要测试服务器是否正在运行,你需要打开第二个 shell 并使用 **curl** 命令。 + +首先,输入以下命令检查是否打印了指令信息: + +``` +curl http://localhost:5000 +``` + +你应该看到说明消息: + +``` +To access this service send a POST request to this URI with the text you want analyzed in the body. +``` + +接下来,运行以下命令发送测试消息,查看情感分析: + +``` +curl http://localhost:5000 --header "Content-Type: application/json" --data "I love applesauce!" +``` + +你从服务器获得的响应应类似于以下内容: + +``` +[{"compound": 0.6696, "neg": 0.0, "neu": 0.182, "pos": 0.818}] +``` + +恭喜!你现在已经实现了一个 RESTful HTTP 情感分析服务。你可以在 [GitHub 上找到此服务的参考实现和本文中的所有代码][10]。 + +### 继续探索 + +现在你已经了解了自然语言处理和情感分析背后的原理和机制,下面是进一步发现探索主题的一些方法。 + +#### 在 OpenShift 上创建流式情感分析器 + +虽然创建本地应用程序来研究情绪分析很方便,但是接下来需要能够部署应用程序以实现更广泛的用途。按照[ Radnaalytics.io][11] 提供的指导和代码进行操作,你将学习如何创建一个情感分析仪,可以集装箱化并部署到 Kubernetes 平台。你还将了解如何将 APache Kafka 用作事件驱动消息传递的框架,以及如何将 Apache Spark 用作情绪分析的分布式计算平台。 + +#### 使用 Twitter API 发现实时数据 + +虽然 [Radanalytics.io][12] 实验室可以生成合成推文流,但你可以不受限于合成数据。事实上,拥有 Twitter 账户的任何人都可以使用 [Tweepy Python][13] 包访问 Twitter 流媒体 API 对推文进行情感分析。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable + +作者:[Michael McCune ][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/elmiko/users/jschlessman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-1 +[3]: https://virtualenv.pypa.io/en/stable/ +[4]: https://pypi.org/project/spacy/ +[5]: https://pypi.org/project/vaderSentiment/ +[6]: https://spacy.io/models +[7]: https://docs.python.org/3.6/tutorial/interpreter.html +[8]: https://en.wikipedia.org/wiki/Representational_state_transfer +[9]: http://flask.pocoo.org/ +[10]: https://github.com/elmiko/social-moments-service +[11]: https://github.com/radanalyticsio/streaming-lab +[12]: http://Radanalytics.io +[13]: https://github.com/tweepy/tweepy From ac9156d27346eb9d2da1a853c2963bd251051f35 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Fri, 3 May 2019 20:31:59 +0800 Subject: [PATCH 0245/1154] Translating by MjSeven --- ...ng started with social media sentiment analysis in Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md b/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md index e70b263acc..8d426a5af3 100644 --- a/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md +++ b/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2854e9de09bced8ea437be5d54be698b02185eb4 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sat, 4 May 2019 10:10:47 +0800 Subject: [PATCH 0246/1154] [Translated] 20190416 Inter-process communication in Linux- Using pipes and message queues.md Signed-off-by: Chang Liu --- ...n Linux- Using pipes and message queues.md | 531 ---------------- ...n Linux- Using pipes and message queues.md | 574 ++++++++++++++++++ 2 files changed, 574 insertions(+), 531 deletions(-) delete mode 100644 sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md create mode 100644 translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md diff --git a/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md deleted file mode 100644 index c73155aa58..0000000000 --- a/sources/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md +++ /dev/null @@ -1,531 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (FSSlc) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Inter-process communication in Linux: Using pipes and message queues) -[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-channels) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) - -Inter-process communication in Linux: Using pipes and message queues -====== -Learn how processes synchronize with each other in Linux. -![Chat bubbles][1] - -This is the second article in a series about [interprocess communication][2] (IPC) in Linux. The [first article][3] focused on IPC through shared storage: shared files and shared memory segments. This article turns to pipes, which are channels that connect processes for communication. A channel has a _write end_ for writing bytes, and a _read end_ for reading these bytes in FIFO (first in, first out) order. In typical use, one process writes to the channel, and a different process reads from this same channel. The bytes themselves might represent anything: numbers, employee records, digital movies, and so on. - -Pipes come in two flavors, named and unnamed, and can be used either interactively from the command line or within programs; examples are forthcoming. This article also looks at memory queues, which have fallen out of fashion—but undeservedly so. - -The code examples in the first article acknowledged the threat of race conditions (either file-based or memory-based) in IPC that uses shared storage. The question naturally arises about safe concurrency for the channel-based IPC, which will be covered in this article. The code examples for pipes and memory queues use APIs with the POSIX stamp of approval, and a core goal of the POSIX standards is thread-safety. - -Consider the [man pages for the **mq_open**][4] function, which belongs to the memory queue API. These pages include a section on [Attributes][5] with this small table: - -Interface | Attribute | Value ----|---|--- -mq_open() | Thread safety | MT-Safe - -The value **MT-Safe** (with **MT** for multi-threaded) means that the **mq_open** function is thread-safe, which in turn implies process-safe: A process executes in precisely the sense that one of its threads executes, and if a race condition cannot arise among threads in the _same_ process, such a condition cannot arise among threads in different processes. The **MT-Safe** attribute assures that a race condition does not arise in invocations of **mq_open**. In general, channel-based IPC is concurrent-safe, although a cautionary note is raised in the examples that follow. - -### Unnamed pipes - -Let's start with a contrived command line example that shows how unnamed pipes work. On all modern systems, the vertical bar **|** represents an unnamed pipe at the command line. Assume **%** is the command line prompt, and consider this command: - - -``` -`% sleep 5 | echo "Hello, world!" ## writer to the left of |, reader to the right` -``` - -The _sleep_ and _echo_ utilities execute as separate processes, and the unnamed pipe allows them to communicate. However, the example is contrived in that no communication occurs. The greeting _Hello, world!_ appears on the screen; then, after about five seconds, the command line prompt returns, indicating that both the _sleep_ and _echo_ processes have exited. What's going on? - -In the vertical-bar syntax from the command line, the process to the left ( _sleep_ ) is the writer, and the process to the right ( _echo_ ) is the reader. By default, the reader blocks until there are bytes to read from the channel, and the writer—after writing its bytes—finishes up by sending an end-of-stream marker. (Even if the writer terminates prematurely, an end-of-stream marker is sent to the reader.) The unnamed pipe persists until both the writer and the reader terminate. - -In the contrived example, the _sleep_ process does not write any bytes to the channel but does terminate after about five seconds, which sends an end-of-stream marker to the channel. In the meantime, the _echo_ process immediately writes the greeting to the standard output (the screen) because this process does not read any bytes from the channel, so it does no waiting. Once the _sleep_ and _echo_ processes terminate, the unnamed pipe—not used at all for communication—goes away and the command line prompt returns. - -Here is a more useful example using two unnamed pipes. Suppose that the file _test.dat_ looks like this: - - -``` -this -is -the -way -the -world -ends -``` - -The command: - - -``` -`% cat test.dat | sort | uniq` -``` - -pipes the output from the _cat_ (concatenate) process into the _sort_ process to produce sorted output, and then pipes the sorted output into the _uniq_ process to eliminate duplicate records (in this case, the two occurrences of **the** reduce to one): - - -``` -ends -is -the -this -way -world -``` - -The scene now is set for a program with two processes that communicate through an unnamed pipe. - -#### Example 1. Two processes communicating through an unnamed pipe. - - -``` -#include /* wait */ -#include -#include /* exit functions */ -#include /* read, write, pipe, _exit */ -#include - -#define ReadEnd 0 -#define WriteEnd 1 - -void report_and_exit(const char* msg) { -[perror][6](msg); -[exit][7](-1); /** failure **/ -} - -int main() { -int pipeFDs[2]; /* two file descriptors */ -char buf; /* 1-byte buffer */ -const char* msg = "Nature's first green is gold\n"; /* bytes to write */ - -if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); -pid_t cpid = fork(); /* fork a child process */ -if (cpid < 0) report_and_exit("fork"); /* check for failure */ - -if (0 == cpid) { /*** child ***/ /* child process */ -close(pipeFDs[WriteEnd]); /* child reads, doesn't write */ - -while (read(pipeFDs[ReadEnd], &buf, 1) > 0) /* read until end of byte stream */ -write(STDOUT_FILENO, &buf, sizeof(buf)); /* echo to the standard output */ - -close(pipeFDs[ReadEnd]); /* close the ReadEnd: all done */ -_exit(0); /* exit and notify parent at once */ -} -else { /*** parent ***/ -close(pipeFDs[ReadEnd]); /* parent writes, doesn't read */ - -write(pipeFDs[WriteEnd], msg, [strlen][8](msg)); /* write the bytes to the pipe */ -close(pipeFDs[WriteEnd]); /* done writing: generate eof */ - -wait(NULL); /* wait for child to exit */ -[exit][7](0); /* exit normally */ -} -return 0; -} -``` - -The _pipeUN_ program above uses the system function **fork** to create a process. Although the program has but a single source file, multi-processing occurs during (successful) execution. Here are the particulars in a quick review of how the library function **fork** works: - - * The **fork** function, called in the _parent_ process, returns **-1** to the parent in case of failure. In the _pipeUN_ example, the call is: [code]`pid_t cpid = fork(); /* called in parent */`[/code] The returned value is stored, in this example, in the variable **cpid** of integer type **pid_t**. (Every process has its own _process ID_ , a non-negative integer that identifies the process.) Forking a new process could fail for several reasons, including a full _process table_ , a structure that the system maintains to track processes. Zombie processes, clarified shortly, can cause a process table to fill if these are not harvested. - * If the **fork** call succeeds, it thereby spawns (creates) a new child process, returning one value to the parent but a different value to the child. Both the parent and the child process execute the _same_ code that follows the call to **fork**. (The child inherits copies of all the variables declared so far in the parent.) In particular, a successful call to **fork** returns: - * Zero to the child process - * The child's process ID to the parent - * An _if/else_ or equivalent construct typically is used after a successful **fork** call to segregate code meant for the parent from code meant for the child. In this example, the construct is: [code] if (0 == cpid) { /*** child ***/ -... -} -else { /*** parent ***/ -... -} -``` -If forking a child succeeds, the _pipeUN_ program proceeds as follows. There is an integer array: -``` -`int pipeFDs[2]; /* two file descriptors */` -``` -to hold two file descriptors, one for writing to the pipe and another for reading from the pipe. (The array element **pipeFDs[0]** is the file descriptor for the read end, and the array element **pipeFDs[1]** is the file descriptor for the write end.) A successful call to the system **pipe** function, made immediately before the call to **fork** , populates the array with the two file descriptors: -``` -`if (pipe(pipeFDs) < 0) report_and_exit("pipeFD");` -``` -The parent and the child now have copies of both file descriptors, but the _separation of concerns_ pattern means that each process requires exactly one of the descriptors. In this example, the parent does the writing and the child does the reading, although the roles could be reversed. The first statement in the child _if_ -clause code, therefore, closes the pipe's write end: -``` -`close(pipeFDs[WriteEnd]); /* called in child code */` -``` -and the first statement in the parent _else_ -clause code closes the pipe's read end: -``` -`close(pipeFDs[ReadEnd]); /* called in parent code */` -``` -The parent then writes some bytes (ASCII codes) to the unnamed pipe, and the child reads these and echoes them to the standard output. - -One more aspect of the program needs clarification: the call to the **wait** function in the parent code. Once spawned, a child process is largely independent of its parent, as even the short _pipeUN_ program illustrates. The child can execute arbitrary code that may have nothing to do with the parent. However, the system does notify the parent through a signal—if and when the child terminates. - -What if the parent terminates before the child? In this case, unless precautions are taken, the child becomes and remains a _zombie_ process with an entry in the process table. The precautions are of two broad types. One precaution is to have the parent notify the system that the parent has no interest in the child's termination: -``` -`signal(SIGCHLD, SIG_IGN); /* in parent: ignore notification */` -``` -A second approach is to have the parent execute a **wait** on the child's termination, thereby ensuring that the parent outlives the child. This second approach is used in the _pipeUN_ program, where the parent code has this call: -``` -`wait(NULL); /* called in parent */` -``` -This call to **wait** means _wait until the termination of any child occurs_ , and in the _pipeUN_ program, there is only one child process. (The **NULL** argument could be replaced with the address of an integer variable to hold the child's exit status.) There is a more flexible **waitpid** function for fine-grained control, e.g., for specifying a particular child process among several. - -The _pipeUN_ program takes another precaution. When the parent is done waiting, the parent terminates with the call to the regular **exit** function. By contrast, the child terminates with a call to the **_exit** variant, which fast-tracks notification of termination. In effect, the child is telling the system to notify the parent ASAP that the child has terminated. - -If two processes write to the same unnamed pipe, can the bytes be interleaved? For example, if process P1 writes: -``` -`foo bar` -``` -to a pipe and process P2 concurrently writes: -``` -`baz baz` -``` -to the same pipe, it seems that the pipe contents might be something arbitrary, such as: -``` -`baz foo baz bar` -``` -The POSIX standard ensures that writes are not interleaved so long as no write exceeds **PIPE_BUF** bytes. On Linux systems, **PIPE_BUF** is 4,096 bytes in size. My preference with pipes is to have a single writer and a single reader, thereby sidestepping the issue. - -## Named pipes - -An unnamed pipe has no backing file: the system maintains an in-memory buffer to transfer bytes from the writer to the reader. Once the writer and reader terminate, the buffer is reclaimed, so the unnamed pipe goes away. By contrast, a named pipe has a backing file and a distinct API. - -Let's look at another command line example to get the gist of named pipes. Here are the steps: - - * Open two terminals. The working directory should be the same for both. - * In one of the terminals, enter these two commands (the prompt again is **%** , and my comments start with **##** ): [code] % mkfifo tester ## creates a backing file named tester -% cat tester ## type the pipe's contents to stdout [/code] At the beginning, nothing should appear in the terminal because nothing has been written yet to the named pipe. - * In the second terminal, enter the command: [code] % cat > tester ## redirect keyboard input to the pipe -hello, world! ## then hit Return key -bye, bye ## ditto - ## terminate session with a Control-C [/code] Whatever is typed into this terminal is echoed in the other. Once **Ctrl+C** is entered, the regular command line prompt returns in both terminals: the pipe has been closed. - * Clean up by removing the file that implements the named pipe: [code]`% unlink tester` -``` - - - -As the utility's name _mkfifo_ implies, a named pipe also is called a FIFO because the first byte in is the first byte out, and so on. There is a library function named **mkfifo** that creates a named pipe in programs and is used in the next example, which consists of two processes: one writes to the named pipe and the other reads from this pipe. - -#### Example 2. The _fifoWriter_ program - - -``` -#include -#include -#include -#include -#include -#include -#include - -#define MaxLoops 12000 /* outer loop */ -#define ChunkSize 16 /* how many written at a time */ -#define IntsPerChunk 4 /* four 4-byte ints per chunk */ -#define MaxZs 250 /* max microseconds to sleep */ - -int main() { -const char* pipeName = "./fifoChannel"; -mkfifo(pipeName, 0666); /* read/write for user/group/others */ -int fd = open(pipeName, O_CREAT | O_WRONLY); /* open as write-only */ -if (fd < 0) return -1; /* can't go on */ - -int i; -for (i = 0; i < MaxLoops; i++) { /* write MaxWrites times */ -int j; -for (j = 0; j < ChunkSize; j++) { /* each time, write ChunkSize bytes */ -int k; -int chunk[IntsPerChunk]; -for (k = 0; k < IntsPerChunk; k++) -chunk[k] = [rand][9](); -write(fd, chunk, sizeof(chunk)); -} -usleep(([rand][9]() % MaxZs) + 1); /* pause a bit for realism */ -} - -close(fd); /* close pipe: generates an end-of-stream marker */ -unlink(pipeName); /* unlink from the implementing file */ -[printf][10]("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); - -return 0; -} -``` - -The _fifoWriter_ program above can be summarized as follows: - - * The program creates a named pipe for writing: [code] mkfifo(pipeName, 0666); /* read/write perms for user/group/others */ -int fd = open(pipeName, O_CREAT | O_WRONLY); [/code] where **pipeName** is the name of the backing file passed to **mkfifo** as the first argument. The named pipe then is opened with the by-now familiar call to the **open** function, which returns a file descriptor. - * For a touch of realism, the _fifoWriter_ does not write all the data at once, but instead writes a chunk, sleeps a random number of microseconds, and so on. In total, 768,000 4-byte integer values are written to the named pipe. - * After closing the named pipe, the _fifoWriter_ also unlinks the file: [code] close(fd); /* close pipe: generates end-of-stream marker */ -unlink(pipeName); /* unlink from the implementing file */ [/code] The system reclaims the backing file once every process connected to the pipe has performed the unlink operation. In this example, there are only two such processes: the _fifoWriter_ and the _fifoReader_ , both of which do an _unlink_ operation. - - - -The two programs should be executed in different terminals with the same working directory. However, the _fifoWriter_ should be started before the _fifoReader_ , as the former creates the pipe. The _fifoReader_ then accesses the already created named pipe. - -#### Example 3. The _fifoReader_ program - - -``` -#include -#include -#include -#include -#include - -unsigned is_prime(unsigned n) { /* not pretty, but efficient */ -if (n <= 3) return n > 1; -if (0 == (n % 2) || 0 == (n % 3)) return 0; - -unsigned i; -for (i = 5; (i * i) <= n; i += 6) -if (0 == (n % i) || 0 == (n % (i + 2))) return 0; - -return 1; /* found a prime! */ -} - -int main() { -const char* file = "./fifoChannel"; -int fd = open(file, O_RDONLY); -if (fd < 0) return -1; /* no point in continuing */ -unsigned count = 0, total = 0, primes_count = 0; - -while (1) { -int next; -int i; - -ssize_t count = read(fd, &next, sizeof(int)); -if (0 == count) break; /* end of stream */ -else if (count == sizeof(int)) { /* read a 4-byte int value */ -total++; -if (is_prime(next)) primes_count++; -} -} - -close(fd); /* close pipe from read end */ -unlink(file); /* unlink from the underlying file */ -[printf][10]("Received ints: %u, primes: %u\n", total, primes_count); - -return 0; -} -``` - -The _fifoReader_ program above can be summarized as follows: - - * Because the _fifoWriter_ creates the named pipe, the _fifoReader_ needs only the standard call **open** to access the pipe through the backing file: [code] const char* file = "./fifoChannel"; -int fd = open(file, O_RDONLY); [/code] The file opens as read-only. - * The program then goes into a potentially infinite loop, trying to read a 4-byte chunk on each iteration. The **read** call: [code]`ssize_t count = read(fd, &next, sizeof(int));`[/code] returns 0 to indicate end-of-stream, in which case the _fifoReader_ breaks out of the loop, closes the named pipe, and unlinks the backing file before terminating. - * After reading a 4-byte integer, the _fifoReader_ checks whether the number is a prime. This represents the business logic that a production-grade reader might perform on the received bytes. On a sample run, there were 37,682 primes among the 768,000 integers received. - - - -On repeated sample runs, the _fifoReader_ successfully read all of the bytes that the _fifoWriter_ wrote. This is not surprising. The two processes execute on the same host, taking network issues out of the equation. Named pipes are a highly reliable and efficient IPC mechanism and, therefore, in wide use. - -Here is the output from the two programs, each launched from a separate terminal but with the same working directory: - - -``` -% ./fifoWriter -768000 ints sent to the pipe. -### -% ./fifoReader -Received ints: 768000, primes: 37682 -``` - -### Message queues - -Pipes have strict FIFO behavior: the first byte written is the first byte read, the second byte written is the second byte read, and so forth. Message queues can behave in the same way but are flexible enough that byte chunks can be retrieved out of FIFO order. - -As the name suggests, a message queue is a sequence of messages, each of which has two parts: - - * The payload, which is an array of bytes ( **char** in C) - * A type, given as a positive integer value; types categorize messages for flexible retrieval - - - -Consider the following depiction of a message queue, with each message labeled with an integer type: - - -``` -+-+ +-+ +-+ +-+ -sender--->|3|--->|2|--->|2|--->|1|--->receiver -+-+ +-+ +-+ +-+ -``` - -Of the four messages shown, the one labeled 1 is at the front, i.e., closest to the receiver. Next come two messages with label 2, and finally, a message labeled 3 at the back. If strict FIFO behavior were in play, then the messages would be received in the order 1-2-2-3. However, the message queue allows other retrieval orders. For example, the messages could be retrieved by the receiver in the order 3-2-1-2. - -The _mqueue_ example consists of two programs, the _sender_ that writes to the message queue and the _receiver_ that reads from this queue. Both programs include the header file _queue.h_ shown below: - -#### Example 4. The header file _queue.h_ - - -``` -#define ProjectId 123 -#define PathName "queue.h" /* any existing, accessible file would do */ -#define MsgLen 4 -#define MsgCount 6 - -typedef struct { -long type; /* must be of type long */ -char payload[MsgLen + 1]; /* bytes in the message */ -} queuedMessage; -``` - -The header file defines a structure type named **queuedMessage** , with **payload** (byte array) and **type** (integer) fields. This file also defines symbolic constants (the **#define** statements), the first two of which are used to generate a key that, in turn, is used to get a message queue ID. The **ProjectId** can be any positive integer value, and the **PathName** must be an existing, accessible file—in this case, the file _queue.h_. The setup statements in both the _sender_ and the _receiver_ programs are: - - -``` -key_t key = ftok(PathName, ProjectId); /* generate key */ -int qid = msgget(key, 0666 | IPC_CREAT); /* use key to get queue id */ -``` - -The ID **qid** is, in effect, the counterpart of a file descriptor for message queues. - -#### Example 5. The message _sender_ program - - -``` -#include -#include -#include -#include -#include -#include "queue.h" - -void report_and_exit(const char* msg) { -[perror][6](msg); -[exit][7](-1); /* EXIT_FAILURE */ -} - -int main() { -key_t key = ftok(PathName, ProjectId); -if (key < 0) report_and_exit("couldn't get key..."); - -int qid = msgget(key, 0666 | IPC_CREAT); -if (qid < 0) report_and_exit("couldn't get queue id..."); - -char* payloads[] = {"msg1", "msg2", "msg3", "msg4", "msg5", "msg6"}; -int types[] = {1, 1, 2, 2, 3, 3}; /* each must be > 0 */ -int i; -for (i = 0; i < MsgCount; i++) { -/* build the message */ -queuedMessage msg; -msg.type = types[i]; -[strcpy][11](msg.payload, payloads[i]); - -/* send the message */ -msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); /* don't block */ -[printf][10]("%s sent as type %i\n", msg.payload, (int) msg.type); -} -return 0; -} -``` - -The _sender_ program above sends out six messages, two each of a specified type: the first messages are of type 1, the next two of type 2, and the last two of type 3. The sending statement: - - -``` -`msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT);` -``` - -is configured to be non-blocking (the flag **IPC_NOWAIT** ) because the messages are so small. The only danger is that a full queue, unlikely in this example, would result in a sending failure. The _receiver_ program below also receives messages using the **IPC_NOWAIT** flag. - -#### Example 6. The message _receiver_ program - - -``` -#include -#include -#include -#include -#include "queue.h" - -void report_and_exit(const char* msg) { -[perror][6](msg); -[exit][7](-1); /* EXIT_FAILURE */ -} - -int main() { -key_t key= ftok(PathName, ProjectId); /* key to identify the queue */ -if (key < 0) report_and_exit("key not gotten..."); - -int qid = msgget(key, 0666 | IPC_CREAT); /* access if created already */ -if (qid < 0) report_and_exit("no access to queue..."); - -int types[] = {3, 1, 2, 1, 3, 2}; /* different than in sender */ -int i; -for (i = 0; i < MsgCount; i++) { -queuedMessage msg; /* defined in queue.h */ -if (msgrcv(qid, &msg, sizeof(msg), types[i], MSG_NOERROR | IPC_NOWAIT) < 0) -[puts][12]("msgrcv trouble..."); -[printf][10]("%s received as type %i\n", msg.payload, (int) msg.type); -} - -/** remove the queue **/ -if (msgctl(qid, IPC_RMID, NULL) < 0) /* NULL = 'no flags' */ -report_and_exit("trouble removing queue..."); - -return 0; -} -``` - -The _receiver_ program does not create the message queue, although the API suggests as much. In the _receiver_ , the call: - - -``` -`int qid = msgget(key, 0666 | IPC_CREAT);` -``` - -is misleading because of the **IPC_CREAT** flag, but this flag really means _create if needed, otherwise access_. The _sender_ program calls **msgsnd** to send messages, whereas the _receiver_ calls **msgrcv** to retrieve them. In this example, the _sender_ sends the messages in the order 1-1-2-2-3-3, but the _receiver_ then retrieves them in the order 3-1-2-1-3-2, showing that message queues are not bound to strict FIFO behavior: - - -``` -% ./sender -msg1 sent as type 1 -msg2 sent as type 1 -msg3 sent as type 2 -msg4 sent as type 2 -msg5 sent as type 3 -msg6 sent as type 3 - -% ./receiver -msg5 received as type 3 -msg1 received as type 1 -msg3 received as type 2 -msg2 received as type 1 -msg6 received as type 3 -msg4 received as type 2 -``` - -The output above shows that the _sender_ and the _receiver_ can be launched from the same terminal. The output also shows that the message queue persists even after the _sender_ process creates the queue, writes to it, and exits. The queue goes away only after the _receiver_ process explicitly removes it with the call to **msgctl** : - - -``` -`if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */` -``` - -### Wrapping up - -The pipes and message queue APIs are fundamentally _unidirectional_ : one process writes and another reads. There are implementations of bidirectional named pipes, but my two cents is that this IPC mechanism is at its best when it is simplest. As noted earlier, message queues have fallen in popularity—but without good reason; these queues are yet another tool in the IPC toolbox. Part 3 completes this quick tour of the IPC toolbox with code examples of IPC through sockets and signals. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/interprocess-communication-linux-channels - -作者:[Marty Kalin][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/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) -[2]: https://en.wikipedia.org/wiki/Inter-process_communication -[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 -[4]: http://man7.org/linux/man-pages/man2/mq_open.2.html -[5]: http://man7.org/linux/man-pages/man2/mq_open.2.html#ATTRIBUTES -[6]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html -[9]: http://www.opengroup.org/onlinepubs/009695399/functions/rand.html -[10]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html -[11]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html -[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html diff --git a/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md new file mode 100644 index 0000000000..bdbb9b4ddd --- /dev/null +++ b/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -0,0 +1,574 @@ +[#]: collector: (lujun9972) +[#]: translator: (FSSlc) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Inter-process communication in Linux: Using pipes and message queues) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-channels) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Linux 下的进程间通信:使用管道和消息队列 +====== +学习在 Linux 中进程是如何与其他进程进行同步的。 +![Chat bubbles][1] + +本篇是 Linux 下[进程间通信][2](IPC)系列的第二篇文章。[第一篇文章][3] 聚焦于通过共享文件和共享内存段这样的共享存储来进行 IPC。这篇文件的重点将转向管道,它是连接需要通信的进程之间的通道。管道拥有一个 _写端_ 用于写入字节数据,还有一个 _读端_ 用于按照先入先出的顺序读入这些字节数据。而这些字节数据可能代表任何东西:数字、数字电影等等。 + +管道有两种类型,命名管道和无名管道,都可以交互式的在命令行或程序中使用它们;相关的例子在下面展示。这篇文章也将介绍内存队列,尽管它们有些过时了,但它们不应该受这样的待遇。 + +在本系列的第一篇文章中的示例代码承认了在 IPC 中可能受到竞争条件(不管是基于文件的还是基于内存的)的威胁。自然地我们也会考虑基于管道的 IPC 的安全并发问题,这个也将在本文中提及。针对管道和内存队列的例子将会使用 POSIX 推荐使用的 API, POSIX 的一个核心目标就是线程安全。 + +考虑查看 [**mq_open** 函数的 man 页][4],这个函数属于内存队列的 API。这个 man 页中有一个章节是有关 [特性][5] 的小表格: + +Interface | Attribute | Value +---|---|--- +mq_open() | Thread safety | MT-Safe + +上面的 **MT-Safe**(**MT** 指的是 multi-threaded,多线程)意味着 **mq_open** 函数是线程安全的,进而暗示是进程安全的:一个进程的执行和它的一个线程执行的过程类似,假如竞争条件不会发生在处于 _相同_ 进程的线程中,那么这样的条件也不会发生在处于不同进程的线程中。**MT-Safe** 特性保证了调用 **mq_open** 时不会出现竞争条件。一般来说,基于通道的 IPC 是并发安全的,尽管在下面例子中会出现一个有关警告的注意事项。 + +### 无名管道 + +首先让我们通过一个特意构造的命令行例子来展示无名管道是如何工作的。在所有的现代系统中,符号 **|** 在命令行中都代表一个无名管道。假设我们的命令行提示符为 **%**,接下来考虑下面的命令: + +```shell +% sleep 5 | echo "Hello, world!" ## writer to the left of |, reader to the right +``` + +_sleep_ 和 _echo_ 程序以不同的进程执行,无名管道允许它们进行通信。但是上面的例子被特意设计为没有通信发生。问候语 _Hello, world!_ 出现在屏幕中,然后过了 5 秒后,命令行返回,暗示 _sleep_ 和 _echo_ 进程都已经结束了。这期间发生了什么呢? + +在命令行中的竖线 **|** 的语法中,左边的进程(_sleep_)是写入方,右边的进程(_echo_)为读取方。默认情况下,读入方将会堵塞,直到从通道中能够读取字节数据,而写入方在写完它的字节数据后,将发送 流已终止 的标志。(即便写入方永久地停止了,一个流已终止的标志还是会发给读取方。)无名管道将保持到写入方和读取方都停止的那个时刻。 + +在上面的例子中,_sleep_ 进程并没有向通道写入任何的字节数据,但在 5 秒后就停止了,这时将向通道发送一个流已终止的标志。与此同时,_echo_ 进程立即向标准输出(屏幕)写入问候语,因为这个进程并不从通道中读入任何字节,所以它并没有等待。一旦 _sleep_ 和 _echo_ 进程都终止了,不会再用作通信的无名管道将会消失然后返回命令行提示符。 + +下面这个更加实用示例将使用两个无名管道。我们假定文件 _test.dat_ 的内容如下: + +``` +this +is +the +way +the +world +ends +``` + +下面的命令 + +``` +% cat test.dat | sort | uniq +``` + +会将 _cat_(concatenate 的缩写)进程的输出通过管道传给 _sort_ 进程以生成排序后的输出,然后将排序后的输出通过管道传给 _uniq_ 进程以消除重复的记录(在本例中,会将两次出现的 **the** 缩减为一个): + +``` +ends +is +the +this +way +world +``` + +下面展示的情景展示的是一个带有两个进程的程序通过一个无名管道通信来进行通信。 + +#### 示例 1. 两个进程通过一个无名管道来进行通信 + + +```c +#include /* wait */ +#include +#include /* exit functions */ +#include /* read, write, pipe, _exit */ +#include + +#define ReadEnd 0 +#define WriteEnd 1 + +void report_and_exit(const char* msg) { + [perror][6](msg); + [exit][7](-1); /** failure **/ +} + +int main() { + int pipeFDs[2]; /* two file descriptors */ + char buf; /* 1-byte buffer */ + const char* msg = "Nature's first green is gold\n"; /* bytes to write */ + + if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); + pid_t cpid = fork(); /* fork a child process */ + if (cpid < 0) report_and_exit("fork"); /* check for failure */ + + if (0 == cpid) { /*** child ***/ /* child process */ + close(pipeFDs[WriteEnd]); /* child reads, doesn't write */ + + while (read(pipeFDs[ReadEnd], &buf, 1) > 0) /* read until end of byte stream */ + write(STDOUT_FILENO, &buf, sizeof(buf)); /* echo to the standard output */ + + close(pipeFDs[ReadEnd]); /* close the ReadEnd: all done */ + _exit(0); /* exit and notify parent at once */ + } + else { /*** parent ***/ + close(pipeFDs[ReadEnd]); /* parent writes, doesn't read */ + + write(pipeFDs[WriteEnd], msg, [strlen][8](msg)); /* write the bytes to the pipe */ + close(pipeFDs[WriteEnd]); /* done writing: generate eof */ + + wait(NULL); /* wait for child to exit */ + [exit][7](0); /* exit normally */ + } + return 0; +} +``` + +上面名为 _pipeUN_ 的程序使用系统函数 **fork** 来创建一个进程。尽管这个程序只有一个单一的源文件,在它正确执行的情况下将会发生多进程的情况。下面的内容是对库函数 **fork** 如何工作的一个简要回顾: + + * **fork** 函数由 _父_ 进程调用,在失败时返回 **-1** 给父进程。在 _pipeUN_ 这个例子中,相应的调用是 + +```c +pid_t cpid = fork(); /* called in parent */ +``` + +函数,调用后的返回值也被保存下来了。在这个例子中,保存在整数类型 **pid_t** 的变量 **cpid** 中。(每个进程有它自己的 _进程 ID_,一个非负的整数,用来标记进程)。复刻一个新的进程可能会因为多种原因而失败。最终它们将会被包括进一个完整的 _进程表_,这个结构由系统维持,以此来追踪进程状态。明确地说,僵尸进程假如没有被处理掉,将可能引起一个进程表被填满。 + * 假如 **fork** 调用成功,则它将创建一个新的子进程,向父进程返回一个值,向子进程返回另外的一个值。在调用 **fork** 后父进程和子进程都将执行相同的代码。(子进程继承了到此为止父进程中声明的所有变量的拷贝),特别地,一次成功的 **fork** 调用将返回如下的东西: + * 向子进程返回 0 + * 向父进程返回子进程的进程 ID + * 在依次成功的 **fork** 调用后,一个 _if/else_ 或等价的结构将会被用来隔离针对父进程和子进程的代码。在这个例子中,相应的声明为: + +```c +if (0 == cpid) { /*** child ***/ +... +} +else { /*** parent ***/ +... +} +``` + +假如成功地复刻出了一个子进程,_pipeUN_ 程序将像下面这样去执行。存在一个整数的数列 + +```c +int pipeFDs[2]; /* two file descriptors */ +``` + +来保存两个文件描述符,一个用来向管道中写入,另一个从管道中写入。(数组元素 **pipeFDs[0]** 是读端的文件描述符,元素 **pipeFDs[1]** 是写端的文件描述符。)在调用 **fork** 之前,对系统 **pipe** 函数的成功调用,将立刻使得这个数组获得两个文件描述符: + +```c +if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); +``` + +父进程和子进程现在都有了文件描述符的副本。但 _分离关注点_ 模式意味着每个进程恰好只需要一个描述符。在这个例子中,父进程负责写入,而子进程负责读取,尽管这样的角色分配可以反过来。在 _if_ 子句中的第一个语句将用于关闭管道的读端: + +```c +close(pipeFDs[WriteEnd]); /* called in child code */ +``` + +在父进程中的 _else_ 子句将会关闭管道的读端: + +```c +close(pipeFDs[ReadEnd]); /* called in parent code */ +``` + +然后父进程将向无名管道中写入某些字节数据(ASCII 代码),子进程读取这些数据,然后向标准输出中回放它们。 + +在这个程序中还需要澄清的一点是在父进程代码中的 **wait** 函数。一旦被创建后,子进程很大程度上独立于它的父进程,正如简短的 _pipeUN_ 程序所展示的那样。子进程可以执行任意的代码,而它们可能与父进程完全没有关系。但是,假如当子进程终止时,系统将会通过一个信号来通知父进程。 + +要是父进程在子进程之前终止又该如何呢?在这种情形下,除非采取了预防措施,子进程将会变成在进程表中的一个 _僵尸_ 进程。预防措施有两大类型:第一种是让父进程去通知系统,告诉系统它对子进程的终止没有任何兴趣: + +```c +signal(SIGCHLD, SIG_IGN); /* in parent: ignore notification */ +``` + +第二种方法是在子进程终止时,让父进程执行一个 **wait**。这样就确保了父进程可以独立于子进程而存在。在 _pipeUN_ 程序中使用了第二种方法,其中父进程的代码使用的是下面的调用: + +```c +wait(NULL); /* called in parent */ +``` + +这个对 **wait** 的调用意味着 _一直等待直到任意一个子进程的终止发生_,因此在 _pipeUN_ 程序中,只有一个子进程。(其中的 **NULL** 参数可以被替换为一个保存有子程序退出状态的整数变量的地址。)对于更细颗粒度的控制,还可以使用更灵活的 **waitpid** 函数,例如特别指定多个子进程中的某一个。 + +_pipeUN_ 将会采取另一个预防措施。当父进程结束了等待,父进程将会调用常规的 **exit** 函数去退出。对应的,子进程将会调用 **_exit** 变种来退出,这类变种将快速跟踪终止相关的通知。在效果上,子进程会告诉系统立刻去通知父进程它的这个子进程已经终止了。 + +假如两个进程向相同的无名管道中写入内容,字节数据会交错吗?例如,假如进程 P1 向管道写入内容: + +``` +foo bar +``` + +同时进程 P2 并发地写入: + +``` +baz baz +``` + +到相同的管道,最后的结果似乎是管道中的内容将会是任意错乱的,例如像这样: + +``` +baz foo baz bar +``` + +POSIX 标准确保了写不是交错的,使得没有写操作能够超过 **PIPE_BUF** 的范围。在 Linux 系统中, **PIPE_BUF** 的大小是 4096 字节。对于管道我更喜欢只有一个写方和一个读方,从而绕过这个问题。 + +## 命名管道 + +无名管道没有备份文件:系统将维持一个内存缓存来将字节数据从写方传给读方。一旦写方和读方终止,这个缓存将会被回收,进而无名管道消失。相反的,命名管道有备份文件和一个不同的 API。 + +下面让我们通过另一个命令行示例来知晓命名管道的要点。下面是具体的步骤: + + * 开启两个终端。这两个终端的工作目录应该相同。 + * 在其中一个终端中,键入下面的两个命令(命令行提示符仍然是 **%**,我的注释以 **##** 打头。): + +```shell +% mkfifo tester ## creates a backing file named tester +% cat tester ## type the pipe's contents to stdout +``` + +在最开始,没有任何东西会出现在终端中,因为到现在为止没有命名管道中写入任何东西。 + * 在第二个终端中输入下面的命令: + +```shell +% cat > tester ## redirect keyboard input to the pipe +hello, world! ## then hit Return key +bye, bye ## ditto + ## terminate session with a Control-C +``` + +无论在这个终端中输入什么,它都会在另一个终端中显示出来。一旦键入 **Ctrl+C**,就会回到正常的命令行提示符,因为管道已经被关闭了。 + * 通过移除实现命名管道的文件来进行清理: + +```shell +% unlink tester +``` + +正如 _mkfifo_ 程序的名字所暗示的那样,一个命名管道也被叫做一个 FIFO,因为第一个字节先进,然后第一个字节就先出,其他的类似。存在一个名为 **mkfifo** 的库函数,用它可以在程序中创建一个命名管道,它将在下一个示例中被用到,该示例由两个进程组成:一个向命名管道写入,而另一个从该管道读取。 + +#### 示例 2. _fifoWriter_ 程序 + +```c +#include +#include +#include +#include +#include +#include +#include + +#define MaxLoops 12000 /* outer loop */ +#define ChunkSize 16 /* how many written at a time */ +#define IntsPerChunk 4 /* four 4-byte ints per chunk */ +#define MaxZs 250 /* max microseconds to sleep */ + +int main() { + const char* pipeName = "./fifoChannel"; + mkfifo(pipeName, 0666); /* read/write for user/group/others */ + int fd = open(pipeName, O_CREAT | O_WRONLY); /* open as write-only */ + if (fd < 0) return -1; /** error **/ + + int i; + for (i = 0; i < MaxLoops; i++) { /* write MaxWrites times */ + int j; + for (j = 0; j < ChunkSize; j++) { /* each time, write ChunkSize bytes */ + int k; + int chunk[IntsPerChunk]; + for (k = 0; k < IntsPerChunk; k++) + chunk[k] = [rand][9](); + write(fd, chunk, sizeof(chunk)); + } + usleep(([rand][9]() % MaxZs) + 1); /* pause a bit for realism */ + } + + close(fd); /* close pipe: generates an end-of-file */ + unlink(pipeName); /* unlink from the implementing file */ + [printf][10]("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); + + return 0; +} +``` + +上面的 _fifoWriter_ 程序可以被总结为如下: + + * 首先程序创建了一个命名管道用来写入数据: + +```c +mkfifo(pipeName, 0666); /* read/write perms for user/group/others */ +int fd = open(pipeName, O_CREAT | O_WRONLY); +``` + +其中的 **pipeName** 是传递给 **mkfifo** 作为它的第一个参数的备份文件的名字。接着命名管道通过我们熟悉的 **open** 函数调用被打开,而这个函数将会返回一个文件描述符。 + * 在实现层面上,_fifoWriter_ 不会一次性将所有的数据都写入,而是写入一个块,然后休息随机数目的微秒时间,接着再循环往复。总的来说,有 768000 个 4 比特的整数值被写入到命名管道中。 + * 在关闭命名管道后,_fifoWriter_ 也将使用 unlink 去掉关联。 + +```c +close(fd); /* close pipe: generates end-of-stream marker */ +unlink(pipeName); /* unlink from the implementing file */ +``` + +一旦连接到管道的每个进程都执行了 unlink 操作后,系统将回收这些备份文件。在这个例子中,只有两个这样的进程 _fifoWriter_ 和 _fifoReader_,它们都做了 _unlink_ 操作。 + +这个两个程序应该在位于相同工作目录下的不同终端中被执行。但是 _fifoWriter_ 应该在 _fifoReader_ 之前被启动,因为需要 _fifoWriter_ 去创建管道。然后 _fifoReader_ 才能够获取到刚被创建的命名管道。 + +#### 示例 3. _fifoReader_ 程序 + +```c +#include +#include +#include +#include +#include + + +unsigned is_prime(unsigned n) { /* not pretty, but gets the job done efficiently */ + if (n <= 3) return n > 1; + if (0 == (n % 2) || 0 == (n % 3)) return 0; + + unsigned i; + for (i = 5; (i * i) <= n; i += 6) + if (0 == (n % i) || 0 == (n % (i + 2))) return 0; + + return 1; /* found a prime! */ +} + +int main() { + const char* file = "./fifoChannel"; + int fd = open(file, O_RDONLY); + if (fd < 0) return -1; /* no point in continuing */ + unsigned count = 0, total = 0, primes_count = 0; + + while (1) { + int next; + int i; + ssize_t count = read(fd, &next, sizeof(int)); + + if (0 == count) break; /* end of stream */ + else if (count == sizeof(int)) { /* read a 4-byte int value */ + total++; + if (is_prime(next)) primes_count++; + } + } + + close(fd); /* close pipe from read end */ + unlink(file); /* unlink from the underlying file */ + [printf][10]("Received ints: %u, primes: %u\n", total, primes_count); + + return 0; +} +``` + +上面的 _fifoReader_ 的内容可以总结为如下: + + * 因为 _fifoWriter_ 已经创建了命名管道,所以 _fifoReader_ 只需要利用标准的 **open** 调用来通过备份文件来获取到管道中的内容: + +```c +const char* file = "./fifoChannel"; +int fd = open(file, O_RDONLY); +``` + +这个文件的打开是只读的。 + * 然后这个程序进入一个潜在的无限循环,在每次循环时,尝试读取 4 比特的块。**read** 调用: + +```c +ssize_t count = read(fd, &next, sizeof(int)); +``` + +返回 0 来暗示流的结束。在这种情况下,_fifoReader_ 跳出循环,关闭命名管道,并在终止前 unlink 备份文件。 + * 在读入 4 比特整数后,_fifoReader_ 检查这个数是否为质数。这个操作代表了一个生产级别的读取器可能在接收到的字节数据上执行的逻辑操作。在示例运行中,接收了 768000 个整数中的 37682 个质数。 + +在重复的运行示例时, _fifoReader_ 将成功地读取 _fifoWriter_ 写入的所有字节。这不是很让人惊讶的。这两个进程在相同的机器上执行,从而可以不用考虑网络相关的问题。命名管道是一个可信且高效的 IPC 机制,因而被广泛使用。 + +下面是这两个程序的输出,在不同的终端中启动,但处于相同的工作目录: + +```shell +% ./fifoWriter +768000 ints sent to the pipe. +### +% ./fifoReader +Received ints: 768000, primes: 37682 +``` + +### 消息队列 + +管道有着严格的先入先出行为:第一个被写入的字节将会第一个被读,第二个写入的字节将第二个被读,以此类推。消息队列可以做出相同的表现,但它又足够灵活,可以使得字节块不以先入先出的次序来接收。 + +正如它的名字所建议的那样,消息队列是一系列的消息,每个消息包含两部分: + * 荷载,一个字节序列(在 C 中是 **char**) + * 一个类型,以一个正整数值的形式给定,类型用来分类消息,为了更灵活的回收 + +考虑下面对一个消息队列的描述,每个消息被一个整数类型标记: + +``` + +-+ +-+ +-+ +-+ +sender--->|3|--->|2|--->|2|--->|1|--->receiver + +-+ +-+ +-+ +-+ +``` + +在上面展示的 4 个消息中,标记为 1 的是开头,即最接近接收端,然后另个标记为 2 的消息,最后接着一个标记为 3 的消息。假如按照严格的 FIFO 行为执行,消息将会以 1-2-2-3 这样的次序被接收。但是消息队列允许其他回收次序。例如,消息可以被接收方以 3-2-1-2 的次序接收。 + +_mqueue_ 示例包含两个程序,_sender_ 将向消息队列中写入数据,而 _receiver_ 将从这个队列中读取数据。这两个程序都包含下面展示的头文件 _queue.h_: + +#### 示例 4. 头文件 _queue.h_ + +```c +#define ProjectId 123 +#define PathName "queue.h" /* any existing, accessible file would do */ +#define MsgLen 4 +#define MsgCount 6 + +typedef struct { + long type; /* must be of type long */ + char payload[MsgLen + 1]; /* bytes in the message */ +} queuedMessage; +``` + +上面的头文件定义了一个名为 **queuedMessage** 的结构类型,它带有 **payload**(字节数组)和 **type**(整数)这两个域。该文件也定义了一些符号常数(使用 **#define** 语句)。前两个常数被用来生成一个 key,而这个 key 反过来被用来获取一个消息队列的 ID。**ProjectId** 可以是任何正整数值,而 **PathName** 必须是一个存在的,可访问的文件,在这个示例中,指的是文件 _queue.h_。在 _sender_ 和 _receiver_ 中,它们都有的设定语句为: + +```c +key_t key = ftok(PathName, ProjectId); /* generate key */ +int qid = msgget(key, 0666 | IPC_CREAT); /* use key to get queue id */ +``` + +ID **qid** 在效果上是消息队列文件描述符的对应物。 + +#### 示例 5. _sender_ 程序 + +```c +#include +#include +#include +#include +#include +#include "queue.h" + +void report_and_exit(const char* msg) { + [perror][6](msg); + [exit][7](-1); /* EXIT_FAILURE */ +} + +int main() { + key_t key = ftok(PathName, ProjectId); + if (key < 0) report_and_exit("couldn't get key..."); + + int qid = msgget(key, 0666 | IPC_CREAT); + if (qid < 0) report_and_exit("couldn't get queue id..."); + + char* payloads[] = {"msg1", "msg2", "msg3", "msg4", "msg5", "msg6"}; + int types[] = {1, 1, 2, 2, 3, 3}; /* each must be > 0 */ + int i; + for (i = 0; i < MsgCount; i++) { + /* build the message */ + queuedMessage msg; + msg.type = types[i]; + [strcpy][11](msg.payload, payloads[i]); + + /* send the message */ + msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); /* don't block */ + [printf][10]("%s sent as type %i\n", msg.payload, (int) msg.type); + } + return 0; +} +``` + +上面的 _sender_ 程序将发送出 6 个消息,每两个为一个类型:前两个是类型 1,接着的连个是类型 2,最后的两个为类型 3。发送的语句: + +```c +msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); +``` + +被配置为非阻塞的(**IPC_NOWAIT** 标志),因为这里的消息体量上都很小。唯一的危险在于一个完整的序列将可能导致发送失败,而这个例子不会。下面的 _receiver_ 程序也将使用 **IPC_NOWAIT** 标志来接收消息。 + +#### 示例 6. _receiver_ 程序 + +```c +#include +#include +#include +#include +#include "queue.h" + +void report_and_exit(const char* msg) { + [perror][6](msg); + [exit][7](-1); /* EXIT_FAILURE */ +} + +int main() { + key_t key= ftok(PathName, ProjectId); /* key to identify the queue */ + if (key < 0) report_and_exit("key not gotten..."); + + int qid = msgget(key, 0666 | IPC_CREAT); /* access if created already */ + if (qid < 0) report_and_exit("no access to queue..."); + + int types[] = {3, 1, 2, 1, 3, 2}; /* different than in sender */ + int i; + for (i = 0; i < MsgCount; i++) { + queuedMessage msg; /* defined in queue.h */ + if (msgrcv(qid, &msg, sizeof(msg), types[i], MSG_NOERROR | IPC_NOWAIT) < 0) + [puts][12]("msgrcv trouble..."); + [printf][10]("%s received as type %i\n", msg.payload, (int) msg.type); + } + + /** remove the queue **/ + if (msgctl(qid, IPC_RMID, NULL) < 0) /* NULL = 'no flags' */ + report_and_exit("trouble removing queue..."); + + return 0; +} +``` + +这个 _receiver_ 程序不会创建消息队列,尽管 API 看起来像是那样。在 _receiver_ 中,对 + +```c +int qid = msgget(key, 0666 | IPC_CREAT); +``` + +的调用可能因为带有 **IPC_CREAT** 标志而具有误导性,但是这个标志的真实意义是 _如果需要就创建,否则直接获取_。_sender_ 程序调用 **msgsnd** 来发送消息,而 _receiver_ 调用 **msgrcv** 来接收它们。在这个例子中,_sender_ 以 1-1-2-2-3-3 的次序发送消息,但 _receiver_ 接收它们的次序为 3-1-2-1-3-2,这显示消息队列没有被严格的 FIFO 行为所拘泥: + +```shell +% ./sender +msg1 sent as type 1 +msg2 sent as type 1 +msg3 sent as type 2 +msg4 sent as type 2 +msg5 sent as type 3 +msg6 sent as type 3 + +% ./receiver +msg5 received as type 3 +msg1 received as type 1 +msg3 received as type 2 +msg2 received as type 1 +msg6 received as type 3 +msg4 received as type 2 +``` + +上面的输出显示 _sender_ 和 _receiver_ 可以在同一个终端中启动。输出也显示消息队列是持久的,即便在 _sender_ 进程在完成创建队列,向队列写数据,然后离开的整个过程后,队列仍然存在。只有在 _receiver_ 进程显式地调用 **msgctl** 来移除该队列,这个队列才会消失: + +```c +if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */ +``` + +### 总结 + +管道和消息队列的 API 在根本上来说都是单向的:一个进程写,然后另一个进程读。当然还存在双向命名管道的实现,但我认为这个 IPC 机制在它最为简单的时候反而是最佳的。正如前面提到的那样,消息队列已经不大受欢迎了,尽管没有找到什么特别好的原因来解释这个现象。而队列仍然是 IPC 工具箱中的另一个工具。这个快速的 IPC 工具箱之旅将以第 3 部分-通过套接字和信号来示例 IPC -来终结。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-channels + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://en.wikipedia.org/wiki/Inter-process_communication +[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 +[4]: http://man7.org/linux/man-pages/man2/mq_open.2.html +[5]: http://man7.org/linux/man-pages/man2/mq_open.2.html#ATTRIBUTES +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/rand.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html From 4aa08a76c901062e789301220c4e5f627cb93e20 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 13:39:38 +0800 Subject: [PATCH 0247/1154] PRF:20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @arrowfeng --- ...gure NTP Server And NTP Client In Linux.md | 122 ++++++++---------- 1 file changed, 56 insertions(+), 66 deletions(-) diff --git a/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md index 1c43f50626..e3ca452105 100644 --- a/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md +++ b/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @@ -1,101 +1,91 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?) [#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -如何在Linux上安装、配置NTP服务和NTP客户端? +如何在 Linux 上安装、配置 NTP 服务器和客户端? ====== -你也许听说过这个词很多次或者你可能已经在使用它了。 -但是,在这篇文章中我将会清晰的告诉你NTP服务和NTP客户端的安装。 +你也许听说过这个词很多次或者你可能已经在使用它了。在这篇文章中我将会清晰的告诉你 NTP 服务器和客户端的安装。 之后我们将会了解 **[Chrony NTP 客户端的安装][1]**。 +### 什么是 NTP 服务? -### 什么是NTP服务? +NTP 意即网络时间协议Network Time Protocol。它是通过网络在计算机系统之间进行时钟同步的网络协议。换言之,它可以让那些通过 NTP 或者 Chrony 客户端连接到 NTP 服务器的系统保持时间上的一致(它能保持一个精确的时间)。 -NTP 表示为网络时间协议。 +NTP 在公共互联网上通常能够保持时间延迟在几十毫秒以内的精度,并在理想条件下,它能在局域网下达到低于一毫秒的延迟精度。 -它是通过网络在电脑系统之间进行时钟同步的网络协议。 +它使用用户数据报协议(UDP)在端口 123 上发送和接受时间戳。它是个 C/S 架构的应用程序。 -另一方面,我可以说,它可以让那些通过NTP或者Chrony客户端连接到NTP服务的系统保持时间上的一致(它能保持一个精确的时间)。 +### NTP 客户端 +NTP 客户端将其时钟与网络时间服务器同步。 -NTP在公共互联网上通常能够保持时间延迟在几十毫秒以内的精度,并在理想条件下,它能在局域网下达到优于一毫秒的延迟精度。 +### Chrony 客户端 -它使用用户数据报协议(UDP)在端口123上发送和接受时间戳。它是C/S架构的应用程序。 +Chrony 是 NTP 客户端的替代品。它能以更精确的时间更快的同步系统时钟,并且它对于那些不总是在线的系统很有用。 - - -### 什么是NTP客户端? - -NTP客户端将其时钟与网络时间服务器同步。 - -### 什么是Chrony客户端? -Chrony是NTP客户端的替代品。它能以更精确的时间更快的同步系统时钟,并且它对于那些不总是在线的系统很有用。 - -### 为什么我们需要NTP服务? +### 为什么我们需要 NTP 服务? 为了使你组织中的所有服务器与基于时间的作业保持精确的时间同步。 -为了说明这点,我将告诉你一个场景。比如说,我们有两个服务器(服务器1和服务器2)。服务器1通常在10:55完成离线作业,然后服务器2在11:00需要基于服务器1完成的作业报告去运行其他作业。 +为了说明这点,我将告诉你一个场景。比如说,我们有两个服务器(服务器 1 和服务器 2)。服务器 1 通常在 10:55 完成离线作业,然后服务器 2 在 11:00 需要基于服务器 1 完成的作业报告去运行其他作业。 -如果两个服务器正在使用不同的时间(如果服务器2时间比服务器1提前,服务器1的时间就落后于服务器2),然后我们就不能去执行这个作业。为了达到时间一致,我们应该安装NTP。 -希望上述能清除你对于NTP的疑惑。 +如果两个服务器正在使用不同的时间(如果服务器 2 时间比服务器 1 提前,服务器 1 的时间就落后于服务器 2),然后我们就不能去执行这个作业。为了达到时间一致,我们应该安装 NTP。 +希望上述能清除你对于 NTP 的疑惑。 在这篇文章中,我们将使用下列设置去测试。 - * **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.8, OS:CentOS 7 - * **`NTP Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.5, OS:Ubuntu 18.04 + * **NTP 服务器:** 主机名:CentOS7.2daygeek.com,IP:192.168.1.8,OS:CentOS 7 + * **NTP 客户端:** 主机名:Ubuntu18.2daygeek.com,IP:192.168.1.5,OS:Ubuntu 18.04 +### NTP 服务器端:如何在 Linux 上安装 NTP? +因为它是 C/S 架构,所以 NTP 服务器端和客户端的安装包没有什么不同。在发行版的官方仓库中都有 NTP 安装包,因此可以使用发行版的包管理器安装它。 -### NTP服务端: 如何在Linux上安装NTP? - -因为它是c/s架构,所以NTP服务端和客户端的安装包没有什么不同。在发行版的官方仓库中都有NTP安装包,因此可以使用发行版的包管理器安装它。 - -对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装ntp. +对于 Fedora 系统,使用 [DNF 命令][2] 去安装 ntp。 ``` $ sudo dnf install ntp ``` -对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装 ntp. +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或者 [APT 命令][4] 去安装 ntp。 ``` -$ +$ sudo apt install ntp ``` -对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装 ntp. +对基于 Arch Linux 的系统,使用 [Pacman 命令][5] 去安装 ntp。 ``` $ sudo pacman -S ntp ``` -对 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装 ntp. +对 RHEL/CentOS 系统,使用 [YUM 命令][6] 去安装 ntp。 ``` $ sudo yum install ntp ``` -对于 **`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装 ntp. +对于 openSUSE Leap 系统,使用 [Zypper 命令][7] 去安装 ntp。 ``` $ sudo zypper install ntp ``` -### 如何在Linux上配置NTP服务? +### 如何在 Linux 上配置 NTP 服务器? -安装NTP软件包后,请确保在服务器端的`/etc/ntp.conf`文件中,必须取消以下配置的注释。 +安装 NTP 软件包后,请确保在服务器端的 `/etc/ntp.conf` 文件中取消以下配置的注释。 -默认情况下,NTP服务器配置依赖于`X.distribution_name.pool.ntp.org`。 如果有必要,可以使用默认配置,也可以访问站点,根据你所在的位置(特定国家/地区)进行更改。 +默认情况下,NTP 服务器配置依赖于 `X.distribution_name.pool.ntp.org`。 如果有必要,可以使用默认配置,也可以访问站点,根据你所在的位置(特定国家/地区)进行更改。 -比如说如果你在印度,然后你的NTP服务器将是`0.in.pool.ntp.org`,并且这个地址适用于大多数国家。 +比如说如果你在印度,然后你的 NTP 服务器将是 `0.in.pool.ntp.org`,并且这个地址适用于大多数国家。 ``` # vi /etc/ntp.conf @@ -113,71 +103,72 @@ driftfile /var/lib/ntp/drift keys /etc/ntp/keys ``` -我们仅允许`192.168.1.0/24`子网的客户端访问NTP服务器。 +我们仅允许 `192.168.1.0/24` 子网的客户端访问这个 NTP 服务器。 -由于默认情况下基于RHEL7的发行版的防火墙是打开的,因此允许ntp服务通过。 +由于默认情况下基于 RHEL7 的发行版的防火墙是打开的,因此要允许 ntp 服务通过。 ``` # firewall-cmd --add-service=ntp --permanent # firewall-cmd --reload ``` -更新配置后重启服务。 +更新配置后要重启服务: -对于基于Debian的sysvinit系统,我们需要去运行`ntp`而不是`ntpd`。 +对于 sysvinit 系统。基于 Debian 的系统需要去运行 `ntp` 而不是 `ntpd`。 ``` # service ntpd restart - # chkconfig ntpd on ``` -对于基于Debian的systemctl系统,我们需要去运行`ntp`和`ntpd`。 + +对于 systemctl 系统。基于 Debian 的需要去运行 `ntp` 和 `ntpd`。 ``` # systemctl restart ntpd - # systemctl enable ntpd ``` -### NTP客户端:如何在Linux上安装NTP客户端? +### NTP 客户端:如何在 Linux 上安装 NTP 客户端? -正如我在这篇文章中前面所说的。NTP服务端和客户端的安装包没有什么不同。因此在客户端上也安装同样的软件包。 +正如我在这篇文章中前面所说的。NTP 服务器端和客户端的安装包没有什么不同。因此在客户端上也安装同样的软件包。 -对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装ntp. +对于 Fedora 系统,使用 [DNF 命令][2] 去安装 ntp。 ``` $ sudo dnf install ntp ``` -对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装 ntp. +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或者 [APT 命令][4] 去安装 ntp。 ``` -$ +$ sudo apt install ntp ``` -对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装 ntp. +对基于 Arch Linux 的系统,使用 [Pacman 命令][5] 去安装 ntp。 ``` $ sudo pacman -S ntp ``` -对 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装 ntp. +对 RHEL/CentOS 系统,使用 [YUM 命令][6] 去安装 ntp。 ``` $ sudo yum install ntp ``` -对于 **`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装 ntp. +对于 openSUSE Leap 系统,使用 [Zypper 命令][7] 去安装 ntp。 ``` $ sudo zypper install ntp ``` -我已经在`CentOS7.2daygeek.com`这台主机上安装和配置了NTP服务器,因此将其附加到所有的客户端机器上。 +我已经在 CentOS7.2daygeek.com` 这台主机上安装和配置了 NTP 服务器,因此将其附加到所有的客户端机器上。 ``` # vi /etc/ntp.conf +``` +``` restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 @@ -187,26 +178,25 @@ driftfile /var/lib/ntp/drift keys /etc/ntp/keys ``` -更新配置后重启服务。 +更新配置后重启服务: -对于基于Debian的sysvinit系统,我们需要去运行`ntp`而不是`ntpd`。 +对于 sysvinit 系统。基于 Debian 的系统需要去运行 `ntp` 而不是 `ntpd`。 ``` # service ntpd restart - # chkconfig ntpd on ``` -对于基于Debian的systemctl系统,我们需要去运行`ntp`和`ntpd`。 + +对于 systemctl 系统。基于 Debian 的需要去运行 `ntp` 和 `ntpd`。 ``` # systemctl restart ntpd - # systemctl enable ntpd ``` -重新启动NTP服务后等待几分钟以便从NTP服务器获取同步的时间。 +重新启动 NTP 服务后等待几分钟以便从 NTP 服务器获取同步的时间。 -在Linux上运行下列命令去验证NTP服务的同步状态。 +在 Linux 上运行下列命令去验证 NTP 服务的同步状态。 ``` # ntpq –p @@ -218,7 +208,7 @@ keys /etc/ntp/keys *CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 ``` -运行下列命令去得到ntpd的当前状态。 +运行下列命令去得到 ntpd 的当前状态。 ``` # ntpstat @@ -227,14 +217,14 @@ synchronised to NTP server (192.168.1.8) at stratum 3 polling server every 64 s ``` -最后运行`date`命令。 +最后运行 `date` 命令。 ``` # date Tue Mar 26 23:17:05 CDT 2019 ``` -如果你观察到NTP中输出的偏移很大。运行下列命令从NTP服务器手动同步时钟。当你执行下列命令的时候,确保你的NTP客户端应该为未激活状态。 +如果你观察到 NTP 中输出的时间偏移很大。运行下列命令从 NTP 服务器手动同步时钟。当你执行下列命令的时候,确保你的 NTP 客户端应该为未活动状态。(LCTT 译注:当时间偏差很大时,客户端的自动校正需要花费很长时间才能逐步追上,因此应该手动运行以更新) ``` # ntpdate –uv CentOS7.2daygeek.com @@ -247,7 +237,7 @@ via: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[arrowfeng](https://github.com/arrowfeng) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bca32da7ba195f68a25d20491e8c5faed25b5eda Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 13:40:40 +0800 Subject: [PATCH 0248/1154] PUB:20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @arrowfeng https://linux.cn/article-10811-1.html --- ...nstall And Configure NTP Server And NTP Client In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md (99%) diff --git a/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/published/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md similarity index 99% rename from translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md rename to published/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md index e3ca452105..4979e03dcb 100644 --- a/translated/tech/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md +++ b/published/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10811-1.html) [#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?) [#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 46b80ab8f3f238f2ddad82ee7454c0a71261cf20 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 14:24:29 +0800 Subject: [PATCH 0249/1154] PRF:20190401 What is 5G- How is it better than 4G.md @warmfrog --- ...01 What is 5G- How is it better than 4G.md | 109 +++++++++--------- 1 file changed, 52 insertions(+), 57 deletions(-) diff --git a/translated/tech/20190401 What is 5G- How is it better than 4G.md b/translated/tech/20190401 What is 5G- How is it better than 4G.md index 7465d4b495..3e16d4471c 100644 --- a/translated/tech/20190401 What is 5G- How is it better than 4G.md +++ b/translated/tech/20190401 What is 5G- How is it better than 4G.md @@ -1,130 +1,125 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: () [#]: subject: (What is 5G? How is it better than 4G?) [#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) [#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) -什么是 5G?它如何比 4G 更快? +什么是 5G?它比 4G 好在哪里? ========================== -### 5G 网络将使无限网络吞吐量提高 10 倍并且能够替代有线宽带。但是它们什么时候能够投入使用呢,为什么 5G 和物联网如此紧密地联系在一起呢? +> 5G 网络将使无线网络吞吐量提高 10 倍并且能够替代有线宽带。但是它们什么时候能够投入使用呢,为什么 5G 和物联网如此紧密地联系在一起呢? ![Thinkstock][1] -[5G 无线][2] 是一个概括的术语,用来描述一系列更快的无线网络的标准和技术,理想上比 4G 快了 20 倍并且延迟降低了 120 倍,为物联网的发展和对新高带宽应用的支持奠定了基础。 +[5G 无线][2] 是一个概括的术语,用来描述一系列更快的无线互联网的标准和技术,理论上比 4G 快了 20 倍并且延迟降低了 120 倍,为物联网的发展和对新的高带宽应用的支持奠定了基础。 -## 什么是 5G?科技还是流行词? +### 什么是 5G?科技还是流行词? -技术在世界范围内完全发挥它的潜能需要数年时间,但同时当今一些 5G 网络服务已经投入使用。5G 不仅是一个技术术语,也是一个营销术语,并不是市场上的所有 5G 服务是标准的。 +这个技术在世界范围内完全发挥它的潜能还需要数年时间,但同时当今一些 5G 网络服务已经投入使用。5G 不仅是一个技术术语,也是一个营销术语,并不是市场上的所有 5G 服务是标准的。 -**[来自世界移动大会:[The time of 5G is almost here][3].]** +- [来自世界移动大会:[5G 时代即将来到][3]] -## 5G 速度 vs 4G +### 5G 与 4G 的速度对比 -无线技术的每一代,最大的呼吁是增加速度。5G 网络潜在的的峰值下载速度达到[20 Gbps,一般在 10 Gbps][4]。这不仅仅是比当前 4G 网络更快,4G 目前峰值大约 1 Gbps,并且比更多家庭的有线网络连接更快。5G 提供的网络速度能够与光纤一较高下。 +无线技术的每一代,最大的呼吁是增加速度。5G 网络潜在的峰值下载速度可以达到[20 Gbps,一般在 10 Gbps][4]。这不仅仅比当前 4G 网络更快,4G 目前峰值大约 1 Gbps,并且比更多家庭的有线网络连接更快。5G 提供的网络速度能够与光纤一较高下。 -吞吐量不是 5G 仅有的速度提升;它还有的特点是极大降低了网络延迟*。* 这是一个重要的区分:吞吐量用来测量花费多久来下载一个大文件,而延迟由网络瓶颈决定,延迟在来回的沟通中减慢了响应速度。 +吞吐量不是 5G 仅有的速度提升;它还有的特点是极大降低了网络延迟。这是一个重要的区分:吞吐量用来测量花费多久来下载一个大文件,而延迟由网络瓶颈决定,延迟在往返的通讯中减慢了响应速度。 -延迟很难量化,因为它在无数的网络状态中变化,但是 5G 网络在理想情况下有能力使延迟率在 1 ms 内。总的来说,5G 延迟将比 4G 降低 60 到 120 倍。这会使很多应用变得可能,例如当前虚拟现实的延迟使它变得不实际。 +延迟很难量化,因为它因各种网络状态变化而变化,但是 5G 网络在理想情况下有能力使延迟率在 1 ms 内。总的来说,5G 延迟将比 4G 降低 60 到 120 倍。这会使很多应用变得可能,例如当前虚拟现实的延迟使它变得不实际。 -## 5G 技术 +### 5G 技术 -5G 技术的基础有一系列标准定义,在过去的 10 年里一直在研究更好的部分。这些里面最重要的是 5G New Radio,或者 5G NR*,* 由 3GPP(一个为移动电话开发协议的标准化组织) 组织标准化。5G NR 规定了很多 5G 设备操作的方式,于 2018 年 7 月 完成终版。 - -**[[从 PluralSight 上移动设备管理的课程并且学习如何在你的公司在不降低用户体验的情况下保护设备][6]]** +5G 技术的基础有一系列标准定义,在过去的 10 年里一直在研究更好的部分。这些里面最重要的是 5G New Radio(5G NR),由 3GPP(一个为移动电话开发协议的标准化组织)组织标准化。5G NR 规定了很多 5G 设备操作的方式,[于 2018 年 7 月 完成终版][5]。 很多独特的技术同时出现来尽可能地提升 5G 的速度并降低延迟,下面是一些重要的。 -## 毫米波 +### 毫米波 -5G 网络大部分使用在 30 到 300 GHz 范围的频率。(正如名称一样,这些频率的波长在 1 到 10 毫米之间)这些高频范围能够[在每个时间单元比低频信号携带更多的信息][7],4G 当前使用的就是通常频率在 1 GHz 以下的低频信号,或者 WiFi,最高 6 GHz。 +5G 网络大部分使用在 30 到 300 GHz 范围的频率。(正如名称一样,这些频率的波长在 1 到 10 毫米之间)这些高频范围能够[在每个时间单元比低频信号携带更多的信息][7],4G LTE 当前使用的就是通常频率在 1 GHz 以下的低频信号,或者 WiFi,最高 6 GHz。 -毫米波技术传统上是昂贵并且难于部署的。科技进步已经克服了这些困难,这也是 5G 在如今成为了可能。 +毫米波技术传统上是昂贵并且难于部署的。科技进步已经克服了这些困难,这也是 5G 在如今成为了可能的原因。 -## 小的单元 +### 小蜂窝 -毫米波传输的一个缺点是当他们传输通过物理对象的时候更容易被干扰。 +毫米波传输的一个缺点是当它们传输通过物理对象的时候比 4G 或 WiFi 信号更容易被干扰。 -为了克服这些,5G 基础设施的模型将不同于 4G。替代了大的移动天线桅杆,我们开始接受作为景观的一部分,5G 网络将由[穿越城市大概间距 250 米的更小的基站]提供支持,创建更小的服务区域。 +为了克服这些,5G 基础设施的模型将不同于 4G。替代了大的像景观一样移动天线桅杆,5G 网络将由[分布在城市中大概间距 250 米的更小的基站][8]提供支持,创建更小的服务区域。 -## 大量的 MIMO +这些 5G 基站的功率要求低于 4G,并且可以更容易地连接到建筑物和电线杆上。 -尽管 5G 基站比 4G 的对应部分小多了,但他们却打包了更多的天线。这些天线是[多输入多输出的(MIMO)][9],意味着在相同的数据信道能够同时处理多个双向会话。5G 网络能够处理比 4G 网络超过 20 倍的会话。 +### 大量的 MIMO -大量的 MIMO 保证了[基站容量限制下的彻底的提升],允许单个基站承载更多的设备会话。这就是 5G 可能推动物联网更广泛应用的原因。理论上,更多的网络连接的无限设备能够部署在相同的空间而不会使网络被压垮。 +尽管 5G 基站比 4G 的对应部分小多了,但它们却带了更多的天线。这些天线是[多输入多输出的(MIMO)][9],意味着在相同的数据信道能够同时处理多个双向会话。5G 网络能够处理比 4G 网络超过 20 倍的会话。 -## 波束成形 +大量的 MIMO 保证了[基站容量限制下的极大提升][10],允许单个基站承载更多的设备会话。这就是 5G 可能推动物联网更广泛应用的原因。理论上,更多的连接到互联网的无线设备能够部署在相同的空间而不会使网络被压垮。 + +### 波束成形 确保所有的会话来回地到达正确的地方是比较棘手的,尤其是前面提到的毫米波信号的干涉问题。为了克服这些问题,5G 基站部署了更高级的波束技术,使用建设性和破坏性的无线电干扰来使信号有向而不是广播。这在一个特定的方向上有效地加强了信号强度和范围。 -## 5G 可获得性 +### 5G 可获得性 -第一个 5G 商用网络 [2018 年 5 月在卡塔尔推出][12]。自那以后,网络已经扩展到全世界,从阿根廷到越南。[Lifewire 有一个不错的,经常更新的列表][13]. +第一个 5G 商用网络 [2018 年 5 月在卡塔尔推出][12]。自那以后,5G 网络已经扩展到全世界,从阿根廷到越南。[Lifewire 有一个不错的,经常更新的列表][13]. -牢记一点的是,尽管这样,目前不是所有的 5G 网络都履行了所有的技术承诺。一些早期的 5G 产品依赖于现有的 4G 基础设施,减少了可以获得的潜在速度;其他服务为了市场目的标榜 5G 但是并不符合标准。仔细观察美国无限运营商的产品都会表现出一些陷阱。 +牢记一点的是,尽管这样,目前不是所有的 5G 网络都履行了所有的技术承诺。一些早期的 5G 产品依赖于现有的 4G 基础设施,减少了可以获得的潜在速度;其它服务为了市场目的而标榜 5G 但是并不符合标准。仔细观察美国无线运营商的产品都会发现一些陷阱。 -## 无线运营商和 5G +### 无线运营商和 5G 技术上讲,5G 服务如今在美国已经可获得了。但声明中包含的注意事项因运营商而异,表明 5G 普及之前还有很长的路要走。 -Verizon 可能是早期 5G 最大的推动者。它宣告到 2018 年 10 月 将有 4 个城市成为 [5G 家庭][14]的一部分, 一项需要你的其他设备通过 WiFi 来连接特定的 5G 热点,由热点连接到网络服务。 +Verizon 可能是早期 5G 最大的推动者。它宣告到 2018 年 10 月 将有 4 个城市成为 [5G 家庭][14]的一部分,这是一项需要你的其他设备通过 WiFi 来连接特定的 5G 热点,由热点连接到网络的服务。 -Verizon 计划四月在 Minneapolis 和 Chicago 首次展示 5G 移动服务,该服务将在这一年内传播到其他城市。访问 5G 网络将会花费消费者每月额外的费用加上购买能够实际访问 5G 的手机花费(稍后会详细介绍)。作为附加,Verizon 的部署被称作 [5G TF][16],实际上不符合 5G NR 的标准。 +Verizon 计划四月在 [Minneapolis 和 Chicago 发布 5G 移动服务][15],该服务将在这一年内传播到其他城市。访问 5G 网络将需要消费者每月额外花费费用,加上购买能够实际访问 5G 的手机花费(稍后会详细介绍)。另外,Verizon 的部署被称作 [5G TF][16],实际上不符合 5G NR 的标准。 -AT&T [声明在 2018 年 12 月将有美国的 12 个城市可以使用 5G][17],在 2019 年的末尾将增加 9 个城市,但最终在这些城市里,只有商业区能够访问。为了访问 5G 网络,需要一个特定的 Netgear 热点来连接到 5G 服务,然后为手机和其他设备提供一个 Wi-Fi 信号。 +AT&T [声明在 2018 年 12 月将有美国的 12 个城市可以使用 5G][17],在 2019 年的末尾将增加 9 个城市,但最终在这些城市里,只有市中心商业区能够访问。为了访问 5G 网络,需要一个特定的 Netgear 热点来连接到 5G 服务,然后为手机和其他设备提供一个 Wi-Fi 信号。 -与此同时,AT&T 也在推出 4G 网络的速度提升计划,被成为 5GE,即使这些提升和 5G 网络没有关系。([这会向后兼容][18]。) +与此同时,AT&T 也在推出 4G 网络的速度提升计划,被成为 5GE,即使这些提升和 5G 网络没有关系。([这会向后兼容][18]) Sprint 将在 2019 年 5 月之前在四个城市提供 5G 服务,在年末将有更多。但是 Sprint 的 5G 产品充分利用了 MIMO 单元,他们[没有使用毫米波信道][19],意味着 Sprint 的用户不会看到像其他运营商一样的速度提升。 -T-Mobile 追求一个相似的模型,它[在 2019 年年底之前不会推出 5G 服务][20]因为他们没有手机能够连接到它。 +T-Mobile 采用相似的模型,它[在 2019 年年底之前不会推出 5G 服务][20],因为他们没有手机能够连接到它。 -一个障碍可能阻止 5G 速度的迅速传播是需要铺开所有这些小的单元基站。他们小的尺寸和较低的功耗需求使它们技术上比 4G 技术更容易部署,但这不意味着它能够很简单的使政府和财产拥有者信服来到处安装一堆基站。Verizon 实际上建立了[向本地民选官员请愿的网站][21]来加速 5G 基站的部署。 +一个可能阻止 5G 速度的迅速传播的障碍是需要铺开所有这些小蜂窝基站。它们小的尺寸和较低的功耗需求使它们技术上比 4G 技术更容易部署,但这不意味着它能够很简单的使政府和财产拥有者信服到处安装一堆基站。Verizon 实际上建立了[向本地民选官员请愿的网站][21]来加速 5G 基站的部署。 -## ** 5G 手机:何时可获得?何时可以买?** +### 5G 手机:何时可获得?何时可以买? -第一部声称为 5G 手机的是 Samsung Galaxy S10 5G,将在 2019 年夏末首发。你可以从 Verizon 订阅一个“[Moto Mod][22]”,用来[转换 Moto Z3 手机为 5G 兼容设备][23]。 +第一部声称为 5G 手机的是 Samsung Galaxy S10 5G,将在 2019 年夏末首发。你也可以从 Verizon 订阅一个“[Moto Mod][22]”,用来[转换 Moto Z3 手机为 5G 兼容设备][23]。 -但是除非你不能忍受作为一个早期使用者的诱惑,你会希望再等待一下;一些奇怪和隐约的关于运营商的问题意味着可能你的手机[不兼容你的运营商的整个 5G 网络][24]。 +但是除非你不能忍受作为一个早期使用者的诱惑,你会希望再等待一下;一些关于运营商的奇怪和突显的问题意味着可能你的手机[不兼容你的运营商的整个 5G 网络][24]。 -一个可能令你吃惊的落后者是苹果:分析者坚信最早直到 2020 年以前 iPhone 不会与 5G 兼容。但这符合该公司的特点;苹果在 2012 年末也落后于三星发布兼容 4G 的手机。 +一个可能令你吃惊的落后者是苹果:分析者确信最早直到 2020 年以前 iPhone 不会与 5G 兼容。但这符合该公司的特点;苹果在 2012 年末也落后于三星发布兼容 4G 的手机。 不可否认,5G 洪流已经到来。5G 兼容的设备[在 2019 年统治了巴塞罗那世界移动大会][3],因此期待视野里有更多的选择。 -## 为什么人们已经在讨论 6G 了? +### 为什么人们已经在讨论 6G 了? 一些专家说缺点是[5G 不能够达到延迟和可靠性的目标][27]。这些完美主义者已经在探寻 6G,来试图解决这些缺点。 -这是一个[研究新的能够融入 6G 技术的小组],它们自称 - -The Center for Converged TeraHertz Communications and Sensing (ComSenTer)。根据说明,他们努力让每个设备的带宽达到 100Gbps。 +有一个[研究新的能够融入 6G 技术的小组][28],自称为“融合 TeraHertz 通信与传感中心”(ComSenTer)。根据说明,他们努力让每个设备的带宽达到 100Gbps。 除了增加可靠性,还突破了可靠性并增加速度,6G 同样试图允许上千的并发连接。如果成功的话,这个特点将帮助物联网设备联网,使在工业设置中部署上千个传感器。 -即使仍在胚胎当中,6G 已经由于新发现的 [tera-hretz 中基于网络的潜在的中间人攻击][29]的紧迫性面临安全的考虑。好消息是有大量时间来解决这个问题。6G 网络直到 2030 之前才可能出现。 +即使仍在胚胎当中,6G 已经由于新发现的 [在基于 tera-hretz 的网络中潜在的中间人攻击][29]的紧迫性面临安全的考虑。好消息是有大量时间来解决这个问题。6G 网络直到 2030 之前才可能出现。 -**阅读更多关于 5G 网络:** +阅读更多关于 5G 网络: - * [How enterprises can prep for 5G networks][30] - * [5G vs 4G: How speed, latency and apps support differ][31] - * [Private 5G networks are coming][32] - * [5G and 6G wireless have security issues][33] - * [How millimeter-wave wireless could help support 5G and IoT][34] - - -在 [Facebook][35] 和 [LinkedIn][36] 上加入网络世界社区来评论当前最热门的话题。 + * [企业如何为 5G 网络做准备][30] + * [5G 与 4G:速度、延迟和应用支持的差异][31] + * [私人 5G 网络即将到来][32] + * [5G 和 6G 无线存在安全问题][33] + * [毫米波无线技术如何支持 5G 和物联网][34] -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all +via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html 作者:[Josh Fruhlinger][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 117e2f3f4902407a95b94c0f4e564db582031d2f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 14:25:04 +0800 Subject: [PATCH 0250/1154] PUB:20190401 What is 5G- How is it better than 4G.md @warmfrog https://linux.cn/article-10812-1.html --- .../20190401 What is 5G- How is it better than 4G.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {translated/tech => published}/20190401 What is 5G- How is it better than 4G.md (99%) diff --git a/translated/tech/20190401 What is 5G- How is it better than 4G.md b/published/20190401 What is 5G- How is it better than 4G.md similarity index 99% rename from translated/tech/20190401 What is 5G- How is it better than 4G.md rename to published/20190401 What is 5G- How is it better than 4G.md index 3e16d4471c..a54eadbd7b 100644 --- a/translated/tech/20190401 What is 5G- How is it better than 4G.md +++ b/published/20190401 What is 5G- How is it better than 4G.md @@ -2,7 +2,7 @@ [#]: translator: (warmfrog) [#]: reviewer: (wxy) [#]: publisher: (wxy) -[#]: url: () +[#]: url: (https://linux.cn/article-10812-1.html) [#]: subject: (What is 5G? How is it better than 4G?) [#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) [#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) From 0e714f0e5cb5b1cb54228f43a717061023bcae70 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 14:49:47 +0800 Subject: [PATCH 0251/1154] PRF:20190422 8 environment-friendly open software projects you should know.md @geekpi --- ... open software projects you should know.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190422 8 environment-friendly open software projects you should know.md b/translated/tech/20190422 8 environment-friendly open software projects you should know.md index 9d5378ddc2..79030be11d 100644 --- a/translated/tech/20190422 8 environment-friendly open software projects you should know.md +++ b/translated/tech/20190422 8 environment-friendly open software projects you should know.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (8 environment-friendly open software projects you should know) @@ -9,26 +9,28 @@ 8 个你应该了解的环保开源项目 ====== -通过给这些致力于提升环境的项目做贡献来庆祝地球日。 + +> 通过给这些致力于提升环境的项目做贡献来庆祝地球日。 + ![][1] -在过去的几年里,我一直在帮助 [Greenpeace][2] 建立其第一个完全开源的项目,Planet 4. [Planet 4][3] 是一个全球参与平台,Greenpeace 的支持者和活动家可以互动并参与组织。它的目标是让人们代表我们的星球采取行动。我们希望邀请参与并利用人力来应对气候变化和塑料污染等全球性问题。它们正在寻找开发者、设计师、作者、贡献者和其他通过开源支持环保主义的人都非常欢迎[参与进来][4]! +在过去的几年里,我一直在帮助 [Greenpeace][2] 建立其第一个完全开源的软件项目,Planet 4. [Planet 4][3] 是一个全球参与平台,Greenpeace 的支持者和活动家可以互动并参与组织。它的目标是让人们代表我们的星球采取行动。我们希望邀请参与并利用人力来应对气候变化和塑料污染等全球性问题。开发者、设计师、作者、贡献者和其他通过开源支持环保主义的人都非常欢迎[参与进来][4]! Planet 4 远非唯一关注环境的开源项目。对于地球日,我会分享其他七个关注我们星球的开源项目。 -**[Eco Hacker Farm][5]** 致力于支持可持续社区。它建议并支持将黑客空间/黑客基地和永续农业生活结合在一起的项目。该组织还有在线项目。访问其 [wiki][6] 或 [Twitter][7] 了解有关 Eco Hacker Farm 正在做的更多信息。 +[Eco Hacker Farm][5] 致力于支持可持续社区。它建议并支持将黑客空间/黑客基地和永续农业生活结合在一起的项目。该组织还有在线项目。访问其 [wiki][6] 或 [Twitter][7] 了解有关 Eco Hacker Farm 正在做的更多信息。 -**[Public Lab][8]** 是一个开放社区和非营利组织,它致力于将科学掌握在公民手中。它于 2010 年在 BP 石油灾难后形成,Public Lab 与开源合作,协助环境勘探和调查。它是一个多元化的社区,有很多方法可以做[贡献][9]。 +[Public Lab][8] 是一个开放社区和非营利组织,它致力于将科学掌握在公民手中。它于 2010 年在 BP 石油灾难后形成,Public Lab 与开源合作,协助环境勘探和调查。它是一个多元化的社区,有很多方法可以做[贡献][9]。 -不久前,Opensource.com 的管理 Don Watkins 撰写了一篇 **[Open Climate Workbench][10]** 的文章,该项目来自 Apache 基金会。 [OCW][11] 提供了进行气候建模和评估的软件,可用于各种应用。 +不久前,Opensource.com 的社区管理者 Don Watkins 撰写了一篇 [Open Climate Workbench][10] 的文章,该项目来自 Apache 基金会。 [OCW][11] 提供了进行气候建模和评估的软件,可用于各种应用。 -**[Open Source Ecology][12]** 是一个旨在改善经济运作方式的项目。该项目着眼于环境再生和社会公正,它旨在重新定义我们的一些肮脏的生产和分配技术,以创造一个更可持续的文明。 +[Open Source Ecology][12] 是一个旨在改善经济运作方式的项目。该项目着眼于环境再生和社会公正,它旨在重新界定我们的一些肮脏的生产和分配技术,以创造一个更可持续的文明。 -促进开源和大数据工具之间的合作,以实现海洋、大气、土地和气候的研究,“ **[Pangeo][13]** 是第一个推广开放、可重复和可扩展科学的社区。”大数据可以改变世界! +促进开源和大数据工具之间的合作,以实现海洋、大气、土地和气候的研究,“ [Pangeo][13] 是第一个推广开放、可重复和可扩展科学的社区。”大数据可以改变世界! -**[Leaflet][14]** 是一个著名的开源 JavaScript 库。它可以做各种各样的事情,包括环保项目,如 [Arctic Web Map][15],它能让科学家准确地可视化和分析北极地区,这是气候研究的关键能力。 +[Leaflet][14] 是一个著名的开源 JavaScript 库。它可以做各种各样的事情,包括环保项目,如 [Arctic Web Map][15],它能让科学家准确地可视化和分析北极地区,这是气候研究的关键能力。 -当然,没有我在 Mozilla 的朋友就没有这个列表(不是这个完整的列表!)。**[Mozilla Science Lab][16]** 社区就像所有 Mozilla 项目一样,非常开放,它致力于将开源原则带给科学界。它的项目和社区使科学家能够进行我们世界所需的各种研究,以解决一些最普遍的环境问题。 +当然,没有我在 Mozilla 的朋友就没有这个列表(这不是个完整的列表!)。[Mozilla Science Lab][16] 社区就像所有 Mozilla 项目一样,非常开放,它致力于将开源原则带给科学界。它的项目和社区使科学家能够进行我们世界所需的各种研究,以解决一些最普遍的环境问题。 ### 如何贡献 @@ -41,7 +43,7 @@ via: https://opensource.com/article/19/4/environment-projects 作者:[Laura Hilliger][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/) 荣誉推出 From 921e0044a71380c908a2ea10f279d7746b407633 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 May 2019 14:50:15 +0800 Subject: [PATCH 0252/1154] PUB:20190422 8 environment-friendly open software projects you should know.md @geekpi https://linux.cn/article-10814-1.html --- ...ronment-friendly open software projects you should know.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190422 8 environment-friendly open software projects you should know.md (98%) diff --git a/translated/tech/20190422 8 environment-friendly open software projects you should know.md b/published/20190422 8 environment-friendly open software projects you should know.md similarity index 98% rename from translated/tech/20190422 8 environment-friendly open software projects you should know.md rename to published/20190422 8 environment-friendly open software projects you should know.md index 79030be11d..5233688a65 100644 --- a/translated/tech/20190422 8 environment-friendly open software projects you should know.md +++ b/published/20190422 8 environment-friendly open software projects you should know.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10814-1.html) [#]: subject: (8 environment-friendly open software projects you should know) [#]: via: (https://opensource.com/article/19/4/environment-projects) [#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger) From ce60e8dbeefa32660982ffa7decb03437ac39725 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Sat, 4 May 2019 21:29:45 +0800 Subject: [PATCH 0253/1154] translated --- ...tall And Configure Chrony As NTP Client.md | 86 ++++++++++--------- 1 file changed, 44 insertions(+), 42 deletions(-) rename {sources => translated}/tech/20190409 How To Install And Configure Chrony As NTP Client.md (55%) diff --git a/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md b/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md similarity index 55% rename from sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md rename to translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md index 3988cda330..bd9ddaf2ef 100644 --- a/sources/tech/20190409 How To Install And Configure Chrony As NTP Client.md +++ b/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md @@ -7,84 +7,84 @@ [#]: via: (https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -How To Install And Configure Chrony As NTP Client? +如何正确安装和配置Chrony作为NTP客户端? ====== -The NTP server and NTP client allow us to sync the clock across the network. +NTP服务器和NTP客户端运行我们通过网络来同步时钟。 -We had written an article about **[NTP server and NTP client installation and configuration][1]** in the past. +在过去,我们已经撰写了一篇关于 **[NTP服务器和NTP客户端的安装与配置][1]** 的文章。 -If you would like to check these, navigate to the above URL. +如果你想看这些内容,点击上述的URL访问。 -### What Is Chrony Client? +### 什么是Chrony客户端? -Chrony is replacement of NTP client. +Chrony是NTP客户端的替代品。 -It can synchronize the system clock faster with better time accuracy and it can be particularly useful for the systems which are not online all the time. +它能以更精确的时间和更快的速度同步时钟,并且它对于那些不是全天候在线的系统非常有用。 -chronyd is smaller, it uses less memory and it wakes up the CPU only when necessary, which is better for power saving. +chronyd更小、更省电,它占用更少的内存且仅当需要时它才唤醒CPU。 -It can perform well even when the network is congested for longer periods of time. +即使网络拥塞较长时间,它也能很好地运行。 -It supports hardware timestamping on Linux, which allows extremely accurate synchronization on local networks. +它支持Linux上的硬件时间戳,允许在本地网络进行极其准确的同步。 -It offers following two services. +它提供下列两个服务。 - * **`chronyc:`** Command line interface for chrony. - * **`chronyd:`** Chrony daemon service. + * **`chronyc:`** Chrony的命令行接口。 + * **`chronyd:`** Chrony守护进程服务。 -### How To Install And Configure Chrony In Linux? +### 如何在Linux上安装和配置Chrony? -Since the package is available in most of the distributions official repository. So, use the package manager to install it. +由于安装包在大多数发行版的官方仓库中可用,因此直接使用包管理器去安装它。 -For **`Fedora`** system, use **[DNF Command][2]** to install chrony. +对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装chrony. ``` $ sudo dnf install chrony ``` -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install chrony. +对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装chrony. ``` $ sudo apt install chrony ``` -For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install chrony. +对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装chrony. ``` $ sudo pacman -S chrony ``` -For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install chrony. +对于 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装chrony. ``` $ sudo yum install chrony ``` -For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install chrony. +对于**`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装chrony. ``` $ sudo zypper install chrony ``` -In this article, we are going to use the following setup to test this. +在这篇文章中,我们将使用下列设置去测试。 - * **`NTP Server:`** HostName: CentOS7.2daygeek.com, IP:192.168.1.5, OS:CentOS 7 - * **`Chrony Client:`** HostName: Ubuntu18.2daygeek.com, IP:192.168.1.3, OS:Ubuntu 18.04 + * **`NTP服务器:`** 主机名: CentOS7.2daygeek.com, IP:192.168.1.5, OS:CentOS 7 + * **`Chrony客户端:`** 主机名: Ubuntu18.2daygeek.com, IP:192.168.1.3, OS:Ubuntu 18.04 +导航到 **[在Linux上安装和配置NTP服务器][1]** 的URL。 -Navigate to the following URL for **[NTP server installation and configuration in Linux][1]**. -I have installed and configured the NTP server on `CentOS7.2daygeek.com` so, append the same into all the client machines. Also, include the other required information on it. +我已经在`CentOS7.2daygeek.com`这台主机上安装和配置了NTP服务器,因此,将其附加到所有的客户端机器上。此外,还包括其他所需信息。 -The `chrony.conf` file will be placed in the different locations based on your distribution. +`chrony.conf`文件的位置根据你的发行版不同而不同。 -For RHEL based systems, it’s located at `/etc/chrony.conf`. +对基于RHEL的系统,它位于`/etc/chrony.conf`。 -For Debian based systems, it’s located at `/etc/chrony/chrony.conf`. +对基于Debian的系统,它位于`/etc/chrony/chrony.conf`。 ``` # vi /etc/chrony/chrony.conf @@ -98,27 +98,28 @@ makestep 1 3 cmdallow 192.168.1.0/24 ``` -Bounce the Chrony service once you update the configuration. +更新配置后需要重启Chrony服务。 -For sysvinit systems. For RHEL based system we need to run `chronyd` instead of chrony. +对于sysvinit系统。基于RHEL的系统需要去运行`chronyd`而不是chrony。 ``` -# service chrony restart +# service chronyd restart -# chkconfig chrony on +# chkconfig chronyd on ``` -For systemctl systems. For RHEL based system we need to run `chronyd` instead of chrony. +对于systemctl系统。 基于RHEL的系统需要去运行`chronyd`而不是chrony。 ``` -# systemctl restart chrony +# systemctl restart chronyd -# systemctl enable chrony +# systemctl enable chronyd ``` -Use the following commands like tacking, sources and sourcestats to check chrony synchronization details. +使用像tacking,sources和sourcestats这样的命令去检查chrony的同步细节。 + +去检查chrony的跟踪状态。 -To check chrony tracking status. ``` # chronyc tracking @@ -137,7 +138,7 @@ Update interval : 2.0 seconds Leap status : Normal ``` -Run the sources command to displays information about the current time sources. +运行sources命令去显示当前时间源的信息。 ``` # chronyc sources @@ -147,7 +148,7 @@ MS Name/IP address Stratum Poll Reach LastRx Last sample ^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms ``` -The sourcestats command displays information about the drift rate and offset estimation process for each of the sources currently being examined by chronyd. +sourcestats命令显示有关chronyd当前正在检查的每个源的漂移率和偏移估计过程的信息。 ``` # chronyc sourcestats @@ -157,7 +158,7 @@ Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev CentOS7.2daygeek.com 5 3 71 -97.314 78.754 -469us 441us ``` -When chronyd is configured as an NTP client or peer, you can have the transmit and receive timestamping modes and the interleaved mode reported for each NTP source by the chronyc ntpdata command. +当chronyd配置为NTP客户端或对等端时,你就能通过chronyc ntpdata命令向每一个NTP源发送和接收时间戳模式和交错模式报告。 ``` # chronyc ntpdata @@ -190,13 +191,14 @@ Total RX : 46 Total valid RX : 46 ``` -Finally run the `date` command. +最后运行`date`命令。 ``` # date Thu Mar 28 03:08:11 CDT 2019 ``` +为了立即切换系统时钟,通过转换绕过任何正在进行的调整,请以root身份发出以下命令(手动调整系统时钟)。 To step the system clock immediately, bypassing any adjustments in progress by slewing, issue the following command as root (To adjust the system clock manually). ``` @@ -209,7 +211,7 @@ via: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[arrowfeng](https://github.com/arrowfeng) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 547f57ddc052fb577dc114cdac5e4dd4adf4814d Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sat, 4 May 2019 08:36:27 -0500 Subject: [PATCH 0254/1154] Apply for Translating (#13485) Apply for Translating --- ...An introduction to the DomTerm terminal emulator for Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md index 4553570166..84c45adc4f 100644 --- a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md +++ b/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md @@ -1,3 +1,4 @@ +tomjlw is translating An introduction to the DomTerm terminal emulator for Linux ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals.png?itok=CfBqYBah) From 758b6c6a8e3a9074a9c0f377c7ec064a7e394d1e Mon Sep 17 00:00:00 2001 From: bodhix Date: Sat, 4 May 2019 22:44:54 +0800 Subject: [PATCH 0255/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=86=85=E5=AE=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...A Network Interface Port (NIC) In Linux.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index 4a3d87a488..25aa9be835 100644 --- a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -10,21 +10,21 @@ Linux 中如何启用禁用网口? ====== -You may need to run these commands based on your requirements. +你可能会根据你的需要执行以下命令。 -I can tell you few examples, where you would be needed this. +举一些你会用到这些命令的例子。 当你添加一个网卡或者从一个物理网口创建出一个虚拟网口的时候,你可能需要使用这些命令将新网口启用起来。 -Also, if you made any changes or if it’s down then you need to run one of the below commands to bring them up. +除此之外,如果你对网口做了某些修改或者网口本身没有启用,那你也需要使用以下的某个命令将网口启用起来。 -It can be done on many ways and we would like to add best five method which we used in the article. +启用禁用网口有很多种方法。在这篇文章里,我们会介绍我们使用过的、最好的 5 种方法。 -It can be done using the below five methods. +启用禁用网口可以通过以下 5 个方法实现: * **`ifconfig 命令:`** ifconfig 命令用于配置网口。 它可以提供网口的很多信息。 * **`ifdown/up 命令:`** ifdown 命令用于禁用网口,ifup 命令用于启用网口。 - * **`ip 命令:`** ip 命令用于管理网口,用于替代老的、不推荐使用的 ifconfig 命令。它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 + * **`ip 命令:`** ip 命令用于管理网口,用于替代老旧的、不推荐使用的 ifconfig 命令。它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 * **`nmcli 命令:`** nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 * **`nmtui 命令:`** nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 @@ -54,7 +54,7 @@ It can be done using the below five methods. valid_lft forever preferred_lft forever ``` -### 1) 如何使用 ifconfig 命令启用禁用网口? +### 1、如何使用 ifconfig 命令启用禁用网口? ifconfig 命令用于配置网口。 @@ -71,7 +71,7 @@ ifconfig 的常用语法: # ifconfig enp0s3 down ``` -现在,从以下输出结果可以看到网口已经被禁用了。 +从以下输出结果可以看到网口已经被禁用了。 ``` # ip a | grep -A 1 "enp0s3:" @@ -85,7 +85,7 @@ ifconfig 的常用语法: # ifconfig enp0s3 up ``` -现在,从以下输出结果可以看到网口已经启用了。 +从以下输出结果可以看到网口已经启用了。 ``` # ip a | grep -A 5 "enp0s3:" @@ -97,7 +97,7 @@ ifconfig 的常用语法: valid_lft forever preferred_lft forever ``` -### 2) 如何使用 ifdown/up 命令启用禁用网口? +### 2、如何使用 ifdown/up 命令启用禁用网口? ifdown 命令用于禁用网口,ifup 命令用于启用网口。 @@ -114,7 +114,7 @@ ifdown/ifup 的常用语法: 执行以下命令禁用 `eth1` 网口。 ``` -# ifdown eth0 +# ifdown eth1 ``` 从以下输出结果可以看到网口已经被禁用了。 @@ -128,7 +128,7 @@ ifdown/ifup 的常用语法: 执行以下命令启用 `eth1` 网口。 ``` -# ifup eth0 +# ifup eth1 ``` 从以下输出结果可以看到网口已经启用了。 @@ -142,16 +142,16 @@ ifdown/ifup 的常用语法: valid_lft forever preferred_lft forever ``` -ifup 和 ifdown 不支持以 `enpXXX` 命名的新的网口。当我执行该命令的时候得到的结果如下: +ifup 和 ifdown 不支持以 `enpXXX` 命名的网口。当我执行该命令的时候得到的结果如下: ``` # ifdown enp0s8 Unknown interface enp0s8 ``` -### 3) 如何使用 ip 命令启用禁用网口? +### 3、如何使用 ip 命令启用禁用网口? -ip 命令用于管理网口,用于替代老的、不推荐使用的 ifconfig 命令。 +ip 命令用于管理网口,用于替代老旧的、不推荐使用的 ifconfig 命令。 它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 @@ -193,13 +193,13 @@ ip 的常用语法: valid_lft forever preferred_lft forever ``` -### 4) 如何使用 nmcli 命令启用禁用网口? +### 4、如何使用 nmcli 命令启用禁用网口? nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 它可以用做 nm-applet 或者其他图形化客户端的替代品。 nmcli 可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,还可以用来管理和展示网络设备状态。 -Run the following command to identify the interface name because nmcli command is perform most of the task using `profile name` instead of `device name`. +nmcli 命令大部分情况下都是使用`配置名称`工作而不是`设备名称`。所以,执行以下命令,获取网口对应的配置名称。【译者注:在使用 nmtui 或者 nmcli 管理网络连接的时候,可以为网络连接配置一个名称,就是这里提到的`配置名称(Profile name)`】 ``` # nmcli con show @@ -214,14 +214,14 @@ nmcli 的常用语法: # nmcli con Down/Up ``` -Run the following command to bring down the `enp0s3` interface in Linux. You have to give `profile name` instead of `device name` to bring down it. +执行以下命令禁用 `enp0s3` 网口。 在禁用网口的时候,你需要使用`配置名称`而不是`设备名称`。 ``` # nmcli con down 'Wired connection 1' Connection 'Wired connection 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6) ``` -Yes, the given interface is down now as per the following output. +从以下输出结果可以看到网口已经禁用了。 ``` # nmcli dev status @@ -231,14 +231,14 @@ enp0s3 ethernet disconnected -- lo loopback unmanaged -- ``` -Run the following command to bring down the `enp0s3` interface in Linux. You have to give `profile name` instead of `device name` to bring down it. +执行以下命令启用 `enp0s3` 网口。 同样的,这里你需要使用`配置名称`而不是`设备名称`。 ``` # nmcli con up 'Wired connection 1' Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7) ``` -Yes, the given interface is up now as per the following output. +从以下输出结果可以看到网口已经启用了。 ``` # nmcli dev status @@ -248,13 +248,13 @@ enp0s3 ethernet connected Wired connection 1 lo loopback unmanaged -- ``` -### 5) 如何使用 nmtui 命令启用禁用网口? +### 5、如何使用 nmtui 命令启用禁用网口? nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 -When starting nmtui, the user is prompted to choose the activity to perform unless it was specified as the first argument. +在启用 nmtui 的时候,如果第一个参数没有特别指定,它会引导用户选择对应的操作去执行。 -Run the following command launch the nmtui interface. Select “Active a connection” and hit “OK” +执行以下命令打开 mntui 界面。选择 “Active a connection” 然后点击 “OK”。 ``` # nmtui @@ -265,7 +265,7 @@ Run the following command launch the nmtui interface. Select “Active a connect 选择你要禁用的网口,然后点击 “Deactivate” 按钮。 [![][1]![][1]][3] -For activation do the same above procedure. +如果要启用网口,进行上述相同的步骤即可。 [![][1]![][1]][4] -------------------------------------------------------------------------------- From b71f9097640da9c46430860134ac3bfc62acdb9c Mon Sep 17 00:00:00 2001 From: bodhix Date: Sat, 4 May 2019 23:12:52 +0800 Subject: [PATCH 0256/1154] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=B9=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... A Network Interface Port (NIC) In Linux.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) rename {sources => translated}/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md (91%) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md similarity index 91% rename from sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md rename to translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index 25aa9be835..066e0d9a68 100644 --- a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -12,15 +12,13 @@ Linux 中如何启用禁用网口? 你可能会根据你的需要执行以下命令。 -举一些你会用到这些命令的例子。 +列举一些你会用到这些命令的例子。 -当你添加一个网卡或者从一个物理网口创建出一个虚拟网口的时候,你可能需要使用这些命令将新网口启用起来。 - -除此之外,如果你对网口做了某些修改或者网口本身没有启用,那你也需要使用以下的某个命令将网口启用起来。 +当你添加一个网卡或者从一个物理网口创建出一个虚拟网口的时候,你可能需要使用这些命令将新网口启用起来。另外,如果你对网口做了某些修改或者网口本身没有启用,那么你也需要使用以下的某个命令将网口启用起来。 启用禁用网口有很多种方法。在这篇文章里,我们会介绍我们使用过的、最好的 5 种方法。 -启用禁用网口可以通过以下 5 个方法实现: +启用禁用网口可以使用以下 5 个方法来完成: * **`ifconfig 命令:`** ifconfig 命令用于配置网口。 它可以提供网口的很多信息。 * **`ifdown/up 命令:`** ifdown 命令用于禁用网口,ifup 命令用于启用网口。 @@ -58,7 +56,7 @@ Linux 中如何启用禁用网口? ifconfig 命令用于配置网口。 -系统启动过程中如果需要启用网口,调用的命令就是 ifconfig。它可以提供很多网口的信息。不管我们想修改网口的什么配置,都可以使用该命令。 +系统启动过程中如果需要启用网口,调用的命令就是 ifconfig。 ifconfig 可以提供很多网口的信息。不管我们想修改网口的什么配置,都可以使用该命令。 ifconfig 的常用语法: @@ -142,7 +140,7 @@ ifdown/ifup 的常用语法: valid_lft forever preferred_lft forever ``` -ifup 和 ifdown 不支持以 `enpXXX` 命名的网口。当我执行该命令的时候得到的结果如下: +ifup 和 ifdown 不支持以 `enpXXX` 命名的网口。当执行该命令时得到的结果如下: ``` # ifdown enp0s8 @@ -197,7 +195,7 @@ ip 的常用语法: nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 -它可以用做 nm-applet 或者其他图形化客户端的替代品。 nmcli 可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,还可以用来管理和展示网络设备状态。 +nmcli 可以用做 nm-applet 或者其他图形化客户端的替代品。 它可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,它还可以用来管理和展示网络设备状态。 nmcli 命令大部分情况下都是使用`配置名称`工作而不是`设备名称`。所以,执行以下命令,获取网口对应的配置名称。【译者注:在使用 nmtui 或者 nmcli 管理网络连接的时候,可以为网络连接配置一个名称,就是这里提到的`配置名称(Profile name)`】 @@ -262,10 +260,10 @@ nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 U [![][1]![][1]][2] -选择你要禁用的网口,然后点击 “Deactivate” 按钮。 +选择你要禁用的网口,然后点击 “Deactivate” 按钮,就可以将网口禁用。 [![][1]![][1]][3] -如果要启用网口,进行上述相同的步骤即可。 +如果要启用网口,使用上述同样的步骤即可。 [![][1]![][1]][4] -------------------------------------------------------------------------------- From 9aa5b8710bb4b2a65ae6ebaa008a4a428790ee94 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sat, 4 May 2019 10:23:46 -0500 Subject: [PATCH 0257/1154] Submitted Translatted Passage for Review Submitted Translatted Passage for Review --- ...the DomTerm terminal emulator for Linux.md | 94 +++++++++---------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md index 84c45adc4f..59510f430b 100644 --- a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md +++ b/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md @@ -1,103 +1,100 @@ -tomjlw is translating -An introduction to the DomTerm terminal emulator for Linux +DomTerm 一款为 Linux 打造的终端模拟器 ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals.png?itok=CfBqYBah) -[DomTerm][1] is a modern terminal emulator that uses a browser engine as a "GUI toolkit." This enables some neat features, such as embeddable graphics and links, HTML rich text, and foldable (show/hide) commands. Otherwise it looks and feels like a feature-full, standalone terminal emulator, with excellent xterm compatibility (including mouse handling and 24-bit color), and appropriate "chrome" (menus). In addition, there is built-in support for session management and sub-windows (as in `tmux` and `GNU screen`), basic input editing (as in `readline`), and paging (as in `less`). +[DomTerm][1] 是一款现代化的终端模拟器,它使用浏览器引擎作为 “GUI 工具包”。这就使得一些干净特性例如可嵌入的图像和链接,HTML 富文本以及可折叠(显示/隐藏)命令成为可能。除此以外,它看起来感觉就像一个功能强大,有着优秀 xterm 兼容性(包括鼠标处理和24位色)和恰当的 “chrome” (菜单)的独特终端模拟器。另外它同样有对会话管理和副窗口(例如 `tmux` 和 `GNU Screen` 中),基本输入编辑(例如 `readline` 中)以及分页(例如 `less` 中)的内置支持。 ![](https://opensource.com/sites/default/files/u128651/domterm1.png) -Image 1: The DomTerminal terminal emulator. View larger image. +图 1: DomTerminal 终端模拟器。 查看大图 -Below we'll look more at these features. We'll assume you have `domterm` installed (skip to the end of this article if you need to get and build DomTerm). First, though, here's a quick overview of the technology. +在以下部分我们将看一看这些特性。我们将假设你已经安装好了 `domterm` (如果你需要获取并搭建 Dormterm 请跳到本文最后)。开始之前先让我们概览一下这项技术。 -### Frontend vs. backend +### 前端 vs. 后端 -Most of DomTerm is written in JavaScript and runs in a browser engine. This can be a desktop web browser, such as Chrome or Firefox (see image 3), or it can be an embedded browser. Using a general web browser works fine, but the user experience isn't as nice (as the menus are designed for general browsing, not for a terminal emulator), and the security model gets in the way, so using an embedded browser is nicer. +DomTerm 大部分是用 JavaScript 写的,它运行在一个浏览器引擎中。这个引擎可以是一个桌面浏览器,例如 Chrome 或者 Firefox(见图三),也可以是一个内嵌的浏览器。使用一个通用的网页浏览器没有问题,但是用户体验却不够好(因为菜单是为通用的网页浏览而不是为了终端模拟器所打造),并且安全模型也会妨碍使用。因此使用内嵌的浏览器更好一些。 -The following are currently supported: +目前以下这些是支持的: - * `qtdomterm`, which uses the Qt toolkit and `QtWebEngine` - * An `[Electron][2]` embedding (see image 1) - * `atom-domterm` runs DomTerm as a package in the [Atom text editor][3] (which is also based on Electron) and integrates with the Atom pane system (see image 2) - * A wrapper for JavaFX's `WebEngine`, which is useful for code written in Java (see image 4) - * Previously, the preferred frontend used [Firefox-XUL][4], but Mozilla has since dropped XUL + * `qdomterm`,使用了 Qt 工具包 和 `QtWebEngine` + * 一个内嵌的 `[Electron][2]`(见图一) + * `atom-domterm` 以 [Atom 文本编辑器][3](同样基于 Electron)包的形式运行 DomTerm,并和 Atom 面板系统集成在一起(见图二) + * 一个为 JavaFX 的 `WebEngine` 包装器,这对 Java 编程十分有用(见图四) + * 之前前端使用 [Firefox-XUL][4] 作为首选,但是 Mozilla 已经终止了 XUL -![DomTerm terminal panes in Atom editor][6] +![在 Atom 编辑器中的 DomTerm 终端面板][6] -Image 2: DomTerm terminal panes in Atom editor. [View larger image.][7] +图二:在 Atom 编辑器中的 DomTerm 终端面板。[查看大图][7] -Currently, the Electron frontend is probably the nicest option, closely followed by the Qt frontend. If you use Atom, `atom-domterm` works pretty well. +目前,Electron 前端可能是最佳选择,紧随其后的是 Qt 前端。如果你使用 Atom,`atom-domterm` 也工作得相当不错。 -The backend server is written in C. It manages pseudo terminals (PTYs) and sessions. It is also an HTTP server that provides the JavaScript and other files to the frontend. The `domterm` command starts terminal jobs and performs other requests. If there is no server running, `domterm` daemonizes itself. Communication between the backend and the server is normally done using WebSockets (with [libwebsockets][8] on the server). However, the JavaFX embedding uses neither WebSockets nor the DomTerm server; instead Java applications communicate directly using the Java-JavaScript bridge. +后端服务器是用 C 写的。它管理着伪终端(PTYs)和会话。它同样也是一个为前端提供 Javascript 和其他文件的 HTTP 服务器。如果没有服务器在运行,`domterm` 就会使用它自己。后端与服务器之间的通讯通常是用 WebSockets (在服务器端是[libwebsockets][8])完成的。然而,JavaFX 嵌入时既不用 Websockets 也不用 DomTerm 服务器。相反 Java 应用直接通过 Java-Javascript 桥接进行通讯。 -### A solid xterm-compatible terminal emulator +### 一个稳健的可兼容 xterm 的终端模拟器 -DomTerm looks and feels like a modern terminal emulator. It handles mouse events, 24-bit color, Unicode, double-width (CJK) characters, and input methods. DomTerm does a very good job on the [vttest testsuite][9]. +DomTerm 看上去感觉像一个现代的终端模拟器。它处理鼠标事件,24位色,万国码,倍宽字符(CJK)以及输入方式。DomTerm 在 [vttest 测试套件][9] 上工作地十分出色。 -Unusual features include: +不同寻常的特性包括: -**Show/hide buttons ("folding"):** The little triangles (seen in image 2 above) are buttons that hide/show the corresponding output. To create the buttons, just add certain [escape sequences][10] in the [prompt text][11]. +**展示/隐藏按钮(“折叠”):** 小三角(如上图二)是隐藏/展示相应输出的按钮。仅需在[提示文字][11]中添加特定的[转义字符][10]就可以创建按钮。 -**Mouse-click support for`readline` and similar input editors:** If you click in the (yellow) input area, DomTerm will send the right sequence of arrow-key keystrokes to the application. (This is enabled by escape sequences in the prompt; you can also force it using Alt+Click.) +**对于 `readline` 和类似输入编辑器的鼠标点击支持:** 如果你点击(黄色)输入区域,DomTerm 会向应用发送正确的方向键按键序列。(提示窗口中的转义字符使能这一特性,你也可以通过 Alt+Click 强制使用。) -**Style the terminal using CSS:** This is usually done in `~/.domterm/settings.ini`, which is automatically reloaded when saved. For example, in image 2, terminal-specific background colors were set. +**用CSS样式化终端:** 这通常是在 `~/.domterm/settings.ini` 里完成的,保存时会自动重载。例如在图二中,终端专用的背景色被设置。 -### A better REPL console +### 一个更好的 REPL 控制台 -A classic terminal emulator works on rectangular grids of character cells. This works for a REPL (command shell), but it is not ideal. Here are some DomTerm features useful for REPLs that are not typically found in terminal emulators: +一个经典的终端模拟器基于长方形的字符单元格工作。这在 REPL(命令行)上没问题,但是并不理想。这有些对通常在终端模拟器中不常见的 REPL 很有用的 DomTerm 特性: -**A command can "print" an image, a graph, a mathematical formula, or a set of clickable links:** An application can send an escape sequence containing almost any HTML. (The HTML is scrubbed to remove JavaScript and other dangerous features.) +**一个能“打印”图片,图表,数学公式或者一组可点击的链接的命令:** 一个应用可以发送包含几乎任何 HTML 的转义字符。(擦除 HTML 以移除 JavaScript 和其它危险特性。) -The image 3 shows a fragment from a [`gnuplot`][12] session. Gnuplot (2.1 or later) supports `domterm` as a terminal type. Graphical output is converted to an [SVG image][13], which is then printed to the terminal. My blog post [Gnuplot display on DomTerm][14] provides more information on this. +图三从[`gnuplot`][12]会话展示了一个片段。Gnuplot(2.1或者跟高版本)支持 `dormterm` 作为终端类型。图像输出被转换成 [SVG 图][13],然后图片被打印到终端。我的博客帖子[在 DormTerm 上的 Gnuplot 展示]在这方面提供了更多信息。 ![](https://opensource.com/sites/default/files/dt-gnuplot.png) -Image 3: Gnuplot screenshot. View larger image. +图三: Gnuplot 截图。查看大图 -The [Kawa][15] language has a library for creating and transforming [geometric picture values][16]. If you print such a picture value to a DomTerm terminal, the picture is converted to SVG and embedded in the output. +[Kawa][15] 语言有一个创建并转换[几何图像值][16]的库。如果你将这样的图片值打印到 DomTerm 终端,图片就会被转换成 SVG 形式并嵌入进输出中。 ![](https://opensource.com/sites/default/files/dt-kawa1.png) -Image 4: Computable geometry in Kawa. View larger image. +图四: Kawa 中可计算的几何形状。查看大图 -**Rich text in output:** Help messages are more readable and look nicer with HTML styling. The lower pane of image 1 shows the ouput from `domterm help`. (The output is plaintext if not running under DomTerm.) Note the `PAUSED` message from the built-in pager. +**输出中的富文本:** 有着 HTML 样式的帮助信息更加便于阅读,看上去也更漂亮。图片一的面板下部分展示 `dormterm help` 的输出。(如果没在 DomTerm 下运行的话输出的是普通文本。)注意自带的分页器中的 `PAUSED` 消息。 -**Error messages can include clickable links:** DomTerm recognizes the syntax `filename:line:column:` and turns it into a link that opens the file and line in a configurable text editor. (This works for relative filenames if you use `PROMPT_COMMAND` or similar to track directories.) +**包括可点击链接的错误消息:** DomTerm 识别语法 `filename:line:column` 并将其转化成一个能在可定制文本编辑器中打开文件并定位到行的链接。(这适用相对的文件名上如果你用 `PROMPT_COMMAND` 或类似的以跟踪目录。) -A compiler can detect that it is running under DomTerm and directly emit file links in an escape sequence. This is more robust than depending on DomTerm's pattern matching, as it handles spaces and other special characters, and it does not depend on directory tracking. In image 4, you can see error messages from the [Kawa compiler][15]. Hovering over the file position causes it to be underlined, and the `file:` URL shows in the `atom-domterm` message area (bottom of the window). (When not using `atom-domterm`, such messages are shown in an overlay box, as seen for the `PAUSED` message in image 1.) +一个编译器可以侦测到它在 DomTerm 下运行,并直接用转义字符发出文件链接。这比依赖 DomTerm 的样式匹配要稳健得多,因为它可以处理空格和其他字符并且无需依赖目录追踪。在图四中,你可以看到来自 [Kawa Compiler][15] 的错误消息。悬停在文件位置上会使其出现下划线,`file:` URL 出现在 `atom-domterm` 消息栏(窗口底部)中。(当不用 `atom-domterm` 时,这样的消息会在一个覆盖框中显示,如图一中所看到的 `PAUSED` 消息所示。) -The action when clicking on a link is configurable. The default action for a `file:` link with a `#position` suffix is to open the file in a text editor. +点击链接时的动作是可以配置的。默认对于带有 `#position` 后缀的 `file:` 链接的动作是在文本编辑器中打开那个文件。 -**Structured internal representation:** The following are all represented in the internal node structure: Commands, prompts, input lines, normal and error output, tabs, and preserving the structure if you "Save as HTML." The HTML file is compatible with XML, so you can use XML tools to search or transform the output. The command `domterm view-saved` opens a saved HTML file in a way that enables command folding (show/hide buttons are active) and reflow on window resize. +**内建的 Lisp 样式优美打印:** 你可以在输出中包括优美打印目录(比如,组)这样行分隔符会随着窗口调整二重新计算。查看我的文章 [DomTerm 中的动态优美打印][17]以更深入探讨。 -**Built-in Lisp-style pretty-printing:** You can include pretty-printing directives (e.g., grouping) in the output such that line breaks are recalculated on window resize. See my article [Dynamic pretty-printing in DomTerm][17] for a deeper discussion. +**基本的有着历史记录的内建行编辑**(像 `GNU readline` 一样): 这使用浏览器自带的编辑器,因此它有着优秀的鼠标和选择处理机制。你可以在正常字符模式(大多数输入的字符被指接送向进程); 或者行模式(当控制字符导致编辑动作,回车键向进程发送被编辑行,通常的字符是被插入的)之间转换。默认的是自动模式,根据 PTY 是在原始模式还是终端模式中,DomTerm 在字符模式与行模式间转换。 -**Basic built-in line editing** with history (like `GNU readline`): This uses the browser's built-in editor, so it has great mouse and selection handling. You can switch between normal character-mode (most characters typed are sent directly to the process); or line-mode (regular characters are inserted while control characters cause editing actions, with Enter sending the edited line to the process). The default is automatic mode, where DomTerm switches between character-mode and line-mode depending on whether the PTY is in raw or canonical mode. +**自带的分页器**(类似简化版的 `less`):键盘快捷键控制滚动。在“页模式”中,输出在每个新的屏幕(或者单独的行如果你一行行地向前移)后暂停; 页模式对于用户输入简单智能,因此(如果你想的话)你可以无需阻碍交互程序就可以运行它。 -**A built-in pager** (like a simplified `less`): Keyboard shortcuts will control scrolling. In "paging mode," the output pauses after each new screen (or single line, if you move forward line-by-line). The paging mode is unobtrusive and smart about user input, so you can (if you wish) run it without it interfering with interactive programs. +### 多路传输和会话 -### Multiplexing and sessions +**标签和平铺:** 你不仅可以创建多个终端标签,也可以平铺它们。你可以要么使用鼠标要么使用键盘快捷键来创建或者切换面板和标签。它们可以用鼠标重新排列并调整大小。这是通过[GoldenLayout][18] JavaScript 库实现的。[图一][19]展示了一个有着两个面板的窗口。上面的有两个标签,一个运行 [Midnight Commander][20]; 底下的面板以 HTML 形式展示了 `dormterm help` 输出。然而相反在 Atom 中我们使用其自带的可拖拽的面板和标签。你可以在图二中看到这个。 -**Tabs and tiling:** Not only can you create multiple terminal tabs, you can also tile them. You can use either the mouse or a keyboard shortcut to move between panes and tabs as well as create new ones. They can be rearranged and resized with the mouse. This is implemented using the [GoldenLayout][18] JavaScript library. [Image 1][19] shows a window with two panes. The top one has two tabs, with one running [Midnight Commander][20]; the bottom pane shows `domterm help` output as HTML. However, on Atom we instead use its built-in draggable tiles and tabs; you can see this in image 2. +**分离或重接会话:** 与 `tmux` 和 GNU `screen` 类似,DomTerm 支持会话安排。你甚至可以给同样的会话接上多个窗口或面板。这支持多用户会话分享和远程链接。(为了安全,同一个服务器的所有会话都需要能够读取 Unix 域接口和包含随机密钥的本地文件。当我们有了良好,安全的远程链接,这个限制将会有所改善。) -**Detaching and reattaching to sessions:** DomTerm supports sessions arrangement, similar to `tmux` and GNU `screen`. You can even attach multiple windows or panes to the same session. This supports multi-user session sharing and remote connections. (For security, all sessions of the same server need to be able to read a Unix domain socket and a local file containing a random key. This restriction will be lifted when we have a good, safe remote-access story.) +**`domterm`** **命令** 与 `tmux` 和 GNU `screen` 同样相似的地方在于它为控制或者打开单个或多个会话的服务器有着多个选项。主要的差别在于,如果它没在 DomTerm 下运行,`dormterm` 命令会创建一个新的顶层窗口,而不是在现有的终端中运行。 -**The** **`domterm`** **command** is also like `tmux` or GNU `screen` in that has multiple options for controlling or starting a server that manages one or more sessions. The major difference is that, if it's not already running under DomTerm, the `domterm` command creates a new top-level window, rather than running in the existing terminal. +与 `tmux` 和 `git` 类似,dormterm` 命令有许多副命令。一些副命令创建窗口或者会话。另一些(例如“打印”一张图片)仅在现有的 DormTerm 会话下起作用。 -The `domterm` command has a number of sub-commands, similar to `tmux` or `git`. Some sub-commands create windows or sessions. Others (such as "printing" an image) only work within an existing DomTerm session. +命令 `domterm browse` 打开一个窗口或者面板以浏览一个指定的 URL,例如浏览文档的时候。 -The command `domterm browse` opens a window or pane for browsing a specified URL, such as when browsing documentation. +### 获取并安装 DomTerm -### Getting and installing DomTerm - -DomTerm is available from its [GitHub repository][21]. Currently, there are no prebuilt packages, but there are [detailed instructions][22]. All prerequisites are available on Fedora 27, which makes it especially easy to build. +DomTerm 从其 [Github 仓库][21]可以获取。目前没有提前搭建好的包,但是有[详细指导][22]。所有的前提条件都可以在 Fedora 27 上获取,这使得其特别容易被搭建。 -------------------------------------------------------------------------------- via: https://opensource.com/article/18/1/introduction-domterm-terminal-emulator 作者:[Per Bothner][a] -译者:[译者ID](https://github.com/译者ID) +译者:[tomjlw](https://github.com/tomjlw) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -125,3 +122,4 @@ via: https://opensource.com/article/18/1/introduction-domterm-terminal-emulator [20]:https://midnight-commander.org/ [21]:https://github.com/PerBothner/DomTerm [22]:http://domterm.org/Downloading-and-building.html + From 9a305857cb62323c04d0fb5a8a5ef381eab8ce40 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sat, 4 May 2019 10:24:08 -0500 Subject: [PATCH 0258/1154] Rename sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md to translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md --- ... An introduction to the DomTerm terminal emulator for Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md (100%) diff --git a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md similarity index 100% rename from sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md rename to translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md From 2a52c39e24d43ad6c39190645a66fb03d3125bd8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 5 May 2019 09:29:28 +0800 Subject: [PATCH 0259/1154] translated --- ...5 How to use autofs to mount NFS shares.md | 147 ------------------ ...5 How to use autofs to mount NFS shares.md | 146 +++++++++++++++++ 2 files changed, 146 insertions(+), 147 deletions(-) delete mode 100644 sources/tech/20180605 How to use autofs to mount NFS shares.md create mode 100644 translated/tech/20180605 How to use autofs to mount NFS shares.md diff --git a/sources/tech/20180605 How to use autofs to mount NFS shares.md b/sources/tech/20180605 How to use autofs to mount NFS shares.md deleted file mode 100644 index 69325a0670..0000000000 --- a/sources/tech/20180605 How to use autofs to mount NFS shares.md +++ /dev/null @@ -1,147 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to use autofs to mount NFS shares) -[#]: via: (https://opensource.com/article/18/6/using-autofs-mount-nfs-shares) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) - -How to use autofs to mount NFS shares -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx) - -Most Linux file systems are mounted at boot and remain mounted while the system is running. This is also true of any remote file systems that have been configured in the `fstab` file. However, there may be times when you prefer to have a remote file system mount only on demand—for example, to boost performance by reducing network bandwidth usage, or to hide or obfuscate certain directories for security reasons. The package [autofs][1] provides this feature. In this article, I'll describe how to get a basic automount configuration up and running. - -`tree.mydatacenter.net` is up and running. Also assume a data directory named `ourfiles` and two user directories, for Carl and Sarah, are being shared by this server. - -First, a few assumptions: Assume the NFS server namedis up and running. Also assume a data directory namedand two user directories, for Carl and Sarah, are being shared by this server. - -A few best practices will make things work a bit better: It is a good idea to use the same user ID for your users on the server and any client workstations where they have an account. Also, your workstations and server should have the same domain name. Checking the relevant configuration files should confirm. -``` -alan@workstation1:~$ sudo getent passwd carl sarah - -[sudo] password for alan: - -carl:x:1020:1020:Carl,,,:/home/carl:/bin/bash - -sarah:x:1021:1021:Sarah,,,:/home/sarah:/bin/bash - - - -alan@workstation1:~$ sudo getent hosts - -127.0.0.1       localhost - -127.0.1.1       workstation1.mydatacenter.net workstation1 - -10.10.1.5       tree.mydatacenter.net tree - -``` - -As you can see, both the client workstation and the NFS server are configured in the `hosts` file. I’m assuming a basic home or even small office network that might lack proper internal domain name service (i.e., DNS). - -### Install the packages - -You need to install only two packages: `nfs-common` for NFS client functions, and `autofs` to provide the automount function. -``` -alan@workstation1:~$ sudo apt-get install nfs-common autofs - -``` - -You can verify that the autofs files have been placed in the `etc` directory: -``` -alan@workstation1:~$ cd /etc; ll auto* - --rw-r--r-- 1 root root 12596 Nov 19  2015 autofs.conf - --rw-r--r-- 1 root root   857 Mar 10  2017 auto.master - --rw-r--r-- 1 root root   708 Jul  6  2017 auto.misc - --rwxr-xr-x 1 root root  1039 Nov 19  2015 auto.net* - --rwxr-xr-x 1 root root  2191 Nov 19  2015 auto.smb* - -alan@workstation1:/etc$ - -``` - -### Configure autofs - -Now you need to edit several of these files and add the file `auto.home`. First, add the following two lines to the file `auto.master`: -``` -/mnt/tree  /etc/auto.misc - -/home/tree  /etc/auto.home - -``` - -Each line begins with the directory where the NFS shares will be mounted. Go ahead and create those directories: -``` -alan@workstation1:/etc$ sudo mkdir /mnt/tree /home/tree - -``` - -Second, add the following line to the file `auto.misc`: -``` -ourfiles        -fstype=nfs     tree:/share/ourfiles - -``` - -This line instructs autofs to mount the `ourfiles` share at the location matched in the `auto.master` file for `auto.misc`. As shown above, these files will be available in the directory `/mnt/tree/ourfiles`. - -Third, create the file `auto.home` with the following line: -``` -*               -fstype=nfs     tree:/home/& - -``` - -This line instructs autofs to mount the users share at the location matched in the `auto.master` file for `auto.home`. In this case, Carl and Sarah's files will be available in the directories `/home/tree/carl` or `/home/tree/sarah`, respectively. The asterisk (referred to as a wildcard) makes it possible for each user's share to be automatically mounted when they log in. The ampersand also works as a wildcard representing the user's directory on the server side. Their home directory should be mapped accordingly in the `passwd` file. This doesn’t have to be done if you prefer a local home directory; instead, the user could use this as simple remote storage for specific files. - -Finally, restart the `autofs` daemon so it will recognize and load these configuration file changes. -``` -alan@workstation1:/etc$ sudo service autofs restart - -``` - -### Testing autofs - -If you change to one of the directories listed in the file `auto.master` and run the `ls` command, you won’t see anything immediately. For example, change directory `(cd)` to `/mnt/tree`. At first, the output of `ls` won’t show anything, but after running `cd ourfiles`, the `ourfiles` share directory will be automatically mounted. The `cd` command will also be executed and you will be placed into the newly mounted directory. -``` -carl@workstation1:~$ cd /mnt/tree - -carl@workstation1:/mnt/tree$ ls - -carl@workstation1:/mnt/tree$ cd ourfiles - -carl@workstation1:/mnt/tree/ourfiles$ - -``` - -To further confirm that things are working, the `mount` command will display the details of the mounted share. -``` -carl@workstation1:~$ mount - -tree:/mnt/share/ourfiles on /mnt/tree/ourfiles type nfs4 (rw,relatime,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.10.1.22,local_lock=none,addr=10.10.1.5) - -``` - -The `/home/tree` directory will work the same way for Carl and Sarah. - -I find it useful to bookmark these directories in my file manager for quicker access. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/6/using-autofs-mount-nfs-shares - -作者:[Alan Formy-Duval][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/alanfdoss -[1]:https://wiki.archlinux.org/index.php/autofs diff --git a/translated/tech/20180605 How to use autofs to mount NFS shares.md b/translated/tech/20180605 How to use autofs to mount NFS shares.md new file mode 100644 index 0000000000..b402ee2ba2 --- /dev/null +++ b/translated/tech/20180605 How to use autofs to mount NFS shares.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use autofs to mount NFS shares) +[#]: via: (https://opensource.com/article/18/6/using-autofs-mount-nfs-shares) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +如何使用 autofs 挂载 NFS 共享 +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx) + +大多数 Linux 文件系统在引导时挂载,并在系统运行时保持挂载状态。对于已在 `fstab` 中配置的任何远程文件系统也是如此。但是,有时你可能希望仅按需挂载远程文件系统 - 例如,通过减少网络带宽使用来提高性能,或出于安全原因隐藏或混淆某些目录。[autofs][1] 软件包提供此功能。在本文中,我将介绍如何配置基本的自动挂载。 + +首先做点假设:假设有台 NFS 服务器 `tree.mydatacenter.net` 已经启动并运行。另外假设一个名为 `ourfiles` 的数据目录还有供 Carl 和 Sarah 使用的用户目录,它们都由服务器共享。 + +一些最佳实践可以使工作更好:服务器上的用户和任何客户端工作站上的帐号有相同的用户 ID。此外,你的工作站和服务器应有相同的域名。检查相关配置文件应该确认。 + +``` +alan@workstation1:~$ sudo getent passwd carl sarah + +[sudo] password for alan: + +carl:x:1020:1020:Carl,,,:/home/carl:/bin/bash + +sarah:x:1021:1021:Sarah,,,:/home/sarah:/bin/bash + + + +alan@workstation1:~$ sudo getent hosts + +127.0.0.1       localhost + +127.0.1.1       workstation1.mydatacenter.net workstation1 + +10.10.1.5       tree.mydatacenter.net tree + +``` + +如你所见,客户端工作站和 NFS 服务器都在 `hosts` 中配置。我假设一个基本的家庭甚至小型办公室网络,可能缺乏适合的内部域名服务(即 DNS)。 + +### 安装软件包 + +你只需要安装两个软件包:用于 NFS 客户端的 `nfs-common` 和提供自动挂载的 `autofs`。 +``` +alan@workstation1:~$ sudo apt-get install nfs-common autofs + +``` + +你可以验证 autofs 是否已放在 `etc` 目录中: +``` +alan@workstation1:~$ cd /etc; ll auto* + +-rw-r--r-- 1 root root 12596 Nov 19  2015 autofs.conf + +-rw-r--r-- 1 root root   857 Mar 10  2017 auto.master + +-rw-r--r-- 1 root root   708 Jul  6  2017 auto.misc + +-rwxr-xr-x 1 root root  1039 Nov 19  2015 auto.net* + +-rwxr-xr-x 1 root root  2191 Nov 19  2015 auto.smb* + +alan@workstation1:/etc$ + +``` + +### 配置 autofs + +现在你需要编辑其中几个文件并添加 `auto.home` 文件。首先,将以下两行添加到文件 `auto.master` 中: +``` +/mnt/tree  /etc/auto.misc + +/home/tree  /etc/auto.home + +``` + +每行以挂载 NFS 共享的目录开头。继续创建这些目录: +``` +alan@workstation1:/etc$ sudo mkdir /mnt/tree /home/tree + +``` + +接下来,将以下行添加到文件 `auto.misc`: +``` +ourfiles        -fstype=nfs     tree:/share/ourfiles + +``` + +该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.misc` 的 `ourfiles` 共享。如上所示,这些文件将在 `/mnt/tree/ourfiles` 目录中。 + +第三步,使用以下行创建文件 `auto.home`: +``` +*               -fstype=nfs     tree:/home/& + +``` + +该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.home` 的用户共享。在这种情况下,Carl 和 Sarah 的文件将分别在目录 `/home/tree/carl` 或 `/home/tree/sarah`中。星号(称为通配符)使每个用户的共享可以在登录时自动挂载。& 符号也可以作为表示服务器端用户目录的通配符。它们的主目录会相应地根据 `passwd` 文件映射。如果你更喜欢本地主目录,则无需执行此操作。相反,用户可以将其用作特定文件的简单远程存储。 + +最后,重启 `autofs` 守护进程,以便识别并加载这些配置的更改。 +``` +alan@workstation1:/etc$ sudo service autofs restart + +``` + +### 测试 autofs + +如果更改文件 `auto.master` 中的列出目录并运行 `ls` 命令,那么不会立即看到任何内容。例如,`(cd)` 到目录 `/mnt/tree`。首先,`ls` 的输出不会显示任何内容,但在运行 `cd ourfiles` 之后,将自动挂载 `ourfiles` 共享目录。 `cd` 命令也将被执行,你将进入新挂载的目录中。 +``` +carl@workstation1:~$ cd /mnt/tree + +carl@workstation1:/mnt/tree$ ls + +carl@workstation1:/mnt/tree$ cd ourfiles + +carl@workstation1:/mnt/tree/ourfiles$ + +``` + +为了进一步确认正常工作,`mount` 命令会显示已挂载共享的细节 +``` +carl@workstation1:~$ mount + +tree:/mnt/share/ourfiles on /mnt/tree/ourfiles type nfs4 (rw,relatime,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.10.1.22,local_lock=none,addr=10.10.1.5) + +``` + +对于Carl和Sarah,`/home/tree` 目录工作方式相同。 + +我发现在我的文件管理器中添加这些目录的书签很有用,可以用来快速访问。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/6/using-autofs-mount-nfs-shares + +作者:[Alan Formy-Duval][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[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/alanfdoss +[1]:https://wiki.archlinux.org/index.php/autofs From aef2a8f3f6a35759bfd6261086fab6c35645d070 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 5 May 2019 09:40:32 +0800 Subject: [PATCH 0260/1154] translating --- ...w to quickly deploy, run Linux applications as unikernels.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md index 6d65eaf369..bf069370a3 100644 --- a/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md +++ b/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From eae7cec613ae98fc8436b84fb26814124a29cc8b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 10:13:40 +0800 Subject: [PATCH 0261/1154] PRF:20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @warmfrog --- ...sing iotop And iostat Commands In Linux.md | 102 ++++++++---------- 1 file changed, 44 insertions(+), 58 deletions(-) diff --git a/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index ffececb666..f2a6e4eb93 100644 --- a/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) @@ -8,67 +8,55 @@ [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) 在 Linux 中如何使用 iotop 和 iostat 监控磁盘 I/O 活动? -=================================================== +====================================== -你知道在 Linux 中我们使用什么工具检修和监控实时的磁盘活动吗? +你知道在 Linux 中我们使用什么工具检修和监控实时的磁盘活动吗?如果 [Linux 系统性能][1]变慢,我们会用 [top 命令][2] 来查看系统性能。它被用来检查是什么进程在服务器上占有如此高的使用率,对于大多数 Linux 系统管理员来说很常见,现实世界中被 Linux 系统管理员广泛采用。 -如果 **[Linux 系统性能][1]**变慢,我们会用 **[top 命令][12]** 来查看系统性能。 - -它被用来检查是什么进程在服务器上占有如此高的使用率。 - -对于大多数 Linux 系统管理员来说很常见。 - -现实世界中被 Linux 系统管理员广泛采用。 - -如果在进程输出中你没有看到很大的不同,你仍然有选择查看其他东西。 - -我会建议你在 top 输出中检查 `wa` 状态因为大多数时间服务器性能由于在硬盘上的高 I/O 读和写降低了性能。 - -如果它很高或者波动,很可能就是它造成的。因此,我们需要检查硬盘上的 I/O 活动。 +如果在进程输出中你没有看到很大的不同,你仍然有选择查看其他东西。我会建议你在 `top` 输出中检查 `wa` 状态,因为大多数时间里服务器性能由于在硬盘上的高 I/O 读和写降低了性能。如果它很高或者波动,很可能就是它造成的。因此,我们需要检查硬盘上的 I/O 活动。 我们可以在 Linux 中使用 `iotop` 和 `iostat` 命令监控所有的磁盘和文件系统的磁盘 I/O 统计。 ### 什么是 iotop? -iotop 是一个类似 top 的工具来显示实时的磁盘活动。 +`iotop` 是一个类似 `top` 的工具,用来显示实时的磁盘活动。 -iotop 监控 Linux 内核输出的 I/O 使用信息并且显示一个系统中进程或线程的当前 I/O 使用情况。 +`iotop` 监控 Linux 内核输出的 I/O 使用信息,并且显示一个系统中进程或线程的当前 I/O 使用情况。 -它显示每个进程/线程读写 I/O 带宽。它同样显示当等待换入和等待 I/O 的线程/进程 时间花费的百分比。 +它显示每个进程/线程读写 I/O 带宽。它同样显示当等待换入和等待 I/O 的线程/进程花费的时间的百分比。 -Total DISK READ 和 Total DISK WRITE 的值表示了一方面进程和内核线程之间的总的读写带宽,另一方面表示内核块设备子系统的。 +`Total DISK READ` 和 `Total DISK WRITE` 的值一方面表示了进程和内核线程之间的总的读写带宽,另一方面也表示内核块设备子系统的。 -Actual DISK READ 和 Actual DISK WRITE 的值表示在内核块设备子系统和下面硬件(HDD,SSD,等等。)对应的实际磁盘 I/O 带宽。 +`Actual DISK READ` 和 `Actual DISK WRITE` 的值表示在内核块设备子系统和下面硬件(HDD、SSD 等等)对应的实际磁盘 I/O 带宽。 ### 如何在 Linux 中安装 iotop ? 我们可以轻松在包管理器的帮助下安装,因为该软件包在所有的 Linux 发行版仓库中都可以获得。 -对于 **`Fedora`** 系统,使用 **[DNF 命令][3]** 来安装 iotop。 +对于 Fedora 系统,使用 [DNF 命令][3] 来安装 `iotop`。 ``` $ sudo dnf install iotop ``` -对于 **`Debian/Ubuntu`** 系统,使用 **[API-GET 命令][4]** 或者 **[APT 命令][5]** 来安装 iotop。 +对于 Debian/Ubuntu 系统,使用 [API-GET 命令][4] 或者 [APT 命令][5] 来安装 `iotop`。 ``` $ sudo apt install iotop ``` -对于基于 **`Arch Linux`** 的系统,使用 **[Pacman Command][6]** 来安装 iotop。 +对于基于 Arch Linux 的系统,使用 [Pacman Command][6] 来安装 `iotop`。 ``` $ sudo pacman -S iotop ``` -对于 **`RHEL/CentOS`** 的系统,使用 **[YUM Command][7]** 来安装 iotop。 +对于 RHEL/CentOS 的系统,使用 [YUM Command][7] 来安装 `iotop`。 ``` $ sudo yum install iotop ``` -对于使用 **`openSUSE Leap`** 的系统,使用 **[Zypper Command][8]** 来安装 iotop。 +对于使用 openSUSE Leap 的系统,使用 [Zypper Command][8] 来安装 `iotop`。 ``` $ sudo zypper install iotop @@ -76,72 +64,70 @@ $ sudo zypper install iotop ### 在 Linux 中如何使用 iotop 命令来监控磁盘 I/O 活动/统计? -iotop 命令有很多参数来检查关于磁盘 I/O 的变化 +`iotop` 命令有很多参数来检查关于磁盘 I/O 的变化: ``` # iotop ``` -[![][9]![][9]][10] +![10] -如果你想检查那个进程实际在做 I/O,那么运行 iotop 命令加上 `-o` 或者 `--only` 参数。 +如果你想检查那个进程实际在做 I/O,那么运行 `iotop` 命令加上 `-o` 或者 `--only` 参数。 ``` # iotop --only ``` -[![][9]![][9]][11] - -**细节:** - - * **`IO:`** 它显示每个进程的 I/O 利用率,包含磁盘和交换。 - * **`SWAPIN:`** 它只显示每个进程的交换使用率。 +![11] +细节: + * `IO`:它显示每个进程的 I/O 利用率,包含磁盘和交换。 + * `SWAPIN`: 它只显示每个进程的交换使用率。 ### 什么是 iostat? -iostat 被用来报告中央处理单元(CPU)的统计和设备与分区的输出/输出的统计。 +`iostat` 被用来报告中央处理单元(CPU)的统计和设备与分区的输出/输出的统计。 -iostat 命令通过观察与他们平均传输率相关的设备活跃时间来监控系统输入/输出设备载入。 +`iostat` 命令通过观察与它们平均传输率相关的设备活跃时间来监控系统输入/输出设备负载。 -iostat 命令生成的报告可以被用来改变系统配置来更好的平衡物理磁盘之间的输入/输出负载。 +`iostat` 命令生成的报告可以被用来改变系统配置来更好的平衡物理磁盘之间的输入/输出负载。 -所有的统计都在 iostat 命令每次运行时被报告。该报告包含一个 CPU 头部,后面是一行 CPU 统计。 +所有的统计都在 `iostat` 命令每次运行时被报告。该报告包含一个 CPU 头部,后面是一行 CPU 统计。 -在多处理器系统中,CPU 统计被计算为系统层面的所有处理器的平均值。一个设备头行显示后紧跟一行每个配置设备的统计。 +在多处理器系统中,CPU 统计被计算为系统层面的所有处理器的平均值。设备头行后紧跟显示每个配置的设备一行的统计。 -iostat 命令生成两种类型的报告,CPU 利用率报告和设备利用率报告。 +`iostat` 命令生成两种类型的报告,CPU 利用率报告和设备利用率报告。 ### 在 Linux 中怎样安装 iostat? -iostat 工具是 sysstat 包的一部分,所以我们可以轻松地在包管理器地帮助下安装因为在所有的 Linux 发行版的仓库都是可以获得的。 +`iostat` 工具是 `sysstat` 包的一部分,所以我们可以轻松地在包管理器地帮助下安装,因为在所有的 Linux 发行版的仓库都是可以获得的。 -对于 **`Fedora`** 系统,使用 **[DNF Command][3]** 来安装 sysstat。 +对于 Fedora 系统,使用 [DNF Command][3] 来安装 `sysstat`。 ``` $ sudo dnf install sysstat ``` -对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET Command][4]** 或者 **[APT Command][5]** 来安装 sysstat。 +对于 Debian/Ubuntu 系统,使用 [APT-GET Command][4] 或者 [APT Command][5] 来安装 `sysstat`。 ``` $ sudo apt install sysstat ``` -对于基于 **`Arch Linux`** 的系统,使用 **[Pacman Command][6]** 来安装 sysstat。 +对于基于 Arch Linux 的系统,使用 [Pacman Command][6] 来安装 `sysstat`。 ``` $ sudo pacman -S sysstat ``` -对于 **`RHEL/CentOS`** 系统,使用 **[YUM Command][7]** 来安装 sysstat。 +对于 RHEL/CentOS 系统,使用 [YUM Command][7] 来安装 `sysstat`。 ``` $ sudo yum install sysstat ``` -对于 **`openSUSE Leap`** 系统,使用 **[Zypper Command][8]** 来安装 sysstat。 +对于 openSUSE Leap 系统,使用 [Zypper Command][8] 来安装 `sysstat`。 ``` $ sudo zypper install sysstat @@ -149,9 +135,9 @@ $ sudo zypper install sysstat ### 在 Linux 中如何使用 sysstat 命令监控磁盘 I/O 活动/统计? -在 iostat 命令中有很多参数来检查关于 I/O 和 CPU 的变化统计信息。 +在 `iostat` 命令中有很多参数来检查关于 I/O 和 CPU 的变化统计信息。 -不加参数运行 iostat 命令会看到完整的系统统计。 +不加参数运行 `iostat` 命令会看到完整的系统统计。 ``` # iostat @@ -169,7 +155,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -运行 iostat 命令加上 `-d` 参数查看所有设备的 I/O 统计。 +运行 `iostat` 命令加上 `-d` 参数查看所有设备的 I/O 统计。 ``` # iostat -d @@ -184,7 +170,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -运行 iostat 命令加上 `-p` 参数查看所有的设备和分区的 I/O 统计。 +运行 `iostat` 命令加上 `-p` 参数查看所有的设备和分区的 I/O 统计。 ``` # iostat -p @@ -206,7 +192,7 @@ loop1 0.00 0.00 0.00 0.00 1093 loop2 0.00 0.00 0.00 0.00 1077 0 0 ``` -运行 iostat 命令加上 `-x` 参数显示所有设备的详细的 I/O 统计信息。 +运行 `iostat` 命令加上 `-x` 参数显示所有设备的详细的 I/O 统计信息。 ``` # iostat -x @@ -224,7 +210,7 @@ loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0. loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ``` -运行 iostat 命令加上 `-d [设备名]` 参数查看具体设备和它的分区的 I/O 统计信息。 +运行 `iostat` 命令加上 `-d [设备名]` 参数查看具体设备和它的分区的 I/O 统计信息。 ``` # iostat -p [Device_Name] @@ -242,7 +228,7 @@ sda2 0.18 6.76 80.21 0.00 3112916 36924 sda1 0.00 0.01 0.00 0.00 3224 0 0 ``` -运行 iostat 命令加上 `-m` 参数以 `MB` 为单位而不是 `KB` 查看所有设备的统计。默认以 KB 显示输出。 +运行 `iostat` 命令加上 `-m` 参数以 MB 为单位而不是 KB 查看所有设备的统计。默认以 KB 显示输出。 ``` # iostat -m @@ -260,7 +246,7 @@ loop1 0.00 0.00 0.00 0.00 1 loop2 0.00 0.00 0.00 0.00 1 0 0 ``` -运行 iostat 命令使用特定的间隔使用如下的格式。在这个例子中,我们打算以 5 秒捕获的间隔捕获两个报告。 +运行 `iostat` 命令使用特定的间隔使用如下的格式。在这个例子中,我们打算以 5 秒捕获的间隔捕获两个报告。 ``` # iostat [Interval] [Number Of Reports] @@ -290,7 +276,7 @@ loop1 0.00 0.00 0.00 0.00 0 loop2 0.00 0.00 0.00 0.00 0 0 0 ``` -运行 iostat 命令 与 `-N` 参数来查看 LVM 磁盘 I/O 统计报告。 +运行 `iostat` 命令与 `-N` 参数来查看 LVM 磁盘 I/O 统计报告。 ``` # iostat -N @@ -307,7 +293,7 @@ sdc 0.01 0.12 0.00 2108 0 2g-2gvol1 0.00 0.07 0.00 1204 0 ``` -运行 nfsiostat 命令来查看 Network File System(NFS)的 I/O 统计。 +运行 `nfsiostat` 命令来查看 Network File System(NFS)的 I/O 统计。 ``` # nfsiostat @@ -320,7 +306,7 @@ via: https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ad3c6dd228b6c2567cda27582c3fa69c13a43053 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:13:45 +0800 Subject: [PATCH 0262/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20How?= =?UTF-8?q?=20To=20Create=20SSH=20Alias=20In=20Linux=20sources/tech/201905?= =?UTF-8?q?05=20How=20To=20Create=20SSH=20Alias=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190505 How To Create SSH Alias In Linux.md | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 sources/tech/20190505 How To Create SSH Alias In Linux.md diff --git a/sources/tech/20190505 How To Create SSH Alias In Linux.md b/sources/tech/20190505 How To Create SSH Alias In Linux.md new file mode 100644 index 0000000000..3ea1a77b7a --- /dev/null +++ b/sources/tech/20190505 How To Create SSH Alias In Linux.md @@ -0,0 +1,209 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Create SSH Alias In Linux) +[#]: via: (https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +How To Create SSH Alias In Linux +====== + +![How To Create SSH Alias In Linux][1] + +If you frequently access a lot of different remote systems via SSH, this trick will save you some time. You can create SSH alias to frequently-accessed systems via SSH. This way you need not to remember all the different usernames, hostnames, ssh port numbers and IP addresses etc. Additionally, It avoids the need to repetitively type the same username/hostname, ip address, port no whenever you SSH into a Linux server(s). + +### Create SSH Alias In Linux + +Before I know this trick, usually, I connect to a remote system over SSH using anyone of the following ways. + +Using IP address: + +``` +$ ssh 192.168.225.22 +``` + +Or using port number, username and IP address: + +``` +$ ssh -p 22 sk@server.example.com +``` + +Or using port number, username and hostname: + +``` +$ ssh -p 22 sk@server.example.com +``` + +Here, + + * **22** is the port number, + * **sk** is the username of the remote system, + * **192.168.225.22** is the IP of my remote system, + * **server.example.com** is the hostname of remote system. + + + +I believe most of the newbie Linux users and/or admins would SSH into a remote system this way. However, If you SSH into multiple different systems, remembering all hostnames/ip addresses, usernames is bit difficult unless you write them down in a paper or save them in a text file. No worries! This can be easily solved by creating an alias(or shortcut) for SSH connections. + +We can create an alias for SSH commands in two methods. + +##### Method 1 – Using SSH Config File + +This is my preferred way of creating aliases. + +We can use SSH default configuration file to create SSH alias. To do so, edit **~/.ssh/config** file (If this file doesn’t exist, just create one): + +``` +$ vi ~/.ssh/config +``` + +Add all of your remote hosts details like below: + +``` +Host webserver + HostName 192.168.225.22 + User sk + +Host dns + HostName server.example.com + User root + +Host dhcp + HostName 192.168.225.25 + User ostechnix + Port 2233 +``` + +![][2] + +Create SSH Alias In Linux Using SSH Config File + +Replace the values of **Host** , **Hostname** , **User** and **Port** with your own. Once you added the details of all remote hosts, save and exit the file. + +Now you can SSH into the systems with commands: + +``` +$ ssh webserver + +$ ssh dns + +$ ssh dhcp +``` + +It is simple as that. + +Have a look at the following screenshot. + +![][3] + +Access remote system using SSH alias + +See? I only used the alias name (i.e **webserver** ) to access my remote system that has IP address **192.168.225.22**. + +Please note that this applies for current user only. If you want to make the aliases available for all users (system wide), add the above lines in **/etc/ssh/ssh_config** file. + +You can also add plenty of other things in the SSH config file. For example, if you have [**configured SSH Key-based authentication**][4], mention the SSH keyfile location as below. + +``` +Host ubuntu + HostName 192.168.225.50 + User senthil + IdentityFIle ~/.ssh/id_rsa_remotesystem +``` + +Make sure you have replace the hostname, username and SSH keyfile path with your own. + +Now connect to the remote server with command: + +``` +$ ssh ubuntu +``` + +This way you can add as many as remote hosts you want to access over SSH and quickly access them using their alias name. + +##### Method 2 – Using Bash aliases + +This is quick and dirty way to create SSH aliases for faster communication. You can use the [**alias command**][5] to make this task much easier. + +Open **~/.bashrc** or **~/.bash_profile** file: + +Add aliases for each SSH connections one by one like below. + +``` +alias webserver='ssh sk@server.example.com' +alias dns='ssh sk@server.example.com' +alias dhcp='ssh sk@server.example.com -p 2233' +alias ubuntu='ssh sk@server.example.com -i ~/.ssh/id_rsa_remotesystem' +``` + +Again make sure you have replaced the host, hostname, port number and ip address with your own. Save the file and exit. + +Then, apply the changes using command: + +``` +$ source ~/.bashrc +``` + +Or, + +``` +$ source ~/.bash_profile +``` + +In this method, you don’t even need to use “ssh alias-name” command. Instead, just use alias name only like below. + +``` +$ webserver +$ dns +$ dhcp +$ ubuntu +``` + +![][6] + +These two methods are very simple, yet useful and much more convenient for those who often SSH into multiple different systems. Use any one of the aforementioned methods that suits for you to quickly access your remote Linux systems over SSH. + +* * * + +**Suggested read:** + + * [**Allow Or Deny SSH Access To A Particular User Or Group In Linux**][7] + * [**How To SSH Into A Particular Directory On Linux**][8] + * [**How To Stop SSH Session From Disconnecting In Linux**][9] + * [**4 Ways To Keep A Command Running After You Log Out Of The SSH Session**][10] + * [**SSLH – Share A Same Port For HTTPS And SSH**][11] + + + +* * * + +And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! + +Cheers! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-create-ssh-alias-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/2019/04/ssh-alias-720x340.png +[2]: http://www.ostechnix.com/wp-content/uploads/2019/04/Create-SSH-Alias-In-Linux.png +[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias.png +[4]: https://www.ostechnix.com/configure-ssh-key-based-authentication-linux/ +[5]: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-examples/ +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias-1.png +[7]: https://www.ostechnix.com/allow-deny-ssh-access-particular-user-group-linux/ +[8]: https://www.ostechnix.com/how-to-ssh-into-a-particular-directory-on-linux/ +[9]: https://www.ostechnix.com/how-to-stop-ssh-session-from-disconnecting-in-linux/ +[10]: https://www.ostechnix.com/4-ways-keep-command-running-log-ssh-session/ +[11]: https://www.ostechnix.com/sslh-share-port-https-ssh/ From f3e8a97c50820bcdc720c0fd722e35b183b149b1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 10:14:16 +0800 Subject: [PATCH 0263/1154] PUB:20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @warmfrog https://linux.cn/article-10815-1.html --- ...k I-O Activity Using iotop And iostat Commands In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md (99%) diff --git a/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/published/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md similarity index 99% rename from translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md rename to published/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md index f2a6e4eb93..66b202a011 100644 --- a/translated/tech/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md +++ b/published/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10815-1.html) [#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) [#]: via: (https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat-command/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From f3e3ea4d3a6ee5f59cc6bc969bd4d206557084a0 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:14:56 +0800 Subject: [PATCH 0264/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Kind?= =?UTF-8?q?d=20=E2=80=93=20A=20Graphical=20Frontend=20To=20dd=20Command=20?= =?UTF-8?q?sources/tech/20190505=20Kindd=20-=20A=20Graphical=20Frontend=20?= =?UTF-8?q?To=20dd=20Command.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...dd - A Graphical Frontend To dd Command.md | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md diff --git a/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md new file mode 100644 index 0000000000..59dcfd2ffa --- /dev/null +++ b/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kindd – A Graphical Frontend To dd Command) +[#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Kindd – A Graphical Frontend To dd Command +====== + +![Kindd - A Graphical Frontend To dd Command][1] + +A while ago we learned how to [**create bootable ISO using dd command**][2] in Unix-like systems. Please keep in mind that dd command is one of the dangerous and destructive command. If you’re not sure what you are actually doing, you might accidentally wipe your hard drive in minutes. The dd command just takes bytes from **if** and writes them to **of**. It won’t care what it’s overwriting, it won’t care if there’s a partition table in the way, or a boot sector, or a home folder, or anything important. It will simply do what it is told to do. If you’re beginner, mostly try to avoid using dd command to do stuffs. Thankfully, there is a simple GUI utility for dd command. Say hello to **“Kindd”** , a graphical frontend to dd command. It is free, open source tool written in **Qt Quick**. This tool can be very helpful for the beginners and who are not comfortable with command line in general. + +The developer created this tool mainly to provide, + + 1. a modern, simple and safe graphical user interface for dd command, + 2. a graphical way to easily create bootable device without having to use Terminal. + + + +### Installing Kindd + +Kindd is available in [**AUR**][3]. So if you’re a Arch user, install it using any AUR helper tools, for example [**Yay**][4]. + +To install Git version, run: + +``` +$ yay -S kindd-git +``` + +To install release version, run: + +``` +$ yay -S kindd +``` + +After installing, launch Kindd from the Menu or Application launcher. + +For other distributions, you need to manually compile and install it from source as shown below. + +Make sure you have installed the following prerequisites. + + * git + * coreutils + * polkit + * qt5-base + * qt5-quickcontrols + * qt5-quickcontrols2 + * qt5-graphicaleffects + + + +Once all prerequisites installed, git clone the Kindd repository: + +``` +git clone https://github.com/LinArcX/Kindd/ +``` + +Go to the directory where you just cloned Kindd and compile and install it: + +``` +cd Kindd + +qmake + +make +``` + +Finally run the following command to launch Kindd application: + +``` +./kindd +``` + +Kindd uses **pkexec** internally. The pkexec agent is installed by default in most most Desktop environments. But if you use **i3** (or maybe some other DE), you should install **polkit-gnome** first, and then paste the following line into i3 config file: + +``` +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & +``` + +### Create bootable ISO using Kindd + +To create a bootable USB from an ISO, plug in the USB drive. Then, launch Kindd either from the Menu or Terminal. + +This is how Kindd default interface looks like: + +![][5] + +Kindd interface + +As you can see, Kindd interface is very simple and self-explanatory. There are just two sections namely **List Devices** which displays the list of available devices (hdd and Usb) on your system and **Create Bootable .iso**. You will be in “Create Bootable .iso” section by default. + +Enter the block size in the first column, select the path of the ISO file in the second column and choose the correct device (USB drive path) in third column. Click **Convert/Copy** button to start creating bootable ISO. + +![][6] + +Once the process is completed, you will see successful message. + +![][7] + +Now, unplug the USB drive and boot your system with USB to check if it really works. + +If you don’t know the actual device name (target path), just click on the List devices and check the USB drive name. + +![][8] + +* * * + +**Related read:** + + * [**Etcher – A Beautiful App To Create Bootable SD Cards Or USB Drives**][9] + * [**Bootiso Lets You Safely Create Bootable USB Drive**][10] + + + +* * * + +Kindd is in its early development stage. So, there would be bugs. If you find any bugs, please report them in its GitHub page given at the end of this guide. + +And, that’s all. Hope this was useful. More good stuffs to come. Stay tuned! + +Cheers! + +**Resource:** + + * [**Kindd GitHub Repository**][11] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ + +作者:[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/2019/04/kindd-720x340.png +[2]: https://www.ostechnix.com/how-to-create-bootable-usb-drive-using-dd-command/ +[3]: https://aur.archlinux.org/packages/kindd-git/ +[4]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-interface.png +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-1.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-2.png +[8]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-3.png +[9]: https://www.ostechnix.com/etcher-beauitiful-app-create-bootable-sd-cards-usb-drives/ +[10]: https://www.ostechnix.com/bootiso-lets-you-safely-create-bootable-usb-drive/ +[11]: https://github.com/LinArcX/Kindd From daf496bde89fe7e8e0eaf099f6ae8ea40cc6d3db Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:17:37 +0800 Subject: [PATCH 0265/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Ping?= =?UTF-8?q?=20Multiple=20Servers=20And=20Show=20The=20Output=20In=20Top-li?= =?UTF-8?q?ke=20Text=20UI=20sources/tech/20190505=20Ping=20Multiple=20Serv?= =?UTF-8?q?ers=20And=20Show=20The=20Output=20In=20Top-like=20Text=20UI.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...And Show The Output In Top-like Text UI.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md diff --git a/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md new file mode 100644 index 0000000000..ba177fc480 --- /dev/null +++ b/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) +[#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Ping Multiple Servers And Show The Output In Top-like Text UI +====== + +![Ping Multiple Servers And Show The Output In Top-like Text UI][1] + +A while ago, we wrote about [**“Fping”**][2] utility which enables us to ping multiple hosts at once. Unlike the traditional **“Ping”** utility, Fping doesn’t wait for one host’s timeout. It uses round-robin method. Meaning – It will send the ICMP Echo request to one host, then move to the another host and finally display which hosts are up or down at a time. Today, we are going to discuss about a similar utility named **“Pingtop”**. As the name says, it will ping multiple servers at a time and show the result in Top-like Terminal UI. It is free and open source, command line program written in **Python**. + +### Install Pingtop + +Pingtop can be installed using Pip, a package manager to install programs developed in Python. Make sure sure you have installed Python 3.7.x and Pip in your Linux box. + +To install Pip on Linux, refer the following link. + + * [**How To Manage Python Packages Using Pip**][3] + + + +Once Pip is installed, run the following command to install Pingtop: + +``` +$ pip install pingtop +``` + +Now let us go ahead and ping multiple systems using Pingtop. + +### Ping Multiple Servers And Show The Output In Top-like Terminal UI + +To ping mulstiple hosts/systems, run: + +``` +$ pingtop ostechnix.com google.com facebook.com twitter.com +``` + +You will now see the result in a nice top-like Terminal UI as shown in the following output. + +![][4] + +Ping multiple servers using Pingtop + +* * * + +**Suggested read:** + + * [**Some Alternatives To ‘top’ Command line Utility You Might Want To Know**][5] + + + +* * * + +I personally couldn’t find any use cases for Pingtop utility at the moment. But I like the idea of showing the ping command’s output in text user interface. Give it a try and see if it helps. + +And, that’s all for now. More good stuffs to come. Stay tuned! + +Cheers! + +**Resource:** + + * [**Pingtop GitHub Repository**][6] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/ + +作者:[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/2019/04/pingtop-720x340.png +[2]: https://www.ostechnix.com/ping-multiple-hosts-linux/ +[3]: https://www.ostechnix.com/manage-python-packages-using-pip/ +[4]: http://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-1.gif +[5]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/ +[6]: https://github.com/laixintao/pingtop From f1b6c849e72fae4e639bdfb8c6cedd1b1c85c496 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:18:18 +0800 Subject: [PATCH 0266/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Bloc?= =?UTF-8?q?kchain=202.0=20=E2=80=93=20What=20Is=20Ethereum=20[Part=209]=20?= =?UTF-8?q?sources/tech/20190505=20Blockchain=202.0=20-=20What=20Is=20Ethe?= =?UTF-8?q?reum=20-Part=209.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ockchain 2.0 - What Is Ethereum -Part 9.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md diff --git a/sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md b/sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md new file mode 100644 index 0000000000..a4669a2eb0 --- /dev/null +++ b/sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – What Is Ethereum [Part 9]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – What Is Ethereum [Part 9] +====== + +![Ethereum][1] + +In the previous guide of this series, we discussed about [**Hyperledger Project (HLP)**][2], a fastest growing product developed by **Linux Foundation**. In this guide, we are going to discuss about what is **Ethereum** and its features in detail. Many researchers opine that the future of the internet will be based on principles of decentralized computing. Decentralized computing was in fact among one of the broader objectives of having the internet in the first place. However, the internet took another turn owing to differences in computing capabilities available. While modern server capabilities make the case for server-side processing and execution, lack of decent mobile networks in large parts of the world make the case for the same on the client side. Modern smartphones now have **SoCs** (system on a chip or system on chip) capable of handling many such operations on the client side itself, however, limitations owing to retrieving and storing data securely still pushes developers to have server-side computing and data management. Hence, a bottleneck in regards to data transfer capabilities is currently observed. + +All of that might soon change because of advancements in distributed data storage and program execution platforms. [**The blockchain**][3], for the first time in the history of the internet, basically allows for secure data management and program execution on a distributed network of users as opposed to central servers. + +**Ethereum** is one such blockchain platform that gives developers access to frameworks and tools used to build and run applications on such a decentralized network. Though more popularly known in general for its cryptocurrency, Ethereum is more than just **ethers** (the cryptocurrency). It’s a full **Turing complete programming language** that is designed to develop and deploy **DApps** or **Distributed APPlications** [1]. We’ll look at DApps in more detail in one of the upcoming posts. + +Ethereum is an open-source, supports by default a public (non-permissioned) blockchain, and features an extensive smart contract platform **(Solidity)** underneath. Ethereum provides a virtual computing environment called the **Ethereum virtual machine** to run applications and [**smart contracts**][4] as well[2]. The Ethereum virtual machine runs on thousands of participating nodes all over the world, meaning the application data while being secure, is almost impossible to be tampered with or lost. + +### Getting behind Ethereum: What sets it apart + +In 2017, a 30 plus group of the who’s who of the tech and financial world got together to leverage the Ethereum blockchain’s capabilities. Thus, the **Ethereum Enterprise Alliance (EEA)** was formed by a long list of supporting members including _Microsoft_ , _JP Morgan_ , _Cisco Systems_ , _Deloitte_ , and _Accenture_. JP Morgan already has **Quorum** , a decentralized computing platform for financial services based on Ethereum currently in operation, while Microsoft has Ethereum based cloud services it markets through its Azure cloud business[3]. + +### What is ether and how is it related to Ethereum + +Ethereum creator **Vitalik Buterin** understood the true value of a decentralized processing platform and the underlying blockchain tech that powered bitcoin. He failed to gain majority agreement for his idea of proposing that Bitcoin should be developed to support running distributed applications (DApps) and programs (now referred to as smart contracts). + +Hence in 2013, he proposed the idea of Ethereum in a white paper he published. The original white paper is still maintained and available for readers **[here][5]**. The idea was to develop a blockchain based platform to run smart contracts and applications designed to run on nodes and user devices instead of servers. + +The Ethereum system is often mistaken to just mean the cryptocurrency ether, however, it has to be reiterated that Ethereum is a full stack platform for developing applications and executing them as well and has been so since inception whereas bitcoin isn’t. **Ether is currently the second biggest cryptocurrency** by market capitalization and trades at an average of $170 per ether at the time of writing this article[4]. + +### Features and technicalities of the platform[5] + + * As we’ve already mentioned, the cryptocurrency called ether is simply one of the things the platform features. The purpose of the system is more than taking care of financial transactions. In fact, the key difference between the Ethereum platform and Bitcoin is in their scripting capabilities. Ethereum is developed in a Turing complete programming language which means it has scripting and application capabilities similar to other major programming languages. Developers require this feature to create DApps and complex smart contracts on the platform, a feature that bitcoin misses on. + * The “mining” process of ether is more stringent and complex. While specialized ASICs may be used to mine bitcoin, the basic hashing algorithm used by Ethereum **(EThash)** reduces the advantage that ASICs have in this regard. + * The transaction fees itself to be paid as an incentive to miners and node operators for running the network is calculated using a computational token called **Gas**. Gas improves the system’s resilience and resistance to external hacks and attacks by requiring the initiator of the transaction to pay ethers proportionate to the number of computational resources that are required to carry out that transaction. This is in contrast to other platforms such as Bitcoin where the transaction fee is measured in tandem with the transaction size. As such, the average transaction costs in Ethereum is radically less than Bitcoin. This also implies that running applications running on the Ethereum virtual machine will require a fee depending straight up on the computational problems that the application is meant to solve. Basically, the more complex an execution, the more the fee. + * The block time for Ethereum is estimated to be around _**10-15 seconds**_. The block time is the average time that is required to timestamp and create a block on the blockchain network. Compared to the 10+ minutes the same transaction will take on the bitcoin network, it becomes apparent that _**Ethereum is much faster**_ with respect to transactions and verification of blocks. + * _It is also interesting to note that there is no hard cap on the amount of ether that can be mined or the rate at which ether can be mined leading to less radical system design than bitcoin._ + + + +### Conclusion + +While Ethereum is comparable and far outpaces similar platforms, the platform itself lacked a definite path for development until the Ethereum enterprise alliance started pushing it. While the definite push for enterprise developments are made by the Ethereum platform, it has to be noted that Ethereum also caters to small-time developers and individuals as well. As such developing the platform for end users and enterprises leave a lot of specific functionality out of the loop for Ethereum. Also, the blockchain model proposed and developed by the Ethereum foundation is a public model whereas the one proposed by projects such as the Hyperledger project is private and permissioned. + +While only time can tell which platform among the ones put forward by Ethereum, Hyperledger, and R3 Corda among others will find the most fans in real-world use cases, such systems do prove the validity behind the claim of a blockchain powered future. + +**References:** + + * [1] [**Gabriel Nicholas, “Ethereum Is Coding’s New Wild West | WIRED,” Wired , 2017**][6]. + * [2] [**What is Ethereum? — Ethereum Homestead 0.1 documentation**][7]. + * [3] [**Ethereum, a Virtual Currency, Enables Transactions That Rival Bitcoin’s – The New York Times**][8]. + * [4] [**Cryptocurrency Market Capitalizations | CoinMarketCap**][9]. + * [5] [**Introduction — Ethereum Homestead 0.1 documentation**][10]. + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ + +作者:[editor][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/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Ethereum-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ +[3]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[4]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[5]: https://github.com/ethereum/wiki/wiki/White-Paper +[6]: https://www.wired.com/story/ethereum-is-codings-new-wild-west/ +[7]: http://www.ethdocs.org/en/latest/introduction/what-is-ethereum.html#ethereum-virtual-machine +[8]: https://www.nytimes.com/2016/03/28/business/dealbook/ethereum-a-virtual-currency-enables-transactions-that-rival-bitcoins.html +[9]: https://coinmarketcap.com/ +[10]: http://www.ethdocs.org/en/latest/introduction/index.html From 6f5bd832e1a874ad868a940dc21b90b30bbc476b Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:19:46 +0800 Subject: [PATCH 0267/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20How?= =?UTF-8?q?=20To=20Navigate=20Directories=20Faster=20In=20Linux=20sources/?= =?UTF-8?q?tech/20190505=20How=20To=20Navigate=20Directories=20Faster=20In?= =?UTF-8?q?=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...To Navigate Directories Faster In Linux.md | 350 ++++++++++++++++++ 1 file changed, 350 insertions(+) create mode 100644 sources/tech/20190505 How To Navigate Directories Faster In Linux.md diff --git a/sources/tech/20190505 How To Navigate Directories Faster In Linux.md b/sources/tech/20190505 How To Navigate Directories Faster In Linux.md new file mode 100644 index 0000000000..e0979b3915 --- /dev/null +++ b/sources/tech/20190505 How To Navigate Directories Faster In Linux.md @@ -0,0 +1,350 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Navigate Directories Faster In Linux) +[#]: via: (https://www.ostechnix.com/navigate-directories-faster-linux/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +How To Navigate Directories Faster In Linux +====== + +![Navigate Directories Faster In Linux][1] + +Today we are going to learn some command line productivity hacks. As you already know, we use “cd” command to move between a stack of directories in Unix-like operating systems. In this guide I am going to teach you how to navigate directories faster without having to use “cd” command often. There could be many ways, but I only know the following five methods right now! I will keep updating this guide when I came across any methods or utilities to achieve this task in the days to come. + +### Five Different Methods To Navigate Directories Faster In Linux + +##### Method 1: Using “Pushd”, “Popd” And “Dirs” Commands + +This is the most frequent method that I use everyday to navigate between a stack of directories. The “Pushd”, “Popd”, and “Dirs” commands comes pre-installed in most Linux distributions, so don’t bother with installation. These trio commands are quite useful when you’re working in a deep directory structure and scripts. For more details, check our guide in the link given below. + + * **[How To Use Pushd, Popd And Dirs Commands For Faster CLI Navigation][2]** + + + +##### Method 2: Using “bd” utility + +The “bd” utility also helps you to quickly go back to a specific parent directory without having to repeatedly typing “cd ../../.” on your Bash. + +Bd is also available in the [**Debian extra**][3] and [**Ubuntu universe**][4] repositories. So, you can install it using “apt-get” package manager in Debian, Ubuntu and other DEB based systems as shown below: + +``` +$ sudo apt-get update + +$ sudo apt-get install bd +``` + +For other distributions, you can install as shown below. + +``` +$ sudo wget --no-check-certificate -O /usr/local/bin/bd https://raw.github.com/vigneshwaranr/bd/master/bd + +$ sudo chmod +rx /usr/local/bin/bd + +$ echo 'alias bd=". bd -si"' >> ~/.bashrc + +$ source ~/.bashrc +``` + +To enable auto completion, run: + +``` +$ sudo wget -O /etc/bash_completion.d/bd https://raw.github.com/vigneshwaranr/bd/master/bash_completion.d/bd + +$ source /etc/bash_completion.d/bd +``` + +The Bd utility has now been installed. Let us see few examples to understand how to quickly move through stack of directories using this tool. + +Create some directories. + +``` +$ mkdir -p dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10 +``` + +The above command will create a hierarchy of directories. Let us check [**directory structure**][5] using command: + +``` +$ tree dir1/ +dir1/ +└── dir2 + └── dir3 + └── dir4 + └── dir5 + └── dir6 + └── dir7 + └── dir8 + └── dir9 + └── dir10 + +9 directories, 0 files +``` + +Alright, we have now 10 directories. Let us say you’re currently in 7th directory i.e dir7. + +``` +$ pwd +/home/sk/dir1/dir2/dir3/dir4/dir5/dir6/dir7 +``` + +You want to move to dir3. Normally you would type: + +``` +$ cd /home/sk/dir1/dir2/dir3 +``` + +Right? yes! But it not necessary though! To go back to dir3, just type: + +``` +$ bd dir3 +``` + +Now you will be in dir3. + +![][6] + +Navigate Directories Faster In Linux Using “bd” Utility + +Easy, isn’t it? It supports auto complete, so you can just type the partial name of a directory and hit the tab key to auto complete the full path. + +To check the contents of a specific parent directory, you don’t need to inside that particular directory. Instead, just type: + +``` +$ ls `bd dir1` +``` + +The above command will display the contents of dir1 from your current working directory. + +For more details, check out the following GitHub page. + + * [**bd GitHub repository**][7] + + + +##### Method 3: Using “Up” Shell script + +The “Up” is a shell script allows you to move quickly to your parent directory. It works well on many popular shells such as Bash, Fish, and Zsh etc. Installation is absolutely easy too! + +To install “Up” on **Bash** , run the following commands one bye: + +``` +$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh + +$ echo 'source ~/.config/up/up.sh' >> ~/.bashrc +``` + +The up script registers the “up” function and some completion functions via your “.bashrc” file. + +Update the changes using command: + +``` +$ source ~/.bashrc +``` + +On **zsh** : + +``` +$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh + +$ echo 'source ~/.config/up/up.sh' >> ~/.zshrc +``` + +The up script registers the “up” function and some completion functions via your “.zshrc” file. + +Update the changes using command: + +``` +$ source ~/.zshrc +``` + +On **fish** : + +``` +$ curl --create-dirs -o ~/.config/up/up.fish https://raw.githubusercontent.com/shannonmoeller/up/master/up.fish + +$ source ~/.config/up/up.fish +``` + +The up script registers the “up” function and some completion functions via “funcsave”. + +Now it is time to see some examples. + +Let us create some directories. + +``` +$ mkdir -p dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10 +``` + +Let us say you’re in 7th directory i.e dir7. + +``` +$ pwd +/home/sk/dir1/dir2/dir3/dir4/dir5/dir6/dir7 +``` + +You want to move to dir3. Using “cd” command, we can do this by typing the following command: + +``` +$ cd /home/sk/dir1/dir2/dir3 +``` + +But it is really easy to go back to dir3 using “up” script: + +``` +$ up dir3 +``` + +That’s it. Now you will be in dir3. To go one directory up, just type: + +``` +$ up 1 +``` + +To go back two directory type: + +``` +$ up 2 +``` + +It’s that simple. Did I type the full path? Nope. Also it supports tab completion. So just type the partial directory name and hit the tab to complete the full path. + +For more details, check out the GitHub page. + + * [**Up GitHub Repository**][8] + + + +Please be mindful that “bd” and “up” tools can only help you to go backward i.e to the parent directory of the current working directory. You can’t move forward. If you want to switch to dir10 from dir5, you can’t! Instead, you need to use “cd” command to switch to dir10. These two utilities are meant for quickly moving you to the parent directory! + +##### Method 4: Using “Shortcut” tool + +This is yet another handy method to switch between different directories quickly and easily. This is somewhat similar to [**alias**][9] command. In this method, we create shortcuts to frequently used directories and use the shortcut name to go to that respective directory without having to type the path. If you’re working in deep directory structure and stack of directories, this method will greatly save some time. You can learn how it works in the guide given below. + + * [**Create Shortcuts To The Frequently Used Directories In Your Shell**][10] + + + +##### Method 5: Using “CDPATH” Environment variable + +This method doesn’t require any installation. **CDPATH** is an environment variable. It is somewhat similar to **PATH** variable which contains many different paths concatenated using **‘:’** (colon). The main difference between PATH and CDPATH variables is the PATH variable is usable with all commands whereas CDPATH works only for **cd** command. + +I have the following directory structure. + +![][11] + +Directory structure + +As you see, there are four child directories under a parent directory named “ostechnix”. + +Now add this parent directory to CDPATH using command: + +``` +$ export CDPATH=~/ostechnix +``` + +You now can instantly cd to the sub-directories of the parent directory (i.e **~/ostechnix** in our case) from anywhere in the filesystem. + +For instance, currently I am in **/var/mail/** location. + +![][12] + +To cd into **~/ostechnix/Linux/** directory, we don’t have to use the full path of the directory as shown below: + +``` +$ cd ~/ostechnix/Linux +``` + +Instead, just mention the name of the sub-directory you want to switch to: + +``` +$ cd Linux +``` + +It will automatically cd to **~/ostechnix/Linux** directory instantly. + +![][13] + +As you can see in the above output, I didn’t use “cd ”. Instead, I just used “cd ” command. + +Please note that CDPATH will allow you to quickly navigate to only one child directory of the parent directory set in CDPATH variable. It doesn’t much help for navigating a stack of directories (directories inside sub-directories, of course). + +To find the values of CDPATH variable, run: + +``` +$ echo $CDPATH +``` + +Sample output would be: + +``` +/home/sk/ostechnix +``` + +**Set multiple values to CDPATH** + +Similar to PATH variable, we can also set multiple values (more than one directory) to CDPATH separated by colon (:). + +``` +$ export CDPATH=.:~/ostechnix:/etc:/var:/opt +``` + +**Make the changes persistent** + +As you already know, the above command (export) will only keep the values of CDPATH until next reboot. To permanently set the values of CDPATH, just add them to your **~/.bashrc** or **~/.bash_profile** files. + +``` +$ vi ~/.bash_profile +``` + +Add the values: + +``` +export CDPATH=.:~/ostechnix:/etc:/var:/opt +``` + +Hit **ESC** key and type **:wq** to save and exit. + +Apply the changes using command: + +``` +$ source ~/.bash_profile +``` + +**Clear CDPATH** + +To clear the values of CDPATH, use **export CDPATH=””**. Or, simply delete the entire line from **~/.bashrc** or **~/.bash_profile** files. + +In this article, you have learned the different ways to navigate directory stack faster and easier in Linux. As you can see, it’s not that difficult to browse a pile of directories faster. Now stop typing “cd ../../..” endlessly by using these tools. If you know any other worth trying tool or method to navigate directories faster, feel free to let us know in the comment section below. I will review and add them in this guide. + +And, that’s all for now. Hope this helps. More good stuffs to come. Stay tuned! + +Cheers! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/navigate-directories-faster-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/2017/12/Navigate-Directories-Faster-In-Linux-720x340.png +[2]: https://www.ostechnix.com/use-pushd-popd-dirs-commands-faster-cli-navigation/ +[3]: https://tracker.debian.org/pkg/bd +[4]: https://launchpad.net/ubuntu/+source/bd +[5]: https://www.ostechnix.com/view-directory-tree-structure-linux/ +[6]: http://www.ostechnix.com/wp-content/uploads/2017/12/Navigate-Directories-Faster-1.png +[7]: https://github.com/vigneshwaranr/bd +[8]: https://github.com/shannonmoeller/up +[9]: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-examples/ +[10]: https://www.ostechnix.com/create-shortcuts-frequently-used-directories-shell/ +[11]: http://www.ostechnix.com/wp-content/uploads/2018/12/tree-command-output.png +[12]: http://www.ostechnix.com/wp-content/uploads/2018/12/pwd-command.png +[13]: http://www.ostechnix.com/wp-content/uploads/2018/12/cdpath.png From 710c02cfdae60035acb8300dac8729b20339d73a Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:20:16 +0800 Subject: [PATCH 0268/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Bloc?= =?UTF-8?q?kchain=202.0=20=E2=80=93=20An=20Introduction=20To=20Hyperledger?= =?UTF-8?q?=20Project=20(HLP)=20[Part=208]=20sources/tech/20190505=20Block?= =?UTF-8?q?chain=202.0=20-=20An=20Introduction=20To=20Hyperledger=20Projec?= =?UTF-8?q?t=20(HLP)=20-Part=208.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...on To Hyperledger Project (HLP) -Part 8.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md diff --git a/sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md b/sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md new file mode 100644 index 0000000000..bb1d187ea4 --- /dev/null +++ b/sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – An Introduction To Hyperledger Project (HLP) [Part 8]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – An Introduction To Hyperledger Project (HLP) [Part 8] +====== + +![Introduction To Hyperledger Project][1] + +Once a new technology platform reaches a threshold level of popularity in terms of active development and commercial interests, major global companies and smaller start-ups alike rush to catch a slice of the pie. **Linux** was one such platform back in the day. Once the ubiquity of its applications was realized individuals, firms, and institutions started displaying their interest in it and by 2000 the **Linux foundation** was formed. + +The Linux foundation aims to standardize and develop Linux as a platform by sponsoring their development team. The Linux Foundation is a non-profit organization that is supported by software and IT behemoths such as Microsoft, Oracle, Samsung, Cisco, IBM, Intel among others[1]. This is excluding the hundreds of individual developers who offer their services for the betterment of the platform. Over the years the Linux foundation has taken many projects under its roof. The **Hyperledger Project** is their fastest growing one till date. + +Such consortium led development have a lot of advantages when it comes to furthering tech into usable useful forms. Developing the standards, libraries and all the back-end protocols for large scale projects are expensive and resource intensive without a shred of income generating from it. Hence, it makes sense for companies to pool in their resources to develop the common “boring” parts by supporting such organizations and later upon completing work on these standard parts to simply plug & play and customize their products afterwards. Apart from the economics of the model, such collaborative efforts also yield standards allowing for easier use and integration into aspiring products and services. + +Other major innovations that were once or are currently being developed following the said consortium model include standards for WiFi (The Wi-Fi alliance), Mobile Telephony etc. + +### Introduction to Hyperledger Project (HLP) + +The Hyperledger project was launched in December 2015 by the Linux foundation as is currently among the fastest growing project they’ve incubated. It’s an umbrella organization for collaborative efforts into developing and advancing tools & standards for [**blockchain**][2] based distributed ledger technologies(DLT). Major industry players supporting the project include **IBM** , **Intel** and **SAP Ariba** among [**others**][3]. The HLP aims to create frameworks for individuals and companies to create shared as well as closed blockchains as required to further their own requirements. The design principles include a strong tilt toward developing a globally deployable, scalable, robust platform with a focus on privacy, and future auditability[2]. It is also important to note that most of the blockchains proposed and the frame. + +### Development goals and structure: Making it plug & play + +Although enterprise facing platforms exist from the likes of the Ethereum alliance, HLP is by definition business facing and supported by industry behemoths who contribute and further development in the many modules that come under the HLP banner. The HLP incubates projects in development after their induction into the cause and after finishing work on it and correcting the knick-knacks rolls it out for the public. Members of the Hyperledger project contribute their own work such as how IBM contributed their Fabric platform for collaborative development. The codebase is absorbed and developed in house by the group in the project and rolled out for all members equally for their use. + +Such processes make the modules in HLP highly flexible plug-in frameworks which will support rapid development and roll-outs in enterprise settings. Furthermore, other comparable platforms are open **permission-less blockchains** or rather **public chains** by default and even though it is possible to adapt them to specific applications, HLP modules support the feature natively. + +The differences and use cases of public & private blockchains are covered more [**here**][4] in this comparative primer on the same. + +The Hyperledger project’s mission is four-fold according to **Brian Behlendorf** , the executive director of the project. + +They are: + + 1. To create an enterprise grade DLT framework and standards which anyone can port to suit their specific industrial or personal needs. + 2. To give rise to a robust open source community to aid the ecosystem. + 3. To promote and further participation of industry members of the said ecosystem such as member firms. + 4. To host a neutral unbiased infrastructure for the HLP community to gather and share updates and developments regarding the same. + + + +The original document can be accessed [**here**][5]****. + +### Structure of the HLP + +The **HLP consists of 12 projects** that are classified as independent modules, each usually structured and working independently to develop their module. These are first studied for their capabilities and viability before being incubated. Proposals for additions can be made by any member of the organization. After the project is incubated active development ensues after which it is rolled out. The interoperability between these modules are given a high priority, hence regular communication between these groups are maintained by the community. Currently 4 of these projects are categorized as active. The active tag implies these are ready for use but not ready for a major release yet. These 4 are arguably the most significant or rather fundamental modules to furthering the blockchain revolution. We’ll look at the individual modules and their functionalities at a later time in detail. However, a brief description of a the Hyperledger Fabric platform, arguably the most popular among them follows. + +### Hyperledger Fabric + +The **Hyperledger Fabric** [2] is a fully open-source, permissioned (non-public) blockchain-based DLT platform that is designed keeping enterprise uses in mind. The platform provides features and is structured to fit the enterprise environment. It is highly modular allowing its developers to choose from different consensus protocols, **chain code protocols ([smart contracts][6])** , or identity management systems etc., as they go along. **It is a permissioned blockchain based platform** that’s makes use of an identity management system, meaning participants will be aware of each other’s identities which is required in an enterprise setting. Fabric allows for smart contract ( _ **“chaincode”, is the term that the Hyperledger team uses**_ ) development in a variety of mainstream programming languages including **Java** , **Javascript** , **Go** etc. This allows institutions and enterprises to make use of their existing talent in the area without hiring or re-training developers to develop their own smart contracts. Fabric also uses an execute-order-validate system to handle smart contracts for better reliability compared to the standard order-validate system that is used by other platforms providing smart contract functionality. Pluggable performance, identity management systems, DBMS, Consensus platforms etc. are other features of Fabric that keeps it miles ahead of its competition. + +### Conclusion + +Projects such as the Hyperledger Fabric platforms enable a faster rate of adoption of blockchain technology in mainstream use-cases. The Hyperledger community structure itself supports open governance principles and since all the projects are led as open source platforms, this improves the security and accountability that the teams exhibit in pushing out commitments. + +Since major applications of such projects involve working with enterprises to further development of platforms and standards, the Hyperledger project is currently at a great position with respect to comparable projects by others. + +**References:** + + * **[1][Samsung takes a seat with Intel and IBM at the Linux Foundation | TheINQUIRER][7]** + * **[2] E. Androulaki et al., “Hyperledger Fabric: A Distributed Operating System for Permissioned Blockchains,” 2018.** + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ + +作者:[editor][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/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Introduction-To-Hyperledger-Project-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.hyperledger.org/members +[4]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ +[5]: http://www.hitachi.com/rev/archive/2017/r2017_01/expert/index.html +[6]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[7]: https://www.theinquirer.net/inquirer/news/2182438/samsung-takes-seat-intel-ibm-linux-foundation From 70b9cb6b48d9b78377de5b0e1dda6d1b3cd866bd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:21:08 +0800 Subject: [PATCH 0269/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Bloc?= =?UTF-8?q?kchain=202.0=20=E2=80=93=20Public=20Vs=20Private=20Blockchain?= =?UTF-8?q?=20Comparison=20[Part=207]=20sources/tech/20190505=20Blockchain?= =?UTF-8?q?=202.0=20-=20Public=20Vs=20Private=20Blockchain=20Comparison=20?= =?UTF-8?q?-Part=207.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s Private Blockchain Comparison -Part 7.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md diff --git a/sources/tech/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md b/sources/tech/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md new file mode 100644 index 0000000000..a954e8514e --- /dev/null +++ b/sources/tech/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Public Vs Private Blockchain Comparison [Part 7]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – Public Vs Private Blockchain Comparison [Part 7] +====== + +![Public vs Private blockchain][1] + +The previous part of the [**Blockchain 2.0**][2] series explored the [**the state of Smart contracts**][3] now. This post intends to throw some light on the different types of blockchains that can be created. Each of these are used for vastly different applications and depending on the use cases, the protocol followed by each of these differ. Now let us go ahead and learn about **Public vs Private blockchain comparison** with Open source and proprietary technology. + +The fundamental three-layer structure of a blockchain based distributed ledger as we know is as follows: + +![][4] + +Figure 1 – Fundamental structure of Blockchain-based ledgers + +The differences between the types mentioned here is attributable primarily to the protocol that rests on the underlying blockchain. The protocol dictates rules for the participants and the behavior of the blockchain in response to the said participation. + +Remember to keep the following things in mind while reading through this article: + + * Platforms such as these are always created to solve a use-case requirement. There is no one direction that the technology should take that is best. Blockchains for instance have tremendous applications and some of these might require dropping features that seem significant in other settings. **Decentralized storage** is a major example in this regard. + * Blockchains are basically database systems keeping track of information by timestamping and organizing data in the form of blocks. Creators of such blockchains can choose who has the right to make these blocks and perform alterations. + * Blockchains can be “centralized” as well, and participation in varying extents can be limited to those who this “central authority” deems eligible. + + + +Most blockchains are either **public** or **private**. Broadly speaking, public blockchains can be considered as being the equivalent of open source software and most private blockchains can be seen as proprietary platforms deriving from the public ones. The figure below should make the basic difference obvious to most of you. + +![][5] + +Figure 2 – Public vs Private blockchain comparison with Open source and Proprietary Technology + +This is not to say that all private blockchains are derived from open public ones. The most popular ones however usually are though. + +### Public Blockchains + +A public blockchain can be considered as a **permission-less platform** or **network**. Anyone with the knowhow and computing resources can participate in it. This will have the following implications: + + * Anyone can join and participate in a public blockchain network. All the “participant” needs is a stable internet connection along with computing resources. + * Participation will include reading, writing, verifying, and providing consensus during transactions. An example for participating individuals would be **Bitcoin miners**. In exchange for participating in the network the miners are paid back in Bitcoins in this case. + * The platform is decentralized completely and fully redundant. + * Because of the decentralized nature, no one entity has complete control over the data recorded in the ledger. To validate a block all (or most) participants need to vet the data. + * This means that once information is verified and recorded, it cannot be altered easily. Even if it is, its impossible to not leave marks. + * The identity of participants remains anonymous by design in platforms such as **BITCOIN** and **LITECOIN**. These platforms by design aim for protecting and securing user identities. This is primarily a feature provided by the overlying protocol stack. + * Examples for public blockchain networks are **BITCOIN** , **LITECOIN** , **ETHEREUM** etc. + * Extensive decentralizations mean that gaining consensus on transactions might take a while compared to what is typically possible over blockchain ledger networks and throughput can be a challenge for large enterprises aiming for pushing a very high number of transactions every instant. + * The open participation and often the high number of such participants in open chains such as bitcoin add up to considerable initial investments in computing equipment and energy costs. + + + +### Private Blockchain + +In contrast, a private blockchain is a **permissioned blockchain**. Meaning: + + * Permission to participate in the network is restricted and is presided over by the owner or institution overseeing the network. Meaning even though an individual will be able to store data and transact (send and receive payments for example), the validation and storage of these transactions will be done only by select participants. + * Participation even once permission is given by the central authority will be limited by terms. For instance, in case of a private blockchain network run by a financial institution, not every customer will have access to the entire blockchain ledger, and even among those with the permission, not everyone will be able to access everything. Permissions to access select services will be given by the central figure in this case. This is often referred to as **“channeling”**. + * Such systems have significantly larger throughput capabilities and also showcase much faster transaction speeds compared to their public counterparts because a block of information only needs to be validated by a select few. + * Security by design is something the public blockchains are renowned for. They achieve this +by: + * Anonymizing participants, + * Distributed & redundant but encrypted storage on multiple nodes, + * Mass consensus required for creating and altering data. + + + +Private blockchains usually don’t feature any of these in their protocol. This makes the system only as secure as most cloud-based database systems currently in use. + +### A note for the wise + +An important point to note is this, the fact that they’re named public or private (or open or closed) has nothing to do with the underlying code base. The code or the literal foundations on which the platforms are based on may or may not be publicly available and or developed in either of these cases. **R3** is a **DLT** ( **D** istributed **L** edger **T** echnology) company that leads a public consortium of over 200 multinational institutions. Their aim is to further development of blockchain and related distributed ledger technology in the domain of finance and commerce. **Corda** is the product of this joint effort. R3 defines corda as a blockchain platform that is built specially for businesses. The codebase for the same is open source and developers all over the world are encouraged to contribute to the project. However, given its business facing nature and the needs it is meant to address, corda would be categorized as a permissioned closed blockchain platform. Meaning businesses can choose the participants of the network once it is deployed and choose the kind of information these participants can access through the use of natively available smart contract tools. + +While it is a reality that public platforms like Bitcoin and Ethereum are responsible for the widespread awareness and development going on in the space, it can still be argued that private blockchains designed for specific use cases in enterprise or business settings is what will lead monetary investments in the short run. These are the platforms most of us will see implemented the near future in practical ways. + +Read the next guide about Hyperledger project in this series. + + * [**Blockchain 2.0 – An Introduction To Hyperledger Project (HLP)**][6] + + + +We are working on many interesting topics on Blockchain technology. Stay tuned! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ + +作者:[editor][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/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Public-Vs-Private-Blockchain-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/ +[4]: http://www.ostechnix.com/wp-content/uploads/2019/04/blockchain-architecture.png +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/Public-vs-Private-blockchain-comparison.png +[6]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ From 2a7418b53a2721bd3036a06e7d98e10b5442f064 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:22:28 +0800 Subject: [PATCH 0270/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Duc?= =?UTF-8?q?=20=E2=80=93=20A=20Collection=20Of=20Tools=20To=20Inspect=20And?= =?UTF-8?q?=20Visualize=20Disk=20Usage=20sources/tech/20190505=20Duc=20-?= =?UTF-8?q?=20A=20Collection=20Of=20Tools=20To=20Inspect=20And=20Visualize?= =?UTF-8?q?=20Disk=20Usage.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ols To Inspect And Visualize Disk Usage.md | 261 ++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md diff --git a/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md b/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md new file mode 100644 index 0000000000..edba21d327 --- /dev/null +++ b/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md @@ -0,0 +1,261 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Duc – A Collection Of Tools To Inspect And Visualize Disk Usage) +[#]: via: (https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Duc – A Collection Of Tools To Inspect And Visualize Disk Usage +====== + +![Duc - A Collection Of Tools To Inspect And Visualize Disk Usage][1] + +**Duc** is a collection of tools that can be used to index, inspect and visualize disk usage on Unix-like operating systems. Don’t think of it as a simple CLI tool that merely displays a fancy graph of your disk usage. It is built to scale quite well on huge filesystems. Duc has been tested on systems that consisted of more than 500 million files and several petabytes of storage without any problems. + +Duc is quite fast and versatile tool. It stores your disk usage in an optimized database, so you can quickly find where your bytes are as soon as the index is completed. In addition, it comes with various user interfaces and back-ends to access the database and draw the graphs. + +Here is the list of currently supported user interfaces (UI): + + 1. Command line interface (ls), + 2. Ncurses console interface (ui), + 3. X11 GUI (duc gui), + 4. OpenGL GUI (duc gui). + + + +List of supported database back-ends: + + * Tokyocabinet, + * Leveldb, + * Sqlite3. + + + +Duc uses **Tokyocabinet** as default database backend. + +### Install Duc + +Duc is available in the default repositories of Debian and its derivatives such as Ubuntu. So installing Duc on DEB-based systems is a piece of cake. + +``` +$ sudo apt-get install duc +``` + +On other Linux distributions, you may need to manually compile and install Duc from source as shown below. + +Download latest duc source .tgz file from the [**releases**][2] page on github. As of writing this guide, the latest version was **1.4.4**. + +``` +$ wget https://github.com/zevv/duc/releases/download/1.4.4/duc-1.4.4.tar.gz +``` + +Then run the following commands one by one to install DUC. + +``` +$ tar -xzf duc-1.4.4.tar.gz +$ cd duc-1.4.4 +$ ./configure +$ make +$ sudo make install +``` + +### Duc Usage + +The typical usage of duc is: + +``` +$ duc +``` + +You can view the list of general options and sub-commands by running the following command: + +``` +$ duc help +``` + +You can also know the the usage of a specific subcommand as below. + +``` +$ duc help +``` + +To view the extensive list of all commands and their options, simply run: + +``` +$ duc help --all +``` + +Let us now se some practical use cases of duc utility. + +### Create Index (database) + +First of all, you need to create an index file (database) of your filesystem. To create an index file, use “duc index” command. + +For example, to create an index of your **/home** directory, simply run: + +``` +$ duc index /home +``` + +The above command will create the index of your /home/ directory and save it in **$HOME/.duc.db** file. If you have added new files/directories in the /home directory in future, just re-run the above command at any time later to rebuild the index. + +### Query Index + +Duc has various sub-commands to query and explore the index. + +To view the list of available indexes, run: + +``` +$ duc info +``` + +**Sample output:** + +``` +Date Time Files Dirs Size Path +2019-04-09 15:45:55 3.5K 305 654.6M /home +``` + +As you see in the above output, I have already indexed the /home directory. + +To list all files and directories in the current working directory, you can do: + +``` +$ duc ls +``` + +To list files/directories in a specific directory, for example **/home/sk/Downloads** , just pass the path as argument like below. + +``` +$ duc ls /home/sk/Downloads +``` + +Similarly, run **“duc ui”** command to open a **ncurses** based console user interface for exploring the file system usage and run **“duc gui”** to start a **graphical (X11)** interface to explore the file system. + +To know more about a sub-command usage, simply refer the help section. + +``` +$ duc help ls +``` + +The above command will display the help section of “ls” subcommand. + +### Visualize Disk Usage + +In the previous section, we have seen how to list files and directories using duc subcommands. In addition, you can even show the file sizes in a fancy graph. + +To show the graph of a given path, use “ls” subcommand like below. + +``` +$ duc ls -Fg /home/sk +``` + +Sample output: + +![][3] + +Visualize disk usage using “duc ls” command + +As you see in the above output, the “ls” subcommand queries the duc database and lists the inclusive size of all +files and directories of the given path i.e **/home/sk/** in this case. + +Here, the **“-F”** option is used to append file type indicator (one of */) to entries and the **“-g”** option is used to draw graph with relative size for each entry. + +Please note that if no path is given, the current working directory is explored. + +You can use **-R** option to view the disk usage result in [**tree**][4] structure. + +``` +$ duc ls -R /home/sk +``` + +![][5] + +Visualize disk usage in tree structure + +To query the duc database and open a **ncurses** based console user interface for exploring the disk usage of given path, use **“ui”** subcommand like below. + +``` +$ duc ui /home/sk +``` + +![][6] + +Similarly, we use **“gui”** subcommand to query the duc database and start a **graphical (X11)** interface to explore the disk usage of the given path: + +``` +$ duc gui /home/sk +``` + +![][7] + +Like I already mentioned earlier, we can learn more about a subcommand usage like below. + +``` +$ duc help +``` + +I covered the basic usage part only. Refer man pages for more details about “duc” tool. + +``` +$ man duc +``` + +* * * + +**Related read:** + + * [**Filelight – Visualize Disk Usage On Your Linux System**][8] + * [**Some Good Alternatives To ‘du’ Command**][9] + * [**How To Check Disk Space Usage In Linux Using Ncdu**][10] + * [**Agedu – Find Out Wasted Disk Space In Linux**][11] + * [**How To Find The Size Of A Directory In Linux**][12] + * [**The df Command Tutorial With Examples For Beginners**][13] + + + +* * * + +### Conclusion + +Duc is simple yet useful disk usage viewer. If you want to quickly and easily know which files/directories are eating up your disk space, Duc might be a good choice. What are you waiting for? Go get this tool already, scan your filesystem and get rid of unused files/directories. + +And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! + +Cheers! + +**Resource:** + + * [**Duc website**][14] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/ + +作者:[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/2019/04/duc-720x340.png +[2]: https://github.com/zevv/duc/releases +[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-1-1.png +[4]: https://www.ostechnix.com/view-directory-tree-structure-linux/ +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-2.png +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-3.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-4.png +[8]: https://www.ostechnix.com/filelight-visualize-disk-usage-on-your-linux-system/ +[9]: https://www.ostechnix.com/some-good-alternatives-to-du-command/ +[10]: https://www.ostechnix.com/check-disk-space-usage-linux-using-ncdu/ +[11]: https://www.ostechnix.com/agedu-find-out-wasted-disk-space-in-linux/ +[12]: https://www.ostechnix.com/find-size-directory-linux/ +[13]: https://www.ostechnix.com/the-df-command-tutorial-with-examples-for-beginners/ +[14]: https://duc.zevv.nl/ From f5e5ab97a6d07de59dcae4d022c2423d7136dabc Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:26:42 +0800 Subject: [PATCH 0271/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Linu?= =?UTF-8?q?x=20Shell=20Script=20To=20Monitor=20Disk=20Space=20Usage=20And?= =?UTF-8?q?=20Send=20Email=20sources/tech/20190505=20Linux=20Shell=20Scrip?= =?UTF-8?q?t=20To=20Monitor=20Disk=20Space=20Usage=20And=20Send=20Email.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Monitor Disk Space Usage And Send Email.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md diff --git a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md new file mode 100644 index 0000000000..38a1d6419b --- /dev/null +++ b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -0,0 +1,202 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Shell Script To Monitor Disk Space Usage And Send Email) +[#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Linux Shell Script To Monitor Disk Space Usage And Send Email +====== + +There are numerous monitoring tools are available in market to monitor Linux systems and it will send an email when the system reaches the threshold limit. + +It monitors everything such as CPU utilization, Memory utilization, swap utilization, disk space utilization and much more. + +However, it’s suitable for small and big environment. + +Think about if you have only few systems then what will be the best approach on this. + +Yup, we want to write a **[shell script][1]** to achieve this. + +In this tutorial we are going to write a shell script to monitor disk space usage on system. + +When the system reaches the given threshold then it will trigger a mail to corresponding email id. + +We have added totally four shell scripts in this article and each has been used for different purpose. + +Later, we will come up with other shell scripts to monitor CPU, Memory and Swap utilization. + +Before step into that, i would like to clarify one thing which i noticed regarding the disk space usage shell script. + +Most of the users were commented in multiple blogs saying they were getting the following error message when they are running the disk space usage script. + +``` +# sh /opt/script/disk-usage-alert-old.sh + +/dev/mapper/vg_2g-lv_root +test-script.sh: line 7: [: /dev/mapper/vg_2g-lv_root: integer expression expected +/ 9.8G +``` + +Yes that’s right. Even, i had faced the same issue when i ran the script first time. Later, i had found the root causes. + +When you use “df -h” or “df -H” in shell script for disk space alert on RHEL 5 & RHEL 6 based system, you will be end up with the above error message because the output is not in the proper format, see the below output. + +To overcome this issue, we need to use “df -Ph” (POSIX output format) but by default “df -h” is working fine on RHEL 7 based systems. + +``` +# df -h + +Filesystem Size Used Avail Use% Mounted on +/dev/mapper/vg_2g-lv_root + 10G 6.7G 3.4G 67% / +tmpfs 7.8G 0 7.8G 0% /dev/shm +/dev/sda1 976M 95M 830M 11% /boot +/dev/mapper/vg_2g-lv_home + 5.0G 4.3G 784M 85% /home +/dev/mapper/vg_2g-lv_tmp + 4.8G 14M 4.6G 1% /tmp +``` + +### Method-1 : Linux Shell Script To Monitor Disk Space Usage And Send Email + +You can use the following shell script to monitor disk space usage on Linux system. + +It will send an email when the system reaches the given threshold limit. In this example, we set threshold limit at 60% for testing purpose and you can change this limit as per your requirements. + +It will send multiple mails if more than one file systems get reached the given threshold limit because the script is using loop. + +Also, replace your email id instead of us to get this alert. + +``` +# vi /opt/script/disk-usage-alert.sh + +#!/bin/sh +df -Ph | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5,$1 }' | while read output; +do + echo $output + used=$(echo $output | awk '{print $1}' | sed s/%//g) + partition=$(echo $output | awk '{print $2}') + if [ $used -ge 60 ]; then + echo "The partition \"$partition\" on $(hostname) has used $used% at $(date)" | mail -s "Disk Space Alert: $used% Used On $(hostname)" [email protected] + fi +done +``` + +**Output:** I got the following two email alerts. + +``` +The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 + +The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 +``` + +Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/script/disk-usage-alert.sh +``` + +### Method-2 : Linux Shell Script To Monitor Disk Space Usage And Send Email + +Alternatively, you can use the following shell script. We have made few changes in this compared with above script. + +``` +# vi /opt/script/disk-usage-alert-1.sh + +#!/bin/sh +df -Ph | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5,$1 }' | while read output; +do + max=60% + echo $output + used=$(echo $output | awk '{print $1}') + partition=$(echo $output | awk '{print $2}') + if [ ${used%?} -ge ${max%?} ]; then + echo "The partition \"$partition\" on $(hostname) has used $used at $(date)" | mail -s "Disk Space Alert: $used Used On $(hostname)" [email protected] + fi +done +``` + +**Output:** I got the following two email alerts. + +``` +The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 + +The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 +``` + +Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/script/disk-usage-alert-1.sh +``` + +### Method-3 : Linux Shell Script To Monitor Disk Space Usage And Send Email + +I would like to go with this method. Since, it work like a charm and you will be getting single email for everything. + +This is very simple and straightforward. + +``` +*/10 * * * * df -Ph | sed s/%//g | awk '{ if($5 > 60) print $0;}' | mail -s "Disk Space Alert On $(hostname)" [email protected] +``` + +**Output:** I got a single mail for all alerts. + +``` +Filesystem Size Used Avail Use Mounted on +/dev/mapper/vg_2g-lv_root 10G 6.7G 3.4G 67 / +/dev/mapper/vg_2g-lv_home 5.0G 4.3G 784M 85 /home +``` + +### Method-4 : Linux Shell Script To Monitor Disk Space Usage Of Particular Partition And Send Email + +If anybody wants to monitor the particular partition then you can use the following shell script. Simply replace your filesystem name instead of us. + +``` +# vi /opt/script/disk-usage-alert-2.sh + +#!/bin/bash +used=$(df -Ph | grep '/dev/mapper/vg_2g-lv_dbs' | awk {'print $5'}) +max=80% +if [ ${used%?} -ge ${max%?} ]; then +echo "The Mount Point "/DB" on $(hostname) has used $used at $(date)" | mail -s "Disk space alert on $(hostname): $used used" [email protected] +fi +``` + +**Output:** I got the following email alerts. + +``` +The partition /dev/mapper/vg_2g-lv_dbs on 2g.CentOS6 has used 82% at Mon Apr 29 06:16:14 IST 2019 +``` + +Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/script/disk-usage-alert-2.sh +``` + +**Note:** You will be getting an email alert 10 mins later since the script has scheduled to run every 10 minutes (But it’s not exactly 10 mins and it depends the timing). + +Say for example. If your system reaches the limit at 8.25 then you will get an email alert in another 5 mins. Hope it’s clear now. + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-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/ +[2]: https://www.2daygeek.com/crontab-cronjob-to-schedule-jobs-in-linux/ From 779cd1e8ac51d6cfa9814c2b7bcc0dfd8db19131 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:26:58 +0800 Subject: [PATCH 0272/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20How?= =?UTF-8?q?=20To=20Install/Uninstall=20Listed=20Packages=20From=20A=20File?= =?UTF-8?q?=20In=20Linux=3F=20sources/tech/20190505=20How=20To=20Install-U?= =?UTF-8?q?ninstall=20Listed=20Packages=20From=20A=20File=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ll Listed Packages From A File In Linux.md | 338 ++++++++++++++++++ 1 file changed, 338 insertions(+) create mode 100644 sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md diff --git a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md new file mode 100644 index 0000000000..5b42159f08 --- /dev/null +++ b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -0,0 +1,338 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install/Uninstall Listed Packages From A File In Linux?) +[#]: via: (https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Install/Uninstall Listed Packages From A File In Linux? +====== + +In some case you may want to install list of packages from one server to another server. + +For example, You have installed 15 packages on ServerA, and those packages needs to be installed on ServerB, ServerC, etc., + +We can manually install all the packages but it’s time consuming process. + +It can be done for one or two servers, think about if you have around 10 servers. + +In this case it doesn’t help you then What will be the solution? + +Don’t worry we are here to help you out in this situation or scenario. + +We have added four methods in this article to overcome this situation. + +I hope this will help you to fix your issue. I have tested these commands on CentOS7 and Ubuntu 18.04 systems. + +I hope this will work with other distributions too. Just replace with distribution official package manager command instead of us. + +Navigate to the following article if you want to **[check list of installed packages in Linux system][1]**. + +For example, if you would like to create a package lists from RHEL based system then use the following steps. Do the same for other distributions as well. + +``` +# rpm -qa --last | head -15 | awk '{print $1}' > /tmp/pack1.txt + +# cat /tmp/pack1.txt +mariadb-server-5.5.60-1.el7_5.x86_64 +perl-DBI-1.627-4.el7.x86_64 +perl-DBD-MySQL-4.023-6.el7.x86_64 +perl-PlRPC-0.2020-14.el7.noarch +perl-Net-Daemon-0.48-5.el7.noarch +perl-IO-Compress-2.061-2.el7.noarch +perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 +mariadb-5.5.60-1.el7_5.x86_64 +perl-Data-Dumper-2.145-3.el7.x86_64 +perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 +httpd-2.4.6-88.el7.centos.x86_64 +mailcap-2.1.41-2.el7.noarch +httpd-tools-2.4.6-88.el7.centos.x86_64 +apr-util-1.5.2-6.el7.x86_64 +apr-1.4.8-3.el7_4.1.x86_64 +``` + +### Method-1 : How To Install Listed Packages From A File In Linux With Help Of cat Command? + +To achieve this, i would like to go with this first method. As this very simple and straightforward. + +To do so, just create a file and add the list of packages that you want to install it. + +For testing purpose, we are going to add only the below three packages into the following file. + +``` +# cat /tmp/pack1.txt + +apache2 +mariadb-server +nano +``` + +Simply run the following **[apt command][2]** to install all the packages in a single shot from a file in Ubuntu/Debian systems. + +``` +# apt -y install $(cat /tmp/pack1.txt) + +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages were automatically installed and are no longer required: + libopts25 sntp +Use 'sudo apt autoremove' to remove them. +Suggested packages: + apache2-doc apache2-suexec-pristine | apache2-suexec-custom spell +The following NEW packages will be installed: + apache2 mariadb-server nano +0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded. +Need to get 339 kB of archives. +After this operation, 1,377 kB of additional disk space will be used. +Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.6 [95.1 kB] +Get:2 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 nano amd64 2.9.3-2 [231 kB] +Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mariadb-server all 1:10.1.38-0ubuntu0.18.04.1 [12.9 kB] +Fetched 339 kB in 19s (18.0 kB/s) +Selecting previously unselected package apache2. +(Reading database ... 290926 files and directories currently installed.) +Preparing to unpack .../apache2_2.4.29-1ubuntu4.6_amd64.deb ... +Unpacking apache2 (2.4.29-1ubuntu4.6) ... +Selecting previously unselected package nano. +Preparing to unpack .../nano_2.9.3-2_amd64.deb ... +Unpacking nano (2.9.3-2) ... +Selecting previously unselected package mariadb-server. +Preparing to unpack .../mariadb-server_1%3a10.1.38-0ubuntu0.18.04.1_all.deb ... +Unpacking mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... +Setting up apache2 (2.4.29-1ubuntu4.6) ... +Processing triggers for ureadahead (0.100.0-20) ... +Processing triggers for install-info (6.5.0.dfsg.1-2) ... +Setting up nano (2.9.3-2) ... +update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode +update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode +Processing triggers for systemd (237-3ubuntu10.20) ... +Processing triggers for man-db (2.8.3-2ubuntu0.1) ... +Setting up mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +``` + +For removal, use the same format with appropriate option. + +``` +# apt -y remove $(cat /tmp/pack1.txt) +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages were automatically installed and are no longer required: + apache2-bin apache2-data apache2-utils galera-3 libaio1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 liblua5.2-0 + libmysqlclient20 libopts25 libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common sntp socat +Use 'apt autoremove' to remove them. +The following packages will be REMOVED: + apache2 mariadb-server nano +0 upgraded, 0 newly installed, 3 to remove and 24 not upgraded. +After this operation, 1,377 kB disk space will be freed. +(Reading database ... 291046 files and directories currently installed.) +Removing apache2 (2.4.29-1ubuntu4.6) ... +Removing mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +Removing nano (2.9.3-2) ... +update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in auto mode +Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... +Processing triggers for install-info (6.5.0.dfsg.1-2) ... +Processing triggers for man-db (2.8.3-2ubuntu0.1) ... +``` + +Use the following **[yum command][3]** to install listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). + +``` +# yum -y install $(cat /tmp/pack1.txt) +``` + +Use the following format to uninstall listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). + +``` +# yum -y remove $(cat /tmp/pack1.txt) +``` + +Use the following **[dnf command][4]** to install listed packages from a file on Fedora system. + +``` +# dnf -y install $(cat /tmp/pack1.txt) +``` + +Use the following format to uninstall listed packages from a file on Fedora system. + +``` +# dnf -y remove $(cat /tmp/pack1.txt) +``` + +Use the following **[zypper command][5]** to install listed packages from a file on openSUSE system. + +``` +# zypper -y install $(cat /tmp/pack1.txt) +``` + +Use the following format to uninstall listed packages from a file on openSUSE system. + +``` +# zypper -y remove $(cat /tmp/pack1.txt) +``` + +Use the following **[pacman command][6]** to install listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. + +``` +# pacman -S $(cat /tmp/pack1.txt) +``` + +Use the following format to uninstall listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. + +``` +# pacman -Rs $(cat /tmp/pack1.txt) +``` + +### Method-2 : How To Install Listed Packages From A File In Linux With Help Of cat And xargs Command? + +Even, i prefer to go with this method because this is very simple and straightforward method. + +Use the following apt command to install listed packages from a file on Debian based systems such as Debian, Ubuntu and Linux Mint. + +``` +# cat /tmp/pack1.txt | xargs apt -y install +``` + +Use the following apt command to uninstall listed packages from a file on Debian based systems such as Debian, Ubuntu and Linux Mint. + +``` +# cat /tmp/pack1.txt | xargs apt -y remove +``` + +Use the following yum command to install listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). + +``` +# cat /tmp/pack1.txt | xargs yum -y install +``` + +Use the following format to uninstall listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). + +``` +# cat /tmp/pack1.txt | xargs yum -y remove +``` + +Use the following dnf command to install listed packages from a file on Fedora system. + +``` +# cat /tmp/pack1.txt | xargs dnf -y install +``` + +Use the following format to uninstall listed packages from a file on Fedora system. + +``` +# cat /tmp/pack1.txt | xargs dnf -y remove +``` + +Use the following zypper command to install listed packages from a file on openSUSE system. + +``` +# cat /tmp/pack1.txt | xargs zypper -y install +``` + +Use the following format to uninstall listed packages from a file on openSUSE system. + +``` +# cat /tmp/pack1.txt | xargs zypper -y remove +``` + +Use the following pacman command to install listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. + +``` +# cat /tmp/pack1.txt | xargs pacman -S +``` + +Use the following format to uninstall listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. + +``` +# cat /tmp/pack1.txt | xargs pacman -Rs +``` + +### Method-3 : How To Install Listed Packages From A File In Linux With Help Of For Loop Command? + +Alternatively we can use the “For Loop” command to achieve this. + +To install bulk packages. Use the below format to run a “For Loop” with single line. + +``` +# for pack in `cat /tmp/pack1.txt` ; do apt -y install $i; done +``` + +To install bulk packages with shell script use the following “For Loop”. + +``` +# vi /opt/scripts/bulk-package-install.sh + +#!/bin/bash +for pack in `cat /tmp/pack1.txt` +do apt -y remove $pack +done +``` + +Set an executable permission to `bulk-package-install.sh` file. + +``` +# chmod + bulk-package-install.sh +``` + +Finally run the script to achieve this. + +``` +# sh bulk-package-install.sh +``` + +### Method-4 : How To Install Listed Packages From A File In Linux With Help Of While Loop Command? + +Alternatively we can use the “While Loop” command to achieve this. + +To install bulk packages. Use the below format to run a “While Loop” with single line. + +``` +# file="/tmp/pack1.txt"; while read -r pack; do apt -y install $pack; done < "$file" +``` + +To install bulk packages with shell script use the following "While Loop". + +``` +# vi /opt/scripts/bulk-package-install.sh + +#!/bin/bash +file="/tmp/pack1.txt" +while read -r pack +do apt -y remove $pack +done < "$file" +``` + +Set an executable permission to `bulk-package-install.sh` file. + +``` +# chmod + bulk-package-install.sh +``` + +Finally run the script to achieve this. + +``` +# sh bulk-package-install.sh +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/ + +作者:[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/check-installed-packages-in-rhel-centos-fedora-debian-ubuntu-opensuse-arch-linux/ +[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[5]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ From a31e49386d3baed8bd24805b505198b633a98cf1 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:27:09 +0800 Subject: [PATCH 0273/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20apt-?= =?UTF-8?q?clone=20:=20Backup=20Installed=20Packages=20And=20Restore=20Tho?= =?UTF-8?q?se=20On=20Fresh=20Ubuntu=20System=20sources/tech/20190505=20apt?= =?UTF-8?q?-clone=20-=20Backup=20Installed=20Packages=20And=20Restore=20Th?= =?UTF-8?q?ose=20On=20Fresh=20Ubuntu=20System.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd Restore Those On Fresh Ubuntu System.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md diff --git a/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md new file mode 100644 index 0000000000..ab8efd7599 --- /dev/null +++ b/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) +[#]: via: (https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System +====== + +Package installation is become more easier on Ubuntu/Debian based systems when we use apt-clone utility. + +apt-clone will work for you, if you want to build few systems with same set of packages. + +It’s time consuming process if you want to build and install necessary packages manually on each systems. + +It can be achieved in many ways and there are many utilities are available in Linux. + +We have already wrote an article about **[Aptik][1]** in the past. + +It’s one of the utility that allow Ubuntu users to backup and restore system settings and data + +### What Is apt-clone? + +[apt-clone][2] lets allow you to create backup of all installed packages for your Debian/Ubuntu systems that can be restored on freshly installed systems (or containers) or into a directory. + +This backup can be restored on multiple systems with same operating system version and architecture. + +### How To Install apt-clone? + +The apt-clone package is available on Ubuntu/Debian official repository so, use **[apt Package Manager][3]** or **[apt-get Package Manager][4]** to install it. + +Install apt-clone package using apt package manager. + +``` +$ sudo apt install apt-clone +``` + +Install apt-clone package using apt-get package manager. + +``` +$ sudo apt-get install apt-clone +``` + +### How To Backup Installed Packages Using apt-clone? + +Once you have successfully installed the apt-clone package. Simply give a location where do you want to save the backup file. + +We are going to save the installed packages backup under `/backup` directory. + +The apt-clone utility will save the installed packages list into `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` file. + +``` +$ sudo apt-clone clone /backup +``` + +We can check the same by running the ls Command. + +``` +$ ls -lh /backup/ +total 32K +-rw-r--r-- 1 root root 29K Apr 20 19:06 apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +``` + +Run the following command to view the details of the backup file. + +``` +$ apt-clone info /backup/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +Hostname: Ubuntu18.2daygeek.com +Arch: amd64 +Distro: bionic +Meta: libunity-scopes-json-def-desktop, ubuntu-desktop +Installed: 1792 pkgs (194 automatic) +Date: Sat Apr 20 19:06:43 2019 +``` + +As per the above output, totally we have 1792 packages in the backup file. + +### How To Restore The Backup Which Was Taken Using apt-clone? + +You can use any of the remote copy utility to copy the files on remote server. + +``` +$ scp /backup/apt-clone-state-ubunt-18-04.tar.gz Destination-Server:/opt +``` + +Once you copy the file then perform the restore using apt-clone utility. + +Run the following command to restore it. + +``` +$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +``` + +Make a note, The restore will override your existing `/etc/apt/sources.list` and will install/remove packages. So be careful. + +If you want to restore all the packages into a folder instead of actual restore, you can do it by using the following command. + +``` +$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz --destination /opt/oldubuntu +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/ + +作者:[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/aptik-backup-restore-ppas-installed-apps-users-data/ +[2]: https://github.com/mvo5/apt-clone +[3]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ From 89df7fa33f5d6f013f616cc79bdb3f5c6d37905b Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:27:20 +0800 Subject: [PATCH 0274/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20Five?= =?UTF-8?q?=20Methods=20To=20Check=20Your=20Current=20Runlevel=20In=20Linu?= =?UTF-8?q?x=3F=20sources/tech/20190505=20Five=20Methods=20To=20Check=20Yo?= =?UTF-8?q?ur=20Current=20Runlevel=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...To Check Your Current Runlevel In Linux.md | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md diff --git a/sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md b/sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md new file mode 100644 index 0000000000..2169f04e51 --- /dev/null +++ b/sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md @@ -0,0 +1,183 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Five Methods To Check Your Current Runlevel In Linux?) +[#]: via: (https://www.2daygeek.com/check-current-runlevel-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Five Methods To Check Your Current Runlevel In Linux? +====== + +A run level is an operating system state on Linux system. + +There are seven runlevels exist, numbered from zero to six. + +A system can be booted into any of the given runlevel. Run levels are identified by numbers. + +Each runlevel designates a different system configuration and allows access to a different combination of processes. + +By default Linux boots either to runlevel 3 or to runlevel 5. + +Only one runlevel is executed at a time on startup. It doesn’t execute one after another. + +The default runlevel for a system is specified in the /etc/inittab file for SysVinit system. + +But systemd systems doesn’t read this file and it uses the following file `/etc/systemd/system/default.target` to get default runlevel information. + +We can check the Linux system current runlevel using the below five methods. + + * **`runlevel Command:`** runlevel prints the previous and current runlevel of the system. + * **`who Command:`** Print information about users who are currently logged in. It will print the runlevel information with “-r” option. + * **`systemctl Command:`** It controls the systemd system and service manager. + * **`Using /etc/inittab File:`** The default runlevel for a system is specified in the /etc/inittab file for SysVinit System. + * **`Using /etc/systemd/system/default.target File:`** The default runlevel for a system is specified in the /etc/systemd/system/default.target file for systemd System. + + + +Detailed runlevels information is described in the below table. + +**Runlevel** | **SysVinit System** | **systemd System** +---|---|--- +0 | Shutdown or Halt the system | shutdown.target +1 | Single user mode | rescue.target +2 | Multiuser, without NFS | multi-user.target +3 | Full multiuser mode | multi-user.target +4 | unused | multi-user.target +5 | X11 (Graphical User Interface) | graphical.target +6 | reboot the system | reboot.target + +The system will execute the programs/service based on the runlevel. + +For SysVinit system, it will be execute from the following location. + + * Run level 0 – /etc/rc.d/rc0.d/ + * Run level 1 – /etc/rc.d/rc1.d/ + * Run level 2 – /etc/rc.d/rc2.d/ + * Run level 3 – /etc/rc.d/rc3.d/ + * Run level 4 – /etc/rc.d/rc4.d/ + * Run level 5 – /etc/rc.d/rc5.d/ + * Run level 6 – /etc/rc.d/rc6.d/ + + + +For systemd system, it will be execute from the following location. + + * runlevel1.target – /etc/systemd/system/rescue.target + * runlevel2.target – /etc/systemd/system/multi-user.target.wants + * runlevel3.target – /etc/systemd/system/multi-user.target.wants + * runlevel4.target – /etc/systemd/system/multi-user.target.wants + * runlevel5.target – /etc/systemd/system/graphical.target.wants + + + +### 1) How To Check Your Current Runlevel In Linux Using runlevel Command? + +runlevel prints the previous and current runlevel of the system. + +``` +$ runlevel +N 5 +``` + + * **`N:`** “N” indicates that the runlevel has not been changed since the system was booted. + * **`5:`** “5” indicates the current runlevel of the system. + + + +### 2) How To Check Your Current Runlevel In Linux Using who Command? + +Print information about users who are currently logged in. It will print the runlevel information with `-r` option. + +``` +$ who -r + run-level 5 2019-04-22 09:32 +``` + +### 3) How To Check Your Current Runlevel In Linux Using systemctl Command? + +systemctl is used to controls the systemd system and service manager. systemd is system and service manager for Unix like operating systems. + +It can work as a drop-in replacement for sysvinit system. systemd is the first process get started by kernel and holding PID 1. + +systemd uses `.service` files Instead of bash scripts (SysVinit uses). systemd sorts all daemons into their own Linux cgroups and you can see the system hierarchy by exploring `/cgroup/systemd` file. + +``` +$ systemctl get-default +graphical.target +``` + +### 4) How To Check Your Current Runlevel In Linux Using /etc/inittab File? + +The default runlevel for a system is specified in the /etc/inittab file for SysVinit System but systemd systemd doesn’t read the files. + +So, it will work only on SysVinit system and not in systemd system. + +``` +$ cat /etc/inittab +# inittab is only used by upstart for the default runlevel. +# +# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM. +# +# System initialization is started by /etc/init/rcS.conf +# +# Individual runlevels are started by /etc/init/rc.conf +# +# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf +# +# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf, +# with configuration in /etc/sysconfig/init. +# +# For information on how to write upstart event handlers, or how +# upstart works, see init(5), init(8), and initctl(8). +# +# Default runlevel. The runlevels used are: +# 0 - halt (Do NOT set initdefault to this) +# 1 - Single user mode +# 2 - Multiuser, without NFS (The same as 3, if you do not have networking) +# 3 - Full multiuser mode +# 4 - unused +# 5 - X11 +# 6 - reboot (Do NOT set initdefault to this) +# +id:5:initdefault: +``` + +### 5) How To Check Your Current Runlevel In Linux Using /etc/systemd/system/default.target File? + +The default runlevel for a system is specified in the /etc/systemd/system/default.target file for systemd System. + +It doesn’t work on SysVinit system. + +``` +$ cat /etc/systemd/system/default.target +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Graphical Interface +Documentation=man:systemd.special(7) +Requires=multi-user.target +Wants=display-manager.service +Conflicts=rescue.service rescue.target +After=multi-user.target rescue.service rescue.target display-manager.service +AllowIsolate=yes +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-current-runlevel-in-linux/ + +作者:[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 From c63663d26506ffffdf4de1b78623adf8d0e97fc9 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:27:36 +0800 Subject: [PATCH 0275/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20Mirr?= =?UTF-8?q?or=20your=20System=20Drive=20using=20Software=20RAID=20sources/?= =?UTF-8?q?tech/20190503=20Mirror=20your=20System=20Drive=20using=20Softwa?= =?UTF-8?q?re=20RAID.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r your System Drive using Software RAID.md | 306 ++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 sources/tech/20190503 Mirror your System Drive using Software RAID.md diff --git a/sources/tech/20190503 Mirror your System Drive using Software RAID.md b/sources/tech/20190503 Mirror your System Drive using Software RAID.md new file mode 100644 index 0000000000..1b5936dfa0 --- /dev/null +++ b/sources/tech/20190503 Mirror your System Drive using Software RAID.md @@ -0,0 +1,306 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mirror your System Drive using Software RAID) +[#]: via: (https://fedoramagazine.org/mirror-your-system-drive-using-software-raid/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +Mirror your System Drive using Software RAID +====== + +![][1] + +Nothing lasts forever. When it comes to the hardware in your PC, most of it can easily be replaced. There is, however, one special-case hardware component in your PC that is not as easy to replace as the rest — your hard disk drive. + +### Drive Mirroring + +Your hard drive stores your personal data. Some of your data can be backed up automatically by scheduled backup jobs. But those jobs scan the files to be backed up for changes and trying to scan an entire drive would be very resource intensive. Also, anything that you’ve changed since your last backup will be lost if your drive fails. [Drive mirroring][2] is a better way to maintain a secondary copy of your entire hard drive. With drive mirroring, a secondary copy of _all the data_ on your hard drive is maintained _in real time_. + +An added benefit of live mirroring your hard drive to a secondary hard drive is that it can [increase your computer’s performance][3]. Because disk I/O is one of your computer’s main performance [bottlenecks][4], the performance improvement can be quite significant. + +Note that a mirror is not a backup. It only protects your data from being lost if one of your physical drives fail. Types of failures that drive mirroring, by itself, does not protect against include: + + * [File System Corruption][5] + * [Bit Rot][6] + * Accidental File Deletion + * Simultaneous Failure of all Mirrored Drives (highly unlikely) + + + +Some of the above can be addressed by other file system features that can be used in conjunction with drive mirroring. File system features that address the above types of failures include: + + * Using a [Journaling][7] or [Log-Structured][8] file system + * Using [Checksums][9] ([ZFS][10] , for example, does this automatically and transparently) + * Using [Snapshots][11] + * Using [BCVs][12] + + + +This guide will demonstrate one method of mirroring your system drive using the Multiple Disk and Device Administration (mdadm) toolset. Just for fun, this guide will show how to do the conversion without using any extra boot media (CDs, USB drives, etc). For more about the concepts and terminology related to the multiple device driver, you can skim the _md_ man page: + +``` +$ man md +``` + +### The Procedure + + 1. **Use** [**sgdisk**][13] **to (re)partition the _extra_ drive that you have added to your computer** : + +``` + $ sudo -i +# MY_DISK_1=/dev/sdb +# sgdisk --zap-all $MY_DISK_1 +# test -d /sys/firmware/efi/efivars || sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub_1 $MY_DISK_1 +# sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot_1 $MY_DISK_1 +# sgdisk -n 0:0:+4GiB -t 0:fd00 -c 0:swap_1 $MY_DISK_1 +# sgdisk -n 0:0:0 -t 0:fd00 -c 0:root_1 $MY_DISK_1 +``` + +– If the drive that you will be using for the second half of the mirror in step 12 is smaller than this drive, then you will need to adjust down the size of the last partition so that the total size of all the partitions is not greater than the size of your second drive. +– A few of the commands in this guide are prefixed with a test for the existence of an _efivars_ directory. This is necessary because those commands are slightly different depending on whether your computer is BIOS-based or UEFI-based. + + 2. **Use** [**mdadm**][14] **to create RAID devices that use the new partitions to store their data** : + +``` + # mdadm --create /dev/md/boot --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/boot_1 missing +# mdadm --create /dev/md/swap --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/swap_1 missing +# mdadm --create /dev/md/root --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/root_1 missing + +# cat << END > /etc/mdadm.conf +MAILADDR root +AUTO +all +DEVICE partitions +END + +# mdadm --detail --scan >> /etc/mdadm.conf +``` + +– The _missing_ parameter tells mdadm to create an array with a missing member. You will add the other half of the mirror in step 14. +– You should configure [sendmail][15] so you will be notified if a drive fails. +– You can configure [Evolution][16] to [monitor a local mail spool][17]. + + 3. **Use** [**dracut**][18] **to update the initramfs** : + +``` +# dracut -f --add mdraid --add-drivers xfs +``` + +– Dracut will include the /etc/mdadm.conf file you created in the previous section in your initramfs _unless_ you build your initramfs with the _hostonly_ option set to _no_. If you build your initramfs with the hostonly option set to no, then you should either manually include the /etc/mdadm.conf file, manually specify the UUID’s of the RAID arrays to assemble at boot time with the _rd.md.uuid_ kernel parameter, or specify the _rd.auto_ kernel parameter to have all RAID arrays automatically assembled and started at boot time. This guide will demonstrate the _rd.auto_ option since it is the most generic. + + 4. **Format the RAID devices** : + +``` + # mkfs -t vfat /dev/md/boot +# mkswap /dev/md/swap +# mkfs -t xfs /dev/md/root +``` + +– The new [Boot Loader Specification][19] states “if the OS is installed on a disk with GPT disk label, and no ESP partition exists yet, a new suitably sized (let’s say 500MB) ESP should be created and should be used as $BOOT” and “$BOOT must be a VFAT (16 or 32) file system”. + + 5. **Reboot and set the _rd.auto_ , _rd.break_ and _single_ kernel parameters** : + +``` +# reboot +``` + +– You may need to [set your root password][20] before rebooting so that you can get into _single-user mode_ in step 7. +– See “[Making Temporary Changes to a GRUB 2 Menu][21]” for directions on how to set kernel parameters on compters that use the GRUB 2 boot loader. + + 6. **Use** [**the dracut shell**][18] **to copy the root file system** : + +``` + # mkdir /newroot +# mount /dev/md/root /newroot +# shopt -s dotglob +# cp -ax /sysroot/* /newroot +# rm -rf /newroot/boot/* +# umount /newroot +# exit +``` + +– The _dotglob_ flag is set for this bash session so that the [wildcard character][22] will match hidden files. +– Files are removed from the _boot_ directory because they will be copied to a separate partition in the next step. +– This copy operation is being done from the dracut shell to insure that no processes are accessing the files while they are being copied. + + 7. **Use _single-user mode_ to copy the non-root file systems** : + +``` + # mkdir /newroot +# mount /dev/md/root /newroot +# mount /dev/md/boot /newroot/boot +# shopt -s dotglob +# cp -Lr /boot/* /newroot/boot +# test -d /newroot/boot/efi/EFI && mv /newroot/boot/efi/EFI/* /newroot/boot/efi && rmdir /newroot/boot/efi/EFI +# test -d /sys/firmware/efi/efivars && ln -sfr /newroot/boot/efi/fedora/grub.cfg /newroot/etc/grub2-efi.cfg +# cp -ax /home/* /newroot/home +# exit +``` + +– It is OK to run these commands in the dracut shell shown in the previous section instead of doing it from single-user mode. I’ve demonstrated using single-user mode to avoid having to explain how to mount the non-root partitions from the dracut shell. +– The parameters being past to the _cp_ command for the _boot_ directory are a little different because the VFAT file system doesn’t support symbolic links or Unix-style file permissions. +– In rare cases, the _rd.auto_ parameter is known to cause LVM to fail to assemble due to a [race condition][23]. If you see errors about your _swap_ or _home_ partition failing to mount when entering single-user mode, simply try again by repeating step 5 but omiting the _rd.break_ paramenter so that you will go directly to single-user mode. + + 8. **Update _fstab_ on the new drive** : + +``` + # cat << END > /newroot/etc/fstab +/dev/md/root / xfs defaults 0 0 +/dev/md/boot /boot vfat defaults 0 0 +/dev/md/swap swap swap defaults 0 0 +END +``` + + 9. **Configure the boot loader on the new drive** : + +``` + # NEW_GRUB_CMDLINE_LINUX=$(cat /etc/default/grub | sed -n 's/^GRUB_CMDLINE_LINUX="\(.*\)"/\1/ p') +# NEW_GRUB_CMDLINE_LINUX=${NEW_GRUB_CMDLINE_LINUX//rd.lvm.*([^ ])} +# NEW_GRUB_CMDLINE_LINUX=${NEW_GRUB_CMDLINE_LINUX//resume=*([^ ])} +# NEW_GRUB_CMDLINE_LINUX+=" selinux=0 rd.auto" +# sed -i "/^GRUB_CMDLINE_LINUX=/s/=.*/=\"$NEW_GRUB_CMDLINE_LINUX\"/" /newroot/etc/default/grub +``` + +– You can re-enable selinux after this procedure is complete. But you will have to [relabel your file system][24] first. + + 10. **Install the boot loader on the new drive** : + +``` + # sed -i '/^GRUB_DISABLE_OS_PROBER=.*/d' /newroot/etc/default/grub +# echo "GRUB_DISABLE_OS_PROBER=true" >> /newroot/etc/default/grub +# MY_DISK_1=$(mdadm --detail /dev/md/boot | grep active | grep -m 1 -o "/dev/sd.") +# for i in dev dev/pts proc sys run; do mount -o bind /$i /newroot/$i; done +# chroot /newroot env MY_DISK_1=$MY_DISK_1 bash --login +# test -d /sys/firmware/efi/efivars || MY_GRUB_DIR=/boot/grub2 +# test -d /sys/firmware/efi/efivars && MY_GRUB_DIR=$(find /boot/efi -type d -name 'fedora' -print -quit) +# test -e /usr/sbin/grub2-switch-to-blscfg && grub2-switch-to-blscfg --grub-directory=$MY_GRUB_DIR +# grub2-mkconfig -o $MY_GRUB_DIR/grub.cfg \; +# test -d /sys/firmware/efi/efivars && test /boot/grub2/grubenv -nt $MY_GRUB_DIR/grubenv && cp /boot/grub2/grubenv $MY_GRUB_DIR/grubenv +# test -d /sys/firmware/efi/efivars || grub2-install "$MY_DISK_1" +# logout +# for i in run sys proc dev/pts dev; do umount /newroot/$i; done +# test -d /sys/firmware/efi/efivars && efibootmgr -c -d "$MY_DISK_1" -p 1 -l "$(find /newroot/boot -name shimx64.efi -printf '/%P\n' -quit | sed 's!/!\\!g')" -L "Fedora RAID Disk 1" +``` + +– The _grub2-switch-to-blscfg_ command is optional. It is only supported on Fedora 29+. +– The _cp_ command above should not be necessary, but there appears to be a bug in the current version of grub which causes it to write to $BOOT/grub2/grubenv instead of $BOOT/efi/fedora/grubenv on UEFI systems. +– You can use the following command to verify the contents of the _grub.cfg_ file right after running the _grub2-mkconfig_ command above: + +``` +# sed -n '/BEGIN .*10_linux/,/END .*10_linux/ p' $MY_GRUB_DIR/grub.cfg +``` + +– You should see references to _mdraid_ and _mduuid_ in the output from the above command if the RAID array was detected properly. + + 11. **Boot off of the new drive** : + +``` +# reboot +``` + +– How to select the new drive is system-dependent. It usually requires pressing one of the **F12** , **F10** , **Esc** or **Del** keys when you hear the [System OK BIOS beep code][25]. +– On UEFI systems the boot loader on the new drive should be labeled “Fedora RAID Disk 1”. + + 12. **Remove all the volume groups and partitions from your old drive** : + +``` + # MY_DISK_2=/dev/sda +# MY_VOLUMES=$(pvs | grep $MY_DISK_2 | awk '{print $2}' | tr "\n" " ") +# test -n "$MY_VOLUMES" && vgremove $MY_VOLUMES +# sgdisk --zap-all $MY_DISK_2 +``` + +– **WARNING** : You want to make certain that everything is working properly on your new drive before you do this. A good way to verify that your old drive is no longer being used is to try booting your computer once without the old drive connected. +– You can add another new drive to your computer instead of erasing your old one if you prefer. + + 13. **Create new partitions on your old drive to match the ones on your new drive** : + +``` + # test -d /sys/firmware/efi/efivars || sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub_2 $MY_DISK_2 +# sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot_2 $MY_DISK_2 +# sgdisk -n 0:0:+4GiB -t 0:fd00 -c 0:swap_2 $MY_DISK_2 +# sgdisk -n 0:0:0 -t 0:fd00 -c 0:root_2 $MY_DISK_2 +``` + +– It is important that the partitions match in size and type. I prefer to use the _parted_ command to display the partition table because it supports setting the display unit: + +``` + # parted /dev/sda unit MiB print +# parted /dev/sdb unit MiB print +``` + + 14. **Use mdadm to add the new partitions to the RAID devices** : + +``` + # mdadm --manage /dev/md/boot --add /dev/disk/by-partlabel/boot_2 +# mdadm --manage /dev/md/swap --add /dev/disk/by-partlabel/swap_2 +# mdadm --manage /dev/md/root --add /dev/disk/by-partlabel/root_2 +``` + + 15. **Install the boot loader on your old drive** : + +``` + # test -d /sys/firmware/efi/efivars || grub2-install "$MY_DISK_2" +# test -d /sys/firmware/efi/efivars && efibootmgr -c -d "$MY_DISK_2" -p 1 -l "$(find /boot -name shimx64.efi -printf "/%P\n" -quit | sed 's!/!\\!g')" -L "Fedora RAID Disk 2" +``` + + 16. **Use mdadm to test that email notifications are working** : + +``` +# mdadm --monitor --scan --oneshot --test +``` + + + + +As soon as your drives have finished synchronizing, you should be able to select either drive when restarting your computer and you will receive the same live-mirrored operating system. If either drive fails, mdmonitor will send an email notification. Recovering from a drive failure is now simply a matter of swapping out the bad drive with a new one and running a few _sgdisk_ and _mdadm_ commands to re-create the mirrors (steps 13 through 15). You will no longer have to worry about losing any data if a drive fails! + +### Video Demonstrations + +Converting a UEFI PC to RAID1 + +Converting a BIOS PC to RAID1 + + * TIP: Set the the quality to 720p on the above videos for best viewing. + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/mirror-your-system-drive-using-software-raid/ + +作者:[Gregory Bartholomew][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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/raid_mirroring-816x345.jpg +[2]: https://en.wikipedia.org/wiki/Disk_mirroring +[3]: https://en.wikipedia.org/wiki/Disk_mirroring#Additional_benefits +[4]: https://en.wikipedia.org/wiki/Bottleneck_(software) +[5]: https://en.wikipedia.org/wiki/Data_corruption +[6]: https://en.wikipedia.org/wiki/Data_degradation +[7]: https://en.wikipedia.org/wiki/Journaling_file_system +[8]: https://www.quora.com/What-is-the-difference-between-a-journaling-vs-a-log-structured-file-system +[9]: https://en.wikipedia.org/wiki/File_verification +[10]: https://en.wikipedia.org/wiki/ZFS#Summary_of_key_differentiating_features +[11]: https://en.wikipedia.org/wiki/Snapshot_(computer_storage)#File_systems +[12]: https://en.wikipedia.org/wiki/Business_continuance_volume +[13]: https://fedoramagazine.org/managing-partitions-with-sgdisk/ +[14]: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ +[15]: https://fedoraproject.org/wiki/QA:Testcase_Sendmail +[16]: https://en.wikipedia.org/wiki/Evolution_(software) +[17]: https://dotancohen.com/howto/root_email.html +[18]: https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/ +[19]: https://systemd.io/BOOT_LOADER_SPECIFICATION#technical-details +[20]: https://docs.fedoraproject.org/en-US/Fedora/26/html/System_Administrators_Guide/sec-Changing_and_Resetting_the_Root_Password.html +[21]: https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/#sec-Making_Temporary_Changes_to_a_GRUB_2_Menu +[22]: https://en.wikipedia.org/wiki/Wildcard_character#File_and_directory_patterns +[23]: https://en.wikipedia.org/wiki/Race_condition +[24]: https://wiki.centos.org/HowTos/SELinux#head-867ca18a09f3103705cdb04b7d2581b69cd74c55 +[25]: https://en.wikipedia.org/wiki/Power-on_self-test#Original_IBM_POST_beep_codes From f5ed4b8ec2fc05ba74f424197a09499427f82849 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:27:46 +0800 Subject: [PATCH 0276/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=203=20?= =?UTF-8?q?apps=20to=20manage=20personal=20finances=20in=20Fedora=20source?= =?UTF-8?q?s/tech/20190501=203=20apps=20to=20manage=20personal=20finances?= =?UTF-8?q?=20in=20Fedora.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s to manage personal finances in Fedora.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20190501 3 apps to manage personal finances in Fedora.md diff --git a/sources/tech/20190501 3 apps to manage personal finances in Fedora.md b/sources/tech/20190501 3 apps to manage personal finances in Fedora.md new file mode 100644 index 0000000000..afa5eb889f --- /dev/null +++ b/sources/tech/20190501 3 apps to manage personal finances in Fedora.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 apps to manage personal finances in Fedora) +[#]: via: (https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +3 apps to manage personal finances in Fedora +====== + +![][1] + +There are numerous services available on the web for managing your personal finances. Although they may be convenient, they also often mean leaving your most valuable personal data with a company you can’t monitor. Some people are comfortable with this level of trust. + +Whether you are or not, you might be interested in an app you can maintain on your own system. This means your data never has to leave your own computer if you don’t want. One of these three apps might be what you’re looking for. + +### HomeBank + +HomeBank is a fully featured way to manage multiple accounts. It’s easy to set up and keep updated. It has multiple ways to categorize and graph income and liabilities so you can see where your money goes. It’s available through the official Fedora repositories. + +![A simple account set up in HomeBank with a few transactions.][2] + +To install HomeBank, open the _Software_ app, search for _HomeBank_ , and select the app. Then click _Install_ to add it to your system. HomeBank is also available via a Flatpak. + +### KMyMoney + +The KMyMoney app is a mature app that has been around for a long while. It has a robust set of features to help you manage multiple accounts, including assets, liabilities, taxes, and more. KMyMoney includes a full set of tools for managing investments and making forecasts. It also sports a huge set of reports for seeing how your money is doing. + +![A subset of the many reports available in KMyMoney.][3] + +To install, use a software center app, or use the command line: + +``` +$ sudo dnf install kmymoney +``` + +### GnuCash + +One of the most venerable free GUI apps for personal finance is GnuCash. GnuCash is not just for personal finances. It also has functions for managing income, assets, and liabilities for a business. That doesn’t mean you can’t use it for managing just your own accounts. Check out [the online tutorial and guide][4] to get started. + +![Checking account records shown in GnuCash.][5] + +Open the _Software_ app, search for _GnuCash_ , and select the app. Then click _Install_ to add it to your system. Or use _dnf install_ as above to install the _gnucash_ package. + +It’s now available via Flathub which makes installation easy. If you don’t have Flathub support, check out [this article on the Fedora Magazine][6] for how to use it. Then you can also use the _flatpak install GnuCash_ command with a terminal. + +* * * + +*Photo by _[_Fabian Blank_][7]_ on *[ _Unsplash_][8]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/ + +作者:[Paul W. Frields][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/pfrields/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/personal-finance-3-apps-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-16-16-1024x637.png +[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-27-10-1-1024x649.png +[4]: https://www.gnucash.org/viewdoc.phtml?rev=3&lang=C&doc=guide +[5]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-41-27-1024x631.png +[6]: https://fedoramagazine.org/install-flathub-apps-fedora/ +[7]: https://unsplash.com/photos/pElSkGRA2NU?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/money?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From c6144e07241b2d5e9068a7fafbbc2293299dba4d Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:28:22 +0800 Subject: [PATCH 0277/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190430=20Upgr?= =?UTF-8?q?ading=20Fedora=2029=20to=20Fedora=2030=20sources/tech/20190430?= =?UTF-8?q?=20Upgrading=20Fedora=2029=20to=20Fedora=2030.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190430 Upgrading Fedora 29 to Fedora 30.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md diff --git a/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md new file mode 100644 index 0000000000..f6d819c754 --- /dev/null +++ b/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Upgrading Fedora 29 to Fedora 30) +[#]: via: (https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +Upgrading Fedora 29 to Fedora 30 +====== + +![][1] + +Fedora 30 i[s available now][2]. You’ll likely want to upgrade your system to the latest version of Fedora. Fedora Workstation has a graphical upgrade method. Alternatively, Fedora offers a command-line method for upgrading Fedora 29 to Fedora 30. + +### Upgrading Fedora 29 Workstation to Fedora 30 + +Soon after release time, a notification appears to tell you an upgrade is available. You can click the notification to launch the **GNOME Software** app. Or you can choose Software from GNOME Shell. + +Choose the _Updates_ tab in GNOME Software and you should see a screen informing you that Fedora 30 is Now Available. + +If you don’t see anything on this screen, try using the reload button at the top left. It may take some time after release for all systems to be able to see an upgrade available. + +Choose _Download_ to fetch the upgrade packages. You can continue working until you reach a stopping point, and the download is complete. Then use GNOME Software to restart your system and apply the upgrade. Upgrading takes time, so you may want to grab a coffee and come back to the system later. + +### Using the command line + +If you’ve upgraded from past Fedora releases, you are likely familiar with the _dnf upgrade_ plugin. This method is the recommended and supported way to upgrade from Fedora 29 to Fedora 30. Using this plugin will make your upgrade to Fedora 30 simple and easy. + +##### 1\. Update software and back up your system + +Before you do anything, you will want to make sure you have the latest software for Fedora 29 before beginning the upgrade process. To update your software, use _GNOME Software_ or enter the following command in a terminal. + +``` +sudo dnf upgrade --refresh +``` + +Additionally, make sure you back up your system before proceeding. For help with taking a backup, see [the backup series][3] on the Fedora Magazine. + +##### 2\. Install the DNF plugin + +Next, open a terminal and type the following command to install the plugin: + +``` +sudo dnf install dnf-plugin-system-upgrade +``` + +##### 3\. Start the update with DNF + +Now that your system is up-to-date, backed up, and you have the DNF plugin installed, you can begin the upgrade by using the following command in a terminal: + +``` +sudo dnf system-upgrade download --releasever=30 +``` + +This command will begin downloading all of the upgrades for your machine locally to prepare for the upgrade. If you have issues when upgrading because of packages without updates, broken dependencies, or retired packages, add the _‐‐allowerasing_ flag when typing the above command. This will allow DNF to remove packages that may be blocking your system upgrade. + +##### 4\. Reboot and upgrade + +Once the previous command finishes downloading all of the upgrades, your system will be ready for rebooting. To boot your system into the upgrade process, type the following command in a terminal: + +``` +sudo dnf system-upgrade reboot +``` + +Your system will restart after this. Many releases ago, the _fedup_ tool would create a new option on the kernel selection / boot screen. With the _dnf-plugin-system-upgrade_ package, your system reboots into the current kernel installed for Fedora 29; this is normal. Shortly after the kernel selection screen, your system begins the upgrade process. + +Now might be a good time for a coffee break! Once it finishes, your system will restart and you’ll be able to log in to your newly upgraded Fedora 30 system. + +![][4] + +### Resolving upgrade problems + +On occasion, there may be unexpected issues when you upgrade your system. If you experience any issues, please visit the [DNF system upgrade wiki page][5] for more information on troubleshooting in the event of a problem. + +If you are having issues upgrading and have third-party repositories installed on your system, you may need to disable these repositories while you are upgrading. For support with repositories not provided by Fedora, please contact the providers of the repositories. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/ + +作者:[Ryan Lerch][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/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/29-30-816x345.jpg +[2]: https://fedoramagazine.org/announcing-fedora-30/ +[3]: https://fedoramagazine.org/taking-smart-backups-duplicity/ +[4]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png +[5]: https://fedoraproject.org/wiki/DNF_system_upgrade#Resolving_post-upgrade_issues From c9c39e6a2b1b346009ec0021c524399f9522b461 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:28:56 +0800 Subject: [PATCH 0278/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=20Awk?= =?UTF-8?q?=20utility=20in=20Fedora=20sources/tech/20190429=20Awk=20utilit?= =?UTF-8?q?y=20in=20Fedora.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190429 Awk utility in Fedora.md | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 sources/tech/20190429 Awk utility in Fedora.md diff --git a/sources/tech/20190429 Awk utility in Fedora.md b/sources/tech/20190429 Awk utility in Fedora.md new file mode 100644 index 0000000000..21e40641f7 --- /dev/null +++ b/sources/tech/20190429 Awk utility in Fedora.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Awk utility in Fedora) +[#]: via: (https://fedoramagazine.org/awk-utility-in-fedora/) +[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) + +Awk utility in Fedora +====== + +![][1] + +Fedora provides _awk_ as part of its default installation, including all its editions, including the immutable ones like Silverblue. But you may be asking, what is _awk_ and why would you need it? + +_Awk_ is a data driven programming language that acts when it matches a pattern. On Fedora, and most other distributions, GNU _awk_ or _gawk_ is used. Read on for more about this language and how to use it. + +### A brief history of awk + +_Awk_ began at Bell Labs in 1977. Its name is an acronym from the initials of the designers: Alfred V. Aho, Peter J. Weinberger, and Brian W. Kernighan. + +> The specification for _awk_ in the POSIX Command Language and Utilities standard further clarified the language. Both the _gawk_ designers and the original _awk_ designers at Bell Laboratories provided feedback for the POSIX specification. +> +> From [The GNU Awk User’s Guide][2] + +For a more in-depth look at how _awk/gawk_ ended up being as powerful and useful as it is, follow the link above. Numerous individuals have contributed to the current state of _gawk_. Among those are: + + * Arnold Robbins and David Trueman, the creators of _gawk_ + * Michael Brennan, the creator of _mawk_ , which later was merged with _gawk_ + * Jurgen Kahrs, who added networking capabilities to _gawk_ in 1997 + * John Hague, who rewrote the _gawk_ internals and added an _awk_ -level debugger in 2011 + + + +### Using awk + +The following sections show various ways of using _awk_ in Fedora. + +#### At the command line + +The simples way to invoke _awk_ is at the command line. You can search a text file for a particular pattern, and if found, print out the line(s) of the file that match the pattern anywhere. As an example, use _cat_ to take a look at the command history file in your home director: + +``` +$ cat ~/.bash_history +``` + +There are probably many lines scrolling by right now. + +_Awk_ helps with this type of file quite easily. Instead of printing the entire file out to the terminal like _cat_ , you can use _awk_ to find something of specific interest. For this example, type the following at the command line if you’re running a standard Fedora edition: + +``` +$ awk '/dnf/' ~/.bash_history +``` + +If you’re running Silverblue, try this instead: + +``` +$ awk '/rpm-ostree/' ~/.bash_history +``` + +In both cases, more data likely appears than what you really want. That’s no problem for _awk_ since it can accept regular expressions. Using the previous example, you can change the pattern to more closely match search requirements of wanting to know about installs only. Try changing the search pattern to one of these: + +``` +$ awk '/rpm-ostree install/' ~/.bash_history +$ awk '/dnf install/' ~/.bash_history +``` + +All the entries of your bash command line history appear that have the pattern specified at any position along the line. Awk works on one line of a data file at a time. It matches pattern, then performs an action, then moves to next line until the end of file (EOF) is reached. + +#### From an _awk_ program + +Using awk at the command line as above is not much different than piping output to _grep_ , like this: + +``` +$ cat .bash_history | grep 'dnf install' +``` + +The end result of printing to standard output ( _stdout_ ) is the same with both methods. + +Awk is a programming language, and the command _awk_ is an interpreter of that language. The real power and flexibility of _awk_ is you can make programs with it, and combine them with shell scripts to create even more powerful programs. For more feature rich development with _awk_ , you can also incorporate C or C++ code using [Dynamic-Extensions][3]. + +Next, to show the power of _awk_ , let’s make a couple of program files to print the header and draw five numbers for the first row of a bingo card. To do this we’ll create two awk program files. + +The first file prints out the header of the bingo card. For this example it is called _bingo-title.awk_. Use your favorite editor to save this text as that file name: +``` + +``` + +BEGIN { +print "B\tI\tN\tG\tO" +} +``` + +``` + +Now the title program is ready. You could try it out with this command: + +``` +$ awk -f bingo-title.awk +``` + +The program prints the word BINGO, with a tab space ( _\t_ ) between the characters. For the number selection, let’s use one of awk’s builtin numeric functions called _rand()_ and use two of the control statements, _for_ and _switch._ (Except the editor changed my program, so no switch statement used this time). + +The title of the second awk program is _bingo-num.awk_. Enter the following into your favorite editor and save with that file name: +``` + +``` + +@include "bingo-title.awk" +BEGIN { +for (i = 1; i < = 5; i++) { +b = int(rand() * 15) + (15*(i-1)) +printf "%s\t", b +} +print +} +``` + +``` + +The _@include_ statement in the file tells the interpreter to process the included file first. In this case the interpreter processs the _bingo-title.awk_ file so the title prints out first. + +#### Running the test program + +Now enter the command to pick a row of bingo numbers: + +``` +$ awk -f bingo-num.awk +``` + +Output appears similar to the following. Note that the _rand()_ function in _awk_ is not ideal for truly random numbers. It’s used here only as for example purposes. +``` + +``` + +$ awk -f bingo-num.awk +B I N G O +13 23 34 53 71 +``` + +``` + +In the example, we created two programs with only beginning sections that used actions to manipulate data generated from within the awk program. In order to satisfy the rules of Bingo, more work is needed to achieve the desirable results. The reader is encouraged to fix the programs so they can reliably pick bingo numbers, maybe look at the awk function _srand()_ for answers on how that could be done. + +### Final examples + +_Awk_ can be useful even for mundane daily search tasks that you encounter, like listing all _flatpak’s_ on the _Flathub_ repository from _org.gnome_ (providing you have the Flathub repository setup). The command to do that would be: + +``` +$ flatpak remote-ls flathub --system | awk /org.gnome/ +``` + +A listing appears that shows all output from _remote-ls_ that matches the _org.gnome_ pattern. To see flatpaks already installed from org.gnome, enter this command: + +``` +$ flatpak list --system | awk /org.gnome/ +``` + +Awk is a powerful and flexible programming language that fills a niche with text file manipulation exceedingly well. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/awk-utility-in-fedora/ + +作者:[Stephen Snow][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/jakfrost/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/awk-816x345.jpg +[2]: https://www.gnu.org/software/gawk/manual/gawk.html#Foreword3 +[3]: https://www.gnu.org/software/gawk/manual/gawk.html#Dynamic-Extensions From 91dedce69cf03acf679be7b609c74d53f48f0c56 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:29:08 +0800 Subject: [PATCH 0279/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190425=20Auto?= =?UTF-8?q?mate=20backups=20with=20restic=20and=20systemd=20sources/tech/2?= =?UTF-8?q?0190425=20Automate=20backups=20with=20restic=20and=20systemd.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...utomate backups with restic and systemd.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/tech/20190425 Automate backups with restic and systemd.md diff --git a/sources/tech/20190425 Automate backups with restic and systemd.md b/sources/tech/20190425 Automate backups with restic and systemd.md new file mode 100644 index 0000000000..46c71ae313 --- /dev/null +++ b/sources/tech/20190425 Automate backups with restic and systemd.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Automate backups with restic and systemd) +[#]: via: (https://fedoramagazine.org/automate-backups-with-restic-and-systemd/) +[#]: author: (Link Dupont https://fedoramagazine.org/author/linkdupont/) + +Automate backups with restic and systemd +====== + +![][1] + +Timely backups are important. So much so that [backing up software][2] is a common topic of discussion, even [here on the Fedora Magazine][3]. This article demonstrates how to automate backups with **restic** using only systemd unit files. + +For an introduction to restic, be sure to check out our article [Use restic on Fedora for encrypted backups][4]. Then read on for more details. + +Two systemd services are required to run in order to automate taking snapshots and keeping data pruned. The first service runs the _backup_ command needs to be run on a regular frequency. The second service takes care of data pruning. + +If you’re not familiar with systemd at all, there’s never been a better time to learn. Check out [the series on systemd here at the Magazine][5], starting with this primer on unit files: + +> [systemd unit file basics][6] + +If you haven’t installed restic already, note it’s in the official Fedora repositories. To install use this command [with sudo][7]: + +``` +$ sudo dnf install restic +``` + +### Backup + +First, create the _~/.config/systemd/user/restic-backup.service_ file. Copy and paste the text below into the file for best results. + +``` +[Unit] +Description=Restic backup service +[Service] +Type=oneshot +ExecStart=restic backup --verbose --one-file-system --tag systemd.timer $BACKUP_EXCLUDES $BACKUP_PATHS +ExecStartPost=restic forget --verbose --tag systemd.timer --group-by "paths,tags" --keep-daily $RETENTION_DAYS --keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS +EnvironmentFile=%h/.config/restic-backup.conf +``` + +This service references an environment file in order to load secrets (such as _RESTIC_PASSWORD_ ). Create the _~/.config/restic-backup.conf_ file. Copy and paste the content below for best results. This example uses BackBlaze B2 buckets. Adjust the ID, key, repository, and password values accordingly. + +``` +BACKUP_PATHS="/home/rupert" +BACKUP_EXCLUDES="--exclude-file /home/rupert/.restic_excludes --exclude-if-present .exclude_from_backup" +RETENTION_DAYS=7 +RETENTION_WEEKS=4 +RETENTION_MONTHS=6 +RETENTION_YEARS=3 +B2_ACCOUNT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX +B2_ACCOUNT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ +RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +``` + +Now that the service is installed, reload systemd: _systemctl –user daemon-reload_. Try running the service manually to create a backup: _systemctl –user start restic-backup_. + +Because the service is a _oneshot_ , it will run once and exit. After verifying that the service runs and creates snapshots as desired, set up a timer to run this service regularly. For example, to run the _restic-backup.service_ daily, create _~/.config/systemd/user/restic-backup.timer_ as follows. Again, copy and paste this text: + +``` +[Unit] +Description=Backup with restic daily +[Timer] +OnCalendar=daily +Persistent=true +[Install] +WantedBy=timers.target +``` + +Enable it by running this command: + +``` +$ systemctl --user enable --now restic-backup.timer +``` + +### Prune + +While the main service runs the _forget_ command to only keep snapshots within the keep policy, the data is not actually removed from the restic repository. The _prune_ command inspects the repository and current snapshots, and deletes any data not associated with a snapshot. Because _prune_ can be a time-consuming process, it is not necessary to run every time a backup is run. This is the perfect scenario for a second service and timer. First, create the file _~/.config/systemd/user/restic-prune.service_ by copying and pasting this text: + +``` +[Unit] +Description=Restic backup service (data pruning) +[Service] +Type=oneshot +ExecStart=restic prune +EnvironmentFile=%h/.config/restic-backup.conf +``` + +Similarly to the main _restic-backup.service_ , _restic-prune_ is a oneshot service and can be run manually. Once the service has been set up, create and enable a corresponding timer at _~/.config/systemd/user/restic-prune.timer_ : + +``` +[Unit] +Description=Prune data from the restic repository monthly +[Timer] +OnCalendar=monthly +Persistent=true +[Install] +WantedBy=timers.target +``` + +That’s it! Restic will now run daily and prune data monthly. + +* * * + +_Photo by _[ _Samuel Zeller_][8]_ on _[_Unsplash_][9]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/automate-backups-with-restic-and-systemd/ + +作者:[Link Dupont][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/linkdupont/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/restic-systemd-816x345.jpg +[2]: https://restic.net/ +[3]: https://fedoramagazine.org/?s=backup +[4]: https://fedoramagazine.org/use-restic-encrypted-backups/ +[5]: https://fedoramagazine.org/series/systemd-series/ +[6]: https://fedoramagazine.org/systemd-getting-a-grip-on-units/ +[7]: https://fedoramagazine.org/howto-use-sudo/ +[8]: https://unsplash.com/photos/JuFcQxgCXwA?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[9]: https://unsplash.com/search/photos/archive?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 24786fe5909c9b34ead579c79ace2236b2c60629 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:29:22 +0800 Subject: [PATCH 0280/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20Tuta?= =?UTF-8?q?nota=20Launches=20New=20Encrypted=20Tool=20to=20Support=20Press?= =?UTF-8?q?=20Freedom=20sources/tech/20190503=20Tutanota=20Launches=20New?= =?UTF-8?q?=20Encrypted=20Tool=20to=20Support=20Press=20Freedom.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Encrypted Tool to Support Press Freedom.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md diff --git a/sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md b/sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md new file mode 100644 index 0000000000..692b4ecba8 --- /dev/null +++ b/sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tutanota Launches New Encrypted Tool to Support Press Freedom) +[#]: via: (https://itsfoss.com/tutanota-secure-connect/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Tutanota Launches New Encrypted Tool to Support Press Freedom +====== + +A secure email provider has announced the release of a new product designed to help whistleblowers get their information to the media. The tool is free for journalists. + +### Tutanota helps you protect your privacy + +![][1] + +[Tutanota][2] is a German-based company that provides “world’s most secure email service, easy to use and private by design.” They offer end-to-end encryption for their [secure email service][3]. Recently Tutanota announced a [desktop app for their email service][4]. + +They also make use of two-factor authentication and [open source the code][5] that they use. + +While you can get an account for free, you don’t have to worry about your information being sold or seeing ads. Tutanota makes money by charging for extra features and storage. They also offer solutions for non-profit organizations. + +Tutanota has launched a new service to further help journalists, social activists and whistleblowers in communicating securely. + +[][6] + +Suggested read Purism's New Offering is a Dream Come True for Privacy Concerned People + +### Secure Connect: An encrypted form for websites + +![][7] + +Tutanota has released a new piece of software named Secure Connect. Secure Connect is “an open source encrypted contact form for news sites”. The goal of the project is to create a way so that “whistleblowers can get in touch with journalists securely”. Tutanota picked the right day because May 3rd is the [Day of Press Freedom][8]. + +According to Tutanota, Secure Connect is designed to be easily added to websites, but can also work on any blog to ensure access by smaller news agencies. A whistleblower would access Secure Connect app on a news site, preferably using Tor, and type in any information that they want to bring to light. The whistleblower would also be able to upload files. Once they submit the information, Secure Connect will assign a random address and password, “which lets the whistleblower re-access his sent message at a later stage and check for replies from the news site.” + +![Secure Connect Encrypted Contact Form][9] + +While Tutanota will be offering Secure Connect to journalists for free, they know that someone will have to foot the bill. They plan to pay for further development of the project by selling it to businesses, such as “lawyers, financial institutions, medical institutions, educational institutions, and the authorities”. Non-journalists would have to pay €24 per month. + +You can see a demo of Secure Connect, by clicking [here][10]. If you are a journalist interested in adding Secure Connect to your website or blog, you can contact them at [[email protected]][11] Be sure to include a link to your website. + +[][12] + +Suggested read 8 Privacy Oriented Alternative Search Engines To Google in 2019 + +### Final Thoughts on Secure Connect + +I have read repeatedly about whistleblowers whose identities were accidentally exposed, either by themselves or others. Tutanota’s project looks like it would remove that possibility by making it impossible for others to discover their identity. It also gives both parties an easy way to exchange information without having to worry about encryption or PGP keys. + +I understand that it’s not the same as [Firefox Send][13], another encrypted file sharing program from Mozilla. The only question I have is whose servers will the whistleblowers’ information be sitting on? + +Do you think that Tutanota’s Secure Connect will be a boon for whistleblowers and activists? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][14]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/tutanota-secure-connect/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2018/02/tutanota-featured-800x450.png +[2]: https://tutanota.com/ +[3]: https://itsfoss.com/tutanota-review/ +[4]: https://itsfoss.com/tutanota-desktop/ +[5]: https://tutanota.com/blog/posts/open-source-email +[6]: https://itsfoss.com/librem-one/ +[7]: https://itsfoss.com/wp-content/uploads/2019/05/secure-communication.jpg +[8]: https://en.wikipedia.org/wiki/World_Press_Freedom_Day +[9]: https://itsfoss.com/wp-content/uploads/2019/05/secure-connect-encrypted-contact-form.png +[10]: https://secureconnect.tutao.de/contactform/demo +[11]: /cdn-cgi/l/email-protection +[12]: https://itsfoss.com/privacy-search-engines/ +[13]: https://itsfoss.com/firefox-send/ +[14]: http://reddit.com/r/linuxusersgroup From 4f6df373fd8157464793642b854c9d7320527da0 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:29:32 +0800 Subject: [PATCH 0281/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20Suit?= =?UTF-8?q?eCRM:=20An=20Open=20Source=20CRM=20Takes=20Aim=20At=20Salesforc?= =?UTF-8?q?e=20sources/tech/20190503=20SuiteCRM-=20An=20Open=20Source=20CR?= =?UTF-8?q?M=20Takes=20Aim=20At=20Salesforce.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Open Source CRM Takes Aim At Salesforce.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md diff --git a/sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md b/sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md new file mode 100644 index 0000000000..63802d4976 --- /dev/null +++ b/sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (SuiteCRM: An Open Source CRM Takes Aim At Salesforce) +[#]: via: (https://itsfoss.com/suitecrm-ondemand/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +SuiteCRM: An Open Source CRM Takes Aim At Salesforce +====== + +SuiteCRM is one of the most popular open source CRM (Customer Relationship Management) software available. With its unique-priced managed CRM hosting service, SuiteCRM is aiming to challenge enterprise CRMs like Salesforce. + +### SuiteCRM: An Open Source CRM Software + +CRM stands for Customer Relationship Management. It is used by businesses to manage the interaction with customers, keep track of services, supplies and other things that help the business manage their customers. + +![][1] + +[SuiteCRM][2] came into existence after the hugely popular [SugarCRM][3] decided to stop developing its open source version. The open source version of SugarCRM was then forked into SuiteCRM by UK-based [SalesAgility][4] team. + +In just a couple of years, SuiteCRM became immensely popular and started to be considered the best open source CRM software out there. You can gauge its popularity from the fact that it’s nearing a million download and it has over 100,000 community members. There are around 4 million SuiteCRM users worldwide (a CRM software usually has more than one user) and it is available in several languages. It’s even used by National Health Service ([NHS][5]) in UK. + +Since SuiteCRM is a free and open source software, you are free to download it and deploy it on your cloud server such as [UpCloud][6] (we at It’s FOSS use it), [DigitalOcean][7], [AWS][8] or any Linux server of our own. + +But configuring the software, deploying it and managing it a tiresome job and requires certain skill level or a the services of a sysadmin. This is why business oriented open source software provide a hosted version of their software. + +This enables you to enjoy the open source software without the additional headache and the team behind the software has a way to generate revenue and continue the development of their software. + +### Suite:OnDemand – Cost effective managed hosting of SuiteCRM + +So, recently, [SalesAgility][4] – the creators/maintainers of SuiteCRM, decided to challenge [Salesforce][9] and other enterprise CRMs by introducing [Suite:OnDemand][10] , a hosted version of SuiteCRM. + +[][11] + +Suggested read Papyrus: An Open Source Note Manager + +Normally, you will observe pricing plans on the basis of number of users. But, with SuiteCRM’s OnDemand cloud hosting plans, they are trying to give businesses an affordable solution on a “per-server” basis instead of paying for every user you add. + +In other words, they want you to pay extra only for advanced features, not for more users. + +Here’s what SalesAgility mentioned in their [press release][12]: + +> Unlike Salesforce and other enterprise CRM vendors, the practice of pricing per user has been abandoned in favour of per-server hosting packages all of which will support unlimited users. In addition, there’s no increase in cost for access to advanced features. With Suite:OnDemand every feature and benefit is available with each hosting package. + +Of course, unlimited users does not mean that you will have to abuse the term. So, there’s a recommended number of users for every hosting plan you opt for. + +![Suitecrm Hosting][13] + +The CEO of SalesAgility also had to describe their goals for this step: + +“ _We want SuiteCRM to be available to all businesses and to all users within a business,_ ”said **Dale Murray CEO** of **SalesAgility**. + +In addition to that, they also mentioned that they want to revolutionize the way enterprise-class CRM is being currently offered in order to make it more accessible to businesses and organizations: + +> “Many organisations do not have the experience to run and support our product on-premise or it is not part of their technology strategy to do so. With Suite:OnDemand we are providing our customers with a quick and easy solution to access all the features of SuiteCRM without a per user cost. We’re also saying to Salesforce that enterprise-class CRM can be delivered, enhanced, maintained and supported without charging mouth-wateringly expensive monthly fees. Our aim is to transform the CRM market to enable users to make CRM pervasive within their organisations.” +> +> Dale Murray, CEO of SalesAgility + +### Why is this a big deal? + +This is a huge relief for small business owners and startups because other CRMs like Saleforce and SugarCRM charge $30-$40 per month per user. If you have 10 members in your team, this will increase the cost to $300-$400 per month. + +[][14] + +Suggested read Winds Beautifully Combines Feed Reader and Podcast Player in One Single App + +This is also a good news for the open source community that we will have an affordable alternative to Salesforce. + +In addition to this, SuiteCRM is fully open source meaning there are no license fees or vendor lock-in – as they mention. You are always free to use it on your own. + +It is interesting to see different strategies and solutions being applied for an open source CRM software to take an aim at Salesforce directly. + +What do you think? Let us know your thoughts in the comments below. + +_With inputs from Abhishek Prakash._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/suitecrm-ondemand/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2019/05/suite-crm-800x450.png +[2]: https://suitecrm.com/ +[3]: https://www.sugarcrm.com/ +[4]: https://salesagility.com/ +[5]: https://www.nhs.uk/ +[6]: https://www.upcloud.com/register/?promo=itsfoss +[7]: https://m.do.co/c/d58840562553 +[8]: https://aws.amazon.com/ +[9]: https://www.salesforce.com +[10]: https://suitecrm.com/suiteondemand/ +[11]: https://itsfoss.com/papyrus-open-source-note-manager/ +[12]: https://suitecrm.com/sod-pr/ +[13]: https://itsfoss.com/wp-content/uploads/2019/05/suitecrm-hosting-800x457.jpg +[14]: https://itsfoss.com/winds-podcast-feedreader/ From d05df817a65aaae6facb6a09ec65f6cc55fe6a34 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:42:45 +0800 Subject: [PATCH 0282/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190430=20The?= =?UTF-8?q?=20Awesome=20Fedora=2030=20is=20Here!=20Check=20Out=20the=20New?= =?UTF-8?q?=20Features=20sources/tech/20190430=20The=20Awesome=20Fedora=20?= =?UTF-8?q?30=20is=20Here-=20Check=20Out=20the=20New=20Features.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 30 is Here- Check Out the New Features.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md diff --git a/sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md b/sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md new file mode 100644 index 0000000000..3d158c7031 --- /dev/null +++ b/sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Awesome Fedora 30 is Here! Check Out the New Features) +[#]: via: (https://itsfoss.com/fedora-30/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +The Awesome Fedora 30 is Here! Check Out the New Features +====== + +The latest and greatest release of Fedora is here. Fedora 30 brings some visual as well as performance improvements. + +Fedora releases a new version every six months and each release is supported for thirteen months. + +Before you decide to download or upgrade Fedora, let’s first see what’s new in Fedora 30. + +### New Features in Fedora 30 + +![Fedora 30 Release][1] + +Here’s what’s new in the latest release of Fedora. + +#### GNOME 3.32 gives a brand new look, features and performance improvement + +A lot of visual improvements is brought by the latest release of GNOME. + +GNOME 3.32 has refreshed new icons and UI and it almost looks like a brand new version of GNOME. + +![Gnome 3.32 icons | Image Credit][2] + +GNOME 3.32 also brings several other features like fractional scaling, permission control for each application, granular control on Night Light intensity among many other changes. + +GNOME 3.32 also brings some performance improvements. You’ll see faster file and app searches and a smoother scrolling. + +#### Improved performance for DNF + +Fedora 30 will see a faster [DNF][3] (the default package manager for Fedora) thanks to the [zchunk][4] compression algorithm. + +The zchunk algorithm splits the file into independent chunks. This helps in dealing with ‘delta’ or changes as you download only the changed chunks while downloading the new version of a file. + +With zcunk, dnf will only download the difference between the metadata of the current version and the earlier versions. + +#### Fedora 30 brings two new desktop environments into the fold + +Fedora already offers several desktop environment choices. Fedora 30 extends the offering with [elementary OS][5]‘ Pantheon desktop environment and Deepin Linux’ [DeepinDE][6]. + +So now you can enjoy the looks and feel of elementary OS and Deepin Linux in Fedora. How cool is that! + +#### Linux Kernel 5 + +Fedora 29 has Linux Kernel 5.0.9 version that has improved support for hardware and some performance improvements. You may check out the [features of Linux kernel 5.0 in this article][7]. + +[][8] + +Suggested read The Featureful Release of Nextcloud 14 Has Two New Security Features + +#### Updated software + +You’ll also get newer versions of software. Some of the major ones are: + + * GCC 9.0.1 + * [Bash Shell 5.0][9] + * GNU C Library 2.29 + * Ruby 2.6 + * Golang 1.12 + * Mesa 19.0.2 + + + * Vagrant 2.2 + * JDK12 + * PHP 7.3 + * Fish 3.0 + * Erlang 21 + * Python 3.7.3 + + + +### Getting Fedora 30 + +If you are already using Fedora 29 then you can upgrade to the latest release from your current install. You may follow this guide to learn [how to upgrade a Fedora version][10]. + +Fedora 29 users will still get the updates for seven more months so if you don’t feel like upgrading, you may skip it for now. Fedora 28 users have no choice because Fedora 28 reached end of life next month which means there will be no security or maintenance update anymore. Upgrading to a newer version is no longer a choice. + +You always has the option to download the ISO of Fedora 30 and install it afresh. You can download Fedora from its official website. It’s only available for 64-bit systems and the ISO is 1.9 GB in size. + +[Download Fedora 30 Workstation][11] + +What do you think of Fedora 30? Are you planning to upgrade or at least try it out? Do share your thoughts in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fedora-30/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2019/04/fedora-30-release-800x450.png +[2]: https://itsfoss.com/wp-content/uploads/2019/04/gnome-3-32-icons.png +[3]: https://fedoraproject.org/wiki/DNF?rd=Dnf +[4]: https://github.com/zchunk/zchunk +[5]: https://itsfoss.com/elementary-os-juno-features/ +[6]: https://www.deepin.org/en/dde/ +[7]: https://itsfoss.com/linux-kernel-5/ +[8]: https://itsfoss.com/nextcloud-14-release/ +[9]: https://itsfoss.com/bash-5-release/ +[10]: https://itsfoss.com/upgrade-fedora-version/ +[11]: https://getfedora.org/en/workstation/ From f81d65a6f77a548f2db6d8ff904df47ce41e8902 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:42:55 +0800 Subject: [PATCH 0283/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=20How?= =?UTF-8?q?=20To=20Turn=20On=20And=20Shutdown=20The=20Raspberry=20Pi=20[Ab?= =?UTF-8?q?solute=20Beginner=20Tip]=20sources/tech/20190429=20How=20To=20T?= =?UTF-8?q?urn=20On=20And=20Shutdown=20The=20Raspberry=20Pi=20-Absolute=20?= =?UTF-8?q?Beginner=20Tip.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...The Raspberry Pi -Absolute Beginner Tip.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md diff --git a/sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md b/sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md new file mode 100644 index 0000000000..ce667a1dff --- /dev/null +++ b/sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Turn On And Shutdown The Raspberry Pi [Absolute Beginner Tip]) +[#]: via: (https://itsfoss.com/turn-on-raspberry-pi/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +How To Turn On And Shutdown The Raspberry Pi [Absolute Beginner Tip] +====== + +_**Brief: This quick tip teaches you how to turn on Raspberry Pi and how to shut it down properly afterwards.**_ + +The [Raspberry Pi][1] is one of the [most popular SBC (Single-Board-Computer)][2]. If you are interested in this topic, I believe that you’ve finally got a Pi device. I also advise to get all the [additional Raspberry Pi accessories][3] to get started with your device. + +You’re ready to turn it on and start to tinker around with it. It has it’s own similarities and differences compared to traditional computers like desktops and laptops. + +Today, let’s go ahead and learn how to turn on and shutdown a Raspberry Pi as it doesn’t really feature a ‘power button’ of sorts. + +For this article I’m using a Raspberry Pi 3B+, but it’s the same for all the Raspberry Pi variants. + +Bestseller No. 1 + +[][4] + +[CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)][4] + +CanaKit - Personal Computers + +$79.99 [][5] + +Bestseller No. 2 + +[][6] + +[CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply][6] + +CanaKit - Personal Computers + +$54.99 [][5] + +### Turn on Raspberry Pi + +![Micro USB port for Power][7] + +The micro USB port powers the Raspberry Pi, the way you turn it on is by plugging in the power cable into the micro USB port. But, before you do that you should make sure that you have done the following things. + + * Preparing the micro SD card with Raspbian according to the official [guide][8] and inserting into the micro SD card slot. + * Plugging in the HDMI cable, USB keyboard and a Mouse. + * Plugging in the Ethernet Cable(Optional). + + + +Once you have done the above, plug in the power cable. This turns on the Raspberry Pi and the display will light up and load the Operating System. + +Bestseller No. 1 + +[][4] + +[CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)][4] + +CanaKit - Personal Computers + +$79.99 [][5] + +### Shutting Down the Pi + +Shutting down the Pi is pretty straight forward, click the menu button and choose shutdown. + +![Turn off Raspberry Pi graphically][9] + +Alternatively, you can use the [shutdown command][10] in the terminal: + +``` +sudo shutdown now +``` + +Once the shutdown process has started **wait** till it completely finishes and then you can cut the power to it. Once the Pi shuts down, there is no real way to turn the Pi back on without turning off and turning on the power. You could the GPIO’s to turn on the Pi from the shutdown state but it’ll require additional modding. + +[][2] + +Suggested read 12 Single Board Computers: Alternative to Raspberry Pi + +_Note: Micro USB ports tend to be fragile, hence turn-off/on the power at source instead of frequently unplugging and plugging into the micro USB port._ + +Well, that’s about all you should know about turning on and shutting down the Pi, what do you plan to use it for? Let me know in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/turn-on-raspberry-pi/ + +作者:[Chinmay][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/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://itsfoss.com/raspberry-pi-alternatives/ +[3]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/ +[4]: https://www.amazon.com/CanaKit-Raspberry-Starter-Premium-Black/dp/B07BCC8PK7?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07BCC8PK7&keywords=raspberry%20pi%20kit (CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)) +[5]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[6]: https://www.amazon.com/CanaKit-Raspberry-Premium-Clear-Supply/dp/B07BC7BMHY?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07BC7BMHY&keywords=raspberry%20pi%20kit (CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply) +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-3-microusb.png?fit=800%2C532&ssl=1 +[8]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/Raspbian-ui-menu.jpg?fit=800%2C492&ssl=1 +[10]: https://linuxhandbook.com/linux-shutdown-command/ From 8f5f59755bf5cd0c34cf0ae11bbc9fc90915d0dd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:43:04 +0800 Subject: [PATCH 0284/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190428=20Inst?= =?UTF-8?q?alling=20Budgie=20Desktop=20on=20Ubuntu=20[Quick=20Guide]=20sou?= =?UTF-8?q?rces/tech/20190428=20Installing=20Budgie=20Desktop=20on=20Ubunt?= =?UTF-8?q?u=20-Quick=20Guide.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g Budgie Desktop on Ubuntu -Quick Guide.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md diff --git a/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md b/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md new file mode 100644 index 0000000000..11659592fb --- /dev/null +++ b/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing Budgie Desktop on Ubuntu [Quick Guide]) +[#]: via: (https://itsfoss.com/install-budgie-ubuntu/) +[#]: author: (Atharva Lele https://itsfoss.com/author/atharva/) + +Installing Budgie Desktop on Ubuntu [Quick Guide] +====== + +_**Brief: Learn how to install Budgie desktop on Ubuntu in this step-by-step tutorial.**_ + +Among all the [various Ubuntu versions][1], [Ubuntu Budgie][2] is the most underrated one. It looks elegant and it’s not heavy on resources. + +Read this [Ubuntu Budgie review][3] or simply watch this video to see what Ubuntu Budgie 18.04 looks like. + +[Subscribe to our YouTube channel for more Linux Videos][4] + +If you like [Budgie desktop][5] but you are using some other version of Ubuntu such as the default Ubuntu with GNOME desktop, I have good news for you. You can install Budgie on your current Ubuntu system and switch the desktop environments. + +In this post, I’m going to tell you exactly how to do that. But first, a little introduction to Budgie for those who are unaware about it. + +Budgie desktop environment is developed mainly by [Solus Linux team.][6] It is designed with focus on elegance and modern usage. Budgie is available for all major Linux distributions for users to try and experience this new desktop environment. Budgie is pretty mature by now and provides a great desktop experience. + +Warning + +Installing multiple desktops on the same system MAY result in conflicts and you may see some issue like missing icons in the panel or multiple icons of the same program. + +You may not see any issue at all as well. It’s your call if you want to try different desktop. + +### Install Budgie on Ubuntu + +This method is not tested on Linux Mint, so I recommend that you not follow this guide for Mint. + +For those on Ubuntu, Budgie is now a part of the Ubuntu repositories by default. Hence, we don’t need to add any PPAs in order to get Budgie. + +To install Budgie, simply run this command in terminal. We’ll first make sure that the system is fully updated. + +``` +sudo apt update && sudo apt upgrade +sudo apt install ubuntu-budgie-desktop +``` + +When everything is done downloading, you will get a prompt to choose your display manager. Select ‘lightdm’ to get the full Budgie experience. + +![Select lightdm][7] + +After the installation is complete, reboot your computer. You will be then greeted by the Budgie login screen. Enter your password to go into the homescreen. + +![Budgie Desktop Home][8] + +### Switching to other desktop environments + +![Budgie login screen][9] + +You can click the Budgie icon next to your name to get options for login. From there you can select between the installed Desktop Environments (DEs). In my case, I see Budgie and the default Ubuntu (GNOME) DEs. + +![Select your DE][10] + +Hence whenever you feel like logging into GNOME, you can do so using this menu. + +[][11] + +Suggested read Get Rid of 'snapd returned status code 400: Bad Request' Error in Ubuntu + +### How to Remove Budgie + +If you don’t like Budgie or just want to go back to your regular old Ubuntu, you can switch back to your regular desktop as described in the above section. + +However, if you really want to remove Budgie and its component, you can follow the following commands to get back to a clean slate. + +_**Switch to some other desktop environments before using these commands:**_ + +``` +sudo apt remove ubuntu-budgie-desktop ubuntu-budgie* lightdm +sudo apt autoremove +sudo apt install --reinstall gdm3 +``` + +After running all the commands successfully, reboot your computer. + +Now, you will be back to GNOME or whichever desktop environment you had. + +**What you think of Budgie?** + +Budgie is one of the [best desktop environments for Linux][12]. Hope this short guide helped you install the awesome Budgie desktop on your Ubuntu system. + +If you did install Budgie, what do you like about it the most? Let us know in the comments below. And as usual, any questions or suggestions are always welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-budgie-ubuntu/ + +作者:[Atharva Lele][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/atharva/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/which-ubuntu-install/ +[2]: https://ubuntubudgie.org/ +[3]: https://itsfoss.com/ubuntu-budgie-18-review/ +[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[5]: https://github.com/solus-project/budgie-desktop +[6]: https://getsol.us/home/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_select_dm.png?fit=800%2C559&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_homescreen.jpg?fit=800%2C500&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_lockscreen.png?fit=800%2C403&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_lockscreen_select_de.png?fit=800%2C403&ssl=1 +[11]: https://itsfoss.com/snapd-error-ubuntu/ +[12]: https://itsfoss.com/best-linux-desktop-environments/ From 2d186603cddbe96e748b27b42456876c4c912a60 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:43:15 +0800 Subject: [PATCH 0285/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190427=20Moni?= =?UTF-8?q?toring=20CPU=20and=20GPU=20Temperatures=20on=20Linux=20sources/?= =?UTF-8?q?tech/20190427=20Monitoring=20CPU=20and=20GPU=20Temperatures=20o?= =?UTF-8?q?n=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oring CPU and GPU Temperatures on Linux.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md diff --git a/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md b/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md new file mode 100644 index 0000000000..89f942ce66 --- /dev/null +++ b/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md @@ -0,0 +1,166 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Monitoring CPU and GPU Temperatures on Linux) +[#]: via: (https://itsfoss.com/monitor-cpu-gpu-temp-linux/) +[#]: author: (It's FOSS Community https://itsfoss.com/author/itsfoss/) + +Monitoring CPU and GPU Temperatures on Linux +====== + +_**Brief: This articles discusses two simple ways of monitoring CPU and GPU temperatures in Linux command line.**_ + +Because of **[Steam][1]** (including _[Steam Play][2]_ , aka _Proton_ ) and other developments, **GNU/Linux** is becoming the gaming platform of choice for more and more computer users everyday. A good number of users are also going for **GNU/Linux** when it comes to other resource-consuming computing tasks such as [video editing][3] or graphic design ( _Kdenlive_ and _[Blender][4]_ are good examples of programs for these). + +Whether you are one of those users or otherwise, you are bound to have wondered how hot your computer’s CPU and GPU can get (even more so if you do overclocking). If that is the case, keep reading. We will be looking at a couple of very simple commands to monitor CPU and GPU temps. + +My setup includes a [Slimbook Kymera][5] and two displays (a TV set and a PC monitor) which allows me to use one for playing games and the other to keep an eye on the temperatures. Also, since I use [Zorin OS][6] I will be focusing on **Ubuntu** and **Ubuntu** derivatives. + +To monitor the behaviour of both CPU and GPU we will be making use of the useful `watch` command to have dynamic readings every certain number of seconds. + +![][7] + +### Monitoring CPU Temperature in Linux + +For CPU temps, we will combine `watch` with the `sensors` command. An interesting article about a [gui version of this tool has already been covered on It’s FOSS][8]. However, we will use the terminal version here: + +``` +watch -n 2 sensors +``` + +`watch` guarantees that the readings will be updated every 2 seconds (and this value can — of course — be changed to what best fit your needs): + +``` +Every 2,0s: sensors + +iwlwifi-virtual-0 +Adapter: Virtual device +temp1: +39.0°C + +acpitz-virtual-0 +Adapter: Virtual device +temp1: +27.8°C (crit = +119.0°C) +temp2: +29.8°C (crit = +119.0°C) + +coretemp-isa-0000 +Adapter: ISA adapter +Package id 0: +37.0°C (high = +82.0°C, crit = +100.0°C) +Core 0: +35.0°C (high = +82.0°C, crit = +100.0°C) +Core 1: +35.0°C (high = +82.0°C, crit = +100.0°C) +Core 2: +33.0°C (high = +82.0°C, crit = +100.0°C) +Core 3: +36.0°C (high = +82.0°C, crit = +100.0°C) +Core 4: +37.0°C (high = +82.0°C, crit = +100.0°C) +Core 5: +35.0°C (high = +82.0°C, crit = +100.0°C) +``` + +Amongst other things, we get the following information: + + * We have 5 cores in use at the moment (with the current highest temperature being 37.0ºC). + * Values higher than 82.0ºC are considered high. + * A value over 100.0ºC is deemed critical. + + + +[][9] + +Suggested read Top 10 Command Line Games For Linux + +The values above lead us to the conclusion that the computer’s workload is very light at the moment. + +### Monitoring GPU Temperature in Linux + +Let us turn to the graphics card now. I have never used an **AMD** dedicated graphics card, so I will be focusing on **Nvidia** ones. The first thing to do is download the appropriate, current driver through [additional drivers in Ubuntu][10]. + +On **Ubuntu** (and its forks such as **Zorin** or **Linux Mint** ), going to _Software & Updates_ > _Additional Drivers_ and selecting the most recent one normally suffices. Additionally, you can add/enable the official _ppa_ for graphics cards (either through the command line or via _Software & Updates_ > _Other Software_ ). After installing the driver you will have at your disposal the _Nvidia X Server_ gui application along with the command line utility _nvidia-smi_ (Nvidia System Management Interface). So we will use `watch` and `nvidia-smi`: + +``` +watch -n 2 nvidia-smi +``` + +And — the same as for the CPU — we will get updated readings every two seconds: + +``` +Every 2,0s: nvidia-smi + +Fri Apr 19 20:45:30 2019 ++-----------------------------------------------------------------------------+ +| Nvidia-SMI 418.56 Driver Version: 418.56 CUDA Version: 10.1 | +|-------------------------------+----------------------+----------------------+ +| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | +| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | +|===============================+======================+======================| +| 0 GeForce GTX 106... Off | 00000000:01:00.0 On | N/A | +| 0% 54C P8 10W / 120W | 433MiB / 6077MiB | 4% Default | ++-------------------------------+----------------------+----------------------+ + ++-----------------------------------------------------------------------------+ +| Processes: GPU Memory | +| GPU PID Type Process name Usage | +|=============================================================================| +| 0 1557 G /usr/lib/xorg/Xorg 190MiB | +| 0 1820 G /usr/bin/gnome-shell 174MiB | +| 0 7820 G ...equest-channel-token=303407235874180773 65MiB | ++-----------------------------------------------------------------------------+ +``` + +The chart gives the following information about the graphics card: + + * it is using the open source driver version 418.56. + * the current temperature of the card is 54.0ºC — with the fan at 0% of its capacity. + * the power consumption is very low: only 10W. + * out of 6 GB of vram (video random access memory), it is only using 433 MB. + * the used vram is being taken by three processes whose IDs are — respectively — 1557, 1820 and 7820. + + + +[][11] + +Suggested read Googler: Now You Can Google From Linux Terminal! + +Most of these facts/values show that — clearly — we are not playing any resource-consuming games or dealing with heavy workloads. Should we started playing a game, processing a video — or the like —, the values would start to go up. + +#### Conclusion + +Althoug there are gui tools, I find these two commands very handy to check on your hardware in real time. + +What do you make of them? You can learn more about the utilities involved by reading their man pages. + +Do you have other preferences? Share them with us in the comments, ;). + +Halof!!! (Have a lot of fun!!!). + +![avatar][12] + +### Alejandro Egea-Abellán + +It’s FOSS Community Contributor + +I developed a liking for electronics, linguistics, herpetology and computers (particularly GNU/Linux and FOSS). I am LPIC-2 certified and currently work as a technical consultant and Moodle administrator in the Department for Lifelong Learning at the Ministry of Education in Murcia, Spain. I am a firm believer in lifelong learning, the sharing of knowledge and computer-user freedom. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/monitor-cpu-gpu-temp-linux/ + +作者:[It's FOSS Community][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-steam-ubuntu-linux/ +[2]: https://itsfoss.com/steam-play-proton/ +[3]: https://itsfoss.com/best-video-editing-software-linux/ +[4]: https://www.blender.org/ +[5]: https://slimbook.es/ +[6]: https://zorinos.com/ +[7]: https://itsfoss.com/wp-content/uploads/2019/04/monitor-cpu-gpu-temperature-linux-800x450.png +[8]: https://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ +[9]: https://itsfoss.com/best-command-line-games-linux/ +[10]: https://itsfoss.com/install-additional-drivers-ubuntu/ +[11]: https://itsfoss.com/review-googler-linux/ +[12]: https://itsfoss.com/wp-content/uploads/2019/04/EGEA-ABELLAN-Alejandro.jpg From 458cb1037260d07f5bccb056f82e4d625bd788dd Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:43:24 +0800 Subject: [PATCH 0286/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190426=20Noma?= =?UTF-8?q?dBSD,=20a=20BSD=20for=20the=20Road=20sources/tech/20190426=20No?= =?UTF-8?q?madBSD,=20a=20BSD=20for=20the=20Road.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190426 NomadBSD, a BSD for the Road.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/tech/20190426 NomadBSD, a BSD for the Road.md diff --git a/sources/tech/20190426 NomadBSD, a BSD for the Road.md b/sources/tech/20190426 NomadBSD, a BSD for the Road.md new file mode 100644 index 0000000000..d31f9b4a90 --- /dev/null +++ b/sources/tech/20190426 NomadBSD, a BSD for the Road.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (NomadBSD, a BSD for the Road) +[#]: via: (https://itsfoss.com/nomadbsd/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +NomadBSD, a BSD for the Road +====== + +As regular It’s FOSS readers should know, I like diving into the world of BSDs. Recently, I came across an interesting BSD that is designed to live on a thumb drive. Let’s take a look at NomadBSD. + +### What is NomadBSD? + +![Nomadbsd Desktop][1] + +[NomadBSD][2] is different than most available BSDs. NomadBSD is a live system based on FreeBSD. It comes with automatic hardware detection and an initial config tool. NomadBSD is designed to “be used as a desktop system that works out of the box, but can also be used for data recovery, for educational purposes, or to test FreeBSD’s hardware compatibility.” + +This German BSD comes with an [OpenBox][3]-based desktop with the Plank application dock. NomadBSD makes use of the [DSB project][4]. DSB stands for “Desktop Suite (for) (Free)BSD” and consists of a collection of programs designed to create a simple and working environment without needing a ton of dependencies to use one tool. DSB is created by [Marcel Kaiser][5] one of the lead devs of NomadBSD. + +Just like the original BSD projects, you can contact the NomadBSD developers via a [mailing list][6]. + +[][7] + +Suggested read Enjoy Netflix? You Should Thank FreeBSD + +#### Included Applications + +NomadBSD comes with the following software installed: + + * Thunar file manager + * Asunder CD ripper + * Bash 5.0 + * Filezilla FTP client + * Firefox web browser + * Fish Command line + * Gimp + * Qpdfview + * Git + + + * Hexchat IRC client + * Leafpad text editor + * Midnight Commander file manager + * PaleMoon web browser + * PCManFM file manager + * Pidgin messaging client + * Transmission BitTorrent client + + + * Redshift + * Sakura terminal emulator + * Slim login manager + * Thunderbird email client + * VLC media player + * Plank application dock + * Z Shell + + + +You can see a complete of the pre-installed applications in the [MANIFEST file][8]. + +![Nomadbsd Openbox Menu][9] + +#### Version 1.2 Released + +NomadBSD recently released version 1.2 on April 21, 2019. This means that NomadBSD is now based on FreeBSD 12.0-p3. TRIM is now enabled by default. One of the biggest changes is that the initial command-line setup was replaced with a Qt graphical interface. They also added a Qt5 tool to install NomadBSD to your hard drive. A number of fixes were included to improve graphics support. They also added support for creating 32-bit images. + +[][10] + +Suggested read 6 Reasons Why Linux Users Switch to BSD + +### Installing NomadBSD + +Since NomadBSD is designed to be a live system, we will need to add the BSD to a USB drive. First, you will need to [download it][11]. There are several options to choose from: 64-bit, 32-bit, or 64-bit Mac. + +You will be a USB drive that has at least 4GB. The system that you are installing to should have a 1.2 GHz processor and 1GB of RAM to run NomadBSD comfortably. Both BIOS and UEFI are supported. + +All of the images available for download are compressed as a `.lzma` file. So, once you have downloaded the file, you will need to extract the `.img` file. On Linux, you can use either of these commands: `lzma -d nomadbsd-x.y.z.img.lzma` or `xzcat nomadbsd-x.y.z.img.lzma`. (Be sure to replace x.y.z with the correct file name you just downloaded.) + +Before we proceed, we need to find out the id of your USB drive. (Hopefully, you have inserted it by now.) I use the `lsblk` command to find my USB drive, which in my case is `sdb`. To write the image file, use this command `sudo dd if=nomadbsd-x.y.z.img of=/dev/sdb bs=1M conv=sync`. (Again, don’t forget to correct the file name.) If you are uncomfortable using `dd`, you can use [Etcher][12]. If you have Windows, you will need to use [7-zip][13] to extract the image file and Etcher or [Rufus][14] to write the image to the USB drive. + +When you boot from the USB drive, you will encounter a simple config tool. Once you answer the required questions, you will be greeted with a simple Openbox desktop. + +### Thoughts on NomadBSD + +I first discovered NomadBSD back in January when they released 1.2-RC1. At the time, I had been unable to install [Project Trident][15] on my laptop and was very frustrated with BSDs. I downloaded NomadBSD and tried it out. I initially ran into issues reaching the desktop, but RC2 fixed that issue. However, I was unable to get on the internet, even though I had an Ethernet cable plugged in. Luckily, I found the wifi manager in the menu and was able to connect to my wifi. + +Overall, my experience with NomadBSD was pleasant. Once I figured out a few things, I was good to go. I hope that NomadBSD is the first of a new generation of BSDs that focus on mobility and ease of use. BSD has conquered the server world, it’s about time they figured out how to be more user-friendly. + +Have you ever used NomadBSD? What is your BSD? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][16]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nomadbsd/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2019/04/NomadBSD-desktop-800x500.jpg +[2]: http://nomadbsd.org/ +[3]: http://openbox.org/wiki/Main_Page +[4]: https://freeshell.de/%7Emk/projects/dsb.html +[5]: https://github.com/mrclksr +[6]: http://nomadbsd.org/contact.html +[7]: https://itsfoss.com/netflix-freebsd-cdn/ +[8]: http://nomadbsd.org/download/nomadbsd-1.2.manifest +[9]: https://itsfoss.com/wp-content/uploads/2019/04/NomadBSD-Openbox-menu-800x500.jpg +[10]: https://itsfoss.com/why-use-bsd/ +[11]: http://nomadbsd.org/download.html +[12]: https://www.balena.io/etcher/ +[13]: https://www.7-zip.org/ +[14]: https://rufus.ie/ +[15]: https://itsfoss.com/project-trident-interview/ +[16]: http://reddit.com/r/linuxusersgroup From d47b073321f420d9aaca0aab4e51b1919a372cce Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:43:34 +0800 Subject: [PATCH 0287/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190425=20Debi?= =?UTF-8?q?an=20has=20a=20New=20Project=20Leader=20sources/tech/20190425?= =?UTF-8?q?=20Debian=20has=20a=20New=20Project=20Leader.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190425 Debian has a New Project Leader.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20190425 Debian has a New Project Leader.md diff --git a/sources/tech/20190425 Debian has a New Project Leader.md b/sources/tech/20190425 Debian has a New Project Leader.md new file mode 100644 index 0000000000..00f114b907 --- /dev/null +++ b/sources/tech/20190425 Debian has a New Project Leader.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Debian has a New Project Leader) +[#]: via: (https://itsfoss.com/debian-project-leader-election/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +Debian has a New Project Leader +====== + +Like each year, the Debian Secretary announced a call for nominations for the post of Debian Project Leader (commonly known as DPL) in early March. Soon 5 candidates shared their nomination. One of the DPL candidates backed out due to personal reasons and we had [four candidates][1] as can be seen in the Nomination section of the Vote page. + +### Sam Hartman, the new Debian Project Leader + +![][2] + +While I will not go much into details as Sam already outlined his position on his [platform][3], it is good to see that most Debian developers recognize that it’s no longer just the technical excellence which need to be looked at. I do hope he is able to create more teams which would leave some more time in DPL’s hands and less stress going forward. + +As he has shared, he would be looking into also helping the other DPL candidates, all of which presented initiatives to make Debian better. + +Apart from this, there had been some excellent suggestions, for example modernizing debian-installer, making lists.debian.org have a [Mailman 3][4] instance, modernizing Debian packaging and many more. + +While probably a year is too short a time for any of the deliverables that Debian people are thinking, some sort of push or start should enable Debian to reach greater heights than today. + +### A brief history of DPL elections + +In the beginning, Debian was similar to many distributions which have a [BDFL][5], although from the very start Debian had a sort of rolling leadership. While I wouldn’t go through the whole history, from October 1998 there was an idea [germinated][6] to have a Debian Constitution. + +After quite a bit of discussion between Debian users, contributors, developers etc. [Debian 1.0 Constitution][7] was released on December 2nd, 1998. One of the big changes was that it formalised the selection of Debian Project Leader via elections. + +From 1998 till 2019 13 Debian project leaders have been elected till date with Sam Hartman being the latest (2019). + +Before Sam, [Chris Lamb][8] was DPL in 2017 and again stood up for re-election in 2018. One of the biggest changes in Chris’s tenure was having more impetus to outreach than ever before. This made it possible to have many more mini-debconfs all around the world and thus increasing more number of Debian users and potential Debian Developers. + +[][9] + +Suggested read SemiCode OS: A Linux Distribution For Programmers And Web Developers + +### Duties and Responsibilities of the Debian Project Leader + +![][10] + +Debian Project Leader (DPL) is a non-monetary position which means that the DPL doesn’t get a salary or any monetary benefits in the traditional sense but it’s a prestigious position. + +Curious what what a DPL does? Here are some of the duties, responsibilities, prestige and perks associated with this position. + +#### Travelling + +As the DPL is the public face of the project, she/he is supposed to travel to many places in the world to share about Debian. While the travel may be a perk, it is and could be discounted by being not paid for the time spent articulating Debian’s position in various free software and other communities. Also travel, language, politics of free software are also some of the stress points that any DPL would have to go through. + +#### Communication + +A DPL is expected to have excellent verbal and non-verbal communication skills as she/he is the expected to share Debian’s vision of computing to technical and non-technical people. As she/he is also expected to weigh in many a sensitive matter, the Project Leader has to make choices about which communications should be made public and which should be private. + +#### Budgeting + +Quite a bit of the time the Debian Project Leader has to look into the finances along with the Secretary and take a call at various initiatives mooted by the larger community. The Project Leader has to ask and then make informed decisions on the same. + +#### Delegation + +One of the important tasks of the DPL is to delegate different tasks to suitable people. Some sensitive delegations include ftp-master, ftp-assistant, list-managers, debian-mirror, debian-infrastructure and so on. + +#### Influence + +Last but not the least, just like any other election, the people who contest for DPL have a platform where they share their ideas about where they would like to see the Debian project heading and how they would go about doing it. + +This is by no means an exhaustive list. I would suggest to read Lucas Nussbaum’s [mail][11] in which he outlines some more responsibilities as a Debian Project Leader. + +[][12] + +Suggested read Lightweight Linux Distribution Bodhi Linux 5.0 Released + +**In the end…** + +I wish Sam Hartman all the luck. I look forward to see how Debian grows under his leadership. + +I also hope that you learned a few non-technical thing around Debian. If you are an [ardent Debian user][13], stuff like this make you feel more involved with Debian project. What do you say? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debian-project-leader-election/ + +作者:[Shirish][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/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://www.debian.org/vote/2019/vote_001 +[2]: https://itsfoss.com/wp-content/uploads/2019/04/Debian-Project-Leader-election-800x450.png +[3]: https://www.debian.org/vote/2019/platforms/hartmans +[4]: http://docs.mailman3.org/en/latest/ +[5]: https://en.wikipedia.org/wiki/Benevolent_dictator_for_life +[6]: https://lists.debian.org/debian-devel/1998/09/msg00506.html +[7]: https://www.debian.org/devel/constitution.1.0 +[8]: https://www.debian.org/vote/2017/platforms/lamby +[9]: https://itsfoss.com/semicode-os-linux/ +[10]: https://itsfoss.com/wp-content/uploads/2019/04/leadership-800x450.jpg +[11]: https://lists.debian.org/debian-vote/2019/03/msg00023.html +[12]: https://itsfoss.com/bodhi-linux-5/ +[13]: https://itsfoss.com/reasons-why-i-love-debian/ From aebd9c5688a48a8383e54c000f386cb150cec144 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:43:53 +0800 Subject: [PATCH 0288/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20Epic?= =?UTF-8?q?=20Games=20Store=20is=20Now=20Available=20on=20Linux=20Thanks?= =?UTF-8?q?=20to=20Lutris=20sources/tech/20190423=20Epic=20Games=20Store?= =?UTF-8?q?=20is=20Now=20Available=20on=20Linux=20Thanks=20to=20Lutris.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Now Available on Linux Thanks to Lutris.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md diff --git a/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md b/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md new file mode 100644 index 0000000000..b8432c522e --- /dev/null +++ b/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Epic Games Store is Now Available on Linux Thanks to Lutris) +[#]: via: (https://itsfoss.com/epic-games-lutris-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Epic Games Store is Now Available on Linux Thanks to Lutris +====== + +_**Brief: Open Source gaming platform Lutris now enables you to use Epic Games Store on Linux. We tried it on Ubuntu 19.04 and here’s our experience with it.**_ + +[Gaming on Linux][1] just keeps getting better. Want to [play Windows games on Linux][2], Steam’s new [in-progress feature][3] enables you to do that. + +Steam might be new in the field of Windows games on Linux but Lutris has been doing it for years. + +[Lutris][4] is an open source gaming platform for Linux where it provides installers for game clients like Origin, Steam, Blizzard.net app and so on. It utilizes Wine to run stuff that isn’t natively supported on Linux. + +Lutris has recently announced that you can now use Epic Games Store using Lutris. + +### Lutris brings Epic Games to Linux + +![Epic Games Store Lutris Linux][5] + +[Epic Games Store][6] is a digital video game distribution platform like Steam. It only supports Windows and macOS for the moment. + +The Lutris team worked hard to bring Epic Games Store to Linux via Lutris. Even though I’m not a big fan of Epic Games Store, it was good to know about the support for Linux via Lutris: + +> Good news! [@EpicGames][7] Store is now fully functional under Linux if you use Lutris to install it! No issues observed whatsoever. [@TimSweeneyEpic][8] will probably like this 😊 [pic.twitter.com/7mt9fXt7TH][9] +> +> — Lutris Gaming (@LutrisGaming) [April 17, 2019][10] + +As an avid gamer and Linux user, I immediately jumped upon this news and installed Lutris to run Epic Games on it. + +**Note:** _I used[Ubuntu 19.04][11] to test Epic Games store for Linux._ + +### Using Epic Games Store for Linux using Lutris + +To install Epic Games Store on your Linux system, make sure that you have [Lutris][4] installed with its pre-requisites Wine and Python 3. So, first [install Wine on Ubuntu][12] or whichever Linux you are using and then [download Lutris from its website][13]. + +[][14] + +Suggested read Ubuntu Mate Will Be Default OS On Entroware Laptops + +#### Installing Epic Games Store + +Once the installation of Lutris is successful, simply launch it. + +While I tried this, I encountered an error (nothing happened when I tried to launch it using the GUI). However, when I typed in “ **lutris** ” on the terminal to launch it otherwise, I noticed an error that looked like this: + +![][15] + +Thanks to Abhishek, I learned that this is a common issue (you can check that on [GitHub][16]). + +So, to fix it, all I had to do was – type in a command in the terminal: + +``` +export LC_ALL=C +``` + +Just copy it and enter it in your terminal if you face the same issue. And, then, you will be able to open Lutris. + +**Note:** _You’ll have to enter this command every time you launch Lutris. So better to add it to your .bashrc or list of environment variable._ + +Once that is done, simply launch it and search for “ **Epic Games Store** ” as shown in the image below: + +![Epic Games Store in Lutris][17] + +Here, I have it installed already, so you will get the option to “Install” it and then it will automatically ask you to install the required packages that it needs. You just have to proceed in order to successfully install it. That’s it – no rocket science involved. + +#### Playing a Game on Epic Games Store + +![Epic Games Store][18] + +Now that we have Epic Games store via Lutris on Linux, simply launch it and log in to your account to get started. + +But, does it really work? + +_Yes, the Epic Games Store does work._ **But, all the games don’t.** + +Well, I haven’t tried everything, but I grabbed a free game (Transistor – a turn-based ARPG game) to check if that works. + +![Transistor – Epic Games Store][19] + +Unfortunately, it didn’t. It says that it is “Running” when I launch it but then again, nothing happens. + +As of now, I’m not aware of any solutions to that – so I’ll try to keep you guys updated if I find a fix. + +[][20] + +Suggested read Alpha Version Of New Skype Client For Linux Is Out Now + +**Wrapping Up** + +It’s good to see the gaming scene improve on Linux thanks to the solutions like Lutris for users. However, there’s still a lot of work to be done. + +For a game to run hassle-free on Linux is still a challenge. There can be issues like this which I encountered or similar. But, it’s going in the right direction – even if it has issues. + +What do you think of Epic Games Store on Linux via Lutris? Have you tried it yet? Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/epic-games-lutris-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-gaming-guide/ +[2]: https://itsfoss.com/steam-play/ +[3]: https://itsfoss.com/steam-play-proton/ +[4]: https://lutris.net/ +[5]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-lutris-linux-800x450.png +[6]: https://www.epicgames.com/store/en-US/ +[7]: https://twitter.com/EpicGames?ref_src=twsrc%5Etfw +[8]: https://twitter.com/TimSweeneyEpic?ref_src=twsrc%5Etfw +[9]: https://t.co/7mt9fXt7TH +[10]: https://twitter.com/LutrisGaming/status/1118552969816018948?ref_src=twsrc%5Etfw +[11]: https://itsfoss.com/ubuntu-19-04-release-features/ +[12]: https://itsfoss.com/install-latest-wine/ +[13]: https://lutris.net/downloads/ +[14]: https://itsfoss.com/ubuntu-mate-entroware/ +[15]: https://itsfoss.com/wp-content/uploads/2019/04/lutris-error.jpg +[16]: https://github.com/lutris/lutris/issues/660 +[17]: https://itsfoss.com/wp-content/uploads/2019/04/lutris-epic-games-store-800x520.jpg +[18]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-800x450.jpg +[19]: https://itsfoss.com/wp-content/uploads/2019/04/transistor-game-epic-games-store-800x410.jpg +[20]: https://itsfoss.com/skpe-alpha-linux/ From f8e618dc6542d55888006959c0bc5b4ace91239e Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:44:17 +0800 Subject: [PATCH 0289/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190504=20May?= =?UTF-8?q?=20the=20fourth=20be=20with=20you:=20How=20Star=20Wars=20(and?= =?UTF-8?q?=20Star=20Trek)=20inspired=20real=20life=20tech=20sources/tech/?= =?UTF-8?q?20190504=20May=20the=20fourth=20be=20with=20you-=20How=20Star?= =?UTF-8?q?=20Wars=20(and=20Star=20Trek)=20inspired=20real=20life=20tech.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...(and Star Trek) inspired real life tech.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md diff --git a/sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md b/sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md new file mode 100644 index 0000000000..a05f9a6b4f --- /dev/null +++ b/sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (May the fourth be with you: How Star Wars (and Star Trek) inspired real life tech) +[#]: via: (https://opensource.com/article/19/5/may-the-fourth-star-wars-trek) +[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) + +May the fourth be with you: How Star Wars (and Star Trek) inspired real life tech +====== +The technologies may have been fictional, but these two acclaimed sci-fi +series have inspired open source tech. +![Triangulum galaxy, NASA][1] + +Conventional wisdom says you can either be a fan of _Star Trek_ or of _Star Wars_ , but mixing the two is like mixing matter and anti-matter. I'm not sure that's true, but even if the laws of physics cannot be changed, these two acclaimed sci-fi series have influenced the open source universe and created their own open source multi-verses. + +For example, fans have used the original _Star Trek_ as "source code" to create fan-made films, cartoons, and games. One of the more notable fan creations was the web series _Star Trek Continues_ , which faithfully adapted Gene Roddenberry's universe and redistributed it to the world. + +"Eventually we realized that there is no more profound way in which people could express what _Star Trek_ has meant to them than by creating their own very personal _Star Trek_ things," [Roddenberry said][2]. However, due to copyright restrictions, this "open source" channel [has since been curtailed][3]. + +_Star Wars_ has a different approach to open sourcing its universe. [Jess Paguaga writes][4] on FanSided: "With a variety [of] fan film awards dating back to 2002, the _Star Wars_ brand has always supported and encouraged the creation of short films that help expand the universe of a galaxy far, far away." + +But, _Star Wars_ is not without its own copyright prime directives. In one case, a Darth Vader film by a YouTuber called Star Wars Theory has drawn a copyright claim from Disney. The claim does not stop production of the film, but diverts monetary gains from it, [reports James Richards][5] on FanSided. + +This could be one of the [Ferengi Rules of Acquisition][6], perhaps. + +But if you can't watch your favorite fan film, you can still get your [_Star Wars_ fix right in the Linux terminal][7] by entering: + + +``` +`telnet towel.blinkenlights.nl` +``` + +And _Star Trek_ fans can also interact with the Federation with the original text-based video game from 1971. While a high-school senior, Mike Mayfield ported the game from punch cards to HP BASIC. If you'd like to go old school and battle Klingons, the source code is available at the [Code Project][8]. + +### Real-life star tech + +Both _Star Wars_ and _Star Trek_ have inspired real-life technologies. Although those technologies were fictional, many have become the practical, open technology we use today. Some of them inspired technologies that are still in development now. + +In the early 1970s, Motorola engineer Martin Cooper was trying to beat AT&T at the car-phone game. He says he was watching Captain Kirk use a "communicator" on an episode of _Star Trek_ and had a eureka moment. His team went on to create the first portable cellular 800MHz phone prototype in 90 days. + +In _Star Wars_ , scout stormtroopers of the Galactic Empire rode the Aratech 74-Z Speeder Bike, and a real-life counterpart is the [Aero-X][9] being developed by California's Aerofex. + +Perhaps the most visible _Star Wars_ tech to enter our lives is droids. We first encountered R2-D2 back in the 1970s, but now we have droids vacuuming our carpets and mowing our lawns, from Roombas to the [Worx Landroid][10] lawnmower. + +And, in _Star Wars_ , Princess Leia appeared to Obi-Wan Kenobi as a hologram, and in Star Trek: Voyager, the ship's chief medical officer was an interactive hologram that could diagnose and treat patients. The technology to bring characters like these to "life" is still a ways off, but there are some interesting open source developments that hint of things to come. [OpenHolo][11], "an open source library containing algorithms and software implementations for holograms in various fields," is one such project. + +### Where's the beef? + +> "She handled… real meat… touched it, and cut it?" —Keiko O'Brien, Star Trek: The Next Generation + +In the _Star Trek_ universe, crew members get their meals by simply ordering a replicator to produce whatever food they desire. That could one day become a reality thanks to a concept created by two German students for an open source "meat-printer" they call the [Cultivator][12]. It would use bio-printing to produce something that appears to be meat; the user could even select its mineral and fat content. Perhaps with more collaboration and development, the Cultivator could become the replicator in tomorrow's kitchen! + +### The 501st + +Cosplayers, people from all walks of life who dress as their favorite characters, are the "open source embodiment" of their favorite universes. The [501st][13] [Legion][13] is an all-volunteer _Star Wars_ fan organization "formed for the express purpose of bringing together costume enthusiasts under a collective identity within which to operate," according to its charter. + +Jon Stallard, a member of Garrison Tyranus, the Central Virginia chapter of the 501st Legion says, "Everybody wanted to be something else when they were a kid, right? Whether it was Neil Armstrong, Batman, or the Six Million Dollar Man. Every backyard playdate was some kind of make-believe. The 501st lets us participate in our fan communities while contributing to the community at large." + +Are cosplayers really "open source characters"? Well, that depends. The copyright laws around cosplay and using unique props, costumes, and more are very complex, [writes Meredith Filak Rose][14] for _Public Knowledge_. "We're lucky to be living in a time where fandom generally enjoys a positive relationship with the creators whose work it admires," Rose concludes. + +So, it is safe to say that stormtroopers, Ferengi, Vulcans, and Yoda are all here to stay for a long, long time, near, and far, far away. + +Live long and prosper, you shall. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/may-the-fourth-star-wars-trek + +作者:[Jeff Macharyas ][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/jeffmacharyas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/triangulum_galaxy_nasa_stars.jpg?itok=NdS19A7m +[2]: https://fanlore.org/wiki/Gene_Roddenberry#His_Views_Regarding_Fanworks +[3]: https://trekmovie.com/2016/06/23/cbs-and-paramount-release-fan-film-guidelines/ +[4]: https://dorksideoftheforce.com/2019/01/17/star-wars-fan-films/ +[5]: https://dorksideoftheforce.com/2019/01/16/disney-claims-copyright-star-wars-theory/ +[6]: https://en.wikipedia.org/wiki/Rules_of_Acquisition +[7]: https://itsfoss.com/star-wars-linux/ +[8]: https://www.codeproject.com/Articles/28228/Star-Trek-1971-Text-Game +[9]: https://www.livescience.com/58943-real-life-star-wars-technology.html +[10]: https://www.digitaltrends.com/cool-tech/best-robot-lawnmowers/ +[11]: http://openholo.org/ +[12]: https://www.pastemagazine.com/articles/2016/05/the-future-is-vegan-according-to-star-trek.html +[13]: https://www.501st.com/ +[14]: https://www.publicknowledge.org/news-blog/blogs/copyright-and-cosplay-working-with-an-awkward-fit From 7c9315501bbcd128585fc1b1c32475a68b282566 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:44:32 +0800 Subject: [PATCH 0290/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190504=20Add?= =?UTF-8?q?=20methods=20retroactively=20in=20Python=20with=20singledispatc?= =?UTF-8?q?h=20sources/tech/20190504=20Add=20methods=20retroactively=20in?= =?UTF-8?q?=20Python=20with=20singledispatch.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oactively in Python with singledispatch.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20190504 Add methods retroactively in Python with singledispatch.md diff --git a/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md b/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md new file mode 100644 index 0000000000..022b06aa52 --- /dev/null +++ b/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Add methods retroactively in Python with singledispatch) +[#]: via: (https://opensource.com/article/19/5/python-singledispatch) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Add methods retroactively in Python with singledispatch +====== +Learn more about solving common Python problems in our series covering +seven PyPI libraries. +![][1] + +Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. + +In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. Today, we'll examine [**singledispatch**][4], a library that allows you to add methods to Python libraries retroactively. + +### singledispatch + +Imagine you have a "shapes" library with a **Circle** class, a **Square** class, etc. + +A **Circle** has a **radius** , a **Square** has a **side** , and a **Rectangle** has **height** and **width**. Our library already exists; we do not want to change it. + +However, we do want to add an **area** calculation to our library. If we didn't share this library with anyone else, we could just add an **area** method so we could call **shape.area()** and not worry about what the shape is. + +While it is possible to reach into a class and add a method, this is a bad idea: nobody expects their class to grow new methods, and things might break in weird ways. + +Instead, the **singledispatch** function in **functools** can come to our rescue. + + +``` +@singledispatch +def get_area(shape): +raise NotImplementedError("cannot calculate area for unknown shape", +shape) +``` + +The "base" implementation for the **get_area** function fails. This makes sure that if we get a new shape, we will fail cleanly instead of returning a nonsense result. + + +``` +@get_area.register(Square) +def _get_area_square(shape): +return shape.side ** 2 +@get_area.register(Circle) +def _get_area_circle(shape): +return math.pi * (shape.radius ** 2) +``` + +One nice thing about doing things this way is that if someone writes a _new_ shape that is intended to play well with our code, they can implement **get_area** themselves. + + +``` +from area_calculator import get_area + +@attr.s(auto_attribs=True, frozen=True) +class Ellipse: +horizontal_axis: float +vertical_axis: float + +@get_area.register(Ellipse) +def _get_area_ellipse(shape): +return math.pi * shape.horizontal_axis * shape.vertical_axis +``` + +_Calling_ **get_area** is straightforward. + + +``` +`print(get_area(shape))` +``` + +This means we can change a function that has a long **if isintance()/elif isinstance()** chain to work this way, without changing the interface. The next time you are tempted to check **if isinstance** , try using **singledispatch**! + +In the next article in this series, we'll look at **tox** , a tool for automating tests on Python code. + +#### Review the previous articles in this series: + + * [Cython][5] + * [Black][6] + * [attrs][7] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-singledispatch + +作者:[Moshe Zadka ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/singledispatch/ +[5]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[6]: https://opensource.com/article/19/4/python-problems-solved-black +[7]: https://opensource.com/article/19/4/python-problems-solved-attrs From ee01f6da917227acd0ba42e22a17873b130c2155 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:44:49 +0800 Subject: [PATCH 0291/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190504=20Usin?= =?UTF-8?q?g=20the=20force=20at=20the=20Linux=20command=20line=20sources/t?= =?UTF-8?q?ech/20190504=20Using=20the=20force=20at=20the=20Linux=20command?= =?UTF-8?q?=20line.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing the force at the Linux command line.md | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 sources/tech/20190504 Using the force at the Linux command line.md diff --git a/sources/tech/20190504 Using the force at the Linux command line.md b/sources/tech/20190504 Using the force at the Linux command line.md new file mode 100644 index 0000000000..48e802e183 --- /dev/null +++ b/sources/tech/20190504 Using the force at the Linux command line.md @@ -0,0 +1,240 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using the force at the Linux command line) +[#]: via: (https://opensource.com/article/19/5/may-the-force-linux) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +Using the force at the Linux command line +====== +Like the Jedi Force, -f is powerful, potentially destructive, and very +helpful when you know how to use it. +![Fireworks][1] + +Sometime in recent history, sci-fi nerds began an annual celebration of everything [_Star Wars_ on May the 4th][2], a pun on the Jedi blessing, "May the Force be with you." Although most Linux users are probably not Jedi, they still have ways to use the force. Of course, the movie might not have been quite as exciting if Yoda simply told Luke to type **man X-Wing fighter** or **man force**. Or if he'd said, "RTFM" (Read the Force Manual, of course). + +Many Linux commands have an **-f** option, which stands for, you guessed it, force! Sometimes when you execute a command, it fails or prompts you for additional input. This may be an effort to protect the files you are trying to change or inform the user that a device is busy or a file already exists. + +If you don't want to be bothered by prompts or don't care about errors, use the force! + +Be aware that using a command's force option to override these protections is, generally, destructive. Therefore, the user needs to pay close attention and be sure that they know what they are doing. Using the force can have consequences! + +Following are four Linux commands with a force option and a brief description of how and why you might want to use it. + +### cp + +The **cp** command is short for copy—it's used to copy (or duplicate) a file or directory. The [man page][3] describes the force option for **cp** as: + + +``` +-f, --force +if an existing destination file cannot be opened, remove it +and try again +``` + +This example is for when you are working with read-only files: + + +``` +[alan@workstation ~]$ ls -l +total 8 +-rw-rw---- 1 alan alan 13 May 1 12:24 Hoth +-r--r----- 1 alan alan 14 May 1 12:23 Naboo +[alan@workstation ~]$ cat Hoth Naboo +Icy Planet + +Green Planet +``` + +If you want to copy a file called _Hoth_ to _Naboo_ , the **cp** command will not allow it since _Naboo_ is read-only: + + +``` +[alan@workstation ~]$ cp Hoth Naboo +cp: cannot create regular file 'Naboo': Permission denied +``` + +But by using the force, **cp** will not prompt. The contents and permissions of _Hoth_ will immediately be copied to _Naboo_ : + + +``` +[alan@workstation ~]$ cp -f Hoth Naboo +[alan@workstation ~]$ cat Hoth Naboo +Icy Planet + +Icy Planet + +[alan@workstation ~]$ ls -l +total 8 +-rw-rw---- 1 alan alan 12 May 1 12:32 Hoth +-rw-rw---- 1 alan alan 12 May 1 12:38 Naboo +``` + +Oh no! I hope they have winter gear on Naboo. + +### ln + +The **ln** command is used to make links between files. The [man page][4] describes the force option for **ln** as: + + +``` +-f, --force +remove existing destination files +``` + +Suppose Princess Leia is maintaining a Java application server and she has a directory where all Java versions are stored. Here is an example: + + +``` +leia@workstation:/usr/lib/java$ ls -lt +total 28 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +As you can see, there are several versions of the Java Development Kit (JDK) and a symbolic link pointing to the latest one. She uses a script with the following commands to install new JDK versions. However, it won't work without a force option or unless the root user runs it: + + +``` +tar xvzmf jdk1.8.0_181.tar.gz -C jdk1.8.0_181/ +ln -vs jdk1.8.0_181 jdk +``` + +The **tar** command will extract the .gz file to the specified directory, but the **ln** command will fail to upgrade the link because one already exists. The result will be that the link no longer points to the latest JDK: + + +``` +leia@workstation:/usr/lib/java$ ln -vs jdk1.8.0_181 jdk +ln: failed to create symbolic link 'jdk/jdk1.8.0_181': File exists +leia@workstation:/usr/lib/java$ ls -lt +total 28 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +She can force **ln** to update the link correctly by passing the force option and one other, **-n**. The **-n** is needed because the link points to a directory. Now, the link again points to the latest JDK: + + +``` +leia@workstation:/usr/lib/java$ ln -vsnf jdk1.8.0_181 jdk +'jdk' -> 'jdk1.8.0_181' +leia@workstation:/usr/lib/java$ ls -lt +total 28 +lrwxrwxrwx 1 leia leia 12 May 1 16:13 jdk -> jdk1.8.0_181 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +A Java application can be configured to find the JDK with the path **/usr/lib/java/jdk** instead of having to change it every time Java is updated. + +### rm + +The **rm** command is short for "remove" (which we often call delete, since some other operating systems have a **del** command for this action). The [man page][5] describes the force option for **rm** as: + + +``` +-f, --force +ignore nonexistent files and arguments, never prompt +``` + +If you try to delete a read-only file, you will be prompted by **rm** : + + +``` +[alan@workstation ~]$ ls -l +total 4 +-r--r----- 1 alan alan 16 May 1 11:38 B-wing +[alan@workstation ~]$ rm B-wing +rm: remove write-protected regular file 'B-wing'? +``` + +You must type either **y** or **n** to answer the prompt and allow the **rm** command to proceed. If you use the force option, **rm** will not prompt you and will immediately delete the file: + + +``` +[alan@workstation ~]$ rm -f B-wing +[alan@workstation ~]$ ls -l +total 0 +[alan@workstation ~]$ +``` + +The most common use of force with **rm** is to delete a directory. The **-r** (recursive) option tells **rm** to remove a directory. When combined with the force option, it will remove the directory and all its contents without prompting. + +The **rm** command with certain options can be disastrous. Over the years, online forums have filled with jokes and horror stories of users completely wiping their systems. This notorious usage is **rm -rf ***. This will immediately delete all files and directories without any prompt wherever it is used. + +### userdel + +The **userdel** command is short for user delete, which will delete a user. The [man page][6] describes the force option for **userdel** as: + + +``` +-f, --force +This option forces the removal of the user account, even if the +user is still logged in. It also forces userdel to remove the +user's home directory and mail spool, even if another user uses +the same home directory or if the mail spool is not owned by the +specified user. If USERGROUPS_ENAB is defined to yes in +/etc/login.defs and if a group exists with the same name as the +deleted user, then this group will be removed, even if it is +still the primary group of another user. + +Note: This option is dangerous and may leave your system in an +inconsistent state. +``` + +When Obi-Wan reached the castle on Mustafar, he knew what had to be done. He had to delete Darth's user account—but Darth was still logged in. + + +``` +[root@workstation ~]# ps -fu darth +UID PID PPID C STIME TTY TIME CMD +darth 7663 7655 0 13:28 pts/3 00:00:00 -bash +[root@workstation ~]# userdel darth +userdel: user darth is currently used by process 7663 +``` + +Since Darth is currently logged in, Obi-Wan has to use the force option to **userdel**. This will delete the user account even though it's logged in. + + +``` +[root@workstation ~]# userdel -f darth +userdel: user darth is currently used by process 7663 +[root@workstation ~]# finger darth +finger: darth: no such user. +[root@workstation ~]# ps -fu darth +error: user name does not exist +``` + +As you can see, the **finger** and **ps** commands confirm the user Darth has been deleted. + +### Using force in shell scripts + +Many other commands have a force option. One place force is very useful is in shell scripts. Since we use scripts in cron jobs and other automated operations, avoiding any prompts is crucial, or else these automated processes will not complete. + +I hope the four examples I shared above help you understand how certain circumstances may require the use of force. You should have a strong understanding of the force option when used at the command line or in creating automation scripts. It's misuse can have devastating effects—sometimes across your infrastructure, and not only on a single machine. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/may-the-force-linux + +作者:[Alan Formy-Duval ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fireworks_light_art_design.jpg?itok=hfx9i4By (Fireworks) +[2]: https://www.starwars.com/star-wars-day +[3]: http://man7.org/linux/man-pages/man1/cp.1.html +[4]: http://man7.org/linux/man-pages/man1/ln.1.html +[5]: http://man7.org/linux/man-pages/man1/rm.1.html +[6]: http://man7.org/linux/man-pages/man8/userdel.8.html From b495d4306cdd077cc1d929a63eeb7602108cc202 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:45:07 +0800 Subject: [PATCH 0292/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20Chec?= =?UTF-8?q?k=20your=20spelling=20at=20the=20command=20line=20with=20Ispell?= =?UTF-8?q?=20sources/tech/20190503=20Check=20your=20spelling=20at=20the?= =?UTF-8?q?=20command=20line=20with=20Ispell.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pelling at the command line with Ispell.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/tech/20190503 Check your spelling at the command line with Ispell.md diff --git a/sources/tech/20190503 Check your spelling at the command line with Ispell.md b/sources/tech/20190503 Check your spelling at the command line with Ispell.md new file mode 100644 index 0000000000..5c26143241 --- /dev/null +++ b/sources/tech/20190503 Check your spelling at the command line with Ispell.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Check your spelling at the command line with Ispell) +[#]: via: (https://opensource.com/article/19/5/spelling-command-line-ispell) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Check your spelling at the command line with Ispell +====== +Ispell helps you stamp out typos in plain text files written in more +than 50 languages. +![Command line prompt][1] + +Good spelling is a skill. A skill that takes time to learn and to master. That said, there are people who never quite pick that skill up—I know a couple or three outstanding writers who can't spell to save their lives. + +Even if you spell well, the occasional typo creeps in. That's especially true if you're quickly banging on your keyboard to meet a deadline. Regardless of your spelling chops, it's always a good idea to run what you've written through a spelling checker. + +I do most of my writing in [plain text][2] and often use a command line spelling checker called [Aspell][3] to do the deed. Aspell isn't the only game in town. You might also want to check out the venerable [Ispell][4]. + +### Getting started + +Ispell's been around, in various forms, since 1971. Don't let its age fool you. Ispell is still a peppy application that you can use effectively in the 21st century. + +Before doing anything else, check whether or not Ispell is installed on your computer by cracking open a terminal window and typing **which ispell**. If it isn't installed, fire up your distribution's package manager and install Ispell from there. + +Don't forget to install dictionaries for the languages you work in, too. My only language is English, so I just need to worry about grabbing the US and British English dictionaries. You're not limited to my mother (and only) tongue. Ispell has [dictionaries for over 50 languages][5]. + +![Installing Ispell dictionaries][6] + +### Using Ispell + +If you haven't guessed already, Ispell only works with text files. That includes ones marked up with HTML, LaTeX, and [nroff or troff][7]. More on this in a few moments. + +To get to work, open a terminal window and navigate to the directory containing the file where you want to run a spelling check. Type **ispell** followed by the file's name and then press Enter. + +![Checking spelling with Ispell][8] + +Ispell highlights the first word it doesn't recognize. If the word is misspelled, Ispell usually offers one or more alternatives. Press **R** and then the number beside the correct choice. In the screen capture above, I'd press **R** and **0** to fix the error. + +If, on the other hand, the word is correctly spelled, press **A** to move to the next misspelled word. + +Keep doing that until you reach the end of the file. Ispell saves your changes, creates a backup of the file you just checked (with the extension _.bak_ ), and shuts down. + +### A few other options + +This example illustrates basic Ispell usage. The program has a [number of options][9], some of which you _might_ use and others you _might never_ use. Let's take a quick peek at some of the ones I regularly use. + +A few paragraphs ago, I mentioned that Ispell works with certain markup languages. You need to tell it a file's format. When starting Ispell, add **-t** for a TeX or LaTeX file, **-H** for an HTML file, or **-n** for a groff or troff file. For example, if you enter **ispell -t myReport.tex** , Ispell ignores all markup. + +If you don't want the backup file that Ispell creates after checking a file, add **-x** to the command line—for example, **ispell -x myFile.txt**. + +What happens if Ispell runs into a word that's spelled correctly but isn't in its dictionary, like a proper name? You can add that word to a personal word list by pressing **I**. This saves the word to a file called _.ispell_default_ in the root of your _/home_ directory. + +Those are the options I find most useful when working with Ispell, but check out [Ispell's man page][9] for descriptions of all its options. + +Is Ispell any better or faster than Aspell or any other command line spelling checker? I have to say it's no worse than any of them, nor is it any slower. Ispell's not for everyone. It might not be for you. But it is good to have options, isn't it? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/spelling-command-line-ispell + +作者:[Scott Nesbitt ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://plaintextproject.online +[3]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell +[4]: https://www.cs.hmc.edu/~geoff/ispell.html +[5]: https://www.cs.hmc.edu/~geoff/ispell-dictionaries.html +[6]: https://opensource.com/sites/default/files/uploads/ispell-install-dictionaries.png (Installing Ispell dictionaries) +[7]: https://opensource.com/article/18/2/how-format-academic-papers-linux-groff-me +[8]: https://opensource.com/sites/default/files/uploads/ispell-checking.png (Checking spelling with Ispell) +[9]: https://www.cs.hmc.edu/~geoff/ispell-man.html From 0915e93246bf4dc7d82e603f195f6cb573e044af Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:45:26 +0800 Subject: [PATCH 0293/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20API?= =?UTF-8?q?=20evolution=20the=20right=20way=20sources/tech/20190503=20API?= =?UTF-8?q?=20evolution=20the=20right=20way.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190503 API evolution the right way.md | 735 ++++++++++++++++++ 1 file changed, 735 insertions(+) create mode 100644 sources/tech/20190503 API evolution the right way.md diff --git a/sources/tech/20190503 API evolution the right way.md b/sources/tech/20190503 API evolution the right way.md new file mode 100644 index 0000000000..ada8bdce20 --- /dev/null +++ b/sources/tech/20190503 API evolution the right way.md @@ -0,0 +1,735 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (API evolution the right way) +[#]: via: (https://opensource.com/article/19/5/api-evolution-right-way) +[#]: author: (A. Jesse https://opensource.com/users/emptysquare) + +API evolution the right way +====== +Ten covenants that responsible library authors keep with their users. +![Browser of things][1] + +Imagine you are a creator deity, designing a body for a creature. In your benevolence, you wish for the creature to evolve over time: first, because it must respond to changes in its environment, and second, because your wisdom grows and you think of better designs for the beast. It shouldn't remain in the same body forever! + +![Serpents][2] + +The creature, however, might be relying on features of its present anatomy. You can't add wings or change its scales without warning. It needs an orderly process to adapt its lifestyle to its new body. How can you, as a responsible designer in charge of this creature's natural history, gently coax it toward ever greater improvements? + +It's the same for responsible library maintainers. We keep our promises to the people who depend on our code: we release bugfixes and useful new features. We sometimes delete features if that's beneficial for the library's future. We continue to innovate, but we don't break the code of people who use our library. How can we fulfill all those goals at once? + +### Add useful features + +Your library shouldn't stay the same for eternity: you should add features that make your library better for your users. For example, if you have a Reptile class and it would be useful to have wings for flying, go for it. + + +``` +class Reptile: +@property +def teeth(self): +return 'sharp fangs' + +# If wings are useful, add them! +@property +def wings(self): +return 'majestic wings' +``` + +But beware, features come with risk. Consider the following feature in the Python standard library, and see what went wrong with it. + + +``` +bool(datetime.time(9, 30)) == True +bool(datetime.time(0, 0)) == False +``` + +This is peculiar: converting any time object to a boolean yields True, except for midnight. (Worse, the rules for timezone-aware times are even stranger.) + +I've been writing Python for more than a decade but I didn't discover this rule until last week. What kind of bugs can this odd behavior cause in users' code? + +Consider a calendar application with a function that creates events. If an event has an end time, the function requires it to also have a start time. + + +``` +def create_event(day, +start_time=None, +end_time=None): +if end_time and not start_time: +raise ValueError("Can't pass end_time without start_time") + +# The coven meets from midnight until 4am. +create_event(datetime.date.today(), +datetime.time(0, 0), +datetime.time(4, 0)) +``` + +Unfortunately for witches, an event starting at midnight fails this validation. A careful programmer who knows about the quirk at midnight can write this function correctly, of course. + + +``` +def create_event(day, +start_time=None, +end_time=None): +if end_time is not None and start_time is None: +raise ValueError("Can't pass end_time without start_time") +``` + +But this subtlety is worrisome. If a library creator wanted to make an API that bites users, a "feature" like the boolean conversion of midnight works nicely. + +![Man being chased by an alligator][3] + +The responsible creator's goal, however, is to make your library easy to use correctly. + +This feature was written by Tim Peters when he first made the datetime module in 2002. Even founding Pythonistas like Tim make mistakes. [The quirk was removed][4], and all times are True now. + + +``` +# Python 3.5 and later. + +bool(datetime.time(9, 30)) == True +bool(datetime.time(0, 0)) == True +``` + +Programmers who didn't know about the oddity of midnight are saved from obscure bugs, but it makes me nervous to think about any code that relies on the weird old behavior and didn't notice the change. It would have been better if this bad feature were never implemented at all. This leads us to the first promise of any library maintainer: + +#### First covenant: Avoid bad features + +The most painful change to make is when you have to delete a feature. One way to avoid bad features is to add few features in general! Make no public method, class, function, or property without a good reason. Thus: + +#### Second covenant: Minimize features + +Features are like children: conceived in a moment of passion, they must be supported for years. Don't do anything silly just because you can. Don't add feathers to a snake! + +![Serpents with and without feathers][5] + +But of course, there are plenty of occasions when users need something from your library that it does not yet offer. How do you choose the right feature to give them? Here's another cautionary tale. + +### A cautionary tale from asyncio + +As you may know, when you call a coroutine function, it returns a coroutine object: + + +``` +async def my_coroutine(): +pass + +print(my_coroutine()) + +[/code] [code]`` +``` + +Your code must "await" this object to run the coroutine. It's easy to forget this, so asyncio's developers wanted a "debug mode" that catches this mistake. Whenever a coroutine is destroyed without being awaited, the debug mode prints a warning with a traceback to the line where it was created. + +When Yury Selivanov implemented the debug mode, he added as its foundation a "coroutine wrapper" feature. The wrapper is a function that takes in a coroutine and returns anything at all. Yury used it to install the warning logic on each coroutine, but someone else could use it to turn coroutines into the string "hi!" + + +``` +import sys + +def my_wrapper(coro): +return 'hi!' + +sys.set_coroutine_wrapper(my_wrapper) + +async def my_coroutine(): +pass + +print(my_coroutine()) + +[/code] [code]`hi!` +``` + +That is one hell of a customization. It changes the very meaning of "async." Calling set_coroutine_wrapper once will globally and permanently change all coroutine functions. It is, [as Nathaniel Smith wrote][6], "a problematic API" that is prone to misuse and had to be removed. The asyncio developers could have avoided the pain of deleting the feature if they'd better shaped it to its purpose. Responsible creators must keep this in mind: + +#### Third covenant: Keep features narrow + +Luckily, Yury had the good judgment to mark this feature provisional, so asyncio users knew not to rely on it. Nathaniel was free to replace **set_coroutine_wrapper** with a narrower feature that only customized the traceback depth. + + +``` +import sys + +sys.set_coroutine_origin_tracking_depth(2) + +async def my_coroutine(): +pass + +print(my_coroutine()) + +[/code] [code] + + + +RuntimeWarning:'my_coroutine' was never awaited + +Coroutine created at (most recent call last) +File "script.py", line 8, in +print(my_coroutine()) +``` + +This is much better. There's no more global setting that can change coroutines' type, so asyncio users need not code as defensively. Deities should all be as farsighted as Yury. + +#### Fourth covenant: Mark experimental features "provisional" + +If you have merely a hunch that your creature wants horns and a quadruple-forked tongue, introduce the features but mark them "provisional." + +![Serpent with horns][7] + +You might discover that the horns are extraneous but the quadruple-forked tongue is useful after all. In the next release of your library, you can delete the former and mark the latter official. + +### Deleting features + +No matter how wisely we guide our creature's evolution, there may come a time when it's best to delete an official feature. For example, you might have created a lizard, and now you choose to delete its legs. Perhaps you want to transform this awkward creature into a sleek and modern python. + +![Lizard transformed to snake][8] + +There are two main reasons to delete features. First, you might discover a feature was a bad idea, through user feedback or your own growing wisdom. That was the case with the quirky behavior of midnight. Or, the feature might have been well-adapted to your library's environment at first, but the ecology changes. Perhaps another deity invents mammals. Your creature wants to squeeze into the mammals' little burrows and eat the tasty mammal filling, so it has to lose its legs. + +![A mouse][9] + +Similarly, the Python standard library deletes features in response to changes in the language itself. Consider asyncio's Lock. It has been awaitable ever since "await" was added as a keyword: + + +``` +lock = asyncio.Lock() + +async def critical_section(): +await lock +try: +print('holding lock') +finally: +lock.release() +``` + +But now, we can do "async with lock." + + +``` +lock = asyncio.Lock() + +async def critical_section(): +async with lock: +print('holding lock') +``` + +The new style is much better! It's short and less prone to mistakes in a big function with other try-except blocks. Since "there should be one and preferably only one obvious way to do it," [the old syntax is deprecated in Python 3.7][10] and it will be banned soon. + +It's inevitable that ecological change will have this effect on your code, too, so learn to delete features gently. Before you do so, consider the cost or benefit of deleting it. Responsible maintainers are reluctant to make their users change a large amount of their code or change their logic. (Remember how painful it was when Python 3 removed the "u" string prefix, before it was added back.) If the code changes are mechanical, however, like a simple search-and-replace, or if the feature is dangerous, it may be worth deleting. + +#### Whether to delete a feature + +![Balance scales][11] + +Con | Pro +---|--- +Code must change | Change is mechanical +Logic must change | Feature is dangerous + +In the case of our hungry lizard, we decide to delete its legs so it can slither into a mouse's hole and eat it. How do we go about this? We could just delete the **walk** method, changing code from this: + + +``` +class Reptile: +def walk(self): +print('step step step') +``` + +to this: + + +``` +class Reptile: +def slither(self): +print('slide slide slide') +``` + +That's not a good idea; the creature is accustomed to walking! Or, in terms of a library, your users have code that relies on the existing method. When they upgrade to the latest version of your library, their code will break. + + +``` +# User's code. Oops! +Reptile.walk() +``` + +Therefore, responsible creators make this promise: + +#### Fifth covenant: Delete features gently + +There are a few steps involved in deleting a feature gently. Starting with a lizard that walks with its legs, you first add the new method, "slither." Next, deprecate the old method. + + +``` +import warnings + +class Reptile: +def walk(self): +warnings.warn( +"walk is deprecated, use slither", +DeprecationWarning, stacklevel=2) +print('step step step') + +def slither(self): +print('slide slide slide') +``` + +The Python warnings module is quite powerful. By default it prints warnings to stderr, only once per code location, but you can silence warnings or turn them into exceptions, among other options. + +As soon as you add this warning to your library, PyCharm and other IDEs render the deprecated method with a strikethrough. Users know right away that the method is due for deletion. + +`Reptile().walk()` + +What happens when they run their code with the upgraded library? + + +``` +$ python3 script.py + +DeprecationWarning: walk is deprecated, use slither +script.py:14: Reptile().walk() + +step step step +``` + +By default, they see a warning on stderr, but the script succeeds and prints "step step step." The warning's traceback shows what line of the user's code must be fixed. (That's what the "stacklevel" argument does: it shows the call site that users need to change, not the line in your library where the warning is generated.) Notice that the error message is instructive, it describes what a library user must do to migrate to the new version. + +Your users will want to test their code and prove they call no deprecated library methods. Warnings alone won't make unit tests fail, but exceptions will. Python has a command-line option to turn deprecation warnings into exceptions. + + +``` +> python3 -Werror::DeprecationWarning script.py + +Traceback (most recent call last): +File "script.py", line 14, in +Reptile().walk() +File "script.py", line 8, in walk +DeprecationWarning, stacklevel=2) +DeprecationWarning: walk is deprecated, use slither +``` + +Now, "step step step" is not printed, because the script terminates with an error. + +So, once you've released a version of your library that warns about the deprecated "walk" method, you can delete it safely in the next release. Right? + +Consider what your library's users might have in their projects' requirements. + + +``` +# User's requirements.txt has a dependency on the reptile package. +reptile +``` + +The next time they deploy their code, they'll install the latest version of your library. If they haven't yet handled all deprecations, then their code will break, because it still depends on "walk." You need to be gentler than this. There are three more promises you must keep to your users: maintain a changelog, choose a version scheme, and write an upgrade guide. + +#### Sixth covenant: Maintain a changelog + +Your library must have a changelog; its main purpose is to announce when a feature that your users rely on is deprecated or deleted. + +#### Changes in Version 1.1 + +**New features** + + * New function Reptile.slither() + + + +**Deprecations** + + * Reptile.walk() is deprecated and will be removed in version 2.0, use slither() + + +--- + +Responsible creators use version numbers to express how a library has changed so users can make informed decisions about upgrading. A "version scheme" is a language for communicating the pace of change. + +#### Seventh covenant: Choose a version scheme + +There are two schemes in widespread use, [semantic versioning][12] and time-based versioning. I recommend semantic versioning for nearly any library. The Python flavor thereof is defined in [PEP 440][13], and tools like **pip** understand semantic version numbers. + +If you choose semantic versioning for your library, you can delete its legs gently with version numbers like: + +> 1.0: First "stable" release, with walk() +> 1.1: Add slither(), deprecate walk() +> 2.0: Delete walk() + +Your users should depend on a range of your library's versions, like so: + + +``` +# User's requirements.txt. +reptile>=1,<2 +``` + +This allows them to upgrade automatically within a major release, receiving bugfixes and potentially raising some deprecation warnings, but not upgrading to the _next_ major release and risking a change that breaks their code. + +If you follow time-based versioning, your releases might be numbered thus: + +> 2017.06.0: A release in June 2017 +> 2018.11.0: Add slither(), deprecate walk() +> 2019.04.0: Delete walk() + +And users can depend on your library like: + + +``` +# User's requirements.txt for time-based version. +reptile==2018.11.* +``` + +This is terrific, but how do your users know your versioning scheme and how to test their code for deprecations? You have to advise them how to upgrade. + +#### Eighth covenant: Write an upgrade guide + +Here's how a responsible library creator might guide users: + +#### Upgrading to 2.0 + +**Migrate from Deprecated APIs** + +See the changelog for deprecated features. + +**Enable Deprecation Warnings** + +Upgrade to 1.1 and test your code with: + +`python -Werror::DeprecationWarning` + +​​​​​​Now it's safe to upgrade. + +--- + +You must teach users how to handle deprecation warnings by showing them the command line options. Not all Python programmers know this—I certainly have to look up the syntax each time. And take note, you must _release_ a version that prints warnings from each deprecated API so users can test with that version before upgrading again. In this example, version 1.1 is the bridge release. It allows your users to rewrite their code incrementally, fixing each deprecation warning separately until they have entirely migrated to the latest API. They can test changes to their code and changes in your library, independently from each other, and isolate the cause of bugs. + +If you chose semantic versioning, this transitional period lasts until the next major release, from 1.x to 2.0, or from 2.x to 3.0, and so on. The gentle way to delete a creature's legs is to give it at least one version in which to adjust its lifestyle. Don't remove the legs all at once! + +![A skink][14] + +Version numbers, deprecation warnings, the changelog, and the upgrade guide work together to gently evolve your library without breaking the covenant with your users. The [Twisted project's Compatibility Policy][15] explains this beautifully: + +> "The First One's Always Free" +> +> Any application which runs without warnings may be upgraded one minor version of Twisted. +> +> In other words, any application which runs its tests without triggering any warnings from Twisted should be able to have its Twisted version upgraded at least once with no ill effects except the possible production of new warnings. + +Now, we creator deities have gained the wisdom and power to add features by adding methods and to delete them gently. We can also add features by adding parameters, but this brings a new level of difficulty. Are you ready? + +### Adding parameters + +Imagine that you just gave your snake-like creature a pair of wings. Now you must allow it the choice whether to move by slithering or flying. Currently its "move" function takes one parameter. + + +``` +# Your library code. +def move(direction): +print(f'slither {direction}') + +# A user's application. +move('north') +``` + +You want to add a "mode" parameter, but this breaks your users' code if they upgrade, because they pass only one argument. + + +``` +# Your library code. +def move(direction, mode): +assert mode in ('slither', 'fly') +print(f'{mode} {direction}') + +# A user's application. Error! +move('north') +``` + +A truly wise creator promises not to break users' code this way. + +#### Ninth covenant: Add parameters compatibly + +To keep this covenant, add each new parameter with a default value that preserves the original behavior. + + +``` +# Your library code. +def move(direction, mode='slither'): +assert mode in ('slither', 'fly') +print(f'{mode} {direction}') + +# A user's application. +move('north') +``` + +Over time, parameters are the natural history of your function's evolution. They're listed oldest first, each with a default value. Library users can pass keyword arguments to opt into specific new behaviors and accept the defaults for all others. + + +``` +# Your library code. +def move(direction, +mode='slither', +turbo=False, +extra_sinuous=False, +hail_lyft=False): +# ... + +# A user's application. +move('north', extra_sinuous=True) +``` + +There is a danger, however, that a user might write code like this: + + +``` +# A user's application, poorly-written. +move('north', 'slither', False, True) +``` + +What happens if, in the next major version of your library, you get rid of one of the parameters, like "turbo"? + + +``` +# Your library code, next major version. "turbo" is deleted. +def move(direction, +mode='slither', +extra_sinuous=False, +hail_lyft=False): +# ... + +# A user's application, poorly-written. +move('north', 'slither', False, True) +``` + +The user's code still compiles, and this is a bad thing. The code stopped moving extra-sinuously and started hailing a Lyft, which was not the intention. I trust that you can predict what I'll say next: Deleting a parameter requires several steps. First, of course, deprecate the "turbo" parameter. I like a technique like this one, which detects whether any user's code relies on this parameter. + + +``` +# Your library code. +_turbo_default = object() + +def move(direction, +mode='slither', +turbo=_turbo_default, +extra_sinuous=False, +hail_lyft=False): +if turbo is not _turbo_default: +warnings.warn( +"'turbo' is deprecated", +DeprecationWarning, +stacklevel=2) +else: +# The old default. +turbo = False +``` + +But your users might not notice the warning. Warnings are not very loud: they can be suppressed or lost in log files. Users might heedlessly upgrade to the next major version of your library, the version that deletes "turbo." Their code will run without error and silently do the wrong thing! As the Zen of Python says, "Errors should never pass silently." Indeed, reptiles hear poorly, so you must correct them very loudly when they make mistakes. + +![Woman riding an alligator][16] + +The best way to protect your users is with Python 3's star syntax, which requires callers to pass keyword arguments. + + +``` +# Your library code. +# All arguments after "*" must be passed by keyword. +def move(direction, +*, +mode='slither', +turbo=False, +extra_sinuous=False, +hail_lyft=False): +# ... + +# A user's application, poorly-written. +# Error! Can't use positional args, keyword args required. +move('north', 'slither', False, True) +``` + +With the star in place, this is the only syntax allowed: + + +``` +# A user's application. +move('north', extra_sinuous=True) +``` + +Now when you delete "turbo," you can be certain any user code that relies on it will fail loudly. If your library also supports Python 2, there's no shame in that; you can simulate the star syntax thus ([credit to Brett Slatkin][17]): + + +``` +# Your library code, Python 2 compatible. +def move(direction, **kwargs): +mode = kwargs.pop('mode', 'slither') +turbo = kwargs.pop('turbo', False) +sinuous = kwargs.pop('extra_sinuous', False) +lyft = kwargs.pop('hail_lyft', False) + +if kwargs: +raise TypeError('Unexpected kwargs: %r' +% kwargs) + +# ... +``` + +Requiring keyword arguments is a wise choice, but it requires foresight. If you allow an argument to be passed positionally, you cannot convert it to keyword-only in a later release. So, add the star now. You can observe in the asyncio API that it uses the star pervasively in constructors, methods, and functions. Even though "Lock" only takes one optional parameter so far, the asyncio developers added the star right away. This is providential. + + +``` +# In asyncio. +class Lock: +def __init__(self, *, loop=None): +# ... +``` + +Now we've gained the wisdom to change methods and parameters while keeping our covenant with users. The time has come to try the most challenging kind of evolution: changing behavior without changing either methods or parameters. + +### Changing behavior + +Let's say your creature is a rattlesnake, and you want to teach it a new behavior. + +![Rattlesnake][18] + +Sidewinding! The creature's body will appear the same, but its behavior will change. How can we prepare it for this step of its evolution? + +![][19] + +Image by HCA [[CC BY-SA 4.0][20]], [via Wikimedia Commons][21], modified by Opensource.com + +A responsible creator can learn from the following example in the Python standard library, when behavior changed without a new function or parameters. Once upon a time, the os.stat function was introduced to get file statistics, like the creation time. At first, times were always integers. + + +``` +>>> os.stat('file.txt').st_ctime +1540817862 +``` + +One day, the core developers decided to use floats for os.stat times to give sub-second precision. But they worried that existing user code wasn't ready for the change. They created a setting in Python 2.3, "stat_float_times," that was false by default. A user could set it to True to opt into floating-point timestamps. + + +``` +>>> # Python 2.3. +>>> os.stat_float_times(True) +>>> os.stat('file.txt').st_ctime +1540817862.598021 +``` + +Starting in Python 2.5, float times became the default, so any new code written for 2.5 and later could ignore the setting and expect floats. Of course, you could set it to False to keep the old behavior or set it to True to ensure the new behavior in all Python versions, and prepare your code for the day when stat_float_times is deleted. + +Ages passed. In Python 3.1, the setting was deprecated to prepare people for the distant future and finally, after its decades-long journey, [the setting was removed][22]. Float times are now the only option. It's a long road, but responsible deities are patient because we know this gradual process has a good chance of saving users from unexpected behavior changes. + +#### Tenth covenant: Change behavior gradually + +Here are the steps: + + * Add a flag to opt into the new behavior, default False, warn if it's False + * Change default to True, deprecate flag entirely + * Remove the flag + + + +If you follow semantic versioning, the versions might be like so: + +Library version | Library API | User code +---|---|--- +| | +1.0 | No flag | Expect old behavior +1.1 | Add flag, default False, +warn if it's False | Set flag True, +handle new behavior +2.0 | Change default to True, +deprecate flag entirely | Handle new behavior +3.0 | Remove flag | Handle new behavior + +You need _two_ major releases to complete the maneuver. If you had gone straight from "Add flag, default False, warn if it's False" to "Remove flag" without the intervening release, your users' code would be unable to upgrade. User code written correctly for 1.1, which sets the flag to True and handles the new behavior, must be able to upgrade to the next release with no ill effect except new warnings, but if the flag were deleted in the next release, that code would break. A responsible deity never violates the Twisted policy: "The First One's Always Free." + +### The responsible creator + +![Demeter][23] + +Our 10 covenants belong loosely in three categories: + +**Evolve cautiously** + + 1. Avoid bad features + 2. Minimize features + 3. Keep features narrow + 4. Mark experimental features "provisional" + 5. Delete features gently + + + +**Record history rigorously** + + 1. Maintain a changelog + 2. Choose a version scheme + 3. Write an upgrade guide + + + +**Change slowly and loudly** + + 1. Add parameters compatibly + 2. Change behavior gradually + + + +If you keep these covenants with your creature, you'll be a responsible creator deity. Your creature's body can evolve over time, forever improving and adapting to changes in its environment but without sudden changes the creature isn't prepared for. If you maintain a library, keep these promises to your users and you can innovate your library without breaking the code of the people who rely on you. + +* * * + +_This article originally appeared on[A. Jesse Jiryu Davis's blog][24] and is republished with permission._ + +Illustration credits: + + * [The World's Progress, The Delphian Society, 1913][25] + * [Essay Towards a Natural History of Serpents, Charles Owen, 1742][26] + * [On the batrachia and reptilia of Costa Rica: With notes on the herpetology and ichthyology of Nicaragua and Peru, Edward Drinker Cope, 1875][27] + * [Natural History, Richard Lydekker et. al., 1897][28] + * [Mes Prisons, Silvio Pellico, 1843][29] + * [Tierfotoagentur / m.blue-shadow][30] + * [Los Angeles Public Library, 1930][31] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/api-evolution-right-way + +作者:[A. Jesse][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/emptysquare +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://opensource.com/sites/default/files/uploads/praise-the-creator.jpg (Serpents) +[3]: https://opensource.com/sites/default/files/uploads/bite.jpg (Man being chased by an alligator) +[4]: https://bugs.python.org/issue13936 +[5]: https://opensource.com/sites/default/files/uploads/feathers.jpg (Serpents with and without feathers) +[6]: https://bugs.python.org/issue32591 +[7]: https://opensource.com/sites/default/files/uploads/horns.jpg (Serpent with horns) +[8]: https://opensource.com/sites/default/files/uploads/lizard-to-snake.jpg (Lizard transformed to snake) +[9]: https://opensource.com/sites/default/files/uploads/mammal.jpg (A mouse) +[10]: https://bugs.python.org/issue32253 +[11]: https://opensource.com/sites/default/files/uploads/scale.jpg (Balance scales) +[12]: https://semver.org +[13]: https://www.python.org/dev/peps/pep-0440/ +[14]: https://opensource.com/sites/default/files/uploads/skink.jpg (A skink) +[15]: https://twistedmatrix.com/documents/current/core/development/policy/compatibility-policy.html +[16]: https://opensource.com/sites/default/files/uploads/loudly.jpg (Woman riding an alligator) +[17]: http://www.informit.com/articles/article.aspx?p=2314818 +[18]: https://opensource.com/sites/default/files/uploads/rattlesnake.jpg (Rattlesnake) +[19]: https://opensource.com/sites/default/files/articles/neonate_sidewinder_sidewinding_with_tracks_unlabeled.png +[20]: https://creativecommons.org/licenses/by-sa/4.0 +[21]: https://commons.wikimedia.org/wiki/File:Neonate_sidewinder_sidewinding_with_tracks_unlabeled.jpg +[22]: https://bugs.python.org/issue31827 +[23]: https://opensource.com/sites/default/files/uploads/demeter.jpg (Demeter) +[24]: https://emptysqua.re/blog/api-evolution-the-right-way/ +[25]: https://www.gutenberg.org/files/42224/42224-h/42224-h.htm +[26]: https://publicdomainreview.org/product-att/artist/charles-owen/ +[27]: https://archive.org/details/onbatrachiarepti00cope/page/n3 +[28]: https://www.flickr.com/photos/internetarchivebookimages/20556001490 +[29]: https://www.oldbookillustrations.com/illustrations/stationery/ +[30]: https://www.alamy.com/mediacomp/ImageDetails.aspx?ref=D7Y61W +[31]: https://www.vintag.es/2013/06/riding-alligator-c-1930s.html From a7889db3309739f70a6cd9c3dfc00f77f43dcd64 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:45:37 +0800 Subject: [PATCH 0294/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190503=20Say?= =?UTF-8?q?=20goodbye=20to=20boilerplate=20in=20Python=20with=20attrs=20so?= =?UTF-8?q?urces/tech/20190503=20Say=20goodbye=20to=20boilerplate=20in=20P?= =?UTF-8?q?ython=20with=20attrs.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...bye to boilerplate in Python with attrs.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md diff --git a/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md new file mode 100644 index 0000000000..42d9f86ca3 --- /dev/null +++ b/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Say goodbye to boilerplate in Python with attrs) +[#]: via: (https://opensource.com/article/19/5/python-attrs) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) + +Say goodbye to boilerplate in Python with attrs +====== +Learn more about solving common Python problems in our series covering +seven PyPI libraries. +![Programming at a browser, orange hands][1] + +Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. + +In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. Today, we'll examine [**attrs**][4], a Python package that helps you write concise, correct code quickly. + +### attrs + +If you have been using Python for any length of time, you are probably used to writing code like: + + +``` +class Book(object): + +def __init__(self, isbn, name, author): +self.isbn = isbn +self.name = name +self.author = author +``` + +Then you write a **__repr__** function; otherwise, it would be hard to log instances of **Book** : + + +``` +def __repr__(self): +return f"Book({self.isbn}, {self.name}, {self.author})" +``` + +Next, you write a nice docstring documenting the expected types. But you notice you forgot to add the **edition** and **published_year** attributes, so you have to modify them in five places. + +What if you didn't have to? + + +``` +@attr.s(auto_attribs=True) +class Book(object): +isbn: str +name: str +author: str +published_year: int +edition: int +``` + +Annotating the attributes with types using the new type annotation syntax, **attrs** detects the annotations and creates a class. + +ISBNs have a specific format. What if we want to enforce that format? + + +``` +@attr.s(auto_attribs=True) +class Book(object): +isbn: str = attr.ib() +@isbn.validator +def pattern_match(self, attribute, value): +m = re.match(r"^(\d{3}-)\d{1,3}-\d{2,3}-\d{1,7}-\d$", value) +if not m: +raise ValueError("incorrect format for isbn", value) +name: str +author: str +published_year: int +edition: int +``` + +The **attrs** library also has great support for [immutability-style programming][5]. Changing the first line to **@attr.s(auto_attribs=True, frozen=True)** means that **Book** is now immutable: trying to modify an attribute will raise an exception. Instead, we can get a _new_ instance with modification using **attr.evolve(old_book, published_year=old_book.published_year+1)** , for example, if we need to push publication forward by a year. + +In the next article in this series, we'll look at **singledispatch** , a library that allows you to add methods to Python libraries retroactively. + +#### Review the previous articles in this series + + * [Cython][6] + * [Black][7] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-attrs + +作者:[Moshe Zadka ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands) +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/attrs/ +[5]: https://opensource.com/article/18/10/functional-programming-python-immutable-data-structures +[6]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[7]: https://opensource.com/article/19/4/python-problems-solved-black From 7c95756ae55ea75460ed07a9ce8ffbf3dbc580ac Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:45:50 +0800 Subject: [PATCH 0295/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190502=20Crow?= =?UTF-8?q?dsourcing=20license=20compliance=20with=20ClearlyDefined=20sour?= =?UTF-8?q?ces/tech/20190502=20Crowdsourcing=20license=20compliance=20with?= =?UTF-8?q?=20ClearlyDefined.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... license compliance with ClearlyDefined.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md diff --git a/sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md b/sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md new file mode 100644 index 0000000000..fe36e37b9c --- /dev/null +++ b/sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Crowdsourcing license compliance with ClearlyDefined) +[#]: via: (https://opensource.com/article/19/5/license-compliance-clearlydefined) +[#]: author: (Jeff McAffer https://opensource.com/users/jeffmcaffer) + +Crowdsourcing license compliance with ClearlyDefined +====== +Licensing is what holds open source together, and ClearlyDefined takes +the mystery out of projects' licenses, copyright, and source location. +![][1] + +Open source use continues to skyrocket, not just in use cases and scenarios but also in volume. It is trivial for a developer to depend on a 1,000 JavaScript packages from a single run of `npm install` or have thousands of packages in a [Docker][2] image. At the same time, there is increased interest in ensuring license compliance. + +Without the right license you may not be able to legally use a software component in the way you intend or may have obligations that run counter to your business model. For instance, a JavaScript package could be marked as [MIT license][3], which allows commercial reuse, while one of its dependencies is licensed has a [copyleft license][4] that requires you give your software away under the same license. Complying means finding the applicable license(s), and assessing and adhering to the terms, which is not too bad for individual components adn can be daunting for large initiatives. + +Fortunately, this open source challenge has an open source solution: [ClearlyDefined][5]. ClearlyDefined is a crowdsourced, open source, [Open Source Initiative][6] (OSI) effort to gather, curate, and upstream/normalize data about open source components, such as license, copyright, and source location. This data is the cornerstone of reducing the friction in open source license compliance. + +The premise behind ClearlyDefined is simple: we are all struggling to find and understand key information related to the open source we use—whether it is finding the license, knowing who to attribute, or identifying the source that goes with a particular package. Rather than struggling independently, ClearlyDefined allows us to collaborate and share the compliance effort. Moreover, the ClearlyDefined community seeks to upstream any corrections so future releases are more clearly defined and make conventions more explicit to improve community understanding of project intent. + +### How it works + +![ClearlyDefined's harvest, curate, upstream process][7] + +ClearlyDefined monitors the open source ecosystem and automatically harvests relevant data from open source components using a host of open source tools such as [ScanCode][8], [FOSSology][9], and [Licensee][10]. The results are summarized and aggregated to create a _definition_ , which is then surfaced to users via an API and a UI. Each definition includes: + + * Declared license of the component + * Licenses and copyrights discovered across all files + * Exact source code location to the commit level + * Release date + * List of embedded components + + + +Coincidentally (well, not really), this is exactly the data you need to do license compliance. + +### Curating + +Any given definition may have gaps or imperfections due to tool issues or the data being missing or incorrect at the origin. ClearlyDefined enables users to curate the results by refining the values and filling in the gaps. These contributions are reviewed and merged, as with any open source project. The result is an improved dataset for all to use. + +### Getting ahead + +To a certain degree, this process is still chasing the problem—analyzing and curating after the packages have already been published. To get ahead of the game, the ClearlyDefined community also feeds merged curations back to the originating projects as pull requests (e.g., adding a license file, clarifying a copyright). This increases the clarity of future release and sets up a virtuous cycle. + +### Adapting, not mandating + +In doing the analysis, we've found quite a number of approaches to expressing license-related data. Different communities put LICENSE files in different places or have different practices around attribution. The ClearlyDefined philosophy is to discover these conventions and adapt to them rather than asking the communities to do something different. A side benefit of this is that implicit conventions can be made more explicit, improving clarity for all. + +Related to this, ClearlyDefined is careful to not look too hard for this interesting data. If we have to be too smart and infer too much to find the data, then there's a good chance the origin is not all that clear. Instead, we prefer to work with the community to better understand and clarify the conventions being used. From there, we can update the tools accordingly and make it easier to be "clearly defined." + +#### NOTICE files + +As an added bonus for users, we set up an API and UI for generating NOTICE files, making it trivial for you to comply with the attribution requirements found in most open source licenses. You can give ClearlyDefined a list of components (e.g., _drag and drop an npm package-lock.json file on the UI_ ) and get back a fully formed NOTICE file rendered by one of several renderers (e.g., text, HTML, Handlebars.js template). This is a snap, given that we already have all the compliance data. Big shout out to the [OSS Attribution Builder project][11] for making a simple and pluggable NOTICE renderer we could just pop into the ClearlyDefined service. + +### Getting involved + +You can get involved with ClearlyDefined in several ways: + + * Become an active user, contributing to your compliance workflow + * Review other people's curations using the interface + * Get involved in [the code][12] (Node and React) + * Ask and answer questions on [our mailing list][13] or [Discord channel][14] + * Contribute money to the OSI targeted to ClearlyDefined. We'll use that to fund development and curation. + + + +We are excited to continue to grow our community of contributors so that licensing can continue to become an understable part of any team's open source adoption. For more information, check out [https://clearlydefined.io][15]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/license-compliance-clearlydefined + +作者:[Jeff McAffer][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/jeffmcaffer +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Crowdfunding_520x292_9597717_0612CM.png?itok=lxSKyFXU +[2]: https://opensource.com/resources/what-docker +[3]: /article/19/4/history-mit-license +[4]: /resources/what-is-copyleft +[5]: https://clearlydefined.io +[6]: https://opensource.org +[7]: https://opensource.com/sites/default/files/uploads/clearlydefined.png (ClearlyDefined's harvest, curate, upstream process) +[8]: https://github.com/nexB/scancode-toolkit +[9]: https://www.fossology.org/ +[10]: https://github.com/licensee/licensee +[11]: https://github.com/amzn/oss-attribution-builder +[12]: https://github.com/clearlydefined +[13]: mailto:clearlydefined@googlegroups.com +[14]: %C2%A0https://clearlydefined.io/discord) +[15]: https://clearlydefined.io/ From 5763e43dab4a6a34dca6cf9cbbc86c74393938b3 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:46:01 +0800 Subject: [PATCH 0296/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190502=20The?= =?UTF-8?q?=20making=20of=20the=20Breaking=20the=20Code=20electronic=20boo?= =?UTF-8?q?k=20sources/tech/20190502=20The=20making=20of=20the=20Breaking?= =?UTF-8?q?=20the=20Code=20electronic=20book.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...f the Breaking the Code electronic book.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20190502 The making of the Breaking the Code electronic book.md diff --git a/sources/tech/20190502 The making of the Breaking the Code electronic book.md b/sources/tech/20190502 The making of the Breaking the Code electronic book.md new file mode 100644 index 0000000000..6786df8549 --- /dev/null +++ b/sources/tech/20190502 The making of the Breaking the Code electronic book.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The making of the Breaking the Code electronic book) +[#]: via: (https://opensource.com/article/19/5/code-book) +[#]: author: (Alicia Gibb https://opensource.com/users/aliciagibb/users/don-watkins) + +The making of the Breaking the Code electronic book +====== +Offering a safe space for middle school girls to learn technology speaks +volumes about who should be sitting around the tech table. +![Open hardware electronic book][1] + +I like a good challenge. The [Open Source Stories team][2] came to me with a great one: Create a hardware project where students could create their own thing that would be put together as a larger thing. The students would be middle school girls. My job was to figure out the hardware and make this thing make sense. + +After days of sketching out concepts, I was wandering through my local public library, and it dawned on me that the perfect piece of hardware where everyone could design their own part to create something whole is a book! The idea of a book using paper electronics was exciting, simple enough to be taught in a day, and fit the criteria of needing no special equipment, like soldering irons. + +!["Breaking the Code" book cover][3] + +I designed two parts to the electronics within the book. Half the circuits were developed with copper tape, LEDs, and DIY buttons, and half were developed with LilyPad Arduino microcontrollers, sensors, LEDs, and DIY buttons. Using the electronics in the book, the girls could make pages light up, buzz, or play music using various inputs such as button presses, page turns, or tilting the book. + +!['Breaking the Code' interior pages][4] + +We worked with young adult author [Lauren Sabel][5] to come up with the story, which features two girls who get locked in the basement of their school and have to solve puzzles to get out. Setting the scene in the basement gave us lots of opportunities to use lights! Along with the story, we received illustrations that the girls enhanced with electronics. The girls got creative, for example, using lights as the skeleton's eyes, not just for the obvious light bulb in the room. + +Creating a curriculum that was flexible enough to empower each girl to build her own successfully functioning circuit was a vital piece of the user experience. We chose components so the circuit wouldn't need to be over-engineered. We also used breakout boards and LEDs with built-in resistors so that the circuits allowed flexibility and functioned with only basic knowledge of circuit design—without getting too muddled in the deep end. + +!['Breaking the Code' interior pages][6] + +The project curriculum gave girls the confidence and skills to understand electronics by building two circuits, in the process learning circuit layout, directional aspects, cause-and-effect through inputs and outputs, and how to identify various components. Controlling electrons by pushing them through a circuit feels a bit like you're controlling a tiny part of the universe. And seeing the girls' faces light up is like seeing a universe of opportunities open in front of them. + +!['Breaking the Code' interior pages][7] + +The girls were ecstatic to see their work as a completed book, taking pride in their pages and showing others what they had built. + +![About 'Breaking the Code'][8] + +Teaching them my little corner of the world for the day was a truly empowering experience for me. As a woman in tech, I think this is the right approach for companies trying to change the gender inequalities we see in tech. Offering a safe space to learn—with lots of people in the room who look like you as mentors—speaks volumes about who should be sitting around the tech table. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/code-book + +作者:[Alicia Gibb][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/aliciagibb/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_book_electronics_hardware.jpg?itok=zb-zaiwz (Open hardware electronic book) +[2]: https://www.redhat.com/en/open-source-stories +[3]: https://opensource.com/sites/default/files/uploads/codebook_cover.jpg ("Breaking the Code" book cover) +[4]: https://opensource.com/sites/default/files/uploads/codebook_38-39.jpg ('Breaking the Code' interior pages) +[5]: https://www.amazon.com/Lauren-Sabel/e/B01M0FW223 +[6]: https://opensource.com/sites/default/files/uploads/codebook_lightbulb.jpg ('Breaking the Code' interior pages) +[7]: https://opensource.com/sites/default/files/uploads/codebook_10-11.jpg ('Breaking the Code' interior pages) +[8]: https://opensource.com/sites/default/files/uploads/codebook_pg1.jpg (About 'Breaking the Code') From 313dad4a54b9d5d11f4a1575adb85892f4a5cb00 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:46:14 +0800 Subject: [PATCH 0297/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190502=20Get?= =?UTF-8?q?=20started=20with=20Libki=20to=20manage=20public=20user=20compu?= =?UTF-8?q?ter=20access=20sources/tech/20190502=20Get=20started=20with=20L?= =?UTF-8?q?ibki=20to=20manage=20public=20user=20computer=20access.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...i to manage public user computer access.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/tech/20190502 Get started with Libki to manage public user computer access.md diff --git a/sources/tech/20190502 Get started with Libki to manage public user computer access.md b/sources/tech/20190502 Get started with Libki to manage public user computer access.md new file mode 100644 index 0000000000..7c6f4b2746 --- /dev/null +++ b/sources/tech/20190502 Get started with Libki to manage public user computer access.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get started with Libki to manage public user computer access) +[#]: via: (https://opensource.com/article/19/5/libki-computer-access) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) + +Get started with Libki to manage public user computer access +====== +Libki is a cross-platform, computer reservation and time management +system. +![][1] + +Libraries, schools, colleges, and other organizations that provide public computers need a good way to manage users' access—otherwise, there's no way to prevent some people from monopolizing the machines and ensure everyone has a fair amount of time. This is the problem that [Libki][2] was designed to solve. + +Libki is an open source, cross-platform, computer reservation and time management system for Windows and Linux PCs. It provides a web-based server and a web-based administration system that staff can use to manage computer access, including creating and deleting users, setting time limits on accounts, logging out and banning users, and setting access restrictions. + +According to lead developer [Kyle Hall][3], Libki is mainly used for PC time control as an open source alternative to Envisionware's proprietary computer access control software. When users log into a Libki-managed computer, they get a block of time to use the computer; once that time is up, they are logged off. The default setting is 45 minutes, but that can easily be adjusted using the web-based administration system. Some organizations offer 24 hours of access before logging users off, and others use it to track usage without setting time limits. + +Kyle is currently lead developer at [ByWater Solutions][4], which provides open source software solutions (including Libki) to libraries. He developed Libki early in his career when he was the IT tech at the [Meadville Public Library][5] in Pennsylvania. He was occasionally asked to cover the children's room during lunch breaks for other employees. The library used a paper sign-up sheet to manage access to the computers in the children's room, which meant constant supervision and checking to ensure equitable access for the people who came there. + +Kyle said, "I found this system to be cumbersome and awkward, and I wanted to find a solution. That solution needed to be both FOSS and cross-platform. In the end, no existing software package suited our particular needs, and that is why I developed Libki." + +Or, as Libki's website proclaims, "Libki was born of the need to avoid interacting with teenagers and now allows librarians to avoid interacting with teenagers around the world!" + +### Easy to set up and use + +I recently decided to try Libki in our local public library, where I frequently volunteer. I followed the [documentation][6] for the automatic installation, using Ubuntu 18.04 Server, and very quickly had it up and running. + +I am planning to support Libki in our local library, but I wondered about libraries that don't have someone with IT experience or the ability to build and deploy a server. Kyle says, "ByWater Solutions can cloud-host a Libki server, which makes maintenance and management much simpler for everyone." + +Kyle says ByWater is not planning to bundle Libki with its most popular offering, open source integrated library system (ILS) Koha, or any of the other [projects][7] it supports. "Libki and Koha are different [types of] software serving different needs, but they definitely work well together in a library setting. In fact, it was quite early on that I developed Libki's SIP2 integration so it could support single sign-on using Koha," he says. + +### How you can contribute + +Libki client is licensed under the GPLv3 and Libki server is licensed under the AGPLv3. Kyle says he would love Libki to have a more active and robust community, and the project is always looking for new people to join its [contributors][8]. If you would like to participate, visit [Libki's Community page][9] and join the mailing list. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/libki-computer-access + +作者:[Don Watkins ][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/don-watkins/users/tony-thomas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 +[2]: https://libki.org/ +[3]: https://www.linkedin.com/in/kylemhallinfo/ +[4]: https://opensource.com/article/19/4/software-libraries +[5]: https://meadvillelibrary.org/ +[6]: https://manual.libki.org/master/libki-manual.html#_automatic_installation +[7]: https://bywatersolutions.com/projects +[8]: https://github.com/Libki/libki-server/graphs/contributors +[9]: https://libki.org/community/ From 6fa353e3881509efd4a6f32c753ccd9cd6c0d33b Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:46:25 +0800 Subject: [PATCH 0298/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190502=20Form?= =?UTF-8?q?at=20Python=20however=20you=20like=20with=20Black=20sources/tec?= =?UTF-8?q?h/20190502=20Format=20Python=20however=20you=20like=20with=20Bl?= =?UTF-8?q?ack.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rmat Python however you like with Black.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20190502 Format Python however you like with Black.md diff --git a/sources/tech/20190502 Format Python however you like with Black.md b/sources/tech/20190502 Format Python however you like with Black.md new file mode 100644 index 0000000000..7030bc795b --- /dev/null +++ b/sources/tech/20190502 Format Python however you like with Black.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Format Python however you like with Black) +[#]: via: (https://opensource.com/article/19/5/python-black) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) + +Format Python however you like with Black +====== +Learn more about solving common Python problems in our series covering +seven PyPI libraries. +![OpenStack source code \(Python\) in VIM][1] + +Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. + +In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. In the first article, we learned about [Cython][4]; today, we'll examine the **[Black][5]** code formatter. + +### Black + +Sometimes creativity can be a wonderful thing. Sometimes it is just a pain. I enjoy solving hard problems creatively, but I want my Python formatted as consistently as possible. Nobody has ever been impressed by code that uses "interesting" indentation. + +But even worse than inconsistent formatting is a code review that consists of nothing but formatting nits. It is annoying to the reviewer—and even more annoying to the person whose code is reviewed. It's also infuriating when your linter tells you that your code is indented incorrectly, but gives no hint about the _correct_ amount of indentation. + +Enter Black. Instead of telling you _what_ to do, Black is a good, industrious robot: it will fix your code for you. + +To see how it works, feel free to write something beautifully inconsistent like: + + +``` +def add(a, b): return a+b + +def mult(a, b): +return \ +a * b +``` + +Does Black complain? Goodness no, it just fixes it for you! + + +``` +$ black math +reformatted math +All done! ✨ 🍰 ✨ +1 file reformatted. +$ cat math +def add(a, b): +return a + b + +def mult(a, b): +return a * b +``` + +Black does offer the option of failing instead of fixing and even outputting a **diff** -style edit. These options are great in a continuous integration (CI) system that enforces running Black locally. In addition, if the **diff** output is logged to the CI output, you can directly paste it into **patch** in the rare case that you need to fix your output but cannot install Black locally. + + +``` +$ black --check --diff bad +\--- math 2019-04-09 17:24:22.747815 +0000 ++++ math 2019-04-09 17:26:04.269451 +0000 +@@ -1,7 +1,7 @@ +-def add(a, b): return a + b ++def add(a, b): +\+ return a + b + + +def mult(a, b): +\- return \ +\- a * b +\+ return a * b + +would reformat math +All done! 💥 💔 💥 +1 file would be reformatted. +$ echo $? +1 +``` + +In the next article in this series, we'll look at **attrs** , a library that helps you write concise, correct code quickly. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-black + +作者:[Moshe Zadka ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez/users/moshez/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM) +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[5]: https://pypi.org/project/black/ From c2f9e18f860b3bc4d89e1e569d2270d1bf827444 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:47:07 +0800 Subject: [PATCH 0299/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190502=20Revo?= =?UTF-8?q?lutionary=20data=20compression=20technique=20could=20slash=20co?= =?UTF-8?q?mpute=20costs=20sources/talk/20190502=20Revolutionary=20data=20?= =?UTF-8?q?compression=20technique=20could=20slash=20compute=20costs.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ion technique could slash compute costs.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md diff --git a/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md b/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md new file mode 100644 index 0000000000..00316946f6 --- /dev/null +++ b/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Revolutionary data compression technique could slash compute costs) +[#]: via: (https://www.networkworld.com/article/3392716/revolutionary-data-compression-technique-could-slash-compute-costs.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Revolutionary data compression technique could slash compute costs +====== +A new form of data compression, called Zippads, will create faster computer programs that could drastically lower the costs of computing. +![Kevin Stanchfield \(CC BY 2.0\)][1] + +There’s a major problem with today’s money-saving memory compression used for storing more data in less space. The issue is that computers store and run memory in predetermined blocks, yet many modern programs function and play out in variable chunks. + +The way it’s currently done is actually, highly inefficient. That’s because the compressed programs, which use objects rather than evenly configured slabs of data, don’t match the space used to store and run them, explain scientists working on a revolutionary new compression system called Zippads. + +The answer, they say—and something that if it works would drastically reduce those inefficiencies, speed things up, and importantly, reduce compute costs—is to compress the varied objects and not the cache lines, as is the case now. Cache lines are fixed-size blocks of memory that are transferred to memory cache. + +**[ Read also:[How to deal with backup when you switch to hyperconverged infrastructure][2] ]** + +“Objects, not cache lines, are the natural unit of compression,” writes Po-An Tsai and Daniel Sanchez in their MIT Computer Science and Artificial Intelligence Laboratory (CSAIL) [paper][3] (pdf). + +They say object-based programs — of the kind used now everyday, such as Python — should be compressed based on their programmed object size, not on some fixed value created by traditional or even state-of-the art cached methods. + +The alternative, too, isn’t to recklessly abandon object-oriented programming just because it’s inefficient at using compression. One must adapt compression to that now common object-using code. + +The scientists claim their new system can increase the compression ratio 1.63 times and improve performance by 17%. It’s the “first compressed memory hierarchy designed for object-based applications,” they say. + +### The benefits of compression + +Compression is a favored technique for making computers more efficient. The main advantage over simply adding more memory is that costs are lowered significantly—you don’t need to add increasing physical main memory hardware because you’re cramming more data into existing. + +However, to date, hardware memory compression has been best suited to more old-school large blocks of data, not the “random, fine-grained memory accesses,” the team explains. It’s not great at accessing small pieces of data, such as words, for example. + +### How the Zippads compression system works + +In Zippads, as the new system is called, stored object hierarchical levels (called “pads”) are located on-chip and are directly accessed. The different levels (pads) have changing speed grades, with newly referenced objects being placed in the fastest pad. As a pad fills up, it begins the process of evicting older, not-so-active objects and ultimately recycles the unused code that is taking up desirable fast space and isn’t being used. Cleverly, at the fast level, the code parts aren’t even compressed, but as they prove their non-usefulness they get kicked down to compressed, slow-to-access, lower-importance pads—and are brought back up as necessary. + +Zippads would “see computers that can run much faster or can run many more apps at the same speeds,” an[ MIT News][4] article says. “Each application consumes less memory, it runs faster, so a device can support more applications within its allotted memory.” Bandwidth is freed up, in other words. + +“All computer systems would benefit from this,” Sanchez, a professor of computer science and electrical engineering, says in the article. “Programs become faster because they stop being bottlenecked by memory bandwidth.” + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3392716/revolutionary-data-compression-technique-could-slash-compute-costs.html#tk.rss_all + +作者:[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.idgesg.net/images/article/2019/02/memory-100787327-large.jpg +[2]: https://www.networkworld.com/article/3389396/how-to-deal-with-backup-when-you-switch-to-hyperconverged-infrastructure.html +[3]: http://people.csail.mit.edu/poantsai/papers/2019.zippads.asplos.pdf +[4]: http://news.mit.edu/2019/hardware-data-compression-0416 +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 0569bbccea21aeab944ce93fb2bc2c67098ad4ae Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:47:17 +0800 Subject: [PATCH 0300/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Heal?= =?UTF-8?q?th=20care=20is=20still=20stitching=20together=20IoT=20systems?= =?UTF-8?q?=20sources/talk/20190501=20Health=20care=20is=20still=20stitchi?= =?UTF-8?q?ng=20together=20IoT=20systems.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...is still stitching together IoT systems.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/talk/20190501 Health care is still stitching together IoT systems.md diff --git a/sources/talk/20190501 Health care is still stitching together IoT systems.md b/sources/talk/20190501 Health care is still stitching together IoT systems.md new file mode 100644 index 0000000000..988b58f592 --- /dev/null +++ b/sources/talk/20190501 Health care is still stitching together IoT systems.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Health care is still stitching together IoT systems) +[#]: via: (https://www.networkworld.com/article/3392818/health-care-is-still-stitching-together-iot-systems.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Health care is still stitching together IoT systems +====== +The use of IoT technology in medicine is fraught with complications, but users are making it work. +_Government regulations, safety and technical integration are all serious issues facing the use of IoT in medicine, but professionals in the field say that medical IoT is moving forward despite the obstacles. A vendor, a doctor, and an IT pro all spoke to Network World about the work involved._ + +### Vendor: It's tough to gain acceptance** + +** + +Josh Stein is the CEO and co-founder of Adheretech, a medical-IoT startup whose main product is a connected pill bottle. The idea is to help keep seriously ill patients current with their medications, by monitoring whether they’ve taken correct dosages or not. + +The bottle – which patients get for free (Adheretech’s clients are hospitals and clinics) – uses a cellular modem to call home to the company’s servers and report on how much medication is left in the bottle, according to sensors that detect how many pills are touching the bottle’s sides and measuring its weight. There, the data is analyzed not just to determine whether patients are sticking to their doctor’s prescription, but to help identify possible side effects and whether they need additional help. + +For example, a bottle that detects itself being moved to the bathroom too often might send up a flag that the patient is experiencing gastrointestinal side effects. The system can then contact patients or providers via phone or text to help them take the next steps. + +The challenges to reach this point have been stiff, according to Stein. The company was founded in 2011 and spent the first four years of its existence simply designing and building its product. + +“We had to go through many years of R&D to create a device that’s replicatible a million times over,” he said. “If you’re a healthcare company, you have to deal with HIPAA, the FDA, and then there’s lots of other things like medication bottles have their whole own set of regulatory certifications.” + +Beyond the simple fact of regulatory compliance, Stein said that there’s resistance to this sort of new technology in the medical community. + +“Healthcare is typically one of the last industries to adopt new technology,” he said. + +### Doctor: Colleagues wonder if medical IoT plusses are worth the trouble + +Dr. Rebecca Mishuris is the associate chief medical information officer at Boston Medical Center, a private non-profit hospital located in the South End. One of the institution’s chief missions is to act as a safety net for the population of the area – 57% of BMC’s patients come from under-served populations, and roughly a third don’t speak English as a primary language. That, in itself, can be a problem for IoT because many devices are designed to be used by native English speakers. + +BMC’s adoption of IoT tech has taken place mostly at the individual-practice level – things like Bluetooth-enabled scales and diagnostic equipment for specific offices that want to use them – but there’s no hospital-wide IoT initiative happening, according to Mishuris. + +That’s partially due to the fact that many practitioners aren’t convinced that connected healthcare devices are worth the trouble to purchase, install and manage, she said. HIPAA compliance and BMC’s own privacy regulations are a particular concern, given that many of the devices deal with patient-generated data. + +To continue reading this article register now + +[Get Free Access][1] + +[Learn More][2] Existing Users [Sign In][1] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3392818/health-care-is-still-stitching-together-iot-systems.html#tk.rss_all + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: javascript:// +[2]: /learn-about-insider/ From d150468562d88e401fa5a9f5586c64d57670d245 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:47:29 +0800 Subject: [PATCH 0301/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Cisc?= =?UTF-8?q?o=20issues=20critical=20security=20warning=20for=20Nexus=20data?= =?UTF-8?q?-center=20switches=20sources/talk/20190501=20Cisco=20issues=20c?= =?UTF-8?q?ritical=20security=20warning=20for=20Nexus=20data-center=20swit?= =?UTF-8?q?ches.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... warning for Nexus data-center switches.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md diff --git a/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md new file mode 100644 index 0000000000..1905aa56de --- /dev/null +++ b/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco issues critical security warning for Nexus data-center switches) +[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco issues critical security warning for Nexus data-center switches +====== +Cisco released 40 security advisories around Nexus switches, Firepower firewalls and more +![Thinkstock][1] + +Cisco issued some 40 security advisories today but only one of them was deemed “[critical][2]” – a vulnerability in the Cisco Nexus 9000 Series Application Centric Infrastructure (ACI) Mode data-center switch that could let an attacker secretly access system resources. + +The exposure, which was given a Common Vulnerability Scoring System importance of 9.8 out of 10, is described as a problem with secure shell (SSH) key-management for the Cisco Nexus 9000 that lets a remote attacker to connect to the affected system with the privileges of a root user, Cisco said. + +**[ Read also:[How to plan a software-defined data-center network][3] ]** + +“The vulnerability is due to the presence of a default SSH key pair that is present in all devices. An attacker could exploit this vulnerability by opening an SSH connection via IPv6 to a targeted device using the extracted key materials. This vulnerability is only exploitable over IPv6; IPv4 is not vulnerable," Cisco wrote. + +This vulnerability affects Nexus 9000s if they are running a Cisco NX-OS software release prior to 14.1, and the company said there were no workarounds to address the problem. + +However, Cisco has [released free software updates][4] that address the vulnerability. + +The company also issued a “high” security warning advisory for the Nexus 9000 that involves an exploit that would let attackers execute arbitrary operating-system commands as root on an affected device. To succeed, an attacker would need valid administrator credentials for the device, Cisco said. + +The vulnerability is due to overly broad system-file permissions, [Cisco wrote][5]. An attacker could exploit this vulnerability by authenticating to an affected device, creating a crafted command string and writing this crafted string to a specific file location. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][6] ]** + +Cisco has released software updates that address this vulnerability. + +Two other vulneraries rated “high” also involved the Nexus 9000: + + * [A vulnerability][7] in the background-operations functionality of Cisco Nexus 9000 software could allow an authenticated, local attacker to gain elevated privileges as root on an affected device. The vulnerability is due to insufficient validation of user-supplied files on an affected device. Cisco said an attacker could exploit this vulnerability by logging in to the CLI of the affected device and creating a crafted file in a specific directory on the filesystem. + * A [weakness][7] in the background-operations functionality of the switch software could allow an attacker to login to the CLI of the affected device and create a crafted file in a specific directory on the filesystem. The vulnerability is due to insufficient validation of user-supplied files on an affected device, Cisco said. + + + +Cisco has [released software][4] for these vulnerabilities as well. + +Also part of these security alerts were a number of “high” rated warnings about vulneraries in Cisco’s FirePower firewall series. + +For example Cisco [wrote][8] that multiple vulnerabilities in the Server Message Block Protocol preprocessor detection engine for Cisco Firepower Threat Defense Software could allow an unauthenticated, adjacent or remote attacker to cause a denial of service (DoS) condition. + +Yet [another vulnerability][9] in the internal packet-processing functionality of Cisco Firepower software for the Cisco Firepower 2100 Series could let an unauthenticated, remote attacker cause an affected device to stop processing traffic, resulting in a DOS situation, Cisco said. + +[Software patches][4] are available for these vulnerabilities. + +Other products such as the Cisco [Adaptive Security Virtual Appliance][10], and [Web Security appliance][11] had high priority patches as well. + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/lock_broken_unlocked_binary_code_security_circuits_protection_privacy_thinkstock_873916354-100750739-large.jpg +[2]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-sshkey +[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[4]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html +[5]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-rpe +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-aci-hw-clock-util +[8]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-smb-snort +[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-dos +[10]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-asa-ipsec-dos +[11]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-wsa-privesc +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From 9f2dcb3211748134f2200035e0c1a002f97ad2a3 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:48:24 +0800 Subject: [PATCH 0302/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Look?= =?UTF-8?q?ing=20into=20Linux=20modules=20sources/tech/20190501=20Looking?= =?UTF-8?q?=20into=20Linux=20modules.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190501 Looking into Linux modules.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20190501 Looking into Linux modules.md diff --git a/sources/tech/20190501 Looking into Linux modules.md b/sources/tech/20190501 Looking into Linux modules.md new file mode 100644 index 0000000000..eb3125c19b --- /dev/null +++ b/sources/tech/20190501 Looking into Linux modules.md @@ -0,0 +1,219 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Looking into Linux modules) +[#]: via: (https://www.networkworld.com/article/3391362/looking-into-linux-modules.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Looking into Linux modules +====== +The lsmod command can tell you which kernel modules are currently loaded on your system, along with some interesting details about their use. +![Rob Oo \(CC BY 2.0\)][1] + +### What are Linux modules? + +Kernel modules are chunks of code that are loaded and unloaded into the kernel as needed, thus extending the functionality of the kernel without requiring a reboot. In fact, unless users inquire about modules using commands like **lsmod** , they won't likely know that anything has changed. + +One important thing to understand is that there are _lots_ of modules that will be in use on your Linux system at all times and that a lot of details are available if you're tempted to dive into the details. + +One of the prime ways that lsmod is used is to examine modules when a system isn't working properly. However, most of the time, modules load as needed and users don't need to be aware of how they are working. + +**[ Also see:[Must-know Linux Commands][2] ]** + +### Listing modules + +The easiest way to list modules is with the **lsmod** command. While this command provides a lot of detail, this is the most user-friendly output. + +``` +$ lsmod +Module Size Used by +snd_hda_codec_realtek 114688 1 +snd_hda_codec_generic 77824 1 snd_hda_codec_realtek +ledtrig_audio 16384 2 snd_hda_codec_generic,snd_hda_codec_realtek +snd_hda_codec_hdmi 53248 1 +snd_hda_intel 40960 2 +snd_hda_codec 131072 4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel + ,snd_hda_codec_realtek +snd_hda_core 86016 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel + ,snd_hda_codec,snd_hda_codec_realtek +snd_hwdep 20480 1 snd_hda_codec +snd_pcm 102400 4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda + _core +snd_seq_midi 20480 0 +snd_seq_midi_event 16384 1 snd_seq_midi +dcdbas 20480 0 +snd_rawmidi 36864 1 snd_seq_midi +snd_seq 69632 2 snd_seq_midi,snd_seq_midi_event +coretemp 20480 0 +snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi +snd_timer 36864 2 snd_seq,snd_pcm +kvm_intel 241664 0 +kvm 626688 1 kvm_intel +radeon 1454080 10 +irqbypass 16384 1 kvm +joydev 24576 0 +input_leds 16384 0 +ttm 102400 1 radeon +drm_kms_helper 180224 1 radeon +drm 475136 13 drm_kms_helper,radeon,ttm +snd 81920 15 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda + _codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd + _hda_codec_realtek,snd_timer,snd_pcm,snd_rawmidi +i2c_algo_bit 16384 1 radeon +fb_sys_fops 16384 1 drm_kms_helper +syscopyarea 16384 1 drm_kms_helper +serio_raw 20480 0 +sysfillrect 16384 1 drm_kms_helper +sysimgblt 16384 1 drm_kms_helper +soundcore 16384 1 snd +mac_hid 16384 0 +sch_fq_codel 20480 2 +parport_pc 40960 0 +ppdev 24576 0 +lp 20480 0 +parport 53248 3 parport_pc,lp,ppdev +ip_tables 28672 0 +x_tables 40960 1 ip_tables +autofs4 45056 2 +raid10 57344 0 +raid456 155648 0 +async_raid6_recov 24576 1 raid456 +async_memcpy 20480 2 raid456,async_raid6_recov +async_pq 24576 2 raid456,async_raid6_recov +async_xor 20480 3 async_pq,raid456,async_raid6_recov +async_tx 20480 5 async_pq,async_memcpy,async_xor,raid456,async_raid6_re + cov +xor 24576 1 async_xor +raid6_pq 114688 3 async_pq,raid456,async_raid6_recov +libcrc32c 16384 1 raid456 +raid1 45056 0 +raid0 24576 0 +multipath 20480 0 +linear 20480 0 +hid_generic 16384 0 +psmouse 151552 0 +i2c_i801 32768 0 +pata_acpi 16384 0 +lpc_ich 24576 0 +usbhid 53248 0 +hid 126976 2 usbhid,hid_generic +e1000e 245760 0 +floppy 81920 0 +``` + +In the output above: + + * "Module" shows the name of each module + * "Size" shows the module size (not how much memory it is using) + * "Used by" shows each module's usage count and the referring modules + + + +Clearly, that's a _lot_ of modules. The number of modules loaded will depend on your system and distribution and what's running. We can count them like this: + +``` +$ lsmod | wc -l +67 +``` + +To see the number of modules available on the system (not just running), try this command: + +``` +$ modprobe -c | wc -l +41272 +``` + +### Other commands for examining modules + +Linux provides several commands for listing, loading and unloading, examining, and checking the status of modules. + + * depmod -- generates modules.dep and map files + * insmod -- a simple program to insert a module into the Linux Kernel + * lsmod -- show the status of modules in the Linux Kernel + * modinfo -- show information about a Linux Kernel module + * modprobe -- add and remove modules from the Linux Kernel + * rmmod -- a simple program to remove a module from the Linux Kernel + + + +### Listing modules that are built in + +As mentioned above, the **lsmod** command is the most convenient command for listing modules. There are, however, other ways to examine them. The modules.builtin file lists all modules that are built into the kernel and is used by modprobe when trying to load one of these modules. Note that **$(uname -r)** in the commands below provides the name of the kernel release. + +``` +$ more /lib/modules/$(uname -r)/modules.builtin | head -10 +kernel/arch/x86/crypto/crc32c-intel.ko +kernel/arch/x86/events/intel/intel-uncore.ko +kernel/arch/x86/platform/intel/iosf_mbi.ko +kernel/mm/zpool.ko +kernel/mm/zbud.ko +kernel/mm/zsmalloc.ko +kernel/fs/binfmt_script.ko +kernel/fs/mbcache.ko +kernel/fs/configfs/configfs.ko +kernel/fs/crypto/fscrypto.ko +``` + +You can get some additional detail on a module by using the **modinfo** command, though nothing that qualifies as an easy explanation of what service the module provides. The omitted details from the output below include a lengthy signature. + +``` +$ modinfo floppy | head -16 +filename: /lib/modules/5.0.0-13-generic/kernel/drivers/block/floppy.ko +alias: block-major-2-* +license: GPL +author: Alain L. Knaff +srcversion: EBEAA26742DF61790588FD9 +alias: acpi*:PNP0700:* +alias: pnp:dPNP0700* +depends: +retpoline: Y +intree: Y +name: floppy +vermagic: 5.0.0-13-generic SMP mod_unload +sig_id: PKCS#7 +signer: +sig_key: +sig_hashalgo: md4 +``` + +You can load or unload a module using the **modprobe** command. Using a command like the one below, you can locate the kernel object associated with a particular module: + +``` +$ find /lib/modules/$(uname -r) -name floppy* +/lib/modules/5.0.0-13-generic/kernel/drivers/block/floppy.ko +``` + +If you needed to load the module, you could use a command like this one: + +``` +$ sudo modprobe floppy +``` + +### Wrap-up + +Clearly the loading and unloading of modules is a big deal. It makes Linux systems considerably more flexible and efficient than if they ran with a one-size-fits-all kernel. It also means you can make significant changes — including adding hardware — without rebooting. + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][3] ]** + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391362/looking-into-linux-modules.html#tk.rss_all + +作者:[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/04/modules-100794941-large.jpg +[2]: https://www.networkworld.com/article/3391029/must-know-linux-commands.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From ba56e8a6aaafcc5e0f75972145e4830befa37d75 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:48:37 +0800 Subject: [PATCH 0303/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Yet?= =?UTF-8?q?=20another=20killer=20cloud=20quarter=20puts=20pressure=20on=20?= =?UTF-8?q?data=20centers=20sources/talk/20190501=20Yet=20another=20killer?= =?UTF-8?q?=20cloud=20quarter=20puts=20pressure=20on=20data=20centers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d quarter puts pressure on data centers.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md diff --git a/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md b/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md new file mode 100644 index 0000000000..d65fe448b4 --- /dev/null +++ b/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Yet another killer cloud quarter puts pressure on data centers) +[#]: via: (https://www.networkworld.com/article/3391465/another-strong-cloud-computing-quarter-puts-pressure-on-data-centers.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Yet another killer cloud quarter puts pressure on data centers +====== +Continued strong growth from Amazon Web Services, Microsoft Azure, and Google Cloud Platform signals even more enterprises are moving to the cloud. +![Getty Images][1] + +You’d almost think I’d get tired of [writing this story over and over and over][2]… but the ongoing growth of cloud computing is too big a trend to ignore. + +Critically, the impressive growth numbers of the three leading cloud infrastructure providers—Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform—doesn’t occur in a vacuum. It’s not just about new workloads being run in the cloud; it’s also about more and more enterprises moving existing workloads to the cloud from on-premises data centers. + +**[ Also read:[Is the cloud already killing the enterprise data center?][3] ]** + +To put these trends in perspective, let’s take a look at the results for all three vendors. + +### AWS keeps on trucking + +AWS remains by far the dominant player in the cloud infrastructure market, with a massive [$7.7 billion in quarterly sales][4] (an annual run rate of a whopping $30.8 billion). Even more remarkable, somehow AWS continues to grow revenue by almost 42% year over year. Oh, and that kind of growth is not just unique _this_ quarter; the unit has topped 40% revenue growth _every_ quarter since the beginning of 2017. (To be fair, the first quarter of 2018 saw an amazing 49% revenue growth.) + +And unlike many fast-growing tech companies, that incredible expansion isn’t being fueled by equally impressive losses. AWS earned a healthy $2.2 billion operating profit in the quarter, up 59% from the same period last year. One reason? [The company told analysts][5] it made big data center investments in 2016 and 2017, so it hasn’t had to do so more recently (it expects to boost spending on data centers later this year). The company [reportedly][6] described AWS revenue growth as “lumpy,” but it seems to me that the numbers merely vary between huge and even bigger. + +### Microsoft Azure grows even faster than AWS + +Sure, 41% growth is good, but [Microsoft’s quarterly Azure revenue][7] almost doubled that, jumping 73% year over year (fairly consistent with the previous—also stellar—quarter), helping the company exceed estimates for both sales and revenue and sparking a brief shining moment of a $1 billion valuation for the company. Microsoft doesn’t break out Azure’s sales and revenue, but [the commercial cloud business, which includes Azure as well as other cloud businesses, grew 41% in the quarter to $9.6 billion][8]. + +It’s impossible to tell exactly how big Azure is, but it appears to be growing faster than AWS, though off a much smaller base. While some analysts reportedly say Azure is growing faster than AWS was at a similar stage in its development, that may not bear much significance because the addressable cloud market is now far larger than it used be. + +According to [the New York Times][9], like AWS, Microsoft is also now reaping the benefits of heavy investments in new data centers around the world. And the Times credits Microsoft with “particular success” in [hybrid cloud installations][10], helping ease concerns among some slow-to-change enterprise about full-scale cloud adoption. + +**[ Also read:[Why hybrid cloud will turn out to be a transition strategy][11] ]** + +### Can Google Cloud Platform keep up? + +Even as the [overall quarterly numbers for Alphabet][12]—Google’s parent company—didn’t meet analysts’ revenue expectations (which sent the stock tumbling), Google Cloud Platform seems to have continued its strong growth. Alphabet doesn’t break out its cloud unit, but sales in Alphabet’s “Other Revenue” category—which includes cloud computing along with hardware—jumped 25% compared to the same period last year, hitting $5.4 billion. + +More telling, perhaps, Alphabet Chief Financial Officer Ruth Porat [reportedly][13] told analysts that "Google Cloud Platform remains one of the fastest growing businesses in Alphabet." [Porat also mentioned][14] that hiring in the cloud unit was so aggressive that it drove a 20% jump in Alphabet’s operating expenses! + +### Companies keep going cloud + +But the raw numbers tell only part of the story. All that growth means existing customers are spending more, but also that ever-increasing numbers of enterprises are abandoning their hassle and expense of running their data centers in favor of buying what they need from the cloud. + +**[ Also read:[Large enterprises abandon data centers for the cloud][15] ]** + +The New York Times quotes Amy Hood, Microsoft’s chief financial officer, explaining that, “You don’t really get revenue growth unless you have a usage growth, so this is customers deploying and using Azure.” And the Times notes that Microsoft has signed big deals with companies such as [Walgreens Boots Alliance][16] that combined Azure with other Microsoft cloud-based services. + +This growth is true in existing markets, and also includes new markets. For example, AWS just opened new regions in [Indonesia][17] and [Hong Kong][18]. + +**[ Now read:[After virtualization and cloud, what's left on premises?][19] ]** + +Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391465/another-strong-cloud-computing-quarter-puts-pressure-on-data-centers.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/cloud_comput_connect_blue-100787048-large.jpg +[2]: https://www.networkworld.com/article/3292935/cloud-computing-just-had-another-kick-ass-quarter.html +[3]: https://www.networkworld.com/article/3268384/is-the-cloud-already-killing-the-enterprise-data-center.html +[4]: https://www.latimes.com/business/la-fi-amazon-earnings-cloud-computing-aws-20190425-story.html +[5]: https://www.businessinsider.com/amazon-q1-2019-earnings-aws-advertising-retail-prime-2019-4 +[6]: https://www.computerweekly.com/news/252462310/Amazon-cautions-against-reading-too-much-into-slowdown-in-AWS-revenue-growth-rate +[7]: https://www.microsoft.com/en-us/Investor/earnings/FY-2019-Q3/press-release-webcast +[8]: https://www.cnbc.com/2019/04/24/microsoft-q3-2019-earnings.html +[9]: https://www.nytimes.com/2019/04/24/technology/microsoft-earnings.html +[10]: https://www.networkworld.com/article/3268448/what-is-hybrid-cloud-really-and-whats-the-best-strategy.html +[11]: https://www.networkworld.com/article/3238466/why-hybrid-cloud-will-turn-out-to-be-a-transition-strategy.html +[12]: https://abc.xyz/investor/static/pdf/2019Q1_alphabet_earnings_release.pdf?cache=8ac2b86 +[13]: https://www.forbes.com/sites/jilliandonfro/2019/04/29/google-alphabet-q1-earnings-2019/#52f5c8c733be +[14]: https://www.youtube.com/watch?v=31_KHdse_0Y +[15]: https://www.networkworld.com/article/3240587/large-enterprises-abandon-data-centers-for-the-cloud.html +[16]: https://www.walgreensbootsalliance.com +[17]: https://www.businesswire.com/news/home/20190403005931/en/AWS-Open-New-Region-Indonesia +[18]: https://www.apnews.com/Business%20Wire/57eaf4cb603e46e6b05b634d9751699b +[19]: https://https//www.networkworld.com/article/3232626/virtualization/extreme-virtualization-impact-on-enterprises.html +[20]: https://www.facebook.com/NetworkWorld/ +[21]: https://www.linkedin.com/company/network-world From 0505b8f1fbf925e4c3363dc1a726e406c9f0454e Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:48:50 +0800 Subject: [PATCH 0304/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Vapo?= =?UTF-8?q?r=20IO=20provides=20direct,=20high-speed=20connections=20from?= =?UTF-8?q?=20the=20edge=20to=20AWS=20sources/talk/20190501=20Vapor=20IO?= =?UTF-8?q?=20provides=20direct,=20high-speed=20connections=20from=20the?= =?UTF-8?q?=20edge=20to=20AWS.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-speed connections from the edge to AWS.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md diff --git a/sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md b/sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md new file mode 100644 index 0000000000..0ddef36770 --- /dev/null +++ b/sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Vapor IO provides direct, high-speed connections from the edge to AWS) +[#]: via: (https://www.networkworld.com/article/3391922/vapor-io-provides-direct-high-speed-connections-from-the-edge-to-aws.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Vapor IO provides direct, high-speed connections from the edge to AWS +====== +With a direct fiber line, latency between the edge and the cloud can be dramatically reduced. +![Vapor IO][1] + +Edge computing startup Vapor IO now offers a direct connection between its edge containers to Amazon Web Services (AWS) via a high-speed fiber network link. + +The company said that connection between its Kinetic Edge containers and AWS will be provided by Crown Castle's Cloud Connect fiber network, which uses Amazon Direct Connect Services. This would help reduce network latency by essentially drawing a straight fiber line from Vapor IO's edge computing data centers to Amazon's cloud computing data centers. + +“When combined with Crown Castle’s high-speed Cloud Connect fiber, the Kinetic Edge lets AWS developers build applications that span the entire continuum from core to edge. By enabling new classes of applications at the edge, we make it possible for any AWS developer to unlock the next generation of real-time, innovative use cases,” wrote Matt Trifiro, chief marketing officer of Vapor IO, in a [blog post][2]. + +**[ Read also:[What is edge computing and how it’s changing the network][3] ]** + +Vapor IO clams that the connection will lower latency by as much as 75%. “Connecting workloads and data at the Kinetic Edge with workloads and data in centralized AWS data centers makes it possible to build edge applications that leverage the full power of AWS,” wrote Trifiro. + +Developers building applications at the Kinetic Edge will have access to the full suite of AWS cloud computing services, including Amazon Simple Storage Service (Amazon S3), Amazon Elastic Cloud Compute (Amazon EC2), Amazon Virtual Private Cloud (Amazon VPC), and Amazon Relational Database Service (Amazon RDS). + +Crown Castle is the largest provider of shared communications infrastructure in the U.S., with 40,000 cell towers and 60,000 miles of fiber, offering 1Gbps to 10Gbps private fiber connectivity between the Kinetic Edge and AWS. + +AWS Direct Connect is a essentially a private connection between Amazon's AWS customers and their the AWS data centers, so customers don’t have to rout their traffic over the public internet and compete with Netflix and YouTube, for example, for bandwidth. + +### How edge computing works + +The structure of [edge computing][3] is the reverse of the standard internet design. Rather than sending all the data up to central servers, as much processing as possible is done at the edge. This is to reduce the sheer volume of data coming upstream and thus reduce latency. + +With things like smart cars, even if 95% of data is eliminated that remaining, 5% can still be a lot, so moving it fast is essential. Vapor IO said it will shuttle workloads to Amazon’s USEAST and USWEST data centers, depending on location. + +This shows how the edge is up-ending the traditional internet design and moving more computing outside the traditional data center, although a connection upstream is still important because it allows for rapid movement of necessary data from the edge to the cloud, where it can be stored or processed. + +**More about edge networking:** + + * [How edge networking and IoT will reshape data centers][4] + * [Edge computing best practices][5] + * [How edge computing can help secure the IoT][6] + + + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391922/vapor-io-provides-direct-high-speed-connections-from-the-edge-to-aws.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/09/vapor-io-kinetic-edge-data-center-100771510-large.jpg +[2]: https://www.vapor.io/powering-amazon-web-services-at-the-kinetic-edge/ +[3]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[4]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[5]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[6]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 7233da8c8b2b5ace135ab46cc5935170c5849459 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:49:00 +0800 Subject: [PATCH 0305/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190430=20Must?= =?UTF-8?q?-know=20Linux=20Commands=20sources/talk/20190430=20Must-know=20?= =?UTF-8?q?Linux=20Commands.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20190430 Must-know Linux Commands.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/talk/20190430 Must-know Linux Commands.md diff --git a/sources/talk/20190430 Must-know Linux Commands.md b/sources/talk/20190430 Must-know Linux Commands.md new file mode 100644 index 0000000000..6a70fc1ea9 --- /dev/null +++ b/sources/talk/20190430 Must-know Linux Commands.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Must-know Linux Commands) +[#]: via: (https://www.networkworld.com/article/3391029/must-know-linux-commands.html#tk.rss_all) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +Must-know Linux Commands +====== +A compilation of essential commands for searching, monitoring and securing Linux systems - plus the Linux Command Line Cheat Sheet. +It takes some time working with Linux commands before you know which one you need for the task at hand, how to format it and what result to expect, but it’s possible to speed up the process. + +With that in mind, we’ve gathered together some of the essential Linux commands as explained by Network World's [Unix as a Second Language][1] blogger Sandra Henry-Stocker to give aspiring power users what they need to get started with Linux systems. + +The breakdown starts with the rich options available for finding files on Linux – **find** , **locate** , **mlocate** , **which** , **whereis** , to name a few. Some overlap, but some are more efficient than others or zoom in on a narrow set of results. There’s even a command – **apropos** – to find the right command to do what you want to do. This section will demystify searches. + +Henry-Stocker's article on memory provides a wealth of options for discovering the availability of physical and virtual memory and ways to have that information updated at intervals to constantly measure whether there’s enough memory to go around. It shows how it’s possible to tailor your requests so you get a concise presentation of the results you seek. + +Two remaining articles in this package show how to monitor activity on Linux servers and how to set up security parameters on these systems. + +The first of these shows how to run the same command repetitively in order to have regular updates about any designated activity. It also tells about a command that focuses on user processes and shows changes as they occur, and a command that examines the time that users are connected. + +The final article is a deep dive into commands that help keep Linux systems secure. It describes 22 of them that are essential for day-to-day admin work. They can restrict privileges to keep individuals from having more capabilities than their jobs call for and report on who’s logged in, where from and how long they’ve been there. + +Some of these commands can track recent logins for individuals, which can be useful in running down who made changes. Others find files with varying characteristics, such as having no owner or by their contents. There are commands to control firewalls and to display routing tables. + +As a bonus, our bundle of commands includes **The Linux Command-Line Cheat Sheet,** a concise summary of important commands that are useful every single day. It’s suitable for printing out on two sides of a single sheet, laminating and keeping beside your keyboard. + +Enjoy! + +To continue reading this article register now + +[Get Free Access][2] + +[Learn More][3] Existing Users [Sign In][2] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391029/must-know-linux-commands.html#tk.rss_all + +作者:[Tim Greene][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/blog/unix-as-a-second-language/?nsdr=true +[2]: javascript:// +[3]: /learn-about-insider/ From 9142a4fad6cd196b0f320cea2392f507ac9a4a07 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:49:11 +0800 Subject: [PATCH 0306/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190430=20Meas?= =?UTF-8?q?uring=20the=20edge:=20Finding=20success=20with=20edge=20deploym?= =?UTF-8?q?ents=20sources/talk/20190430=20Measuring=20the=20edge-=20Findin?= =?UTF-8?q?g=20success=20with=20edge=20deployments.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...- Finding success with edge deployments.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md diff --git a/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md b/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md new file mode 100644 index 0000000000..abc1d7dd0c --- /dev/null +++ b/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Measuring the edge: Finding success with edge deployments) +[#]: via: (https://www.networkworld.com/article/3391570/measuring-the-edge-finding-success-with-edge-deployments.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +Measuring the edge: Finding success with edge deployments +====== +To make the most of edge computing investments, it’s important to first understand objectives and expectations. +![iStock][1] + +Edge computing deployments are well underway as companies seek to better process the wealth of data being generated, for example, by Internet of Things (IoT) devices. + +So, what are the results? Plus, how can you ensure success with your own edge projects? + +**Measurements of success** + +The [use cases for edge computing deployments][2] vary widely, as do the business drivers and, ultimately, the benefits. + +Whether they’re seeking improved network or application performance, real-time data analytics, a better customer experience, or other efficiencies, enterprises are accomplishing their goals. Based on two surveys — one by [_Automation World_][3] and another by [Futurum Research][4] — respondents have reported: + + * Decreased network downtime + * Increased productivity + * Increased profitability/reduced costs + * Improved business processes + + + +Basically, success metrics can be bucketed into two categories: direct value propositions and cost reductions. In the former, companies are seeking results that measure revenue generation — such as improved digital experiences with customers and users. In the latter, metrics that prove the value of digitizing processes — like speed, quality, and efficacy — will demonstrate success with edge deployments. + +**Goalposts for success with edge** + +Edge computing deployments are underway. But before diving in, understand what’s driving these projects. + +According to the Futurum Research, 29% of respondents are currently investing in edge infrastructure, and 62% expect to adopt within the year. For these companies, the driving force has been the business, which expects operational efficiencies from these investments. Beyond that, there’s an expectation down the road to better align with IoT strategy. + +That being the case, it’s worth considering your business case before diving into edge. Ask: Are you seeking innovation and revenue generation amid digital transformation efforts? Or is your company looking for a low-risk, “test the waters” type of investment in edge? + +Next up, what type of edge project makes sense for your environment? Edge data centers fall into three categories: local devices for a specific purpose (e.g., an appliance for security systems or a gateway for cloud-to-premises storage); small local data centers (typically one to 10 racks for storage and processing); and regional data centers (10+ racks for large office spaces). + +Then, think about these best practices before talking with vendors: + + * Management: Especially for unmanned edge data centers, remote management is critical. You’ll need predictive alerts and a service contract that enables IT to be just as resilient as a regular data center. + * Security:Much of today’s conversation has been around data security. That starts with physical protection. Too many data breaches — including theft and employee error — are caused by physical access to IT assets. + * Standardization: There is no need to reinvent the wheel when it comes to edge data center deployments. Using standard components makes it easier for the internal IT team to deploy, manage, and maintain. + + + +Finally, consider the ecosystem. The end-to-end nature of edge requires not just technology integration, but also that all third parties work well together. A good ecosystem connects customers, partners, and vendors. + +Get further information to kickstart your edge computing environment at [APC.com][5]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391570/measuring-the-edge-finding-success-with-edge-deployments.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-912928582-100795093-large.jpg +[2]: https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html +[3]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both +[4]: https://futurumresearch.com/edge-computing-from-edge-to-enterprise/ +[5]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp From 39c5dc7a3b153a4f31cd20e4a8d0a78e1737193e Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:49:31 +0800 Subject: [PATCH 0307/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=20How?= =?UTF-8?q?=20to=20shop=20for=20enterprise=20firewalls=20sources/talk/2019?= =?UTF-8?q?0429=20How=20to=20shop=20for=20enterprise=20firewalls.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...29 How to shop for enterprise firewalls.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/talk/20190429 How to shop for enterprise firewalls.md diff --git a/sources/talk/20190429 How to shop for enterprise firewalls.md b/sources/talk/20190429 How to shop for enterprise firewalls.md new file mode 100644 index 0000000000..f298b8b795 --- /dev/null +++ b/sources/talk/20190429 How to shop for enterprise firewalls.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to shop for enterprise firewalls) +[#]: via: (https://www.networkworld.com/article/3390686/how-to-shop-for-enterprise-firewalls.html#tk.rss_all) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +How to shop for enterprise firewalls +====== +Performance, form factors, and automation capabilities are key considerations when choosing a next-generation firewall (NGFW). +Firewalls have been around for years, but the technology keeps evolving as the threat landscape changes. Here are some tips about what to look for in a next-generation firewall ([NGFW][1]) that will satisfy business needs today and into the future. + +### Don't trust firewall performance stats + +Understanding how a NGFW performs requires more than looking at a vendor’s specification or running a bit of traffic through it. Most [firewalls][2] will perform well when traffic loads are light. It’s important to see how a firewall responds at scale, particularly when [encryption][3] is turned on. Roughly 80% of traffic is encrypted today, and the ability to maintain performance levels with high volumes of encrypted traffic is critical. + +**Learn more about network security** + + * [How to boost collaboration between network and security teams][4] + * [What is microsegmentation? How getting granular improves network security][5] + * [What to consider when deploying a next-generation firewall][1] + * [How firewalls fit into enterprise security][2] + + + +Also, be sure to turn on all major functions – including application and user identification, IPS, anti-malware, URL filtering and logging – during testing to see how a firewall will hold up in a production setting. Firewall vendors often tout a single performance number that's achieved with core features turned off. Data from [ZK Research][6] shows many IT pros learn this lesson the hard way: 58% of security professionals polled said they were forced to turn off features to maintain performance. + +Before committing to a vendor, be sure to run tests with as many different types of traffic as possible and with various types of applications. Important metrics to look at include application throughput, connections per second, maximum sessions for both IPv4 and [IPv6][7], and SSL performance. + +### NGFW needs to fit into broader security platform + +Is it better to have a best-of-breed strategy or go with a single vendor for security? The issue has been debated for years, but the fact is, neither approach works flawlessly. It’s important to understand that best-of-breed everywhere doesn’t ensure best-in-class security. In fact, the opposite is typically true; having too many vendors can lead to complexity that can't be managed, which puts a business at risk. A better approach is a security platform, which can be thought of as an open architecture, that third-party products can be plugged into. + +Any NGFW must be able to plug into a platform so it can "see" everything from IoT endpoints to cloud traffic to end-user devices. Also, once the NGFW has aggregated the data, it should be able to perform analytics to provide insights. This will enable the NGFW to take action and enforce policies across the network. + +### Multiple form factors, consistent security features + +Firewalls used to be relegated to corporate data centers. Today, networks have opened up, and customers need a consistent feature set at every point in the network. NGFW vendors should have the following form factors available to optimize price/performance: + + * Data center + * Internet edge + * Midsize branch office + * Small branch office + * Ruggedized for IoT environments + * Cloud delivered + * Virtual machines that can run in private and public clouds + + + +Also, NGFW vendors should have a roadmap for a containerized form factor. This certainly isn’t a trivial task. Most vendors won’t have a [container][8]-ready product yet, but they should be able to talk to how they plan to address the problem. + +### Single-pane-of-glass firewall management + +Having a broad product line doesn’t matter if products need to be managed individually. This makes it hard to keep policies and rules up to date and leads to inconsistencies in features and functions. A firewall vendor must have a single management tool that provides end-to-end visibility and enables the administrator to make a change and push it out across the network at once. Visibility must extend everywhere, including the cloud, [IoT][9] edge, operational technology (OT) environments, and branch offices. A single dashboard is also the right place to implement and maintain software-based segmentation instead of having to configure each device. + +### Firewall automation capabilities + +The goal of [automation][10] is to help remove many of the manual steps that create "human latency" in the security process. Almost all vendors tout some automation capabilities as a way of saving on headcount, but automation goes well beyond that. + +To continue reading this article register now + +[Get Free Access][11] + +[Learn More][12] Existing Users [Sign In][11] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390686/how-to-shop-for-enterprise-firewalls.html#tk.rss_all + +作者:[Zeus Kerravala][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3236448/what-to-consider-when-deploying-a-next-generation-firewall.html +[2]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[3]: https://www.networkworld.com/article/3098354/enterprise-encryption-adoption-up-but-the-devils-in-the-details.html +[4]: https://www.networkworld.com/article/3328218/how-to-boost-collaboration-between-network-and-security-teams.html +[5]: https://www.networkworld.com/article/3247672/what-is-microsegmentation-how-getting-granular-improves-network-security.html +[6]: https://zkresearch.com/ +[7]: https://www.networkworld.com/article/3254575/what-is-ipv6-and-why-aren-t-we-there-yet.html +[8]: https://www.networkworld.com/article/3159735/containers-what-are-containers.html +[9]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[10]: https://www.networkworld.com/article/3184389/automation-rolls-on-what-are-you-doing-about-it.html +[11]: javascript:// +[12]: /learn-about-insider/ From 98822bc4f79b91567f190f5a232f10e9eba061ce Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:49:47 +0800 Subject: [PATCH 0308/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=20Cisc?= =?UTF-8?q?o=20goes=20all=20in=20on=20WiFi=206=20sources/talk/20190429=20C?= =?UTF-8?q?isco=20goes=20all=20in=20on=20WiFi=206.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190429 Cisco goes all in on WiFi 6.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/talk/20190429 Cisco goes all in on WiFi 6.md diff --git a/sources/talk/20190429 Cisco goes all in on WiFi 6.md b/sources/talk/20190429 Cisco goes all in on WiFi 6.md new file mode 100644 index 0000000000..decd25500a --- /dev/null +++ b/sources/talk/20190429 Cisco goes all in on WiFi 6.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco goes all in on WiFi 6) +[#]: via: (https://www.networkworld.com/article/3391919/cisco-goes-all-in-on-wifi-6.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco goes all in on WiFi 6 +====== +Cisco rolls out Catalyst and Meraki WiFi 6-based access points, Catalyst 9000 switch +![undefined / Getty Images][1] + +Cisco has taken the wraps off a family of WiFi 6 access points, roaming technology and developer-community support all to make wireless a solid enterprise equal with the wired world. + +“Best-effort’ wireless for enterprise customers doesn’t cut it any more. There’s been a change in customer expectations that there will be an uninterrupted unplugged experience,” said Scott Harrell, senior vice president and general manager of enterprise networking at Cisco. **“ **It is now a wireless-first world.** ”** + +**More about 802.11ax (Wi-Fi 6)** + + * [Why 802.11ax is the next big thing in wireless][2] + * [FAQ: 802.11ax Wi-Fi][3] + * [Wi-Fi 6 (802.11ax) is coming to a router near you][4] + * [Wi-Fi 6 with OFDMA opens a world of new wireless possibilities][5] + * [802.11ax preview: Access points and routers that support Wi-Fi 6 are on tap][6] + + + +Bringing a wireless-first enterprise world together is one of the drivers behind a new family of WiFi 6-based access points (AP) for Cisco’s Catalyst and Meraki portfolios. WiFi 6 (802.11ax) is designed for high-density public or private environments. But it also will be beneficial in internet of things (IoT) deployments, and in offices that use bandwidth-hogging applications like videoconferencing. + +The Cisco Catalyst 9100 family and Meraki [MR 45/55][7] WiFi-6 access points are built on Cisco silicon and communicate via pre-802.1ax protocols. The silicon in these access points now acts a rich sensor providing IT with insights about what is going on the wireless network in real-time, and that enables faster reactions to problems and security concerns, Harrell said. + +Aside from WiFi 6, the boxes include support for visibility and communications with Zigbee, BLE and Thread protocols. The Catalyst APs support uplink speeds of 2.5 Gbps, in addition to 100 Mbps and 1 Gbps. All speeds are supported on Category 5e cabling for an industry first, as well as 10GBASE-T (IEEE 802.3bz) cabling, Cisco said. + +Wireless traffic aggregates to wired networks so and the wired network must also evolve. Technology like multi-gigabit Ethernet must be driven into the access layer, which in turn drives higher bandwidth needs at the aggregation and core layers, [Harrell said][8]. + +Handling this influx of wireless traffic was part of the reason Cisco also upgraded its iconic Catalyst 6000 with the [Catalyst 9600 this week][9]. The 9600 brings with it support for Cat 6000 features such as support for MPLS, virtual switching and IPv6, while adding or bolstering support for wireless netowrks as well as Intent-based networking (IBN) and security segmentation. The 9600 helps fill out the company’s revamped lineup which includes the 9200 family of access switches, the 9500 aggregation switch and 9800 wireless controller. + +“WiFi doesn’t exist in a vacuum – how it connects to the enterprise and the data center or the Internet is key and in Cisco’s case that key is now the 9600 which has been built to handle the increased traffic,” said Lee Doyle, principal analyst with Doyle Research. + +The new 9600 ties in with the recently [released Catalyst 9800][10], which features 40Gbps to 100Gbps performance, depending on the model, hot-patching to simplify updates and eliminate update-related downtime, Encrypted Traffic Analytics (ETA), policy-based micro- and macro-segmentation and Trustworthy solutions to detect malware on wired or wireless connected devices, Cisco said. + +All Catalyst 9000 family members support other Cisco products such as [DNA Center][11] , which controls automation capabilities, assurance setting, fabric provisioning and policy-based segmentation for enterprise wired and wireless networks. + +The new APs are pre-standard, but other vendors including Aruba, NetGear and others are also selling pre-standard 802.11ax devices. Cisco getting into the market solidifies the validity of this strategy, said Brandon Butler, a senior research analyst with IDC. + +Many experts [expect the standard][12] to be ratified late this year. + +“We expect to see volume shipments of WiFi 6 products by early next year and it being the de facto WiFi standard by 2022.” + +On top of the APs and 9600 switch, Cisco extended its software development community – [DevNet][13] – to offer WiFi 6 learning labs, sandboxes and developer resources. + +The Cisco Catalyst and Meraki access platforms are open and programmable all the way down to the chipset level, allowing applications to take advantage of network programmability, Cisco said. + +Cisco also said it had added more vendors to now include Apple, Samsung, Boingo, Presidio and Intel for its ongoing [OpenRoaming][14] project. OpenRoaming, which is in beta promises to let users move seamlessly between wireless networks and LTE without interruption. + +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/3391919/cisco-goes-all-in-on-wifi-6.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/cisco_catalyst_wifi_coffee-cup_coffee-beans_-100794990-large.jpg +[2]: https://www.networkworld.com/article/3215907/mobile-wireless/why-80211ax-is-the-next-big-thing-in-wi-fi.html +[3]: https://%20https//www.networkworld.com/article/3048196/mobile-wireless/faq-802-11ax-wi-fi.html +[4]: https://www.networkworld.com/article/3311921/mobile-wireless/wi-fi-6-is-coming-to-a-router-near-you.html +[5]: https://www.networkworld.com/article/3332018/wi-fi/wi-fi-6-with-ofdma-opens-a-world-of-new-wireless-possibilities.html +[6]: https://www.networkworld.com/article/3309439/mobile-wireless/80211ax-preview-access-points-and-routers-that-support-the-wi-fi-6-protocol-on-tap.html +[7]: https://meraki.cisco.com/lib/pdf/meraki_datasheet_MR55.pdf +[8]: https://blogs.cisco.com/news/unplugged-and-uninterrupted +[9]: https://www.networkworld.com/article/3391580/venerable-cisco-catalyst-6000-switches-ousted-by-new-catalyst-9600.html +[10]: https://www.networkworld.com/article/3321000/cisco-links-wireless-wired-worlds-with-new-catalyst-9000-switches.html +[11]: https://www.networkworld.com/article/3280988/cisco/cisco-opens-dna-center-network-control-and-management-software-to-the-devops-masses.html +[12]: https://www.networkworld.com/article/3336263/is-jumping-ahead-to-wi-fi-6-the-right-move.html +[13]: https://developer.cisco.com/wireless/?utm_campaign=colaunch-wireless19&utm_source=pressrelease&utm_medium=ciscopress-wireless-main +[14]: https://www.cisco.com/c/en/us/solutions/enterprise-networks/802-11ax-solution/openroaming.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world From 14058b4704518a70f887988ed6e43a782d4aa75e Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:50:07 +0800 Subject: [PATCH 0309/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190429=20Vene?= =?UTF-8?q?rable=20Cisco=20Catalyst=206000=20switches=20ousted=20by=20new?= =?UTF-8?q?=20Catalyst=209600=20sources/talk/20190429=20Venerable=20Cisco?= =?UTF-8?q?=20Catalyst=206000=20switches=20ousted=20by=20new=20Catalyst=20?= =?UTF-8?q?9600.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...00 switches ousted by new Catalyst 9600.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md diff --git a/sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md b/sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md new file mode 100644 index 0000000000..965d2a0e51 --- /dev/null +++ b/sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600) +[#]: via: (https://www.networkworld.com/article/3391580/venerable-cisco-catalyst-6000-switches-ousted-by-new-catalyst-9600.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600 +====== +Cisco introduced Catalyst 9600 switches, that let customers automate, set policy, provide security and gain assurance across wired and wireless networks. +![Martyn Williams][1] + +Few events in the tech industry are truly transformative, but Cisco’s replacement of its core Catalyst 6000 family could be one of those actions for customers and the company. + +Introduced in 1999, [iterations of the Catalyst 6000][2] have nestled into the core of scores of enterprise networks, with the model 6500 becoming the company’s largest selling box ever. + +**Learn about edge networking** + + * [How edge networking and IoT will reshape data centers][3] + * [Edge computing best practices][4] + * [How edge computing can help secure the IoT][5] + + + +It goes without question that migrating these customers alone to the new switch – the Catalyst 9600 which the company introduced today – will be of monumental importance to Cisco as it looks to revamp and continue to dominate large campus-core deployments. The first [Catalyst 9000][6], introduced in June 2017, is already the fastest ramping product line in Cisco’s history. + +“There are at least tens of thousands of Cat 6000s running in campus cores all over the world,” said [Sachin Gupta][7], senior vice president for product management at Cisco. ”It is the Swiss Army knife of switches in term of features, and we have taken great care and over two years developing feature parity and an easy migration path for those users to the Cat 9000.” + +Indeed the 9600 brings with it for Cat 6000 features such as support for MPLS, virtual switching and IPv6, while adding or bolstering support for newer items such as Intent-based networking (IBN), wireless networks and security segmentation. Strategically the 9600 helps fill out the company’s revamped lineup which includes the 9200 family of access switches, the [9500][8] aggregation switch and [9800 wireless controller.][9] + +Some of the nitty-gritty details about the 9600: + + * It is a purpose-built 40 Gigabit and 100 Gigabit Ethernet line of modular switches targeted for the enterprise campus with a wired switching capacity of up to 25.6 Tbps, with up to 6.4 Tbps of bandwidth per slot. + * The switch supports granular port densities that fit diverse campus needs, including nonblocking 40 Gigabit and 100 Gigabit Ethernet Quad Small Form-Factor Pluggable (QSFP+, QSFP28) and 1, 10, and 25 GE Small Form-Factor Pluggable Plus (SFP, SFP+, SFP28). + * It can be configured to support up to 48 nonblocking 100 Gigabit Ethernet QSPF28 ports with the Cisco Catalyst 9600 Series Supervisor Engine 1; Up to 96 nonblocking 40 Gigabit Ethernet QSFP+ ports with the Cisco Catalyst 9600 Series Supervisor Engine 1 and Up to 192 nonblocking 25 Gigabit/10 Gigabit Ethernet SFP28/SFP+ ports with the Cisco Catalyst 9600 Series Supervisor Engine 1. + * It supports advanced routing and infrastructure services (MPLS, Layer 2 and Layer 3 VPNs, Multicast VPN, and Network Address Translation. + * Cisco Software-Defined Access capabilities (such as a host-tracking database, cross-domain connectivity, and VPN Routing and Forwarding [VRF]-aware Locator/ID Separation Protocol; and network system virtualization with Cisco StackWise virtual technology. + + + +The 9600 series runs Cisco’s IOS XE software which now runs across all Catalyst 9000 family members. The software brings with it support for other key products such as Cisco’s [DNA Center][10] which controls automation capabilities, assurance setting, fabric provisioning and policy-based segmentation for enterprise networks. What that means is that with one user interface, DNA Center, customers can automate, set policy, provide security and gain assurance across the entire wired and wireless network fabric, Gupta said. + +“The 9600 is a big deal for Cisco and customers as it brings together the campus core and lets users establish standards access and usage policies across their wired and wireless environments,” said Brandon Butler, a senior research analyst with IDC. “It was important that Cisco add a powerful switch to handle the increasing amounts of traffic wireless and cloud applications are bringing to the network.” + +IOS XE brings with it automated device provisioning and a wide variety of automation features including support for the network configuration protocol NETCONF and RESTCONF using YANG data models. The software offers near-real-time monitoring of the network, leading to quick detection and rectification of failures, Cisco says. + +The software also supports hot patching which provides fixes for critical bugs and security vulnerabilities between regular maintenance releases. This support lets customers add patches without having to wait for the next maintenance release, Cisco says. + +As with the rest of the Catalyst family, the 9600 is available via subscription-based licensing. Cisco says the [base licensing package][11] includes Network Advantage licensing options that are tied to the hardware. The base licensing packages cover switching fundamentals, management automation, troubleshooting, and advanced switching features. These base licenses are perpetual. + +An add-on licensing package includes the Cisco DNA Premier and Cisco DNA Advantage options. The Cisco DNA add-on licenses are available as a subscription. + +IDC’S Butler noted that there are competitors such as Ruckus, Aruba and Extreme that offer switches capable of melding wired and wireless environments. + +The new switch is built for the next two decades of networking, Gupta said. “If any of our competitors though they could just go in and replace the Cat 6k they were misguided.” + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391580/venerable-cisco-catalyst-6000-switches-ousted-by-new-catalyst-9600.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/02/170227-mwc-02759-100710709-large.jpg +[2]: https://www.networkworld.com/article/2289826/133715-The-illustrious-history-of-Cisco-s-Catalyst-LAN-switches.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[5]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[6]: https://www.networkworld.com/article/3256264/cisco-ceo-we-are-still-only-on-the-front-end-of-a-new-version-of-the-network.html +[7]: https://blogs.cisco.com/enterprise/looking-forward-catalyst-9600-switch-and-9100-access-point-meraki +[8]: https://www.networkworld.com/article/3202105/cisco-brings-intent-based-networking-to-the-end-to-end-network.html +[9]: https://www.networkworld.com/article/3321000/cisco-links-wireless-wired-worlds-with-new-catalyst-9000-switches.html +[10]: https://www.networkworld.com/article/3280988/cisco/cisco-opens-dna-center-network-control-and-management-software-to-the-devops-masses.html +[11]: https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9600/software/release/16-11/release_notes/ol-16-11-9600.html#id_67835 +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From 4c9bb8eb9de69a6c53b35b542dd8400cb164142b Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:50:28 +0800 Subject: [PATCH 0310/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190425=20Dell?= =?UTF-8?q?=20EMC=20and=20Cisco=20renew=20converged=20infrastructure=20all?= =?UTF-8?q?iance=20sources/talk/20190425=20Dell=20EMC=20and=20Cisco=20rene?= =?UTF-8?q?w=20converged=20infrastructure=20alliance.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...renew converged infrastructure alliance.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md diff --git a/sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md b/sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md new file mode 100644 index 0000000000..8d3ad041db --- /dev/null +++ b/sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Dell EMC and Cisco renew converged infrastructure alliance) +[#]: via: (https://www.networkworld.com/article/3391071/dell-emc-and-cisco-renew-converged-infrastructure-alliance.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Dell EMC and Cisco renew converged infrastructure alliance +====== +Dell EMC and Cisco renewed their agreement to collaborate on converged infrastructure (CI) products for a few more years even though the momentum is elsewhere. +![Dell EMC][1] + +Dell EMC and Cisco have renewed a collaboration on converged infrastructure (CI) products that has run for more than a decade, even as the momentum shifts elsewhere. The news was announced via a [blog post][2] by Pete Manca, senior vice president for solutions engineering at Dell EMC. + +The deal is centered around Dell EMC’s VxBlock product line, which originally started out in 2009 as a joint venture between EMC and Cisco called VCE (Virtual Computing Environment). EMC bought out Cisco’s stake in the venture before Dell bought EMC. + +The devices offered UCS servers and networking from Cisco, EMC storage, and VMware virtualization software in pre-configured, integrated bundles. VCE was retired in favor of new brands, VxBlock, VxRail, and VxRack. The lineup has been pared down to one device, the VxBlock 1000. + +**[ Read also:[How to plan a software-defined data-center network][3] ]** + +“The newly inked agreement entails continued company alignment across multiple organizations: executive, product development, marketing, and sales,” Manca wrote in the blog post. “This means we’ll continue to share product roadmaps and collaborate on strategic development activities, with Cisco investing in a range of Dell EMC sales, marketing and training initiatives to support VxBlock 1000.” + +Dell EMC cites IDC research that it holds a 48% market share in converged systems, nearly 1.5 times that of any other vendor. But IDC's April edition of the Converged Systems Tracker said the CI category is on the downswing. CI sales fell 6.4% year over year, while the market for hyperconverged infrastructure (HCI) grew 57.2% year over year. + +For the unfamiliar, the primary difference between converged and hyperconverged infrastructure is that CI relies on hardware building blocks, while HCI is software-defined and considered more flexible and scalable than CI and operates more like a cloud system with resources spun up and down as needed. + +Despite this, Dell is committed to CI systems. Just last month it announced an update and expansion of the VxBlock 1000, including higher scalability, a broader choice of components, and the option to add new technologies. It featured updated VMware vRealize and vSphere support, the option to consolidate high-value, mission-critical workloads with new storage and data protection options and support for Cisco UCS fabric and servers. + +For customers who prefer to build their own infrastructure solutions, Dell EMC introduced Ready Stack, a portfolio of validated designs with sizing, design, and deployment resources that offer VMware-based IaaS, vSphere on Dell EMC PowerEdge servers and Dell EMC Unity storage, and Microsoft Hyper-V on Dell EMC PowerEdge servers and Dell EMC Unity storage. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391071/dell-emc-and-cisco-renew-converged-infrastructure-alliance.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/dell-emc-vxblock-1000-100794721-large.jpg +[2]: https://blog.dellemc.com/en-us/dell-technologies-cisco-reaffirm-joint-commitment-converged-infrastructure/ +[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 61dc46150d51ae020318749927120c9d1dc8a32e Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:50:59 +0800 Subject: [PATCH 0311/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190424=20IoT?= =?UTF-8?q?=20roundup:=20VMware,=20Nokia=20beef=20up=20their=20IoT=20sourc?= =?UTF-8?q?es/talk/20190424=20IoT=20roundup-=20VMware,=20Nokia=20beef=20up?= =?UTF-8?q?=20their=20IoT.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oundup- VMware, Nokia beef up their IoT.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md diff --git a/sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md b/sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md new file mode 100644 index 0000000000..90f4ebf5f1 --- /dev/null +++ b/sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IoT roundup: VMware, Nokia beef up their IoT) +[#]: via: (https://www.networkworld.com/article/3390682/iot-roundup-vmware-nokia-beef-up-their-iot.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +IoT roundup: VMware, Nokia beef up their IoT +====== +Everyone wants in on the ground floor of the internet of things, and companies including Nokia, VMware and Silicon Labs are sharpening their offerings in anticipation of further growth. +![Getty Images][1] + +When attempting to understand the world of IoT, it’s easy to get sidetracked by all the fascinating use cases: Automated oil and gas platforms! Connected pet feeders! Internet-enabled toilets! (Is “the Internet of Toilets” a thing yet?) But the most important IoT trend to follow may be the way that major tech vendors are vying to make large portions of the market their own. + +VMware’s play for a significant chunk of the IoT market is called Pulse IoT Center, and the company released version 2.0 of it this week. It follows the pattern set by other big companies getting into IoT: Leveraging their existing technological strengths and applying them to the messier, more heterodox networking environment that IoT represents. + +Unsurprisingly, given that it’s VMware we’re talking about, there’s now a SaaS option, and the company was also eager to talk up that Pulse IoT Center 2.0 has simplified device-onboarding and centralized management features. + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][2] + * [Edge computing best practices][3] + * [How edge computing can help secure the IoT][4] + + + +That might sound familiar, and for good reason – companies with any kind of a background in network management, from HPE/Aruba to Amazon, have been pushing to promote their system as the best framework for managing a complicated and often decentralized web of IoT devices from a single platform. By rolling features like software updates, onboarding and security into a single-pane-of-glass management console, those companies are hoping to be the organizational base for customers trying to implement IoT. + +Whether they’re successful or not remains to be seen. While major IT companies have been trying to capture market share by competing across multiple verticals, the operational orientation of the IoT also means that non-traditional tech vendors with expertise in particular fields (particularly industrial and automotive) are suddenly major competitors. + +**Nokia spreads the IoT network wide** + +As a giant carrier-equipment vendor, Nokia is an important company in the overall IoT landscape. While some types of enterprise-focused IoT are heavily localized, like connected factory floors or centrally managed office buildings, others are so geographically disparate that carrier networks are the only connectivity medium that makes sense. + +The Finnish company earlier this month broadened its footprint in the IoT space, announcing that it had partnered with Nordic Telecom to create a wide-area network focused on enabling IoT and emergency services. The network, which Nokia is billing as the first mission-critical communications network, operates using LTE technology in the 410-430MHz band – a relatively low frequency, which allows for better propagation and a wide effective range. + +The idea is to provide a high-throughput, low-latency network option to any user on the network, whether it’s an emergency services provider needing high-speed video communication or an energy or industrial company with a low-delay-tolerance application. + +**Silicon Labs packs more onto IoT chips** + +The heart of any IoT implementation remains the SoCs that make devices intelligent in the first place, and Silicon Labs announced that it's building more muscle into its IoT-focused product lineup. + +The Austin-based chipmaker said that version 2 of its Wireless Gecko platform will pack more than double the wireless connectivity range of previous entries, which could seriously ease design requirements for companies planning out IoT deployments. The chipsets support Zigbee, Thread and Bluetooth mesh networking, and are designed for line-powered IoT devices, using Arm Cortex-M33 processors for relatively strong computing capacity and high energy efficiency. + +Chipset advances aren’t the type of thing that will pay off immediately in terms of making IoT devices more capable, but improvements like these make designing IoT endpoints for particular uses that much easier, and new SoCs will begin to filter into line-of-business equipment over time. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390682/iot-roundup-vmware-nokia-beef-up-their-iot.html#tk.rss_all + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/08/nw_iot-news_internet-of-things_smart-city_smart-home5-100768494-large.jpg +[2]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[3]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[4]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 41e11b02b17ebb2b4dd661e1d5811625438a667f Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:51:23 +0800 Subject: [PATCH 0312/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190424=20Cisc?= =?UTF-8?q?o:=20DNSpionage=20attack=20adds=20new=20tools,=20morphs=20tacti?= =?UTF-8?q?cs=20sources/talk/20190424=20Cisco-=20DNSpionage=20attack=20add?= =?UTF-8?q?s=20new=20tools,=20morphs=20tactics.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e attack adds new tools, morphs tactics.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md diff --git a/sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md b/sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md new file mode 100644 index 0000000000..e202384558 --- /dev/null +++ b/sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco: DNSpionage attack adds new tools, morphs tactics) +[#]: via: (https://www.networkworld.com/article/3390666/cisco-dnspionage-attack-adds-new-tools-morphs-tactics.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco: DNSpionage attack adds new tools, morphs tactics +====== +Cisco's Talos security group says DNSpionage tools have been upgraded to be more stealthy +![Calvin Dexter / Getty Images][1] + +The group behind the Domain Name System attacks known as DNSpionage have upped their dark actions with new tools and malware to focus their attacks and better hide their activities. + +Cisco Talos security researchers, who discovered [DNSpionage][2] in November, this week warned of new exploits and capabilities of the nefarious campaign. + +**More about DNS:** + + * [DNS in the cloud: Why and why not][3] + * [DNS over HTTPS seeks to make internet use more private][4] + * [How to protect your infrastructure from DNS cache poisoning][5] + * [ICANN housecleaning revokes old DNS security key][6] + + + +“The threat actor's ongoing development of DNSpionage malware shows that the attacker continues to find new ways to avoid detection. DNS tunneling is a popular method of exfiltration for some actors and recent examples of DNSpionage show that we must ensure DNS is monitored as closely as an organization's normal proxy or weblogs,” [Talos wrote][7]. “DNS is essentially the phonebook of the internet, and when it is tampered with, it becomes difficult for anyone to discern whether what they are seeing online is legitimate.” + +In Talos’ initial report, researchers said a DNSpionage campaign targeted various businesses in the Middle East as well as United Arab Emirates government domains. It also utilized two malicious websites containing job postings that were used to compromise targets via crafted Microsoft Office documents with embedded macros. The malware supported HTTP and DNS communication with the attackers. + +In a separate DNSpionage campaign, the attackers used the same IP address to redirect the DNS of legitimate .gov and private company domains. During each DNS compromise, the actor carefully generated “Let's Encrypt” certificates for the redirected domains. These certificates provide X.509 certificates for [Transport Layer Security (TLS)][8] free of charge to the user, Talos said. + +This week Cisco said DNSpionage actors have created a new remote administrative tool that supports HTTP and DNS communication with the attackers' command and control (C2). + +“In our previous post concerning DNSpionage, we showed that the malware author used malicious macros embedded in a Microsoft Word document. In the new sample from Lebanon identified at the end of February, the attacker used an Excel document with a similar macro.” + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][9] ]** + +Talos wrote: “The malware supports HTTP and DNS communication to the C2 server. The HTTP communication is hidden in the comments in the HTML code. This time, however, the C2 server mimics the GitHub platform instead of Wikipedia. While the DNS communication follows the same method we described in our previous article, the developer added some new features in this latest version and, this time, the actor removed the debug mode.” + +Talos added that the domain used for the C2 campaign is “bizarre.” + +“The previous version of DNSpionage attempted to use legitimate-looking domains in an attempt to remain undetected. However, this newer version uses the domain ‘coldfart[.]com,’ which would be easier to spot than other APT campaigns which generally try to blend in with traffic more suitable to enterprise environments. The domain was also hosted in the U.S., which is unusual for any espionage-style attack.” + +Talos researchers said they discovered that DNSpionage added a reconnaissance phase, that ensures the payload is being dropped on specific targets rather than indiscriminately downloaded on every machine. + +This level of attack also returns information about the workstation environment, including platform-specific information, the name of the domain and the local computer, and information concerning the operating system, Talos wrote. This information is key to helping the malware select the victims only and attempts to avoid researchers or sandboxes. Again, it shows the actor's improved abilities, as they now fingerprint the victim. + +This new tactic indicates an improved level of sophistication and is likely in response to the significant amount of public interest in the campaign. + +Talos noted that there have been several other public reports of DNSpionage attacks, and in January, the U.S. Department of Homeland Security issued an [alert][10] warning users about this threat activity. + +“In addition to increased reports of threat activity, we have also discovered new evidence that the threat actors behind the DNSpionage campaign continue to change their tactics, likely in an attempt to improve the efficacy of their operations,” Talos stated. + +In April, Cisco Talos identified an undocumented malware developed in .NET. On the analyzed samples, the malware author left two different internal names in plain text: "DropperBackdoor" and "Karkoff." + +“The malware is lightweight compared to other malware due to its small size and allows remote code execution from the C2 server. There is no obfuscation and the code can be easily disassembled,” Talos wrote. + +The Karkoff malware searches for two specific anti-virus platforms: Avira and Avast and will work around them. + +“The discovery of Karkoff also shows the actor is pivoting and is increasingly attempting to avoid detection while remaining very focused on the Middle Eastern region,” Talos wrote. + +Talos distinguished DNSpionage from another DNS attack method, “[Sea Turtle][11]”, it detailed this month. Sea Turtle involves state-sponsored attackers that are abusing DNS to target organizations and harvest credentials to gain access to sensitive networks and systems in a way that victims are unable to detect. This displays unique knowledge about how to manipulate DNS, Talos stated. + +By obtaining control of victims’ DNS, attackers can change or falsify any data victims receive from the Internet, illicitly modify DNS name records to point users to actor-controlled servers and users visiting those sites would never know, Talos reported. + +“While this incident is limited to targeting primarily national security organizations in the Middle East and North Africa, and we do not want to overstate the consequences of this specific campaign, we are concerned that the success of this operation will lead to actors more broadly attacking the global DNS system,” Talos stated about Sea Turtle. + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390666/cisco-dnspionage-attack-adds-new-tools-morphs-tactics.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/cyber_attack_threat_danger_breach_hack_security_by_calvindexter_gettyimages-860363294_2400x800-100788395-large.jpg +[2]: https://blog.talosintelligence.com/2018/11/dnspionage-campaign-targets-middle-east.html +[3]: https://www.networkworld.com/article/3273891/hybrid-cloud/dns-in-the-cloud-why-and-why-not.html +[4]: https://www.networkworld.com/article/3322023/internet/dns-over-https-seeks-to-make-internet-use-more-private.html +[5]: https://www.networkworld.com/article/3298160/internet/how-to-protect-your-infrastructure-from-dns-cache-poisoning.html +[6]: https://www.networkworld.com/article/3331606/security/icann-housecleaning-revokes-old-dns-security-key.html +[7]: https://blog.talosintelligence.com/2019/04/dnspionage-brings-out-karkoff.html +[8]: https://www.networkworld.com/article/2303073/lan-wan-what-is-transport-layer-security-protocol.html +[9]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[10]: https://www.us-cert.gov/ncas/alerts/AA19-024A +[11]: https://www.networkworld.com/article/3389747/cisco-talos-details-exceptionally-dangerous-dns-hijacking-attack.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From 63281401451875e57b5ee4de5964bfe8a7ef7ac2 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:51:33 +0800 Subject: [PATCH 0313/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190424=20How?= =?UTF-8?q?=20data=20storage=20will=20shift=20to=20blockchain=20sources/ta?= =?UTF-8?q?lk/20190424=20How=20data=20storage=20will=20shift=20to=20blockc?= =?UTF-8?q?hain.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w data storage will shift to blockchain.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/talk/20190424 How data storage will shift to blockchain.md diff --git a/sources/talk/20190424 How data storage will shift to blockchain.md b/sources/talk/20190424 How data storage will shift to blockchain.md new file mode 100644 index 0000000000..b31653e0f7 --- /dev/null +++ b/sources/talk/20190424 How data storage will shift to blockchain.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How data storage will shift to blockchain) +[#]: via: (https://www.networkworld.com/article/3390722/how-data-storage-will-shift-to-blockchain.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +How data storage will shift to blockchain +====== +Move over cloud and traditional in-house enterprise data center storage, distributed storage based on blockchain may be arriving imminently. +![Cybrain / Getty Images][1] + +If you thought cloud storage was digging in its heels to become the go-to method for storing data, and at the same time grabbing share from own-server, in-house storage, you may be interested to hear that some think both are on the way out. Instead organizations will use blockchain-based storage. + +Decentralized blockchain-based file storage will be more secure, will make it harder to lose data, and will be cheaper than anything seen before, say organizations actively promoting the slant on encrypted, distributed technology. + +**[ Read also:[Why blockchain (might be) coming to an IoT implementation near you][2] ]** + +### Storing transactional data in a blockchain + +China company [FileStorm][3], which describes itself in marketing materials as the first [Interplanetary File Storage][4] (IPFS) platform on blockchain, says the key to making it all work is to only store the transactional data in blockchain. The actual data files, such as large video files, are distributed in IPFS. + +IPFS is a distributed, peer-to-peer file storage protocol. File parts come from multiple computers all at the same time, supposedly making the storage hardy. FileStorm adds blockchain on top of it for a form of transactional indexing. + +“Blockchain is designed to store transactions forever, and the data can never be altered, thus a trustworthy system is created,” says Raymond Fu, founder of FileStorm and chief product officer of MOAC, the underlying blockchain system used, in a video on the FileStorm website. + +“The blocks are used to store only small transactional data,” he says. You can’t store the large files on it. Those are distributed. Decentralized data storage platforms are needed for added decentralized blockchain, he says. + +YottaChain, another blockchain storage start-up project is coming at the whole thing from a slightly different angle. It claims its non-IPFS system is more secure partly because it performs deduplication after encryption. + +“Data is 10,000 times more secure than [traditional] centralized storage,” it says on its [website][5]. Deduplication eliminates duplicated or redundant data. + +### Disrupting data storage + +“Blockchain will disrupt data storage,” [says BlockApps separately][6]. The blockchain backend platform provider says advantages to this new generation of storage include that decentralizing data provides more security and privacy. That's due in part because it's harder to hack than traditional centralized storage. That the files are spread piecemeal among nodes, conceivably all over the world, makes it impossible for even the participating node to view the contents of the complete file, it says. + +Sharding, which is the term for the breaking apart and node-spreading of the actual data, is secured through keys. Markets can award token coins for mining, and coins can be spent to gain storage. Excess storage can even be sold. And cryptocurrencies have been started to “incentivize usage and to create a market for buying and selling decentralized storage,” BlockApps explains. + +The final parts of this new storage mix are that lost files are minimized because data can be duplicated simply — the data sets, for example, can be stored multiple times for error correction — and costs are reduced due to efficiencies. + +Square Tech (Shenzhen) Co., which makes blockchain file storage nodes, says in its marketing materials that it intends to build service centers globally to monitor its nodes in real time. Interestingly, another area the company has gotten involved in is the internet of things (IoT), and [it says][7] it wants “to unite the technical resources, capital, and human resources of the IoT industry and blockchain.” Perhaps we end up with a form of the internet of storage things? + +“The entire cloud computing industry will be disrupted by blockchain technology in just a few short years,” says BlockApps. Dropbox and Amazon “may even become overpriced and obsolete if they do not find ways to integrate with the advances.” + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390722/how-data-storage-will-shift-to-blockchain.html#tk.rss_all + +作者:[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.idgesg.net/images/article/2019/02/chains_binary_data_blockchain_security_by_cybrain_gettyimages-926677890_2400x1600-100788435-large.jpg +[2]: https://www.networkworld.com/article/3386881/why-blockchain-might-be-coming-to-an-iot-implementation-near-you.html +[3]: http://filestorm.net/ +[4]: https://ipfs.io/ +[5]: https://www.yottachain.io/ +[6]: https://blockapps.net/blockchain-disrupt-data-storage/ +[7]: http://www.sikuaikeji.com/ +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From ec4b063722659540f66f3cee2fe2c5dcb563518c Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:52:05 +0800 Subject: [PATCH 0314/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190424=20No,?= =?UTF-8?q?=20drone=20delivery=20still=20isn=E2=80=99t=20ready=20for=20pri?= =?UTF-8?q?me=20time=20sources/talk/20190424=20No,=20drone=20delivery=20st?= =?UTF-8?q?ill=20isn-t=20ready=20for=20prime=20time.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...livery still isn-t ready for prime time.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md diff --git a/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md b/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md new file mode 100644 index 0000000000..c948f458ce --- /dev/null +++ b/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (No, drone delivery still isn’t ready for prime time) +[#]: via: (https://www.networkworld.com/article/3390677/drone-delivery-not-ready-for-prime-time.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +No, drone delivery still isn’t ready for prime time +====== +Despite incremental progress and limited regulatory approval in the U.S. and Australia, drone delivery still isn’t a viable option in the vast majority of use cases. +![Sorry imKirk \(CC0\)][1] + +April has a been a big month for drone delivery. First, [Alphabet’s Wing Aviation drones got approval from Australia’s Civil Aviation Safety Authority (CASA)][2], for public deliveries in the country, and this week [Wing earned Air Carrier Certification from the U.S. Federal Aviation Administration][3]. These two regulatory wins got lot of people got very excited. Finally, the conventional wisdom exulted, drone delivery is actually becoming a reality. + +Not so fast. + +### Drone delivery still in pilot/testing mode + +Despite some small-scale successes and the first signs of regulatory acceptance, drone delivery remains firmly in the carefully controlled pilot/test phase (and yes, I know drones don’t carry pilots). + +**[ Also read:[Coffee drone delivery: Ideas this bad could kill the internet of things][4] ]** + +For example, despite getting FAA approval to begin commercial deliveries, Wing is still working up beginning delivery trials to test the technology and gather information in Virginia later this year. + +But what about that public approval from CASA for deliveries outside Canberra? That’s [a real business][5] now, right? + +Well, yes and no. + +On the “yes” side, the Aussie approval reportedly came after 18 months of tests, 70,000 flights, and more than 3,000 actual deliveries of products from local coffee shops and pharmacies. So, at least some people somewhere in the world are actually getting stuff dropped at their doors by drones. + +In the “no” column, however, goes the fact that the approval covers only about 100 suburban homes, though more are planned to be added “in the coming weeks and months.” More importantly, the approval includes strict limits on when and where the drones can go. No crossing main roads, no nighttime deliveries, and prohibitions to stay away from people. And drone-eligible customers need a safety briefing! + +### Safety briefings required for customers + +That still sounds like a small-scale test, not a full-scale commercial roll-out. And while I think drone-safety classes are probably a good idea – and the testing period apparently passed without any injuries – even the perceived _need_ for them is not be a great advertisement for rapid expansion of drone deliveries. + +Ironically, though, a bigger issue than protecting people from the drones, perhaps, is protecting the drones from people. Instructions to stay 2 to 5 meters away from folks will help, but as I’ve previously addressed, these things are already seen as attractive nuisances and vandalism targets. Further raising the stakes, many local residents were said to be annoyed at the noise created by the drones. Now imagine those contraptions buzzing right by you all loaded down with steaming hot coffee or delicious ice cream. + +And even with all those caveats, no one is talking about the key factors in making drone deliveries a viable business: How much will those deliveries cost and who will pay? For a while, the desire to explore the opportunity will drive investment, but that won’t last forever. If drone deliveries aren’t cost effective for businesses, they won’t spread very far. + +From the customer perspective, most drone delivery tests are not yet charging for the service. If and when they start carrying fees as well as purchases, the novelty factor will likely entice many shoppers to pony up to get their items airlifted directly to their homes. But that also won’t last. Drone delivery will have to demonstrate that it’s better — faster, cheaper, or more reliable — than the existing alternatives to find its niche. + +### Drone deliveries are fast, commercial roll-out will be slow + +Long term, I have no doubt that drone delivery will eventually become an accepted part of the transportation infrastructure. I don’t necessarily buy into Wing’s prediction of an AU $40 million drone delivery market in Australia coming to pass anytime soon, but real commercial operations seem inevitable. + +It’s just going to be more limited than many proponents claim, and it’s likely to take a lot longer than expected to become mainstream. For example, despite ongoing testing, [Amazon has already missed Jeff Bezos’ 2018 deadline to begin commercial drone deliveries][6], and we haven’t heard much about [Walmart’s drone delivery plans][7] lately. And while tests by a number of companies continue in locations ranging from Iceland and Finland to the U.K. and the U.S. have created a lot of interest, they have not yet translated into widespread availability. + +Apart from the issue of how much consumers really want their stuff delivered by an armada of drones (a [2016 U.S. Post Office study][8] found that 44% of respondents liked the idea, while 34% didn’t — and 37% worried that drone deliveries might not be safe), a lot has to happen before that vision becomes reality. + +At a minimum, successful implementations of full-scale commercial drone delivery will require better planning, better-thought-out business cases, more rugged and efficient drone technology, and significant advances in flight control and autonomous flight. Like drone deliveries themselves, all that stuff is coming; it just hasn’t arrived yet. + +**More about drones and the internet of things:** + + * [Drone defense -- powered by IoT -- is now a thing][9] + * [Ideas this bad could kill the Internet of Things][4] + * [10 reasons Amazon's drone delivery plan still won't fly][10] + * [Amazon’s successful drone delivery test doesn’t really prove anything][11] + + + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390677/drone-delivery-not-ready-for-prime-time.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/07/drone_mountains_by_sorry_imkirk_cc0_via_unsplash_1200x800-100763763-large.jpg +[2]: https://medium.com/wing-aviation/wing-launches-commercial-air-delivery-service-in-canberra-5da134312474 +[3]: https://medium.com/wing-aviation/wing-becomes-first-certified-air-carrier-for-drones-in-the-us-43401883f20b +[4]: https://www.networkworld.com/article/3301277/ideas-this-bad-could-kill-the-internet-of-things.html +[5]: https://wing.com/australia/canberra +[6]: https://www.businessinsider.com/jeff-bezos-predicted-amazon-would-be-making-drone-deliveries-by-2018-2018-12?r=US&IR=T +[7]: https://www.networkworld.com/article/2999828/walmart-delivery-drone-plans.html +[8]: https://www.uspsoig.gov/sites/default/files/document-library-files/2016/RARC_WP-17-001.pdf +[9]: https://www.networkworld.com/article/3309413/drone-defense-powered-by-iot-is-now-a-thing.html +[10]: https://www.networkworld.com/article/2900317/10-reasons-amazons-drone-delivery-plan-still-wont-fly.html +[11]: https://www.networkworld.com/article/3185478/amazons-successful-drone-delivery-test-doesnt-really-prove-anything.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From ddaf67dd4dde5d745de45ba94b6c404782606598 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:52:34 +0800 Subject: [PATCH 0315/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20Edge?= =?UTF-8?q?=20computing=20is=20in=20most=20industries=E2=80=99=20future=20?= =?UTF-8?q?sources/talk/20190423=20Edge=20computing=20is=20in=20most=20ind?= =?UTF-8?q?ustries-=20future.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...computing is in most industries- future.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/talk/20190423 Edge computing is in most industries- future.md diff --git a/sources/talk/20190423 Edge computing is in most industries- future.md b/sources/talk/20190423 Edge computing is in most industries- future.md new file mode 100644 index 0000000000..3683860bf2 --- /dev/null +++ b/sources/talk/20190423 Edge computing is in most industries- future.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Edge computing is in most industries’ future) +[#]: via: (https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +Edge computing is in most industries’ future +====== +Nearly every industry can take advantage of edge computing in the journey to speed digital transformation efforts +![iStock][1] + +The growth of edge computing is about to take a huge leap. Right now, companies are generating about 10% of their data outside a traditional data center or cloud. But within the next six years, that will increase to 75%, [according to Gartner][2]. + +That’s largely down to the need to process data emanating from devices, such as Internet of Things (IoT) sensors. Early adopters include: + + * **Manufacturers:** Devices and sensors seem endemic to this industry, so it’s no surprise to see the need to find faster processing methods for the data produced. A recent [_Automation World_][3] survey found that 43% of manufacturers have deployed edge projects. Most popular use cases have included production/manufacturing data analysis and equipment data analytics. + + * **Retailers** : Like most industries deeply affected by the need to digitize operations, retailers are being forced to innovate their customer experiences. To that end, these organizations are “investing aggressively in compute power located closer to the buyer,” [writes Dave Johnson][4], executive vice president of the IT division at Schneider Electric. He cites examples such as augmented-reality mirrors in fitting rooms that offer different clothing options without the consumer having to try on the items, and beacon-based heat maps that show in-store traffic. + + + + * **Healthcare organizations** : As healthcare costs continue to escalate, this industry is ripe for innovation that improves productivity and cost efficiencies. Management consulting firm [McKinsey & Co. has identified][5] at least 11 healthcare use cases that benefit patients, the facility, or both. Two examples: tracking mobile medical devices for nursing efficiency as well as optimization of equipment, and wearable devices that track user exercise and offer wellness advice. + + + +While these are strong use cases, as the edge computing market grows, so too will the number of industries adopting it. + +**Getting the edge on digital transformation** + +Faster processing at the edge fits perfectly into the objectives and goals of digital transformation — improving efficiencies, productivity, speed to market, and the customer experience. Here are just a few of the potential applications and industries that will be changed by edge computing: + +**Agriculture:** Farmers and organizations already use drones to transmit field and climate conditions to watering equipment. Other applications might include monitoring and location tracking of workers, livestock, and equipment to improve productivity, efficiencies, and costs. + +**Energy** : There are multiple potential applications in this sector that could benefit both consumers and providers. For example, smart meters help homeowners better manage energy use while reducing grid operators’ need for manual meter reading. Similarly, sensors on water pipes would detect leaks, while providing real-time consumption data. + +**Financial services** : Banks are adopting interactive ATMs that quickly process data to provide better customer experiences. At the organizational level, transactional data can be more quickly analyzed for fraudulent activity. + +**Logistics** : As consumers demand faster delivery of goods and services, logistics companies will need to transform mapping and routing capabilities to get real-time data, especially in terms of last-mile planning and tracking. That could involve street-, package-, and car-based sensors transmitting data for processing. + +All industries have the potential for transformation, thanks to edge computing. But it will depend on how they address their computing infrastructure. Discover how to overcome any IT obstacles at [APC.com][6]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-1019389496-100794424-large.jpg +[2]: https://www.gartner.com/smarterwithgartner/what-edge-computing-means-for-infrastructure-and-operations-leaders/ +[3]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both +[4]: https://blog.schneider-electric.com/datacenter/2018/07/10/why-brick-and-mortar-retail-quickly-establishing-leadership-edge-computing/ +[5]: https://www.mckinsey.com/industries/high-tech/our-insights/new-demand-new-markets-what-edge-computing-means-for-hardware-companies +[6]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp From b431126e3ea5bb97f4b320b332d07f7e93642738 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:52:43 +0800 Subject: [PATCH 0316/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20How?= =?UTF-8?q?=20to=20identify=20same-content=20files=20on=20Linux=20sources/?= =?UTF-8?q?tech/20190423=20How=20to=20identify=20same-content=20files=20on?= =?UTF-8?q?=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to identify same-content files on Linux.md | 260 ++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 sources/tech/20190423 How to identify same-content files on Linux.md diff --git a/sources/tech/20190423 How to identify same-content files on Linux.md b/sources/tech/20190423 How to identify same-content files on Linux.md new file mode 100644 index 0000000000..8d9b34b30a --- /dev/null +++ b/sources/tech/20190423 How to identify same-content files on Linux.md @@ -0,0 +1,260 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to identify same-content files on Linux) +[#]: via: (https://www.networkworld.com/article/3390204/how-to-identify-same-content-files-on-linux.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to identify same-content files on Linux +====== +Copies of files sometimes represent a big waste of disk space and can cause confusion if you want to make updates. Here are six commands to help you identify these files. +![Vinoth Chandar \(CC BY 2.0\)][1] + +In a recent post, we looked at [how to identify and locate files that are hard links][2] (i.e., that point to the same disk content and share inodes). In this post, we'll check out commands for finding files that have the same _content_ , but are not otherwise connected. + +Hard links are helpful because they allow files to exist in multiple places in the file system while not taking up any additional disk space. Copies of files, on the other hand, sometimes represent a big waste of disk space and run some risk of causing some confusion if you want to make updates. In this post, we're going to look at multiple ways to identify these files. + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][3] ]** + +### Comparing files with the diff command + +Probably the easiest way to compare two files is to use the **diff** command. The output will show you the differences between the two files. The < and > signs indicate whether the extra lines are in the first (<) or second (>) file provided as arguments. In this example, the extra lines are in backup.html. + +``` +$ diff index.html backup.html +2438a2439,2441 +>
+> That's all there is to report.
+> 
+``` + +If diff shows no output, that means the two files are the same. + +``` +$ diff home.html index.html +$ +``` + +The only drawbacks to diff are that it can only compare two files at a time, and you have to identify the files to compare. Some commands we will look at in this post can find the duplicate files for you. + +### Using checksums + +The **cksum** (checksum) command computes checksums for files. Checksums are a mathematical reduction of the contents to a lengthy number (like 2819078353 228029). While not absolutely unique, the chance that files that are not identical in content would result in the same checksum is extremely small. + +``` +$ cksum *.html +2819078353 228029 backup.html +4073570409 227985 home.html +4073570409 227985 index.html +``` + +In the example above, you can see how the second and third files yield the same checksum and can be assumed to be identical. + +### Using the find command + +While the find command doesn't have an option for finding duplicate files, it can be used to search files by name or type and run the cksum command. For example: + +``` +$ find . -name "*.html" -exec cksum {} \; +4073570409 227985 ./home.html +2819078353 228029 ./backup.html +4073570409 227985 ./index.html +``` + +### Using the fslint command + +The **fslint** command can be used to specifically find duplicate files. Note that we give it a starting location. The command can take quite some time to complete if it needs to run through a large number of files. Here's output from a very modest search. Note how it lists the duplicate files and also looks for other issues, such as empty directories and bad IDs. + +``` +$ fslint . +-----------------------------------file name lint +-------------------------------Invalid utf8 names +-----------------------------------file case lint +----------------------------------DUPlicate files <== +home.html +index.html +-----------------------------------Dangling links +--------------------redundant characters in links +------------------------------------suspect links +--------------------------------Empty Directories +./.gnupg +----------------------------------Temporary Files +----------------------duplicate/conflicting Names +------------------------------------------Bad ids +-------------------------Non Stripped executables +``` + +You may have to install **fslint** on your system. You will probably have to add it to your search path, as well: + +``` +$ export PATH=$PATH:/usr/share/fslint/fslint +``` + +### Using the rdfind command + +The **rdfind** command will also look for duplicate (same content) files. The name stands for "redundant data find," and the command is able to determine, based on file dates, which files are the originals — which is helpful if you choose to delete the duplicates, as it will remove the newer files. + +``` +$ rdfind ~ +Now scanning "/home/shark", found 12 files. +Now have 12 files in total. +Removed 1 files due to nonunique device and inode. +Total size is 699498 bytes or 683 KiB +Removed 9 files due to unique sizes from list.2 files left. +Now eliminating candidates based on first bytes:removed 0 files from list.2 files left. +Now eliminating candidates based on last bytes:removed 0 files from list.2 files left. +Now eliminating candidates based on sha1 checksum:removed 0 files from list.2 files left. +It seems like you have 2 files that are not unique +Totally, 223 KiB can be reduced. +Now making results file results.txt +``` + +You can also run this command in "dryrun" (i.e., only report the changes that might otherwise be made). + +``` +$ rdfind -dryrun true ~ +(DRYRUN MODE) Now scanning "/home/shark", found 12 files. +(DRYRUN MODE) Now have 12 files in total. +(DRYRUN MODE) Removed 1 files due to nonunique device and inode. +(DRYRUN MODE) Total size is 699352 bytes or 683 KiB +Removed 9 files due to unique sizes from list.2 files left. +(DRYRUN MODE) Now eliminating candidates based on first bytes:removed 0 files from list.2 files left. +(DRYRUN MODE) Now eliminating candidates based on last bytes:removed 0 files from list.2 files left. +(DRYRUN MODE) Now eliminating candidates based on sha1 checksum:removed 0 files from list.2 files left. +(DRYRUN MODE) It seems like you have 2 files that are not unique +(DRYRUN MODE) Totally, 223 KiB can be reduced. +(DRYRUN MODE) Now making results file results.txt +``` + +The rdfind command also provides options for things such as ignoring empty files (-ignoreempty) and following symbolic links (-followsymlinks). Check out the man page for explanations. + +``` +-ignoreempty ignore empty files +-minsize ignore files smaller than speficied size +-followsymlinks follow symbolic links +-removeidentinode remove files referring to identical inode +-checksum identify checksum type to be used +-deterministic determiness how to sort files +-makesymlinks turn duplicate files into symbolic links +-makehardlinks replace duplicate files with hard links +-makeresultsfile create a results file in the current directory +-outputname provide name for results file +-deleteduplicates delete/unlink duplicate files +-sleep set sleep time between reading files (milliseconds) +-n, -dryrun display what would have been done, but don't do it +``` + +Note that the rdfind command offers an option to delete duplicate files with the **-deleteduplicates true** setting. Hopefully the command's modest problem with grammar won't irritate you. ;-) + +``` +$ rdfind -deleteduplicates true . +... +Deleted 1 files. <== +``` + +You will likely have to install the rdfind command on your system. It's probably a good idea to experiment with it to get comfortable with how it works. + +### Using the fdupes command + +The **fdupes** command also makes it easy to identify duplicate files and provides a large number of useful options — like **-r** for recursion. In its simplest form, it groups duplicate files together like this: + +``` +$ fdupes ~ +/home/shs/UPGRADE +/home/shs/mytwin + +/home/shs/lp.txt +/home/shs/lp.man + +/home/shs/penguin.png +/home/shs/penguin0.png +/home/shs/hideme.png +``` + +Here's an example using recursion. Note that many of the duplicate files are important (users' .bashrc and .profile files) and should clearly not be deleted. + +``` +# fdupes -r /home +/home/shark/home.html +/home/shark/index.html + +/home/dory/.bashrc +/home/eel/.bashrc + +/home/nemo/.profile +/home/dory/.profile +/home/shark/.profile + +/home/nemo/tryme +/home/shs/tryme + +/home/shs/arrow.png +/home/shs/PNGs/arrow.png + +/home/shs/11/files_11.zip +/home/shs/ERIC/file_11.zip + +/home/shs/penguin0.jpg +/home/shs/PNGs/penguin.jpg +/home/shs/PNGs/penguin0.jpg + +/home/shs/Sandra_rotated.png +/home/shs/PNGs/Sandra_rotated.png +``` + +The fdupe command's many options are listed below. Use the **fdupes -h** command, or read the man page for more details. + +``` +-r --recurse recurse +-R --recurse: recurse through specified directories +-s --symlinks follow symlinked directories +-H --hardlinks treat hard links as duplicates +-n --noempty ignore empty files +-f --omitfirst omit the first file in each set of matches +-A --nohidden ignore hidden files +-1 --sameline list matches on a single line +-S --size show size of duplicate files +-m --summarize summarize duplicate files information +-q --quiet hide progress indicator +-d --delete prompt user for files to preserve +-N --noprompt when used with --delete, preserve the first file in set +-I --immediate delete duplicates as they are encountered +-p --permissions don't soncider files with different owner/group or + permission bits as duplicates +-o --order=WORD order files according to specification +-i --reverse reverse order while sorting +-v --version display fdupes version +-h --help displays help +``` + +The fdupes command is another one that you're like to have to install and work with for a while to become familiar with its many options. + +### Wrap-up + +Linux systems provide a good selection of tools for locating and potentially removing duplicate files, along with options for where you want to run your search and what you want to do with duplicate files when you find them. + +**[ Also see:[Invaluable tips and tricks for troubleshooting Linux][4] ]** + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390204/how-to-identify-same-content-files-on-linux.html#tk.rss_all + +作者:[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/04/chairs-100794266-large.jpg +[2]: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 9adb3c9b51f4beb6372b2e368c8bbeba926ad63a Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 5 May 2019 10:53:00 +0800 Subject: [PATCH 0317/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190423=20Open?= =?UTF-8?q?=20architecture=20and=20open=20source=20=E2=80=93=20The=20new?= =?UTF-8?q?=20wave=20for=20SD-WAN=3F=20sources/talk/20190423=20Open=20arch?= =?UTF-8?q?itecture=20and=20open=20source=20-=20The=20new=20wave=20for=20S?= =?UTF-8?q?D-WAN.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d open source - The new wave for SD-WAN.md | 186 ++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md diff --git a/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md b/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md new file mode 100644 index 0000000000..8be9e14ada --- /dev/null +++ b/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md @@ -0,0 +1,186 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open architecture and open source – The new wave for SD-WAN?) +[#]: via: (https://www.networkworld.com/article/3390151/open-architecture-and-open-source-the-new-wave-for-sd-wan.html#tk.rss_all) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Open architecture and open source – The new wave for SD-WAN? +====== +As networking continues to evolve, you certainly don't want to break out a forklift every time new technologies are introduced. Open architecture would allow you to replace the components of a system, and give you more flexibility to control your own networking destiny. +![opensource.com \(CC BY-SA 2.0\)][1] + +I recently shared my thoughts about the [role of open source in networking][2]. I discussed two significant technological changes that we have witnessed. I call them waves, and these waves will redefine how we think about networking and security. + +The first wave signifies that networking is moving to the software so that it can run on commodity off-the-shelf hardware. The second wave is the use of open source technologies, thereby removing the barriers to entry for new product innovation and rapid market access. This is especially supported in the SD-WAN market rush. + +Seemingly, we are beginning to see less investment in hardware unless there is a specific segment that needs to be resolved. But generally, software-based platforms are preferred as they bring many advantages. It is evident that there has been a technology shift. We have moved networking from hardware to software and this shift has positive effects for users, enterprises and service providers. + +**[ Don’t miss[customer reviews of top remote access tools][3] and see [the most powerful IoT companies][4] . | Get daily insights by [signing up for Network World newsletters][5]. ]** + +### Performance (hardware vs software) + +There has always been a misconception that the hardware-based platforms are faster due to the hardware acceleration that exists in the network interface controller (NIC). However, this is a mistaken belief. Nowadays, software platforms can reach similar performance levels as compared to hardware-based platforms. + +Initially, people viewed hardware as a performance-based vehicle but today this does not hold true anymore. Even the bigger vendors are switching to software-based platforms. We are beginning to see this almost everywhere in networking. + +### SD-WAN and open source + +SD-WAN really took off quite rapidly due to the availability of open source. It enabled the vendors to leverage all the available open source components and then create their solution on top. By and large, SD-WAN vendors used the open source as the foundation of their solution and then added additional proprietary code over the baseline. + +However, even when using various open source components, there is still a lot of work left for these vendors to make it to a complete SD-WAN solution, even for reaching a baseline of centrally managed routers with flexible network architecture control, not to talk about complete feature set of SD-WAN. + +The result of the work done by these vendors is still closed products so the fact they are using open source components in their products is merely a time-to-market advantage but not a big benefit to the end users (enterprises) or service providers launching hosted services with these products. They are still limited in flexibility and vendor diversity is only achieved through a multi-vendor strategy which in practice means launching multiple silo services each based on a different SD-WAN vendor without real selection of the technologies that make each of the SD-WAN services they launch. + +I recently came across a company called [Flexiwan][6], their goal is to fundamentally change this limitation of SD-WAN by offering a full open source solution that, as they say, “includes integration points in the core of the system that allow for 3rd party logic to be integrated in an efficient way.” They call this an open architecture, which, in practical terms, means a service provider or enterprise can integrate his own application logic into the core of the SD-WAN router…or select best of breed sub-technologies or applications instead of having these dictated by the vendor himself. I believe there is the possibility of another wave of SD-WAN with a fully open source and open architecture to SD-WAN. + +This type of architecture brings many benefits to users, enterprises and service providers, especially when compared to the typical lock-in of bigger vendors, such as Cisco and VMware. + +With an open source open architecture, it’s easier to control the versions and extend more flexibility by using the software offered by different providers. It offers the ability to switch providers, not to mention being easier to install and upgrade the versions. + +### SD-WAN, open source and open architecture + +An SD-WAN solution that is an open source with open architecture provides a modular and decomposed type of SD-WAN. This enables the selection of elements to provide a solution. + +For example, enterprises and service providers can select the best-of-breed technologies from independent vendors, such as deep packet inspection (DPI), security, wide area network (WAN) optimization, session border controller (SBC), VoIP and other traffic specific optimization logic. + +Some SD-WAN vendors define an open architecture in such a way that they just have a set of APIs, for example, northbound APIs, to enable one to build management or do service chaining. This is one approach to an open architecture but in fact, it’s pretty limited since it does not bring the full benefits that an open architecture should offer. + +### Open source and the fear of hacking + +However, when I think about an open source and open architecture for SD-WAN, the first thing that comes to mind is bad actors. What about the code? If it’s an open source, the bad actor can find vulnerabilities, right? + +The community is a powerful force and will fix any vulnerability. Also with open source, the vendor, who is the one responsible for the open source component will fix the vulnerability much faster than a closed solution, where you are unaware of the vulnerability until a fix is released. + +### The SD-WAN evolution + +Before we go any further, let’s examine the history of SD-WAN and its origins, how we used to connect from the wide area network (WAN) to other branches via private or public links. + +SD-WAN offers the ability to connect your organization to a WAN. This could be connecting to the Internet or other branches, to optimally deliver applications with a good user-experience. Essentially, SD-WAN allows the organizations to design the architecture of their network dynamically by means of software. + +### In the beginning, there was IPSec + +It started with IPSec. Around two decades back, in 1995, the popular design was that of mesh architecture. As a result, we had a lot of point-to-point connections. Firstly, mesh architectures with IPSec VPNs are tiresome to manage as there is a potential for 100s of virtual private network (VPN) configurations. + +Authentically, IPSec started with two fundamental goals. The first was the tunneling protocol that would allow organizations to connect the users or other networks to their private network. This enabled the enterprises to connect to networks that they did not have a direct route to. + +The second goal of IPSec was to encrypt packets at the network layer and therefore securing the data in motion. Let’s face it: at that time, IPSec was terrible for complicated multi-site interconnectivity and high availability designs. If left to its defaults, IPSec is best suited for static designs. + +This was the reason why we had to step in the next era where additional functionality was added to IPSec. For example, IPSec had issues in supporting routing protocols using multicast. To overcome this, IPSec over generic routing encapsulation (GRE) was introduced. + +### The next era of SD-WAN + +During the journey to 2008, one could argue that the next era of WAN connectivity was when additional features were added to IPSec. At this time IPSec became known as a “Swiss army knife.” It could do many things but not anything really well. + +Back then, you could create multiple links, but it failed to select the traffic over these links other than by using simple routing. You needed to add a routing protocol. For advanced agile architectures, IPSec had to be incorporated with other higher-level protocols. + +Features were then added based on measuring the quality. Link quality features were added to analyze any delay, drops and to select alternative links for your applications. We began to add tunnels, multi-links and to select the traffic based on the priority, not just based on the routing. + +The most common way to the tunnel was to have IPSec over GRE. You have the GRE tunnel that enables you to send any protocol end-to-end by using IPSec for the encryption. All this functionality was added to achieve and create dynamic tunnels over IPSec and to optimize the IPSec tunnels. + +This was a move in the right direction, but it was still complex. It was not centrally managed and was error-prone with complex configurations that were unable to manage large deployments. IPSec had far too many limitations, so in the mid-2000s early SD-WAN vendors started cropping up. Some of these vendors enabled the enterprises to aggregate many separate digital subscriber lines (DSL) links into one faster logical link. At the same time, others added time stamps and/or sequence numbers to packets to improve the network performance and security when running over best effort (internet) links. + +International WAN connectivity was a popular focus since the cost delta between the Internet and private multiprotocol label switching (MPLS) was 10x+ different. Primarily, enterprises wanted the network performance and security of MPLS without having to pay a premium for it. + +Most of these solutions sat in-front or behind a traditional router from companies like Cisco. Evidently, just like WAN Optimization vendors, these were additional boxes/solutions that enterprises added to their networks. + +### The next era of SD-WAN, circa 2012 + +It was somewhere in 2012 that we started to see the big rush to the SD-WAN market. Vendors such as Velocloud, Viptela and a lot of the other big players in the SD-WAN market kicked off with the objective of claiming some of the early SD-WAN success and going after the edge router market with a full feature router replacement and management simplicity. + +Open source networking software and other open source components for managing the traffic enabled these early SD-WAN vendors to lay a foundation where a lot of the code base was open source. They would then “glue” it together and add their own additional features. + +Around this time, Intel was driving data plane development kit (DPDK) and advanced encryption standard (AES) instruction set, which enabled that software to run on commodity hardware. The SD-WAN solutions were delivered as closed solutions where each solution used its own set of features. The features and technologies chosen for each vendor were different and not compatible with each other. + +### The recent era of SD-WAN, circa 2017 + +A tipping point in 2017 was the gold rush for SD-WAN deployments. Everyone wanted to have SD-WAN as fast as possible. + +The SD-WAN market has taken off, as seen by 50 vendors with competing, proprietary solutions and market growth curves with a CAGR of 100%. There is a trend of big vendors like Cisco, Vmware and Oracle acquiring startups to compete in this new market. + +As a result, Cisco, which is the traditional enterprise market leader in WAN routing solutions felt threatened since its IWAN solution, which had been around since 2008, was too complex (a 900-page configuration and operations manual). Besides, its simple solution based on the Meraki acquisition was not feature-rich enough for the large enterprises. + +With their acquisition of Viptela, Cisco currently has a 13% of the market share, and for the first time in decades, it is not the market leader. The large cloud vendors, such as Google and Facebook are utilizing their own technology for routing within their very large private networks. + +At some point between 2012 and 2017, we witnessed the service providers adopting SD-WAN. This introduced the onset and movement of managed SD-WAN services. As a result, the service providers wanted to have SD-WAN on the menu for their customers. But there were many limitations in the SD-WAN market, as it was offered as a closed-box solution, giving the service providers limited control. + +At this point surfaced an expectation of change, as service providers and enterprises looked for more control. Customers can get better functionality from a multi-vendor approach than from a single vendor. + +### Don’t forget DIY SD-WAN + +Up to 60% of service providers and enterprises within the USA are now looking at DIY SD-WAN. A DIY SD-WAN solution is not where the many pieces of open source are taken and caste into something. The utmost focus is on the solution that can be self-managed but buy from a vendor. + +Today, the majority of the market is looking for managed solutions and the upper section that has the expertise wants to be equipped with more control options. + +### SD-WAN vendors attempting everything + +There is a trend that some vendors try to do everything with SD-WAN. As a result, whether you are an enterprise or a service provider, you are locked into a solution that is dictated by the SD-WAN vendor. + +The SD-WAN vendors have made the supplier choice or developed what they think is relevant. Evidently, some vendors are using stacks and software development kits (SDKs) that they purchased, for example, for deep packet inspection (DPI). + +Ultimately, you are locked into a specific solution that the vendor has chosen for you. If you are a service provider, you might disapprove of this limitation and if you are an enterprise with specific expertise, you might want to zoom in for more control. + +### All-in-one security vendors + +Many SD-WAN vendors promote themselves as security companies. But would you prefer to buy a security solution from an SD-WAN vendor or from an experienced vendor, such as Checkpoint? + +Both: enterprise and service providers want to have a choice, but with an integrated black box security solution, you don't have a choice. The more you integrate and throw into the same box, the stronger the vendor lock-in is and the weaker the flexibility. + +Essentially, with this approach, you are going for the lowest common denominator instead of the highest. Ideally, the technology of the services that you deploy on your network requires expertise. One vendor cannot be an expert in everything. + +An open architecture lies in a place for experts in different areas to join together and add their own specialist functionality. + +### Encrypted traffic + +As a matter of fact, what is not encrypted today will be encrypted tomorrow. The vendor of the application can perform intelligent things that the SD-WAN vendor cannot because they control both sides. Hence, if you can put something inside the SD-WAN edge device, they can make smart decisions even if the traffic is encrypted. + +But in the case of traditional SD-WANs, there needs to be a corporation with a content provider. However, with an open architecture, you can integrate anything, and nothing prevents the integration. A lot of traffic is encrypted and it's harder to manage encrypted traffic. However, an open architecture would allow the content providers to manage the traffic more effectively. + +### 2019 and beyond: what is an open architecture? + +Cloud providers and enterprises have discovered that 90% of the user experience and security problems arise due to the network: between where the cloud provider resides and where the end-user consumes the application. + +Therefore, both cloud providers and large enterprise with digital strategies are focusing on building their solutions based on open source stacks. Having a viable open source SD-WAN solution is the next step in the SD-WAN evolution, where it moves to involve the community in the solution. This is similar to what happens with containers and tools. + +Now, since we’re in 2019, are we going to witness a new era of SD-WAN? Are we moving to the open architecture with an open source SD-WAN solution? An open architecture should be the core of the SD-WAN infrastructure, where additional technologies are integrated inside the SD-WAN solution and not only complementary VNFs. There is an interface and native APIs that allow you to integrate logic into the router. This way, the router will be able to intercept and act according to the traffic. + +So, if I’m a service provider and have my own application, I would want to write logic that would be able to communicate with my application. Without an open architecture, the service providers can’t really offer differentiation and change the way SD-WAN makes decisions and interacts with the traffic of their applications. + +There is a list of various technologies that you need to be an expert in to be able to integrate. And each one of these technologies can be a company, for example, DPI, VoIP optimization, and network monitoring to name a few. An open architecture will allow you to pick and choose these various elements as per your requirements. + +Networking is going through a lot of changes and it will continue to evolve with the passage of time. As a result, you wouldn’t want something that forces you to break out a forklift each time new technologies are introduced. Primarily, open architecture allows you to replace the components of the system and add code or elements that handle specific traffic and applications. + +### Open source + +Open source gives you more flexibility to control your own destiny. It offers the ability to select your own services that you want to be applied to your system. It provides security in the sense that if something happens to the vendor or there is a vulnerability in the system, you know that you are backed by the community that can fix such misadventures. + +From the perspective of the business model, it makes a more flexible and cost-effective system. Besides, with open source, the total cost of ownership will also be lower. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][7]** + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390151/open-architecture-and-open-source-the-new-wave-for-sd-wan.html#tk.rss_all + +作者:[Matt Conran][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/Matt-Conran/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/03/6554314981_7f95641814_o-100714680-large.jpg +[2]: https://www.networkworld.com/article/3338143/the-role-of-open-source-in-networking.html +[3]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb +[4]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html#nww-fsb +[5]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[6]: https://flexiwan.com/sd-wan-open-source/ +[7]: /contributor-network/signup.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From 6d760d447a8a706d346d9389728967215b964a99 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 11:50:18 +0800 Subject: [PATCH 0318/1154] PRF:20161106 Myths about -dev-urandom.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Moelf 这篇翻译的很好,辛苦了。 --- .../tech/20161106 Myths about -dev-urandom.md | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/translated/tech/20161106 Myths about -dev-urandom.md b/translated/tech/20161106 Myths about -dev-urandom.md index dca61fea30..028704f2d2 100644 --- a/translated/tech/20161106 Myths about -dev-urandom.md +++ b/translated/tech/20161106 Myths about -dev-urandom.md @@ -11,33 +11,33 @@ **`/dev/urandom` 是伪随机数生成器pseudo random number generator(PRND),而 `/dev/random` 是“真”随机数生成器。** -事实:它们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。它们之间细微的差别和“真”“不真”随机完全无关。 +*事实*:它们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。它们之间细微的差别和“真”“不真”随机完全无关。(参见:“Linux 随机数生成器的构架”一节) **`/dev/random` 在任何情况下都是密码学应用更好地选择。即便 `/dev/urandom` 也同样安全,我们还是不应该用它。** -*事实*:`/dev/random` 有个很恶心人的问题:它是阻塞的。(LCTT 译注:意味着请求都得逐个执行,等待前一个请求完成) +*事实*:`/dev/random` 有个很恶心人的问题:它是阻塞的。(参见:“阻塞有什么问题?”一节)(LCTT 译注:意味着请求都得逐个执行,等待前一个请求完成) **但阻塞不是好事吗!`/dev/random` 只会给出电脑收集的信息熵足以支持的随机量。`/dev/urandom` 在用完了所有熵的情况下还会不断吐出不安全的随机数给你。** -*事实*:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 位的熵就足以生成计算上安全的随机数很长、很长的一段时间了。 +*事实*:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 位的熵就足以生成计算上安全的随机数很长、很长的一段时间了。(参见:“那熵池快空了的情况呢?”一节) 问题的关键还在后头:`/dev/random` 怎么知道有系统会*多少*可用的信息熵?接着看! **但密码学家老是讨论重新选种子(re-seeding)。这难道不和上一条冲突吗?** -*事实*:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。 +*事实*:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。(参见:“重新选种”一节) 这样说吧,我没有说引入新的信息熵是坏的。更多的熵肯定更好。我只是说在熵池低的时候阻塞是没必要的。 **好,就算你说的都对,但是 `/dev/(u)random` 的 man 页面和你说的也不一样啊!到底有没有专家同意你说的这堆啊?** -*事实*:其实 man 页面和我说的不冲突。它看似好像在说 `/dev/urandom` 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道它说的并不是这个意思。 +*事实*:其实 man 页面和我说的不冲突。它看似好像在说 `/dev/urandom` 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道它说的并不是这个意思。(参见:“random 和 urandom 的 man 页面”一节) man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也没问题,但绝对不是说必要的),但它也推荐在大多数“一般”的密码学应用下使用 `/dev/urandom` 。 虽然诉诸权威一般来说不是好事,但在密码学这么严肃的事情上,和专家统一意见是很有必要的。 -所以说呢,还确实有一些*专家*和我的一件事一致的:`/dev/urandom` 就应该是类 UNIX 操作系统下密码学应用的首选。显然的,是他们的观点说服了我而不是反过来的。 +所以说呢,还确实有一些*专家*和我的一件事一致的:`/dev/urandom` 就应该是类 UNIX 操作系统下密码学应用的首选。显然的,是他们的观点说服了我而不是反过来的。(参见:“正道”一节) ------ @@ -45,9 +45,9 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 我尝试不讲太高深的东西,但是有两点内容必须先提一下才能让我们接着论证观点。 -首当其冲的,*什么是随机性*,或者更准确地:我们在探讨什么样的随机性? +首当其冲的,*什么是随机性*,或者更准确地:我们在探讨什么样的随机性?(参见:“真随机”一节) -另外一点很重要的是,我*没有尝试以说教的态度*对你们写这段话。我写这篇文章是为了日后可以在讨论起的时候指给别人看。比 140 字长(LCTT 译注:推特长度)。这样我就不用一遍遍重复我的观点了。能把论点磨炼成一篇文章本身就很有助于将来的讨论。 +另外一点很重要的是,我*没有尝试以说教的态度*对你们写这段话。我写这篇文章是为了日后可以在讨论起的时候指给别人看。比 140 字长(LCTT 译注:推特长度)。这样我就不用一遍遍重复我的观点了。能把论点磨炼成一篇文章本身就很有助于将来的讨论。(参见:“你是在说我笨?!”一节) 并且我非常乐意听到不一样的观点。但我只是认为单单地说 `/dev/urandom` 坏是不够的。你得能指出到底有什么问题,并且剖析它们。 @@ -55,7 +55,7 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 绝对没有! -事实上我自己也相信了 “`/dev/urandom` 是不安全的” 好些年。这几乎不是我们的错,因为那么德高望重的人在 Usenet、论坛、推特上跟我们重复这个观点。甚至*连 man 手册*都似是而非地说着。我们当年怎么可能鄙视诸如“信息熵太低了”这种看上去就很让人信服的观点呢? +事实上我自己也相信了 “`/dev/urandom` 是不安全的” 好些年。这几乎不是我们的错,因为那么德高望重的人在 Usenet、论坛、推特上跟我们重复这个观点。甚至*连 man 手册*都似是而非地说着。我们当年怎么可能鄙视诸如“信息熵太低了”这种看上去就很让人信服的观点呢?(参见:“random 和 urandom 的 man 页面”一节) 整个流言之所以如此广为流传不是因为人们太蠢,而是因为但凡有点关于信息熵和密码学概念的人都会觉得这个说法很有道理。直觉似乎都在告诉我们这流言讲的很有道理。很不幸直觉在密码学里通常不管用,这次也一样。 @@ -123,25 +123,25 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 ![image: actual structure of the kernel's random number generator before Linux 4.8][2] -> 这是个很粗糙的简化。实际上不仅有一个,而是三个熵池。一个主池,另一个给 `/dev/random`,还有一个给 `/dev/urandom`,后两者依靠从主池里获取熵。这三个池都有各自的熵计数器,但二级池(后两个)的计数器基本都在 0 附近,而“新鲜”的熵总在需要的时候从主池流过来。同时还有好多混合和回流进系统在同时进行。整个过程对于这篇文档来说都过于复杂了我们跳过。 - -你看到最大的区别了吗?CSPRNG 并不是和随机数生成器一起跑的,以 `/dev/urandom` 需要输出但熵不够的时候进行填充。CSPRNG 是整个随机数生成过程的内部组件之一。从来就没有什么 `/dev/random` 直接从池里输出纯纯的随机性。每个随机源的输入都在 CSPRNG 里充分混合和散列过了,这一切都发生在实际变成一个随机数,被 `/dev/urandom` 或者 `/dev/random` 吐出去之前。 +你看到最大的区别了吗?CSPRNG 并不是和随机数生成器一起跑的,它在 `/dev/urandom` 需要输出但熵不够的时候进行填充。CSPRNG 是整个随机数生成过程的内部组件之一。从来就没有什么 `/dev/random` 直接从池里输出纯纯的随机性。每个随机源的输入都在 CSPRNG 里充分混合和散列过了,这一切都发生在实际变成一个随机数,被 `/dev/urandom` 或者 `/dev/random` 吐出去之前。 另外一个重要的区别是这里没有熵计数器的任何事情,只有预估。一个源给你的熵的量并不是什么很明确能直接得到的数字。你得预估它。注意,如果你太乐观地预估了它,那 `/dev/random` 最重要的特性——只给出熵允许的随机量——就荡然无存了。很不幸的,预估熵的量是很困难的。 -Linux 内核只使用事件的到达时间来预估熵的量。它通过多项式插值,某种模型,来预估实际的到达时间有多“出乎意料”。这种多项式插值的方法到底是不是好的预估熵量的方法本身就是个问题。同时硬件情况会不会以某种特定的方式影响到达时间也是个问题。而所有硬件的取样率也是个问题,因为这基本上就直接决定了随机数到达时间的颗粒度。 +> 这是个很粗糙的简化。实际上不仅有一个,而是三个熵池。一个主池,另一个给 `/dev/random`,还有一个给 `/dev/urandom`,后两者依靠从主池里获取熵。这三个池都有各自的熵计数器,但二级池(后两个)的计数器基本都在 0 附近,而“新鲜”的熵总在需要的时候从主池流过来。同时还有好多混合和回流进系统在同时进行。整个过程对于这篇文档来说都过于复杂了,我们跳过。 + +Linux 内核只使用事件的到达时间来预估熵的量。根据模型,它通过多项式插值来预估实际的到达时间有多“出乎意料”。这种多项式插值的方法到底是不是好的预估熵量的方法本身就是个问题。同时硬件情况会不会以某种特定的方式影响到达时间也是个问题。而所有硬件的取样率也是个问题,因为这基本上就直接决定了随机数到达时间的颗粒度。 说到最后,至少现在看来,内核的熵预估还是不错的。这也意味着它比较保守。有些人会具体地讨论它有多好,这都超出我的脑容量了。就算这样,如果你坚持不想在没有足够多的熵的情况下吐出随机数,那你看到这里可能还会有一丝紧张。我睡的就很香了,因为我不关心熵预估什么的。 -最后强调一下终点:`/dev/random` 和 `/dev/urandom` 都是被同一个 CSPRNG 喂的输入。只有它们在用完各自熵池(根据某种预估标准)的时候,它们的行为会不同:`/dev/random` 阻塞,`/dev/urandom` 不阻塞。 +最后要明确一下:`/dev/random` 和 `/dev/urandom` 都是被同一个 CSPRNG 饲喂的。只有它们在用完各自熵池(根据某种预估标准)的时候,它们的行为会不同:`/dev/random` 阻塞,`/dev/urandom` 不阻塞。 ##### Linux 4.8 以后 -在 Linux 4.8 里,`/dev/random` 和 `/dev/urandom` 的等价性被放弃了。现在 `/dev/urandom` 的输出不来自于熵池,而是直接从 CSPRNG 来。 - ![image: actual structure of the kernel's random number generator from Linux 4.8 onward][3] -*我们很快会理解*为什么这不是一个安全问题。 +在 Linux 4.8 里,`/dev/random` 和 `/dev/urandom` 的等价性被放弃了。现在 `/dev/urandom` 的输出不来自于熵池,而是直接从 CSPRNG 来。 + +*我们很快会理解*为什么这不是一个安全问题。(参见:“CSPRNG 没问题”一节) ### 阻塞有什么问题? @@ -149,7 +149,7 @@ Linux 内核只使用事件的到达时间来预估熵的量。它通过多项 这些都是问题。阻塞本质上会降低可用性。换而言之你的系统不干你让它干的事情。不用我说,这是不好的。要是它不干活你干嘛搭建它呢? -> 我在工厂自动化里做过和安全相关的系统。猜猜看安全系统失效的主要原因是什么?被错误操作。就这么简单。很多安全措施的流程让工人恼火了。比如时间太长,或者太不方便。你要知道人很会找捷径来“解决”问题。 +> 我在工厂自动化里做过和安全相关的系统。猜猜看安全系统失效的主要原因是什么?操作问题。就这么简单。很多安全措施的流程让工人恼火了。比如时间太长,或者太不方便。你要知道人很会找捷径来“解决”问题。 但其实有个更深刻的问题:人们不喜欢被打断。它们会找一些绕过的方法,把一些诡异的东西接在一起仅仅因为这样能用。一般人根本不知道什么密码学什么乱七八糟的,至少正常的人是这样吧。 @@ -157,23 +157,23 @@ Linux 内核只使用事件的到达时间来预估熵的量。它通过多项 到头来如果东西太难用的话,你的用户就会被迫开始做一些降低系统安全性的事情——你甚至不知道它们会做些什么。 -我们很容易会忽视可用性之类的重要性。毕竟安全第一对吧?所以比起牺牲安全,不可用,难用,不方便都是次要的? +我们很容易会忽视可用性之类的重要性。毕竟安全第一对吧?所以比起牺牲安全,不可用、难用、不方便都是次要的? 这种二元对立的想法是错的。阻塞不一定就安全了。正如我们看到的,`/dev/urandom` 直接从 CSPRNG 里给你一样好的随机数。用它不好吗! ### CSPRNG 没问题 -现在情况听上去很沧桑。如果连高质量的 `/dev/random` 都是从一个 CSPRNG 里来的,我们怎么敢在高安全性的需求上使用它呢? +现在情况听上去很惨淡。如果连高质量的 `/dev/random` 都是从一个 CSPRNG 里来的,我们怎么敢在高安全性的需求上使用它呢? -实际上,“看上去随机”是现存大多数密码学基础组件的基本要求。如果你观察一个密码学哈希的输出,它一定得和随机的字符串不可区分,密码学家才会认可这个算法。如果你生成一个块加密,它的输出(在你不知道密钥的情况下)也必须和随机数据不可区分才行。 +实际上,“看上去随机”是现存大多数密码学基础组件的基本要求。如果你观察一个密码学哈希的输出,它一定得和随机的字符串不可区分,密码学家才会认可这个算法。如果你生成一个分组加密,它的输出(在你不知道密钥的情况下)也必须和随机数据不可区分才行。 -如果任何人能比暴力穷举要更有效地破解一个加密,比如它利用了某些 CSPRNG 伪随机的弱点,那这就又是老一套了:一切都废了,也别谈后面的了。块加密、哈希,一切都是基于某个数学算法,比如 CSPRNG。所以别害怕,到头来都一样。 +如果任何人能比暴力穷举要更有效地破解一个加密,比如它利用了某些 CSPRNG 伪随机的弱点,那这就又是老一套了:一切都废了,也别谈后面的了。分组加密、哈希,一切都是基于某个数学算法,比如 CSPRNG。所以别害怕,到头来都一样。 ### 那熵池快空了的情况呢? 毫无影响。 -加密算法的根基建立在攻击者不能预测输出上,只要最一开始有足够的随机性(熵)就行了。一般的下限是 256 位,不需要更多了。 +加密算法的根基建立在攻击者不能预测输出上,只要最一开始有足够的随机性(熵)就行了。“足够”的下限可以是 256 位,不需要更多了。 介于我们一直在很随意的使用“熵”这个概念,我用“位”来量化随机性希望读者不要太在意细节。像我们之前讨论的那样,内核的随机数生成器甚至没法精确地知道进入系统的熵的量。只有一个预估。而且这个预估的准确性到底怎么样也没人知道。 @@ -211,7 +211,7 @@ Linux 内核只使用事件的到达时间来预估熵的量。它通过多项 我们在回到 man 页面说:“使用 `/dev/random`”。我们已经知道了,虽然 `/dev/urandom` 不阻塞,但是它的随机数和 `/dev/random` 都是从同一个 CSPRNG 里来的。 -如果你真的需要信息论理论上安全的随机数(你不需要的,相信我),那才有可能成为唯一一个你需要等足够熵进入 CSPRNG 的理由。而且你也不能用 `/dev/random`。 +如果你真的需要信息论安全性的随机数(你不需要的,相信我),那才有可能成为唯一一个你需要等足够熵进入 CSPRNG 的理由。而且你也不能用 `/dev/random`。 man 页面有毒,就这样。但至少它还稍稍挽回了一下自己: @@ -227,7 +227,7 @@ man 页面有毒,就这样。但至少它还稍稍挽回了一下自己: ### 正道 -本篇文章里的观点显然在互联网上是“小众”的。但如果问问一个真正的密码学家,你很难找到一个认同阻塞 `/dev/random` 的人。 +本篇文章里的观点显然在互联网上是“小众”的。但如果问一个真正的密码学家,你很难找到一个认同阻塞 `/dev/random` 的人。 比如我们看看 [Daniel Bernstein][5](即著名的 djb)的看法: @@ -238,8 +238,6 @@ man 页面有毒,就这样。但至少它还稍稍挽回了一下自己: > > 对密码学家来说这甚至都不好笑了 - - 或者 [Thomas Pornin][6] 的看法,他也是我在 stackexchange 上见过最乐于助人的一位: > 简单来说,是的。展开说,答案还是一样。`/dev/urandom` 生成的数据可以说和真随机完全无法区分,至少在现有科技水平下。使用比 `/dev/urandom` “更好的“随机性毫无意义,除非你在使用极为罕见的“信息论安全”的加密算法。这肯定不是你的情况,不然你早就说了。 @@ -260,13 +258,13 @@ Linux 的 `/dev/urandom` 会很乐意给你吐点不怎么随机的随机数, FreeBSD 的行为更正确点:`/dev/random` 和 `/dev/urandom` 是一样的,在系统启动的时候 `/dev/random` 会阻塞到有足够的熵为止,然后它们都再也不阻塞了。 -> 与此同时 Linux 实行了一个新的系统调用syscall,最早由 OpenBSD 引入叫 `getentrypy(2)`,在 Linux 下这个叫 `getrandom(2)`。这个系统调用有着上述正确的行为:阻塞到有足够的熵为止,然后再也不阻塞了。当然,这是个系统调用,而不是一个字节设备(LCTT 译注:指不在 `/dev/` 下),所以它在 shell 或者别的脚本语言里没那么容易获取。这个系统调用 自 Linux 3.17 起存在。 +> 与此同时 Linux 实行了一个新的系统调用syscall,最早由 OpenBSD 引入叫 `getentrypy(2)`,在 Linux 下这个叫 `getrandom(2)`。这个系统调用有着上述正确的行为:阻塞到有足够的熵为止,然后再也不阻塞了。当然,这是个系统调用,而不是一个字节设备(LCTT 译注:不在 `/dev/` 下),所以它在 shell 或者别的脚本语言里没那么容易获取。这个系统调用 自 Linux 3.17 起存在。 -在 Linux 上其实这个问题不太大,因为 Linux 发行版会在启动的过程中储蓄一点随机数(这发生在已经有一些熵之后,因为启动程序不会在按下电源的一瞬间就开始运行)到一个种子文件中,以便系统下次启动的时候读取。所以每次启动的时候系统都会从上一次会话里带一点随机性过来。 +在 Linux 上其实这个问题不太大,因为 Linux 发行版会在启动的过程中保存一点随机数(这发生在已经有一些熵之后,因为启动程序不会在按下电源的一瞬间就开始运行)到一个种子文件中,以便系统下次启动的时候读取。所以每次启动的时候系统都会从上一次会话里带一点随机性过来。 显然这比不上在关机脚本里写入一些随机种子,因为这样的显然就有更多熵可以操作了。但这样做显而易见的好处就是它不用关心系统是不是正确关机了,比如可能你系统崩溃了。 -而且这种做法在你真正第一次启动系统的时候也没法帮你随机,不过好在系统安装器一般会写一个种子文件,所以基本上问题不大。 +而且这种做法在你真正第一次启动系统的时候也没法帮你随机,不过好在 Linux 系统安装程序一般会保存一个种子文件,所以基本上问题不大。 虚拟机是另外一层问题。因为用户喜欢克隆它们,或者恢复到某个之前的状态。这种情况下那个种子文件就帮不到你了。 From 8aaa10d30f5c7d0b3d0e3777a6400d86d3b8230b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 11:51:02 +0800 Subject: [PATCH 0319/1154] PUB:20161106 Myths about -dev-urandom.md @Moelf https://linux.cn/article-10816-1.html --- .../tech => published}/20161106 Myths about -dev-urandom.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20161106 Myths about -dev-urandom.md (100%) diff --git a/translated/tech/20161106 Myths about -dev-urandom.md b/published/20161106 Myths about -dev-urandom.md similarity index 100% rename from translated/tech/20161106 Myths about -dev-urandom.md rename to published/20161106 Myths about -dev-urandom.md From 59596b37287fefadf3a82127e96f8f6193a346ee Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 11:54:07 +0800 Subject: [PATCH 0320/1154] PRF:20161106 Myths about -dev-urandom.md --- published/20161106 Myths about -dev-urandom.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20161106 Myths about -dev-urandom.md b/published/20161106 Myths about -dev-urandom.md index 028704f2d2..76f07ebc3c 100644 --- a/published/20161106 Myths about -dev-urandom.md +++ b/published/20161106 Myths about -dev-urandom.md @@ -71,7 +71,7 @@ man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也 无论如何,我不怎么关心“哲学上安全”的随机数,这也包括别人嘴里的“真”随机数。 -## 两种安全,一种有用 +### 两种安全,一种有用 但就让我们退一步说,你有了一个“真”随机变量。你下一步做什么呢? From 15357953bf2da9678af9aa0fcba8ecc2cdc2a27a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 13:41:07 +0800 Subject: [PATCH 0321/1154] PRF:20190411 Installing Ubuntu MATE on a Raspberry Pi.md @warmfrog --- ...nstalling Ubuntu MATE on a Raspberry Pi.md | 51 +++++++++---------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md index 74d0ac4d2e..2e052b38ab 100644 --- a/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md +++ b/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md @@ -1,49 +1,46 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Installing Ubuntu MATE on a Raspberry Pi) [#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/) [#]: author: (Chinmay https://itsfoss.com/author/chinmay/) -在 Raspberry Pi 上安装 Ubuntu MATE +在树莓派上安装 Ubuntu MATE ================================= -_**简介: 这篇快速指南告诉你如何在 Raspberry Pi 设备上安装 Ubuntu MATE。**_ +> 简介: 这篇快速指南告诉你如何在树莓派设备上安装 Ubuntu MATE。 -[Raspberry Pi][1] 是目前最流行的单板机并且是制造商的首选。[Raspbian][2] 是基于 Debian 的 Pi 的官方操作系统。它是轻量级的,内置了教育工具和能在大部分场景下完成工作的工具。 - -[安装 Raspbian][3] 安装同样简单,但是与 [Debian][4] 一起的问题是慢的升级周期和旧的软件包。 - -在 Raspberry Pi 上运行 Ubuntu 给你带来一个更丰富的体验和最新的软件。当在你的 Pi 上运行 Ubuntu 时我们有几个选择。 - - 1. [Ubuntu MATE][5] :Ubuntu MATE 是仅有的原生支持 Raspberry Pi 包含一个完整的桌面环境的分发版。 - 2. [Ubuntu Server 18.04][6] \+ 手动安装一个桌面环境。 - 3. 使用 [Ubuntu Pi Flavor Maker][7] 社区构建的镜像,_这些镜像只支持 Raspberry Pi 2B 和 3B 的变种_并且**不能**更新到最新的 LTS 发布版。 +[树莓派][1] 是目前最流行的单板机并且是创客首选的板子。[Raspbian][2] 是基于 Debian 的树莓派官方操作系统。它是轻量级的,内置了教育工具和能在大部分场景下完成工作的工具。 +[安装 Raspbian][3] 安装同样简单,但是与 [Debian][4] 随同带来的问题是慢的升级周期和旧的软件包。 +在树莓派上运行 Ubuntu 可以给你带来一个更丰富的体验和最新的软件。当在你的树莓派上运行 Ubuntu 时我们有几个选择。 + 1. [Ubuntu MATE][5] :Ubuntu MATE 是仅有的原生支持树莓派且包含一个完整的桌面环境的发行版。 + 2. [Ubuntu Server 18.04][6] + 手动安装一个桌面环境。 + 3. 使用 [Ubuntu Pi Flavor Maker][7] 社区构建的镜像,这些镜像只支持树莓派 2B 和 3B 的变种,并且**不能**更新到最新的 LTS 发布版。 第一个选择安装是最简单和快速的,而第二个选择给了你自由选择安装桌面环境的机会。我推荐选择前两个中的任一个。 这里是一些磁盘镜像下载链接。在这篇文章里我只会提及 Ubuntu MATE 的安装。 -### 在 Raspberry Pi 上安装 Ubuntu MATE +### 在树莓派上安装 Ubuntu MATE 去 Ubuntu MATE 的下载页面获取推荐的镜像。 ![][8] -试验 ARM64 版只应在你需要在 Raspberry Pi 服务器上运行像 MongoDB 这样的 64-bit 应用时使用。 +试验性的 ARM64 版本只应在你需要在树莓派服务器上运行像 MongoDB 这样的 64 位应用时使用。 -[ 下载为 Raspberry Pi 准备的 Ubuntu MATE][9] +- [下载为树莓派准备的 Ubuntu MATE][9] #### 第 1 步:设置 SD 卡 -镜像文件一旦下载完成后需要解压。你应该简单的右击来提取它。 +镜像文件一旦下载完成后需要解压。你可以简单的右击来提取它。 -可替换地,下面命令做同样的事。 +也可以使用下面命令做同样的事。 ``` xz -d ubuntu-mate***.img.xz @@ -51,7 +48,7 @@ xz -d ubuntu-mate***.img.xz 如果你在 Windows 上你可以使用 [7-zip][10] 替代。 -安装 **[Balena Etcher][11]**,我们将使用这个工具将镜像写入 SD 卡。确保你的 SD 卡有至少 8 GB 的容量。 +安装 [Balena Etcher][11],我们将使用这个工具将镜像写入 SD 卡。确保你的 SD 卡有至少 8 GB 的容量。 启动 Etcher,选择镜像文件和 SD 卡。 @@ -59,21 +56,19 @@ xz -d ubuntu-mate***.img.xz 一旦进度完成 SD 卡就准备好了。 -#### 第 2 步:设置 Raspberry Pi +#### 第 2 步:设置树莓派 -你可能已经知道你需要一些外设才能使用 Raspberry Pi 例如 鼠标,键盘, HDMI 线等等。你同样可以[不用键盘和鼠标安装 Raspberry Pi][13] 但是这篇指南不是那样。 +你可能已经知道你需要一些外设才能使用树莓派,例如鼠标、键盘、HDMI 线等等。你同样可以[不用键盘和鼠标安装树莓派][13],但是这篇指南不是那样。 * 插入一个鼠标和一个键盘。 * 连接 HDMI 线缆。 * 插入 SD 卡 到 SD 卡槽。 - - -插入电源线给它供电。确保你有一个好的电源供应(5V,3A 至少)。一个不好的电源供应可能降低性能。 +插入电源线给它供电。确保你有一个好的电源供应(5V、3A 至少)。一个不好的电源供应可能降低性能。 #### Ubuntu MATE 安装 -一旦你给 Raspberry Pi 供电,你将遇到非常熟悉的 Ubuntu 安装过程。在这里的安装过程相当直接。 +一旦你给树莓派供电,你将遇到非常熟悉的 Ubuntu 安装过程。在这里的安装过程相当直接。 ![选择你的键盘布局][14] @@ -83,7 +78,7 @@ xz -d ubuntu-mate***.img.xz ![添加用户名和密码][16] -在设置了键盘布局,时区和用户凭证后,在几分钟后你将被带到登录界面。瞧!你快要完成了。 +在设置了键盘布局、时区和用户凭证后,在几分钟后你将被带到登录界面。瞧!你快要完成了。 ![][17] @@ -98,9 +93,9 @@ sudo apt upgrade ![][19] -一旦更新完成安装你就可以开始了。你可以根据你的需要继续安装 Raspberry Pi 平台的为 GPIO 和其他 I/O 准备的特定软件包。 +一旦更新完成安装你就可以开始了。你可以根据你的需要继续安装树莓派平台为 GPIO 和其他 I/O 准备的特定软件包。 -是什么让你考虑在 Raspberry 上安装 Ubuntu,你对 Raspbian 的体验如何呢?在下方评论来让我知道。 +是什么让你考虑在 Raspberry 上安装 Ubuntu,你对 Raspbian 的体验如何呢?请在下方评论来让我知道。 -------------------------------------------------------------------------------- @@ -109,7 +104,7 @@ via: https://itsfoss.com/ubuntu-mate-raspberry-pi/ 作者:[Chinmay][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6ec2a7722284c19c45f58afb5ac16ad88a76efdc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 May 2019 13:43:23 +0800 Subject: [PATCH 0322/1154] PUB:20190411 Installing Ubuntu MATE on a Raspberry Pi.md @warmfrog https://linux.cn/article-10817-1.html --- .../20190411 Installing Ubuntu MATE on a Raspberry Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190411 Installing Ubuntu MATE on a Raspberry Pi.md (98%) diff --git a/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/published/20190411 Installing Ubuntu MATE on a Raspberry Pi.md similarity index 98% rename from translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md rename to published/20190411 Installing Ubuntu MATE on a Raspberry Pi.md index 2e052b38ab..2712782f24 100644 --- a/translated/tech/20190411 Installing Ubuntu MATE on a Raspberry Pi.md +++ b/published/20190411 Installing Ubuntu MATE on a Raspberry Pi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10817-1.html) [#]: subject: (Installing Ubuntu MATE on a Raspberry Pi) [#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/) [#]: author: (Chinmay https://itsfoss.com/author/chinmay/) From a6b04b344e76c7341768350a6fbf3d268704b544 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 May 2019 08:41:06 +0800 Subject: [PATCH 0323/1154] translated --- ...y, run Linux applications as unikernels.md | 84 ------------------- ...y, run Linux applications as unikernels.md | 79 +++++++++++++++++ 2 files changed, 79 insertions(+), 84 deletions(-) delete mode 100644 sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md create mode 100644 translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md diff --git a/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md deleted file mode 100644 index bf069370a3..0000000000 --- a/sources/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to quickly deploy, run Linux applications as unikernels) -[#]: via: (https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How to quickly deploy, run Linux applications as unikernels -====== -Unikernels are a smaller, faster, and more secure option for deploying applications on cloud infrastructure. With NanoVMs OPS, anyone can run a Linux application as a unikernel with no additional coding. -![Marcho Verch \(CC BY 2.0\)][1] - -Building and deploying lightweight apps is becoming an easier and more reliable process with the emergence of unikernels. While limited in functionality, unikernals offer many advantages in terms of speed and security. - -### What are unikernels? - -A unikernel is a very specialized single-address-space machine image that is similar to the kind of cloud applications that have come to dominate so much of the internet, but they are considerably smaller and are single-purpose. They are lightweight, providing only the resources needed. They load very quickly and are considerably more secure -- having a very limited attack surface. Any drivers, I/O routines and support libraries that are required are included in the single executable. The resultant virtual image can then be booted and run without anything else being present. And they will often run 10 to 20 times faster than a container. - -**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** - -Would-be attackers cannot drop into a shell and try to gain control because there is no shell. They can't try to grab the system's /etc/passwd or /etc/shadow files because these files don't exist. Creating a unikernel is much like turning your application into its own OS. With a unikernel, the application and the OS become a single entity. You omit what you don't need, thereby removing vulnerabilities and improving performance many times over. - -In short, unikernels: - - * Provide improved security (e.g., making shell code exploits impossible) - * Have much smaller footprints then standard cloud apps - * Are highly optimized - * Boot extremely quickly - - - -### Are there any downsides to unikernels? - -The only serious downside to unikernels is that you have to build them. For many developers, this has been a giant step. Trimming down applications to just what is needed and then producing a tight, smoothly running application can be complex because of the application's low-level nature. In the past, you pretty much had to have been a systems developer or a low level programmer to generate them. - -### How is this changing? - -Just recently (March 24, 2019) [NanoVMs][3] announced a tool that loads any Linux application as a unikernel. Using NanoVMs OPS, anyone can run a Linux application as a unikernel with no additional coding. The application will also run faster, more safely and with less cost and overhead. - -### What is NanoVMs OPS? - -NanoVMs is a unikernel tool for developers. It allows you to run all sorts of enterprise class software yet still have extremely tight control over how it works. - -**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][4] ]** - -Other benefits associated with OPS include: - - * Developers need no prior experience or knowledge to build unikernels. - * The tool can be used to build and run unikernels locally on a laptop. - * No accounts need to be created and only a single download and one command is required to execute OPS. - - - -An intro to NanoVMs is available on [NanoVMs on youtube][5]. You can also check out the company's [LinkedIn page][6] and can read about NanoVMs security [here][7]. - -Here is some information on how to [get started][8]. - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all - -作者:[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/04/corn-kernels-100792925-large.jpg -[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua -[3]: https://nanovms.com/ -[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[5]: https://www.youtube.com/watch?v=VHWDGhuxHPM -[6]: https://www.linkedin.com/company/nanovms/ -[7]: https://nanovms.com/security -[8]: https://nanovms.gitbook.io/ops/getting_started -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md new file mode 100644 index 0000000000..79df6c7c09 --- /dev/null +++ b/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to quickly deploy, run Linux applications as unikernels) +[#]: via: (https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何快速部署并作为 unikernel 运行 Linux 应用 +====== +unikernel 是一种用于在云基础架构上部署应用程序的更小、更快、更安全的选项选择。使用 NanoVMs OPS,任何人都可以将 Linux 应用程序作为 unikernel 运行而无需额外编码。 +![Marcho Verch \(CC BY 2.0\)][1] + +随着 unikernel 的出现,构建和部署轻量级应用变得更容易,更可靠。虽然功能有限,但 unikernal 在速度和安全性方面有许多优势。 + +### 什么是 unikernel? + +unikernel 是一种针对单一用途的机器镜像,类似于已经主导大批互联网的云应用,但它们相当小并且是单一用途的。它们很轻,只提供所需的资源。它们加载速度非常快,而且安全性更高 - 攻击面非常有限。单个可执行文件中包含所需的所有驱动,I/O 例程和支持库。然后,可以在不存在其他的情况下引导和运行所得到的虚拟镜像。它们通常比容器快 10 到 20 倍。 + +潜在的攻击者无法进入 shell 并获得控制权,因为它没有 shell。他们无法获取系统的 /etc/passwd或 /etc/shadow 文件,因为这些文件不存在。创建 unikernel 就像应用将自己变成操作系统。使用 unikernel,应用和操作系统将成为一个单一的实体。你忽略了不需要的东西,从而消除了漏洞并大幅提高性能。 + +简而言之,unikernel: + + * 提供更高的安全性(例如,无法使用 shell 代码) +  * 比标准云应用占用更小空间 +  * 经过高度优化 +  * 启动非常快 + + + +### unikernel 有什么缺点吗? + +unikernel 的唯一严重缺点是你必须构建它们。对于许多开发人员来说,这是一个巨大的进步。由于应用的底层特性,将应用简化为所需的内容然后生成紧凑、平稳运行的应用可能很复杂。在过去,你几乎必须是系统开发人员或底层程序员才能生成它们。 + +### 这是怎么改变的? + +最近(2019 年 3 月 24 日)[NanoVMs][3] 宣布了一个将任何 Linux 应用加载为 unikernel 的工具。使用 NanoVMs OPS,任何人都可以将 Linux 应用作为 unikernel 运行而无需额外编码。该应用还可以更快、更安全地运行,并且成本和开销更低。 + +### 什么是 NanoVMs OPS? + +NanoVMs 是给开发人员的 unikernel 工具。它能让你运行各种企业级软件,但仍然可以非常严格地控制它的运行。 + + +使用 OPS 的其他好处包括: + + * 开发人员不需要经验或知识来构建 unikernel。 +  * 该工具可在笔记本电脑上本地构建和运行 unikernel。 +  * 无需创建帐户,只需下载并一个命令即可执行 OPS。 + + + +NanoVMs 的介绍可以在 [youtube 上的 NanoVMs][5] 上找到。你还可以查看该公司的 [LinkedIn 页面][6]并在[此处][7]阅读有关 NanoVMs 安全性的信息。 + +以下是有关如何[入门][8]的一些信息。 + +在 [Facebook][9] 和 [LinkedIn][10] 上加入 Network World 社区,评论热门主题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all + +作者:[Sandra Henry-Stocker][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.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/corn-kernels-100792925-large.jpg +[3]: https://nanovms.com/ +[5]: https://www.youtube.com/watch?v=VHWDGhuxHPM +[6]: https://www.linkedin.com/company/nanovms/ +[7]: https://nanovms.com/security +[8]: https://nanovms.gitbook.io/ops/getting_started +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 76cd55ba753c51fa29efc8ddf680ee1a7befce7c Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 May 2019 08:44:29 +0800 Subject: [PATCH 0324/1154] translating --- ... Multiple Servers And Show The Output In Top-like Text UI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md index ba177fc480..b74a4f3d76 100644 --- a/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md +++ b/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 32139408d082d546db2c5d4b6d8460a147b84c5c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 09:14:14 +0800 Subject: [PATCH 0325/1154] PRF:20180130 An introduction to the DomTerm terminal emulator for Linux.md @tomjlw --- ...the DomTerm terminal emulator for Linux.md | 79 ++++++++++--------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md index 59510f430b..13652f26ef 100644 --- a/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md +++ b/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md @@ -1,93 +1,98 @@ -DomTerm 一款为 Linux 打造的终端模拟器 +DomTerm:一款为 Linux 打造的终端模拟器 ====== +> 了解一下 DomTerm,这是一款终端模拟器和复用器,带有 HTML 图形和其它不多见的功能。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals.png?itok=CfBqYBah) -[DomTerm][1] 是一款现代化的终端模拟器,它使用浏览器引擎作为 “GUI 工具包”。这就使得一些干净特性例如可嵌入的图像和链接,HTML 富文本以及可折叠(显示/隐藏)命令成为可能。除此以外,它看起来感觉就像一个功能强大,有着优秀 xterm 兼容性(包括鼠标处理和24位色)和恰当的 “chrome” (菜单)的独特终端模拟器。另外它同样有对会话管理和副窗口(例如 `tmux` 和 `GNU Screen` 中),基本输入编辑(例如 `readline` 中)以及分页(例如 `less` 中)的内置支持。 +[DomTerm][1] 是一款现代化的终端模拟器,它使用浏览器引擎作为 “GUI 工具包”。这就支持了一些相关的特性,例如可嵌入图像和链接、HTML 富文本以及可折叠(显示/隐藏)命令。除此以外,它看起来感觉就像一个功能完整、独立的终端模拟器,有着出色 xterm 兼容性(包括鼠标处理和 24 位色)和恰当的 “装饰” (菜单)。另外它内置支持了会话管理和副窗口(如同 `tmux` 和 `GNU Screen` 中一样)、基本输入编辑(如在 `readline` 中)以及分页(如在 `less` 中)。 ![](https://opensource.com/sites/default/files/u128651/domterm1.png) -图 1: DomTerminal 终端模拟器。 查看大图 -在以下部分我们将看一看这些特性。我们将假设你已经安装好了 `domterm` (如果你需要获取并搭建 Dormterm 请跳到本文最后)。开始之前先让我们概览一下这项技术。 +*图 1: DomTerminal 终端模拟器。* + +在以下部分我们将看一看这些特性。我们将假设你已经安装好了 `domterm` (如果你需要获取并构建 Dormterm 请跳到本文最后)。开始之前先让我们概览一下这项技术。 ### 前端 vs. 后端 -DomTerm 大部分是用 JavaScript 写的,它运行在一个浏览器引擎中。这个引擎可以是一个桌面浏览器,例如 Chrome 或者 Firefox(见图三),也可以是一个内嵌的浏览器。使用一个通用的网页浏览器没有问题,但是用户体验却不够好(因为菜单是为通用的网页浏览而不是为了终端模拟器所打造),并且安全模型也会妨碍使用。因此使用内嵌的浏览器更好一些。 +DomTerm 大部分是用 JavaScript 写的,它运行在一个浏览器引擎中。它可以是像例如 Chrome 或者 Firefox 一样的桌面浏览器(见图 3),也可以是一个内嵌的浏览器。使用一个通用的网页浏览器没有问题,但是用户体验却不够好(因为菜单是为通用的网页浏览而不是为了终端模拟器所打造),并且其安全模型也会妨碍使用。因此使用内嵌的浏览器更好一些。 目前以下这些是支持的: - * `qdomterm`,使用了 Qt 工具包 和 `QtWebEngine` - * 一个内嵌的 `[Electron][2]`(见图一) - * `atom-domterm` 以 [Atom 文本编辑器][3](同样基于 Electron)包的形式运行 DomTerm,并和 Atom 面板系统集成在一起(见图二) - * 一个为 JavaFX 的 `WebEngine` 包装器,这对 Java 编程十分有用(见图四) + * qdomterm,使用了 Qt 工具包 和 QtWebEngine + * 一个内嵌的 [Electron][2](见图 1) + * atom-domterm 以 [Atom 文本编辑器][3](同样基于 Electron)包的形式运行 DomTerm,并和 Atom 面板系统集成在一起(见图 2) + * 一个为 JavaFX 的 WebEngine 包装器,这对 Java 编程十分有用(见图 4) * 之前前端使用 [Firefox-XUL][4] 作为首选,但是 Mozilla 已经终止了 XUL - - ![在 Atom 编辑器中的 DomTerm 终端面板][6] -图二:在 Atom 编辑器中的 DomTerm 终端面板。[查看大图][7] +*图 2:在 Atom 编辑器中的 DomTerm 终端面板。* -目前,Electron 前端可能是最佳选择,紧随其后的是 Qt 前端。如果你使用 Atom,`atom-domterm` 也工作得相当不错。 +目前,Electron 前端可能是最佳选择,紧随其后的是 Qt 前端。如果你使用 Atom,atom-domterm 也工作得相当不错。 -后端服务器是用 C 写的。它管理着伪终端(PTYs)和会话。它同样也是一个为前端提供 Javascript 和其他文件的 HTTP 服务器。如果没有服务器在运行,`domterm` 就会使用它自己。后端与服务器之间的通讯通常是用 WebSockets (在服务器端是[libwebsockets][8])完成的。然而,JavaFX 嵌入时既不用 Websockets 也不用 DomTerm 服务器。相反 Java 应用直接通过 Java-Javascript 桥接进行通讯。 +后端服务器是用 C 写的。它管理着伪终端(PTY)和会话。它同样也是一个为前端提供 Javascript 和其它文件的 HTTP 服务器。`domterm` 命令启动终端任务和执行其它请求。如果没有服务器在运行,domterm 就会自己来服务。后端与服务器之间的通讯通常是用 WebSockets(在服务器端是[libwebsockets][8])完成的。然而,JavaFX 的嵌入既不用 Websockets 也不用 DomTerm 服务器。相反 Java 应用直接通过 Java-Javascript 桥接进行通讯。 ### 一个稳健的可兼容 xterm 的终端模拟器 -DomTerm 看上去感觉像一个现代的终端模拟器。它处理鼠标事件,24位色,万国码,倍宽字符(CJK)以及输入方式。DomTerm 在 [vttest 测试套件][9] 上工作地十分出色。 +DomTerm 看上去感觉像一个现代的终端模拟器。它处理鼠标事件、24 位色、Unicode、倍宽字符(CJK)以及输入方式。DomTerm 在 [vttest 测试套件][9] 上工作地十分出色。 -不同寻常的特性包括: +其不同寻常的特性包括: -**展示/隐藏按钮(“折叠”):** 小三角(如上图二)是隐藏/展示相应输出的按钮。仅需在[提示文字][11]中添加特定的[转义字符][10]就可以创建按钮。 +**展示/隐藏按钮(“折叠”):** 小三角(如上图 2)是隐藏/展示相应输出的按钮。仅需在[提示符][11]中添加特定的[转义字符][10]就可以创建按钮。 -**对于 `readline` 和类似输入编辑器的鼠标点击支持:** 如果你点击(黄色)输入区域,DomTerm 会向应用发送正确的方向键按键序列。(提示窗口中的转义字符使能这一特性,你也可以通过 Alt+Click 强制使用。) +**对于 readline 和类似输入编辑器的鼠标点击支持:** 如果你点击输入区域(黄色),DomTerm 会向应用发送正确的方向键按键序列。(可以通过提示符中的转义字符启用这一特性,你也可以通过 `Alt+点击` 强制使用。) -**用CSS样式化终端:** 这通常是在 `~/.domterm/settings.ini` 里完成的,保存时会自动重载。例如在图二中,终端专用的背景色被设置。 +**用 CSS 样式化终端:** 这通常是在 `~/.domterm/settings.ini` 里完成的,保存时会自动重载。例如在图 2 中,设置了终端专用的背景色。 ### 一个更好的 REPL 控制台 -一个经典的终端模拟器基于长方形的字符单元格工作。这在 REPL(命令行)上没问题,但是并不理想。这有些对通常在终端模拟器中不常见的 REPL 很有用的 DomTerm 特性: +一个经典的终端模拟器基于长方形的字符单元格工作的。这在 REPL(命令行)上没问题,但是并不理想。这里有些通常在终端模拟器中不常见的 REPL 很有用的 DomTerm 特性: -**一个能“打印”图片,图表,数学公式或者一组可点击的链接的命令:** 一个应用可以发送包含几乎任何 HTML 的转义字符。(擦除 HTML 以移除 JavaScript 和其它危险特性。) +**一个能“打印”图片、图形、数学公式或者一组可点击的链接的命令:** 应用可以发送包含几乎任何 HTML 的转义字符。(HTML 会被剔除部分,以移除 JavaScript 和其它危险特性。) -图三从[`gnuplot`][12]会话展示了一个片段。Gnuplot(2.1或者跟高版本)支持 `dormterm` 作为终端类型。图像输出被转换成 [SVG 图][13],然后图片被打印到终端。我的博客帖子[在 DormTerm 上的 Gnuplot 展示]在这方面提供了更多信息。 +图 3 显示了来自 [gnuplot][12] 会话的一个片段。Gnuplot(2.1 或者跟高版本)支持 DormTerm 作为终端类型。图形输出被转换成 [SVG 图片][13],然后被打印到终端。我的博客帖子[在 DormTerm 上的 Gnuplot 展示][14]在这方面提供了更多信息。 ![](https://opensource.com/sites/default/files/dt-gnuplot.png) -图三: Gnuplot 截图。查看大图 + +*图 3:Gnuplot 截图。* [Kawa][15] 语言有一个创建并转换[几何图像值][16]的库。如果你将这样的图片值打印到 DomTerm 终端,图片就会被转换成 SVG 形式并嵌入进输出中。 ![](https://opensource.com/sites/default/files/dt-kawa1.png) -图四: Kawa 中可计算的几何形状。查看大图 -**输出中的富文本:** 有着 HTML 样式的帮助信息更加便于阅读,看上去也更漂亮。图片一的面板下部分展示 `dormterm help` 的输出。(如果没在 DomTerm 下运行的话输出的是普通文本。)注意自带的分页器中的 `PAUSED` 消息。 +*图 4:Kawa 中可计算的几何形状。* -**包括可点击链接的错误消息:** DomTerm 识别语法 `filename:line:column` 并将其转化成一个能在可定制文本编辑器中打开文件并定位到行的链接。(这适用相对的文件名上如果你用 `PROMPT_COMMAND` 或类似的以跟踪目录。) +**富文本输出:** 有着 HTML 样式的帮助信息更加便于阅读,看上去也更漂亮。图片 1 的下面面板展示 `dormterm help` 的输出。(如果没在 DomTerm 下运行的话输出的是普通文本。)注意自带的分页器中的 `PAUSED` 消息。 -一个编译器可以侦测到它在 DomTerm 下运行,并直接用转义字符发出文件链接。这比依赖 DomTerm 的样式匹配要稳健得多,因为它可以处理空格和其他字符并且无需依赖目录追踪。在图四中,你可以看到来自 [Kawa Compiler][15] 的错误消息。悬停在文件位置上会使其出现下划线,`file:` URL 出现在 `atom-domterm` 消息栏(窗口底部)中。(当不用 `atom-domterm` 时,这样的消息会在一个覆盖框中显示,如图一中所看到的 `PAUSED` 消息所示。) +**包括可点击链接的错误消息:** DomTerm 可以识别语法 `filename:line:column` 并将其转化成一个能在可定制文本编辑器中打开文件并定位到行的链接。(这适用于相对路径的文件名,如果你用 `PROMPT_COMMAND` 或类似的跟踪目录。) + +编译器可以侦测到它在 DomTerm 下运行,并直接用转义字符发出文件链接。这比依赖 DomTerm 的样式匹配要稳健得多,因为它可以处理空格和其他字符并且无需依赖目录追踪。在图 4 中,你可以看到来自 [Kawa Compiler][15] 的错误消息。悬停在文件位置上会使其出现下划线,`file:` URL 出现在 `atom-domterm` 消息栏(窗口底部)中。(当不用 atom-domterm 时,这样的消息会在一个浮层的框中显示,如图 1 中所看到的 `PAUSED` 消息所示。) 点击链接时的动作是可以配置的。默认对于带有 `#position` 后缀的 `file:` 链接的动作是在文本编辑器中打开那个文件。 -**内建的 Lisp 样式优美打印:** 你可以在输出中包括优美打印目录(比如,组)这样行分隔符会随着窗口调整二重新计算。查看我的文章 [DomTerm 中的动态优美打印][17]以更深入探讨。 +**结构化内部表示:**以下内容均以内部节点结构表示:命令、提示符、输入行、正常和错误输出、标签,如果“另存为 HTML”,则保留结构。HTML 文件与 XML 兼容,因此你可以使用 XML 工具搜索或转换输出。命令 `domterm view-saved` 会以一种启用命令折叠(显示/隐藏按钮处于活动状态)和重新调整窗口大小的方式打开保存的 HTML 文件。 -**基本的有着历史记录的内建行编辑**(像 `GNU readline` 一样): 这使用浏览器自带的编辑器,因此它有着优秀的鼠标和选择处理机制。你可以在正常字符模式(大多数输入的字符被指接送向进程); 或者行模式(当控制字符导致编辑动作,回车键向进程发送被编辑行,通常的字符是被插入的)之间转换。默认的是自动模式,根据 PTY 是在原始模式还是终端模式中,DomTerm 在字符模式与行模式间转换。 +**内建的 Lisp 样式优美打印:** 你可以在输出中包括优美打印指令(比如,grouping),这样断行会根据窗口大小调整而重新计算。查看我的文章 [DomTerm 中的动态优美打印][17]以更深入探讨。 -**自带的分页器**(类似简化版的 `less`):键盘快捷键控制滚动。在“页模式”中,输出在每个新的屏幕(或者单独的行如果你一行行地向前移)后暂停; 页模式对于用户输入简单智能,因此(如果你想的话)你可以无需阻碍交互程序就可以运行它。 +**基本的内建行编辑**,带着历史记录(像 GNU readline 一样): 这使用浏览器自带的编辑器,因此它有着优秀的鼠标和选择处理机制。你可以在正常字符模式(大多数输入的字符被指接送向进程);或者行模式(通常的字符是直接插入的,而控制字符导致编辑操作,回车键会向进程发送被编辑行)之间转换。默认的是自动模式,根据 PTY 是在原始模式还是终端模式中,DomTerm 在字符模式与行模式间转换。 -### 多路传输和会话 +**自带的分页器**(类似简化版的 `less`):键盘快捷键控制滚动。在“页模式”中,输出在每个新的屏幕(或者单独的行,如果你想一行行地向前移)后暂停;页模式对于用户输入简单智能,因此(如果你想的话)你无需阻碍交互式程序就可以运行它。 -**标签和平铺:** 你不仅可以创建多个终端标签,也可以平铺它们。你可以要么使用鼠标要么使用键盘快捷键来创建或者切换面板和标签。它们可以用鼠标重新排列并调整大小。这是通过[GoldenLayout][18] JavaScript 库实现的。[图一][19]展示了一个有着两个面板的窗口。上面的有两个标签,一个运行 [Midnight Commander][20]; 底下的面板以 HTML 形式展示了 `dormterm help` 输出。然而相反在 Atom 中我们使用其自带的可拖拽的面板和标签。你可以在图二中看到这个。 +### 多路复用和会话 -**分离或重接会话:** 与 `tmux` 和 GNU `screen` 类似,DomTerm 支持会话安排。你甚至可以给同样的会话接上多个窗口或面板。这支持多用户会话分享和远程链接。(为了安全,同一个服务器的所有会话都需要能够读取 Unix 域接口和包含随机密钥的本地文件。当我们有了良好,安全的远程链接,这个限制将会有所改善。) +**标签和平铺:** 你不仅可以创建多个终端标签,也可以平铺它们。你可以要么使用鼠标或键盘快捷键来创建或者切换面板和标签。它们可以用鼠标重新排列并调整大小。这是通过 [GoldenLayout][18] JavaScript 库实现的。图 1 展示了一个有着两个面板的窗口。上面的有两个标签,一个运行 [Midnight Commander][20];底下的面板以 HTML 形式展示了 `dormterm help` 输出。然而相反在 Atom 中我们使用其自带的可拖拽的面板和标签。你可以在图 2 中看到这个。 -**`domterm`** **命令** 与 `tmux` 和 GNU `screen` 同样相似的地方在于它为控制或者打开单个或多个会话的服务器有着多个选项。主要的差别在于,如果它没在 DomTerm 下运行,`dormterm` 命令会创建一个新的顶层窗口,而不是在现有的终端中运行。 +**分离或重接会话:** 与 `tmux` 和 GNU `screen` 类似,DomTerm 支持会话安排。你甚至可以给同样的会话接上多个窗口或面板。这支持多用户会话分享和远程链接。(为了安全,同一个服务器的所有会话都需要能够读取 Unix 域接口和一个包含随机密钥的本地文件。当我们有了良好、安全的远程链接,这个限制将会有所放松。) -与 `tmux` 和 `git` 类似,dormterm` 命令有许多副命令。一些副命令创建窗口或者会话。另一些(例如“打印”一张图片)仅在现有的 DormTerm 会话下起作用。 +**domterm 命令** 类似与 `tmux` 和 GNU `screen`,它有多个选项可以用于控制或者打开单个或多个会话的服务器。主要的差别在于,如果它没在 DomTerm 下运行,`dormterm` 命令会创建一个新的顶层窗口,而不是在现有的终端中运行。 + +与 `tmux` 和 `git` 类似,`dormterm` 命令有许多子命令。一些子命令创建窗口或者会话。另一些(例如“打印”一张图片)仅在现有的 DormTerm 会话下起作用。 命令 `domterm browse` 打开一个窗口或者面板以浏览一个指定的 URL,例如浏览文档的时候。 ### 获取并安装 DomTerm -DomTerm 从其 [Github 仓库][21]可以获取。目前没有提前搭建好的包,但是有[详细指导][22]。所有的前提条件都可以在 Fedora 27 上获取,这使得其特别容易被搭建。 +DomTerm 可以从其 [Github 仓库][21]获取。目前没有提前构建好的包,但是有[详细指导][22]。所有的前提条件在 Fedora 27 上都有,这使得其特别容易被搭建。 -------------------------------------------------------------------------------- @@ -95,7 +100,7 @@ via: https://opensource.com/article/18/1/introduction-domterm-terminal-emulator 作者:[Per Bothner][a] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c164aced67eb496a94bc478422025863f7c0eee8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 09:14:51 +0800 Subject: [PATCH 0326/1154] PUB:20180130 An introduction to the DomTerm terminal emulator for Linux.md @tomjlw https://linux.cn/article-10819-1.html --- ... An introduction to the DomTerm terminal emulator for Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180130 An introduction to the DomTerm terminal emulator for Linux.md (100%) diff --git a/translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/published/20180130 An introduction to the DomTerm terminal emulator for Linux.md similarity index 100% rename from translated/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md rename to published/20180130 An introduction to the DomTerm terminal emulator for Linux.md From 636fc929b0a0f70879f298d284be16f2a31b76ca Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 14:57:17 +0800 Subject: [PATCH 0327/1154] PRF:20190409 How To Install And Configure Chrony As NTP Client.md @arrowfeng --- ...tall And Configure Chrony As NTP Client.md | 84 ++++++++----------- 1 file changed, 34 insertions(+), 50 deletions(-) diff --git a/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md b/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md index bd9ddaf2ef..b953e4ae88 100644 --- a/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md +++ b/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md @@ -1,69 +1,59 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Install And Configure Chrony As NTP Client?) [#]: via: (https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -如何正确安装和配置Chrony作为NTP客户端? +如何安装和配置 Chrony 作为 NTP 客户端? ====== -NTP服务器和NTP客户端运行我们通过网络来同步时钟。 +NTP 服务器和 NTP 客户端可以让我们通过网络来同步时钟。之前,我们已经撰写了一篇关于 [NTP 服务器和 NTP 客户端的安装与配置][1] 的文章。 -在过去,我们已经撰写了一篇关于 **[NTP服务器和NTP客户端的安装与配置][1]** 的文章。 +如果你想看这些内容,点击上述的 URL 访问。 -如果你想看这些内容,点击上述的URL访问。 +### Chrony 客户端 -### 什么是Chrony客户端? +Chrony 是 NTP 客户端的替代品。它能以更精确的时间和更快的速度同步时钟,并且它对于那些不是全天候在线的系统非常有用。 -Chrony是NTP客户端的替代品。 - -它能以更精确的时间和更快的速度同步时钟,并且它对于那些不是全天候在线的系统非常有用。 - -chronyd更小、更省电,它占用更少的内存且仅当需要时它才唤醒CPU。 - -即使网络拥塞较长时间,它也能很好地运行。 - -它支持Linux上的硬件时间戳,允许在本地网络进行极其准确的同步。 +chronyd 更小、更节能,它占用更少的内存且仅当需要时它才唤醒 CPU。即使网络拥塞较长时间,它也能很好地运行。它支持 Linux 上的硬件时间戳,允许在本地网络进行极其准确的同步。 它提供下列两个服务。 - * **`chronyc:`** Chrony的命令行接口。 - * **`chronyd:`** Chrony守护进程服务。 + * `chronyc`:Chrony 的命令行接口。 + * `chronyd`:Chrony 守护进程服务。 - - -### 如何在Linux上安装和配置Chrony? +### 如何在 Linux 上安装和配置 Chrony? 由于安装包在大多数发行版的官方仓库中可用,因此直接使用包管理器去安装它。 -对于 **`Fedora`** 系统, 使用 **[DNF 命令][2]** 去安装chrony. +对于 Fedora 系统,使用 [DNF 命令][2] 去安装 chrony。 ``` $ sudo dnf install chrony ``` -对于 **`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][3]** 或者 **[APT 命令][4]** 去安装chrony. +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或者 [APT 命令][4] 去安装 chrony。 ``` $ sudo apt install chrony ``` -对基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][5]** 去安装chrony. +对基于 Arch Linux 的系统,使用 [Pacman 命令][5] 去安装 chrony。 ``` $ sudo pacman -S chrony ``` -对于 **`RHEL/CentOS`** 系统, 使用 **[YUM 命令][6]** 去安装chrony. +对于 RHEL/CentOS 系统,使用 [YUM 命令][6] 去安装 chrony。 ``` $ sudo yum install chrony ``` -对于**`openSUSE Leap`** 系统, 使用 **[Zypper 命令][7]** 去安装chrony. +对于 openSUSE Leap 系统,使用 [Zypper 命令][7] 去安装 chrony。 ``` $ sudo zypper install chrony @@ -71,20 +61,18 @@ $ sudo zypper install chrony 在这篇文章中,我们将使用下列设置去测试。 - * **`NTP服务器:`** 主机名: CentOS7.2daygeek.com, IP:192.168.1.5, OS:CentOS 7 - * **`Chrony客户端:`** 主机名: Ubuntu18.2daygeek.com, IP:192.168.1.3, OS:Ubuntu 18.04 + * NTP 服务器:主机名:CentOS7.2daygeek.com,IP:192.168.1.5,OS:CentOS 7 + * Chrony 客户端:主机名:Ubuntu18.2daygeek.com,IP:192.168.1.3,OS:Ubuntu 18.04 +服务器的安装请访问 [在 Linux 上安装和配置 NTP 服务器][1] 的 URL。 -导航到 **[在Linux上安装和配置NTP服务器][1]** 的URL。 +我已经在 CentOS7.2daygeek.com 这台主机上安装和配置了 NTP 服务器,因此,将其附加到所有的客户端机器上。此外,还包括其他所需信息。 +`chrony.conf` 文件的位置根据你的发行版不同而不同。 -我已经在`CentOS7.2daygeek.com`这台主机上安装和配置了NTP服务器,因此,将其附加到所有的客户端机器上。此外,还包括其他所需信息。 +对基于 RHEL 的系统,它位于 `/etc/chrony.conf`。 -`chrony.conf`文件的位置根据你的发行版不同而不同。 - -对基于RHEL的系统,它位于`/etc/chrony.conf`。 - -对基于Debian的系统,它位于`/etc/chrony/chrony.conf`。 +对基于 Debian 的系统,它位于 `/etc/chrony/chrony.conf`。 ``` # vi /etc/chrony/chrony.conf @@ -98,28 +86,25 @@ makestep 1 3 cmdallow 192.168.1.0/24 ``` -更新配置后需要重启Chrony服务。 +更新配置后需要重启 Chrony 服务。 -对于sysvinit系统。基于RHEL的系统需要去运行`chronyd`而不是chrony。 +对于 sysvinit 系统。基于 RHEL 的系统需要去运行 `chronyd` 而不是 `chrony`。 ``` # service chronyd restart - # chkconfig chronyd on ``` -对于systemctl系统。 基于RHEL的系统需要去运行`chronyd`而不是chrony。 +对于 systemctl 系统。 基于 RHEL 的系统需要去运行 `chronyd` 而不是 `chrony`。 ``` # systemctl restart chronyd - # systemctl enable chronyd ``` -使用像tacking,sources和sourcestats这样的命令去检查chrony的同步细节。 - -去检查chrony的跟踪状态。 +使用像 `tacking`、`sources` 和 `sourcestats` 这样的子命令去检查 chrony 的同步细节。 +去检查 chrony 的追踪状态。 ``` # chronyc tracking @@ -138,7 +123,7 @@ Update interval : 2.0 seconds Leap status : Normal ``` -运行sources命令去显示当前时间源的信息。 +运行 `sources` 命令去显示当前时间源的信息。 ``` # chronyc sources @@ -148,7 +133,7 @@ MS Name/IP address Stratum Poll Reach LastRx Last sample ^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms ``` -sourcestats命令显示有关chronyd当前正在检查的每个源的漂移率和偏移估计过程的信息。 +`sourcestats` 命令显示有关 chronyd 当前正在检查的每个源的漂移率和偏移估计过程的信息。 ``` # chronyc sourcestats @@ -158,7 +143,7 @@ Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev CentOS7.2daygeek.com 5 3 71 -97.314 78.754 -469us 441us ``` -当chronyd配置为NTP客户端或对等端时,你就能通过chronyc ntpdata命令向每一个NTP源发送和接收时间戳模式和交错模式报告。 +当 chronyd 配置为 NTP 客户端或对等端时,你就能通过 `chronyc ntpdata` 命令向每一个 NTP 源发送/接收时间戳模式和交错模式的报告。 ``` # chronyc ntpdata @@ -191,15 +176,14 @@ Total RX : 46 Total valid RX : 46 ``` -最后运行`date`命令。 +最后运行 `date` 命令。 ``` # date Thu Mar 28 03:08:11 CDT 2019 ``` -为了立即切换系统时钟,通过转换绕过任何正在进行的调整,请以root身份发出以下命令(手动调整系统时钟)。 -To step the system clock immediately, bypassing any adjustments in progress by slewing, issue the following command as root (To adjust the system clock manually). +为了立即跟进系统时钟,绕过任何正在进行的缓步调整,请以 root 身份运行以下命令(以手动调整系统时钟)。 ``` # chronyc makestep @@ -212,13 +196,13 @@ via: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[arrowfeng](https://github.com/arrowfeng) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/ +[1]: https://linux.cn/article-10811-1.html [2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ [3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ [4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ From a318d6416fd1de04ed94780225cbc784e109bf0f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 14:57:57 +0800 Subject: [PATCH 0328/1154] PUB:20190409 How To Install And Configure Chrony As NTP Client.md @arrowfeng https://linux.cn/article-10820-1.html --- ...90409 How To Install And Configure Chrony As NTP Client.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 How To Install And Configure Chrony As NTP Client.md (98%) diff --git a/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md b/published/20190409 How To Install And Configure Chrony As NTP Client.md similarity index 98% rename from translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md rename to published/20190409 How To Install And Configure Chrony As NTP Client.md index b953e4ae88..cf25d7af66 100644 --- a/translated/tech/20190409 How To Install And Configure Chrony As NTP Client.md +++ b/published/20190409 How To Install And Configure Chrony As NTP Client.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10820-1.html) [#]: subject: (How To Install And Configure Chrony As NTP Client?) [#]: via: (https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 17f8bcaeff8481477b5b89a950f89a94e12f2d9a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 15:36:53 +0800 Subject: [PATCH 0329/1154] PRF:20190408 How to quickly deploy, run Linux applications as unikernels.md @geekpi --- ...y, run Linux applications as unikernels.md | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md index 79df6c7c09..5dd0e9f573 100644 --- a/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md +++ b/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to quickly deploy, run Linux applications as unikernels) @@ -9,25 +9,25 @@ 如何快速部署并作为 unikernel 运行 Linux 应用 ====== -unikernel 是一种用于在云基础架构上部署应用程序的更小、更快、更安全的选项选择。使用 NanoVMs OPS,任何人都可以将 Linux 应用程序作为 unikernel 运行而无需额外编码。 + +unikernel 是一种用于在云基础架构上部署应用程序的更小、更快、更安全的方式。使用 NanoVMs OPS,任何人都可以将 Linux 应用程序作为 unikernel 运行而无需额外编码。 + ![Marcho Verch \(CC BY 2.0\)][1] -随着 unikernel 的出现,构建和部署轻量级应用变得更容易,更可靠。虽然功能有限,但 unikernal 在速度和安全性方面有许多优势。 +随着 unikernel 的出现,构建和部署轻量级应用变得更容易、更可靠。虽然功能有限,但 unikernal 在速度和安全性方面有许多优势。 ### 什么是 unikernel? -unikernel 是一种针对单一用途的机器镜像,类似于已经主导大批互联网的云应用,但它们相当小并且是单一用途的。它们很轻,只提供所需的资源。它们加载速度非常快,而且安全性更高 - 攻击面非常有限。单个可执行文件中包含所需的所有驱动,I/O 例程和支持库。然后,可以在不存在其他的情况下引导和运行所得到的虚拟镜像。它们通常比容器快 10 到 20 倍。 +unikernel 是一种非常特殊的单一地址空间single-address-space的机器镜像,类似于已经主导大批互联网的云应用,但它们相当小并且是单一用途的。它们很轻,只提供所需的资源。它们加载速度非常快,而且安全性更高 —— 攻击面非常有限。单个可执行文件中包含所需的所有驱动、I/O 例程和支持库。其最终生成的虚拟镜像可以无需其它部分就可以引导和运行。它们通常比容器快 10 到 20 倍。 -潜在的攻击者无法进入 shell 并获得控制权,因为它没有 shell。他们无法获取系统的 /etc/passwd或 /etc/shadow 文件,因为这些文件不存在。创建 unikernel 就像应用将自己变成操作系统。使用 unikernel,应用和操作系统将成为一个单一的实体。你忽略了不需要的东西,从而消除了漏洞并大幅提高性能。 +潜在的攻击者无法进入 shell 并获得控制权,因为它没有 shell。他们无法获取系统的 `/etc/passwd`或 `/etc/shadow` 文件,因为这些文件不存在。创建一个 unikernel 就像应用将自己变成操作系统。使用 unikernel,应用和操作系统将成为一个单一的实体。你忽略了不需要的东西,从而消除了漏洞并大幅提高性能。 简而言之,unikernel: - * 提供更高的安全性(例如,无法使用 shell 代码) -  * 比标准云应用占用更小空间 -  * 经过高度优化 -  * 启动非常快 - - +* 提供更高的安全性(例如,shell 破解代码无用武之地) +* 比标准云应用占用更小空间 +* 经过高度优化 +* 启动非常快 ### unikernel 有什么缺点吗? @@ -41,29 +41,24 @@ unikernel 的唯一严重缺点是你必须构建它们。对于许多开发人 NanoVMs 是给开发人员的 unikernel 工具。它能让你运行各种企业级软件,但仍然可以非常严格地控制它的运行。 - 使用 OPS 的其他好处包括: - * 开发人员不需要经验或知识来构建 unikernel。 -  * 该工具可在笔记本电脑上本地构建和运行 unikernel。 -  * 无需创建帐户,只需下载并一个命令即可执行 OPS。 +* 无需经验或知识,开发人员就可以构建 unikernel。 +* 该工具可在笔记本电脑上本地构建和运行 unikernel。 +* 无需创建帐户,只需下载并一个命令即可执行 OPS。 +NanoVMs 的介绍可以在 [Youtube 上的 NanoVMs 视频][5] 上找到。你还可以查看该公司的 [LinkedIn 页面][6]并在[此处][7]阅读有关 NanoVMs 安全性的信息。 - -NanoVMs 的介绍可以在 [youtube 上的 NanoVMs][5] 上找到。你还可以查看该公司的 [LinkedIn 页面][6]并在[此处][7]阅读有关 NanoVMs 安全性的信息。 - -以下是有关如何[入门][8]的一些信息。 - -在 [Facebook][9] 和 [LinkedIn][10] 上加入 Network World 社区,评论热门主题。 +还有有关如何[入门][8]的一些信息。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all +via: https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html 作者:[Sandra Henry-Stocker][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/) 荣誉推出 From 9299398984d848d7030bfb8d45eb3b2b0bb664eb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 May 2019 15:37:30 +0800 Subject: [PATCH 0330/1154] PUB:20190408 How to quickly deploy, run Linux applications as unikernels.md @geekpi https://linux.cn/article-10822-1.html --- ...to quickly deploy, run Linux applications as unikernels.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190408 How to quickly deploy, run Linux applications as unikernels.md (98%) diff --git a/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md b/published/20190408 How to quickly deploy, run Linux applications as unikernels.md similarity index 98% rename from translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md rename to published/20190408 How to quickly deploy, run Linux applications as unikernels.md index 5dd0e9f573..87753f2a68 100644 --- a/translated/tech/20190408 How to quickly deploy, run Linux applications as unikernels.md +++ b/published/20190408 How to quickly deploy, run Linux applications as unikernels.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10822-1.html) [#]: subject: (How to quickly deploy, run Linux applications as unikernels) [#]: via: (https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 4e897a24b601cf4ff74326610046dabca8e8bba2 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 6 May 2019 18:37:16 +0800 Subject: [PATCH 0331/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020170717=20The?= =?UTF-8?q?=20Ultimate=20Guide=20to=20JavaScript=20Fatigue:=20Realities=20?= =?UTF-8?q?of=20our=20industry=20sources/talk/20170717=20The=20Ultimate=20?= =?UTF-8?q?Guide=20to=20JavaScript=20Fatigue-=20Realities=20of=20our=20ind?= =?UTF-8?q?ustry.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ript Fatigue- Realities of our industry.md | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md diff --git a/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md b/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md new file mode 100644 index 0000000000..923d4618a9 --- /dev/null +++ b/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md @@ -0,0 +1,221 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Ultimate Guide to JavaScript Fatigue: Realities of our industry) +[#]: via: (https://lucasfcosta.com/2017/07/17/The-Ultimate-Guide-to-JavaScript-Fatigue.html) +[#]: author: (Lucas Fernandes Da Costa https://lucasfcosta.com) + +The Ultimate Guide to JavaScript Fatigue: Realities of our industry +====== + +**Complaining about JS Fatigue is just like complaining about the fact that humanity has created too many tools to solve the problems we have** , from email to airplanes and spaceships. + +Last week I’ve done a talk about this very same subject at the NebraskaJS 2017 Conference and I got so many positive feedbacks that I just thought this talk should also become a blog post in order to reach more people and help them deal with JS Fatigue and understand the realities of our industry. **My goal with this post is to change the way you think about software engineering in general and help you in any areas you might work on**. + +One of the things that has inspired me to write this blog post and that totally changed my life is [this great post by Patrick McKenzie, called “Don’t Call Yourself a Programmer and other Career Advice”][1]. **I highly recommend you read that**. Most of this blog post is advice based on what Patrick has written in that post applied to the JavaScript ecosystem and with a few more thoughts I’ve developed during these last years working in the tech industry. + +This first section is gonna be a bit philosophical, but I swear it will be worth reading. + +### Realities of Our Industry 101 + +Just like Patrick has done in [his post][1], let’s start with the most basic and essential truth about our industry: + +Software solves business problems + +This is it. **Software does not exist to please us as programmers** and let us write beautiful code. Neither it exists to create jobs for people in the tech industry. **Actually, it exists to kill as many jobs as possible, including ours** , and this is why basic income will become much more important in the next few years, but that’s a whole other subject. + +I’m sorry to say that, but the reason things are that way is that there are only two things that matter in the software engineering (and any other industries): + +**Cost versus Revenue** + +**The more you decrease cost and increase revenue, the more valuable you are** , and one of the most common ways of decreasing cost and increasing revenue is replacing human beings by machines, which are more effective and usually cost less in the long run. + +You are not paid to write code + +**Technology is not a goal.** Nobody cares about which programming language you are using, nobody cares about which frameworks your team has chosen, nobody cares about how elegant your data structures are and nobody cares about how good is your code. **The only thing that somebody cares about is how much does your software cost and how much revenue it generates**. + +Writing beautiful code does not matter to your clients. We write beautiful code because it makes us more productive in the long run and this decreases cost and increases revenue. + +The whole reason why we try not to write bugs is not that we value correctness, but that **our clients** value correctness. If you have ever seen a bug becoming a feature you know what I’m talking about. That bug exists but it should not be fixed. That happens because our goal is not to fix bugs, our goal is to generate revenue. If our bugs make clients happy then they increase revenue and therefore we are accomplishing our goals. + +Reusable space rockets, self-driving cars, robots, artificial intelligence: these things do not exist just because someone thought it would be cool to create them. They exist because there are business interests behind them. And I’m not saying the people behind them just want money, I’m sure they think that stuff is also cool, but the truth is that if they were not economically viable or had any potential to become so, they would not exist. + +Probably I should not even call this section “Realities of Our Industry 101”, maybe I should just call it “Realities of Capitalism 101”. + +And given that our only goal is to increase revenue and decrease cost, I think we as programmers should be paying more attention to requirements and design and start thinking with our minds and participating more actively in business decisions, which is why it is extremely important to know the problem domain we are working on. How many times before have you found yourself trying to think about what should happen in certain edge cases that have not been thought before by your managers or business people? + +In 1975, Boehm has done a research in which he found out that about 64% of all errors in the software he was studying were caused by design, while only 36% of all errors were coding errors. Another study called [“Higher Order Software—A Methodology for Defining Software”][2] also states that **in the NASA Apollo project, about 73% of all errors were design errors**. + +The whole reason why Design and Requirements exist is that they define what problems we’re going to solve and solving problems is what generates revenue. + +> Without requirements or design, programming is the art of adding bugs to an empty text file. +> +> * Louis Srygley +> + + +This same principle also applies to the tools we’ve got available in the JavaScript ecosystem. Babel, webpack, react, Redux, Mocha, Chai, Typescript, all of them exist to solve a problem and we gotta understand which problem they are trying to solve, we need to think carefully about when most of them are needed, otherwise, we will end up having JS Fatigue because: + +JS Fatigue happens when people use tools they don't need to solve problems they don't have. + +As Donald Knuth once said: “Premature optimization is the root of all evil”. Remember that software only exists to solve business problems and most software out there is just boring, it does not have any high scalability or high-performance constraints. Focus on solving business problems, focus on decreasing cost and generating revenue because this is all that matters. Optimize when you need, otherwise you will probably be adding unnecessary complexity to your software, which increases cost, and not generating enough revenue to justify that. + +This is why I think we should apply [Test Driven Development][3] principles to everything we do in our job. And by saying this I’m not just talking about testing. **I’m talking about waiting for problems to appear before solving them. This is what TDD is all about**. As Kent Beck himself says: “TDD reduces fear” because it guides your steps and allows you take small steps towards solving your problems. One problem at a time. By doing the same thing when it comes to deciding when to adopt new technologies then we will also reduce fear. + +Solving one problem at a time also decreases [Analysis Paralysis][4], which is basically what happens when you open Netflix and spend three hours concerned about making the optimal choice instead of actually watching something. By solving one problem at a time we reduce the scope of our decisions and by reducing the scope of our decisions we have fewer choices to make and by having fewer choices to make we decrease Analysis Paralysis. + +Have you ever thought about how easier it was to decide what you were going to watch when there were only a few TV channels available? Or how easier it was to decide which game you were going to play when you had only a few cartridges at home? + +### But what about JavaScript? + +By the time I’m writing this post NPM has 489,989 packages and tomorrow approximately 515 new ones are going to be published. + +And the packages we use and complain about have a history behind them we must comprehend in order to understand why we need them. **They are all trying to solve problems.** + +Babel, Dart, CoffeeScript and other transpilers come from our necessity of writing code other than JavaScript but making it runnable in our browsers. Babel even lets us write new generation JavaScript and make sure it will work even on older browsers, which has always been a great problem given the inconsistencies and different amount of compliance to the ECMA Specification between browsers. Even though the ECMA spec is becoming more and more solid these days, we still need Babel. And if you want to read more about Babel’s history I highly recommend that you read [this excellent post by Henry Zhu][5]. + +Module bundlers such as Webpack and Browserify also have their reason to exist. If you remember well, not so long ago we used to suffer a lot with lots of `script` tags and making them work together. They used to pollute the global namespace and it was reasonably hard to make them work together when one depended on the other. In order to solve this [`Require.js`][6] was created, but it still had its problems, it was not that straightforward and its syntax also made it prone to other problems, as you can see [in this blog post][7]. Then Node.js came with `CommonJS` imports, which were synchronous, simple and clean, but we still needed a way to make that work on our browsers and this is why we needed Webpack and Browserify. + +And Webpack itself actually solves more problems than that by allowing us to deal with CSS, images and many other resources as if they were JavaScript dependencies. + +Front-end frameworks are a bit more complicated, but the reason why they exist is to reduce the cognitive load when we write code so that we don’t need to worry about manipulating the DOM ourselves or even dealing with messy browser APIs (another problem JQuery came to solve), which is not only error prone but also not productive. + +This is what we have been doing this whole time in computer science. We use low-level abstractions and build even more abstractions on top of it. The more we worry about describing how our software should work instead of making it work, the more productive we are. + +But all those tools have something in common: **they exist because the web platform moves too fast**. Nowadays we’re using web technology everywhere: in web browsers, in desktop applications, in phone applications or even in watch applications. + +This evolution also creates problems we need to solve. PWAs, for example, do not exist only because they’re cool and we programmers have fun writing them. Remember the first section of this post: **PWAs exist because they create business value**. + +And usually standards are not fast enough to be created and therefore we need to create our own solutions to these things, which is why it is great to have such a vibrant and creative community with us. We’re solving problems all the time and **we are allowing natural selection to do its job**. + +The tools that suit us better thrive, get more contributors and develop themselves more quickly and sometimes other tools end up incorporating the good ideas from the ones that thrive and becoming even more popular than them. This is how we evolve. + +By having more tools we also have more choices. If you remember the UNIX philosophy well, it states that we should aim at creating programs that do one thing and do it well. + +We can clearly see this happening in the JS testing environment, for example, where we have Mocha for running tests and Chai for doing assertions, while in Java JUnit tries to do all these things. This means that if we have a problem with one of them or if we find another one that suits us better, we can simply replace that small part and still have the advantages of the other ones. + +The UNIX philosophy also states that we should write programs that work together. And this is exactly what we are doing! Take a look at Babel, Webpack and React, for example. They work very well together but we still do not need one to use the other. In the testing environment, for example, if we’re using Mocha and Chai all of a sudden we can just install Karma and run those same tests in multiple environments. + +### How to Deal With It + +My first advice for anyone suffering from JS Fatigue would definitely be to stay aware that **you don’t need to know everything**. Trying to learn it all at once, even when we don’t have to do so, only increases the feeling of fatigue. Go deep in areas that you love and for which you feel an inner motivation to study and adopt a lazy approach when it comes to the other ones. I’m not saying that you should be lazy, I’m just saying that you can learn those only when needed. Whenever you face a problem that requires you to use a certain technology to solve it, go learn. + +Another important thing to say is that **you should start from the beginning**. Make sure you have learned enough about JavaScript itself before using any JavaScript frameworks. This is the only way you will be able to understand them and bend them to your will, otherwise, whenever you face an error you have never seen before you won’t know which steps to take in order to solve it. Learning core web technologies such as CSS, HTML5, JavaScript and also computer science fundamentals or even how the HTTP protocol works will help you master any other technologies a lot more quickly. + +But please, don’t get too attached to that. Sometimes you gotta risk yourself and start doing things on your own. As Sacha Greif has written in [this blog post][8], spending too much time learning the fundamentals is just like trying to learn how to swim by studying fluid dynamics. Sometimes you just gotta jump into the pool and try to swim by yourself. + +And please, don’t get too attached to a single technology. All of the things we have available nowadays have already been invented in the past. Of course, they have different features and a brand new name, but, in their essence, they are all the same. + +If you look at NPM, it is nothing new, we already had Maven Central and Ruby Gems quite a long time ago. + +In order to transpile your code, Babel applies the very same principles and theory as some of the oldest and most well-known compilers, such as the GCC. + +Even JSX is not a new idea. It E4X (ECMAScript for XML) already existed more than 10 years ago. + +Now you might ask: “what about Gulp, Grunt and NPM Scripts?” Well, I’m sorry but we can solve all those problems with GNU Make in 1976. And actually, there are a reasonable number of JavaScript projects that still use it, such as Chai.js, for example. But we do not do that because we are hipsters that like vintage stuff. We use `make` because it solves our problems, and this is what you should aim at doing, as we’ve talked before. + +If you really want to understand a certain technology and be able to solve any problems you might face, please, dig deep. One of the most decisive factors to success is curiosity, so **dig deep into the technologies you like**. Try to understand them from bottom-up and whenever you think something is just “magic”, debunk that myth by exploring the codebase by yourself. + +In my opinion, there is no better quote than this one by Richard Feinman, when it comes to really learning something: + +> What I cannot create, I do not understand + +And just below this phrase, [in the same blackboard, Richard also wrote][9]: + +> Know how to solve every problem that has been solved + +Isn’t this just amazing? + +When Richard said that, he was talking about being able to take any theoretical result and re-derive it, but I think the exact same principle can be applied to software engineering. The tools that solve our problems have already been invented, they already exist, so we should be able to get to them all by ourselves. + +This is the very reason I love [some of the videos available in Egghead.io][10] in which Dan Abramov explains how to implement certain features that exist in Redux from scratch or [blog posts that teach you how to build your own JSX renderer][11]. + +So why not trying to implement these things by yourself or going to GitHub and reading their codebase in order to understand how they work? I’m sure you will find a lot of useful knowledge out there. Comments and tutorials might lie and be incorrect sometimes, the code cannot. + +Another thing that we have been talking a lot in this post is that **you should not get ahead of yourself**. Follow a TDD approach and solve one problem at a time. You are paid to increase revenue and decrease cost and you do this by solving problems, this is the reason why software exists. + +And since we love comparing our role to the ones related to civil engineering, let’s do a quick comparison between software development and civil engineering, just as [Sam Newman does in his brilliant book called “Building Microservices”][12]. + +We love calling ourselves “engineers” or “architects”, but is that term really correct? We have been developing software for what we know as computers less than a hundred years ago, while the Colosseum, for example, exists for about two thousand years. + +When was the last time you’ve seen a bridge falling and when was the last time your telephone or your browser crashed? + +In order to explain this, I’ll use an example I love. + +This is the beautiful and awesome city of Barcelona: + +![The City of Barcelona][13] + +When we look at it this way and from this distance, it just looks like any other city in the world, but when we look at it from above, this is how Barcelona looks: + +![Barcelona from above][14] + +As you can see, every block has the same size and all of them are very organized. If you’ve ever been to Barcelona you will also know how good it is to move through the city and how well it works. + +But the people that planned Barcelona could not predict what it was going to look like in the next two or three hundred years. In cities, people come in and people move through it all the time so what they had to do was make it grow organically and adapt as the time goes by. They had to be prepared for changes. + +This very same thing happens to our software. It evolves quickly, refactors are often needed and requirements change more frequently than we would like them to. + +So, instead of acting like a Software Engineer, act as a Town Planner. Let your software grow organically and adapt as needed. Solve problems as they come by but make sure everything still has its place. + +Doing this when it comes to software is even easier than doing this in cities due to the fact that **software is flexible, civil engineering is not**. **In the software world, our build time is compile time**. In Barcelona we cannot simply destroy buildings to give space to new ones, in Software we can do that a lot easier. We can break things all the time, we can make experiments because we can build as many times as we want and it usually takes seconds and we spend a lot more time thinking than building. Our job is purely intellectual. + +So **act like a town planner, let your software grow and adapt as needed**. + +By doing this you will also have better abstractions and know when it’s the right time to adopt them. + +As Sam Koblenski says: + +> Abstractions only work well in the right context, and the right context develops as the system develops. + +Nowadays something I see very often is people looking for boilerplates when they’re trying to learn a new technology, but, in my opinion, **you should avoid boilerplates when you’re starting out**. Of course boilerplates and generators are useful if you are already experienced, but they take a lot of control out of your hands and therefore you won’t learn how to set up a project and you won’t understand exactly where each piece of the software you are using fits. + +When you feel like you are struggling more than necessary to get something simple done, it might be the right time for you to look for an easier way to do this. In our role **you should strive to be lazy** , you should work to not work. By doing that you have more free time to do other things and this decreases cost and increases revenue, so that’s another way of accomplishing your goal. You should not only work harder, you should work smarter. + +Probably someone has already had the same problem as you’re having right now, but if nobody did it might be your time to shine and build your own solution and help other people. + +But sometimes you will not be able to realize you could be more effective in your tasks until you see someone doing them better. This is why it is so important to **talk to people**. + +By talking to people you share experiences that help each other’s careers and we discover new tools to improve our workflow and, even more important than that, learn how they solve their problems. This is why I like reading blog posts in which companies explain how they solve their problems. + +Especially in our area we like to think that Google and StackOverflow can answer all our questions, but we still need to know which questions to ask. I’m sure you have already had a problem you could not find a solution for because you didn’t know exactly what was happening and therefore didn’t know what was the right question to ask. + +But if I needed to sum this whole post in a single advice, it would be: + +Solve problems. + +Software is not a magic box, software is not poetry (unfortunately). It exists to solve problems and improves peoples’ lives. Software exists to push the world forward. + +**Now it’s your time to go out there and solve problems**. + + +-------------------------------------------------------------------------------- + +via: https://lucasfcosta.com/2017/07/17/The-Ultimate-Guide-to-JavaScript-Fatigue.html + +作者:[Lucas Fernandes Da Costa][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://lucasfcosta.com +[b]: https://github.com/lujun9972 +[1]: http://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/ +[2]: http://ieeexplore.ieee.org/document/1702333/ +[3]: https://en.wikipedia.org/wiki/Test_Driven_Development +[4]: https://en.wikipedia.org/wiki/Analysis_paralysis +[5]: https://babeljs.io/blog/2016/12/07/the-state-of-babel +[6]: http://requirejs.org +[7]: https://benmccormick.org/2015/05/28/moving-past-requirejs/ +[8]: https://medium.freecodecamp.org/a-study-plan-to-cure-javascript-fatigue-8ad3a54f2eb1 +[9]: https://www.quora.com/What-did-Richard-Feynman-mean-when-he-said-What-I-cannot-create-I-do-not-understand +[10]: https://egghead.io/lessons/javascript-redux-implementing-store-from-scratch +[11]: https://jasonformat.com/wtf-is-jsx/ +[12]: https://www.barnesandnoble.com/p/building-microservices-sam-newman/1119741399/2677517060476?st=PLA&sid=BNB_DRS_Marketplace+Shopping+Books_00000000&2sid=Google_&sourceId=PLGoP4760&k_clickid=3x4760 +[13]: /assets/barcelona-city.jpeg +[14]: /assets/barcelona-above.jpeg +[15]: https://twitter.com/thewizardlucas From 0df4a41f2ea6494c123fa60cb32bf8639c25f086 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 May 2019 08:56:50 +0800 Subject: [PATCH 0332/1154] translated --- ...And Show The Output In Top-like Text UI.md | 89 ------------------- ...And Show The Output In Top-like Text UI.md | 89 +++++++++++++++++++ 2 files changed, 89 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md create mode 100644 translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md diff --git a/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md deleted file mode 100644 index b74a4f3d76..0000000000 --- a/sources/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) -[#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Ping Multiple Servers And Show The Output In Top-like Text UI -====== - -![Ping Multiple Servers And Show The Output In Top-like Text UI][1] - -A while ago, we wrote about [**“Fping”**][2] utility which enables us to ping multiple hosts at once. Unlike the traditional **“Ping”** utility, Fping doesn’t wait for one host’s timeout. It uses round-robin method. Meaning – It will send the ICMP Echo request to one host, then move to the another host and finally display which hosts are up or down at a time. Today, we are going to discuss about a similar utility named **“Pingtop”**. As the name says, it will ping multiple servers at a time and show the result in Top-like Terminal UI. It is free and open source, command line program written in **Python**. - -### Install Pingtop - -Pingtop can be installed using Pip, a package manager to install programs developed in Python. Make sure sure you have installed Python 3.7.x and Pip in your Linux box. - -To install Pip on Linux, refer the following link. - - * [**How To Manage Python Packages Using Pip**][3] - - - -Once Pip is installed, run the following command to install Pingtop: - -``` -$ pip install pingtop -``` - -Now let us go ahead and ping multiple systems using Pingtop. - -### Ping Multiple Servers And Show The Output In Top-like Terminal UI - -To ping mulstiple hosts/systems, run: - -``` -$ pingtop ostechnix.com google.com facebook.com twitter.com -``` - -You will now see the result in a nice top-like Terminal UI as shown in the following output. - -![][4] - -Ping multiple servers using Pingtop - -* * * - -**Suggested read:** - - * [**Some Alternatives To ‘top’ Command line Utility You Might Want To Know**][5] - - - -* * * - -I personally couldn’t find any use cases for Pingtop utility at the moment. But I like the idea of showing the ping command’s output in text user interface. Give it a try and see if it helps. - -And, that’s all for now. More good stuffs to come. Stay tuned! - -Cheers! - -**Resource:** - - * [**Pingtop GitHub Repository**][6] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/ - -作者:[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/2019/04/pingtop-720x340.png -[2]: https://www.ostechnix.com/ping-multiple-hosts-linux/ -[3]: https://www.ostechnix.com/manage-python-packages-using-pip/ -[4]: http://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-1.gif -[5]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/ -[6]: https://github.com/laixintao/pingtop diff --git a/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md new file mode 100644 index 0000000000..64a9e54a8f --- /dev/null +++ b/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) +[#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +ping 多台服务器并在类似 top 的文本 UI 中显示 +====== + +![Ping Multiple Servers And Show The Output In Top-like Text UI][1] + +不久前,我们写了篇关于 [**“fping”**][2] 的文章,该程序能使我们能够同时 ping 多台主机。与传统的 **“ping”** 不同,fping 不会等待一台主机的超时。它使用循环法,这表示它将 ICMP Echo 请求发送到一台主机,然后转到另一台主机,最后一次显示哪些主机开启或关闭。今天,我们将讨论一个名为 **“pingtop”** 的类似程序。顾名思义,它会一次 ping 多台服务器,并在类似 top 的终端 UI 中显示结果。它是用 **Python** 写的免费开源程序。 + +### 安装 pingtop + +可以使用 pip 安装 pingtop,pip 是一个软件包管理器,用于安装用 Python 开发的程序。确保已在 Linux 中安装了 Python 3.7.x 和 pip。 + +要在Linux上安装 pip,请参阅以下链接。 + + * [**如何使用 pip 管理 Python 包**][3] + + + +安装 pip 后,运行以下命令安装 pingtop: + +``` +$ pip install pingtop +``` + +现在让我们继续使用 pingtop ping 多个系统。 + +### ping 多台服务器并在类似 top 的终端 UI 中显示 + +要 ping 多个主机/系统,请运行: + +``` +$ pingtop ostechnix.com google.com facebook.com twitter.com +``` + +现在,你将在一个漂亮的类似 top 的终端 UI 中看到结果,如下所示。 + +![][4] + +使用 pingtop ping 多台服务器 + +* * * + +**建议阅读:** + + * [**一些你可能想知道的替代 “top” 命令的程序**][5] + + + +* * * + +我个人目前没有使用 pingtop 的情况。但我喜欢在这个在文本界面中展示 ping 命令输出的想法。试试看它,也许有帮助。 + +就是这些了。还有更多好东西。敬请期待! + +干杯! + +**资源:** + + * [**pingtop GitHub 仓库**][6] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/ + +作者:[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/2019/04/pingtop-720x340.png +[2]: https://www.ostechnix.com/ping-multiple-hosts-linux/ +[3]: https://www.ostechnix.com/manage-python-packages-using-pip/ +[4]: http://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-1.gif +[5]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/ +[6]: https://github.com/laixintao/pingtop From 17213bbec1815857ac43e6eb8b1687b3c7afa6a9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 May 2019 09:01:22 +0800 Subject: [PATCH 0333/1154] translating --- ...stalled Packages And Restore Those On Fresh Ubuntu System.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md index ab8efd7599..4e8182e240 100644 --- a/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md +++ b/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1dd93de3483a6201eafbbc87e993d4bc3ae35706 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 10:31:20 +0800 Subject: [PATCH 0334/1154] PRF:20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @warmfrog --- ... Computers- Alternative to Raspberry Pi.md | 156 +++++++----------- 1 file changed, 61 insertions(+), 95 deletions(-) diff --git a/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md index 4e1fc6a6e9..040290dd02 100644 --- a/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md +++ b/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -1,38 +1,38 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) [#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -12 个可替换 Raspberry Pi 的单片机 +12 个可替代树莓派的单板机 ================================ -_**简介: 正在寻找 Raspberry Pi 的替代品? 这里有一些单片机可以满足你的 DIY 渴求**_ +> 正在寻找树莓派的替代品?这里有一些单板机可以满足你的 DIY 渴求。 -Raspberry Pi 是当前最流行的单片机。你可以在你的 DIY 项目中使用它,或者用它作为一个成本效益高的系统来学习编代码,或者为了你的便利,利用一个[流媒体软件][1]运行在上面作为流媒体设备。 +树莓派是当前最流行的单板机。你可以在你的 DIY 项目中使用它,或者用它作为一个成本效益高的系统来学习编代码,或者为了你的便利,利用一个[流媒体软件][1]运行在上面作为流媒体设备。 -你可以使用 Raspberry Pi 做很多事,但它不是各种极客的最终解决方案。一些人可能在寻找更便宜的开发板,一些可能在寻找更强大的。 +你可以使用树莓派做很多事,但它不是各种极客的最终解决方案。一些人可能在寻找更便宜的开发板,一些可能在寻找更强大的。 -无论是哪种情况,我们都有很多原因需要 Raspberry Pi 的替代品。因此,在这片文章里,我们将讨论最好的十个我们认为能够替代 Raspberry Pi 的单片机。 +无论是哪种情况,我们都有很多原因需要树莓派的替代品。因此,在这片文章里,我们将讨论最好的 12 个我们认为能够替代树莓派的单板机。 ![][2] -### 满足你 DIY 渴望的 Raspberry Pi 替代品 +### 满足你 DIY 渴望的树莓派替代品 -这个列表没有特定的顺序排名。链接的一部分是附属链接。请阅读我们的[附属政策][3]. +这个列表没有特定的顺序排名。链接的一部分是赞助链接。请阅读我们的[赞助政策][3]。 -#### 1\. Onion Omega2+ +#### 1、Onion Omega2+ ![][4] -只要 **$13**,Omega2+ 是这里你可以找到的最便宜的 IoT 单片机设备。它运行 LEDE(Linux 嵌入式开发环境)Linux 系统 - 一个基于 [OpenWRT][5] 的分发版。 +只要 $13,Omega2+ 是这里你可以找到的最便宜的 IoT 单板机设备。它运行 LEDE(Linux 嵌入式开发环境)Linux 系统 —— 这是一个基于 [OpenWRT][5] 的发行版。 -由于运行一个自定义 Linux 系统,它的组成因素,花费,和灵活性使它完美适合几乎所有类型的 IoT 应用。 +由于运行一个自定义 Linux 系统,它的组成元件、花费和灵活性使它完美适合几乎所有类型的 IoT 应用。 -你可以在[亚马逊商城的 Onion Omega 装备][6]或者从他们的网站下单,可能会收取额外的邮费。 +你可以在[亚马逊商城的 Onion Omega 套件][6]或者从他们的网站下单,可能会收取额外的邮费。 **关键参数:** @@ -44,15 +44,15 @@ Raspberry Pi 是当前最流行的单片机。你可以在你的 DIY 项目中 * USB 2.0 * 12 GPIO Pins - [查看官网][7] +[查看官网][7] -#### 2\. NVIDIA Jetson Nano Developer Kit +#### 2、NVIDIA Jetson Nano Developer Kit -这是来自 NVIDIA 的只要 **$99** 的非常独特和有趣的 Raspberry Pi 替代品。是的,它不是每个人都能充分利用的设备 - 只为特定的一组极客或者开发者。 +这是来自 NVIDIA 的只要 **$99** 的非常独特和有趣的树莓派替代品。是的,它不是每个人都能充分利用的设备 —— 只为特定的一组极客或者开发者而生。 NVIDIA 使用下面的用例解释它: -> NVIDIA® Jetson Nano™ Developer Kit 是一个小的,强大的让你并行运行多个神经网络的应用像图像分类,对象侦察,分段,语音处理。全部在一个易于使用的运行功率只有 5 瓦特平台。 +> NVIDIA® Jetson Nano™ Developer Kit 是一个小的、强大的计算机,可以让你并行运行多个神经网络的应用像图像分类、对象侦察、图像分段、语音处理。全部在一个易于使用的、运行功率只有 5 瓦特的平台上。 > > nvidia @@ -66,20 +66,17 @@ NVIDIA 使用下面的用例解释它: * Display: HDMI 2.0 * 4 x USB 3.0 and eDP 1.4 +[查看官网][9] - -[查看官网 -][9] - -#### 3\. ASUS Tinker Board S +#### 3、ASUS Tinker Board S ![][10] -ASUS Tinker Board S 不是大多数可负担得起的可替代 Raspberry Pi 的替换设备 (**$82**, [亚马逊商城][11]),但是它是一个强大的替代品。它的特点是有你通常可以发现与标准 Raspberry Pi 3 Model 一样的 40 针脚的连接器,但是提供了强大的处理器和 GPU。同样的,Tinker Board S 的大小恰巧和标准的 Raspberry Pi 3 一样大。 +ASUS Tinker Board S 不是大多数人可负担得起的树莓派的替换设备 (**$82**,[亚马逊商城][11]),但是它是一个强大的替代品。它的特点是它有你通常可以发现与标准树莓派 3 一样的 40 针脚的连接器,但是提供了强大的处理器和 GPU。同样的,Tinker Board S 的大小恰巧和标准的树莓派3 一样大。 这个板子的主要亮点是 16 GB [eMMC][12] (用外行术语说,它的板上有一个类似 SSD 的存储单元使它工作时运行的更快。) 的存在。 -**关键参数** +**关键参数:** * Rockchip Quad-Core RK3288 processor * 2 GB DDR3 RAM @@ -92,20 +89,17 @@ ASUS Tinker Board S 不是大多数可负担得起的可替代 Raspberry Pi 的 * 28 GPIO pins * HDMI Interface +[查看网站][13] - -[查看网站 -][13] - -#### 4\. ClockworkPi +#### 4、ClockworkPi ![][14] -如果你在想方设法组装一个模块化的复古的游戏控制台,Clockwork Pi 通常是 [GameShell Kit][15] 的一部分。然而,你可以 使用 $49 单独购买板子。 +如果你正在想方设法组装一个模块化的复古的游戏控制台,Clockwork Pi 可能就是你需要的,它通常是 [GameShell Kit][15] 的一部分。然而,你可以 使用 $49 单独购买板子。 -它紧凑的大小,WiFi 连接性,和 micro HDMI 端口的存在使它成为很多事物的选择。 +它紧凑的大小、WiFi 连接性和 micro HDMI 端口的存在使它成为许多方面的选择。 -**关键参数** +**关键参数:** * Allwinner R16-J Quad-core Cortex-A7 CPU @1.2GHz * Mali-400 MP2 GPU @@ -114,41 +108,33 @@ ASUS Tinker Board S 不是大多数可负担得起的可替代 Raspberry Pi 的 * Micro HDMI output * MicroSD Card Slot +[查看官网][16] - -[查看官网 -][16] - -#### 5\. Arduino Mega 2560 +#### 5、Arduino Mega 2560 ![][17] -如果你正在研究机器人项目或者你想要一个 3D 打印机 - Arduino Mega 2560 将是 Raspberry Pi 的便利的替代品。不像 Raspberry Pi,它是基于微控制器而不是微处理器的。 +如果你正在研究机器人项目或者你想要一个 3D 打印机 —— Arduino Mega 2560 将是树莓派的便利的替代品。不像树莓派,它是基于微控制器而不是微处理器的。 -在他们的[官网][18],它会花费你 $38.50 或者在[在亚马逊商城 $33][19]。 +在他们的[官网][18],你需要花费 $38.50,或者在[在亚马逊商城是 $33][19]。 **关键参数:** -**Key Specifications:** - * Microcontroller: ATmega2560 * Clock Speed: 16 MHz * Digital I/O Pins: 54 * Analog Input Pins: 16 * Flash Memory: 256 KB of which 8 KB used by bootloader +[查看官网][18] - -[查看官网 -][18] - -#### 6\. Rock64 Media Board +#### 6、Rock64 Media Board ![][20] -对于与你可能想要 Raspberry Pi 3 B+ 相同的投资,你将在 Rock64 Media Board 上获得更快的处理器和双倍的内存。除此之外,如果你想要 1 GB RAM 版的,它提供了一个 Raspberry Pi 的 更便宜的替代,花费更少,只要 $10 。 +用与你可能想要的树莓派 3 B+ 相同的价格,你将在 Rock64 Media Board 上获得更快的处理器和双倍的内存。除此之外,如果你想要 1 GB RAM 版的,它提供了一个比树莓派更便宜的替代品,花费更少,只要 $10 。 -不像 Raspberry Pi,这里没有无线连接支持,但是 USB 3.0 和 HDMI 2.0 的存在使它与众不同,如果它对你很重要的话。 +不像树莓派,它没有无线连接支持,但是 USB 3.0 和 HDMI 2.0 的存在使它与众不同,如果它对你很重要的话。 **关键参数:** @@ -159,20 +145,18 @@ ASUS Tinker Board S 不是大多数可负担得起的可替代 Raspberry Pi 的 * USB 3.0 * HDMI 2.0 +[查看官网][21] - -[查看官网 -][21] - -#### 7\. Odroid-XU4 +#### 7、Odroid-XU4 ![][22] -Odroid-XU4 是一个完美的 Raspberry Pi 的替代,如果你有能够稍微提高预算的空间($80-$100 甚至更低,取决于存储的容量)。 +Odroid-XU4 是一个完美的树莓派的替代品,如果你有能够稍微提高预算的空间($80-$100 甚至更低,取决于存储的容量)。 -它确实是一个强大的替代并且体积更小。 支持 eMMC 和 USB 3.0 使它工作起来更快。 +它确实是一个强大的替代品并且体积更小。支持 eMMC 和 USB 3.0 使它工作起来更快。 **关键参数:** + * Samsung Exynos 5422 Octa ARM Cortex™-A15 Quad 2Ghz and Cortex™-A7 Quad 1.3GHz CPUs * 2Gbyte LPDDR3 RAM * GPU: Mali-T628 MP6 @@ -181,16 +165,13 @@ Odroid-XU4 是一个完美的 Raspberry Pi 的替代,如果你有能够稍微提 * eMMC 5.0 module socket * MicroSD Card Slot +[查看官网][23] - -[查看官网 -][23] - -#### 8\. **PocketBeagle** +#### 8、PocketBeagle ![][24] -它是一个难以置信的小的单片机 - 几乎和 Raspberry Pi Zero 相似。然而它会花费完全大小的 Raspberry Pi 3 相同的价格。主要的亮点是你可以用它作为一个 USB 便携式信息终端 并且进入 Linux 命令行工作。 +它是一个难以置信的小的单板机 —— 几乎和树莓派Zero 相似。然而它的价格相当于完整大小的树莓派 3。主要的亮点是你可以用它作为一个 USB 便携式信息终端,并且进入 Linux 命令行工作。 **关键参数:** @@ -200,22 +181,18 @@ Odroid-XU4 是一个完美的 Raspberry Pi 的替代,如果你有能够稍微提 * microUSB * USB 2.0 +[查看官网][25] - -[查看官网 -][25] - -#### 9\. Le Potato +#### 9、Le Potato ![][26] -由 [Libre Computer][27] 出品的 Le Potato,同样被它的型号 AML-S905X-CC 标识。它花费你 [$45][28]。 +由 [Libre Computer][27] 出品的 Le Potato,其型号是 AML-S905X-CC。它需要花费你 [$45][28]。 -如果你花费的比 Raspberry Pi 更多的钱,你就能得到想要双倍内存和 HDMI 2.0 接口,这可能是一个完美的选择。尽管,你还是不能发现嵌入的无线连接。 +如果你花费的比树莓派更多的钱,你就能得到双倍内存和 HDMI 2.0 接口,这可能是一个完美的选择。尽管,你还是不能找到嵌入的无线连接。 **关键参数:** - * Amlogic S905X SoC * 2GB DDR3 SDRAM * USB 2.0 @@ -224,18 +201,15 @@ Odroid-XU4 是一个完美的 Raspberry Pi 的替代,如果你有能够稍微提 * MicroSD Card Slot * eMMC Interface +[查看官网][29] - -[查看官网 -][29] - -#### 10\. Banana Pi M64 +#### 10、Banana Pi M64 ![][30] -它自带了 8 Gigs 的 eMMC - 是替代 Raspberry Pi 的主要亮点。由于相同的原因,它花费 $60。 +它自带了 8G 的 eMMC —— 这是替代树莓派的主要亮点。因此,它需要花费 $60。 -HDMI 接口的存在使它胜任 4K。除此之外,Banana Pi 提供了更多种类的开源单片机作为 Raspberry Pi 的替代。 +HDMI 接口的存在使它胜任 4K。除此之外,Banana Pi 提供了更多种类的开源单板机作为树莓派的替代。 **关键参数:** @@ -246,18 +220,15 @@ HDMI 接口的存在使它胜任 4K。除此之外,Banana Pi 提供了更多 * USB 2.0 * HDMI +[查看官网][31] - -[查看官网 -][31] - -#### 11\. Orange Pi Zero +#### 11、Orange Pi Zero ![][32] -Orange Pi Zero 相对于 Raspberry Pi 难以置信的便宜。你可以在 Aliexpress 或者亚马逊上以最多 $10 就能够获得。如果[稍微投资多点,你能够获得 512 MB RAM][33]。 +Orange Pi Zero 相对于树莓派来说难以置信的便宜。你可以在 Aliexpress 或者亚马逊上以最多 $10 就能够获得。如果[稍微多花点,你能够获得 512 MB RAM][33]。 -如果这还不够充分,你可以花费大概 $25 获得更好的配置像 Orange Pi 3。 +如果这还不够,你可以花费大概 $25 获得更好的配置,比如 Orange Pi 3。 **关键参数:** @@ -268,18 +239,15 @@ Orange Pi Zero 相对于 Raspberry Pi 难以置信的便宜。你可以在 Aliex * WiFi * USB 2.0 +[查看官网][34] - -[查看官网 -][34] - -#### 12\. VIM 2 SBC by Khadas +#### 12、VIM 2 SBC by Khadas ![][35] -由 Khadas 出品的 VIM 2 是最新的单片机,因此你能够在板上获取到蓝牙 5.0。[从 $99 的基础款到上限 $140][36]. +由 Khadas 出品的 VIM 2 是最新的单板机,因此你能够在板上得到蓝牙 5.0 支持。它的价格范围[从 $99 的基础款到上限 $140][36]。 -基础款包含 2 GB RAM,16 GB eMMC 和蓝牙 4.1。然而,Pro/Max 版包含蓝牙 5.0,更多的内存,更多的 eMMC 存储。 +基础款包含 2 GB RAM、16 GB eMMC 和蓝牙 4.1。然而,Pro/Max 版包含蓝牙 5.0,更多的内存,更多的 eMMC 存储。 **关键参数:** @@ -292,13 +260,11 @@ Orange Pi Zero 相对于 Raspberry Pi 难以置信的便宜。你可以在 Aliex * HDMI 2.0a * WiFi +### 总结 +我们知道有很多不同种类的单板机电脑。一些比树莓派更好 —— 它的一些小规格的版本有更便宜的价格。同样的,像 Jetson Nano 这样的单板机已经被裁剪用于特定用途。因此,取决于你需要什么 —— 你应该检查一下单板机的配置。 -**总结** - -我们知道有很多不同种类的单片机电脑。一些比 Raspberry Pi 更好 - 它的一些小规格的版本有更便宜的价格。同样的,单片机像 Jetson Nano 已经被裁剪用于特定用途。因此,取决于你需要什么 - 你应该验证单片机的配置。 - -如果你认为你知道比上述提到的更好的东西,请随意在下方评论来让我们知道。 +如果你知道比上述提到的更好的东西,请随意在下方评论来让我们知道。 -------------------------------------------------------------------------------- @@ -307,7 +273,7 @@ via: https://itsfoss.com/raspberry-pi-alternatives/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f788d4308365d085d7ffbe2bfa4172ff2d272a8c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 10:31:51 +0800 Subject: [PATCH 0335/1154] PUB:20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @warmfrog https://linux.cn/article-10823-1.html --- ... 12 Single Board Computers- Alternative to Raspberry Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md (99%) diff --git a/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/published/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md similarity index 99% rename from translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md rename to published/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md index 040290dd02..742fca39da 100644 --- a/translated/tech/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md +++ b/published/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10823-1.html) [#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) [#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 8fc6bd0f7791553ef8ced1d8754240bd97358129 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 11:00:46 +0800 Subject: [PATCH 0336/1154] PRF:20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @geekpi --- ...And Show The Output In Top-like Text UI.md | 47 +++++++------------ 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md index 64a9e54a8f..7e81e0c601 100644 --- a/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md +++ b/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -1,36 +1,34 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) [#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) [#]: author: (sk https://www.ostechnix.com/author/sk/) -ping 多台服务器并在类似 top 的文本 UI 中显示 +ping 多台服务器并在类似 top 的界面中显示 ====== ![Ping Multiple Servers And Show The Output In Top-like Text UI][1] -不久前,我们写了篇关于 [**“fping”**][2] 的文章,该程序能使我们能够同时 ping 多台主机。与传统的 **“ping”** 不同,fping 不会等待一台主机的超时。它使用循环法,这表示它将 ICMP Echo 请求发送到一台主机,然后转到另一台主机,最后一次显示哪些主机开启或关闭。今天,我们将讨论一个名为 **“pingtop”** 的类似程序。顾名思义,它会一次 ping 多台服务器,并在类似 top 的终端 UI 中显示结果。它是用 **Python** 写的免费开源程序。 +不久前,我们写了篇关于 [fping][2] 的文章,该程序能使我们能够同时 ping 多台主机。与传统的 `ping` 不同,`fping` 不会等待一台主机的超时。它使用循环法,这表示它将 ICMP Echo 请求发送到一台主机,然后转到另一台主机,最后一次显示哪些主机开启或关闭。今天,我们将讨论一个名为 `pingtop` 的类似程序。顾名思义,它会一次 ping 多台服务器,并在类似 `top` 的终端 UI 中显示结果。它是用 Python 写的自由开源程序。 ### 安装 pingtop -可以使用 pip 安装 pingtop,pip 是一个软件包管理器,用于安装用 Python 开发的程序。确保已在 Linux 中安装了 Python 3.7.x 和 pip。 +可以使用 `pip` 安装 `pingtop`,`pip` 是一个软件包管理器,用于安装用 Python 开发的程序。确保已在 Linux 中安装了 Python 3.7.x 和 pip。 -要在Linux上安装 pip,请参阅以下链接。 +要在 Linux 上安装 `pip`,请参阅以下链接。 - * [**如何使用 pip 管理 Python 包**][3] +* [如何使用 pip 管理 Python 包][3] - - -安装 pip 后,运行以下命令安装 pingtop: +安装 `pip` 后,运行以下命令安装 `pingtop`: ``` $ pip install pingtop ``` -现在让我们继续使用 pingtop ping 多个系统。 +现在让我们继续使用 `pingtop` ping 多个系统。 ### ping 多台服务器并在类似 top 的终端 UI 中显示 @@ -40,33 +38,24 @@ $ pip install pingtop $ pingtop ostechnix.com google.com facebook.com twitter.com ``` -现在,你将在一个漂亮的类似 top 的终端 UI 中看到结果,如下所示。 +现在,你将在一个漂亮的类似 `top` 的终端 UI 中看到结果,如下所示。 ![][4] -使用 pingtop ping 多台服务器 - -* * * - -**建议阅读:** - - * [**一些你可能想知道的替代 “top” 命令的程序**][5] +*使用 pingtop ping 多台服务器* +建议阅读: -* * * + * [一些你可能想知道的替代 “top” 命令的程序][5] 我个人目前没有使用 pingtop 的情况。但我喜欢在这个在文本界面中展示 ping 命令输出的想法。试试看它,也许有帮助。 -就是这些了。还有更多好东西。敬请期待! - -干杯! - -**资源:** - - * [**pingtop GitHub 仓库**][6] +就是这些了。还有更多好东西。敬请期待!干杯! +资源: + * [pingtop GitHub 仓库][6] -------------------------------------------------------------------------------- @@ -74,8 +63,8 @@ via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top- 作者:[sk][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -83,7 +72,7 @@ via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top- [b]: https://github.com/lujun9972 [1]: https://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-720x340.png [2]: https://www.ostechnix.com/ping-multiple-hosts-linux/ -[3]: https://www.ostechnix.com/manage-python-packages-using-pip/ +[3]: https://linux.cn/article-10110-1.html [4]: http://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-1.gif [5]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/ [6]: https://github.com/laixintao/pingtop From 051e905bee12e9e37a19faf6a2aea0bae5a5fcfc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 11:01:22 +0800 Subject: [PATCH 0337/1154] PUB:20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @geekpi https://linux.cn/article-10824-1.html --- ...ultiple Servers And Show The Output In Top-like Text UI.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md (97%) diff --git a/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/published/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md similarity index 97% rename from translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md rename to published/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md index 7e81e0c601..8d90b5b520 100644 --- a/translated/tech/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md +++ b/published/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10824-1.html) [#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) [#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 0c02e96c6b0640e4ff93951870690fff5ac56ff0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 12:27:17 +0800 Subject: [PATCH 0338/1154] PRF:20190415 Inter-process communication in Linux- Shared storage.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @FSSlc 辛苦了 --- ... communication in Linux- Shared storage.md | 137 ++++++++++-------- 1 file changed, 73 insertions(+), 64 deletions(-) diff --git a/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md b/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md index 3ee39094a6..101c2f2cb3 100644 --- a/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md +++ b/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (FSSlc) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Inter-process communication in Linux: Shared storage) @@ -10,7 +10,8 @@ Linux 下的进程间通信:共享存储 ====== -学习在 Linux 中进程是如何与其他进程进行同步的。 +> 学习在 Linux 中进程是如何与其他进程进行同步的。 + ![Filing papers and documents][1] 本篇是 Linux 下[进程间通信][2](IPC)系列的第一篇文章。这个系列将使用 C 语言代码示例来阐明以下 IPC 机制: @@ -22,21 +23,22 @@ Linux 下的进程间通信:共享存储 * 套接字 * 信号 -在聚焦上面提到的共享文件和共享内存这两个机制之前,这篇文章将复习一些核心的概念。 +在聚焦上面提到的共享文件和共享内存这两个机制之前,这篇文章将带你回顾一些核心的概念。 ### 核心概念 -_进程_ 是运行着的程序,每个进程都有着它自己的地址空间,这些空间由进程被允许获取的内存地址组成。进程有一个或多个执行 _线程_,而线程是一系列执行指令的集合: _单线程_ 进程就只有一个线程,而 _多线程_ 的进程则有多个线程。一个进程中的线程共享各种资源,特别是地址空间。另外,一个进程中的线程可以直接通过共享内存来进行通信,尽管某些现代语言(例如 Go)鼓励一种更有序的方式例如使用线程安全的通道。当然对于不同的进程,默认情况下,它们 _不_ 能共享内存。 -启动进程后进行通信有多种方法,下面所举的例子中主要使用了下面的两种方法: +*进程*是运行着的程序,每个进程都有着它自己的地址空间,这些空间由进程被允许访问的内存地址组成。进程有一个或多个执行*线程*,而线程是一系列执行指令的集合:*单线程*进程就只有一个线程,而*多线程*的进程则有多个线程。一个进程中的线程共享各种资源,特别是地址空间。另外,一个进程中的线程可以直接通过共享内存来进行通信,尽管某些现代语言(例如 Go)鼓励一种更有序的方式,例如使用线程安全的通道。当然对于不同的进程,默认情况下,它们**不**能共享内存。 + +有多种方法启动之后要进行通信的进程,下面所举的例子中主要使用了下面的两种方法: * 一个终端被用来启动一个进程,另外一个不同的终端被用来启动另一个。 - * 在一个进程(父进程)中调用系统函数 **fork**,以此生发另一个进程(子进程)。 + * 在一个进程(父进程)中调用系统函数 `fork`,以此生发另一个进程(子进程)。 第一个例子采用了上面使用终端的方法。这些[代码示例][3]的 ZIP 压缩包可以从我的网站下载到。 ### 共享文件 -程序员对文件获取问题应该都已经很熟识了,包括许多坑(不存在的文件、文件权限损坏等等),这些问题困扰着程序对文件的使用。尽管如此,共享文件可能是最为基础的 IPC 机制了。考虑一下下面这样一个相对简单的例子,其中一个进程(_生产者_)创建和写入一个文件,然后另一个进程(_消费者_)从这个相同的文件中进行读取: +程序员对文件访问应该都已经很熟识了,包括许多坑(不存在的文件、文件权限损坏等等),这些问题困扰着程序对文件的使用。尽管如此,共享文件可能是最为基础的 IPC 机制了。考虑一下下面这样一个相对简单的例子,其中一个进程(生产者 `producer`)创建和写入一个文件,然后另一个进程(消费者 `consumer `)从这个相同的文件中进行读取: ``` writes +-----------+ reads @@ -44,16 +46,16 @@ producer-------->| disk file |<-------consumer +-----------+ ``` -在使用这个 IPC 机制时最明显的挑战是 _竞争条件_ 可能会发生:生产者和消费者可能恰好在同一时间访问该文件,从而使得输出结果不确定。为了避免竞争条件的发生,该文件在处于 _读_ 或 _写_ 状态时必须以某种方式处于被锁状态,从而阻止在 _写_ 操作执行时和其他操作的冲突。在标准系统库中与锁相关的 API 可以被总结如下: +在使用这个 IPC 机制时最明显的挑战是*竞争条件*可能会发生:生产者和消费者可能恰好在同一时间访问该文件,从而使得输出结果不确定。为了避免竞争条件的发生,该文件在处于*读*或*写*状态时必须以某种方式处于被锁状态,从而阻止在*写*操作执行时和其他操作的冲突。在标准系统库中与锁相关的 API 可以被总结如下: - * 生产者应该在写入文件时获得一个文件的排斥锁。一个 _排斥_ 锁最多被一个进程所拥有。这样就可以排除掉竞争条件的发生,因为在锁被释放之前没有其他的进程可以访问这个文件。 - * 消费者应该在从文件中读取内容时得到至少一个共享锁。多个 _readers_ 可以同时保有一个 _共享_ 锁,但是没有 _writer_ 可以获取到文件内容,甚至在当一个单独的 _reader_ 保有一个共享锁时。 + * 生产者应该在写入文件时获得一个文件的排斥锁。一个*排斥*锁最多被一个进程所拥有。这样就可以排除掉竞争条件的发生,因为在锁被释放之前没有其他的进程可以访问这个文件。 + * 消费者应该在从文件中读取内容时得到至少一个共享锁。多个*读取者*可以同时保有一个*共享*锁,但是没有*写入者*可以获取到文件内容,甚至在当只有一个*读取者*保有一个共享锁时。 共享锁可以提升效率。假如一个进程只是读入一个文件的内容,而不去改变它的内容,就没有什么原因阻止其他进程来做同样的事。但如果需要写入内容,则很显然需要文件有排斥锁。 -标准的 I/O 库中包含一个名为 **fcntl** 的实用函数,它可以被用来检查或者操作一个文件上的排斥锁和共享锁。该函数通过一个 _文件描述符_ (一个在进程中的非负整数值)来标记一个文件(在不同的进程中不同的文件描述符可能标记同一个物理文件)。对于文件的锁定, Linux 提供了名为 **flock** 的库函数,它是 **fcntl** 的一个精简包装。第一个例子中使用 **fcntl** 函数来暴露这些 API 细节。 +标准的 I/O 库中包含一个名为 `fcntl` 的实用函数,它可以被用来检查或者操作一个文件上的排斥锁和共享锁。该函数通过一个*文件描述符*(一个在进程中的非负整数值)来标记一个文件(在不同的进程中不同的文件描述符可能标记同一个物理文件)。对于文件的锁定, Linux 提供了名为 `flock` 的库函数,它是 `fcntl` 的一个精简包装。第一个例子中使用 `fcntl` 函数来暴露这些 API 细节。 -#### 示例 1. _生产者_ 程序 +#### 示例 1. 生产者程序 ```c #include @@ -104,27 +106,30 @@ int main() { } ``` -上面 _生产者_ 程序的主要步骤可以总结如下: +上面生产者程序的主要步骤可以总结如下: - * 这个程序首先声明了一个类型为 **struct flock** 的变量,它代表一个锁,并对它的 5 个域做了初始化。第一个初始化 -```c + * 这个程序首先声明了一个类型为 `struct flock` 的变量,它代表一个锁,并对它的 5 个域做了初始化。第一个初始化 + + ```c lock.l_type = F_WRLCK; /* exclusive lock */ -```` -使得这个锁为排斥锁(_read-write_)而不是一个共享锁(_read-only_)。假如 _生产者_ 获得了这个锁,则其他的进程将不能够对文件做读或者写操作,直到 _生产者_ 释放了这个锁,或者显式地调用 **fcntl**,又或者隐式地关闭这个文件。(当进程终止时,所有被它打开的文件都会被自动关闭,从而释放了锁) - * 上面的程序接着初始化其他的域。主要的效果是 _整个_ 文件都将被锁上。但是,有关锁的 API 允许特别指定的字节被上锁。例如,假如文件包含多个文本记录,则单个记录(或者甚至一个记录的一部分)可以被锁,而其余部分不被锁。 - * 第一次调用 **fcntl** -```c +``` + 使得这个锁为排斥锁(read-write)而不是一个共享锁(read-only)。假如生产者获得了这个锁,则其他的进程将不能够对文件做读或者写操作,直到生产者释放了这个锁,或者显式地调用 `fcntl`,又或者隐式地关闭这个文件。(当进程终止时,所有被它打开的文件都会被自动关闭,从而释放了锁) + * 上面的程序接着初始化其他的域。主要的效果是*整个*文件都将被锁上。但是,有关锁的 API 允许特别指定的字节被上锁。例如,假如文件包含多个文本记录,则单个记录(或者甚至一个记录的一部分)可以被锁,而其余部分不被锁。 + * 第一次调用 `fcntl` + + ```c if (fcntl(fd, F_SETLK, &lock) < 0) ``` -尝试排斥性地将文件锁住,并检查调用是否成功。一般来说, **fcntl** 函数返回 **-1** (因此小于 0)意味着失败。第二个参数 **F_SETLK** 意味着 **fcntl** 的调用 _不是_ 堵塞的;函数立即做返回,要么获得锁,要么显示失败了。假如替换地使用 **F_SETLKW**(末尾的 **W** 代指 _等待_),那么对 **fcntl** 的调用将是阻塞的,直到有可能获得锁的时候。在调用 **fcntl** 函数时,它的第一个参数 **fd** 指的是文件描述符,第二个参数指定了将要采取的动作(在这个例子中,**F_SETLK** 指代设置锁),第三个参数为锁结构的地址(在本例中,指的是 **& lock**)。 - * 假如 _生产者_ 获得了锁,这个程序将向文件写入两个文本记录。 - * 在向文件写入内容后,_生产者_ 改变锁结构中的 **l_type** 域为 _unlock_ 值: -```c + 尝试排斥性地将文件锁住,并检查调用是否成功。一般来说, `fcntl` 函数返回 `-1` (因此小于 0)意味着失败。第二个参数 `F_SETLK` 意味着 `fcntl` 的调用*不是*堵塞的;函数立即做返回,要么获得锁,要么显示失败了。假如替换地使用 `F_SETLKW`(末尾的 `W` 代指*等待*),那么对 `fcntl` 的调用将是阻塞的,直到有可能获得锁的时候。在调用 `fcntl` 函数时,它的第一个参数 `fd` 指的是文件描述符,第二个参数指定了将要采取的动作(在这个例子中,`F_SETLK` 指代设置锁),第三个参数为锁结构的地址(在本例中,指的是 `&lock`)。 + * 假如生产者获得了锁,这个程序将向文件写入两个文本记录。 + * 在向文件写入内容后,生产者改变锁结构中的 `l_type` 域为 `unlock` 值: + + ```c lock.l_type = F_UNLCK; ``` -并调用 **fcntl** 来执行解锁操作。最后程序关闭了文件并退出。 + 并调用 `fcntl` 来执行解锁操作。最后程序关闭了文件并退出。 -#### 示例 2. _消费者_ 程序 +#### 示例 2. 消费者程序 ```c #include @@ -175,7 +180,7 @@ int main() { } ``` -相比于着重解释锁的 API,_消费者_ 程序会相对复杂一点儿。特别的,_消费者_ 程序首先检查文件是否被排斥性的被锁,然后才尝试去获得一个共享锁。相关的代码为: +相比于锁的 API,消费者程序会相对复杂一点儿。特别的,消费者程序首先检查文件是否被排斥性的被锁,然后才尝试去获得一个共享锁。相关的代码为: ``` lock.l_type = F_WRLCK; @@ -185,11 +190,11 @@ if (lock.l_type != F_UNLCK) report_and_exit("file is still write locked..."); ``` -在 **fcntl** 调用中的 **F_GETLK** 操作指定检查一个锁,在本例中,上面代码的声明中给了一个 **F_WRLCK** 的排斥锁。假如特指的锁不存在,那么 **fcntl** 调用将会自动地改变锁类型域为 **F_UNLCK** 以此来显示当前的状态。假如文件是排斥性地被锁,那么 _消费者_ 将会终止。(一个更健壮的程序版本或许应该让 _消费者_ _睡_ 会儿,然后再尝试几次。) +在 `fcntl` 调用中的 `F_GETLK` 操作指定检查一个锁,在本例中,上面代码的声明中给了一个 `F_WRLCK` 的排斥锁。假如特指的锁不存在,那么 `fcntl` 调用将会自动地改变锁类型域为 `F_UNLCK` 以此来显示当前的状态。假如文件是排斥性地被锁,那么消费者将会终止。(一个更健壮的程序版本或许应该让消费者*睡*会儿,然后再尝试几次。) -假如当前文件没有被锁,那么 _消费者_ 将尝试获取一个共享(_read-only_)锁(**F_RDLCK**)。为了缩短程序,**fcntl** 中的 **F_GETLK** 调用可以丢弃,因为假如其他进程已经保有一个 _读写_ 锁,**F_RDLCK** 的调用就可能会失败。重新调用一个 _只读_ 锁能够阻止其他进程向文件进行写的操作,但可以允许其他进程对文件进行读取。简而言之,共享锁可以被多个进程所保有。在获取了一个共享锁后,_消费者_ 程序将立即从文件中读取字节数据,然后在标准输出中打印这些字节的内容,接着释放锁,关闭文件并终止。 +假如当前文件没有被锁,那么消费者将尝试获取一个共享(read-only)锁(`F_RDLCK`)。为了缩短程序,`fcntl` 中的 `F_GETLK` 调用可以丢弃,因为假如其他进程已经保有一个读写锁,`F_RDLCK` 的调用就可能会失败。重新调用一个只读锁能够阻止其他进程向文件进行写的操作,但可以允许其他进程对文件进行读取。简而言之,共享锁可以被多个进程所保有。在获取了一个共享锁后,消费者程序将立即从文件中读取字节数据,然后在标准输出中打印这些字节的内容,接着释放锁,关闭文件并终止。 -下面的 **%** 为命令行提示符,下面展示的是从相同终端开启这两个程序的输出: +下面的 `%` 为命令行提示符,下面展示的是从相同终端开启这两个程序的输出: ``` % ./producer @@ -204,11 +209,11 @@ Made glorious summer by this sun of York ### 共享内存 -对于共享内存,Linux 系统提供了两类不同的 API:传统的 System V API 和更新一点的 POSIX API。在单个应用中,这些 API 不能混用。但是, POSIX 方式的一个坏处是它的特性仍在发展中,并且依赖于安装的内核版本,这非常影响代码的可移植性。例如, 默认情况下,POSIX API 用 _内存映射文件_ 来实现共享内存:对于一个共享的内存段,系统为相应的内容维护一个 _备份文件_。在 POSIX 规范下共享内存可以被配置为不需要备份文件,但这可能会影响可移植性。我的例子中使用的是带有备份文件的 POSIX API,这既结合了内存获取的速度优势,又获得了文件存储的持久性。 +对于共享内存,Linux 系统提供了两类不同的 API:传统的 System V API 和更新一点的 POSIX API。在单个应用中,这些 API 不能混用。但是,POSIX 方式的一个坏处是它的特性仍在发展中,并且依赖于安装的内核版本,这非常影响代码的可移植性。例如,默认情况下,POSIX API 用*内存映射文件*来实现共享内存:对于一个共享的内存段,系统为相应的内容维护一个*备份文件*。在 POSIX 规范下共享内存可以被配置为不需要备份文件,但这可能会影响可移植性。我的例子中使用的是带有备份文件的 POSIX API,这既结合了内存获取的速度优势,又获得了文件存储的持久性。 -下面的共享内存例子中包含两个程序,分别名为 _memwriter_ 和 _memreader_,并使用 _信号量_ 来调整它们对共享内存的获取。在任何时候当共享内存进入一个 _writer_ 的版图时,无论是多进程还是多线程,都有遇到基于内存的竞争条件的风险,所以,需要引入信号量来协调(同步)对共享内存的获取。 +下面的共享内存例子中包含两个程序,分别名为 `memwriter` 和 `memreader`,并使用*信号量*来调整它们对共享内存的获取。在任何时候当共享内存进入一个*写入者*场景时,无论是多进程还是多线程,都有遇到基于内存的竞争条件的风险,所以,需要引入信号量来协调(同步)对共享内存的获取。 -_memwriter_ 程序应当在它自己所处的终端首先启动,然后 _memreader_ 程序才可以在它自己所处的终端启动(在接着的十几秒内)。_memreader_ 的输出如下: +`memwriter` 程序应当在它自己所处的终端首先启动,然后 `memreader` 程序才可以在它自己所处的终端启动(在接着的十几秒内)。`memreader` 的输出如下: ``` This is the way the world ends... @@ -216,11 +221,11 @@ This is the way the world ends... 在每个源程序的最上方注释部分都解释了在编译它们时需要添加的链接参数。 -首先让我们复习一下信号量是如何作为一个同步机制工作的。一般的信号量也被叫做一个 _计数信号量_,因为带有一个可以增加的值(通常初始化为 0)。考虑一家租用自行车的商店,在它的库存中有 100 辆自行车,还有一个供职员用于租赁的程序。每当一辆自行车被租出去,信号量就增加 1;当一辆自行车被还回来,信号量就减 1。在信号量的值为 100 之前都还可以进行租赁业务,但如果等于 100 时,就必须停止业务,直到至少有一辆自行车被还回来,从而信号量减为 99。 +首先让我们复习一下信号量是如何作为一个同步机制工作的。一般的信号量也被叫做一个*计数信号量*,因为带有一个可以增加的值(通常初始化为 0)。考虑一家租用自行车的商店,在它的库存中有 100 辆自行车,还有一个供职员用于租赁的程序。每当一辆自行车被租出去,信号量就增加 1;当一辆自行车被还回来,信号量就减 1。在信号量的值为 100 之前都还可以进行租赁业务,但如果等于 100 时,就必须停止业务,直到至少有一辆自行车被还回来,从而信号量减为 99。 -_二元信号量_ 是一个特例,它只有两个值: 0 和 1。在这种情况下,信号量的表现为 _互斥量_(一个互斥的构造)。下面的共享内存示例将把信号量用作互斥量。当信号量的值为 0 时,只有 _memwriter_ 可以获取共享内存,在写操作完成后,这个进程将增加信号量的值,从而允许 _memreader_ 来读取共享内存。 +*二元信号量*是一个特例,它只有两个值:0 和 1。在这种情况下,信号量的表现为*互斥量*(一个互斥的构造)。下面的共享内存示例将把信号量用作互斥量。当信号量的值为 0 时,只有 `memwriter` 可以获取共享内存,在写操作完成后,这个进程将增加信号量的值,从而允许 `memreader` 来读取共享内存。 -#### 示例 3. _memwriter_ 进程的源程序 +#### 示例 3. memwriter 进程的源程序 ```c /** Compilation: gcc -o memwriter memwriter.c -lrt -lpthread **/ @@ -281,15 +286,17 @@ int main() { } ``` -下面是 _memwriter_ 和 _memreader_ 程序如何通过共享内存来通信的一个总结: +下面是 `memwriter` 和 `memreader` 程序如何通过共享内存来通信的一个总结: - * 上面展示的 _memwriter_ 程序调用 **shm_open** 函数来得到作为系统协调共享内存的备份文件的文件描述符。此时,并没有内存被分配。接下来调用的是令人误解的名为 **ftruncate** 的函数 -```c + * 上面展示的 `memwriter` 程序调用 `shm_open` 函数来得到作为系统协调共享内存的备份文件的文件描述符。此时,并没有内存被分配。接下来调用的是令人误解的名为 `ftruncate` 的函数 + + ```c ftruncate(fd, ByteSize); /* get the bytes */ ``` -它将分配 **ByteSize** 字节的内存,在该情况下,一般为大小适中的 512 字节。_memwriter_ 和 _memreader_ 程序都只从共享内存中获取数据,而不是从备份文件。系统将负责共享内存和备份文件之间数据的同步。 - * 接着 _memwriter_ 调用 **mmap** 函数: -```c + 它将分配 `ByteSize` 字节的内存,在该情况下,一般为大小适中的 512 字节。`memwriter` 和 `memreader` 程序都只从共享内存中获取数据,而不是从备份文件。系统将负责共享内存和备份文件之间数据的同步。 + * 接着 `memwriter` 调用 `mmap` 函数: + + ```c caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ ByteSize, /* how many bytes */ PROT_READ | PROT_WRITE, /* access protections */ @@ -297,27 +304,29 @@ caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ fd, /* file descriptor */ 0); /* offset: start at 1st byte */ ``` -来获得共享内存的指针。(_memreader_ 也做一次类似的调用。) 指针类型 **caddr_t** 以 **c** 开头,它代表 **calloc**,而这是动态初始化分配的内存为 0 的一个系统函数。_memwriter_ 通过库函数 **strcpy**(string copy)来获取后续 _写_ 操作的 **memptr**。 - * 到现在为止, _memwriter_ 已经准备好进行写操作了,但首先它要创建一个信号量来确保共享内存的排斥性。假如 _memwriter_ 正在执行写操作而同时 _memreader_ 在执行读操作,则有可能出现竞争条件。假如调用 **sem_open** - 成功了: -```c + 来获得共享内存的指针。(`memreader` 也做一次类似的调用。) 指针类型 `caddr_t` 以 `c` 开头,它代表 `calloc`,而这是动态初始化分配的内存为 0 的一个系统函数。`memwriter` 通过库函数 `strcpy`(字符串复制)来获取后续*写*操作的 `memptr`。 + * 到现在为止,`memwriter` 已经准备好进行写操作了,但首先它要创建一个信号量来确保共享内存的排斥性。假如 `memwriter` 正在执行写操作而同时 `memreader` 在执行读操作,则有可能出现竞争条件。假如调用 `sem_open` 成功了: + + ```c sem_t* semptr = sem_open(SemaphoreName, /* name */ O_CREAT, /* create the semaphore */ AccessPerms, /* protection perms */ 0); /* initial value */ ``` -那么,接着写操作便可以执行。上面的 **SemaphoreName**(任意一个唯一的非空名称)用来在 _memwriter_ 和 _memreader_ 识别信号量。 初始值 0 将会传递给信号量的创建者,在这个例子中指的是 _memwriter_ 赋予它执行 _写_ 操作的权利。 - * 在写操作完成后,_memwriter_ 通过调用 **sem_post** 函数将信号量的值增加到 1: -```c + 那么,接着写操作便可以执行。上面的 `SemaphoreName`(任意一个唯一的非空名称)用来在 `memwriter` 和 `memreader` 识别信号量。初始值 0 将会传递给信号量的创建者,在这个例子中指的是 `memwriter` 赋予它执行*写*操作的权利。 + * 在写操作完成后,`memwriter* 通过调用 `sem_post` 函数将信号量的值增加到 1: + + ```c if (sem_post(semptr) < 0) .. ``` -增加信号了将释放互斥锁,使得 _memreader_ 可以执行它的 _读_ 操作。为了更好地测量,_memwriter_ 也将从它自己的地址空间中取消映射, -```c + 增加信号了将释放互斥锁,使得 `memreader` 可以执行它的*读*操作。为了更好地测量,`memwriter` 也将从它自己的地址空间中取消映射, + + ```c munmap(memptr, ByteSize); /* unmap the storage * ``` -这将使得 _memwriter_ 不能进一步地访问共享内存。 + 这将使得 `memwriter` 不能进一步地访问共享内存。 -#### 示例 4. _memreader_ 进程的源代码 +#### 示例 4. memreader 进程的源代码 ```c /** Compilation: gcc -o memreader memreader.c -lrt -lpthread **/ @@ -372,45 +381,45 @@ int main() { return 0; } ``` -_memwriter_ 和 _memreader_ 程序中,共享内存的主要着重点都在 **shm_open** 和 **mmap** 函数上:在成功时,第一个调用返回一个备份文件的文件描述符,而第二个调用则使用这个文件描述符从共享内存段中获取一个指针。它们对 **shm_open** 的调用都很相似,除了 _memwriter_ 程序创建共享内存,而 _memreader_ 只获取这个已经创建 -的内存: + +`memwriter` 和 `memreader` 程序中,共享内存的主要着重点都在 `shm_open` 和 `mmap` 函数上:在成功时,第一个调用返回一个备份文件的文件描述符,而第二个调用则使用这个文件描述符从共享内存段中获取一个指针。它们对 `shm_open` 的调用都很相似,除了 `memwriter` 程序创建共享内存,而 `memreader 只获取这个已经创建的内存: ```c int fd = shm_open(BackingFile, O_RDWR | O_CREAT, AccessPerms); /* memwriter */ int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* memreader */ ``` -手握文件描述符,接着对 **mmap** 的调用就是类似的了: +有了文件描述符,接着对 `mmap` 的调用就是类似的了: ```c caddr_t memptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); ``` -**mmap** 的第一个参数为 **NULL**,这意味着让系统自己决定在虚拟内存地址的哪个地方分配内存,当然也可以指定一个地址(但很有技巧性)。**MAP_SHARED** 标志着被分配的内存在进程中是共享的,最后一个参数(在这个例子中为 0 ) 意味着共享内存的偏移量应该为第一个字节。**size** 参数特别指定了将要分配的字节数目(在这个例子中是 512);另外的保护参数(AccessPerms)暗示着共享内存是可读可写的。 +`mmap` 的第一个参数为 `NULL`,这意味着让系统自己决定在虚拟内存地址的哪个地方分配内存,当然也可以指定一个地址(但很有技巧性)。`MAP_SHARED` 标志着被分配的内存在进程中是共享的,最后一个参数(在这个例子中为 0 ) 意味着共享内存的偏移量应该为第一个字节。`size` 参数特别指定了将要分配的字节数目(在这个例子中是 512);另外的保护参数(`AccessPerms`)暗示着共享内存是可读可写的。 -当 _memwriter_ 程序执行成功后,系统将创建并维护备份文件,在我的系统中,该文件为 _/dev/shm/shMemEx_,其中的 _shMemEx_ 是我为共享存储命名的(在头文件 _shmem.h_ 中给定)。在当前版本的 _memwriter_ 和 _memreader_ 程序中,下面的语句 +当 `memwriter` 程序执行成功后,系统将创建并维护备份文件,在我的系统中,该文件为 `/dev/shm/shMemEx`,其中的 `shMemEx` 是我为共享存储命名的(在头文件 `shmem.h` 中给定)。在当前版本的 `memwriter` 和 `memreader` 程序中,下面的语句 ```c shm_unlink(BackingFile); /* removes backing file */ ``` -将会移除备份文件。假如没有 **unlink** 这个词,则备份文件在程序终止后仍然持久地保存着。 +将会移除备份文件。假如没有 `unlink` 这个语句,则备份文件在程序终止后仍然持久地保存着。 -_memreader_ 和 _memwriter_ 一样,在调用 **sem_open** 函数时,通过信号量的名字来获取信号量。但 _memreader_ 随后将进入等待状态,直到 _memwriter_ 将初始值为 0 的信号量的值增加。 +`memreader` 和 `memwriter` 一样,在调用 `sem_open` 函数时,通过信号量的名字来获取信号量。但 `memreader` 随后将进入等待状态,直到 `memwriter` 将初始值为 0 的信号量的值增加。 ```c if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ ``` -一旦等待结束,_memreader_ 将从共享内存中读取 ASCII 数据,然后做些清理工作并终止。 +一旦等待结束,`memreader` 将从共享内存中读取 ASCII 数据,然后做些清理工作并终止。 共享内存 API 包括显式地同步共享内存段和备份文件。在这次的示例中,这些操作都被省略了,以免文章显得杂乱,好让我们专注于内存共享和信号量的代码。 -即便在信号量代码被移除的情况下,_memwriter_ 和 _memreader_ 程序很大几率也能够正常执行而不会引入竞争条件:_memwriter_ 创建了共享内存段,然后立即向它写入;_memreader_ 不能访问共享内存,直到共享内存段被创建好。然而,当一个 _写操作_ 处于混合状态时,最佳实践需要共享内存被同步。信号量 API 足够重要,值得在代码示例中着重强调。 +即便在信号量代码被移除的情况下,`memwriter` 和 `memreader` 程序很大几率也能够正常执行而不会引入竞争条件:`memwriter` 创建了共享内存段,然后立即向它写入;`memreader` 不能访问共享内存,直到共享内存段被创建好。然而,当一个*写操作*处于混合状态时,最佳实践需要共享内存被同步。信号量 API 足够重要,值得在代码示例中着重强调。 ### 总结 -上面共享文件和共享内存的例子展示了进程是怎样通过 _共享存储_ 来进行通信的,前者通过文件而后者通过内存块。这两种方法的 API 相对来说都很直接。这两种方法有什么共同的缺点吗?现代的应用经常需要处理流数据,而且是非常大规模的数据流。共享文件或者共享内存的方法都不能很好地处理大规模的流数据。按照类型使用管道会更加合适一些。所以这个系列的第二部分将会介绍管道和消息队列,同样的,我们将使用 C 语言写的代码示例来辅助讲解。 +上面共享文件和共享内存的例子展示了进程是怎样通过*共享存储*来进行通信的,前者通过文件而后者通过内存块。这两种方法的 API 相对来说都很直接。这两种方法有什么共同的缺点吗?现代的应用经常需要处理流数据,而且是非常大规模的数据流。共享文件或者共享内存的方法都不能很好地处理大规模的流数据。按照类型使用管道会更加合适一些。所以这个系列的第二部分将会介绍管道和消息队列,同样的,我们将使用 C 语言写的代码示例来辅助讲解。 -------------------------------------------------------------------------------- @@ -419,7 +428,7 @@ via: https://opensource.com/article/19/4/interprocess-communication-linux-storag 作者:[Marty Kalin][a] 选题:[lujun9972][b] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d564fdda143f612a61e50bbc3f473da405ac0f33 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 May 2019 12:27:57 +0800 Subject: [PATCH 0339/1154] PUB:20190415 Inter-process communication in Linux- Shared storage.md @FSSlc https://linux.cn/article-10826-1.html --- ...15 Inter-process communication in Linux- Shared storage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 Inter-process communication in Linux- Shared storage.md (99%) diff --git a/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md b/published/20190415 Inter-process communication in Linux- Shared storage.md similarity index 99% rename from translated/tech/20190415 Inter-process communication in Linux- Shared storage.md rename to published/20190415 Inter-process communication in Linux- Shared storage.md index 101c2f2cb3..dba63f8782 100644 --- a/translated/tech/20190415 Inter-process communication in Linux- Shared storage.md +++ b/published/20190415 Inter-process communication in Linux- Shared storage.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (FSSlc) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10826-1.html) [#]: subject: (Inter-process communication in Linux: Shared storage) [#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-storage) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) From fae517742cabcb4727fe56dc7688f98c1c62d68f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 8 May 2019 08:32:32 +0800 Subject: [PATCH 0340/1154] APL:20190308 Virtual filesystems in Linux- Why we need them and how they work --- ... filesystems in Linux- Why we need them and how they work.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index 1114863bf7..ad18f719b3 100644 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 214a3b018e77bb57e82f4d6e1d19becf928b20d3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 8 May 2019 08:48:55 +0800 Subject: [PATCH 0341/1154] TSL:20190308 Virtual filesystems in Linux- Why we need them and how they work.md --- ... Linux- Why we need them and how they work.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index ad18f719b3..e6b4bd1889 100644 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -7,19 +7,21 @@ [#]: via: (https://opensource.com/article/19/3/virtual-filesystems-linux) [#]: author: (Alison Chariken ) -Virtual filesystems in Linux: Why we need them and how they work +Linux 中的虚拟文件系统 ====== -Virtual filesystems are the magic abstraction that makes the "everything is a file" philosophy of Linux possible. + +> 虚拟文件系统是一种神奇的抽象,它使得 “一切皆文件” 哲学在 Linux 中成为了可能。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ) -What is a filesystem? According to early Linux contributor and author [Robert Love][1], "A filesystem is a hierarchical storage of data adhering to a specific structure." However, this description applies equally well to VFAT (Virtual File Allocation Table), Git, and [Cassandra][2] (a [NoSQL database][3]). So what distinguishes a filesystem? +什么是文件系统?根据早期的 Linux 贡献者和作者 [Robert Love][1] 所说,“文件系统是一个遵循特定结构的数据的分层存储。” 不过,这种描述也同样适用于 VFAT(虚拟文件分配表)、Git 和[Cassandra][2](一种 [NoSQL 数据库][3])。那么如何区别文件系统呢? -### Filesystem basics - -The Linux kernel requires that for an entity to be a filesystem, it must also implement the **open()** , **read()** , and **write()** methods on persistent objects that have names associated with them. From the point of view of [object-oriented programming][4], the kernel treats the generic filesystem as an abstract interface, and these big-three functions are "virtual," with no default definition. Accordingly, the kernel's default filesystem implementation is called a virtual filesystem (VFS). +### 文件系统基础概念 +Linux 内核要求文件系统必须是实体,它还必须在持久对象上实现 `open()`、`read()` 和 `write()` 方法,并且这些实体需要有与之关联的名字。从 [面向对象编程][4] 的角度来看,内核将通用文件系统视为一个抽象接口,这些三大函数是“虚拟”的,没有默认定义。因此,内核的默认文件系统实现被称为虚拟文件系统(VFS)。 ![][5] + If we can open(), read(), and write(), it is a file as this console session shows. VFS underlies the famous observation that in Unix-like systems "everything is a file." Consider how weird it is that the tiny demo above featuring the character device /dev/console actually works. The image shows an interactive Bash session on a virtual teletype (tty). Sending a string into the virtual console device makes it appear on the virtual screen. VFS has other, even odder properties. For example, it's [possible to seek in them][6]. @@ -143,7 +145,7 @@ via: https://opensource.com/article/19/3/virtual-filesystems-linux 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]: +[a]: https://opensource.com/users/chaiken [b]: https://github.com/lujun9972 [1]: https://www.pearson.com/us/higher-education/program/Love-Linux-Kernel-Development-3rd-Edition/PGM202532.html [2]: http://cassandra.apache.org/ From f5ba5647e13bb2c3d25616ee5afc8a4257ab654c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 8 May 2019 09:01:59 +0800 Subject: [PATCH 0342/1154] translated --- ...nd Restore Those On Fresh Ubuntu System.md | 121 ------------------ ...nd Restore Those On Fresh Ubuntu System.md | 121 ++++++++++++++++++ 2 files changed, 121 insertions(+), 121 deletions(-) delete mode 100644 sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md create mode 100644 translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md diff --git a/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md deleted file mode 100644 index 4e8182e240..0000000000 --- a/sources/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) -[#]: via: (https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System -====== - -Package installation is become more easier on Ubuntu/Debian based systems when we use apt-clone utility. - -apt-clone will work for you, if you want to build few systems with same set of packages. - -It’s time consuming process if you want to build and install necessary packages manually on each systems. - -It can be achieved in many ways and there are many utilities are available in Linux. - -We have already wrote an article about **[Aptik][1]** in the past. - -It’s one of the utility that allow Ubuntu users to backup and restore system settings and data - -### What Is apt-clone? - -[apt-clone][2] lets allow you to create backup of all installed packages for your Debian/Ubuntu systems that can be restored on freshly installed systems (or containers) or into a directory. - -This backup can be restored on multiple systems with same operating system version and architecture. - -### How To Install apt-clone? - -The apt-clone package is available on Ubuntu/Debian official repository so, use **[apt Package Manager][3]** or **[apt-get Package Manager][4]** to install it. - -Install apt-clone package using apt package manager. - -``` -$ sudo apt install apt-clone -``` - -Install apt-clone package using apt-get package manager. - -``` -$ sudo apt-get install apt-clone -``` - -### How To Backup Installed Packages Using apt-clone? - -Once you have successfully installed the apt-clone package. Simply give a location where do you want to save the backup file. - -We are going to save the installed packages backup under `/backup` directory. - -The apt-clone utility will save the installed packages list into `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` file. - -``` -$ sudo apt-clone clone /backup -``` - -We can check the same by running the ls Command. - -``` -$ ls -lh /backup/ -total 32K --rw-r--r-- 1 root root 29K Apr 20 19:06 apt-clone-state-Ubuntu18.2daygeek.com.tar.gz -``` - -Run the following command to view the details of the backup file. - -``` -$ apt-clone info /backup/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz -Hostname: Ubuntu18.2daygeek.com -Arch: amd64 -Distro: bionic -Meta: libunity-scopes-json-def-desktop, ubuntu-desktop -Installed: 1792 pkgs (194 automatic) -Date: Sat Apr 20 19:06:43 2019 -``` - -As per the above output, totally we have 1792 packages in the backup file. - -### How To Restore The Backup Which Was Taken Using apt-clone? - -You can use any of the remote copy utility to copy the files on remote server. - -``` -$ scp /backup/apt-clone-state-ubunt-18-04.tar.gz Destination-Server:/opt -``` - -Once you copy the file then perform the restore using apt-clone utility. - -Run the following command to restore it. - -``` -$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz -``` - -Make a note, The restore will override your existing `/etc/apt/sources.list` and will install/remove packages. So be careful. - -If you want to restore all the packages into a folder instead of actual restore, you can do it by using the following command. - -``` -$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz --destination /opt/oldubuntu -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/ - -作者:[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/aptik-backup-restore-ppas-installed-apps-users-data/ -[2]: https://github.com/mvo5/apt-clone -[3]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ diff --git a/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md new file mode 100644 index 0000000000..37f7c06f48 --- /dev/null +++ b/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) +[#]: via: (https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +apt-clone:备份已安装的软件包并在新的 Ubuntu 系统上恢复它们 +====== + +当我们在基于Ubuntu/Debian 的系统上使用 apt-clone,包安装会变得更加容易。 + +如果你需要在少量系统上安装相同的软件包时,apt-clone 会适合你。 + +如果你想在每个系统上手动构建和安装必要的软件包,这是一个耗时的过程。 + +它可以通过多种方式实现,Linux 中有许多程序可用。 + +我们过去曾写过一篇关于 **[Aptik][1]** 的文章。 + +它是能让 Ubuntu 用户备份和恢复系统设置和数据的程序之一。 + +### 什么是 apt-clone? + +[apt-clone][2] 能让你为 Debian/Ubuntu 系统创建所有已安装软件包的备份,这些软件包可以在新安装的系统(或容器)或目录中恢复。 + +该备份可以在相同操作系统版本和架构的多个系统上还原。 + +### 如何安装 apt-clone? + +apt-clone 包可以在 Ubuntu/Debian 的官方仓库中找到,所以,使用 **[apt 包管理器][3]** 或 **[apt-get 包管理器][4]** 来安装它。 + +使用 apt 包管理器安装 apt-clone。 + +``` +$ sudo apt install apt-clone +``` + +使用 apt-get 包管理器安装 apt-clone。 + +``` +$ sudo apt-get install apt-clone +``` + +### 如何使用 apt-clone 备份已安装的软件包? + +成功安装 apt-clone 之后。只需提供一个保存备份文件的位置。 + +我们将在 `/backup` 目录下保存已安装的软件包备份。 + +apt-clone 会将已安装的软件包列表保存到 `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` 中。 + +``` +$ sudo apt-clone clone /backup +``` + +我们同样可以通过运行 ls 命令来检查。 + +``` +$ ls -lh /backup/ +total 32K +-rw-r--r-- 1 root root 29K Apr 20 19:06 apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +``` + +运行以下命令,查看备份文件的详细信息。 + +``` +$ apt-clone info /backup/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +Hostname: Ubuntu18.2daygeek.com +Arch: amd64 +Distro: bionic +Meta: libunity-scopes-json-def-desktop, ubuntu-desktop +Installed: 1792 pkgs (194 automatic) +Date: Sat Apr 20 19:06:43 2019 +``` + +根据上面的输出,备份文件中总共有 1792 个包。 + +### 如何恢复使用 apt-clone 进行备份的软件包? + +你可以使用任何远程复制程序来复制远程服务器上的文件。 + +``` +$ scp /backup/apt-clone-state-ubunt-18-04.tar.gz Destination-Server:/opt +``` + +复制完成后,使用 apt-clone 执行还原。 + +使用以下命令进行还原。 + +``` +$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +``` + +请注意,还原将覆盖现有的 `/etc/apt/sources.list` 并安装/删除包。所以要小心。 + +如果你要将所有软件包还原到文件夹而不是实际还原,可以使用以下命令。 + +``` +$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz --destination /opt/oldubuntu +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/aptik-backup-restore-ppas-installed-apps-users-data/ +[2]: https://github.com/mvo5/apt-clone +[3]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ From 9084853005aba3bbc43f39beaa56fc9d86602c7f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 8 May 2019 09:12:44 +0800 Subject: [PATCH 0343/1154] translating --- ...190408 Getting started with Python-s cryptography library.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190408 Getting started with Python-s cryptography library.md b/sources/tech/20190408 Getting started with Python-s cryptography library.md index 9ed9211adf..566629341d 100644 --- a/sources/tech/20190408 Getting started with Python-s cryptography library.md +++ b/sources/tech/20190408 Getting started with Python-s cryptography library.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b60a4f0e27fb499c47235c310225ec866601e21d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 8 May 2019 11:53:50 +0800 Subject: [PATCH 0344/1154] PRF:20180605 How to use autofs to mount NFS shares.md @geekpi --- ...5 How to use autofs to mount NFS shares.md | 74 ++++++++----------- 1 file changed, 29 insertions(+), 45 deletions(-) diff --git a/translated/tech/20180605 How to use autofs to mount NFS shares.md b/translated/tech/20180605 How to use autofs to mount NFS shares.md index b402ee2ba2..4fc55e2931 100644 --- a/translated/tech/20180605 How to use autofs to mount NFS shares.md +++ b/translated/tech/20180605 How to use autofs to mount NFS shares.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to use autofs to mount NFS shares) @@ -10,9 +10,11 @@ 如何使用 autofs 挂载 NFS 共享 ====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx) +> 给你的网络文件系统(NFS)配置一个基本的自动挂载功能。 -大多数 Linux 文件系统在引导时挂载,并在系统运行时保持挂载状态。对于已在 `fstab` 中配置的任何远程文件系统也是如此。但是,有时你可能希望仅按需挂载远程文件系统 - 例如,通过减少网络带宽使用来提高性能,或出于安全原因隐藏或混淆某些目录。[autofs][1] 软件包提供此功能。在本文中,我将介绍如何配置基本的自动挂载。 +![](https://img.linux.net.cn/data/attachment/album/201905/08/115328rva7kqw9wqh2qees.jpg) + +大多数 Linux 文件系统在引导时挂载,并在系统运行时保持挂载状态。对于已在 `fstab` 中配置的任何远程文件系统也是如此。但是,有时你可能希望仅按需挂载远程文件系统。例如,通过减少网络带宽使用来提高性能,或出于安全原因隐藏或混淆某些目录。[autofs][1] 软件包提供此功能。在本文中,我将介绍如何配置基本的自动挂载。 首先做点假设:假设有台 NFS 服务器 `tree.mydatacenter.net` 已经启动并运行。另外假设一个名为 `ourfiles` 的数据目录还有供 Carl 和 Sarah 使用的用户目录,它们都由服务器共享。 @@ -20,106 +22,88 @@ ``` alan@workstation1:~$ sudo getent passwd carl sarah - [sudo] password for alan: - carl:x:1020:1020:Carl,,,:/home/carl:/bin/bash - sarah:x:1021:1021:Sarah,,,:/home/sarah:/bin/bash - - alan@workstation1:~$ sudo getent hosts - -127.0.0.1       localhost - -127.0.1.1       workstation1.mydatacenter.net workstation1 - -10.10.1.5       tree.mydatacenter.net tree - +127.0.0.1 localhost +127.0.1.1 workstation1.mydatacenter.net workstation1 +10.10.1.5 tree.mydatacenter.net tree ``` -如你所见,客户端工作站和 NFS 服务器都在 `hosts` 中配置。我假设一个基本的家庭甚至小型办公室网络,可能缺乏适合的内部域名服务(即 DNS)。 +如你所见,客户端工作站和 NFS 服务器都在 `hosts` 文件中配置。我假设这是一个基本的家庭甚至小型办公室网络,可能缺乏适合的内部域名服务(即 DNS)。 ### 安装软件包 你只需要安装两个软件包:用于 NFS 客户端的 `nfs-common` 和提供自动挂载的 `autofs`。 + ``` alan@workstation1:~$ sudo apt-get install nfs-common autofs - ``` -你可以验证 autofs 是否已放在 `etc` 目录中: +你可以验证 autofs 相关的文件是否已放在 `/etc` 目录中: + ``` alan@workstation1:~$ cd /etc; ll auto* - --rw-r--r-- 1 root root 12596 Nov 19  2015 autofs.conf - --rw-r--r-- 1 root root   857 Mar 10  2017 auto.master - --rw-r--r-- 1 root root   708 Jul  6  2017 auto.misc - --rwxr-xr-x 1 root root  1039 Nov 19  2015 auto.net* - --rwxr-xr-x 1 root root  2191 Nov 19  2015 auto.smb* - +-rw-r--r-- 1 root root 12596 Nov 19 2015 autofs.conf +-rw-r--r-- 1 root root 857 Mar 10 2017 auto.master +-rw-r--r-- 1 root root 708 Jul 6 2017 auto.misc +-rwxr-xr-x 1 root root 1039 Nov 19 2015 auto.net* +-rwxr-xr-x 1 root root 2191 Nov 19 2015 auto.smb* alan@workstation1:/etc$ - ``` ### 配置 autofs 现在你需要编辑其中几个文件并添加 `auto.home` 文件。首先,将以下两行添加到文件 `auto.master` 中: + ``` /mnt/tree  /etc/auto.misc - /home/tree  /etc/auto.home - ``` 每行以挂载 NFS 共享的目录开头。继续创建这些目录: + ``` alan@workstation1:/etc$ sudo mkdir /mnt/tree /home/tree - ``` 接下来,将以下行添加到文件 `auto.misc`: + ``` ourfiles        -fstype=nfs     tree:/share/ourfiles - ``` 该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.misc` 的 `ourfiles` 共享。如上所示,这些文件将在 `/mnt/tree/ourfiles` 目录中。 第三步,使用以下行创建文件 `auto.home`: + ``` *               -fstype=nfs     tree:/home/& - ``` -该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.home` 的用户共享。在这种情况下,Carl 和 Sarah 的文件将分别在目录 `/home/tree/carl` 或 `/home/tree/sarah`中。星号(称为通配符)使每个用户的共享可以在登录时自动挂载。& 符号也可以作为表示服务器端用户目录的通配符。它们的主目录会相应地根据 `passwd` 文件映射。如果你更喜欢本地主目录,则无需执行此操作。相反,用户可以将其用作特定文件的简单远程存储。 +该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.home` 的用户共享。在这种情况下,Carl 和 Sarah 的文件将分别在目录 `/home/tree/carl` 或 `/home/tree/sarah`中。星号 `*`(称为通配符)使每个用户的共享可以在登录时自动挂载。`&` 符号也可以作为表示服务器端用户目录的通配符。它们的主目录会相应地根据 `passwd` 文件映射。如果你更喜欢本地主目录,则无需执行此操作。相反,用户可以将其用作特定文件的简单远程存储。 最后,重启 `autofs` 守护进程,以便识别并加载这些配置的更改。 + ``` alan@workstation1:/etc$ sudo service autofs restart - ``` ### 测试 autofs -如果更改文件 `auto.master` 中的列出目录并运行 `ls` 命令,那么不会立即看到任何内容。例如,`(cd)` 到目录 `/mnt/tree`。首先,`ls` 的输出不会显示任何内容,但在运行 `cd ourfiles` 之后,将自动挂载 `ourfiles` 共享目录。 `cd` 命令也将被执行,你将进入新挂载的目录中。 +如果更改文件 `auto.master` 中的列出目录,并运行 `ls` 命令,那么不会立即看到任何内容。例如,切换到目录 `/mnt/tree`。首先,`ls` 的输出不会显示任何内容,但在运行 `cd ourfiles` 之后,将自动挂载 `ourfiles` 共享目录。 `cd` 命令也将被执行,你将进入新挂载的目录中。 + ``` carl@workstation1:~$ cd /mnt/tree - carl@workstation1:/mnt/tree$ ls - carl@workstation1:/mnt/tree$ cd ourfiles - carl@workstation1:/mnt/tree/ourfiles$ - ``` -为了进一步确认正常工作,`mount` 命令会显示已挂载共享的细节 +为了进一步确认正常工作,`mount` 命令会显示已挂载共享的细节。 + ``` carl@workstation1:~$ mount @@ -127,7 +111,7 @@ tree:/mnt/share/ourfiles on /mnt/tree/ourfiles type nfs4 (rw,relatime,vers=4.0,r ``` -对于Carl和Sarah,`/home/tree` 目录工作方式相同。 +对于 Carl 和 Sarah,`/home/tree` 目录工作方式相同。 我发现在我的文件管理器中添加这些目录的书签很有用,可以用来快速访问。 @@ -138,7 +122,7 @@ via: https://opensource.com/article/18/6/using-autofs-mount-nfs-shares 作者:[Alan Formy-Duval][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[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/) 荣誉推出 From da488a59be5d0fc5eb4a8cf5e4caa59a38e20986 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 8 May 2019 11:54:36 +0800 Subject: [PATCH 0345/1154] PUB:20180605 How to use autofs to mount NFS shares.md @geekpi https://linux.cn/article-10830-1.html --- .../20180605 How to use autofs to mount NFS shares.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20180605 How to use autofs to mount NFS shares.md (98%) diff --git a/translated/tech/20180605 How to use autofs to mount NFS shares.md b/published/20180605 How to use autofs to mount NFS shares.md similarity index 98% rename from translated/tech/20180605 How to use autofs to mount NFS shares.md rename to published/20180605 How to use autofs to mount NFS shares.md index 4fc55e2931..15321b2e3d 100644 --- a/translated/tech/20180605 How to use autofs to mount NFS shares.md +++ b/published/20180605 How to use autofs to mount NFS shares.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10830-1.html) [#]: subject: (How to use autofs to mount NFS shares) [#]: via: (https://opensource.com/article/18/6/using-autofs-mount-nfs-shares) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) From 8452fb859d62d8a53b1b006e0fff31dc083b25ab Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 9 May 2019 09:39:11 +0800 Subject: [PATCH 0346/1154] translated --- ...rted with Python-s cryptography library.md | 111 ----------------- ...rted with Python-s cryptography library.md | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20190408 Getting started with Python-s cryptography library.md create mode 100644 translated/tech/20190408 Getting started with Python-s cryptography library.md diff --git a/sources/tech/20190408 Getting started with Python-s cryptography library.md b/sources/tech/20190408 Getting started with Python-s cryptography library.md deleted file mode 100644 index 566629341d..0000000000 --- a/sources/tech/20190408 Getting started with Python-s cryptography library.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with Python's cryptography library) -[#]: via: (https://opensource.com/article/19/4/cryptography-python) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Getting started with Python's cryptography library -====== -Encrypt your data and keep it safe from attackers. -![lock on world map][1] - -The first rule of cryptography club is: never _invent_ a cryptography system yourself. The second rule of cryptography club is: never _implement_ a cryptography system yourself: many real-world holes are found in the _implementation_ phase of a cryptosystem as well as in the design. - -One useful library for cryptographic primitives in Python is called simply [**cryptography**][2]. It has both "secure" primitives as well as a "hazmat" layer. The "hazmat" layer requires care and knowledge of cryptography and it is easy to implement security holes using it. We will not cover anything in the "hazmat" layer in this introductory article! - -The most useful high-level secure primitive in **cryptography** is the Fernet implementation. Fernet is a standard for encrypting buffers in a way that follows best-practices cryptography. It is not suitable for very big files—anything in the gigabyte range and above—since it requires you to load the whole buffer that you want to encrypt or decrypt into memory at once. - -Fernet supports _symmetric_ , or _secret key_ , cryptography: the same key is used for encryption and decryption, and therefore must be kept safe. - -Generating a key is easy: - - -``` ->>> k = fernet.Fernet.generate_key() ->>> type(k) - -``` - -Those bytes can be written to a file with appropriate permissions, ideally on a secure machine. - -Once you have key material, encrypting is easy as well: - - -``` ->>> frn = fernet.Fernet(k) ->>> encrypted = frn.encrypt(b"x marks the spot") ->>> encrypted[:10] -b'gAAAAABb1' -``` - -You will get slightly different values if you encrypt on your machine. Not only because (I hope) you generated a different key from me, but because Fernet concatenates the value to be encrypted with some randomly generated buffer. This is one of the "best practices" I alluded to earlier: it will prevent an adversary from being able to tell which encrypted values are identical, which is sometimes an important part of an attack. - -Decryption is equally simple: - - -``` ->>> frn = fernet.Fernet(k) ->>> frn.decrypt(encrypted) -b'x marks the spot' -``` - -Note that this only encrypts and decrypts _byte strings_. In order to encrypt and decrypt _text strings_ , they will need to be encoded and decoded, usually with [UTF-8][3]. - -One of the most interesting advances in cryptography in the mid-20th century was _public key_ cryptography. It allows the encryption key to be published while the _decryption key_ is kept secret. It can, for example, be used to store API keys to be used by a server: the server is the only thing with access to the decryption key, but anyone can add to the store by using the public encryption key. - -While **cryptography** does not have any public key cryptographic _secure_ primitives, the [**PyNaCl**][4] library does. PyNaCl wraps and offers some nice ways to use the [**NaCl**][5] encryption system invented by Daniel J. Bernstein. - -NaCl always _encrypts_ and _signs_ or _decrypts_ and _verifies signatures_ simultaneously. This is a way to prevent malleability-based attacks, where an adversary modifies the encrypted value. - -Encryption is done with a public key, while signing is done with a secret key: - - -``` ->>> from nacl.public import PrivateKey, PublicKey, Box ->>> source = PrivateKey.generate() ->>> with open("target.pubkey", "rb") as fpin: -... target_public_key = PublicKey(fpin.read()) ->>> enc_box = Box(source, target_public_key) ->>> result = enc_box.encrypt(b"x marks the spot") ->>> result[:4] -b'\xe2\x1c0\xa4' -``` - -Decryption reverses the roles: it needs the private key for decryption and the public key to verify the signature: - - -``` ->>> from nacl.public import PrivateKey, PublicKey, Box ->>> with open("source.pubkey", "rb") as fpin: -... source_public_key = PublicKey(fpin.read()) ->>> with open("target.private_key", "rb") as fpin: -... target = PrivateKey(fpin.read()) ->>> dec_box = Box(target, source_public_key) ->>> dec_box.decrypt(result) -b'x marks the spot' -``` - -The [**PocketProtector**][6] library builds on top of PyNaCl and contains a complete secrets management solution. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/cryptography-python - -作者:[Moshe Zadka (Community Moderator)][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-cloud-safe.png?itok=yj2TFPzq (lock on world map) -[2]: https://cryptography.io/en/latest/ -[3]: https://en.wikipedia.org/wiki/UTF-8 -[4]: https://pynacl.readthedocs.io/en/stable/ -[5]: https://nacl.cr.yp.to/ -[6]: https://github.com/SimpleLegal/pocket_protector/blob/master/USER_GUIDE.md diff --git a/translated/tech/20190408 Getting started with Python-s cryptography library.md b/translated/tech/20190408 Getting started with Python-s cryptography library.md new file mode 100644 index 0000000000..a9e87bf470 --- /dev/null +++ b/translated/tech/20190408 Getting started with Python-s cryptography library.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Python's cryptography library) +[#]: via: (https://opensource.com/article/19/4/cryptography-python) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Python 的加密库入门 +====== +加密你的数据并使其免受攻击者的攻击。 +![lock on world map][1] + +密码学俱乐部的第一条规则是:永远不要自己_发明_密码系统。密码学俱乐部的第二条规则是:永远不要自己_实现_密码系统:在现实世界中,在_实现_以及设计密码系统阶段都找到过许多漏洞。 + +Python 中的一个有用的加密原语被称为 [**cryptography**][2]。它既有“安全”原语,也有“危险”层。“危险”层需要小心和相关知识,并且使用它很容易出现安全漏洞。在这篇介绍性文章中,我们不会涵盖“危险”层中的任何内容! + +**cryptography** 中最有用的高级安全原语是 Fernet 实现。Fernet 是一种遵循最佳实践的加密缓冲区的标准。它不适用于非常大的文件,如千兆字节以上的文件,因为它要求你一次加载要加密或解密的内容到内存缓冲区中。 + + +Fernet 支持_对称_或_私钥_、密码:加密和解密使用相同的密钥,因此必须保持安全。 + +生成密钥很简单: + + +``` +>>> k = fernet.Fernet.generate_key() +>>> type(k) + +``` + +这些字节可以写入有适当权限的文件,最好是在安全的机器上。 + +有了密钥后,加密也很容易: + + +``` +>>> frn = fernet.Fernet(k) +>>> encrypted = frn.encrypt(b"x marks the spot") +>>> encrypted[:10] +b'gAAAAABb1' +``` + +如果在你的机器上加密,你会看到略微不同的值。不仅因为(我希望)你生成了和我不同的密钥,而且因为 Fernet 将要加密的值与一些随机生成的缓冲区连接起来。这是我之前提到的“最佳实践”之一:它将阻止对手分辨哪些加密值是相同的,这有时是攻击的重要部分。 + +解密同样简单: + + +``` +>>> frn = fernet.Fernet(k) +>>> frn.decrypt(encrypted) +b'x marks the spot' +``` + +请注意,这仅加密和解密_字节串_。为了加密和解密_文本串_,通常需要对它们使用 [UTF-8][3] 进行编码和解码。 + +20 世纪中期密码学最有趣的进展之一是 _公钥_ 加密。它能在_解密密钥_保密时发布加密密钥。例如,它可用于保存服务器使用的 API 密钥:服务器是唯一可以访问解密密钥的一方,但是任何人都可以保存公共加密密钥。 + +虽然 **cryptography** 没有任何公钥加密_安全_原语,但 [**PyNaCl**][4] 库有。PyNaCl 封装并提供了一些很好的方法来使用 Daniel J. Bernstein 发明的 [**NaCl**][5] 加密系统。 + +NaCl 始终同时_加密_和_签名_或者同时_解密_和_验证签名_。这是一种防止基于可伸缩性的攻击的方法,其中攻击者会修改加密值。 + +加密是使用公钥完成的,而签名是使用密钥完成的: + + +``` +>>> from nacl.public import PrivateKey, PublicKey, Box +>>> source = PrivateKey.generate() +>>> with open("target.pubkey", "rb") as fpin: +... target_public_key = PublicKey(fpin.read()) +>>> enc_box = Box(source, target_public_key) +>>> result = enc_box.encrypt(b"x marks the spot") +>>> result[:4] +b'\xe2\x1c0\xa4' +``` + +解密颠倒了角色:它需要私钥进行解密,需要公钥验证签名: + + +``` +>>> from nacl.public import PrivateKey, PublicKey, Box +>>> with open("source.pubkey", "rb") as fpin: +... source_public_key = PublicKey(fpin.read()) +>>> with open("target.private_key", "rb") as fpin: +... target = PrivateKey(fpin.read()) +>>> dec_box = Box(target, source_public_key) +>>> dec_box.decrypt(result) +b'x marks the spot' +``` + +[**PocketProtector**][6] 库构建在 PyNaCl 之上,包含完整的私钥管理方案。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/cryptography-python + +作者:[Moshe Zadka (Community Moderator)][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-cloud-safe.png?itok=yj2TFPzq (lock on world map) +[2]: https://cryptography.io/en/latest/ +[3]: https://en.wikipedia.org/wiki/UTF-8 +[4]: https://pynacl.readthedocs.io/en/stable/ +[5]: https://nacl.cr.yp.to/ +[6]: https://github.com/SimpleLegal/pocket_protector/blob/master/USER_GUIDE.md From 579c1729c92cd457b81a41db7aa562df19dfbefc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 9 May 2019 10:28:33 +0800 Subject: [PATCH 0347/1154] PRF:20190408 Getting started with Python-s cryptography library.md @geekpi --- ...rted with Python-s cryptography library.md | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/translated/tech/20190408 Getting started with Python-s cryptography library.md b/translated/tech/20190408 Getting started with Python-s cryptography library.md index a9e87bf470..3f90c319dd 100644 --- a/translated/tech/20190408 Getting started with Python-s cryptography library.md +++ b/translated/tech/20190408 Getting started with Python-s cryptography library.md @@ -1,29 +1,29 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with Python's cryptography library) [#]: via: (https://opensource.com/article/19/4/cryptography-python) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) Python 的加密库入门 ====== -加密你的数据并使其免受攻击者的攻击。 + +> 加密你的数据并使其免受攻击者的攻击。 + ![lock on world map][1] -密码学俱乐部的第一条规则是:永远不要自己_发明_密码系统。密码学俱乐部的第二条规则是:永远不要自己_实现_密码系统:在现实世界中,在_实现_以及设计密码系统阶段都找到过许多漏洞。 +密码学俱乐部的第一条规则是:永远不要自己*发明*密码系统。密码学俱乐部的第二条规则是:永远不要自己*实现*密码系统:在现实世界中,在*实现*以及设计密码系统阶段都找到过许多漏洞。 -Python 中的一个有用的加密原语被称为 [**cryptography**][2]。它既有“安全”原语,也有“危险”层。“危险”层需要小心和相关知识,并且使用它很容易出现安全漏洞。在这篇介绍性文章中,我们不会涵盖“危险”层中的任何内容! +Python 中的一个有用的基本加密库就叫做 [cryptography][2]。它既是一个“安全”方面的基础库,也是一个“危险”层。“危险”层需要更加小心和相关的知识,并且使用它很容易出现安全漏洞。在这篇介绍性文章中,我们不会涵盖“危险”层中的任何内容! -**cryptography** 中最有用的高级安全原语是 Fernet 实现。Fernet 是一种遵循最佳实践的加密缓冲区的标准。它不适用于非常大的文件,如千兆字节以上的文件,因为它要求你一次加载要加密或解密的内容到内存缓冲区中。 +cryptography 库中最有用的高级安全功能是一种 Fernet 实现。Fernet 是一种遵循最佳实践的加密缓冲区的标准。它不适用于非常大的文件,如千兆字节以上的文件,因为它要求你一次加载要加密或解密的内容到内存缓冲区中。 - -Fernet 支持_对称_或_私钥_、密码:加密和解密使用相同的密钥,因此必须保持安全。 +Fernet 支持对称symmetric(即密钥secret key)加密方式*:加密和解密使用相同的密钥,因此必须保持安全。 生成密钥很简单: - ``` >>> k = fernet.Fernet.generate_key() >>> type(k) @@ -34,7 +34,6 @@ Fernet 支持_对称_或_私钥_、密码:加密和解密使用相同的密钥 有了密钥后,加密也很容易: - ``` >>> frn = fernet.Fernet(k) >>> encrypted = frn.encrypt(b"x marks the spot") @@ -46,24 +45,22 @@ b'gAAAAABb1' 解密同样简单: - ``` >>> frn = fernet.Fernet(k) >>> frn.decrypt(encrypted) b'x marks the spot' ``` -请注意,这仅加密和解密_字节串_。为了加密和解密_文本串_,通常需要对它们使用 [UTF-8][3] 进行编码和解码。 +请注意,这仅加密和解密*字节串*。为了加密和解密*文本串*,通常需要对它们使用 [UTF-8][3] 进行编码和解码。 -20 世纪中期密码学最有趣的进展之一是 _公钥_ 加密。它能在_解密密钥_保密时发布加密密钥。例如,它可用于保存服务器使用的 API 密钥:服务器是唯一可以访问解密密钥的一方,但是任何人都可以保存公共加密密钥。 +20 世纪中期密码学最有趣的进展之一是公钥public key加密。它可以在发布加密密钥的同时而让*解密密钥*保持保密。例如,它可用于保存服务器使用的 API 密钥:服务器是唯一可以访问解密密钥的一方,但是任何人都可以保存公共加密密钥。 -虽然 **cryptography** 没有任何公钥加密_安全_原语,但 [**PyNaCl**][4] 库有。PyNaCl 封装并提供了一些很好的方法来使用 Daniel J. Bernstein 发明的 [**NaCl**][5] 加密系统。 +虽然 cryptography 没有任何支持公钥加密的*安全*功能,但 [PyNaCl][4] 库有。PyNaCl 封装并提供了一些很好的方法来使用 Daniel J. Bernstein 发明的 [NaCl][5] 加密系统。 -NaCl 始终同时_加密_和_签名_或者同时_解密_和_验证签名_。这是一种防止基于可伸缩性的攻击的方法,其中攻击者会修改加密值。 +NaCl 始终同时加密encrypt签名sign或者同时解密decrypt验证签名verify signature。这是一种防止基于可伸缩性malleability-based的攻击的方法,其中攻击者会修改加密值。 加密是使用公钥完成的,而签名是使用密钥完成的: - ``` >>> from nacl.public import PrivateKey, PublicKey, Box >>> source = PrivateKey.generate() @@ -77,7 +74,6 @@ b'\xe2\x1c0\xa4' 解密颠倒了角色:它需要私钥进行解密,需要公钥验证签名: - ``` >>> from nacl.public import PrivateKey, PublicKey, Box >>> with open("source.pubkey", "rb") as fpin: @@ -89,16 +85,16 @@ b'\xe2\x1c0\xa4' b'x marks the spot' ``` -[**PocketProtector**][6] 库构建在 PyNaCl 之上,包含完整的私钥管理方案。 +最后,[PocketProtector][6] 库构建在 PyNaCl 之上,包含完整的密钥管理方案。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/4/cryptography-python -作者:[Moshe Zadka (Community Moderator)][a] +作者:[Moshe Zadka][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/) 荣誉推出 From e74f589e5ee014b4785f9a19aee5e2befd249107 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 9 May 2019 10:29:05 +0800 Subject: [PATCH 0348/1154] PUB:20190408 Getting started with Python-s cryptography library.md @geekpi https://linux.cn/article-10833-1.html --- ...0408 Getting started with Python-s cryptography library.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190408 Getting started with Python-s cryptography library.md (98%) diff --git a/translated/tech/20190408 Getting started with Python-s cryptography library.md b/published/20190408 Getting started with Python-s cryptography library.md similarity index 98% rename from translated/tech/20190408 Getting started with Python-s cryptography library.md rename to published/20190408 Getting started with Python-s cryptography library.md index 3f90c319dd..bc6aeb05b7 100644 --- a/translated/tech/20190408 Getting started with Python-s cryptography library.md +++ b/published/20190408 Getting started with Python-s cryptography library.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10833-1.html) [#]: subject: (Getting started with Python's cryptography library) [#]: via: (https://opensource.com/article/19/4/cryptography-python) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From c6b8c6b347b50a0ef41fd6ce38d125dd636664df Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 9 May 2019 11:31:06 +0800 Subject: [PATCH 0349/1154] PRF:20190327 Why DevOps is the most important tech strategy today.md @zgj1024 --- ... the most important tech strategy today.md | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/translated/talk/20190327 Why DevOps is the most important tech strategy today.md b/translated/talk/20190327 Why DevOps is the most important tech strategy today.md index fe014a243a..9c12db5d57 100644 --- a/translated/talk/20190327 Why DevOps is the most important tech strategy today.md +++ b/translated/talk/20190327 Why DevOps is the most important tech strategy today.md @@ -1,48 +1,47 @@ [#]: collector: "lujun9972" -[#]: translator: "zgj1024 " -[#]: reviewer: " " +[#]: translator: "zgj1024" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "Why DevOps is the most important tech strategy today" [#]: via: "https://opensource.com/article/19/3/devops-most-important-tech-strategy" -[#]: author: "Kelly AlbrechtWilly-Peter Schaub https://opensource.com/users/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht" +[#]: author: "Kelly Albrecht https://opensource.com/users/ksalbrecht" 为何 DevOps 是如今最重要的技术策略 ====== -消除一些关于 DevOps 的疑惑 + +> 消除一些关于 DevOps 的疑惑。 + ![CICD with gears][1] 很多人初学 [DevOps][2] 时,看到它其中一个结果就问这个是如何得来的。其实理解这部分 Devops 的怎样实现并不重要,重要的是——理解(使用) DevOps 策略的原因——这是做一个行业的领导者还是追随者的差别。 -你可能会听过些 Devops 的难以置信的成果,例如生产环境非常有弹性,“混世猴子”([Chaos Monkey][3])程序运行时,将周围的连接随机切断,每天仍可以处理数千个版本。这是令人印象深刻的,但就其本身而言,这是一个 DevOps 的无力案例,本质上会被一个[反例][4]困扰:DevOps 环境有弹性是因为没有观察到严重的故障。。。还没有。 +你可能会听过些 Devops 的难以置信的成果,例如生产环境非常有弹性,就算是有个“[癫狂的猴子][3]Chaos Monkey)跳来跳去将不知道哪个插头随便拔下,每天仍可以处理数千个发布。这是令人印象深刻的,但就其本身而言,这是一个 DevOps 的证据不足的案例,其本质上会被一个[反例][4]困扰:DevOps 环境有弹性是因为严重的故障还没有被观测到。 有很多关于 DevOps 的疑惑,并且许多人还在尝试弄清楚它的意义。下面是来自我 LinkedIn Feed 中的某个人的一个案例: -> 最近我参加一些 #DevOps 的交流会,那里一些演讲人好像在倡导 #敏捷开发是 DevOps 的子集。不知为何,我的理解洽洽相反。 +> 最近我参加一些 #DevOps 的交流会,那里一些演讲人好像在倡导 #敏捷开发是 DevOps 的子集。不知为何,我的理解恰恰相反。 > > 能听一下你们的想法吗?你认为敏捷开发和 DevOps 之间是什么关系呢? > > 1. DevOps 是敏捷开发的子集 -> 2. 敏捷开发 是 DevOps 的子集 +> 2. 敏捷开发是 DevOps 的子集 > 3. DevOps 是敏捷开发的扩展,从敏捷开发结束的地方开始 > 4. DevOps 是敏捷开发的新版本 -> -科技行业的专业人士在那篇 LinkedIn 的帖子上达标各样的答案,你会怎样回复呢? +科技行业的专业人士在那篇 LinkedIn 的帖子上表达了各种各样的答案,你会怎样回复呢? -### DevOps源于精益和敏捷 +### DevOps 源于精益和敏捷 + +如果我们从亨利福特的战略和丰田生产系统对福特车型的改进(的历史)开始, DevOps 就更有意义了。精益制造就诞生在那段历史中,人们对精益制作进行了良好的研究。James P. Womack 和 Daniel T. Jones 将精益思维([Lean Thinking][5])提炼为五个原则: -如果我们从亨利福特的战略和丰田生产系统对福特车型的改进(的历史)开始, DevOps 就更有意义了。精益制造就诞生在那段历史中,人们对精益制作进行了良好的研究。James P. Womack 和 Daniel T. Jones 将精益思维( [Lean Thinking][5])提炼为五个原则: 1. 指明客户所需的价值 2. 确定提供该价值的每个产品的价值流,并对当前提供该价值所需的所有浪费步骤提起挑战 3. 使产品通过剩余的增值步骤持续流动 4. 在可以连续流动的所有步骤之间引入拉力 5. 管理要尽善尽美,以便为客户服务所需的步骤数量和时间以及信息量持续下降 - -Lean seeks to continuously remove waste and increase the flow of value to the customer. This is easily recognizable and understood through a core tenet of lean: single piece flow. We can do a number of activities to learn why moving single pieces at a time is magnitudes faster than batches of many pieces; the [Penny Game][6] and the [Airplane Game][7] are two of them. In the Penny Game, if a batch of 20 pennies takes two minutes to get to the customer, they get the whole batch after waiting two minutes. If you move one penny at a time, the customer gets the first penny in about five seconds and continues getting pennies until the 20th penny arrives approximately 25 seconds later. - -精益致力于持续消除浪费并增加客户的价值流动。这很容易识别并明白精益的核心原则:单一流。我们可以做一些游戏去了解为何同一时间移动单个比批量移动要快得多。其中的两个游戏是[硬币游戏][6]和[飞机游戏][7]。在硬币游戏中,如果一批 20 个硬币到顾客手中要用 2 分钟,顾客等 2 分钟后能拿到整批硬币。如果一次只移动一个硬币,顾客会在 5 秒内得到第一枚硬币,并会持续获得硬币,直到在大约 25 秒后第 20 个硬币到达。(译者注:有相关的视频的) +精益致力于持续消除浪费并增加客户的价值流动。这很容易识别并明白精益的核心原则:单一流。我们可以做一些游戏去了解为何同一时间移动单个比批量移动要快得多。其中的两个游戏是[硬币游戏][6]和[飞机游戏][7]。在硬币游戏中,如果一批 20 个硬币到顾客手中要用 2 分钟,顾客等 2 分钟后能拿到整批硬币。如果一次只移动一个硬币,顾客会在 5 秒内得到第一枚硬币,并会持续获得硬币,直到在大约 25 秒后第 20 个硬币到达。(LCTT 译注:有相关的视频的) 这是巨大的不同,但是不是生活中的所有事都像硬币游戏那样简单并可预测的。这就是敏捷的出现的原因。我们当然看到了高效绩敏捷团队的精益原则,但这些团队需要的不仅仅是精益去做他们要做的事。 @@ -52,13 +51,13 @@ Lean seeks to continuously remove waste and increase the flow of value to the cu ### 最佳批量大小 -要了解 DevOps 在软件开发中的请强大功能,这会帮助我们理解批处理大小的经济学。请考虑以下来自Donald Reinertsen 的[产品开发流程原则][8]的U曲线优化示例: +要了解 DevOps 在软件开发中的强大功能,这会帮助我们理解批处理大小的经济学。请考虑以下来自Donald Reinertsen 的[产品开发流程原则][8]的U曲线优化示例: ![U-curve optimization illustration of optimal batch size][9] -这可以类比杂货店购物来解释。假设你需要买一些鸡蛋,而你住的地方离商店只有 30 分的路程。买一个鸡蛋(图种最左边)意味着每次要花 30 分钟的路程,这就是你的_交易成本_。_持有成本_可能是鸡蛋变质和在你的冰箱中持续地占用空间。_总成本_是_交易成本_加上你的_持有成本_。这 U 型曲线解释了为什么对大部分来说,一次买一打鸡蛋是他们的_最佳批量大小_。如果你就住在商店的旁边,步行到那里不会花费你任何的时候,你可能每次只会买一小盒鸡蛋,以此来节省冰箱的空间并享受新鲜的鸡蛋。 +这可以类比杂货店购物来解释。假设你需要买一些鸡蛋,而你住的地方离商店只有 30 分钟的路程。买一个鸡蛋(图中最左边)意味着每次要花 30 分钟的路程,这就是你的*交易成本*。*持有成本*可能是鸡蛋变质和在你的冰箱中持续地占用空间。*总成本*是*交易成本*加上你的*持有成本*。这个 U 型曲线解释了为什么对大部分人来说,一次买一打鸡蛋是他们的*最佳批量大小*。如果你就住在商店的旁边,步行到那里不会花费你任何的时候,你可能每次只会买一小盒鸡蛋,以此来节省冰箱的空间并享受新鲜的鸡蛋。 -这 U 型优化曲线可以说明为什么在成功敏捷转换中生产力会显著提高。考虑敏捷转换对组织决策的影响。在传统的分级组织中,决策权是集中的。这会导致较少的人做更大的决策。敏捷方法论会有效地降低组织决策中的交易成本,方法是将决策分散到最被人熟知的认识和信息的位置:跨越高度信任,自组织的敏捷团队。 +这 U 型优化曲线可以说明为什么在成功的敏捷转换中生产力会显著提高。考虑敏捷转换对组织决策的影响。在传统的分级组织中,决策权是集中的。这会导致较少的人做更大的决策。敏捷方法论会有效地降低组织决策中的交易成本,方法是将决策分散到最被人熟知的认识和信息的位置:跨越高度信任,自组织的敏捷团队。 下面的动画演示了降低事务成本后,最佳批量大小是如何向左移动。在更频繁地做出更快的决策方面,你不能低估组织的价值。 @@ -66,22 +65,21 @@ Lean seeks to continuously remove waste and increase the flow of value to the cu ### DevOps 适合哪些地方 -自动化是 DevOps 最知名的事情之一。前面的插图非常详细地展示了自动化的价值。通过自动化,我们将交易成本降低到接近零,实质上是免费进行测试和部署。这使我们可以利用越来越小的批量工作。较小批量的工作更容易理解、提交、测试、审查和知道何时能完成。这些较小的批量大小也包含较少的差异和风险,使其更易于部署,如果出现问题,可以进行故障排除和恢复。通过自动化与扎实的敏捷实践相结合,我们可以使我们的功能开发非常接近单件流程,从而快速,持续地为客户提供价值。 +自动化是 DevOps 最知名的事情之一。前面的插图非常详细地展示了自动化的价值。通过自动化,我们将交易成本降低到接近于零,实质上是可以免费进行测试和部署。这使我们可以利用越来越小的批量工作。较小批量的工作更容易理解、提交、测试、审查和知道何时能完成。这些较小的批量大小也包含较少的差异和风险,使其更易于部署,如果出现问题,可以进行故障排除和恢复。通过自动化与扎实的敏捷实践相结合,我们可以使我们的功能开发非常接近单件流程,从而快速、持续地为客户提供价值。 更传统地说,DevOps 被理解为一种打破开发团队和运营团队之间混乱局面的方法。在这个模型中,开发团队开发新的功能,而运营团队则保持系统的稳定和平稳运行。摩擦的发生是因为开发过程中的新功能将更改引入到系统中,从而增加了停机的风险,运营团队并不认为要对此负责,但无论如何都必须处理这一问题。DevOps 不仅仅尝试让人们一起工作,更重要的是尝试在复杂的环境中安全地进行更频繁的更改。 -我们可以向 [Ron Westrum][11] 寻求有关在复杂组织中实现安全性的研究。在研究为什么有些组织比其他组织更安全时,他发现组织的文化可以预测其安全性。他确定了三种文化:病态,官僚主义的和生产式的。他发现病理的可以预测安全性较低,而生产式文化被预测为更安全(例如,在他的主要研究领域中,飞机坠毁或意外住院死亡的数量要少得多)。 +我们可以看看 [Ron Westrum][11] 在有关复杂组织中实现安全性的研究。在研究为什么有些组织比其他组织更安全时,他发现组织的文化可以预测其安全性。他确定了三种文化:病态的、官僚主义的和生产式的。他发现病态的可以预测其安全性较低,而生产式文化被预测为更安全(例如,在他的主要研究领域中,飞机坠毁或意外住院死亡的数量要少得多)。 ![Three types of culture identified by Ron Westrum][12] 高效的 DevOps 团队通过精益和敏捷的实践实现了一种生成性文化,这表明速度和安全性是互补的,或者说是同一个问题的两个方面。通过将决策和功能的最佳批量大小减少到非常小,DevOps 实现了更快的信息流和价值,同时消除了浪费并降低了风险。 -与 Westrum的研究一致,在提高安全性和可靠性的同时,变化也很容易发生。。当一个敏捷的 DevOps 团队被信任做出自己的决定时,我们将获得 DevOps 目前最为人所知的工具和技术:自动化和持续交付。通过这种自动化,交易成本比以往任何时候都进一步降低,并且实现了近乎单一的精益流程,每天创造数千个决策和发布的潜力,正如我们在高效绩的 DevOps 组织中看到的那样 +与 Westrum 的研究一致,在提高安全性和可靠性的同时,变化也很容易发生。当一个敏捷的 DevOps 团队被信任做出自己的决定时,我们将获得 DevOps 目前最为人所知的工具和技术:自动化和持续交付。通过这种自动化,交易成本比以往任何时候都进一步降低,并且实现了近乎单一的精益流程,每天创造数千个决策和发布的潜力,正如我们在高效绩的 DevOps 组织中看到的那样 ### 流动、反馈、学习 -DevOps 并不止于此。我们主要讨论了 DevOps 实现了革命性的流程,但通过类似的努力可以进一步放大精益和敏捷实践,从而实现更快的反馈循环和更快的学习。在[_DevOps手册_][13] 中,作者除了详细解释快速流程外, DevOps 如何在整个价值流中实现遥测,从而获得快速且持续的反馈。此外,利用[精益求精的突破][14]和scrum 的[回顾][15],高效的 DevOps 团队将不断推动学习和持续改进深入到他们的组织的基础,实现软件产品开发行业的精益制造革命。 - +DevOps 并不止于此。我们主要讨论了 DevOps 实现了革命性的流程,但通过类似的努力可以进一步放大精益和敏捷实践,从而实现更快的反馈循环和更快的学习。在[DevOps手册][13] 中,作者除了详细解释快速流程外, DevOps 如何在整个价值流中实现遥测,从而获得快速且持续的反馈。此外,利用[精益求精的突破][14]和 scrum 的[回顾][15],高效的 DevOps 团队将不断推动学习和持续改进深入到他们的组织的基础,实现软件产品开发行业的精益制造革命。 ### 从 DevOps 评估开始 @@ -91,18 +89,14 @@ DevOps 并不止于此。我们主要讨论了 DevOps 实现了革命性的流 在本文的[第二部分][16]中,我们将查看 Drupal 社区中 DevOps 调查的结果,并了解最有可能找到快速获胜的位置。 -* * * - -_Rob_ _Bayliss and Kelly Albrecht will present[DevOps: Why, How, and What][17] and host a follow-up [Birds of a][18]_ [_Feather_][18] _[discussion][18] at [DrupalCon 2019][19] in Seattle, April 8-12._ - -------------------------------------------------------------------------------- via: https://opensource.com/article/19/3/devops-most-important-tech-strategy -作者:[Kelly AlbrechtWilly-Peter Schaub][a] +作者:[Kelly Albrecht][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/zgj1024) -校对:[校对者ID](https://github.com/校对者ID) +译者:[zgj1024](https://github.com/zgj1024) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3bce8ccadb139d1729d20b3dcf8c65bf172b5370 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 9 May 2019 11:31:40 +0800 Subject: [PATCH 0350/1154] PUB:20190327 Why DevOps is the most important tech strategy today.md @zgj1024 https://linux.cn/article-10834-1.html --- ...27 Why DevOps is the most important tech strategy today.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190327 Why DevOps is the most important tech strategy today.md (99%) diff --git a/translated/talk/20190327 Why DevOps is the most important tech strategy today.md b/published/20190327 Why DevOps is the most important tech strategy today.md similarity index 99% rename from translated/talk/20190327 Why DevOps is the most important tech strategy today.md rename to published/20190327 Why DevOps is the most important tech strategy today.md index 9c12db5d57..d96ae31f13 100644 --- a/translated/talk/20190327 Why DevOps is the most important tech strategy today.md +++ b/published/20190327 Why DevOps is the most important tech strategy today.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "zgj1024" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10834-1.html" [#]: subject: "Why DevOps is the most important tech strategy today" [#]: via: "https://opensource.com/article/19/3/devops-most-important-tech-strategy" [#]: author: "Kelly Albrecht https://opensource.com/users/ksalbrecht" From d6815df5007da6064ea57671a96fa726d0593d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Thu, 9 May 2019 22:07:32 +0800 Subject: [PATCH 0351/1154] translating --- .../20190409 Anbox - Easy Way To Run Android Apps On Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md index c7b0ba82c8..8187d07674 100644 --- a/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md +++ b/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From aaaef541160ce7bf697d3a1cf6b35f5bbea462fa Mon Sep 17 00:00:00 2001 From: Moelf Date: Thu, 9 May 2019 16:06:40 -0700 Subject: [PATCH 0352/1154] Start translating 'Use force in Linux command line' --- .../tech/20190504 Using the force at the Linux command line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190504 Using the force at the Linux command line.md b/sources/tech/20190504 Using the force at the Linux command line.md index 48e802e183..b4a937797c 100644 --- a/sources/tech/20190504 Using the force at the Linux command line.md +++ b/sources/tech/20190504 Using the force at the Linux command line.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Moelf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9f24387e19a1244adcb7b1a93073c20d926ae584 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 May 2019 08:56:18 +0800 Subject: [PATCH 0353/1154] translated --- ...rmat Python however you like with Black.md | 99 ------------------- ...rmat Python however you like with Black.md | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20190502 Format Python however you like with Black.md create mode 100644 translated/tech/20190502 Format Python however you like with Black.md diff --git a/sources/tech/20190502 Format Python however you like with Black.md b/sources/tech/20190502 Format Python however you like with Black.md deleted file mode 100644 index 7030bc795b..0000000000 --- a/sources/tech/20190502 Format Python however you like with Black.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Format Python however you like with Black) -[#]: via: (https://opensource.com/article/19/5/python-black) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) - -Format Python however you like with Black -====== -Learn more about solving common Python problems in our series covering -seven PyPI libraries. -![OpenStack source code \(Python\) in VIM][1] - -Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. - -In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. In the first article, we learned about [Cython][4]; today, we'll examine the **[Black][5]** code formatter. - -### Black - -Sometimes creativity can be a wonderful thing. Sometimes it is just a pain. I enjoy solving hard problems creatively, but I want my Python formatted as consistently as possible. Nobody has ever been impressed by code that uses "interesting" indentation. - -But even worse than inconsistent formatting is a code review that consists of nothing but formatting nits. It is annoying to the reviewer—and even more annoying to the person whose code is reviewed. It's also infuriating when your linter tells you that your code is indented incorrectly, but gives no hint about the _correct_ amount of indentation. - -Enter Black. Instead of telling you _what_ to do, Black is a good, industrious robot: it will fix your code for you. - -To see how it works, feel free to write something beautifully inconsistent like: - - -``` -def add(a, b): return a+b - -def mult(a, b): -return \ -a * b -``` - -Does Black complain? Goodness no, it just fixes it for you! - - -``` -$ black math -reformatted math -All done! ✨ 🍰 ✨ -1 file reformatted. -$ cat math -def add(a, b): -return a + b - -def mult(a, b): -return a * b -``` - -Black does offer the option of failing instead of fixing and even outputting a **diff** -style edit. These options are great in a continuous integration (CI) system that enforces running Black locally. In addition, if the **diff** output is logged to the CI output, you can directly paste it into **patch** in the rare case that you need to fix your output but cannot install Black locally. - - -``` -$ black --check --diff bad -\--- math 2019-04-09 17:24:22.747815 +0000 -+++ math 2019-04-09 17:26:04.269451 +0000 -@@ -1,7 +1,7 @@ --def add(a, b): return a + b -+def add(a, b): -\+ return a + b - - -def mult(a, b): -\- return \ -\- a * b -\+ return a * b - -would reformat math -All done! 💥 💔 💥 -1 file would be reformatted. -$ echo $? -1 -``` - -In the next article in this series, we'll look at **attrs** , a library that helps you write concise, correct code quickly. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/python-black - -作者:[Moshe Zadka ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez/users/moshez/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM) -[2]: https://opensource.com/article/18/5/numbers-python-community-trends -[3]: https://pypi.org/ -[4]: https://opensource.com/article/19/4/7-python-problems-solved-cython -[5]: https://pypi.org/project/black/ diff --git a/translated/tech/20190502 Format Python however you like with Black.md b/translated/tech/20190502 Format Python however you like with Black.md new file mode 100644 index 0000000000..ffcfc5aad2 --- /dev/null +++ b/translated/tech/20190502 Format Python however you like with Black.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Format Python however you like with Black) +[#]: via: (https://opensource.com/article/19/5/python-black) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) + +使用 Black 随意格式化 Python +====== +在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 +![OpenStack source code \(Python\) in VIM][1] + +Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包的原因,用以扩展和改进 Python 并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。在第一篇文章中,我们了解了 [Cython][4]。今天,我们将使用 **[Black] [5]** 这个代码格式化工具。 + +### Black + +有时创意可能是一件美妙的事情。有时它只是一种痛苦。我喜欢创造性地解决难题,但我希望我的 Python 格式尽可能一致。没有人对使用“有趣”缩进的代码印象深刻。 + +但是比不一致的格式更糟糕的是除了检查格式之外什么都没有的代码审查。这对审查者来说很烦人,对于被审查者人来说甚至更烦人。当你的 linter 告诉你你的代码缩进不正确时,但没有提示_正确_的缩进量,这也会令人气愤。 + +使用 Black,它不会告诉你_要_做什么,它是一个优良、勤奋的机器人:它将为你修复代码。 + +要了解它如何工作的,请随意写一些非常不一致的内容,例如: + + +``` +def add(a, b): return a+b + +def mult(a, b): + return \ + a * b +``` + +Black 抱怨了么?并没有,它为你修复了! + + +``` +$ black math +reformatted math +All done! ✨ 🍰 ✨ +1 file reformatted. +$ cat math +def add(a, b): + return a + b + + +def mult(a, b): + return a * b +``` + +Black 确实提供了错误而不是修复的选项,甚至还有输出 **diff** 编辑样式的选项。这些选项在持续集成 (CI) 系统中非常有用,可以在本地强制运行 Black。此外,如果 **diff** 输出被记录到 CI 输出中,你可以直接将其粘贴到 **patch** 中,以便在极少数情况下你需要修复输出,但无法本地安装 Black。 + + +``` +$ black --check --diff bad +--- math 2019-04-09 17:24:22.747815 +0000 ++++ math 2019-04-09 17:26:04.269451 +0000 +@@ -1,7 +1,7 @@ +-def add(a, b): return a + b ++def add(a, b): ++ return a + b + + + def mult(a, b): +- return \ +- a * b ++ return a * b + +would reformat math +All done! 💥 💔 💥 +1 file would be reformatted. +$ echo $? +1 +``` + +在本系列的下一篇文章中,我们将介绍 **attrs** ,这是一个可以帮助你快速编写简洁,正确的代码的库。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-black + +作者:[Moshe Zadka ][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/moshez/users/moshez/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM) +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[5]: https://pypi.org/project/black/ From c8861e0ce57bc5ded146d585d209cbeb37d67195 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 May 2019 09:01:53 +0800 Subject: [PATCH 0354/1154] translating --- .../20190503 Say goodbye to boilerplate in Python with attrs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md index 42d9f86ca3..85d1f2345c 100644 --- a/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md +++ b/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8fe510abec56172e9614292e6dd41bf0cde2abc3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 10 May 2019 23:09:18 +0800 Subject: [PATCH 0355/1154] PRF:20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @geekpi --- ...nd Restore Those On Fresh Ubuntu System.md | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md index 37f7c06f48..1be336fc59 100644 --- a/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md +++ b/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) @@ -10,17 +10,9 @@ apt-clone:备份已安装的软件包并在新的 Ubuntu 系统上恢复它们 ====== -当我们在基于Ubuntu/Debian 的系统上使用 apt-clone,包安装会变得更加容易。 +当我们在基于 Ubuntu/Debian 的系统上使用 `apt-clone`,包安装会变得更加容易。如果你需要在少量系统上安装相同的软件包时,`apt-clone` 会适合你。 -如果你需要在少量系统上安装相同的软件包时,apt-clone 会适合你。 - -如果你想在每个系统上手动构建和安装必要的软件包,这是一个耗时的过程。 - -它可以通过多种方式实现,Linux 中有许多程序可用。 - -我们过去曾写过一篇关于 **[Aptik][1]** 的文章。 - -它是能让 Ubuntu 用户备份和恢复系统设置和数据的程序之一。 +如果你想在每个系统上手动构建和安装必要的软件包,这是一个耗时的过程。它可以通过多种方式实现,Linux 中有许多程序可用。我们过去曾写过一篇关于 [Aptik][1] 的文章。它是能让 Ubuntu 用户备份和恢复系统设置和数据的程序之一。 ### 什么是 apt-clone? @@ -30,15 +22,15 @@ apt-clone:备份已安装的软件包并在新的 Ubuntu 系统上恢复它们 ### 如何安装 apt-clone? -apt-clone 包可以在 Ubuntu/Debian 的官方仓库中找到,所以,使用 **[apt 包管理器][3]** 或 **[apt-get 包管理器][4]** 来安装它。 +`apt-clone` 包可以在 Ubuntu/Debian 的官方仓库中找到,所以,使用 [apt 包管理器][3] 或 [apt-get 包管理器][4] 来安装它。 -使用 apt 包管理器安装 apt-clone。 +使用 `apt` 包管理器安装 `apt-clone`。 ``` $ sudo apt install apt-clone ``` -使用 apt-get 包管理器安装 apt-clone。 +使用 `apt-get` 包管理器安装 `apt-clone`。 ``` $ sudo apt-get install apt-clone @@ -46,17 +38,15 @@ $ sudo apt-get install apt-clone ### 如何使用 apt-clone 备份已安装的软件包? -成功安装 apt-clone 之后。只需提供一个保存备份文件的位置。 +成功安装 `apt-clone` 之后。只需提供一个保存备份文件的位置。我们将在 `/backup` 目录下保存已安装的软件包备份。 -我们将在 `/backup` 目录下保存已安装的软件包备份。 - -apt-clone 会将已安装的软件包列表保存到 `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` 中。 +`apt-clone` 会将已安装的软件包列表保存到 `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` 中。 ``` $ sudo apt-clone clone /backup ``` -我们同样可以通过运行 ls 命令来检查。 +我们同样可以通过运行 `ls` 命令来检查。 ``` $ ls -lh /backup/ @@ -86,7 +76,7 @@ Date: Sat Apr 20 19:06:43 2019 $ scp /backup/apt-clone-state-ubunt-18-04.tar.gz Destination-Server:/opt ``` -复制完成后,使用 apt-clone 执行还原。 +复制完成后,使用 `apt-clone` 执行还原。 使用以下命令进行还原。 @@ -109,7 +99,7 @@ via: https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-th 作者:[Magesh Maruthamuthu][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/) 荣誉推出 From d54aa4ac2c20471e223ec7614530c4d00bd39763 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 10 May 2019 23:09:53 +0800 Subject: [PATCH 0356/1154] PUB:20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @geekpi https://linux.cn/article-10837-1.html --- ...alled Packages And Restore Those On Fresh Ubuntu System.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md (98%) diff --git a/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/published/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md similarity index 98% rename from translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md rename to published/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md index 1be336fc59..fa7db2e2bb 100644 --- a/translated/tech/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md +++ b/published/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10837-1.html) [#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) [#]: via: (https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From eca7933030fcdc9cdc9e1759a05ea3ddbc88c2e7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 09:53:48 +0800 Subject: [PATCH 0357/1154] TSL:20190308 Virtual filesystems in Linux- Why we need them and how they work.md --- ...nux- Why we need them and how they work.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index e6b4bd1889..3e32f3d519 100644 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -14,39 +14,41 @@ Linux 中的虚拟文件系统 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ) -什么是文件系统?根据早期的 Linux 贡献者和作者 [Robert Love][1] 所说,“文件系统是一个遵循特定结构的数据的分层存储。” 不过,这种描述也同样适用于 VFAT(虚拟文件分配表)、Git 和[Cassandra][2](一种 [NoSQL 数据库][3])。那么如何区别文件系统呢? +什么是文件系统?根据早期的 Linux 贡献者和作家 [Robert Love][1] 所说,“文件系统是一个遵循特定结构的数据的分层存储。” 不过,这种描述也同样适用于 VFAT(虚拟文件分配表)、Git 和[Cassandra][2](一种 [NoSQL 数据库][3])。那么如何区别文件系统呢? ### 文件系统基础概念 -Linux 内核要求文件系统必须是实体,它还必须在持久对象上实现 `open()`、`read()` 和 `write()` 方法,并且这些实体需要有与之关联的名字。从 [面向对象编程][4] 的角度来看,内核将通用文件系统视为一个抽象接口,这些三大函数是“虚拟”的,没有默认定义。因此,内核的默认文件系统实现被称为虚拟文件系统(VFS)。 +Linux 内核要求文件系统必须是实体,它还必须在持久对象上实现 `open()`、`read()` 和 `write()` 方法,并且这些实体需要有与之关联的名字。从 [面向对象编程][4] 的角度来看,内核将通用文件系统视为一个抽象接口,这三大函数是“虚拟”的,没有默认定义。因此,内核的默认文件系统实现被称为虚拟文件系统(VFS)。 ![][5] -If we can open(), read(), and write(), it is a file as this console session shows. +如果我们能够 `open()`、`read()` 和 `write()`,它就是一个文件,如这个主控台会话所示。 -VFS underlies the famous observation that in Unix-like systems "everything is a file." Consider how weird it is that the tiny demo above featuring the character device /dev/console actually works. The image shows an interactive Bash session on a virtual teletype (tty). Sending a string into the virtual console device makes it appear on the virtual screen. VFS has other, even odder properties. For example, it's [possible to seek in them][6]. +VFS 是著名的类 Unix 系统中 “一切皆文件” 的基础。让我们看一下它有多奇怪,上面的小演示体现了字符设备 `/dev/console` 实际的工作。该图显示了一个在虚拟电传打字(tty)上的交互式 Bash 会话。将一个字符串发送到虚拟控制台设备会使其显示在虚拟屏幕上。而 VFS 甚至还有其它更奇怪的属性。例如,它[可以在其中寻址][6]。 -The familiar filesystems like ext4, NFS, and /proc all provide definitions of the big-three functions in a C-language data structure called [file_operations][7] . In addition, particular filesystems extend and override the VFS functions in the familiar object-oriented way. As Robert Love points out, the abstraction of VFS enables Linux users to blithely copy files to and from foreign operating systems or abstract entities like pipes without worrying about their internal data format. On behalf of userspace, via a system call, a process can copy from a file into the kernel's data structures with the read() method of one filesystem, then use the write() method of another kind of filesystem to output the data. +熟悉的文件系统如 ext4、NFS 和 /proc 在名为 [file_operations] [7] 的 C 语言数据结构中都提供了三大函数的定义。此外,特定的文件系统会以熟悉的面向对象的方式扩展和覆盖了 VFS 功能。正如 Robert Love 指出的那样,VFS 的抽象使 Linux 用户可以轻松地将文件复制到(复制自)外部操作系统或抽象实体(如管道),而无需担心其内部数据格式。在用户空间,通过系统调用,进程可以使用一个文件系统的 `read()`方法从文件复制到内核的数据结构中,然后使用另一种文件系统的 `write()` 方法输出数据。 -The function definitions that belong to the VFS base type itself are found in the [fs/*.c files][8] in kernel source, while the subdirectories of fs/ contain the specific filesystems. The kernel also contains filesystem-like entities such as cgroups, /dev, and tmpfs, which are needed early in the boot process and are therefore defined in the kernel's init/ subdirectory. Note that cgroups, /dev, and tmpfs do not call the file_operations big-three functions, but directly read from and write to memory instead. +属于 VFS 基本类型的函数定义本身可以在内核源代码的 [fs/*.c 文件][8] 中找到,而 `fs/` 的子目录中包含了特定的文件系统。内核还包含了类似文件系统的实体,例如 cgroup、`/dev` 和 tmpfs,它们在引导过程的早期需要,因此定义在内核的 `init/` 子目录中。请注意,cgroup、`/dev` 和 tmpfs 不会调用 `file_operations` 的三大函数,而是直接读取和写入内存。 -The diagram below roughly illustrates how userspace accesses various types of filesystems commonly mounted on Linux systems. Not shown are constructs like pipes, dmesg, and POSIX clocks that also implement struct file_operations and whose accesses therefore pass through the VFS layer. +下图大致说明了用户空间如何访问通常挂载在 Linux 系统上的各种类型的文件系统。未显示的是像管道、dmesg 和 POSIX 时钟这样的结构,它们也实现了 `struct file_operations`,并且因此其访问要通过 VFS 层。 ![How userspace accesses various types of filesystems][9] -VFS are a "shim layer" between system calls and implementors of specific file_operations like ext4 and procfs. The file_operations functions can then communicate either with device-specific drivers or with memory accessors. tmpfs, devtmpfs and cgroups don't make use of file_operations but access memory directly. -VFS's existence promotes code reuse, as the basic methods associated with filesystems need not be re-implemented by every filesystem type. Code reuse is a widely accepted software engineering best practice! Alas, if the reused code [introduces serious bugs][10], then all the implementations that inherit the common methods suffer from them. +VFS 是系统调用和特定 `file_operations` 的实现(如 ext4 和 procfs)之间的“垫片层”。然后,`file_operations` 函数可以与特定于设备的驱动程序或内存访问器进行通信。tmpfs、devtmpfs 和 cgroup 不使用 `file_operations` 而是直接访问内存。 -### /tmp: A simple tip +VFS 的存在促进了代码重用,因为与文件系统相关的基本方法不需要由每种文件系统类型重新实现。代码重用是一种被广泛接受的软件工程最佳实践!唉,如果重用的代码[引入了严重的错误][10],那么继承常用方法的所有实现都会受到影响。 -An easy way to find out what VFSes are present on a system is to type **mount | grep -v sd | grep -v :/** , which will list all mounted filesystems that are not resident on a disk and not NFS on most computers. One of the listed VFS mounts will assuredly be /tmp, right? +### /tmp:一个小提示 + +找出系统中存在的 VFS 的简单方法是键入 `mount | grep -v sd | grep -v :/`,在大多数计算机上,它将列出所有未驻留在磁盘上也不是 NFS 的已挂载文件系统。其中一个列出的 VFS 挂载肯定是 `/ tmp`,对吧? ![Man with shocked expression][11] -Everyone knows that keeping /tmp on a physical storage device is crazy! credit: -Why is keeping /tmp on storage inadvisable? Because the files in /tmp are temporary(!), and storage devices are slower than memory, where tmpfs are created. Further, physical devices are more subject to wear from frequent writing than memory is. Last, files in /tmp may contain sensitive information, so having them disappear at every reboot is a feature. +*每个人都知道把 /tmp 放在物理存储设备上简直是疯了!图片:* -Unfortunately, installation scripts for some Linux distros still create /tmp on a storage device by default. Do not despair should this be the case with your system. Follow simple instructions on the always excellent [Arch Wiki][12] to fix the problem, keeping in mind that memory allocated to tmpfs is not available for other purposes. In other words, a system with a gigantic tmpfs with large files in it can run out of memory and crash. Another tip: when editing the /etc/fstab file, be sure to end it with a newline, as your system will not boot otherwise. (Guess how I know.) +为什么把 `/tmp` 留在存储设备上是不可取的?因为 `/tmp` 中的文件是临时的(!),并且存储设备比内存慢,所以创建了 tmpfs 这种文件系统。此外,比起内存,物理设备频繁写入更容易磨损。最后,`/tmp` 中的文件可能包含敏感信息,因此在每次重新启动时让它们消失是一项功能。 + +不幸的是,默认情况下,某些 Linux 发行版的安装脚本仍会在存储设备上创建 /tmp。如果你的系统出现这种情况,请不要绝望。按照一直优秀的 [Arch Wiki][12] 上的简单说明来解决问题就行,记住分配给 tmpfs 的内存不能用于其他目的。换句话说,带有巨大 tmpfs 并且其中包含大文件的系统可能会耗尽内存并崩溃。另一个提示:编辑 `/etc/fstab` 文件时,请务必以换行符结束,否则系统将无法启动。(猜猜我怎么知道。) ### /proc and /sys From 878fdc1ffb95ae9858e1be86fbd84d51a24addc6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 09:56:32 +0800 Subject: [PATCH 0358/1154] APL:20190416 Building a DNS-as-a-service with OpenStack Designate.md --- ...0416 Building a DNS-as-a-service with OpenStack Designate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md index 2dc628a49c..287d0099df 100644 --- a/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md +++ b/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d285b91350c65d3053f47825e46bf952fd0861c2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 10:42:06 +0800 Subject: [PATCH 0359/1154] TSL:20190416 Building a DNS-as-a-service with OpenStack Designate.md --- ...S-as-a-service with OpenStack Designate.md | 263 ------------- ...S-as-a-service with OpenStack Designate.md | 347 ++++++++++++++++++ 2 files changed, 347 insertions(+), 263 deletions(-) delete mode 100644 sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md create mode 100644 translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md diff --git a/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md deleted file mode 100644 index 287d0099df..0000000000 --- a/sources/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md +++ /dev/null @@ -1,263 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Building a DNS-as-a-service with OpenStack Designate) -[#]: via: (https://opensource.com/article/19/4/getting-started-openstack-designate) -[#]: author: (Amjad Yaseen https://opensource.com/users/ayaseen) - -Building a DNS-as-a-service with OpenStack Designate -====== -Learn how to install and configure Designate, a multi-tenant -DNS-as-a-service (DNSaaS) for OpenStack. -![Command line prompt][1] - -[Designate][2] is a multi-tenant DNS-as-a-service that includes a REST API for domain and record management, a framework for integration with [Neutron][3], and integration support for Bind9. - -You would want to consider a DNSaaS for the following: - - * A clean REST API for managing zones and records - * Automatic records generated (with OpenStack integration) - * Support for multiple authoritative name servers - * Hosting multiple projects/organizations - - - -![Designate's architecture][4] - -This article explains how to manually install and configure the latest release of Designate service on CentOS or Red Hat Enterprise Linux 7 (RHEL 7), but you can use the same configuration on other distributions. - -### Install Designate on OpenStack - -I have Ansible roles for bind and Designate that demonstrate the setup in my [GitHub repository][5]. - -This setup presumes bind service is external (even though you can install bind locally) on the OpenStack controller node. - - 1. Install Designate's packages and bind (on OpenStack controller): [code]`# yum install openstack-designate-* bind bind-utils -y` -``` - 2. Create the Designate database and user: [code] MariaDB [(none)]> CREATE DATABASE designate CHARACTER SET utf8 COLLATE utf8_general_ci; - -MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO \ -'designate'@'localhost' IDENTIFIED BY 'rhlab123'; - -MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO 'designate'@'%' \ -IDENTIFIED BY 'rhlab123'; -``` - - - - -Note: Bind packages must be installed on the controller side for Remote Name Daemon Control (RNDC) to function properly. - -### Configure bind (DNS server) - - 1. Generate RNDC files: [code] rndc-confgen -a -k designate -c /etc/rndc.key -r /dev/urandom - -cat < etcrndc.conf -include "/etc/rndc.key"; -options { -default-key "designate"; -default-server {{ DNS_SERVER_IP }}; -default-port 953; -}; -EOF -``` - 2. Add the following into **named.conf** : [code]`include "/etc/rndc.key"; controls { inet {{ DNS_SERVER_IP }} allow { localhost;{{ CONTROLLER_SERVER_IP }}; } keys { "designate"; }; };`[/code] In the **option** section, add: [code] options { -... -allow-new-zones yes; -request-ixfr no; -listen-on port 53 { any; }; -recursion no; -allow-query { 127.0.0.1; {{ CONTROLLER_SERVER_IP }}; }; -}; [/code] Add the right permissions: [code] chown named:named /etc/rndc.key -chown named:named /etc/rndc.conf -chmod 600 /etc/rndc.key -chown -v root:named /etc/named.conf -chmod g+w /var/named - -# systemctl restart named -# setsebool named_write_master_zones 1 -``` - - 3. Push **rndc.key** and **rndc.conf** into the OpenStack controller: [code]`# scp -r /etc/rndc* {{ CONTROLLER_SERVER_IP }}:/etc/` -``` -## Create OpenStack Designate service and endpoints - -Enter: -``` - - -# openstack user create --domain default --password-prompt designate -# openstack role add --project services --user designate admin -# openstack service create --name designate --description "DNS" dns - -# openstack endpoint create --region RegionOne dns public http://{{ CONTROLLER_SERVER_IP }}:9001/ -# openstack endpoint create --region RegionOne dns internal http://{{ CONTROLLER_SERVER_IP }}:9001/ -# openstack endpoint create --region RegionOne dns admin http://{{ CONTROLLER_SERVER_IP }}:9001/ - -``` -## Configure Designate service - - 1. Edit **/etc/designate/designate.conf** : - * In the **[service:api]** section, configure **auth_strategy** : [code] [service:api] -listen = 0.0.0.0:9001 -auth_strategy = keystone -api_base_uri = http://{{ CONTROLLER_SERVER_IP }}:9001/ -enable_api_v2 = True -enabled_extensions_v2 = quotas, reports -``` - * In the **[keystone_authtoken]** section, configure the following options: [code] [keystone_authtoken] -auth_type = password -username = designate -password = rhlab123 -project_name = service -project_domain_name = Default -user_domain_name = Default -www_authenticate_uri = http://{{ CONTROLLER_SERVER_IP }}:5000/ -auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000/ -``` - * In the **[service:worker]** section, enable the worker model: [code] enabled = True -notify = True -``` - * In the **[storage:sqlalchemy]** section, configure database access: [code] [storage:sqlalchemy] -connection = mysql+pymysql://designate:rhlab123@{{ CONTROLLER_SERVER_IP }}/designate -``` -* Populate the Designate database: [code]`# su -s /bin/sh -c "designate-manage database sync" designate` -``` - - - 2. Create Designate's **pools.yaml** file (has target and bind details): - * Edit **/etc/designate/pools.yaml** : [code] - name: default -# The name is immutable. There will be no option to change the name after -# creation and the only way will to change it will be to delete it -# (and all zones associated with it) and recreate it. -description: Default Pool - -attributes: {} - -# List out the NS records for zones hosted within this pool -# This should be a record that is created outside of designate, that -# points to the public IP of the controller node. -ns_records: -\- hostname: {{Controller_FQDN}}. # Thisis mDNS -priority: 1 - -# List out the nameservers for this pool. These are the actual BIND servers. -# We use these to verify changes have propagated to all nameservers. -nameservers: -\- host: {{ DNS_SERVER_IP }} -port: 53 - -# List out the targets for this pool. For BIND there will be one -# entry for each BIND server, as we have to run rndc command on each server -targets: -\- type: bind9 -description: BIND9 Server 1 - -# List out the designate-mdns servers from which BIND servers should -# request zone transfers (AXFRs) from. -# This should be the IP of the controller node. -# If you have multiple controllers you can add multiple masters -# by running designate-mdns on them, and adding them here. -masters: -\- host: {{ CONTROLLER_SERVER_IP }} -port: 5354 - -# BIND Configuration options -options: -host: {{ DNS_SERVER_IP }} -port: 53 -rndc_host: {{ DNS_SERVER_IP }} -rndc_port: 953 -rndc_key_file: /etc/rndc.key -rndc_config_file: /etc/rndc.conf -``` -* Populate Designate's pools: [code]`su -s /bin/sh -c "designate-manage pool update" designate` -``` - - - - 3. Start Designate central and API services: [code]`systemctl enable --now designate-central designate-api` -``` - 4. Verify Designate's services are up: [code] # openstack dns service list - -+--------------+--------+-------+--------------+ -| service_name | status | stats | capabilities | -+--------------+--------+-------+--------------+ -| central | UP | - | - | -| api | UP | - | - | -| mdns | UP | - | - | -| worker | UP | - | - | -| producer | UP | - | - | -+--------------+--------+-------+--------------+ -``` - - - - -### Configure OpenStack Neutron with external DNS - - 1. Configure iptables for Designate services: [code] # iptables -I INPUT -p tcp -m multiport --dports 9001 -m comment --comment "designate incoming" -j ACCEPT - -# iptables -I INPUT -p tcp -m multiport --dports 5354 -m comment --comment "Designate mdns incoming" -j ACCEPT - -# iptables -I INPUT -p tcp -m multiport --dports 53 -m comment --comment "bind incoming" -j ACCEPT - - -# iptables -I INPUT -p udp -m multiport --dports 53 -m comment --comment "bind/powerdns incoming" -j ACCEPT - -# iptables -I INPUT -p tcp -m multiport --dports 953 -m comment --comment "rndc incoming - bind only" -j ACCEPT - -# service iptables save; service iptables restart -# setsebool named_write_master_zones 1 -``` -2. Edit the **[default]** section of **/etc/neutron/neutron.conf** : [code]`external_dns_driver = designate` -``` - - 3. Add the **[designate]** section in **/_etc/_neutron/neutron.conf** : [code] [designate] -url = http://{{ CONTROLLER_SERVER_IP }}:9001/v2 ## This end point of designate -auth_type = password -auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000 -username = designate -password = rhlab123 -project_name = services -project_domain_name = Default -user_domain_name = Default -allow_reverse_dns_lookup = True -ipv4_ptr_zone_prefix_size = 24 -ipv6_ptr_zone_prefix_size = 116 -``` - 4. Edit **dns_domain** in **neutron.conf** : [code] dns_domain = rhlab.dev. - -# systemctl restart neutron-* -``` - - 5. Add **dns** to the list of Modular Layer 2 (ML2) drivers in **/etc/neutron/plugins/ml2/ml2_conf.ini** : [code]`extension_drivers=port_security,qos,dns` -``` -6. Add **zone** in Designate: [code]`# openstack zone create –email=admin@rhlab.dev rhlab.dev.`[/code] Add a new record in **zone rhlab.dev** : [code]`# openstack recordset create --record '192.168.1.230' --type A rhlab.dev. Test` -``` - - - - -Designate should now be installed and configured. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/getting-started-openstack-designate - -作者:[Amjad Yaseen][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/ayaseen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) -[2]: https://docs.openstack.org/designate/latest/ -[3]: /article/19/3/openstack-neutron -[4]: https://opensource.com/sites/default/files/uploads/openstack_designate_architecture.png (Designate's architecture) -[5]: https://github.com/ayaseen/designate diff --git a/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md new file mode 100644 index 0000000000..136aaffde4 --- /dev/null +++ b/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -0,0 +1,347 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building a DNS-as-a-service with OpenStack Designate) +[#]: via: (https://opensource.com/article/19/4/getting-started-openstack-designate) +[#]: author: (Amjad Yaseen https://opensource.com/users/ayaseen) + +用 OpenStack Designate 构建一个 DNS 即服务(DNSaaS) +====== + +> 学习如何安装和配置 Designate,这是一个 OpenStack 的多租户 DNS 即服务(DNSaaS)。 + +![Command line prompt][1] + +[Designate][2] 是一个多租户的 DNS 即服务,它包括一个用于域名和记录管理的 REST API 和集成了 [Neutron][3] 的框架,并集成支持了 Bind9。 + +DNSaaS 可以提供: + + * 一个管理区域和记录的干净利落的 REST API + * 自动生成记录(集成 OpenStack) + * 支持多个授权名字服务器 + * 可以托管多个项目/组织 + +![Designate's architecture][4] + +这篇文章解释了如何在 CentOS 和 RHEL 上手动安装和配置 Designate 的最新版本,但是这个相同的配置你也可以用在其它发行版上。 + +### 在 OpenStack 上安装 Designate + +在我的 [GitHub 仓库][5]里我已经放了 Ansible 的 bind 和 Designate 的角色的示范设置。 + +这个设置假定 bing 服务是安装 OpenStack 控制器节点之外(即使你可以在本地安装 bind)。 + +1、在 OpenStack 控制节点上安装 Designate 和 bind 软件包: + +``` +# yum install openstack-designate-* bind bind-utils -y +``` + +2、创建 Designate 数据库和用户: + +``` +MariaDB [(none)]> CREATE DATABASE designate CHARACTER SET utf8 COLLATE utf8_general_ci; + +MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO \ +'designate'@'localhost' IDENTIFIED BY 'rhlab123'; + +MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO 'designate'@'%' \ +IDENTIFIED BY 'rhlab123'; +``` + +注意:bind 包必须安装在控制节点之外才能使远程名字服务控制Remote Name Daemon Control(RNDC) 功能正常。 + +### 配置 bind(DNS 服务器) + +1、生成 RNDC 文件: + +``` +rndc-confgen -a -k designate -c /etc/rndc.key -r /dev/urandom + +cat < etcrndc.conf +include "/etc/rndc.key"; +options { + default-key "designate"; + default-server {{ DNS_SERVER_IP }}; + default-port 953; +}; +EOF +``` + +2、将下列配置添加到 `named.conf`: + +``` +include "/etc/rndc.key"; +controls { + inet {{ DNS_SERVER_IP }} allow { localhost;{{ CONTROLLER_SERVER_IP }}; } keys { "designate"; }; +}; +``` + +在 `option` 一节中,添加: + +``` +options { + ... + allow-new-zones yes; + request-ixfr no; + listen-on port 53 { any; }; + recursion no; + allow-query { 127.0.0.1; {{ CONTROLLER_SERVER_IP }}; }; +}; +``` + +添加正确的权限: + +``` +chown named:named /etc/rndc.key +chown named:named /etc/rndc.conf +chmod 600 /etc/rndc.key +chown -v root:named /etc/named.conf +chmod g+w /var/named + +# systemctl restart named +# setsebool named_write_master_zones 1 +``` + +3、推送 `rndc.key` 和 `rndc.conf` 到 OpenStack 控制节点: + +``` +# scp -r /etc/rndc* {{ CONTROLLER_SERVER_IP }}:/etc/ +``` + +### 创建 OpenStack Designate 服务和端点 + +输入: + +``` +# openstack user create --domain default --password-prompt designate +# openstack role add --project services --user designate admin +# openstack service create --name designate --description "DNS" dns + +# openstack endpoint create --region RegionOne dns public http://{{ CONTROLLER_SERVER_IP }}:9001/ +# openstack endpoint create --region RegionOne dns internal http://{{ CONTROLLER_SERVER_IP }}:9001/ +# openstack endpoint create --region RegionOne dns admin http://{{ CONTROLLER_SERVER_IP }}:9001/ +``` + +### 配置 Designate 服务 + +1、编辑 `/etc/designate/designate.conf`: + +在 `[service:api]` 节配置 `auth_strategy`: + +``` +[service:api] +listen = 0.0.0.0:9001 +auth_strategy = keystone +api_base_uri = http://{{ CONTROLLER_SERVER_IP }}:9001/ +enable_api_v2 = True +enabled_extensions_v2 = quotas, reports +``` + +在 `[keystone_authtoken]` 节配置下列选项: + +``` +[keystone_authtoken] +auth_type = password +username = designate +password = rhlab123 +project_name = service +project_domain_name = Default +user_domain_name = Default +www_authenticate_uri = http://{{ CONTROLLER_SERVER_IP }}:5000/ +auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000/ +``` + +在 `[service:worker]` 节,启用 worker 模型: + +``` +enabled = True +notify = True +``` + +在 `[storage:sqlalchemy]` 节,配置数据库访问: + +``` +[storage:sqlalchemy] +connection = mysql+pymysql://designate:rhlab123@{{ CONTROLLER_SERVER_IP }}/designate +``` + +填充 Designate 数据库: + +``` +# su -s /bin/sh -c "designate-manage database sync" designate +``` + +2、 创建 Designate 的 `pools.yaml` 文件(包含 target 和 bind 细节): + +编辑 `/etc/designate/pools.yaml`: + +``` +- name: default + # The name is immutable. There will be no option to change the name after + # creation and the only way will to change it will be to delete it + # (and all zones associated with it) and recreate it. + description: Default Pool + + attributes: {} + + # List out the NS records for zones hosted within this pool + # This should be a record that is created outside of designate, that + # points to the public IP of the controller node. + ns_records: + - hostname: {{Controller_FQDN}}. # Thisis mDNS + priority: 1 + + # List out the nameservers for this pool. These are the actual BIND servers. + # We use these to verify changes have propagated to all nameservers. + nameservers: + - host: {{ DNS_SERVER_IP }} + port: 53 + + # List out the targets for this pool. For BIND there will be one + # entry for each BIND server, as we have to run rndc command on each server + targets: + - type: bind9 + description: BIND9 Server 1 + + # List out the designate-mdns servers from which BIND servers should + # request zone transfers (AXFRs) from. + # This should be the IP of the controller node. + # If you have multiple controllers you can add multiple masters + # by running designate-mdns on them, and adding them here. + masters: + - host: {{ CONTROLLER_SERVER_IP }} + port: 5354 + + # BIND Configuration options + options: + host: {{ DNS_SERVER_IP }} + port: 53 + rndc_host: {{ DNS_SERVER_IP }} + rndc_port: 953 + rndc_key_file: /etc/rndc.key + rndc_config_file: /etc/rndc.conf +``` + +填充 Designate 池: + +``` +su -s /bin/sh -c "designate-manage pool update" designate +``` + +3、启动 Designate 中心和 API 服务: + +``` +systemctl enable --now designate-central designate-api +``` + +4、验证 Designate 服务运行: + +``` +# openstack dns service list + ++--------------+--------+-------+--------------+ +| service_name | status | stats | capabilities | ++--------------+--------+-------+--------------+ +| central | UP | - | - | +| api | UP | - | - | +| mdns | UP | - | - | +| worker | UP | - | - | +| producer | UP | - | - | ++--------------+--------+-------+--------------+ +``` + +### 用外部 DNS 配置 OpenStack Neutron + +1、为 Designate 服务配置 iptables: + +``` +# iptables -I INPUT -p tcp -m multiport --dports 9001 -m comment --comment "designate incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 5354 -m comment --comment "Designate mdns incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 53 -m comment --comment "bind incoming" -j ACCEPT + +# iptables -I INPUT -p udp -m multiport --dports 53 -m comment --comment "bind/powerdns incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 953 -m comment --comment "rndc incoming - bind only" -j ACCEPT + +# service iptables save; service iptables restart +# setsebool named_write_master_zones 1 +``` + +2、 编辑 `/etc/neutron/neutron.conf` 的 `[default]` 节: + +``` +external_dns_driver = designate +``` + +3、 在 `/etc/neutron/neutron.conf` 中添加 `[designate]` 节: + +``` +[designate] +url = http://{{ CONTROLLER_SERVER_IP }}:9001/v2 ## This end point of designate +auth_type = password +auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000 +username = designate +password = rhlab123 +project_name = services +project_domain_name = Default +user_domain_name = Default +allow_reverse_dns_lookup = True +ipv4_ptr_zone_prefix_size = 24 +ipv6_ptr_zone_prefix_size = 116 +``` + +4、编辑 `neutron.conf` 的 `dns_domain`: + +``` +dns_domain = rhlab.dev. +``` + +重启: + +``` +# systemctl restart neutron-* +``` + +5、在 `/etc/neutron/plugins/ml2/ml2_conf.ini` 中的组成层 2(ML2)中添加 `dns`: + +``` +extension_drivers=port_security,qos,dns +``` + +6、在 Designate 中添加区域: + +``` +# openstack zone create –email=admin@rhlab.dev rhlab.dev. +``` + +在 `rhlab.dev` 区域中添加记录: + +``` +# openstack recordset create --record '192.168.1.230' --type A rhlab.dev. Test +``` + +Designate 现在就安装和配置好了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/getting-started-openstack-designate + +作者:[Amjad Yaseen][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ayaseen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://docs.openstack.org/designate/latest/ +[3]: /article/19/3/openstack-neutron +[4]: https://opensource.com/sites/default/files/uploads/openstack_designate_architecture.png (Designate's architecture) +[5]: https://github.com/ayaseen/designate From 5c3bd40a3a4b721eb35afa38ad3406ad55bb19b0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 11:08:39 +0800 Subject: [PATCH 0360/1154] PRF:20190416 Building a DNS-as-a-service with OpenStack Designate.md --- ... DNS-as-a-service with OpenStack Designate.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md index 136aaffde4..c8cdaec556 100644 --- a/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md +++ b/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Building a DNS-as-a-service with OpenStack Designate) @@ -14,7 +14,7 @@ ![Command line prompt][1] -[Designate][2] 是一个多租户的 DNS 即服务,它包括一个用于域名和记录管理的 REST API 和集成了 [Neutron][3] 的框架,并集成支持了 Bind9。 +[Designate][2] 是一个多租户的 DNS 即服务,它包括一个用于域名和记录管理的 REST API 和集成了 [Neutron][3] 的框架,并支持 Bind9。 DNSaaS 可以提供: @@ -25,11 +25,11 @@ DNSaaS 可以提供: ![Designate's architecture][4] -这篇文章解释了如何在 CentOS 和 RHEL 上手动安装和配置 Designate 的最新版本,但是这个相同的配置你也可以用在其它发行版上。 +这篇文章解释了如何在 CentOS 和 RHEL 上手动安装和配置 Designate 的最新版本,但是同样的配置也可以用在其它发行版上。 ### 在 OpenStack 上安装 Designate -在我的 [GitHub 仓库][5]里我已经放了 Ansible 的 bind 和 Designate 的角色的示范设置。 +在我的 [GitHub 仓库][5]里,我已经放了 Ansible 的 bind 和 Designate 角色的示范设置。 这个设置假定 bing 服务是安装 OpenStack 控制器节点之外(即使你可以在本地安装 bind)。 @@ -51,7 +51,7 @@ MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO 'designate'@'%' \ IDENTIFIED BY 'rhlab123'; ``` -注意:bind 包必须安装在控制节点之外才能使远程名字服务控制Remote Name Daemon Control(RNDC) 功能正常。 +注意:bind 包必须安装在控制节点之外才能使远程名字服务控制Remote Name Daemon Control(RNDC)功能正常。 ### 配置 bind(DNS 服务器) @@ -79,7 +79,7 @@ controls { }; ``` -在 `option` 一节中,添加: +在 `option` 节中,添加: ``` options { @@ -105,7 +105,7 @@ chmod g+w /var/named # setsebool named_write_master_zones 1 ``` -3、推送 `rndc.key` 和 `rndc.conf` 到 OpenStack 控制节点: +3、把 `rndc.key` 和 `rndc.conf` 推入 OpenStack 控制节点: ``` # scp -r /etc/rndc* {{ CONTROLLER_SERVER_IP }}:/etc/ @@ -334,7 +334,7 @@ via: https://opensource.com/article/19/4/getting-started-openstack-designate 作者:[Amjad Yaseen][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4543f8a7100a4976148debb4b65d68b9803b55d8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 11:10:44 +0800 Subject: [PATCH 0361/1154] PUB:20190416 Building a DNS-as-a-service with OpenStack Designate.md @wxy https://linux.cn/article-10840-1.html --- ... Building a DNS-as-a-service with OpenStack Designate.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20190416 Building a DNS-as-a-service with OpenStack Designate.md (98%) diff --git a/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/published/20190416 Building a DNS-as-a-service with OpenStack Designate.md similarity index 98% rename from translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md rename to published/20190416 Building a DNS-as-a-service with OpenStack Designate.md index c8cdaec556..162097e5a9 100644 --- a/translated/tech/20190416 Building a DNS-as-a-service with OpenStack Designate.md +++ b/published/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10840-1.html) [#]: subject: (Building a DNS-as-a-service with OpenStack Designate) [#]: via: (https://opensource.com/article/19/4/getting-started-openstack-designate) [#]: author: (Amjad Yaseen https://opensource.com/users/ayaseen) @@ -12,7 +12,7 @@ > 学习如何安装和配置 Designate,这是一个 OpenStack 的多租户 DNS 即服务(DNSaaS)。 -![Command line prompt][1] +![Command line prompt](https://img.linux.net.cn/data/attachment/album/201905/11/110822rjub9wtwtwtmccet.jpg) [Designate][2] 是一个多租户的 DNS 即服务,它包括一个用于域名和记录管理的 REST API 和集成了 [Neutron][3] 的框架,并支持 Bind9。 From cb3364d0635fb4c5295e3ce7138a491f2104447b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 11:24:44 +0800 Subject: [PATCH 0362/1154] PRF:20190502 Format Python however you like with Black.md @geekpi --- ...rmat Python however you like with Black.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20190502 Format Python however you like with Black.md b/translated/tech/20190502 Format Python however you like with Black.md index ffcfc5aad2..88a0540c36 100644 --- a/translated/tech/20190502 Format Python however you like with Black.md +++ b/translated/tech/20190502 Format Python however you like with Black.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Format Python however you like with Black) @@ -9,24 +9,25 @@ 使用 Black 随意格式化 Python ====== -在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 + +> 在我们覆盖 7 个 PyPI 库的系列文章中了解解决 Python 问题的更多信息。 + ![OpenStack source code \(Python\) in VIM][1] -Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包的原因,用以扩展和改进 Python 并解决不可避免的问题。 +Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区可以让我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包,用以扩展和改进 Python 并解决不可避免的问题。 -在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。在第一篇文章中,我们了解了 [Cython][4]。今天,我们将使用 **[Black] [5]** 这个代码格式化工具。 +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。在第一篇文章中,我们了解了 [Cython][4]。今天,我们将使用 [Black][5] 这个代码格式化工具。 ### Black 有时创意可能是一件美妙的事情。有时它只是一种痛苦。我喜欢创造性地解决难题,但我希望我的 Python 格式尽可能一致。没有人对使用“有趣”缩进的代码印象深刻。 -但是比不一致的格式更糟糕的是除了检查格式之外什么都没有的代码审查。这对审查者来说很烦人,对于被审查者人来说甚至更烦人。当你的 linter 告诉你你的代码缩进不正确时,但没有提示_正确_的缩进量,这也会令人气愤。 +但是比不一致的格式更糟糕的是除了检查格式之外什么都没有做的代码审查。这对审查者来说很烦人,对于被审查者来说甚至更烦人。当你的 linter 告诉你代码缩进不正确时,但没有提示*正确*的缩进量,这也会令人气愤。 -使用 Black,它不会告诉你_要_做什么,它是一个优良、勤奋的机器人:它将为你修复代码。 +使用 Black,它不会告诉你*要*做什么,它是一个优良、勤奋的机器人:它将为你修复代码。 要了解它如何工作的,请随意写一些非常不一致的内容,例如: - ``` def add(a, b): return a+b @@ -37,7 +38,6 @@ def mult(a, b): Black 抱怨了么?并没有,它为你修复了! - ``` $ black math reformatted math @@ -52,7 +52,7 @@ def mult(a, b): return a * b ``` -Black 确实提供了错误而不是修复的选项,甚至还有输出 **diff** 编辑样式的选项。这些选项在持续集成 (CI) 系统中非常有用,可以在本地强制运行 Black。此外,如果 **diff** 输出被记录到 CI 输出中,你可以直接将其粘贴到 **patch** 中,以便在极少数情况下你需要修复输出,但无法本地安装 Black。 +Black 确实提供了报错而不是修复的选项,甚至还有输出 diff 编辑样式的选项。这些选项在持续集成 (CI)系统中非常有用,可以在本地强制运行 Black。此外,如果 diff 输出被记录到 CI 输出中,你可以直接将其粘贴到 `patch` 中,以便在极少数情况下你需要修复输出,但无法本地安装 Black 使用。 ``` @@ -77,7 +77,7 @@ $ echo $? 1 ``` -在本系列的下一篇文章中,我们将介绍 **attrs** ,这是一个可以帮助你快速编写简洁,正确的代码的库。 +在本系列的下一篇文章中,我们将介绍 attrs ,这是一个可以帮助你快速编写简洁、正确的代码的库。 -------------------------------------------------------------------------------- From f27b43fe9e45c393f34858466782acdcdaf38251 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 11:31:36 +0800 Subject: [PATCH 0363/1154] APL:20190422 2 new apps for music tweakers on Fedora Workstation.md --- ...90422 2 new apps for music tweakers on Fedora Workstation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md index 8da9ca4795..b0787d9f4e 100644 --- a/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md +++ b/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 76021cfa99b790faf4afc7d6d125582be47c65e5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 13:01:51 +0800 Subject: [PATCH 0364/1154] TSL:20190422 2 new apps for music tweakers on Fedora Workstation.md --- ...or music tweakers on Fedora Workstation.md | 148 ------------------ ...or music tweakers on Fedora Workstation.md | 139 ++++++++++++++++ 2 files changed, 139 insertions(+), 148 deletions(-) delete mode 100644 sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md create mode 100644 translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md diff --git a/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md deleted file mode 100644 index b0787d9f4e..0000000000 --- a/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md +++ /dev/null @@ -1,148 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (2 new apps for music tweakers on Fedora Workstation) -[#]: via: (https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/) -[#]: author: (Justin W. Flory https://fedoramagazine.org/author/jflory7/) - -2 new apps for music tweakers on Fedora Workstation -====== - -![][1] - -Linux operating systems are great for making unique customizations and tweaks to make your computer work better for you. For example, the [i3 window manager][2] encourages users to think about the different components and pieces that make up the modern Linux desktop. - -Fedora has two new packages of interest for music tweakers: **mpris-scrobbler** and **playerctl**. _mpris-scrobbler_ [tracks your music listening history][3] on a music-tracking service like Last.fm and/or ListenBrainz. _playerctl_ is a command-line [music player controller][4]. - -## _mpris-scrobbler_ records your music listening trends - -_mpris-scrobbler_ is a CLI application to submit play history of your music to a service like [Last.fm][5], [Libre.fm][6], or [ListenBrainz][7]. It listens on the [MPRIS D-Bus interface][8] to detect what’s playing. It connects with several different music clients like spotify-client, [vlc][9], audacious, bmp, [cmus][10], and others. - -![Last.fm last week in music report. Generated from user-submitted listening history.][11] - -### Install and configure _mpris-scrobbler_ - -_mpris-scrobbler_ is available for Fedora 28 or later, as well as the EPEL 7 repositories. Run the following command in a terminal to install it: - -``` -sudo dnf install mpris-scrobbler -``` - -Once it is installed, use _systemctl_ to start and enable the service. The following command starts _mpris-scrobbler_ and always starts it after a system reboot: - -``` -systemctl --user enable --now mpris-scrobbler.service -``` - -### Submit plays to ListenBrainz - -This article explains how to link _mpris-scrobbler_ with a ListenBrainz account. To use Last.fm or Libre.fm, see the [upstream documentation][12]. - -To submit plays to a ListenBrainz server, you need a ListenBrainz API token. If you have an account, get the token from your [profile settings page][13]. When you have a token, run this command to authenticate with your ListenBrainz API token: - -``` -$ mpris-scrobbler-signon token listenbrainz -Token for listenbrainz.org: -``` - -Finally, test it by playing a song in your preferred music client on Fedora. The songs you play appear on your ListenBrainz profile. - -![Basic statistics and play history from a user profile on ListenBrainz. The current track is playing on a Fedora Workstation laptop with mpris-scrobbler.][14] - -## _playerctl_ controls your music playback - -_playerctl_ is a CLI tool to control any music player implementing the MPRIS D-Bus interface. You can easily bind it to keyboard shortcuts or media hotkeys. Here’s how to install it, use it in the command line, and create key bindings for the i3 window manager. - -### Install and use _playerctl_ - -_playerctl_ is available for Fedora 28 or later. Run the following command in a terminal to install it: - -``` -sudo dnf install playerctl -``` - -Now that it’s installed, you can use it right away. Open your preferred music player on Fedora. Next, try the following commands to control playback from a terminal. - -To play or pause the currently playing track: - -``` -playerctl play-pause -``` - -If you want to skip to the next track: - -``` -playerctl next -``` - -For a list of all running players: - -``` -playerctl -l -``` - -To play or pause what’s currently playing, only on the spotify-client app: - -``` -playerctl -p spotify play-pause -``` - -### Create _playerctl_ key bindings in i3wm - -Do you use a window manager like the [i3 window manager?][2] Try using _playerctl_ for key bindings. You can bind different commands to different key shortcuts, like the play/pause buttons on your keyboard. Look at the following [i3wm config excerpt][15] to see how: - -``` -# Media player controls -bindsym XF86AudioPlay exec "playerctl play-pause" -bindsym XF86AudioNext exec "playerctl next" -bindsym XF86AudioPrev exec "playerctl previous" -``` - -## Try it out with your favorite music players - -Need to know more about customizing the music listening experience on Fedora? The Fedora Magazine has you covered. Check out these five cool music players on Fedora: - -> [5 cool music player apps][16] - -Bring order to your music library chaos by sorting and organizing it with MusicBrainz Picard: - -> [Picard brings order to your music library][17] - -* * * - -_Photo by _[ _Frank Septillion_][18]_ on _[_Unsplash_][19]_._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/ - -作者:[Justin W. Flory][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/jflory7/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/2-music-tweak-apps-816x345.jpg -[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ -[3]: https://github.com/mariusor/mpris-scrobbler -[4]: https://github.com/acrisci/playerctl -[5]: https://www.last.fm/ -[6]: https://libre.fm/ -[7]: https://listenbrainz.org/ -[8]: https://specifications.freedesktop.org/mpris-spec/latest/ -[9]: https://www.videolan.org/vlc/ -[10]: https://cmus.github.io/ -[11]: https://fedoramagazine.org/wp-content/uploads/2019/02/Screenshot_2019-04-13-jflory7%E2%80%99s-week-in-music2-1024x500.png -[12]: https://github.com/mariusor/mpris-scrobbler#authenticate-to-the-service -[13]: https://listenbrainz.org/profile/ -[14]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot_2019-04-13-User-jflory-ListenBrainz.png -[15]: https://github.com/jwflory/swiss-army/blob/ba6ac0c71855e33e3caa1ee1fe51c05d2df0529d/roles/apps/i3wm/files/config#L207-L210 -[16]: https://fedoramagazine.org/5-cool-music-player-apps/ -[17]: https://fedoramagazine.org/picard-brings-order-music-library/ -[18]: https://unsplash.com/photos/Qrspubmx6kE?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[19]: https://unsplash.com/search/photos/music?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md new file mode 100644 index 0000000000..eb6daca682 --- /dev/null +++ b/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (2 new apps for music tweakers on Fedora Workstation) +[#]: via: (https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/) +[#]: author: (Justin W. Flory https://fedoramagazine.org/author/jflory7/) + +2 个给使用 Fedora 工作站的音乐爱好者的新应用 +====== + +![][1] + +Linux 操作系统非常适合进行独特的自定义和调整,以使您的计算机更好地为您工作。例如,[i3 窗口管理器][2] 就让用户认识到构成现代 Linux 桌面的各种组件和部分。 + +Fedora 有两个音乐爱好者会感兴趣的新软件包:mpris-scrobbler 和 playerctl。 mpris-scrobbler 可以在 Last.fm 和/或 ListenBrainz 等音乐跟踪服务上[跟踪你的音乐收听历史][3]。 playerctl 是一个命令行的[音乐播放器控制器][4]。 + +### mpris-scrobbler:记录你的音乐收听趋势 + +mpris-scrobbler 是一个命令行应用程序,用于将音乐的播放历史记录提交给 [Last.fm][5]、[Libre.fm][6] 或 [ListenBrainz][7] 等服务。它监听 [MPRIS D-Bus 接口][8] 以检测正在播放的内容。它可以连接几个不同的音乐客户端,如 spotify 客户端、[vlc][9]、audacious、bmp、[cmus][10] 等。 + +![Last.fm last week in music report. Generated from user-submitted listening history.][11] + +#### 安装和配置 mpris-scrobbler + +mpris-scrobbler 在 Fedora 28 或更高版本以及 EPEL 7 存储库中可用。在终端中运行以下命令进行安装: + +``` +sudo dnf install mpris-scrobbler +``` + +安装完成后,使用 `systemctl` 启动并启用该服务。以下命令启动 mpris-scrobbler 并始终在系统重启后启动它: + +``` +systemctl --user enable --now mpris-scrobbler.service +``` + +#### 提交播放信息给 ListenBrainz + +本文将介绍如何将 mpris-scrobbler 与 ListenBrainz 帐户相关联。 要使用 Last.fm 或 Libre.fm,请参阅其[上游文档][12]。 + +要将播放信息提交到 ListenBrainz 服务器,你需要有一个 ListenBrainz API 令牌。如果你有帐户,请从[个人资料设置页面][13]中获取该令牌。如果有了令牌,请运行此命令以使用 ListenBrainz API 令牌进行身份验证: + +``` +$ mpris-scrobbler-signon token listenbrainz +Token for listenbrainz.org: +``` + +最后,通过在 Fedora 上你的音乐客户端播放一首歌来测试它。你播放的歌曲会出现在 ListenBrainz 个人资料中。 + +![Basic statistics and play history from a user profile on ListenBrainz. The current track is playing on a Fedora Workstation laptop with mpris-scrobbler.][14] + +### playerctl 可以控制音乐回放 + +playerctl 是一个命令行工具,它可以控制任何实现了 MPRIS D-Bus 接口的任何音乐播放器。你可以轻松地将其绑定到键盘快捷键或媒体热键。以下是如何在命令行中安装、使用它,以及为 i3 窗口管理器创建键绑定的方法。 + +#### 安装和使用 playerctl + +playerctl 在 Fedora 28 或更高版本中可用。在终端运行如下命令以安装: + +``` +sudo dnf install playerctl +``` +现在已安装好,你可以立即使用它。在 Fedora 上打开你的音乐播放器。接下来,尝试用以下命令来控制终端的播放。 + +播放或暂停当前播放的曲目: + +``` +playerctl play-pause +``` + +如果你想跳过下一首曲目: + +``` +playerctl next +``` + +列出所有正在运行的播放器: + +``` +playerctl -l +``` + +仅使用 spotify 客户端播放或暂停当前播放的内容: + +``` +playerctl -p spotify play-pause +``` + +### 在 i3wm 中创建 playerctl 键绑定 + +你是否使用窗口管理器,比如 [i3 窗口管理器][2]?尝试使用 `playerctl` 进行键绑定。你可以将不同的命令绑定到不同的快捷键,例如键盘上的播放/暂停按钮。参照下面的 [i3wm 配置摘录][15] 看看如何做: + +``` +# Media player controls +bindsym XF86AudioPlay exec "playerctl play-pause" +bindsym XF86AudioNext exec "playerctl next" +bindsym XF86AudioPrev exec "playerctl previous" +``` + +### 体验一下音乐播放器 + +想了解更多关于在 Fedora 上定制音乐聆听体验的信息吗?Fedora Magazine 为你提供服务。在 Fedora 上看看这[五个很酷的音乐播放器][16]。 + +通过使用 MusicBrainz Picard 对音乐库进行排序和组织,[为你的混乱的音乐库带来秩序][17]: + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/ + +作者:[Justin W. Flory][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/jflory7/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/2-music-tweak-apps-816x345.jpg +[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ +[3]: https://github.com/mariusor/mpris-scrobbler +[4]: https://github.com/acrisci/playerctl +[5]: https://www.last.fm/ +[6]: https://libre.fm/ +[7]: https://listenbrainz.org/ +[8]: https://specifications.freedesktop.org/mpris-spec/latest/ +[9]: https://www.videolan.org/vlc/ +[10]: https://cmus.github.io/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/02/Screenshot_2019-04-13-jflory7%E2%80%99s-week-in-music2-1024x500.png +[12]: https://github.com/mariusor/mpris-scrobbler#authenticate-to-the-service +[13]: https://listenbrainz.org/profile/ +[14]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot_2019-04-13-User-jflory-ListenBrainz.png +[15]: https://github.com/jwflory/swiss-army/blob/ba6ac0c71855e33e3caa1ee1fe51c05d2df0529d/roles/apps/i3wm/files/config#L207-L210 +[16]: https://fedoramagazine.org/5-cool-music-player-apps/ +[17]: https://fedoramagazine.org/picard-brings-order-music-library/ +[18]: https://unsplash.com/photos/Qrspubmx6kE?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[19]: https://unsplash.com/search/photos/music?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 369e92e2fd3db680cc105d5ff3af8ce0cdbfce5c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 13:21:43 +0800 Subject: [PATCH 0365/1154] PRF:20190422 2 new apps for music tweakers on Fedora Workstation.md @wxy --- ...or music tweakers on Fedora Workstation.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md index eb6daca682..bcea4c54b8 100644 --- a/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md +++ b/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (2 new apps for music tweakers on Fedora Workstation) @@ -12,9 +12,9 @@ ![][1] -Linux 操作系统非常适合进行独特的自定义和调整,以使您的计算机更好地为您工作。例如,[i3 窗口管理器][2] 就让用户认识到构成现代 Linux 桌面的各种组件和部分。 +Linux 操作系统非常适合进行独特的自定义和调整,以使你的计算机更好地为你工作。例如,[i3 窗口管理器][2] 就让用户认识到了构成现代 Linux 桌面的各种组件和部分。 -Fedora 有两个音乐爱好者会感兴趣的新软件包:mpris-scrobbler 和 playerctl。 mpris-scrobbler 可以在 Last.fm 和/或 ListenBrainz 等音乐跟踪服务上[跟踪你的音乐收听历史][3]。 playerctl 是一个命令行的[音乐播放器控制器][4]。 +Fedora 上有两个音乐爱好者会感兴趣的新软件包:mpris-scrobbler 和 playerctl。mpris-scrobbler 可以在 Last.fm 和/或 ListenBrainz 等音乐跟踪服务上[跟踪你的音乐收听历史][3]。 playerctl 是一个命令行的[音乐播放器的控制器][4]。 ### mpris-scrobbler:记录你的音乐收听趋势 @@ -38,7 +38,7 @@ systemctl --user enable --now mpris-scrobbler.service #### 提交播放信息给 ListenBrainz -本文将介绍如何将 mpris-scrobbler 与 ListenBrainz 帐户相关联。 要使用 Last.fm 或 Libre.fm,请参阅其[上游文档][12]。 +这里将介绍如何将 mpris-scrobbler 与 ListenBrainz 帐户相关联。要使用 Last.fm 或 Libre.fm,请参阅其[上游文档][12]。 要将播放信息提交到 ListenBrainz 服务器,你需要有一个 ListenBrainz API 令牌。如果你有帐户,请从[个人资料设置页面][13]中获取该令牌。如果有了令牌,请运行此命令以使用 ListenBrainz API 令牌进行身份验证: @@ -47,21 +47,22 @@ $ mpris-scrobbler-signon token listenbrainz Token for listenbrainz.org: ``` -最后,通过在 Fedora 上你的音乐客户端播放一首歌来测试它。你播放的歌曲会出现在 ListenBrainz 个人资料中。 +最后,通过在 Fedora 上用你的音乐客户端播放一首歌来测试它。你播放的歌曲会出现在 ListenBrainz 个人资料页中。 ![Basic statistics and play history from a user profile on ListenBrainz. The current track is playing on a Fedora Workstation laptop with mpris-scrobbler.][14] ### playerctl 可以控制音乐回放 -playerctl 是一个命令行工具,它可以控制任何实现了 MPRIS D-Bus 接口的任何音乐播放器。你可以轻松地将其绑定到键盘快捷键或媒体热键。以下是如何在命令行中安装、使用它,以及为 i3 窗口管理器创建键绑定的方法。 +`playerctl` 是一个命令行工具,它可以控制任何实现了 MPRIS D-Bus 接口的音乐播放器。你可以轻松地将其绑定到键盘快捷键或媒体热键上。以下是如何在命令行中安装、使用它,以及为 i3 窗口管理器创建键绑定的方法。 #### 安装和使用 playerctl -playerctl 在 Fedora 28 或更高版本中可用。在终端运行如下命令以安装: +`playerctl` 在 Fedora 28 或更高版本中可用。在终端运行如下命令以安装: ``` sudo dnf install playerctl ``` + 现在已安装好,你可以立即使用它。在 Fedora 上打开你的音乐播放器。接下来,尝试用以下命令来控制终端的播放。 播放或暂停当前播放的曲目: @@ -88,7 +89,7 @@ playerctl -l playerctl -p spotify play-pause ``` -### 在 i3wm 中创建 playerctl 键绑定 +#### 在 i3wm 中创建 playerctl 键绑定 你是否使用窗口管理器,比如 [i3 窗口管理器][2]?尝试使用 `playerctl` 进行键绑定。你可以将不同的命令绑定到不同的快捷键,例如键盘上的播放/暂停按钮。参照下面的 [i3wm 配置摘录][15] 看看如何做: @@ -101,9 +102,9 @@ bindsym XF86AudioPrev exec "playerctl previous" ### 体验一下音乐播放器 -想了解更多关于在 Fedora 上定制音乐聆听体验的信息吗?Fedora Magazine 为你提供服务。在 Fedora 上看看这[五个很酷的音乐播放器][16]。 +想了解关于在 Fedora 上定制音乐聆听体验的更多信息吗?Fedora Magazine 为你提供服务。看看 Fedora 上这[五个很酷的音乐播放器][16]。 -通过使用 MusicBrainz Picard 对音乐库进行排序和组织,[为你的混乱的音乐库带来秩序][17]: +也可以通过使用 MusicBrainz Picard 对音乐库进行排序和组织,[为你的混乱的音乐库带来秩序][17]。 -------------------------------------------------------------------------------- @@ -112,7 +113,7 @@ via: https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstat 作者:[Justin W. Flory][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d40cd1c731450f00043b08352433d13daf9b5465 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 May 2019 13:22:28 +0800 Subject: [PATCH 0366/1154] PUB:20190422 2 new apps for music tweakers on Fedora Workstation.md @wxy https://linux.cn/article-10841-1.html --- ...422 2 new apps for music tweakers on Fedora Workstation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190422 2 new apps for music tweakers on Fedora Workstation.md (98%) diff --git a/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md b/published/20190422 2 new apps for music tweakers on Fedora Workstation.md similarity index 98% rename from translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md rename to published/20190422 2 new apps for music tweakers on Fedora Workstation.md index bcea4c54b8..00ccf16a53 100644 --- a/translated/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md +++ b/published/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10841-1.html) [#]: subject: (2 new apps for music tweakers on Fedora Workstation) [#]: via: (https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/) [#]: author: (Justin W. Flory https://fedoramagazine.org/author/jflory7/) From 8e3f2dc73b11d97785b585ca173785e9c315056d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sat, 11 May 2019 17:37:42 +0800 Subject: [PATCH 0367/1154] Translated --- ...- Easy Way To Run Android Apps On Linux.md | 182 ------------------ ...- Easy Way To Run Android Apps On Linux.md | 182 ++++++++++++++++++ 2 files changed, 182 insertions(+), 182 deletions(-) delete mode 100644 sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md create mode 100644 translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md diff --git a/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md deleted file mode 100644 index 8187d07674..0000000000 --- a/sources/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md +++ /dev/null @@ -1,182 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Anbox – Easy Way To Run Android Apps On Linux) -[#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -Anbox – Easy Way To Run Android Apps On Linux -====== - -Android emulator applications are allow us to run our favorite Android apps or games directly from Linux system. - -There are many android emulators were available for Linux and we had covered few applications in the past. - -You can review those by navigating to the following URLs. - - * [How To Install Official Android Emulator (SDK) On Linux][1] - * [How To Install GenyMotion (Android Emulator) On Linux][2] - - - -Today we are going to discuss about the Anbox Android emulator. - -### What Is Anbox? - -Anbox stands for Android in a box. Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system. - -It’s new and modern emulator among others. - -Since Anbox places the core Android OS into a container using Linux namespaces (LXE) so, there is no slowness while accessing the installed applications. - -Anbox will let you run Android on your Linux system without the slowness of virtualization because the core Android OS has placed into a container using Linux namespaces (LXE). - -There is no direct access to any hardware from the Android container. All hardware access are going through the anbox daemon on the host. - -Each applications will be open in a separate window, just like other native system applications, and it can be showing up in the launcher. - -### How To Install Anbox In Linux? - -Anbox application is available as snap package so, make sure you have enabled snap support on your system. - -Anbox package is recently added to the Ubuntu (Cosmic) and Debian (Buster) repositories. If you are running these version then you can easily install with help of official distribution package manager. Other wise go with snap package installation. - -Make sure the necessary kernel modules should be installed in your system in order to work Anbox. For Ubuntu based users, use the following PPA to install it. - -``` -$ sudo add-apt-repository ppa:morphis/anbox-support -$ sudo apt update -$ sudo apt install linux-headers-generic anbox-modules-dkms -``` - -After you installed the `anbox-modules-dkms` package you have to manually reload the kernel modules or system reboot is required. - -``` -$ sudo modprobe ashmem_linux -$ sudo modprobe binder_linux -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install anbox. - -``` -$ sudo apt install anbox -``` - -We always used to get package for Arch Linux based systems from AUR repository. So, use any of the **[AUR helper][5]** to install it. I prefer to go with **[Yay utility][6]**. - -``` -$ yuk -S anbox-git -``` - -If no, you can **[install and configure snaps in Linux][7]** by navigating to the following article. Others can ignore if you have already installed snaps on your system. - -``` -$ sudo snap install --devmode --beta anbox -``` - -### Prerequisites For Anbox - -By default, Anbox doesn’t ship with the Google Play Store. - -Hence, we need to manually download each application (APK) and install it using Android Debug Bridge (ADB). - -The ADB tool is readily available in most of the distributions repository so, we can easily install it. - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install ADB. - -``` -$ sudo apt install android-tools-adb -``` - -For **`Fedora`** system, use **[DNF Command][8]** to install ADB. - -``` -$ sudo dnf install android-tools -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install ADB. - -``` -$ sudo pacman -S android-tools -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][10]** to install ADB. - -``` -$ sudo zypper install android-tools -``` - -### Where To Download The Android Apps? - -Since you can’t use the Play Store so, you have to download the APK packages from trusted sites like [APKMirror][11] then manually install it. - -### How To Launch Anbox? - -Anbox can be launched from the Dash. This is how the default Anbox looks. -![][13] - -### How To Push The Apps Into Anbox? - -As i told previously, we need to manually install it. For testing purpose, we are going to install `YouTube` and `Firefox` apps. - -First, you need to start ADB server. To do so, run the following command. - -``` -$ adb devices -``` - -We have already downloaded the `YouTube` and `Firefox` apps and the same we will install now. - -**Common Syntax:** - -``` -$ adb install Name-Of-Your-Application.apk -``` - -Installing YouTube and Firefox app. - -``` -$ adb install 'com.google.android.youtube_14.13.54-1413542800_minAPI19(x86_64)(nodpi)_apkmirror.com.apk' -Success - -$ adb install 'org.mozilla.focus_9.0-330191219_minAPI21(x86)(nodpi)_apkmirror.com.apk' -Success -``` - -I have installed `YouTube` and `Firefox` in my Anbox. See the screenshot below. -![][14] - -As we told in the beginning of the article, it will open any app as a new tab. Here, I’m going to open Firefox and accessing the **[2daygeek.com][15]** website. -![][16] - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/anbox-best-android-emulator-for-linux/ - -作者:[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/install-configure-sdk-android-emulator-on-linux/ -[2]: https://www.2daygeek.com/install-genymotion-android-emulator-on-ubuntu-debian-fedora-arch-linux/ -[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[5]: https://www.2daygeek.com/category/aur-helper/ -[6]: https://www.2daygeek.com/install-yay-yet-another-yogurt-aur-helper-on-arch-linux/ -[7]: https://www.2daygeek.com/linux-snap-package-manager-ubuntu/ -[8]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[10]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ -[11]: https://www.apkmirror.com/ -[12]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[13]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-1.jpg -[14]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-2.jpg -[15]: https://www.2daygeek.com/ -[16]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-3.jpg diff --git a/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md new file mode 100644 index 0000000000..ccd259bf69 --- /dev/null +++ b/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md @@ -0,0 +1,182 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Anbox – Easy Way To Run Android Apps On Linux) +[#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Anbox – 简单的方法来在 Linux 上运行 Android 应用程序 +====== + +Android 模拟器应用程序允许我们直接从 Linux 系统上运行我们最喜欢的 Android 应用程序或游戏。 + +对于 Linux 来说,有很多的 android 模拟器是可用的,在过去我们很少涉及应用程序。 + +你可以通过导航到下面的网址回顾它们。 + + * [如何在 Linux 上安装官方 Android 模拟器 (SDK)][1] + * [如何在 Linux 上安装 GenyMotion (Android 模拟器)][2] + + + +今天我们将讨论 Anbox Android 模拟器。 + +### Anbox 是什么? + +Anbox 支持 Android 在一个盒子中。Anbox 是一个基于容器的在一个普通的 GNU/Linux 系统上启动一个完整的 Android 系统的方法。 + +它是新的和现代模拟器的其中一个。 + +由于 Anbox 使用同样的 Linux 命名空间 (LXE) 来放置核心 Android 操作系统到一个容器中,当访问安装的应用程序时,没有迟钝。 + +Anbox 将让你在你的 Linux 系统上运行 Android ,而没有虚拟化的迟钝,因为 Android 核心操作系统已经放置到一个使用 Linux 命名空间(LXE)的容器中。 + +没有直接访问到来自 Android 容器的任何硬件。所有硬件的访问通过在主机上的守护进程。 + +每个应用程序将在一个单独窗口打开,正像其它本地系统应用程序,并且它可以显示在启动器中。 + +### 如何在 Linux 中安装 Anbox ? + +Anbox 应用程序也可以作为 snap 软件包,确保你已经在你的系统上启用 snap 支持。 + +Anbox 软件包最近被添加到 Ubuntu 18.10 (Cosmic) 和 Debian 10 (Buster) 存储库。如果你正在运行这些版本,那么你可以轻松地在官方分发软件包管理器的帮助下安装。其它明智的方法与 snap 软件包一起安装。 + +为使 Anbox 工作,确保需要的内核模块已经安装在你的系统中。对于基于 Ubuntu 的用户,使用下面的 PPA 来安装它。 + +``` +$ sudo add-apt-repository ppa:morphis/anbox-support +$ sudo apt update +$ sudo apt install linux-headers-generic anbox-modules-dkms +``` + +在你安装 `anbox-modules-dkms` 软件包后,你必须重新加载内核模块,或需要系统重新启动。 + +``` +$ sudo modprobe ashmem_linux +$ sudo modprobe binder_linux +``` + +对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 来安装 anbox。 + +``` +$ sudo apt install anbox +``` + +对于基于 Arch Linux 的系统,我们总是习惯从 AUR 储存库中获取软件包。所以,使用任一个的 **[AUR helper][5]** 来安装它。我较喜欢去使用 **[Yay utility][6]**. + +``` +$ yuk -S anbox-git +``` + +如果不是,你可以通过导航到下面的文章来 **[在 Linux 中安装和配置 snaps ][7]** 。如果你已经在你的系统上安装 snaps ,其它的可以忽略。 + +``` +$ sudo snap install --devmode --beta anbox +``` + +### Anbox 的必要条件 + +默认情况下,Anbox 不与 Google Play Store 一起提供。 + +因此,我们需要手动下载每个应用程序 (APK) ,并使用 Android 调试桥 (ADB) 安装它。 + +ADB 工具在大多数的发行版存储库是轻易可获得的,我们可以容易地安装它。 + +对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 来安装 ADB 。 + +``` +$ sudo apt install android-tools-adb +``` + +对于 **`Fedora`** 系统,使用 **[DNF 命令][8]** 来安装 ADB 。 + +``` +$ sudo dnf install android-tools +``` + +对于基于 **`Arch Linux`** 的系统,使用 **[Pacman 命令][9]** 来安装 ADB 。 + +``` +$ sudo pacman -S android-tools +``` + +对于 **`openSUSE Leap`** 系统,使用 **[Zypper 命令][10]** 来安装 ADB. + +``` +$ sudo zypper install android-tools +``` + +### 在哪里下载 Android 应用程序? + +既然我们不能使用 Play Store ,你不得不从信得过的网站来下载 APK 软件包,像 [APKMirror][11] ,然后手动安装它。 + +### 如何启动 Anbox? + +Anbox 可以从 Dash 启动。这多少是默认的 Anbox 外貌。 +![][13] + +### 如何推移应用程序到 Anbox ? + +像我先前所说,我们需要手动安装它。为测试目的,我们将安装 `YouTube` 和 `Firefox` 应用程序。 + +首先,你需要启动 ADB 服务。为做到这样,运行下面的命令。 + +``` +$ adb devices +``` + +我们已经下载 `YouTube` 和 `Firefox` 应用程序,现在我们将安装。 + +**共同的语法:** + +``` +$ adb install Name-Of-Your-Application.apk +``` + +安装 YouTube 和 Firefox 应用程序。 + +``` +$ adb install 'com.google.android.youtube_14.13.54-1413542800_minAPI19(x86_64)(nodpi)_apkmirror.com.apk' +Success + +$ adb install 'org.mozilla.focus_9.0-330191219_minAPI21(x86)(nodpi)_apkmirror.com.apk' +Success +``` + +我已经在我的 Anbox 中安装 `YouTube` 和 `Firefox`。查看下面的截图。 +![][14] + +像我们在文章的开始所说,它将以新的标签页打开任何的应用程序。在这里,我们将打开 Firefox ,并访问 **[2daygeek.com][15]** 网站。 +![][16] + +-------------------------------------------------------------------------------- + +通过: https://www.2daygeek.com/anbox-best-android-emulator-for-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/robsean) +校对:[校对者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/install-configure-sdk-android-emulator-on-linux/ +[2]: https://www.2daygeek.com/install-genymotion-android-emulator-on-ubuntu-debian-fedora-arch-linux/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/category/aur-helper/ +[6]: https://www.2daygeek.com/install-yay-yet-another-yogurt-aur-helper-on-arch-linux/ +[7]: https://www.2daygeek.com/linux-snap-package-manager-ubuntu/ +[8]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[11]: https://www.apkmirror.com/ +[12]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[13]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-1.jpg +[14]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-2.jpg +[15]: https://www.2daygeek.com/ +[16]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-3.jpg From bbf27dbc77adcb145eac43c52c10b50014545df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sat, 11 May 2019 17:58:20 +0800 Subject: [PATCH 0368/1154] Translating --- .../tech/20190505 Kindd - A Graphical Frontend To dd Command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md index 59dcfd2ffa..52f1d6b1da 100644 --- a/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md +++ b/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 67da984a7d93d2401271dca0bdf9da87d26f0204 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 10:11:06 +0800 Subject: [PATCH 0369/1154] PRF:20190409 Anbox - Easy Way To Run Android Apps On Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @robsean 要是更仔细一些会更好。 --- ...- Easy Way To Run Android Apps On Linux.md | 75 +++++++++---------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md index ccd259bf69..6402c74ac8 100644 --- a/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md +++ b/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md @@ -1,47 +1,41 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Anbox – Easy Way To Run Android Apps On Linux) [#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Anbox – 简单的方法来在 Linux 上运行 Android 应用程序 +Anbox:在 Linux 上运行 Android 应用程序的简单方式 ====== -Android 模拟器应用程序允许我们直接从 Linux 系统上运行我们最喜欢的 Android 应用程序或游戏。 - -对于 Linux 来说,有很多的 android 模拟器是可用的,在过去我们很少涉及应用程序。 +Android 模拟器允许我们直接从 Linux 系统上运行我们最喜欢的 Android 应用程序或游戏。对于 Linux 来说,有很多的这样的 Android 模拟器,在过去我们介绍过几个此类应用程序。 你可以通过导航到下面的网址回顾它们。 * [如何在 Linux 上安装官方 Android 模拟器 (SDK)][1] * [如何在 Linux 上安装 GenyMotion (Android 模拟器)][2] - - 今天我们将讨论 Anbox Android 模拟器。 ### Anbox 是什么? -Anbox 支持 Android 在一个盒子中。Anbox 是一个基于容器的在一个普通的 GNU/Linux 系统上启动一个完整的 Android 系统的方法。 +Anbox 是 “Android in a box” 的缩写。Anbox 是一个基于容器的方法,可以在普通的 GNU/Linux 系统上启动完整的 Android 系统。 -它是新的和现代模拟器的其中一个。 +它是现代化的新模拟器之一。 -由于 Anbox 使用同样的 Linux 命名空间 (LXE) 来放置核心 Android 操作系统到一个容器中,当访问安装的应用程序时,没有迟钝。 +Anbox 可以让你在 Linux 系统上运行 Android,而没有虚拟化的迟钝,因为核心的 Android 操作系统已经使用 Linux 命名空间(LXE)放置到容器中了。 -Anbox 将让你在你的 Linux 系统上运行 Android ,而没有虚拟化的迟钝,因为 Android 核心操作系统已经放置到一个使用 Linux 命名空间(LXE)的容器中。 +Android 容器不能直接访问到任何硬件,所有硬件的访问都是通过在主机上的守护进程进行的。 -没有直接访问到来自 Android 容器的任何硬件。所有硬件的访问通过在主机上的守护进程。 - -每个应用程序将在一个单独窗口打开,正像其它本地系统应用程序,并且它可以显示在启动器中。 +每个应用程序将在一个单独窗口打开,就像其它本地系统应用程序一样,并且它可以显示在启动器中。 ### 如何在 Linux 中安装 Anbox ? -Anbox 应用程序也可以作为 snap 软件包,确保你已经在你的系统上启用 snap 支持。 +Anbox 也可作为 snap 软件包安装,请确保你已经在你的系统上启用了 snap 支持。 -Anbox 软件包最近被添加到 Ubuntu 18.10 (Cosmic) 和 Debian 10 (Buster) 存储库。如果你正在运行这些版本,那么你可以轻松地在官方分发软件包管理器的帮助下安装。其它明智的方法与 snap 软件包一起安装。 +Anbox 软件包最近被添加到 Ubuntu 18.10 (Cosmic) 和 Debian 10 (Buster) 软件仓库。如果你正在运行这些版本,那么你可以轻松地在官方发行版的软件包管理器的帮助下安装。否则可以用 snap 软件包安装。 为使 Anbox 工作,确保需要的内核模块已经安装在你的系统中。对于基于 Ubuntu 的用户,使用下面的 PPA 来安装它。 @@ -51,26 +45,26 @@ $ sudo apt update $ sudo apt install linux-headers-generic anbox-modules-dkms ``` -在你安装 `anbox-modules-dkms` 软件包后,你必须重新加载内核模块,或需要系统重新启动。 +在你安装 `anbox-modules-dkms` 软件包后,你必须手动重新加载内核模块,或需要系统重新启动。 ``` $ sudo modprobe ashmem_linux $ sudo modprobe binder_linux ``` -对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 来安装 anbox。 +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4] 来安装 anbox。 ``` $ sudo apt install anbox ``` -对于基于 Arch Linux 的系统,我们总是习惯从 AUR 储存库中获取软件包。所以,使用任一个的 **[AUR helper][5]** 来安装它。我较喜欢去使用 **[Yay utility][6]**. +对于基于 Arch Linux 的系统,我们总是习惯从 AUR 储存库中获取软件包。所以,使用任一个的 [AUR 助手][5] 来安装它。我喜欢使用 [Yay 工具][6]。 ``` $ yuk -S anbox-git ``` -如果不是,你可以通过导航到下面的文章来 **[在 Linux 中安装和配置 snaps ][7]** 。如果你已经在你的系统上安装 snaps ,其它的可以忽略。 +否则,你可以通过导航到下面的文章来 [在 Linux 中安装和配置 snap][7]。如果你已经在你的系统上安装 snap,其它的步骤可以忽略。 ``` $ sudo snap install --devmode --beta anbox @@ -78,31 +72,29 @@ $ sudo snap install --devmode --beta anbox ### Anbox 的必要条件 -默认情况下,Anbox 不与 Google Play Store 一起提供。 +默认情况下,Anbox 并没有带有 Google Play Store。因此,我们需要手动下载每个应用程序(APK),并使用 Android 调试桥(ADB)安装它。 -因此,我们需要手动下载每个应用程序 (APK) ,并使用 Android 调试桥 (ADB) 安装它。 +ADB 工具在大多数的发行版的软件仓库是轻易可获得的,我们可以容易地安装它。 -ADB 工具在大多数的发行版存储库是轻易可获得的,我们可以容易地安装它。 - -对于 **`Debian/Ubuntu`** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 来安装 ADB 。 +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4] 来安装 ADB。 ``` $ sudo apt install android-tools-adb ``` -对于 **`Fedora`** 系统,使用 **[DNF 命令][8]** 来安装 ADB 。 +对于 Fedora 系统,使用 [DNF 命令][8] 来安装 ADB。 ``` $ sudo dnf install android-tools ``` -对于基于 **`Arch Linux`** 的系统,使用 **[Pacman 命令][9]** 来安装 ADB 。 +对于基于 Arch Linux 的系统,使用 [Pacman 命令][9] 来安装 ADB。 ``` $ sudo pacman -S android-tools ``` -对于 **`openSUSE Leap`** 系统,使用 **[Zypper 命令][10]** 来安装 ADB. +对于 openSUSE Leap 系统,使用 [Zypper 命令][10] 来安装 ADB。 ``` $ sudo zypper install android-tools @@ -110,16 +102,17 @@ $ sudo zypper install android-tools ### 在哪里下载 Android 应用程序? -既然我们不能使用 Play Store ,你不得不从信得过的网站来下载 APK 软件包,像 [APKMirror][11] ,然后手动安装它。 +既然我们不能使用 Play Store ,你就得从信得过的网站来下载 APK 软件包,像 [APKMirror][11] ,然后手动安装它。 ### 如何启动 Anbox? -Anbox 可以从 Dash 启动。这多少是默认的 Anbox 外貌。 +Anbox 可以从 Dash 启动。这是默认的 Anbox 外貌。 + ![][13] -### 如何推移应用程序到 Anbox ? +### 如何把应用程序推到 Anbox ? -像我先前所说,我们需要手动安装它。为测试目的,我们将安装 `YouTube` 和 `Firefox` 应用程序。 +像我先前所说,我们需要手动安装它。为测试目的,我们将安装 YouTube 和 Firefox 应用程序。 首先,你需要启动 ADB 服务。为做到这样,运行下面的命令。 @@ -127,15 +120,15 @@ Anbox 可以从 Dash 启动。这多少是默认的 Anbox 外貌。 $ adb devices ``` -我们已经下载 `YouTube` 和 `Firefox` 应用程序,现在我们将安装。 +我们已经下载 YouTube 和 Firefox 应用程序,现在我们将安装。 -**共同的语法:** +语法格式: ``` $ adb install Name-Of-Your-Application.apk ``` -安装 YouTube 和 Firefox 应用程序。 +安装 YouTube 和 Firefox 应用程序: ``` $ adb install 'com.google.android.youtube_14.13.54-1413542800_minAPI19(x86_64)(nodpi)_apkmirror.com.apk' @@ -145,20 +138,22 @@ $ adb install 'org.mozilla.focus_9.0-330191219_minAPI21(x86)(nodpi)_apkmirror.co Success ``` -我已经在我的 Anbox 中安装 `YouTube` 和 `Firefox`。查看下面的截图。 +我已经在我的 Anbox 中安装 YouTube 和 Firefox。查看下面的截图。 + ![][14] -像我们在文章的开始所说,它将以新的标签页打开任何的应用程序。在这里,我们将打开 Firefox ,并访问 **[2daygeek.com][15]** 网站。 +像我们在文章的开始所说,它将以新的标签页打开任何的应用程序。在这里,我们将打开 Firefox ,并访问 [2daygeek.com][15] 网站。 + ![][16] -------------------------------------------------------------------------------- -通过: https://www.2daygeek.com/anbox-best-android-emulator-for-linux/ +via: https://www.2daygeek.com/anbox-best-android-emulator-for-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b12a07179981e694e92245cc74a2351b1431a58b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 10:11:49 +0800 Subject: [PATCH 0370/1154] PUB:20190409 Anbox - Easy Way To Run Android Apps On Linux.md @robsean https://linux.cn/article-10843-1.html --- .../20190409 Anbox - Easy Way To Run Android Apps On Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 Anbox - Easy Way To Run Android Apps On Linux.md (98%) diff --git a/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/published/20190409 Anbox - Easy Way To Run Android Apps On Linux.md similarity index 98% rename from translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md rename to published/20190409 Anbox - Easy Way To Run Android Apps On Linux.md index 6402c74ac8..d4829d7344 100644 --- a/translated/tech/20190409 Anbox - Easy Way To Run Android Apps On Linux.md +++ b/published/20190409 Anbox - Easy Way To Run Android Apps On Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10843-1.html) [#]: subject: (Anbox – Easy Way To Run Android Apps On Linux) [#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From be03fbbc8787bfc84989bd8efea1cb7a5edecda8 Mon Sep 17 00:00:00 2001 From: bodhix Date: Sun, 12 May 2019 10:46:53 +0800 Subject: [PATCH 0371/1154] =?UTF-8?q?=E5=B0=86=E8=B7=AF=E5=BE=84=E5=85=88?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=9E=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... And Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated => sources}/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md (100%) diff --git a/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md similarity index 100% rename from translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md rename to sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md From 17de08e34e0d3f04560a120bfacdcae6966152a3 Mon Sep 17 00:00:00 2001 From: bodhix Date: Sun, 12 May 2019 10:52:36 +0800 Subject: [PATCH 0372/1154] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=91=E6=96=87?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... And Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md (100%) diff --git a/sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md similarity index 100% rename from sources/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md rename to translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md From 7f87fbaacb29db9dc53df33572309ee5d447c846 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 11:04:28 +0800 Subject: [PATCH 0373/1154] TSL:20190308 Virtual filesystems in Linux- Why we need them and how they work.md --- ...nux- Why we need them and how they work.md | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index 3e32f3d519..ed7c2d6b8e 100644 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -50,32 +50,35 @@ VFS 的存在促进了代码重用,因为与文件系统相关的基本方法 不幸的是,默认情况下,某些 Linux 发行版的安装脚本仍会在存储设备上创建 /tmp。如果你的系统出现这种情况,请不要绝望。按照一直优秀的 [Arch Wiki][12] 上的简单说明来解决问题就行,记住分配给 tmpfs 的内存不能用于其他目的。换句话说,带有巨大 tmpfs 并且其中包含大文件的系统可能会耗尽内存并崩溃。另一个提示:编辑 `/etc/fstab` 文件时,请务必以换行符结束,否则系统将无法启动。(猜猜我怎么知道。) -### /proc and /sys +### /proc 和 /sys -Besides /tmp, the VFSes with which most Linux users are most familiar are /proc and /sys. (/dev relies on shared memory and has no file_operations). Why two flavors? Let's have a look in more detail. +除了 `/tmp` 之外,大多数 Linux 用户最熟悉的 VFS 是 `/proc` 和 `/sys`。(`/dev` 依赖于共享内存,没有 `file_operations`)。为什么有两种?让我们来看看更多细节。 -The procfs offers a snapshot into the instantaneous state of the kernel and the processes that it controls for userspace. In /proc, the kernel publishes information about the facilities it provides, like interrupts, virtual memory, and the scheduler. In addition, /proc/sys is where the settings that are configurable via the [sysctl command][13] are accessible to userspace. Status and statistics on individual processes are reported in /proc/ directories. +procfs 提供了内核的瞬时状态及其为用户空间控制的进程的快照。在 `/proc` 中,内核发布有关其提供的工具的信息,如中断、虚拟内存和调度程序。此外,`/proc/sys` 是存放可以通过 [sysctl 命令][13]配置的设置的地方,可供用户空间访问。单个进程的状态和统计信息在 `/proc/` 目录中报告。 ![Console][14] -/proc/meminfo is an empty file that nonetheless contains valuable information. -The behavior of /proc files illustrates how unlike on-disk filesystems VFS can be. On the one hand, /proc/meminfo contains the information presented by the command **free**. On the other hand, it's also empty! How can this be? The situation is reminiscent of a famous article written by Cornell University physicist N. David Mermin in 1985 called "[Is the moon there when nobody looks?][15] Reality and the quantum theory." The truth is that the kernel gathers statistics about memory when a process requests them from /proc, and there actually is nothing in the files in /proc when no one is looking. As [Mermin said][16], "It is a fundamental quantum doctrine that a measurement does not, in general, reveal a preexisting value of the measured property." (The answer to the question about the moon is left as an exercise.) +*/proc/meminfo 是一个空文件,但仍包含有价值的信息。* + +`/proc` 文件的行为说明了 VFS 可以与磁盘上的文件系统不同。一方面,`/proc/meminfo` 包含命令 `free` 提供的信息。另一方面,它还是空的!怎么会这样?这种情况让人联想起康奈尔大学物理学家 N. David Mermin 在 1985 年写的一篇名为“[没有人看见月亮的情况吗?][15]现实和量子理论。”事实是当进程从 `/proc` 请求内存时内核再收集有关内存的统计信息,并且当没有人在查看时,`/proc` 中的文件实际上没有任何内容。正如 [Mermin 所说][16],“这是一个基本的量子学说,一般来说,测量不会揭示被测属性的预先存在的价值。”(关于月球的问题的答案留作练习。) ![Full moon][17] -The files in /proc are empty when no process accesses them. ([Source][18]) -The apparent emptiness of procfs makes sense, as the information available there is dynamic. The situation with sysfs is different. Let's compare how many files of at least one byte in size there are in /proc versus /sys. +*当没有进程访问它们时,/proc 中的文件为空。([来源][18])* + +procfs 的空文件是有道理的,因为那里可用的信息是动态的。sysfs 的情况不同。让我们比较一下 `/proc` 与 `/sys` 中不为空的文件数量。 ![](https://opensource.com/sites/default/files/uploads/virtualfilesystems_6-filesize.png) -Procfs has precisely one, namely the exported kernel configuration, which is an exception since it needs to be generated only once per boot. On the other hand, /sys has lots of larger files, most of which comprise one page of memory. Typically, sysfs files contain exactly one number or string, in contrast to the tables of information produced by reading files like /proc/meminfo. +procfs 只有一个,即导出的内核配置,这是一个例外,因为每次启动只需要生成一次。另一方面,`/sys` 有许多较大的文件,其中大多数包含一页内存。通常,sysfs 文件只包含一个数字或字符串,与通过读取 `/proc/meminfo` 等文件生成的信息表格形成鲜明对比。 -The purpose of sysfs is to expose the readable and writable properties of what the kernel calls "kobjects" to userspace. The only purpose of kobjects is reference-counting: when the last reference to a kobject is deleted, the system will reclaim the resources associated with it. Yet, /sys constitutes most of the kernel's famous "[stable ABI to userspace][19]" which [no one may ever, under any circumstances, "break."][20] That doesn't mean the files in sysfs are static, which would be contrary to reference-counting of volatile objects. +sysfs 的目的是将内核称为“kobjects”的可读写属性公开给用户空间。kobjects 的唯一目的是引用计数:当删除对 kobject 的最后一个引用时,系统将回收与之关联的资源。然而,`/sys` 构成了内核著名的“[到用户空间的稳定 ABI][19]”,它的大部分内容[在任何情况下都没有人会“破坏”][20]。这并不意味着 sysfs 中的文件是静态,这与易失性对象的引用计数相反。 -The kernel's stable ABI instead constrains what can appear in /sys, not what is actually present at any given instant. Listing the permissions on files in sysfs gives an idea of how the configurable, tunable parameters of devices, modules, filesystems, etc. can be set or read. Logic compels the conclusion that procfs is also part of the kernel's stable ABI, although the kernel's [documentation][19] doesn't state so explicitly. +内核的稳定 ABI 反而限制了 `/sys` 中可能出现的内容,而不是任何给定时刻实际存在的内容。列出 sysfs 中文件的权限可以了解如何设置或读取设备、模块、文件系统等的可配置、可调参数。Logic 强调 procfs 也是内核稳定 ABI 的一部分的结论,尽管内核的[文档][19]没有明确说明。 ![Console][21] -Files in sysfs describe exactly one property each for an entity and may be readable, writable or both. The "0" in the file reveals that the SSD is not removable. + +*sysfs 中的文件恰好描述了实体的每个属性,并且可以是可读的、可写的或两者兼而有之。文件中的“0”表示 SSD 不可移动的存储设备。* ### Snooping on VFS with eBPF and bcc tools From d9419972a0d5406acea9c00836d60ab387bb238a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sun, 12 May 2019 11:15:26 +0800 Subject: [PATCH 0374/1154] Translated --- ...dd - A Graphical Frontend To dd Command.md | 156 ------------------ ...dd - A Graphical Frontend To dd Command.md | 156 ++++++++++++++++++ 2 files changed, 156 insertions(+), 156 deletions(-) delete mode 100644 sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md create mode 100644 translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md diff --git a/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md deleted file mode 100644 index 52f1d6b1da..0000000000 --- a/sources/tech/20190505 Kindd - A Graphical Frontend To dd Command.md +++ /dev/null @@ -1,156 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Kindd – A Graphical Frontend To dd Command) -[#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Kindd – A Graphical Frontend To dd Command -====== - -![Kindd - A Graphical Frontend To dd Command][1] - -A while ago we learned how to [**create bootable ISO using dd command**][2] in Unix-like systems. Please keep in mind that dd command is one of the dangerous and destructive command. If you’re not sure what you are actually doing, you might accidentally wipe your hard drive in minutes. The dd command just takes bytes from **if** and writes them to **of**. It won’t care what it’s overwriting, it won’t care if there’s a partition table in the way, or a boot sector, or a home folder, or anything important. It will simply do what it is told to do. If you’re beginner, mostly try to avoid using dd command to do stuffs. Thankfully, there is a simple GUI utility for dd command. Say hello to **“Kindd”** , a graphical frontend to dd command. It is free, open source tool written in **Qt Quick**. This tool can be very helpful for the beginners and who are not comfortable with command line in general. - -The developer created this tool mainly to provide, - - 1. a modern, simple and safe graphical user interface for dd command, - 2. a graphical way to easily create bootable device without having to use Terminal. - - - -### Installing Kindd - -Kindd is available in [**AUR**][3]. So if you’re a Arch user, install it using any AUR helper tools, for example [**Yay**][4]. - -To install Git version, run: - -``` -$ yay -S kindd-git -``` - -To install release version, run: - -``` -$ yay -S kindd -``` - -After installing, launch Kindd from the Menu or Application launcher. - -For other distributions, you need to manually compile and install it from source as shown below. - -Make sure you have installed the following prerequisites. - - * git - * coreutils - * polkit - * qt5-base - * qt5-quickcontrols - * qt5-quickcontrols2 - * qt5-graphicaleffects - - - -Once all prerequisites installed, git clone the Kindd repository: - -``` -git clone https://github.com/LinArcX/Kindd/ -``` - -Go to the directory where you just cloned Kindd and compile and install it: - -``` -cd Kindd - -qmake - -make -``` - -Finally run the following command to launch Kindd application: - -``` -./kindd -``` - -Kindd uses **pkexec** internally. The pkexec agent is installed by default in most most Desktop environments. But if you use **i3** (or maybe some other DE), you should install **polkit-gnome** first, and then paste the following line into i3 config file: - -``` -exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & -``` - -### Create bootable ISO using Kindd - -To create a bootable USB from an ISO, plug in the USB drive. Then, launch Kindd either from the Menu or Terminal. - -This is how Kindd default interface looks like: - -![][5] - -Kindd interface - -As you can see, Kindd interface is very simple and self-explanatory. There are just two sections namely **List Devices** which displays the list of available devices (hdd and Usb) on your system and **Create Bootable .iso**. You will be in “Create Bootable .iso” section by default. - -Enter the block size in the first column, select the path of the ISO file in the second column and choose the correct device (USB drive path) in third column. Click **Convert/Copy** button to start creating bootable ISO. - -![][6] - -Once the process is completed, you will see successful message. - -![][7] - -Now, unplug the USB drive and boot your system with USB to check if it really works. - -If you don’t know the actual device name (target path), just click on the List devices and check the USB drive name. - -![][8] - -* * * - -**Related read:** - - * [**Etcher – A Beautiful App To Create Bootable SD Cards Or USB Drives**][9] - * [**Bootiso Lets You Safely Create Bootable USB Drive**][10] - - - -* * * - -Kindd is in its early development stage. So, there would be bugs. If you find any bugs, please report them in its GitHub page given at the end of this guide. - -And, that’s all. Hope this was useful. More good stuffs to come. Stay tuned! - -Cheers! - -**Resource:** - - * [**Kindd GitHub Repository**][11] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ - -作者:[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/2019/04/kindd-720x340.png -[2]: https://www.ostechnix.com/how-to-create-bootable-usb-drive-using-dd-command/ -[3]: https://aur.archlinux.org/packages/kindd-git/ -[4]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ -[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-interface.png -[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-1.png -[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-2.png -[8]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-3.png -[9]: https://www.ostechnix.com/etcher-beauitiful-app-create-bootable-sd-cards-usb-drives/ -[10]: https://www.ostechnix.com/bootiso-lets-you-safely-create-bootable-usb-drive/ -[11]: https://github.com/LinArcX/Kindd diff --git a/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md new file mode 100644 index 0000000000..72e34e2938 --- /dev/null +++ b/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kindd – A Graphical Frontend To dd Command) +[#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Kindd – 一个图形化 dd 命令前端 +====== + +![Kindd - A Graphical Frontend To dd Command][1] + +前不久,我们已经学习如何在类 Unix 系统中 [**使用 dd 命令创建可启动的 ISO **][2] 。请记住,dd 命令是危险的和破坏性的命令之一。如果你不确定,你实际在做什么,你可能会在几分钟内意外地擦除你的硬盘数据。dd 命令仅仅从 **if** 获取数据,并写入数据到 **of** 。它将不关心它正在覆盖什么,它将不关心是否在磁道上有一个分区表,或一个启动扇区,或者一个 home 文件夹,或者任何重要的东西。它将简单地做它被告诉去做的事。如果你是初学者,一般地尝试避免使用 dd 命令来做原料。幸好,这有一个支持 dd 命令的简单的 GUI 实用程序。向 **“Kindd”** 问好,一个属于 dd 命令的图形化前端。它是自由的,开放源码的用 **Qt Quick** 所写的工具。总的来说,这个工具对那些对命令行不舒适的初学者是非常有用的。 + +开发者创建这个工具主要是为了提供, + + 1. 一个用于 dd 命令的现代的,简单的和安全的图形化用户界面, + 2. 一种图形化的方法来简单地创建可启动设备,而不必使用终端。 + + + +### 安装 Kindd + +Kindd 在 [**AUR**][3] 中是可用的。所以,如果你是 Arch 用户,使用任一的 AUR helper 工具来安装它tools,例如 [**Yay**][4] 。 + +为安装 Git 版本,运行: + +``` +$ yay -S kindd-git +``` + +为安装发布的版本,运行: + +``` +$ yay -S kindd +``` + +在安装后,从菜单或应用程序启动器启动 Kindd 。 + +对于其它的发行版,你需要从源文件手动编译和安装它,像下面所示。 + +确保你已经安装下面的必要条件。 + + * git + * coreutils + * polkit + * qt5-base + * qt5-quickcontrols + * qt5-quickcontrols2 + * qt5-graphicaleffects + + + +一旦所有必要条件安装,git 克隆 Kindd 储存库: + +``` +git clone https://github.com/LinArcX/Kindd/ +``` + +转到你刚刚克隆 Kindd 的目录,并编译和安装它: + +``` +cd Kindd + +qmake + +make +``` + +最后运行下面的命令来启动 Kindd 应用程序: + +``` +./kindd +``` + +Kindd 使用内部的 **pkexec** 。pkexec 代理被默认安装在大多数桌面环境中。但是,如果你使用 **i3** (或者可能一些其它的桌面环境),你应该首先安装 **polkit-gnome** ,然后粘贴下面的行到 i3 配置文件: + +``` +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & +``` + +### 使用 Kindd 创建可启动的 ISO + +为从一个 ISO 创建一个可启动的 USB ,插入 USB 驱动器。然后,从菜单或终端启动 Kindd 。 + +这是 Kindd 默认界面的外观: + +![][5] + +Kindd 界面 + +正如你所能看到的,Kindd 界面是非常简单的和明白易懂的。这里仅有两部分,即 **设备列表** ,它显示你的系统上的可用的设备( hdd 和 Usb ),并**创建可启动的 .iso** 。默认情况下,你将在“创建可启动 .iso”部分。 + +在第一列中输入块大小,在第二列中选择 ISO 文件的路径,并在第三列中选择正确的设备( USB 驱动器路径)。单击 **转换/复制** 按钮来开始创建可启动的 ISO 。 + +![][6] + +一旦进程被完成,你将看到成功的信息。 + +![][7] + +现在,拔出 USB 驱动器,并带有 USB 启动器启动你的系统,来检查它是否真地工作。 + +如果你不知道真实的设备名称(目标路径),仅在列出的设备上单击,并检查 USB 驱动器名称。 + +![][8] + +* * * + +**相关阅读:** + + * [**Etcher – 一个漂亮的来创建可启动 SD 卡或 USB 驱动器的应用程序**][9] + * [**Bootiso 让你安全地创建可启动的 USB 驱动器**][10] + + + +* * * + +Kindd 在早期开发阶段。因此,可能有错误。如果你找到一些错误,请在这篇的指南的结尾所给的 GitHub 页面报告它们。 + +这就是全部。希望这是有用的。更多的好东西将会来。敬请期待! + +谢谢! + +**资源:** + + * [**Kindd GitHub 储存库**][11] + + + +-------------------------------------------------------------------------------- + +通过: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者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/2019/04/kindd-720x340.png +[2]: https://www.ostechnix.com/how-to-create-bootable-usb-drive-using-dd-command/ +[3]: https://aur.archlinux.org/packages/kindd-git/ +[4]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-interface.png +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-1.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-2.png +[8]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-3.png +[9]: https://www.ostechnix.com/etcher-beauitiful-app-create-bootable-sd-cards-usb-drives/ +[10]: https://www.ostechnix.com/bootiso-lets-you-safely-create-bootable-usb-drive/ +[11]: https://github.com/LinArcX/Kindd From e3b2ae52bd0b7d99e6f6e96416a542ae6ab8ebd7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 11:26:21 +0800 Subject: [PATCH 0375/1154] PRF:20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @bodhix --- ...A Network Interface Port (NIC) In Linux.md | 120 +++++++++--------- 1 file changed, 59 insertions(+), 61 deletions(-) diff --git a/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index 066e0d9a68..dce9849532 100644 --- a/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -1,34 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (bodhix) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?) [#]: via: (https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Linux 中如何启用禁用网口? +Linux 中如何启用和禁用网卡? ====== -你可能会根据你的需要执行以下命令。 +你可能会根据你的需要执行以下命令。我会在这里列举一些你会用到这些命令的例子。 -列举一些你会用到这些命令的例子。 +当你添加一个网卡或者从一个物理网卡创建出一个虚拟网卡的时候,你可能需要使用这些命令将新网卡启用起来。另外,如果你对网卡做了某些修改或者网卡本身没有启用,那么你也需要使用以下的某个命令将网卡启用起来。 -当你添加一个网卡或者从一个物理网口创建出一个虚拟网口的时候,你可能需要使用这些命令将新网口启用起来。另外,如果你对网口做了某些修改或者网口本身没有启用,那么你也需要使用以下的某个命令将网口启用起来。 +启用、禁用网卡有很多种方法。在这篇文章里,我们会介绍我们使用过的最好的 5 种方法。 -启用禁用网口有很多种方法。在这篇文章里,我们会介绍我们使用过的、最好的 5 种方法。 +启用禁用网卡可以使用以下 5 个方法来完成: -启用禁用网口可以使用以下 5 个方法来完成: +* `ifconfig` 命令:用于配置网卡。它可以提供网卡的很多信息。 +* `ifdown/up` 命令:`ifdown` 命令用于禁用网卡,`ifup` 命令用于启用网卡。 +* `ip` 命令:用于管理网卡,用于替代老旧的、不推荐使用的 `ifconfig` 命令。它和 `ifconfig` 命令很相似,但是提供了很多 `ifconfig` 命令所不具有的强大的特性。 +* `nmcli` 命令:是一个控制 NetworkManager 并报告网络状态的命令行工具。 +* `nmtui` 命令:是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 - * **`ifconfig 命令:`** ifconfig 命令用于配置网口。 它可以提供网口的很多信息。 - * **`ifdown/up 命令:`** ifdown 命令用于禁用网口,ifup 命令用于启用网口。 - * **`ip 命令:`** ip 命令用于管理网口,用于替代老旧的、不推荐使用的 ifconfig 命令。它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 - * **`nmcli 命令:`** nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 - * **`nmtui 命令:`** nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 - - - -以下显示的是我的 Linux 系统中可用网口的信息。 +以下显示的是我的 Linux 系统中可用网卡的信息。 ``` # ip a @@ -52,24 +48,25 @@ Linux 中如何启用禁用网口? valid_lft forever preferred_lft forever ``` -### 1、如何使用 ifconfig 命令启用禁用网口? +### 1、如何使用 ifconfig 命令启用禁用网卡? -ifconfig 命令用于配置网口。 +`ifconfig` 命令用于配置网卡。 -系统启动过程中如果需要启用网口,调用的命令就是 ifconfig。 ifconfig 可以提供很多网口的信息。不管我们想修改网口的什么配置,都可以使用该命令。 +在系统启动过程中如果需要启用网卡,调用的命令就是 `ifconfig`。`ifconfig` 可以提供很多网卡的信息。不管我们想修改网卡的什么配置,都可以使用该命令。 -ifconfig 的常用语法: +`ifconfig` 的常用语法: ``` # ifconfig [NIC_NAME] Down/Up ``` -执行以下命令禁用 `enp0s3` 网口。注意,这里你需要输入你自己的网口名字。 +执行以下命令禁用 `enp0s3` 网卡。注意,这里你需要输入你自己的网卡名字。 + ``` # ifconfig enp0s3 down ``` -从以下输出结果可以看到网口已经被禁用了。 +从以下输出结果可以看到网卡已经被禁用了。 ``` # ip a | grep -A 1 "enp0s3:" @@ -77,13 +74,13 @@ ifconfig 的常用语法: link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff ``` -执行以下命令启用 `enp0s3` 网口。 +执行以下命令启用 `enp0s3` 网卡。 ``` # ifconfig enp0s3 up ``` -从以下输出结果可以看到网口已经启用了。 +从以下输出结果可以看到网卡已经启用了。 ``` # ip a | grep -A 5 "enp0s3:" @@ -95,27 +92,26 @@ ifconfig 的常用语法: valid_lft forever preferred_lft forever ``` -### 2、如何使用 ifdown/up 命令启用禁用网口? +### 2、如何使用 ifdown/up 命令启用禁用网卡? -ifdown 命令用于禁用网口,ifup 命令用于启用网口。 +`ifdown` 命令用于禁用网卡,`ifup` 命令用于启用网卡。 -**注意:** 这两个命令不支持以 `enpXXX` 命名的新的网络设备。 +注意:这两个命令不支持以 `enpXXX` 命名的新的网络设备。 -ifdown/ifup 的常用语法: +`ifdown`/`ifup` 的常用语法: ``` # ifdown [NIC_NAME] - # ifup [NIC_NAME] ``` -执行以下命令禁用 `eth1` 网口。 +执行以下命令禁用 `eth1` 网卡。 ``` # ifdown eth1 ``` -从以下输出结果可以看到网口已经被禁用了。 +从以下输出结果可以看到网卡已经被禁用了。 ``` # ip a | grep -A 3 "eth1:" @@ -123,13 +119,13 @@ ifdown/ifup 的常用语法: link/ether 08:00:27:d5:a0:18 brd ff:ff:ff:ff:ff:ff ``` -执行以下命令启用 `eth1` 网口。 +执行以下命令启用 `eth1` 网卡。 ``` # ifup eth1 ``` -从以下输出结果可以看到网口已经启用了。 +从以下输出结果可以看到网卡已经启用了。 ``` # ip a | grep -A 5 "eth1:" @@ -140,32 +136,32 @@ ifdown/ifup 的常用语法: valid_lft forever preferred_lft forever ``` -ifup 和 ifdown 不支持以 `enpXXX` 命名的网口。当执行该命令时得到的结果如下: +`ifup` 和 `ifdown` 不支持以 `enpXXX` 命名的网卡。当执行该命令时得到的结果如下: ``` # ifdown enp0s8 Unknown interface enp0s8 ``` -### 3、如何使用 ip 命令启用禁用网口? +### 3、如何使用 ip 命令启用禁用网卡? -ip 命令用于管理网口,用于替代老旧的、不推荐使用的 ifconfig 命令。 +`ip` 命令用于管理网卡,用于替代老旧的、不推荐使用的 `ifconfig` 命令。 -它和 ifconfig 命令很相似,但是提供了很多 ifconfig 命令不具有的强大的特性。 +它和 `ifconfig` 命令很相似,但是提供了很多 `ifconfig` 命令不具有的强大的特性。 -ip 的常用语法: +`ip` 的常用语法: ``` # ip link set Down/Up ``` -执行以下命令禁用 `enp0s3` 网口。 +执行以下命令禁用 `enp0s3` 网卡。 ``` # ip link set enp0s3 down ``` -从以下输出结果可以看到网口已经被禁用了。 +从以下输出结果可以看到网卡已经被禁用了。 ``` # ip a | grep -A 1 "enp0s3:" @@ -173,13 +169,13 @@ ip 的常用语法: link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff ``` -执行以下命令启用 `enp0s3` 网口。 +执行以下命令启用 `enp0s3` 网卡。 ``` # ip link set enp0s3 up ``` -从以下输出结果可以看到网口已经启用了。 +从以下输出结果可以看到网卡已经启用了。 ``` # ip a | grep -A 5 "enp0s3:" @@ -191,13 +187,13 @@ ip 的常用语法: valid_lft forever preferred_lft forever ``` -### 4、如何使用 nmcli 命令启用禁用网口? +### 4、如何使用 nmcli 命令启用禁用网卡? -nmcli 是一个控制 NetworkManager 并报告网络状态的命令行工具。 +`nmcli` 是一个控制 NetworkManager 并报告网络状态的命令行工具。 -nmcli 可以用做 nm-applet 或者其他图形化客户端的替代品。 它可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,它还可以用来管理和展示网络设备状态。 +`nmcli` 可以用做 nm-applet 或者其他图形化客户端的替代品。它可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,它还可以用来管理和展示网络设备状态。 -nmcli 命令大部分情况下都是使用`配置名称`工作而不是`设备名称`。所以,执行以下命令,获取网口对应的配置名称。【译者注:在使用 nmtui 或者 nmcli 管理网络连接的时候,可以为网络连接配置一个名称,就是这里提到的`配置名称(Profile name)`】 +`nmcli` 命令大部分情况下都是使用“配置名称”工作而不是“设备名称”。所以,执行以下命令,获取网卡对应的配置名称。(LCTT 译注:在使用 `nmtui` 或者 `nmcli` 管理网络连接的时候,可以为网络连接配置一个名称,就是这里提到的配置名称Profile name`) ``` # nmcli con show @@ -206,20 +202,20 @@ Wired connection 1 3d5afa0a-419a-3d1a-93e6-889ce9c6a18c ethernet enp0s3 Wired connection 2 a22154b7-4cc4-3756-9d8d-da5a4318e146 ethernet enp0s8 ``` -nmcli 的常用语法: +`nmcli` 的常用语法: ``` # nmcli con Down/Up ``` -执行以下命令禁用 `enp0s3` 网口。 在禁用网口的时候,你需要使用`配置名称`而不是`设备名称`。 +执行以下命令禁用 `enp0s3` 网卡。在禁用网卡的时候,你需要使用配置名称而不是设备名称。 ``` # nmcli con down 'Wired connection 1' Connection 'Wired connection 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6) ``` -从以下输出结果可以看到网口已经禁用了。 +从以下输出结果可以看到网卡已经禁用了。 ``` # nmcli dev status @@ -229,14 +225,14 @@ enp0s3 ethernet disconnected -- lo loopback unmanaged -- ``` -执行以下命令启用 `enp0s3` 网口。 同样的,这里你需要使用`配置名称`而不是`设备名称`。 +执行以下命令启用 `enp0s3` 网卡。同样的,这里你需要使用配置名称而不是设备名称。 ``` # nmcli con up 'Wired connection 1' Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7) ``` -从以下输出结果可以看到网口已经启用了。 +从以下输出结果可以看到网卡已经启用了。 ``` # nmcli dev status @@ -246,25 +242,27 @@ enp0s3 ethernet connected Wired connection 1 lo loopback unmanaged -- ``` -### 5、如何使用 nmtui 命令启用禁用网口? +### 5、如何使用 nmtui 命令启用禁用网卡? -nmtui 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 +`nmtui` 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 -在启用 nmtui 的时候,如果第一个参数没有特别指定,它会引导用户选择对应的操作去执行。 +在启用 `nmtui` 的时候,如果第一个参数没有特别指定,它会引导用户选择对应的操作去执行。 -执行以下命令打开 mntui 界面。选择 “Active a connection” 然后点击 “OK”。 +执行以下命令打开 `mntui` 界面。选择 “Active a connection” 然后点击 “OK”。 ``` # nmtui ``` -[![][1]![][1]][2] +![][2] -选择你要禁用的网口,然后点击 “Deactivate” 按钮,就可以将网口禁用。 -[![][1]![][1]][3] +选择你要禁用的网卡,然后点击 “Deactivate” 按钮,就可以将网卡禁用。 -如果要启用网口,使用上述同样的步骤即可。 -[![][1]![][1]][4] +![][3] + +如果要启用网卡,使用上述同样的步骤即可。 + +![][4] -------------------------------------------------------------------------------- @@ -273,7 +271,7 @@ via: https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[bodhix](https://github.com/bodhix) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a0069dea7e1b7a079c625b00c952296e5622d233 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 11:26:55 +0800 Subject: [PATCH 0376/1154] PUB:20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @bodhix https://linux.cn/article-10844-1.html --- ... Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md (99%) diff --git a/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/published/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md similarity index 99% rename from translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md rename to published/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md index dce9849532..46c2ce0052 100644 --- a/translated/tech/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md +++ b/published/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (bodhix) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10844-1.html) [#]: subject: (How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?) [#]: via: (https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 0f3bf369b6bb556e722fa25ee16e8148ab223300 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 13:43:53 +0800 Subject: [PATCH 0377/1154] PRF:20190416 Inter-process communication in Linux- Using pipes and message queues.md @FSSlc --- ...n Linux- Using pipes and message queues.md | 187 +++++++++--------- 1 file changed, 96 insertions(+), 91 deletions(-) diff --git a/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md index bdbb9b4ddd..e97b45e085 100644 --- a/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md +++ b/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (FSSlc) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Inter-process communication in Linux: Using pipes and message queues) @@ -9,38 +9,41 @@ Linux 下的进程间通信:使用管道和消息队列 ====== -学习在 Linux 中进程是如何与其他进程进行同步的。 + +> 学习在 Linux 中进程是如何与其他进程进行同步的。 + ![Chat bubbles][1] -本篇是 Linux 下[进程间通信][2](IPC)系列的第二篇文章。[第一篇文章][3] 聚焦于通过共享文件和共享内存段这样的共享存储来进行 IPC。这篇文件的重点将转向管道,它是连接需要通信的进程之间的通道。管道拥有一个 _写端_ 用于写入字节数据,还有一个 _读端_ 用于按照先入先出的顺序读入这些字节数据。而这些字节数据可能代表任何东西:数字、数字电影等等。 +本篇是 Linux 下[进程间通信][2](IPC)系列的第二篇文章。[第一篇文章][3] 聚焦于通过共享文件和共享内存段这样的共享存储来进行 IPC。这篇文件的重点将转向管道,它是连接需要通信的进程之间的通道。管道拥有一个*写端*用于写入字节数据,还有一个*读端*用于按照先入先出的顺序读入这些字节数据。而这些字节数据可能代表任何东西:数字、员工记录、数字电影等等。 管道有两种类型,命名管道和无名管道,都可以交互式的在命令行或程序中使用它们;相关的例子在下面展示。这篇文章也将介绍内存队列,尽管它们有些过时了,但它们不应该受这样的待遇。 -在本系列的第一篇文章中的示例代码承认了在 IPC 中可能受到竞争条件(不管是基于文件的还是基于内存的)的威胁。自然地我们也会考虑基于管道的 IPC 的安全并发问题,这个也将在本文中提及。针对管道和内存队列的例子将会使用 POSIX 推荐使用的 API, POSIX 的一个核心目标就是线程安全。 +在本系列的第一篇文章中的示例代码承认了在 IPC 中可能受到竞争条件(不管是基于文件的还是基于内存的)的威胁。自然地我们也会考虑基于管道的 IPC 的安全并发问题,这个也将在本文中提及。针对管道和内存队列的例子将会使用 POSIX 推荐使用的 API,POSIX 的一个核心目标就是线程安全。 -考虑查看 [**mq_open** 函数的 man 页][4],这个函数属于内存队列的 API。这个 man 页中有一个章节是有关 [特性][5] 的小表格: +请查看一些 [mq_open 函数的 man 页][4],这个函数属于内存队列的 API。这个 man 页中有关 [特性][5] 的章节带有一个小表格: -Interface | Attribute | Value +接口 | 特性 | 值 ---|---|--- -mq_open() | Thread safety | MT-Safe +`mq_open()` | 线程安全 | MT-Safe -上面的 **MT-Safe**(**MT** 指的是 multi-threaded,多线程)意味着 **mq_open** 函数是线程安全的,进而暗示是进程安全的:一个进程的执行和它的一个线程执行的过程类似,假如竞争条件不会发生在处于 _相同_ 进程的线程中,那么这样的条件也不会发生在处于不同进程的线程中。**MT-Safe** 特性保证了调用 **mq_open** 时不会出现竞争条件。一般来说,基于通道的 IPC 是并发安全的,尽管在下面例子中会出现一个有关警告的注意事项。 +上面的 MT-Safe(MT 指的是多线程multi-threaded)意味着 `mq_open` 函数是线程安全的,进而暗示是进程安全的:一个进程的执行和它的一个线程执行的过程类似,假如竞争条件不会发生在处于*相同*进程的线程中,那么这样的条件也不会发生在处于不同进程的线程中。MT-Safe 特性保证了调用 `mq_open` 时不会出现竞争条件。一般来说,基于通道的 IPC 是并发安全的,尽管在下面例子中会出现一个有关警告的注意事项。 ### 无名管道 -首先让我们通过一个特意构造的命令行例子来展示无名管道是如何工作的。在所有的现代系统中,符号 **|** 在命令行中都代表一个无名管道。假设我们的命令行提示符为 **%**,接下来考虑下面的命令: +首先让我们通过一个特意构造的命令行例子来展示无名管道是如何工作的。在所有的现代系统中,符号 `|` 在命令行中都代表一个无名管道。假设我们的命令行提示符为 `%`,接下来考虑下面的命令: ```shell -% sleep 5 | echo "Hello, world!" ## writer to the left of |, reader to the right +## 写入方在 | 左边,读取方在右边 +% sleep 5 | echo "Hello, world!" ``` -_sleep_ 和 _echo_ 程序以不同的进程执行,无名管道允许它们进行通信。但是上面的例子被特意设计为没有通信发生。问候语 _Hello, world!_ 出现在屏幕中,然后过了 5 秒后,命令行返回,暗示 _sleep_ 和 _echo_ 进程都已经结束了。这期间发生了什么呢? +`sleep` 和 `echo` 程序以不同的进程执行,无名管道允许它们进行通信。但是上面的例子被特意设计为没有通信发生。问候语 “Hello, world!” 出现在屏幕中,然后过了 5 秒后,命令行返回,暗示 `sleep` 和 `echo` 进程都已经结束了。这期间发生了什么呢? -在命令行中的竖线 **|** 的语法中,左边的进程(_sleep_)是写入方,右边的进程(_echo_)为读取方。默认情况下,读入方将会堵塞,直到从通道中能够读取字节数据,而写入方在写完它的字节数据后,将发送 流已终止 的标志。(即便写入方永久地停止了,一个流已终止的标志还是会发给读取方。)无名管道将保持到写入方和读取方都停止的那个时刻。 +在命令行中的竖线 `|` 的语法中,左边的进程(`sleep`)是写入方,右边的进程(`echo`)为读取方。默认情况下,读取方将会阻塞,直到从通道中能够读取到字节数据,而写入方在写完它的字节数据后,将发送 流已终止end-of-stream的标志。(即便写入方过早终止了,一个流已终止的标志还是会发给读取方。)无名管道将保持到写入方和读取方都停止的那个时刻。 -在上面的例子中,_sleep_ 进程并没有向通道写入任何的字节数据,但在 5 秒后就停止了,这时将向通道发送一个流已终止的标志。与此同时,_echo_ 进程立即向标准输出(屏幕)写入问候语,因为这个进程并不从通道中读入任何字节,所以它并没有等待。一旦 _sleep_ 和 _echo_ 进程都终止了,不会再用作通信的无名管道将会消失然后返回命令行提示符。 +在上面的例子中,`sleep` 进程并没有向通道写入任何的字节数据,但在 5 秒后就终止了,这时将向通道发送一个流已终止的标志。与此同时,`echo` 进程立即向标准输出(屏幕)写入问候语,因为这个进程并不从通道中读入任何字节,所以它并没有等待。一旦 `sleep` 和 `echo` 进程都终止了,不会再用作通信的无名管道将会消失然后返回命令行提示符。 -下面这个更加实用示例将使用两个无名管道。我们假定文件 _test.dat_ 的内容如下: +下面这个更加实用的示例将使用两个无名管道。我们假定文件 `test.dat` 的内容如下: ``` this @@ -52,13 +55,13 @@ world ends ``` -下面的命令 +下面的命令: ``` % cat test.dat | sort | uniq ``` -会将 _cat_(concatenate 的缩写)进程的输出通过管道传给 _sort_ 进程以生成排序后的输出,然后将排序后的输出通过管道传给 _uniq_ 进程以消除重复的记录(在本例中,会将两次出现的 **the** 缩减为一个): +会将 `cat`(连接concatenate的缩写)进程的输出通过管道传给 `sort` 进程以生成排序后的输出,然后将排序后的输出通过管道传给 `uniq` 进程以消除重复的记录(在本例中,会将两次出现的 “the” 缩减为一个): ``` ends @@ -73,7 +76,6 @@ world #### 示例 1. 两个进程通过一个无名管道来进行通信 - ```c #include /* wait */ #include @@ -120,21 +122,23 @@ int main() { } ``` -上面名为 _pipeUN_ 的程序使用系统函数 **fork** 来创建一个进程。尽管这个程序只有一个单一的源文件,在它正确执行的情况下将会发生多进程的情况。下面的内容是对库函数 **fork** 如何工作的一个简要回顾: +上面名为 `pipeUN` 的程序使用系统函数 `fork` 来创建一个进程。尽管这个程序只有一个单一的源文件,在它正确执行的情况下将会发生多进程的情况。 - * **fork** 函数由 _父_ 进程调用,在失败时返回 **-1** 给父进程。在 _pipeUN_ 这个例子中,相应的调用是 +> 下面的内容是对库函数 `fork` 如何工作的一个简要回顾: -```c +> * `fork` 函数由*父*进程调用,在失败时返回 `-1` 给父进程。在 `pipeUN` 这个例子中,相应的调用是: + +> ```c pid_t cpid = fork(); /* called in parent */ ``` -函数,调用后的返回值也被保存下来了。在这个例子中,保存在整数类型 **pid_t** 的变量 **cpid** 中。(每个进程有它自己的 _进程 ID_,一个非负的整数,用来标记进程)。复刻一个新的进程可能会因为多种原因而失败。最终它们将会被包括进一个完整的 _进程表_,这个结构由系统维持,以此来追踪进程状态。明确地说,僵尸进程假如没有被处理掉,将可能引起一个进程表被填满。 - * 假如 **fork** 调用成功,则它将创建一个新的子进程,向父进程返回一个值,向子进程返回另外的一个值。在调用 **fork** 后父进程和子进程都将执行相同的代码。(子进程继承了到此为止父进程中声明的所有变量的拷贝),特别地,一次成功的 **fork** 调用将返回如下的东西: - * 向子进程返回 0 - * 向父进程返回子进程的进程 ID - * 在依次成功的 **fork** 调用后,一个 _if/else_ 或等价的结构将会被用来隔离针对父进程和子进程的代码。在这个例子中,相应的声明为: +> 函数调用后的返回值也被保存下来了。在这个例子中,保存在整数类型 `pid_t` 的变量 `cpid` 中。(每个进程有它自己的*进程 ID*,这是一个非负的整数,用来标记进程)。复刻一个新的进程可能会因为多种原因而失败,包括*进程表*满了的原因,这个结构由系统维持,以此来追踪进程状态。明确地说,僵尸进程假如没有被处理掉,将可能引起进程表被填满的错误。 +> * 假如 `fork` 调用成功,则它将创建一个新的子进程,向父进程返回一个值,向子进程返回另外的一个值。在调用 `fork` 后父进程和子进程都将执行相同的代码。(子进程继承了到此为止父进程中声明的所有变量的拷贝),特别地,一次成功的 `fork` 调用将返回如下的东西: +> * 向子进程返回 `0` +> * 向父进程返回子进程的进程 ID +> * 在一次成功的 `fork` 调用后,一个 `if`/`else` 或等价的结构将会被用来隔离针对父进程和子进程的代码。在这个例子中,相应的声明为: -```c +> ```c if (0 == cpid) { /*** child ***/ ... } @@ -143,25 +147,25 @@ else { /*** parent ***/ } ``` -假如成功地复刻出了一个子进程,_pipeUN_ 程序将像下面这样去执行。存在一个整数的数列 +假如成功地复刻出了一个子进程,`pipeUN` 程序将像下面这样去执行。在一个整数的数列里: ```c int pipeFDs[2]; /* two file descriptors */ ``` -来保存两个文件描述符,一个用来向管道中写入,另一个从管道中写入。(数组元素 **pipeFDs[0]** 是读端的文件描述符,元素 **pipeFDs[1]** 是写端的文件描述符。)在调用 **fork** 之前,对系统 **pipe** 函数的成功调用,将立刻使得这个数组获得两个文件描述符: +来保存两个文件描述符,一个用来向管道中写入,另一个从管道中写入。(数组元素 `pipeFDs[0]` 是读端的文件描述符,元素 `pipeFDs[1]` 是写端的文件描述符。)在调用 `fork` 之前,对系统 `pipe` 函数的成功调用,将立刻使得这个数组获得两个文件描述符: ```c if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); ``` -父进程和子进程现在都有了文件描述符的副本。但 _分离关注点_ 模式意味着每个进程恰好只需要一个描述符。在这个例子中,父进程负责写入,而子进程负责读取,尽管这样的角色分配可以反过来。在 _if_ 子句中的第一个语句将用于关闭管道的读端: +父进程和子进程现在都有了文件描述符的副本。但*分离关注点*模式意味着每个进程恰好只需要一个描述符。在这个例子中,父进程负责写入,而子进程负责读取,尽管这样的角色分配可以反过来。在 `if` 子句中的第一个语句将用于关闭管道的读端: ```c close(pipeFDs[WriteEnd]); /* called in child code */ ``` -在父进程中的 _else_ 子句将会关闭管道的读端: +在父进程中的 `else` 子句将会关闭管道的读端: ```c close(pipeFDs[ReadEnd]); /* called in parent code */ @@ -169,23 +173,23 @@ close(pipeFDs[ReadEnd]); /* called in parent code */ 然后父进程将向无名管道中写入某些字节数据(ASCII 代码),子进程读取这些数据,然后向标准输出中回放它们。 -在这个程序中还需要澄清的一点是在父进程代码中的 **wait** 函数。一旦被创建后,子进程很大程度上独立于它的父进程,正如简短的 _pipeUN_ 程序所展示的那样。子进程可以执行任意的代码,而它们可能与父进程完全没有关系。但是,假如当子进程终止时,系统将会通过一个信号来通知父进程。 +在这个程序中还需要澄清的一点是在父进程代码中的 `wait` 函数。一旦被创建后,子进程很大程度上独立于它的父进程,正如简短的 `pipeUN` 程序所展示的那样。子进程可以执行任意的代码,而它们可能与父进程完全没有关系。但是,假如当子进程终止时,系统将会通过一个信号来通知父进程。 -要是父进程在子进程之前终止又该如何呢?在这种情形下,除非采取了预防措施,子进程将会变成在进程表中的一个 _僵尸_ 进程。预防措施有两大类型:第一种是让父进程去通知系统,告诉系统它对子进程的终止没有任何兴趣: +要是父进程在子进程之前终止又该如何呢?在这种情形下,除非采取了预防措施,子进程将会变成在进程表中的一个*僵尸*进程。预防措施有两大类型:第一种是让父进程去通知系统,告诉系统它对子进程的终止没有任何兴趣: ```c signal(SIGCHLD, SIG_IGN); /* in parent: ignore notification */ ``` -第二种方法是在子进程终止时,让父进程执行一个 **wait**。这样就确保了父进程可以独立于子进程而存在。在 _pipeUN_ 程序中使用了第二种方法,其中父进程的代码使用的是下面的调用: +第二种方法是在子进程终止时,让父进程执行一个 `wait`。这样就确保了父进程可以独立于子进程而存在。在 `pipeUN` 程序中使用了第二种方法,其中父进程的代码使用的是下面的调用: ```c wait(NULL); /* called in parent */ ``` -这个对 **wait** 的调用意味着 _一直等待直到任意一个子进程的终止发生_,因此在 _pipeUN_ 程序中,只有一个子进程。(其中的 **NULL** 参数可以被替换为一个保存有子程序退出状态的整数变量的地址。)对于更细颗粒度的控制,还可以使用更灵活的 **waitpid** 函数,例如特别指定多个子进程中的某一个。 +这个对 `wait` 的调用意味着*一直等待直到任意一个子进程的终止发生*,因此在 `pipeUN` 程序中,只有一个子进程。(其中的 `NULL` 参数可以被替换为一个保存有子程序退出状态的整数变量的地址。)对于更细粒度的控制,还可以使用更灵活的 `waitpid` 函数,例如特别指定多个子进程中的某一个。 -_pipeUN_ 将会采取另一个预防措施。当父进程结束了等待,父进程将会调用常规的 **exit** 函数去退出。对应的,子进程将会调用 **_exit** 变种来退出,这类变种将快速跟踪终止相关的通知。在效果上,子进程会告诉系统立刻去通知父进程它的这个子进程已经终止了。 +`pipeUN` 将会采取另一个预防措施。当父进程结束了等待,父进程将会调用常规的 `exit` 函数去退出。对应的,子进程将会调用 `_exit` 变种来退出,这类变种将快速跟踪终止相关的通知。在效果上,子进程会告诉系统立刻去通知父进程它的这个子进程已经终止了。 假如两个进程向相同的无名管道中写入内容,字节数据会交错吗?例如,假如进程 P1 向管道写入内容: @@ -205,42 +209,42 @@ baz baz baz foo baz bar ``` -POSIX 标准确保了写不是交错的,使得没有写操作能够超过 **PIPE_BUF** 的范围。在 Linux 系统中, **PIPE_BUF** 的大小是 4096 字节。对于管道我更喜欢只有一个写方和一个读方,从而绕过这个问题。 +只要没有写入超过 `PIPE_BUF` 字节,POSIX 标准就能确保写入不会交错。在 Linux 系统中, `PIPE_BUF` 的大小是 4096 字节。对于管道我更喜欢只有一个写入方和一个读取方,从而绕过这个问题。 -## 命名管道 +### 命名管道 无名管道没有备份文件:系统将维持一个内存缓存来将字节数据从写方传给读方。一旦写方和读方终止,这个缓存将会被回收,进而无名管道消失。相反的,命名管道有备份文件和一个不同的 API。 -下面让我们通过另一个命令行示例来知晓命名管道的要点。下面是具体的步骤: +下面让我们通过另一个命令行示例来了解命名管道的要点。下面是具体的步骤: - * 开启两个终端。这两个终端的工作目录应该相同。 - * 在其中一个终端中,键入下面的两个命令(命令行提示符仍然是 **%**,我的注释以 **##** 打头。): +* 开启两个终端。这两个终端的工作目录应该相同。 +* 在其中一个终端中,键入下面的两个命令(命令行提示符仍然是 `%`,我的注释以 `##` 打头。): -```shell -% mkfifo tester ## creates a backing file named tester -% cat tester ## type the pipe's contents to stdout + ```shell +% mkfifo tester ## 创建一个备份文件,名为 tester +% cat tester ## 将管道的内容输出到 stdout ``` -在最开始,没有任何东西会出现在终端中,因为到现在为止没有命名管道中写入任何东西。 - * 在第二个终端中输入下面的命令: + 在最开始,没有任何东西会出现在终端中,因为到现在为止没有在命名管道中写入任何东西。 +* 在第二个终端中输入下面的命令: -```shell + ```shell % cat > tester ## redirect keyboard input to the pipe hello, world! ## then hit Return key bye, bye ## ditto ## terminate session with a Control-C ``` -无论在这个终端中输入什么,它都会在另一个终端中显示出来。一旦键入 **Ctrl+C**,就会回到正常的命令行提示符,因为管道已经被关闭了。 - * 通过移除实现命名管道的文件来进行清理: + 无论在这个终端中输入什么,它都会在另一个终端中显示出来。一旦键入 `Ctrl+C`,就会回到正常的命令行提示符,因为管道已经被关闭了。 +* 通过移除实现命名管道的文件来进行清理: -```shell + ```shell % unlink tester ``` -正如 _mkfifo_ 程序的名字所暗示的那样,一个命名管道也被叫做一个 FIFO,因为第一个字节先进,然后第一个字节就先出,其他的类似。存在一个名为 **mkfifo** 的库函数,用它可以在程序中创建一个命名管道,它将在下一个示例中被用到,该示例由两个进程组成:一个向命名管道写入,而另一个从该管道读取。 +正如 `mkfifo` 程序的名字所暗示的那样,命名管道也被叫做 FIFO,因为第一个进入的字节,就会第一个出,其他的类似。有一个名为 `mkfifo` 的库函数,用它可以在程序中创建一个命名管道,它将在下一个示例中被用到,该示例由两个进程组成:一个向命名管道写入,而另一个从该管道读取。 -#### 示例 2. _fifoWriter_ 程序 +#### 示例 2. fifoWriter 程序 ```c #include @@ -283,29 +287,29 @@ int main() { } ``` -上面的 _fifoWriter_ 程序可以被总结为如下: +上面的 `fifoWriter` 程序可以被总结为如下: - * 首先程序创建了一个命名管道用来写入数据: +* 首先程序创建了一个命名管道用来写入数据: -```c + ```c mkfifo(pipeName, 0666); /* read/write perms for user/group/others */ int fd = open(pipeName, O_CREAT | O_WRONLY); ``` -其中的 **pipeName** 是传递给 **mkfifo** 作为它的第一个参数的备份文件的名字。接着命名管道通过我们熟悉的 **open** 函数调用被打开,而这个函数将会返回一个文件描述符。 - * 在实现层面上,_fifoWriter_ 不会一次性将所有的数据都写入,而是写入一个块,然后休息随机数目的微秒时间,接着再循环往复。总的来说,有 768000 个 4 比特的整数值被写入到命名管道中。 - * 在关闭命名管道后,_fifoWriter_ 也将使用 unlink 去掉关联。 + 其中的 `pipeName` 是备份文件的名字,传递给 `mkfifo` 作为它的第一个参数。接着命名管道通过我们熟悉的 `open` 函数调用被打开,而这个函数将会返回一个文件描述符。 +* 在实现层面上,`fifoWriter` 不会一次性将所有的数据都写入,而是写入一个块,然后休息随机数目的微秒时间,接着再循环往复。总的来说,有 768000 个 4 字节整数值被写入到命名管道中。 +* 在关闭命名管道后,`fifoWriter` 也将使用 `unlink` 取消对该文件的连接。 -```c + ```c close(fd); /* close pipe: generates end-of-stream marker */ unlink(pipeName); /* unlink from the implementing file */ ``` -一旦连接到管道的每个进程都执行了 unlink 操作后,系统将回收这些备份文件。在这个例子中,只有两个这样的进程 _fifoWriter_ 和 _fifoReader_,它们都做了 _unlink_ 操作。 + 一旦连接到管道的每个进程都执行了 `unlink` 操作后,系统将回收这些备份文件。在这个例子中,只有两个这样的进程 `fifoWriter` 和 `fifoReader`,它们都做了 `unlink` 操作。 -这个两个程序应该在位于相同工作目录下的不同终端中被执行。但是 _fifoWriter_ 应该在 _fifoReader_ 之前被启动,因为需要 _fifoWriter_ 去创建管道。然后 _fifoReader_ 才能够获取到刚被创建的命名管道。 +这个两个程序应该在不同终端的相同工作目录中执行。但是 `fifoWriter` 应该在 `fifoReader` 之前被启动,因为需要 `fifoWriter` 去创建管道。然后 `fifoReader` 才能够获取到刚被创建的命名管道。 -#### 示例 3. _fifoReader_ 程序 +#### 示例 3. fifoReader 程序 ```c #include @@ -352,28 +356,28 @@ int main() { } ``` -上面的 _fifoReader_ 的内容可以总结为如下: +上面的 `fifoReader` 的内容可以总结为如下: - * 因为 _fifoWriter_ 已经创建了命名管道,所以 _fifoReader_ 只需要利用标准的 **open** 调用来通过备份文件来获取到管道中的内容: +* 因为 `fifoWriter` 已经创建了命名管道,所以 `fifoReader` 只需要利用标准的 `open` 调用来通过备份文件来获取到管道中的内容: -```c + ```c const char* file = "./fifoChannel"; int fd = open(file, O_RDONLY); ``` -这个文件的打开是只读的。 - * 然后这个程序进入一个潜在的无限循环,在每次循环时,尝试读取 4 比特的块。**read** 调用: + 这个文件的是以只读打开的。 +* 然后这个程序进入一个潜在的无限循环,在每次循环时,尝试读取 4 字节的块。`read` 调用: -```c + ```c ssize_t count = read(fd, &next, sizeof(int)); ``` -返回 0 来暗示流的结束。在这种情况下,_fifoReader_ 跳出循环,关闭命名管道,并在终止前 unlink 备份文件。 - * 在读入 4 比特整数后,_fifoReader_ 检查这个数是否为质数。这个操作代表了一个生产级别的读取器可能在接收到的字节数据上执行的逻辑操作。在示例运行中,接收了 768000 个整数中的 37682 个质数。 + 返回 0 来暗示该流的结束。在这种情况下,`fifoReader` 跳出循环,关闭命名管道,并在终止前 `unlink` 备份文件。 +* 在读入 4 字节整数后,`fifoReader` 检查这个数是否为质数。这个操作代表了一个生产级别的读取器可能在接收到的字节数据上执行的逻辑操作。在示例运行中,在接收到的 768000 个整数中有 37682 个质数。 -在重复的运行示例时, _fifoReader_ 将成功地读取 _fifoWriter_ 写入的所有字节。这不是很让人惊讶的。这两个进程在相同的机器上执行,从而可以不用考虑网络相关的问题。命名管道是一个可信且高效的 IPC 机制,因而被广泛使用。 +重复运行示例, `fifoReader` 将成功地读取 `fifoWriter` 写入的所有字节。这不是很让人惊讶的。这两个进程在相同的机器上执行,从而可以不用考虑网络相关的问题。命名管道是一个可信且高效的 IPC 机制,因而被广泛使用。 -下面是这两个程序的输出,在不同的终端中启动,但处于相同的工作目录: +下面是这两个程序的输出,它们在不同的终端中启动,但处于相同的工作目录: ```shell % ./fifoWriter @@ -385,13 +389,14 @@ Received ints: 768000, primes: 37682 ### 消息队列 -管道有着严格的先入先出行为:第一个被写入的字节将会第一个被读,第二个写入的字节将第二个被读,以此类推。消息队列可以做出相同的表现,但它又足够灵活,可以使得字节块不以先入先出的次序来接收。 +管道有着严格的先入先出行为:第一个被写入的字节将会第一个被读,第二个写入的字节将第二个被读,以此类推。消息队列可以做出相同的表现,但它又足够灵活,可以使得字节块可以不以先入先出的次序来接收。 -正如它的名字所建议的那样,消息队列是一系列的消息,每个消息包含两部分: - * 荷载,一个字节序列(在 C 中是 **char**) - * 一个类型,以一个正整数值的形式给定,类型用来分类消息,为了更灵活的回收 +正如它的名字所提示的那样,消息队列是一系列的消息,每个消息包含两部分: -考虑下面对一个消息队列的描述,每个消息被一个整数类型标记: +* 荷载,一个字节序列(在 C 中是 char) +* 类型,以一个正整数值的形式给定,类型用来分类消息,为了更灵活的回收 + +看一下下面对一个消息队列的描述,每个消息由一个整数类型标记: ``` +-+ +-+ +-+ +-+ @@ -399,11 +404,11 @@ sender--->|3|--->|2|--->|2|--->|1|--->receiver +-+ +-+ +-+ +-+ ``` -在上面展示的 4 个消息中,标记为 1 的是开头,即最接近接收端,然后另个标记为 2 的消息,最后接着一个标记为 3 的消息。假如按照严格的 FIFO 行为执行,消息将会以 1-2-2-3 这样的次序被接收。但是消息队列允许其他回收次序。例如,消息可以被接收方以 3-2-1-2 的次序接收。 +在上面展示的 4 个消息中,标记为 1 的是开头,即最接近接收端,然后另个标记为 2 的消息,最后接着一个标记为 3 的消息。假如按照严格的 FIFO 行为执行,消息将会以 1-2-2-3 这样的次序被接收。但是消息队列允许其他收取次序。例如,消息可以被接收方以 3-2-1-2 的次序接收。 -_mqueue_ 示例包含两个程序,_sender_ 将向消息队列中写入数据,而 _receiver_ 将从这个队列中读取数据。这两个程序都包含下面展示的头文件 _queue.h_: +`mqueue` 示例包含两个程序,`sender` 将向消息队列中写入数据,而 `receiver` 将从这个队列中读取数据。这两个程序都包含的头文件 `queue.h` 如下所示: -#### 示例 4. 头文件 _queue.h_ +#### 示例 4. 头文件 queue.h ```c #define ProjectId 123 @@ -417,16 +422,16 @@ typedef struct { } queuedMessage; ``` -上面的头文件定义了一个名为 **queuedMessage** 的结构类型,它带有 **payload**(字节数组)和 **type**(整数)这两个域。该文件也定义了一些符号常数(使用 **#define** 语句)。前两个常数被用来生成一个 key,而这个 key 反过来被用来获取一个消息队列的 ID。**ProjectId** 可以是任何正整数值,而 **PathName** 必须是一个存在的,可访问的文件,在这个示例中,指的是文件 _queue.h_。在 _sender_ 和 _receiver_ 中,它们都有的设定语句为: +上面的头文件定义了一个名为 `queuedMessage` 的结构类型,它带有 `payload`(字节数组)和 `type`(整数)这两个域。该文件也定义了一些符号常数(使用 `#define` 语句),前两个常数被用来生成一个 `key`,而这个 `key` 反过来被用来获取一个消息队列的 ID。`ProjectId` 可以是任何正整数值,而 `PathName` 必须是一个存在的、可访问的文件,在这个示例中,指的是文件 `queue.h`。在 `sender` 和 `receiver` 中,它们都有的设定语句为: ```c key_t key = ftok(PathName, ProjectId); /* generate key */ int qid = msgget(key, 0666 | IPC_CREAT); /* use key to get queue id */ ``` -ID **qid** 在效果上是消息队列文件描述符的对应物。 +ID `qid` 在效果上是消息队列文件描述符的对应物。 -#### 示例 5. _sender_ 程序 +#### 示例 5. sender 程序 ```c #include @@ -465,15 +470,15 @@ int main() { } ``` -上面的 _sender_ 程序将发送出 6 个消息,每两个为一个类型:前两个是类型 1,接着的连个是类型 2,最后的两个为类型 3。发送的语句: +上面的 `sender` 程序将发送出 6 个消息,每两个为一个类型:前两个是类型 1,接着的连个是类型 2,最后的两个为类型 3。发送的语句: ```c msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); ``` -被配置为非阻塞的(**IPC_NOWAIT** 标志),因为这里的消息体量上都很小。唯一的危险在于一个完整的序列将可能导致发送失败,而这个例子不会。下面的 _receiver_ 程序也将使用 **IPC_NOWAIT** 标志来接收消息。 +被配置为非阻塞的(`IPC_NOWAIT` 标志),是因为这里的消息体量上都很小。唯一的危险在于一个完整的序列将可能导致发送失败,而这个例子不会。下面的 `receiver` 程序也将使用 `IPC_NOWAIT` 标志来接收消息。 -#### 示例 6. _receiver_ 程序 +#### 示例 6. receiver 程序 ```c #include @@ -511,13 +516,13 @@ int main() { } ``` -这个 _receiver_ 程序不会创建消息队列,尽管 API 看起来像是那样。在 _receiver_ 中,对 +这个 `receiver` 程序不会创建消息队列,尽管 API 尽管建议那样。在 `receiver` 中,对 ```c int qid = msgget(key, 0666 | IPC_CREAT); ``` -的调用可能因为带有 **IPC_CREAT** 标志而具有误导性,但是这个标志的真实意义是 _如果需要就创建,否则直接获取_。_sender_ 程序调用 **msgsnd** 来发送消息,而 _receiver_ 调用 **msgrcv** 来接收它们。在这个例子中,_sender_ 以 1-1-2-2-3-3 的次序发送消息,但 _receiver_ 接收它们的次序为 3-1-2-1-3-2,这显示消息队列没有被严格的 FIFO 行为所拘泥: +的调用可能因为带有 `IPC_CREAT` 标志而具有误导性,但是这个标志的真实意义是*如果需要就创建,否则直接获取*。`sender` 程序调用 `msgsnd` 来发送消息,而 `receiver` 调用 `msgrcv` 来接收它们。在这个例子中,`sender` 以 1-1-2-2-3-3 的次序发送消息,但 `receiver` 接收它们的次序为 3-1-2-1-3-2,这显示消息队列没有被严格的 FIFO 行为所拘泥: ```shell % ./sender @@ -537,7 +542,7 @@ msg6 received as type 3 msg4 received as type 2 ``` -上面的输出显示 _sender_ 和 _receiver_ 可以在同一个终端中启动。输出也显示消息队列是持久的,即便在 _sender_ 进程在完成创建队列,向队列写数据,然后离开的整个过程后,队列仍然存在。只有在 _receiver_ 进程显式地调用 **msgctl** 来移除该队列,这个队列才会消失: +上面的输出显示 `sender` 和 `receiver` 可以在同一个终端中启动。输出也显示消息队列是持久的,即便 `sender` 进程在完成创建队列、向队列写数据、然后退出的整个过程后,该队列仍然存在。只有在 `receiver` 进程显式地调用 `msgctl` 来移除该队列,这个队列才会消失: ```c if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */ @@ -545,7 +550,7 @@ if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */ ### 总结 -管道和消息队列的 API 在根本上来说都是单向的:一个进程写,然后另一个进程读。当然还存在双向命名管道的实现,但我认为这个 IPC 机制在它最为简单的时候反而是最佳的。正如前面提到的那样,消息队列已经不大受欢迎了,尽管没有找到什么特别好的原因来解释这个现象。而队列仍然是 IPC 工具箱中的另一个工具。这个快速的 IPC 工具箱之旅将以第 3 部分-通过套接字和信号来示例 IPC -来终结。 +管道和消息队列的 API 在根本上来说都是单向的:一个进程写,然后另一个进程读。当然还存在双向命名管道的实现,但我认为这个 IPC 机制在它最为简单的时候反而是最佳的。正如前面提到的那样,消息队列已经不大受欢迎了,尽管没有找到什么特别好的原因来解释这个现象;而队列仍然是 IPC 工具箱中的一个工具。这个快速的 IPC 工具箱之旅将以第 3 部分(通过套接字和信号来示例 IPC)来终结。 -------------------------------------------------------------------------------- @@ -554,7 +559,7 @@ via: https://opensource.com/article/19/4/interprocess-communication-linux-channe 作者:[Marty Kalin][a] 选题:[lujun9972][b] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -562,7 +567,7 @@ via: https://opensource.com/article/19/4/interprocess-communication-linux-channe [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) [2]: https://en.wikipedia.org/wiki/Inter-process_communication -[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 +[3]: https://linux.cn/article-10826-1.html [4]: http://man7.org/linux/man-pages/man2/mq_open.2.html [5]: http://man7.org/linux/man-pages/man2/mq_open.2.html#ATTRIBUTES [6]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html From 1c621a429124f445abc799b2f497e944f0ab8fc7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 13:45:09 +0800 Subject: [PATCH 0378/1154] PUB:20190416 Inter-process communication in Linux- Using pipes and message queues.md @FSSlc https://linux.cn/article-10845-1.html --- ... communication in Linux- Using pipes and message queues.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190416 Inter-process communication in Linux- Using pipes and message queues.md (99%) diff --git a/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md similarity index 99% rename from translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md rename to published/20190416 Inter-process communication in Linux- Using pipes and message queues.md index e97b45e085..f0393a1ba6 100644 --- a/translated/tech/20190416 Inter-process communication in Linux- Using pipes and message queues.md +++ b/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (FSSlc) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10845-1.html) [#]: subject: (Inter-process communication in Linux: Using pipes and message queues) [#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-channels) [#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) From fde1c2b2037c0af3c494a281b35c3bceabd04be9 Mon Sep 17 00:00:00 2001 From: FSSlc Date: Sun, 12 May 2019 16:20:19 +0800 Subject: [PATCH 0379/1154] Update 20190417 Inter-process communication in Linux- Sockets and signals.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...Inter-process communication in Linux- Sockets and signals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md b/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md index 40f64a2f5a..3d306d35af 100644 --- a/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md +++ b/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (FSSlc) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1978a1f7cab6eec587b7b069957c3ae2d8e021ea Mon Sep 17 00:00:00 2001 From: bodhix Date: Sun, 12 May 2019 16:54:37 +0800 Subject: [PATCH 0380/1154] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190501 Looking into Linux modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190501 Looking into Linux modules.md b/sources/tech/20190501 Looking into Linux modules.md index eb3125c19b..cb431874d3 100644 --- a/sources/tech/20190501 Looking into Linux modules.md +++ b/sources/tech/20190501 Looking into Linux modules.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (bodhix) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f0395369072ee350e0691d042a1aed2e301240e6 Mon Sep 17 00:00:00 2001 From: cycoe Date: Sun, 12 May 2019 19:40:40 +0800 Subject: [PATCH 0381/1154] Translating by Cycoe --- .../tech/20171215 How to add a player to your Python game.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171215 How to add a player to your Python game.md b/sources/tech/20171215 How to add a player to your Python game.md index caa1e4754e..d4e0094384 100644 --- a/sources/tech/20171215 How to add a player to your Python game.md +++ b/sources/tech/20171215 How to add a player to your Python game.md @@ -1,3 +1,5 @@ +Translating by Cycoe +Cycoe 翻译中 [#]: collector: (lujun9972) [#]: translator: ( ) [#]: reviewer: ( ) From f2329aefce3987c867a258afe040a7dbb2191852 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 12 May 2019 22:16:30 +0800 Subject: [PATCH 0382/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cial media sentiment analysis in Python.md | 117 ------------------ ...cial media sentiment analysis in Python.md | 115 +++++++++++++++++ 2 files changed, 115 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20190419 Getting started with social media sentiment analysis in Python.md create mode 100644 translated/tech/20190419 Getting started with social media sentiment analysis in Python.md diff --git a/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md b/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md deleted file mode 100644 index 8d426a5af3..0000000000 --- a/sources/tech/20190419 Getting started with social media sentiment analysis in Python.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with social media sentiment analysis in Python) -[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python) -[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) - -Getting started with social media sentiment analysis in Python -====== -Learn the basics of natural language processing and explore two useful -Python packages. -![Raspberry Pi and Python][1] - -Natural language processing (NLP) is a type of machine learning that addresses the correlation between spoken/written languages and computer-aided analysis of those languages. We experience numerous innovations from NLP in our daily lives, from writing assistance and suggestions to real-time speech translation and interpretation. - -This article examines one specific area of NLP: sentiment analysis, with an emphasis on determining the positive, negative, or neutral nature of the input language. This part will explain the background behind NLP and sentiment analysis and explore two open source Python packages. [Part 2][2] will demonstrate how to begin building your own scalable sentiment analysis services. - -When learning sentiment analysis, it is helpful to have an understanding of NLP in general. This article won't dig into the mathematical guts, rather our goal is to clarify key concepts in NLP that are crucial to incorporating these methods into your solutions in practical ways. - -### Natural language and text data - -A reasonable place to begin is defining: "What is natural language?" It is the means by which we, as humans, communicate with one another. The primary modalities for communication are verbal and text. We can take this a step further and focus solely on text communication; after all, living in an age of pervasive Siri, Alexa, etc., we know speech is a group of computations away from text. - -### Data landscape and challenges - -Limiting ourselves to textual data, what can we say about language and text? First, language, particularly English, is fraught with exceptions to rules, plurality of meanings, and contextual differences that can confuse even a human interpreter, let alone a computational one. In elementary school, we learn articles of speech and punctuation, and from speaking our native language, we acquire intuition about which words have less significance when searching for meaning. Examples of the latter would be articles of speech such as "a," "the," and "or," which in NLP are referred to as _stop words_ , since traditionally an NLP algorithm's search for meaning stops when reaching one of these words in a sequence. - -Since our goal is to automate the classification of text as belonging to a sentiment class, we need a way to work with text data in a computational fashion. Therefore, we must consider how to represent text data to a machine. As we know, the rules for utilizing and interpreting language are complicated, and the size and structure of input text can vary greatly. We'll need to transform the text data into numeric data, the form of choice for machines and math. This transformation falls under the area of _feature extraction_. - -Upon extracting numeric representations of input text data, one refinement might be, given an input body of text, to determine a set of quantitative statistics for the articles of speech listed above and perhaps classify documents based on them. For example, a glut of adverbs might make a copywriter bristle, or excessive use of stop words might be helpful in identifying term papers with content padding. Admittedly, this may not have much bearing on our goal of sentiment analysis. - -### Bag of words - -When you assess a text statement as positive or negative, what are some contextual clues you use to assess its polarity (i.e., whether the text has positive, negative, or neutral sentiment)? One way is connotative adjectives: something called "disgusting" is viewed as negative, but if the same thing were called "beautiful," you would judge it as positive. Colloquialisms, by definition, give a sense of familiarity and often positivity, whereas curse words could be a sign of hostility. Text data can also include emojis, which carry inherent sentiments. - -Understanding the polarity influence of individual words provides a basis for the [_bag-of-words_][3] (BoW) model of text. It considers a set of words or vocabulary and extracts measures about the presence of those words in the input text. The vocabulary is formed by considering text where the polarity is known, referred to as _labeled training data_. Features are extracted from this set of labeled data, then the relationships between the features are analyzed and labels are associated with the data. - -The name "bag of words" illustrates what it utilizes: namely, individual words without consideration of spatial locality or context. A vocabulary typically is built from all words appearing in the training set, which tends to be pruned afterward. Stop words, if not cleaned prior to training, are removed due to their high frequency and low contextual utility. Rarely used words can also be removed, given the lack of information they provide for general input cases. - -It is important to note, however, that you can (and should) go further and consider the appearance of words beyond their use in an individual instance of training data, or what is called [_term frequency_][4] (TF). You should also consider the counts of a word through all instances of input data; typically the infrequency of words among all documents is notable, which is called the [_inverse document frequency_][5] (IDF). These metrics are bound to be mentioned in other articles and software packages on this subject, so having an awareness of them can only help. - -BoW is useful in a number of document classification applications; however, in the case of sentiment analysis, things can be gamed when the lack of contextual awareness is leveraged. Consider the following sentences: - - * We are not enjoying this war. - * I loathe rainy days, good thing today is sunny. - * This is not a matter of life and death. - - - -The sentiment of these phrases is questionable for human interpreters, and by strictly focusing on instances of individual vocabulary words, it's difficult for a machine interpreter as well. - -Groupings of words, called _n-grams_ , can also be considered in NLP. A bigram considers groups of two adjacent words instead of (or in addition to) the single BoW. This should alleviate situations such as "not enjoying" above, but it will remain open to gaming due to its loss of contextual awareness. Furthermore, in the second sentence above, the sentiment context of the second half of the sentence could be perceived as negating the first half. Thus, spatial locality of contextual clues also can be lost in this approach. Complicating matters from a pragmatic perspective is the sparsity of features extracted from a given input text. For a thorough and large vocabulary, a count is maintained for each word, which can be considered an integer vector. Most documents will have a large number of zero counts in their vectors, which adds unnecessary space and time complexity to operations. While a number of clever approaches have been proposed for reducing this complexity, it remains an issue. - -### Word embeddings - -Word embeddings are a distributed representation that allows words with a similar meaning to have a similar representation. This is based on using a real-valued vector to represent words in connection with the company they keep, as it were. The focus is on the manner that words are used, as opposed to simply their existence. In addition, a huge pragmatic benefit of word embeddings is their focus on dense vectors; by moving away from a word-counting model with commensurate amounts of zero-valued vector elements, word embeddings provide a more efficient computational paradigm with respect to both time and storage. - -Following are two prominent word embedding approaches. - -#### Word2vec - -The first of these word embeddings, [Word2vec][6], was developed at Google. You'll probably see this embedding method mentioned as you go deeper in your study of NLP and sentiment analysis. It utilizes either a _continuous bag of words_ (CBOW) or a _continuous skip-gram_ model. In CBOW, a word's context is learned during training based on the words surrounding it. Continuous skip-gram learns the words that tend to surround a given word. Although this is more than what you'll probably need to tackle, if you're ever faced with having to generate your own word embeddings, the author of Word2vec advocates the CBOW method for speed and assessment of frequent words, while the skip-gram approach is better suited for embeddings where rare words are more important. - -#### GloVe - -The second word embedding, [_Global Vectors for Word Representation_][7] (GloVe), was developed at Stanford. It's an extension to the Word2vec method that attempts to combine the information gained through classical global text statistical feature extraction with the local contextual information determined by Word2vec. In practice, GloVe has outperformed Word2vec for some applications, while falling short of Word2vec's performance in others. Ultimately, the targeted dataset for your word embedding will dictate which method is optimal; as such, it's good to know the existence and high-level mechanics of each, as you'll likely come across them. - -#### Creating and using word embeddings - -Finally, it's useful to know how to obtain word embeddings; in part 2, you'll see that we are standing on the shoulders of giants, as it were, by leveraging the substantial work of others in the community. This is one method of acquiring a word embedding: namely, using an existing trained and proven model. Indeed, myriad models exist for English and other languages, and it's possible that one does what your application needs out of the box! - -If not, the opposite end of the spectrum in terms of development effort is training your own standalone model without consideration of your application. In essence, you would acquire substantial amounts of labeled training data and likely use one of the approaches above to train a model. Even then, you are still only at the point of acquiring understanding of your input-text data; you then need to develop a model specific for your application (e.g., analyzing sentiment valence in software version-control messages) which, in turn, requires its own time and effort. - -You also could train a word embedding on data specific to your application; while this could reduce time and effort, the word embedding would be application-specific, which would reduce reusability. - -### Available tooling options - -You may wonder how you'll ever get to a point of having a solution for your problem, given the intensive time and computing power needed. Indeed, the complexities of developing solid models can be daunting; however, there is good news: there are already many proven models, tools, and software libraries available that may provide much of what you need. We will focus on [Python][8], which conveniently has a plethora of tooling in place for these applications. - -#### SpaCy - -[SpaCy][9] provides a number of language models for parsing input text data and extracting features. It is highly optimized and touted as the fastest library of its kind. Best of all, it's open source! SpaCy performs tokenization, parts-of-speech classification, and dependency annotation. It contains word embedding models for performing this and other feature extraction operations for over 46 languages. You will see how it can be used for text analysis and feature extraction in the second article in this series. - -#### vaderSentiment - -The [vaderSentiment][10] package provides a measure of positive, negative, and neutral sentiment. As the [original paper][11]'s title ("VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Media Text") indicates, the models were developed and tuned specifically for social media text data. VADER was trained on a thorough set of human-labeled data, which included common emoticons, UTF-8 encoded emojis, and colloquial terms and abbreviations (e.g., meh, lol, sux). - -For given input text data, vaderSentiment returns a 3-tuple of polarity score percentages. It also provides a single scoring measure, referred to as _vaderSentiment's compound metric_. This is a real-valued measurement within the range **[-1, 1]** wherein sentiment is considered positive for values greater than **0.05** , negative for values less than **-0.05** , and neutral otherwise. - -In [part 2][2], you will learn how to use these tools to add sentiment analysis capabilities to your designs. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python - -作者:[Michael McCune ][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/elmiko/users/jschlessman -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) -[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-2 -[3]: https://en.wikipedia.org/wiki/Bag-of-words_model -[4]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Term_frequency -[5]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Inverse_document_frequency -[6]: https://en.wikipedia.org/wiki/Word2vec -[7]: https://en.wikipedia.org/wiki/GloVe_(machine_learning) -[8]: https://www.python.org/ -[9]: https://pypi.org/project/spacy/ -[10]: https://pypi.org/project/vaderSentiment/ -[11]: http://comp.social.gatech.edu/papers/icwsm14.vader.hutto.pdf diff --git a/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md b/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md new file mode 100644 index 0000000000..77e0ab54b4 --- /dev/null +++ b/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with social media sentiment analysis in Python) +[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python) +[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) + +使用 Python 进行社交媒体情感分析入门 +====== +学习自然语言处理的基础知识并探索两个有用的 Python 包。 +![Raspberry Pi and Python][1] + +自然语言处理(NLP)是机器学习的一种,它解决了口语或书面语言和计算机辅助分析这些语言之间的相关性。日常生活中我们经历了无数的 NLP 创新,从写作帮助和建议到实时语音翻译,还有口译。 + +本文研究了 NLP 的一个特定领域:情感分析。重点是确定输入语言的积极、消极或中性性质。本部分将解释 NLP 和情感分析的背景,并探讨两个开源的 Python 包。[第 2 部分][2]将演示如何开始构建自己的可扩展情感分析服务。 + +在学习情感分析时,对 NLP 有一个大体了解是有帮助的。本文不会深入研究数学本质。相反,我们的目标是阐明 NLP 中的关键概念,这些概念对于将这些方法实际结合到你的解决方案中至关重要。 + +### 自然语言和文本数据 + +合理的起点是从定义开始:“什么是自然语言?”它是我们人类相互交流的方式,沟通的主要方式是口语和文字。我们可以更进一步,只关注文本交流。毕竟,生活在 Siri, Alexa 等无处不在的时代,我们知道语音是一组与文本无关的计算。 + +### 数据前景和挑战 + +我们只考虑使用文本数据,我们可以对语言和文本做什么呢?首先是语言,特别是英语,除了规则还有很多例外,含义的多样性和语境差异,这些都可能使人类口译员感到困惑,更不用说计算机翻译了。在小学,我们学习文章和标点符号,通过讲母语,我们获得了寻找直觉上表示唯一意义的词的能力。比如,出现诸如 "a"、"the" 和 "or" 之类的文章,它们在 NLP 中被称为 _停用词_,因为传统上 NLP 算法是在一个序列中找到这些词时意味着搜索停止。 + +由于我们的目标是自动将文本分类为情感类,因此我们需要一种以计算方式处理文本数据的方法。因此,我们必须考虑如何向机器表示文本数据。众所周知,利用和解释语言的规则很复杂,输入文本的大小和结构可能会有很大差异。我们需要将文本数据转换为数字数据,这是机器和数学的首选方式。这种转变属于 _特征提取_ 的范畴。 + +在提取输入文本数据的数字表示形式后,一个改进可能是:给定一个文本输入体,为上面列出的文章确定一组向量统计数据,并根据这些数据对文档进行分类。例如,过多的副词可能会使撰稿人感到愤怒,或者过度使用停用词可能有助于识别带有内容填充的学期论文。诚然,这可能与我们情感分析的目标没有太大关系。 + +### 词袋 + +当你评估一个文本陈述是积极还是消极的时候,你使用哪些上下文来评估它的极性?(例如,文本中是否具有积极的、消极的或中性的情感)一种方式是隐含形容词:被称为 "disgusting" 的东西被认为是消极的,但如果同样的东西被称为 "beautiful",你会认为它是积极的。从定义上讲,俗语给人一种熟悉感,通常是积极的,而脏话可能是敌意的表现。文本数据也可以包括表情符号,它带有固定的情感。 + +理解单个单词的极性影响为文本的[_词袋_][3](BoW) 模型提供了基础。它考虑一组单词或词汇表,并提取关于这些单词在输入文本中是否存在的度量。词汇表是通过考虑极性已知的文本形成的,称为 _标记的训练数据_。从这组标记数据中提取特征,然后分析特征之间的关系,并将标签与数据关联起来。 + +“词袋”这个名称说明了它的用途:即不考虑空间位置或上下文的的单个词。词汇表通常是由训练集中出现的所有单词构建的,在训练结束后被删除。如果在训练之前没有清理停用词,那么停用词会因为其高频率和低语境而被移除。很少使用的单词也可以删除,因为一般情况下它们提供了缺失的信息。 + +但是,重要的是要注意,你可以(并且应该)进一步考虑单词在单独的训练数据实例中使用之外的外观,称为[_词频_][4] (TF)。你还应该考虑输入数据的所有实例中的单词计数,通常,所有文档中的单词频率显著,这被称为[_逆文本频率指数_][5](IDF)。这些指标一定会在本主题的其他文章和软件包中提及,因此了解它们会有所帮助。 + +词袋在许多文档分类应用程序中很有用。然而,在情感分析中,当缺乏情境意识的问题被利用时,事情就可以解决。考虑以下句子: + + * 我们不喜欢这场战争。 + * 我讨厌下雨天,好事是今天是晴天。 + * 这不是生死攸关的问题。 + + +这些短语的情感对于人类口译员来说是有难度的,而且由于严格关注单个词汇的实例,对于机器翻译来说也是困难的。 + +在 NLP 中也可以考虑称为 _n-grams_ 的单词分组。一个二元组考虑两个相邻单词组成的组而不是(或除了)单个词袋。这应该可以缓解诸如上述“不喜欢”之类的情况,但由于缺乏语境意思,它仍然是个问题。此外,在上面的第二句中,下半句的情感语境可以被理解为否定前半部分。因此,这种方法中也会丢失上下文线索的空间局部性。从实用角度来看,使问题复杂化的是从给定输入文本中提取的特征的稀疏性。对于一个完整的大型词汇表,每个单词都有一个计数,可以将其视为一个整数向量。大多数文档的向量中都有大量的零计数,这给操作增加了不必要的空间和时间复杂度。虽然已经提出了许多用于降低这种复杂性的简便方法,但它仍然是一个问题。 + +### 词嵌入 + +词嵌入是一种分布式表示,它允许具有相似含义的单词具有相似的表示。这是基于使用实值向量来与它们周围相关联。重点在于使用单词的方式,而不仅仅是它们的存在。此外,词嵌入的一个巨大语用优势是它们对密集向量的关注。通过摆脱具有相应数量的零值向量元素的单词计数模型,词嵌入在时间和存储方面提供了一个更有效的计算范例。 + +以下是两个优秀的词嵌入方法。 + +#### Word2vec + +第一个是 [Word2vec][6],它是由 Google 开发的。随着你对 NLP 和情绪分析研究的深入,你可能会看到这种嵌入方法。它要么使用一个 _连续的词袋_(CBOW),要么使用一个 _连续的 skip-gram_ 模型。在 CBOW 中,一个单词的上下文是在训练中根据围绕它的单词来学习的。连续的 skip-gram 学习倾向于围绕给定的单词学习单词。虽然这可能超出了你需要解决的问题,但是如果你曾经面对必须生成自己的词嵌入情况,那么 Word2vec 的作者提倡使用 CBOW 方法来提高速度并评估频繁的单词,而 skip-gram 方法更适合嵌入稀有单词更重要的嵌入。 + +#### GloVe + +第二个是 [ _Global Vectors for Word Representation_][7(GloVe),它是斯坦福大学开发的。它是 Word2vec 方法的扩展,它试图将通过经典的全局文本统计特征提取获得的信息与 Word2vec 确定的本地上下文信息相结合。实际上,在一些应用程序中,GloVe 性能优于 Word2vec,而在另一些应用程序中则不如 Word2vec。最终,用于词嵌入的目标数据集将决定哪种方法最优。因此,最好了解它们的存在性和高级机制,因为你很可能会遇到它们。 + +#### 创建和使用词嵌入 + +最后,知道如何获得词嵌入是有用的。在第 2 部分中,你将看到我们通过利用社区中其他人的实质性工作,可以说我们是站在了巨人的肩膀上。这是获取词嵌入的一种方法:即使用现有的经过训练和验证的模型。实际上,有无数的模型适用于英语和其他语言,一定会有一种模型可以满足你的应用程序,让你开箱即用! + +如果没有的话,就开发工作而言,另一个极端是培训你自己的独立模型,而不考虑你的应用程序。实质上,你将获得大量标记的训练数据,并可能使用上述方法之一来训练模型。即使这样,你仍然只是在获取对输入文本数据的理解。然后,你需要为你应用程序开发一个特定的模型(例如,分析软件版本控制消息中的情感价值),这反过来又需要自己的时间和精力。 + +你还可以为你的应用程序数据训练一个词嵌入,虽然这可以减少时间和精力,但这个词嵌入将是特定于应用程序的,这将会降低它的可重用性。 + +### 可用的工具选项 + +考虑到所需的大量时间和计算能力,你可能想知道如何才能找到解决问题的方法。的确,开发可靠模型的复杂性可能令人望而生畏。但是,有一个好消息:已经有许多经过验证的模型、工具和软件库可以为我们提供所需的大部分内容。我们将重点关注 [Python][8],因为它为这些应用程序提供了大量方便的工具。 + +#### SpaCy + +[SpaCy][9] 提供了许多用于解析输入文本数据和提取特征的语言模型。它经过了高度优化,并被誉为同类中最快的库。最棒的是,它是开源的!SpaCy 会执行标识化、词性分类和依赖项注释。它包含了用于执行此功能的词嵌入模型,还有用于为超过 46 种语言的其他特征提取操作。在本系列的第二篇文章中,你将看到它如何用于文本分析和特征提取。 + +#### vaderSentiment + +[vaderSentiment][10] 包提供了积极、消极和中性情绪的衡量标准。正如 [original paper][11] 的标题(“VADER:一个基于规则的社交媒体文本情感分析模型”)所示,这些模型是专门为社交媒体文本数据开发和调整的。VADER 接受了一组完整的人类标记数据的训练,包括常见的表情符号、UTF-8 编码的表情符号以及口语术语和缩写(例如 meh、lol、sux)。 + +对于给定的输入文本数据,vaderSentiment 返回一个极性分数百分比的三元组。它还提供了一个单个的评分标准,称为 _vaderSentiment 复合指标_。这是一个在 **[-1, 1]** 范围内的实值,其中对于分值大于 **0.05** 的情绪被认为是积极的,对于分值小于 **-0.05** 的被认为是消极的,否则为中性。 + +在[第 2 部分][2]中,你将学习如何使用这些工具为你的设计添加情感分析功能。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python + +作者:[Michael McCune ][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/elmiko/users/jschlessman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) +[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-2 +[3]: https://en.wikipedia.org/wiki/Bag-of-words_model +[4]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Term_frequency +[5]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Inverse_document_frequency +[6]: https://en.wikipedia.org/wiki/Word2vec +[7]: https://en.wikipedia.org/wiki/GloVe_(machine_learning) +[8]: https://www.python.org/ +[9]: https://pypi.org/project/spacy/ +[10]: https://pypi.org/project/vaderSentiment/ +[11]: http://comp.social.gatech.edu/papers/icwsm14.vader.hutto.pdf From 2759846ed3d7d40b8be025b806337a26f96a9b8c Mon Sep 17 00:00:00 2001 From: cycoe Date: Sun, 12 May 2019 22:49:32 +0800 Subject: [PATCH 0383/1154] translated by cycoe --- ...How to add a player to your Python game.md | 164 ------------------ ...How to add a player to your Python game.md | 162 +++++++++++++++++ 2 files changed, 162 insertions(+), 164 deletions(-) delete mode 100644 sources/tech/20171215 How to add a player to your Python game.md create mode 100644 translated/tech/20171215 How to add a player to your Python game.md diff --git a/sources/tech/20171215 How to add a player to your Python game.md b/sources/tech/20171215 How to add a player to your Python game.md deleted file mode 100644 index d4e0094384..0000000000 --- a/sources/tech/20171215 How to add a player to your Python game.md +++ /dev/null @@ -1,164 +0,0 @@ -Translating by Cycoe -Cycoe 翻译中 -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to add a player to your Python game) -[#]: via: (https://opensource.com/article/17/12/game-python-add-a-player) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -How to add a player to your Python game -====== -Part three of a series on building a game from scratch with Python. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python3-game.png?itok=jG9UdwC3) - -In the [first article of this series][1], I explained how to use Python to create a simple, text-based dice game. In the second part, I showed you how to build a game from scratch, starting with [creating the game's environment][2]. But every game needs a player, and every player needs a playable character, so that's what we'll do next in the third part of the series. - -In Pygame, the icon or avatar that a player controls is called a sprite. If you don't have any graphics to use for a player sprite yet, create something for yourself using [Krita][3] or [Inkscape][4]. If you lack confidence in your artistic skills, you can also search [OpenClipArt.org][5] or [OpenGameArt.org][6] for something pre-generated. Then, if you didn't already do so in the previous article, create a directory called `images` alongside your Python project directory. Put the images you want to use in your game into the `images` folder. - -To make your game truly exciting, you ought to use an animated sprite for your hero. It means you have to draw more assets, but it makes a big difference. The most common animation is a walk cycle, a series of drawings that make it look like your sprite is walking. The quick and dirty version of a walk cycle requires four drawings. - -![](https://opensource.com/sites/default/files/u128651/walk-cycle-poses.jpg) - -Note: The code samples in this article allow for both a static player sprite and an animated one. - -Name your player sprite `hero.png`. If you're creating an animated sprite, append a digit after the name, starting with `hero1.png`. - -### Create a Python class - -In Python, when you create an object that you want to appear on screen, you create a class. - -Near the top of your Python script, add the code to create a player. In the code sample below, the first three lines are already in the Python script that you're working on: - -``` -import pygame -import sys -import os # new code below - -class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.images = [] -    img = pygame.image.load(os.path.join('images','hero.png')).convert() -    self.images.append(img) -    self.image = self.images[0] -    self.rect  = self.image.get_rect() -``` - -If you have a walk cycle for your playable character, save each drawing as an individual file called `hero1.png` to `hero4.png` in the `images` folder. - -Use a loop to tell Python to cycle through each file. - -``` -''' -Objects -''' - -class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.images = [] -        for i in range(1,5): -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            self.images.append(img) -            self.image = self.images[0] -            self.rect  = self.image.get_rect() -``` - -### Bring the player into the game world - -Now that a Player class exists, you must use it to spawn a player sprite in your game world. If you never call on the Player class, it never runs, and there will be no player. You can test this out by running your game now. The game will run just as well as it did at the end of the previous article, with the exact same results: an empty game world. - -To bring a player sprite into your world, you must call the Player class to generate a sprite and then add it to a Pygame sprite group. In this code sample, the first three lines are existing code, so add the lines afterwards: - -``` -world       = pygame.display.set_mode([worldx,worldy]) -backdrop    = pygame.image.load(os.path.join('images','stage.png')).convert() -backdropbox = screen.get_rect() - -# new code below - -player = Player()   # spawn player -player.rect.x = 0   # go to x -player.rect.y = 0   # go to y -player_list = pygame.sprite.Group() -player_list.add(player) -``` - -Try launching your game to see what happens. Warning: it won't do what you expect. When you launch your project, the player sprite doesn't spawn. Actually, it spawns, but only for a millisecond. How do you fix something that only happens for a millisecond? You might recall from the previous article that you need to add something to the main loop. To make the player spawn for longer than a millisecond, tell Python to draw it once per loop. - -Change the bottom clause of your loop to look like this: - -``` -    world.blit(backdrop, backdropbox) -    player_list.draw(screen) # draw player -    pygame.display.flip() -    clock.tick(fps) -``` - -Launch your game now. Your player spawns! - -### Setting the alpha channel - -Depending on how you created your player sprite, it may have a colored block around it. What you are seeing is the space that ought to be occupied by an alpha channel. It's meant to be the "color" of invisibility, but Python doesn't know to make it invisible yet. What you are seeing, then, is the space within the bounding box (or "hit box," in modern gaming terms) around the sprite. - -![](https://opensource.com/sites/default/files/u128651/greenscreen.jpg) - -You can tell Python what color to make invisible by setting an alpha channel and using RGB values. If you don't know the RGB values your drawing uses as alpha, open your drawing in Krita or Inkscape and fill the empty space around your drawing with a unique color, like #00ff00 (more or less a "greenscreen green"). Take note of the color's hex value (#00ff00, for greenscreen green) and use that in your Python script as the alpha channel. - -Using alpha requires the addition of two lines in your Sprite creation code. Some version of the first line is already in your code. Add the other two lines: - -``` -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            img.convert_alpha()     # optimise alpha -            img.set_colorkey(ALPHA) # set alpha -``` - -Python doesn't know what to use as alpha unless you tell it. In the setup area of your code, add some more color definitions. Add this variable definition anywhere in your setup section: - -``` -ALPHA = (0, 255, 0) -``` - -In this example code, **0,255,0** is used, which is the same value in RGB as #00ff00 is in hex. You can get all of these color values from a good graphics application like [GIMP][7], Krita, or Inkscape. Alternately, you can also detect color values with a good system-wide color chooser, like [KColorChooser][8]. - -![](https://opensource.com/sites/default/files/u128651/kcolor.png) - -If your graphics application is rendering your sprite's background as some other value, adjust the values of your alpha variable as needed. No matter what you set your alpha value, it will be made "invisible." RGB values are very strict, so if you need to use 000 for alpha, but you need 000 for the black lines of your drawing, just change the lines of your drawing to 111, which is close enough to black that nobody but a computer can tell the difference. - -Launch your game to see the results. - -![](https://opensource.com/sites/default/files/u128651/alpha.jpg) - -In the [fourth part of this series][9], I'll show you how to make your sprite move. How exciting! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/12/game-python-add-a-player - -作者:[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/article/17/10/python-101 -[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world -[3]: http://krita.org -[4]: http://inkscape.org -[5]: http://openclipart.org -[6]: https://opengameart.org/ -[7]: http://gimp.org -[8]: https://github.com/KDE/kcolorchooser -[9]: https://opensource.com/article/17/12/program-game-python-part-4-moving-your-sprite diff --git a/translated/tech/20171215 How to add a player to your Python game.md b/translated/tech/20171215 How to add a player to your Python game.md new file mode 100644 index 0000000000..fc9ce00303 --- /dev/null +++ b/translated/tech/20171215 How to add a player to your Python game.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to add a player to your Python game) +[#]: via: (https://opensource.com/article/17/12/game-python-add-a-player) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +如何在你的 Python 游戏中添加一个玩家 +====== +用 Python 从头开始构建游戏的系列文章的第三部分。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python3-game.png?itok=jG9UdwC3) + +在 [这个系列的第一篇文章][1] 中,我解释了如何使用 Python 创建一个简单的基于文本的骰子游戏。在第二部分中,我向你们展示了如何从头开始构建游戏,即从 [创建游戏的环境][2] 开始。但是每个游戏都需要一名玩家,并且每个玩家都需要一个可操控的角色,这也就是我们接下来要在这个系列的第三部分中需要做的。 + +在 Pygame 中,玩家操控的图标或者化身被称作妖精。如果你现在还没有任何图像可用于玩家妖精,你可以使用 [Krita][3] 或 [Inkscape][4] 来自己创建一些图像。如果你对自己的艺术细胞缺乏自信,你也可以在 [OpenClipArt.org][5] 或 [OpenGameArt.org][6] 搜索一些现成的图像。如果你还未按照上一篇文章所说的单独创建一个 images 文件夹,那么你需要在你的 Python 项目目录中创建它。将你想要在游戏中使用的图片都放 images 文件夹中。 + +为了使你的游戏真正的刺激,你应该为你的英雄使用一张动态的妖精图片。这意味着你需要绘制更多的素材,并且它们要大不相同。最常见的动画就是走路循环,通过一系列的图像让你的妖精看起来像是在走路。走路循环最快捷粗糙的版本需要四张图像。 + +![](https://opensource.com/sites/default/files/u128651/walk-cycle-poses.jpg) + +注意:这篇文章中的代码示例同时兼容静止的和动态的玩家妖精。 + +将你的玩家妖精命名为 `hero.png`。如果你正在创建一个动态的妖精,则需要在名字后面加上一个数字,从 `hero1.png` 开始。 + +### 创建一个 Python 类 + +在 Python 中,当你在创建一个你想要显示在屏幕上的对象时,你需要创建一个类。 + +在你的 Python 脚本靠近顶端的位置,加入如下代码来创建一个玩家。在以下的代码示例中,前三行已经在你正在处理的 Python 脚本中: + +``` +import pygame +import sys +import os # 以下是新代码 + +class Player(pygame.sprite.Sprite): +    ''' +    生成一个玩家 +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.images = [] +    img = pygame.image.load(os.path.join('images','hero.png')).convert() +    self.images.append(img) +    self.image = self.images[0] +    self.rect  = self.image.get_rect() +``` + +如果你的可操控角色拥有一个走路循环,在 `images` 文件夹中将对应图片保存为 `hero1.png` 到 `hero4.png` 的独立文件。 + +使用一个循环来告诉 Python 遍历每个文件。 + +``` +''' +对象 +''' + +class Player(pygame.sprite.Sprite): +    ''' +    生成一个玩家 +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.images = [] +        for i in range(1,5): +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            self.images.append(img) +            self.image = self.images[0] +            self.rect  = self.image.get_rect() +``` + +### 将玩家带入游戏世界 + +现在一个 Player 类已经创建好了,你需要使用它在你的游戏世界中生成一个玩家妖精。如果你不调用 Player 类,那它永远不会起作用,(游戏世界中)也就不会有玩家。你可以通过立马运行你的游戏来验证一下。游戏会像上一篇文章末尾看到的那样运行,并得到明确的结果:一个空荡荡的游戏世界。 + +为了将一个玩家妖精带到你的游戏世界,你必须通过调用 Player 类来生成一个妖精,并将它加入到 Pygame 的妖精组中。在如下的代码示例中,前三行是已经存在的代码,你需要在其后添加代码: + +``` +world       = pygame.display.set_mode([worldx,worldy]) +backdrop    = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = screen.get_rect() + +# 以下是新代码 + +player = Player()   # 生成玩家 +player.rect.x = 0   # 移动 x 坐标 +player.rect.y = 0   # 移动 y 坐标 +player_list = pygame.sprite.Group() +player_list.add(player) +``` + +尝试启动你的游戏来看看发生了什么。高能预警:它不会像你预期的那样工作,当你启动你的项目,玩家妖精没有出现。事实上它生成了,只不过只出现了一毫秒。你要如何修复一个只出现了一毫秒的东西呢?你可能回想起上一篇文章中,你需要在主循环中添加一些东西。为了使玩家的存在时间超过一毫秒,你需要告诉 Python 在每次循环中都绘制一次。 + +将你的循环底部的语句更改如下: + +``` +    world.blit(backdrop, backdropbox) +    player_list.draw(screen) # 绘制玩家 +    pygame.display.flip() +    clock.tick(fps) +``` + +现在启动你的游戏,你的玩家出现了! + +### 设置 alpha 通道 + +根据你如何创建你的玩家妖精,在它周围可能会有一个色块。你所看到的是 alpha 通道应该占据的空间。它本来是不可见的“颜色”,但 Python 现在还不知道要使它不可见。那么你所看到的,是围绕在妖精周围的边界区(或现代游戏术语中的“命中区”)内的空间。 + +![](https://opensource.com/sites/default/files/u128651/greenscreen.jpg) + +你可以通过设置一个 alpha 通道和 RGB 值来告诉 Python 使哪种颜色不可见。如果你不知道你使用 alpha 通道的图像的 RGB 值,你可以使用 Krita 或 Inkscape 打开它,并使用一种独特的颜色,比如 #00ff00(差不多是“绿屏绿”)来填充图像周围的空白区域。记下颜色对应的十六进制值(此处为 #00ff00,绿屏绿)并将其作为 alpha 通道用于你的 Python 脚本。 + +使用 alpha 通道需要在你的妖精生成相关代码中添加如下两行。类似第一行的代码已经存在于你的脚本中,你只需要添加另外两行: + +``` +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            img.convert_alpha()     # 优化 alpha +            img.set_colorkey(ALPHA) # 设置 alpha +``` + +除非你告诉它,否则 Python 不知道将哪种颜色作为 alpha 通道。在你代码的设置相关区域,添加一些颜色定义。将如下的变量定义添加于你的设置相关区域的任意位置: + +``` +ALPHA = (0, 255, 0) +``` + +在以上示例代码中,**0,255,0** 被我们使用,它在 RGB 中所代表的值与 #00ff00 在十六进制中所代表的值相同。你可以通过一个优秀的图像应用程序,如 [GIMP][7]、Krita 或 Inkscape,来获取所有这些颜色值。或者,你可以使用一个优秀的系统级颜色选择器,如 [KColorChooser][8],来检测颜色。 + +![](https://opensource.com/sites/default/files/u128651/kcolor.png) + +如果你的图像应用程序将你的妖精背景渲染成了其他的值,你可以按需调整 ``ALPHA`` 变量的值。不论你将 alpha 设为多少,最后它都将“不可见”。RGB 颜色值是非常严格的,因此如果你需要将 alpha 设为 000,但你又想将 000 用于你图像中的黑线,你只需要将图像中线的颜色设为 111。这样一来,(图像中的黑线)就足够接近黑色,但除了电脑以外没有人能看出区别。 + +运行你的游戏查看结果。 + +![](https://opensource.com/sites/default/files/u128651/alpha.jpg) + +在 [这个系列的第四篇文章][9] 中,我会向你们展示如何使你的妖精动起来。多么的激动人心啊! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/12/game-python-add-a-player + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[校对者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/article/17/10/python-101 +[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world +[3]: http://krita.org +[4]: http://inkscape.org +[5]: http://openclipart.org +[6]: https://opengameart.org/ +[7]: http://gimp.org +[8]: https://github.com/KDE/kcolorchooser +[9]: https://opensource.com/article/17/12/program-game-python-part-4-moving-your-sprite From 3156abc2037ee613e31c9abc3bc66fed075e7c80 Mon Sep 17 00:00:00 2001 From: cycoe Date: Sun, 12 May 2019 22:52:15 +0800 Subject: [PATCH 0384/1154] add cycoe to translator --- .../tech/20171215 How to add a player to your Python game.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20171215 How to add a player to your Python game.md b/translated/tech/20171215 How to add a player to your Python game.md index fc9ce00303..c46d4a5826 100644 --- a/translated/tech/20171215 How to add a player to your Python game.md +++ b/translated/tech/20171215 How to add a player to your Python game.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cycoe) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0b57b767e3231da4e8ccab87db9d2b75f1a98199 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 12 May 2019 22:49:28 +0800 Subject: [PATCH 0385/1154] Translating by MjSeven --- sources/tech/20190505 How To Create SSH Alias In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190505 How To Create SSH Alias In Linux.md b/sources/tech/20190505 How To Create SSH Alias In Linux.md index 3ea1a77b7a..d353ce40f1 100644 --- a/sources/tech/20190505 How To Create SSH Alias In Linux.md +++ b/sources/tech/20190505 How To Create SSH Alias In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -189,7 +189,7 @@ via: https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/ 作者:[sk][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MjSeven](https://github.com/MjSeven) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 404244d51d695fe888d8897750452829ed1b0b27 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 23:17:53 +0800 Subject: [PATCH 0386/1154] PRF:20190505 Kindd - A Graphical Frontend To dd Command.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @robsean 文末的 “via:” 无需翻译。 --- ...dd - A Graphical Frontend To dd Command.md | 66 ++++++++----------- 1 file changed, 26 insertions(+), 40 deletions(-) diff --git a/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md index 72e34e2938..dc5d28b6ee 100644 --- a/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md +++ b/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -1,43 +1,41 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Kindd – A Graphical Frontend To dd Command) [#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) [#]: author: (sk https://www.ostechnix.com/author/sk/) -Kindd – 一个图形化 dd 命令前端 +Kindd:一个图形化 dd 命令前端 ====== ![Kindd - A Graphical Frontend To dd Command][1] -前不久,我们已经学习如何在类 Unix 系统中 [**使用 dd 命令创建可启动的 ISO **][2] 。请记住,dd 命令是危险的和破坏性的命令之一。如果你不确定,你实际在做什么,你可能会在几分钟内意外地擦除你的硬盘数据。dd 命令仅仅从 **if** 获取数据,并写入数据到 **of** 。它将不关心它正在覆盖什么,它将不关心是否在磁道上有一个分区表,或一个启动扇区,或者一个 home 文件夹,或者任何重要的东西。它将简单地做它被告诉去做的事。如果你是初学者,一般地尝试避免使用 dd 命令来做原料。幸好,这有一个支持 dd 命令的简单的 GUI 实用程序。向 **“Kindd”** 问好,一个属于 dd 命令的图形化前端。它是自由的,开放源码的用 **Qt Quick** 所写的工具。总的来说,这个工具对那些对命令行不舒适的初学者是非常有用的。 - -开发者创建这个工具主要是为了提供, - - 1. 一个用于 dd 命令的现代的,简单的和安全的图形化用户界面, - 2. 一种图形化的方法来简单地创建可启动设备,而不必使用终端。 +前不久,我们已经学习如何在类 Unix 系统中 [使用 dd 命令创建可启动的 ISO][2]。请记住,`dd` 命令是最具危险性和破坏性的命令之一。如果你不确定你实际在做什么,你可能会在几分钟内意外地擦除你的硬盘数据。`dd` 命令仅仅从 `if` 参数获取数据,并写入数据到 `of` 参数。它将不关心它正在覆盖什么,它也不关心是否在磁道上有一个分区表,或一个启动扇区,或者一个家文件夹,或者任何重要的东西。它将简单地做它被告诉去做的事。如果你是初学者,一般地尝试避免使用 `dd` 命令来做实验。幸好,这有一个支持 `dd` 命令的简单的 GUI 实用程序。向 “Kindd” 问好,一个属于 `dd` 命令的图形化前端。它是自由开源的、用 Qt Quick 所写的工具。总的来说,这个工具对那些对命令行不适应的初学者是非常有用的。 +它的开发者创建这个工具主要是为了提供: +1. 一个用于 `dd` 命令的现代化的、简单而安全的图形化用户界面, +2. 一种简单地创建可启动设备的图形化方法,而不必使用终端。 ### 安装 Kindd -Kindd 在 [**AUR**][3] 中是可用的。所以,如果你是 Arch 用户,使用任一的 AUR helper 工具来安装它tools,例如 [**Yay**][4] 。 +Kindd 在 [AUR][3] 中是可用的。所以,如果你是 Arch 用户,使用任一的 AUR 助手工具来安装它,例如 [Yay][4] 。 -为安装 Git 版本,运行: +要安装其 Git 发布版,运行: ``` $ yay -S kindd-git ``` -为安装发布的版本,运行: +要安装正式发布版,运行: ``` $ yay -S kindd ``` -在安装后,从菜单或应用程序启动器启动 Kindd 。 +在安装后,从菜单或应用程序启动器启动 Kindd。 对于其它的发行版,你需要从源文件手动编译和安装它,像下面所示。 @@ -51,9 +49,7 @@ $ yay -S kindd * qt5-quickcontrols2 * qt5-graphicaleffects - - -一旦所有必要条件安装,git 克隆 Kindd 储存库: +一旦所有必要条件安装,使用 `git` 克隆 Kindd 储存库: ``` git clone https://github.com/LinArcX/Kindd/ @@ -63,9 +59,7 @@ git clone https://github.com/LinArcX/Kindd/ ``` cd Kindd - qmake - make ``` @@ -75,7 +69,7 @@ make ./kindd ``` -Kindd 使用内部的 **pkexec** 。pkexec 代理被默认安装在大多数桌面环境中。但是,如果你使用 **i3** (或者可能一些其它的桌面环境),你应该首先安装 **polkit-gnome** ,然后粘贴下面的行到 i3 配置文件: +Kindd 内部使用 pkexec。pkexec 代理被默认安装在大多数桌面环境中。但是,如果你使用 i3 (或者可能还有一些其它的桌面环境),你应该首先安装 polkit-gnome ,然后粘贴下面的行到 i3 配置文件: ``` exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & @@ -83,17 +77,17 @@ exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & ### 使用 Kindd 创建可启动的 ISO -为从一个 ISO 创建一个可启动的 USB ,插入 USB 驱动器。然后,从菜单或终端启动 Kindd 。 +为从一个 ISO 创建一个可启动的 USB,插入 USB 驱动器。然后,从菜单或终端启动 Kindd 。 这是 Kindd 默认界面的外观: ![][5] -Kindd 界面 +*Kindd 界面* -正如你所能看到的,Kindd 界面是非常简单的和明白易懂的。这里仅有两部分,即 **设备列表** ,它显示你的系统上的可用的设备( hdd 和 Usb ),并**创建可启动的 .iso** 。默认情况下,你将在“创建可启动 .iso”部分。 +正如你所能看到的,Kindd 界面是非常简单的和明白易懂的。这里仅有两部分,即设备列表,它显示你的系统上的可用的设备(hdd 和 Usb),并创建可启动的 .iso 。默认情况下,你将在“创建可启动 .iso”部分。 -在第一列中输入块大小,在第二列中选择 ISO 文件的路径,并在第三列中选择正确的设备( USB 驱动器路径)。单击 **转换/复制** 按钮来开始创建可启动的 ISO 。 +在第一列中输入块大小,在第二列中选择 ISO 文件的路径,并在第三列中选择正确的设备(USB 驱动器路径)。单击“转换/复制”按钮来开始创建可启动的 ISO 。 ![][6] @@ -101,43 +95,35 @@ Kindd 界面 ![][7] -现在,拔出 USB 驱动器,并带有 USB 启动器启动你的系统,来检查它是否真地工作。 +现在,拔出 USB 驱动器,并用该 USB 启动器启动你的系统,来检查它是否真地工作。 -如果你不知道真实的设备名称(目标路径),仅在列出的设备上单击,并检查 USB 驱动器名称。 +如果你不知道真实的设备名称(目标路径),只需要在列出的设备上单击,并检查 USB 驱动器名称。 ![][8] -* * * - -**相关阅读:** - - * [**Etcher – 一个漂亮的来创建可启动 SD 卡或 USB 驱动器的应用程序**][9] - * [**Bootiso 让你安全地创建可启动的 USB 驱动器**][10] - - - -* * * - -Kindd 在早期开发阶段。因此,可能有错误。如果你找到一些错误,请在这篇的指南的结尾所给的 GitHub 页面报告它们。 +Kindd 还处在早期开发阶段。因此,可能有错误。如果你找到一些错误,请在这篇的指南的结尾所给的 GitHub 页面报告它们。 这就是全部。希望这是有用的。更多的好东西将会来。敬请期待! 谢谢! -**资源:** +资源: - * [**Kindd GitHub 储存库**][11] + * [Kindd GitHub 储存库][11] +相关阅读: + * [Etcher:一个来创建可启动 SD 卡或 USB 驱动器的漂亮的应用程序][9] + * [Bootiso 让你安全地创建可启动的 USB 驱动器][10] -------------------------------------------------------------------------------- -通过: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ +via: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ 作者:[sk][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/) 荣誉推出 From 064c5b6d8c38d5112121afb76cda3ed542e18886 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 May 2019 23:19:48 +0800 Subject: [PATCH 0387/1154] PUB:20190505 Kindd - A Graphical Frontend To dd Command.md @robsean https://linux.cn/article-10847-1.html --- .../20190505 Kindd - A Graphical Frontend To dd Command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 Kindd - A Graphical Frontend To dd Command.md (98%) diff --git a/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md b/published/20190505 Kindd - A Graphical Frontend To dd Command.md similarity index 98% rename from translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md rename to published/20190505 Kindd - A Graphical Frontend To dd Command.md index dc5d28b6ee..fbcf447bad 100644 --- a/translated/tech/20190505 Kindd - A Graphical Frontend To dd Command.md +++ b/published/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10847-1.html) [#]: subject: (Kindd – A Graphical Frontend To dd Command) [#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 12cece8da6e95e1273eeb16e0166316981805554 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 08:48:50 +0800 Subject: [PATCH 0388/1154] APL:20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop --- ...Management Tool That Improve Battery Life On Linux Laptop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md index e1e6a7f25e..085a0db4f1 100644 --- a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c327fbde159ae0069f2fe8cf1447abc5f18ad903 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 13 May 2019 08:56:54 +0800 Subject: [PATCH 0389/1154] translated --- ...bye to boilerplate in Python with attrs.md | 107 ------------------ ...bye to boilerplate in Python with attrs.md | 106 +++++++++++++++++ 2 files changed, 106 insertions(+), 107 deletions(-) delete mode 100644 sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md create mode 100644 translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md diff --git a/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md deleted file mode 100644 index 85d1f2345c..0000000000 --- a/sources/tech/20190503 Say goodbye to boilerplate in Python with attrs.md +++ /dev/null @@ -1,107 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Say goodbye to boilerplate in Python with attrs) -[#]: via: (https://opensource.com/article/19/5/python-attrs) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) - -Say goodbye to boilerplate in Python with attrs -====== -Learn more about solving common Python problems in our series covering -seven PyPI libraries. -![Programming at a browser, orange hands][1] - -Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. - -In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. Today, we'll examine [**attrs**][4], a Python package that helps you write concise, correct code quickly. - -### attrs - -If you have been using Python for any length of time, you are probably used to writing code like: - - -``` -class Book(object): - -def __init__(self, isbn, name, author): -self.isbn = isbn -self.name = name -self.author = author -``` - -Then you write a **__repr__** function; otherwise, it would be hard to log instances of **Book** : - - -``` -def __repr__(self): -return f"Book({self.isbn}, {self.name}, {self.author})" -``` - -Next, you write a nice docstring documenting the expected types. But you notice you forgot to add the **edition** and **published_year** attributes, so you have to modify them in five places. - -What if you didn't have to? - - -``` -@attr.s(auto_attribs=True) -class Book(object): -isbn: str -name: str -author: str -published_year: int -edition: int -``` - -Annotating the attributes with types using the new type annotation syntax, **attrs** detects the annotations and creates a class. - -ISBNs have a specific format. What if we want to enforce that format? - - -``` -@attr.s(auto_attribs=True) -class Book(object): -isbn: str = attr.ib() -@isbn.validator -def pattern_match(self, attribute, value): -m = re.match(r"^(\d{3}-)\d{1,3}-\d{2,3}-\d{1,7}-\d$", value) -if not m: -raise ValueError("incorrect format for isbn", value) -name: str -author: str -published_year: int -edition: int -``` - -The **attrs** library also has great support for [immutability-style programming][5]. Changing the first line to **@attr.s(auto_attribs=True, frozen=True)** means that **Book** is now immutable: trying to modify an attribute will raise an exception. Instead, we can get a _new_ instance with modification using **attr.evolve(old_book, published_year=old_book.published_year+1)** , for example, if we need to push publication forward by a year. - -In the next article in this series, we'll look at **singledispatch** , a library that allows you to add methods to Python libraries retroactively. - -#### Review the previous articles in this series - - * [Cython][6] - * [Black][7] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/python-attrs - -作者:[Moshe Zadka ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands) -[2]: https://opensource.com/article/18/5/numbers-python-community-trends -[3]: https://pypi.org/ -[4]: https://pypi.org/project/attrs/ -[5]: https://opensource.com/article/18/10/functional-programming-python-immutable-data-structures -[6]: https://opensource.com/article/19/4/7-python-problems-solved-cython -[7]: https://opensource.com/article/19/4/python-problems-solved-black diff --git a/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md new file mode 100644 index 0000000000..e80b5b03e1 --- /dev/null +++ b/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Say goodbye to boilerplate in Python with attrs) +[#]: via: (https://opensource.com/article/19/5/python-attrs) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) + +使用 attrs 来告别 Python 中的样板 +====== +在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 +![Programming at a browser, orange hands][1] + +Python是当今使用最多[流行的编程语言] [2]之一 - 并且有充分的理由:它是开源的,它具有广泛的用途(例如Web编程,业务应用程序,游戏,科学编程等等)更多),它有一个充满活力和专注的社区支持它。这个社区是我们在[Python Package Index] [3](PyPI)中提供如此庞大,多样化的软件包的原因,以扩展和改进Python并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [**attrs**][4],这是一个帮助你快速编写简洁,正确的代码的 Python 包。 + +### attrs + +如果你已经写过一段时间的 Python,那么你可能习惯这样写代码: + + +``` +class Book(object): + + def __init__(self, isbn, name, author): + self.isbn = isbn + self.name = name + self.author = author +``` + +接着写一个 **__repr__** 函数。否则,很难记录 **Book** 的实例: + + +``` +def __repr__(self): + return f"Book({self.isbn}, {self.name}, {self.author})" +``` + +接下来你会写一个好看的 docstring 来记录期望的类型。但是你注意到你忘了添加 **edition** 和 **published_year** 属性,所以你必须在五个地方修改它们。 + +如果你不必这么做如何? + + +``` +@attr.s(auto_attribs=True) +class Book(object): + isbn: str + name: str + author: str + published_year: int + edition: int +``` + +使用新的类型注释语法注释类型属性,**attrs** 会检测注释并创建一个类。 + +ISBN 有特定格式。如果我们想强行使用该格式怎么办? + + +``` +@attr.s(auto_attribs=True) +class Book(object): + isbn: str = attr.ib() + @isbn.validator + def pattern_match(self, attribute, value): + m = re.match(r"^(\d{3}-)\d{1,3}-\d{2,3}-\d{1,7}-\d$", value) + if not m: + raise ValueError("incorrect format for isbn", value) + name: str + author: str + published_year: int + edition: int +``` + +**attrs** 库也对[不可变风格编程][5]支持良好。将第一行改成 **@attr.s(auto_attribs=True, frozen=True)** 意味着 **Book** 现在是不可变的:尝试修改一个属性将会引发一个异常。相反,比如,如果希望将发布日期向后一年,我们可以修改成 **attr.evolve(old_book, published_year=old_book.published_year+1)** 来得到一个_新的_实例。 + +本系列的下一篇文章我们将来看下 **singledispatch**,一个能让你向 Python 库添加方法的库。 + +#### 查看本系列先前的文章 + + * [Cython][6] + * [Black][7] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-attrs + +作者:[Moshe Zadka ][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/moshez/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands) +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/attrs/ +[5]: https://opensource.com/article/18/10/functional-programming-python-immutable-data-structures +[6]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[7]: https://opensource.com/article/19/4/python-problems-solved-black From 6176c4b57f5d062ff5cd5fd84890375e4bc9a347 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 13 May 2019 09:03:56 +0800 Subject: [PATCH 0390/1154] translating --- sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md index f6d819c754..7db3cce1f6 100644 --- a/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md +++ b/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 78040009dd493b90972afc8005bb5760a7a18b59 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 09:37:22 +0800 Subject: [PATCH 0391/1154] TSL:20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md --- ...at Improve Battery Life On Linux Laptop.md | 745 ------------------ ...at Improve Battery Life On Linux Laptop.md | 588 ++++++++++++++ 2 files changed, 588 insertions(+), 745 deletions(-) delete mode 100644 sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md create mode 100644 translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md diff --git a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md deleted file mode 100644 index 085a0db4f1..0000000000 --- a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ /dev/null @@ -1,745 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) -[#]: via: (https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop -====== - -Laptop battery is highly optimized for Windows OS, that i had realized when i was using Windows OS in my laptop but it’s not same for Linux. - -Over the years Linux has improved a lot for battery optimization but still we need make some necessary things to improve laptop battery life in Linux. - -When i think about battery life, i got few options for that but i felt TLP is a better solutions for me so, i’m going with it. - -In this tutorial we are going to discuss about TLP in details to improve battery life. - -We had written three articles previously in our site about **[laptop battery saving utilities][1]** for Linux **[PowerTOP][2]** and **[Battery Charging State][3]**. - -### What is TLP? - -[TLP][4] is a free opensource advanced power management tool that improve your battery life without making any configuration change. - -Since it comes with a default configuration already optimized for battery life, so you may just install and forget it. - -Also, it is highly customizable to fulfill your specific requirements. TLP is a pure command line tool with automated background tasks. It does not contain a GUI. - -TLP runs on every laptop brand. Setting the battery charge thresholds is available for IBM/Lenovo ThinkPads only. - -All TLP settings are stored in `/etc/default/tlp`. The default configuration provides optimized power saving out of the box. - -The following TLP settings is available for customization and you need to make the necessary changes accordingly if you want it. - -### TLP Features - - * Kernel laptop mode and dirty buffer timeouts - * Processor frequency scaling including “turbo boost” / “turbo core” - * Limit max/min P-state to control power dissipation of the CPU - * HWP energy performance hints - * Power aware process scheduler for multi-core/hyper-threading - * Processor performance versus energy savings policy (x86_energy_perf_policy) - * Hard disk advanced power magement level (APM) and spin down timeout (per disk) - * AHCI link power management (ALPM) with device blacklist - * PCIe active state power management (PCIe ASPM) - * Runtime power management for PCI(e) bus devices - * Radeon graphics power management (KMS and DPM) - * Wifi power saving mode - * Power off optical drive in drive bay - * Audio power saving mode - * I/O scheduler (per disk) - * USB autosuspend with device blacklist/whitelist (input devices excluded automatically) - * Enable or disable integrated wifi, bluetooth or wwan devices upon system startup and shutdown - * Restore radio device state on system startup (from previous shutdown). - * Radio device wizard: switch radios upon network connect/disconnect and dock/undock - * Disable Wake On LAN - * Integrated WWAN and bluetooth state is restored after suspend/hibernate - * Untervolting of Intel processors – requires kernel with PHC-Patch - * Battery charge thresholds – ThinkPads only - * Recalibrate battery – ThinkPads only - - - -### How to Install TLP in Linux - -TLP package is available in most of the distributions official repository so, use the distributions **[Package Manager][5]** to install it. - -For **`Fedora`** system, use **[DNF Command][6]** to install TLP. - -``` -$ sudo dnf install tlp tlp-rdw -``` - -ThinkPads require an additional packages. - -``` -$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -$ sudo dnf install http://repo.linrunner.de/fedora/tlp/repos/releases/tlp-release.fc$(rpm -E %fedora).noarch.rpm -$ sudo dnf install akmod-tp_smapi akmod-acpi_call kernel-devel -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo dnf install smartmontools -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][7]** or **[APT Command][8]** to install TLP. - -``` -$ sudo apt install tlp tlp-rdw -``` - -ThinkPads require an additional packages. - -``` -$ sudo apt-get install tp-smapi-dkms acpi-call-dkms -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo apt-get install smartmontools -``` - -When the official package becomes outdated for Ubuntu based systems then use the following PPA repository which provides an up-to-date version. Run the following commands to install TLP using the PPA. - -``` -$ sudo apt-get install tlp tlp-rdw -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install TLP. - -``` -$ sudo pacman -S tlp tlp-rdw -``` - -ThinkPads require an additional packages. - -``` -$ pacman -S tp_smapi acpi_call -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo pacman -S smartmontools -``` - -Enable TLP & TLP-Sleep service on boot for Arch Linux based systems. - -``` -$ sudo systemctl enable tlp.service -$ sudo systemctl enable tlp-sleep.service -``` - -You should also mask the following services to avoid conflicts and assure proper operation of TLP’s radio device switching options for Arch Linux based systems. - -``` -$ sudo systemctl mask systemd-rfkill.service -$ sudo systemctl mask systemd-rfkill.socket -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][10]** to install TLP. - -``` -$ sudo yum install tlp tlp-rdw -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo yum install smartmontools -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][11]** to install TLP. - -``` -$ sudo zypper install TLP -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo zypper install smartmontools -``` - -After successfully TLP installed, use the following command to start the service. - -``` -$ systemctl start tlp.service -``` - -To show battery information. - -``` -$ sudo tlp-stat -b -or -$ sudo tlp-stat --battery - ---- TLP 1.1 -------------------------------------------- - -+++ Battery Status -/sys/class/power_supply/BAT0/manufacturer = SMP -/sys/class/power_supply/BAT0/model_name = L14M4P23 -/sys/class/power_supply/BAT0/cycle_count = (not supported) -/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] -/sys/class/power_supply/BAT0/energy_full = 48850 [mWh] -/sys/class/power_supply/BAT0/energy_now = 48850 [mWh] -/sys/class/power_supply/BAT0/power_now = 0 [mW] -/sys/class/power_supply/BAT0/status = Full - -Charge = 100.0 [%] -Capacity = 81.4 [%] -``` - -To show disk information. - -``` -$ sudo tlp-stat -d -or -$ sudo tlp-stat --disk - ---- TLP 1.1 -------------------------------------------- - -+++ Storage Devices -/dev/sda: - Model = WDC WD10SPCX-24HWST1 - Firmware = 02.01A02 - APM Level = 128 - Status = active/idle - Scheduler = mq-deadline - - Runtime PM: control = on, autosuspend_delay = (not available) - - SMART info: - 4 Start_Stop_Count = 18787 - 5 Reallocated_Sector_Ct = 0 - 9 Power_On_Hours = 606 [h] - 12 Power_Cycle_Count = 1792 - 193 Load_Cycle_Count = 25775 - 194 Temperature_Celsius = 31 [°C] - - -+++ AHCI Link Power Management (ALPM) -/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm - -+++ AHCI Host Controller Runtime Power Management -/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on -``` - -To show PCI device information. - -``` -$ sudo tlp-stat -e -or -$ sudo tlp-stat --pcie - ---- TLP 1.1 -------------------------------------------- - -+++ Runtime Power Management -Device blacklist = (not configured) -Driver blacklist = amdgpu nouveau nvidia radeon pcieport - -/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) -/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) -/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) -/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) -/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) -/sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.2/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, no driver) -/sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x058000, Memory controller, no driver) -/sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x040300, Audio device, snd_hda_intel) -/sys/bus/pci/devices/0000:00:1f.4/power/control = auto (0x0c0500, SMBus, i801_smbus) -/sys/bus/pci/devices/0000:01:00.0/power/control = auto (0x030200, 3D controller, nouveau) -/sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x080501, SD Host controller, sdhci-pci) -/sys/bus/pci/devices/0000:08:00.0/power/control = auto (0x028000, Network controller, iwlwifi) -/sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, r8168) -/sys/bus/pci/devices/0000:0a:00.0/power/control = auto (0x010802, Non-Volatile memory controller, nvme) -``` - -To show graphics card information. - -``` -$ sudo tlp-stat -g -or -$ sudo tlp-stat --graphics - ---- TLP 1.1 -------------------------------------------- - -+++ Intel Graphics -/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) -/sys/module/i915/parameters/enable_fbc = 1 (enabled) -/sys/module/i915/parameters/enable_psr = 0 (disabled) -/sys/module/i915/parameters/modeset = -1 (use per-chip default) -``` - -To show Processor information. - -``` -$ sudo tlp-stat -p -or -$ sudo tlp-stat --processor - ---- TLP 1.1 -------------------------------------------- - -+++ Processor -CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - -/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] -/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] -/sys/devices/system/cpu/intel_pstate/no_turbo = 0 -/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] -/sys/devices/system/cpu/intel_pstate/num_pstates = 28 - -x86_energy_perf_policy: program not installed. - -/sys/module/workqueue/parameters/power_efficient = Y -/proc/sys/kernel/nmi_watchdog = 0 - -+++ Undervolting -PHC kernel not available. -``` - -To show system data information. - -``` -$ sudo tlp-stat -s -or -$ sudo tlp-stat --system - ---- TLP 1.1 -------------------------------------------- - -+++ System Info -System = LENOVO Lenovo ideapad Y700-15ISK 80NV -BIOS = CDCN35WW -Release = "Manjaro Linux" -Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 -/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b -Init system = systemd -Boot mode = BIOS (CSM, Legacy) - -+++ TLP Status -State = enabled -Last run = 11:04:00 IST, 596 sec(s) ago -Mode = battery -Power source = battery -``` - -To show temperatures and fan speed information. - -``` -$ sudo tlp-stat -t -or -$ sudo tlp-stat --temp - ---- TLP 1.1 -------------------------------------------- - -+++ Temperatures -CPU temp = 36 [°C] -Fan speed = (not available) -``` - -To show USB device data information. - -``` -$ sudo tlp-stat -u -or -$ sudo tlp-stat --usb - ---- TLP 1.1 -------------------------------------------- - -+++ USB -Autosuspend = disabled -Device whitelist = (not configured) -Device blacklist = (not configured) -Bluetooth blacklist = disabled -Phone blacklist = disabled -WWAN blacklist = enabled - -Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) -Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) -Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) -Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) -Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) -``` - -To show warnings. - -``` -$ sudo tlp-stat -w -or -$ sudo tlp-stat --warn - ---- TLP 1.1 -------------------------------------------- - -No warnings detected. -``` - -Status report with configuration and all active settings. - -``` -$ sudo tlp-stat - ---- TLP 1.1 -------------------------------------------- - -+++ Configured Settings: /etc/default/tlp -TLP_ENABLE=1 -TLP_DEFAULT_MODE=AC -TLP_PERSISTENT_DEFAULT=0 -DISK_IDLE_SECS_ON_AC=0 -DISK_IDLE_SECS_ON_BAT=2 -MAX_LOST_WORK_SECS_ON_AC=15 -MAX_LOST_WORK_SECS_ON_BAT=60 -CPU_HWP_ON_AC=balance_performance -CPU_HWP_ON_BAT=balance_power -SCHED_POWERSAVE_ON_AC=0 -SCHED_POWERSAVE_ON_BAT=1 -NMI_WATCHDOG=0 -ENERGY_PERF_POLICY_ON_AC=performance -ENERGY_PERF_POLICY_ON_BAT=power -DISK_DEVICES="sda sdb" -DISK_APM_LEVEL_ON_AC="254 254" -DISK_APM_LEVEL_ON_BAT="128 128" -SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance" -SATA_LINKPWR_ON_BAT="med_power_with_dipm max_performance" -AHCI_RUNTIME_PM_TIMEOUT=15 -PCIE_ASPM_ON_AC=performance -PCIE_ASPM_ON_BAT=powersave -RADEON_POWER_PROFILE_ON_AC=default -RADEON_POWER_PROFILE_ON_BAT=low -RADEON_DPM_STATE_ON_AC=performance -RADEON_DPM_STATE_ON_BAT=battery -RADEON_DPM_PERF_LEVEL_ON_AC=auto -RADEON_DPM_PERF_LEVEL_ON_BAT=auto -WIFI_PWR_ON_AC=off -WIFI_PWR_ON_BAT=on -WOL_DISABLE=Y -SOUND_POWER_SAVE_ON_AC=0 -SOUND_POWER_SAVE_ON_BAT=1 -SOUND_POWER_SAVE_CONTROLLER=Y -BAY_POWEROFF_ON_AC=0 -BAY_POWEROFF_ON_BAT=0 -BAY_DEVICE="sr0" -RUNTIME_PM_ON_AC=on -RUNTIME_PM_ON_BAT=auto -RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon pcieport" -USB_AUTOSUSPEND=0 -USB_BLACKLIST_BTUSB=0 -USB_BLACKLIST_PHONE=0 -USB_BLACKLIST_PRINTER=1 -USB_BLACKLIST_WWAN=1 -RESTORE_DEVICE_STATE_ON_STARTUP=0 - -+++ System Info -System = LENOVO Lenovo ideapad Y700-15ISK 80NV -BIOS = CDCN35WW -Release = "Manjaro Linux" -Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 -/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b -Init system = systemd -Boot mode = BIOS (CSM, Legacy) - -+++ TLP Status -State = enabled -Last run = 11:04:00 IST, 684 sec(s) ago -Mode = battery -Power source = battery - -+++ Processor -CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - -/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] -/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] -/sys/devices/system/cpu/intel_pstate/no_turbo = 0 -/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] -/sys/devices/system/cpu/intel_pstate/num_pstates = 28 - -x86_energy_perf_policy: program not installed. - -/sys/module/workqueue/parameters/power_efficient = Y -/proc/sys/kernel/nmi_watchdog = 0 - -+++ Undervolting -PHC kernel not available. - -+++ Temperatures -CPU temp = 42 [°C] -Fan speed = (not available) - -+++ File System -/proc/sys/vm/laptop_mode = 2 -/proc/sys/vm/dirty_writeback_centisecs = 6000 -/proc/sys/vm/dirty_expire_centisecs = 6000 -/proc/sys/vm/dirty_ratio = 20 -/proc/sys/vm/dirty_background_ratio = 10 - -+++ Storage Devices -/dev/sda: - Model = WDC WD10SPCX-24HWST1 - Firmware = 02.01A02 - APM Level = 128 - Status = active/idle - Scheduler = mq-deadline - - Runtime PM: control = on, autosuspend_delay = (not available) - - SMART info: - 4 Start_Stop_Count = 18787 - 5 Reallocated_Sector_Ct = 0 - 9 Power_On_Hours = 606 [h] - 12 Power_Cycle_Count = 1792 - 193 Load_Cycle_Count = 25777 - 194 Temperature_Celsius = 31 [°C] - - -+++ AHCI Link Power Management (ALPM) -/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm - -+++ AHCI Host Controller Runtime Power Management -/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on - -+++ PCIe Active State Power Management -/sys/module/pcie_aspm/parameters/policy = powersave - -+++ Intel Graphics -/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) -/sys/module/i915/parameters/enable_fbc = 1 (enabled) -/sys/module/i915/parameters/enable_psr = 0 (disabled) -/sys/module/i915/parameters/modeset = -1 (use per-chip default) - -+++ Wireless -bluetooth = on -wifi = on -wwan = none (no device) - -hci0(btusb) : bluetooth, not connected -wlp8s0(iwlwifi) : wifi, connected, power management = on - -+++ Audio -/sys/module/snd_hda_intel/parameters/power_save = 1 -/sys/module/snd_hda_intel/parameters/power_save_controller = Y - -+++ Runtime Power Management -Device blacklist = (not configured) -Driver blacklist = amdgpu nouveau nvidia radeon pcieport - -/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) -/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) -/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) -/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) -/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) -/sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.2/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, no driver) -/sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x058000, Memory controller, no driver) -/sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x040300, Audio device, snd_hda_intel) -/sys/bus/pci/devices/0000:00:1f.4/power/control = auto (0x0c0500, SMBus, i801_smbus) -/sys/bus/pci/devices/0000:01:00.0/power/control = auto (0x030200, 3D controller, nouveau) -/sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x080501, SD Host controller, sdhci-pci) -/sys/bus/pci/devices/0000:08:00.0/power/control = auto (0x028000, Network controller, iwlwifi) -/sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, r8168) -/sys/bus/pci/devices/0000:0a:00.0/power/control = auto (0x010802, Non-Volatile memory controller, nvme) - -+++ USB -Autosuspend = disabled -Device whitelist = (not configured) -Device blacklist = (not configured) -Bluetooth blacklist = disabled -Phone blacklist = disabled -WWAN blacklist = enabled - -Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) -Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) -Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) -Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) -Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) - -+++ Battery Status -/sys/class/power_supply/BAT0/manufacturer = SMP -/sys/class/power_supply/BAT0/model_name = L14M4P23 -/sys/class/power_supply/BAT0/cycle_count = (not supported) -/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] -/sys/class/power_supply/BAT0/energy_full = 51690 [mWh] -/sys/class/power_supply/BAT0/energy_now = 50140 [mWh] -/sys/class/power_supply/BAT0/power_now = 12185 [mW] -/sys/class/power_supply/BAT0/status = Discharging - -Charge = 97.0 [%] -Capacity = 86.2 [%] -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/ - -作者:[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/check-laptop-battery-status-and-charging-state-in-linux-terminal/ -[2]: https://www.2daygeek.com/powertop-monitors-laptop-battery-usage-linux/ -[3]: https://www.2daygeek.com/monitor-laptop-battery-charging-state-linux/ -[4]: https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html -[5]: https://www.2daygeek.com/category/package-management/ -[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ diff --git a/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md new file mode 100644 index 0000000000..34ff3d3da7 --- /dev/null +++ b/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -0,0 +1,588 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) +[#]: via: (https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +TLP:一个可以延长 Linux 笔记本电池寿命的高级电源管理工具 +====== + +笔记本电池是针对 Windows 操作系统进行了高度优化的,当我在笔记本电脑中使用 Windows 操作系统时,我已经意识到这一点,但对于 Linux 来说却不一样。 + +多年来,Linux 在电池优化方面取得了很大进步,但我们仍然需要做一些必要的事情来改善 Linux 中笔记本电脑的电池寿命。 + +当我考虑电池寿命时,我没有多少选择,但我觉得 TLP 对我来说是一个更好的解决方案,所以我会继续使用它。 + +在本教程中,我们将详细讨论 TLP 以延长电池寿命。 + +我们之前在我们的网站上写了三篇关于 Linux [笔记本电池节电工具][1] 的文章:[PowerTOP][2] 和 [电池充电状态][3]。 + +### TLP + +[TLP][4] 是一款自由开源的高级电源管理工具,可在不进行任何配置更改的情况下延长电池寿命。 + +由于它的默认配置已针对电池寿命进行了优化,因此你可能只需要安装,然后就忘记它吧。 + +此外,它可以高度定制化,以满足你的特定要求。TLP 是一个具有自动后台任务的纯命令行工具。它不包含GUI。 + +TLP 适用于各种品牌的笔记本电脑。设置电池充电阈值仅适用于 IBM/Lenovo ThinkPad。 + +所有 TLP 设置都存储在 `/etc/default/tlp` 中。其默认配置提供了开箱即用的优化的节能设置。 + +以下 TLP 设置可用于自定义,如果需要,你可以相应地进行必要的更改。 + +### TLP 功能 + +* 内核笔记本电脑模式和脏缓冲区超时 +* 处理器频率调整,包括 “turbo boost”/“turbo core” +* 限制最大/最小的 P 状态以控制 CPU 的功耗 +* HWP 能源性能提示 +* 用于多核/超线程的功率感知进程调度程序 +* 处理器性能与节能策略(`x86_energy_perf_policy`) +* 硬盘高级电源管理级别(APM)和降速超时(按磁盘) +* AHCI 链路电源管理(ALPM)与设备黑名单 +* PCIe 活动状态电源管理(PCIe ASPM) +* PCI(e) 总线设备的运行时电源管理 +* Radeon 图形电源管理(KMS 和 DPM) +* Wifi 省电模式 +* 关闭驱动器托架中的光盘驱动器 +* 音频省电模式 +* I/O 调度程序(按磁盘) +* USB 自动暂停,支持设备黑名单/白名单(输入设备自动排除) +* 在系统启动和关闭时启用或禁用集成的 wifi、蓝牙或 wwan 设备 +* 在系统启动时恢复无线电设备状态(从之前的关机时的状态) +* 无线电设备向导:在网络连接/断开和停靠/取消停靠时切换无线电 +* 禁用 LAN 唤醒 +* 挂起/休眠后恢复集成的 WWAN 和蓝牙状态 +* 英特尔处理器的动态电源降低 —— 需要内核和 PHC-Patch 支持 +* 电池充电阈值 —— 仅限 ThinkPad +* 重新校准电池 —— 仅限 ThinkPad + +### 如何在 Linux 上安装 TLP + +TLP 包在大多数发行版官方存储库中都可用,因此,使用发行版的 [包管理器][5] 来安装它。 + +对于 Fedora 系统,使用 [DNF 命令][6] 安装 TLP。 + +``` +$ sudo dnf install tlp tlp-rdw +``` + +ThinkPad 需要一些附加软件包。 + +``` +$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +$ sudo dnf install http://repo.linrunner.de/fedora/tlp/repos/releases/tlp-release.fc$(rpm -E %fedora).noarch.rpm +$ sudo dnf install akmod-tp_smapi akmod-acpi_call kernel-devel +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo dnf install smartmontools +``` + +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][7] 或 [APT 命令][8] 安装 TLP。 + +``` +$ sudo apt install tlp tlp-rdw +``` + +ThinkPad 需要一些附加软件包。 + +``` +$ sudo apt-get install tp-smapi-dkms acpi-call-dkms +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo apt-get install smartmontools +``` + +当基于 Ubuntu 的系统的官方软件包过时时,请使用以下 PPA 存储库,该存储库提供最新版本。运行以下命令以使用 PPA 安装 TLP。 + +``` +$ sudo apt-get install tlp tlp-rdw +``` + +对于基于 Arch Linux 的系统,使用 [Pacman 命令][9] 安装 TLP。 + +``` +$ sudo pacman -S tlp tlp-rdw +``` + +ThinkPad 需要一些附加软件包。 + +``` +$ pacman -S tp_smapi acpi_call +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo pacman -S smartmontools +``` + +对于基于 Arch Linux 的系统,在启动时启用 TLP 和 TLP-Sleep 服务。 + +``` +$ sudo systemctl enable tlp.service +$ sudo systemctl enable tlp-sleep.service +``` + +对于基于 Arch Linux 的系统,你还应该屏蔽以下服务以避免冲突,并确保 TLP 的无线电设备切换选项的正确操作。 + +``` +$ sudo systemctl mask systemd-rfkill.service +$ sudo systemctl mask systemd-rfkill.socket +``` + +对于 RHEL/CentOS 系统,使用 [YUM 命令][10] 安装 TLP。 + +``` +$ sudo yum install tlp tlp-rdw +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo yum install smartmontools +``` + +对于 openSUSE Leap 系统,使用 [Zypper 命令][11] 安装 TLP。 + +``` +$ sudo zypper install TLP +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo zypper install smartmontools +``` + +成功安装 TLP 后,使用以下命令启动服务。 + +``` +$ systemctl start tlp.service +``` + +### 使用方法 + +#### 显示电池信息 + +``` +$ sudo tlp-stat -b +或 +$ sudo tlp-stat --battery +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 48850 [mWh] +/sys/class/power_supply/BAT0/energy_now = 48850 [mWh] +/sys/class/power_supply/BAT0/power_now = 0 [mW] +/sys/class/power_supply/BAT0/status = Full + +Charge = 100.0 [%] +Capacity = 81.4 [%] +``` + +#### 显示磁盘信息 + +``` +$ sudo tlp-stat -d +或 +$ sudo tlp-stat --disk +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Storage Devices +/dev/sda: + Model = WDC WD10SPCX-24HWST1 + Firmware = 02.01A02 + APM Level = 128 + Status = active/idle + Scheduler = mq-deadline + + Runtime PM: control = on, autosuspend_delay = (not available) + + SMART info: + 4 Start_Stop_Count = 18787 + 5 Reallocated_Sector_Ct = 0 + 9 Power_On_Hours = 606 [h] + 12 Power_Cycle_Count = 1792 + 193 Load_Cycle_Count = 25775 + 194 Temperature_Celsius = 31 [°C] + + ++++ AHCI Link Power Management (ALPM) +/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm + ++++ AHCI Host Controller Runtime Power Management +/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on +``` + +#### 显示 PCI 设备信息 + +``` +$ sudo tlp-stat -e +或 +$ sudo tlp-stat --pcie +``` + +``` +$ sudo tlp-stat -e +or +$ sudo tlp-stat --pcie + +--- TLP 1.1 -------------------------------------------- + ++++ Runtime Power Management +Device blacklist = (not configured) +Driver blacklist = amdgpu nouveau nvidia radeon pcieport + +/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) +/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) +/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) +/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) +/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) +...... +``` + +#### 显示图形卡信息 + +``` +$ sudo tlp-stat -g +或 +$ sudo tlp-stat --graphics +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Intel Graphics +/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) +/sys/module/i915/parameters/enable_fbc = 1 (enabled) +/sys/module/i915/parameters/enable_psr = 0 (disabled) +/sys/module/i915/parameters/modeset = -1 (use per-chip default) +``` + +#### 显示处理器信息 + +``` +$ sudo tlp-stat -p +或 +$ sudo tlp-stat --processor +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Processor +CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz + +/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +...... +/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] +/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] +/sys/devices/system/cpu/intel_pstate/no_turbo = 0 +/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] +/sys/devices/system/cpu/intel_pstate/num_pstates = 28 + +x86_energy_perf_policy: program not installed. + +/sys/module/workqueue/parameters/power_efficient = Y +/proc/sys/kernel/nmi_watchdog = 0 + ++++ Undervolting +PHC kernel not available. +``` + +#### 显示系统数据信息 + +``` +$ sudo tlp-stat -s +或 +$ sudo tlp-stat --system +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 11:04:00 IST, 596 sec(s) ago +Mode = battery +Power source = battery +``` + +#### 显示温度和风扇速度信息 + +``` +$ sudo tlp-stat -t +或 +$ sudo tlp-stat --temp +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Temperatures +CPU temp = 36 [°C] +Fan speed = (not available) +``` + +#### 显示 USB 设备数据信息 + +``` +$ sudo tlp-stat -u +或 +$ sudo tlp-stat --usb +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ USB +Autosuspend = disabled +Device whitelist = (not configured) +Device blacklist = (not configured) +Bluetooth blacklist = disabled +Phone blacklist = disabled +WWAN blacklist = enabled + +Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) +Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) +...... +``` + +#### 显示警告信息 + +``` +$ sudo tlp-stat -w +或 +$ sudo tlp-stat --warn +``` + +``` +--- TLP 1.1 -------------------------------------------- + +No warnings detected. +``` + +#### 状态报告及配置和所有活动的设置 + +``` +$ sudo tlp-stat +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Configured Settings: /etc/default/tlp +TLP_ENABLE=1 +TLP_DEFAULT_MODE=AC +TLP_PERSISTENT_DEFAULT=0 +DISK_IDLE_SECS_ON_AC=0 +DISK_IDLE_SECS_ON_BAT=2 +MAX_LOST_WORK_SECS_ON_AC=15 +MAX_LOST_WORK_SECS_ON_BAT=60 +...... + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 11:04:00 IST, 684 sec(s) ago +Mode = battery +Power source = battery + ++++ Processor +CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz + +/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave +...... + +/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] +/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] +/sys/devices/system/cpu/intel_pstate/no_turbo = 0 +/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] +/sys/devices/system/cpu/intel_pstate/num_pstates = 28 + +x86_energy_perf_policy: program not installed. + +/sys/module/workqueue/parameters/power_efficient = Y +/proc/sys/kernel/nmi_watchdog = 0 + ++++ Undervolting +PHC kernel not available. + ++++ Temperatures +CPU temp = 42 [°C] +Fan speed = (not available) + ++++ File System +/proc/sys/vm/laptop_mode = 2 +/proc/sys/vm/dirty_writeback_centisecs = 6000 +/proc/sys/vm/dirty_expire_centisecs = 6000 +/proc/sys/vm/dirty_ratio = 20 +/proc/sys/vm/dirty_background_ratio = 10 + ++++ Storage Devices +/dev/sda: + Model = WDC WD10SPCX-24HWST1 + Firmware = 02.01A02 + APM Level = 128 + Status = active/idle + Scheduler = mq-deadline + + Runtime PM: control = on, autosuspend_delay = (not available) + + SMART info: + 4 Start_Stop_Count = 18787 + 5 Reallocated_Sector_Ct = 0 + 9 Power_On_Hours = 606 [h] + 12 Power_Cycle_Count = 1792 + 193 Load_Cycle_Count = 25777 + 194 Temperature_Celsius = 31 [°C] + + ++++ AHCI Link Power Management (ALPM) +/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm + ++++ AHCI Host Controller Runtime Power Management +/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on + ++++ PCIe Active State Power Management +/sys/module/pcie_aspm/parameters/policy = powersave + ++++ Intel Graphics +/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) +/sys/module/i915/parameters/enable_fbc = 1 (enabled) +/sys/module/i915/parameters/enable_psr = 0 (disabled) +/sys/module/i915/parameters/modeset = -1 (use per-chip default) + ++++ Wireless +bluetooth = on +wifi = on +wwan = none (no device) + +hci0(btusb) : bluetooth, not connected +wlp8s0(iwlwifi) : wifi, connected, power management = on + ++++ Audio +/sys/module/snd_hda_intel/parameters/power_save = 1 +/sys/module/snd_hda_intel/parameters/power_save_controller = Y + ++++ Runtime Power Management +Device blacklist = (not configured) +Driver blacklist = amdgpu nouveau nvidia radeon pcieport + +/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) +/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) +...... + ++++ USB +Autosuspend = disabled +Device whitelist = (not configured) +Device blacklist = (not configured) +Bluetooth blacklist = disabled +Phone blacklist = disabled +WWAN blacklist = enabled + +Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) +Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) +Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) +Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) +Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 51690 [mWh] +/sys/class/power_supply/BAT0/energy_now = 50140 [mWh] +/sys/class/power_supply/BAT0/power_now = 12185 [mW] +/sys/class/power_supply/BAT0/status = Discharging + +Charge = 97.0 [%] +Capacity = 86.2 [%] +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/ +[2]: https://www.2daygeek.com/powertop-monitors-laptop-battery-usage-linux/ +[3]: https://www.2daygeek.com/monitor-laptop-battery-charging-state-linux/ +[4]: https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html +[5]: https://www.2daygeek.com/category/package-management/ +[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From 7265432c59fffcaa86d494235563129205c4c85b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 09:45:37 +0800 Subject: [PATCH 0392/1154] PRF:20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md --- ...hat Improve Battery Life On Linux Laptop.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md index 34ff3d3da7..4d5161a9f4 100644 --- a/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ b/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) @@ -10,15 +10,17 @@ TLP:一个可以延长 Linux 笔记本电池寿命的高级电源管理工具 ====== +![](https://img.linux.net.cn/data/attachment/album/201905/13/094413iu77i8w75t80tq7h.jpg) + 笔记本电池是针对 Windows 操作系统进行了高度优化的,当我在笔记本电脑中使用 Windows 操作系统时,我已经意识到这一点,但对于 Linux 来说却不一样。 多年来,Linux 在电池优化方面取得了很大进步,但我们仍然需要做一些必要的事情来改善 Linux 中笔记本电脑的电池寿命。 -当我考虑电池寿命时,我没有多少选择,但我觉得 TLP 对我来说是一个更好的解决方案,所以我会继续使用它。 +当我考虑延长电池寿命时,我没有多少选择,但我觉得 TLP 对我来说是一个更好的解决方案,所以我会继续使用它。 在本教程中,我们将详细讨论 TLP 以延长电池寿命。 -我们之前在我们的网站上写了三篇关于 Linux [笔记本电池节电工具][1] 的文章:[PowerTOP][2] 和 [电池充电状态][3]。 +我们之前在我们的网站上写过三篇关于 Linux [笔记本电池节电工具][1] 的文章:[PowerTOP][2] 和 [电池充电状态][3]。 ### TLP @@ -264,8 +266,7 @@ Driver blacklist = amdgpu nouveau nvidia radeon pcieport /sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) /sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) /sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) -/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) -/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) + ...... ``` @@ -310,6 +311,7 @@ CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power ...... + /sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] /sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] /sys/devices/system/cpu/intel_pstate/no_turbo = 0 @@ -389,6 +391,7 @@ WWAN blacklist = enabled Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) + ...... ``` @@ -423,6 +426,7 @@ DISK_IDLE_SECS_ON_AC=0 DISK_IDLE_SECS_ON_BAT=2 MAX_LOST_WORK_SECS_ON_AC=15 MAX_LOST_WORK_SECS_ON_BAT=60 + ...... +++ System Info @@ -446,6 +450,7 @@ CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave + ...... /sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] @@ -532,6 +537,7 @@ Driver blacklist = amdgpu nouveau nvidia radeon pcieport /sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) /sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) /sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) + ...... +++ USB @@ -569,7 +575,7 @@ via: https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ba07985019a27c4eca2ac22558be413fec655084 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 09:46:19 +0800 Subject: [PATCH 0393/1154] PUB:20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @wxy https://linux.cn/article-10848-1.html --- ...nagement Tool That Improve Battery Life On Linux Laptop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md (99%) diff --git a/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md similarity index 99% rename from translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md rename to published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md index 4d5161a9f4..d21a4f2a44 100644 --- a/translated/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ b/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10848-1.html) [#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) [#]: via: (https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From b33fb62fba7ae031829d42972994957a2f3b4ef7 Mon Sep 17 00:00:00 2001 From: cycoe Date: Mon, 13 May 2019 09:53:21 +0800 Subject: [PATCH 0394/1154] translating by cycoe --- .../20181218 Using Pygame to move your game character around.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181218 Using Pygame to move your game character around.md b/sources/tech/20181218 Using Pygame to move your game character around.md index 96daf8da7d..689d15d650 100644 --- a/sources/tech/20181218 Using Pygame to move your game character around.md +++ b/sources/tech/20181218 Using Pygame to move your game character around.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cycoe) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 27df42526c73a41fc0f8cba9691528669d52f078 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Mon, 13 May 2019 12:47:40 +0800 Subject: [PATCH 0395/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190505 How To Create SSH Alias In Linux.md | 209 ------------------ ...190505 How To Create SSH Alias In Linux.md | 200 +++++++++++++++++ 2 files changed, 200 insertions(+), 209 deletions(-) delete mode 100644 sources/tech/20190505 How To Create SSH Alias In Linux.md create mode 100644 translated/tech/20190505 How To Create SSH Alias In Linux.md diff --git a/sources/tech/20190505 How To Create SSH Alias In Linux.md b/sources/tech/20190505 How To Create SSH Alias In Linux.md deleted file mode 100644 index d353ce40f1..0000000000 --- a/sources/tech/20190505 How To Create SSH Alias In Linux.md +++ /dev/null @@ -1,209 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Create SSH Alias In Linux) -[#]: via: (https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -How To Create SSH Alias In Linux -====== - -![How To Create SSH Alias In Linux][1] - -If you frequently access a lot of different remote systems via SSH, this trick will save you some time. You can create SSH alias to frequently-accessed systems via SSH. This way you need not to remember all the different usernames, hostnames, ssh port numbers and IP addresses etc. Additionally, It avoids the need to repetitively type the same username/hostname, ip address, port no whenever you SSH into a Linux server(s). - -### Create SSH Alias In Linux - -Before I know this trick, usually, I connect to a remote system over SSH using anyone of the following ways. - -Using IP address: - -``` -$ ssh 192.168.225.22 -``` - -Or using port number, username and IP address: - -``` -$ ssh -p 22 sk@server.example.com -``` - -Or using port number, username and hostname: - -``` -$ ssh -p 22 sk@server.example.com -``` - -Here, - - * **22** is the port number, - * **sk** is the username of the remote system, - * **192.168.225.22** is the IP of my remote system, - * **server.example.com** is the hostname of remote system. - - - -I believe most of the newbie Linux users and/or admins would SSH into a remote system this way. However, If you SSH into multiple different systems, remembering all hostnames/ip addresses, usernames is bit difficult unless you write them down in a paper or save them in a text file. No worries! This can be easily solved by creating an alias(or shortcut) for SSH connections. - -We can create an alias for SSH commands in two methods. - -##### Method 1 – Using SSH Config File - -This is my preferred way of creating aliases. - -We can use SSH default configuration file to create SSH alias. To do so, edit **~/.ssh/config** file (If this file doesn’t exist, just create one): - -``` -$ vi ~/.ssh/config -``` - -Add all of your remote hosts details like below: - -``` -Host webserver - HostName 192.168.225.22 - User sk - -Host dns - HostName server.example.com - User root - -Host dhcp - HostName 192.168.225.25 - User ostechnix - Port 2233 -``` - -![][2] - -Create SSH Alias In Linux Using SSH Config File - -Replace the values of **Host** , **Hostname** , **User** and **Port** with your own. Once you added the details of all remote hosts, save and exit the file. - -Now you can SSH into the systems with commands: - -``` -$ ssh webserver - -$ ssh dns - -$ ssh dhcp -``` - -It is simple as that. - -Have a look at the following screenshot. - -![][3] - -Access remote system using SSH alias - -See? I only used the alias name (i.e **webserver** ) to access my remote system that has IP address **192.168.225.22**. - -Please note that this applies for current user only. If you want to make the aliases available for all users (system wide), add the above lines in **/etc/ssh/ssh_config** file. - -You can also add plenty of other things in the SSH config file. For example, if you have [**configured SSH Key-based authentication**][4], mention the SSH keyfile location as below. - -``` -Host ubuntu - HostName 192.168.225.50 - User senthil - IdentityFIle ~/.ssh/id_rsa_remotesystem -``` - -Make sure you have replace the hostname, username and SSH keyfile path with your own. - -Now connect to the remote server with command: - -``` -$ ssh ubuntu -``` - -This way you can add as many as remote hosts you want to access over SSH and quickly access them using their alias name. - -##### Method 2 – Using Bash aliases - -This is quick and dirty way to create SSH aliases for faster communication. You can use the [**alias command**][5] to make this task much easier. - -Open **~/.bashrc** or **~/.bash_profile** file: - -Add aliases for each SSH connections one by one like below. - -``` -alias webserver='ssh sk@server.example.com' -alias dns='ssh sk@server.example.com' -alias dhcp='ssh sk@server.example.com -p 2233' -alias ubuntu='ssh sk@server.example.com -i ~/.ssh/id_rsa_remotesystem' -``` - -Again make sure you have replaced the host, hostname, port number and ip address with your own. Save the file and exit. - -Then, apply the changes using command: - -``` -$ source ~/.bashrc -``` - -Or, - -``` -$ source ~/.bash_profile -``` - -In this method, you don’t even need to use “ssh alias-name” command. Instead, just use alias name only like below. - -``` -$ webserver -$ dns -$ dhcp -$ ubuntu -``` - -![][6] - -These two methods are very simple, yet useful and much more convenient for those who often SSH into multiple different systems. Use any one of the aforementioned methods that suits for you to quickly access your remote Linux systems over SSH. - -* * * - -**Suggested read:** - - * [**Allow Or Deny SSH Access To A Particular User Or Group In Linux**][7] - * [**How To SSH Into A Particular Directory On Linux**][8] - * [**How To Stop SSH Session From Disconnecting In Linux**][9] - * [**4 Ways To Keep A Command Running After You Log Out Of The SSH Session**][10] - * [**SSLH – Share A Same Port For HTTPS And SSH**][11] - - - -* * * - -And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! - -Cheers! - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/ - -作者:[sk][a] -选题:[lujun9972][b] -译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/ssh-alias-720x340.png -[2]: http://www.ostechnix.com/wp-content/uploads/2019/04/Create-SSH-Alias-In-Linux.png -[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias.png -[4]: https://www.ostechnix.com/configure-ssh-key-based-authentication-linux/ -[5]: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-examples/ -[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias-1.png -[7]: https://www.ostechnix.com/allow-deny-ssh-access-particular-user-group-linux/ -[8]: https://www.ostechnix.com/how-to-ssh-into-a-particular-directory-on-linux/ -[9]: https://www.ostechnix.com/how-to-stop-ssh-session-from-disconnecting-in-linux/ -[10]: https://www.ostechnix.com/4-ways-keep-command-running-log-ssh-session/ -[11]: https://www.ostechnix.com/sslh-share-port-https-ssh/ diff --git a/translated/tech/20190505 How To Create SSH Alias In Linux.md b/translated/tech/20190505 How To Create SSH Alias In Linux.md new file mode 100644 index 0000000000..42960e945d --- /dev/null +++ b/translated/tech/20190505 How To Create SSH Alias In Linux.md @@ -0,0 +1,200 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Create SSH Alias In Linux) +[#]: via: (https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +如何在 Linux 中创建 SSH 别名 +====== + +![How To Create SSH Alias In Linux][1] + +如果你经常通过 SSH 访问许多不同的远程系统,这个技巧将为你节省一些时间。你可以通过 SSH 为频繁访问的系统创建 SSH 别名,这样你就不必记住所有不同的用户名、主机名、ssh 端口号和 IP 地址等。此外,它避免了在 SSH 到 Linux 服务器时重复输入相同的用户名、主机名、IP 地址、端口号。 + +### 在 Linux 中创建 SSH 别名 + +在我知道这个技巧之前,我通常使用以下任意一种方式通过 SSH 连接到远程系统。 + +使用 IP 地址: + +``` +$ ssh 192.168.225.22 +``` + +或使用端口号、用户名和 IP 地址: + +``` +$ ssh -p 22 sk@192.168.225.22 +``` + +或使用端口号、用户名和主机名: + +``` +$ ssh -p 22 sk@server.example.com +``` + +这里 + + * **22** 是端口号, + * **sk** 是远程系统的用户名, + * **192.168.225.22** 是我远程系统的 IP, + * **server.example.com** 是远程系统的主机名。 + +我相信大多数新手 Linux 用户和(或一些)管理员都会以这种方式通过 SSH 连接到远程系统。但是,如果你通过 SSH 连接到多个不同的系统,记住所有主机名或 IP 地址,还有用户名是困难的,除非你将它们写在纸上或者将其保存在文本文件中。别担心!这可以通过为 SSH 连接创建别名(或快捷方式)轻松解决。 + +我们可以用两种方法为 SSH 命令创建别名。 + +##### 方法 1 – 使用 SSH 配置文件 + +这是我创建别名的首选方法。 + +我们可以使用 SSH 默认配置文件来创建 SSH 别名。为此,编辑 **~/.ssh/config** 文件(如果此文件不存在,只需创建一个): + +``` +$ vi ~/.ssh/config +``` + +添加所有远程主机的详细信息,如下所示: + +``` +Host webserver + HostName 192.168.225.22 + User sk + +Host dns + HostName server.example.com + User root + +Host dhcp + HostName 192.168.225.25 + User ostechnix + Port 2233 +``` + +![][2] +使用 SSH 配置文件在 Linux 中创建 SSH 别名 + +将 **Host**、**Hostname**、**User** 和 **Port** 的值替换为你自己的值。添加所有远程主机的详细信息后,保存并退出该文件。 + +现在你可以使用以下命令通过 SSH 进入系统: + +``` +$ ssh webserver + +$ ssh dns + +$ ssh dhcp +``` + +就是这么简单! + +看看下面的截图。 + +![][3] +使用 SSH 别名访问远程系统 + +看到了吗?我只使用别名(例如 **webserver**)来访问 IP 地址为 **192.168.225.22** 的远程系统。 + +请注意,这只使用于当前用户。如果要为所有用户(系统范围内)提供别名,请在 **/etc/ssh/ssh_config** 文件中添加以上行。 + +你还可以在 SSH 配置文件中添加许多其他内容。例如,如果你[**已配置基于 SSH 密钥的身份验证**][4],说明 SSH 密钥文件的位置,如下所示: + +``` +Host ubuntu + HostName 192.168.225.50 + User senthil + IdentityFIle ~/.ssh/id_rsa_remotesystem +``` + +确保已使用你自己的值替换主机名、用户名和 SSH 密钥文件路径。 + +现在使用以下命令连接到远程服务器: + +``` +$ ssh ubuntu +``` + +这样,你可以添加希望通过 SSH 访问的任意多台远程主机,并使用别名快速访问它们。 + +##### 方法 2 – 使用 Bash 别名 + +这是创建 SSH 别名的一种应急变通的方法,可以加快通信的速度。你可以使用 [**alias 命令**][5]使这项任务更容易。 + +打开 **~/.bashrc** 或者 **~/.bash_profile** 文件: + +``` +alias webserver='ssh sk@server.example.com' +alias dns='ssh sk@server.example.com' +alias dhcp='ssh sk@server.example.com -p 2233' +alias ubuntu='ssh sk@server.example.com -i ~/.ssh/id_rsa_remotesystem' +``` + +再次确保你已使用自己的值替换主机、主机名、端口号和 IP 地址。保存文件并退出。 + +然后,使用命令应用更改: + +``` +$ source ~/.bashrc +``` + +或者 + +``` +$ source ~/.bash_profile +``` + +在此方法中,你甚至不需要使用 “ssh 别名” 命令。相反,只需使用别名,如下所示。 + +``` +$ webserver +$ dns +$ dhcp +$ ubuntu +``` + +![][6] + +这两种方法非常简单,但对于经常通过 SSH 连接到多个不同系统的人来说非常有用,而且非常方便。使用适合你的上述任何一种方法,通过 SSH 快速访问远程 Linux 系统。 +* * * + +**建议阅读:** + + * [**允许或拒绝 SSH 访问 Linux 中的特定用户或组**][7] + * [**如何在 Linux 上 SSH 到特定目录**][8] + * [**如何在 Linux 中断开 SSH 会话**][9] + * [**4 种方式在退出 SSH 会话后保持命令运行**][10] + * [**SSLH – 共享相同端口的 HTTPS 和 SSH**][11] + +* * * + +目前这就是全部了,希望它对你有帮助。更多好东西要来了,敬请关注! + +干杯! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/ssh-alias-720x340.png +[2]: http://www.ostechnix.com/wp-content/uploads/2019/04/Create-SSH-Alias-In-Linux.png +[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias.png +[4]: https://www.ostechnix.com/configure-ssh-key-based-authentication-linux/ +[5]: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-examples/ +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias-1.png +[7]: https://www.ostechnix.com/allow-deny-ssh-access-particular-user-group-linux/ +[8]: https://www.ostechnix.com/how-to-ssh-into-a-particular-directory-on-linux/ +[9]: https://www.ostechnix.com/how-to-stop-ssh-session-from-disconnecting-in-linux/ +[10]: https://www.ostechnix.com/4-ways-keep-command-running-log-ssh-session/ +[11]: https://www.ostechnix.com/sslh-share-port-https-ssh/ From 691ec7a5a490fda782b48f51937347f0a64d3ce2 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 12:57:34 +0800 Subject: [PATCH 0396/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20How?= =?UTF-8?q?=20To=20Set=20Password=20Complexity=20On=20Linux=3F=20sources/t?= =?UTF-8?q?ech/20190513=20How=20To=20Set=20Password=20Complexity=20On=20Li?= =?UTF-8?q?nux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...How To Set Password Complexity On Linux.md | 243 ++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 sources/tech/20190513 How To Set Password Complexity On Linux.md diff --git a/sources/tech/20190513 How To Set Password Complexity On Linux.md b/sources/tech/20190513 How To Set Password Complexity On Linux.md new file mode 100644 index 0000000000..e9a3171c6b --- /dev/null +++ b/sources/tech/20190513 How To Set Password Complexity On Linux.md @@ -0,0 +1,243 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Set Password Complexity On Linux?) +[#]: via: (https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Set Password Complexity On Linux? +====== + +User management is one of the important task of Linux system administration. + +There are many aspect is involved in this and implementing the strong password policy is one of them. + +Navigate to the following URL, if you would like to **[generate a strong password on Linux][1]**. + +It will Restrict unauthorized access to systems. + +By default Linux is secure that everybody know. however, we need to make necessary tweak on this to make it more secure. + +Insecure password will leads to breach security. So, take additional care on this. + +Navigate to the following URL, if you would like to see the **[password strength and score][2]** of the generated strong password. + +In this article, we will teach you, how to implement the best security policy on Linux. + +We can use PAM (the “pluggable authentication module”) to enforce password policy On most Linux systems. + +The file can be found in the following location. + +For Redhat based systems @ `/etc/pam.d/system-auth` and Debian based systems @ `/etc/pam.d/common-password`. + +The default password aging details can be found in the `/etc/login.defs` file. + +I have trimmed this file for better understanding. + +``` +# vi /etc/login.defs + +PASS_MAX_DAYS 99999 +PASS_MIN_DAYS 0 +PASS_MIN_LEN 5 +PASS_WARN_AGE 7 +``` + +**Details:** + + * **`PASS_MAX_DAYS:`**` ` Maximum number of days a password may be used. + * **`PASS_MIN_DAYS:`**` ` Minimum number of days allowed between password changes. + * **`PASS_MIN_LEN:`**` ` Minimum acceptable password length. + * **`PASS_WARN_AGE:`**` ` Number of days warning given before a password expires. + + + +We will show you, how to implement the below eleven password policies in Linux. + + * Password Max days + * Password Min days + * Password warning days + * Password history or Deny Re-Used Passwords + * Password minimum length + * Minimum upper case characters + * Minimum lower case characters + * Minimum digits in password + * Minimum other characters (Symbols) + * Account lock – retries + * Account unlock time + + + +### What Is Password Max days? + +This parameter limits the maximum number of days a password can be used. It’s mandatory for user to change his/her account password before expiry. + +If they forget to change, they are not allowed to login into the system. They need to work with admin team to get rid of it. + +It can be set in `/etc/login.defs` file. I’m going to set `90 days`. + +``` +# vi /etc/login.defs + +PASS_MAX_DAYS 90 +``` + +### What Is Password Min days? + +This parameter limits the minimum number of days after password can be changed. + +Say for example, if this parameter is set to 15 and user changed password today. Then he won’t be able to change the password again before 15 days from now. + +It can be set in `/etc/login.defs` file. I’m going to set `15 days`. + +``` +# vi /etc/login.defs + +PASS_MIN_DAYS 15 +``` + +### What Is Password Warning Days? + +This parameter controls the password warning days and it will warn the user when the password is going to expires. + +A warning will be given to the user regularly until the warning days ends. This can helps user to change their password before expiry. Otherwise we need to work with admin team for unlock the password. + +It can be set in `/etc/login.defs` file. I’m going to set `10 days`. + +``` +# vi /etc/login.defs + +PASS_WARN_AGE 10 +``` + +**Note:** All the above parameters only applicable for new accounts and not for existing accounts. + +### What Is Password History Or Deny Re-Used Passwords? + +This parameter keep controls of the password history. Keep history of passwords used (the number of previous passwords which cannot be reused). + +When the users try to set a new password, it will check the password history and warn the user when they set the same old password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `5` for history of password. + +``` +# vi /etc/pam.d/system-auth + +password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=5 +``` + +### What Is Password Minimum Length? + +This parameter keeps the minimum password length. When the users set a new password, it will check against this parameter and warn the user if they try to set the password length less than that. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `12` character for minimum password length. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 +``` + +**try_first_pass retry=3** : Allow users to set a good password before the passwd command aborts. + +### Set Minimum Upper Case Characters? + +This parameter keeps, how many upper case characters should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any upper case characters in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character for minimum password length. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 ucredit=-1 +``` + +### Set Minimum Lower Case Characters? + +This parameter keeps, how many lower case characters should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any lower case characters in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 lcredit=-1 +``` + +### Set Minimum Digits In Password? + +This parameter keeps, how many digits should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any digits in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 dcredit=-1 +``` + +### Set Minimum Other Characters (Symbols) In Password? + +This parameter keeps, how many Symbols should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any Symbol in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 ocredit=-1 +``` + +### Set Account Lock? + +This parameter controls users failed attempts. It locks user account after reaches the given number of failed login attempts. + +It can be set in `/etc/pam.d/system-auth` file. + +``` +# vi /etc/pam.d/system-auth + +auth required pam_tally2.so onerr=fail audit silent deny=5 +account required pam_tally2.so +``` + +### Set Account Unlock Time? + +This parameter keeps users unlock time. If the user account is locked after consecutive failed authentications. + +It’s unlock the locked user account after reaches the given time. Sets the time (900 seconds = 15 minutes) for which the account should remain locked. + +It can be set in `/etc/pam.d/system-auth` file. + +``` +# vi /etc/pam.d/system-auth + +auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900 +account required pam_tally2.so +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/ + +作者:[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/5-ways-to-generate-a-random-strong-password-in-linux-terminal/ +[2]: https://www.2daygeek.com/how-to-check-password-complexity-strength-and-score-in-linux/ From 5585e293c38e9e8a7fad6a0070c856d211078d4f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 12:57:48 +0800 Subject: [PATCH 0397/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20How?= =?UTF-8?q?=20To=20Check=20Whether=20The=20Given=20Package=20Is=20Installe?= =?UTF-8?q?d=20Or=20Not=20On=20Debian/Ubuntu=20System=3F=20sources/tech/20?= =?UTF-8?q?190513=20How=20To=20Check=20Whether=20The=20Given=20Package=20I?= =?UTF-8?q?s=20Installed=20Or=20Not=20On=20Debian-Ubuntu=20System.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nstalled Or Not On Debian-Ubuntu System.md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md diff --git a/sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md b/sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md new file mode 100644 index 0000000000..dfc3e62dce --- /dev/null +++ b/sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md @@ -0,0 +1,141 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Check Whether The Given Package Is Installed Or Not On Debian/Ubuntu System?) +[#]: via: (https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Check Whether The Given Package Is Installed Or Not On Debian/Ubuntu System? +====== + +We have recently published an article about bulk package installation. + +While doing that, i was struggled to get the installed package information and did a small google search and found few methods about it. + +I would like to share it in our website so, that it will be helpful for others too. + +There are numerous ways we can achieve this. + +I have add seven ways to achieve this. However, you can choose the preferred method for you. + +Those methods are listed below. + + * **`apt-cache Command:`** apt-cache command is used to query the APT cache or package metadata. + * **`apt Command:`** APT is a powerful command-line tool for installing, downloading, removing, searching and managing packages on Debian based systems. + * **`dpkg-query Command:`** dpkg-query is a tool to query the dpkg database. + * **`dpkg Command:`** dpkg is a package manager for Debian based systems. + * **`which Command:`** The which command returns the full path of the executable that would have been executed when the command had been entered in terminal. + * **`whereis Command:`** The whereis command used to search the binary, source, and man page files for a given command. + * **`locate Command:`** locate command works faster than the find command because it uses updatedb database, whereas the find command searches in the real system. + + + +### Method-1 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using apt-cache Command? + +apt-cache command is used to query the APT cache or package metadata from APT’s internal database. + +It will search and display an information about the given package. It shows whether the package is installed or not, installed package version, source repository information. + +The below output clearly showing that `nano` package has already installed in the system. Since installed part is showing the installed version of nano package. + +``` +# apt-cache policy nano +nano: + Installed: 2.9.3-2 + Candidate: 2.9.3-2 + Version table: + *** 2.9.3-2 500 + 500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages + 100 /var/lib/dpkg/status +``` + +### Method-2 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using apt Command? + +APT is a powerful command-line tool for installing, downloading, removing, searching and managing as well as querying information about packages as a low-level access to all features of the libapt-pkg library. It’s contains some less used command-line utilities related to package management. + +``` +# apt -qq list nano +nano/bionic,now 2.9.3-2 amd64 [installed] +``` + +### Method-3 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using dpkg-query Command? + +dpkg-query is a tool to show information about packages listed in the dpkg database. + +In the below output first column showing `ii`. It means, the given package has already installed in the system. + +``` +# dpkg-query --list | grep -i nano +ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico +``` + +### Method-4 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using dpkg Command? + +DPKG stands for Debian Package is a tool to install, build, remove and manage Debian packages, but unlike other package management systems, it cannot automatically download and install packages or their dependencies. + +In the below output first column showing `ii`. It means, the given package has already installed in the system. + +``` +# dpkg -l | grep -i nano +ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico +``` + +### Method-5 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using which Command? + +The which command returns the full path of the executable that would have been executed when the command had been entered in terminal. + +It’s very useful when you want to create a desktop shortcut or symbolic link for executable files. + +Which command searches the directories listed in the current user’s PATH environment variable not for all the users. I mean, when you are logged in your own account and you can’t able to search for root user file or directory. + +If the following output shows the given package binary or executable file location then the given package has already installed in the system. If not, the package is not installed in system. + +``` +# which nano +/bin/nano +``` + +### Method-6 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using whereis Command? + +The whereis command used to search the binary, source, and man page files for a given command. + +If the following output shows the given package binary or executable file location then the given package has already installed in the system. If not, the package is not installed in system. + +``` +# whereis nano +nano: /bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz +``` + +### Method-7 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using locate Command? + +locate command works faster than the find command because it uses updatedb database, whereas the find command searches in the real system. + +It uses a database rather than hunting individual directory paths to get a given file. + +locate command doesn’t pre-installed in most of the distributions so, use your distribution package manager to install it. + +The database is updated regularly through cron. Even, we can update it manually. + +If the following output shows the given package binary or executable file location then the given package has already installed in the system. If not, the package is not installed in system. + +``` +# locate --basename '\nano' +/usr/bin/nano +/usr/share/nano +/usr/share/doc/nano +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/ + +作者:[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 From 620b0898dee464e8d5b1063612cc089440da9549 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 12:58:37 +0800 Subject: [PATCH 0398/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20Chec?= =?UTF-8?q?k=20storage=20performance=20with=20dd=20sources/tech/20190510?= =?UTF-8?q?=20Check=20storage=20performance=20with=20dd.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...90510 Check storage performance with dd.md | 432 ++++++++++++++++++ 1 file changed, 432 insertions(+) create mode 100644 sources/tech/20190510 Check storage performance with dd.md diff --git a/sources/tech/20190510 Check storage performance with dd.md b/sources/tech/20190510 Check storage performance with dd.md new file mode 100644 index 0000000000..8cdea81f69 --- /dev/null +++ b/sources/tech/20190510 Check storage performance with dd.md @@ -0,0 +1,432 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Check storage performance with dd) +[#]: via: (https://fedoramagazine.org/check-storage-performance-with-dd/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +Check storage performance with dd +====== + +![][1] + +This article includes some example commands to show you how to get a _rough_ estimate of hard drive and RAID array performance using the _dd_ command. Accurate measurements would have to take into account things like [write amplification][2] and [system call overhead][3], which this guide does not. For a tool that might give more accurate results, you might want to consider using [hdparm][4]. + +To factor out performance issues related to the file system, these examples show how to test the performance of your drives and arrays at the block level by reading and writing directly to/from their block devices. **WARNING** : The _write_ tests will destroy any data on the block devices against which they are run. **Do not run them against any device that contains data you want to keep!** + +### Four tests + +Below are four example dd commands that can be used to test the performance of a block device: + + 1. One process reading from $MY_DISK: + +``` +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + + 2. One process writing to $MY_DISK: + +``` +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + + 3. Two processes reading concurrently from $MY_DISK: + +``` +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + + 4. Two processes writing concurrently to $MY_DISK: + +``` +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + + + + +– The _iflag=nocache_ and _oflag=direct_ parameters are important when performing the read and write tests (respectively) because without them the dd command will sometimes show the resulting speed of transferring the data to/from [RAM][5] rather than the hard drive. + +– The values for the _bs_ and _count_ parameters are somewhat arbitrary and what I have chosen should be large enough to provide a decent average in most cases for current hardware. + +– The _null_ and _zero_ devices are used for the destination and source (respectively) in the read and write tests because they are fast enough that they will not be the limiting factor in the performance tests. + +– The _skip=200_ parameter on the second dd command in the concurrent read and write tests is to ensure that the two copies of dd are operating on different areas of the hard drive. + +### 16 examples + +Below are demonstrations showing the results of running each of the above four tests against each of the following four block devices: + + 1. MY_DISK=/dev/sda2 (used in examples 1-X) + 2. MY_DISK=/dev/sdb2 (used in examples 2-X) + 3. MY_DISK=/dev/md/stripped (used in examples 3-X) + 4. MY_DISK=/dev/md/mirrored (used in examples 4-X) + + + +A video demonstration of the these tests being run on a PC is provided at the end of this guide. + +Begin by putting your computer into _rescue_ mode to reduce the chances that disk I/O from background services might randomly affect your test results. **WARNING** : This will shutdown all non-essential programs and services. Be sure to save your work before running these commands. You will need to know your _root_ password to get into rescue mode. The _passwd_ command, when run as the root user, will prompt you to (re)set your root account password. + +``` +$ sudo -i +# passwd +# setenforce 0 +# systemctl rescue +``` + +You might also want to temporarily disable logging to disk: + +``` +# sed -r -i.bak 's/^#?Storage=.*/Storage=none/' /etc/systemd/journald.conf +# systemctl restart systemd-journald.service +``` + +If you have a swap device, it can be temporarily disabled and used to perform the following tests: + +``` +# swapoff -a +# MY_DEVS=$(mdadm --detail /dev/md/swap | grep active | grep -o "/dev/sd.*") +# mdadm --stop /dev/md/swap +# mdadm --zero-superblock $MY_DEVS +``` + +#### Example 1-1 (reading from sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.7003 s, 123 MB/s +``` + +#### Example 1-2 (writing to sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67117 s, 125 MB/s +``` + +#### Example 1-3 (reading concurrently from sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.42875 s, 61.2 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.52614 s, 59.5 MB/s +``` + +#### Example 1-4 (writing concurrently to sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.2435 s, 64.7 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.60872 s, 58.1 MB/s +``` + +#### Example 2-1 (reading from sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67285 s, 125 MB/s +``` + +#### Example 2-2 (writing to sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67198 s, 125 MB/s +``` + +#### Example 2-3 (reading concurrently from sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.52808 s, 59.4 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.57736 s, 58.6 MB/s +``` + +#### Example 2-4 (writing concurrently to sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.7841 s, 55.4 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.81475 s, 55.0 MB/s +``` + +#### Example 3-1 (reading from RAID0) + +``` +# mdadm --create /dev/md/stripped --homehost=any --metadata=1.0 --level=0 --raid-devices=2 $MY_DEVS +# MY_DISK=/dev/md/stripped +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 0.837419 s, 250 MB/s +``` + +#### Example 3-2 (writing to RAID0) + +``` +# MY_DISK=/dev/md/stripped +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 0.823648 s, 255 MB/s +``` + +#### Example 3-3 (reading concurrently from RAID0) + +``` +# MY_DISK=/dev/md/stripped +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.31025 s, 160 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.80016 s, 116 MB/s +``` + +#### Example 3-4 (writing concurrently to RAID0) + +``` +# MY_DISK=/dev/md/stripped +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.65026 s, 127 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.81323 s, 116 MB/s +``` + +#### Example 4-1 (reading from RAID1) + +``` +# mdadm --stop /dev/md/stripped +# mdadm --create /dev/md/mirrored --homehost=any --metadata=1.0 --level=1 --raid-devices=2 --assume-clean $MY_DEVS +# MY_DISK=/dev/md/mirrored +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.74963 s, 120 MB/s +``` + +#### Example 4-2 (writing to RAID1) + +``` +# MY_DISK=/dev/md/mirrored +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.74625 s, 120 MB/s +``` + +#### Example 4-3 (reading concurrently from RAID1) + +``` +# MY_DISK=/dev/md/mirrored +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67171 s, 125 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67685 s, 125 MB/s +``` + +#### Example 4-4 (writing concurrently to RAID1) + +``` +# MY_DISK=/dev/md/mirrored +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 4.09666 s, 51.2 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 4.1067 s, 51.1 MB/s +``` + +#### Restore your swap device and journald configuration + +``` +# mdadm --stop /dev/md/stripped /dev/md/mirrored +# mdadm --create /dev/md/swap --homehost=any --metadata=1.0 --level=1 --raid-devices=2 $MY_DEVS +# mkswap /dev/md/swap +# swapon -a +# mv /etc/systemd/journald.conf.bak /etc/systemd/journald.conf +# systemctl restart systemd-journald.service +# reboot +``` + +### Interpreting the results + +Examples 1-1, 1-2, 2-1, and 2-2 show that each of my drives read and write at about 125 MB/s. + +Examples 1-3, 1-4, 2-3, and 2-4 show that when two reads or two writes are done in parallel on the same drive, each process gets at about half the drive’s bandwidth (60 MB/s). + +The 3-x examples show the performance benefit of putting the two drives together in a RAID0 (data stripping) array. The numbers, in all cases, show that the RAID0 array performs about twice as fast as either drive is able to perform on its own. The trade-off is that you are twice as likely to lose everything because each drive only contains half the data. A three-drive array would perform three times as fast as a single drive (all drives being equal) but it would be thrice as likely to suffer a [catastrophic failure][6]. + +The 4-x examples show that the performance of the RAID1 (data mirroring) array is similar to that of a single disk except for the case where multiple processes are concurrently reading (example 4-3). In the case of multiple processes reading, the performance of the RAID1 array is similar to that of the RAID0 array. This means that you will see a performance benefit with RAID1, but only when processes are reading concurrently. For example, if a process tries to access a large number of files in the background while you are trying to use a web browser or email client in the foreground. The main benefit of RAID1 is that your data is unlikely to be lost [if a drive fails][7]. + +### Video demo + +Testing storage throughput using dd + +### Troubleshooting + +If the above tests aren’t performing as you expect, you might have a bad or failing drive. Most modern hard drives have built-in Self-Monitoring, Analysis and Reporting Technology ([SMART][8]). If your drive supports it, the _smartctl_ command can be used to query your hard drive for its internal statistics: + +``` +# smartctl --health /dev/sda +# smartctl --log=error /dev/sda +# smartctl -x /dev/sda +``` + +Another way that you might be able to tune your PC for better performance is by changing your [I/O scheduler][9]. Linux systems support several I/O schedulers and the current default for Fedora systems is the [multiqueue][10] variant of the [deadline][11] scheduler. The default performs very well overall and scales extremely well for large servers with many processors and large disk arrays. There are, however, a few more specialized schedulers that might perform better under certain conditions. + +To view which I/O scheduler your drives are using, issue the following command: + +``` +$ for i in /sys/block/sd?/queue/scheduler; do echo "$i: $(<$i)"; done +``` + +You can change the scheduler for a drive by writing the name of the desired scheduler to the /sys/block//queue/scheduler file: + +``` +# echo bfq > /sys/block/sda/queue/scheduler +``` + +You can make your changes permanent by creating a [udev rule][12] for your drive. The following example shows how to create a udev rule that will set all [rotational drives][13] to use the [BFQ][14] I/O scheduler: + +``` +# cat << END > /etc/udev/rules.d/60-ioscheduler-rotational.rules +ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" +END +``` + +Here is another example that sets all [solid-state drives][15] to use the [NOOP][16] I/O scheduler: + +``` +# cat << END > /etc/udev/rules.d/60-ioscheduler-solid-state.rules +ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="none" +END +``` + +Changing your I/O scheduler won’t affect the raw throughput of your devices, but it might make your PC seem more responsive by prioritizing the bandwidth for the foreground tasks over the background tasks or by eliminating unnecessary block reordering. + +* * * + +_Photo by _[ _James Donovan_][17]_ on _[_Unsplash_][18]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/check-storage-performance-with-dd/ + +作者:[Gregory Bartholomew][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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/dd-performance-816x345.jpg +[2]: https://www.ibm.com/developerworks/community/blogs/ibmnas/entry/misalignment_can_be_twice_the_cost1?lang=en +[3]: https://eklitzke.org/efficient-file-copying-on-linux +[4]: https://en.wikipedia.org/wiki/Hdparm +[5]: https://en.wikipedia.org/wiki/Random-access_memory +[6]: https://blog.elcomsoft.com/2019/01/why-ssds-die-a-sudden-death-and-how-to-deal-with-it/ +[7]: https://www.computerworld.com/article/2484998/ssds-do-die--as-linus-torvalds-just-discovered.html +[8]: https://en.wikipedia.org/wiki/S.M.A.R.T. +[9]: https://en.wikipedia.org/wiki/I/O_scheduling +[10]: https://lwn.net/Articles/552904/ +[11]: https://en.wikipedia.org/wiki/Deadline_scheduler +[12]: http://www.reactivated.net/writing_udev_rules.html +[13]: https://en.wikipedia.org/wiki/Hard_disk_drive_performance_characteristics +[14]: http://algo.ing.unimo.it/people/paolo/disk_sched/ +[15]: https://en.wikipedia.org/wiki/Solid-state_drive +[16]: https://en.wikipedia.org/wiki/Noop_scheduler +[17]: https://unsplash.com/photos/0ZBRKEG_5no?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[18]: https://unsplash.com/search/photos/speed?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From fb1d97323104a61257d4d43cad224a8284e2b750 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 12:59:19 +0800 Subject: [PATCH 0399/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190506=20Use?= =?UTF-8?q?=20udica=20to=20build=20SELinux=20policy=20for=20containers=20s?= =?UTF-8?q?ources/tech/20190506=20Use=20udica=20to=20build=20SELinux=20pol?= =?UTF-8?q?icy=20for=20containers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... to build SELinux policy for containers.md | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 sources/tech/20190506 Use udica to build SELinux policy for containers.md diff --git a/sources/tech/20190506 Use udica to build SELinux policy for containers.md b/sources/tech/20190506 Use udica to build SELinux policy for containers.md new file mode 100644 index 0000000000..4e31288a43 --- /dev/null +++ b/sources/tech/20190506 Use udica to build SELinux policy for containers.md @@ -0,0 +1,199 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use udica to build SELinux policy for containers) +[#]: via: (https://fedoramagazine.org/use-udica-to-build-selinux-policy-for-containers/) +[#]: author: (Lukas Vrabec https://fedoramagazine.org/author/lvrabec/) + +Use udica to build SELinux policy for containers +====== + +![][1] + +While modern IT environments move towards Linux containers, the need to secure these environments is as relevant as ever. Containers are a process isolation technology. While containers can be a defense mechanism, they only excel when combined with SELinux. + +Fedora SELinux engineering built a new standalone tool, **udica** , to generate SELinux policy profiles for containers by automatically inspecting them. This article focuses on why _udica_ is needed in the container world, and how it makes SELinux and containers work better together. You’ll find examples of SELinux separation for containers that let you avoid turning protection off because the generic SELinux type _container_t_ is too tight. With _udica_ you can easily customize the policy with limited SELinux policy writing skills. + +### SELinux technology + +SELinux is a security technology that brings proactive security to Linux systems. It’s a labeling system that assigns a label to all _subjects_ (processes and users) and _objects_ (files, directories, sockets, etc.). These labels are then used in a security policy that controls access throughout the system. It’s important to mention that what’s not allowed in an SELinux security policy is denied by default. The policy rules are enforced by the kernel. This security technology has been in use on Fedora for several years. A real example of such a rule is: + +``` +allow httpd_t httpd_log_t: file { append create getattr ioctl lock open read setattr }; +``` + +The rule allows any process labeled as _httpd_t_ ****to create, append, read and lock files labeled as _httpd_log_t_. Using the _ps_ command, you can list all processes with their labels: + +``` +$ ps -efZ | grep httpd +system_u:system_r:httpd_t:s0 root 13911 1 0 Apr14 ? 00:05:14 /usr/sbin/httpd -DFOREGROUND +... +``` + +To see which objects are labeled as httpd_log_t, use _semanage_ : + +``` +# semanage fcontext -l | grep httpd_log_t +/var/log/httpd(/.)? all files system_u:object_r:httpd_log_t:s0 +/var/log/nginx(/.)? all files system_u:object_r:httpd_log_t:s0 +... +``` + +The SELinux security policy for Fedora is shipped in the _selinux-policy_ RPM package. + +### SELinux vs. containers + +In Fedora, the _container-selinux_ RPM package provides a generic SELinux policy for all containers started by engines like _podman_ or _docker_. Its main purposes are to protect the host system against a container process, and to separate containers from each other. For instance, containers confined by SELinux with the process type _container_t_ can only read/execute files in _/usr_ and write to _container_file_t_ ****files type on host file system. To prevent attacks by containers on each other, Multi-Category Security (MCS) is used. + +Using only one generic policy for containers is problematic, because of the huge variety of container usage. On one hand, the default container type ( _container_t_ ) is often too strict. For example: + + * [Fedora SilverBlue][2] needs containers to read/write a user’s home directory + * [Fluentd][3] project needs containers to be able to read logs in the _/var/log_ directory + + + +On the other hand, the default container type could be too loose for certain use cases: + + * It has no SELinux network controls — all container processes can bind to any network port + * It has no SELinux control on [Linux capabilities][4] — all container processes can use all capabilities + + + +There is one solution to handle both use cases: write a custom SELinux security policy for the container. This can be tricky, because SELinux expertise is required. For this purpose, the _udica_ tool was created. + +### Introducing udica + +Udica generates SELinux security profiles for containers. Its concept is based on the “block inheritance” feature inside the [common intermediate language][5] (CIL) supported by SELinux userspace. The tool creates a policy that combines: + + * Rules inherited from specified CIL blocks (templates), and + * Rules discovered by inspection of container JSON file, which contains mountpoints and ports definitions + + + +You can load the final policy immediately, or move it to another system to load into the kernel. Here’s an example, using a container that: + + * Mounts _/home_ as read only + * Mounts _/var/spool_ as read/write + * Exposes port _tcp/21_ + + + +The container starts with this command: + +``` +# podman run -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 -it fedora bash +``` + +The default container type ( _container_t_ ) doesn’t allow any of these three actions. To prove it, you could use the _sesearch_ tool to query that the _allow_ rules are present on system: + +``` +# sesearch -A -s container_t -t home_root_t -c dir -p read +``` + +There’s no _allow_ rule present that lets a process labeled as _container_t_ access a directory labeled _home_root_t_ (like the _/home_ directory). The same situation occurs with _/var/spool_ , which is labeled _var_spool_t:_ + +``` +# sesearch -A -s container_t -t var_spool_t -c dir -p read +``` + +On the other hand, the default policy completely allows network access. + +``` +# sesearch -A -s container_t -t port_type -c tcp_socket +allow container_net_domain port_type:tcp_socket { name_bind name_connect recv_msg send_msg }; +allow sandbox_net_domain port_type:tcp_socket { name_bind name_connect recv_msg send_msg }; +``` + +### Securing the container + +It would be great to restrict this access and allow the container to bind just on TCP port _21_ or with the same label. Imagine you find an example container using _podman ps_ whose ID is _37a3635afb8f_ : + +``` +# podman ps -q +37a3635afb8f +``` + +You can now inspect the container and pass the inspection file to the _udica_ tool. The name for the new policy is _my_container_. + +``` +# podman inspect 37a3635afb8f > container.json +# udica -j container.json my_container +Policy my_container with container id 37a3635afb8f created! + +Please load these modules using: + # semodule -i my_container.cil /usr/share/udica/templates/{base_container.cil,net_container.cil,home_container.cil} + +Restart the container with: "--security-opt label=type:my_container.process" parameter +``` + +That’s it! You just created a custom SELinux security policy for the example container. Now you can load this policy into the kernel and make it active. The _udica_ output above even tells you the command to use: + +``` +# semodule -i my_container.cil /usr/share/udica/templates/{base_container.cil,net_container.cil,home_container.cil} +``` + +Now you must restart the container to allow the container engine to use the new custom policy: + +``` +# podman run --security-opt label=type:my_container.process -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 -it fedora bash +``` + +The example container is now running in the newly created _my_container.process_ SELinux process type: + +``` +# ps -efZ | grep my_container.process +unconfined_u:system_r:container_runtime_t:s0-s0:c0.c1023 root 2275 434 1 13:49 pts/1 00:00:00 podman run --security-opt label=type:my_container.process -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 -it fedora bash +system_u:system_r:my_container.process:s0:c270,c963 root 2317 2305 0 13:49 pts/0 00:00:00 bash +``` + +### Seeing the results + +The command _sesearch_ now shows _allow_ rules for accessing _/home_ and _/var/spool:_ + +``` +# sesearch -A -s my_container.process -t home_root_t -c dir -p read +allow my_container.process home_root_t:dir { getattr ioctl lock open read search }; +# sesearch -A -s my_container.process -t var_spool_t -c dir -p read +allow my_container.process var_spool_t:dir { add_name getattr ioctl lock open read remove_name search write } +``` + +The new custom SELinux policy also allows _my_container.process_ to bind only to TCP/UDP ports labeled the same as TCP port 21: + +``` +# semanage port -l | grep 21 | grep ftp + ftp_port_t tcp 21, 989, 990 +# sesearch -A -s my_container.process -c tcp_socket -p name_bind + allow my_container.process ftp_port_t:tcp_socket name_bind; +``` + +### Conclusion + +The _udica_ tool helps you create SELinux policies for containers based on an inspection file without any SELinux expertise required. Now you can increase the security of containerized environments. Sources are available on [GitHub][6], and an RPM package is available in Fedora repositories for Fedora 28 and later. + +* * * + +*Photo by _[_Samuel Zeller_][7]_ on *[ _Unsplash_.][8] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-udica-to-build-selinux-policy-for-containers/ + +作者:[Lukas Vrabec][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/lvrabec/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/udica-816x345.jpg +[2]: https://silverblue.fedoraproject.org +[3]: https://www.fluentd.org +[4]: http://man7.org/linux/man-pages/man7/capabilities.7.html +[5]: https://en.wikipedia.org/wiki/Common_Intermediate_Language +[6]: https://github.com/containers/udica +[7]: https://unsplash.com/photos/KVG-XMOs6tw?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/lockers?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 9fd36128ebbd373345c61532dd8a23000f3bca87 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 12:59:53 +0800 Subject: [PATCH 0400/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20How?= =?UTF-8?q?=20to=20Use=207Zip=20in=20Ubuntu=20and=20Other=20Linux=20[Quick?= =?UTF-8?q?=20Tip]=20sources/tech/20190510=20How=20to=20Use=207Zip=20in=20?= =?UTF-8?q?Ubuntu=20and=20Other=20Linux=20-Quick=20Tip.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ip in Ubuntu and Other Linux -Quick Tip.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md diff --git a/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md new file mode 100644 index 0000000000..83875b5bb2 --- /dev/null +++ b/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Use 7Zip in Ubuntu and Other Linux [Quick Tip]) +[#]: via: (https://itsfoss.com/use-7zip-ubuntu-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Use 7Zip in Ubuntu and Other Linux [Quick Tip] +====== + +_**Brief: Cannot extract .7z file in Linux? Learn how to install and use 7zip in Ubuntu and other Linux distributions.**_ + +[7Zip][1] (properly written as 7-Zip) is an archive format hugely popular among Windows users. A 7Zip archive file usually ends in .7z extension. It’s mostly an open source software barring a few part of the code that deals with unRAR. + +The 7Zip support is not enabled by default in most Linux distributions. If you try to extract it, you may see this error: + +_**Could not open this file type +There is no command installed for 7-zip archive files. Do you want to search for a command to open this file?**_ + +![][2] + +Don’t worry, you can easily install 7zip in Ubuntu or other Linux distributions. + +The one problem you’ll notice if you try to use the [apt-get install command][3], you’ll see that there are no installation candidate that starts with 7zip. It’s because the 7Zip package in Linux is named [p7zip][4]., start with letter ‘p’ instead of the expected number ‘7’. + +Let’s see how to install 7zip in Ubuntu and (possibly) other distributions. + +### Install 7Zip in Ubuntu Linux + +![][5] + +First thing you need is to install the p7zip package. You’ll find three 7zip packages in Ubuntu: p7zip, p7zip-full and p7zip-rar. + +The difference between p7zip and p7zip-full is that p7zip is a lighter version providing support only for .7z while the full version provides support for more 7z compression algorithms (for audio files etc). + +The p7zip-rar package provides support for [RAR files][6] along with 7z. + +Installing p7zip-full should be sufficient in most cases but you may also install p7zip-rar for additional support for the rar file. + +p7zip packages are in the [universe repository in Ubuntu][7] so make sure that you have enabled it using this command: + +``` +sudo add-apt-repository universe +sudo apt update +``` + +Use the following command to install 7zip support in Ubuntu and Debian based distributions. + +``` +sudo apt install p7zip-full p7zip-rar +``` + +That’s good. Now you have 7zip archive support in your system. + +[][8] + +Suggested read Easily Share Files Between Linux, Windows And Mac Using NitroShare + +### Extract 7Zip archive file in Linux + +With 7Zip installed, you can either use the GUI or the command line to extract 7zip files in Linux. + +In GUI, you can extract a .7z file as you extract any other compressed file. You right click on the file and proceed to extract it. + +In terminal, you can extract a .7z archive file using this command: + +``` +7z e file.7z +``` + +### Compress a file in 7zip archive format in Linux + +You can compress a file in 7zip archive format graphically. Simply right click on the file/directory, and select **Compress**. You should see several types of archive format options. Choose .7z for 7zip. + +![7zip Archive Ubuntu][9] + +Alternatively, you can also use the command line. Here’s the command that you can use for this purpose: + +``` +7z a OutputFile files_to_compress +``` + +By default, the archived file will have .7z extension. You can compress the file in zip format by specifying the extension (.zip) of the output file. + +**Conclusion** + +That’s it. See, how easy it is to use 7zip in Linux? I hope you liked this quick tip. If you have questions or suggestions, feel free to let me know the comment sections. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/use-7zip-ubuntu-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.7-zip.org/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2015/07/Install_7zip_ubuntu_1.png?ssl=1 +[3]: https://itsfoss.com/apt-get-linux-guide/ +[4]: https://sourceforge.net/projects/p7zip/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/7zip-linux.png?resize=800%2C450&ssl=1 +[6]: https://itsfoss.com/use-rar-ubuntu-linux/ +[7]: https://itsfoss.com/ubuntu-repositories/ +[8]: https://itsfoss.com/easily-share-files-linux-windows-mac-nitroshare/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/7zip-archive-ubuntu.png?resize=800%2C239&ssl=1 From 30269e2f37335319c8f16a335e8784997c642f52 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:00:27 +0800 Subject: [PATCH 0401/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=2021?= =?UTF-8?q?=20Best=20Kali=20Linux=20Tools=20for=20Hacking=20and=20Penetrat?= =?UTF-8?q?ion=20Testing=20sources/tech/20190509=2021=20Best=20Kali=20Linu?= =?UTF-8?q?x=20Tools=20for=20Hacking=20and=20Penetration=20Testing.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ols for Hacking and Penetration Testing.md | 271 ++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md diff --git a/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md new file mode 100644 index 0000000000..13c9f19888 --- /dev/null +++ b/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -0,0 +1,271 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) +[#]: via: (https://itsfoss.com/best-kali-linux-tools/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +21 Best Kali Linux Tools for Hacking and Penetration Testing +====== + +_**Here’s our list of best Kali Linux tools that will allow you to assess the security of web-servers and help in performing hacking and pen-testing.**_ + +If you read the [Kali Linux review][1], you know why it is considered one of the [best Linux distributions for hacking and pen-testing][2] and rightly so. It comes baked in with a lot of tools to make it easier for you to test, hack, and for anything else related to digital forensics. + +It is one of the most recommended Linux distro for ethical hackers. Even if you are not a hacker but a webmaster – you can still utilize some of the tools to easily run a scan of your web server or web page. + +In either case, no matter what your purpose is – we shall take a look at some of the best Kali Linux tools that you should be using. + +_Note that not all tools mentioned here are open source._ + +### Top Kali Linux Tools for Hacking and Penetration Testing + +![Kali Linux][3] + +There are several types of tools that comes pre-installed. If you do not find a tool installed, simply download it and set it up. It’s easy. + +#### 1\. Nmap + +![Kali Linux Nmap][4] + +[Nmap][5] or “Network Mapper” is one of the most popular tools on Kali Linux for information gathering. In other words, to get insights about the host, its IP address, OS detection, and similar network security details (like the number of open ports and what they are). + +It also offers features for firewall evasion and spoofing. + +#### 2\. Lynis + +![Lynis Kali Linux Tool][6] + +[Lynis][7] is a powerful tool for security auditing, compliance testing, and system hardening. Of course, you can also utilize this for vulnerability detection and penetration testing as well. + +It will scan the system according to the components it detects. For example, if it detects Apache – it will run Apache-related tests for pin point information. + +#### 3\. WPScan + +![][8] + +WordPress is one of the [best open source CMS][9] and this would be the best free WordpPress security auditing tool. It’s free but not open source. + +If you want to know whether a WordPress blog is vulnerable in some way, [WPScan][10] is your friend. + +In addition, it also gives you details of the plugins active. Of course, a well-secured blog may not give you a lot of details, but it is still the best tool for WordPress security scans to find potential vulnerabilities. + +#### 4\. Aircrack-ng + +![][11] + +[Aircrack-ng][12] is a collection of tools to assess WiFi network security. It isn’t just limited to monitor and get insights – but it also includes the ability to compromise a network (WEP, WPA 1, and WPA 2). + +If you forgot the password of your own WiFi network – you can try using this to regain access. It also includes a variety of wireless attacks with which you can target/monitor a WiFi network to enhance its security. + +#### 5\. Hydra + +![][13] + +If you are looking for an interesting tool to crack login/password pairs, [Hydra][14] will be one of the best Kali Linux tools that comes pre-installed. + +It may not be actively maintained anymore – but it is now on [GitHub][15], so you can contribute working on it as well. + +[][16] + +Suggested read [Year 2013 For Linux] 14 New Linux Distributions Born + +#### 6\. Wireshark + +![][17] + +[Wireshark][18] is the most popular network analyzer that comes baked in with Kali Linux. It can be categorized as one of the best Kali Linux tools for network sniffing as well. + +It is being actively maintained, so I would definitely recommend trying this out. + +#### 7\. Metasploit Framework + +![][19] + +[Metsploit Framework][20] is the most used penetration testing framework. It offers two editions – one (open source) and the second is the pro version to it. With this tool, you can verify vulnerabilities, test known exploits, and perform a complete security assessment. + +Of course, the free version won’t have all the features, so if you are into serious stuff, you should compare the editions [here][21]. + +#### 8\. Skipfish + +![][22] + +Similar to WPScan, but not just focused for WordPress. [Skipfish][23] is a web application scanner that would give you insights for almost every type of web applications. It’s fast and easy to use. In addition, its recursive crawl method makes it even better. + +For professional web application security assessments, the report generated by Skipfish will come in handy. + +#### 9\. Maltego + +![][24] + +[Maltego][25] is an impressive data mining tool to analyze information online and connect the dots (if any). As per the information, it creates a directed graph to help analyze the link between those pieces of data. + +Do note, that this isn’t an open source tool. + +It comes pre-installed, however, you will have to sign up in order to select which edition you want to use. If you want for personal use, the community edition will suffice (you just need to register for an account) but if you want to utilize for commercial purpose, you need the subscription to the classic or XL version. + +#### 10\. Nessus + +![Nessus][26] + +If you have a computer connected to a network, Nessus can help find vulnerabilities that a potential attacker may take advantage of. Of course, if you are an administrator for multiple computers connected to a network, you can make use of it and secure those computers. + +However, this is not a free tool anymore, you can try it free for 7 days on from its [official website][27]. + +#### 11\. Burp Suite Scanner + +![][28] + +[Burp Suite Scanner][29] is a fantastic web security analysis tool. Unlike other web application security scanner, Burp offers a GUI and quite a few advanced tools. + +However, the community edition restricts the features to only some essential manual tools. For professionals, you will have to consider upgrading. Similar to the previous tool, this isn’t open source either. + +I’ve used the free version, but if you want more details on it, you should check out the features available on their [official website][29]. + +#### 12\. BeEF + +![][30] + +BeEF (Browser Exploitation Framework) is yet another impressive tool. It has been tailored for penetration testers to assess the security of a web browser. + +This is one of the best Kali Linux tools because a lot of users do want to know and fix the client-side problems when talking about web security. + +#### 13\. Apktool + +![][31] + +[Apktool][32] is indeed one of the popular tools found on Kali Linux for reverse engineering Android apps. Of course, you should make good use of it – for educational purposes. + +[][33] + +Suggested read 4 Format Factory Alternative In Linux + +With this tool, you can experiment some stuff yourself and let the original developer know about your idea as well. What do you think you’ll be using it for? + +#### 14\. sqlmap + +![][34] + +If you were looking for an open source penetration testing tool – [sqlmap][35] is one of the best. It automates the process of exploiting SQL injection flaws and helps you take over database servers. + +#### 15\. John the Ripper + +![John The Ripper][36] + +[John the Ripper][37] is a popular password cracker tool available on Kali Linux. It’s free and open source as well. But, if you are not interested in the [community-enhanced version][37], you can choose the [pro version][38] for commercial use. + +#### 16\. Snort + +Want real-time traffic analysis and packet logging capability? [Snort][39] has got your back. Even being an open source intrusion prevention system, it has a lot to offer. + +The [official website][40] mentions the procedure to get it installed if you don’t have it already. + +#### 17\. Autopsy Forensic Browser + +![][41] + +[Autopsy][42] is a digital forensic tool to investigate what happened on your computer. Well, you can also use it to recover images from SD card. It is also being used by law enforcement officials. You can read the [documentation][43] to explore what you can do with it. + +You should also check out their [GitHub page][44]. + +#### 18\. King Phisher + +![King Phisher][45] + +Phishing attacks are very common nowadays. And, [King Phisher tool][46] helps test, and promote user awareness by simulating real-world phishing attacks. For obvious reasons, you will need permission to simulate it on a server content of an organization. + +#### 19\. Nikto + +![Nikto][47] + +[Nikto][48] is a powerful web server scanner – that makes it one of the best Kali Linux tools available. It checks in against potentially dangerous files/programs, outdated versions of server, and many more things. + +#### 20\. Yersinia + +![][49] + +[Yersinia][50] is an interesting framework to perform Layer 2 attacks (Layer 2 refers to the data link layer of [OSI model][51]) on a network. Of course, if you want a network to be secure, you will have to consider all the seven layers. However, this tool focuses on Layer 2 and a variety of network protocols that include STP, CDP, DTP, and so on. + +#### 21\. Social Engineering Toolkit (SET) + +![][52] + +If you are into pretty serious penetration testing stuff, this should be one of the best tools you should check out. Social engineering is a big deal and with [SET][53] tool, you can help protect against such attacks. + +**Wrapping Up** + +There’s actually a lot of tools that comes bundled with Kali Linux. Do refer to Kali Linux’ [official tool listing page][54] to find them all. + +You will find some of them to be completely free and open source while some to be proprietary solutions (yet free). However, for commercial purpose, you should always opt for the premium editions. + +We might have missed one of your favorite Kali Linux tools. Did we? Let us know about it in the comments section below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-kali-linux-tools/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/kali-linux-review/ +[2]: https://itsfoss.com/linux-hacking-penetration-testing/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-tools.jpg?resize=800%2C518&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-nmap.jpg?resize=800%2C559&ssl=1 +[5]: https://nmap.org/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/lynis-kali-linux-tool.jpg?resize=800%2C525&ssl=1 +[7]: https://cisofy.com/lynis/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/wpscan-kali-linux.jpg?resize=800%2C545&ssl=1 +[9]: https://itsfoss.com/open-source-cms/ +[10]: https://wpscan.org/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/aircrack-ng-kali-linux-tool.jpg?resize=800%2C514&ssl=1 +[12]: https://www.aircrack-ng.org/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/hydra-kali-linux.jpg?resize=800%2C529&ssl=1 +[14]: https://github.com/vanhauser-thc/thc-hydra +[15]: https://github.com/vanhauser-thc/THC-Archive +[16]: https://itsfoss.com/new-linux-distros-2013/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/wireshark-network-analyzer.jpg?resize=800%2C556&ssl=1 +[18]: https://www.wireshark.org/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/metasploit-framework.jpg?resize=800%2C561&ssl=1 +[20]: https://github.com/rapid7/metasploit-framework +[21]: https://www.rapid7.com/products/metasploit/download/editions/ +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/skipfish-kali-linux-tool.jpg?resize=800%2C515&ssl=1 +[23]: https://gitlab.com/kalilinux/packages/skipfish/ +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/maltego.jpg?resize=800%2C403&ssl=1 +[25]: https://www.paterva.com/web7/buy/maltego-clients.php +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nessus.jpg?resize=800%2C456&ssl=1 +[27]: https://www.tenable.com/try +[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/burp-suite-community-edition-800x582.jpg?resize=800%2C582&ssl=1 +[29]: https://portswigger.net/burp +[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/beef-framework.jpg?resize=800%2C339&ssl=1 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/apktool.jpg?resize=800%2C504&ssl=1 +[32]: https://github.com/iBotPeaches/Apktool +[33]: https://itsfoss.com/format-factory-alternative-linux/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/sqlmap.jpg?resize=800%2C528&ssl=1 +[35]: http://sqlmap.org/ +[36]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/john-the-ripper.jpg?ssl=1 +[37]: https://github.com/magnumripper/JohnTheRipper +[38]: https://www.openwall.com/john/pro/ +[39]: https://www.snort.org/ +[40]: https://www.snort.org/#get-started +[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/autopsy-forensic-browser.jpg?resize=800%2C319&ssl=1 +[42]: https://www.sleuthkit.org/autopsy/ +[43]: https://www.sleuthkit.org/autopsy/docs.php +[44]: https://github.com/sleuthkit/autopsy +[45]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/king-phisher.jpg?resize=800%2C626&ssl=1 +[46]: https://github.com/securestate/king-phisher +[47]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nikto.jpg?resize=800%2C511&ssl=1 +[48]: https://gitlab.com/kalilinux/packages/nikto/ +[49]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/yersinia.jpg?resize=800%2C516&ssl=1 +[50]: https://github.com/tomac/yersinia +[51]: https://en.wikipedia.org/wiki/OSI_model +[52]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/social-engineering-toolkit.jpg?resize=800%2C511&ssl=1 +[53]: https://www.trustedsec.com/social-engineer-toolkit-set/ +[54]: https://tools.kali.org/tools-listing From efcd02091689af1a2407ab27dcbf9321a9d9f991 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:01:06 +0800 Subject: [PATCH 0402/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190506=20How?= =?UTF-8?q?=20to=20Add=20Application=20Shortcuts=20on=20Ubuntu=20Desktop?= =?UTF-8?q?=20sources/tech/20190506=20How=20to=20Add=20Application=20Short?= =?UTF-8?q?cuts=20on=20Ubuntu=20Desktop.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Application Shortcuts on Ubuntu Desktop.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md diff --git a/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md new file mode 100644 index 0000000000..eb22a17365 --- /dev/null +++ b/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) +[#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Add Application Shortcuts on Ubuntu Desktop +====== + +_**In this quick tutorial, you’ll learn how to add application shortcuts on desktop in Ubuntu and other distributions that use GNOME desktop.**_ + +A classic desktop operating systems always have icons on the ‘desktop screen’. These desktop icons could include the file manager, the trash bin and the shortcut to applications. + +While installing applications in Windows, some of the programs ask if you want to create a shortcut on the desktop. That’s not the case in Linux though. + +But if you are a fan of this feature, let me show you how you can add desktop shortcuts to your favorite applications in [Ubuntu][1] and other Linux distributions. + +![Application Shortcuts on Desktop in Ubuntu with GNOME desktop][2] + +In case you are wondering about the looks of my desktop, I am using Ant theme with Tela icons. You can also get some [GTK themes][3] and [icons for Ubuntu][4] and change them as you like. + +### Adding desktop shortcut in Ubuntu + +![][5] + +Personally I prefer the Ubuntu launcher for application shortcuts. If I use a program frequently, I add it to the launcher. But I know not everyone has the same preference and a few people prefer the shortcuts on the desktop. + +Let’s see the simplest way of creating an application shortcut on the desktop. + +Disclaimer + +This tutorial has been tested on Ubuntu 18.04 LTS with [GNOME desktop][6]. It may work in other distributions and desktop environments but you have to try it on your own. Some GNOME specific steps may change so please pay attention while trying it on [other desktop environments][7]. + +[Subscribe to our YouTube Channel for More Linux Videos][8] + +#### Prerequisite + +First and foremost thing is to make sure that you have icons allowed on the GNOME desktop. + +If you followed the Ubuntu 18.04 customization tips, you know how to install GNOME Tweaks tool. In this tool, make sure that you have ‘Show Icons’ option enabled. + +![Allow icons on desktop in GNOME][9] + +Once you have made sure of that, it’s time to add some application shortcuts on the desktop. + +[][10] + +Suggested read How to Replace One Linux Distribution With Another From Dual Boot [Keeping Home Partition] + +#### Step 1: Locate the .desktop files of applications + +Go to Files -> Other Location -> Computer. + +![Go to Other Locations -> Computer][11] + +From here, go to the directory usr -> share -> applications. You’ll see icons of several [Ubuntu applications][12] you have installed here. Even if you don’t see the icons, you should see the .desktop files that are named as application.desktop. + +![Application Shortcuts][13] + +#### Step 2: Copy the .desktop file to desktop + +Now all you have to do here is to look for the application icon (or its desktop file). When you find it, either drag-drop the file to the desktop or copy the file (using Ctrl+C shortcut) and paste it on the desktop (using Ctrl+V shortcut). + +![Add .desktop file to the desktop][14] + +#### Step 3: Run the desktop file + +When you do that, you should see a text file kind of icon on the desktop instead of the logo of the application. Don’t worry, things will be different in a moment. + +What you have to do is to double click on that file on the desktop. It will warn you that it’s an ‘untrusted application launcher’ so click on Trust and Launch. + +![Launch Desktop Shortcut][15] + +The application will launch as usual but the good thing that you’ll notice that the .desktop file has now turned into the application icon. I believe you like the application shortcuts this way, don’t you? + +![Application shortcut on the desktop][16] + +#### Troubleshoot for Ubuntu 19.04 or GNOME 3.32 users + +If you use Ubuntu 19.04 or GNOME 3.32, you the .desktop file may not launch at all. You should right click on the .desktop file and select “Allow Launching”. + +After this, you should be able to launch the application and the application shortcut should be displayed properly on the desktop. + +**Conclusion** + +If you don’t like a certain application launcher on the desktop, just select it and delete it. It will delete the shortcut but the application will remain safely in your system. + +I hope you found this quick tip helpful and now you can enjoy the application shortcuts on Ubuntu desktop. + +[][17] + +Suggested read How to Install and Make Nemo the Default File Manager in Ubuntu + +If you have questions or suggestions, please let me know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-desktop-shortcut/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.ubuntu.com/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-ubuntu-desktop.jpeg?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/best-gtk-themes/ +[4]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-ubuntu-desktop-shortcut.jpeg?resize=800%2C450&ssl=1 +[6]: https://www.gnome.org/ +[7]: https://itsfoss.com/best-linux-desktop-environments/ +[8]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/allow-icons-on-desktop-gnome.jpg?ssl=1 +[10]: https://itsfoss.com/replace-linux-from-dual-boot/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Adding-desktop-shortcut-Ubuntu-gnome-1.png?resize=800%2C436&ssl=1 +[12]: https://itsfoss.com/best-ubuntu-apps/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/application-shortcuts-in-ubuntu.png?resize=800%2C422&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-desktop-file-to-desktop.jpeg?resize=800%2C458&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/launch-desktop-shortcut-.jpeg?resize=800%2C349&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-desktop-ubuntu-gnome.jpeg?resize=800%2C375&ssl=1 +[17]: https://itsfoss.com/install-nemo-file-manager-ubuntu/ From 45d3dfec8d184173e0db098ce9b4e9d84f288d99 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:01:20 +0800 Subject: [PATCH 0403/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190505=20[Rev?= =?UTF-8?q?iew]=20Void=20Linux,=20a=20Linux=20BSD=20Hybrid=20sources/tech/?= =?UTF-8?q?20190505=20-Review-=20Void=20Linux,=20a=20Linux=20BSD=20Hybrid.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-Review- Void Linux, a Linux BSD Hybrid.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md diff --git a/sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md b/sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md new file mode 100644 index 0000000000..cc8a660252 --- /dev/null +++ b/sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: ([Review] Void Linux, a Linux BSD Hybrid) +[#]: via: (https://itsfoss.com/void-linux/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +[Review] Void Linux, a Linux BSD Hybrid +====== + +There are distros that follow the crowd and there are others that try to make their own path through the tall weed. Today, we’ll be looking at a small distro that looks to challenge how a distro should work. We’ll be looking at Void Linux. + +### What is Void Linux? + +[Void Linux][1] is a “general purpose operating system, based on the monolithic Linux kernel. Its package system allows you to quickly install, update and remove software; software is provided in binary packages or can be built directly from sources with the help of the XBPS source packages collection.” + +![Void Linux Neofetch][2] + +Like Solus, Void Linux is written from scratch and does not depend on any other operating system. It is a rolling release. Unlike the majority of Linux distros, Void does not use [systemd][3]. Instead, it uses [runit][4]. Another thing that separates Void from the rest of Linux distros is the fact that they use LibreSSL instead of OpenSSL. Void also offers support for the [musl C library][5]. In fact, when you download a .iso file, you can choose between `glibc` and `musl`. + +The homegrown package manager that Void uses is named X Binary Package System (or xbps). According to the [Void wiki][6], xbps has the following features: + + * Supports multiple local and remote repositories (HTTP/HTTPS/FTP). + * RSA signed remote repositories + * SHA256 hashes for package metadata, files, and binary packages + * Supports package states (ala dpkg) to mitigate broken package * installs/updates + * Ability to resume partial package install/updates + * Ability to unpack only files that have been modified in * package updates + * Ability to use virtual packages + * Ability to check for incompatible shared libraries in reverse dependencies + * Ability to replace packages + * Ability to put packages on hold (to never update them) + * Ability to preserve/update configuration files + * Ability to force reinstallation of any installed package + * Ability to downgrade any installed package + * Ability to execute pre/post install/remove/update scriptlets + * Ability to check package integrity: missing files, hashes, missing or unresolved (reverse)dependencies, dangling or modified symlinks, etc. + + + +#### System Requirements + +According to the [Void Linux download page][7], the system requirements differ based on the architecture you choose. 64-bit images require “EM64T CPU, 96MB RAM, 350MB disk, Ethernet/WiFi for network installation”. 32-bit images require “Pentium 4 CPU (SSE2), 96MB RAM, 350MB disk, Ethernet / WiFi for network installation”. The [Void Linux handbook][8] recommends 700 MB for storage and also notes that “Flavor installations require more resources. How much more depends on the flavor.” + +Void also supports ARM devices. You can download [ready to boot images][9] for Raspberry Pi and several other [Raspberry Pi alternatives][10]. + +[][11] + +Suggested read NomadBSD, a BSD for the Road + +### Void Linux Installation + +NOTE: you can either install [Void Linux download page][7] via a live image or use a net installer. I used a live image. + +I was able to successfully install Void Linux on my Dell Latitude D630. This laptop has an Intel Centrino Duo Core processor running at 2.00 GHz, NVIDIA Quadro NVS 135M graphics chip, and 4 GB of RAM. + +![Void Linux Mate][12] + +After I `dd`ed the 800 MB Void Linux MATE image to my thumb drive and inserted it, I booted my computer. I was very quickly presented with a vanilla MATE desktop. To start installing Void, I opened up a terminal and typed `sudo void-installer`. After using the default password `voidlinux`, the installer started. The installer reminded me a little bit of the terminal Debian installer, but it was laid out more like FreeBSD. It was divided into keyboard, network, source, hostname, locale, timezone, root password, user account, bootloader, partition, and filesystems sections. + +Most of the sections where self-explanatory. In the source section, you could choose whether to install the packages from the local image or grab them from the web. I chose local because I did not want to eat up bandwidth or take longer than I had to. The partition and filesystems sections are usually handled automatically by most installers, but not on Void. In this case, the first section allows you to use `cfdisk` to create partitions and the second allows to specify what filesystems will be used in those partitions. I followed the partition layout on [this page][13]. + +If you install Void Linux from the local image, you definitely need to update your system. The [Void wiki][14] recommends running `xbps-install -Suv` until there are no more updates to install. It would probably be a good idea to reboot between batches of updates. + +### Experience with Void Linux + +So far in my Linux journey, Void Linux has been by far the most difficult. It feels more like I’m [using a BSD than a Linux distro][15]. (I guess that should not be surprising since Void was created by a former [NetBSD][16] developer who wanted to experiment with his own package manager.) The steps in the command line installer are closer to that of [FreeBSD][17] than Debian. + +Once Void was installed and updated, I went to work installing apps. Unfortunately, I ran into an issue with missing applications. Most of these applications come preinstalled on other distros. I had to install wget, unzip, git, nano, LibreOffice to name just a few. + +Void does not come with a graphical package manager. There are three unofficial frontends for the xbps package manager and [one is based on qt][18]. I ran into issues getting one of the Bash-based tools to work. It hadn’t been updated in 4-5 years. + +![Octoxbps][19] + +The xbps package manager is kinda interesting. It downloads the package and its signature to verify it. You can see the [terminal print out][20] from when I installed Mcomix. Xbps does not use the normal naming convention used in most package managers (ie `apt install` or `pacman -R`), instead, it uses `xbps-install`, `xbps-query`, `xbps-remove`. Luckily, the Void wiki had a [page][21] to show what xbps command relates to apt or dnf commands. + +[][22] + +Suggested read How To Solve: error: no such partition grub rescue in Ubuntu Linux + +The main repo for Void is located in Germany, so I decided to switch to a more local server to ease the burden on that server and to download packages quicker. Switching to a local mirror took a couple of tries because the documentation was not very clear. Documentation for Void is located in two different places: the [wiki][23] and the [handbook][24]. For me, the wiki’s [explanation][25] was confusing and I ran into issues. So, I searched for an answer on DuckDuckGo. From there I stumbled upon the [handbook’s instructions][26], which were much clearer. (The handbook is not linked on the Void Linux website and I had to stumble across it via search.) + +One of the nice things about Void is the speed of the system once everything was installed. It had the quickest boot time I have ever encountered. Overall, the system was very responsive. I did not run into any system crashes. + +### Final Thoughts + +Void Linux took more work to get to a useable state than any other distro I have tried. Even the BSDs I tried felt more polished than Void. I think the tagline “General purpose Linux” is misleading. It should be “Linux with hackers and tinkerers in mind”. Personally, I prefer using distros that are ready for me to use after installing. While it is an interesting combination of Linux and BSD ideas, I don’t think I’ll add Void to my short list of go-to distros. + +If you like tinkering with your Linux system or like building it from scratch, give [Void Linux][7] a try. + +Have you ever used Void Linux? What is your favorite Debian-based distro? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][27]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/void-linux/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://voidlinux.org/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Void-Linux-Neofetch.png?resize=800%2C562&ssl=1 +[3]: https://en.wikipedia.org/wiki/Systemd +[4]: http://smarden.org/runit/ +[5]: https://www.musl-libc.org/ +[6]: https://wiki.voidlinux.org/XBPS +[7]: https://voidlinux.org/download/ +[8]: https://docs.voidlinux.org/installation/base-requirements.html +[9]: https://voidlinux.org/download/#download-ready-to-boot-images-for-arm +[10]: https://itsfoss.com/raspberry-pi-alternatives/ +[11]: https://itsfoss.com/nomadbsd/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Void-Linux-Mate.png?resize=800%2C640&ssl=1 +[13]: https://wiki.voidlinux.org/Disks#Filesystems +[14]: https://wiki.voidlinux.org/Post_Installation#Updates +[15]: https://itsfoss.com/why-use-bsd/ +[16]: https://itsfoss.com/netbsd-8-release/ +[17]: https://www.freebsd.org/ +[18]: https://github.com/aarnt/octoxbps +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/OctoXBPS.jpg?resize=800%2C534&ssl=1 +[20]: https://pastebin.com/g31n1bFT +[21]: https://wiki.voidlinux.org/Rosetta_stone +[22]: https://itsfoss.com/solve-error-partition-grub-rescue-ubuntu-linux/ +[23]: https://wiki.voidlinux.org/ +[24]: https://docs.voidlinux.org/ +[25]: https://wiki.voidlinux.org/XBPS#Official_Repositories +[26]: https://docs.voidlinux.org/xbps/repositories/mirrors/changing.html +[27]: http://reddit.com/r/linuxusersgroup From 2d80d7f9549325f29bd71507d82e88c3ac5469f0 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:01:59 +0800 Subject: [PATCH 0404/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20Keep?= =?UTF-8?q?ing=20an=20open=20source=20project=20alive=20when=20people=20le?= =?UTF-8?q?ave=20sources/tech/20190510=20Keeping=20an=20open=20source=20pr?= =?UTF-8?q?oject=20alive=20when=20people=20leave.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... source project alive when people leave.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20190510 Keeping an open source project alive when people leave.md diff --git a/sources/tech/20190510 Keeping an open source project alive when people leave.md b/sources/tech/20190510 Keeping an open source project alive when people leave.md new file mode 100644 index 0000000000..31a0ab7412 --- /dev/null +++ b/sources/tech/20190510 Keeping an open source project alive when people leave.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Keeping an open source project alive when people leave) +[#]: via: (https://opensource.com/article/19/5/code-missing-community-management) +[#]: author: (Rodrigo Duarte Sousa https://opensource.com/users/rodrigods/users/tellesnobrega) + +Keeping an open source project alive when people leave +====== +How to find out what's done, what's not, and what's missing. +![][1] + +Suppose you wake up one day and decide to finally use that recipe video you keep watching all over social media. You get the ingredients, organize the necessary utensils, and start to follow the recipe steps. You cut this, cut that, then start heating the oven at the same time you put butter and onions in a pan. Then, your phone reminds you: you have a dinner appointment with your boss, and you're already late! You turn off everything and leave immediately, stopping the cooking process somewhere near the end. + +Some minutes later, your roommate arrives at home ready to have dinner and finds only the _ongoing work_ in the kitchen. They have the following options: + + 1. Clean up the mess and start cooking something from scratch. + 2. Order dinner and don’t bother to cook and/or fix the mess you left. + 3. Start cooking “around” the mess you left, which will probably take more time since most of the utensils are dirty and there isn’t much space left in the kitchen. + + + +If you left the printed version of the recipe somewhere, your roommate also has a fourth option. They could finish what you started! The problem is that they have no idea what's missing. It is not like you crossed out each completed step. Their best bet is either to call you or to examine all of your _changes_ to infer what is missing. + +In this example, the kitchen is like a software project, the utensils are the code, and the recipe is a new feature being implemented. Leaving something behind is not usually doable in a company's private project since you're accountable for your work and—in a scenario where you need to leave—it's almost certain that there is someone tracking/following the project, so they avoid having a "single point of failure." With open source projects, though, this continuity rarely happens. So how can we in the open source community deal with legacy, unfinished code, or code that is completed but no one dares touch it? + +### Knowledge legacy in open source projects + +We have always felt that open source is one of the best ways for an inexperienced software engineer to improve her skills. For many, open source projects offer their first hands-on experience with particular tools. [Version control systems][2], [unit][3] and [integration][4] tests, [continuous delivery][5], [code reviews][6], [features planning][7], [bug reporting/fixing][8], and more. + +In addition to learning opportunities, we can also view open source projects as a career opportunity—many senior engineers in the community get paid to be there, and you can add your contributions to your resume. That’s pretty cool. There's nothing like learning while improving your resume and getting potential employers' attention so you can pay your rent. + +Is this whole situation an infinite loop where everyone wins? The answer is obviously no. This post focuses on one of the main issues that arise in any project: the [bus/truck factor][9]. In the open source context, specifically, when people experience major changes such as a new job or other more personal factors, they tend to leave the community. We will first describe the problems that can arise from people leaving their _recipes_ unfinished by using [OpenStack][10] as an example. Then, we'll try to discuss some ideas to try to mitigate the issues. + +### Common problems + +In the past few years, we've seen a lot of changes in the [OpenStack][11] community, where some projects lost some portion of their active contributors team. These losses led to incomplete work and even finished modules without clear maintainers. Below are other examples of what happens when people suddenly leave. While this article uses OpenStack terms, such as “specs,” these issues easily apply to software development in general: + + * **Broken documentation:** A new API or setting either wasn't documented, or it was documented but not implemented. + * **Hard to resolve knowledge deficits:** For example, a new requirement and/or feature requires part of the code to be refactored but no one has the necessary expertise. + * **Incomplete features:** What are the missing tasks required for each feature? Which tasks were completed? + * **Debugging drama:** If the person who wrote the code isn't there, meaning that it takes a lot of engineering hours just to decrypt—so to speak—the code path that needs to be fixed. + + + +To illustrate, we will use the [Project Tree Deletion][12] feature. Project Tree Deletion is a tiny feature that one of us proposed more than three years ago and couldn’t complete. Basically, the main goal was to enable an OpenStack user/operator to erase a whole branch of projects without having to manually disable/delete every single of them starting from the leaves. Very straightforward, right? The PTD spec has been merged and has the following _work items_ : + + * Update API spec documentation. + * Add new rules to the file **policy.json**. + * Add new endpoints to mirror the new features. + * Implement the new deletion/disabling behavior for the project’s hierarchy. + + + +What about the sequence of steps (roadmap) to get these work items done? How do we know where to start and when what to tackle next? Are there any logical dependencies between the work items? How do we know where to start, and with what? + +Also, how do we know which work has been completed (if any)? One of the things that we do is look in the [blueprint][13] and/or the new [bug tracker][14], for example: + + * Recursive deletion and project disabling: (merged) + * API changes for Reseller: (merged) + * Add parent_id to GET /projects: (merged) + * Manager support for project cascade update: (merged) + * API support for cascade update: (abandoned) + * Manager support for project delete cascade: (merged) + * API support for project cascade delete: (abandoned) + * Add backend support for deleting a projects list: (merged) + * Test list project hierarchy is correct for a large tree: (merged) + * Fix cascade operations documentation: (merged) + * Revert “Fix cascade operations documentation”: (merged) + * Remove the APIs from the doc that aren't supported yet: (merged) + + + +Here we can see a lot of merged patches, but also that some were abandoned, and that some include the words Revert and Remove in their titles. Now we have strong evidence that this work is not completed, but at least some work was started to clean it up and avoid exposing something incomplete in the service API. Let’s dig a little bit deeper and look at the [_current_ delete project code][15]. + +There, we can see an added **cascade** argument (“cascade” resembles deleting related things together, so this argument must be somehow related to the proposed feature), and that it has a special block to treat the cases for the possible values of **cascade** : + + +``` +`def _delete_project(self, project, initiator=None, cascade=False):`[/code] [code] + +if cascade: +# Getting reversed project's subtrees list, i.e. from the leaves +# to the root, so we do not break parent_id FK. +subtree_list = self.list_projects_in_subtree(project_id) +subtree_list.reverse() +if not self._check_whole_subtree_is_disabled( +project_id, subtree_list=subtree_list): +raise exception.ForbiddenNotSecurity( +_('Cannot delete project %(project_id)s since its subtree ' +'contains enabled projects.') +% {'project_id': project_id}) + +project_list = subtree_list + [project] +projects_ids = [x['id'] for x in project_list] + +ret = self.driver.delete_projects_from_ids(projects_ids) +for prj in project_list: +self._post_delete_cleanup_project(prj['id'], prj, initiator) +else: +ret = self.driver.delete_project(project_id) +self._post_delete_cleanup_project(project_id, project, initiator) +``` + +What about the callers of this function? Do they use **cascade** at all? If we search for it, we only find occurrences in the backend tests: + + +``` +$ git grep "delete_project" | grep "cascade" | grep -v "def" +keystone/tests/unit/resource/test_backends.py: PROVIDERS.resource_api.delete_project(root_project['id'], cascade=True) +keystone/tests/unit/resource/test_backends.py: PROVIDERS.resource_api.delete_project(p1['id'], cascade=True) +``` + +We can also confirm this finding by looking at the [delete projects API implementation][16]. + +So it seems that we have a problem here, something simple that I started was left behind a very long time ago. How could the community or I have prevented this from happening? + +From the example above, one of the most apparent problems is the lack of a clear roadmap and list of completed tasks somewhere. To follow the actual implementation status, we had to dig into the blueprint/bug comments and the code. + +Based on this issue, we can sketch an idea: for each new feature, we need a roadmap stored somewhere to reflect the implementation status. Once the roadmap is defined within a spec, we can track each step as a [Launchpad][17] entry, for example, and have a better view of the progress status of that spec. + +Of course, these steps won’t prevent unfinished projects and they add a little bit of process, but following them can give a better view of what's missing so someone else from the community could finish or even revert what's there. + +### That’s not all + +What about other aspects of the project besides feature completion? We shouldn’t expect that every person on the core team is an expert in every single project module. This issue highlights another very important aspect of any open source community: mentoring. + +New people come to the community all the time and many have an incentive to continuing coming back as we discussed earlier. However, are our current community members willing to mentor them? How many times have you participated as a mentor in a program such as [Outreachy ][18]or [Google Summer of Code][19], or taken time to answer questions in the project’s chat? + +We also know that people eventually move on to other open source communities, so we have the chance of not leaving what we learned behind. We can always transmit that knowledge directly to those who are currently interested and actively asking questions, or indirectly, by writing documentation, blog posts, giving talks, and so forth. + +In order to have a healthy open source community, knowledge can’t be dominated by few people. We need to make an effort to have as many people capable of moving the project forward as possible. Also, a key aspect of mentoring is not only related to coding, but also to leadership skills. Preparing people to take roles like Project Team Lead, joining the Technical Committee, and so on is crucial if we intend to see the community grow even when we're not around anymore. + +Needless to say, mentoring is also an important skill for climbing the engineering ladder in most companies. Consider that another motivation. + +### To conclude + +Open source should not be treated as only the means to an end. Collaboration is a crucial part of these projects, and alongside mentoring, should always be treated as a first citizen in any open source community. And, of course, we will fix the unfinished spec used as this article's example. + +If you are part of an open source community, it is your responsibility to be focusing on sharing your knowledge while you are still around. Chances are that no one is going to tell you to do so, it should be part of the routine of any open source collaborator. + +What are other ways of sharing knowledge? What are your thoughts and ideas about the issue? + +_This original article was posted on[rodrigods][20]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/code-missing-community-management + +作者:[Rodrigo Duarte Sousa][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/rodrigods/users/tellesnobrega +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_question_B.png?itok=f88cyt00 +[2]: https://en.wikipedia.org/wiki/Version_control +[3]: https://en.wikipedia.org/wiki/Unit_testing +[4]: https://en.wikipedia.org/wiki/Integration_testing +[5]: https://en.wikipedia.org/wiki/Continuous_delivery +[6]: https://en.wikipedia.org/wiki/Code_review +[7]: https://www.agilealliance.org/glossary/sprint-planning/ +[8]: https://www.softwaretestinghelp.com/how-to-write-good-bug-report/ +[9]: https://en.wikipedia.org/wiki/Bus_factor +[10]: https://www.openstack.org/ +[11]: /resources/what-is-openstack +[12]: https://review.opendev.org/#/c/148730/35 +[13]: https://blueprints.launchpad.net/keystone/+spec/project-tree-deletion +[14]: https://bugs.launchpad.net/keystone/+bug/1816105 +[15]: https://github.com/openstack/keystone/blob/master/keystone/resource/core.py#L475-L519 +[16]: https://github.com/openstack/keystone/blob/master/keystone/api/projects.py#L202-L214 +[17]: https://launchpad.net +[18]: https://www.outreachy.org/ +[19]: https://summerofcode.withgoogle.com/ +[20]: https://blog.rodrigods.com/knowledge-legacy-the-issue-of-passing-the-baton/ From b21b84cb214683fd81144ed570157e7e617363f4 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:02:14 +0800 Subject: [PATCH 0405/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=205=20?= =?UTF-8?q?open=20source=20hardware=20products=20for=20the=20great=20outdo?= =?UTF-8?q?ors=20sources/tech/20190510=205=20open=20source=20hardware=20pr?= =?UTF-8?q?oducts=20for=20the=20great=20outdoors.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ardware products for the great outdoors.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20190510 5 open source hardware products for the great outdoors.md diff --git a/sources/tech/20190510 5 open source hardware products for the great outdoors.md b/sources/tech/20190510 5 open source hardware products for the great outdoors.md new file mode 100644 index 0000000000..357fbfdcb8 --- /dev/null +++ b/sources/tech/20190510 5 open source hardware products for the great outdoors.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 open source hardware products for the great outdoors) +[#]: via: (https://opensource.com/article/19/5/hardware-outdoors) +[#]: author: (Michael Weinberg https://opensource.com/users/mweinberg/users/aliciagibb) + +5 open source hardware products for the great outdoors +====== +Here's some equipment you can buy or make yourself for hitting the great +outdoors, no generators or batteries required. +![Tree clouds][1] + +When people think about open source hardware, they often think about the general category of electronics that can be soldered and needs batteries. While there are [many][2] fantastic open source pieces of electronics, the overall category of open source hardware is much broader. This month we take a look at open source hardware that you can take out into the world, no power outlet or batteries required. + +### Hummingbird Hammocks + +[Hummingbird Hammocks][3] offers an entire line of open source camping gear. You can set up an open source [rain tarp][4]... + +![An open source rain tarp from Hummingbird Hammocks][5] + +...with open source [friction adjusters][6] + +![Open source friction adjusters from Hummingbird Hammocks.][7] + +Open source friction adjusters from Hummingbird Hammocks. + +...over your open source [hammock][8] + +![An open source hammock from Hummingbird Hammocks.][9] + +An open source hammock from Hummingbird Hammocks. + +...hung with open source [tree straps][10]. + +![Open source tree straps from Hummingbird Hammocks.][11] + +Open source tree straps from Hummingbird Hammocks. + +The design for each of these items is fully documented, so you can even use them as a starting point for making your own outdoor gear (if you are willing to trust friction adjusters you design yourself). + +### Openfoil + +[Openfoil][12] is an open source hydrofoil for kitesurfing. Hydrofoils are attached to the bottom of kiteboards and allow the rider to rise out of the water. This aspect of the design makes riding in low wind situations and with smaller kites easier. It can also reduce the amount of noise the board makes on the water, making for a quieter experience. Because this hydrofoil is open source you can customize it to your needs and adventure tolerance. + +![Openfoil, an open source hydrofoil for kitesurfing.][13] + +Openfoil, an open source hydrofoil for kitesurfing. + +### Solar water heater + +If you prefer your outdoors-ing a bit closer to home, you could build this open source [solar water heater][14] created by the [Anisa Foundation][15]. This appliance focuses energy from the sun to heat water that can then be used in your home, letting you reduce your carbon footprint without having to give up long, hot showers. Of course, you can also [monitor its temperature ][16]over the internet if you need to feel connected. + +![An open source solar water heater from the Anisa Foundation.][17] + +An open source solar water heater from the Anisa Foundation. + +## Wrapping up + +As these projects make clear, open source hardware is more than just electronics. You can take it with you to the woods, to the beach, or just to your roof. Next month we’ll talk about open source instruments and musical gear. Until then, [certify][18] your open source hardware! + +Learn how and why you may want to start using the Open Source Hardware Certification logo on an... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/hardware-outdoors + +作者:[Michael Weinberg][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/mweinberg/users/aliciagibb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds) +[2]: https://certification.oshwa.org/list.html +[3]: https://hummingbirdhammocks.com/ +[4]: https://certification.oshwa.org/us000102.html +[5]: https://opensource.com/sites/default/files/uploads/01-hummingbird_hammocks_rain_tarp.png (An open source rain tarp from Hummingbird Hammocks) +[6]: https://certification.oshwa.org/us000105.html +[7]: https://opensource.com/sites/default/files/uploads/02-hummingbird_hammocks_friction_adjusters_400_px.png (Open source friction adjusters from Hummingbird Hammocks.) +[8]: https://certification.oshwa.org/us000095.html +[9]: https://opensource.com/sites/default/files/uploads/03-hummingbird_hammocks_hammock_400_px.png (An open source hammock from Hummingbird Hammocks.) +[10]: https://certification.oshwa.org/us000098.html +[11]: https://opensource.com/sites/default/files/uploads/04-hummingbird_hammocks_tree_straps_400_px_0.png (Open source tree straps from Hummingbird Hammocks.) +[12]: https://certification.oshwa.org/fr000004.html +[13]: https://opensource.com/sites/default/files/uploads/05-openfoil-original_size.png (Openfoil, an open source hydrofoil for kitesurfing.) +[14]: https://certification.oshwa.org/mx000002.html +[15]: http://www.fundacionanisa.org/index.php?lang=en +[16]: https://thingspeak.com/channels/72565 +[17]: https://opensource.com/sites/default/files/uploads/06-solar_water_heater_500_px.png (An open source solar water heater from the Anisa Foundation.) +[18]: https://certification.oshwa.org/ From 0b6fbf51e8e96424047bb7911af2dcab399909a1 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:02:26 +0800 Subject: [PATCH 0406/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=20A=20?= =?UTF-8?q?day=20in=20the=20life=20of=20an=20open=20source=20performance?= =?UTF-8?q?=20engineering=20team=20sources/tech/20190509=20A=20day=20in=20?= =?UTF-8?q?the=20life=20of=20an=20open=20source=20performance=20engineerin?= =?UTF-8?q?g=20team.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pen source performance engineering team.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20190509 A day in the life of an open source performance engineering team.md diff --git a/sources/tech/20190509 A day in the life of an open source performance engineering team.md b/sources/tech/20190509 A day in the life of an open source performance engineering team.md new file mode 100644 index 0000000000..373983e8bc --- /dev/null +++ b/sources/tech/20190509 A day in the life of an open source performance engineering team.md @@ -0,0 +1,138 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A day in the life of an open source performance engineering team) +[#]: via: (https://opensource.com/article/19/5/life-performance-engineer) +[#]: author: (Aakarsh Gopi https://opensource.com/users/aakarsh/users/portante/users/anaga/users/gameloid) + +A day in the life of an open source performance engineering team +====== +Collaborating with the community enables performance engineering to +address the confusion and complexity that come with working on a broad +spectrum of products. +![Team checklist and to dos][1] + +In today's world, open source software solutions are a collaborative effort of the community. Can a performance engineering team operate the same way, by collaborating with the community to address the confusion and complexity that come with working on a broad spectrum of products? + +To answer that question, we need to explore some basic questions: + + * What does a performance engineering team do? + * How does a performance engineering team fulfill its responsibilities? + * How are open source tools developed or leveraged for performance analysis? + + + +The term "performance engineering" has different meanings, which causes difficulty in figuring out a performance engineering team's responsibilities. Adding to the confusion, a team may be charged with working on a broad spectrum of products, ranging from an operating system like RHEL, whose performance can be significantly impacted by hardware components (CPU caches, network interface controllers, disk technologies, etc.), to something much higher up in the stack like Kubernetes, which comes with the added challenges of operating at scale without compromising on performance. + +Performance engineering has progressed a lot since the days of running manual A/B testing and single-system benchmarks. Now, these teams test cloud infrastructures and add machine learning classifiers as a component in the CI/CD pipeline for identifying performance regression in releases of products. + +### What does a performance engineering team do? + +A performance engineering team is generally responsible for the following (among other things): + + * Identifying potential performance issues + * Identifying any scale issues that could occur + * Developing tuning guides and/or tools that would enable the user to achieve the most out of a product + * Developing guides and/or working with customers to help with capacity planning + * Providing customers with performance expectations for different use cases of the product + + + +The mission of our specific team is to: + + * Establish performance and scale leadership of the Red Hat portfolio; the scope includes component level, system, and solution analysis + * Collaborate with engineering, product management, product marketing, and Customer Experience and Engagement (CEE), as well as hardware and software partners + * Deliver public-facing guidance, internal enablement, and continuous integration tests + + + +Our team fulfills our mission in the following ways: + + * We work with product teams to set performance goals and develop performance tests to run against those products deployed to see how they measure up to those goals. + * We also work to re-run performance tests to ensure there are no regressions in behaviors. + * We develop open source tooling to achieve our product performance goals, making them available to the communities where the products are derived to re-create what we do. + * We work to be transparent and open about how we do performance engineering; sharing these methods and approaches benefits communities, allowing them to reuse our work, and benefits us by leveraging the work they contribute with these tools. + + + +### How does a performance engineering team fulfill its responsibilities? + +Meeting these responsibilities requires collaboration with other teams, such as product management, development, QA/QE, documentation, and consulting, and with the communities. + +_Collaboration_ allows a team to be successful by pulling together team members' diverse knowledge and experience. A performance engineering team builds tools to share their knowledge both within the team and with the community, furthering the value of collaboration. + +Our performance engineering team achieves success through: + + * **Collaboration:** _Intra_ -team collaboration is as important as _inter_ -team collaboration for our performance engineering team + * Most performance engineers tend to create a niche for themselves in one or more sub-disciplines of performance engineering via tooling, performance analysis, systems knowledge, systems configuration, and such. Our team is composed of engineers with knowledge of setting up/configuring systems across the product stack, those who know how a configuration option would affect the system's performance, and so on. Our team's success is heavily reliant on effective collaboration between performance engineers on the team. + * Our team works closely with other organizations at various levels within Red Hat and the communities where our products are derived. + * **Knowledge:** To understand the performance implications of configuration and/or system changes, deep knowledge of the product alone is not sufficient. + * Our team has the knowledge to cover performance across all levels of the stack: + * Hardware setup and configuration + * Networking and scale considerations + * Operating system setup and configuration (Linux kernel, userspace stack) + * Storage sub-systems (Ceph) + * Cloud infrastructure (OpenStack, RHV) + * Cloud deployments (OpenShift/Kubernetes) + * Product architectures + * Software technologies (databases like Postgres; software-defined networking and storage) + * Product interactions with the underlying hardware + * Tooling to monitor and accomplish repeatable benchmarking + * **Tooling:** The differentiator for our performance engineering team is the data collected through its tools to help tackle performance analysis complexity in the environments where our products are deployed. + + + +### How are open source tools developed or leveraged for performance analysis? + +Tooling is no longer a luxury but a need for today's performance engineering teams. With today's product solutions being so complex (and increasing in complexity as more solutions are composed to solve ever-larger problems), we need tools to help us run performance test suites in a repeatable manner, collect data about those runs, and help us distill that data so it becomes understandable and usable. + +Yet, no performance engineering team is judged on how performance analysis is done, but rather on the results achieved from this analysis. + +This tension can be resolved by collaboratively developing tools. A performance engineering team can't spend all its time developing tools, since that would prevent it from effectively collecting data. By developing its tools in a collaborative manner, a team can leverage work from the community to make further progress while still generating the result by which they will be measured. + +Tooling is the backbone of our performance engineering team, and we strive to use the tools already available upstream. When no tools are available in the community that fit our needs, we've built tools that help us achieve our goals and made them available to the community. Open sourcing our tools has helped us immensely because we receive contributions from our competitors and partners, allowing us to solve problems collectively through collaboration. + +![Performance Engineering Tools][2] + +Following are some of the tools our team has contributed to and rely upon for our work: + + * **[Perf-c2c][3]:** Is your performance impacted by false sharing in CPU caches? The perf-c2c tool can help you tackle this problem by helping you inspect the cache lines where false sharing is detected and understand the readers/writers accessing those cache lines along with the offsets where those accesses occurred. You can read more about this tool on [Joe Mario's blog][4]. + * **[Pbench][5]:** Do you repeat the same steps when collecting data about performance, but fail to do it consistently? Or do you find it difficult to compare results with others because you're collecting different configuration data? Pbench is a tool that attempts to standardize the way data is collected for performance so comparisons and historical reviews are much easier. Pbench is at the heart of our tooling efforts, as most of the other tools consume it in some form. Pbench is a Swiss Army Knife, as it allows the user to run benchmarks such as fio, uperf, or custom, user-defined tests while gathering metrics through tools such as sar, iostat, and pidstat, standardizing the methods of collecting configuration data about the environment. Pbench provides a dashboard UI to help review and analyze the data collected. + * **[Browbeat][6]:** Do you want to monitor a complex environment such as an OpenStack cluster while running tests? Browbeat is the solution, and its power lies in its ability to collect comprehensive data, ranging from logs to system metrics, about an OpenStack cluster while it orchestrates workloads. Browbeat can also monitor the OpenStack cluster while users run test/workloads of their choice either manually or through their own automation. + * **[Ripsaw][7]:** Do you want to compare the performance of different Kubernetes distros against the same platform? Do you want to compare the performance of the same Kubernetes distros deployed on different platforms? Ripsaw is a relatively new tool created to run workloads through Kubernetes native calls using the Ansible operator framework to provide solutions to the above questions. Ripsaw's unique selling point is that it can run against any kind of Kubernetes distribution, thus it would run the same against a Kubernetes cluster, on Minikube, or on an OpenShift cluster deployed on OpenStack or bare metal. + * **[ClusterLoader][8]:** Ever wondered how an OpenShift component would perform under different cluster states? If you are looking for an answer that can stress the cluster, ClusterLoader will help. The team has generalized the tool so it can be used with any Kubernetes distro. It is currently hosted in the [perf-tests repository][9]. + + + +### Bottom line + +Given the scale at which products are evolving rapidly, performance engineering teams need to build tooling to help them keep up with products' evolution and diversification. + +Open source-based software solutions are a collaborative effort of the community. Our performance engineering team operates in the same way, collaborating with the community to address the confusion and complexity that comes with working on a broad spectrum of products. By developing our tools in a collaborative manner and using tools from the community, we are leveraging the community's work to make progress, while still generating the results we are measured on. + +_Collaboration_ is our key to accomplish our goals and ensure the success of our team. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/life-performance-engineer + +作者:[Aakarsh Gopi ][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/aakarsh/users/portante/users/anaga/users/gameloid +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://opensource.com/sites/default/files/uploads/performanceengineeringtools.png (Performance Engineering Tools) +[3]: http://man7.org/linux/man-pages/man1/perf-c2c.1.html +[4]: https://joemario.github.io/blog/2016/09/01/c2c-blog/ +[5]: https://github.com/distributed-system-analysis/pbench +[6]: https://github.com/openstack/browbeat +[7]: https://github.com/cloud-bulldozer/ripsaw +[8]: https://github.com/openshift/origin/tree/master/test/extended/cluster +[9]: https://github.com/kubernetes/perf-tests/tree/master/clusterloader From 671542ea0ee8b69b0a6825359c096732187d5535 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:02:47 +0800 Subject: [PATCH 0407/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=205=20?= =?UTF-8?q?essential=20values=20for=20the=20DevOps=20mindset=20sources/tec?= =?UTF-8?q?h/20190509=205=20essential=20values=20for=20the=20DevOps=20mind?= =?UTF-8?q?set.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...essential values for the DevOps mindset.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20190509 5 essential values for the DevOps mindset.md diff --git a/sources/tech/20190509 5 essential values for the DevOps mindset.md b/sources/tech/20190509 5 essential values for the DevOps mindset.md new file mode 100644 index 0000000000..4746d2ffaa --- /dev/null +++ b/sources/tech/20190509 5 essential values for the DevOps mindset.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 essential values for the DevOps mindset) +[#]: via: (https://opensource.com/article/19/5/values-devops-mindset) +[#]: author: (Brent Aaron Reed https://opensource.com/users/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed) + +5 essential values for the DevOps mindset +====== +People and process take more time but are more important than any +technology "silver bullet" in solving business problems. +![human head, brain outlined with computer hardware background][1] + +Many IT professionals today struggle with adapting to change and disruption. Are you struggling with just trying to keep the lights on, so to speak? Do you feel overwhelmed? This is not uncommon. Today, the status quo is not enough, so IT constantly tries to re-invent itself. + +With over 30 years of combined IT experience, we have witnessed how important people and relationships are to IT's ability to be effective and help the business thrive. However, most of the time, our conversations about IT solutions start with technology rather than people and process. The propensity to look for a "silver bullet" to address business and IT challenges is far too common. But you can't just buy innovation, DevOps, or effective teams and ways of working; they need to be nurtured, supported, and guided. + +With disruption so prevalent and there being such a critical demand for speed of change, we need both discipline and guardrails. The five essential values for the DevOps mindset, described below, will support the practices that will get us there. These values are not new ideas; they are refactored as we've learned from our experience. Some of the values may be interchangeable, they are flexible, and they guide overall principles that support (like a pillar) these five values. + +![5 essential values for the DevOps mindset][2] + +### 1\. Feedback from stakeholders is essential + +How do we know if we are creating more value for us than for our stakeholders? We need persistent quality data to analyze, inform, and drive better decisions. Relevant information from trusted sources is vital for any business to thrive. We need to listen to and understand what our stakeholders are saying—and not saying—and we need to implement changes in a way that enables us to adjust our thinking—and our processes and technologies—and adapt them as needed to delight our stakeholders. Too often, we see little change, or lots of change for the wrong reasons, because of incorrect information (data). Therefore, aligning change to our stakeholders' feedback is an essential value and helps us focus on what is most important to making our company successful. + +> Focus on our stakeholders and their feedback rather than simply changing for the sake of change. + +### 2\. Improve beyond the limits of today's processes + +We want our products and services to continuously delight our customers—our most important stakeholders—therefore, we need to improve continually. This is not only about quality; it could also mean costs, availability, relevance, and many other goals and factors. Creating repeatable processes or utilizing a common framework is great—they can improve governance and a host of other issues—however, that should not be our end goal. As we look for ways to improve, we must adjust our processes, complemented by the right tech and tools. There may be reasons to throw out a "so-called" framework because not doing so could add waste—or worse, simply "cargo culting" (doing something with of no value or purpose). + +> Strive to always innovate and improve beyond repeatable processes and frameworks. + +### 3\. No new silos to break down silos + +Silos and DevOps are incompatible. We see this all the time: an IT director brings in so-called "experts" to implement agile and DevOps, and what do they do? These "experts" create a new problem on top of the existing problem, which is another silo added to an IT department and a business riddled with silos. Creating "DevOps" titles goes against the very principles of agile and DevOps, which are based on the concept of breaking down silos. In both agile and DevOps, teamwork is essential, and if you don't work in a self-organizing team, you're doing neither of them. + +> Inspire and share collaboratively instead of becoming a hero or creating a silo. + +### 4\. Knowing your customer means cross-organization collaboration + +No part of the business is an independent entity because they all have stakeholders, and the primary stakeholder is always the customer. "The customer is always right" (or the king, as I like to say). The point is, without the customer, there really is no business, and to stay in business today, we need to "differentiate" from our competitors. We also need to know how our customers feel about us and what they want from us. Knowing what the customer wants is imperative and requires timely feedback to ensure the business addresses these primary stakeholders' needs and concerns quickly and responsibly. + +![Minimize time spent with build-measure-learn process][3] + +Whether it comes from an idea, a concept, an assumption, or direct stakeholder feedback, we need to identify and measure the feature or service our product delivers by using the explore, build, test, deliver lifecycle. Fundamentally, this means that we need to be "plugged into" our organization across the organization. There are no borders in continuous innovation, learning, and DevOps. Thus when we measure across the enterprise, we can understand the whole and take actionable, meaningful steps to improve. + +> Measure performance across the organization, not just in a line of business. + +### 5\. Inspire adoption through enthusiasm + +Not everyone is driven to learn, adapt, and change; however, just like smiles can be infectious, so can learning and wanting to be part of a culture of change. Adapting and evolving within a culture of learning provides a natural mechanism for a group of people to learn and pass on information (i.e., cultural transmission). Learning styles, attitudes, methods, and processes continually evolve so we can improve upon them. The next step is to apply what was learned and improved and share the information with colleagues. Learning does not happen automatically; it takes effort, evaluation, discipline, awareness, and especially communication; unfortunately these are things that tools and automation alone will not provide. Review your processes, automation, tool strategies, and implementation work, make it transparent, and collaborate with your colleagues on reuse and improvement. + +> Promote a culture of learning through lean quality deliverables, not just tools and automation. + +### Summary + +![Continuous goals of DevOps mindset][4] + +As our companies adopt DevOps, we continue to champion these five values over any book, website, or automation software. It takes time to adopt this mindset, and this is very different than what we used to do as sysadmins. It's a wholly new way of working that will take many years to mature. Do these principles align with your own? Share them in the comments or on our website, [Agents of chaos][5]. + +* * * + +Can you really do DevOps without sharing scripts or code? DevOps manifesto proponents value cross-... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/values-devops-mindset + +作者:[Brent Aaron Reed][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/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_data.png?itok=RH6NA32X (human head, brain outlined with computer hardware background) +[2]: https://opensource.com/sites/default/files/uploads/devops_mindset_values.png (5 essential values for the DevOps mindset) +[3]: https://opensource.com/sites/default/files/uploads/devops_mindset_minimze-time.jpg (Minimize time spent with build-measure-learn process) +[4]: https://opensource.com/sites/default/files/uploads/devops_mindset_continuous.png (Continuous goals of DevOps mindset) +[5]: http://agents-of-chaos.org From 6672096a3f3ad534d224959477e894da7b40dfb1 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:02:59 +0800 Subject: [PATCH 0408/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=20Quer?= =?UTF-8?q?y=20freely=20available=20exchange=20rate=20data=20with=20Exchan?= =?UTF-8?q?geRate-API=20sources/tech/20190509=20Query=20freely=20available?= =?UTF-8?q?=20exchange=20rate=20data=20with=20ExchangeRate-API.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...xchange rate data with ExchangeRate-API.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md diff --git a/sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md b/sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md new file mode 100644 index 0000000000..3db9708c81 --- /dev/null +++ b/sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Query freely available exchange rate data with ExchangeRate-API) +[#]: via: (https://opensource.com/article/19/5/exchange-rate-data) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) + +Query freely available exchange rate data with ExchangeRate-API +====== +In this interview, ExchangeRate-API's founder explains why exchange rate +data should be freely accessible to developers who want to build useful +stuff. +![scientific calculator][1] + +Last year, [I wrote about][2] using the Groovy programming language to access foreign exchange rate data from an API to simplify my expense records. I showed how two exchange rate sites, [fixer.io][3] and apilayer.net (now [apilayer.com][4]), could provide the data I needed, allowing me to convert between Indian rupees (INR) and Canadian dollars (CAD) using the former, and Chilean pesos (CLP) and Canadian dollars using the latter. + +Recently, David over at [ExchangeRate-API.com][5] reached out to me to say, "the free API you mentioned (Fixer) has been bought by CurrencyLayer and had its no-signup/unlimited access deprecated." He also told me, "I run a free API called ExchangeRate-API.com that has the same JSON format as the original Fixer, doesn't require any signup, and allows unlimited requests." + +After exchanging a few emails, we decided to turn our conversation into an interview. Below the interview, you can find scripts and usage instructions. (The interview has been edited slightly for clarity.) + +### About ExchangeRate-API + +_**Chris:** How is ExchangeRate-API different from other online exchange-rate services? What motivates you to provide this service?_ + +**David:** When I started ExchangeRate-API with a friend in 2010, we built and released it for free because we really needed this service for another project and couldn't find one despite extensive googling. There are now around 20 such APIs offering quite a few different approaches. Over the years, I've tried a number of different approaches, but offering quality data for free has always proven the most popular. I'm also motivated by the thought that this data should be freely accessible to developers who want to build useful stuff even if they don't have a budget. + +Thus, the main difference with our currency conversion API is that it's unlimited and requires no signup. This also makes starting to use it really fast—you literally just copy the endpoint URL and you're good to go. + +There are one or two other free and unlimited APIs, but these typically just serve the daily reference rates provided by the European Central Bank. ExchangeRate-API collects the public reference rates from a number of central banks and then blends them to reduce the risk of outlying values. It also does acceptance checking to ensure the rates aren't wildly wrong (for instance an inverted data capture recording US dollars to CLP instead of CLP to USD) and weights different sources based on their historical accuracy. This makes the service quite reliable. I'm currently working on a transparency project to compare and show the accuracy of this public reference rate blend against a proprietary data source so potential users can make more informed decisions on what type of currency data service is right for them. + +_**Chris:** I'm delighted that you've included Canadian dollars and Indian rupees, as that is one problem I need to solve. I'm sad to see that you don't have Chilean pesos (another problem I need to solve). Can you tell us how you select the list of currencies? Do you anticipate adding other currencies to your list?_ + +**David:** Since my main aim for this service is to offer stable and reliable exchange rate data, I only include currencies when there is more than one data source for that currency code. For instance, after you mentioned that you're looking for CLP data, I added the daily reference rates published by the Central Bank of Chile to our system. If I can find another source that includes CLP, it would be included in our list of supported currencies, but until then, unfortunately not. The goal is to support as many currencies as possible. + +One thing to note is that, for some currencies, the service has the minimum two sources, but a few currency pairs (for instance USD/EUR) are included in almost every set of public reference rates. The transparent accuracy project I mentioned will hopefully make this difference clear so that users can understand why our USD/EUR rate might be more accurate than less common pairs like CLP/INR and also the degree of variance in accuracy between the pairs. It will take some work to make showing this information quick and easy to understand. + +### The API's architecture + +_**Chris:** Can you tell us a bit about your API's architecture? Do you use open source components to deliver your service?_ + +**David:** I exclusively use open source software to run ExchangeRate-API. I'm definitely an open source enthusiast and am always getting friends to switch to open source, explaining licenses, and donating when I can to the projects I use most. I also try to email maintainers of projects I use to say thanks, but I don't do this enough. + +The stack is currently Ubuntu LTS, MariaDB, Nginx, PHP 7, and Memcached. I also use Bootstrap and Picnic open source CSS frameworks. I use Let's Encrypt for HTTPS certificates via the Electronic Frontier Foundation's open source ACME client, [Certbot][6]. The service makes extensive use of classic tools like UFW/iptables, cURL, OpenSSH, and Git. + +My approach is typically to keep everything as simple as possible while using the tried-and-tested open source building blocks. For a project that aims to _always_ be available for users to convert currencies, this feels like the best route to reliability. I love reading about innovative new projects that could be useful for a project like this (for example, CockroachDB), but I wouldn't use them until they are considered really bulletproof. Obviously, things like [Heartbleed][7] show that there are risks with "boring" projects too—but I think these are easier to manage than the potential for unknown risks with newer, cutting-edge projects. + +In terms of the infrastructure setup, I've steadily built and improved the system over the last nine years, and it now comprises roughly three tiers. The main cluster runs on Amazon Web Services (AWS) and consists of Ubuntu EC2 servers and a high-availability MariaDB relational database service (RDS) instance. The EC2 instances are spread across multiple AWS Availability Zones and fronted by the managed AWS Elastic Load Balancing (ELB) service. Between the RDS database instance with automated cross-zone failover and the ELB-fronted EC2 instances spread across availability zones, this setup is exceptionally available. It is, however, only in one locale. So I've set up a second tier of virtual private server (VPS) instances in different geographic locations to reduce latency and distribute the load away from the more expensive AWS infrastructure. These are currently with Linode, but I have also used DigitalOcean and Vultr recently. + +Finally, this is all protected behind Cloudflare. With a free service, it's inevitable that some users will choose to abuse the system, and Cloudflare is an amazing product that's vital to ExchangeRate-API. Our servers can be protected and our users get low-latency, in-region caches. Cloudflare is set up with both the load balancing and traffic steering products to reduce latency and instantly shift traffic from unhealthy parts of the infrastructure to available origins. + +With this very redundant approach, there hasn't been downtime as a result of infrastructure problems or user load for around three years. The few periods of degraded service experienced in this time are all due to issues with code, deployment strategy, or config mistakes. The setup currently handles hundreds of millions of requests per month with low load levels and manageable costs, so there's plenty of room for growth. + +The actual application code is PHP with heavy use of Memcached. Memcached is an amazing open source project started by Brad Fitzpatrick in 2003. It's not particularly glamorous, but it is an incredibly reliable and performant distributed in-memory key value store. + +### Engaging with the open source community + +_**Chris:** There is an impressive amount of open source in your configuration. How do you engage with the broader community of users in these projects?_ + +**David:** I really struggle with the best way to be a good open source citizen while running a side project SaaS. I've considered building an open source library of some sort and releasing it, but I haven't thought of something that hasn't already been done and that I would be able to make the time commitment to reliably maintain. I'd only start a project like this if I could be confident I'd have the time to ensure users who choose the project wouldn't suddenly find themselves depending on abandonware. I've also looked into contributing to the projects that ExchangeRate-API depends on, but since I only use the biggest, most established options, I lack the expertise to make a meaningful contribution to such serious projects. + +I'm currently working on a new "Pro" plan for the service and I'm going to set a percentage of this income to donate to my open source dependencies. This still feels like a bandage though—answering this question makes me realize I need to put more time into starting an open source project that calls ExchangeRate-API home! + +### Looking ahead + +_**Chris:** We can only query the latest exchange rate, but it appears that you may be offering historical rates sometime later this year. Can you tell us more about the technical challenges with serving up historical data?_ + +**David:** There is a dataset of historical rates blended using our same algorithm from multiple central bank reference sets. However, I stopped new signups for it due to some issues with the data quality. The dataset reaches back to 1990, and there were a few earlier periods that need better data validation. As such, I'm building a better system for checking and comparing the data as it's ingested as well as adding an additional data source. The plan is to have a clean and more comprehensively verified-as-accurate dataset available later this year. + +In terms of the technical side of things, historical data is slightly more complex than live data. Compared to the live dataset (which is just a few bytes) the historical data is millions of database rows. This data was originally served from the database infrastructure with a long time-to-live (TTL) intermediary-caching layer. This was largely performant but struggled in situations where users wanted to dump the entire dataset as fast as the network could handle it. If the cache was sufficiently warm, this was fine, but if reboots, new server deployments, etc. had taken place recently, these big request sets would "miss" enough on the cache that the database would have problematic load spikes. + +Obviously, the goal is an infrastructure that can handle even aggressive use cases with normal performance, so the new historical rates dataset will be accompanied by a preemptive in-memory cache rather than a request-driven one. Thankfully, RAM is cheap these days, and putting a couple hundred megabytes of data entirely into RAM is a plausible approach even for a small project like ExchangeRate-API.com. + +_**Chris:** It sounds like you've been through quite a few iterations of this service to get to where it is today! Where do you see it going in the next few years?_ + +**David:** I'd aim for it to have reached coverage of every world currency so that anyone looking for this sort of software can easily and programmatically get the exchange rates they need for free. + +I'd also definitely like to have an affordable Pro plan that really resonates with users. Getting this right would mean better infrastructure and lower latency for free users as well. + +Finally, I'd like to have some sort of useful open source library under the ExchangeRate-API banner. Starting a small project that finds an enthusiastic community would be really rewarding. It's great to run something that's free-as-in-beer, but it would be even better if part of it was free-as-in-speech, as well. + +### How to use the service + +It's easy enough to test out the service using **wget** , as follows: + + +``` +clh@marseille:~$ wget -O - +\--2019-04-26 13:48:23-- +Resolving api.exchangerate-api.com (api.exchangerate-api.com)... 2606:4700:20::681a:c80, 2606:4700:20::681a:d80, 104.26.13.128, ... +Connecting to api.exchangerate-api.com (api.exchangerate-api.com)|2606:4700:20::681a:c80|:443... connected. +HTTP request sent, awaiting response... 200 OK +Length: unspecified [application/json] +Saving to: ‘STDOUT’ + +\- [<=> +] 0 --.-KB/s {"base":"INR","date":"2019-04-26","time_last_updated":1556236800,"rates":{"INR":1,"AUD":0.020343,"BRL":0.056786,"CAD":0.019248,"CHF":0.014554,"CNY":0.096099,"CZK":0.329222,"DKK":0.095497,"EUR":0.012789,"GBP":0.011052,"HKD":0.111898,"HUF":4.118615,"IDR":199.61769,"ILS":0.051749,"ISK":1.741659,"JPY":1.595527,"KRW":16.553091,"MXN":0.272383,"MYR":0.058964,"NOK":0.123365,"NZD":0.02161,"PEN":0.047497,"PHP":0.744974,"PLN":0.054927,"RON":0.060923,"RUB":0.921808,"SAR":0.053562,"SEK":0.135226,"SGD":0.019442,"THB":0.457501,"TRY":0- [ <=> ] 579 --.-KB/s in 0s + +2019-04-26 13:48:23 (15.5 MB/s) - written to stdout [579] + +clh@marseille:~$ +``` + +The result is returned as a JSON payload, giving conversion rates from Indian rupees (the currency I requested in the URL) to all the currencies handled by ExchangeRate-API. + +The Groovy shell can access the API: + + +``` +clh@marseille:~$ groovysh +Groovy Shell (2.5.3, JVM: 1.8.0_212) +Type ':help' or ':h' for help. +\---------------------------------------------------------------------------------------------------------------------------------- +groovy:000> import groovy.json.JsonSlurper +===> groovy.json.JsonSlurper +groovy:000> result = (new JsonSlurper()).parse( +groovy:001> new InputStreamReader((new URL(')) +groovy:002> ) +===> [base:INR, date:2019-04-26, time_last_updated:1556236800, rates:[INR:1, AUD:0.020343, BRL:0.056786, CAD:0.019248, CHF:0.014554, CNY:0.096099, CZK:0.329222, DKK:0.095497, EUR:0.012789, GBP:0.011052, HKD:0.111898, HUF:4.118615, IDR:199.61769, ILS:0.051749, ISK:1.741659, JPY:1.595527, KRW:16.553091, MXN:0.272383, MYR:0.058964, NOK:0.123365, NZD:0.02161, PEN:0.047497, PHP:0.744974, PLN:0.054927, RON:0.060923, RUB:0.921808, SAR:0.053562, SEK:0.135226, SGD:0.019442, THB:0.457501, TRY:0.084362, TWD:0.441385, USD:0.014255, ZAR:0.206271]] +groovy:000> +``` + +The same JSON payload is returned as a result of the Groovy JSON slurper operating on the URL. Of course, since this is Groovy, the JSON is converted into a Map, so you can do stuff like this: + + +``` +groovy:000> println result.base +INR +===> null +groovy:000> println result.date +2019-04-26 +===> null +groovy:000> println result.rates.CAD +0.019248 +===> null +``` + +And that's it! + +Do you use ExchangeRate-API or a similar service? Share how you use exchange rate data in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/exchange-rate-data + +作者:[Chris Hermansen ][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/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) +[2]: https://opensource.com/article/18/3/groovy-calculate-foreign-exchange +[3]: https://fixer.io/ +[4]: https://apilayer.com/ +[5]: https://www.exchangerate-api.com/ +[6]: https://certbot.eff.org/ +[7]: https://en.wikipedia.org/wiki/Heartbleed From a968839ff4c6208dc9a93c5173d0d6f193df3fdd Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:03:16 +0800 Subject: [PATCH 0409/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190508=20How?= =?UTF-8?q?=20to=20use=20advanced=20rsync=20for=20large=20Linux=20backups?= =?UTF-8?q?=20sources/tech/20190508=20How=20to=20use=20advanced=20rsync=20?= =?UTF-8?q?for=20large=20Linux=20backups.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... advanced rsync for large Linux backups.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20190508 How to use advanced rsync for large Linux backups.md diff --git a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md new file mode 100644 index 0000000000..6a6af666e4 --- /dev/null +++ b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md @@ -0,0 +1,143 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use advanced rsync for large Linux backups) +[#]: via: (https://opensource.com/article/19/5/advanced-rsync) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) + +How to use advanced rsync for large Linux backups +====== +Basic rsync commands are usually enough to manage your Linux backups, +but a few extra options add speed and power to large backup sets. +![Filing papers and documents][1] + +It seems clear that backups are always a hot topic in the Linux world. Back in 2017, David Both offered [Opensource.com][2] readers tips on "[Using rsync to back up your Linux system][3]," and earlier this year, he published a poll asking us, "[What's your primary backup strategy for the /home directory in Linux?][4]" In another poll this year, Don Watkins asked, "[Which open source backup solution do you use?][5]" + +My response is [rsync][6]. I really like rsync! There are plenty of large and complex tools on the market that may be necessary for managing tape drives or storage library devices, but a simple open source command line tool may be all you need. + +### Basic rsync + +I managed the binary repository system for a global organization that had roughly 35,000 developers with multiple terabytes of files. I regularly moved or archived hundreds of gigabytes of data at a time. Rsync was used. This experience gave me confidence in this simple tool. (So, yes, I use it at home to back up my Linux systems.) + +The basic rsync command is simple. + + +``` +`rsync -av SRC DST` +``` + +Indeed, the rsync commands taught in any tutorial will work fine for most general situations. However, suppose we need to back up a very large amount of data. Something like a directory with 2,000 sub-directories, each holding anywhere from 50GB to 700GB of data. Running rsync on this directory could take a tremendous amount of time, particularly if you're using the checksum option, which I prefer. + +Performance is likely to suffer if we try to sync large amounts of data or sync across slow network connections. Let me show you some methods I use to ensure good performance and reliability. + +### Advanced rsync + +One of the first lines that appears when rsync runs is: "sending incremental file list." If you do a search for this line, you'll see many questions asking things like: why is it taking forever? or why does it seem to hang up? + +Here's an example based on this scenario. Let's say we have a directory called **/storage** that we want to back up to an external USB device mounted at **/media/WDPassport**. + +If we want to back up **/storage** to a USB external drive, we could use this command: + + +``` +`rsync -cav /storage /media/WDPassport` +``` + +The **c** option tells rsync to use file checksums instead of timestamps to determine changed files, and this usually takes longer. In order to break down the **/storage** directory, I sync by subdirectory, using the **find** command. Here's an example: + + +``` +`find /storage -type d -exec rsync -cav {} /media/WDPassport \;` +``` + +This looks OK, but if there are any files in the **/storage** directory, they will not be copied. So, how can we sync the files in **/storage**? There is also a small nuance where certain options will cause rsync to sync the **.** directory, which is the root of the source directory; this means it will sync the subdirectories twice, and we don't want that. + +Long story short, the solution I settled on is a "double-incremental" script. This allows me to break down a directory, for example, breaking **/home** into the individual users' home directories or in cases when you have multiple large directories, such as music or family photos. + +Here is an example of my script: + + +``` +HOMES="alan" +DRIVE="/media/WDPassport" + +for HOME in $HOMES; do +cd /home/$HOME +rsync -cdlptgov --delete . /$DRIVE/$HOME +find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DRIVE/$HOME \; +done +``` + +The first rsync command copies the files and directories that it finds in the source directory. However, it leaves the directories empty so we can iterate through them using the **find** command. This is done by passing the **d** argument, which tells rsync not to recurse the directory. + + +``` +`-d, --dirs transfer directories without recursing` +``` + +The **find** command then passes each directory to rsync individually. Rsync then copies the directories' contents. This is done by passing the **r** argument, which tells rsync to recurse the directory. + + +``` +`-r, --recursive recurse into directories` +``` + +This keeps the increment file that rsync uses to a manageable size. + +Most rsync tutorials use the **a** (or **archive** ) argument for convenience. This is actually a compound argument. + + +``` +`-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)` +``` + +The other arguments that I pass would have been included in the **a** ; those are **l** , **p** , **t** , **g** , and **o**. + + +``` +-l, --links copy symlinks as symlinks +-p, --perms preserve permissions +-t, --times preserve modification times +-g, --group preserve group +-o, --owner preserve owner (super-user only) +``` + +The **\--delete** option tells rsync to remove any files on the destination that no longer exist on the source. This way, the result is an exact duplication. You can also add an exclude for the **.Trash** directories or perhaps the **.DS_Store** files created by MacOS. + + +``` +`-not -name ".Trash*" -not -name ".DS_Store"` +``` + +### Be careful + +One final recommendation: rsync can be a destructive command. Luckily, its thoughtful creators provided the ability to do "dry runs." If we include the **n** option, rsync will display the expected output without writing any data. + + +``` +`rsync -cdlptgovn --delete . /$DRIVE/$HOME` +``` + +This script is scalable to very large storage sizes and large latency or slow link situations. I'm sure there is still room for improvement, as there always is. If you have suggestions, please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/advanced-rsync + +作者:[Alan Formy-Duval ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: http://Opensource.com +[3]: https://opensource.com/article/17/1/rsync-backup-linux +[4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux +[5]: https://opensource.com/article/19/2/linux-backup-solutions +[6]: https://en.wikipedia.org/wiki/Rsync From 3597ccc84afa30bb85eaa8f5bf130feca1b2a76b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:03:32 +0800 Subject: [PATCH 0410/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190508=20Why?= =?UTF-8?q?=20startups=20should=20release=20their=20code=20as=20open=20sou?= =?UTF-8?q?rce=20sources/tech/20190508=20Why=20startups=20should=20release?= =?UTF-8?q?=20their=20code=20as=20open=20source.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hould release their code as open source.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/tech/20190508 Why startups should release their code as open source.md diff --git a/sources/tech/20190508 Why startups should release their code as open source.md b/sources/tech/20190508 Why startups should release their code as open source.md new file mode 100644 index 0000000000..f877964b5f --- /dev/null +++ b/sources/tech/20190508 Why startups should release their code as open source.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why startups should release their code as open source) +[#]: via: (https://opensource.com/article/19/5/startups-release-code) +[#]: author: (Clément Flipo https://opensource.com/users/cl%C3%A9ment-flipo) + +Why startups should release their code as open source +====== +Dokit wondered whether giving away its knowledge as open source was a +bad business decision, but that choice has been the foundation of its +success. +![open source button on keyboard][1] + +It's always hard to recall exactly how a project started, but sometimes that can help you understand that project more clearly. When I think about it, our platform for creating user guides and documentation, [Dokit][2], came straight out of my childhood. Growing up in a house where my toys were Meccano and model airplane kits, the idea of making things, taking individual pieces and putting them together to create a new whole, was always a fundamental part of what it meant to play. My father worked for a DIY company, so there were always signs of building, repair, and instruction manuals around the house. When I was young, my parents sent me to join the Boy Scouts, where we made tables, tents and mud ovens, which helped foster my enjoyment of shared learning that I later found in the open source movement. + +The art of repairing things and recycling products that I learned in childhood became part of what I did for a job. Then it became my ambition to take the reassuring feel of learning how to make and do and repair at home or in a group—but put it online. That inspired Dokit's creation. + +### The first months + +It hasn't always been easy, but since founding our company in 2017, I've realized that the biggest and most worthwhile goals are generally always difficult. If we were to achieve our plan to revolutionize the way [old-fashioned manuals and user guides are created and published][3], and maximize our impact in what we knew all along would be a niche market, we knew that a guiding mission was crucial to how we organized everything else. It was from there that we reached our first big decision: to [quickly launch a proof of concept using an existing open source framework][4], MediaWiki, and from there to release all of our code as open source. + +In retrospect, this decision was made easier by the fact that [MediaWiki][5] was already up and running. With 15,000 developers already active around the world and on a platform that included 90% of the features we needed to meet our minimum viable product (MVP), things would have no doubt been harder without support from the engine that made its name by powering Wikipedia. Confluence, a documentation platform in use by many enterprises, offers some good features, but in the end, it was an easy choice between the two. + +Placing our faith in the community, we put the first version of our platform straight onto GitHub. The excitement of watching the world's makers start using our platform, even before we'd done any real advertising, felt like an early indication that we were on the right track. Although the [maker and Fablab movements][6] encourage users to share instructions, and even sets out this expectation in the [Fablab charter][7] (as stated by MIT), in reality, there is a lack of real documentation. + +The first and most significant reason people like using our platform is that it responds to the very real problem of poor documentation inside an otherwise great movement—one that we knew could be even better. To us, it felt a bit like we were repairing a gap in the community of makers and DIY. Within a year of our launch, Fablabs, [Wikifab][8], [Open Source Ecology][9], [Les Petits Debrouillards][10], [Ademe][11], and [Low-Tech Lab][12] had installed our tool on their servers for creating step-by-step tutorials. + +Before even putting out a press release, one of our users, Wikifab, began to get praise in national media as "[the Wikipedia of DIY][13]." In just two years, we've seen hundreds of communities launched on their own Dokits, ranging from the fun to the funny to the more formal product guides. Again, the power of the community is the force we want to harness, and it's constantly amazing to see projects—ranging from wind turbines to pet feeders—develop engaging product manuals using the platform we started. + +### Opening up open source + +Looking back at such a successful first two years, it's clear to us that our choice to use open source was fundamental to how we got where we are as fast as we did. The ability to gather feedback in open source is second-to-none. If a piece of code didn't work, [someone could tell us right away][14]. Why wait on appointments with consultants if you can learn along with those who are already using the service you created? + +The level of engagement from the community also revealed the potential (including the potential interest) in our market. [Paris has a good and growing community of developers][15], but open source took us from a pool of a few thousand locally, and brought us to millions of developers all around the world who could become a part of what we were trying to make happen. The open availability of our code also proved reassuring to our users and customers who felt safe that, even if our company went away, the code wouldn't. + +If that was most of what we thought might happen as a result of using open source, there were also surprises along the way. By adopting an open method, we found ourselves gaining customers, reputation, and perfectly targeted advertising that we didn't have to pay for out of our limited startup budget. We found that the availability of our code helped improve our recruitment process because we were able to test candidates using our code before we made hires, and this also helped simplify the onboarding journey for those we did hire. + +In what we see as a mixture of embarrassment and solidarity, the totally public nature of developers creating code in an open setting also helped drive up quality. People can share feedback with one another, but the public nature of the work also seems to encourage people to do their best. In the spirit of constant improvement and of continually building and rebuilding how Dokit works, supporting the community is something that we know we'd like to do more of and get better at in future. + +### Where to next? + +Even with the faith we've always had in what we were doing, and seeing the great product manuals that have been developed using our software, it never stops being exciting to see our project grow, and we're certain that the future has good things in store. + +In the early days, we found ourselves living a lot under the fear of distributing our knowledge for free. In reality, it was the opposite—open source gave us the ability to very rapidly build a startup that was sustainable from the beginning. Dokit is a platform designed to give its users the confidence to build, assemble, repair, and create entirely new inventions with the support of a community. In hindsight, we found we were doing the same thing by using open source to build a platform. + +Just like when doing a repair or assembling a physical product, it's only when you have confidence in your methods that things truly begin to feel right. Now, at the beginning of our third year, we're starting to see growing global interest as the industry responds to [new generations of customers who want to use, reuse, and assemble products][16] that respond to changing homes and lifestyles. By providing the support of an online community, we think we're helping to create circumstances in which people feel more confident in doing things for themselves. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/startups-release-code + +作者:[Clément Flipo][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/cl%C3%A9ment-flipo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx (open source button on keyboard) +[2]: https://dokit.io/ +[3]: https://dokit.io/9-reasons-to-stop-writing-your-user-manuals-or-work-instructions-with-word-processors/ +[4]: https://medium.com/@gofloaters/5-cheap-ways-to-build-your-mvp-71d6170d5250 +[5]: https://en.wikipedia.org/wiki/MediaWiki +[6]: https://en.wikipedia.org/wiki/Maker_culture +[7]: http://fab.cba.mit.edu/about/charter/ +[8]: https://wikifab.org/ +[9]: https://www.opensourceecology.org/ +[10]: http://www.lespetitsdebrouillards.org/ +[11]: https://www.ademe.fr/en +[12]: http://lowtechlab.org/ +[13]: https://www.20minutes.fr/magazine/economie-collaborative-mag/2428995-20160919-pour-construire-leurs-meubles-eux-memes-ils-creent-le-wikipedia-du-bricolage +[14]: https://opensource.guide/how-to-contribute/ +[15]: https://www.rudebaguette.com/2013/03/here-are-the-details-on-the-new-developer-school-that-xavier-niel-is-launching-tomorrow/?lang=en +[16]: https://www.inc.com/ari-zoldan/why-now-is-the-best-time-to-start-a-diy-home-based.html From 7cca16d2117246f52123f8b41f61804db48a16f7 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:03:51 +0800 Subject: [PATCH 0411/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190508=20Inno?= =?UTF-8?q?vations=20on=20the=20Linux=20desktop:=20A=20look=20at=20Fedora?= =?UTF-8?q?=2030's=20new=20features=20sources/tech/20190508=20Innovations?= =?UTF-8?q?=20on=20the=20Linux=20desktop-=20A=20look=20at=20Fedora=2030-s?= =?UTF-8?q?=20new=20features.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...top- A look at Fedora 30-s new features.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md diff --git a/sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md b/sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md new file mode 100644 index 0000000000..083a8c9768 --- /dev/null +++ b/sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Innovations on the Linux desktop: A look at Fedora 30's new features) +[#]: via: (https://opensource.com/article/19/5/fedora-30-features) +[#]: author: (Anderson Silva https://opensource.com/users/ansilva/users/marcobravo/users/alanfdoss/users/ansilva) + +Innovations on the Linux desktop: A look at Fedora 30's new features +====== +Learn about some of the highlights in the latest version of Fedora +Linux. +![Fedora Linux distro on laptop][1] + +The latest version of Fedora Linux was released at the end of April. As a full-time Fedora user since its original release back in 2003 and an active contributor since 2007, I always find it satisfying to see new features and advancements in the community. + +If you want a TL;DR version of what's has changed in [Fedora 30][2], feel free to ignore this article and jump straight to Fedora's [ChangeSet][3] wiki page. Otherwise, keep on reading to learn about some of the highlights in the new version. + +### Upgrade vs. fresh install + +I upgraded my Lenovo ThinkPad T series from Fedora 29 to 30 using the [DNF system upgrade instructions][4], and so far it is working great! + +I also had the chance to do a fresh install on another ThinkPad, and it was a nice surprise to see a new boot screen on Fedora 30—it even picked up the Lenovo logo. I did not see this new and improved boot screen on the upgrade above; it was only on the fresh install. + +![Fedora 30 boot screen][5] + +### Desktop changes + +If you are a GNOME user, you'll be happy to know that Fedora 30 comes with the latest version, [GNOME 3.32][6]. It has an improved on-screen keyboard (handy for touch-screen laptops), brand new icons for core applications, and a new "Applications" panel under Settings that allows users to gain a bit more control on GNOME default handlers, access permissions, and notifications. Version 3.32 also improves Google Drive performance so that Google files and calendar appointments will be integrated with GNOME. + +![Applications panel in GNOME Settings][7] + +The new Applications panel in GNOME Settings + +Fedora 30 also introduces two new Desktop environments: Pantheon and Deepin. Pantheon is [ElementaryOS][8]'s default desktop environment and can be installed with a simple: + + +``` +`$ sudo dnf groupinstall "Pantheon Desktop"` +``` + +I haven't used Pantheon yet, but I do use [Deepin][9]. Installation is simple; just run: + + +``` +`$ sudo dnf install deepin-desktop` +``` + +then log out of GNOME and log back in, choosing "Deepin" by clicking on the gear icon on the login screen. + +![Deepin desktop on Fedora 30][10] + +Deepin desktop on Fedora 30 + +Deepin appears as a very polished, user-friendly desktop environment that allows you to control many aspects of your environment with a click of a button. So far, the only issue I've had is that it can take a few extra seconds to complete login and return control to your mouse pointer. Other than that, it is brilliant! It is the first desktop environment I've used that seems to do high dots per inch (HiDPI) properly—or at least close to correctly. + +### Command line + +Fedora 30 upgrades the Bourne Again Shell (aka Bash) to version 5.0.x. If you want to find out about every change since its last stable version (4.4), read this [description][11]. I do want to mention that three new environments have been introduced in Bash 5: + + +``` +$ echo $EPOCHSECONDS +1556636959 +$ echo $EPOCHREALTIME +1556636968.012369 +$ echo $BASH_ARGV0 +bash +``` + +Fedora 30 also updates the [Fish shell][12], a colorful shell with auto-suggestion, which can be very helpful for beginners. Fedora 30 comes with [Fish version 3][13], and you can even [try it out in a browser][14] without having to install it on your machine. + +(Note that Fish shell is not the same as guestfish for mounting virtual machine images, which comes with the libguestfs-tools package.) + +### Development + +Fedora 30 brings updates to the following languages: [C][15], [Boost (C++)][16], [Erlang][17], [Go][18], [Haskell][19], [Python][20], [Ruby][21], and [PHP][22]. + +Regarding these updates, the most important thing to know is that Python 2 is deprecated in Fedora 30. The community and Fedora leadership are requesting that all package maintainers that still depend on Python 2 port their packages to Python 3 as soon as possible, as the plan is to remove virtually all Python 2 packages in Fedora 31. + +### Containers + +If you would like to run Fedora as an immutable OS for a container, kiosk, or appliance-like environment, check out [Fedora Silverblue][23]. It brings you all of Fedora's technology managed by [rpm-ostree][24], which is a hybrid image/package system that allows automatic updates and easy rollbacks for developers. It is a great option for anyone who wants to learn more and play around with [Flatpak deployments][25]. + +Fedora Atomic is no longer available under Fedora 30, but you can still [download it][26]. If your jam is containers, don't despair: even though Fedora Atomic is gone, a brand new [Fedora CoreOS][27] is under development and should be going live soon! + +### What else is new? + +As of Fedora 30, **/usr/bin/gpg** points to [GnuPG][28] v2 by default, and [NFS][29] server configuration is now located at **/etc/nfs.conf** instead of **/etc/sysconfig/nfs**. + +There have also been a [few changes][30] for installation and boot time. + +Last but not least, check out [Fedora Spins][31] for a spin of Fedora that defaults to your favorite Window manager and [Fedora Labs][32] for functionally curated software bundles built on Fedora 30 (i.e. astronomy, security, and gaming). + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/fedora-30-features + +作者:[Anderson Silva ][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/ansilva/users/marcobravo/users/alanfdoss/users/ansilva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fedora_on_laptop_lead.jpg?itok=XMc5wo_e (Fedora Linux distro on laptop) +[2]: https://getfedora.org/ +[3]: https://fedoraproject.org/wiki/Releases/30/ChangeSet +[4]: https://fedoraproject.org/wiki/DNF_system_upgrade#How_do_I_use_it.3F +[5]: https://opensource.com/sites/default/files/uploads/fedora30_fresh-boot.jpg (Fedora 30 boot screen) +[6]: https://help.gnome.org/misc/release-notes/3.32/ +[7]: https://opensource.com/sites/default/files/uploads/fedora10_gnome.png (Applications panel in GNOME Settings) +[8]: https://elementary.io/ +[9]: https://www.deepin.org/en/dde/ +[10]: https://opensource.com/sites/default/files/uploads/fedora10_deepin.png (Deepin desktop on Fedora 30) +[11]: https://git.savannah.gnu.org/cgit/bash.git/tree/NEWS +[12]: https://fishshell.com/ +[13]: https://fishshell.com/release_notes.html +[14]: https://rootnroll.com/d/fish-shell/ +[15]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_C/ +[16]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Boost/ +[17]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Erlang/ +[18]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Go/ +[19]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Haskell/ +[20]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Python/ +[21]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Ruby/ +[22]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Web/ +[23]: https://silverblue.fedoraproject.org/ +[24]: https://rpm-ostree.readthedocs.io/en/latest/ +[25]: https://flatpak.org/setup/Fedora/ +[26]: https://getfedora.org/en/atomic/ +[27]: https://coreos.fedoraproject.org/ +[28]: https://gnupg.org/index.html +[29]: https://en.wikipedia.org/wiki/Network_File_System +[30]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/sysadmin/Installation/ +[31]: https://spins.fedoraproject.org +[32]: https://labs.fedoraproject.org/ From 72698f729f342b677fa32ad3efa412db66e4fb7a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:04:47 +0800 Subject: [PATCH 0412/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20Supe?= =?UTF-8?q?rmicro=20moves=20production=20from=20China=20sources/talk/20190?= =?UTF-8?q?510=20Supermicro=20moves=20production=20from=20China.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Supermicro moves production from China.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/talk/20190510 Supermicro moves production from China.md diff --git a/sources/talk/20190510 Supermicro moves production from China.md b/sources/talk/20190510 Supermicro moves production from China.md new file mode 100644 index 0000000000..21739fa416 --- /dev/null +++ b/sources/talk/20190510 Supermicro moves production from China.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Supermicro moves production from China) +[#]: via: (https://www.networkworld.com/article/3394404/supermicro-moves-production-from-china.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Supermicro moves production from China +====== +Supermicro was cleared of any activity related to the Chinese government and secret chips in its motherboards, but it is taking no chances and is moving its facilities. +![Frank Schwichtenberg \(CC BY 4.0\)][1] + +Server maker Supermicro, based in Fremont, California, is reportedly moving production out of China over customer concerns that the Chinese government had secretly inserted chips for spying into its motherboards. + +The claims were made by Bloomberg late last year in a story that cited more than 100 sources in government and private industry, including Apple and Amazon Web Services (AWS). However, Apple CEO Tim Cook and AWS CEO Andy Jassy denied the claims and called for Bloomberg to retract the article. And a few months later, the third-party investigations firm Nardello & Co examined the claims and [cleared Supermicro][2] of any surreptitious activity. + +At first it seemed like Supermicro was weathering the storm, but the story did have a negative impact. Server sales have fallen since the Bloomberg story, and the company is forecasting a near 10% decline in total revenues for the March quarter compared to the previous three months. + +**[ Also read:[Who's developing quantum computers][3] ]** + +And now, Nikkei Asian Review reports that despite the strong rebuttals, some customers remain cautious about the company's products. To address those concerns, Nikkei says Supermicro has told suppliers to [move production out of China][4], citing industry sources familiar with the matter. + +It also has the side benefit of mitigating against the U.S.-China trade war, which is only getting worse. Since the tariffs are on the dollar amount of the product, that can quickly add up even for a low-end system, as Serve The Home noted in [this analysis][5]. + +Supermicro is the world's third-largest server maker by shipments, selling primarily to cloud providers like Amazon and Facebook. It does its own assembly in its Fremont facility but outsources motherboard production to numerous suppliers, mostly China and Taiwan. + +"We have to be more self-reliant [to build in-house manufacturing] without depending only on those outsourcing partners whose production previously has mostly been in China," an executive told Nikkei. + +Nikkei notes that roughly 90% of the motherboards shipped worldwide in 2017 were made in China, but that percentage dropped to less than 50% in 2018, according to Digitimes Research, a tech supply chain specialist based in Taiwan. + +Supermicro just held a groundbreaking ceremony in Taiwan for a 800,000 square foot manufacturing plant in Taiwan and is expanding its San Jose, California, plant as well. So, they must be anxious to be free of China if they are willing to expand in one of the most expensive real estate markets in the world. + +A Supermicro spokesperson said via email, “We have been expanding our manufacturing capacity for many years to meet increasing customer demand. We are currently constructing a new Green Computing Park building in Silicon Valley, where we are the only Tier 1 solutions vendor manufacturing in Silicon Valley, and we proudly broke ground this week on a new manufacturing facility in Taiwan. To support our continued global growth, we look forward to expanding in Europe as well.” + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394404/supermicro-moves-production-from-china.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/supermicro_-_x11sae__cebit_2016_01-100796121-large.jpg +[2]: https://www.networkworld.com/article/3326828/investigator-finds-no-evidence-of-spy-chips-on-super-micro-motherboards.html +[3]: https://www.networkworld.com/article/3275385/who-s-developing-quantum-computers.html +[4]: https://asia.nikkei.com/Economy/Trade-war/Server-maker-Super-Micro-to-ditch-made-in-China-parts-on-spy-fears +[5]: https://www.servethehome.com/how-tariffs-hurt-intel-xeon-d-atom-and-amd-epyc-3000/ +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From b3ebe57fee85319eb09953f790ea187d6eeb65b7 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:05:13 +0800 Subject: [PATCH 0413/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=20Cisc?= =?UTF-8?q?o=20adds=20AMP=20to=20SD-WAN=20for=20ISR/ASR=20routers=20source?= =?UTF-8?q?s/talk/20190509=20Cisco=20adds=20AMP=20to=20SD-WAN=20for=20ISR-?= =?UTF-8?q?ASR=20routers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... adds AMP to SD-WAN for ISR-ASR routers.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md diff --git a/sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md b/sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md new file mode 100644 index 0000000000..a5ec6212d8 --- /dev/null +++ b/sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco adds AMP to SD-WAN for ISR/ASR routers) +[#]: via: (https://www.networkworld.com/article/3394597/cisco-adds-amp-to-sd-wan-for-israsr-routers.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco adds AMP to SD-WAN for ISR/ASR routers +====== +Cisco SD-WAN now sports Advanced Malware Protection on its popular edge routers, adding to their routing, segmentation, security, policy and orchestration capabilities. +![vuk8691 / Getty Images][1] + +Cisco has added support for Advanced Malware Protection (AMP) to its million-plus ISR/ASR edge routers, in an effort to [reinforce branch and core network malware protection][2] at across the SD-WAN. + +Cisco last year added its Viptela SD-WAN technology to the IOS XE version 16.9.1 software that runs its core ISR/ASR routers such as the ISR models 1000, 4000 and ASR 5000, in use by organizations worldwide. Cisco bought Viptela in 2017. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][3] + * [How to pick an off-site data-backup method][4] + * [SD-Branch: What it is and why you’ll need it][5] + * [What are the options for security SD-WAN?][6] + + + +The release of Cisco IOS XE offered an instant upgrade path for creating cloud-controlled SD-WAN fabrics to connect distributed offices, people, devices and applications operating on the installed base, Cisco said. At the time Cisco said that Cisco SD-WAN on edge routers builds a secure virtual IP fabric by combining routing, segmentation, security, policy and orchestration. + +With the recent release of [IOS-XE SD-WAN 16.11][7], Cisco has brought AMP and other enhancements to its SD-WAN. + +“Together with Cisco Talos [Cisco’s security-intelligence arm], AMP imbues your SD-WAN branch, core and campuses locations with threat intelligence from millions of worldwide users, honeypots, sandboxes, and extensive industry partnerships,” wrote Cisco’s Patrick Vitalone a product marketing manager in a [blog][8] about the security portion of the new software. “In total, AMP identifies more than 1.1 million unique malware samples a day." When AMP in Cisco SD-WAN spots malicious behavior it automatically blocks it, he wrote. + +The idea is to use integrated preventative engines, exploit prevention and intelligent signature-based antivirus to stop malicious attachments and fileless malware before they execute, Vitalone wrote. + +AMP support is added to a menu of security features already included in the SD-WAN software including support for URL filtering, [Cisco Umbrella][9] DNS security, Snort Intrusion Prevention, the ability to segment users across the WAN and embedded platform security, including the [Cisco Trust Anchor][10] module. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][11] ]** + +The software also supports [SD-WAN Cloud onRamp for CoLocation][12], which lets customers tie distributed multicloud applications back to a local branch office or local private data center. That way a cloud-to-branch link would be shorter, faster and possibly more secure that tying cloud-based applications directly to the data center. + +“The idea that this kind of security technology is now integrated into Cisco’s SD-WAN offering is a critical for Cisco and customers looking to evaluate SD-WAN offerings,” said Lee Doyle, principal analyst at Doyle Research. + +IOS-XE SD-WAN 16.11 is available now. + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394597/cisco-adds-amp-to-sd-wan-for-israsr-routers.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/09/shimizu_island_el_nido_palawan_philippines_by_vuk8691_gettyimages-155385042_1200x800-100773533-large.jpg +[2]: https://www.networkworld.com/article/3285728/what-are-the-options-for-securing-sd-wan.html +[3]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[4]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[5]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[6]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[7]: https://www.cisco.com/c/en/us/td/docs/routers/sdwan/release/notes/xe-16-11/sd-wan-rel-notes-19-1.html +[8]: https://blogs.cisco.com/enterprise/enabling-amp-in-cisco-sd-wan +[9]: https://www.networkworld.com/article/3167837/cisco-umbrella-cloud-service-shapes-security-for-cloud-mobile-resources.html +[10]: https://www.cisco.com/c/dam/en_us/about/doing_business/trust-center/docs/trustworthy-technologies-datasheet.pdf +[11]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[12]: https://www.networkworld.com/article/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world From 23895305dcb994aa6c5f46e7da1446c8228d550e Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:05:36 +0800 Subject: [PATCH 0414/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=20When?= =?UTF-8?q?=20it=20comes=20to=20uptime,=20not=20all=20cloud=20providers=20?= =?UTF-8?q?are=20created=20equal=20sources/talk/20190509=20When=20it=20com?= =?UTF-8?q?es=20to=20uptime,=20not=20all=20cloud=20providers=20are=20creat?= =?UTF-8?q?ed=20equal.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t all cloud providers are created equal.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md diff --git a/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md b/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md new file mode 100644 index 0000000000..8f9db8a94b --- /dev/null +++ b/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When it comes to uptime, not all cloud providers are created equal) +[#]: via: (https://www.networkworld.com/article/3394341/when-it-comes-to-uptime-not-all-cloud-providers-are-created-equal.html#tk.rss_all) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +When it comes to uptime, not all cloud providers are created equal +====== +Cloud uptime is critical today, but vendor-provided data can be confusing. Here's an analysis of how AWS, Google Cloud and Microsoft Azure compare. +![Getty Images][1] + +The cloud is not just important; it's mission-critical for many companies. More and more IT and business leaders I talk to look at public cloud as a core component of their digital transformation strategies — using it as part of their hybrid cloud or public cloud implementation. + +That raises the bar on cloud reliability, as a cloud outage means important services are not available to the business. If this is a business-critical service, the company may not be able to operate while that key service is offline. + +Because of the growing importance of the cloud, it’s critical that buyers have visibility into the reliability number for the cloud providers. The challenge is the cloud providers don't disclose the disruptions in a consistent manner. In fact, some are confusing to the point where it’s difficult to glean any kind of meaningful conclusion. + +**[ RELATED:[What IT pros need to know about Azure Stack][2] and [Which cloud performs better, AWS, Azure or Google?][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** + +### Reported cloud outage times don't always reflect actual downtime + +Microsoft Azure and Google Cloud Platform (GCP) both typically provide information on date and time, but only high-level data on the services affected and sparse information on regional impact. The problem with that is it’s difficult to get a sense of overall reliability. For instance, if Azure reports a one-hour outage that impacts five services in three regions, the website might show just a single hour. In actuality, that’s 15 hours of total downtime. + +Between Azure, GCP and Amazon Web Services (AWS), [Azure is the most obscure][5], as it provides the least amount of detail. [GCP does a better job of providing detail][6] at the service level but tends to be obscure with regional information. Sometimes it’s very clear as to what services are unavailable, and other times it’s not. + +[AWS has the most granular reporting][7], as it shows every service in every region. If an incident occurs that impacts three services, all three of those services would light up red. If those were unavailable for one hour, AWS would record three hours of downtime. + +Another inconsistency between the cloud providers is the amount of historical downtime data that is available. At one time, all three of the cloud vendors provided a one-year view into outages. GCP and AWS still do this, but Azure moved to only a [90-day view][5] sometime over the past year. + +### Azure has significantly higher downtime than GCP and AWS + +The next obvious question is who has the most downtime? To answer that, I worked with a third-party firm that has continually collected downtime information directly from the vendor websites. I have personally reviewed the information and can validate its accuracy. Based on the vendors own reported numbers, from the beginning of 2018 through May 3, 2019, AWS leads the pack with only 338 hours of downtime, followed by GCP closely at 361. Microsoft Azure has a whopping total of 1,934 hours of self-reported downtime. + +![][8] + +A few points on these numbers. First, this is an aggregation of the self-reported data from the vendors' websites, which isn’t the “true” number, as regional information or service granularity is sometimes obscured. If a service is unavailable for an hour and it’s reported for an hour on the website but it spanned five regions, correctly five hours should have been used. But for this calculation, we used only one hour because that is what was self-reported. + +Because of this, the numbers are most favorable to Microsoft because they provide the least amount of regional information. The numbers are least favorable to AWS because they provide the most granularity. Also, I believe AWS has the most services in most regions, so they have more opportunities for an outage. + +We had considered normalizing the data, but that would require a significant amount of work to destruct the downtime on a per service per region basis. I may choose to do that in the future, but for now, the vendor-reported view is a good indicator of relative performance. + +Another important point is that only infrastructure as a service (IaaS) services were used to calculate downtime. If Google Street View or Bing Maps went down, most businesses would not care, so it would have been unfair to roll those number in. + +### SLAs do not correlate to reliability + +Given the importance of cloud services today, I would like to see every cloud provider post a 12-month running total of downtime somewhere on their website so customers can do an “apples to apples” comparison. This obviously isn’t the only factor used in determining which cloud provider to use, but it is one of the more critical ones. + +Also, buyers should be aware that there is a big difference between service-level agreements (SLAs) and downtime. A cloud operator can promise anything they want, even provide a 100% SLA, but that just means they need to reimburse the business when a service isn’t available. Most IT leaders I have talked to say the few bucks they get back when a service is out is a mere fraction of what the outage actually cost them. + +### Measure twice and cut once to minimize business disruption + +If you’re reading this and you’re researching cloud services, it’s important to not just make the easy decision of buying for convenience. Many companies look at Azure because Microsoft gives away Azure credits as part of the Enterprise Agreement (EA). I’ve interviewed several companies that took the path of least resistance, but they wound up disappointed with availability and then switched to AWS or GCP later, which can have a disruptive effect. + +I’m certainly not saying to not buy Microsoft Azure, but it is important to do your homework to understand the historical performance of the services you’re considering in the regions you need them. The information on the vendor websites may not tell the full picture, so it’s important to do the necessary due diligence to ensure you understand what you’re buying before you buy it. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394341/when-it-comes-to-uptime-not-all-cloud-providers-are-created-equal.html#tk.rss_all + +作者:[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/02/cloud_comput_connect_blue-100787048-large.jpg +[2]: https://www.networkworld.com/article/3208029/azure-stack-microsoft-s-private-cloud-platform-and-what-it-pros-need-to-know-about-it +[3]: https://www.networkworld.com/article/3319776/the-network-matters-for-public-cloud-performance.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://azure.microsoft.com/en-us/status/history/ +[6]: https://status.cloud.google.com/incident/appengine/19008 +[7]: https://status.aws.amazon.com/ +[8]: https://images.idgesg.net/images/article/2019/05/public-cloud-downtime-100795948-large.jpg +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 607465b07c32dcaaa4628b16917e881aff4a95ad Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:08:07 +0800 Subject: [PATCH 0415/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190507=20Serv?= =?UTF-8?q?er=20shipments=20to=20pick=20up=20in=20the=20second=20half=20of?= =?UTF-8?q?=202019=20sources/talk/20190507=20Server=20shipments=20to=20pic?= =?UTF-8?q?k=20up=20in=20the=20second=20half=20of=202019.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s to pick up in the second half of 2019.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/talk/20190507 Server shipments to pick up in the second half of 2019.md diff --git a/sources/talk/20190507 Server shipments to pick up in the second half of 2019.md b/sources/talk/20190507 Server shipments to pick up in the second half of 2019.md new file mode 100644 index 0000000000..8169c594ef --- /dev/null +++ b/sources/talk/20190507 Server shipments to pick up in the second half of 2019.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Server shipments to pick up in the second half of 2019) +[#]: via: (https://www.networkworld.com/article/3393167/server-shipments-to-pick-up-in-the-second-half-of-2019.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Server shipments to pick up in the second half of 2019 +====== +Server sales slowed in anticipation of the new Intel Xeon processors, but they are expected to start up again before the end of the year. +![Thinkstock][1] + +Global server shipments are not expected to return to growth momentum until the third quarter or even the fourth quarter of 2019, according to Taiwan-based tech news site DigiTimes, which cited unnamed server supply chain sources. The one bright spot remains cloud providers like Amazon, Google, and Facebook, which continue their buying binge. + +Normally I’d be reluctant to cite such a questionable source, but given most of the OEMs and ODMs are based in Taiwan and DigiTimes (the article is behind a paywall so I cannot link) has shown it has connections to them, I’m inclined to believe them. + +Quanta Computer chairman Barry Lam told the publication that Quanta's shipments of cloud servers have risen steadily, compared to sharp declines in shipments of enterprise servers. Lam continued that enterprise servers command only 1-2% of the firm's total server shipments. + +**[ Also read:[Gartner: IT spending to drop due to falling equipment prices][2] ]** + +[Server shipments began to slow down in the first quarter][3] thanks in part to the impending arrival of second-generation Xeon Scalable processors from Intel. And since it takes a while to get parts and qualify them, this quarter won’t be much better. + +In its latest quarterly earnings, Intel's data center group (DCG) said sales declined 6% year over year, the first decline of its kind since the first quarter of 2012 and reversing an average growth of over 20% in the past. + +[The Osbourne Effect][4] wasn’t the sole reason. An economic slowdown in China and the trade war, which will add significant tariffs to Chinese-made products, are also hampering sales. + +DigiTimes says Inventec, Intel's largest server motherboard supplier, expects shipments of enterprise server motherboards to further lose steams for the rest of the year, while sales of data center servers are expected to grow 10-15% on year in 2019. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][5] ]** + +It went on to say server shipments may concentrate in the second half or even the fourth quarter of the year, while cloud-based data center servers for the cloud giants will remain positive as demand for edge computing, new artificial intelligence (AI) applications, and the proliferation of 5G applications begin in 2020. + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3393167/server-shipments-to-pick-up-in-the-second-half-of-2019.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/04/2_data_center_servers-100718306-large.jpg +[2]: https://www.networkworld.com/article/3391062/it-spending-to-drop-due-to-falling-equipment-prices-gartner-predicts.html +[3]: https://www.networkworld.com/article/3332144/server-sales-projected-to-slow-while-memory-prices-drop.html +[4]: https://en.wikipedia.org/wiki/Osborne_effect +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 03bf22863e066fc04d9de5197ae888623fb922fa Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:08:48 +0800 Subject: [PATCH 0416/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190507=20Some?= =?UTF-8?q?=20IT=20pros=20say=20they=20have=20too=20much=20data=20sources/?= =?UTF-8?q?talk/20190507=20Some=20IT=20pros=20say=20they=20have=20too=20mu?= =?UTF-8?q?ch=20data.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ome IT pros say they have too much data.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/talk/20190507 Some IT pros say they have too much data.md diff --git a/sources/talk/20190507 Some IT pros say they have too much data.md b/sources/talk/20190507 Some IT pros say they have too much data.md new file mode 100644 index 0000000000..a645ae52e9 --- /dev/null +++ b/sources/talk/20190507 Some IT pros say they have too much data.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Some IT pros say they have too much data) +[#]: via: (https://www.networkworld.com/article/3393205/some-it-pros-say-they-have-too-much-data.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Some IT pros say they have too much data +====== +IT professionals have too many data sources to count, and they spend a huge amount of time wrestling that data into usable condition, a survey from Ivanti finds. +![Getty Images][1] + +A new survey has found that a growing number of IT professionals have too many data sources to even count, and they are spending more and more time just wrestling that data into usable condition. + +Ivanti, an IT asset management firm, [surveyed 400 IT professionals on their data situation][2] and found IT faces numerous challenges when it comes to siloes, data, and implementation. The key takeaway is data overload is starting to overwhelm IT managers and data lakes are turning into data oceans. + +**[ Read also:[Understanding mass data fragmentation][3] | Get daily insights [Sign up for Network World newsletters][4] ]** + +Among the findings from Ivanti's survey: + + * Fifteen percent of IT professionals say they have too many data sources to count, and 37% of professionals said they have about 11-25 different sources for data. + * More than half of IT professionals (51%) report they have to work with their data for days, weeks or more before it's actionable. + * Only 10% of respondents said the data they receive is actionable within minutes. + * One in three respondents said they have the resources to act on their data, but more than half (52%) said they only sometimes have the resources. + + + +“It’s clear from the results of this survey that IT professionals are in need of a more unified approach when working across organizational departments and resulting silos,” said Duane Newman, vice president of product management at Ivanti, in a statement. + +### The problem with siloed data + +The survey found siloed data represents a number of problems and challenges. Three key priorities suffer the most: automation (46%), user productivity and troubleshooting (42%), and customer experience (41%). The survey also found onboarding/offboarding suffers the least (20%) due to siloes, so apparently HR and IT are getting things right. + +In terms of what they want from real-time insight, about 70% of IT professionals said their security status was the top priority over other issues. Respondents were least interested in real-time insights around warranty data. + +### Data lake method a recipe for disaster + +I’ve been immersed in this subject for other publications for some time now. Too many companies are hoovering up data for the sake of collecting it with little clue as to what they will do with it later. One thing you have to say about data warehouses, the schema on write at least forces you to think about what you are collecting and how you might use it because you have to store it away in a usable form. + +The new data lake method is schema on read, meaning you filter/clean it when you read it into an application, and that’s just a recipe for disaster. If you are looking at data collected a month or a year ago, do you even know what it all is? Now you have to apply schema to data and may not even remember collecting it. + +Too many people think more data is good when it isn’t. You just drown in it. When you reach a point of having too many data sources to count, you’ve gone too far and are not going to get insight. You’re going to get overwhelmed. Collect data you know you can use. Otherwise you are wasting petabytes of disk space. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3393205/some-it-pros-say-they-have-too-much-data.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/03/database_data-center_futuristic-technology-100752012-large.jpg +[2]: https://www.ivanti.com/blog/survey-it-professionals-data-sources +[3]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb +[4]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 8558f223c3215b3a54b3cbf976b06e381efd38fc Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:09:27 +0800 Subject: [PATCH 0417/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190507=20SD-W?= =?UTF-8?q?AN=20is=20Critical=20for=20IoT=20sources/talk/20190507=20SD-WAN?= =?UTF-8?q?=20is=20Critical=20for=20IoT.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190507 SD-WAN is Critical for IoT.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/talk/20190507 SD-WAN is Critical for IoT.md diff --git a/sources/talk/20190507 SD-WAN is Critical for IoT.md b/sources/talk/20190507 SD-WAN is Critical for IoT.md new file mode 100644 index 0000000000..a5867d5afd --- /dev/null +++ b/sources/talk/20190507 SD-WAN is Critical for IoT.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (SD-WAN is Critical for IoT) +[#]: via: (https://www.networkworld.com/article/3393445/sd-wan-is-critical-for-iot.html#tk.rss_all) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +SD-WAN is Critical for IoT +====== + +![istock][1] + +The Internet of Things (IoT) is everywhere and its use is growing fast. IoT is used by local governments to build smart cities. It’s used to build smart businesses. And, consumers are benefitting as it’s built into smart homes and smart cars. Industry analyst first estimates that over 20 billion IoT devices will be connected by 2020. That’s a 2.5x increase from the more than 8 billion connected devices in 2017*. + +Manufacturing companies have the highest IoT spend to date of industries while the health care market is experiencing the highest IoT growth. By 2020, 50 percent of IoT spending will be driven by manufacturing, transportation and logistics, and utilities. + +IoT growth is being fueled by the promise of analytical data insights that will ultimately yield greater efficiencies and enhanced customer satisfaction. The top use cases driving IoT growth are self-optimizing production, predictive maintenance and automated inventory management. + +From a high-level view, the IoT architecture includes sensors that collect and transmit data (i.e. temperature, speed, humidity, video feed, pressure, IR, proximity, etc.) from “things” like cars, trucks, machines, etc. that are connected over the internet. Data collected is then analyzed, translating raw data into actionable information. Businesses can then act on this information. And at more advanced levels, machine learning and AI algorithms learn and adapt to this information and automatically respond at a system level. + +IDC estimates that by 2025, over 75 billion IoT devices* will be connected. By that time, nearly a quarter of the world’s projected 163 zettabytes* (163 trillion gigabytes) of data will have been created in real-time, and the vast majority of that data will have been created by IoT devices. This massive amount of data will drive an exponential increase in traffic on the network infrastructure requiring massive scalability. Also, this increasing amount of data will require tremendous processing power to mine it and transform it into actionable intelligence. In parallel, security risks will continue to increase as there will be many more potential entry points onto the network. Lastly, management of the overall infrastructure will require better orchestration of policies as well as the means to streamline on-going operations. + +### **How does SD-WAN enable IoT business initiatives?** + +There are three key elements that an [SD-WAN][2] platform must include: + + 1. **Visibility** : Real-time visibility into the network is key. It takes the guesswork out of rapid problem resolution, enabling organizations to run more efficiently by accelerating troubleshooting and applying preventive measures. Furthermore, a CIO is able to pull metrics and see bandwidth consumed by any IoT application. + 2. **Security** : IoT traffic must be isolated from other application traffic. IT must prevent – or at least reduce – the possible attack surface that may be exposed to IoT device traffic. Also, the network must continue delivering other application traffic in the event of a melt down on a WAN link caused by a DDoS attack. + 3. **Agility** : With the increased number of connected devices, applications and users, a comprehensive, intelligent and centralized orchestration approach that continuously adapts to deliver the best experience to the business and users is critical to success. + + + +### Key Silver Peak EdgeConnect SD-WAN capabilities for IoT + +1\. Silver Peak has an [embedded real-time visibility engine][3] allowing IT to gain complete observability into the performance attributes of the network and applications in real-time. The [EdgeConnect][4] SD-WAN appliances deployed in branch offices send information to the centralized [Unity Orchestrator™][5]. Orchestrator collects the data and presents it in a comprehensive management dashboard via customizable widgets. These widgets provide a wealth of operational data including a health heatmap for every SD-WAN appliance deployed, flow counts, active tunnels, logical topologies, top talkers, alarms, bandwidth consumed by each application and location, latency and jitter and much more. Furthermore, the platform maintains weeks’ worth of data with context allowing IT to playback and see what has transpired at a specific time and location, similar to a DVR. + +![Click to read Solution Brief][6] + +2\. The second set of key capabilities center around security and end-to-end zone-based segmentation. An IoT traffic zone may be created on the LAN or branch side. IoT traffic is then mapped all the way across the WAN to the data center or cloud where the data will be processed. Zone-based segmentation is accomplished in a simplified and automated way within the Orchestrator GUI. In cases where further traffic inspection is required, IT can simply service chain to another security service. There are several key benefits realized by this approach. IT can easily and quickly apply segmentation policies; segmentation mitigates the attack surface; and IT can save on additional security investments. + +![***Click to read Solution Brief ***][7] + +3\. EdgeConnect employs machine learning at the global level where with internet sensors and third-party sensors feed into the cloud portal software. The software tracks the geolocation of all IP addresses and IP reputation, distributing signals down to the Unity Orchestrator running in each individual customer’s enterprise. In turn, it is speaking to the edge devices sitting in the branch offices. There, distributed learning is done by looking at the first packet, making an inference based on the first packet what the application is. So, if seeing that 100 times now, every time packets come from that particular IP address and turns out to be an IoT, we can make an inference that IP belongs to IoT application. In parallel, we’re using a mix of traditional techniques to validate the identification of the application. All this combined other multi-level intelligence enables simple and automated policy orchestration across a large number of devices and applications. + +![***Click to read Solution Brief ***][8] + +SD-WAN plays a foundational role as businesses continue to embrace IoT, but choosing the right SD-WAN platform is even more critical to ensuring businesses are ultimately able to fully optimize their operations. + +* Source: [IDC][9] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3393445/sd-wan-is-critical-for-iot.html#tk.rss_all + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-1019172426-100795551-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.silver-peak.com/resource-center/simplify-sd-wan-operations-greater-visibility +[4]: https://www.silver-peak.com/products/unity-edge-connect +[5]: https://www.silver-peak.com/products/unity-orchestrator +[6]: https://images.idgesg.net/images/article/2019/05/1_simplify-100795554-large.jpg +[7]: https://images.idgesg.net/images/article/2019/05/2_centralize-100795555-large.jpg +[8]: https://images.idgesg.net/images/article/2019/05/3_increase-100795558-large.jpg +[9]: https://www.information-age.com/data-forecast-grow-10-fold-2025-123465538/ From b4f405d93c21360427d6e77c16f3f59c4d4aa75e Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 13:09:44 +0800 Subject: [PATCH 0418/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190506=20Cisc?= =?UTF-8?q?o=20boosts=20SD-WAN=20with=20multicloud-to-branch=20access=20sy?= =?UTF-8?q?stem=20sources/talk/20190506=20Cisco=20boosts=20SD-WAN=20with?= =?UTF-8?q?=20multicloud-to-branch=20access=20system.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...with multicloud-to-branch access system.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md diff --git a/sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md b/sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md new file mode 100644 index 0000000000..c676e5effb --- /dev/null +++ b/sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco boosts SD-WAN with multicloud-to-branch access system) +[#]: via: (https://www.networkworld.com/article/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco boosts SD-WAN with multicloud-to-branch access system +====== +Cisco's SD-WAN Cloud onRamp for CoLocation can tie branch offices to private data centers in regional corporate headquarters via colocation facilities for shorter, faster, possibly more secure connections. +![istock][1] + +Cisco is looking to give traditional or legacy wide-area network users another reason to move to the [software-defined WAN world][2]. + +The company has rolled out an integrated hardware/software package called SD-WAN Cloud onRamp for CoLocation that lets customers tie distributed multicloud applications back to a local branch office or local private data center. The idea is that a cloud-to-branch link would be shorter, faster and possibly more secure that tying cloud-based applications directly all the way to the data center. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][3] + * [How to pick an off-site data-backup method][4] + * [SD-Branch: What it is and why you’ll need it][5] + * [What are the options for security SD-WAN?][6] + + + +“With Cisco SD-WAN Cloud onRamp for CoLocation operating regionally, connections from colocation facilities to branches are set up and configured according to traffic loads (such as video vs web browsing vs email) SLAs (requirements for low latency/jitter), and Quality of Experience for optimizing cloud application performance,” wrote Anand Oswal, senior vice president of engineering, in Cisco’s Enterprise Networking Business in a [blog about the new service][7]. + +According to Oswal, each branch or private data center is equipped with a network interface that provides a secure tunnel to the regional colocation facility. In turn, the Cloud onRamp for CoLocation establishes secure tunnels to SaaS application platforms, multi-cloud platform services, and enterprise data centers, he stated. + +Traffic is securely routed through the Cloud onRamp for CoLocation stack which includes security features such as application-aware firewalls, URL-filtering, intrusion detection/prevention, DNS-layer security, and Advanced Malware Protection (AMP) Threat Grid, as well as other network services such as load-balancing and Wide Area Application Services, Oswal wrote. + +A typical use case for the package is an enterprise that has dozens of distributed branch offices, clustered around major cities, spread over several countries. The goal is to tie each branch to enterprise data center databases, SaaS applications, and multi-cloud services while meeting service level agreements and application quality of experience, Oswal stated. + +“With virtualized Cisco SD-WAN running on regional colocation centers, the branch workforce has access to applications and data residing in AWS, Azure, and Google cloud platforms as well as SaaS providers such as Microsoft 365 and Salesforce—transparently and securely,” Oswal said. “Distributing SD-WAN features over a regional architecture also brings processing power closer to where data is being generated—at the cloud edge.” + +The idea is that paths to designated SaaS applications will be monitored continuously for performance, and the application traffic will be dynamically routed to the best-performing path, without requiring human intervention, Oswal stated. + +For a typical configuration, a region covering a target city uses a colocation IaaS provider that hosts the Cisco Cloud onRamp for CoLocation, which includes: + + * Cisco vManage software that lets customers manage applications and provision, monitor and troubleshooting the WAN. + * [Cisco Cloud Services Platform (CSP) 5000][8] The systems are x86 Linux Kernel-based Virtual Machine (KVM) software and hardware platforms for the data center, regional hub, and colocation Network Functions Virtualization (NFV). The platforms let enterprise IT teams or service providers deploy any Cisco or third-party network virtual service with Cisco’s [Network Services Orchestrator (NSO)][9] or any other northbound management and orchestration system. + * The Cisco [Catalyst 9500 Series][10] aggregation switches. Based on an x86 CPU, the Catalyst 9500 Series is Cisco’s lead purpose-built fixed core and aggregation enterprise switching platform, built for security, IoT, and cloud. The switches come with a 4-core x86, 2.4-GHz CPU, 16-GB DDR4 memory, and 16-GB internal storage. + + + +If the features of the package sound familiar, that’s because the [Cloud onRamp for CoLocation][11] package is the second generation of a similar SD-WAN package offered by Viptela which Cisco [bought in 2017][12]. + +SD-WAN's driving principle is to simplify the way big companies turn up new links to branch offices, better manage the way those links are utilized – for data, voice or video – and potentially save money in the process. + +It's a profoundly hot market with tons of players including [Cisco][13], VMware, Silver Peak, Riverbed, Aryaka, Fortinet, Nokia and Versa. IDC says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40% yearly clip between now and then. + +[SD-WAN][14] lets networks route traffic based on centrally managed roles and rules, no matter what the entry and exit points of the traffic are, and with full security. For example, if a user in a branch office is working in Office365, SD-WAN can route their traffic directly to the closest cloud data center for that app, improving network responsiveness for the user and lowering bandwidth costs for the business. + +"SD-WAN has been a promised technology for years, but in 2019 it will be a major driver in how networks are built and re-built," Oswal said a Network World [article][15] earlier this year. + +Join the Network World communities on [Facebook][16] and [LinkedIn][17] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/istock-578801262-100750453-large.jpg +[2]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html +[3]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[4]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[5]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[6]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[7]: https://blogs.cisco.com/enterprise/cisco-sd-wan-cloud-onramp-for-colocation-multicloud +[8]: https://www.cisco.com/c/en/us/products/collateral/switches/cloud-services-platform-5000/nb-06-csp-5k-data-sheet-cte-en.html#ProductOverview +[9]: https://www.cisco.com/go/nso +[10]: https://www.cisco.com/c/en/us/products/collateral/switches/catalyst-9500-series-switches/data_sheet-c78-738978.html +[11]: https://www.networkworld.com/article/3207751/viptela-cloud-onramp-optimizes-cloud-access.html +[12]: https://www.networkworld.com/article/3193784/cisco-grabs-up-sd-wan-player-viptela-for-610m.html?nsdr=true +[13]: https://www.networkworld.com/article/3322937/what-will-be-hot-for-cisco-in-2019.html +[14]: https://www.networkworld.com/article/3031279/sd-wan/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[15]: https://www.networkworld.com/article/3332027/cisco-touts-5-technologies-that-will-change-networking-in-2019.html +[16]: https://www.facebook.com/NetworkWorld/ +[17]: https://www.linkedin.com/company/network-world From 72b743c28f5c841e821a5cba03bd58b51dc37964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 13 May 2019 14:13:44 +0800 Subject: [PATCH 0419/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md index 83875b5bb2..1800a03110 100644 --- a/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md +++ b/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e98c18b70af366cff05136c8c2af128d15bb2168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 13 May 2019 14:56:52 +0800 Subject: [PATCH 0420/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md (100%) diff --git a/sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md similarity index 100% rename from sources/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md rename to translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md From 55086fa847b757a95f999e73c33680134ed6195b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 15:47:24 +0800 Subject: [PATCH 0421/1154] TSL:20190308 Virtual filesystems in Linux- Why we need them and how they work.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 累吐了,过两天校对。 --- ...nux- Why we need them and how they work.md | 64 +++++++++++-------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index ed7c2d6b8e..cac4eb99b7 100644 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -80,64 +80,72 @@ sysfs 的目的是将内核称为“kobjects”的可读写属性公开给用户 *sysfs 中的文件恰好描述了实体的每个属性,并且可以是可读的、可写的或两者兼而有之。文件中的“0”表示 SSD 不可移动的存储设备。* -### Snooping on VFS with eBPF and bcc tools +### 用 eBPF 和 bcc 工具一窥 VFS 内部 -The easiest way to learn how the kernel manages sysfs files is to watch it in action, and the simplest way to watch on ARM64 or x86_64 is to use eBPF. eBPF (extended Berkeley Packet Filter) consists of a [virtual machine running inside the kernel][22] that privileged users can query from the command line. Kernel source tells the reader what the kernel can do; running eBPF tools on a booted system shows instead what the kernel actually does. +了解内核如何管理 sysfs 文件的最简单方法是观察它的运行情况,在 ARM64 或 x86_64 上观看的最简单方法是使用 eBPF。eBPF(扩展的伯克利数据包过滤器extended Berkeley Packet Filter)由[在内核中运行的虚拟机][22]组成,特权用户可以从命令行进行查询。内核源代码告诉读者内核可以做什么;在一个启动的系统上运行 eBPF 工具会显示内核实际上做了什么。 -Happily, getting started with eBPF is pretty easy via the [bcc][23] tools, which are available as [packages from major Linux distros][24] and have been [amply documented][25] by Brendan Gregg. The bcc tools are Python scripts with small embedded snippets of C, meaning anyone who is comfortable with either language can readily modify them. At this count, [there are 80 Python scripts in bcc/tools][26], making it highly likely that a system administrator or developer will find an existing one relevant to her/his needs. +令人高兴的是,通过 [bcc][23] 工具入门使用 eBPF 非常容易,这些工具在[主要 Linux 发行版的软件包][24] 中都有,并且已经由 Brendan Gregg [充分地给出了文档说明][25]。bcc 工具是带有小段嵌入式 C 语言片段的 Python 脚本,这意味着任何对这两种语言熟悉的人都可以轻松修改它们。当前统计,[bcc/tools 中有 80 个 Python 脚本][26],使系统管理员或开发人员很有可能能够找到与她/他的需求相关的现有脚本。 + +要了解 VFS 在正在运行的系统上的工作情况,请尝试使用简单的 [vfscount][27] 或 [vfsstat][28],这表明每秒都会发生数十次对 `vfs_open()` 及其相关的调用 -To get a very crude idea about what work VFSes are performing on a running system, try the simple [vfscount][27] or [vfsstat][28], which show that dozens of calls to vfs_open() and its friends occur every second. ![Console - vfsstat.py][29] -vfsstat.py is a Python script with an embedded C snippet that simply counts VFS function calls. -For a less trivial example, let's watch what happens in sysfs when a USB stick is inserted on a running system. +*vfsstat.py 是一个带有嵌入式 C 片段的 Python 脚本,它只是计数 VFS 函数调用。* + +作为一个不太重要的例子,让我们看一下在运行的系统上插入 USB 记忆棒时 sysfs 中会发生什么。 + ![Console when USB is inserted][30] -Watch with eBPF what happens in /sys when a USB stick is inserted, with simple and complex examples. -In the first simple example above, the [trace.py][31] bcc tools script prints out a message whenever the sysfs_create_files() command runs. We see that sysfs_create_files() was started by a kworker thread in response to the USB stick insertion, but what file was created? The second example illustrates the full power of eBPF. Here, trace.py is printing the kernel backtrace (-K option) plus the name of the file created by sysfs_create_files(). The snippet inside the single quotes is some C source code, including an easily recognizable format string, that the provided Python script [induces a LLVM just-in-time compiler][32] to compile and execute inside an in-kernel virtual machine. The full sysfs_create_files() function signature must be reproduced in the second command so that the format string can refer to one of the parameters. Making mistakes in this C snippet results in recognizable C-compiler errors. For example, if the **-I** parameter is omitted, the result is "Failed to compile BPF text." Developers who are conversant with either C or Python will find the bcc tools easy to extend and modify. +*用 eBPF 观察插入 USB 记忆棒时 /sys 中会发生什么,简单的和复杂的例子。* -When the USB stick is inserted, the kernel backtrace appears showing that PID 7711 is a kworker thread that created a file called "events" in sysfs. A corresponding invocation with sysfs_remove_files() shows that removal of the USB stick results in removal of the events file, in keeping with the idea of reference counting. Watching sysfs_create_link() with eBPF during USB stick insertion (not shown) reveals that no fewer than 48 symbolic links are created. +在上面的第一个简单示例中,只要 `sysfs_create_files()` 命令运行,[trace.py][31] bcc 工具脚本就会打印出一条消息。我们看到 `sysfs_create_files()` 由一个 kworker 线程启动,以响应 USB 棒插入事件,但是它创建了什么文件?第二个例子说明了 eBPF 的强大能力。这里,`trace.py` 正在打印内核回溯(`-K` 选项)以及 `sysfs_create_files()` 创建的文件的名称。单引号内的代码段是一些 C 源代码,包括一个易于识别的格式字符串,提供的 Python 脚本[引入 LLVM 即时编译器(JIT)][32] 在内核虚拟机内编译和执行它。必须在第二个命令中重现完整的 `sysfs_create_files()` 函数签名,以便格式字符串可以引用其中一个参数。在此 C 片段中出错会导致可识别的 C 编译器错误。例如,如果省略 `-I` 参数,则结果为“无法编译 BPF 文本”。熟悉 C 或 Python 的开发人员会发现 bcc 工具易于扩展和修改。 -What is the purpose of the events file anyway? Using [cscope][33] to find the function [__device_add_disk()][34] reveals that it calls disk_add_events(), and either "media_change" or "eject_request" may be written to the events file. Here, the kernel's block layer is informing userspace about the appearance and disappearance of the "disk." Consider how quickly informative this method of investigating how USB stick insertion works is compared to trying to figure out the process solely from the source. +插入 USB 记忆棒后,内核回溯显示 PID 7711 是一个 kworker 线程,它在 sysfs 中创建了一个名为 `events` 的文件。使用 `sysfs_remove_files()` 进行相应的调用表明,删除 USB 记忆棒会导致删除该 `events` 文件,这与引用计数的想法保持一致。在 USB 棒插入期间(未显示)在 eBPF 中观察 `sysfs_create_link()` 表明创建了不少于 48 个符号链接。 -### Read-only root filesystems make embedded devices possible +无论如何,`events` 文件的目的是什么?使用 [cscope][33] 查找函数 [`__device_add_disk()`][34] 显示它调用 `disk_add_events()`,并且可以将 “media_change” 或 “eject_request” 写入到该文件。这里,内核的块层通知用户空间 “磁盘” 的出现和消失。考虑一下这种调查 USB 棒插入工作原理的方法与试图仅从源头中找出该过程的速度有多快。 -Assuredly, no one shuts down a server or desktop system by pulling out the power plug. Why? Because mounted filesystems on the physical storage devices may have pending writes, and the data structures that record their state may become out of sync with what is written on the storage. When that happens, system owners will have to wait at next boot for the [fsck filesystem-recovery tool][35] to run and, in the worst case, will actually lose data. +### 只读根文件系统使得嵌入式设备成为可能 + +确实,没有人通过拔出电源插头来关闭服务器或桌面系统。为什么?因为物理存储设备上挂载的文件系统可能有挂起的(未完成的)写入,并且记录其状态的数据结构可能与写入存储器的内容不同步。当发生这种情况时,系统所有者将不得不在下次启动时等待 [fsck 文件系统恢复工具][35] 运行完成,在最坏的情况下,实际上会丢失数据。 + +然而,狂热爱好者会听说许多物联网和嵌入式设备,如路由器、恒温器和汽车现在都运行 Linux。许多这些设备几乎完全没有用户界面,并且没有办法干净地“解除启动”它们。想一想使用启动电池耗尽的汽车,其中[运行 Linux 的主机设备][36] 的电源会不断加电断电。当引擎最终开始运行时,系统如何在没有长时间 fsck 的情况下启动呢?答案是嵌入式设备依赖于[只读根文件系统][37](简称 ro-rootfs)。 -Yet, aficionados will have heard that many IoT and embedded devices like routers, thermostats, and automobiles now run Linux. Many of these devices almost entirely lack a user interface, and there's no way to "unboot" them cleanly. Consider jump-starting a car with a dead battery where the power to the [Linux-running head unit][36] goes up and down repeatedly. How is it that the system boots without a long fsck when the engine finally starts running? The answer is that embedded devices rely on [a read-only root fileystem][37] (ro-rootfs for short). ![Photograph of a console][38] -ro-rootfs are why embedded systems don't frequently need to fsck. Credit (with permission): -A ro-rootfs offers many advantages that are less obvious than incorruptibility. One is that malware cannot write to /usr or /lib if no Linux process can write there. Another is that a largely immutable filesystem is critical for field support of remote devices, as support personnel possess local systems that are nominally identical to those in the field. Perhaps the most important (but also most subtle) advantage is that ro-rootfs forces developers to decide during a project's design phase which system objects will be immutable. Dealing with ro-rootfs may often be inconvenient or even painful, as [const variables in programming languages][39] often are, but the benefits easily repay the extra overhead. +*ro-rootfs 是嵌入式系统不经常需要 fsck 的原因。 来源:* -Creating a read-only rootfs does require some additional amount of effort for embedded developers, and that's where VFS comes in. Linux needs files in /var to be writable, and in addition, many popular applications that embedded systems run will try to create configuration dot-files in $HOME. One solution for configuration files in the home directory is typically to pregenerate them and build them into the rootfs. For /var, one approach is to mount it on a separate writable partition while / itself is mounted as read-only. Using bind or overlay mounts is another popular alternative. +ro-rootfs 提供了许多优点,虽然这些优点不如耐用性那么显然。一个是,如果没有 Linux 进程可以写入,那么恶意软件无法写入 `/usr` 或 `/lib`。另一个是,基本上不可变的文件系统对于远程设备的现场支持至关重要,因为支持人员拥有名义上与现场相同的本地系统。也许最重要(但也是最微妙)的优势是 ro-rootfs 迫使开发人员在项目的设计阶段就决定哪些系统对象是不可变的。处理 ro-rootfs 可能经常是不方便甚至是痛苦的,[编程语言中的常量变量][39]经常就是这样,但带来的好处很容易偿还额外的开销。 -### Bind and overlay mounts and their use by containers +对于嵌入式开发人员,创建只读根文件系统确实需要做一些额外的工作,而这正是 VFS 的用武之地。Linux 需要 `/var` 中的文件可写,此外,嵌入式系统运行的许多流行应用程序将尝试在 `$HOME` 中创建配置点文件。放在家目录中的配置文件的一种解决方案通常是预生成它们并将它们构建到 rootfs 中。对于 `/var`,一种方法是将其挂载在单独的可写分区上,而 `/` 本身以只读方式挂载。使用绑定或叠加挂载是另一种流行的替代方案。 -Running **[man mount][40]** is the best place to learn about bind and overlay mounts, which give embedded developers and system administrators the power to create a filesystem in one path location and then provide it to applications at a second one. For embedded systems, the implication is that it's possible to store the files in /var on an unwritable flash device but overlay- or bind-mount a path in a tmpfs onto the /var path at boot so that applications can scrawl there to their heart's delight. At next power-on, the changes in /var will be gone. Overlay mounts provide a union between the tmpfs and the underlying filesystem and allow apparent modification to an existing file in a ro-rootfs, while bind mounts can make new empty tmpfs directories show up as writable at ro-rootfs paths. While overlayfs is a proper filesystem type, bind mounts are implemented by the [VFS namespace facility][41]. +### 绑定和叠加挂载以及在容器中的使用 -Based on the description of overlay and bind mounts, no one will be surprised that [Linux containers][42] make heavy use of them. Let's spy on what happens when we employ [systemd-nspawn][43] to start up a container by running bcc's mountsnoop tool: +运行 [man mount][40] 是了解绑定挂载bind mount叠加挂载overlay mount的最好办法,这使嵌入式开发人员和系统管理员能够在一个路径位置创建文件系统,然后在另外一个路径将其提供给应用程序。对于嵌入式系统,这代表着可以将文件存储在 `/var` 中的不可写闪存设备上,但是在启动时将 tmpfs 中的路径叠加挂载或绑定挂载到 `/var` 路径上,这样应用程序就可以在那里随意写它们的内容了。下次加电时,`/var` 中的变化将会消失。叠加挂载提供了 tmpfs 和底层文件系统之间的联合,允许对 ro-rootfs 中的现有文件进行直接修改,而绑定挂载可以使新的空 tmpfs 目录在 ro-rootfs 路径中显示为可写。虽然叠加文件系统是一种适当的文件系统类型,但绑定挂载由 [VFS 命名空间工具][41] 实现的。 + +根据叠加挂载和绑定挂载的描述,没有人会对 [Linux容器][42] 大量使用它们感到惊讶。让我们通过运行 bcc 的 `mountsnoop` 工具监视当使用 [systemd-nspawn][43] 启动容器时会发生什么: ![Console - system-nspawn invocation][44] -The system-nspawn invocation fires up the container while mountsnoop.py runs. -And let's see what happened: +*在 mountsnoop.py 运行的同时,system-nspawn 调用启动容器。* + +让我们看看发生了什么: ![Console - Running mountsnoop][45] -Running mountsnoop during the container "boot" reveals that the container runtime relies heavily on bind mounts. (Only the beginning of the lengthy output is displayed) -Here, systemd-nspawn is providing selected files in the host's procfs and sysfs to the container at paths in its rootfs. Besides the MS_BIND flag that sets bind-mounting, some of the other flags that the "mount" system call invokes determine the relationship between changes in the host namespace and in the container. For example, the bind-mount can either propagate changes in /proc and /sys to the container, or hide them, depending on the invocation. +在容器 “启动” 期间运行 `mountsnoop` 可以看到容器运行时很大程度上依赖于绑定挂载。(仅显示冗长输出的开头) -### Summary +这里,`systemd-nspawn` 将主机的 procfs 和 sysfs 中的选定文件其 rootfs 中的路径提供给容器按。除了设置绑定挂载时的 `MS_BIND` 标志之外,`mount` 系统调用的一些其他标志用于确定主机命名空间和容器中的更改之间的关系。例如,绑定挂载可以将 `/proc` 和 `/sys` 中的更改传播到容器,也可以隐藏它们,具体取决于调用。 -Understanding Linux internals can seem an impossible task, as the kernel itself contains a gigantic amount of code, leaving aside Linux userspace applications and the system-call interface in C libraries like glibc. One way to make progress is to read the source code of one kernel subsystem with an emphasis on understanding the userspace-facing system calls and headers plus major kernel internal interfaces, exemplified here by the file_operations table. The file operations are what makes "everything is a file" actually work, so getting a handle on them is particularly satisfying. The kernel C source files in the top-level fs/ directory constitute its implementation of virtual filesystems, which are the shim layer that enables broad and relatively straightforward interoperability of popular filesystems and storage devices. Bind and overlay mounts via Linux namespaces are the VFS magic that makes containers and read-only root filesystems possible. In combination with a study of source code, the eBPF kernel facility and its bcc interface makes probing the kernel simpler than ever before. +### 总结 -Much thanks to [Akkana Peck][46] and [Michael Eager][47] for comments and corrections. +理解 Linux 内部结构似乎是一项不可能完成的任务,因为除了 Linux 用户空间应用程序和 glibc 这样的 C 库中的系统调用接口,内核本身也包含大量代码。取得进展的一种方法是阅读一个内核子系统的源代码,重点是理解面向用户空间的系统调用和头文件以及主要的内核内部接口,这里以 `file_operations` 表为例的。`file_operations` 使得“一切都是文件”可以实际工作,因此掌握它们收获特别大。顶级 `fs/` 目录中的内核 C 源文件构成了虚拟文件系统的实现,虚拟文件​​系统是支持流行的文件系统和存储设备的广泛且相对简单的互操作性的垫片层。通过 Linux 命名空间进行绑定挂载和覆盖挂载是 VFS 魔术,它使容器和只读根文件系统成为可能。结合对源代码的研究,eBPF 内核工具及其 bcc 接口使得探测内核比以往任何时候都更简单。 -Alison Chaiken will present [Virtual filesystems: why we need them and how they work][48] at the 17th annual Southern California Linux Expo ([SCaLE 17x][49]) March 7-10 in Pasadena, Calif. +非常感谢 [Akkana Peck][46] 和 [Michael Eager][47] 的评论和指正。 + +Alison Chaiken 也于 3 月 7 日至 10 日在加利福尼亚州帕萨迪纳举行的第 17 届南加州 Linux 博览会([SCaLE 17x][49])上演讲了[本主题][48]。 -------------------------------------------------------------------------------- @@ -145,7 +153,7 @@ via: https://opensource.com/article/19/3/virtual-filesystems-linux 作者:[Alison Chariken][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4096a42cf3ba7ba1dc38206a6f8041d2a5b621bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Mon, 13 May 2019 15:51:04 +0800 Subject: [PATCH 0422/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ip in Ubuntu and Other Linux -Quick Tip.md | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md index 1800a03110..b7d36cd794 100644 --- a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md +++ b/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -7,86 +7,86 @@ [#]: via: (https://itsfoss.com/use-7zip-ubuntu-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -How to Use 7Zip in Ubuntu and Other Linux [Quick Tip] -====== +如何在 Ubuntu 和其他 Linux 分发版上使用 7Zip [快速指南] +==================================================== -_**Brief: Cannot extract .7z file in Linux? Learn how to install and use 7zip in Ubuntu and other Linux distributions.**_ +_**简介: 不能在 Linux 中提取 .7z 文件? 学习如何在 Ubuntu 和其他 Linux 分发版中安装和使用 7zip。**_ -[7Zip][1] (properly written as 7-Zip) is an archive format hugely popular among Windows users. A 7Zip archive file usually ends in .7z extension. It’s mostly an open source software barring a few part of the code that deals with unRAR. +[7Zip][1](更适当的写法是 7-Zip)是一种在 Windows 用户中广泛流行的文档格式。一个 7Zip 文档文件通常以 .7z 扩展结尾。它大部分是开源的,除了包含一些少量解压 rar 文件的代码。 -The 7Zip support is not enabled by default in most Linux distributions. If you try to extract it, you may see this error: +默认大多数 Linux 分发版不支持 7Zip。如果你试图提取它,你会看见这个错误: -_**Could not open this file type -There is no command installed for 7-zip archive files. Do you want to search for a command to open this file?**_ +_**不能打开这种文件类型 +没有已安装的适用 7-zip 文档文件的命令。你想搜索一个命令来打开这个文件吗**_ ![][2] -Don’t worry, you can easily install 7zip in Ubuntu or other Linux distributions. +不要担心,你可以轻松的在 Ubuntu 和其他 Linux 分发版中安装 7zip。 -The one problem you’ll notice if you try to use the [apt-get install command][3], you’ll see that there are no installation candidate that starts with 7zip. It’s because the 7Zip package in Linux is named [p7zip][4]., start with letter ‘p’ instead of the expected number ‘7’. +一个问题是你会注意到如果你试图用 [apt-get install 命令][3],你会发现没有以 7zip 开头的候选安装。因为在 Linux 中 7Zip 包的名字是 [p7zip][4]。以字母 ‘p’ 开头而不是预期的数字 ‘7’。 -Let’s see how to install 7zip in Ubuntu and (possibly) other distributions. +让我们看一下如何在 Ubuntu 和其他 Linux 分发版中安装 7zip。 -### Install 7Zip in Ubuntu Linux +### 在 Ubuntu Linux 中安装 7Zip ![][5] -First thing you need is to install the p7zip package. You’ll find three 7zip packages in Ubuntu: p7zip, p7zip-full and p7zip-rar. +你需要做的第一件事是安装 p7zip 包。你会在 Ubuntu 中发现 3 个包:p7zip,p7zip-full 和 pzip-rar。 -The difference between p7zip and p7zip-full is that p7zip is a lighter version providing support only for .7z while the full version provides support for more 7z compression algorithms (for audio files etc). +pzip 和 p7zip-full 的不同是 pzip 是一个轻量级的版本,仅仅对 .7z 文件提供支持,而 full 版本提供了更多的 7z 压缩算法(例如音频文件)。 -The p7zip-rar package provides support for [RAR files][6] along with 7z. +p7zip-rar 包在 7z 中提供了对 [RAR 文件][6] 的支持 -Installing p7zip-full should be sufficient in most cases but you may also install p7zip-rar for additional support for the rar file. +安装 p7zip-full 在大多数情况下足够了,但是你可能想安装 p7zip-rar 来支持 rar 文件的解压。 -p7zip packages are in the [universe repository in Ubuntu][7] so make sure that you have enabled it using this command: +p7zip 包在[ Ubuntu 的 universe 仓库][7] 因此保证你可以使用以下命令: ``` sudo add-apt-repository universe sudo apt update ``` -Use the following command to install 7zip support in Ubuntu and Debian based distributions. +在 Ubuntu 和 基于 Debian 的分发版中使用以下命令。 ``` sudo apt install p7zip-full p7zip-rar ``` -That’s good. Now you have 7zip archive support in your system. +这很好。现在在你的系统之有了 7zip 文档的支持。 [][8] -Suggested read Easily Share Files Between Linux, Windows And Mac Using NitroShare +建议使用 NitroShare 在 Linux,Windows 和 Mac 系统之间轻松共享文件。 -### Extract 7Zip archive file in Linux +### 在 Linux中提取 7Zip 文档文件 -With 7Zip installed, you can either use the GUI or the command line to extract 7zip files in Linux. +安装了 7Zip 后,在 Linux 中,你可以在图形用户界面或者 命令行中提取 7zip 文件。 -In GUI, you can extract a .7z file as you extract any other compressed file. You right click on the file and proceed to extract it. +在图形用户界面,你可以像提取其他压缩文件一样提取 .7z 文件。右击文件来提取它。 -In terminal, you can extract a .7z archive file using this command: +在终端中,你可以使用下列命令提取 .7z 文档文件: ``` 7z e file.7z ``` -### Compress a file in 7zip archive format in Linux +### 在 Linux 中压缩文件为 7zip 文档格式 -You can compress a file in 7zip archive format graphically. Simply right click on the file/directory, and select **Compress**. You should see several types of archive format options. Choose .7z for 7zip. +你可以在图形界面压缩文件为 7zip 文档格式。简单的在文件或目录上右击,选择**压缩**。你应该看到几种类型的文件格式选项。选择 .7z。 ![7zip Archive Ubuntu][9] -Alternatively, you can also use the command line. Here’s the command that you can use for this purpose: +作为替换,你也可以在命令行中使用。这里是你可以用来压缩的命令: ``` -7z a OutputFile files_to_compress +7z a 输出的文件名 要压缩的文件 ``` -By default, the archived file will have .7z extension. You can compress the file in zip format by specifying the extension (.zip) of the output file. +默认,文档文件有 .7z 扩展。你可以压缩文件为 zip 格式通过在输出文件中指定0扩展(.zip)。 -**Conclusion** +**总结** -That’s it. See, how easy it is to use 7zip in Linux? I hope you liked this quick tip. If you have questions or suggestions, feel free to let me know the comment sections. +就是这样。看,在 Linux 中使用 7zip 多简单?我希望你喜欢这个快速指南。如果你有问题或者建议,请随意在下方评论让我知道。 -------------------------------------------------------------------------------- @@ -94,7 +94,7 @@ via: https://itsfoss.com/use-7zip-ubuntu-linux/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[warmfrog](https://github.com/warmfrog) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2e77ee1c1e6ea510323c05984e6e753edce37ddb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 15:52:56 +0800 Subject: [PATCH 0423/1154] TSL:20190308 Virtual filesystems in Linux- Why we need them and how they work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 忘记移动了 --- ...al filesystems in Linux- Why we need them and how they work.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md (100%) diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md similarity index 100% rename from sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md rename to translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md From 22b3c612a0b72ff3b9204aefbd474dfaec98b94d Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 18:38:40 +0800 Subject: [PATCH 0424/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20Bloc?= =?UTF-8?q?kchain=202.0=20=E2=80=93=20Introduction=20To=20Hyperledger=20Fa?= =?UTF-8?q?bric=20[Part=2010]=20sources/tech/20190513=20Blockchain=202.0?= =?UTF-8?q?=20-=20Introduction=20To=20Hyperledger=20Fabric=20-Part=2010.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oduction To Hyperledger Fabric -Part 10.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md diff --git a/sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md b/sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md new file mode 100644 index 0000000000..c685af487c --- /dev/null +++ b/sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Introduction To Hyperledger Fabric [Part 10]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-fabric/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Blockchain 2.0 – Introduction To Hyperledger Fabric [Part 10] +====== + +![Hyperledger Fabric][1] + +### Hyperledger Fabric + +The [**Hyperledger project**][2] is an umbrella organization of sorts featuring many different modules and systems under development. Among the most popular among these individual sub-projects is the **Hyperledger Fabric**. This post will explore the features that would make the Fabric almost indispensable in the near future once blockchain systems start proliferating into main stream use. Towards the end we will also take a quick look at what developers and enthusiasts need to know regarding the technicalities of the Hyperledger Fabric. + +### Inception + +In the usual fashion for the Hyperledger project, Fabric was “donated” to the organization by one of its core members, **IBM** , who was previously the principle developer of the same. The technology platform shared by IBM was put to joint development at the Hyperledger project with contributions from over a 100 member companies and institutions. + +Currently running on **v1.4** of the LTS version, Fabric has come a long way and is currently seen as the go to enterprise solution for managing business data. The core vision that surrounds the Hyperledger project inevitably permeates into the Fabric as well. The Hyperledger Fabric system carries forward all the enterprise ready and scalable features that are hard coded into all projects under the Hyperledger organization. + +### Highlights Of Hyperledger Fabric + +Hyperledger Fabric offers a wide variety of features and standards that are built around the mission of supporting fast development and modular architectures. Furthermore, compared to its competitors (primarily **Ripple** and [**Ethereum**][3]), Fabric takes an explicit stance toward closed and [**permissioned blockchains**][4]. Their core objective here is to develop a set of tools which will aid blockchain developers in creating customized solutions and not to create a standalone ecosystem or a product. + +Some of the highlights of the Hyperledger Fabric are given below: + + * **Permissioned blockchain systems** + + + +This is a category where other platforms such as Ethereum and Ripple differ quite a lot with Hyperledger Fabric. The Fabric by default is a tool designed to implement a private permissioned blockchain. Such blockchains cannot be accessed by everyone and the nodes working to offer consensus or to verify transactions are chosen by a central authority. This might be important for some applications such as banking and insurance, where transactions have to be verified by the central authority rather than participants. + + * **Confidential and controlled information flow** + + + +The Fabric has built in permission systems that will restrict information flow within a specific group or certain individuals as the case may be. Unlike a public blockchain where anyone and everyone who runs a node will have a copy and selective access to data stored in the blockchain, the admin of the system can choose how to and who to share access to the information. There are also subsystems which will encrypt the stored data at better security standards compared to existing competition. + + * **Plug and play architecture** + + + +Hyperledger Fabric has a plug and play type architecture. Individual components of the system may be chosen to be implemented and components of the system that developers don’t see a use for maybe discarded. The Fabric takes a highly modular and customizable route to development rather than a one size fits all approach taken by its competitors. This is especially attractive for firms and companies looking to build a lean system fast. This combined with the interoperability of the Fabric with other Hyperledger components implies that developers and designers now have access to a diverse set of standardized tools instead of having to pull code from different sources and integrate them afterwards. It also presents a rather fail-safe way to build robust modular systems. + + * **Smart contracts and chaincode** + + + +A distributed application running on a blockchain is called a [**Smart contract**][5]. While the smart contract term is more or less associated with the Ethereum platform, chaincode is the name given to the same in the Hyperledger camp. Apart from possessing all the benefits of **DApps** being present in chaincode applications, what sets Hyperledger apart is the fact that the code for the same may be written in multiple high-level programming language. It supports [**Go**][6] and **JavaScript** out of the box and supports many other after integration with appropriate compiler modules as well. Though this fact might not mean much at this point, the fact remains that if existing talent can be used for ongoing projects involving blockchain that has the potential to save companies billions of dollars in personnel training and management in the long run. Developers can code in languages they’re comfortable in to start building applications on the Hyperledger Fabric and need not learn nor train in platform specific languages and syntax. This presents flexibility which current competitors of the Hyperledger Fabric do not offer. + + * The Hyperledger Fabric is a back-end driver platform and is mainly aimed at integration projects where a blockchain or another distributed ledger technology is required. As such it does not provide any user facing services except for minor scripting capabilities. (Think of it to be more like a scripting language.) + * Hyperledger Fabric supports building sidechains for specific use-cases. In case, the developer wishes to isolate a set of users or participants to a specific part or functionality of the application, they may do so by implementing side-chains. Side-chains are blockchains that derive from a main parent, but form a different chain after their initial block. This block which gives rise to the new chain will stay immune to further changes in the new chain and the new chain remains immutable even if new information is added to the original chain. This functionality will aid in scaling the platform being developed and usher in user specific and case specific processing capabilities. + * The previous feature also means that not all users will have an “exact” copy of all the data in the blockchain as is expected usually from public chains. Participating nodes will have a copy of data that is only relevant to them. For instance, consider an application similar to PayTM in India. The app has wallet functionality as well as an e-commerce end. However, not all its wallet users use PayTM to shop online. In this scenario, only active shoppers will have the corresponding chain of transactions on the PayTM e-commerce site, whereas the wallet users will just have a copy of the chain that stores wallet transactions. This flexible architecture for data storage and retrieval is important while scaling, since massive singular blockchains have been shown to increase lead times for processing transactions. The chain can be kept lean and well categorised this way. + + + +We will look at other modules under the Hyperledger Project in detail in upcoming posts. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-fabric/ + +作者:[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]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ +[3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[4]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ +[5]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[6]: https://www.ostechnix.com/install-go-language-linux/ From 57d9aeabe74a7bb1c6d9399cb4c1e24175f355a9 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 13 May 2019 18:48:37 +0800 Subject: [PATCH 0425/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Writ?= =?UTF-8?q?e=20faster=20C=20extensions=20for=20Python=20with=20Cython=20so?= =?UTF-8?q?urces/tech/20190501=20Write=20faster=20C=20extensions=20for=20P?= =?UTF-8?q?ython=20with=20Cython.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ter C extensions for Python with Cython.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20190501 Write faster C extensions for Python with Cython.md diff --git a/sources/tech/20190501 Write faster C extensions for Python with Cython.md b/sources/tech/20190501 Write faster C extensions for Python with Cython.md new file mode 100644 index 0000000000..1d13bfd6d6 --- /dev/null +++ b/sources/tech/20190501 Write faster C extensions for Python with Cython.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Write faster C extensions for Python with Cython) +[#]: via: (https://opensource.com/article/19/5/python-cython) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00) + +Write faster C extensions for Python with Cython +====== +Learn more about solving common Python problems in our series covering +seven PyPI libraries. +![Hand drawing out the word "code"][1] + +Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. + +In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. First up: **[**Cython**][4]** , a language that simplifies writing C extensions for Python. + +### Cython + +Python is fun to use, but sometimes, programs written in it can be slow. All the runtime dynamic dispatching comes with a steep price: sometimes it's up to 10-times slower than equivalent code written in a systems language like C or Rust. + +Moving pieces of code to a completely new language can have a big cost in both effort and reliability: All that manual rewrite work will inevitably introduce bugs. Can we have our cake and eat it too? + +To have something to optimize for this exercise, we need something slow. What can be slower than an accidentally exponential implementation of the Fibonacci sequence? + + +``` +def fib(n): + if n < 2: + return 1 + return fib(n-1) + fib(n-2) +``` + +Since a call to **fib** results in two calls, this beautifully inefficient algorithm takes a long time to execute. For example, on my new laptop, **fib(36)** takes about 4.5 seconds. These 4.5 seconds will be our baseline as we explore how Python's Cython extension can help. + +The proper way to use Cython is to integrate it into **setup.py**. However, a quick and easy way to try things out is with **pyximport**. Let's put the **fib** code above in **fib.pyx** and run it using Cython. + + +``` +>>> import pyximport; pyximport.install() +>>> import fib +>>> fib.fib(36) +``` + +Just using Cython with _no_ code changes reduced the time the algorithm takes on my laptop to around 2.5 seconds. That's a reduction of almost 50% runtime with almost no effort; certainly, a scrumptious cake to eat and have! + +Putting in a little more effort, we can make things even faster. + + +``` +cpdef int fib(int n): + if n < 2: + return 1 + return fib(n - 1) + fib(n - 2) +``` + +We moved the code in **fib** to a function defined with **cpdef** and added a couple of type annotations: it takes an integer and returns an integer. + +This makes it _much_ faster—around 0.05 seconds. It's so fast that I may start suspecting my measurement methods contain noise: previously, this noise was lost in the signal. + +So, the next time some of your Python code spends too long on the CPU, maybe spinning up some fans in the process, why not see if Cython can fix things? + +In the next article in this series, we'll look at **Black** , a project that automatically corrects format errors in your code. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-cython + +作者:[Moshe Zadka ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/Cython/ From 9b39f566a927015e6c332aad705c54ff6b0e275e Mon Sep 17 00:00:00 2001 From: MjSeven Date: Mon, 13 May 2019 21:46:48 +0800 Subject: [PATCH 0426/1154] Translating by MjSeven --- sources/tech/20190503 API evolution the right way.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190503 API evolution the right way.md b/sources/tech/20190503 API evolution the right way.md index ada8bdce20..087c71eead 100644 --- a/sources/tech/20190503 API evolution the right way.md +++ b/sources/tech/20190503 API evolution the right way.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 54d5fa2a98dc41e5e73e63f8000371df063a76f2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 21:52:24 +0800 Subject: [PATCH 0427/1154] PRF:20171214 Build a game framework with Python using the module Pygame.md @robsean --- ...ork with Python using the module Pygame.md | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/translated/tech/20171214 Build a game framework with Python using the module Pygame.md b/translated/tech/20171214 Build a game framework with Python using the module Pygame.md index 7ce7402959..83ea2b7dcd 100644 --- a/translated/tech/20171214 Build a game framework with Python using the module Pygame.md +++ b/translated/tech/20171214 Build a game framework with Python using the module Pygame.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Build a game framework with Python using the module Pygame) @@ -9,29 +9,31 @@ 使用 Python 和 Pygame 模块构建一个游戏框架 ====== -这系列的第一篇通过创建一个简单的骰子游戏来探究 Python。现在是来从零制作你自己的游戏的时间。 + + > 这系列的第一篇通过创建一个简单的骰子游戏来探究 Python。现在是来从零制作你自己的游戏的时间。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python2-header.png?itok=tEvOVo4A) -在我的 [这系列的第一篇文章][1] 中, 我已经讲解如何使用 Python 创建一个简单的,基于文本的骰子游戏。这次,我将展示如何使用 Python 和 Pygame 模块来创建一个图形化游戏。它将占用一些文章来得到一个确实完成一些东西的游戏,但是在这系列的结尾,你将有一个更好的理解,如何查找和学习新的 Python 模块和如何从其基础上构建一个应用程序。 +在我的[这系列的第一篇文章][1] 中, 我已经讲解如何使用 Python 创建一个简单的、基于文本的骰子游戏。这次,我将展示如何使用 Python 模块 Pygame 来创建一个图形化游戏。它将需要几篇文章才能来得到一个确实做成一些东西的游戏,但是到这系列的结尾,你将更好地理解如何查找和学习新的 Python 模块和如何从其基础上构建一个应用程序。 在开始前,你必须安装 [Pygame][2]。 ### 安装新的 Python 模块 -这里有一些方法来安装 Python 模块,但是最通用的两个是: +有几种方法来安装 Python 模块,但是最通用的两个是: * 从你的发行版的软件存储库 - * 使用 Python 的软件包管理器,pip + * 使用 Python 的软件包管理器 `pip` -两个方法都工作很好,并且每一个都有它自己的一套优势。如果你是在 Linux 或 BSD 上开发,促使你的发行版的软件存储库确保自动及时更新。 +两个方法都工作的很好,并且每一个都有它自己的一套优势。如果你是在 Linux 或 BSD 上开发,可以利用你的发行版的软件存储库来自动和及时地更新。 -然而,使用 Python 的内置软件包管理器给予你控制更新模块时间的能力。而且,它不是明确指定操作系统的,意味着,即使当你不是在你常用的开发机器上时,你也可以使用它。pip 的其它的优势是允许模块局部安装,如果你没有一台正在使用的计算机的权限,它是有用的。 +然而,使用 Python 的内置软件包管理器可以给予你控制更新模块时间的能力。而且,它不是特定于操作系统的,这意味着,即使当你不是在你常用的开发机器上时,你也可以使用它。`pip` 的其它的优势是允许本地安装模块,如果你没有正在使用的计算机的管理权限,这是有用的。 ### 使用 pip -如果 Python 和 Python3 都安装在你的系统上,你想使用的命令很可能是 `pip3`,它区分来自Python 2.x 的 `pip` 的命令。如果你不确定,先尝试 `pip3`。 +如果 Python 和 Python3 都安装在你的系统上,你想使用的命令很可能是 `pip3`,它用来区分 Python 2.x 的 `pip` 的命令。如果你不确定,先尝试 `pip3`。 -`pip` 命令有些像大多数 Linux 软件包管理器的工作。你可以使用 `search` 搜索 Pythin 模块,然后使用 `install` 安装它们。如果你没有你正在使用的计算机的权限来安装软件,你可以使用 `--user` 选项来仅仅安装模块到你的 home 目录。 +`pip` 命令有些像大多数 Linux 软件包管理器一样工作。你可以使用 `search` 搜索 Python 模块,然后使用 `install` 安装它们。如果你没有你正在使用的计算机的管理权限来安装软件,你可以使用 `--user` 选项来仅仅安装模块到你的家目录。 ``` $ pip3 search pygame @@ -44,11 +46,11 @@ pygame_cffi (0.2.1)            - A cffi-based SDL wrapper that copies the $ pip3 install Pygame --user ``` -Pygame 是一个 Python 模块,这意味着它仅仅是一套可以被使用在你的 Python 程序中库。换句话说,它不是一个你启动的程序,像 [IDLE][3] 或 [Ninja-IDE][4] 一样。 +Pygame 是一个 Python 模块,这意味着它仅仅是一套可以使用在你的 Python 程序中的库。换句话说,它不是一个像 [IDLE][3] 或 [Ninja-IDE][4] 一样可以让你启动的程序。 ### Pygame 新手入门 -一个电子游戏需要一个故事背景;一个发生的地点。在 Python 中,有两种不同的方法来创建你的故事背景: +一个电子游戏需要一个背景设定:故事发生的地点。在 Python 中,有两种不同的方法来创建你的故事背景: * 设置一种背景颜色 * 设置一张背景图片 @@ -57,15 +59,15 @@ Pygame 是一个 Python 模块,这意味着它仅仅是一套可以被使用 ### 设置你的 Pygame 脚本 -为了开始一个新的 Pygame 脚本,在计算机上创建一个文件夹。游戏的全部文件被放在这个目录中。在工程文件夹内部保持所需要的所有的文件来运行游戏是极其重要的。 +要开始一个新的 Pygame 工程,先在计算机上创建一个文件夹。游戏的全部文件被放在这个目录中。在你的工程文件夹内部保持所需要的所有的文件来运行游戏是极其重要的。 ![](https://opensource.com/sites/default/files/u128651/project.jpg) -一个 Python 脚本以文件类型,你的姓名,和你想使用的协议开始。使用一个开放源码协议,以便你的朋友可以改善你的游戏并与你一起分享他们的更改: +一个 Python 脚本以文件类型、你的姓名,和你想使用的许可证开始。使用一个开放源码许可证,以便你的朋友可以改善你的游戏并与你一起分享他们的更改: ``` #!/usr/bin/env python3 -# Seth Kenlon 编写 +# by Seth Kenlon ## GPLv3 # This program is free software: you can redistribute it and/or @@ -75,14 +77,14 @@ Pygame 是一个 Python 模块,这意味着它仅仅是一套可以被使用 # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program.  If not, see . +# along with this program. If not, see . ``` -然后,你告诉 Python 你想使用的模块。一些模块是常见的 Python 库,当然,你想包括一个你刚刚安装的,Pygame 。 +然后,你告诉 Python 你想使用的模块。一些模块是常见的 Python 库,当然,你想包括一个你刚刚安装的 Pygame 模块。 ``` import pygame  # 加载 pygame 关键字 @@ -90,7 +92,7 @@ import sys     # 让 python 使用你的文件系统 import os      # 帮助 python 识别你的操作系统 ``` -由于你将用这个脚本文件工作很多,在文件中制作成段落是有帮助的,以便你知道在哪里放原料。使用语句块注释来做这些,这些注释仅在看你的源文件代码时是可见的。在你的代码中创建三个语句块。 +由于你将用这个脚本文件做很多工作,在文件中分成段落是有帮助的,以便你知道在哪里放代码。你可以使用块注释来做这些,这些注释仅在看你的源文件代码时是可见的。在你的代码中创建三个块。 ``` ''' @@ -114,7 +116,7 @@ Main Loop 接下来,为你的游戏设置窗口大小。注意,不是每一个人都有大计算机屏幕,所以,最好使用一个适合大多数人的计算机的屏幕大小。 -这里有一个方法来切换全屏模式,很多现代电子游戏做的方法,但是,由于你刚刚开始,保存它简单和仅设置一个大小。 +这里有一个方法来切换全屏模式,很多现代电子游戏都会这样做,但是,由于你刚刚开始,简单起见仅设置一个大小即可。 ``` ''' @@ -124,7 +126,7 @@ worldx = 960 worldy = 720 ``` -在一个脚本中使用 Pygame 引擎前,你需要一些基本的设置。你必需设置帧频,启动它的内部时钟,然后开始 (`init`) Pygame 。 +在脚本中使用 Pygame 引擎前,你需要一些基本的设置。你必须设置帧频,启动它的内部时钟,然后开始 (`init`)Pygame 。 ``` fps   = 40  # 帧频 @@ -137,17 +139,15 @@ pygame.init() ### 设置背景 -在你继续前,打开一个图形应用程序,并为你的游戏世界创建一个背景。在你的工程目录中的 `images` 文件夹内部保存它为 `stage.png` 。 +在你继续前,打开一个图形应用程序,为你的游戏世界创建一个背景。在你的工程目录中的 `images` 文件夹内部保存它为 `stage.png` 。 这里有一些你可以使用的自由图形应用程序。 - * [Krita][5] 是一个专业级绘图原料模拟器,它可以被用于创建漂亮的图片。如果你对电子游戏创建艺术作品非常感兴趣,你甚至可以购买一系列的[游戏艺术作品教程][6]. - * [Pinta][7] 是一个基本的,易于学习的绘图应用程序。 - * [Inkscape][8] 是一个矢量图形应用程序。使用它来绘制形状,线,样条曲线,和 Bézier 曲线。 +* [Krita][5] 是一个专业级绘图素材模拟器,它可以被用于创建漂亮的图片。如果你对创建电子游戏艺术作品非常感兴趣,你甚至可以购买一系列的[游戏艺术作品教程][6]。 +* [Pinta][7] 是一个基本的,易于学习的绘图应用程序。 +* [Inkscape][8] 是一个矢量图形应用程序。使用它来绘制形状、线、样条曲线和贝塞尔曲线。 - - -你的图像不必很复杂,你可以以后回去更改它。一旦你有它,在你文件的 setup 部分添加这些代码: +你的图像不必很复杂,你可以以后回去更改它。一旦有了它,在你文件的 Setup 部分添加这些代码: ``` world    = pygame.display.set_mode([worldx,worldy]) @@ -155,13 +155,13 @@ backdrop = pygame.image.load(os.path.join('images','stage.png').convert()) backdropbox = world.get_rect() ``` -如果你仅仅用一种颜色来填充你的游戏的背景,你需要做的全部是: +如果你仅仅用一种颜色来填充你的游戏的背景,你需要做的就是: ``` world = pygame.display.set_mode([worldx,worldy]) ``` -你也必需定义一个来使用的颜色。在你的 setup 部分,使用红,绿,蓝 (RGB) 的值来创建一些颜色的定义。 +你也必须定义颜色以使用。在你的 Setup 部分,使用红、绿、蓝 (RGB) 的值来创建一些颜色的定义。 ``` ''' @@ -173,13 +173,13 @@ BLACK = (23,23,23 ) WHITE = (254,254,254) ``` -在这点上,你能理论上启动你的游戏。问题是,它可能仅持续一毫秒。 +至此,你理论上可以启动你的游戏了。问题是,它可能仅持续了一毫秒。 -为证明这一点,保存你的文件为 `your-name_game.py` (用你真实的名称替换 `your-name` )。然后启动你的游戏。 +为证明这一点,保存你的文件为 `your-name_game.py`(用你真实的名称替换 `your-name`)。然后启动你的游戏。 -如果你正在使用 IDLE ,通过选择来自 Run 菜单的 `Run Module` 来运行你的游戏。 +如果你正在使用 IDLE,通过选择来自 “Run” 菜单的 “Run Module” 来运行你的游戏。 -如果你正在使用 Ninja ,在左侧按钮条中单击 `Run file` 按钮。 +如果你正在使用 Ninja,在左侧按钮条中单击 “Run file” 按钮。 ![](https://opensource.com/sites/default/files/u128651/ninja_run_0.png) @@ -189,27 +189,27 @@ WHITE = (254,254,254) $ python3 ./your-name_game.py ``` -如果你正在使用 Windows ,使用这命令: +如果你正在使用 Windows,使用这命令: ``` py.exe your-name_game.py ``` -你启动它,不过不要期望很多,因为你的游戏现在仅仅持续几毫秒。你可以在下一部分中修复它。 +启动它,不过不要期望很多,因为你的游戏现在仅仅持续几毫秒。你可以在下一部分中修复它。 ### 循环 -除非另有说明,一个 Python 脚本运行一次并仅一次。近来计算机的运行速度是非常快的,所以你的 Python 脚本运行时间少于1秒钟。 +除非另有说明,一个 Python 脚本运行一次并仅一次。近来计算机的运行速度是非常快的,所以你的 Python 脚本运行时间会少于 1 秒钟。 为强制你的游戏来处于足够长的打开和活跃状态来让人看到它(更不要说玩它),使用一个 `while` 循环。为使你的游戏保存打开,你可以设置一个变量为一些值,然后告诉一个 `while` 循环只要变量保持未更改则一直保存循环。 -这经常被称为一个"主循环",你可以使用术语 `main` 作为你的变量。在你的 setup 部分的任意位置添加这些代码: +这经常被称为一个“主循环”,你可以使用术语 `main` 作为你的变量。在你的 Setup 部分的任意位置添加代码: ``` main = True ``` -在主循环期间,使用 Pygame 关键字来检查是否在键盘上的按键已经被按下或释放。添加这些代码到你的主循环部分: +在主循环期间,使用 Pygame 关键字来检查键盘上的按键是否已经被按下或释放。添加这些代码到你的主循环部分: ``` ''' @@ -228,7 +228,7 @@ while main == True:                 main = False ``` -也在你的循环中,刷新你世界的背景。 +也是在你的循环中,刷新你世界的背景。 如果你使用一个图片作为背景: @@ -242,33 +242,33 @@ world.blit(backdrop, backdropbox) world.fill(BLUE) ``` -最后,告诉 Pygame 来刷新在屏幕上的所有内容并推进游戏的内部时钟。 +最后,告诉 Pygame 来重新刷新屏幕上的所有内容,并推进游戏的内部时钟。 ```     pygame.display.flip()     clock.tick(fps) ``` -保存你的文件,再次运行它来查看曾经创建的最无趣的游戏。 +保存你的文件,再次运行它来查看你曾经创建的最无趣的游戏。 退出游戏,在你的键盘上按 `q` 键。 -在这系列的 [下一篇文章][9] 中,我将向你演示,如何加强你当前空的游戏世界,所以,继续学习并创建一些将要使用的图形! +在这系列的 [下一篇文章][9] 中,我将向你演示,如何加强你当前空空如也的游戏世界,所以,继续学习并创建一些将要使用的图形! -------------------------------------------------------------------------------- -通过: https://opensource.com/article/17/12/game-framework-python +via: https://opensource.com/article/17/12/game-framework-python 作者:[Seth Kenlon][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/) 荣誉推出 [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/17/10/python-101 +[1]: https://linux.cn/article-9071-1.html [2]: http://www.pygame.org/wiki/about [3]: https://en.wikipedia.org/wiki/IDLE [4]: http://ninja-ide.org/ From cc6e0c83fb5d2baed49e5b428fe38ac57030687f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 21:54:20 +0800 Subject: [PATCH 0428/1154] PUB:20171214 Build a game framework with Python using the module Pygame.md @robsean https://linux.cn/article-10850-1.html --- ...ld a game framework with Python using the module Pygame.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20171214 Build a game framework with Python using the module Pygame.md (99%) diff --git a/translated/tech/20171214 Build a game framework with Python using the module Pygame.md b/published/20171214 Build a game framework with Python using the module Pygame.md similarity index 99% rename from translated/tech/20171214 Build a game framework with Python using the module Pygame.md rename to published/20171214 Build a game framework with Python using the module Pygame.md index 83ea2b7dcd..931a248a8c 100644 --- a/translated/tech/20171214 Build a game framework with Python using the module Pygame.md +++ b/published/20171214 Build a game framework with Python using the module Pygame.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10850-1.html) [#]: subject: (Build a game framework with Python using the module Pygame) [#]: via: (https://opensource.com/article/17/12/game-framework-python) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 615967521a10ed8f8ccba4cccef4c04891f43f94 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 22:30:05 +0800 Subject: [PATCH 0429/1154] PRF:20190505 How To Create SSH Alias In Linux.md @MjSeven --- ...190505 How To Create SSH Alias In Linux.md | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/translated/tech/20190505 How To Create SSH Alias In Linux.md b/translated/tech/20190505 How To Create SSH Alias In Linux.md index 42960e945d..35bd112d5d 100644 --- a/translated/tech/20190505 How To Create SSH Alias In Linux.md +++ b/translated/tech/20190505 How To Create SSH Alias In Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Create SSH Alias In Linux) @@ -10,9 +10,9 @@ 如何在 Linux 中创建 SSH 别名 ====== -![How To Create SSH Alias In Linux][1] +![How To Create SSH Alias In Linux](https://img.linux.net.cn/data/attachment/album/201905/13/222910h2uwy06um3byr68r.jpg) -如果你经常通过 SSH 访问许多不同的远程系统,这个技巧将为你节省一些时间。你可以通过 SSH 为频繁访问的系统创建 SSH 别名,这样你就不必记住所有不同的用户名、主机名、ssh 端口号和 IP 地址等。此外,它避免了在 SSH 到 Linux 服务器时重复输入相同的用户名、主机名、IP 地址、端口号。 +如果你经常通过 SSH 访问许多不同的远程系统,这个技巧将为你节省一些时间。你可以通过 SSH 为频繁访问的系统创建 SSH 别名,这样你就不必记住所有不同的用户名、主机名、SSH 端口号和 IP 地址等。此外,它避免了在 SSH 到 Linux 服务器时重复输入相同的用户名、主机名、IP 地址、端口号。 ### 在 Linux 中创建 SSH 别名 @@ -38,20 +38,20 @@ $ ssh -p 22 sk@server.example.com 这里 - * **22** 是端口号, - * **sk** 是远程系统的用户名, - * **192.168.225.22** 是我远程系统的 IP, - * **server.example.com** 是远程系统的主机名。 + * `22` 是端口号, + * `sk` 是远程系统的用户名, + * `192.168.225.22` 是我远程系统的 IP, + * `server.example.com` 是远程系统的主机名。 -我相信大多数新手 Linux 用户和(或一些)管理员都会以这种方式通过 SSH 连接到远程系统。但是,如果你通过 SSH 连接到多个不同的系统,记住所有主机名或 IP 地址,还有用户名是困难的,除非你将它们写在纸上或者将其保存在文本文件中。别担心!这可以通过为 SSH 连接创建别名(或快捷方式)轻松解决。 +我相信大多数 Linux 新手和(或一些)管理员都会以这种方式通过 SSH 连接到远程系统。但是,如果你通过 SSH 连接到多个不同的系统,记住所有主机名或 IP 地址,还有用户名是困难的,除非你将它们写在纸上或者将其保存在文本文件中。别担心!这可以通过为 SSH 连接创建别名(或快捷方式)轻松解决。 我们可以用两种方法为 SSH 命令创建别名。 -##### 方法 1 – 使用 SSH 配置文件 +#### 方法 1 – 使用 SSH 配置文件 这是我创建别名的首选方法。 -我们可以使用 SSH 默认配置文件来创建 SSH 别名。为此,编辑 **~/.ssh/config** 文件(如果此文件不存在,只需创建一个): +我们可以使用 SSH 默认配置文件来创建 SSH 别名。为此,编辑 `~/.ssh/config` 文件(如果此文件不存在,只需创建一个): ``` $ vi ~/.ssh/config @@ -75,17 +75,16 @@ Host dhcp ``` ![][2] -使用 SSH 配置文件在 Linux 中创建 SSH 别名 -将 **Host**、**Hostname**、**User** 和 **Port** 的值替换为你自己的值。添加所有远程主机的详细信息后,保存并退出该文件。 +*使用 SSH 配置文件在 Linux 中创建 SSH 别名* + +将 `Host`、`Hostname`、`User` 和 `Port` 配置的值替换为你自己的值。添加所有远程主机的详细信息后,保存并退出该文件。 现在你可以使用以下命令通过 SSH 进入系统: ``` $ ssh webserver - $ ssh dns - $ ssh dhcp ``` @@ -94,13 +93,14 @@ $ ssh dhcp 看看下面的截图。 ![][3] -使用 SSH 别名访问远程系统 -看到了吗?我只使用别名(例如 **webserver**)来访问 IP 地址为 **192.168.225.22** 的远程系统。 +*使用 SSH 别名访问远程系统* -请注意,这只使用于当前用户。如果要为所有用户(系统范围内)提供别名,请在 **/etc/ssh/ssh_config** 文件中添加以上行。 +看到了吗?我只使用别名(例如 `webserver`)来访问 IP 地址为 `192.168.225.22` 的远程系统。 -你还可以在 SSH 配置文件中添加许多其他内容。例如,如果你[**已配置基于 SSH 密钥的身份验证**][4],说明 SSH 密钥文件的位置,如下所示: +请注意,这只使用于当前用户。如果要为所有用户(系统范围内)提供别名,请在 `/etc/ssh/ssh_config` 文件中添加以上行。 + +你还可以在 SSH 配置文件中添加许多其他内容。例如,如果你[已配置基于 SSH 密钥的身份验证][4],说明 SSH 密钥文件的位置,如下所示: ``` Host ubuntu @@ -119,11 +119,11 @@ $ ssh ubuntu 这样,你可以添加希望通过 SSH 访问的任意多台远程主机,并使用别名快速访问它们。 -##### 方法 2 – 使用 Bash 别名 +#### 方法 2 – 使用 Bash 别名 -这是创建 SSH 别名的一种应急变通的方法,可以加快通信的速度。你可以使用 [**alias 命令**][5]使这项任务更容易。 +这是创建 SSH 别名的一种应急变通的方法,可以加快通信的速度。你可以使用 [alias 命令][5]使这项任务更容易。 -打开 **~/.bashrc** 或者 **~/.bash_profile** 文件: +打开 `~/.bashrc` 或者 `~/.bash_profile` 文件: ``` alias webserver='ssh sk@server.example.com' @@ -146,7 +146,7 @@ $ source ~/.bashrc $ source ~/.bash_profile ``` -在此方法中,你甚至不需要使用 “ssh 别名” 命令。相反,只需使用别名,如下所示。 +在此方法中,你甚至不需要使用 `ssh 别名` 命令。相反,只需使用别名,如下所示。 ``` $ webserver @@ -158,17 +158,14 @@ $ ubuntu ![][6] 这两种方法非常简单,但对于经常通过 SSH 连接到多个不同系统的人来说非常有用,而且非常方便。使用适合你的上述任何一种方法,通过 SSH 快速访问远程 Linux 系统。 -* * * -**建议阅读:** +建议阅读: - * [**允许或拒绝 SSH 访问 Linux 中的特定用户或组**][7] - * [**如何在 Linux 上 SSH 到特定目录**][8] - * [**如何在 Linux 中断开 SSH 会话**][9] - * [**4 种方式在退出 SSH 会话后保持命令运行**][10] - * [**SSLH – 共享相同端口的 HTTPS 和 SSH**][11] - -* * * + * [允许或拒绝 SSH 访问 Linux 中的特定用户或组][7] + * [如何在 Linux 上 SSH 到特定目录][8] + * [如何在 Linux 中断开 SSH 会话][9] + * [4 种方式在退出 SSH 会话后保持命令运行][10] + * [SSLH – 共享相同端口的 HTTPS 和 SSH][11] 目前这就是全部了,希望它对你有帮助。更多好东西要来了,敬请关注! @@ -181,7 +178,7 @@ via: https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/ 作者:[sk][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0ee09587f57fb2e60bfddcb48b7241e990184083 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 May 2019 22:30:54 +0800 Subject: [PATCH 0430/1154] PUB:20190505 How To Create SSH Alias In Linux.md @MjSeven https://linux.cn/article-10851-1.html --- .../20190505 How To Create SSH Alias In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 How To Create SSH Alias In Linux.md (98%) diff --git a/translated/tech/20190505 How To Create SSH Alias In Linux.md b/published/20190505 How To Create SSH Alias In Linux.md similarity index 98% rename from translated/tech/20190505 How To Create SSH Alias In Linux.md rename to published/20190505 How To Create SSH Alias In Linux.md index 35bd112d5d..2438fb745a 100644 --- a/translated/tech/20190505 How To Create SSH Alias In Linux.md +++ b/published/20190505 How To Create SSH Alias In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10851-1.html) [#]: subject: (How To Create SSH Alias In Linux) [#]: via: (https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From dca8607d9bddaded6916181a545cc756b802eaf3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 00:30:25 +0800 Subject: [PATCH 0431/1154] PRF:20190419 Getting started with social media sentiment analysis in Python.md @MjSeven --- ...cial media sentiment analysis in Python.md | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md b/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md index 77e0ab54b4..033f630c0a 100644 --- a/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md +++ b/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with social media sentiment analysis in Python) @@ -9,8 +9,10 @@ 使用 Python 进行社交媒体情感分析入门 ====== -学习自然语言处理的基础知识并探索两个有用的 Python 包。 -![Raspberry Pi and Python][1] + +> 学习自然语言处理的基础知识并探索两个有用的 Python 包。 + +![](https://img.linux.net.cn/data/attachment/album/201905/14/002943t6udxhhcq1zoxu15.jpg) 自然语言处理(NLP)是机器学习的一种,它解决了口语或书面语言和计算机辅助分析这些语言之间的相关性。日常生活中我们经历了无数的 NLP 创新,从写作帮助和建议到实时语音翻译,还有口译。 @@ -20,25 +22,25 @@ ### 自然语言和文本数据 -合理的起点是从定义开始:“什么是自然语言?”它是我们人类相互交流的方式,沟通的主要方式是口语和文字。我们可以更进一步,只关注文本交流。毕竟,生活在 Siri, Alexa 等无处不在的时代,我们知道语音是一组与文本无关的计算。 +合理的起点是从定义开始:“什么是自然语言?”它是我们人类相互交流的方式,沟通的主要方式是口语和文字。我们可以更进一步,只关注文本交流。毕竟,生活在 Siri、Alexa 等无处不在的时代,我们知道语音是一组与文本无关的计算。 ### 数据前景和挑战 -我们只考虑使用文本数据,我们可以对语言和文本做什么呢?首先是语言,特别是英语,除了规则还有很多例外,含义的多样性和语境差异,这些都可能使人类口译员感到困惑,更不用说计算机翻译了。在小学,我们学习文章和标点符号,通过讲母语,我们获得了寻找直觉上表示唯一意义的词的能力。比如,出现诸如 "a"、"the" 和 "or" 之类的文章,它们在 NLP 中被称为 _停用词_,因为传统上 NLP 算法是在一个序列中找到这些词时意味着搜索停止。 +我们只考虑使用文本数据,我们可以对语言和文本做什么呢?首先是语言,特别是英语,除了规则还有很多例外,含义的多样性和语境差异,这些都可能使人类口译员感到困惑,更不用说计算机翻译了。在小学,我们学习文章和标点符号,通过讲母语,我们获得了寻找直觉上表示唯一意义的词的能力。比如,出现诸如 “a”、“the” 和 “or” 之类的文章,它们在 NLP 中被称为*停止词*,因为传统上 NLP 算法是在一个序列中找到这些词时意味着搜索停止。 -由于我们的目标是自动将文本分类为情感类,因此我们需要一种以计算方式处理文本数据的方法。因此,我们必须考虑如何向机器表示文本数据。众所周知,利用和解释语言的规则很复杂,输入文本的大小和结构可能会有很大差异。我们需要将文本数据转换为数字数据,这是机器和数学的首选方式。这种转变属于 _特征提取_ 的范畴。 +由于我们的目标是自动将文本分类为情感类,因此我们需要一种以计算方式处理文本数据的方法。因此,我们必须考虑如何向机器表示文本数据。众所周知,利用和解释语言的规则很复杂,输入文本的大小和结构可能会有很大差异。我们需要将文本数据转换为数字数据,这是机器和数学的首选方式。这种转变属于*特征提取*的范畴。 -在提取输入文本数据的数字表示形式后,一个改进可能是:给定一个文本输入体,为上面列出的文章确定一组向量统计数据,并根据这些数据对文档进行分类。例如,过多的副词可能会使撰稿人感到愤怒,或者过度使用停用词可能有助于识别带有内容填充的学期论文。诚然,这可能与我们情感分析的目标没有太大关系。 +在提取输入文本数据的数字表示形式后,一个改进可能是:给定一个文本输入体,为上面列出的文章确定一组向量统计数据,并根据这些数据对文档进行分类。例如,过多的副词可能会使撰稿人感到愤怒,或者过度使用停止词可能有助于识别带有内容填充的学期论文。诚然,这可能与我们情感分析的目标没有太大关系。 ### 词袋 -当你评估一个文本陈述是积极还是消极的时候,你使用哪些上下文来评估它的极性?(例如,文本中是否具有积极的、消极的或中性的情感)一种方式是隐含形容词:被称为 "disgusting" 的东西被认为是消极的,但如果同样的东西被称为 "beautiful",你会认为它是积极的。从定义上讲,俗语给人一种熟悉感,通常是积极的,而脏话可能是敌意的表现。文本数据也可以包括表情符号,它带有固定的情感。 +当你评估一个文本陈述是积极还是消极的时候,你使用哪些上下文来评估它的极性?(例如,文本中是否具有积极的、消极的或中性的情感)一种方式是隐含形容词:被称为 “disgusting”(恶心) 的东西被认为是消极的,但如果同样的东西被称为 “beautiful”(漂亮),你会认为它是积极的。从定义上讲,俗语给人一种熟悉感,通常是积极的,而脏话可能是敌意的表现。文本数据也可以包括表情符号,它带有固定的情感。 -理解单个单词的极性影响为文本的[_词袋_][3](BoW) 模型提供了基础。它考虑一组单词或词汇表,并提取关于这些单词在输入文本中是否存在的度量。词汇表是通过考虑极性已知的文本形成的,称为 _标记的训练数据_。从这组标记数据中提取特征,然后分析特征之间的关系,并将标签与数据关联起来。 +理解单个单词的极性影响为文本的[词袋][3]bag-of-words(BoW)模型提供了基础。它分析一组单词或词汇表,并提取关于这些单词在输入文本中是否存在的度量。词汇表是通过处理已知极性的文本形成称为*标记的训练数据*。从这组标记数据中提取特征,然后分析特征之间的关系,并将标记与数据关联起来。 -“词袋”这个名称说明了它的用途:即不考虑空间位置或上下文的的单个词。词汇表通常是由训练集中出现的所有单词构建的,在训练结束后被删除。如果在训练之前没有清理停用词,那么停用词会因为其高频率和低语境而被移除。很少使用的单词也可以删除,因为一般情况下它们提供了缺失的信息。 +“词袋”这个名称说明了它的用途:即不考虑空间位置或上下文的的单个词。词汇表通常是由训练集中出现的所有单词构建的,训练后往往会被修剪。如果在训练之前没有清理停止词,那么停止词会因为其高频率和低语境而被移除。很少使用的单词也可以删除,因为缺乏为一般输入实例提供的信息。 -但是,重要的是要注意,你可以(并且应该)进一步考虑单词在单独的训练数据实例中使用之外的外观,称为[_词频_][4] (TF)。你还应该考虑输入数据的所有实例中的单词计数,通常,所有文档中的单词频率显著,这被称为[_逆文本频率指数_][5](IDF)。这些指标一定会在本主题的其他文章和软件包中提及,因此了解它们会有所帮助。 +但是,重要的是要注意,你可以(并且应该)进一步考虑单词在单个训练数据实例之外的情形,这称为[词频][4]term frequency(TF)。你还应该考虑输入数据在所有训练实例中的单词计数,通常,出现在所有文档中的低频词更重要,这被称为[逆文本频率指数][5]inverse document frequency(IDF)。这些指标一定会在本主题系列的其他文章和软件包中提及,因此了解它们会有所帮助。 词袋在许多文档分类应用程序中很有用。然而,在情感分析中,当缺乏情境意识的问题被利用时,事情就可以解决。考虑以下句子: @@ -46,32 +48,31 @@ * 我讨厌下雨天,好事是今天是晴天。 * 这不是生死攸关的问题。 +这些短语的情感对于人类口译员来说是有难度的,而且通过严格关注单个词汇的实例,对于机器翻译来说也是困难的。 -这些短语的情感对于人类口译员来说是有难度的,而且由于严格关注单个词汇的实例,对于机器翻译来说也是困难的。 - -在 NLP 中也可以考虑称为 _n-grams_ 的单词分组。一个二元组考虑两个相邻单词组成的组而不是(或除了)单个词袋。这应该可以缓解诸如上述“不喜欢”之类的情况,但由于缺乏语境意思,它仍然是个问题。此外,在上面的第二句中,下半句的情感语境可以被理解为否定前半部分。因此,这种方法中也会丢失上下文线索的空间局部性。从实用角度来看,使问题复杂化的是从给定输入文本中提取的特征的稀疏性。对于一个完整的大型词汇表,每个单词都有一个计数,可以将其视为一个整数向量。大多数文档的向量中都有大量的零计数,这给操作增加了不必要的空间和时间复杂度。虽然已经提出了许多用于降低这种复杂性的简便方法,但它仍然是一个问题。 +在 NLP 中也可以使用称为 “n-grams” 的单词分组。一个二元组考虑两个相邻单词组成的组而不是(或除了)单个词袋。这应该可以缓解诸如上述“不喜欢”之类的情况,但由于缺乏语境意思,它仍然是个问题。此外,在上面的第二句中,下半句的情感语境可以被理解为否定前半部分。因此,这种方法中也会丢失上下文线索的空间局部性。从实用角度来看,使问题复杂化的是从给定输入文本中提取的特征的稀疏性。对于一个完整的大型词汇表,每个单词都有一个计数,可以将其视为一个整数向量。大多数文档的向量中都有大量的零计数向量,这给操作增加了不必要的空间和时间复杂度。虽然已经提出了许多用于降低这种复杂性的简便方法,但它仍然是一个问题。 ### 词嵌入 -词嵌入是一种分布式表示,它允许具有相似含义的单词具有相似的表示。这是基于使用实值向量来与它们周围相关联。重点在于使用单词的方式,而不仅仅是它们的存在。此外,词嵌入的一个巨大语用优势是它们对密集向量的关注。通过摆脱具有相应数量的零值向量元素的单词计数模型,词嵌入在时间和存储方面提供了一个更有效的计算范例。 +词嵌入Word embedding是一种分布式表示,它允许具有相似含义的单词具有相似的表示。这是基于使用实值向量来与它们周围相关联。重点在于使用单词的方式,而不仅仅是它们的存在与否。此外,词嵌入的一个巨大实用优势是它们关注于密集向量。通过摆脱具有相应数量的零值向量元素的单词计数模型,词嵌入在时间和存储方面提供了一个更有效的计算范例。 以下是两个优秀的词嵌入方法。 #### Word2vec -第一个是 [Word2vec][6],它是由 Google 开发的。随着你对 NLP 和情绪分析研究的深入,你可能会看到这种嵌入方法。它要么使用一个 _连续的词袋_(CBOW),要么使用一个 _连续的 skip-gram_ 模型。在 CBOW 中,一个单词的上下文是在训练中根据围绕它的单词来学习的。连续的 skip-gram 学习倾向于围绕给定的单词学习单词。虽然这可能超出了你需要解决的问题,但是如果你曾经面对必须生成自己的词嵌入情况,那么 Word2vec 的作者提倡使用 CBOW 方法来提高速度并评估频繁的单词,而 skip-gram 方法更适合嵌入稀有单词更重要的嵌入。 +第一个是 [Word2vec][6],它是由 Google 开发的。随着你对 NLP 和情绪分析研究的深入,你可能会看到这种嵌入方法。它要么使用一个连续的词袋continuous bag of words(CBOW),要么使用一个连续 skip-gram 模型。在 CBOW 中,一个单词的上下文是在训练中根据围绕它的单词来学习的。连续 skip-gram 学习倾向于围绕给定的单词学习单词。虽然这可能超出了你需要解决的问题,但是如果你曾经面对必须生成自己的词嵌入情况,那么 Word2vec 的作者就提倡使用 CBOW 方法来提高速度并评估频繁的单词,而 skip-gram 方法更适合嵌入稀有单词更重要的嵌入。 #### GloVe -第二个是 [ _Global Vectors for Word Representation_][7(GloVe),它是斯坦福大学开发的。它是 Word2vec 方法的扩展,它试图将通过经典的全局文本统计特征提取获得的信息与 Word2vec 确定的本地上下文信息相结合。实际上,在一些应用程序中,GloVe 性能优于 Word2vec,而在另一些应用程序中则不如 Word2vec。最终,用于词嵌入的目标数据集将决定哪种方法最优。因此,最好了解它们的存在性和高级机制,因为你很可能会遇到它们。 +第二个是[用于词表示的全局向量][7]Global Vectors for Word Representation(GloVe),它是斯坦福大学开发的。它是 Word2vec 方法的扩展,试图通过将经典的全局文本统计特征提取获得的信息与 Word2vec 确定的本地上下文信息相结合。实际上,在一些应用程序中,GloVe 性能优于 Word2vec,而在另一些应用程序中则不如 Word2vec。最终,用于词嵌入的目标数据集将决定哪种方法最优。因此,最好了解它们的存在性和高级机制,因为你很可能会遇到它们。 #### 创建和使用词嵌入 -最后,知道如何获得词嵌入是有用的。在第 2 部分中,你将看到我们通过利用社区中其他人的实质性工作,可以说我们是站在了巨人的肩膀上。这是获取词嵌入的一种方法:即使用现有的经过训练和验证的模型。实际上,有无数的模型适用于英语和其他语言,一定会有一种模型可以满足你的应用程序,让你开箱即用! +最后,知道如何获得词嵌入是有用的。在第 2 部分中,你将看到我们通过利用社区中其他人的实质性工作,站到了巨人的肩膀上。这是获取词嵌入的一种方法:即使用现有的经过训练和验证的模型。实际上,有无数的模型适用于英语和其他语言,一定会有一种模型可以满足你的应用程序,让你开箱即用! -如果没有的话,就开发工作而言,另一个极端是培训你自己的独立模型,而不考虑你的应用程序。实质上,你将获得大量标记的训练数据,并可能使用上述方法之一来训练模型。即使这样,你仍然只是在获取对输入文本数据的理解。然后,你需要为你应用程序开发一个特定的模型(例如,分析软件版本控制消息中的情感价值),这反过来又需要自己的时间和精力。 +如果没有的话,就开发工作而言,另一个极端是培训你自己的独立模型,而不考虑你的应用程序。实质上,你将获得大量标记的训练数据,并可能使用上述方法之一来训练模型。即使这样,你仍然只是在理解你输入文本数据。然后,你需要为你应用程序开发一个特定的模型(例如,分析软件版本控制消息中的情感价值),这反过来又需要自己的时间和精力。 -你还可以为你的应用程序数据训练一个词嵌入,虽然这可以减少时间和精力,但这个词嵌入将是特定于应用程序的,这将会降低它的可重用性。 +你还可以对针对你的应用程序的数据训练一个词嵌入,虽然这可以减少时间和精力,但这个词嵌入将是特定于应用程序的,这将会降低它的可重用性。 ### 可用的工具选项 @@ -83,9 +84,9 @@ #### vaderSentiment -[vaderSentiment][10] 包提供了积极、消极和中性情绪的衡量标准。正如 [original paper][11] 的标题(“VADER:一个基于规则的社交媒体文本情感分析模型”)所示,这些模型是专门为社交媒体文本数据开发和调整的。VADER 接受了一组完整的人类标记数据的训练,包括常见的表情符号、UTF-8 编码的表情符号以及口语术语和缩写(例如 meh、lol、sux)。 +[vaderSentiment][10] 包提供了积极、消极和中性情绪的衡量标准。正如 [原论文][11] 的标题(《VADER:一个基于规则的社交媒体文本情感分析模型》)所示,这些模型是专门为社交媒体文本数据开发和调整的。VADER 接受了一组完整的人类标记过的数据的训练,包括常见的表情符号、UTF-8 编码的表情符号以及口语术语和缩写(例如 meh、lol、sux)。 -对于给定的输入文本数据,vaderSentiment 返回一个极性分数百分比的三元组。它还提供了一个单个的评分标准,称为 _vaderSentiment 复合指标_。这是一个在 **[-1, 1]** 范围内的实值,其中对于分值大于 **0.05** 的情绪被认为是积极的,对于分值小于 **-0.05** 的被认为是消极的,否则为中性。 +对于给定的输入文本数据,vaderSentiment 返回一个极性分数百分比的三元组。它还提供了一个单个的评分标准,称为 *vaderSentiment 复合指标*。这是一个在 `[-1, 1]` 范围内的实值,其中对于分值大于 `0.05` 的情绪被认为是积极的,对于分值小于 `-0.05` 的被认为是消极的,否则为中性。 在[第 2 部分][2]中,你将学习如何使用这些工具为你的设计添加情感分析功能。 @@ -93,10 +94,10 @@ via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python -作者:[Michael McCune ][a] +作者:[Michael McCune][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5b1ea40740217666f7e42c5144587d922f05c5ba Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 00:31:05 +0800 Subject: [PATCH 0432/1154] PUB:20190419 Getting started with social media sentiment analysis in Python.md @MjSeven https://linux.cn/article-10852-1.html --- ... started with social media sentiment analysis in Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190419 Getting started with social media sentiment analysis in Python.md (99%) diff --git a/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md b/published/20190419 Getting started with social media sentiment analysis in Python.md similarity index 99% rename from translated/tech/20190419 Getting started with social media sentiment analysis in Python.md rename to published/20190419 Getting started with social media sentiment analysis in Python.md index 033f630c0a..b9abec9325 100644 --- a/translated/tech/20190419 Getting started with social media sentiment analysis in Python.md +++ b/published/20190419 Getting started with social media sentiment analysis in Python.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10852-1.html) [#]: subject: (Getting started with social media sentiment analysis in Python) [#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python) [#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) From 969175808dacd7a20424f4bbf746007d618da1fa Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Mon, 13 May 2019 17:00:30 +0000 Subject: [PATCH 0433/1154] =?UTF-8?q?Revert=20"=E7=94=B3=E8=AF=B7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 73f67ae72b72dee3bb1c13ab49ac9931ab56e9e8. --- ...181031 Working with data streams on the Linux command line.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20181031 Working with data streams on the Linux command line.md b/sources/tech/20181031 Working with data streams on the Linux command line.md index b391b2af0b..87403558d7 100644 --- a/sources/tech/20181031 Working with data streams on the Linux command line.md +++ b/sources/tech/20181031 Working with data streams on the Linux command line.md @@ -1,4 +1,3 @@ -liujing97 is translating Working with data streams on the Linux command line ====== Learn to connect data streams from one utility to another using STDIO. From 42fc313ac152fcb70f67c2f934142bac6951b3f3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 08:56:09 +0800 Subject: [PATCH 0434/1154] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lujun9972 这里两篇 IPC 的代码出现错误,是因为原文代码里面有链接解析错误导致。 @FSSlc 请注意你正在翻译的第三篇可能也有此情形。 --- ...at Improve Battery Life On Linux Laptop.md | 4 +- ... communication in Linux- Shared storage.md | 95 +++++++++---------- ...n Linux- Using pipes and message queues.md | 81 ++++++++-------- 3 files changed, 88 insertions(+), 92 deletions(-) diff --git a/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md index d21a4f2a44..2b38da68d0 100644 --- a/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ b/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -108,7 +108,9 @@ $ sudo apt-get install smartmontools 当基于 Ubuntu 的系统的官方软件包过时时,请使用以下 PPA 存储库,该存储库提供最新版本。运行以下命令以使用 PPA 安装 TLP。 ``` -$ sudo apt-get install tlp tlp-rdw +$ sudo add-apt-repository ppa:linrunner/tlp +$ sudo apt-get update +$ sudo apt-get install tlp ``` 对于基于 Arch Linux 的系统,使用 [Pacman 命令][9] 安装 TLP。 diff --git a/published/20190415 Inter-process communication in Linux- Shared storage.md b/published/20190415 Inter-process communication in Linux- Shared storage.md index dba63f8782..de56a36982 100644 --- a/published/20190415 Inter-process communication in Linux- Shared storage.md +++ b/published/20190415 Inter-process communication in Linux- Shared storage.md @@ -62,47 +62,42 @@ producer-------->| disk file |<-------consumer #include #include #include +#include #define FileName "data.dat" +#define DataString "Now is the winter of our discontent\nMade glorious summer by this sun of York\n" void report_and_exit(const char* msg) { - [perror][4](msg); - [exit][5](-1); /* EXIT_FAILURE */ + perror(msg); + exit(-1); /* EXIT_FAILURE */ } int main() { struct flock lock; - lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ + lock.l_type = F_WRLCK; /* read/write (exclusive versus shared) lock */ lock.l_whence = SEEK_SET; /* base for seek offsets */ lock.l_start = 0; /* 1st byte in file */ lock.l_len = 0; /* 0 here means 'until EOF' */ lock.l_pid = getpid(); /* process id */ int fd; /* file descriptor to identify a file within a process */ - if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ - report_and_exit("open to read failed..."); + if ((fd = open(FileName, O_RDWR | O_CREAT, 0666)) < 0) /* -1 signals an error */ + report_and_exit("open failed..."); - /* If the file is write-locked, we can't continue. */ - fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ - if (lock.l_type != F_UNLCK) - report_and_exit("file is still write locked..."); + if (fcntl(fd, F_SETLK, &lock) < 0) /** F_SETLK doesn't block, F_SETLKW does **/ + report_and_exit("fcntl failed to get lock..."); + else { + write(fd, DataString, strlen(DataString)); /* populate data file */ + fprintf(stderr, "Process %d has written to data file...\n", lock.l_pid); + } - lock.l_type = F_RDLCK; /* prevents any writing during the reading */ - if (fcntl(fd, F_SETLK, &lock) < 0) - report_and_exit("can't get a read-only lock..."); - - /* Read the bytes (they happen to be ASCII codes) one at a time. */ - int c; /* buffer for read bytes */ - while (read(fd, &c, 1) > 0) /* 0 signals EOF */ - write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ - - /* Release the lock explicitly. */ + /* Now release the lock explicitly. */ lock.l_type = F_UNLCK; if (fcntl(fd, F_SETLK, &lock) < 0) report_and_exit("explicit unlocking failed..."); - close(fd); - return 0; + close(fd); /* close the file: would unlock if needed */ + return 0; /* terminating the process would unlock as well */ } ``` @@ -140,8 +135,8 @@ lock.l_type = F_UNLCK; #define FileName "data.dat" void report_and_exit(const char* msg) { - [perror][4](msg); - [exit][5](-1); /* EXIT_FAILURE */ + perror(msg); + exit(-1); /* EXIT_FAILURE */ } int main() { @@ -240,37 +235,37 @@ This is the way the world ends... #include "shmem.h" void report_and_exit(const char* msg) { - [perror][4](msg); - [exit][5](-1); + perror(msg); + exit(-1); } int main() { int fd = shm_open(BackingFile, /* name from smem.h */ - O_RDWR | O_CREAT, /* read/write, create if needed */ - AccessPerms); /* access permissions (0644) */ + O_RDWR | O_CREAT, /* read/write, create if needed */ + AccessPerms); /* access permissions (0644) */ if (fd < 0) report_and_exit("Can't open shared mem segment..."); ftruncate(fd, ByteSize); /* get the bytes */ caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ - ByteSize, /* how many bytes */ - PROT_READ | PROT_WRITE, /* access protections */ - MAP_SHARED, /* mapping visible to other processes */ - fd, /* file descriptor */ - 0); /* offset: start at 1st byte */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ if ((caddr_t) -1 == memptr) report_and_exit("Can't get segment..."); - [fprintf][7](stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); - [fprintf][7](stderr, "backing file: /dev/shm%s\n", BackingFile ); + fprintf(stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); + fprintf(stderr, "backing file: /dev/shm%s\n", BackingFile ); - /* semahore code to lock the shared mem */ + /* semaphore code to lock the shared mem */ sem_t* semptr = sem_open(SemaphoreName, /* name */ - O_CREAT, /* create the semaphore */ - AccessPerms, /* protection perms */ - 0); /* initial value */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ if (semptr == (void*) -1) report_and_exit("sem_open"); - [strcpy][8](memptr, MemContents); /* copy some ASCII bytes to the segment */ + strcpy(memptr, MemContents); /* copy some ASCII bytes to the segment */ /* increment the semaphore so that memreader can read */ if (sem_post(semptr) < 0) report_and_exit("sem_post"); @@ -341,8 +336,8 @@ munmap(memptr, ByteSize); /* unmap the storage * #include "shmem.h" void report_and_exit(const char* msg) { - [perror][4](msg); - [exit][5](-1); + perror(msg); + exit(-1); } int main() { @@ -351,24 +346,24 @@ int main() { /* get a pointer to memory */ caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ - ByteSize, /* how many bytes */ - PROT_READ | PROT_WRITE, /* access protections */ - MAP_SHARED, /* mapping visible to other processes */ - fd, /* file descriptor */ - 0); /* offset: start at 1st byte */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ if ((caddr_t) -1 == memptr) report_and_exit("Can't access segment..."); /* create a semaphore for mutual exclusion */ sem_t* semptr = sem_open(SemaphoreName, /* name */ - O_CREAT, /* create the semaphore */ - AccessPerms, /* protection perms */ - 0); /* initial value */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ if (semptr == (void*) -1) report_and_exit("sem_open"); /* use semaphore as a mutex (lock) by waiting for writer to increment it */ if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ int i; - for (i = 0; i < [strlen][6](MemContents); i++) + for (i = 0; i < strlen(MemContents); i++) write(STDOUT_FILENO, memptr + i, 1); /* one byte at a time */ sem_post(semptr); } diff --git a/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md index f0393a1ba6..714f451e2e 100644 --- a/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md +++ b/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -87,8 +87,8 @@ world #define WriteEnd 1 void report_and_exit(const char* msg) { - [perror][6](msg); - [exit][7](-1); /** failure **/ + perror(msg); + exit(-1); /** failure **/ } int main() { @@ -112,11 +112,11 @@ int main() { else { /*** parent ***/ close(pipeFDs[ReadEnd]); /* parent writes, doesn't read */ - write(pipeFDs[WriteEnd], msg, [strlen][8](msg)); /* write the bytes to the pipe */ + write(pipeFDs[WriteEnd], msg, strlen(msg)); /* write the bytes to the pipe */ close(pipeFDs[WriteEnd]); /* done writing: generate eof */ wait(NULL); /* wait for child to exit */ - [exit][7](0); /* exit normally */ + exit(0); /* exit normally */ } return 0; } @@ -249,7 +249,7 @@ bye, bye ## ditto ```c #include #include -#include +#include #include #include #include @@ -264,24 +264,24 @@ int main() { const char* pipeName = "./fifoChannel"; mkfifo(pipeName, 0666); /* read/write for user/group/others */ int fd = open(pipeName, O_CREAT | O_WRONLY); /* open as write-only */ - if (fd < 0) return -1; /** error **/ - + if (fd < 0) return -1; /* can't go on */ + int i; for (i = 0; i < MaxLoops; i++) { /* write MaxWrites times */ int j; for (j = 0; j < ChunkSize; j++) { /* each time, write ChunkSize bytes */ int k; int chunk[IntsPerChunk]; - for (k = 0; k < IntsPerChunk; k++) - chunk[k] = [rand][9](); - write(fd, chunk, sizeof(chunk)); + for (k = 0; k < IntsPerChunk; k++) + chunk[k] = rand(); + write(fd, chunk, sizeof(chunk)); } - usleep(([rand][9]() % MaxZs) + 1); /* pause a bit for realism */ + usleep((rand() % MaxZs) + 1); /* pause a bit for realism */ } - close(fd); /* close pipe: generates an end-of-file */ - unlink(pipeName); /* unlink from the implementing file */ - [printf][10]("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); + close(fd); /* close pipe: generates an end-of-stream marker */ + unlink(pipeName); /* unlink from the implementing file */ + printf("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); return 0; } @@ -318,13 +318,12 @@ unlink(pipeName); /* unlink from the implementing file */ #include #include - -unsigned is_prime(unsigned n) { /* not pretty, but gets the job done efficiently */ +unsigned is_prime(unsigned n) { /* not pretty, but efficient */ if (n <= 3) return n > 1; if (0 == (n % 2) || 0 == (n % 3)) return 0; unsigned i; - for (i = 5; (i * i) <= n; i += 6) + for (i = 5; (i * i) <= n; i += 6) if (0 == (n % i) || 0 == (n % (i + 2))) return 0; return 1; /* found a prime! */ @@ -332,25 +331,25 @@ unsigned is_prime(unsigned n) { /* not pretty, but gets the job done efficiently int main() { const char* file = "./fifoChannel"; - int fd = open(file, O_RDONLY); + int fd = open(file, O_RDONLY); if (fd < 0) return -1; /* no point in continuing */ unsigned count = 0, total = 0, primes_count = 0; while (1) { int next; int i; - ssize_t count = read(fd, &next, sizeof(int)); + ssize_t count = read(fd, &next, sizeof(int)); if (0 == count) break; /* end of stream */ else if (count == sizeof(int)) { /* read a 4-byte int value */ total++; if (is_prime(next)) primes_count++; - } + } } close(fd); /* close pipe from read end */ unlink(file); /* unlink from the underlying file */ - [printf][10]("Received ints: %u, primes: %u\n", total, primes_count); + printf("Received ints: %u, primes: %u\n", total, primes_count); return 0; } @@ -434,23 +433,23 @@ ID `qid` 在效果上是消息队列文件描述符的对应物。 #### 示例 5. sender 程序 ```c -#include -#include +#include +#include #include #include #include #include "queue.h" void report_and_exit(const char* msg) { - [perror][6](msg); - [exit][7](-1); /* EXIT_FAILURE */ + perror(msg); + exit(-1); /* EXIT_FAILURE */ } int main() { - key_t key = ftok(PathName, ProjectId); + key_t key = ftok(PathName, ProjectId); if (key < 0) report_and_exit("couldn't get key..."); - - int qid = msgget(key, 0666 | IPC_CREAT); + + int qid = msgget(key, 0666 | IPC_CREAT); if (qid < 0) report_and_exit("couldn't get queue id..."); char* payloads[] = {"msg1", "msg2", "msg3", "msg4", "msg5", "msg6"}; @@ -460,11 +459,11 @@ int main() { /* build the message */ queuedMessage msg; msg.type = types[i]; - [strcpy][11](msg.payload, payloads[i]); + strcpy(msg.payload, payloads[i]); /* send the message */ msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); /* don't block */ - [printf][10]("%s sent as type %i\n", msg.payload, (int) msg.type); + printf("%s sent as type %i\n", msg.payload, (int) msg.type); } return 0; } @@ -481,21 +480,21 @@ msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); #### 示例 6. receiver 程序 ```c -#include -#include +#include +#include #include #include #include "queue.h" void report_and_exit(const char* msg) { - [perror][6](msg); - [exit][7](-1); /* EXIT_FAILURE */ + perror(msg); + exit(-1); /* EXIT_FAILURE */ } - -int main() { + +int main() { key_t key= ftok(PathName, ProjectId); /* key to identify the queue */ if (key < 0) report_and_exit("key not gotten..."); - + int qid = msgget(key, 0666 | IPC_CREAT); /* access if created already */ if (qid < 0) report_and_exit("no access to queue..."); @@ -504,15 +503,15 @@ int main() { for (i = 0; i < MsgCount; i++) { queuedMessage msg; /* defined in queue.h */ if (msgrcv(qid, &msg, sizeof(msg), types[i], MSG_NOERROR | IPC_NOWAIT) < 0) - [puts][12]("msgrcv trouble..."); - [printf][10]("%s received as type %i\n", msg.payload, (int) msg.type); + puts("msgrcv trouble..."); + printf("%s received as type %i\n", msg.payload, (int) msg.type); } /** remove the queue **/ if (msgctl(qid, IPC_RMID, NULL) < 0) /* NULL = 'no flags' */ report_and_exit("trouble removing queue..."); - - return 0; + + return 0; } ``` From 47019184f9bf805ead982950a4bb4800fb99a4b1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 14 May 2019 08:56:17 +0800 Subject: [PATCH 0435/1154] translated --- ...190430 Upgrading Fedora 29 to Fedora 30.md | 96 ------------------- ...190430 Upgrading Fedora 29 to Fedora 30.md | 96 +++++++++++++++++++ 2 files changed, 96 insertions(+), 96 deletions(-) delete mode 100644 sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md create mode 100644 translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md diff --git a/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md deleted file mode 100644 index 7db3cce1f6..0000000000 --- a/sources/tech/20190430 Upgrading Fedora 29 to Fedora 30.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Upgrading Fedora 29 to Fedora 30) -[#]: via: (https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/) -[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) - -Upgrading Fedora 29 to Fedora 30 -====== - -![][1] - -Fedora 30 i[s available now][2]. You’ll likely want to upgrade your system to the latest version of Fedora. Fedora Workstation has a graphical upgrade method. Alternatively, Fedora offers a command-line method for upgrading Fedora 29 to Fedora 30. - -### Upgrading Fedora 29 Workstation to Fedora 30 - -Soon after release time, a notification appears to tell you an upgrade is available. You can click the notification to launch the **GNOME Software** app. Or you can choose Software from GNOME Shell. - -Choose the _Updates_ tab in GNOME Software and you should see a screen informing you that Fedora 30 is Now Available. - -If you don’t see anything on this screen, try using the reload button at the top left. It may take some time after release for all systems to be able to see an upgrade available. - -Choose _Download_ to fetch the upgrade packages. You can continue working until you reach a stopping point, and the download is complete. Then use GNOME Software to restart your system and apply the upgrade. Upgrading takes time, so you may want to grab a coffee and come back to the system later. - -### Using the command line - -If you’ve upgraded from past Fedora releases, you are likely familiar with the _dnf upgrade_ plugin. This method is the recommended and supported way to upgrade from Fedora 29 to Fedora 30. Using this plugin will make your upgrade to Fedora 30 simple and easy. - -##### 1\. Update software and back up your system - -Before you do anything, you will want to make sure you have the latest software for Fedora 29 before beginning the upgrade process. To update your software, use _GNOME Software_ or enter the following command in a terminal. - -``` -sudo dnf upgrade --refresh -``` - -Additionally, make sure you back up your system before proceeding. For help with taking a backup, see [the backup series][3] on the Fedora Magazine. - -##### 2\. Install the DNF plugin - -Next, open a terminal and type the following command to install the plugin: - -``` -sudo dnf install dnf-plugin-system-upgrade -``` - -##### 3\. Start the update with DNF - -Now that your system is up-to-date, backed up, and you have the DNF plugin installed, you can begin the upgrade by using the following command in a terminal: - -``` -sudo dnf system-upgrade download --releasever=30 -``` - -This command will begin downloading all of the upgrades for your machine locally to prepare for the upgrade. If you have issues when upgrading because of packages without updates, broken dependencies, or retired packages, add the _‐‐allowerasing_ flag when typing the above command. This will allow DNF to remove packages that may be blocking your system upgrade. - -##### 4\. Reboot and upgrade - -Once the previous command finishes downloading all of the upgrades, your system will be ready for rebooting. To boot your system into the upgrade process, type the following command in a terminal: - -``` -sudo dnf system-upgrade reboot -``` - -Your system will restart after this. Many releases ago, the _fedup_ tool would create a new option on the kernel selection / boot screen. With the _dnf-plugin-system-upgrade_ package, your system reboots into the current kernel installed for Fedora 29; this is normal. Shortly after the kernel selection screen, your system begins the upgrade process. - -Now might be a good time for a coffee break! Once it finishes, your system will restart and you’ll be able to log in to your newly upgraded Fedora 30 system. - -![][4] - -### Resolving upgrade problems - -On occasion, there may be unexpected issues when you upgrade your system. If you experience any issues, please visit the [DNF system upgrade wiki page][5] for more information on troubleshooting in the event of a problem. - -If you are having issues upgrading and have third-party repositories installed on your system, you may need to disable these repositories while you are upgrading. For support with repositories not provided by Fedora, please contact the providers of the repositories. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/ - -作者:[Ryan Lerch][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/ryanlerch/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/29-30-816x345.jpg -[2]: https://fedoramagazine.org/announcing-fedora-30/ -[3]: https://fedoramagazine.org/taking-smart-backups-duplicity/ -[4]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png -[5]: https://fedoraproject.org/wiki/DNF_system_upgrade#Resolving_post-upgrade_issues diff --git a/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md new file mode 100644 index 0000000000..0ac36450d6 --- /dev/null +++ b/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Upgrading Fedora 29 to Fedora 30) +[#]: via: (https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +将 Fedora 29 升级到 Fedora 30 +====== + +![][1] + +Fedora 30 [现在发布了][2]。你可能希望将系统升级到最新版本的 Fedora。Fedora Workstation 有图形化升级的方法。另外,Fedora 也提供了一个命令行方法,用于将 Fedora 29 升级到 Fedora 30。 + +### 将 Fedora 29 Workstation 升级到 Fedora 30 + +在发布不久后,桌面会显示一条通知告诉你可以升级。你可以单击通知启动 **GNOME Software** 应用。或者你可以从 GNOME Shell 中选择 Software。 + +在 GNOME Software 中选择_更新_选项卡,你会看到一个页面通知你可以更新 Fedora 30。 + +如果你在屏幕上看不到任何内容,请尝试点击左上角的重新加载按钮。发布后,所有系统都可能需要一段时间才能看到可用的升级。 + +选择_下载_获取升级包。你可以继续做其他的事直到下载完成。然后使用 GNOME Software 重启系统并应用升级。升级需要时间,因此你可以喝杯咖啡,稍后再回来。 + +### 使用命令行 + +如果你过去升级过 Fedora 版本,你可能熟悉 _dnf upgrade_ 插件。这是从 Fedora 29 升级到 Fedora 30 的推荐和支持的方式。使用这个插件将使你的 Fedora 30 升级简单易行。 + +##### 1\. 更新软件并备份系统 + +在你执行任何操作之前,你需要确保在开始升级之前拥有 Fedora 29 的最新软件。要更新软件,请使用 _GNOME Software_ 或在终端中输入以下命令。 + +``` +sudo dnf upgrade --refresh +``` + +此外,请确保在继续之前备份系统。关于备份的帮助,请参阅 Fedora Magazine 上的[备份系列][3]。 + +##### 2\. 安装 DNF 插件 + +接下来,打开终端并输入以下命令来安装插件: + +``` +sudo dnf install dnf-plugin-system-upgrade +``` + +##### 3\. 使用 DNF 开始更新 + +现在你的系统是最新的,完成了备份,并且已安装 DNF 插件,你可以在终端中使用以下命令开始升级: + +``` +sudo dnf system-upgrade download --releasever=30 +``` + +此命令将开始在本地下载所有升级文件以准备升级。如果你因没有更新包、错误的依赖,或过时的包在升级时遇到问题,请在输入上面的命令时添加 _-- allowerasing_ 标志。这将允许 DNF 删除可能阻止系统升级的软件包。 + +##### 4\. 重启并升级 + +当前面的命令完成下载所有升级文件后,你的系统就可以重启了。要将系统引导至升级过程,请在终端中输入以下命令: + +``` +sudo dnf system-upgrade reboot +``` + +此后你的系统将重启。在许多版本之前,_fedup_ 工具将在内核选择/引导页面上创建一个新选项。使用 _dnf-plugin-system-upgrade_ 包,你的系统将使用 Fedora 29 安装的内核重启。这个是正常的。在内核选择页面后不久,系统开始升级过程。 + +现在可以休息一下了!完成后你的系统将重启,你就可以登录新升级的 Fedora 30 了。 + +![][4] + +### 解决升级问题 + +升级系统时偶尔可能会出现意外问题。如果你遇到任何问题,请访问 [DNF 系统升级的维基页面][5],以获取有关出现问题时的故障排除的更多信息。 + +如果你在升级时遇到问题并在系统上安装了第三方仓库,那么可能需要在升级时禁用这些仓库。有关 Fedora 对未提供仓库的支持,请与仓库的提供商联系。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/ + +作者:[Ryan Lerch][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/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/29-30-816x345.jpg +[2]: https://fedoramagazine.org/announcing-fedora-30/ +[3]: https://fedoramagazine.org/taking-smart-backups-duplicity/ +[4]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png +[5]: https://fedoraproject.org/wiki/DNF_system_upgrade#Resolving_post-upgrade_issues From e8a4fd7d46b68e73550a9ec9fd70c6f0a46a21bb Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 14 May 2019 09:02:41 +0800 Subject: [PATCH 0436/1154] translated --- ...20190501 Write faster C extensions for Python with Cython.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190501 Write faster C extensions for Python with Cython.md b/sources/tech/20190501 Write faster C extensions for Python with Cython.md index 1d13bfd6d6..c8c3daf779 100644 --- a/sources/tech/20190501 Write faster C extensions for Python with Cython.md +++ b/sources/tech/20190501 Write faster C extensions for Python with Cython.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f531374165d8f9d2da09d58f2b0c114dc2a145cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 14 May 2019 09:54:25 +0800 Subject: [PATCH 0437/1154] translating --- .../tech/20180725 Put platforms in a Python game with Pygame.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180725 Put platforms in a Python game with Pygame.md b/sources/tech/20180725 Put platforms in a Python game with Pygame.md index 759bfc01df..74d2536942 100644 --- a/sources/tech/20180725 Put platforms in a Python game with Pygame.md +++ b/sources/tech/20180725 Put platforms in a Python game with Pygame.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7904053c3435dea2aabe9ef66d572685b5532359 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 12:52:56 +0800 Subject: [PATCH 0438/1154] PRF:20190430 Upgrading Fedora 29 to Fedora 30.md @geekpi --- ...190430 Upgrading Fedora 29 to Fedora 30.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md index 0ac36450d6..9631df78d3 100644 --- a/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md +++ b/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Upgrading Fedora 29 to Fedora 30) @@ -12,25 +12,25 @@ ![][1] -Fedora 30 [现在发布了][2]。你可能希望将系统升级到最新版本的 Fedora。Fedora Workstation 有图形化升级的方法。另外,Fedora 也提供了一个命令行方法,用于将 Fedora 29 升级到 Fedora 30。 +Fedora 30 [已经发布了][2]。你可能希望将系统升级到最新版本的 Fedora。Fedora 工作站版本有图形化升级的方法。另外,Fedora 也提供了一个命令行方法,用于将 Fedora 29 升级到 Fedora 30。 -### 将 Fedora 29 Workstation 升级到 Fedora 30 +### 将 Fedora 29 工作站版本升级到 Fedora 30 -在发布不久后,桌面会显示一条通知告诉你可以升级。你可以单击通知启动 **GNOME Software** 应用。或者你可以从 GNOME Shell 中选择 Software。 +在发布不久后,桌面会显示一条通知告诉你可以升级。你可以单击通知启动 “GNOME 软件” 应用。或者你可以从 GNOME Shell 中选择“软件”。 -在 GNOME Software 中选择_更新_选项卡,你会看到一个页面通知你可以更新 Fedora 30。 +在 “GNOME 软件” 中选择*更新*选项卡,你会看到一个页面通知你可以更新 Fedora 30。 如果你在屏幕上看不到任何内容,请尝试点击左上角的重新加载按钮。发布后,所有系统都可能需要一段时间才能看到可用的升级。 -选择_下载_获取升级包。你可以继续做其他的事直到下载完成。然后使用 GNOME Software 重启系统并应用升级。升级需要时间,因此你可以喝杯咖啡,稍后再回来。 +选择“下载”获取升级包。你可以继续做其他的事直到下载完成。然后使用 “GNOME 软件” 重启系统并应用升级。升级需要时间,因此你可以喝杯咖啡,稍后再回来。 ### 使用命令行 -如果你过去升级过 Fedora 版本,你可能熟悉 _dnf upgrade_ 插件。这是从 Fedora 29 升级到 Fedora 30 的推荐和支持的方式。使用这个插件将使你的 Fedora 30 升级简单易行。 +如果你过去升级过 Fedora 版本,你可能熟悉 `dnf upgrade` 插件。这是从 Fedora 29 升级到 Fedora 30 的推荐和支持的方式。使用这个插件将使你的 Fedora 30 升级简单易行。 -##### 1\. 更新软件并备份系统 +#### 1、更新软件并备份系统 -在你执行任何操作之前,你需要确保在开始升级之前拥有 Fedora 29 的最新软件。要更新软件,请使用 _GNOME Software_ 或在终端中输入以下命令。 +在你执行任何操作之前,你需要确保在开始升级之前拥有 Fedora 29 的最新软件。要更新软件,请使用 “GNOME 软件” 或在终端中输入以下命令。 ``` sudo dnf upgrade --refresh @@ -38,7 +38,7 @@ sudo dnf upgrade --refresh 此外,请确保在继续之前备份系统。关于备份的帮助,请参阅 Fedora Magazine 上的[备份系列][3]。 -##### 2\. 安装 DNF 插件 +#### 2、安装 DNF 插件 接下来,打开终端并输入以下命令来安装插件: @@ -46,7 +46,7 @@ sudo dnf upgrade --refresh sudo dnf install dnf-plugin-system-upgrade ``` -##### 3\. 使用 DNF 开始更新 +#### 3、使用 DNF 开始更新 现在你的系统是最新的,完成了备份,并且已安装 DNF 插件,你可以在终端中使用以下命令开始升级: @@ -54,9 +54,9 @@ sudo dnf install dnf-plugin-system-upgrade sudo dnf system-upgrade download --releasever=30 ``` -此命令将开始在本地下载所有升级文件以准备升级。如果你因没有更新包、错误的依赖,或过时的包在升级时遇到问题,请在输入上面的命令时添加 _-- allowerasing_ 标志。这将允许 DNF 删除可能阻止系统升级的软件包。 +此命令将开始在本地下载所有升级文件以准备升级。如果你因为没有更新包、错误的依赖,或过时的包在升级时遇到问题,请在输入上面的命令时添加 `-- allowerasing` 标志。这将允许 DNF 删除可能阻止系统升级的软件包。 -##### 4\. 重启并升级 +#### 4、重启并升级 当前面的命令完成下载所有升级文件后,你的系统就可以重启了。要将系统引导至升级过程,请在终端中输入以下命令: @@ -64,7 +64,7 @@ sudo dnf system-upgrade download --releasever=30 sudo dnf system-upgrade reboot ``` -此后你的系统将重启。在许多版本之前,_fedup_ 工具将在内核选择/引导页面上创建一个新选项。使用 _dnf-plugin-system-upgrade_ 包,你的系统将使用 Fedora 29 安装的内核重启。这个是正常的。在内核选择页面后不久,系统开始升级过程。 +此后你的系统将重启。在许多版本之前,`fedup` 工具将在内核选择/引导页面上创建一个新选项。使用 `dnf-plugin-system-upgrade` 包,你的系统将使用当前 Fedora 29 安装的内核重启。这个是正常的。在内核选择页面后不久,系统开始升级过程。 现在可以休息一下了!完成后你的系统将重启,你就可以登录新升级的 Fedora 30 了。 @@ -83,7 +83,7 @@ via: https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/ 作者:[Ryan Lerch][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/) 荣誉推出 From 96cfc9631ca5724b8384648c2fa5029bcefbfd28 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 12:53:26 +0800 Subject: [PATCH 0439/1154] PUB:20190430 Upgrading Fedora 29 to Fedora 30.md @geekpi https://linux.cn/article-10854-1.html --- .../20190430 Upgrading Fedora 29 to Fedora 30.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190430 Upgrading Fedora 29 to Fedora 30.md (98%) diff --git a/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md b/published/20190430 Upgrading Fedora 29 to Fedora 30.md similarity index 98% rename from translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md rename to published/20190430 Upgrading Fedora 29 to Fedora 30.md index 9631df78d3..4d9123601f 100644 --- a/translated/tech/20190430 Upgrading Fedora 29 to Fedora 30.md +++ b/published/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10854-1.html) [#]: subject: (Upgrading Fedora 29 to Fedora 30) [#]: via: (https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/) [#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) From cfabc2736ee28b6c0ed810b6c0d2e29d0d35a3cd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 15:55:18 +0800 Subject: [PATCH 0440/1154] PRF:20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @warmfrog 一般称“发行版”而不是“分发版” --- ...ip in Ubuntu and Other Linux -Quick Tip.md | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md index b7d36cd794..ff27065d14 100644 --- a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md +++ b/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -1,78 +1,77 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Use 7Zip in Ubuntu and Other Linux [Quick Tip]) [#]: via: (https://itsfoss.com/use-7zip-ubuntu-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何在 Ubuntu 和其他 Linux 分发版上使用 7Zip [快速指南] -==================================================== +如何在 Ubuntu 和其他 Linux 发行版上使用 7Zip +============================================== -_**简介: 不能在 Linux 中提取 .7z 文件? 学习如何在 Ubuntu 和其他 Linux 分发版中安装和使用 7zip。**_ +![](https://img.linux.net.cn/data/attachment/album/201905/14/154515xqy7nbq6eyjzu7qj.jpg) -[7Zip][1](更适当的写法是 7-Zip)是一种在 Windows 用户中广泛流行的文档格式。一个 7Zip 文档文件通常以 .7z 扩展结尾。它大部分是开源的,除了包含一些少量解压 rar 文件的代码。 +> 不能在 Linux 中提取 .7z 文件?学习如何在 Ubuntu 和其他 Linux 发行版中安装和使用 7zip。 -默认大多数 Linux 分发版不支持 7Zip。如果你试图提取它,你会看见这个错误: +[7Zip][1](更适当的写法是 7-Zip)是一种在 Windows 用户中广泛流行的归档格式。一个 7Zip 归档文件通常以 .7z 扩展结尾。它大部分是开源的,除了包含一些少量解压 rar 文件的代码。 -_**不能打开这种文件类型 -没有已安装的适用 7-zip 文档文件的命令。你想搜索一个命令来打开这个文件吗**_ +默认大多数 Linux 发行版不支持 7Zip。如果你试图提取它,你会看见这个错误: + +> 不能打开这种文件类型 + +> 没有已安装的适用 7-zip 归档文件的命令。你想搜索一个命令来打开这个文件吗? ![][2] -不要担心,你可以轻松的在 Ubuntu 和其他 Linux 分发版中安装 7zip。 +不要担心,你可以轻松的在 Ubuntu 和其他 Linux 发行版中安装 7zip。 -一个问题是你会注意到如果你试图用 [apt-get install 命令][3],你会发现没有以 7zip 开头的候选安装。因为在 Linux 中 7Zip 包的名字是 [p7zip][4]。以字母 ‘p’ 开头而不是预期的数字 ‘7’。 +一个问题是你会注意到如果你试图用 [apt-get install 命令][3],你会发现没有以 7zip 开头的候选安装。因为在 Linux 中 7Zip 包的名字是 [p7zip][4]。以字母 “p” 开头而不是预期的数字 “7”。 -让我们看一下如何在 Ubuntu 和其他 Linux 分发版中安装 7zip。 +让我们看一下如何在 Ubuntu 和其他 Linux 发行版中安装 7zip。 ### 在 Ubuntu Linux 中安装 7Zip ![][5] -你需要做的第一件事是安装 p7zip 包。你会在 Ubuntu 中发现 3 个包:p7zip,p7zip-full 和 pzip-rar。 +你需要做的第一件事是安装 p7zip 包。你会在 Ubuntu 中发现 3 个包:p7zip、p7zip-full 和 pzip-rar。 -pzip 和 p7zip-full 的不同是 pzip 是一个轻量级的版本,仅仅对 .7z 文件提供支持,而 full 版本提供了更多的 7z 压缩算法(例如音频文件)。 +pzip 和 p7zip-full 的不同是 pzip 是一个轻量级的版本,仅仅对 .7z 文件提供支持,而 p7zip-full 提供了更多的 7z 压缩算法(例如音频文件)。 p7zip-rar 包在 7z 中提供了对 [RAR 文件][6] 的支持 -安装 p7zip-full 在大多数情况下足够了,但是你可能想安装 p7zip-rar 来支持 rar 文件的解压。 +在大多数情况下安装 p7zip-full 就足够了,但是你可能想安装 p7zip-rar 来支持 rar 文件的解压。 -p7zip 包在[ Ubuntu 的 universe 仓库][7] 因此保证你可以使用以下命令: +p7zip 包在 [Ubuntu 的 universe 仓库][7] 因此保证你可以使用以下命令: ``` sudo add-apt-repository universe sudo apt update ``` -在 Ubuntu 和 基于 Debian 的分发版中使用以下命令。 +在 Ubuntu 和基于 Debian 的发行版中使用以下命令。 ``` sudo apt install p7zip-full p7zip-rar ``` -这很好。现在在你的系统之有了 7zip 文档的支持。 +这很好。现在在你的系统就有了 7zip 归档的支持。 -[][8] - -建议使用 NitroShare 在 Linux,Windows 和 Mac 系统之间轻松共享文件。 - -### 在 Linux中提取 7Zip 文档文件 +### 在 Linux 中提取 7Zip 归档文件 安装了 7Zip 后,在 Linux 中,你可以在图形用户界面或者 命令行中提取 7zip 文件。 在图形用户界面,你可以像提取其他压缩文件一样提取 .7z 文件。右击文件来提取它。 -在终端中,你可以使用下列命令提取 .7z 文档文件: +在终端中,你可以使用下列命令提取 .7z 归档文件: ``` 7z e file.7z ``` -### 在 Linux 中压缩文件为 7zip 文档格式 +### 在 Linux 中压缩文件为 7zip 归档格式 -你可以在图形界面压缩文件为 7zip 文档格式。简单的在文件或目录上右击,选择**压缩**。你应该看到几种类型的文件格式选项。选择 .7z。 +你可以在图形界面压缩文件为 7zip 归档格式。简单的在文件或目录上右击,选择“压缩”。你应该看到几种类型的文件格式选项。选择 .7z。 ![7zip Archive Ubuntu][9] @@ -82,9 +81,9 @@ sudo apt install p7zip-full p7zip-rar 7z a 输出的文件名 要压缩的文件 ``` -默认,文档文件有 .7z 扩展。你可以压缩文件为 zip 格式通过在输出文件中指定0扩展(.zip)。 +默认,归档文件有 .7z 扩展。你可以通过在指定输出文件扩展名为 .zip 以压缩为 zip 格式。 -**总结** +### 总结 就是这样。看,在 Linux 中使用 7zip 多简单?我希望你喜欢这个快速指南。如果你有问题或者建议,请随意在下方评论让我知道。 @@ -95,7 +94,7 @@ via: https://itsfoss.com/use-7zip-ubuntu-linux/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 720294c1823ee71eedb2741df25d43eb90a75ed2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 15:56:31 +0800 Subject: [PATCH 0441/1154] PUB:20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @warmfrog https://linux.cn/article-10855-1.html --- ... How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) rename {translated/tech => published}/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md (98%) diff --git a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/published/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md similarity index 98% rename from translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md rename to published/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md index ff27065d14..f3de1044ee 100644 --- a/translated/tech/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md +++ b/published/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10855-1.html) [#]: subject: (How to Use 7Zip in Ubuntu and Other Linux [Quick Tip]) [#]: via: (https://itsfoss.com/use-7zip-ubuntu-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) @@ -32,8 +32,6 @@ ### 在 Ubuntu Linux 中安装 7Zip -![][5] - 你需要做的第一件事是安装 p7zip 包。你会在 Ubuntu 中发现 3 个包:p7zip、p7zip-full 和 pzip-rar。 pzip 和 p7zip-full 的不同是 pzip 是一个轻量级的版本,仅仅对 .7z 文件提供支持,而 p7zip-full 提供了更多的 7z 压缩算法(例如音频文件)。 From 311f3c723e6f39794433a9af2e6f2e5aa0178dfc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 16:20:06 +0800 Subject: [PATCH 0442/1154] APL:20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing --- ...Best Kali Linux Tools for Hacking and Penetration Testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md index 13c9f19888..37d1155ba3 100644 --- a/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md +++ b/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e1a11f6e68a34d5ac2e2872c8580f23314032ac0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 14 May 2019 18:26:00 +0800 Subject: [PATCH 0443/1154] TSL:20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md --- ...ols for Hacking and Penetration Testing.md | 271 ------------------ ...ols for Hacking and Penetration Testing.md | 264 +++++++++++++++++ 2 files changed, 264 insertions(+), 271 deletions(-) delete mode 100644 sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md create mode 100644 translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md diff --git a/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md deleted file mode 100644 index 37d1155ba3..0000000000 --- a/sources/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md +++ /dev/null @@ -1,271 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) -[#]: via: (https://itsfoss.com/best-kali-linux-tools/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -21 Best Kali Linux Tools for Hacking and Penetration Testing -====== - -_**Here’s our list of best Kali Linux tools that will allow you to assess the security of web-servers and help in performing hacking and pen-testing.**_ - -If you read the [Kali Linux review][1], you know why it is considered one of the [best Linux distributions for hacking and pen-testing][2] and rightly so. It comes baked in with a lot of tools to make it easier for you to test, hack, and for anything else related to digital forensics. - -It is one of the most recommended Linux distro for ethical hackers. Even if you are not a hacker but a webmaster – you can still utilize some of the tools to easily run a scan of your web server or web page. - -In either case, no matter what your purpose is – we shall take a look at some of the best Kali Linux tools that you should be using. - -_Note that not all tools mentioned here are open source._ - -### Top Kali Linux Tools for Hacking and Penetration Testing - -![Kali Linux][3] - -There are several types of tools that comes pre-installed. If you do not find a tool installed, simply download it and set it up. It’s easy. - -#### 1\. Nmap - -![Kali Linux Nmap][4] - -[Nmap][5] or “Network Mapper” is one of the most popular tools on Kali Linux for information gathering. In other words, to get insights about the host, its IP address, OS detection, and similar network security details (like the number of open ports and what they are). - -It also offers features for firewall evasion and spoofing. - -#### 2\. Lynis - -![Lynis Kali Linux Tool][6] - -[Lynis][7] is a powerful tool for security auditing, compliance testing, and system hardening. Of course, you can also utilize this for vulnerability detection and penetration testing as well. - -It will scan the system according to the components it detects. For example, if it detects Apache – it will run Apache-related tests for pin point information. - -#### 3\. WPScan - -![][8] - -WordPress is one of the [best open source CMS][9] and this would be the best free WordpPress security auditing tool. It’s free but not open source. - -If you want to know whether a WordPress blog is vulnerable in some way, [WPScan][10] is your friend. - -In addition, it also gives you details of the plugins active. Of course, a well-secured blog may not give you a lot of details, but it is still the best tool for WordPress security scans to find potential vulnerabilities. - -#### 4\. Aircrack-ng - -![][11] - -[Aircrack-ng][12] is a collection of tools to assess WiFi network security. It isn’t just limited to monitor and get insights – but it also includes the ability to compromise a network (WEP, WPA 1, and WPA 2). - -If you forgot the password of your own WiFi network – you can try using this to regain access. It also includes a variety of wireless attacks with which you can target/monitor a WiFi network to enhance its security. - -#### 5\. Hydra - -![][13] - -If you are looking for an interesting tool to crack login/password pairs, [Hydra][14] will be one of the best Kali Linux tools that comes pre-installed. - -It may not be actively maintained anymore – but it is now on [GitHub][15], so you can contribute working on it as well. - -[][16] - -Suggested read [Year 2013 For Linux] 14 New Linux Distributions Born - -#### 6\. Wireshark - -![][17] - -[Wireshark][18] is the most popular network analyzer that comes baked in with Kali Linux. It can be categorized as one of the best Kali Linux tools for network sniffing as well. - -It is being actively maintained, so I would definitely recommend trying this out. - -#### 7\. Metasploit Framework - -![][19] - -[Metsploit Framework][20] is the most used penetration testing framework. It offers two editions – one (open source) and the second is the pro version to it. With this tool, you can verify vulnerabilities, test known exploits, and perform a complete security assessment. - -Of course, the free version won’t have all the features, so if you are into serious stuff, you should compare the editions [here][21]. - -#### 8\. Skipfish - -![][22] - -Similar to WPScan, but not just focused for WordPress. [Skipfish][23] is a web application scanner that would give you insights for almost every type of web applications. It’s fast and easy to use. In addition, its recursive crawl method makes it even better. - -For professional web application security assessments, the report generated by Skipfish will come in handy. - -#### 9\. Maltego - -![][24] - -[Maltego][25] is an impressive data mining tool to analyze information online and connect the dots (if any). As per the information, it creates a directed graph to help analyze the link between those pieces of data. - -Do note, that this isn’t an open source tool. - -It comes pre-installed, however, you will have to sign up in order to select which edition you want to use. If you want for personal use, the community edition will suffice (you just need to register for an account) but if you want to utilize for commercial purpose, you need the subscription to the classic or XL version. - -#### 10\. Nessus - -![Nessus][26] - -If you have a computer connected to a network, Nessus can help find vulnerabilities that a potential attacker may take advantage of. Of course, if you are an administrator for multiple computers connected to a network, you can make use of it and secure those computers. - -However, this is not a free tool anymore, you can try it free for 7 days on from its [official website][27]. - -#### 11\. Burp Suite Scanner - -![][28] - -[Burp Suite Scanner][29] is a fantastic web security analysis tool. Unlike other web application security scanner, Burp offers a GUI and quite a few advanced tools. - -However, the community edition restricts the features to only some essential manual tools. For professionals, you will have to consider upgrading. Similar to the previous tool, this isn’t open source either. - -I’ve used the free version, but if you want more details on it, you should check out the features available on their [official website][29]. - -#### 12\. BeEF - -![][30] - -BeEF (Browser Exploitation Framework) is yet another impressive tool. It has been tailored for penetration testers to assess the security of a web browser. - -This is one of the best Kali Linux tools because a lot of users do want to know and fix the client-side problems when talking about web security. - -#### 13\. Apktool - -![][31] - -[Apktool][32] is indeed one of the popular tools found on Kali Linux for reverse engineering Android apps. Of course, you should make good use of it – for educational purposes. - -[][33] - -Suggested read 4 Format Factory Alternative In Linux - -With this tool, you can experiment some stuff yourself and let the original developer know about your idea as well. What do you think you’ll be using it for? - -#### 14\. sqlmap - -![][34] - -If you were looking for an open source penetration testing tool – [sqlmap][35] is one of the best. It automates the process of exploiting SQL injection flaws and helps you take over database servers. - -#### 15\. John the Ripper - -![John The Ripper][36] - -[John the Ripper][37] is a popular password cracker tool available on Kali Linux. It’s free and open source as well. But, if you are not interested in the [community-enhanced version][37], you can choose the [pro version][38] for commercial use. - -#### 16\. Snort - -Want real-time traffic analysis and packet logging capability? [Snort][39] has got your back. Even being an open source intrusion prevention system, it has a lot to offer. - -The [official website][40] mentions the procedure to get it installed if you don’t have it already. - -#### 17\. Autopsy Forensic Browser - -![][41] - -[Autopsy][42] is a digital forensic tool to investigate what happened on your computer. Well, you can also use it to recover images from SD card. It is also being used by law enforcement officials. You can read the [documentation][43] to explore what you can do with it. - -You should also check out their [GitHub page][44]. - -#### 18\. King Phisher - -![King Phisher][45] - -Phishing attacks are very common nowadays. And, [King Phisher tool][46] helps test, and promote user awareness by simulating real-world phishing attacks. For obvious reasons, you will need permission to simulate it on a server content of an organization. - -#### 19\. Nikto - -![Nikto][47] - -[Nikto][48] is a powerful web server scanner – that makes it one of the best Kali Linux tools available. It checks in against potentially dangerous files/programs, outdated versions of server, and many more things. - -#### 20\. Yersinia - -![][49] - -[Yersinia][50] is an interesting framework to perform Layer 2 attacks (Layer 2 refers to the data link layer of [OSI model][51]) on a network. Of course, if you want a network to be secure, you will have to consider all the seven layers. However, this tool focuses on Layer 2 and a variety of network protocols that include STP, CDP, DTP, and so on. - -#### 21\. Social Engineering Toolkit (SET) - -![][52] - -If you are into pretty serious penetration testing stuff, this should be one of the best tools you should check out. Social engineering is a big deal and with [SET][53] tool, you can help protect against such attacks. - -**Wrapping Up** - -There’s actually a lot of tools that comes bundled with Kali Linux. Do refer to Kali Linux’ [official tool listing page][54] to find them all. - -You will find some of them to be completely free and open source while some to be proprietary solutions (yet free). However, for commercial purpose, you should always opt for the premium editions. - -We might have missed one of your favorite Kali Linux tools. Did we? Let us know about it in the comments section below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/best-kali-linux-tools/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/kali-linux-review/ -[2]: https://itsfoss.com/linux-hacking-penetration-testing/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-tools.jpg?resize=800%2C518&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-nmap.jpg?resize=800%2C559&ssl=1 -[5]: https://nmap.org/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/lynis-kali-linux-tool.jpg?resize=800%2C525&ssl=1 -[7]: https://cisofy.com/lynis/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/wpscan-kali-linux.jpg?resize=800%2C545&ssl=1 -[9]: https://itsfoss.com/open-source-cms/ -[10]: https://wpscan.org/ -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/aircrack-ng-kali-linux-tool.jpg?resize=800%2C514&ssl=1 -[12]: https://www.aircrack-ng.org/ -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/hydra-kali-linux.jpg?resize=800%2C529&ssl=1 -[14]: https://github.com/vanhauser-thc/thc-hydra -[15]: https://github.com/vanhauser-thc/THC-Archive -[16]: https://itsfoss.com/new-linux-distros-2013/ -[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/wireshark-network-analyzer.jpg?resize=800%2C556&ssl=1 -[18]: https://www.wireshark.org/ -[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/metasploit-framework.jpg?resize=800%2C561&ssl=1 -[20]: https://github.com/rapid7/metasploit-framework -[21]: https://www.rapid7.com/products/metasploit/download/editions/ -[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/skipfish-kali-linux-tool.jpg?resize=800%2C515&ssl=1 -[23]: https://gitlab.com/kalilinux/packages/skipfish/ -[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/maltego.jpg?resize=800%2C403&ssl=1 -[25]: https://www.paterva.com/web7/buy/maltego-clients.php -[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nessus.jpg?resize=800%2C456&ssl=1 -[27]: https://www.tenable.com/try -[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/burp-suite-community-edition-800x582.jpg?resize=800%2C582&ssl=1 -[29]: https://portswigger.net/burp -[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/beef-framework.jpg?resize=800%2C339&ssl=1 -[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/apktool.jpg?resize=800%2C504&ssl=1 -[32]: https://github.com/iBotPeaches/Apktool -[33]: https://itsfoss.com/format-factory-alternative-linux/ -[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/sqlmap.jpg?resize=800%2C528&ssl=1 -[35]: http://sqlmap.org/ -[36]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/john-the-ripper.jpg?ssl=1 -[37]: https://github.com/magnumripper/JohnTheRipper -[38]: https://www.openwall.com/john/pro/ -[39]: https://www.snort.org/ -[40]: https://www.snort.org/#get-started -[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/autopsy-forensic-browser.jpg?resize=800%2C319&ssl=1 -[42]: https://www.sleuthkit.org/autopsy/ -[43]: https://www.sleuthkit.org/autopsy/docs.php -[44]: https://github.com/sleuthkit/autopsy -[45]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/king-phisher.jpg?resize=800%2C626&ssl=1 -[46]: https://github.com/securestate/king-phisher -[47]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nikto.jpg?resize=800%2C511&ssl=1 -[48]: https://gitlab.com/kalilinux/packages/nikto/ -[49]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/yersinia.jpg?resize=800%2C516&ssl=1 -[50]: https://github.com/tomac/yersinia -[51]: https://en.wikipedia.org/wiki/OSI_model -[52]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/social-engineering-toolkit.jpg?resize=800%2C511&ssl=1 -[53]: https://www.trustedsec.com/social-engineer-toolkit-set/ -[54]: https://tools.kali.org/tools-listing diff --git a/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md new file mode 100644 index 0000000000..7204ae575e --- /dev/null +++ b/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -0,0 +1,264 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) +[#]: via: (https://itsfoss.com/best-kali-linux-tools/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +用于黑客渗透测试的 21 个最佳 Kali Linux 工具 +====== + +> 最好的 Kali Linux 工具列表,它们可以让你评估 Web 服务器的安全性,并帮助你执行黑客和渗透测试。 + +如果你读过 [Kali Linux 点评][1],你就知道为什么它被认为是[最好的黑客渗透测试的 Linux 发行版][2]之一,而且正如其实。它带有许多工具,使你可以更轻松地进行测试、破解以及与数字取证相关的任何其他工作。 + +它是道德黑客ethical hacker最推荐的 Linux 发行版之一。即使你不是黑客而是网站管理员 —— 你仍然可以利用其中某些工具轻松地扫描你的网络服务器或网页。 + +在任何一种情况下,无论你的目的是什么 —— 让我们来看看你应该使用的一些最好的 Kali Linux 工具。 + +*注意:这里不是所提及的所有工具都是开源的。* + +### 用于黑客渗透测试的 Kali Linux 工具 + +![Kali Linux][3] + +Kali Linux 预装了几种类型的工具。如果你发现有的工具没有安装,只需下载并进行设置即可。这很简单。 + +#### 1、Nmap + +![Kali Linux Nmap][4] + +[Nmap][5] (即 “网络映射器Network Mapper”)是 Kali Linux 上最受欢迎的信息收集工具之一。换句话说,它可以获取有关主机的信息:其 IP 地址、操作系统检测以及类似网络安全详细信息(如开放的端口数量及其含义)。 + +它还提供防火墙规避和欺骗功能。 + +#### 2、Lynis + +![Lynis Kali Linux Tool][6] + +[Lynis][7] 是安全审计、合规性测试和系统强化的强大工具。当然,你也可以将其用于漏洞检测和渗透测试。 + +它将根据检测到的组件扫描系统。例如,如果它检测到 Apache —— 它将针对入口信息运行与 Apache 相关的测试。 + +#### 3、WPScan + +![][8] + +WordPress 是[最好的开源 CMS][9]之一,而这个工具是最好的免费 WordpPress 安全审计工具。它是免费的,但不是开源的。 + +如果你想知道一个 WordPress 博客是否在某种程度上容易受到攻击,[WPScan][10] 就是你的朋友。 + +此外,它还为你提供了所用的插件的详细信息。当然,一个安全性很好的博客可能不会给你很多细节,但它仍然是 WordPress 安全扫描找到潜在漏洞的最佳工具。 + +#### 4、Aircrack-ng + +![][11] + +[Aircrack-ng][12] 是评估 WiFi 网络安全性的工具集合。它不仅限于监控和获取洞察力 —— 还包括破坏网络(WEP、WPA 1 和 WPA 2)的能力。 + +如果你忘记了自己的 WiFi 网络的密码,可以尝试使用它来重新获得访问权限。它还包括各种无线攻击,你可以使用它们来定位/监控 WiFi 网络以增强其安全性。 + +#### 5、Hydra + +![][13] + +如果你正在寻找一个有趣的工具来破解登录密码时,[Hydra][14] 将是 Kali Linux 预装的最好的工具之一。 + +它可能不再被积极维护,但它现在放在 [GitHub][15] 上,所以你也可以为它做贡献。 + +#### 6、Wireshark + +![][17] + +[Wireshark][18] 是 Kali Linux 最受欢迎的网络分析仪。它也可以归类为用于网络嗅探的最佳 Kali Linux 工具之一。 + +它正在积极维护,所以我肯定会建议试试它。 + +#### 7、Metasploit Framework + +![][19] + +[Metsploit Framework][20](MSF)是最常用的渗透测试框架。它提供两个版本:一个开源,第二个是其专业版。使用此工具,你可以验证漏洞、测试已知漏洞并执行完整的安全评估。 + +当然,免费版本不具备所有功能,所以如果你对此很认真,你应该在[这里][21]比较一下版本。 + + +#### 8、Skipfish + +![][22] + +与 WPScan 类似,但不仅仅专注于 WordPress。[Skipfish][23] 是一个 Web 应用扫描程序,可以为你提供几乎所有类型的 Web 应用程序的洞察信息。它快速且易于使用。此外,它的递归爬行方法使它更好。 + +Skipfish 生成的报告可以用于专业的 Web 应用程序安全评估。 + +#### 9、Maltego + +![][24] + +[Maltego][25] 是一种令人印象深刻的数据挖掘工具,用于在线分析信息并连接信息点(如果有的话)。 根据这些信息,它创建了一个有向图,以帮助分析这些数据之间的链接。 + +请注意,这不是一个开源工具。 + +它已预先安装,但你必须注册才能选择要使用的版本。如果个人使用,社区版就足够了(只需要注册一个帐户),但如果想用于商业用途,则需要订阅 classic 或 XL 版本。 + +#### 10、Nessus + +![Nessus][26] + +如果你有个连接到网络的计算机,Nessus 可以帮助你找到潜在攻击者可能利用的漏洞。当然,如果你是连接到网络的多台计算机的管理员,则可以使用它并保护这些计算机。 + +但是,它不再是免费的工具了,你可以从 [官方网站][27] 免费试用 7 天。 + +#### 11、Burp Suite Scanner + +![][28] + +[Burp Suite Scanner][29] 是一款出色的网络安全分析工具。与其他 Web 应用程序安全扫描程序不同,Burp 提供了 GUI 和一些高级工具。 + +但是,社区版仅将功能限制为一些基本的手动工具。对于专业人士,你必须考虑升级。与前面的工具类似,这也不是开源的。 + +我使用过免费版本,但是如果你想了解更多细节,你应该查看他们[官方网站][29]上提供的功能。 + +#### 12、BeEF + +![][30] + +BeEF(浏览器利用框架Browser Exploitation Framework)是另一个令人印象深刻的工具。它专为渗透测试人员量身定制,用于评估 Web 浏览器的安全性。 + +这是最好的 Kali Linux 工具之一,因为很多用户在谈论 Web 安全时确实想知道并修复客户端问题。 + +#### 13、Apktool + +![][31] + +[Apktool][32] 确实是 Kali Linux 上用于逆向工程 Android 应用程序的流行工具之一。当然,你应该正确利用它 —— 出于教育目的。 + +使用此工具,你可以自己尝试一下,并让原开发人员了解你的想法。你认为你会用它做什么? + +#### 14、sqlmap + +![][34] + +如果你正在寻找一个开源渗透测试工具 —— [sqlmap][35] 是最好的之一。它可以自动化利用 SQL 注入漏洞的过程,并帮助你接管数据库服务器。 + +#### 15、John the Ripper + +![John The Ripper][36] + +[John the Ripper][37] 是 Kali Linux 上流行的密码破解工具。它也是自由开源的。但是,如果你对[社区增强版][37]不感兴趣,可以用于商业用途的[专业版][38]。 + +#### 16、Snort + +想要实时流量分析和数据包记录功能吗?[Snort][39] 鼎力支持你。即使它是一个开源的入侵防御系统,也有很多东西可以提供。 + +如果你还没有安装它,[官方网站][40]提及了安装过程。 + +#### 17、Autopsy Forensic Browser + +![][41] + +[Autopsy][42] 是一个数字取证工具,用于调查计算机上发生的事情。那么,你也可以使用它从 SD 卡恢复图像。它也被执法官员使用。你可以阅读[文档][43]来探索可以用它做什么。 + +你还应该查看他们的 [GitHub 页面][44]。 + +#### 18、King Phisher + +![King Phisher][45] + +网络钓鱼攻击现在非常普遍。[King Phisher 工具][46]可以通过模拟真实的网络钓鱼攻击来帮助测试和提升用户意识。出于显而易见的原因,在模拟一个组织的服务器内容前,你需要获得许可。 + +#### 19、Nikto + +![Nikto][47] + +[Nikto][48] 是一款功能强大的 Web 服务器扫描程序 —— 使其成为最好的 Kali Linux 工具之一。 它会检查存在潜在危险的文件/程序、过时的服务器版本等等。 + +#### 20、Yersinia + +![][49] + +[Yersinia][50] 是一个有趣的框架,用于在网络上执行第 2 层攻击(第 2 层是指 [OSI 模型][51]的数据链路层)。当然,如果你希望网络安全,则必须考虑所有七个层。但是,此工具侧重于第 2 层和各种网络协议,包括 STP、CDP,DTP等。 + +#### 21、Social Engineering Toolkit (SET) + +![][52] + +如果你正在进行相当严格的渗透测试,那么这应该是你应该检查的最佳工具之一。社交工程是一个大问题,使用 [SET][53] 工具,你可以帮助防止此类攻击。 + +### 总结 + +实际上 Kali Linux 捆绑了很多工具。请参考 Kali Linux 的[官方工具列表页面][54]来查找所有内容。 + +你会发现其中一些是完全自由开源的,而有些则是专有解决方案(但是免费)。但是,出于商业目的,你应该始终选择高级版本。 + +我们可能错过了你最喜欢的某个 Kali Linux 工具。请在下面的评论部分告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-kali-linux-tools/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/kali-linux-review/ +[2]: https://itsfoss.com/linux-hacking-penetration-testing/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-tools.jpg?resize=800%2C518&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-nmap.jpg?resize=800%2C559&ssl=1 +[5]: https://nmap.org/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/lynis-kali-linux-tool.jpg?resize=800%2C525&ssl=1 +[7]: https://cisofy.com/lynis/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/wpscan-kali-linux.jpg?resize=800%2C545&ssl=1 +[9]: https://itsfoss.com/open-source-cms/ +[10]: https://wpscan.org/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/aircrack-ng-kali-linux-tool.jpg?resize=800%2C514&ssl=1 +[12]: https://www.aircrack-ng.org/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/hydra-kali-linux.jpg?resize=800%2C529&ssl=1 +[14]: https://github.com/vanhauser-thc/thc-hydra +[15]: https://github.com/vanhauser-thc/THC-Archive +[16]: https://itsfoss.com/new-linux-distros-2013/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/wireshark-network-analyzer.jpg?resize=800%2C556&ssl=1 +[18]: https://www.wireshark.org/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/metasploit-framework.jpg?resize=800%2C561&ssl=1 +[20]: https://github.com/rapid7/metasploit-framework +[21]: https://www.rapid7.com/products/metasploit/download/editions/ +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/skipfish-kali-linux-tool.jpg?resize=800%2C515&ssl=1 +[23]: https://gitlab.com/kalilinux/packages/skipfish/ +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/maltego.jpg?resize=800%2C403&ssl=1 +[25]: https://www.paterva.com/web7/buy/maltego-clients.php +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nessus.jpg?resize=800%2C456&ssl=1 +[27]: https://www.tenable.com/try +[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/burp-suite-community-edition-800x582.jpg?resize=800%2C582&ssl=1 +[29]: https://portswigger.net/burp +[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/beef-framework.jpg?resize=800%2C339&ssl=1 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/apktool.jpg?resize=800%2C504&ssl=1 +[32]: https://github.com/iBotPeaches/Apktool +[33]: https://itsfoss.com/format-factory-alternative-linux/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/sqlmap.jpg?resize=800%2C528&ssl=1 +[35]: http://sqlmap.org/ +[36]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/john-the-ripper.jpg?ssl=1 +[37]: https://github.com/magnumripper/JohnTheRipper +[38]: https://www.openwall.com/john/pro/ +[39]: https://www.snort.org/ +[40]: https://www.snort.org/#get-started +[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/autopsy-forensic-browser.jpg?resize=800%2C319&ssl=1 +[42]: https://www.sleuthkit.org/autopsy/ +[43]: https://www.sleuthkit.org/autopsy/docs.php +[44]: https://github.com/sleuthkit/autopsy +[45]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/king-phisher.jpg?resize=800%2C626&ssl=1 +[46]: https://github.com/securestate/king-phisher +[47]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nikto.jpg?resize=800%2C511&ssl=1 +[48]: https://gitlab.com/kalilinux/packages/nikto/ +[49]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/yersinia.jpg?resize=800%2C516&ssl=1 +[50]: https://github.com/tomac/yersinia +[51]: https://en.wikipedia.org/wiki/OSI_model +[52]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/social-engineering-toolkit.jpg?resize=800%2C511&ssl=1 +[53]: https://www.trustedsec.com/social-engineer-toolkit-set/ +[54]: https://tools.kali.org/tools-listing From 3824212c1391da2afd054061b5cc15c06f9a588b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 15 May 2019 08:25:37 +0800 Subject: [PATCH 0444/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190506 How to Add Application Shortcuts on Ubuntu Desktop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md index eb22a17365..6afcd7b7e2 100644 --- a/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md +++ b/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1d94ba02f489c293626f2caff528539c86bfb1da Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 15 May 2019 08:56:48 +0800 Subject: [PATCH 0445/1154] translated --- ...ter C extensions for Python with Cython.md | 83 ------------------- ...ter C extensions for Python with Cython.md | 82 ++++++++++++++++++ 2 files changed, 82 insertions(+), 83 deletions(-) delete mode 100644 sources/tech/20190501 Write faster C extensions for Python with Cython.md create mode 100644 translated/tech/20190501 Write faster C extensions for Python with Cython.md diff --git a/sources/tech/20190501 Write faster C extensions for Python with Cython.md b/sources/tech/20190501 Write faster C extensions for Python with Cython.md deleted file mode 100644 index c8c3daf779..0000000000 --- a/sources/tech/20190501 Write faster C extensions for Python with Cython.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Write faster C extensions for Python with Cython) -[#]: via: (https://opensource.com/article/19/5/python-cython) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00) - -Write faster C extensions for Python with Cython -====== -Learn more about solving common Python problems in our series covering -seven PyPI libraries. -![Hand drawing out the word "code"][1] - -Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. - -In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. First up: **[**Cython**][4]** , a language that simplifies writing C extensions for Python. - -### Cython - -Python is fun to use, but sometimes, programs written in it can be slow. All the runtime dynamic dispatching comes with a steep price: sometimes it's up to 10-times slower than equivalent code written in a systems language like C or Rust. - -Moving pieces of code to a completely new language can have a big cost in both effort and reliability: All that manual rewrite work will inevitably introduce bugs. Can we have our cake and eat it too? - -To have something to optimize for this exercise, we need something slow. What can be slower than an accidentally exponential implementation of the Fibonacci sequence? - - -``` -def fib(n): - if n < 2: - return 1 - return fib(n-1) + fib(n-2) -``` - -Since a call to **fib** results in two calls, this beautifully inefficient algorithm takes a long time to execute. For example, on my new laptop, **fib(36)** takes about 4.5 seconds. These 4.5 seconds will be our baseline as we explore how Python's Cython extension can help. - -The proper way to use Cython is to integrate it into **setup.py**. However, a quick and easy way to try things out is with **pyximport**. Let's put the **fib** code above in **fib.pyx** and run it using Cython. - - -``` ->>> import pyximport; pyximport.install() ->>> import fib ->>> fib.fib(36) -``` - -Just using Cython with _no_ code changes reduced the time the algorithm takes on my laptop to around 2.5 seconds. That's a reduction of almost 50% runtime with almost no effort; certainly, a scrumptious cake to eat and have! - -Putting in a little more effort, we can make things even faster. - - -``` -cpdef int fib(int n): - if n < 2: - return 1 - return fib(n - 1) + fib(n - 2) -``` - -We moved the code in **fib** to a function defined with **cpdef** and added a couple of type annotations: it takes an integer and returns an integer. - -This makes it _much_ faster—around 0.05 seconds. It's so fast that I may start suspecting my measurement methods contain noise: previously, this noise was lost in the signal. - -So, the next time some of your Python code spends too long on the CPU, maybe spinning up some fans in the process, why not see if Cython can fix things? - -In the next article in this series, we'll look at **Black** , a project that automatically corrects format errors in your code. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/python-cython - -作者:[Moshe Zadka ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") -[2]: https://opensource.com/article/18/5/numbers-python-community-trends -[3]: https://pypi.org/ -[4]: https://pypi.org/project/Cython/ diff --git a/translated/tech/20190501 Write faster C extensions for Python with Cython.md b/translated/tech/20190501 Write faster C extensions for Python with Cython.md new file mode 100644 index 0000000000..cbc2c99d62 --- /dev/null +++ b/translated/tech/20190501 Write faster C extensions for Python with Cython.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Write faster C extensions for Python with Cython) +[#]: via: (https://opensource.com/article/19/5/python-cython) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00) + +使用 Cython 为 Python 编写更快的 C 扩展 +====== +在我们覆盖 7 个 PyPI 库的系列文章中了解解决 Python 问题的更多信息。 +![Hand drawing out the word "code"][1] + +Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区可以让我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包,用以扩展和改进 Python 并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。首先是 [Cython][4],一个简化 Python 编写 C 扩展的语言。 + +### Cython + +使用 Python 很有趣,但有时,用它编写的程序可能很慢。所有运行时动态调度会带来很大的代价:有时它比用 C 或 Rust 等系统语言编写的等效代码慢10倍。 + +将代码迁移到一种全新的语言可能会在成本和可靠性方面付出巨大代价:所有手工重写工作都将不可避免地引入错误。我们可以两者兼得么? + +为了练习优化,我们需要一些慢代码。什么比斐波那契数列的意外指数实现更慢? + + +``` +def fib(n): + if n < 2: + return 1 + return fib(n-1) + fib(n-2) +``` + +由于对 **fib** 的调用会导致两次调用,因此这种效率极低的算法需要很长时间才能执行。例如,在我的新笔记本电脑上,**fib(36)** 需要大约 4.5 秒。这个 4.5 秒会成为我们探索 Python 的 Cython 扩展能提供的帮助的基准。 + +使用 Cython 的正确方法是将其集成到 **setup.py** 中。然而,使用 **pyximport** 可以快速地进行尝试。让我们将 **fib** 代码放在 **fib.pyx** 中并使用 Cython 运行它。 + + +``` +>>> import pyximport; pyximport.install() +>>> import fib +>>> fib.fib(36) +``` + +只使用 Cython 不_修改_代码,这个算法在我笔记本上花费的时间减少到大约 2.5 秒。几乎无需任何努力,这几乎减少了 50% 的运行时间。当然,得到了一个不错的成果。 + +加把劲,我们可以让它变得更快。 + + +``` +cpdef int fib(int n): + if n < 2: + return 1 + return fib(n - 1) + fib(n - 2) +``` + +我们将 **fib** 中的代码变成用 **cpdef** 定义的函数,并添加了几个类型注释:它接受一个整数并返回一个整数。 + +这个变得快_多_了,大约 0.05 秒。它是如此之快以至于我可能开始怀疑我的测量方法包含噪声:之前,这种噪声在信号中丢失了。 + +当下次你的 Python 代码花费太多 CPU 时间时,也许在这个过程中会让一些粉丝蠢蠢欲动,为何不看看 Cython 是否可以解决问题呢? + +在本系列的下一篇文章中,我们将看一下 **Black** ,一个自动纠正代码格式错误的项目。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-cython + +作者:[Moshe Zadka ][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/moshez/users/moshez/users/foundjem/users/jugmac00 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/Cython/ From e260e19cae2a537e89be1b641a6ed43dfedf7449 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 15 May 2019 09:02:38 +0800 Subject: [PATCH 0446/1154] translating --- .../tech/20190425 Automate backups with restic and systemd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190425 Automate backups with restic and systemd.md b/sources/tech/20190425 Automate backups with restic and systemd.md index 46c71ae313..bc29d39c0d 100644 --- a/sources/tech/20190425 Automate backups with restic and systemd.md +++ b/sources/tech/20190425 Automate backups with restic and systemd.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 849ca6c2883f792bb389b9b91dce55c0a481eba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 15 May 2019 09:28:13 +0800 Subject: [PATCH 0447/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Application Shortcuts on Ubuntu Desktop.md | 128 ------------------ ...Application Shortcuts on Ubuntu Desktop.md | 128 ++++++++++++++++++ 2 files changed, 128 insertions(+), 128 deletions(-) delete mode 100644 sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md create mode 100644 translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md diff --git a/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md deleted file mode 100644 index 6afcd7b7e2..0000000000 --- a/sources/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md +++ /dev/null @@ -1,128 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) -[#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Add Application Shortcuts on Ubuntu Desktop -====== - -_**In this quick tutorial, you’ll learn how to add application shortcuts on desktop in Ubuntu and other distributions that use GNOME desktop.**_ - -A classic desktop operating systems always have icons on the ‘desktop screen’. These desktop icons could include the file manager, the trash bin and the shortcut to applications. - -While installing applications in Windows, some of the programs ask if you want to create a shortcut on the desktop. That’s not the case in Linux though. - -But if you are a fan of this feature, let me show you how you can add desktop shortcuts to your favorite applications in [Ubuntu][1] and other Linux distributions. - -![Application Shortcuts on Desktop in Ubuntu with GNOME desktop][2] - -In case you are wondering about the looks of my desktop, I am using Ant theme with Tela icons. You can also get some [GTK themes][3] and [icons for Ubuntu][4] and change them as you like. - -### Adding desktop shortcut in Ubuntu - -![][5] - -Personally I prefer the Ubuntu launcher for application shortcuts. If I use a program frequently, I add it to the launcher. But I know not everyone has the same preference and a few people prefer the shortcuts on the desktop. - -Let’s see the simplest way of creating an application shortcut on the desktop. - -Disclaimer - -This tutorial has been tested on Ubuntu 18.04 LTS with [GNOME desktop][6]. It may work in other distributions and desktop environments but you have to try it on your own. Some GNOME specific steps may change so please pay attention while trying it on [other desktop environments][7]. - -[Subscribe to our YouTube Channel for More Linux Videos][8] - -#### Prerequisite - -First and foremost thing is to make sure that you have icons allowed on the GNOME desktop. - -If you followed the Ubuntu 18.04 customization tips, you know how to install GNOME Tweaks tool. In this tool, make sure that you have ‘Show Icons’ option enabled. - -![Allow icons on desktop in GNOME][9] - -Once you have made sure of that, it’s time to add some application shortcuts on the desktop. - -[][10] - -Suggested read How to Replace One Linux Distribution With Another From Dual Boot [Keeping Home Partition] - -#### Step 1: Locate the .desktop files of applications - -Go to Files -> Other Location -> Computer. - -![Go to Other Locations -> Computer][11] - -From here, go to the directory usr -> share -> applications. You’ll see icons of several [Ubuntu applications][12] you have installed here. Even if you don’t see the icons, you should see the .desktop files that are named as application.desktop. - -![Application Shortcuts][13] - -#### Step 2: Copy the .desktop file to desktop - -Now all you have to do here is to look for the application icon (or its desktop file). When you find it, either drag-drop the file to the desktop or copy the file (using Ctrl+C shortcut) and paste it on the desktop (using Ctrl+V shortcut). - -![Add .desktop file to the desktop][14] - -#### Step 3: Run the desktop file - -When you do that, you should see a text file kind of icon on the desktop instead of the logo of the application. Don’t worry, things will be different in a moment. - -What you have to do is to double click on that file on the desktop. It will warn you that it’s an ‘untrusted application launcher’ so click on Trust and Launch. - -![Launch Desktop Shortcut][15] - -The application will launch as usual but the good thing that you’ll notice that the .desktop file has now turned into the application icon. I believe you like the application shortcuts this way, don’t you? - -![Application shortcut on the desktop][16] - -#### Troubleshoot for Ubuntu 19.04 or GNOME 3.32 users - -If you use Ubuntu 19.04 or GNOME 3.32, you the .desktop file may not launch at all. You should right click on the .desktop file and select “Allow Launching”. - -After this, you should be able to launch the application and the application shortcut should be displayed properly on the desktop. - -**Conclusion** - -If you don’t like a certain application launcher on the desktop, just select it and delete it. It will delete the shortcut but the application will remain safely in your system. - -I hope you found this quick tip helpful and now you can enjoy the application shortcuts on Ubuntu desktop. - -[][17] - -Suggested read How to Install and Make Nemo the Default File Manager in Ubuntu - -If you have questions or suggestions, please let me know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-desktop-shortcut/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://www.ubuntu.com/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-ubuntu-desktop.jpeg?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/best-gtk-themes/ -[4]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-ubuntu-desktop-shortcut.jpeg?resize=800%2C450&ssl=1 -[6]: https://www.gnome.org/ -[7]: https://itsfoss.com/best-linux-desktop-environments/ -[8]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/allow-icons-on-desktop-gnome.jpg?ssl=1 -[10]: https://itsfoss.com/replace-linux-from-dual-boot/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Adding-desktop-shortcut-Ubuntu-gnome-1.png?resize=800%2C436&ssl=1 -[12]: https://itsfoss.com/best-ubuntu-apps/ -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/application-shortcuts-in-ubuntu.png?resize=800%2C422&ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-desktop-file-to-desktop.jpeg?resize=800%2C458&ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/launch-desktop-shortcut-.jpeg?resize=800%2C349&ssl=1 -[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-desktop-ubuntu-gnome.jpeg?resize=800%2C375&ssl=1 -[17]: https://itsfoss.com/install-nemo-file-manager-ubuntu/ diff --git a/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md new file mode 100644 index 0000000000..3c836b069a --- /dev/null +++ b/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) +[#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 Ubuntu 桌面如何添加应用快捷方式 +=============================== + +_**在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中添加应用图标。**_ + +一个经典的桌面操作系统在 ‘桌面屏’ 上总是有图标的。这些桌面图标包括文件管理器,回收站和应用图标。 + +当在 Windows 中安装应用时,一些程序会询问你是否在桌面创建一个快捷方式。但在 Linux 系统中不是这样。 + +但是如果你热衷于这个特点,让我给你展示如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中创建应用的快捷方式。 + +![Application Shortcuts on Desktop in Ubuntu with GNOME desktop][2] + +如果你想知道我的桌面外观,我正在使用 Ant 主题和 Tela 图标集。你可以获取一些 [GTK 主题][3] 和 [为 Ubuntu 准备的图标集][4]并换成你喜欢的。 + +### 在 Ubuntu 中添加桌面快捷方式 + +![][5] + +个人来讲,我更喜欢为应用图标准备的 Ubuntu 启动器方式。如果我经常使用一个程序,我会添加到启动器。但是我知道不是每个人都有相同的偏好并且少数人更喜欢桌面的快捷方式。 + +让我们看在桌面中创建应用快捷方式的最简单方式。 + +免责声明 + +这篇指南已经在 Ubuntu18.04 LTS 的 GNOME 桌面上测试过了。它可能在其他发行版和桌面环境上也能发挥作用,但你必须自己尝试。一些 GNOME 特定步骤可能会变,所以请在[其他桌面环境][7]尝试时注意。 + +[Subscribe to our YouTube Channel for More Linux Videos][8] + +#### 准备 + +首先最重要的事是确保你有 GNOME 桌面的图标权限。 + +如果你跟随 Ubuntu 18.04 自定义提示,你会知道如何安装 GNOME Tweaks 工具。在这个工具中,确保你设置 ‘Show Icons’ 选项为允许。 + +![Allow icons on desktop in GNOME][9] + +一旦你确保已经设置,是时候在桌面添加应用快捷方式了。 + +[][10] + +建议阅读在双启动中如何替代一个 Linux 发行版 [保留 Home分区] + +#### 第一步:定位应用的 .desktop 文件 + +到 Files -> Other Location -> Computer。 + +![Go to Other Locations -> Computer][11] + +从这里,到目录 usr -> share -> applications。你会在这里看到几个你已经安装的 [Ubuntu 应用][12]。即使你没有看到图标,你应该看到被命名为 应用名.desktop 形式的文件。 + +![Application Shortcuts][13] + +#### 第二步:拷贝 .desktop 文件到桌面 + +现在你要做的只是查找应用图标(或者它的 desktop 文件)。当你找到后,拖文件到桌面或者拷贝文件(使用 Ctrl+C 快捷方式)并在桌面粘贴(使用 Ctrl+V 快捷方式)。 + +![Add .desktop file to the desktop][14] + +#### 第三步:运行 desktop 文件 + +当你这么做,你应该在桌面上看到一个图标的文本文件而不是应用 logo。别担心,一会就不一样了。 + +你要做的就是双击桌面的那个文件。它将警告你它是一个 ‘未信任的应用启动器’,点击信任并启动。 + +![Launch Desktop Shortcut][15] + +这个应用像往常一样启动,好事是你会察觉到 .desktop 文件现在已经变成应用图标了。我相信你喜欢应用图标的方式,不是吗? + +![Application shortcut on the desktop][16] + +#### Ubuntu 19.04 或者 GNOME 3.32 用户的疑难杂症 + +如果你使用 Ubuntu 19.04 或者 GNOME 3.32,你的 .desktop 文件可能根本不会启动。你应该右击 .desktop 文件并选择 “Allow Launching”。 + +在这之后,你应该能够启动应用并且桌面上的应用快捷方式能够正常显示了。 + +**总结** + +如果你不喜欢桌面的某个应用启动器,选择删除就是了。它会删除应用快捷方式,但是应用仍安全的保留在你的系统中。 + +我希望你发现这篇快速指南有帮助并喜欢在 Ubuntu 桌面上的应用快捷方式。 + +[][17] + +建议阅读在 Ubuntu 中如何安装和设置 Nemo 为默认的文件管理器。 + +如果你有问题或建议,请在下方评论让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-desktop-shortcut/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.ubuntu.com/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-ubuntu-desktop.jpeg?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/best-gtk-themes/ +[4]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-ubuntu-desktop-shortcut.jpeg?resize=800%2C450&ssl=1 +[6]: https://www.gnome.org/ +[7]: https://itsfoss.com/best-linux-desktop-environments/ +[8]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/allow-icons-on-desktop-gnome.jpg?ssl=1 +[10]: https://itsfoss.com/replace-linux-from-dual-boot/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Adding-desktop-shortcut-Ubuntu-gnome-1.png?resize=800%2C436&ssl=1 +[12]: https://itsfoss.com/best-ubuntu-apps/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/application-shortcuts-in-ubuntu.png?resize=800%2C422&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-desktop-file-to-desktop.jpeg?resize=800%2C458&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/launch-desktop-shortcut-.jpeg?resize=800%2C349&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-desktop-ubuntu-gnome.jpeg?resize=800%2C375&ssl=1 +[17]: https://itsfoss.com/install-nemo-file-manager-ubuntu/ From 93a62a0fe34cc73a3ac010b364261d884e8ebbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 15 May 2019 09:34:54 +0800 Subject: [PATCH 0448/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190508 How to use advanced rsync for large Linux backups.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md index 6a6af666e4..cfb949257f 100644 --- a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md +++ b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a799fcce2c5941938923bbeae43a1aac1510d8c1 Mon Sep 17 00:00:00 2001 From: hopefully2333 <787016457@qq.com> Date: Wed, 15 May 2019 11:35:17 +0800 Subject: [PATCH 0449/1154] translating by hopefully2333 translating by hopefully2333 --- ... critical security warning for Nexus data-center switches.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md index 1905aa56de..421f5192b7 100644 --- a/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md +++ b/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hopefully2333) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6774c76f00b69e8279e86af1e6efae7044ef9f53 Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Wed, 15 May 2019 01:44:04 -0400 Subject: [PATCH 0450/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... advanced rsync for large Linux backups.md | 143 ------------------ ... advanced rsync for large Linux backups.md | 140 +++++++++++++++++ 2 files changed, 140 insertions(+), 143 deletions(-) delete mode 100644 sources/tech/20190508 How to use advanced rsync for large Linux backups.md create mode 100644 translated/tech/20190508 How to use advanced rsync for large Linux backups.md diff --git a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md deleted file mode 100644 index 6a6af666e4..0000000000 --- a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to use advanced rsync for large Linux backups) -[#]: via: (https://opensource.com/article/19/5/advanced-rsync) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) - -How to use advanced rsync for large Linux backups -====== -Basic rsync commands are usually enough to manage your Linux backups, -but a few extra options add speed and power to large backup sets. -![Filing papers and documents][1] - -It seems clear that backups are always a hot topic in the Linux world. Back in 2017, David Both offered [Opensource.com][2] readers tips on "[Using rsync to back up your Linux system][3]," and earlier this year, he published a poll asking us, "[What's your primary backup strategy for the /home directory in Linux?][4]" In another poll this year, Don Watkins asked, "[Which open source backup solution do you use?][5]" - -My response is [rsync][6]. I really like rsync! There are plenty of large and complex tools on the market that may be necessary for managing tape drives or storage library devices, but a simple open source command line tool may be all you need. - -### Basic rsync - -I managed the binary repository system for a global organization that had roughly 35,000 developers with multiple terabytes of files. I regularly moved or archived hundreds of gigabytes of data at a time. Rsync was used. This experience gave me confidence in this simple tool. (So, yes, I use it at home to back up my Linux systems.) - -The basic rsync command is simple. - - -``` -`rsync -av SRC DST` -``` - -Indeed, the rsync commands taught in any tutorial will work fine for most general situations. However, suppose we need to back up a very large amount of data. Something like a directory with 2,000 sub-directories, each holding anywhere from 50GB to 700GB of data. Running rsync on this directory could take a tremendous amount of time, particularly if you're using the checksum option, which I prefer. - -Performance is likely to suffer if we try to sync large amounts of data or sync across slow network connections. Let me show you some methods I use to ensure good performance and reliability. - -### Advanced rsync - -One of the first lines that appears when rsync runs is: "sending incremental file list." If you do a search for this line, you'll see many questions asking things like: why is it taking forever? or why does it seem to hang up? - -Here's an example based on this scenario. Let's say we have a directory called **/storage** that we want to back up to an external USB device mounted at **/media/WDPassport**. - -If we want to back up **/storage** to a USB external drive, we could use this command: - - -``` -`rsync -cav /storage /media/WDPassport` -``` - -The **c** option tells rsync to use file checksums instead of timestamps to determine changed files, and this usually takes longer. In order to break down the **/storage** directory, I sync by subdirectory, using the **find** command. Here's an example: - - -``` -`find /storage -type d -exec rsync -cav {} /media/WDPassport \;` -``` - -This looks OK, but if there are any files in the **/storage** directory, they will not be copied. So, how can we sync the files in **/storage**? There is also a small nuance where certain options will cause rsync to sync the **.** directory, which is the root of the source directory; this means it will sync the subdirectories twice, and we don't want that. - -Long story short, the solution I settled on is a "double-incremental" script. This allows me to break down a directory, for example, breaking **/home** into the individual users' home directories or in cases when you have multiple large directories, such as music or family photos. - -Here is an example of my script: - - -``` -HOMES="alan" -DRIVE="/media/WDPassport" - -for HOME in $HOMES; do -cd /home/$HOME -rsync -cdlptgov --delete . /$DRIVE/$HOME -find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DRIVE/$HOME \; -done -``` - -The first rsync command copies the files and directories that it finds in the source directory. However, it leaves the directories empty so we can iterate through them using the **find** command. This is done by passing the **d** argument, which tells rsync not to recurse the directory. - - -``` -`-d, --dirs transfer directories without recursing` -``` - -The **find** command then passes each directory to rsync individually. Rsync then copies the directories' contents. This is done by passing the **r** argument, which tells rsync to recurse the directory. - - -``` -`-r, --recursive recurse into directories` -``` - -This keeps the increment file that rsync uses to a manageable size. - -Most rsync tutorials use the **a** (or **archive** ) argument for convenience. This is actually a compound argument. - - -``` -`-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)` -``` - -The other arguments that I pass would have been included in the **a** ; those are **l** , **p** , **t** , **g** , and **o**. - - -``` --l, --links copy symlinks as symlinks --p, --perms preserve permissions --t, --times preserve modification times --g, --group preserve group --o, --owner preserve owner (super-user only) -``` - -The **\--delete** option tells rsync to remove any files on the destination that no longer exist on the source. This way, the result is an exact duplication. You can also add an exclude for the **.Trash** directories or perhaps the **.DS_Store** files created by MacOS. - - -``` -`-not -name ".Trash*" -not -name ".DS_Store"` -``` - -### Be careful - -One final recommendation: rsync can be a destructive command. Luckily, its thoughtful creators provided the ability to do "dry runs." If we include the **n** option, rsync will display the expected output without writing any data. - - -``` -`rsync -cdlptgovn --delete . /$DRIVE/$HOME` -``` - -This script is scalable to very large storage sizes and large latency or slow link situations. I'm sure there is still room for improvement, as there always is. If you have suggestions, please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/advanced-rsync - -作者:[Alan Formy-Duval ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alanfdoss/users/marcobravo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) -[2]: http://Opensource.com -[3]: https://opensource.com/article/17/1/rsync-backup-linux -[4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux -[5]: https://opensource.com/article/19/2/linux-backup-solutions -[6]: https://en.wikipedia.org/wiki/Rsync diff --git a/translated/tech/20190508 How to use advanced rsync for large Linux backups.md b/translated/tech/20190508 How to use advanced rsync for large Linux backups.md new file mode 100644 index 0000000000..c6a9fa0828 --- /dev/null +++ b/translated/tech/20190508 How to use advanced rsync for large Linux backups.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use advanced rsync for large Linux backups) +[#]: via: (https://opensource.com/article/19/5/advanced-rsync) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) + +如何使用高级工具 rsync 进行大的 Linux 备份 +===================================== +基础的 rsync 命令通常足够来管理你的 Linux 备份,但是额外的选项使大数据集备份更快更强大。 +![Filing papers and documents][1] + +很明显,备份一直是Linux世界的热门话题。回到 2017,David Both 为 [Opensource.com][2] 的读者在"[使用 rsync 备份你的 Linux 系统][3]方面提了一些建议,在这年的更早时候,他发起了一项问卷调查询问大家,"[在 Linux 中你的 /home 目录的主要备份策略是什么][4]",在今年的另一个问卷调查中,Don Watkins 问到,"[你使用哪种开源备份解决方案][5]"。 + +我的回复是 [rsync][6]。市场上有大量大的复杂的工具,对于管理磁带机或者存储库设备,这些可能是必要的,但是可能你需要的只是一个简单的开源命令行工具。 + +### rsync 基础 + +我为一个大概拥有 35,000 开发者并有着几十 TB 文件的全球组织管理二进制仓库。我经常一次移动或者归档上百 GB 的数据。使用的是 rsync。这种经历使我对这个简单的工具充满信心。(所以,是的,我在家使用它来备份我的 Linux 系统) + +基础的 rsync 命令很简单。 + + +``` +`rsync -av 源目录 目的地目录` +``` + +实际上,在任何指南中教的 rsync 命令在大多数通用情况下都运行的很好。然而,假设我们需要备份大量的数据。例如包含 2,000 个子目录的目录,每个包含 50GB 到 700GB 的数据。在这个目录运行 rsync 可能需要大量时间,尤其是当你使用 checksum 选项时(我倾向使用的)。 + +当我们试图同步大量数据或者通过慢的网络连接时,可能遇到性能问题。让我给你展示一些我使用的方法来确保好的性能和可靠性。 + +### 高级 rsync + +当 rsync 运行时出现的第一行是:“正在发送增量文件列表。” 如果你搜索这一行,你将看到很多类似的问题:为什么它一直运行,或者为什么它似乎挂起了。 + +这里是一个基于这个场景的例子。假设我们有一个 **/storage** 的目录,我们想要备份到一个外部 USB 磁盘,我们可以使用下面的命令: + + +``` +`rsync -cav /storage /media/WDPassport` +``` + +**c** 选项告诉 rsync 使用文件校验和而不是时间戳来决定改变的文件,这通常消耗的时间更久。为了分解 **/storage** 目录,我通过子目录同步,使用 **find** 命令。这是一个例子: + + +``` +`find /storage -type d -exec rsync -cav {} /media/WDPassport \;` +``` + +这看起来可以,但是如果 **/storage** 目录有任何文件,它们将被跳过。因此,我们如何同步 **/storage** 目录中的文件呢?同样有一个细微的差别是具体的选项将造成 rsync 同步 **.** 目录,该目录是源目录自身;这意味着它会同步子目录两次,这并不是我们想要的。 + +长话短说,我的解决方案是一个 “双-递增”脚本。这允许我分解一个目录,例如,当你的 home 目录有多个大的目录,例如音乐或者家庭照片时,分解 **/home** 目录为单个的用户 home 目录。 + +这是我的脚本的一个例子: + + +``` +HOMES="alan" +DRIVE="/media/WDPassport" + +for HOME in $HOMES; do +cd /home/$HOME +rsync -cdlptgov --delete . /$DRIVE/$HOME +find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DRIVE/$HOME \; +done +``` + +第一个 rsync 命令拷贝它在源目录中发现的文件和目录。然而,它将目录留空,因此我们能够通过 **find** 命令迭代他们。这通过传递 **d** 参数来完成,它告诉 rsync 不要递归目录。 + + +``` +`-d, --dirs transfer directories without recursing` +``` + +然后 **find** 命令传递每个目录来单独运行 rsync。之后 rsync 拷贝目录的内容。这通过传递 **r** 参数来完成,它告诉 rsync 要递归目录。 + + +``` +`-r, --recursive 递归进入目录` +``` + +这使得 rsync使用的增量文件保持在一个可管理的大小。 + +大多数 rsync 指南为了简便使用 **a** (或者 **archive**) 参数。这实际是一个复合参数。 + + +``` +`-a, --archive 归档模式; equals -rlptgoD (no -H,-A,-X)` +``` + +我传递的其他参数包含在 **a** 中;这些是 **l** , **p** , **t** , **g** , 和 **o**。 + + +``` +-l, --links 复制符号链接作为符号链接 +-p, --perms 保留权限 +-t, --times 保留修改时间 +-g, --group 保留组 +-o, --owner 保留拥有者(只适用于超级管理员) +``` + +**\--delete** 选项告诉 rsync 删除目的地目录中所有在源目录不存在的任意文件。这种方式,运行的结果仅仅是复制。你同样可以排除 **.Trash** 目录或者 MacOS 创建的 **.DS_Store** 文件。 + + +``` +`-not -name ".Trash*" -not -name ".DS_Store"` +``` + +### 注意 + +最后一条建议: rsync 可以是破坏性的命令。幸运的是,它的睿智的创造者提供了 “空运行”的能力。如果我们加入 **n** 选项,rsync 会显示预期的输出但不写任何数据。 + + +``` +`rsync -cdlptgovn --delete . /$DRIVE/$HOME` +``` + +这个脚本适用于非常大的存储规模和高延迟或者慢链接的情况。一如既往,我确信仍有提升的空间。如果你有任何建议,请在下方评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/advanced-rsync + +作者:[Alan Formy-Duval ][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: http://Opensource.com +[3]: https://opensource.com/article/17/1/rsync-backup-linux +[4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux +[5]: https://opensource.com/article/19/2/linux-backup-solutions +[6]: https://en.wikipedia.org/wiki/Rsync From faa2f014e1d9677d457ed784340eb1b6f82a6cbf Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Wed, 15 May 2019 01:54:11 -0400 Subject: [PATCH 0451/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... advanced rsync for large Linux backups.md | 143 ------------------ 1 file changed, 143 deletions(-) delete mode 100644 sources/tech/20190508 How to use advanced rsync for large Linux backups.md diff --git a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md b/sources/tech/20190508 How to use advanced rsync for large Linux backups.md deleted file mode 100644 index cfb949257f..0000000000 --- a/sources/tech/20190508 How to use advanced rsync for large Linux backups.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to use advanced rsync for large Linux backups) -[#]: via: (https://opensource.com/article/19/5/advanced-rsync) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) - -How to use advanced rsync for large Linux backups -====== -Basic rsync commands are usually enough to manage your Linux backups, -but a few extra options add speed and power to large backup sets. -![Filing papers and documents][1] - -It seems clear that backups are always a hot topic in the Linux world. Back in 2017, David Both offered [Opensource.com][2] readers tips on "[Using rsync to back up your Linux system][3]," and earlier this year, he published a poll asking us, "[What's your primary backup strategy for the /home directory in Linux?][4]" In another poll this year, Don Watkins asked, "[Which open source backup solution do you use?][5]" - -My response is [rsync][6]. I really like rsync! There are plenty of large and complex tools on the market that may be necessary for managing tape drives or storage library devices, but a simple open source command line tool may be all you need. - -### Basic rsync - -I managed the binary repository system for a global organization that had roughly 35,000 developers with multiple terabytes of files. I regularly moved or archived hundreds of gigabytes of data at a time. Rsync was used. This experience gave me confidence in this simple tool. (So, yes, I use it at home to back up my Linux systems.) - -The basic rsync command is simple. - - -``` -`rsync -av SRC DST` -``` - -Indeed, the rsync commands taught in any tutorial will work fine for most general situations. However, suppose we need to back up a very large amount of data. Something like a directory with 2,000 sub-directories, each holding anywhere from 50GB to 700GB of data. Running rsync on this directory could take a tremendous amount of time, particularly if you're using the checksum option, which I prefer. - -Performance is likely to suffer if we try to sync large amounts of data or sync across slow network connections. Let me show you some methods I use to ensure good performance and reliability. - -### Advanced rsync - -One of the first lines that appears when rsync runs is: "sending incremental file list." If you do a search for this line, you'll see many questions asking things like: why is it taking forever? or why does it seem to hang up? - -Here's an example based on this scenario. Let's say we have a directory called **/storage** that we want to back up to an external USB device mounted at **/media/WDPassport**. - -If we want to back up **/storage** to a USB external drive, we could use this command: - - -``` -`rsync -cav /storage /media/WDPassport` -``` - -The **c** option tells rsync to use file checksums instead of timestamps to determine changed files, and this usually takes longer. In order to break down the **/storage** directory, I sync by subdirectory, using the **find** command. Here's an example: - - -``` -`find /storage -type d -exec rsync -cav {} /media/WDPassport \;` -``` - -This looks OK, but if there are any files in the **/storage** directory, they will not be copied. So, how can we sync the files in **/storage**? There is also a small nuance where certain options will cause rsync to sync the **.** directory, which is the root of the source directory; this means it will sync the subdirectories twice, and we don't want that. - -Long story short, the solution I settled on is a "double-incremental" script. This allows me to break down a directory, for example, breaking **/home** into the individual users' home directories or in cases when you have multiple large directories, such as music or family photos. - -Here is an example of my script: - - -``` -HOMES="alan" -DRIVE="/media/WDPassport" - -for HOME in $HOMES; do -cd /home/$HOME -rsync -cdlptgov --delete . /$DRIVE/$HOME -find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DRIVE/$HOME \; -done -``` - -The first rsync command copies the files and directories that it finds in the source directory. However, it leaves the directories empty so we can iterate through them using the **find** command. This is done by passing the **d** argument, which tells rsync not to recurse the directory. - - -``` -`-d, --dirs transfer directories without recursing` -``` - -The **find** command then passes each directory to rsync individually. Rsync then copies the directories' contents. This is done by passing the **r** argument, which tells rsync to recurse the directory. - - -``` -`-r, --recursive recurse into directories` -``` - -This keeps the increment file that rsync uses to a manageable size. - -Most rsync tutorials use the **a** (or **archive** ) argument for convenience. This is actually a compound argument. - - -``` -`-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)` -``` - -The other arguments that I pass would have been included in the **a** ; those are **l** , **p** , **t** , **g** , and **o**. - - -``` --l, --links copy symlinks as symlinks --p, --perms preserve permissions --t, --times preserve modification times --g, --group preserve group --o, --owner preserve owner (super-user only) -``` - -The **\--delete** option tells rsync to remove any files on the destination that no longer exist on the source. This way, the result is an exact duplication. You can also add an exclude for the **.Trash** directories or perhaps the **.DS_Store** files created by MacOS. - - -``` -`-not -name ".Trash*" -not -name ".DS_Store"` -``` - -### Be careful - -One final recommendation: rsync can be a destructive command. Luckily, its thoughtful creators provided the ability to do "dry runs." If we include the **n** option, rsync will display the expected output without writing any data. - - -``` -`rsync -cdlptgovn --delete . /$DRIVE/$HOME` -``` - -This script is scalable to very large storage sizes and large latency or slow link situations. I'm sure there is still room for improvement, as there always is. If you have suggestions, please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/advanced-rsync - -作者:[Alan Formy-Duval ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alanfdoss/users/marcobravo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) -[2]: http://Opensource.com -[3]: https://opensource.com/article/17/1/rsync-backup-linux -[4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux -[5]: https://opensource.com/article/19/2/linux-backup-solutions -[6]: https://en.wikipedia.org/wiki/Rsync From ee87cf882e91606130be5bb52b11c99d62f6ad5d Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 15 May 2019 17:18:19 +0800 Subject: [PATCH 0452/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20Lear?= =?UTF-8?q?n=20to=20change=20history=20with=20git=20rebase!=20sources/tech?= =?UTF-8?q?/20190510=20Learn=20to=20change=20history=20with=20git=20rebase?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Learn to change history with git rebase.md | 594 ++++++++++++++++++ 1 file changed, 594 insertions(+) create mode 100644 sources/tech/20190510 Learn to change history with git rebase.md diff --git a/sources/tech/20190510 Learn to change history with git rebase.md b/sources/tech/20190510 Learn to change history with git rebase.md new file mode 100644 index 0000000000..cf8f9351d9 --- /dev/null +++ b/sources/tech/20190510 Learn to change history with git rebase.md @@ -0,0 +1,594 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learn to change history with git rebase!) +[#]: via: (https://git-rebase.io/) +[#]: author: (git-rebase https://git-rebase.io/) + +Learn to change history with git rebase! +====== +One of Git 's core value-adds is the ability to edit history. Unlike version control systems that treat the history as a sacred record, in git we can change history to suit our needs. This gives us a lot of powerful tools and allows us to curate a good commit history in the same way we use refactoring to uphold good software design practices. These tools can be a little bit intimidating to the novice or even intermediate git user, but this guide will help to demystify the powerful git-rebase . + +``` +A word of caution : changing the history of public, shared, or stable branches is generally advised against. Editing the history of feature branches and personal forks is fine, and editing commits that you haven't pushed yet is always okay. Use git push -f to force push your changes to a personal fork or feature branch after editing your commits. +``` + +Despite the scary warning, it's worth mentioning that everything mentioned in this guide is a non-destructive operation. It's actually pretty difficult to permanently lose data in git. Fixing things when you make mistakes is covered at the end of this guide. + +### Setting up a sandbox + +We don't want to mess up any of your actual repositories, so throughout this guide we'll be working with a sandbox repo. Run these commands to get started: + +``` +git init /tmp/rebase-sandbox +cd /tmp/rebase-sandbox +git commit --allow-empty -m"Initial commit" +``` + +If you run into trouble, just run rm -rf /tmp/rebase-sandbox and run these steps again to start over. Each step of this guide can be run on a fresh sandbox, so it's not necessary to re-do every task. + + +### Amending your last commit + +Let's start with something simple: fixing your most recent commit. Let's add a file to our sandbox - and make a mistake: + +``` +echo "Hello wrold!" >greeting.txt + git add greeting.txt + git commit -m"Add greeting.txt" +``` + +Fixing this mistake is pretty easy. We can just edit the file and commit with `--amend`, like so: + +``` +echo "Hello world!" >greeting.txt + git commit -a --amend +``` + +Specifying `-a` automatically stages (i.e. `git add`'s) all files that git already knows about, and `--amend` will squash the changes into the most recent commit. Save and quit your editor (you have a chance to change the commit message now if you'd like). You can see the fixed commit by running `git show`: + +``` +commit f5f19fbf6d35b2db37dcac3a55289ff9602e4d00 (HEAD -> master) +Author: Drew DeVault +Date: Sun Apr 28 11:09:47 2019 -0400 + + Add greeting.txt + +diff --git a/greeting.txt b/greeting.txt +new file mode 100644 +index 0000000..cd08755 +--- /dev/null ++++ b/greeting.txt +@@ -0,0 +1 @@ ++Hello world! +``` + +### Fixing up older commits + +Amending only works for the most recent commit. What happens if you need to correct an older commit? Let's start by setting up our sandbox accordingly: + +``` +echo "Hello!" >greeting.txt +git add greeting.txt +git commit -m"Add greeting.txt" + +echo "Goodbye world!" >farewell.txt +git add farewell.txt +git commit -m"Add farewell.txt" +``` + +Looks like `greeting.txt` is missing "world". Let's write a commit normally which fixes that: + +``` +echo "Hello world!" >greeting.txt +git commit -a -m"fixup greeting.txt" +``` + +So now the files look correct, but our history could be better - let's use the new commit to "fixup" the last one. For this, we need to introduce a new tool: the interactive rebase. We're going to edit the last three commits this way, so we'll run `git rebase -i HEAD~3` (`-i` for interactive). This'll open your text editor with something like this: + +``` +pick 8d3fc77 Add greeting.txt +pick 2a73a77 Add farewell.txt +pick 0b9d0bb fixup greeting.txt + +# Rebase f5f19fb..0b9d0bb onto f5f19fb (3 commands) +# +# Commands: +# p, pick = use commit +# f, fixup = like "squash", but discard this commit's log message +``` + +This is the rebase plan, and by editing this file you can instruct git on how to edit history. I've trimmed the summary to just the details relevant to this part of the rebase guide, but feel free to skim the full summary in your text editor. + +When we save and close our editor, git is going to remove all of these commits from its history, then execute each line one at a time. By default, it's going to pick each commit, summoning it from the heap and adding it to the branch. If we don't edit this file at all, we'll end up right back where we started, picking every commit as-is. We're going to use one of my favorite features now: fixup. Edit the third line to change the operation from "pick" to "fixup" and move it to immediately after the commit we want to "fix up": + +``` +pick 8d3fc77 Add greeting.txt +fixup 0b9d0bb fixup greeting.txt +pick 2a73a77 Add farewell.txt +``` + +**Tip** : We can also abbreviate this with just "f" to speed things up next time. + +Save and quit your editor - git will run these commands. We can check the log to verify the result: + +``` +$ git log -2 --oneline +fcff6ae (HEAD -> master) Add farewell.txt +a479e94 Add greeting.txt +``` + +### Squashing several commits into one + +As you work, you may find it useful to write lots of commits as you reach small milestones or fix bugs in previous commits. However, it may be useful to "squash" these commits together, to make a cleaner history before merging your work into master. For this, we'll use the "squash" operation. Let's start by writing a bunch of commits - just copy and paste this if you want to speed it up: + +``` +git checkout -b squash +for c in H e l l o , ' ' w o r l d; do + echo "$c" >>squash.txt + git add squash.txt + git commit -m"Add '$c' to squash.txt" +done +``` + +That's a lot of commits to make a file that says "Hello, world"! Let's start another interactive rebase to squash them together. Note that we checked out a branch to try this on, first. Because of that, we can quickly rebase all of the commits since we branched by using `git rebase -i master`. The result: + +``` +pick 1e85199 Add 'H' to squash.txt +pick fff6631 Add 'e' to squash.txt +pick b354c74 Add 'l' to squash.txt +pick 04aaf74 Add 'l' to squash.txt +pick 9b0f720 Add 'o' to squash.txt +pick 66b114d Add ',' to squash.txt +pick dc158cd Add ' ' to squash.txt +pick dfcf9d6 Add 'w' to squash.txt +pick 7a85f34 Add 'o' to squash.txt +pick c275c27 Add 'r' to squash.txt +pick a513fd1 Add 'l' to squash.txt +pick 6b608ae Add 'd' to squash.txt + +# Rebase 1af1b46..6b608ae onto 1af1b46 (12 commands) +# +# Commands: +# p, pick = use commit +# s, squash = use commit, but meld into previous commit +``` + +**Tip** : your local master branch evolves independently of the remote master branch, and git stores the remote branch as `origin/master`. Combined with this trick, `git rebase -i origin/master` is often a very convenient way to rebase all of the commits which haven't been merged upstream yet! + +We're going to squash all of these changes into the first commit. To do this, change every "pick" operation to "squash", except for the first line, like so: + +``` +pick 1e85199 Add 'H' to squash.txt +squash fff6631 Add 'e' to squash.txt +squash b354c74 Add 'l' to squash.txt +squash 04aaf74 Add 'l' to squash.txt +squash 9b0f720 Add 'o' to squash.txt +squash 66b114d Add ',' to squash.txt +squash dc158cd Add ' ' to squash.txt +squash dfcf9d6 Add 'w' to squash.txt +squash 7a85f34 Add 'o' to squash.txt +squash c275c27 Add 'r' to squash.txt +squash a513fd1 Add 'l' to squash.txt +squash 6b608ae Add 'd' to squash.txt +``` + +When you save and close your editor, git will think about this for a moment, then open your editor again to revise the final commit message. You'll see something like this: + +``` +# This is a combination of 12 commits. +# This is the 1st commit message: + +Add 'H' to squash.txt + +# This is the commit message #2: + +Add 'e' to squash.txt + +# This is the commit message #3: + +Add 'l' to squash.txt + +# This is the commit message #4: + +Add 'l' to squash.txt + +# This is the commit message #5: + +Add 'o' to squash.txt + +# This is the commit message #6: + +Add ',' to squash.txt + +# This is the commit message #7: + +Add ' ' to squash.txt + +# This is the commit message #8: + +Add 'w' to squash.txt + +# This is the commit message #9: + +Add 'o' to squash.txt + +# This is the commit message #10: + +Add 'r' to squash.txt + +# This is the commit message #11: + +Add 'l' to squash.txt + +# This is the commit message #12: + +Add 'd' to squash.txt + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# Date: Sun Apr 28 14:21:56 2019 -0400 +# +# interactive rebase in progress; onto 1af1b46 +# Last commands done (12 commands done): +# squash a513fd1 Add 'l' to squash.txt +# squash 6b608ae Add 'd' to squash.txt +# No commands remaining. +# You are currently rebasing branch 'squash' on '1af1b46'. +# +# Changes to be committed: +# new file: squash.txt +# +``` + +This defaults to a combination of all of the commit messages which were squashed, but leaving it like this is almost always not what you want. The old commit messages may be useful for reference when writing the new one, though. + +**Tip** : the "fixup" command you learned about in the previous section can be used for this purpose, too - but it discards the messages of the squashed commits. + +Let's delete everything and replace it with a better commit message, like this: + +``` +Add squash.txt with contents "Hello, world" + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# Date: Sun Apr 28 14:21:56 2019 -0400 +# +# interactive rebase in progress; onto 1af1b46 +# Last commands done (12 commands done): +# squash a513fd1 Add 'l' to squash.txt +# squash 6b608ae Add 'd' to squash.txt +# No commands remaining. +# You are currently rebasing branch 'squash' on '1af1b46'. +# +# Changes to be committed: +# new file: squash.txt +# +``` + +Save and quit your editor, then examine your git log - success! + +``` +commit c785f476c7dff76f21ce2cad7c51cf2af00a44b6 (HEAD -> squash) +Author: Drew DeVault +Date: Sun Apr 28 14:21:56 2019 -0400 + + Add squash.txt with contents "Hello, world" +``` + +Before we move on, let's pull our changes into the master branch and get rid of this scratch one. We can use `git rebase` like we use `git merge`, but it avoids making a merge commit: + +``` +git checkout master +git rebase squash +git branch -D squash +``` + +We generally prefer to avoid using git merge unless we're actually merging unrelated histories. If you have two divergent branches, a git merge is useful to have a record of when they were... merged. In the course of your normal work, rebase is often more appropriate. + +### Splitting one commit into several + +Sometimes the opposite problem happens - one commit is just too big. Let's look into splitting it up. This time, let's write some actual code. Start with a simple C program2 (you can still copy+paste this snippet into your shell to do this quickly): + +``` +cat <main.c +int main(int argc, char *argv[]) { + return 0; +} +EOF +``` + +We'll commit this first. + +``` +git add main.c +git commit -m"Add C program skeleton" +``` + +Next, let's extend the program a bit: + +``` +cat <main.c +#include <stdio.h> + +const char *get_name() { + static char buf[128]; + scanf("%s", buf); + return buf; +} + +int main(int argc, char *argv[]) { + printf("What's your name? "); + const char *name = get_name(); + printf("Hello, %s!\n", name); + return 0; +} +EOF +``` + +After we commit this, we'll be ready to learn how to split it up. + +``` +git commit -a -m"Flesh out C program" +``` + +The first step is to start an interactive rebase. Let's rebase both commits with `git rebase -i HEAD~2`, giving us this rebase plan: + +``` +pick 237b246 Add C program skeleton +pick b3f188b Flesh out C program + +# Rebase c785f47..b3f188b onto c785f47 (2 commands) +# +# Commands: +# p, pick = use commit +# e, edit = use commit, but stop for amending +``` + +Change the second commit's command from "pick" to "edit", then save and close your editor. Git will think about this for a second, then present you with this: + +``` +Stopped at b3f188b... Flesh out C program +You can amend the commit now, with + + git commit --amend + +Once you are satisfied with your changes, run + + git rebase --continue +``` + +We could follow these instructions to add new changes to the commit, but instead let's do a "soft reset"3 by running `git reset HEAD^`. If you run `git status` after this, you'll see that it un-commits the latest commit and adds its changes to the working tree: + +``` +Last commands done (2 commands done): + pick 237b246 Add C program skeleton + edit b3f188b Flesh out C program +No commands remaining. +You are currently splitting a commit while rebasing branch 'master' on 'c785f47'. + (Once your working directory is clean, run "git rebase --continue") + +Changes not staged for commit: + (use "git add ..." to update what will be committed) + (use "git checkout -- ..." to discard changes in working directory) + + modified: main.c + +no changes added to commit (use "git add" and/or "git commit -a") +``` + +To split this up, we're going to do an interactive commit. This allows us to selectively commit only specific changes from the working tree. Run `git commit -p` to start this process, and you'll be presented with the following prompt: + +``` +diff --git a/main.c b/main.c +index b1d9c2c..3463610 100644 +--- a/main.c ++++ b/main.c +@@ -1,3 +1,14 @@ ++#include <stdio.h> ++ ++const char *get_name() { ++ static char buf[128]; ++ scanf("%s", buf); ++ return buf; ++} ++ + int main(int argc, char *argv[]) { ++ printf("What's your name? "); ++ const char *name = get_name(); ++ printf("Hello, %s!\n", name); + return 0; + } +Stage this hunk [y,n,q,a,d,s,e,?]? +``` + +Git has presented you with just one "hunk" (i.e. a single change) to consider committing. This one is too big, though - let's use the "s" command to "split" up the hunk into smaller parts. + +``` +Split into 2 hunks. +@@ -1 +1,9 @@ ++#include ++ ++const char *get_name() { ++ static char buf[128]; ++ scanf("%s", buf); ++ return buf; ++} ++ + int main(int argc, char *argv[]) { +Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? +``` + +**Tip** : If you're curious about the other options, press "?" to summarize them. + +This hunk looks better - a single, self-contained change. Let's hit "y" to answer the question (and stage that "hunk"), then "q" to "quit" the interactive session and proceed with the commit. Your editor will pop up to ask you to enter a suitable commit message. + +``` +Add get_name function to C program + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# interactive rebase in progress; onto c785f47 +# Last commands done (2 commands done): +# pick 237b246 Add C program skeleton +# edit b3f188b Flesh out C program +# No commands remaining. +# You are currently splitting a commit while rebasing branch 'master' on 'c785f47'. +# +# Changes to be committed: +# modified: main.c +# +# Changes not staged for commit: +# modified: main.c +# +``` + +Save and close your editor, then we'll make the second commit. We could do another interactive commit, but since we just want to include the rest of the changes in this commit we'll just do this: + +``` +git commit -a -m"Prompt user for their name" +git rebase --continue +``` + +That last command tells git that we're done editing this commit, and to continue to the next rebase command. That's it! Run `git log` to see the fruits of your labor: + +``` +$ git log -3 --oneline +fe19cc3 (HEAD -> master) Prompt user for their name +659a489 Add get_name function to C program +237b246 Add C program skeleton +``` + +### Reordering commits + +This one is pretty easy. Let's start by setting up our sandbox: + +``` +echo "Goodbye now!" >farewell.txt +git add farewell.txt +git commit -m"Add farewell.txt" + +echo "Hello there!" >greeting.txt +git add greeting.txt +git commit -m"Add greeting.txt" + +echo "How're you doing?" >inquiry.txt +git add inquiry.txt +git commit -m"Add inquiry.txt" +``` + +The git log should now look like this: + +``` +f03baa5 (HEAD -> master) Add inquiry.txt +a4cebf7 Add greeting.txt +90bb015 Add farewell.txt +``` + +Clearly, this is all out of order. Let's do an interactive rebase of the past 3 commits to resolve this. Run `git rebase -i HEAD~3` and this rebase plan will appear: + +``` +pick 90bb015 Add farewell.txt +pick a4cebf7 Add greeting.txt +pick f03baa5 Add inquiry.txt + +# Rebase fe19cc3..f03baa5 onto fe19cc3 (3 commands) +# +# Commands: +# p, pick = use commit +# +# These lines can be re-ordered; they are executed from top to bottom. +``` + +The fix is now straightforward: just reorder these lines in the order you wish for the commits to appear. Should look something like this: + +``` +pick a4cebf7 Add greeting.txt +pick f03baa5 Add inquiry.txt +pick 90bb015 Add farewell.txt +``` + +Save and close your editor and git will do the rest for you. Note that it's possible to end up with conflicts when you do this in practice - click here for help resolving conflicts. + +### git pull --rebase + +If you've been writing some commits on a branch which has been updated upstream, normally `git pull` will create a merge commit. In this respect, `git pull`'s behavior by default is equivalent to: + +``` +git fetch origin +git merge origin/master +``` + +There's another option, which is often more useful and leads to a much cleaner history: `git pull --rebase`. Unlike the merge approach, this is equivalent to the following: + +``` +git fetch origin +git rebase origin/master +``` + +The merge approach is simpler and easier to understand, but the rebase approach is almost always what you want to do if you understand how to use git rebase. If you like, you can set it as the default behavior like so: + +``` +git config --global pull.rebase true +``` + +When you do this, technically you're applying the procedure we discuss in the next section... so let's explain what it means to do that deliberately, too. + +### Using git rebase to... rebase + +Ironically, the feature of git rebase that I use the least is the one it's named for: rebasing branches. Say you have the following branches: + +``` +o--o--o--o--> master + \--o--o--> feature-1 + \--o--> feature-2 +``` + +It turns out feature-2 doesn't depend on any of the changes in feature-1, so you can just base it off of master. The fix is thus: + +``` +git checkout feature-2 +git rebase master +``` + +The non-interactive rebase does the default operation for all implicated commits ("pick")4, which simply rolls your history back to the last common anscestor and replays the commits from both branches. Your history now looks like this: + +``` +o--o--o--o--> master + | \--o--> feature-2 + \--o--o--> feature-1 +``` + +### Resolving conflicts + +The details on resolving merge conflicts are beyond the scope of this guide - keep your eye out for another guide for this in the future. Assuming you're familiar with resolving conflicts in general, here are the specifics that apply to rebasing. + +The details on resolving merge conflicts are beyond the scope of this guide - keep your eye out for another guide for this in the future. Assuming you're familiar with resolving conflicts in general, here are the specifics that apply to rebasing. + +Sometimes you'll get a merge conflict when doing a rebase, which you can handle just like any other merge conflict. Git will set up the conflict markers in the affected files, `git status` will show you what you need to resolve, and you can mark files as resolved with `git add` or `git rm`. However, in the context of a git rebase, there are two options you should be aware of. + +The first is how you complete the conflict resolution. Rather than `git commit` like you'll use when addressing conflicts that arise from `git merge`, the appropriate command for rebasing is `git rebase --continue`. However, there's another option available to you: `git rebase --skip`. This will skip the commit you're working on, and it won't be included in the rebase. This is most common when doing a non-interactive rebase, when git doesn't realize that a commit it's pulled from the "other" branch is an updated version of the commit that it conflicts with on "our" branch. + +### Help! I broke it! + +No doubt about it - rebasing can be hard sometimes. If you've made a mistake and in so doing lost commits which you needed, then `git reflog` is here to save the day. Running this command will show you every operation which changed a ref, or reference - that is, branches and tags. Each line shows you what the old reference pointed to, and you can `git cherry-pick`, `git checkout`, `git show`, or use any other operation on git commits once thought lost. + + +-------------------------------------------------------------------------------- + +via: https://git-rebase.io/ + +作者:[git-rebase][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://git-rebase.io/ +[b]: https://github.com/lujun9972 From cd541ea90108fa083bbe55721d87b7cfacc0acd5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 22:07:32 +0800 Subject: [PATCH 0453/1154] PRF:20171215 How to add a player to your Python game.md @cycoe --- ...How to add a player to your Python game.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/translated/tech/20171215 How to add a player to your Python game.md b/translated/tech/20171215 How to add a player to your Python game.md index c46d4a5826..150c8c6325 100644 --- a/translated/tech/20171215 How to add a player to your Python game.md +++ b/translated/tech/20171215 How to add a player to your Python game.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to add a player to your Python game) @@ -9,12 +9,13 @@ 如何在你的 Python 游戏中添加一个玩家 ====== -用 Python 从头开始构建游戏的系列文章的第三部分。 +> 这是用 Python 从头开始构建游戏的系列文章的第三部分。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python3-game.png?itok=jG9UdwC3) 在 [这个系列的第一篇文章][1] 中,我解释了如何使用 Python 创建一个简单的基于文本的骰子游戏。在第二部分中,我向你们展示了如何从头开始构建游戏,即从 [创建游戏的环境][2] 开始。但是每个游戏都需要一名玩家,并且每个玩家都需要一个可操控的角色,这也就是我们接下来要在这个系列的第三部分中需要做的。 -在 Pygame 中,玩家操控的图标或者化身被称作妖精。如果你现在还没有任何图像可用于玩家妖精,你可以使用 [Krita][3] 或 [Inkscape][4] 来自己创建一些图像。如果你对自己的艺术细胞缺乏自信,你也可以在 [OpenClipArt.org][5] 或 [OpenGameArt.org][6] 搜索一些现成的图像。如果你还未按照上一篇文章所说的单独创建一个 images 文件夹,那么你需要在你的 Python 项目目录中创建它。将你想要在游戏中使用的图片都放 images 文件夹中。 +在 Pygame 中,玩家操控的图标或者化身被称作妖精sprite。如果你现在还没有任何可用于玩家妖精的图像,你可以使用 [Krita][3] 或 [Inkscape][4] 来自己创建一些图像。如果你对自己的艺术细胞缺乏自信,你也可以在 [OpenClipArt.org][5] 或 [OpenGameArt.org][6] 搜索一些现成的图像。如果你还未按照上一篇文章所说的单独创建一个 `images` 文件夹,那么你需要在你的 Python 项目目录中创建它。将你想要在游戏中使用的图片都放 `images` 文件夹中。 为了使你的游戏真正的刺激,你应该为你的英雄使用一张动态的妖精图片。这意味着你需要绘制更多的素材,并且它们要大不相同。最常见的动画就是走路循环,通过一系列的图像让你的妖精看起来像是在走路。走路循环最快捷粗糙的版本需要四张图像。 @@ -73,7 +74,7 @@ class Player(pygame.sprite.Sprite): ### 将玩家带入游戏世界 -现在一个 Player 类已经创建好了,你需要使用它在你的游戏世界中生成一个玩家妖精。如果你不调用 Player 类,那它永远不会起作用,(游戏世界中)也就不会有玩家。你可以通过立马运行你的游戏来验证一下。游戏会像上一篇文章末尾看到的那样运行,并得到明确的结果:一个空荡荡的游戏世界。 +现在已经创建好了一个 Player 类,你需要使用它在你的游戏世界中生成一个玩家妖精。如果你不调用 Player 类,那它永远不会起作用,(游戏世界中)也就不会有玩家。你可以通过立马运行你的游戏来验证一下。游戏会像上一篇文章末尾看到的那样运行,并得到明确的结果:一个空荡荡的游戏世界。 为了将一个玩家妖精带到你的游戏世界,你必须通过调用 Player 类来生成一个妖精,并将它加入到 Pygame 的妖精组中。在如下的代码示例中,前三行是已经存在的代码,你需要在其后添加代码: @@ -106,11 +107,11 @@ player_list.add(player) ### 设置 alpha 通道 -根据你如何创建你的玩家妖精,在它周围可能会有一个色块。你所看到的是 alpha 通道应该占据的空间。它本来是不可见的“颜色”,但 Python 现在还不知道要使它不可见。那么你所看到的,是围绕在妖精周围的边界区(或现代游戏术语中的“命中区”)内的空间。 +根据你如何创建你的玩家妖精,在它周围可能会有一个色块。你所看到的是 alpha 通道应该占据的空间。它本来是不可见的“颜色”,但 Python 现在还不知道要使它不可见。那么你所看到的,是围绕在妖精周围的边界区(或现代游戏术语中的“命中区hit box”)内的空间。 ![](https://opensource.com/sites/default/files/u128651/greenscreen.jpg) -你可以通过设置一个 alpha 通道和 RGB 值来告诉 Python 使哪种颜色不可见。如果你不知道你使用 alpha 通道的图像的 RGB 值,你可以使用 Krita 或 Inkscape 打开它,并使用一种独特的颜色,比如 #00ff00(差不多是“绿屏绿”)来填充图像周围的空白区域。记下颜色对应的十六进制值(此处为 #00ff00,绿屏绿)并将其作为 alpha 通道用于你的 Python 脚本。 +你可以通过设置一个 alpha 通道和 RGB 值来告诉 Python 使哪种颜色不可见。如果你不知道你使用 alpha 通道的图像的 RGB 值,你可以使用 Krita 或 Inkscape 打开它,并使用一种独特的颜色,比如 `#00ff00`(差不多是“绿屏绿”)来填充图像周围的空白区域。记下颜色对应的十六进制值(此处为 `#00ff00`,绿屏绿)并将其作为 alpha 通道用于你的 Python 脚本。 使用 alpha 通道需要在你的妖精生成相关代码中添加如下两行。类似第一行的代码已经存在于你的脚本中,你只需要添加另外两行: @@ -126,11 +127,11 @@ player_list.add(player) ALPHA = (0, 255, 0) ``` -在以上示例代码中,**0,255,0** 被我们使用,它在 RGB 中所代表的值与 #00ff00 在十六进制中所代表的值相同。你可以通过一个优秀的图像应用程序,如 [GIMP][7]、Krita 或 Inkscape,来获取所有这些颜色值。或者,你可以使用一个优秀的系统级颜色选择器,如 [KColorChooser][8],来检测颜色。 +在以上示例代码中,`0,255,0` 被我们使用,它在 RGB 中所代表的值与 `#00ff00` 在十六进制中所代表的值相同。你可以通过一个优秀的图像应用程序,如 [GIMP][7]、Krita 或 Inkscape,来获取所有这些颜色值。或者,你可以使用一个优秀的系统级颜色选择器,如 [KColorChooser][8],来检测颜色。 ![](https://opensource.com/sites/default/files/u128651/kcolor.png) -如果你的图像应用程序将你的妖精背景渲染成了其他的值,你可以按需调整 ``ALPHA`` 变量的值。不论你将 alpha 设为多少,最后它都将“不可见”。RGB 颜色值是非常严格的,因此如果你需要将 alpha 设为 000,但你又想将 000 用于你图像中的黑线,你只需要将图像中线的颜色设为 111。这样一来,(图像中的黑线)就足够接近黑色,但除了电脑以外没有人能看出区别。 +如果你的图像应用程序将你的妖精背景渲染成了其他的值,你可以按需调整 `ALPHA` 变量的值。不论你将 alpha 设为多少,最后它都将“不可见”。RGB 颜色值是非常严格的,因此如果你需要将 alpha 设为 000,但你又想将 000 用于你图像中的黑线,你只需要将图像中线的颜色设为 111。这样一来,(图像中的黑线)就足够接近黑色,但除了电脑以外没有人能看出区别。 运行你的游戏查看结果。 @@ -145,14 +146,14 @@ via: https://opensource.com/article/17/12/game-python-add-a-player 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[cycoe](https://github.com/cycoe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/17/10/python-101 -[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world +[1]: https://linux.cn/article-9071-1.html +[2]: https://linux.cn/article-10850-1.html [3]: http://krita.org [4]: http://inkscape.org [5]: http://openclipart.org From 4d0a5317cc1e652d290115e47bfff52962c25be5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 22:08:52 +0800 Subject: [PATCH 0454/1154] PUB: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @cycoe https://linux.cn/article-10858-1.html 第四篇还没见到~ --- .../20171215 How to add a player to your Python game.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20171215 How to add a player to your Python game.md (99%) diff --git a/translated/tech/20171215 How to add a player to your Python game.md b/published/20171215 How to add a player to your Python game.md similarity index 99% rename from translated/tech/20171215 How to add a player to your Python game.md rename to published/20171215 How to add a player to your Python game.md index 150c8c6325..b313a8219e 100644 --- a/translated/tech/20171215 How to add a player to your Python game.md +++ b/published/20171215 How to add a player to your Python game.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10858-1.html) [#]: subject: (How to add a player to your Python game) [#]: via: (https://opensource.com/article/17/12/game-python-add-a-player) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 5a889b56995b1b655dc8693e1bc9b675d1c325b3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 23:02:45 +0800 Subject: [PATCH 0455/1154] PRF:20190501 Write faster C extensions for Python with Cython.md @geekpi --- ...ter C extensions for Python with Cython.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/translated/tech/20190501 Write faster C extensions for Python with Cython.md b/translated/tech/20190501 Write faster C extensions for Python with Cython.md index cbc2c99d62..8ca4fb072a 100644 --- a/translated/tech/20190501 Write faster C extensions for Python with Cython.md +++ b/translated/tech/20190501 Write faster C extensions for Python with Cython.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Write faster C extensions for Python with Cython) @@ -9,8 +9,10 @@ 使用 Cython 为 Python 编写更快的 C 扩展 ====== -在我们覆盖 7 个 PyPI 库的系列文章中了解解决 Python 问题的更多信息。 -![Hand drawing out the word "code"][1] + +> 在我们这个包含了 7 个 PyPI 库的系列文章中学习解决常见的 Python 问题的方法。 + +![Hand drawing out the word "code"](https://img.linux.net.cn/data/attachment/album/201905/15/225506fnn2mz6l3u122n70.jpg) Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区可以让我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包,用以扩展和改进 Python 并解决不可避免的问题。 @@ -18,12 +20,11 @@ Python 是当今使用最多的[流行编程语言][2]之一,因为:它是 ### Cython -使用 Python 很有趣,但有时,用它编写的程序可能很慢。所有运行时动态调度会带来很大的代价:有时它比用 C 或 Rust 等系统语言编写的等效代码慢10倍。 +使用 Python 很有趣,但有时,用它编写的程序可能很慢。所有的运行时动态调度会带来很大的代价:有时它比用 C 或 Rust 等系统语言编写的等效代码慢 10 倍。 -将代码迁移到一种全新的语言可能会在成本和可靠性方面付出巨大代价:所有手工重写工作都将不可避免地引入错误。我们可以两者兼得么? - -为了练习优化,我们需要一些慢代码。什么比斐波那契数列的意外指数实现更慢? +将代码迁移到一种全新的语言可能会在成本和可靠性方面付出巨大代价:所有的手工重写工作都将不可避免地引入错误。我们可以两者兼得么? +为了练习一下优化,我们需要一些慢代码。有什么比斐波那契数列的意外指数实现更慢? ``` def fib(n): @@ -32,10 +33,9 @@ def fib(n): return fib(n-1) + fib(n-2) ``` -由于对 **fib** 的调用会导致两次调用,因此这种效率极低的算法需要很长时间才能执行。例如,在我的新笔记本电脑上,**fib(36)** 需要大约 4.5 秒。这个 4.5 秒会成为我们探索 Python 的 Cython 扩展能提供的帮助的基准。 - -使用 Cython 的正确方法是将其集成到 **setup.py** 中。然而,使用 **pyximport** 可以快速地进行尝试。让我们将 **fib** 代码放在 **fib.pyx** 中并使用 Cython 运行它。 +由于对 `fib` 的调用会导致两次再次调用,因此这种效率极低的算法需要很长时间才能执行。例如,在我的新笔记本电脑上,`fib(36)` 需要大约 4.5 秒。这个 4.5 秒会成为我们探索 Python 的 Cython 扩展能提供的帮助的基准。 +使用 Cython 的正确方法是将其集成到 `setup.py` 中。然而,使用 `pyximport` 可以快速地进行尝试。让我们将 `fib` 代码放在 `fib.pyx` 中并使用 Cython 运行它。 ``` >>> import pyximport; pyximport.install() @@ -43,11 +43,10 @@ def fib(n): >>> fib.fib(36) ``` -只使用 Cython 不_修改_代码,这个算法在我笔记本上花费的时间减少到大约 2.5 秒。几乎无需任何努力,这几乎减少了 50% 的运行时间。当然,得到了一个不错的成果。 +只使用 Cython 而不*修改*代码,这个算法在我笔记本上花费的时间减少到大约 2.5 秒。几乎无需任何努力,这几乎减少了 50% 的运行时间。当然,得到了一个不错的成果。 加把劲,我们可以让它变得更快。 - ``` cpdef int fib(int n): if n < 2: @@ -55,22 +54,22 @@ cpdef int fib(int n): return fib(n - 1) + fib(n - 2) ``` -我们将 **fib** 中的代码变成用 **cpdef** 定义的函数,并添加了几个类型注释:它接受一个整数并返回一个整数。 +我们将 `fib` 中的代码变成用 `cpdef` 定义的函数,并添加了两个类型注释:它接受一个整数并返回一个整数。 -这个变得快_多_了,大约 0.05 秒。它是如此之快以至于我可能开始怀疑我的测量方法包含噪声:之前,这种噪声在信号中丢失了。 +这个变得快*多*了,大约只用了 0.05 秒。它是如此之快,以至于我可能开始怀疑我的测量方法包含噪声:之前,这种噪声在信号中丢失了。 -当下次你的 Python 代码花费太多 CPU 时间时,也许在这个过程中会让一些粉丝蠢蠢欲动,为何不看看 Cython 是否可以解决问题呢? +当下次你的 Python 代码花费太多 CPU 时间时,也许会导致风扇狂转,为何不看看 Cython 是否可以解决问题呢? -在本系列的下一篇文章中,我们将看一下 **Black** ,一个自动纠正代码格式错误的项目。 +在本系列的下一篇文章中,我们将看一下 Black,一个自动纠正代码格式错误的项目。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/5/python-cython -作者:[Moshe Zadka ][a] +作者:[Moshe Zadka][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/) 荣誉推出 From 4c813ece7432eb6fd5aa56ac61e3694d7a532ee2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 23:03:36 +0800 Subject: [PATCH 0456/1154] PUB:20190501 Write faster C extensions for Python with Cython.md @geekpi https://linux.cn/article-10859-1.html --- ...190501 Write faster C extensions for Python with Cython.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190501 Write faster C extensions for Python with Cython.md (98%) diff --git a/translated/tech/20190501 Write faster C extensions for Python with Cython.md b/published/20190501 Write faster C extensions for Python with Cython.md similarity index 98% rename from translated/tech/20190501 Write faster C extensions for Python with Cython.md rename to published/20190501 Write faster C extensions for Python with Cython.md index 8ca4fb072a..b3ff2f0edd 100644 --- a/translated/tech/20190501 Write faster C extensions for Python with Cython.md +++ b/published/20190501 Write faster C extensions for Python with Cython.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10859-1.html) [#]: subject: (Write faster C extensions for Python with Cython) [#]: via: (https://opensource.com/article/19/5/python-cython) [#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00) From cdc1cf11b6f7a012301ffa1fee1bdc9ef502acf4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 23:41:51 +0800 Subject: [PATCH 0457/1154] PRF:20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @wxy --- ...ols for Hacking and Penetration Testing.md | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md index 7204ae575e..25b8c3fe12 100644 --- a/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md +++ b/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) @@ -10,9 +10,9 @@ 用于黑客渗透测试的 21 个最佳 Kali Linux 工具 ====== -> 最好的 Kali Linux 工具列表,它们可以让你评估 Web 服务器的安全性,并帮助你执行黑客和渗透测试。 +> 这里是最好的 Kali Linux 工具列表,它们可以让你评估 Web 服务器的安全性,并帮助你执行黑客渗透测试。 -如果你读过 [Kali Linux 点评][1],你就知道为什么它被认为是[最好的黑客渗透测试的 Linux 发行版][2]之一,而且正如其实。它带有许多工具,使你可以更轻松地进行测试、破解以及与数字取证相关的任何其他工作。 +如果你读过 [Kali Linux 点评][1],你就知道为什么它被认为是[最好的黑客渗透测试的 Linux 发行版][2]之一,而且名副其实。它带有许多工具,使你可以更轻松地测试、破解以及进行与数字取证相关的任何其他工作。 它是道德黑客ethical hacker最推荐的 Linux 发行版之一。即使你不是黑客而是网站管理员 —— 你仍然可以利用其中某些工具轻松地扫描你的网络服务器或网页。 @@ -22,7 +22,7 @@ ### 用于黑客渗透测试的 Kali Linux 工具 -![Kali Linux][3] +![Kali Linux](https://img.linux.net.cn/data/attachment/album/201905/15/234125c22rx77mmz9m37zo.jpg) Kali Linux 预装了几种类型的工具。如果你发现有的工具没有安装,只需下载并进行设置即可。这很简单。 @@ -30,7 +30,7 @@ Kali Linux 预装了几种类型的工具。如果你发现有的工具没有安 ![Kali Linux Nmap][4] -[Nmap][5] (即 “网络映射器Network Mapper”)是 Kali Linux 上最受欢迎的信息收集工具之一。换句话说,它可以获取有关主机的信息:其 IP 地址、操作系统检测以及类似网络安全详细信息(如开放的端口数量及其含义)。 +[Nmap][5] (即 “网络映射器Network Mapper”)是 Kali Linux 上最受欢迎的信息收集工具之一。换句话说,它可以获取有关主机的信息:其 IP 地址、操作系统检测以及网络安全的详细信息(如开放的端口数量及其含义)。 它还提供防火墙规避和欺骗功能。 @@ -50,21 +50,21 @@ WordPress 是[最好的开源 CMS][9]之一,而这个工具是最好的免费 如果你想知道一个 WordPress 博客是否在某种程度上容易受到攻击,[WPScan][10] 就是你的朋友。 -此外,它还为你提供了所用的插件的详细信息。当然,一个安全性很好的博客可能不会给你很多细节,但它仍然是 WordPress 安全扫描找到潜在漏洞的最佳工具。 +此外,它还为你提供了所用的插件的详细信息。当然,一个安全性很好的博客可能不会暴露给你很多细节,但它仍然是 WordPress 安全扫描找到潜在漏洞的最佳工具。 #### 4、Aircrack-ng ![][11] -[Aircrack-ng][12] 是评估 WiFi 网络安全性的工具集合。它不仅限于监控和获取洞察力 —— 还包括破坏网络(WEP、WPA 1 和 WPA 2)的能力。 +[Aircrack-ng][12] 是评估 WiFi 网络安全性的工具集合。它不仅限于监控和获取信息 —— 还包括破坏网络(WEP、WPA 1 和 WPA 2)的能力。 -如果你忘记了自己的 WiFi 网络的密码,可以尝试使用它来重新获得访问权限。它还包括各种无线攻击,你可以使用它们来定位/监控 WiFi 网络以增强其安全性。 +如果你忘记了自己的 WiFi 网络的密码,可以尝试使用它来重新获得访问权限。它还包括各种无线攻击能力,你可以使用它们来定位和监控 WiFi 网络以增强其安全性。 #### 5、Hydra ![][13] -如果你正在寻找一个有趣的工具来破解登录密码时,[Hydra][14] 将是 Kali Linux 预装的最好的工具之一。 +如果你正在寻找一个有趣的工具来破解登录密码,[Hydra][14] 将是 Kali Linux 预装的最好的工具之一。 它可能不再被积极维护,但它现在放在 [GitHub][15] 上,所以你也可以为它做贡献。 @@ -72,24 +72,23 @@ WordPress 是[最好的开源 CMS][9]之一,而这个工具是最好的免费 ![][17] -[Wireshark][18] 是 Kali Linux 最受欢迎的网络分析仪。它也可以归类为用于网络嗅探的最佳 Kali Linux 工具之一。 +[Wireshark][18] 是 Kali Linux 上最受欢迎的网络分析仪。它也可以归类为用于网络嗅探的最佳 Kali Linux 工具之一。 -它正在积极维护,所以我肯定会建议试试它。 +它正在积极维护,所以我肯定会建议你试试它。 #### 7、Metasploit Framework ![][19] -[Metsploit Framework][20](MSF)是最常用的渗透测试框架。它提供两个版本:一个开源,第二个是其专业版。使用此工具,你可以验证漏洞、测试已知漏洞并执行完整的安全评估。 - -当然,免费版本不具备所有功能,所以如果你对此很认真,你应该在[这里][21]比较一下版本。 +[Metsploit Framework][20](MSF)是最常用的渗透测试框架。它提供两个版本:一个开源版,另外一个是其专业版。使用此工具,你可以验证漏洞、测试已知漏洞并执行完整的安全评估。 +当然,免费版本不具备所有功能,所以如果你在意它们的区别,你应该在[这里][21]比较一下版本。 #### 8、Skipfish ![][22] -与 WPScan 类似,但不仅仅专注于 WordPress。[Skipfish][23] 是一个 Web 应用扫描程序,可以为你提供几乎所有类型的 Web 应用程序的洞察信息。它快速且易于使用。此外,它的递归爬行方法使它更好。 +与 WPScan 类似,但它不仅仅专注于 WordPress。[Skipfish][23] 是一个 Web 应用扫描程序,可以为你提供几乎所有类型的 Web 应用程序的洞察信息。它快速且易于使用。此外,它的递归爬取方法使它更好用。 Skipfish 生成的报告可以用于专业的 Web 应用程序安全评估。 @@ -101,23 +100,23 @@ Skipfish 生成的报告可以用于专业的 Web 应用程序安全评估。 请注意,这不是一个开源工具。 -它已预先安装,但你必须注册才能选择要使用的版本。如果个人使用,社区版就足够了(只需要注册一个帐户),但如果想用于商业用途,则需要订阅 classic 或 XL 版本。 +它已预装,但你必须注册才能选择要使用的版本。如果个人使用,社区版就足够了(只需要注册一个帐户),但如果想用于商业用途,则需要订阅 classic 或 XL 版本。 #### 10、Nessus ![Nessus][26] -如果你有个连接到网络的计算机,Nessus 可以帮助你找到潜在攻击者可能利用的漏洞。当然,如果你是连接到网络的多台计算机的管理员,则可以使用它并保护这些计算机。 +如果你的计算机连接到了网络,Nessus 可以帮助你找到潜在攻击者可能利用的漏洞。当然,如果你是多台连接到网络的计算机的管理员,则可以使用它并保护这些计算机。 -但是,它不再是免费的工具了,你可以从 [官方网站][27] 免费试用 7 天。 +但是,它不再是免费的工具了,你可以从[官方网站][27]免费试用 7 天。 #### 11、Burp Suite Scanner ![][28] -[Burp Suite Scanner][29] 是一款出色的网络安全分析工具。与其他 Web 应用程序安全扫描程序不同,Burp 提供了 GUI 和一些高级工具。 +[Burp Suite Scanner][29] 是一款出色的网络安全分析工具。与其它 Web 应用程序安全扫描程序不同,Burp 提供了 GUI 和一些高级工具。 -但是,社区版仅将功能限制为一些基本的手动工具。对于专业人士,你必须考虑升级。与前面的工具类似,这也不是开源的。 +社区版仅将功能限制为一些基本的手动工具。对于专业人士,你必须考虑升级。与前面的工具类似,这也不是开源的。 我使用过免费版本,但是如果你想了解更多细节,你应该查看他们[官方网站][29]上提供的功能。 @@ -127,7 +126,7 @@ Skipfish 生成的报告可以用于专业的 Web 应用程序安全评估。 BeEF(浏览器利用框架Browser Exploitation Framework)是另一个令人印象深刻的工具。它专为渗透测试人员量身定制,用于评估 Web 浏览器的安全性。 -这是最好的 Kali Linux 工具之一,因为很多用户在谈论 Web 安全时确实想知道并修复客户端问题。 +这是最好的 Kali Linux 工具之一,因为很多用户在谈论 Web 安全时希望了解并修复客户端的问题。 #### 13、Apktool @@ -151,7 +150,7 @@ BeEF(浏览器利用框架Browser Exploitation Framework #### 16、Snort -想要实时流量分析和数据包记录功能吗?[Snort][39] 鼎力支持你。即使它是一个开源的入侵防御系统,也有很多东西可以提供。 +想要实时流量分析和数据包记录功能吗?[Snort][39] 可以鼎力支持你。即使它是一个开源的入侵防御系统,也有很多东西可以提供。 如果你还没有安装它,[官方网站][40]提及了安装过程。 @@ -173,13 +172,13 @@ BeEF(浏览器利用框架Browser Exploitation Framework ![Nikto][47] -[Nikto][48] 是一款功能强大的 Web 服务器扫描程序 —— 使其成为最好的 Kali Linux 工具之一。 它会检查存在潜在危险的文件/程序、过时的服务器版本等等。 +[Nikto][48] 是一款功能强大的 Web 服务器扫描程序 —— 这使其成为最好的 Kali Linux 工具之一。 它会检查存在潜在危险的文件/程序、过时的服务器版本等等。 #### 20、Yersinia ![][49] -[Yersinia][50] 是一个有趣的框架,用于在网络上执行第 2 层攻击(第 2 层是指 [OSI 模型][51]的数据链路层)。当然,如果你希望网络安全,则必须考虑所有七个层。但是,此工具侧重于第 2 层和各种网络协议,包括 STP、CDP,DTP等。 +[Yersinia][50] 是一个有趣的框架,用于在网络上执行第 2 层攻击(第 2 层是指 [OSI 模型][51]的数据链路层)。当然,如果你希望你的网络安全,则必须考虑所有七个层。但是,此工具侧重于第 2 层和各种网络协议,包括 STP、CDP,DTP 等。 #### 21、Social Engineering Toolkit (SET) @@ -202,7 +201,7 @@ via: https://itsfoss.com/best-kali-linux-tools/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 85072931035bacc515a3217e0757bdd4a68cc3b1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 May 2019 23:43:31 +0800 Subject: [PATCH 0458/1154] PUB:20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @wxy https://linux.cn/article-10860-1.html --- ...st Kali Linux Tools for Hacking and Penetration Testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md (99%) diff --git a/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/published/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md similarity index 99% rename from translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md rename to published/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md index 25b8c3fe12..f3ac78e47a 100644 --- a/translated/tech/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md +++ b/published/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10860-1.html) [#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) [#]: via: (https://itsfoss.com/best-kali-linux-tools/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From c16179066c421e78a4a69cdc7ebe630ab5964023 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 16 May 2019 08:56:17 +0800 Subject: [PATCH 0459/1154] translated --- ...utomate backups with restic and systemd.md | 132 ----------------- ...utomate backups with restic and systemd.md | 133 ++++++++++++++++++ 2 files changed, 133 insertions(+), 132 deletions(-) delete mode 100644 sources/tech/20190425 Automate backups with restic and systemd.md create mode 100644 translated/tech/20190425 Automate backups with restic and systemd.md diff --git a/sources/tech/20190425 Automate backups with restic and systemd.md b/sources/tech/20190425 Automate backups with restic and systemd.md deleted file mode 100644 index bc29d39c0d..0000000000 --- a/sources/tech/20190425 Automate backups with restic and systemd.md +++ /dev/null @@ -1,132 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Automate backups with restic and systemd) -[#]: via: (https://fedoramagazine.org/automate-backups-with-restic-and-systemd/) -[#]: author: (Link Dupont https://fedoramagazine.org/author/linkdupont/) - -Automate backups with restic and systemd -====== - -![][1] - -Timely backups are important. So much so that [backing up software][2] is a common topic of discussion, even [here on the Fedora Magazine][3]. This article demonstrates how to automate backups with **restic** using only systemd unit files. - -For an introduction to restic, be sure to check out our article [Use restic on Fedora for encrypted backups][4]. Then read on for more details. - -Two systemd services are required to run in order to automate taking snapshots and keeping data pruned. The first service runs the _backup_ command needs to be run on a regular frequency. The second service takes care of data pruning. - -If you’re not familiar with systemd at all, there’s never been a better time to learn. Check out [the series on systemd here at the Magazine][5], starting with this primer on unit files: - -> [systemd unit file basics][6] - -If you haven’t installed restic already, note it’s in the official Fedora repositories. To install use this command [with sudo][7]: - -``` -$ sudo dnf install restic -``` - -### Backup - -First, create the _~/.config/systemd/user/restic-backup.service_ file. Copy and paste the text below into the file for best results. - -``` -[Unit] -Description=Restic backup service -[Service] -Type=oneshot -ExecStart=restic backup --verbose --one-file-system --tag systemd.timer $BACKUP_EXCLUDES $BACKUP_PATHS -ExecStartPost=restic forget --verbose --tag systemd.timer --group-by "paths,tags" --keep-daily $RETENTION_DAYS --keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS -EnvironmentFile=%h/.config/restic-backup.conf -``` - -This service references an environment file in order to load secrets (such as _RESTIC_PASSWORD_ ). Create the _~/.config/restic-backup.conf_ file. Copy and paste the content below for best results. This example uses BackBlaze B2 buckets. Adjust the ID, key, repository, and password values accordingly. - -``` -BACKUP_PATHS="/home/rupert" -BACKUP_EXCLUDES="--exclude-file /home/rupert/.restic_excludes --exclude-if-present .exclude_from_backup" -RETENTION_DAYS=7 -RETENTION_WEEKS=4 -RETENTION_MONTHS=6 -RETENTION_YEARS=3 -B2_ACCOUNT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX -B2_ACCOUNT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ -RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -``` - -Now that the service is installed, reload systemd: _systemctl –user daemon-reload_. Try running the service manually to create a backup: _systemctl –user start restic-backup_. - -Because the service is a _oneshot_ , it will run once and exit. After verifying that the service runs and creates snapshots as desired, set up a timer to run this service regularly. For example, to run the _restic-backup.service_ daily, create _~/.config/systemd/user/restic-backup.timer_ as follows. Again, copy and paste this text: - -``` -[Unit] -Description=Backup with restic daily -[Timer] -OnCalendar=daily -Persistent=true -[Install] -WantedBy=timers.target -``` - -Enable it by running this command: - -``` -$ systemctl --user enable --now restic-backup.timer -``` - -### Prune - -While the main service runs the _forget_ command to only keep snapshots within the keep policy, the data is not actually removed from the restic repository. The _prune_ command inspects the repository and current snapshots, and deletes any data not associated with a snapshot. Because _prune_ can be a time-consuming process, it is not necessary to run every time a backup is run. This is the perfect scenario for a second service and timer. First, create the file _~/.config/systemd/user/restic-prune.service_ by copying and pasting this text: - -``` -[Unit] -Description=Restic backup service (data pruning) -[Service] -Type=oneshot -ExecStart=restic prune -EnvironmentFile=%h/.config/restic-backup.conf -``` - -Similarly to the main _restic-backup.service_ , _restic-prune_ is a oneshot service and can be run manually. Once the service has been set up, create and enable a corresponding timer at _~/.config/systemd/user/restic-prune.timer_ : - -``` -[Unit] -Description=Prune data from the restic repository monthly -[Timer] -OnCalendar=monthly -Persistent=true -[Install] -WantedBy=timers.target -``` - -That’s it! Restic will now run daily and prune data monthly. - -* * * - -_Photo by _[ _Samuel Zeller_][8]_ on _[_Unsplash_][9]_._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/automate-backups-with-restic-and-systemd/ - -作者:[Link Dupont][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/linkdupont/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/restic-systemd-816x345.jpg -[2]: https://restic.net/ -[3]: https://fedoramagazine.org/?s=backup -[4]: https://fedoramagazine.org/use-restic-encrypted-backups/ -[5]: https://fedoramagazine.org/series/systemd-series/ -[6]: https://fedoramagazine.org/systemd-getting-a-grip-on-units/ -[7]: https://fedoramagazine.org/howto-use-sudo/ -[8]: https://unsplash.com/photos/JuFcQxgCXwA?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[9]: https://unsplash.com/search/photos/archive?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20190425 Automate backups with restic and systemd.md b/translated/tech/20190425 Automate backups with restic and systemd.md new file mode 100644 index 0000000000..f3ac58b09c --- /dev/null +++ b/translated/tech/20190425 Automate backups with restic and systemd.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Automate backups with restic and systemd) +[#]: via: (https://fedoramagazine.org/automate-backups-with-restic-and-systemd/) +[#]: author: (Link Dupont https://fedoramagazine.org/author/linkdupont/) + +使用 restic 和 systemd 自动备份 +====== + +![][1] + +及时备份很重要。即使在 [Fedora Magazine][3] 中,[备份软件][2] 也是一个常见的讨论话题。本文演示了如何仅使用 systemd 以及 **restic** 来自动备份。 + + +有关 restic 的介绍,请查看我们的文章[在 Fedora 上使用 restic 进行加密备份][4]。然后继续阅读以了解更多详情。 + +为了自动创建快照以及清理数据,需要运行两个 systemd 服务。第一个运行_备份_命令的服务需要以常规频率运行。第二个服务负责数据清理。 + +如果你根本不熟悉 systemd,那么这是个很好的学习机会。查看 [Magazine 上关于 systemd 的系列文章] [5],从单元文件的这个入门开始: + +> [systemd 单元文件基础][6] + +如果你还没有安装 restic,请注意它在官方的 Fedora 仓库中。要安装它,请[带上 sudo][7] 运行此命令: + +``` +$ sudo dnf install restic +``` + +### 备份 + +首先,创建 _~/.config/systemd/user/restic-backup.service_。将下面的文本复制并粘贴到文件中以获得最佳效果。 + +``` +[Unit] +Description=Restic backup service +[Service] +Type=oneshot +ExecStart=restic backup --verbose --one-file-system --tag systemd.timer $BACKUP_EXCLUDES $BACKUP_PATHS +ExecStartPost=restic forget --verbose --tag systemd.timer --group-by "paths,tags" --keep-daily $RETENTION_DAYS --keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS +EnvironmentFile=%h/.config/restic-backup.conf +``` + +此服务引用环境文件来加载密钥(例如 _RESTIC_PASSWORD_)。创建 _~/.config/restic-backup.conf_。复制并粘贴以下内容以获得最佳效果。此示例使用 BackBlaze B2 存储。请相应地调整 ID、密钥、仓库和密码值。 + +``` +BACKUP_PATHS="/home/rupert" +BACKUP_EXCLUDES="--exclude-file /home/rupert/.restic_excludes --exclude-if-present .exclude_from_backup" +RETENTION_DAYS=7 +RETENTION_WEEKS=4 +RETENTION_MONTHS=6 +RETENTION_YEARS=3 +B2_ACCOUNT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX +B2_ACCOUNT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ +RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +``` + +现在已安装该服务,请重新加载 systemd:_systemctl -user daemon-reload_。尝试手动运行该服务以创建备份:_systemctl -user start restic-backup_。 + +因为该服务类型是 _oneshot_,它将运行一次并退出。验证服务运行并根据需要创建快照后,设置计时器以定期运行此服务。例如,要每天运行 _restic-backup.service_,请按如下所示创建 _~/.config/systemd/user/restic-backup.timer_。再次复制并粘贴此文本: + +``` +[Unit] +Description=Backup with restic daily +[Timer] +OnCalendar=daily +Persistent=true +[Install] +WantedBy=timers.target +``` + +运行以下命令启用: + +``` +$ systemctl --user enable --now restic-backup.timer +``` + +### 清理 + +虽然主服务运行 _forget_ 命令仅保留保留策略中的快照,但实际上并未从 restic 仓库中删除数据。 _prune_ 命令检查仓库和当前快照,并删除与快照无关的所有数据。由于 _prune_ 可能是一个耗时的过程,因此无需在每次运行备份时运行。这是第二个服务和计时器的场景。首先,通过复制和粘贴此文本来创建文件 _~/.config/systemd/user/restic-prune.service_: + +``` +[Unit] +Description=Restic backup service (data pruning) +[Service] +Type=oneshot +ExecStart=restic prune +EnvironmentFile=%h/.config/restic-backup.conf +``` + +与主 _restic-backup.service_ 服务类似,_restic-prune_ 也是 onehot 服务,并且可以手动运行。设置完服务后,创建 _~/.config/systemd/user/restic-prune.timer_ 并启用相应的计时器: + +``` +[Unit] +Description=Prune data from the restic repository monthly +[Timer] +OnCalendar=monthly +Persistent=true +[Install] +WantedBy=timers.target +``` + +就是这些了!restic 将会每日运行并按月清理数据。 + +* * * + +图片来自 _[Unsplash][9]_ 由 _[ Samuel Zeller][8]_ 拍摄。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/automate-backups-with-restic-and-systemd/ + +作者:[Link Dupont][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/linkdupont/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/restic-systemd-816x345.jpg +[2]: https://restic.net/ +[3]: https://fedoramagazine.org/?s=backup +[4]: https://fedoramagazine.org/use-restic-encrypted-backups/ +[5]: https://fedoramagazine.org/series/systemd-series/ +[6]: https://fedoramagazine.org/systemd-getting-a-grip-on-units/ +[7]: https://fedoramagazine.org/howto-use-sudo/ +[8]: https://unsplash.com/photos/JuFcQxgCXwA?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[9]: https://unsplash.com/search/photos/archive?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 73d21e0e5e6ea6ba0a27a6b661020b1b4687e588 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 16 May 2019 08:59:46 +0800 Subject: [PATCH 0460/1154] translating --- ... started with Libki to manage public user computer access.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190502 Get started with Libki to manage public user computer access.md b/sources/tech/20190502 Get started with Libki to manage public user computer access.md index 7c6f4b2746..398cace2b9 100644 --- a/sources/tech/20190502 Get started with Libki to manage public user computer access.md +++ b/sources/tech/20190502 Get started with Libki to manage public user computer access.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 02657d2a936eea8f77f8241888ef41cf594ffa37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Thu, 16 May 2019 09:25:08 +0800 Subject: [PATCH 0461/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...x Shell Script To Monitor Disk Space Usage And Send Email.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md index 38a1d6419b..0052115ed1 100644 --- a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md +++ b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6ed2f7cd69f88175417c10a32953aee1961b5cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Thu, 16 May 2019 09:28:00 +0800 Subject: [PATCH 0462/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...x Shell Script To Monitor Disk Space Usage And Send Email.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md index 38a1d6419b..0052115ed1 100644 --- a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md +++ b/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d22a18c30bfff4517a6b6f894f670c75569fe4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Thu, 16 May 2019 10:37:33 +0800 Subject: [PATCH 0463/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190411 How do you contribute to open source without code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190411 How do you contribute to open source without code.md b/sources/tech/20190411 How do you contribute to open source without code.md index 659fd9064e..40c2a89842 100644 --- a/sources/tech/20190411 How do you contribute to open source without code.md +++ b/sources/tech/20190411 How do you contribute to open source without code.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a54765bb04b87f3a6622b8c27a08e169935631f1 Mon Sep 17 00:00:00 2001 From: warmfrog <1594914459@qq.com> Date: Thu, 16 May 2019 08:18:59 -0400 Subject: [PATCH 0464/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= =?UTF-8?q?=20(#13690)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Monitor Disk Space Usage And Send Email.md | 82 ++++++++++--------- 1 file changed, 44 insertions(+), 38 deletions(-) rename {sources => translated}/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md (52%) diff --git a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md similarity index 52% rename from sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md rename to translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md index 0052115ed1..c4a7480042 100644 --- a/sources/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md +++ b/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -7,30 +7,30 @@ [#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Linux Shell Script To Monitor Disk Space Usage And Send Email -====== +用 Linux Shell 脚本来监控磁盘使用情况和发送邮件 +============================================ -There are numerous monitoring tools are available in market to monitor Linux systems and it will send an email when the system reaches the threshold limit. +市场上有很多用来监控 Linux 系统的监控工具,当系统到达阀值后它将发送一封邮件。 -It monitors everything such as CPU utilization, Memory utilization, swap utilization, disk space utilization and much more. +它监控所有的东西例如 CPU 利用率,内存利用率,交换空间利用率,磁盘空间利用率等等。 -However, it’s suitable for small and big environment. +然而,它更适合小环境和大环境。 -Think about if you have only few systems then what will be the best approach on this. +想一想如果你只有少量系统,那么什么是最好的方式来应对这种情况。 -Yup, we want to write a **[shell script][1]** to achieve this. +是的,我们想要写一个 **[shell 脚本][1]** 来实现。 -In this tutorial we are going to write a shell script to monitor disk space usage on system. +在这篇指南中我们打算写一个 shell 脚本来监控系统的磁盘空间使用率。 -When the system reaches the given threshold then it will trigger a mail to corresponding email id. +当系统到达给定的阀值,它将给对应的邮件 id 发送一封邮件。 -We have added totally four shell scripts in this article and each has been used for different purpose. +在这篇文章中我们总共添加了四个 shell 脚本,每个用于不同的目的。 -Later, we will come up with other shell scripts to monitor CPU, Memory and Swap utilization. +之后,我们会想出其他 shell 脚本来监控 CPU,内存和交换空间利用率。 -Before step into that, i would like to clarify one thing which i noticed regarding the disk space usage shell script. +在此之前,我想澄清一件事,根据我观察的磁盘空间使用率 shell 脚本使用情况。 -Most of the users were commented in multiple blogs saying they were getting the following error message when they are running the disk space usage script. +大多数用户在多篇博客中评论说,当他们运行磁盘空间使用率脚本时他们获得了以下错误。 ``` # sh /opt/script/disk-usage-alert-old.sh @@ -40,11 +40,11 @@ test-script.sh: line 7: [: /dev/mapper/vg_2g-lv_root: integer expression expecte / 9.8G ``` -Yes that’s right. Even, i had faced the same issue when i ran the script first time. Later, i had found the root causes. +是的,这是对的。甚至,当我第一次运行这个脚本的时候我遇到了相同的问题。之后,我发现了根本原因。 -When you use “df -h” or “df -H” in shell script for disk space alert on RHEL 5 & RHEL 6 based system, you will be end up with the above error message because the output is not in the proper format, see the below output. +当你在基于 RHEL 5 & RHEL 6 的系统上运行包含用于磁盘空间警告的 “df -h” 或 “df -H” 的 shell 脚本中时,你会发现上述错误信息,因为输出格式不对,查看下列输出。 -To overcome this issue, we need to use “df -Ph” (POSIX output format) but by default “df -h” is working fine on RHEL 7 based systems. +为了解决这个问题,我们需要用 “df -Ph” (POSIX 输出格式),但是默认的 “df -h” 在基于 RHEL 7 的系统上运行的很好。 ``` # df -h @@ -60,15 +60,15 @@ tmpfs 7.8G 0 7.8G 0% /dev/shm 4.8G 14M 4.6G 1% /tmp ``` -### Method-1 : Linux Shell Script To Monitor Disk Space Usage And Send Email +### 方法一:Linux Shell 脚本来监控磁盘空间使用率和发送邮件 -You can use the following shell script to monitor disk space usage on Linux system. +你可以使用下列 shell 脚本在 Linux 系统中来监控磁盘空间使用率。 -It will send an email when the system reaches the given threshold limit. In this example, we set threshold limit at 60% for testing purpose and you can change this limit as per your requirements. +当系统到达给定的阀值限制时,它将发送一封邮件。在这个例子中,我们设置阀值为 60% 用于测试目的,你可以改变这个限制来符合你的需求。 -It will send multiple mails if more than one file systems get reached the given threshold limit because the script is using loop. +如果超过一个文件系统到达给定的阀值,它将发送多封邮件,因为这个脚本使用了循环。 -Also, replace your email id instead of us to get this alert. +同样,替换你的邮件 id 来获取这份警告。 ``` # vi /opt/script/disk-usage-alert.sh @@ -85,7 +85,7 @@ do done ``` -**Output:** I got the following two email alerts. +**输出:**我获得了下列两封邮件警告。 ``` The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 @@ -100,9 +100,9 @@ Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. */10 * * * * /bin/bash /opt/script/disk-usage-alert.sh ``` -### Method-2 : Linux Shell Script To Monitor Disk Space Usage And Send Email +### 方法二:Linux Shell 脚本来监控磁盘空间使用率和发送邮件 -Alternatively, you can use the following shell script. We have made few changes in this compared with above script. +作为代替,你可以使用下列的 shell 脚本。对比上面的脚本我们做了少量改变。 ``` # vi /opt/script/disk-usage-alert-1.sh @@ -120,7 +120,8 @@ do done ``` -**Output:** I got the following two email alerts. +**输出:**我获得了下列两封邮件警告。 + ``` The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 @@ -128,24 +129,24 @@ The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 ``` -Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. +最终添加了一个 **[cronjob][2]** 来自动完成。它会每 10 分钟运行一次。 ``` # crontab -e */10 * * * * /bin/bash /opt/script/disk-usage-alert-1.sh ``` -### Method-3 : Linux Shell Script To Monitor Disk Space Usage And Send Email +### 方法三:Linux Shell 脚本来监控磁盘空间使用率和发送邮件 -I would like to go with this method. Since, it work like a charm and you will be getting single email for everything. +我更喜欢这种方法。因为,它工作起来很有魔力,你只会收到一封关于所有事的邮件。 -This is very simple and straightforward. +这相当简单和直接。 ``` */10 * * * * df -Ph | sed s/%//g | awk '{ if($5 > 60) print $0;}' | mail -s "Disk Space Alert On $(hostname)" [email protected] ``` -**Output:** I got a single mail for all alerts. +**输出:** 我获得了一封关于所有警告的邮件。 ``` Filesystem Size Used Avail Use Mounted on @@ -153,9 +154,7 @@ Filesystem Size Used Avail Use Mounted on /dev/mapper/vg_2g-lv_home 5.0G 4.3G 784M 85 /home ``` -### Method-4 : Linux Shell Script To Monitor Disk Space Usage Of Particular Partition And Send Email - -If anybody wants to monitor the particular partition then you can use the following shell script. Simply replace your filesystem name instead of us. +### 方法四:Linux Shell 脚本来监控某个分区的磁盘空间使用情况和发送邮件 ``` # vi /opt/script/disk-usage-alert-2.sh @@ -168,22 +167,22 @@ echo "The Mount Point "/DB" on $(hostname) has used $used at $(date)" | mail -s fi ``` -**Output:** I got the following email alerts. +**输出:** 我得到了下面的邮件警告。 ``` The partition /dev/mapper/vg_2g-lv_dbs on 2g.CentOS6 has used 82% at Mon Apr 29 06:16:14 IST 2019 ``` -Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. +最终添加了一个 **[cronjob][2]** 来自动完成这些工作。它将每 10 分钟运行一次。 ``` # crontab -e */10 * * * * /bin/bash /opt/script/disk-usage-alert-2.sh ``` -**Note:** You will be getting an email alert 10 mins later since the script has scheduled to run every 10 minutes (But it’s not exactly 10 mins and it depends the timing). +**注意:** 你将在 10 分钟后收到一封邮件警告,因为这个脚本被计划为每 10 分钟运行一次(但也不是精确的 10 分钟,取决于时间)。 -Say for example. If your system reaches the limit at 8.25 then you will get an email alert in another 5 mins. Hope it’s clear now. +例如这个例子。如果你的系统在 8:25 到达了限制,你将在 5 分钟后收到邮件警告。希望现在讲清楚了。 -------------------------------------------------------------------------------- @@ -191,7 +190,7 @@ via: https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[warmfrog](https://github.com/warmfrog) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -200,3 +199,10 @@ via: https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and [b]: https://github.com/lujun9972 [1]: https://www.2daygeek.com/category/shell-script/ [2]: https://www.2daygeek.com/crontab-cronjob-to-schedule-jobs-in-linux/ + + + + + + + From 7923b670e7ac2ab3f119f36fe87a5b3e7521276c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 16 May 2019 22:04:42 +0800 Subject: [PATCH 0465/1154] PRF:20190502 Format Python however you like with Black.md @geekpi --- .../20190502 Format Python however you like with Black.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translated/tech/20190502 Format Python however you like with Black.md b/translated/tech/20190502 Format Python however you like with Black.md index 88a0540c36..ee2ede215b 100644 --- a/translated/tech/20190502 Format Python however you like with Black.md +++ b/translated/tech/20190502 Format Python however you like with Black.md @@ -7,12 +7,12 @@ [#]: via: (https://opensource.com/article/19/5/python-black) [#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) -使用 Black 随意格式化 Python +使用 Black 自由格式化 Python ====== > 在我们覆盖 7 个 PyPI 库的系列文章中了解解决 Python 问题的更多信息。 -![OpenStack source code \(Python\) in VIM][1] +![OpenStack source code \(Python\) in VIM](https://img.linux.net.cn/data/attachment/album/201905/16/220249ethkikh5h1uib5iy.jpg) Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区可以让我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包,用以扩展和改进 Python 并解决不可避免的问题。 @@ -83,10 +83,10 @@ $ echo $? via: https://opensource.com/article/19/5/python-black -作者:[Moshe Zadka ][a] +作者:[Moshe Zadka][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/) 荣誉推出 From 2b23d530ab10e3f4ff8c655378d39b870e7cd1c6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 16 May 2019 22:05:31 +0800 Subject: [PATCH 0466/1154] PUB:20190502 Format Python however you like with Black.md @geekpi https://linux.cn/article-10864-1.html --- .../20190502 Format Python however you like with Black.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190502 Format Python however you like with Black.md (98%) diff --git a/translated/tech/20190502 Format Python however you like with Black.md b/published/20190502 Format Python however you like with Black.md similarity index 98% rename from translated/tech/20190502 Format Python however you like with Black.md rename to published/20190502 Format Python however you like with Black.md index ee2ede215b..dd56785451 100644 --- a/translated/tech/20190502 Format Python however you like with Black.md +++ b/published/20190502 Format Python however you like with Black.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10864-1.html) [#]: subject: (Format Python however you like with Black) [#]: via: (https://opensource.com/article/19/5/python-black) [#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) From d1263609502f1f7723153703ba46468a6f4abf11 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 16 May 2019 23:16:06 +0800 Subject: [PATCH 0467/1154] PRF:20190508 How to use advanced rsync for large Linux backups.md @warmfrog --- ... advanced rsync for large Linux backups.md | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/translated/tech/20190508 How to use advanced rsync for large Linux backups.md b/translated/tech/20190508 How to use advanced rsync for large Linux backups.md index c6a9fa0828..070518203d 100644 --- a/translated/tech/20190508 How to use advanced rsync for large Linux backups.md +++ b/translated/tech/20190508 How to use advanced rsync for large Linux backups.md @@ -1,61 +1,61 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to use advanced rsync for large Linux backups) [#]: via: (https://opensource.com/article/19/5/advanced-rsync) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) -如何使用高级工具 rsync 进行大的 Linux 备份 +如何使用 rsync 的高级用法进行大型备份 ===================================== -基础的 rsync 命令通常足够来管理你的 Linux 备份,但是额外的选项使大数据集备份更快更强大。 + +> 基础的 `rsync` 命令通常足够来管理你的 Linux 备份,但是额外的选项使大型备份集更快、更强大。 + ![Filing papers and documents][1] -很明显,备份一直是Linux世界的热门话题。回到 2017,David Both 为 [Opensource.com][2] 的读者在"[使用 rsync 备份你的 Linux 系统][3]方面提了一些建议,在这年的更早时候,他发起了一项问卷调查询问大家,"[在 Linux 中你的 /home 目录的主要备份策略是什么][4]",在今年的另一个问卷调查中,Don Watkins 问到,"[你使用哪种开源备份解决方案][5]"。 +很明显,备份一直是 Linux 世界的热门话题。回到 2017,David Both 为 [Opensource.com][2] 的读者在[使用 rsync 备份 Linux 系统][3]方面提了一些建议,在这年的更早时候,他发起了一项问卷调查询问大家,[在 Linux 中你的 /home 目录的主要备份策略是什么][4],在今年的另一个问卷调查中,Don Watkins 问到,[你使用哪种开源备份解决方案][5]。 -我的回复是 [rsync][6]。市场上有大量大的复杂的工具,对于管理磁带机或者存储库设备,这些可能是必要的,但是可能你需要的只是一个简单的开源命令行工具。 +我的回复是 [rsync][6]。我真的非常喜欢 rsync!市场上有大量大而复杂的工具,对于管理磁带机或者存储库设备,这些可能是必要的,但是可能你需要的只是一个简单的开源命令行工具。 ### rsync 基础 -我为一个大概拥有 35,000 开发者并有着几十 TB 文件的全球组织管理二进制仓库。我经常一次移动或者归档上百 GB 的数据。使用的是 rsync。这种经历使我对这个简单的工具充满信心。(所以,是的,我在家使用它来备份我的 Linux 系统) +我为一个大概拥有 35,000 开发者并有着几十 TB 文件的全球性机构管理二进制仓库。我经常一次移动或者归档上百 GB 的数据。使用的是 `rsync`。这种经历使我对这个简单的工具充满信心。(所以,是的,我在家使用它来备份我的 Linux 系统) -基础的 rsync 命令很简单。 +基础的 `rsync` 命令很简单。 ``` -`rsync -av 源目录 目的地目录` +rsync -av 源目录 目的地目录 ``` -实际上,在任何指南中教的 rsync 命令在大多数通用情况下都运行的很好。然而,假设我们需要备份大量的数据。例如包含 2,000 个子目录的目录,每个包含 50GB 到 700GB 的数据。在这个目录运行 rsync 可能需要大量时间,尤其是当你使用 checksum 选项时(我倾向使用的)。 +实际上,在各种指南中教的 `rsync` 命令在大多数通用情况下都运行的很好。然而,假设我们需要备份大量的数据。例如包含 2,000 个子目录的目录,每个包含 50GB 到 700GB 的数据。在这个目录运行 `rsync` 可能需要大量时间,尤其是当你使用校验选项时(我倾向使用)。 当我们试图同步大量数据或者通过慢的网络连接时,可能遇到性能问题。让我给你展示一些我使用的方法来确保好的性能和可靠性。 -### 高级 rsync +### rsync 高级用法 -当 rsync 运行时出现的第一行是:“正在发送增量文件列表。” 如果你搜索这一行,你将看到很多类似的问题:为什么它一直运行,或者为什么它似乎挂起了。 +`rsync` 运行时出现的第一行是:“正在发送增量文件列表。” 如果你在网上搜索这一行,你将看到很多类似的问题:为什么它一直运行,或者为什么它似乎挂起了。 -这里是一个基于这个场景的例子。假设我们有一个 **/storage** 的目录,我们想要备份到一个外部 USB 磁盘,我们可以使用下面的命令: +这里是一个基于这个场景的例子。假设我们有一个 `/storage` 的目录,我们想要备份到一个外部 USB 磁盘,我们可以使用下面的命令: + +``` +rsync -cav /storage /media/WDPassport +``` + +`-c` 选项告诉 `rsync` 使用文件校验和而不是时间戳来决定改变的文件,这通常消耗的时间更久。为了分解 `/storage` 目录,我通过子目录同步,使用 `find` 命令。这是一个例子: ``` -`rsync -cav /storage /media/WDPassport` +find /storage -type d -exec rsync -cav {} /media/WDPassport \; ``` -**c** 选项告诉 rsync 使用文件校验和而不是时间戳来决定改变的文件,这通常消耗的时间更久。为了分解 **/storage** 目录,我通过子目录同步,使用 **find** 命令。这是一个例子: +这看起来可以,但是如果 `/storage` 目录有任何文件,它们将被跳过。因此,我们如何同步 `/storage` 目录中的文件呢?同样有一个细微的差别是这些选项将造成 `rsync` 会同步 `.` 目录,该目录是源目录自身;这意味着它会同步子目录两次,这并不是我们想要的。 - -``` -`find /storage -type d -exec rsync -cav {} /media/WDPassport \;` -``` - -这看起来可以,但是如果 **/storage** 目录有任何文件,它们将被跳过。因此,我们如何同步 **/storage** 目录中的文件呢?同样有一个细微的差别是具体的选项将造成 rsync 同步 **.** 目录,该目录是源目录自身;这意味着它会同步子目录两次,这并不是我们想要的。 - -长话短说,我的解决方案是一个 “双-递增”脚本。这允许我分解一个目录,例如,当你的 home 目录有多个大的目录,例如音乐或者家庭照片时,分解 **/home** 目录为单个的用户 home 目录。 +长话短说,我的解决方案是一个 “双-递增”脚本。这允许我分解一个目录,例如,当你的家目录有多个大的目录,例如音乐或者家庭照片时,分解 `/home` 目录为单个的用户家目录。 这是我的脚本的一个例子: - ``` HOMES="alan" DRIVE="/media/WDPassport" @@ -67,30 +67,29 @@ find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DR done ``` -第一个 rsync 命令拷贝它在源目录中发现的文件和目录。然而,它将目录留空,因此我们能够通过 **find** 命令迭代他们。这通过传递 **d** 参数来完成,它告诉 rsync 不要递归目录。 +第一个 `rsync` 命令拷贝它在源目录中发现的文件和目录。然而,它将目录留着不处理,因此我们能够通过 `find` 命令迭代它们。这通过传递 `-d` 参数来完成,它告诉 `rsync` 不要递归目录。 ``` -`-d, --dirs transfer directories without recursing` +-d, --dirs 传输目录而不递归 ``` -然后 **find** 命令传递每个目录来单独运行 rsync。之后 rsync 拷贝目录的内容。这通过传递 **r** 参数来完成,它告诉 rsync 要递归目录。 +然后 `find` 命令传递每个目录来单独运行 `rsync`。之后 `rsync` 拷贝目录的内容。这通过传递 `-r` 参数来完成,它告诉 `rsync` 要递归目录。 ``` -`-r, --recursive 递归进入目录` +-r, --recursive 递归进入目录 ``` -这使得 rsync使用的增量文件保持在一个可管理的大小。 - -大多数 rsync 指南为了简便使用 **a** (或者 **archive**) 参数。这实际是一个复合参数。 +这使得 `rsync` 使用的增量文件保持在一个合理的大小。 +大多数 `rsync` 指南为了简便使用 `-a` (或者 `archive`) 参数。这实际是一个复合参数。 ``` -`-a, --archive 归档模式; equals -rlptgoD (no -H,-A,-X)` +-a, --archive 归档模式;等价于 -rlptgoD(没有 -H,-A,-X) ``` -我传递的其他参数包含在 **a** 中;这些是 **l** , **p** , **t** , **g** , 和 **o**。 +我传递的其他参数包含在 `a` 中;这些是 `-l`、`-p`、`-t`、`-g`和 `-o`。 ``` @@ -101,16 +100,16 @@ done -o, --owner 保留拥有者(只适用于超级管理员) ``` -**\--delete** 选项告诉 rsync 删除目的地目录中所有在源目录不存在的任意文件。这种方式,运行的结果仅仅是复制。你同样可以排除 **.Trash** 目录或者 MacOS 创建的 **.DS_Store** 文件。 +`--delete` 选项告诉 `rsync` 删除目的地目录中所有在源目录不存在的任意文件。这种方式,运行的结果仅仅是复制。你同样可以排除 `.Trash` 目录或者 MacOS 创建的 `.DS_Store` 文件。 ``` -`-not -name ".Trash*" -not -name ".DS_Store"` +-not -name ".Trash*" -not -name ".DS_Store" ``` ### 注意 -最后一条建议: rsync 可以是破坏性的命令。幸运的是,它的睿智的创造者提供了 “空运行”的能力。如果我们加入 **n** 选项,rsync 会显示预期的输出但不写任何数据。 +最后一条建议: `rsync` 可以是破坏性的命令。幸运的是,它的睿智的创造者提供了 “空运行” 的能力。如果我们加入 `n` 选项,rsync 会显示预期的输出但不写任何数据。 ``` @@ -123,10 +122,10 @@ done via: https://opensource.com/article/19/5/advanced-rsync -作者:[Alan Formy-Duval ][a] +作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -134,7 +133,7 @@ via: https://opensource.com/article/19/5/advanced-rsync [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) [2]: http://Opensource.com -[3]: https://opensource.com/article/17/1/rsync-backup-linux +[3]: https://linux.cn/article-8237-1.html [4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux [5]: https://opensource.com/article/19/2/linux-backup-solutions [6]: https://en.wikipedia.org/wiki/Rsync From 75e1fc8bbde110e6ea2e328ffb37ea72d8909b9c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 16 May 2019 23:16:53 +0800 Subject: [PATCH 0468/1154] PUB:20190508 How to use advanced rsync for large Linux backups.md @warmfrog https://linux.cn/article-10865-1.html --- ...90508 How to use advanced rsync for large Linux backups.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190508 How to use advanced rsync for large Linux backups.md (98%) diff --git a/translated/tech/20190508 How to use advanced rsync for large Linux backups.md b/published/20190508 How to use advanced rsync for large Linux backups.md similarity index 98% rename from translated/tech/20190508 How to use advanced rsync for large Linux backups.md rename to published/20190508 How to use advanced rsync for large Linux backups.md index 070518203d..694158d9d4 100644 --- a/translated/tech/20190508 How to use advanced rsync for large Linux backups.md +++ b/published/20190508 How to use advanced rsync for large Linux backups.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10865-1.html) [#]: subject: (How to use advanced rsync for large Linux backups) [#]: via: (https://opensource.com/article/19/5/advanced-rsync) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) From 24c527f7cc4b562873ea641b6811bc2a1a121efe Mon Sep 17 00:00:00 2001 From: cycoe Date: Fri, 17 May 2019 00:17:03 +0800 Subject: [PATCH 0469/1154] translated by cycoe --- ...game to move your game character around.md | 353 ------------------ ...game to move your game character around.md | 353 ++++++++++++++++++ 2 files changed, 353 insertions(+), 353 deletions(-) delete mode 100644 sources/tech/20181218 Using Pygame to move your game character around.md create mode 100644 translated/tech/20181218 Using Pygame to move your game character around.md diff --git a/sources/tech/20181218 Using Pygame to move your game character around.md b/sources/tech/20181218 Using Pygame to move your game character around.md deleted file mode 100644 index 689d15d650..0000000000 --- a/sources/tech/20181218 Using Pygame to move your game character around.md +++ /dev/null @@ -1,353 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (cycoe) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Pygame to move your game character around) -[#]: via: (https://opensource.com/article/17/12/game-python-moving-player) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Using Pygame to move your game character around -====== -In the fourth part of this series, learn how to code the controls needed to move a game character. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python4-game.png?itok=tXFHaLdt) - -In the first article in this series, I explained how to use Python to create a simple, [text-based dice game][1]. In the second part, we began building a game from scratch, starting with [creating the game's environment][2]. And, in the third installment, we [created a player sprite][3] and made it spawn in your (rather empty) game world. As you've probably noticed, a game isn't much fun if you can't move your character around. In this article, we'll use Pygame to add keyboard controls so you can direct your character's movement. - -There are functions in Pygame to add other kinds of controls, but since you certainly have a keyboard if you're typing out Python code, that's what we'll use. Once you understand keyboard controls, you can explore other options on your own. - -You created a key to quit your game in the second article in this series, and the principle is the same for movement. However, getting your character to move is a little more complex. - -Let's start with the easy part: setting up the controller keys. - -### Setting up keys for controlling your player sprite - -Open your Python game script in IDLE, Ninja-IDE, or a text editor. - -Since the game must constantly "listen" for keyboard events, you'll be writing code that needs to run continuously. Can you figure out where to put code that needs to run constantly for the duration of the game? - -If you answered "in the main loop," you're correct! Remember that unless code is in a loop, it will run (at most) only once—and it may not run at all if it's hidden away in a class or function that never gets used. - -To make Python monitor for incoming key presses, add this code to the main loop. There's no code to make anything happen yet, so use `print` statements to signal success. This is a common debugging technique. - -``` -while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False - -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                print('left') -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                print('right') -            if event.key == pygame.K_UP or event.key == ord('w'): -            print('jump') - -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                print('left stop') -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                print('right stop') -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False     -``` - -Some people prefer to control player characters with the keyboard characters W, A, S, and D, and others prefer to use arrow keys. Be sure to include both options. - -**Note: **It's vital that you consider all of your users when programming. If you write code that works only for you, it's very likely that you'll be the only one who uses your application. More importantly, if you seek out a job writing code for money, you are expected to write code that works for everyone. Giving your users choices, such as the option to use either arrow keys or WASD, is a sign of a good programmer. - -Launch your game using Python, and watch the console window for output as you press the right, left, and up arrows, or the A, D, and W keys. - -``` -$ python ./your-name_game.py -  left -  left stop -  right -  right stop -  jump -``` - -This confirms that Pygame detects key presses correctly. Now it's time to do the hard work of making the sprite move. - -### Coding the player movement function - -To make your sprite move, you must create a property for your sprite that represents movement. When your sprite is not moving, this variable is set to `0`. - -If you are animating your sprite, or should you decide to animate it in the future, you also must track frames to enable the walk cycle to stay on track. - -Create the variables in the Player class. The first two lines are for context (you already have them in your code, if you've been following along), so add only the last three: - -``` -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.movex = 0 # move along X -        self.movey = 0 # move along Y -        self.frame = 0 # count frames -``` - -With those variables set, it's time to code the sprite's movement. - -The player sprite doesn't need to respond to control all the time; sometimes it will not be moving. The code that controls the sprite, therefore, is only one small part of all the things the player sprite will do. When you want to make an object in Python do something independent of the rest of its code, you place your new code in a function. Python functions start with the keyword `def`, which stands for define. - -Make a function in your Player class to add some number of pixels to your sprite's position on screen. Don't worry about how many pixels you add yet; that will be decided in later code. - -``` -    def control(self,x,y): -        ''' -        control player movement -        ''' -        self.movex += x -        self.movey += y -``` - -To move a sprite in Pygame, you have to tell Python to redraw the sprite in its new location—and where that new location is. - -Since the Player sprite isn't always moving, the updates need to be only one function within the Player class. Add this function after the `control` function you created earlier. - -To make it appear that the sprite is walking (or flying, or whatever it is your sprite is supposed to do), you need to change its position on screen when the appropriate key is pressed. To get it to move across the screen, you redefine its position, designated by the `self.rect.x` and `self.rect.y` properties, to its current position plus whatever amount of `movex` or `movey` is applied. (The number of pixels the move requires is set later.) - -``` -    def update(self): -        ''' -        Update sprite position -        ''' -        self.rect.x = self.rect.x + self.movex         -``` - -Do the same thing for the Y position: - -``` -        self.rect.y = self.rect.y + self.movey -``` - -For animation, advance the animation frames whenever your sprite is moving, and use the corresponding animation frame as the player image: - -``` -        # moving left -        if self.movex < 0: -            self.frame += 1 -            if self.frame > 3*ani: -                self.frame = 0 -            self.image = self.images[self.frame//ani] - -        # moving right -        if self.movex > 0: -            self.frame += 1 -            if self.frame > 3*ani: -                self.frame = 0 -            self.image = self.images[(self.frame//ani)+4] -``` - -Tell the code how many pixels to add to your sprite's position by setting a variable, then use that variable when triggering the functions of your Player sprite. - -First, create the variable in your setup section. In this code, the first two lines are for context, so just add the third line to your script: - -``` -player_list = pygame.sprite.Group() -player_list.add(player) -steps = 10  # how many pixels to move -``` - -Now that you have the appropriate function and variable, use your key presses to trigger the function and send the variable to your sprite. - -Do this by replacing the `print` statements in your main loop with the Player sprite's name (player), the function (.control), and how many steps along the X axis and Y axis you want the player sprite to move with each loop. - -``` -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(-steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                print('jump') - -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(-steps,0) -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False -``` - -Remember, `steps` is a variable representing how many pixels your sprite moves when a key is pressed. If you add 10 pixels to the location of your player sprite when you press D or the right arrow, then when you stop pressing that key you must subtract 10 (`-steps`) to return your sprite's momentum back to 0. - -Try your game now. Warning: it won't do what you expect. - -Why doesn't your sprite move yet? Because the main loop doesn't call the `update` function. - -Add code to your main loop to tell Python to update the position of your player sprite. Add the line with the comment: - -``` -    player.update()  # update player position -    player_list.draw(world) -    pygame.display.flip() -    clock.tick(fps) -``` - -Launch your game again to witness your player sprite move across the screen at your bidding. There's no vertical movement yet because those functions will be controlled by gravity, but that's another lesson for another article. - -In the meantime, if you have access to a joystick, try reading Pygame's documentation for its [joystick][4] module and see if you can make your sprite move that way. Alternately, see if you can get the [mouse][5] to interact with your sprite. - -Most importantly, have fun! - -### All the code used in this tutorial - -For your reference, here is all the code used in this series of articles so far. - -``` -#!/usr/bin/env python3 -# draw a world -# add a player and player control -# add player movement - -# 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 pygame -import sys -import os - -''' -Objects -''' - -class Player(pygame.sprite.Sprite): - ''' - Spawn a player - ''' - def __init__(self): - pygame.sprite.Sprite.__init__(self) - self.movex = 0 - self.movey = 0 - self.frame = 0 - self.images = [] - for i in range(1,5): - img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() - img.convert_alpha() - img.set_colorkey(ALPHA) - self.images.append(img) - self.image = self.images[0] - self.rect = self.image.get_rect() - - def control(self,x,y): - ''' - control player movement - ''' - self.movex += x - self.movey += y - - def update(self): - ''' - Update sprite position - ''' - - self.rect.x = self.rect.x + self.movex - self.rect.y = self.rect.y + self.movey - - # moving left - if self.movex < 0: - self.frame += 1 - if self.frame > 3*ani: - self.frame = 0 - self.image = self.images[self.frame//ani] - - # moving right - if self.movex > 0: - self.frame += 1 - if self.frame > 3*ani: - self.frame = 0 - self.image = self.images[(self.frame//ani)+4] - - -''' -Setup -''' -worldx = 960 -worldy = 720 - -fps = 40 # frame rate -ani = 4 # animation cycles -clock = pygame.time.Clock() -pygame.init() -main = True - -BLUE = (25,25,200) -BLACK = (23,23,23 ) -WHITE = (254,254,254) -ALPHA = (0,255,0) - -world = pygame.display.set_mode([worldx,worldy]) -backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() -backdropbox = world.get_rect() -player = Player() # spawn player -player.rect.x = 0 -player.rect.y = 0 -player_list = pygame.sprite.Group() -player_list.add(player) -steps = 10 # how fast to move - -''' -Main loop -''' -while main == True: - for event in pygame.event.get(): - if event.type == pygame.QUIT: - pygame.quit(); sys.exit() - main = False - - if event.type == pygame.KEYDOWN: - if event.key == pygame.K_LEFT or event.key == ord('a'): - player.control(-steps,0) - if event.key == pygame.K_RIGHT or event.key == ord('d'): - player.control(steps,0) - if event.key == pygame.K_UP or event.key == ord('w'): - print('jump') - - if event.type == pygame.KEYUP: - if event.key == pygame.K_LEFT or event.key == ord('a'): - player.control(steps,0) - if event.key == pygame.K_RIGHT or event.key == ord('d'): - player.control(-steps,0) - if event.key == ord('q'): - pygame.quit() - sys.exit() - main = False - -# world.fill(BLACK) - world.blit(backdrop, backdropbox) - player.update() - player_list.draw(world) #refresh player position - pygame.display.flip() - clock.tick(fps) -``` - -You've come far and learned much, but there's a lot more to do. In the next few articles, you'll add enemy sprites, emulated gravity, and lots more. In the mean time, practice with Python! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/12/game-python-moving-player - -作者:[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/article/17/10/python-101 -[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world -[3]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player -[4]: http://pygame.org/docs/ref/joystick.html -[5]: http://pygame.org/docs/ref/mouse.html#module-pygame.mouse diff --git a/translated/tech/20181218 Using Pygame to move your game character around.md b/translated/tech/20181218 Using Pygame to move your game character around.md new file mode 100644 index 0000000000..5d94f6a620 --- /dev/null +++ b/translated/tech/20181218 Using Pygame to move your game character around.md @@ -0,0 +1,353 @@ +[#]: collector: (lujun9972) +[#]: translator: (cycoe) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Pygame to move your game character around) +[#]: via: (https://opensource.com/article/17/12/game-python-moving-player) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +用 Pygame 使你的游戏角色移动起来 +====== +在本系列的第四部分,学习如何编写移动游戏角色的控制代码。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python4-game.png?itok=tXFHaLdt) + +在这个系列的第一篇文章中,我解释了如何使用 Python 创建一个简单的[基于文本的骰子游戏][1]。在第二部分中,我向你们展示了如何从头开始构建游戏,即从 [创建游戏的环境][2] 开始。然后在第三部分,我们[创建了一个玩家妖精][3],并且使它在你的(而不是空的)游戏世界内生成。你可能已经注意到,如果你不能移动你的角色,那么游戏不是那么有趣。在本篇文章中,我们将使用 Pygame 来添加键盘控制,如此一来你就可以控制你的角色的移动。 + +在 Pygame 中有许多函数可以用来添加(除键盘外的)其他控制,但如果你正在敲击 Python 代码,那么你一定是有一个键盘的,这将成为我们接下来会使用的控制方式。一旦你理解了键盘控制,你可以自己去探索其他选项。 + +在本系列的第二篇文章中,你已经为退出游戏创建了一个按键,移动角色的(按键)原则也是相同的。但是,使你的角色移动起来要稍微复杂一点。 + +让我们从简单的部分入手:设置控制器按键 + +### 为控制你的玩家妖精设置按键 + +在 IDLE、Ninja-IDE 或文本编辑器中打开你的 Python 游戏脚本。 + +因为游戏需要时刻“监听”键盘事件,所以你写的代码需要连续运行。你知道应该把需要在游戏周期中持续运行的代码放在哪里吗? + +如果你回答“放在主循环中”,那么你是正确的!记住除非代码在循环中,否则(大多数情况下)它只会运行仅一次。如果它被写在一个从未被使用的类或函数中,它可能根本不会运行。 + +要使 Python 监听传入的按键,将如下代码添加到主循环。目前的代码还不能产生任何的效果,所以使用 `print` 语句来表示成功的信号。这是一种常见的调试技术。 + +``` +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                print('left') +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                print('right') +            if event.key == pygame.K_UP or event.key == ord('w'): +             print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                print('left stop') +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                print('right stop') +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False     +``` + +一些人偏好使用键盘字母 W、A、S 和 D 来控制玩家角色,而另一些偏好使用方向键。因此确保你包含了两种选项。 + +**注意:**当你在编程时,同时考虑所有用户是非常重要的。如果你写代码只是为了自己运行,那么很可能你会成为你写的程序的唯一用户。更重要的是,如果你想找一个通过写代码赚钱的工作,你写的代码就应该让所有人都能运行。给你的用户选择权,比如提供使用方向键或 WASD 的选项,是一个优秀程序员的标志。 + +使用 Python 启动你的游戏,并在你按下“上下左右”方向键或 A、D 和 W 键的时候查看控制台窗口的输出。 + +``` +$ python ./your-name_game.py +  left +  left stop +  right +  right stop +  jump +``` + +这验证了 Pygame 可以正确地检测按键。现在是时候来完成使妖精移动的艰巨任务了。 + +### 编写玩家移动函数 + +为了使你的妖精移动起来,你必须为你的妖精创建一个属性代表移动。当你的妖精没有在移动时,这个变量被设为 `0`。 + +如果你正在为你的妖精设置动画,或者你决定在将来为他设置动画,你还必须跟踪帧来使走路循环保持在轨迹上。 + +在 Player 类中创建如下变量。开头两行作为上下文对照(如果你一直跟着做,你的代码中就已经有这两行),因此只需要添加最后三行: + +``` +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.movex = 0 # 沿 X 方向移动 +        self.movey = 0 # 沿 Y 方向移动 +        self.frame = 0 # 帧计数 +``` + +设置好了这些变量,是时候去为妖精移动编写代码了。 + +玩家妖精不需要时刻响应控制,优势它并没有在移动。控制妖精的代码,仅仅只是玩家妖精所有能做的事情中的一小部分。在 Python 中,当你想要使一个对象做某件事并独立于剩余其他代码时,你可以将你的新代码放入一个函数。Python 的函数以关键词 `def` 开头,(该关键词)代表了定义函数。 + +在你的 Player 类中创建如下函数,来为你的妖精在屏幕上的位置增加几个像素。现在先不要担心你增加几个像素,这将在后续的代码中确定。 + +``` +    def control(self,x,y): +        ''' +        控制玩家移动 +        ''' +        self.movex += x +        self.movey += y +``` + +为了在 Pygame 中移动妖精,你需要告诉 Python 在新的位置重绘妖精,以及这个新位置在哪里。 + +因为玩家妖精并不总是在移动,所以更新只需要是 Player 类中的一个函数。将此函数添加前面创建的 `control` 函数之后。 + +要使妖精看起来像是在行走(或者飞行,或是你的妖精应该做的任何事),你需要在按下适当的键时改变它在屏幕上的位置。要让它在屏幕上移动,你需要将它的位置(由 `self.rect.x` 和 `self.rect.y` 属性指定)重新定义为当前位置加上已应用的任意 `movex` 或 `movey`。(移动的像素数量将在后续进行设置。) + +``` +    def update(self): +        ''' +        更新妖精位置 +        ''' +        self.rect.x = self.rect.x + self.movex         +``` + +对 Y 方向做同样的处理: + +``` +        self.rect.y = self.rect.y + self.movey +``` + +对于动画,在妖精移动时推进动画帧,并使用相应的动画帧作为玩家的图像: + +``` +        # 向左移动 +        if self.movex < 0: +            self.frame += 1 +            if self.frame > 3*ani: +                self.frame = 0 +            self.image = self.images[self.frame//ani] + +        # 向右移动 +        if self.movex > 0: +            self.frame += 1 +            if self.frame > 3*ani: +                self.frame = 0 +            self.image = self.images[(self.frame//ani)+4] +``` + +通过设置一个变量来告诉代码为你的妖精位置增加多少像素,然后在触发你的玩家妖精的函数时使用这个变量。 + +首先,在你的设置部分创建这个变量。在如下代码中,开头两行是上下文对照,因此只需要在你的脚本中增加第三行代码: + +``` +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10  # 移动多少个像素 +``` + +现在你已经有了适当的函数和变量,使用你的按键来触发函数并将变量传递给你的妖精。 + +为此,将主循环中的 `print` 语句替换为玩家妖精的名字(player)、函数(.control)以及你希望玩家妖精在每个循环中沿 X 轴和 Y 轴移动的步数。 + +``` +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(-steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(-steps,0) +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False +``` + +记住,`steps` 变量代表了当一个按键被按下时,你的妖精会移动多少个像素。如果当你按下 D 或右方向键时,你的妖精的位置增加了 10 个像素。那么当你停止按下这个键时,你必须(将 `step`)减 10(`-steps`)来使你的妖精的动量回到 0。 + +现在尝试你的游戏。注意:它不会像你预想的那样运行。 + +为什么你的妖精仍无法移动?因为主循环还没有调用 `update` 函数。 + +将如下代码加入到你的主循环中来告诉 Python 更新你的玩家妖精的位置。增加带注释的那行: + +``` +    player.update()  # 更新玩家位置 +    player_list.draw(world) +    pygame.display.flip() +    clock.tick(fps) +``` + +再次启动你的游戏来见证你的玩家妖精在你的命令下在屏幕上来回移动。现在还没有垂直方向的移动,因为这部分函数会被重力控制,不过这是另一篇文章中的课程了。 + +与此同时,如果你拥有一个摇杆,你可以尝试阅读 Pygame 中 [joystick][4] 模块相关的文档,看看你是否能通过这种方式让你的妖精移动起来。或者,看看你是否能通过[鼠标][5]与你的妖精互动。 + +最重要的是,玩的开心! + +### 本教程中用到的所有代码 + +为了方便查阅,以下是目前本系列文章用到的所有代码。 + +``` +#!/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 pygame +import sys +import os + +''' +Objects +''' + +class Player(pygame.sprite.Sprite): + ''' + 生成玩家 + ''' + def __init__(self): + pygame.sprite.Sprite.__init__(self) + self.movex = 0 + self.movey = 0 + self.frame = 0 + self.images = [] + for i in range(1,5): + img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() + img.convert_alpha() + img.set_colorkey(ALPHA) + self.images.append(img) + self.image = self.images[0] + self.rect = self.image.get_rect() + + def control(self,x,y): + ''' + 控制玩家移动 + ''' + self.movex += x + self.movey += y + + def update(self): + ''' + 更新妖精位置 + ''' + + self.rect.x = self.rect.x + self.movex + self.rect.y = self.rect.y + self.movey + + # 向左移动 + if self.movex < 0: + self.frame += 1 + if self.frame > 3*ani: + self.frame = 0 + self.image = self.images[self.frame//ani] + + # 向右移动 + if self.movex > 0: + self.frame += 1 + if self.frame > 3*ani: + self.frame = 0 + self.image = self.images[(self.frame//ani)+4] + + +''' +设置 +''' +worldx = 960 +worldy = 720 + +fps = 40 # 帧刷新率 +ani = 4 # 动画循环 +clock = pygame.time.Clock() +pygame.init() +main = True + +BLUE = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +ALPHA = (0,255,0) + +world = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = world.get_rect() +player = Player() # 生成玩家 +player.rect.x = 0 +player.rect.y = 0 +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10 # 移动速度 + +''' +主循环 +''' +while main == True: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit(); sys.exit() + main = False + + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_LEFT or event.key == ord('a'): + player.control(-steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + player.control(steps,0) + if event.key == pygame.K_UP or event.key == ord('w'): + print('jump') + + if event.type == pygame.KEYUP: + if event.key == pygame.K_LEFT or event.key == ord('a'): + player.control(steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + player.control(-steps,0) + if event.key == ord('q'): + pygame.quit() + sys.exit() + main = False + +# world.fill(BLACK) + world.blit(backdrop, backdropbox) + player.update() + player_list.draw(world) # 更新玩家位置 + pygame.display.flip() + clock.tick(fps) +``` + +你已经学了很多,但还仍有许多可以做。在接下来的几篇文章中,你将实现添加敌方妖精、模拟重力等等。与此同时,练习 Python 吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/12/game-python-moving-player + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[校对者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/article/17/10/python-101 +[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world +[3]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player +[4]: http://pygame.org/docs/ref/joystick.html +[5]: http://pygame.org/docs/ref/mouse.html#module-pygame.mouse From a485cf11852fa056445e934d7a54e6cd46a5d97d Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 17 May 2019 09:03:57 +0800 Subject: [PATCH 0470/1154] translated --- ...i to manage public user computer access.md | 61 ------------------- ...i to manage public user computer access.md | 60 ++++++++++++++++++ 2 files changed, 60 insertions(+), 61 deletions(-) delete mode 100644 sources/tech/20190502 Get started with Libki to manage public user computer access.md create mode 100644 translated/tech/20190502 Get started with Libki to manage public user computer access.md diff --git a/sources/tech/20190502 Get started with Libki to manage public user computer access.md b/sources/tech/20190502 Get started with Libki to manage public user computer access.md deleted file mode 100644 index 398cace2b9..0000000000 --- a/sources/tech/20190502 Get started with Libki to manage public user computer access.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Get started with Libki to manage public user computer access) -[#]: via: (https://opensource.com/article/19/5/libki-computer-access) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) - -Get started with Libki to manage public user computer access -====== -Libki is a cross-platform, computer reservation and time management -system. -![][1] - -Libraries, schools, colleges, and other organizations that provide public computers need a good way to manage users' access—otherwise, there's no way to prevent some people from monopolizing the machines and ensure everyone has a fair amount of time. This is the problem that [Libki][2] was designed to solve. - -Libki is an open source, cross-platform, computer reservation and time management system for Windows and Linux PCs. It provides a web-based server and a web-based administration system that staff can use to manage computer access, including creating and deleting users, setting time limits on accounts, logging out and banning users, and setting access restrictions. - -According to lead developer [Kyle Hall][3], Libki is mainly used for PC time control as an open source alternative to Envisionware's proprietary computer access control software. When users log into a Libki-managed computer, they get a block of time to use the computer; once that time is up, they are logged off. The default setting is 45 minutes, but that can easily be adjusted using the web-based administration system. Some organizations offer 24 hours of access before logging users off, and others use it to track usage without setting time limits. - -Kyle is currently lead developer at [ByWater Solutions][4], which provides open source software solutions (including Libki) to libraries. He developed Libki early in his career when he was the IT tech at the [Meadville Public Library][5] in Pennsylvania. He was occasionally asked to cover the children's room during lunch breaks for other employees. The library used a paper sign-up sheet to manage access to the computers in the children's room, which meant constant supervision and checking to ensure equitable access for the people who came there. - -Kyle said, "I found this system to be cumbersome and awkward, and I wanted to find a solution. That solution needed to be both FOSS and cross-platform. In the end, no existing software package suited our particular needs, and that is why I developed Libki." - -Or, as Libki's website proclaims, "Libki was born of the need to avoid interacting with teenagers and now allows librarians to avoid interacting with teenagers around the world!" - -### Easy to set up and use - -I recently decided to try Libki in our local public library, where I frequently volunteer. I followed the [documentation][6] for the automatic installation, using Ubuntu 18.04 Server, and very quickly had it up and running. - -I am planning to support Libki in our local library, but I wondered about libraries that don't have someone with IT experience or the ability to build and deploy a server. Kyle says, "ByWater Solutions can cloud-host a Libki server, which makes maintenance and management much simpler for everyone." - -Kyle says ByWater is not planning to bundle Libki with its most popular offering, open source integrated library system (ILS) Koha, or any of the other [projects][7] it supports. "Libki and Koha are different [types of] software serving different needs, but they definitely work well together in a library setting. In fact, it was quite early on that I developed Libki's SIP2 integration so it could support single sign-on using Koha," he says. - -### How you can contribute - -Libki client is licensed under the GPLv3 and Libki server is licensed under the AGPLv3. Kyle says he would love Libki to have a more active and robust community, and the project is always looking for new people to join its [contributors][8]. If you would like to participate, visit [Libki's Community page][9] and join the mailing list. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/libki-computer-access - -作者:[Don Watkins ][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/don-watkins/users/tony-thomas -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 -[2]: https://libki.org/ -[3]: https://www.linkedin.com/in/kylemhallinfo/ -[4]: https://opensource.com/article/19/4/software-libraries -[5]: https://meadvillelibrary.org/ -[6]: https://manual.libki.org/master/libki-manual.html#_automatic_installation -[7]: https://bywatersolutions.com/projects -[8]: https://github.com/Libki/libki-server/graphs/contributors -[9]: https://libki.org/community/ diff --git a/translated/tech/20190502 Get started with Libki to manage public user computer access.md b/translated/tech/20190502 Get started with Libki to manage public user computer access.md new file mode 100644 index 0000000000..d8cda03623 --- /dev/null +++ b/translated/tech/20190502 Get started with Libki to manage public user computer access.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get started with Libki to manage public user computer access) +[#]: via: (https://opensource.com/article/19/5/libki-computer-access) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) + +开始使用 Libk i来管理公共用户访问计算机 +====== +Libki 是一个跨平台的计算机预约和时间管理系统。 +![][1] + +提供公共计算机的图书馆、学校、学院和其他组织需要一种管理用户访问权限的好方法 - 否则,就无法阻止某些人独占机器并确保每个人都有公平的时间。这是 [Libki][2] 要解决的问题。 + +Libki 是一个面向 Windows 和 Linux PC 的开源、跨平台的计算机预约和时间管理系统。它提供了一个基于 Web 的服务器和一个基于 Web 的管理系统,员工可以使用它来管理计算机访问,包括创建和删除用户、设置帐户时间限制、登出和禁止用户以及设置访问限制。 + +根据首席开发人员 [Kyle Hall][3] 所说,Libki 主要用于 PC 时间控制,作为 Envisionware 的专有计算机访问控制软件的开源替代品。当用户登录 Libki 管理的计算机时,他们会有一段时间来使用计算机。时间到了之后,他们就会被登出。时间默认设置为 45 分钟,但可以使用基于 Web 的管理系统轻松调整。一些组织在登出用户之前提供 24 小时访问权限,而有的组织则使用它来跟踪使用情况而不设置时间限制。 + +Kyle 目前是 [ByWater Solutions][4] 的首席开发人员,该公司为图书馆提供开源软件解决方案(包括 Libki)。在职业生涯早期,他在宾夕法尼亚州的[米德维尔公共图书馆][5]担任 IT 技术时开发了 Libki。在其他员工的午休期间,偶尔会要求他关注孩子的房间。图书馆使用纸质注册表来管理对儿童房间计算机的访问,这意味着不断的监督和检查,以确保来到那里的人能够公平地使用。 + +Kyle 说,“我发现这个系统很麻烦、很尴尬,我想找到一个解决方案。这个解决方案需要同时是 FOSS 和跨平台的。最后,没有现有的软件适合我们的特殊需求,那就是为什么我开发了 Libki。“ + +或者,正如 Libki 的网站所宣称的那样,“Libki 的诞生是为了避免与青少年互动,现在允许图书馆员避免与世界各地的青少年互动!” + +### 易于安装和使用 + +我最近决定在我经常在那里做志愿者的当地的公共图书馆尝试 Libki。我按照[文档][6]在 Ubuntu 18.04 Server 中自动进行了安装,它很快就启动起来了。 + +我计划在我们当地的图书馆支持 Libki,但我想知道在那些没有 IT 相关经验的人或者无法构建和部署服务器的图书馆是怎样的。Kyle 说:“ByWater Solutions 可以云端托管 Libki 服务器,这使得每个人的维护和管理变得更加简单。” + +Kyle 表示,ByWater 并不打算将 Libki 与其最受欢迎的产品,开源集成图书馆系统 (ILS)Koha 或其支持的任何其他[项目][7]捆绑在一起。他说: “Libki 和 Koha 是不同[类型]的软件,满足不同的需求,但它们在图书馆中确实很好地协同工作。事实上,我很早就开发了 Libki 的 SIP2 集成,因此它可以支持使用 Koha 进行单点登录,“ 。 + +### 如何贡献 + +Libki 客户端是 GPLv3 许可,Libki 服务器是 AGPLv3 许可。Kyle 说他希望 Libki 拥有一个更加活跃和强大的社区,项目一直在寻找新人加入其[贡献者][8]。如果你想参加,请访问 [Libki 社区页面][9]并加入邮件列表。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/libki-computer-access + +作者:[Don Watkins ][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/don-watkins/users/tony-thomas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 +[2]: https://libki.org/ +[3]: https://www.linkedin.com/in/kylemhallinfo/ +[4]: https://opensource.com/article/19/4/software-libraries +[5]: https://meadvillelibrary.org/ +[6]: https://manual.libki.org/master/libki-manual.html#_automatic_installation +[7]: https://bywatersolutions.com/projects +[8]: https://github.com/Libki/libki-server/graphs/contributors +[9]: https://libki.org/community/ From 12f09915ad60d44e1a24c6a687b995663d1232cf Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 17 May 2019 09:08:42 +0800 Subject: [PATCH 0471/1154] translating --- ...90503 Check your spelling at the command line with Ispell.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190503 Check your spelling at the command line with Ispell.md b/sources/tech/20190503 Check your spelling at the command line with Ispell.md index 5c26143241..3ddcad1024 100644 --- a/sources/tech/20190503 Check your spelling at the command line with Ispell.md +++ b/sources/tech/20190503 Check your spelling at the command line with Ispell.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 545a142a38e30c3c68de068e6715909e2d2f1a39 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 17 May 2019 10:36:11 +0800 Subject: [PATCH 0472/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20Quer?= =?UTF-8?q?ying=2010=20years=20of=20GitHub=20data=20with=20GHTorrent=20and?= =?UTF-8?q?=20Libraries.io=20sources/tech/20190516=20Querying=2010=20years?= =?UTF-8?q?=20of=20GitHub=20data=20with=20GHTorrent=20and=20Libraries.io.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ub data with GHTorrent and Libraries.io.md | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md diff --git a/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md b/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md new file mode 100644 index 0000000000..c7ec1de513 --- /dev/null +++ b/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Querying 10 years of GitHub data with GHTorrent and Libraries.io) +[#]: via: (https://opensource.com/article/19/5/chaossearch-github-ghtorrent) +[#]: author: (Pete Cheslock https://opensource.com/users/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes) + +Querying 10 years of GitHub data with GHTorrent and Libraries.io +====== +There is a way to explore GitHub data without any local infrastructure +using open source datasets. +![magnifying glass on computer screen][1] + +I’m always on the lookout for new datasets that we can use to show off the power of my team's work. [**CHAOS** SEARCH][2] turns your [Amazon S3][3] object storage data into a fully searchable [Elasticsearch][4]-like cluster. With the Elasticsearch API or tools like [Kibana][5], you can then query whatever data you find. + +I was excited when I found the [GHTorrent][6] project to explore. GHTorrent aims to build an offline version of all data available through the GitHub APIs. If datasets are your thing, this is a project worth checking out or even consider [donating one of your GitHub API keys][7]. + +### Accessing GHTorrent data + +There are many ways to gain access to and use [GHTorrent’s data][8], which is available in [NDJSON][9]** **format. This project does a great job making the data available in multiple forms, including[CSV][10] for restoring into a [MySQL][11] database, [MongoDB][12] dumps of all objects, and Google Big Query** **(free) for exporting data directly into Google’s object storage. There is one caveat: this dataset has a nearly complete dataset from 2008 to 2017 but is not as complete from 2017 to today. That will impact our ability to query with certainty, but it is still an exciting amount of information. + +I chose Google Big Query to avoid running any database myself, so I was quickly able to download a full corpus of data including users and projects. **CHAOS** SEARCH can natively analyze the NDJSON format, so after uploading the data to Amazon S3 I was able to index it in just a few minutes. The **CHAOS** SEARCH platform doesn’t require users to set up index schemas or define mappings for their data, so it discovered all of the fields—strings, integers, etc.—itself. + +With my data fully indexed and ready for search and aggregation, I wanted to dive in and see what insights we can learn, like which software languages are the most popular for GitHub projects. + +(A note on formatting: this is a valid JSON query that we won't format correctly here to avoid scroll fatigue. To properly format it, you can copy it locally and send to a command-line utility like [jq][13].) + + +``` +`{"aggs":{"2":{"date_histogram":{"field":"root.created_at","interval":"1M","time_zone":"America/New_York","min_doc_count":1}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["root.created_at","root.updated_at"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"root.language":{"query":""}}}]}}}` +``` + +This result is of little surprise to anyone who’s followed the state of open source languages over recent years. + +![Which software languages are the most popular on GitHub.][14] + +[JavaScript][15] is still the reigning champion, and while some believe JavaScript is on its way out, it remains the 800-pound gorilla and is likely to remain that way for some time. [Java][16] faces similar rumors and this data shows that it's a major part of the open source ecosystem. + +Given the popularity of projects like [Docker][17] and [Kubernetes][18], you might be wondering, “What about Go ([Golang][19])?” This is a good time for a reminder that the GitHub dataset discussed here contains some gaps, most significantly after 2017, which is about when I saw Golang projects popping up everywhere. I hope to repeat this search with a complete GitHub dataset and see if it changes the rankings at all. + +Now let's explore the rate of project creation. (Reminder: this is valid JSON consolidated for readability.) + + +``` +`{"aggs":{"2":{"date_histogram":{"field":"root.created_at","interval":"1M","time_zone":"America/New_York","min_doc_count":1}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["root.created_at","root.updated_at"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"root.language":{"query":""}}}]}}}` +``` + +Seeing the rate at which new projects are created would be fun impressive as well, with tremendous growth starting around 2012: + +![The rate at which new projects are created on GitHub.][20] + +Now that I knew the rate of projects created as well as the most popular languages used to create these projects, I wanted to find out what open source licenses these projects chose. Unfortunately, this data doesn’t exist in the GitHub projects dataset, but the fantastic team over at [Tidelift][21] publishes a detailed list of GitHub projects, licenses used, and other details regarding the state of open source software in their [Libraries.io][22][ data][23]. Ingesting this dataset into **CHAOS** SEARCH took just minutes, letting me see which open source software licenses are the most popular on GitHub: + +(Reminder: this is valid JSON consolidated for readability.) + + +``` +`{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}}` +``` + +The results show some significant outliers: + +![Which open source software licenses are the most popular on GitHub.][24] + +As you can see, the [MIT license][25] and the [Apache 2.0 license][26] by far outweighs most of the other open source licenses used for these projects, while [various BSD and GPL licenses][27] follow far behind. I can’t say that I’m surprised by these results given GitHub’s open model. I would guess that users, not companies, create most projects and that they use the MIT license to make it simple for other people to use, share, and contribute. That Apache 2.0** **licensing is right behind also makes sense, given just how many companies want to ensure their trademarks are respected and have an open source component to their businesses. + +Now that I identified the most popular licenses, I was curious to see the least used ones. By adjusting my last query, I reversed the top 10 into the bottom 10 and was able to find just two projects using the [University of Illinois—NCSA Open Source License][28]. I had never heard of this license before, but it’s pretty close to Apache 2.0. It’s interesting to see just how many different software licenses are in use across all GitHub projects. + +![The University of Illinois/NCSA open source license.][29] + +The University of Illinois/NCSA open source license. + +After that, I dove into a specific language (JavaScript) to see the most popular license used there. (Reminder: this is valid JSON consolidated for readability.) + + +``` +`{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[{"match_phrase":{"Repository Language":{"query":"JavaScript"}}}],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}}` +``` + +There were some surprises in this output. + +![The most popular open source licenses used for GitHub JavaScript projects.][30] + +Even though the default license for [NPM][31] modules when created with **npm init **is the one from [Internet Systems Consortium (ISC)][32], you can see that a considerable number of these projects use MIT as well as Apache 2.0 for their open source license. + +Since the Libraries.io dataset is rich in open source project content, and since the GHTorrent data is missing the last few years’ data (and thus missing any details about Golang projects), I decided to run a similar query to see how Golang projects license their code. + +(Reminder: this is valid JSON consolidated for readability.) + + +``` +`{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[{"match_phrase":{"Repository Language":{"query":"Go"}}}],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}}` +``` + +The results were quite different than Javascript. + +![How Golang projects license their GitHub code.][33] + +Golang offers a stunning reversal from JavaScript—nearly three times as many Golang projects are licensed with Apache 2.0 over MIT. While it’s hard precisely explain why this is the case, over the last few years there’s been massive growth in Golang, especially among companies building projects and software offerings, both open source and commercially. + +As we learned above, many of these companies want to enforce their trademarks, thus the move to the Apache 2.0 license makes sense. + +#### Conclusion + +In the end, I found some interesting results by diving into the GitHub users and projects data dump. Some of these I definitely would have guessed, but a few results were surprises to me as well, especially the outliers like the rarely-used NCSA license. + +All in all, you can see how quickly and easily the **CHAOS** SEARCH platform lets us find complicated answers to interesting questions. I dove into this dataset and received deep analytics without having to run any databases myself, and even stored the data inexpensively on Amazon S3—so there’s little maintenance involved. Now I can ask any other questions regarding the data anytime I want. + +What other questions are you asking your data, and what data sets do you use? Let me know in the comments or on Twitter [@petecheslock][34]. + +_A version of this article was originally posted on[ **CHAOS** SEARCH][35]._ + +* * * + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/chaossearch-github-ghtorrent + +作者:[Pete Cheslock][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/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0 (magnifying glass on computer screen) +[2]: https://chaossearch.io/ +[3]: https://aws.amazon.com/s3/ +[4]: https://www.elastic.co/ +[5]: https://www.elastic.co/products/kibana +[6]: http://ghtorrent.org +[7]: http://ghtorrent.org/services.html +[8]: http://ghtorrent.org/downloads.html +[9]: http://ndjson.org +[10]: https://en.wikipedia.org/wiki/Comma-separated_values +[11]: https://en.wikipedia.org/wiki/MySQL +[12]: https://www.mongodb.com/ +[13]: https://stedolan.github.io/jq/ +[14]: https://opensource.com/sites/default/files/uploads/github-1_500.png (Which software languages are the most popular on GitHub.) +[15]: https://en.wikipedia.org/wiki/JavaScript +[16]: /resources/java +[17]: /resources/what-docker +[18]: /resources/what-is-kubernetes +[19]: https://golang.org/ +[20]: https://opensource.com/sites/default/files/uploads/github-2_500.png (The rate at which new projects are created on GitHub.) +[21]: https://tidelift.com +[22]: http://libraries.io/ +[23]: https://libraries.io/data +[24]: https://opensource.com/sites/default/files/uploads/github-3_500.png (Which open source software licenses are the most popular on GitHub.) +[25]: https://opensource.org/licenses/MIT +[26]: https://opensource.org/licenses/Apache-2.0 +[27]: https://opensource.org/licenses +[28]: https://tldrlegal.com/license/university-of-illinois---ncsa-open-source-license-(ncsa) +[29]: https://opensource.com/sites/default/files/uploads/github-4_500_0.png (The University of Illinois/NCSA open source license.) +[30]: https://opensource.com/sites/default/files/uploads/github-5_500_0.png (The most popular open source licenses used for GitHub JavaScript projects.) +[31]: https://www.npmjs.com/ +[32]: https://en.wikipedia.org/wiki/ISC_license +[33]: https://opensource.com/sites/default/files/uploads/github-6_500.png (How Golang projects license their GitHub code.) +[34]: https://twitter.com/petecheslock +[35]: https://chaossearch.io/blog/where-are-the-github-users-part-1/ From e46cfe87192a343bdf0621c70381c17a92d8fc23 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 17 May 2019 10:44:01 +0800 Subject: [PATCH 0473/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190510=20PHP?= =?UTF-8?q?=20in=202019=20sources/tech/20190510=20PHP=20in=202019.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190510 PHP in 2019.md | 170 +++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 sources/tech/20190510 PHP in 2019.md diff --git a/sources/tech/20190510 PHP in 2019.md b/sources/tech/20190510 PHP in 2019.md new file mode 100644 index 0000000000..ba4705d643 --- /dev/null +++ b/sources/tech/20190510 PHP in 2019.md @@ -0,0 +1,170 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PHP in 2019) +[#]: via: (https://stitcher.io/blog/php-in-2019) +[#]: author: (Brent https://stitcher.io/blog/php-in-2019) + +PHP in 2019 +====== + + +Do you remember the popular "[PHP: a fractal of bad design][3]" blog post? The first time I read it, I was working in a crappy place with lots of legacy PHP projects. This article got me wondering whether I should just quit and go do something entirely different than programming. + +Luckily for me I was able to switch jobs shortly thereafter and, more importantly, PHP managed to evolve quite a bit since the 5.* days. Today I'm addressing the people who are either not programming in PHP anymore, or are stuck in legacy projects. + +Spoiler: some things still suck today, just like almost every programming language has its quirks. Many core functions still have their inconsistent method signatures, there are still confusing configuration settings, there are still many developers out there writing crappy code — because they have to, or because they don't know better. + +Today I want to look at the bright side: let's focus on the things that have changed and ways to write clean and maintainable PHP code. I want to ask you to set aside any prejudice for just a few minutes. + +Afterwards you're free to think exactly the same about PHP as you did before. Though chances are you will be surprised by some of the improvements made to PHP in the last few years. + +### TL;DR + + * PHP is actively developed with a new release each year + * Performance since the PHP 5 era has doubled, if not tripled + * There's a extremely active eco system of frameworks, packages and platforms + * PHP has had lots of new features added to it over the past few years, and the language keeps evolving + * Tooling like static analysers has matured over the past years, and only keeps growing + + + +Update: people asked me to show some actual code. I'm happy to say that's possible! Here's the [source code][4] of one of my hobby projects, written in PHP and Laravel; and [here][5] is a list of a few hundred OSS packages we maintain at our office. Both are good examples of what modern PHP projects look like. + +Let's start. + +### History summarized + +For good measure, let's quickly review PHP's release cycle today. We're at PHP 7.3 now, with 7.4 expected at the end of 2019. PHP 8.0 will be the next version after 7.4. + +Ever since the late 5.* era, the core team tries to keep a yearly release cycle, and have succeeded in doing so for the past four years. + +In general, every new release is actively supported for two years, and gets one more year of "security fixes only". The goal is to motivate PHP developers to stay up-to-date as much as possible: small upgrades every year are way more easy than making the jump between 5.4 to 7.0, for example. + +An active overview of PHP's timeline can be found [here][6]. + +Lastly, PHP 5.6 was the latest 5.* release, with 7.0 being the next one. If you want to know what happened to PHP 6, you can listen to the [PHP Roundtable podcast][7]. + +With that out of the way, let's debunk some common misconceptions about modern PHP. + +### PHP's performance +Back in the 5.* days, PHP's performance was… average at best. With 7.0 though, big pieces of PHP's core were rewritten from the ground up, resulting in two or three times performance increases. + +Words don't suffice though. Let's look at benchmarks. Luckily other people have spent lots of time in benchmarking PHP performance. I find that [Kinsta][8] has a good updated list. + +Ever since the 7.0 upgrade, performance only increased. So much that PHP web applications have comparable — in some cases better — performance than web frameworks in other languages. Take a look at this [extensive benchmark suite][9]. + +Sure PHP frameworks won't outperform C and Rust, but they do quite a lot better than Rails or Django, and are comparable to ExpressJS. + +### Frameworks and ecosystem + +Speaking of frameworks: PHP isn't just WordPress anymore. Let me tell you something as a professional PHP developer: WordPress isn't in any way representative of the contemporary ecosystem. + +In general there are two major web application frameworks, and a few smaller ones: [Symfony][10] and [Laravel][11]. Sure there's also Zend, Yii, Cake, Code Igniter etc. — but if you want to know what modern PHP development looks like, you're good with one of these two. + +Both frameworks have a large ecosystem of packages and products. Ranging from admin panels and CRMs to standalone packages, CI to profilers, numerous services like web sockets servers, queuing managers, payment integrations; honestly there's too much to list. + +These frameworks are meant for actual development though. If you're in need of pure content management, platforms like WordPress and CraftCMS are only improving more and more. + +One way to measure the current state of PHP's ecosystem is to look at Packagist, the main package repository for PHP. It has seen exponential growth. With ±25 million downloads a day, it's fair to say that the PHP ecosystem isn't the small underdog it used to be. + +Take a look at this graph, listing the amount of packages and versions over time. It can also be found on [the Packagist website][12]. + +![][13] + +Besides application frameworks and CMSs, we've also seen the rise of asynchronous frameworks the past years. + +These are frameworks and servers, written in PHP or other languages, that allow users to run truly asynchronous PHP. A few examples include [Swoole][14], [Amp][15] and [ReactPHP][16]. + +Since we've ventured into the async world, stuff like web sockets and applications with lots of IO have become actually relevant in the PHP world. + +There has also been talk on the internals mailing list — the place where core developers discuss the development of the language — to [add libuv to the core][17]. For those unaware of libuv: it's the same library Node.js uses to allow all its asynchronicity. + +### The language itself + +While `async` and `await` are not available yet, lots of improvements to the language itself have been made over the past years. Here's a non-exhaustive list of new features in PHP: + ++ Short closures ++ Null coalescing operator ++ Traits ++ Typed properties ++ Spread operator ++ JIT compiler ++ FFI ++ Anonymous classes ++ Return type declarations ++ Contemporary cryptography ++ Generators ++ Lots more + +While we're on the topic of language features, let's also talk about the process of how the language is developed today. There's an active core team of volunteers who move the language forward, though the community is allowed to propose RFCs. + +Next, these RFCs are discussed on the "internals" mailing list, which can also be [read online][18]. Before a new language feature is added, there must be a vote. Only RFC with at least a 2/3 majority are allowed in the core. + +There are probably around 100 people allowed to vote, though you're not required to vote on each RFC. Members of the core team are of course allowed to vote, they have to maintain the code base. Besides them, there's a group of people who have been individually picked from the PHP community. These people include maintainers of the PHP docs, contributors to the PHP project as a whole, and prominent developers in the PHP community. + +While most of core development is done on a voluntary basis, one of the core PHP developers, Nikita Popov, has recently been [employed by JetBrains][19] to work on the language full time. Another example is the Linux foundation who recently decided to [invest into Zend framework][20]. Employments and acquisitions like these ensure stability for the future development of PHP. + +### Tooling + +Besides the core itself, we've seen an increase in tools around it the past few years. What comes to mind are static analysers like [Psalm][21], created by Vimeo; [Phan][22] and [PHPStan][23]. + +These tools will statically analyse your PHP code and report any type errors, possible bugs etc. In some way, the functionality they provide can be compared to TypeScript, though for now the language isn't transpiled, so no custom syntax is allowed. + +Even though that means we need to rely on docblocks, Rasmus Lerdorf, the original creator of PHP, did mention the idea of [adding a static analysis engine][24] to the core. While there would be lots of potential, it is a huge undertaking. + +Speaking of transpiling, and inspired by the JavaScript community; there have been efforts to extend PHPs syntax in user land. A project called [Pre][25] does exactly that: allow new PHP syntax which is transpiled to normal PHP code. + +While the idea has proven itself in the JavaScript world, it could only work in PHP if proper IDE- and static analysis support was provided. It's a very interesting idea, but has to grow before being able to call it "mainstream". + +### In closing + +All that being said, feel free to still think of PHP as a crappy language. While the language definitely has its drawbacks and 20 years of legacy to carry with it; I can say in confidence that I enjoy working with it. + +In my experience, I'm able to create reliable, maintainable and quality software. The clients I work for are happy with the end result, as am I. + +While it's still possible to do lots of messed up things with PHP, I'd say it's a great choice for web development if used wise and correct. + +Don't you agree? Let me know why! You can reach me via [Twitter][2] or [e-mail][26]. + +-------------------------------------------------------------------------------- + +via: https://stitcher.io/blog/php-in-2019 + +作者:[Brent][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://stitcher.io/blog/php-in-2019 +[b]: https://github.com/lujun9972 +[1]: https://stitcher.io/ +[2]: https://twitter.com/brendt_gd +[3]: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ +[4]: https://github.com/brendt/aggregate.stitcher.io +[5]: https://spatie.be/open-source/packages +[6]: https://www.php.net/supported-versions.php +[7]: https://www.phproundtable.com/episode/what-happened-to-php-6 +[8]: https://kinsta.com/blog/php-benchmarks/ +[9]: https://github.com/the-benchmarker/web-frameworks +[10]: https://symfony.com/ +[11]: https://laravel.com/ +[12]: https://packagist.org/statistics +[13]: https://stitcher.io/resources/img/blog/php-in-2019/packagist.png +[14]: https://www.swoole.co.uk/ +[15]: https://amphp.org/ +[16]: https://reactphp.org/ +[17]: https://externals.io/message/102415#102415 +[18]: https://externals.io/ +[19]: https://blog.jetbrains.com/phpstorm/2019/01/nikita-popov-joins-phpstorm-team/ +[20]: https://getlaminas.org/ +[21]: https://github.com/vimeo/psalm +[22]: https://github.com/phan/phan +[23]: https://github.com/phpstan/phpstan +[24]: https://externals.io/message/101477#101592 +[25]: https://preprocess.io/ +[26]: mailto:brendt@stitcher.io From 65fb1fdde99cadab673afe4300e8ed1272b843bb Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 17 May 2019 10:51:30 +0800 Subject: [PATCH 0474/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20Buil?= =?UTF-8?q?ding=20Smaller=20Container=20Images=20sources/tech/20190516=20B?= =?UTF-8?q?uilding=20Smaller=20Container=20Images.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...90516 Building Smaller Container Images.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20190516 Building Smaller Container Images.md diff --git a/sources/tech/20190516 Building Smaller Container Images.md b/sources/tech/20190516 Building Smaller Container Images.md new file mode 100644 index 0000000000..30ea03f993 --- /dev/null +++ b/sources/tech/20190516 Building Smaller Container Images.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building Smaller Container Images) +[#]: via: (https://fedoramagazine.org/building-smaller-container-images/) +[#]: author: (Muayyad Alsadi https://fedoramagazine.org/author/alsadi/) + +Building Smaller Container Images +====== + +![][1] + +Linux Containers have become a popular topic, making sure that a container image is not bigger than it should be is considered as a good practice. This article give some tips on how to create smaller Fedora container images. + +### microdnf + +Fedora’s DNF is written in Python and and it’s designed to be extensible as it has wide range of plugins. But Fedora has an alternative base container image which uses an smaller package manager called [microdnf][2] written in C. To use this minimal image in a Dockerfile the FROM line should look like this: + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +``` + +This is an important saving if your image does not need typical DNF dependencies like Python. For example, if you are making a NodeJS image. + +### Install and Clean up in one layer + +To save space it’s important to remove repos meta data using _dnf clean all_ or its microdnf equivalent _microdnf clean all_. But you should not do this in two steps because that would actually store those files in a container image layer then mark them for deletion in another layer. To do it properly you should do the installation and cleanup in one step like this + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +RUN microdnf install nodejs && microdnf clean all +``` + +### Modularity with microdnf + +Modularity is a way to offer you different versions of a stack to choose from. For example you might want non-LTS NodeJS version 11 for a project and old LTS NodeJS version 8 for another and latest LTS NodeJS version 10 for another. You can specify which stream using colon + +``` +# dnf module list +# dnf module install nodejs:8 +``` + +The _dnf module install_ command implies two commands one that enables the stream and one that install nodejs from it. + +``` +# dnf module enable nodejs:8 +# dnf install nodejs +``` + +Although microdnf does not offer any command related to modularity, it is possible to enable a module with a configuation file, and libdnf (which microdnf uses) [seems][3] to support modularity streams. The file looks like this + +``` +/etc/dnf/modules.d/nodejs.module +[nodejs] +name=nodejs +stream=8 +profiles= +state=enabled +``` + +A full Dockerfile using modularity with microdnf looks like this: + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +RUN \ + echo -e "[nodejs]\nname=nodejs\nstream=8\nprofiles=\nstate=enabled\n" > /etc/dnf/modules.d/nodejs.module && \ + microdnf install nodejs zopfli findutils busybox && \ + microdnf clean all +``` + +### Multi-staged builds + +In many cases you might have tons of build-time dependencies that are not needed to run the software for example building a Go binary, which statically link dependencies. Multi-stage build are an efficient way to separate the application build and the application runtime. + +For example the Dockerfile below builds [confd][4] a Go application. + +``` +# building container +FROM registry.fedoraproject.org/fedora-minimal AS build +RUN mkdir /go && microdnf install golang && microdnf clean all +WORKDIR /go +RUN export GOPATH=/go; CGO_ENABLED=0 go get github.com/kelseyhightower/confd + +FROM registry.fedoraproject.org/fedora-minimal +WORKDIR / +COPY --from=build /go/bin/confd /usr/local/bin +CMD ["confd"] +``` + +The multi-stage build is done by adding _AS_ after the _FROM_ instruction and by having another _FROM_ from a base container image then using C _OPY –from=_ instruction to copy content from the _build_ container to the second container. + +This Dockerfile can then be built and run using podman + +``` +$ podman build -t myconfd . +$ podman run -it myconfd +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/building-smaller-container-images/ + +作者:[Muayyad Alsadi][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/alsadi/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/smaller-container-images-816x345.jpg +[2]: https://github.com/rpm-software-management/microdnf +[3]: https://bugzilla.redhat.com/show_bug.cgi?id=1575626 +[4]: https://github.com/kelseyhightower/confd From bd821c5e226297d52a3dae9fdef79c2456d23abf Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 May 2019 11:12:12 +0800 Subject: [PATCH 0475/1154] APL:20190510 PHP in 2019.md --- sources/tech/20190510 PHP in 2019.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190510 PHP in 2019.md b/sources/tech/20190510 PHP in 2019.md index ba4705d643..73d2185670 100644 --- a/sources/tech/20190510 PHP in 2019.md +++ b/sources/tech/20190510 PHP in 2019.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 26116788f45da81f882359c119b24863d7bf46ff Mon Sep 17 00:00:00 2001 From: hopefully2333 <787016457@qq.com> Date: Fri, 17 May 2019 18:29:36 +0800 Subject: [PATCH 0476/1154] translated by hopefully2333 translated by hopefully2333 --- ... warning for Nexus data-center switches.md | 81 ------------------ ... warning for Nexus data-center switches.md | 82 +++++++++++++++++++ 2 files changed, 82 insertions(+), 81 deletions(-) delete mode 100644 sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md create mode 100644 translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md diff --git a/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md deleted file mode 100644 index 421f5192b7..0000000000 --- a/sources/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (hopefully2333) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Cisco issues critical security warning for Nexus data-center switches) -[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Cisco issues critical security warning for Nexus data-center switches -====== -Cisco released 40 security advisories around Nexus switches, Firepower firewalls and more -![Thinkstock][1] - -Cisco issued some 40 security advisories today but only one of them was deemed “[critical][2]” – a vulnerability in the Cisco Nexus 9000 Series Application Centric Infrastructure (ACI) Mode data-center switch that could let an attacker secretly access system resources. - -The exposure, which was given a Common Vulnerability Scoring System importance of 9.8 out of 10, is described as a problem with secure shell (SSH) key-management for the Cisco Nexus 9000 that lets a remote attacker to connect to the affected system with the privileges of a root user, Cisco said. - -**[ Read also:[How to plan a software-defined data-center network][3] ]** - -“The vulnerability is due to the presence of a default SSH key pair that is present in all devices. An attacker could exploit this vulnerability by opening an SSH connection via IPv6 to a targeted device using the extracted key materials. This vulnerability is only exploitable over IPv6; IPv4 is not vulnerable," Cisco wrote. - -This vulnerability affects Nexus 9000s if they are running a Cisco NX-OS software release prior to 14.1, and the company said there were no workarounds to address the problem. - -However, Cisco has [released free software updates][4] that address the vulnerability. - -The company also issued a “high” security warning advisory for the Nexus 9000 that involves an exploit that would let attackers execute arbitrary operating-system commands as root on an affected device. To succeed, an attacker would need valid administrator credentials for the device, Cisco said. - -The vulnerability is due to overly broad system-file permissions, [Cisco wrote][5]. An attacker could exploit this vulnerability by authenticating to an affected device, creating a crafted command string and writing this crafted string to a specific file location. - -**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][6] ]** - -Cisco has released software updates that address this vulnerability. - -Two other vulneraries rated “high” also involved the Nexus 9000: - - * [A vulnerability][7] in the background-operations functionality of Cisco Nexus 9000 software could allow an authenticated, local attacker to gain elevated privileges as root on an affected device. The vulnerability is due to insufficient validation of user-supplied files on an affected device. Cisco said an attacker could exploit this vulnerability by logging in to the CLI of the affected device and creating a crafted file in a specific directory on the filesystem. - * A [weakness][7] in the background-operations functionality of the switch software could allow an attacker to login to the CLI of the affected device and create a crafted file in a specific directory on the filesystem. The vulnerability is due to insufficient validation of user-supplied files on an affected device, Cisco said. - - - -Cisco has [released software][4] for these vulnerabilities as well. - -Also part of these security alerts were a number of “high” rated warnings about vulneraries in Cisco’s FirePower firewall series. - -For example Cisco [wrote][8] that multiple vulnerabilities in the Server Message Block Protocol preprocessor detection engine for Cisco Firepower Threat Defense Software could allow an unauthenticated, adjacent or remote attacker to cause a denial of service (DoS) condition. - -Yet [another vulnerability][9] in the internal packet-processing functionality of Cisco Firepower software for the Cisco Firepower 2100 Series could let an unauthenticated, remote attacker cause an affected device to stop processing traffic, resulting in a DOS situation, Cisco said. - -[Software patches][4] are available for these vulnerabilities. - -Other products such as the Cisco [Adaptive Security Virtual Appliance][10], and [Web Security appliance][11] had high priority patches as well. - -Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/02/lock_broken_unlocked_binary_code_security_circuits_protection_privacy_thinkstock_873916354-100750739-large.jpg -[2]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-sshkey -[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html -[4]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html -[5]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-rpe -[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-aci-hw-clock-util -[8]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-smb-snort -[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-dos -[10]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-asa-ipsec-dos -[11]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-wsa-privesc -[12]: https://www.facebook.com/NetworkWorld/ -[13]: https://www.linkedin.com/company/network-world diff --git a/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md new file mode 100644 index 0000000000..c9df2cf407 --- /dev/null +++ b/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (hopefully2333) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco issues critical security warning for Nexus data-center switches) +[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +思科针对 Nexus 数据中心交换机发出危急安全预警 +====== +思科围绕着 Nexus 的交换机、Firepower 防火墙和其他设备,发布了 40 个安全报告。 +![Thinkstock][1] + +今天思科发布了 40 个左右的安全报告,但只有其中的一个被评定为“危急”-思科 Nexus 9000 系列应用中心基础设施(ACI)模式数据中心交换机中的一个漏洞,可能会让攻击者隐秘地访问到系统资源。 + +这个新发现的漏洞,被通用漏洞评分系统给到了 9.8 分(满分 10 分),思科表示,它是思科 Nexus 9000 系列的安全 shell (ssh)密钥管理方面的问题,这个漏洞允许远程攻击者以 root 用户的权限来连接到受影响的系统。 + +**[ 另请阅读:如何规划一个软件定义的数据中心网络 ][3] ]** + +思科表示,“这个漏洞是因为所有的设备都存在一对默认的 ssh 密钥对,攻击者可以使用提取到的密钥材料,并通过 IPv6 来创建连接到目标设备的 SSH 连接。这个漏洞仅能通过 IPv6 来进行利用,IPv4 不会被攻击”。 + +型号为 Nexus 9000 系列且 NX-OS 软件版本在 14.1 之前的设备会受此漏洞的影响,该公司表示没有解决这个问题的办法。 + +然而,思科公司已经为解决这个漏洞发布了免费的软件更新。 + +该公司同样对 Nexus 9000 系列发布了一个“高危”级别的安全预警报告,报告中表示存在一种攻击,允许攻击者以 root 用户权限在受影响的设备上执行任意操作系统命令。思科表示,如果要用这种方式攻击成功,攻击者需要对应设备的有效的管理员用户凭证。 + +思科表示,这个漏洞是由于过于宽泛的系统文件权限造成的。攻击者可以通过向受影响的设备进行认证,构造一个精心设计的命令字符串,并将这个字符串写入到特定位置的文件里。攻击者通过这种方式来利用这个漏洞。 + +**[[通过 PluralSight 的综合在线课程成为一名认证信息安全系统工程师。现在提供为期 10 天的免费试用!][6] ]** + +思科发布了解决这个漏洞的软件更新。 + +另外两个被评为“高危”级别的漏洞的影响范围同样包括 Nexus 9000 系列: + +思科 Nexus 9000 系列软件后台操作功能中的漏洞,能够允许一个已认证的本地攻击者在受影响的设备上提升到 root 权限。这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。思科表示,攻击者可以通过登录到受影响设备的命令行界面,并在文件系统的特定目录中构造一个精心设计过的文件,以此来利用这个漏洞。 + +交换机软件后台操作功能中的弱点能够允许攻击者登录到受影响设备的命令行界面,并在文件系统的特定目录里创建一个精心构造过的文件。思科表示,这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。 + + + +思科同样为这些漏洞发布了软件更新。 + +此外,这些安全警告中的一部分是针对思科 FirePower 防火墙系列中大量的“高危”漏洞警告。 + +例如,思科写道,思科 Firepower 威胁防御软件的 SMB 协议预处理检测引擎中的多个漏洞能够允许未认证的相邻、远程攻击者造成拒绝服务攻击(DoS)的情况。 + +思科表示,思科 Firepower 2100 系列中思科 Firepower 软件里的内部数据包处理功能有另一个漏洞,能够让未认证的远程攻击者造成受影响的设备停止处理流量,从而导致 DOS 的情况。 + +软件补丁可用于这些漏洞。 + +其他的产品,比如思科自适应安全虚拟设备和 web 安全设备同样也有高优先级的补丁。 + +加入 Facebook 和 LinkedIn 中的网络世界社区,在最上面的主题里做评论。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[hopefully2333](https://github.com/hopefully2333) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/lock_broken_unlocked_binary_code_security_circuits_protection_privacy_thinkstock_873916354-100750739-large.jpg +[2]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-sshkey +[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[4]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html +[5]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-rpe +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-aci-hw-clock-util +[8]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-smb-snort +[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-dos +[10]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-asa-ipsec-dos +[11]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-wsa-privesc +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From 40b0fa5e6a159963e10bb4ef45df944af4255e71 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 May 2019 21:38:22 +0800 Subject: [PATCH 0477/1154] TSL:20190510 PHP in 2019.md --- sources/tech/20190510 PHP in 2019.md | 170 ------------------------ translated/tech/20190510 PHP in 2019.md | 169 +++++++++++++++++++++++ 2 files changed, 169 insertions(+), 170 deletions(-) delete mode 100644 sources/tech/20190510 PHP in 2019.md create mode 100644 translated/tech/20190510 PHP in 2019.md diff --git a/sources/tech/20190510 PHP in 2019.md b/sources/tech/20190510 PHP in 2019.md deleted file mode 100644 index 73d2185670..0000000000 --- a/sources/tech/20190510 PHP in 2019.md +++ /dev/null @@ -1,170 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (PHP in 2019) -[#]: via: (https://stitcher.io/blog/php-in-2019) -[#]: author: (Brent https://stitcher.io/blog/php-in-2019) - -PHP in 2019 -====== - - -Do you remember the popular "[PHP: a fractal of bad design][3]" blog post? The first time I read it, I was working in a crappy place with lots of legacy PHP projects. This article got me wondering whether I should just quit and go do something entirely different than programming. - -Luckily for me I was able to switch jobs shortly thereafter and, more importantly, PHP managed to evolve quite a bit since the 5.* days. Today I'm addressing the people who are either not programming in PHP anymore, or are stuck in legacy projects. - -Spoiler: some things still suck today, just like almost every programming language has its quirks. Many core functions still have their inconsistent method signatures, there are still confusing configuration settings, there are still many developers out there writing crappy code — because they have to, or because they don't know better. - -Today I want to look at the bright side: let's focus on the things that have changed and ways to write clean and maintainable PHP code. I want to ask you to set aside any prejudice for just a few minutes. - -Afterwards you're free to think exactly the same about PHP as you did before. Though chances are you will be surprised by some of the improvements made to PHP in the last few years. - -### TL;DR - - * PHP is actively developed with a new release each year - * Performance since the PHP 5 era has doubled, if not tripled - * There's a extremely active eco system of frameworks, packages and platforms - * PHP has had lots of new features added to it over the past few years, and the language keeps evolving - * Tooling like static analysers has matured over the past years, and only keeps growing - - - -Update: people asked me to show some actual code. I'm happy to say that's possible! Here's the [source code][4] of one of my hobby projects, written in PHP and Laravel; and [here][5] is a list of a few hundred OSS packages we maintain at our office. Both are good examples of what modern PHP projects look like. - -Let's start. - -### History summarized - -For good measure, let's quickly review PHP's release cycle today. We're at PHP 7.3 now, with 7.4 expected at the end of 2019. PHP 8.0 will be the next version after 7.4. - -Ever since the late 5.* era, the core team tries to keep a yearly release cycle, and have succeeded in doing so for the past four years. - -In general, every new release is actively supported for two years, and gets one more year of "security fixes only". The goal is to motivate PHP developers to stay up-to-date as much as possible: small upgrades every year are way more easy than making the jump between 5.4 to 7.0, for example. - -An active overview of PHP's timeline can be found [here][6]. - -Lastly, PHP 5.6 was the latest 5.* release, with 7.0 being the next one. If you want to know what happened to PHP 6, you can listen to the [PHP Roundtable podcast][7]. - -With that out of the way, let's debunk some common misconceptions about modern PHP. - -### PHP's performance -Back in the 5.* days, PHP's performance was… average at best. With 7.0 though, big pieces of PHP's core were rewritten from the ground up, resulting in two or three times performance increases. - -Words don't suffice though. Let's look at benchmarks. Luckily other people have spent lots of time in benchmarking PHP performance. I find that [Kinsta][8] has a good updated list. - -Ever since the 7.0 upgrade, performance only increased. So much that PHP web applications have comparable — in some cases better — performance than web frameworks in other languages. Take a look at this [extensive benchmark suite][9]. - -Sure PHP frameworks won't outperform C and Rust, but they do quite a lot better than Rails or Django, and are comparable to ExpressJS. - -### Frameworks and ecosystem - -Speaking of frameworks: PHP isn't just WordPress anymore. Let me tell you something as a professional PHP developer: WordPress isn't in any way representative of the contemporary ecosystem. - -In general there are two major web application frameworks, and a few smaller ones: [Symfony][10] and [Laravel][11]. Sure there's also Zend, Yii, Cake, Code Igniter etc. — but if you want to know what modern PHP development looks like, you're good with one of these two. - -Both frameworks have a large ecosystem of packages and products. Ranging from admin panels and CRMs to standalone packages, CI to profilers, numerous services like web sockets servers, queuing managers, payment integrations; honestly there's too much to list. - -These frameworks are meant for actual development though. If you're in need of pure content management, platforms like WordPress and CraftCMS are only improving more and more. - -One way to measure the current state of PHP's ecosystem is to look at Packagist, the main package repository for PHP. It has seen exponential growth. With ±25 million downloads a day, it's fair to say that the PHP ecosystem isn't the small underdog it used to be. - -Take a look at this graph, listing the amount of packages and versions over time. It can also be found on [the Packagist website][12]. - -![][13] - -Besides application frameworks and CMSs, we've also seen the rise of asynchronous frameworks the past years. - -These are frameworks and servers, written in PHP or other languages, that allow users to run truly asynchronous PHP. A few examples include [Swoole][14], [Amp][15] and [ReactPHP][16]. - -Since we've ventured into the async world, stuff like web sockets and applications with lots of IO have become actually relevant in the PHP world. - -There has also been talk on the internals mailing list — the place where core developers discuss the development of the language — to [add libuv to the core][17]. For those unaware of libuv: it's the same library Node.js uses to allow all its asynchronicity. - -### The language itself - -While `async` and `await` are not available yet, lots of improvements to the language itself have been made over the past years. Here's a non-exhaustive list of new features in PHP: - -+ Short closures -+ Null coalescing operator -+ Traits -+ Typed properties -+ Spread operator -+ JIT compiler -+ FFI -+ Anonymous classes -+ Return type declarations -+ Contemporary cryptography -+ Generators -+ Lots more - -While we're on the topic of language features, let's also talk about the process of how the language is developed today. There's an active core team of volunteers who move the language forward, though the community is allowed to propose RFCs. - -Next, these RFCs are discussed on the "internals" mailing list, which can also be [read online][18]. Before a new language feature is added, there must be a vote. Only RFC with at least a 2/3 majority are allowed in the core. - -There are probably around 100 people allowed to vote, though you're not required to vote on each RFC. Members of the core team are of course allowed to vote, they have to maintain the code base. Besides them, there's a group of people who have been individually picked from the PHP community. These people include maintainers of the PHP docs, contributors to the PHP project as a whole, and prominent developers in the PHP community. - -While most of core development is done on a voluntary basis, one of the core PHP developers, Nikita Popov, has recently been [employed by JetBrains][19] to work on the language full time. Another example is the Linux foundation who recently decided to [invest into Zend framework][20]. Employments and acquisitions like these ensure stability for the future development of PHP. - -### Tooling - -Besides the core itself, we've seen an increase in tools around it the past few years. What comes to mind are static analysers like [Psalm][21], created by Vimeo; [Phan][22] and [PHPStan][23]. - -These tools will statically analyse your PHP code and report any type errors, possible bugs etc. In some way, the functionality they provide can be compared to TypeScript, though for now the language isn't transpiled, so no custom syntax is allowed. - -Even though that means we need to rely on docblocks, Rasmus Lerdorf, the original creator of PHP, did mention the idea of [adding a static analysis engine][24] to the core. While there would be lots of potential, it is a huge undertaking. - -Speaking of transpiling, and inspired by the JavaScript community; there have been efforts to extend PHPs syntax in user land. A project called [Pre][25] does exactly that: allow new PHP syntax which is transpiled to normal PHP code. - -While the idea has proven itself in the JavaScript world, it could only work in PHP if proper IDE- and static analysis support was provided. It's a very interesting idea, but has to grow before being able to call it "mainstream". - -### In closing - -All that being said, feel free to still think of PHP as a crappy language. While the language definitely has its drawbacks and 20 years of legacy to carry with it; I can say in confidence that I enjoy working with it. - -In my experience, I'm able to create reliable, maintainable and quality software. The clients I work for are happy with the end result, as am I. - -While it's still possible to do lots of messed up things with PHP, I'd say it's a great choice for web development if used wise and correct. - -Don't you agree? Let me know why! You can reach me via [Twitter][2] or [e-mail][26]. - --------------------------------------------------------------------------------- - -via: https://stitcher.io/blog/php-in-2019 - -作者:[Brent][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://stitcher.io/blog/php-in-2019 -[b]: https://github.com/lujun9972 -[1]: https://stitcher.io/ -[2]: https://twitter.com/brendt_gd -[3]: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ -[4]: https://github.com/brendt/aggregate.stitcher.io -[5]: https://spatie.be/open-source/packages -[6]: https://www.php.net/supported-versions.php -[7]: https://www.phproundtable.com/episode/what-happened-to-php-6 -[8]: https://kinsta.com/blog/php-benchmarks/ -[9]: https://github.com/the-benchmarker/web-frameworks -[10]: https://symfony.com/ -[11]: https://laravel.com/ -[12]: https://packagist.org/statistics -[13]: https://stitcher.io/resources/img/blog/php-in-2019/packagist.png -[14]: https://www.swoole.co.uk/ -[15]: https://amphp.org/ -[16]: https://reactphp.org/ -[17]: https://externals.io/message/102415#102415 -[18]: https://externals.io/ -[19]: https://blog.jetbrains.com/phpstorm/2019/01/nikita-popov-joins-phpstorm-team/ -[20]: https://getlaminas.org/ -[21]: https://github.com/vimeo/psalm -[22]: https://github.com/phan/phan -[23]: https://github.com/phpstan/phpstan -[24]: https://externals.io/message/101477#101592 -[25]: https://preprocess.io/ -[26]: mailto:brendt@stitcher.io diff --git a/translated/tech/20190510 PHP in 2019.md b/translated/tech/20190510 PHP in 2019.md new file mode 100644 index 0000000000..e8da83742d --- /dev/null +++ b/translated/tech/20190510 PHP in 2019.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PHP in 2019) +[#]: via: (https://stitcher.io/blog/php-in-2019) +[#]: author: (Brent https://stitcher.io/blog/php-in-2019) + +9102 年的 PHP +====== + +你还记得篇流行的《[PHP:糟糕设计的分形][3]》博客文章吗?我第一次读它时,我在一个有很多遗留的 PHP 项目的糟糕地方工作。这篇文章让我去思考我是否应该放弃并去做与编程完全不同的事情。 + +幸运的是,我之后很快就换了工作,更重要的是,自从 5.x 版本以来,PHP 成功地进步了很多。今天,我在向那些不再使用 PHP 编程,或者陷入遗留项目的人们致敬。 + +剧透:今天有些事情仍然很糟糕,就像几乎每种编程语言都有它的怪癖一样。许多核心功能仍然有不一致的调用方法,仍然有令人困惑的配置设置,仍有许多开发人员在那里写蹩脚的代码 —— 因为他们必须如此,或因为他们不知道更好的写法。 + +今天我想看看好的一面:让我们关注已经发生变化的事情以及编写干净而可维护的 PHP 代码的方法。在此之前,我想请你暂时搁置任何偏见。 + +之后,你可以像以前一样自由地对 PHP 发表你的看法。虽然你可能会对 PHP 在过去的几年里的一些改进感到惊讶。 + +### 提前看结论 + +* PHP 在积极开发,每年都有新版本 +* 自 PHP 5 时代以来的性能翻倍,如果不是三倍的话 +* 有一个非常活跃的框架、包和平台的生态系统 +* PHP 在过去几年中添加了许多新功能,并且这种语言在不断发展 +* 像静态分析这样的工具在过去几年中已经成熟,并且一直保持增长 +   +更新:人们让我展示一些实际的代码。我觉得这没问题!这是我的一个爱好项目的[源代码][4],用 PHP 和 Laravel 编写;[这里][5]列出了我们在办公室维护的几百个自由开源软件包。这两者都是现代 PHP 项目的好例子。 + +开始吧。 + +### 历史总结 + +出于更好地衡量的目的,让我们快速回顾一下如今的 PHP 发布周期。我们现在的 PHP 为 7.3,预计在 2019 年底为 7.4。PHP 8.0 将是 7.4 之后的下一个版本。 + +自从 5.x 时代以来,核心团队试图保持每年的发布周期,并且在过去的四年中成功地做到了。 + +一般来说,每个新版本都会在两年内得到积极支持,并再获得一年以上的“安全修复”。其目标是激励 PHP 开发人员尽可能保持最新:例如,每年进行小规模升级比在 5.4 到 7.0 之间跳转更容易。 + +可以在 [这里][6] 找到 PHP 时间轴的活动概述。 + +最后,PHP 5.6 是最新的 5.x 版本,而 7.0 是 6.x 的下一个版本。 如果你想知道 PHP 6 发生了什么,你可以听 [PHP Roundtable 播客][7]。 + +了解了这个,让我们揭穿一些关于现代 PHP 的常见误解。 + +### PHP的性能 + +早在 5.x 时代,PHP 的表现就是……嗯,平均水平。但是在 7.0 版本中,PHP 的核心部分从头开始重写,导致性能提升了两到三倍! + +但光是嘴说是不够的。我们来看看基准测试。幸运的是,人们花了很多时间来对 PHP 性能进行基准测试。 我发现 [Kinsta][8] 有一个很好的更新列表。 + +自 7.0 升级以来,性能就只有提升而没有回退。PHP Web 应用程序的性能就可与其他语言中的 Web 框架相提并论,甚至在某些情况下更好。你可以看看这个[广泛的基准测试套件][9]。 + +当然 PHP 框架不会胜过 C 和 Rust,但它们比 Rails 或 Django 要好得多,并且与 ExpressJS 相当。 + +### 框架和生态系统 + +说到框架:PHP 可不仅仅是 WordPress。让我告诉你,某些专业的 PHP 开发人员:WordPress 绝不代表当代的 PHP 生态系统。 + +一般来说,有两个主要的 Web 应用程序框架,[Symfony][10] 和 [Laravel][11],以及一些较小的应用程序框架。当然还有 Zend、Yii、Cake、Code Igniter 等等,但是如果你想知道现代 PHP 开发是怎么样的,这两者之一都是很好的对象。 + +这两个框架都有一个庞大的包和产品的生态系统。从管理面板和 CRM 到独立软件包,从 CI 到分析器,以及几个 Web 套接字服务器、队列管理器、支付集成等众多服务。老实说,要列出的内容太多了。 + +这些框架虽然适用于实际开发。如果你只是需要个内容管理系统(CMS),WordPress 和 CraftCMS 等平台会越来越好。 + +衡量 PHP 生态系统当前状态的一种方法是查看 Packagist,这是 PHP 的主要软件包存储库。它已呈指数级增长。每天下载量达到 2500 万次,这可以说 PHP 生态系统已不再是以前的小型弱势群体。 + +请查看此图表,它列出一段时间内的软件包和版本数量。它也可以在 [Packagist 网站][12]上找到。 + +![][13] + +除了应用程序框架和 CMS 之外,我们还看到过去几年里异步框架的兴起。 + +这些是用 PHP 或其他语言编写的框架和服务器,允许用户运行真正的异步 PHP。这些例子包括 [Swoole][14](创始人韩天峰),以及 [Amp][15] 和 [ReactPHP][16]。 + +我们已经进入了异步世界冒险,像 Web 套接字和具有大量 IO 的应用程序之类的东西在 PHP 世界中已经变得非常重要。 + +在内部邮件列表里(核心开发人员讨论语言开发的地方)已经谈到了[将 libuv 添加到核心][17]。如果你还不知道 libuv:Node.js 全赖它提供了异步性。 + +### 语言本身 + +虽然尚未提供 `async` 和 `await`,但在过去几年中,PHP 语言本身已经有了很多改进。这是 PHP 中新功能的非详尽列表: + + ++ [短闭包](https://stitcher.io/blog/short-closures-in-php)(箭头函数) ++ [Null 合并操作符](https://stitcher.io/blog/shorthand-comparisons-in-php#null-coalescing-operator)(`??`) ++ [Trait](https://www.php.net/manual/en/language.oop5.traits.php)(一种代码重用方式) ++ [属性类型](https://stitcher.io/blog/new-in-php-74#typed-properties-rfc) ++ [展开操作符](https://wiki.php.net/rfc/argument_unpacking)(参数解包 `...`) ++ [JIT 编译器](https://wiki.php.net/rfc/jit) ++ [FFI](https://wiki.php.net/rfc/ffi)(外部函数接口) ++ [匿名类](https://www.php.net/manual/en/language.oop5.anonymous.php) ++ [返回类型声明](https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration) ++ [现代化的加密支持](https://wiki.php.net/rfc/libsodium) ++ [生成器](https://wiki.php.net/rfc/generators) ++ [等等](https://www.php.net/ChangeLog-7.php) + +当我们讨论语言功能时,我们还要谈谈当今语言的发展过程。虽然社区可以提出 RFC,但是得有一个活跃的志愿者核心团队才能推着语言前进。 + +接下来,这些 RFC 将在“内部”邮件列表中进行讨论,这个邮件列表也可以[在线阅读][18]。在添加新语言功能之前,必须进行投票。只有得到了至少 2/3 多数的 RFC 才能进入核心。 + +可能有大约 100 人能投票,但不需要对每个 RFC 进行投票。核心团队的成员当然可以投票,他们是维护代码库的人。除了他们之外,还有一群人从 PHP 社区中被单独挑选出来。这些人包括 PHP 文档的维护者,对 PHP 项目整体有贡献的人,以及 PHP 社区中的杰出开发人员。 + +虽然大多数核心开发都是在自愿的基础上完成的,但其中一位核心 PHP 开发人员 Nikita Popov 最近受雇于 [JetBrains][19] 全职从事于该语言。另一个例子是 Linux 基金会最近决定[投资 Zend 框架][20]。像这样的雇佣和收购确保了 PHP 未来发展的稳定性。 + +### 工具 + +除了核心本身,我们看到过去几年中围绕它的工具有所增加。浮现于我脑海中的是静态分析器,如由 Vimeo 创建 [Psalm][21],以及 [Phan][22] 和 [PHPStan][23]。 + +这些工具将静态分析你的 PHP 代码并报告任何的类型错误和可能的错误等。在某种程度上,它们提供的功能可以与 TypeScript 进行比较,但是现在这种语言不能转译transpiling,因此不支持使用自定义语法。 + +尽管这意味着我们需要依赖 docblocks,但是 PHP 的原创建者 Rasmus Lerdorf 确实提到了[添加静态分析引擎][24]到核心的想法。虽然会有很多潜力,但这是一项艰巨的任务。 + +说到转译,以及受到 JavaScript 社区的启发;他们已经努力在用户领域中扩展 PHP 语法。一个名为 [Pre][25] 的项目正是如此:允许新的 PHP 语法转译为普通的 PHP 代码。 + +虽然这个思路已经在 JavaScript 世界中被证明了,但如果提供了适当的 IDE 和静态分析支持,它就能在 PHP 中工作了。这是一个非常有趣的想法,但必须发展起来才能称之为“主流”。 + +### 结语 + +尽管如此,你仍然可以将 PHP 视为一种糟糕的语言。虽然这种语言肯定有它的缺点和与之而来的 20 年的遗产;但我可以放胆地说,我喜欢和它一起工作。 + +根据我的经验,我能够创建可靠、可维护和高质量的软件。我工作的客户对最终结果感到满意,就像我一样。 + +尽管仍然可以用 PHP 做很多乱七八糟的事情,但我认为如果明智和正确地使用的话,它是 Web 开发的绝佳选择。 + +你不同意吗?让我知道为什么!你可以通过 [Twitter][2] 或 [电子邮件][26] 与我联系。 + +-------------------------------------------------------------------------------- + +via: https://stitcher.io/blog/php-in-2019 + +作者:[Brent][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://stitcher.io/blog/php-in-2019 +[b]: https://github.com/lujun9972 +[1]: https://stitcher.io/ +[2]: https://twitter.com/brendt_gd +[3]: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ +[4]: https://github.com/brendt/aggregate.stitcher.io +[5]: https://spatie.be/open-source/packages +[6]: https://www.php.net/supported-versions.php +[7]: https://www.phproundtable.com/episode/what-happened-to-php-6 +[8]: https://kinsta.com/blog/php-benchmarks/ +[9]: https://github.com/the-benchmarker/web-frameworks +[10]: https://symfony.com/ +[11]: https://laravel.com/ +[12]: https://packagist.org/statistics +[13]: https://stitcher.io/resources/img/blog/php-in-2019/packagist.png +[14]: https://www.swoole.co.uk/ +[15]: https://amphp.org/ +[16]: https://reactphp.org/ +[17]: https://externals.io/message/102415#102415 +[18]: https://externals.io/ +[19]: https://blog.jetbrains.com/phpstorm/2019/01/nikita-popov-joins-phpstorm-team/ +[20]: https://getlaminas.org/ +[21]: https://github.com/vimeo/psalm +[22]: https://github.com/phan/phan +[23]: https://github.com/phpstan/phpstan +[24]: https://externals.io/message/101477#101592 +[25]: https://preprocess.io/ +[26]: mailto:brendt@stitcher.io From f0ad57a4e3037a2be5861b1758a04ddf082dece9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 May 2019 23:53:11 +0800 Subject: [PATCH 0478/1154] PRF:20190419 Building scalable social media sentiment analysis services in Python.md @MjSeven --- ...a sentiment analysis services in Python.md | 127 ++++++++++-------- 1 file changed, 70 insertions(+), 57 deletions(-) diff --git a/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md index a216ce8495..1df844139d 100644 --- a/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md +++ b/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Building scalable social media sentiment analysis services in Python) @@ -9,8 +9,10 @@ 使用 Python 构建可扩展的社交媒体情感分析服务 ====== -学习如何使用 spaCy、vaderSentiment、Flask 和 Python 来为你的工作添加情感分析能力。 -![Tall building with windows][1] + +> 学习如何使用 spaCy、vaderSentiment、Flask 和 Python 来为你的作品添加情感分析能力。 + +![Tall building with windows](https://img.linux.net.cn/data/attachment/album/201905/17/235241zr0cs4czu4psmrl6.jpg) 本系列的[第一部分][2]提供了情感分析工作原理的一些背景知识,现在让我们研究如何将这些功能添加到你的设计中。 @@ -20,7 +22,7 @@ * 一个终端 shell * shell 中的 Python 语言二进制文件(3.4+ 版本) - * 用于安装 Python 包的 **pip** 命令 + * 用于安装 Python 包的 `pip` 命令 * (可选)一个 [Python 虚拟环境][3]使你的工作与系统隔离开来 #### 配置环境 @@ -53,33 +55,44 @@ Type "help", "copyright", "credits" or "license" for more information. >>> ``` -_(你的 Python 解释器版本打印可能与此不同。)_ +*(你的 Python 解释器版本打印可能与此不同。)* - 1. 导入所需模块: - ``` - >>> import spacy - >>> from vaderSentiment import vaderSentiment - ``` -2. 从 spaCy 加载英语语言模型: - ``` - >>> english = spacy.load("en_core_web_sm") - ``` - 3. 处理一段文本。本例展示了一个非常简单的句子,我们希望它能给我们带来些许积极的情感: - ``` - >>> result = english("I like to eat applesauce with sugar and cinnamon.") - ``` -4. 从处理后的结果中收集句子。SpaCy 已识别并处理短语中的实体,这一步为每个句子生成情感(即时在本例中只有一个句子): - ``` - >>> sentences = [str(s) for s in result.sents] - ``` - 5. 使用 vaderSentiments 创建一个分析器: - ``` - >>> analyzer = vaderSentiment.SentimentIntensityAnalyzer() - ``` - 6. 对句子进行情感分析: - ``` - >>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] - ``` +1、导入所需模块: + +``` +>>> import spacy +>>> from vaderSentiment import vaderSentiment +``` + +2、从 spaCy 加载英语语言模型: + +``` +>>> english = spacy.load("en_core_web_sm") +``` + +3、处理一段文本。本例展示了一个非常简单的句子,我们希望它能给我们带来些许积极的情感: + +``` +>>> result = english("I like to eat applesauce with sugar and cinnamon.") +``` + +4、从处理后的结果中收集句子。SpaCy 已识别并处理短语中的实体,这一步为每个句子生成情感(即时在本例中只有一个句子): + +``` +>>> sentences = [str(s) for s in result.sents] +``` + +5、使用 vaderSentiments 创建一个分析器: + +``` +>>> analyzer = vaderSentiment.SentimentIntensityAnalyzer() +``` + +6、对句子进行情感分析: + +``` +>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] +``` `sentiment` 变量现在包含例句的极性分数。打印出这个值,看看它是如何分析这个句子的。 @@ -90,7 +103,7 @@ _(你的 Python 解释器版本打印可能与此不同。)_ 这个结构是什么意思? -表面上,这是一个只有一个字典对象的数组。如果有多个句子,那么每个句子都会对应一个字典对象。字典中有四个键对应不同类型的情感。**neg** 键表示负面情感,因为在本例中没有报告任何负面情感,**0.0** 值证明了这一点。**neu** 键表示中性情感,它的得分相当高,为**0.737**(最高为 **1.0**)。**pos** 键代表积极情感,得分适中,为 **0.263**。最后,**cmpound** 键代表文本的总体得分,它可以从负数到正数,**0.3612** 表示积极方面的情感多一点。 +表面上,这是一个只有一个字典对象的数组。如果有多个句子,那么每个句子都会对应一个字典对象。字典中有四个键对应不同类型的情感。`neg` 键表示负面情感,因为在本例中没有报告任何负面情感,`0.0` 值证明了这一点。`neu` 键表示中性情感,它的得分相当高,为 `0.737`(最高为 `1.0`)。`pos` 键代表积极情感,得分适中,为 `0.263`。最后,`cmpound` 键代表文本的总体得分,它可以从负数到正数,`0.3612` 表示积极方面的情感多一点。 要查看这些值可能如何变化,你可以使用已输入的代码做一个小实验。以下代码块显示了如何对类似句子的情感评分的评估。 @@ -113,9 +126,9 @@ _(你的 Python 解释器版本打印可能与此不同。)_ #### 前提条件 * 一个终端 shell - * shell 中的 Python 语言二进制文件(3.4+版本) - * 安装 Python 包的 **pip** 命令 - * **curl** 命令 + * shell 中的 Python 语言二进制文件(3.4+ 版本) + * 安装 Python 包的 `pip` 命令 + * `curl` 命令 * 一个文本编辑器 * (可选) 一个 [Python 虚拟环境][3]使你的工作与系统隔离开来 @@ -123,19 +136,21 @@ _(你的 Python 解释器版本打印可能与此不同。)_ 这个环境几乎与上一节中的环境相同,唯一的区别是在 Python 环境中添加了 Flask 包。 - 1. 安装所需依赖项: - ``` - pip install spacy vaderSentiment flask - ``` -2. 安装 spaCy 的英语语言模型: - ``` - python -m spacy download en_core_web_sm - ``` +1、安装所需依赖项: +``` +pip install spacy vaderSentiment flask +``` + +2、安装 spaCy 的英语语言模型: + +``` +python -m spacy download en_core_web_sm +``` #### 创建应用程序文件 -打开编辑器,创建一个名为 **app.py** 的文件。添加以下内容 _(不用担心,我们将解释每一行)_ : +打开编辑器,创建一个名为 `app.py` 的文件。添加以下内容 *(不用担心,我们将解释每一行)*: ``` @@ -179,10 +194,9 @@ analyzer = vader.SentimentIntensityAnalyzer() english = spacy.load("en_core_web_sm") ``` -接下来的三行代码创建了一些全局变量。第一个变量 **app**,它是 Flask 用于创建 HTTP 路由的主要入口点。第二个变量 **analyzer** 与上一个示例中使用的类型相同,它将用于生成情感分数。最后一个变量 **english** 也与上一个示例中使用的类型相同,它将用于注释和标记初始文本输入。 - -你可能想知道为什么全局声明这些变量。对于 **app** 变量,这是许多 Flask 应用程序的标准过程。但是,对于 **analyzer** 和 **english** 变量,将它们设置为全局变量的决定是基于与所涉及的类关联的加载时间。虽然加载时间可能看起来很短,但是当它在 HTTP 服务器的上下文中运行时,这些延迟会对性能产生负面影响。 +接下来的三行代码创建了一些全局变量。第一个变量 `app`,它是 Flask 用于创建 HTTP 路由的主要入口点。第二个变量 `analyzer` 与上一个示例中使用的类型相同,它将用于生成情感分数。最后一个变量 `english` 也与上一个示例中使用的类型相同,它将用于注释和标记初始文本输入。 +你可能想知道为什么全局声明这些变量。对于 `app` 变量,这是许多 Flask 应用程序的标准过程。但是,对于 `analyzer` 和 `english` 变量,将它们设置为全局变量的决定是基于与所涉及的类关联的加载时间。虽然加载时间可能看起来很短,但是当它在 HTTP 服务器的上下文中运行时,这些延迟会对性能产生负面影响。 ``` def get_sentiments(text): @@ -192,8 +206,7 @@ def get_sentiments(text): return sentiments ``` -这部分是服务的核心 -- 一个用于从一串文本生成情感值的函数。你可以看到此函数中的操作对应于你之前在 Python 解释器中运行的命令。这里它们被封装在一个函数定义中,**text** 源作为文本变量传入,最后 **sentiments** 变量返回给调用者。 - +这部分是服务的核心 —— 一个用于从一串文本生成情感值的函数。你可以看到此函数中的操作对应于你之前在 Python 解释器中运行的命令。这里它们被封装在一个函数定义中,`text` 源作为文本变量传入,最后 `sentiments` 变量返回给调用者。 ``` @app.route("/", methods=["POST", "GET"]) @@ -206,11 +219,11 @@ def index(): return flask.json.dumps(sentiments) ``` -源文件的最后一个函数包含了指导 Flask 如何为服务配置 HTTP 服务器的逻辑。它从一行开始,该行将 HTTP 路由 **/** 与请求方法 **POST** 和 **GET** 相关联。 +源文件的最后一个函数包含了指导 Flask 如何为服务配置 HTTP 服务器的逻辑。它从一行开始,该行将 HTTP 路由 `/` 与请求方法 `POST` 和 `GET` 相关联。 -在函数定义行之后,**if** 子句将检测请求方法是否为 **GET**。如果用户向服务发送此请求,那么下面的行将返回一条指示如何访问服务器的文本消息。这主要是为了方便最终用户。 +在函数定义行之后,`if` 子句将检测请求方法是否为 `GET`。如果用户向服务发送此请求,那么下面的行将返回一条指示如何访问服务器的文本消息。这主要是为了方便最终用户。 -下一行使用 **flask.request** 对象来获取请求的主体,该主体应包含要处理的文本字符串。**decode** 函数将字节数组转换为可用的格式化字符串。经过解码的文本消息被传递给 **get_sentiments** 函数以生成情感分数。最后,分数通过 HTTP 框架返回给用户。 +下一行使用 `flask.request` 对象来获取请求的主体,该主体应包含要处理的文本字符串。`decode` 函数将字节数组转换为可用的格式化字符串。经过解码的文本消息被传递给 `get_sentiments` 函数以生成情感分数。最后,分数通过 HTTP 框架返回给用户。 你现在应该保存文件,如果尚未保存,那么返回 shell。 @@ -222,7 +235,7 @@ def index(): FLASK_APP=app.py flask run ``` -现在,你将在 shell 中看到来自服务器的一些输出,并且服务器将处于运行状态。要测试服务器是否正在运行,你需要打开第二个 shell 并使用 **curl** 命令。 +现在,你将在 shell 中看到来自服务器的一些输出,并且服务器将处于运行状态。要测试服务器是否正在运行,你需要打开第二个 shell 并使用 `curl` 命令。 首先,输入以下命令检查是否打印了指令信息: @@ -252,11 +265,11 @@ curl http://localhost:5000 --header "Content-Type: application/json" --data "I l ### 继续探索 -现在你已经了解了自然语言处理和情感分析背后的原理和机制,下面是进一步发现探索主题的一些方法。 +现在你已经了解了自然语言处理和情感分析背后的原理和机制,下面是进一步发现探索该主题的一些方法。 #### 在 OpenShift 上创建流式情感分析器 -虽然创建本地应用程序来研究情绪分析很方便,但是接下来需要能够部署应用程序以实现更广泛的用途。按照[ Radnaalytics.io][11] 提供的指导和代码进行操作,你将学习如何创建一个情感分析仪,可以集装箱化并部署到 Kubernetes 平台。你还将了解如何将 APache Kafka 用作事件驱动消息传递的框架,以及如何将 Apache Spark 用作情绪分析的分布式计算平台。 +虽然创建本地应用程序来研究情绪分析很方便,但是接下来需要能够部署应用程序以实现更广泛的用途。按照[Radnaalytics.io][11] 提供的指导和代码进行操作,你将学习如何创建一个情感分析仪,可以容器化并部署到 Kubernetes 平台。你还将了解如何将 Apache Kafka 用作事件驱动消息传递的框架,以及如何将 Apache Spark 用作情绪分析的分布式计算平台。 #### 使用 Twitter API 发现实时数据 @@ -266,17 +279,17 @@ curl http://localhost:5000 --header "Content-Type: application/json" --data "I l via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable -作者:[Michael McCune ][a] +作者:[Michael McCune][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/elmiko/users/jschlessman [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) -[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-1 +[2]: https://linux.cn/article-10852-1.html [3]: https://virtualenv.pypa.io/en/stable/ [4]: https://pypi.org/project/spacy/ [5]: https://pypi.org/project/vaderSentiment/ From 19392e8e58ea2607aa4dc56076ff25cd50853cde Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 May 2019 23:54:18 +0800 Subject: [PATCH 0479/1154] PUB:20190419 Building scalable social media sentiment analysis services in Python.md @MjSeven https://linux.cn/article-10867-1.html --- ...able social media sentiment analysis services in Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190419 Building scalable social media sentiment analysis services in Python.md (99%) diff --git a/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md b/published/20190419 Building scalable social media sentiment analysis services in Python.md similarity index 99% rename from translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md rename to published/20190419 Building scalable social media sentiment analysis services in Python.md index 1df844139d..dd2dadd739 100644 --- a/translated/tech/20190419 Building scalable social media sentiment analysis services in Python.md +++ b/published/20190419 Building scalable social media sentiment analysis services in Python.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10867-1.html) [#]: subject: (Building scalable social media sentiment analysis services in Python) [#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable) [#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) From 3baa16a9ff181b6161e86c28d0fdd2264759c94c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 May 2019 00:21:39 +0800 Subject: [PATCH 0480/1154] PRF:20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @warmfrog --- ...Monitor Disk Space Usage And Send Email.md | 46 ++++++++----------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md index c4a7480042..1d3ec04f35 100644 --- a/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md +++ b/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -1,32 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Linux Shell Script To Monitor Disk Space Usage And Send Email) [#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -用 Linux Shell 脚本来监控磁盘使用情况和发送邮件 +用 Linux Shell 脚本来监控磁盘使用情况并发送邮件 ============================================ -市场上有很多用来监控 Linux 系统的监控工具,当系统到达阀值后它将发送一封邮件。 - -它监控所有的东西例如 CPU 利用率,内存利用率,交换空间利用率,磁盘空间利用率等等。 - -然而,它更适合小环境和大环境。 +市场上有很多用来监控 Linux 系统的监控工具,当系统到达阀值后它将发送一封邮件。它监控所有的东西例如 CPU 利用率、内存利用率、交换空间利用率、磁盘空间利用率等等。然而,它更适合小环境和大环境。 想一想如果你只有少量系统,那么什么是最好的方式来应对这种情况。 -是的,我们想要写一个 **[shell 脚本][1]** 来实现。 +是的,我们想要写一个 [shell 脚本][1] 来实现。 -在这篇指南中我们打算写一个 shell 脚本来监控系统的磁盘空间使用率。 - -当系统到达给定的阀值,它将给对应的邮件 id 发送一封邮件。 - -在这篇文章中我们总共添加了四个 shell 脚本,每个用于不同的目的。 - -之后,我们会想出其他 shell 脚本来监控 CPU,内存和交换空间利用率。 +在这篇指南中我们打算写一个 shell 脚本来监控系统的磁盘空间使用率。当系统到达给定的阀值,它将给对应的邮件地址发送一封邮件。在这篇文章中我们总共添加了四个 shell 脚本,每个用于不同的目的。之后,我们会想出其他 shell 脚本来监控 CPU,内存和交换空间利用率。 在此之前,我想澄清一件事,根据我观察的磁盘空间使用率 shell 脚本使用情况。 @@ -42,9 +32,9 @@ test-script.sh: line 7: [: /dev/mapper/vg_2g-lv_root: integer expression expecte 是的,这是对的。甚至,当我第一次运行这个脚本的时候我遇到了相同的问题。之后,我发现了根本原因。 -当你在基于 RHEL 5 & RHEL 6 的系统上运行包含用于磁盘空间警告的 “df -h” 或 “df -H” 的 shell 脚本中时,你会发现上述错误信息,因为输出格式不对,查看下列输出。 +当你在基于 RHEL 5 & RHEL 6 的系统上运行包含用于磁盘空间警告的 `df -h` 或 `df -H` 的 shell 脚本中时,你会发现上述错误信息,因为输出格式不对,查看下列输出。 -为了解决这个问题,我们需要用 “df -Ph” (POSIX 输出格式),但是默认的 “df -h” 在基于 RHEL 7 的系统上运行的很好。 +为了解决这个问题,我们需要用 `df -Ph` (POSIX 输出格式),但是默认的 `df -h` 在基于 RHEL 7 的系统上运行的很好。 ``` # df -h @@ -68,7 +58,7 @@ tmpfs 7.8G 0 7.8G 0% /dev/shm 如果超过一个文件系统到达给定的阀值,它将发送多封邮件,因为这个脚本使用了循环。 -同样,替换你的邮件 id 来获取这份警告。 +同样,替换你的邮件地址来获取这份警告。 ``` # vi /opt/script/disk-usage-alert.sh @@ -85,7 +75,7 @@ do done ``` -**输出:**我获得了下列两封邮件警告。 +输出:我获得了下列两封邮件警告。 ``` The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 @@ -93,7 +83,7 @@ The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 ``` -Finally add a **[cronjob][2]** to automate this. It will run every 10 minutes. +最终添加了一个 [cronjob][2] 来自动完成。它会每 10 分钟运行一次。 ``` # crontab -e @@ -120,7 +110,7 @@ do done ``` -**输出:**我获得了下列两封邮件警告。 +输出:我获得了下列两封邮件警告。 ``` @@ -129,7 +119,7 @@ The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 ``` -最终添加了一个 **[cronjob][2]** 来自动完成。它会每 10 分钟运行一次。 +最终添加了一个 [cronjob][2] 来自动完成。它会每 10 分钟运行一次。 ``` # crontab -e @@ -146,7 +136,7 @@ The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr */10 * * * * df -Ph | sed s/%//g | awk '{ if($5 > 60) print $0;}' | mail -s "Disk Space Alert On $(hostname)" [email protected] ``` -**输出:** 我获得了一封关于所有警告的邮件。 +输出: 我获得了一封关于所有警告的邮件。 ``` Filesystem Size Used Avail Use Mounted on @@ -167,22 +157,22 @@ echo "The Mount Point "/DB" on $(hostname) has used $used at $(date)" | mail -s fi ``` -**输出:** 我得到了下面的邮件警告。 +输出: 我得到了下面的邮件警告。 ``` The partition /dev/mapper/vg_2g-lv_dbs on 2g.CentOS6 has used 82% at Mon Apr 29 06:16:14 IST 2019 ``` -最终添加了一个 **[cronjob][2]** 来自动完成这些工作。它将每 10 分钟运行一次。 +最终添加了一个 [cronjob][2] 来自动完成这些工作。它将每 10 分钟运行一次。 ``` # crontab -e */10 * * * * /bin/bash /opt/script/disk-usage-alert-2.sh ``` -**注意:** 你将在 10 分钟后收到一封邮件警告,因为这个脚本被计划为每 10 分钟运行一次(但也不是精确的 10 分钟,取决于时间)。 +注意: 你将在 10 分钟后收到一封邮件警告,因为这个脚本被计划为每 10 分钟运行一次(但也不是精确的 10 分钟,取决于时间)。 -例如这个例子。如果你的系统在 8:25 到达了限制,你将在 5 分钟后收到邮件警告。希望现在讲清楚了。 +例如这个例子。如果你的系统在 8:25 到达了限制,你将在 5 分钟后收到邮件警告。希望现在讲清楚了。 -------------------------------------------------------------------------------- @@ -191,7 +181,7 @@ via: https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 791aa3f8904468a3c97d3df79a7b122baafd0ec5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 May 2019 00:22:16 +0800 Subject: [PATCH 0481/1154] PUB:20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @warmfrog https://linux.cn/article-10868-1.html --- ...Shell Script To Monitor Disk Space Usage And Send Email.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md (99%) diff --git a/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/published/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md similarity index 99% rename from translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md rename to published/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md index 1d3ec04f35..c981988120 100644 --- a/translated/tech/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md +++ b/published/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10868-1.html) [#]: subject: (Linux Shell Script To Monitor Disk Space Usage And Send Email) [#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From fd7c2ff6434e3b0e895c19751b30497fec42b8e9 Mon Sep 17 00:00:00 2001 From: ninifly <18328038336@163.com> Date: Sat, 18 May 2019 00:50:08 +0800 Subject: [PATCH 0482/1154] Update 20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md --- ...Introduction to Clojure - Modern dialect of Lisp (Part 1).md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md b/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md index 5e5f4df763..0fb3c6469d 100644 --- a/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md +++ b/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ninifly) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 63483f7db058a3362347b4850779049c53313938 Mon Sep 17 00:00:00 2001 From: ninifly <18328038336@163.com> Date: Sat, 18 May 2019 10:46:12 +0800 Subject: [PATCH 0483/1154] Update 20190423 Edge computing is in most industries- future.md --- .../20190423 Edge computing is in most industries- future.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190423 Edge computing is in most industries- future.md b/sources/talk/20190423 Edge computing is in most industries- future.md index 3683860bf2..3f5a6d4c00 100644 --- a/sources/talk/20190423 Edge computing is in most industries- future.md +++ b/sources/talk/20190423 Edge computing is in most industries- future.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ninifly ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fd0d8d2dd7ea8168ecf6f414d383f378200673c2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 May 2019 10:52:50 +0800 Subject: [PATCH 0484/1154] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “To continue reading this article register now” @lujun9972 --- ...29 How to shop for enterprise firewalls.md | 92 ------------------- .../talk/20190430 Must-know Linux Commands.md | 54 ----------- ...is still stitching together IoT systems.md | 61 ------------ ...5G- A deep dive into fast, new wireless.md | 70 -------------- 4 files changed, 277 deletions(-) delete mode 100644 sources/talk/20190429 How to shop for enterprise firewalls.md delete mode 100644 sources/talk/20190430 Must-know Linux Commands.md delete mode 100644 sources/talk/20190501 Health care is still stitching together IoT systems.md delete mode 100644 sources/tech/20190402 5G- A deep dive into fast, new wireless.md diff --git a/sources/talk/20190429 How to shop for enterprise firewalls.md b/sources/talk/20190429 How to shop for enterprise firewalls.md deleted file mode 100644 index f298b8b795..0000000000 --- a/sources/talk/20190429 How to shop for enterprise firewalls.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to shop for enterprise firewalls) -[#]: via: (https://www.networkworld.com/article/3390686/how-to-shop-for-enterprise-firewalls.html#tk.rss_all) -[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) - -How to shop for enterprise firewalls -====== -Performance, form factors, and automation capabilities are key considerations when choosing a next-generation firewall (NGFW). -Firewalls have been around for years, but the technology keeps evolving as the threat landscape changes. Here are some tips about what to look for in a next-generation firewall ([NGFW][1]) that will satisfy business needs today and into the future. - -### Don't trust firewall performance stats - -Understanding how a NGFW performs requires more than looking at a vendor’s specification or running a bit of traffic through it. Most [firewalls][2] will perform well when traffic loads are light. It’s important to see how a firewall responds at scale, particularly when [encryption][3] is turned on. Roughly 80% of traffic is encrypted today, and the ability to maintain performance levels with high volumes of encrypted traffic is critical. - -**Learn more about network security** - - * [How to boost collaboration between network and security teams][4] - * [What is microsegmentation? How getting granular improves network security][5] - * [What to consider when deploying a next-generation firewall][1] - * [How firewalls fit into enterprise security][2] - - - -Also, be sure to turn on all major functions – including application and user identification, IPS, anti-malware, URL filtering and logging – during testing to see how a firewall will hold up in a production setting. Firewall vendors often tout a single performance number that's achieved with core features turned off. Data from [ZK Research][6] shows many IT pros learn this lesson the hard way: 58% of security professionals polled said they were forced to turn off features to maintain performance. - -Before committing to a vendor, be sure to run tests with as many different types of traffic as possible and with various types of applications. Important metrics to look at include application throughput, connections per second, maximum sessions for both IPv4 and [IPv6][7], and SSL performance. - -### NGFW needs to fit into broader security platform - -Is it better to have a best-of-breed strategy or go with a single vendor for security? The issue has been debated for years, but the fact is, neither approach works flawlessly. It’s important to understand that best-of-breed everywhere doesn’t ensure best-in-class security. In fact, the opposite is typically true; having too many vendors can lead to complexity that can't be managed, which puts a business at risk. A better approach is a security platform, which can be thought of as an open architecture, that third-party products can be plugged into. - -Any NGFW must be able to plug into a platform so it can "see" everything from IoT endpoints to cloud traffic to end-user devices. Also, once the NGFW has aggregated the data, it should be able to perform analytics to provide insights. This will enable the NGFW to take action and enforce policies across the network. - -### Multiple form factors, consistent security features - -Firewalls used to be relegated to corporate data centers. Today, networks have opened up, and customers need a consistent feature set at every point in the network. NGFW vendors should have the following form factors available to optimize price/performance: - - * Data center - * Internet edge - * Midsize branch office - * Small branch office - * Ruggedized for IoT environments - * Cloud delivered - * Virtual machines that can run in private and public clouds - - - -Also, NGFW vendors should have a roadmap for a containerized form factor. This certainly isn’t a trivial task. Most vendors won’t have a [container][8]-ready product yet, but they should be able to talk to how they plan to address the problem. - -### Single-pane-of-glass firewall management - -Having a broad product line doesn’t matter if products need to be managed individually. This makes it hard to keep policies and rules up to date and leads to inconsistencies in features and functions. A firewall vendor must have a single management tool that provides end-to-end visibility and enables the administrator to make a change and push it out across the network at once. Visibility must extend everywhere, including the cloud, [IoT][9] edge, operational technology (OT) environments, and branch offices. A single dashboard is also the right place to implement and maintain software-based segmentation instead of having to configure each device. - -### Firewall automation capabilities - -The goal of [automation][10] is to help remove many of the manual steps that create "human latency" in the security process. Almost all vendors tout some automation capabilities as a way of saving on headcount, but automation goes well beyond that. - -To continue reading this article register now - -[Get Free Access][11] - -[Learn More][12] Existing Users [Sign In][11] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3390686/how-to-shop-for-enterprise-firewalls.html#tk.rss_all - -作者:[Zeus Kerravala][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Zeus-Kerravala/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3236448/what-to-consider-when-deploying-a-next-generation-firewall.html -[2]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html -[3]: https://www.networkworld.com/article/3098354/enterprise-encryption-adoption-up-but-the-devils-in-the-details.html -[4]: https://www.networkworld.com/article/3328218/how-to-boost-collaboration-between-network-and-security-teams.html -[5]: https://www.networkworld.com/article/3247672/what-is-microsegmentation-how-getting-granular-improves-network-security.html -[6]: https://zkresearch.com/ -[7]: https://www.networkworld.com/article/3254575/what-is-ipv6-and-why-aren-t-we-there-yet.html -[8]: https://www.networkworld.com/article/3159735/containers-what-are-containers.html -[9]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html -[10]: https://www.networkworld.com/article/3184389/automation-rolls-on-what-are-you-doing-about-it.html -[11]: javascript:// -[12]: /learn-about-insider/ diff --git a/sources/talk/20190430 Must-know Linux Commands.md b/sources/talk/20190430 Must-know Linux Commands.md deleted file mode 100644 index 6a70fc1ea9..0000000000 --- a/sources/talk/20190430 Must-know Linux Commands.md +++ /dev/null @@ -1,54 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Must-know Linux Commands) -[#]: via: (https://www.networkworld.com/article/3391029/must-know-linux-commands.html#tk.rss_all) -[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) - -Must-know Linux Commands -====== -A compilation of essential commands for searching, monitoring and securing Linux systems - plus the Linux Command Line Cheat Sheet. -It takes some time working with Linux commands before you know which one you need for the task at hand, how to format it and what result to expect, but it’s possible to speed up the process. - -With that in mind, we’ve gathered together some of the essential Linux commands as explained by Network World's [Unix as a Second Language][1] blogger Sandra Henry-Stocker to give aspiring power users what they need to get started with Linux systems. - -The breakdown starts with the rich options available for finding files on Linux – **find** , **locate** , **mlocate** , **which** , **whereis** , to name a few. Some overlap, but some are more efficient than others or zoom in on a narrow set of results. There’s even a command – **apropos** – to find the right command to do what you want to do. This section will demystify searches. - -Henry-Stocker's article on memory provides a wealth of options for discovering the availability of physical and virtual memory and ways to have that information updated at intervals to constantly measure whether there’s enough memory to go around. It shows how it’s possible to tailor your requests so you get a concise presentation of the results you seek. - -Two remaining articles in this package show how to monitor activity on Linux servers and how to set up security parameters on these systems. - -The first of these shows how to run the same command repetitively in order to have regular updates about any designated activity. It also tells about a command that focuses on user processes and shows changes as they occur, and a command that examines the time that users are connected. - -The final article is a deep dive into commands that help keep Linux systems secure. It describes 22 of them that are essential for day-to-day admin work. They can restrict privileges to keep individuals from having more capabilities than their jobs call for and report on who’s logged in, where from and how long they’ve been there. - -Some of these commands can track recent logins for individuals, which can be useful in running down who made changes. Others find files with varying characteristics, such as having no owner or by their contents. There are commands to control firewalls and to display routing tables. - -As a bonus, our bundle of commands includes **The Linux Command-Line Cheat Sheet,** a concise summary of important commands that are useful every single day. It’s suitable for printing out on two sides of a single sheet, laminating and keeping beside your keyboard. - -Enjoy! - -To continue reading this article register now - -[Get Free Access][2] - -[Learn More][3] Existing Users [Sign In][2] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3391029/must-know-linux-commands.html#tk.rss_all - -作者:[Tim Greene][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Tim-Greene/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/blog/unix-as-a-second-language/?nsdr=true -[2]: javascript:// -[3]: /learn-about-insider/ diff --git a/sources/talk/20190501 Health care is still stitching together IoT systems.md b/sources/talk/20190501 Health care is still stitching together IoT systems.md deleted file mode 100644 index 988b58f592..0000000000 --- a/sources/talk/20190501 Health care is still stitching together IoT systems.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Health care is still stitching together IoT systems) -[#]: via: (https://www.networkworld.com/article/3392818/health-care-is-still-stitching-together-iot-systems.html#tk.rss_all) -[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - -Health care is still stitching together IoT systems -====== -The use of IoT technology in medicine is fraught with complications, but users are making it work. -_Government regulations, safety and technical integration are all serious issues facing the use of IoT in medicine, but professionals in the field say that medical IoT is moving forward despite the obstacles. A vendor, a doctor, and an IT pro all spoke to Network World about the work involved._ - -### Vendor: It's tough to gain acceptance** - -** - -Josh Stein is the CEO and co-founder of Adheretech, a medical-IoT startup whose main product is a connected pill bottle. The idea is to help keep seriously ill patients current with their medications, by monitoring whether they’ve taken correct dosages or not. - -The bottle – which patients get for free (Adheretech’s clients are hospitals and clinics) – uses a cellular modem to call home to the company’s servers and report on how much medication is left in the bottle, according to sensors that detect how many pills are touching the bottle’s sides and measuring its weight. There, the data is analyzed not just to determine whether patients are sticking to their doctor’s prescription, but to help identify possible side effects and whether they need additional help. - -For example, a bottle that detects itself being moved to the bathroom too often might send up a flag that the patient is experiencing gastrointestinal side effects. The system can then contact patients or providers via phone or text to help them take the next steps. - -The challenges to reach this point have been stiff, according to Stein. The company was founded in 2011 and spent the first four years of its existence simply designing and building its product. - -“We had to go through many years of R&D to create a device that’s replicatible a million times over,” he said. “If you’re a healthcare company, you have to deal with HIPAA, the FDA, and then there’s lots of other things like medication bottles have their whole own set of regulatory certifications.” - -Beyond the simple fact of regulatory compliance, Stein said that there’s resistance to this sort of new technology in the medical community. - -“Healthcare is typically one of the last industries to adopt new technology,” he said. - -### Doctor: Colleagues wonder if medical IoT plusses are worth the trouble - -Dr. Rebecca Mishuris is the associate chief medical information officer at Boston Medical Center, a private non-profit hospital located in the South End. One of the institution’s chief missions is to act as a safety net for the population of the area – 57% of BMC’s patients come from under-served populations, and roughly a third don’t speak English as a primary language. That, in itself, can be a problem for IoT because many devices are designed to be used by native English speakers. - -BMC’s adoption of IoT tech has taken place mostly at the individual-practice level – things like Bluetooth-enabled scales and diagnostic equipment for specific offices that want to use them – but there’s no hospital-wide IoT initiative happening, according to Mishuris. - -That’s partially due to the fact that many practitioners aren’t convinced that connected healthcare devices are worth the trouble to purchase, install and manage, she said. HIPAA compliance and BMC’s own privacy regulations are a particular concern, given that many of the devices deal with patient-generated data. - -To continue reading this article register now - -[Get Free Access][1] - -[Learn More][2] Existing Users [Sign In][1] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3392818/health-care-is-still-stitching-together-iot-systems.html#tk.rss_all - -作者:[Jon Gold][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Jon-Gold/ -[b]: https://github.com/lujun9972 -[1]: javascript:// -[2]: /learn-about-insider/ diff --git a/sources/tech/20190402 5G- A deep dive into fast, new wireless.md b/sources/tech/20190402 5G- A deep dive into fast, new wireless.md deleted file mode 100644 index f3941b3dde..0000000000 --- a/sources/tech/20190402 5G- A deep dive into fast, new wireless.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5G: A deep dive into fast, new wireless) -[#]: via: (https://www.networkworld.com/article/3385030/5g-a-deep-dive-into-fast-new-wireless.html#tk.rss_all) -[#]: author: (Craig Mathias https://www.networkworld.com/author/Craig-Mathias/) - -5G: A deep dive into fast, new wireless -====== - -### 5G wireless networks are just about ready for prime time, overcoming backhaul and backward-compatibility issues, and promising the possibility of all-mobile networking through enhanced throughput. - -The next step in the evolution of wireless WAN communications - [5G networks][1] \- is about to hit the front pages, and for good reason: it will complete the evolution of cellular from wireline augmentation to wireline replacement, and strategically from mobile-first to mobile-only. - -So it’s not too early to start least basic planning to understanding how 5G will fit into and benefit IT plans across organizations of all sizes, industries and missions. - -**[ From Mobile World Congress:[The time of 5G is almost here][2] ]** - -5G will of course provide end-users with the additional throughput, capacity, and other elements to address the continuing and dramatic growth in geographic availability, user base, range of subscriber devices, demand for capacity, and application requirements, but will also enable service providers to benefit from new opportunities in overall strategy, service offerings and broadened marketplace presence. - -A look at the key features you can expect in 5G wireless. (Click for larger image.) - -![A look at the key features you can expect in 5G wireless.][3] - -This article explores the technologies and market drivers behind 5G, with an emphasis on what 5G means to enterprise and organizational IT. - -While 5G remains an imprecise term today, key objectives for the development of the advances required have become clear. These are as follows: - -## 5G speeds - -As is the case with Wi-Fi, major advances in cellular are first and foremost defined by new upper-bound _throughput_ numbers. The magic number here for 5G is in fact a _floor_ of 1 Gbps, with numbers as high as 10 Gbps mentioned by some. However, and again as is the case with Wi-Fi, it’s important to think more in terms of overall individual-cell and system-wide _capacity_. We believe, then, that per-user throughput of 50 Mbps is a more reasonable – but clearly still remarkable – working assumption, with up to 300 Mbps peak throughput realized in some deployments over the next five years. The possibility of reaching higher throughput than that exceeds our planning horizon, but such is, well, possible. - -## Reduced latency - -Perhaps even more important than throughput, though, is a reduction in the round-trip time for each packet. Reducing latency is important for voice, which will most certainly be all-IP in 5G implementations, video, and, again, in improving overall capacity. The over-the-air latency goal for 5G is less than 10ms, with 1ms possible in some defined classes of service. - -## 5G network management and OSS - -Operators are always seeking to reduce overhead and operating expense, so enhancements to both system management and operational support systems (OSS) yielding improvements in reliability, availability, serviceability, resilience, consistency, analytics capabilities, and operational efficiency, are all expected. The benefits of these will, in most cases, however, be transparent to end-users. - -## Mobility and 5G technology - -Very-high-speed user mobility, to as much as hundreds of kilometers per hour, will be supported, thus serving users on all modes of transportation. Regulatory and situation-dependent restrictions – most notably, on aircraft – however, will still apply. - -To continue reading this article register now - -[Get Free Access][4] - -[Learn More][5] Existing Users [Sign In][4] - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3385030/5g-a-deep-dive-into-fast-new-wireless.html#tk.rss_all - -作者:[Craig Mathias][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/Craig-Mathias/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html -[2]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html -[3]: https://images.idgesg.net/images/article/2017/06/2017_nw_5g_wireless_key_features-100727485-large.jpg -[4]: javascript:// -[5]: /learn-about-insider/ From 7494370bbfb06b7980aa1ee427a0d287749a01ef Mon Sep 17 00:00:00 2001 From: way-ww <40491614+way-ww@users.noreply.github.com> Date: Sat, 18 May 2019 14:16:25 +0800 Subject: [PATCH 0485/1154] Update 20190505 How To Install-Uninstall Listed Packages From A File In Linux.md --- ...To Install-Uninstall Listed Packages From A File In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md index 5b42159f08..9092d7faeb 100644 --- a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md +++ b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( way-ww ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b017825396be53dab400bd860b12370b0cfa5f26 Mon Sep 17 00:00:00 2001 From: way-ww <40491614+way-ww@users.noreply.github.com> Date: Sat, 18 May 2019 14:22:38 +0800 Subject: [PATCH 0486/1154] Update 20190505 How To Install-Uninstall Listed Packages From A File In Linux.md request to translate --- ...To Install-Uninstall Listed Packages From A File In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md index 9092d7faeb..1e56511de8 100644 --- a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md +++ b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( way-ww ) +[#]: translator: (way-ww) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7187d0dced4e3714a4c796687a86ee3c88e52092 Mon Sep 17 00:00:00 2001 From: ninifly <18328038336@163.com> Date: Sat, 18 May 2019 15:35:51 +0800 Subject: [PATCH 0487/1154] Update 20190423 Edge computing is in most industries- future.md --- ...computing is in most industries- future.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/sources/talk/20190423 Edge computing is in most industries- future.md b/sources/talk/20190423 Edge computing is in most industries- future.md index 3f5a6d4c00..ec6366638b 100644 --- a/sources/talk/20190423 Edge computing is in most industries- future.md +++ b/sources/talk/20190423 Edge computing is in most industries- future.md @@ -7,38 +7,39 @@ [#]: via: (https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html#tk.rss_all) [#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) -Edge computing is in most industries’ future +边缘计算是大多数行业的未来 ====== -Nearly every industry can take advantage of edge computing in the journey to speed digital transformation efforts +几乎每个行业都能够在加速数字化转型的进程中利用边缘计算的优势。 ![iStock][1] -The growth of edge computing is about to take a huge leap. Right now, companies are generating about 10% of their data outside a traditional data center or cloud. But within the next six years, that will increase to 75%, [according to Gartner][2]. +边缘计算的发展将取得一次巨大的飞跃。现在,公司在传统数据中心或云之外生成了10%的数据。但在未来六年内,这一比例将升至75%。 +[according to Gartner][2]. -That’s largely down to the need to process data emanating from devices, such as Internet of Things (IoT) sensors. Early adopters include: +这很大程度上取决于处理来自设备数据的需要,比如物联网数据传感器。 +早起采用这一方法的人包括: - * **Manufacturers:** Devices and sensors seem endemic to this industry, so it’s no surprise to see the need to find faster processing methods for the data produced. A recent [_Automation World_][3] survey found that 43% of manufacturers have deployed edge projects. Most popular use cases have included production/manufacturing data analysis and equipment data analytics. + * **制造商:** 设备与传感器在这个行业似乎是特有的,因此需要为生产数据找到更快速的方法也就不足为奇。最近 [_Automation World_][3]研究发现43%的制造商已经部署了边缘计算。最流行的事例包括了生产数据分析与设备数据分析。 - * **Retailers** : Like most industries deeply affected by the need to digitize operations, retailers are being forced to innovate their customer experiences. To that end, these organizations are “investing aggressively in compute power located closer to the buyer,” [writes Dave Johnson][4], executive vice president of the IT division at Schneider Electric. He cites examples such as augmented-reality mirrors in fitting rooms that offer different clothing options without the consumer having to try on the items, and beacon-based heat maps that show in-store traffic. + * **零售商** : 与大多数深受数字化运营需求影响的产业一样,零售商被迫革新其客户体验。为了达到那一目的,这些组织“正在积极投资靠近买家的计算能力”[writes Dave Johns on][4], 施耐德电气公司IT部门执行副总裁说。他列举了一些例子,例如在试衣间的增强现实镜,给提供了不同的服装选择,而不用顾客试用这些服装。又如用于显示店内交通的基于信标的热图。 - * **Healthcare organizations** : As healthcare costs continue to escalate, this industry is ripe for innovation that improves productivity and cost efficiencies. Management consulting firm [McKinsey & Co. has identified][5] at least 11 healthcare use cases that benefit patients, the facility, or both. Two examples: tracking mobile medical devices for nursing efficiency as well as optimization of equipment, and wearable devices that track user exercise and offer wellness advice. + * **医疗保健机构** : 随着医疗成本的不断上升,这一行业已经在具备在提高生产能力与成本效率方面的创新能力。管理咨询公司已经确定,[McKinsey & Co. has identified][5] 至少有11个有益于患者、医疗机构或者两者都有的医疗保健用例。两个例子:跟踪移动医疗设备提高护理效率,同时也有助于优化设备;可穿戴设备跟踪用户锻炼并提供健康的建议。 -While these are strong use cases, as the edge computing market grows, so too will the number of industries adopting it. +虽然这些是强大的用例,随着边缘计算市场的扩大,使用它的行业也会增加。 -**Getting the edge on digital transformation** +**数字化转型的优势** -Faster processing at the edge fits perfectly into the objectives and goals of digital transformation — improving efficiencies, productivity, speed to market, and the customer experience. Here are just a few of the potential applications and industries that will be changed by edge computing: +随着边缘计算的快速处理能力完全符合数字化转型的提高效率、生产能力和市场发展速度和客户体验。以下是一些有潜力的应用及将被边缘计算改变的行业: -**Agriculture:** Farmers and organizations already use drones to transmit field and climate conditions to watering equipment. Other applications might include monitoring and location tracking of workers, livestock, and equipment to improve productivity, efficiencies, and costs. - -**Energy** : There are multiple potential applications in this sector that could benefit both consumers and providers. For example, smart meters help homeowners better manage energy use while reducing grid operators’ need for manual meter reading. Similarly, sensors on water pipes would detect leaks, while providing real-time consumption data. +**农业** :农名和组织已经使用无人机将农田和气候环境传给灌溉设备。其他的应用可能包括了工人、牲畜和设备的监测与位置跟踪从而改善生产能力、效率和成本。 +**能源** : 在这一领域有许多的qian that could benefit both consumers and providers. For example, smart meters help homeowners better manage energy use while reducing grid operators’ need for manual meter reading. Similarly, sensors on water pipes would detect leaks, while providing real-time consumption data. **Financial services** : Banks are adopting interactive ATMs that quickly process data to provide better customer experiences. At the organizational level, transactional data can be more quickly analyzed for fraudulent activity. -**Logistics** : As consumers demand faster delivery of goods and services, logistics companies will need to transform mapping and routing capabilities to get real-time data, especially in terms of last-mile planning and tracking. That could involve street-, package-, and car-based sensors transmitting data for processing. +**Logistics** : As consumers demand faster delivery of goods and services, logistics companies will need to transform mapping and routing capabilities to get real-time data, especially in terms of last-mile pla钱 nning and tracking. That could involve street-, package-, and car-based sensors transmitting data for processing. All industries have the potential for transformation, thanks to edge computing. But it will depend on how they address their computing infrastructure. Discover how to overcome any IT obstacles at [APC.com][6]. From 958f80e81e08f175207cc6e20b8d7ed3fa406470 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 20:53:38 +0800 Subject: [PATCH 0488/1154] PRF:20190510 PHP in 2019.md @wxy --- translated/tech/20190510 PHP in 2019.md | 72 ++++++++++++------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/translated/tech/20190510 PHP in 2019.md b/translated/tech/20190510 PHP in 2019.md index e8da83742d..55bff328b4 100644 --- a/translated/tech/20190510 PHP in 2019.md +++ b/translated/tech/20190510 PHP in 2019.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (PHP in 2019) @@ -10,75 +10,75 @@ 9102 年的 PHP ====== -你还记得篇流行的《[PHP:糟糕设计的分形][3]》博客文章吗?我第一次读它时,我在一个有很多遗留的 PHP 项目的糟糕地方工作。这篇文章让我去思考我是否应该放弃并去做与编程完全不同的事情。 +你还记得篇流行的博客文章《[PHP:设计糟糕的分形][3]》吗?我第一次读到它时,我在一个有很多遗留的 PHP 项目的糟糕地方工作。这篇文章让我觉得我是否应该放弃,并去做与编程完全不同的事情。 -幸运的是,我之后很快就换了工作,更重要的是,自从 5.x 版本以来,PHP 成功地进步了很多。今天,我在向那些不再使用 PHP 编程,或者陷入遗留项目的人们致敬。 +还好,我之后很快就换了工作,更重要的是,自从 5.x 版本以来,PHP 成功地进步了很多。今天,我在向那些不再使用 PHP 编程,或者陷入遗留项目的人们致意。 -剧透:今天有些事情仍然很糟糕,就像几乎每种编程语言都有它的怪癖一样。许多核心功能仍然有不一致的调用方法,仍然有令人困惑的配置设置,仍有许多开发人员在那里写蹩脚的代码 —— 因为他们必须如此,或因为他们不知道更好的写法。 +剧透:今天有些事情仍然很糟糕,就像几乎每种编程语言都有它的怪癖一样。许多核心功能仍然有不一致的调用方法,仍然有令人困惑的配置设置,仍然有许多开发人员在那里写蹩脚的代码 —— 因为他们必须如此,或是他们不知道更好的写法。 -今天我想看看好的一面:让我们关注已经发生变化的事情以及编写干净而可维护的 PHP 代码的方法。在此之前,我想请你暂时搁置任何偏见。 +今天我想看看好的一面:让我们关注已经发生变化的事情,以及编写干净而可维护的 PHP 代码的方法。在此之前,我想请你暂时搁置任何偏见。 -之后,你可以像以前一样自由地对 PHP 发表你的看法。虽然你可能会对 PHP 在过去的几年里的一些改进感到惊讶。 +然后,你可以像以前一样对 PHP 自由吐槽。虽然,你可能会对 PHP 在过去的几年里的一些改进感到惊讶。(LCTT 译注:说实话,我是真的感到吃惊) ### 提前看结论 -* PHP 在积极开发,每年都有新版本 -* 自 PHP 5 时代以来的性能翻倍,如果不是三倍的话 +* PHP 在积极地开发,每年都有新版本 +* 自 PHP 5 时代以来的性能已经翻倍,如果不是三倍的话 * 有一个非常活跃的框架、包和平台的生态系统 * PHP 在过去几年中添加了许多新功能,并且这种语言在不断发展 * 像静态分析这样的工具在过去几年中已经成熟,并且一直保持增长    -更新:人们让我展示一些实际的代码。我觉得这没问题!这是我的一个爱好项目的[源代码][4],用 PHP 和 Laravel 编写;[这里][5]列出了我们在办公室维护的几百个自由开源软件包。这两者都是现代 PHP 项目的好例子。 +更新:人们让我展示一些实际的代码。我觉得这没问题!这是我的一个业余项目的[源代码][4],用 PHP 和 Laravel 编写的;[这里][5]列出了我们在办公室维护的几百个自由开源软件包。这两者都是现代 PHP 项目的好例子。 -开始吧。 +那让我们开始吧。 ### 历史总结 出于更好地衡量的目的,让我们快速回顾一下如今的 PHP 发布周期。我们现在的 PHP 为 7.3,预计在 2019 年底为 7.4。PHP 8.0 将是 7.4 之后的下一个版本。 -自从 5.x 时代以来,核心团队试图保持每年的发布周期,并且在过去的四年中成功地做到了。 +自从 5.x 时代以来,核心团队试图保持每年发布一个版本的周期,并且他们在过去的四年中成功地做到了这一点。 一般来说,每个新版本都会在两年内得到积极支持,并再获得一年以上的“安全修复”。其目标是激励 PHP 开发人员尽可能保持最新:例如,每年进行小规模升级比在 5.4 到 7.0 之间跳转更容易。 可以在 [这里][6] 找到 PHP 时间轴的活动概述。 -最后,PHP 5.6 是最新的 5.x 版本,而 7.0 是 6.x 的下一个版本。 如果你想知道 PHP 6 发生了什么,你可以听 [PHP Roundtable 播客][7]。 +最后,PHP 5.6 是最新的 5.x 版本,而 8.0 是当前的下一个大版本。如果你想知道 PHP 6 发生了什么,你可以听听 [PHP Roundtable 播客][7]。 了解了这个,让我们揭穿一些关于现代 PHP 的常见误解。 -### PHP的性能 +### PHP 的性能 -早在 5.x 时代,PHP 的表现就是……嗯,平均水平。但是在 7.0 版本中,PHP 的核心部分从头开始重写,导致性能提升了两到三倍! +早在 5.x 时代,PHP 的表现就是……嗯,平均水平。但是在 7.0 版本中,PHP 从头开始重写了核心部分,导致其性能提升了两到三倍! -但光是嘴说是不够的。我们来看看基准测试。幸运的是,人们花了很多时间来对 PHP 性能进行基准测试。 我发现 [Kinsta][8] 有一个很好的更新列表。 +但光是嘴说是不够的。让我们来看看基准测试。幸运的是,人们花了很多时间对 PHP 性能进行了基准测试。 我发现 [Kinsta][8] 有一个很好的更新的测试列表。 -自 7.0 升级以来,性能就只有提升而没有回退。PHP Web 应用程序的性能就可与其他语言中的 Web 框架相提并论,甚至在某些情况下更好。你可以看看这个[广泛的基准测试套件][9]。 +自 7.0 升级以来,性能就一直在提升而没有回退。PHP Web 应用程序的性能可与其它语言中的 Web 框架相提并论,甚至在某些情况下更好。你可以看看这个[广泛的基准测试套件][9]。 当然 PHP 框架不会胜过 C 和 Rust,但它们比 Rails 或 Django 要好得多,并且与 ExpressJS 相当。 ### 框架和生态系统 -说到框架:PHP 可不仅仅是 WordPress。让我告诉你,某些专业的 PHP 开发人员:WordPress 绝不代表当代的 PHP 生态系统。 +说到框架:PHP 可不仅仅是 WordPress。让我告诉你 —— 某些专业的 PHP 开发人员:WordPress 绝不代表当代的 PHP 生态系统。 -一般来说,有两个主要的 Web 应用程序框架,[Symfony][10] 和 [Laravel][11],以及一些较小的应用程序框架。当然还有 Zend、Yii、Cake、Code Igniter 等等,但是如果你想知道现代 PHP 开发是怎么样的,这两者之一都是很好的对象。 +一般来说,有两个主要的 Web 应用程序框架,[Symfony][10] 和 [Laravel][11],以及一些较小的应用程序框架。当然还有 Zend、Yii、Cake、Code Igniter 等等,但是如果你想知道现代 PHP 开发是怎么样的,这两者之一都是很好的选择。 这两个框架都有一个庞大的包和产品的生态系统。从管理面板和 CRM 到独立软件包,从 CI 到分析器,以及几个 Web 套接字服务器、队列管理器、支付集成等众多服务。老实说,要列出的内容太多了。 -这些框架虽然适用于实际开发。如果你只是需要个内容管理系统(CMS),WordPress 和 CraftCMS 等平台会越来越好。 +这些框架虽然适用于实际开发。如果你只是需要个内容管理系统(CMS),WordPress 和 CraftCMS 等平台就够了。 -衡量 PHP 生态系统当前状态的一种方法是查看 Packagist,这是 PHP 的主要软件包存储库。它已呈指数级增长。每天下载量达到 2500 万次,这可以说 PHP 生态系统已不再是以前的小型弱势群体。 +衡量 PHP 生态系统当前状态的一种方法是查看 Packagist,这是 PHP 主要的软件包存储库。它现在呈指数级增长。每天下载量达到了 2500 万次,可以说 PHP 生态系统已不再是以前的小型弱势群体了。 -请查看此图表,它列出一段时间内的软件包和版本数量。它也可以在 [Packagist 网站][12]上找到。 +请查看此图表,它列出一段时间内的软件包和版本数量变化。它也可以在 [Packagist 网站][12]上找到它。 ![][13] 除了应用程序框架和 CMS 之外,我们还看到过去几年里异步框架的兴起。 -这些是用 PHP 或其他语言编写的框架和服务器,允许用户运行真正的异步 PHP。这些例子包括 [Swoole][14](创始人韩天峰),以及 [Amp][15] 和 [ReactPHP][16]。 +这些是用 PHP 或其他语言编写的框架和服务器,允许用户运行真正的异步 PHP,这些例子包括 [Swoole][14](创始人韩天峰),以及 [Amp][15] 和 [ReactPHP][16]。 -我们已经进入了异步世界冒险,像 Web 套接字和具有大量 IO 的应用程序之类的东西在 PHP 世界中已经变得非常重要。 +我们已经进入了异步的世界,像 Web 套接字和具有大量 I/O 的应用程序之类的东西在 PHP 世界中已经变得非常重要。 -在内部邮件列表里(核心开发人员讨论语言开发的地方)已经谈到了[将 libuv 添加到核心][17]。如果你还不知道 libuv:Node.js 全赖它提供了异步性。 +在内部邮件列表里(PHP 核心开发人员讨论语言开发的地方)已经谈到了[将 libuv 添加到核心][17]。如果你还不知道 libuv:Node.js 全有赖它提供异步性。 ### 语言本身 @@ -90,7 +90,7 @@ + [Trait](https://www.php.net/manual/en/language.oop5.traits.php)(一种代码重用方式) + [属性类型](https://stitcher.io/blog/new-in-php-74#typed-properties-rfc) + [展开操作符](https://wiki.php.net/rfc/argument_unpacking)(参数解包 `...`) -+ [JIT 编译器](https://wiki.php.net/rfc/jit) ++ [JIT 编译器](https://wiki.php.net/rfc/jit)(即时编译器) + [FFI](https://wiki.php.net/rfc/ffi)(外部函数接口) + [匿名类](https://www.php.net/manual/en/language.oop5.anonymous.php) + [返回类型声明](https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration) @@ -98,31 +98,31 @@ + [生成器](https://wiki.php.net/rfc/generators) + [等等](https://www.php.net/ChangeLog-7.php) -当我们讨论语言功能时,我们还要谈谈当今语言的发展过程。虽然社区可以提出 RFC,但是得有一个活跃的志愿者核心团队才能推着语言前进。 +当我们讨论语言功能时,我们还要谈谈当今该语言的发展过程。虽然社区可以提出 RFC,但是得有一个活跃的志愿者核心团队才能推着它前进。 -接下来,这些 RFC 将在“内部”邮件列表中进行讨论,这个邮件列表也可以[在线阅读][18]。在添加新语言功能之前,必须进行投票。只有得到了至少 2/3 多数的 RFC 才能进入核心。 +接下来,这些 RFC 将在“内部”邮件列表中进行讨论,这个邮件列表也可以[在线阅读][18]。在添加新的语言特性之前,必须进行投票。只有得到了至少 2/3 多数同意的 RFC 才能进入核心。 -可能有大约 100 人能投票,但不需要对每个 RFC 进行投票。核心团队的成员当然可以投票,他们是维护代码库的人。除了他们之外,还有一群人从 PHP 社区中被单独挑选出来。这些人包括 PHP 文档的维护者,对 PHP 项目整体有贡献的人,以及 PHP 社区中的杰出开发人员。 +可能有大约 100 人能够投票,但不需要每个人对每个 RFC 进行投票。核心团队的成员当然可以投票,他们是维护代码库的人。除了他们之外,还有一群人从 PHP 社区中被单独挑选出来。这些人包括 PHP 文档的维护者,对 PHP 项目整体有贡献的人,以及 PHP 社区中的杰出开发人员。 -虽然大多数核心开发都是在自愿的基础上完成的,但其中一位核心 PHP 开发人员 Nikita Popov 最近受雇于 [JetBrains][19] 全职从事于该语言。另一个例子是 Linux 基金会最近决定[投资 Zend 框架][20]。像这样的雇佣和收购确保了 PHP 未来发展的稳定性。 +虽然大多数核心开发都是在自愿的基础上完成的,但其中一位核心 PHP 开发人员 Nikita Popov 最近受雇于 [JetBrains][19] 全职从事于 PHP 语言的开发。另一个例子是 Linux 基金会最近决定[投资 Zend 框架][20]。像这样的雇佣和收购确保了 PHP 未来发展的稳定性。 ### 工具 -除了核心本身,我们看到过去几年中围绕它的工具有所增加。浮现于我脑海中的是静态分析器,如由 Vimeo 创建 [Psalm][21],以及 [Phan][22] 和 [PHPStan][23]。 +除了核心本身,我们看到过去几年中围绕它的工具有所增加。首先浮现于我脑海中的是静态分析器,比如由 Vimeo 创建 [Psalm][21],以及 [Phan][22] 和 [PHPStan][23]。 -这些工具将静态分析你的 PHP 代码并报告任何的类型错误和可能的错误等。在某种程度上,它们提供的功能可以与 TypeScript 进行比较,但是现在这种语言不能转译transpiling,因此不支持使用自定义语法。 +这些工具将静态分析你的 PHP 代码并报告任何类型错误和可能的错误等。在某种程度上,它们提供的功能可以与 TypeScript 进行比较,但是现在这种语言不能转译transpiling,因此不支持使用自定义语法。 -尽管这意味着我们需要依赖 docblocks,但是 PHP 的原创建者 Rasmus Lerdorf 确实提到了[添加静态分析引擎][24]到核心的想法。虽然会有很多潜力,但这是一项艰巨的任务。 +尽管这意味着我们需要依赖 docblocks,但是 PHP 之父 Rasmus Lerdorf 确实提到了[添加静态分析引擎][24]到核心的想法。虽然会有很多潜力,但这是一项艰巨的任务。 -说到转译,以及受到 JavaScript 社区的启发;他们已经努力在用户领域中扩展 PHP 语法。一个名为 [Pre][25] 的项目正是如此:允许新的 PHP 语法转译为普通的 PHP 代码。 +说到转译,以及受到 JavaScript 社区的启发;他们已经努力在用户领域中扩展 PHP 语法。一个名为 [Pre][25] 的项目正是如此:允许将新的 PHP 语法转译为普通的 PHP 代码。 虽然这个思路已经在 JavaScript 世界中被证明了,但如果提供了适当的 IDE 和静态分析支持,它就能在 PHP 中工作了。这是一个非常有趣的想法,但必须发展起来才能称之为“主流”。 ### 结语 -尽管如此,你仍然可以将 PHP 视为一种糟糕的语言。虽然这种语言肯定有它的缺点和与之而来的 20 年的遗产;但我可以放胆地说,我喜欢和它一起工作。 +尽管如此,你仍然可以将 PHP 视为一种糟糕的语言。虽然这种语言肯定有它的缺点和背负了 20 年的遗产;但我可以放胆地说,我喜欢用它工作。 -根据我的经验,我能够创建可靠、可维护和高质量的软件。我工作的客户对最终结果感到满意,就像我一样。 +根据我的经验,我能够创建可靠、可维护和高质量的软件。我工作的客户对最终结果感到满意,“俺也一样”。 尽管仍然可以用 PHP 做很多乱七八糟的事情,但我认为如果明智和正确地使用的话,它是 Web 开发的绝佳选择。 @@ -135,7 +135,7 @@ via: https://stitcher.io/blog/php-in-2019 作者:[Brent][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 88c645723c17251a20c0ce529a1ff1a45414cc64 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 20:54:27 +0800 Subject: [PATCH 0489/1154] PUB:20190510 PHP in 2019.md @wxy https://linux.cn/article-10870-1.html --- {translated/tech => published}/20190510 PHP in 2019.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190510 PHP in 2019.md (99%) diff --git a/translated/tech/20190510 PHP in 2019.md b/published/20190510 PHP in 2019.md similarity index 99% rename from translated/tech/20190510 PHP in 2019.md rename to published/20190510 PHP in 2019.md index 55bff328b4..5b6aa01eb2 100644 --- a/translated/tech/20190510 PHP in 2019.md +++ b/published/20190510 PHP in 2019.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10870-1.html) [#]: subject: (PHP in 2019) [#]: via: (https://stitcher.io/blog/php-in-2019) [#]: author: (Brent https://stitcher.io/blog/php-in-2019) From bf3ce0cd18288965b7325c50e527be76732d91ee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 21:13:18 +0800 Subject: [PATCH 0490/1154] PRF:20190503 Say goodbye to boilerplate in Python with attrs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @geekpi 这个系列已经翻译都发布了,还有四篇。 @lujun9972 发现来自 opensource 的文章作者后面多个空格。 --- ...bye to boilerplate in Python with attrs.md | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md index e80b5b03e1..f6d3d5a0c0 100644 --- a/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md +++ b/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md @@ -1,26 +1,27 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Say goodbye to boilerplate in Python with attrs) [#]: via: (https://opensource.com/article/19/5/python-attrs) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) 使用 attrs 来告别 Python 中的样板 ====== -在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 -![Programming at a browser, orange hands][1] -Python是当今使用最多[流行的编程语言] [2]之一 - 并且有充分的理由:它是开源的,它具有广泛的用途(例如Web编程,业务应用程序,游戏,科学编程等等)更多),它有一个充满活力和专注的社区支持它。这个社区是我们在[Python Package Index] [3](PyPI)中提供如此庞大,多样化的软件包的原因,以扩展和改进Python并解决不可避免的问题。 +> 在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 -在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [**attrs**][4],这是一个帮助你快速编写简洁,正确的代码的 Python 包。 +![Programming at a browser, orange hands](https://img.linux.net.cn/data/attachment/album/201905/18/211211lhqqbemqwkeqc2bb.jpg) + +Python是当今使用最多[流行的编程语言][2]之一,因为:它是开源的,它具有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中提供如此庞大、多样化的软件包的原因,用以扩展和改进 Python。并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [attrs][4],这是一个帮助你快速编写简洁、正确的代码的 Python 包。 ### attrs 如果你已经写过一段时间的 Python,那么你可能习惯这样写代码: - ``` class Book(object): @@ -30,7 +31,7 @@ class Book(object): self.author = author ``` -接着写一个 **__repr__** 函数。否则,很难记录 **Book** 的实例: +接着写一个 `__repr__` 函数。否则,很难记录 `Book` 的实例: ``` @@ -38,11 +39,10 @@ def __repr__(self): return f"Book({self.isbn}, {self.name}, {self.author})" ``` -接下来你会写一个好看的 docstring 来记录期望的类型。但是你注意到你忘了添加 **edition** 和 **published_year** 属性,所以你必须在五个地方修改它们。 +接下来你会写一个好看的 docstring 来记录期望的类型。但是你注意到你忘了添加 `edition` 和 `published_year` 属性,所以你必须在五个地方修改它们。 如果你不必这么做如何? - ``` @attr.s(auto_attribs=True) class Book(object): @@ -53,11 +53,10 @@ class Book(object): edition: int ``` -使用新的类型注释语法注释类型属性,**attrs** 会检测注释并创建一个类。 +使用新的类型注释语法注释类型属性,`attrs` 会检测注释并创建一个类。 ISBN 有特定格式。如果我们想强行使用该格式怎么办? - ``` @attr.s(auto_attribs=True) class Book(object): @@ -73,14 +72,14 @@ class Book(object): edition: int ``` -**attrs** 库也对[不可变风格编程][5]支持良好。将第一行改成 **@attr.s(auto_attribs=True, frozen=True)** 意味着 **Book** 现在是不可变的:尝试修改一个属性将会引发一个异常。相反,比如,如果希望将发布日期向后一年,我们可以修改成 **attr.evolve(old_book, published_year=old_book.published_year+1)** 来得到一个_新的_实例。 +`attrs` 库也对[不可变式编程][5]支持良好。将第一行改成 `@attr.s(auto_attribs=True, frozen=True)` 意味着 `Book` 现在是不可变的:尝试修改一个属性将会引发一个异常。相反,比如,如果希望将发布日期向后一年,我们可以修改成 `attr.evolve(old_book, published_year=old_book.published_year+1)` 来得到一个*新的*实例。 -本系列的下一篇文章我们将来看下 **singledispatch**,一个能让你向 Python 库添加方法的库。 +本系列的下一篇文章我们将来看下 `singledispatch`,一个能让你向 Python 库添加方法的库。 #### 查看本系列先前的文章 - * [Cython][6] - * [Black][7] +* [Cython][6] +* [Black][7] @@ -88,10 +87,10 @@ class Book(object): via: https://opensource.com/article/19/5/python-attrs -作者:[Moshe Zadka ][a] +作者:[Moshe Zadka][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/) 荣誉推出 @@ -102,5 +101,5 @@ via: https://opensource.com/article/19/5/python-attrs [3]: https://pypi.org/ [4]: https://pypi.org/project/attrs/ [5]: https://opensource.com/article/18/10/functional-programming-python-immutable-data-structures -[6]: https://opensource.com/article/19/4/7-python-problems-solved-cython -[7]: https://opensource.com/article/19/4/python-problems-solved-black +[6]: https://linux.cn/article-10859-1.html +[7]: https://linux.cn/article-10864-1.html From 423fe5d5f2676a27e91d888309005e67d69b1833 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 21:14:21 +0800 Subject: [PATCH 0491/1154] PUB:20190503 Say goodbye to boilerplate in Python with attrs.md @geekpi https://linux.cn/article-10871-1.html --- .../20190503 Say goodbye to boilerplate in Python with attrs.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20190503 Say goodbye to boilerplate in Python with attrs.md (100%) diff --git a/translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md b/published/20190503 Say goodbye to boilerplate in Python with attrs.md similarity index 100% rename from translated/tech/20190503 Say goodbye to boilerplate in Python with attrs.md rename to published/20190503 Say goodbye to boilerplate in Python with attrs.md From e10b066d82515c5a2df4d4b38aed2e07896e3f88 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 22:26:06 +0800 Subject: [PATCH 0492/1154] PRF:20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @warmfrog --- ...Application Shortcuts on Ubuntu Desktop.md | 40 +++++++------------ 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md index 3c836b069a..627aaf14d7 100644 --- a/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md +++ b/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) [#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -在 Ubuntu 桌面如何添加应用快捷方式 +如何在 Ubuntu 桌面手动添加应用快捷方式 =============================== -_**在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中添加应用图标。**_ +> 在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中添加应用图标。 -一个经典的桌面操作系统在 ‘桌面屏’ 上总是有图标的。这些桌面图标包括文件管理器,回收站和应用图标。 +一个经典的桌面操作系统在“桌面屏”上总是有图标的。这些桌面图标包括文件管理器、回收站和应用图标。 当在 Windows 中安装应用时,一些程序会询问你是否在桌面创建一个快捷方式。但在 Linux 系统中不是这样。 @@ -26,43 +26,37 @@ _**在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 ![][5] -个人来讲,我更喜欢为应用图标准备的 Ubuntu 启动器方式。如果我经常使用一个程序,我会添加到启动器。但是我知道不是每个人都有相同的偏好并且少数人更喜欢桌面的快捷方式。 +个人来讲,我更喜欢为应用图标准备的 Ubuntu 启动器方式。如果我经常使用一个程序,我会添加到启动器。但是我知道不是每个人都有相同的偏好,可能少数人更喜欢桌面的快捷方式。 让我们看在桌面中创建应用快捷方式的最简单方式。 -免责声明 +> 免责声明 -这篇指南已经在 Ubuntu18.04 LTS 的 GNOME 桌面上测试过了。它可能在其他发行版和桌面环境上也能发挥作用,但你必须自己尝试。一些 GNOME 特定步骤可能会变,所以请在[其他桌面环境][7]尝试时注意。 - -[Subscribe to our YouTube Channel for More Linux Videos][8] +> 这篇指南已经在 Ubuntu 18.04 LTS 的 GNOME 桌面上测试过了。它可能在其他发行版和桌面环境上也能发挥作用,但你必须自己尝试。一些 GNOME 特定步骤可能会变,所以请在[其他桌面环境][7]尝试时注意。 #### 准备 首先最重要的事是确保你有 GNOME 桌面的图标权限。 -如果你跟随 Ubuntu 18.04 自定义提示,你会知道如何安装 GNOME Tweaks 工具。在这个工具中,确保你设置 ‘Show Icons’ 选项为允许。 +如果你跟随 Ubuntu 18.04 自定义提示,你会知道如何安装 GNOME Tweaks 工具。在这个工具中,确保你设置“Show Icons”选项为启用。 ![Allow icons on desktop in GNOME][9] 一旦你确保已经设置,是时候在桌面添加应用快捷方式了。 -[][10] - -建议阅读在双启动中如何替代一个 Linux 发行版 [保留 Home分区] - #### 第一步:定位应用的 .desktop 文件 -到 Files -> Other Location -> Computer。 +到 “Files -> Other Location -> Computer”。 ![Go to Other Locations -> Computer][11] -从这里,到目录 usr -> share -> applications。你会在这里看到几个你已经安装的 [Ubuntu 应用][12]。即使你没有看到图标,你应该看到被命名为 应用名.desktop 形式的文件。 +从这里,到目录 “usr -> share -> applications”。你会在这里看到几个你已经安装的 [Ubuntu 应用][12]。即使你没有看到图标,你应该看到被命名为“应用名.desktop”形式的文件。 ![Application Shortcuts][13] #### 第二步:拷贝 .desktop 文件到桌面 -现在你要做的只是查找应用图标(或者它的 desktop 文件)。当你找到后,拖文件到桌面或者拷贝文件(使用 Ctrl+C 快捷方式)并在桌面粘贴(使用 Ctrl+V 快捷方式)。 +现在你要做的只是查找应用图标(或者它的 desktop 文件)。当你找到后,拖文件到桌面或者拷贝文件(使用 `Ctrl+C` 快捷方式)并在桌面粘贴(使用 `Ctrl+V` 快捷方式)。 ![Add .desktop file to the desktop][14] @@ -70,7 +64,7 @@ _**在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 当你这么做,你应该在桌面上看到一个图标的文本文件而不是应用 logo。别担心,一会就不一样了。 -你要做的就是双击桌面的那个文件。它将警告你它是一个 ‘未信任的应用启动器’,点击信任并启动。 +你要做的就是双击桌面的那个文件。它将警告你它是一个“未信任的应用启动器’,点击“信任并启动”。 ![Launch Desktop Shortcut][15] @@ -80,20 +74,16 @@ _**在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 #### Ubuntu 19.04 或者 GNOME 3.32 用户的疑难杂症 -如果你使用 Ubuntu 19.04 或者 GNOME 3.32,你的 .desktop 文件可能根本不会启动。你应该右击 .desktop 文件并选择 “Allow Launching”。 +如果你使用 Ubuntu 19.04 或者 GNOME 3.32,你的 .desktop 文件可能根本不会启动。你应该右击 .desktop 文件并选择 “允许启动”。 在这之后,你应该能够启动应用并且桌面上的应用快捷方式能够正常显示了。 -**总结** +### 总结 如果你不喜欢桌面的某个应用启动器,选择删除就是了。它会删除应用快捷方式,但是应用仍安全的保留在你的系统中。 我希望你发现这篇快速指南有帮助并喜欢在 Ubuntu 桌面上的应用快捷方式。 -[][17] - -建议阅读在 Ubuntu 中如何安装和设置 Nemo 为默认的文件管理器。 - 如果你有问题或建议,请在下方评论让我知道。 -------------------------------------------------------------------------------- @@ -103,7 +93,7 @@ via: https://itsfoss.com/ubuntu-desktop-shortcut/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 98677c8cb9c4ff871af26fa0265aad543d09e35f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 May 2019 22:26:58 +0800 Subject: [PATCH 0493/1154] PUB:20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @warmfrog https://linux.cn/article-10872-1.html --- ...0506 How to Add Application Shortcuts on Ubuntu Desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md (98%) diff --git a/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/published/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md similarity index 98% rename from translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md rename to published/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md index 627aaf14d7..2e6946ac79 100644 --- a/translated/tech/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md +++ b/published/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10872-1.html) [#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) [#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From e4438d7e997080d12adcc444c87116e80d1564f6 Mon Sep 17 00:00:00 2001 From: way-ww <40491614+way-ww@users.noreply.github.com> Date: Sun, 19 May 2019 09:52:34 +0800 Subject: [PATCH 0494/1154] Delete 20190505 How To Install-Uninstall Listed Packages From A File In Linux.md --- ...ll Listed Packages From A File In Linux.md | 338 ------------------ 1 file changed, 338 deletions(-) delete mode 100644 sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md diff --git a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md deleted file mode 100644 index 1e56511de8..0000000000 --- a/sources/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md +++ /dev/null @@ -1,338 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (way-ww) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Install/Uninstall Listed Packages From A File In Linux?) -[#]: via: (https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Install/Uninstall Listed Packages From A File In Linux? -====== - -In some case you may want to install list of packages from one server to another server. - -For example, You have installed 15 packages on ServerA, and those packages needs to be installed on ServerB, ServerC, etc., - -We can manually install all the packages but it’s time consuming process. - -It can be done for one or two servers, think about if you have around 10 servers. - -In this case it doesn’t help you then What will be the solution? - -Don’t worry we are here to help you out in this situation or scenario. - -We have added four methods in this article to overcome this situation. - -I hope this will help you to fix your issue. I have tested these commands on CentOS7 and Ubuntu 18.04 systems. - -I hope this will work with other distributions too. Just replace with distribution official package manager command instead of us. - -Navigate to the following article if you want to **[check list of installed packages in Linux system][1]**. - -For example, if you would like to create a package lists from RHEL based system then use the following steps. Do the same for other distributions as well. - -``` -# rpm -qa --last | head -15 | awk '{print $1}' > /tmp/pack1.txt - -# cat /tmp/pack1.txt -mariadb-server-5.5.60-1.el7_5.x86_64 -perl-DBI-1.627-4.el7.x86_64 -perl-DBD-MySQL-4.023-6.el7.x86_64 -perl-PlRPC-0.2020-14.el7.noarch -perl-Net-Daemon-0.48-5.el7.noarch -perl-IO-Compress-2.061-2.el7.noarch -perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 -mariadb-5.5.60-1.el7_5.x86_64 -perl-Data-Dumper-2.145-3.el7.x86_64 -perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 -httpd-2.4.6-88.el7.centos.x86_64 -mailcap-2.1.41-2.el7.noarch -httpd-tools-2.4.6-88.el7.centos.x86_64 -apr-util-1.5.2-6.el7.x86_64 -apr-1.4.8-3.el7_4.1.x86_64 -``` - -### Method-1 : How To Install Listed Packages From A File In Linux With Help Of cat Command? - -To achieve this, i would like to go with this first method. As this very simple and straightforward. - -To do so, just create a file and add the list of packages that you want to install it. - -For testing purpose, we are going to add only the below three packages into the following file. - -``` -# cat /tmp/pack1.txt - -apache2 -mariadb-server -nano -``` - -Simply run the following **[apt command][2]** to install all the packages in a single shot from a file in Ubuntu/Debian systems. - -``` -# apt -y install $(cat /tmp/pack1.txt) - -Reading package lists... Done -Building dependency tree -Reading state information... Done -The following packages were automatically installed and are no longer required: - libopts25 sntp -Use 'sudo apt autoremove' to remove them. -Suggested packages: - apache2-doc apache2-suexec-pristine | apache2-suexec-custom spell -The following NEW packages will be installed: - apache2 mariadb-server nano -0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded. -Need to get 339 kB of archives. -After this operation, 1,377 kB of additional disk space will be used. -Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.6 [95.1 kB] -Get:2 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 nano amd64 2.9.3-2 [231 kB] -Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mariadb-server all 1:10.1.38-0ubuntu0.18.04.1 [12.9 kB] -Fetched 339 kB in 19s (18.0 kB/s) -Selecting previously unselected package apache2. -(Reading database ... 290926 files and directories currently installed.) -Preparing to unpack .../apache2_2.4.29-1ubuntu4.6_amd64.deb ... -Unpacking apache2 (2.4.29-1ubuntu4.6) ... -Selecting previously unselected package nano. -Preparing to unpack .../nano_2.9.3-2_amd64.deb ... -Unpacking nano (2.9.3-2) ... -Selecting previously unselected package mariadb-server. -Preparing to unpack .../mariadb-server_1%3a10.1.38-0ubuntu0.18.04.1_all.deb ... -Unpacking mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... -Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... -Setting up apache2 (2.4.29-1ubuntu4.6) ... -Processing triggers for ureadahead (0.100.0-20) ... -Processing triggers for install-info (6.5.0.dfsg.1-2) ... -Setting up nano (2.9.3-2) ... -update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode -update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode -Processing triggers for systemd (237-3ubuntu10.20) ... -Processing triggers for man-db (2.8.3-2ubuntu0.1) ... -Setting up mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... -``` - -For removal, use the same format with appropriate option. - -``` -# apt -y remove $(cat /tmp/pack1.txt) -Reading package lists... Done -Building dependency tree -Reading state information... Done -The following packages were automatically installed and are no longer required: - apache2-bin apache2-data apache2-utils galera-3 libaio1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 liblua5.2-0 - libmysqlclient20 libopts25 libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common sntp socat -Use 'apt autoremove' to remove them. -The following packages will be REMOVED: - apache2 mariadb-server nano -0 upgraded, 0 newly installed, 3 to remove and 24 not upgraded. -After this operation, 1,377 kB disk space will be freed. -(Reading database ... 291046 files and directories currently installed.) -Removing apache2 (2.4.29-1ubuntu4.6) ... -Removing mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... -Removing nano (2.9.3-2) ... -update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in auto mode -Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... -Processing triggers for install-info (6.5.0.dfsg.1-2) ... -Processing triggers for man-db (2.8.3-2ubuntu0.1) ... -``` - -Use the following **[yum command][3]** to install listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). - -``` -# yum -y install $(cat /tmp/pack1.txt) -``` - -Use the following format to uninstall listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). - -``` -# yum -y remove $(cat /tmp/pack1.txt) -``` - -Use the following **[dnf command][4]** to install listed packages from a file on Fedora system. - -``` -# dnf -y install $(cat /tmp/pack1.txt) -``` - -Use the following format to uninstall listed packages from a file on Fedora system. - -``` -# dnf -y remove $(cat /tmp/pack1.txt) -``` - -Use the following **[zypper command][5]** to install listed packages from a file on openSUSE system. - -``` -# zypper -y install $(cat /tmp/pack1.txt) -``` - -Use the following format to uninstall listed packages from a file on openSUSE system. - -``` -# zypper -y remove $(cat /tmp/pack1.txt) -``` - -Use the following **[pacman command][6]** to install listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. - -``` -# pacman -S $(cat /tmp/pack1.txt) -``` - -Use the following format to uninstall listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. - -``` -# pacman -Rs $(cat /tmp/pack1.txt) -``` - -### Method-2 : How To Install Listed Packages From A File In Linux With Help Of cat And xargs Command? - -Even, i prefer to go with this method because this is very simple and straightforward method. - -Use the following apt command to install listed packages from a file on Debian based systems such as Debian, Ubuntu and Linux Mint. - -``` -# cat /tmp/pack1.txt | xargs apt -y install -``` - -Use the following apt command to uninstall listed packages from a file on Debian based systems such as Debian, Ubuntu and Linux Mint. - -``` -# cat /tmp/pack1.txt | xargs apt -y remove -``` - -Use the following yum command to install listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). - -``` -# cat /tmp/pack1.txt | xargs yum -y install -``` - -Use the following format to uninstall listed packages from a file on RHEL based systems such as CentOS, RHEL (Redhat) and OEL (Oracle Enterprise Linux). - -``` -# cat /tmp/pack1.txt | xargs yum -y remove -``` - -Use the following dnf command to install listed packages from a file on Fedora system. - -``` -# cat /tmp/pack1.txt | xargs dnf -y install -``` - -Use the following format to uninstall listed packages from a file on Fedora system. - -``` -# cat /tmp/pack1.txt | xargs dnf -y remove -``` - -Use the following zypper command to install listed packages from a file on openSUSE system. - -``` -# cat /tmp/pack1.txt | xargs zypper -y install -``` - -Use the following format to uninstall listed packages from a file on openSUSE system. - -``` -# cat /tmp/pack1.txt | xargs zypper -y remove -``` - -Use the following pacman command to install listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. - -``` -# cat /tmp/pack1.txt | xargs pacman -S -``` - -Use the following format to uninstall listed packages from a file on Arch Linux based systems such as Manjaro and Antergos system. - -``` -# cat /tmp/pack1.txt | xargs pacman -Rs -``` - -### Method-3 : How To Install Listed Packages From A File In Linux With Help Of For Loop Command? - -Alternatively we can use the “For Loop” command to achieve this. - -To install bulk packages. Use the below format to run a “For Loop” with single line. - -``` -# for pack in `cat /tmp/pack1.txt` ; do apt -y install $i; done -``` - -To install bulk packages with shell script use the following “For Loop”. - -``` -# vi /opt/scripts/bulk-package-install.sh - -#!/bin/bash -for pack in `cat /tmp/pack1.txt` -do apt -y remove $pack -done -``` - -Set an executable permission to `bulk-package-install.sh` file. - -``` -# chmod + bulk-package-install.sh -``` - -Finally run the script to achieve this. - -``` -# sh bulk-package-install.sh -``` - -### Method-4 : How To Install Listed Packages From A File In Linux With Help Of While Loop Command? - -Alternatively we can use the “While Loop” command to achieve this. - -To install bulk packages. Use the below format to run a “While Loop” with single line. - -``` -# file="/tmp/pack1.txt"; while read -r pack; do apt -y install $pack; done < "$file" -``` - -To install bulk packages with shell script use the following "While Loop". - -``` -# vi /opt/scripts/bulk-package-install.sh - -#!/bin/bash -file="/tmp/pack1.txt" -while read -r pack -do apt -y remove $pack -done < "$file" -``` - -Set an executable permission to `bulk-package-install.sh` file. - -``` -# chmod + bulk-package-install.sh -``` - -Finally run the script to achieve this. - -``` -# sh bulk-package-install.sh -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/ - -作者:[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/check-installed-packages-in-rhel-centos-fedora-debian-ubuntu-opensuse-arch-linux/ -[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[5]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ -[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ From 40fd90619d6ed8c75530f27515f65b827bd178d5 Mon Sep 17 00:00:00 2001 From: way-ww <40491614+way-ww@users.noreply.github.com> Date: Sun, 19 May 2019 09:55:15 +0800 Subject: [PATCH 0495/1154] Create 20190505 How To Install-Uninstall Listed Packages From A File In Linux.md --- ...ll Listed Packages From A File In Linux.md | 343 ++++++++++++++++++ 1 file changed, 343 insertions(+) create mode 100644 translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md diff --git a/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md new file mode 100644 index 0000000000..b825435dcb --- /dev/null +++ b/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -0,0 +1,343 @@ +[#]: collector: (lujun9972) +[#]: translator: (way-ww) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install/Uninstall Listed Packages From A File In Linux?) +[#]: via: (https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在 Linux 上安装/卸载一个文件中列出的软件包? +====== + +在某些情况下,你可能想要将一个服务器上的软件包列表安装到另一个服务器上。 + +例如,你已经在服务器A 上安装了 15 个软件包并且这些软件包也需要被安装到服务器B,服务器C 上等等。 + +我们可以手动去安装这些软件但是这将花费大量的时间。 + +你可以手动安装一俩个服务器,但是试想如果你有大概十个服务器呢。 + +在这种情况下你无法手动完成工作,那么怎样才能解决问题呢? + +不要担心我们可以帮你摆脱这样的情况和场景。 + +我们在这篇文章中增加了四种方法来克服困难。 + +我希望这可以帮你解决问题。我已经在 Centos7 和 Ubuntu 18.04 上测试了这些命令。 + +我也希望这可以在其他发行版上工作。这仅仅需要使用该发行版的官方包管理器命令替代本文中的包管理器命令就行了。 + +如果想要 **[检查 Linux 系统上已安装的软件包列表][1]** 请点击链接。 + +例如,如果你想要在基于 RHEL 系统上创建软件包列表请使用以下步骤。其他发行版也一样。 + +``` +# rpm -qa --last | head -15 | awk '{print $1}' > /tmp/pack1.txt + +# cat /tmp/pack1.txt +mariadb-server-5.5.60-1.el7_5.x86_64 +perl-DBI-1.627-4.el7.x86_64 +perl-DBD-MySQL-4.023-6.el7.x86_64 +perl-PlRPC-0.2020-14.el7.noarch +perl-Net-Daemon-0.48-5.el7.noarch +perl-IO-Compress-2.061-2.el7.noarch +perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 +mariadb-5.5.60-1.el7_5.x86_64 +perl-Data-Dumper-2.145-3.el7.x86_64 +perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 +httpd-2.4.6-88.el7.centos.x86_64 +mailcap-2.1.41-2.el7.noarch +httpd-tools-2.4.6-88.el7.centos.x86_64 +apr-util-1.5.2-6.el7.x86_64 +apr-1.4.8-3.el7_4.1.x86_64 +``` + +### 方法一 : 如何在 Linux 上使用 cat 命令安装文件中列出的包? + +为实现这个目标,我将使用简单明了的第一种方法。 + +为此,创建一个文件并添加上你想要安装的包列表。 + +出于测试的目的,我们将只添加以下的三个软件包名到文件中。 + +``` +# cat /tmp/pack1.txt + +apache2 +mariadb-server +nano +``` + +只要简单的运行 **[apt 命令][2]** 就能在 Ubuntu/Debian 系统上一次性安装所有的软件包。 + +``` +# apt -y install $(cat /tmp/pack1.txt) + +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages were automatically installed and are no longer required: + libopts25 sntp +Use 'sudo apt autoremove' to remove them. +Suggested packages: + apache2-doc apache2-suexec-pristine | apache2-suexec-custom spell +The following NEW packages will be installed: + apache2 mariadb-server nano +0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded. +Need to get 339 kB of archives. +After this operation, 1,377 kB of additional disk space will be used. +Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.6 [95.1 kB] +Get:2 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 nano amd64 2.9.3-2 [231 kB] +Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mariadb-server all 1:10.1.38-0ubuntu0.18.04.1 [12.9 kB] +Fetched 339 kB in 19s (18.0 kB/s) +Selecting previously unselected package apache2. +(Reading database ... 290926 files and directories currently installed.) +Preparing to unpack .../apache2_2.4.29-1ubuntu4.6_amd64.deb ... +Unpacking apache2 (2.4.29-1ubuntu4.6) ... +Selecting previously unselected package nano. +Preparing to unpack .../nano_2.9.3-2_amd64.deb ... +Unpacking nano (2.9.3-2) ... +Selecting previously unselected package mariadb-server. +Preparing to unpack .../mariadb-server_1%3a10.1.38-0ubuntu0.18.04.1_all.deb ... +Unpacking mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... +Setting up apache2 (2.4.29-1ubuntu4.6) ... +Processing triggers for ureadahead (0.100.0-20) ... +Processing triggers for install-info (6.5.0.dfsg.1-2) ... +Setting up nano (2.9.3-2) ... +update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode +update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode +Processing triggers for systemd (237-3ubuntu10.20) ... +Processing triggers for man-db (2.8.3-2ubuntu0.1) ... +Setting up mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +``` + +至于删除,需要使用相同的命令格式和适当的选项。 + +``` +# apt -y remove $(cat /tmp/pack1.txt) +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages were automatically installed and are no longer required: + apache2-bin apache2-data apache2-utils galera-3 libaio1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 liblua5.2-0 + libmysqlclient20 libopts25 libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common sntp socat +Use 'apt autoremove' to remove them. +The following packages will be REMOVED: + apache2 mariadb-server nano +0 upgraded, 0 newly installed, 3 to remove and 24 not upgraded. +After this operation, 1,377 kB disk space will be freed. +(Reading database ... 291046 files and directories currently installed.) +Removing apache2 (2.4.29-1ubuntu4.6) ... +Removing mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +Removing nano (2.9.3-2) ... +update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in auto mode +Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... +Processing triggers for install-info (6.5.0.dfsg.1-2) ... +Processing triggers for man-db (2.8.3-2ubuntu0.1) ... +``` + +使用 **[yum 命令][3]** 在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上安装文件中列出的软件包。 + + +``` +# yum -y install $(cat /tmp/pack1.txt) +``` + +使用以命令在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上卸载文件中列出的软件包。 + +``` +# yum -y remove $(cat /tmp/pack1.txt) +``` + +使用以下 **[dnf 命令][4]** 在 Fedora 系统上安装文件中列出的软件包。 + +``` +# dnf -y install $(cat /tmp/pack1.txt) +``` + +使用以下命令在 Fedora 系统上卸载文件中列出的软件包。 + +``` +# dnf -y remove $(cat /tmp/pack1.txt) +``` + +使用以下 **[zypper 命令][5]** 在 openSUSE 系统上安装文件中列出的软件包。 + +``` +# zypper -y install $(cat /tmp/pack1.txt) +``` + +使用以下命令从 openSUSE 系统上卸载文件中列出的软件包。 + +``` +# zypper -y remove $(cat /tmp/pack1.txt) +``` + +使用以下 **[pacman 命令][6]** 在基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上安装文件中列出的软件包。 + +``` +# pacman -S $(cat /tmp/pack1.txt) +``` + +使用以下命令从基于 Arch Linux (如 Manjaro 和 Antergos) 的系统中卸载文件中列出的软件包。 + + +``` +# pacman -Rs $(cat /tmp/pack1.txt) +``` + +### 方法二 : 如何使用 cat 和 xargs 命令在 Linux 中安装文件中列出的软件包。 + +甚至,我更喜欢使用这种方法,因为这是一种非常简单直接的方法。 + +使用以下 apt 命令在基于 Debian 的系统 (如 Debian,Ubuntu和Linux Mint) 上安装文件中列出的软件包。 + + +``` +# cat /tmp/pack1.txt | xargs apt -y install +``` + +使用以下 apt 命令 从基于 Debian 的系统 (如 Debian,Ubuntu和Linux Mint) 上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs apt -y remove +``` + +使用以下 yum 命令在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上安装文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs yum -y install +``` + +使用以命令从基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs yum -y remove +``` + +使用以下 dnf 命令在 Fedora 系统上安装文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs dnf -y install +``` + +使用以下命令从 Fedora 系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs dnf -y remove +``` + +使用以下 zypper 命令在 openSUSE 系统上安装文件中列出的软件包。 + + +``` +# cat /tmp/pack1.txt | xargs zypper -y install +``` + +使用以下命令从 openSUSE 系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs zypper -y remove +``` + +使用以下 pacman 命令在基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上安装文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs pacman -S +``` + +使用下以命令从基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs pacman -Rs +``` + +### 方法三 : 如何使用 For Loop 在 Linux 上安装文件中列出的软件包? +我们也可以使用 For 循环命令来实现此目的。 + +安装批量包可以使用以下一条 For 循环的命令。 + +``` +# for pack in `cat /tmp/pack1.txt` ; do apt -y install $i; done +``` + +要使用 shell 脚本安装批量包,请使用以下 For 循环。 + + +``` +# vi /opt/scripts/bulk-package-install.sh + +#!/bin/bash +for pack in `cat /tmp/pack1.txt` +do apt -y remove $pack +done +``` + +为 bulk-package-install.sh 设置可执行权限。 + +``` +# chmod + bulk-package-install.sh +``` + +最后运行这个脚本。 + +``` +# sh bulk-package-install.sh +``` + +### 方法四 : 如何使用 While 循环在 Linux 上安装文件中列出的软件包。 + +我们也可以使用 While 循环命令来实现目的。 + +安装批量包可以使用以下一条 While 循环的命令。 + +``` +# file="/tmp/pack1.txt"; while read -r pack; do apt -y install $pack; done < "$file" +``` + +要使用 shell 脚本安装批量包,请使用以下 While 循环。 + +``` +# vi /opt/scripts/bulk-package-install.sh + +#!/bin/bash +file="/tmp/pack1.txt" +while read -r pack +do apt -y remove $pack +done < "$file" +``` + +为 bulk-package-install.sh 设置可执行权限。 + +``` +# chmod + bulk-package-install.sh +``` + +最后运行这个脚本。 + +``` +# sh bulk-package-install.sh +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[way-ww](https://github.com/way-ww) +校对:[校对者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/check-installed-packages-in-rhel-centos-fedora-debian-ubuntu-opensuse-arch-linux/ +[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[5]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ + From d8628e2e53f513af5442a23e7cd61632a8507d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sun, 19 May 2019 10:08:34 +0800 Subject: [PATCH 0496/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20190131 OOP Before OOP with Simula.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190131 OOP Before OOP with Simula.md b/sources/talk/20190131 OOP Before OOP with Simula.md index cae9d9bd3a..aca160ad2d 100644 --- a/sources/talk/20190131 OOP Before OOP with Simula.md +++ b/sources/talk/20190131 OOP Before OOP with Simula.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2925dc84ca365a25a940cf9ab7e722c1cc2722fa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:12:38 +0800 Subject: [PATCH 0497/1154] PRF:20181218 Using Pygame to move your game character around.md @cycoe --- ...game to move your game character around.md | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/translated/tech/20181218 Using Pygame to move your game character around.md b/translated/tech/20181218 Using Pygame to move your game character around.md index 5d94f6a620..7b289f72c4 100644 --- a/translated/tech/20181218 Using Pygame to move your game character around.md +++ b/translated/tech/20181218 Using Pygame to move your game character around.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using Pygame to move your game character around) @@ -9,7 +9,8 @@ 用 Pygame 使你的游戏角色移动起来 ====== -在本系列的第四部分,学习如何编写移动游戏角色的控制代码。 +> 在本系列的第四部分,学习如何编写移动游戏角色的控制代码。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python4-game.png?itok=tXFHaLdt) 在这个系列的第一篇文章中,我解释了如何使用 Python 创建一个简单的[基于文本的骰子游戏][1]。在第二部分中,我向你们展示了如何从头开始构建游戏,即从 [创建游戏的环境][2] 开始。然后在第三部分,我们[创建了一个玩家妖精][3],并且使它在你的(而不是空的)游戏世界内生成。你可能已经注意到,如果你不能移动你的角色,那么游戏不是那么有趣。在本篇文章中,我们将使用 Pygame 来添加键盘控制,如此一来你就可以控制你的角色的移动。 @@ -18,7 +19,7 @@ 在本系列的第二篇文章中,你已经为退出游戏创建了一个按键,移动角色的(按键)原则也是相同的。但是,使你的角色移动起来要稍微复杂一点。 -让我们从简单的部分入手:设置控制器按键 +让我们从简单的部分入手:设置控制器按键。 ### 为控制你的玩家妖精设置按键 @@ -56,11 +57,11 @@ while main == True:                 main = False     ``` -一些人偏好使用键盘字母 W、A、S 和 D 来控制玩家角色,而另一些偏好使用方向键。因此确保你包含了两种选项。 +一些人偏好使用键盘字母 `W`、`A`、`S` 和 `D` 来控制玩家角色,而另一些偏好使用方向键。因此确保你包含了两种选项。 -**注意:**当你在编程时,同时考虑所有用户是非常重要的。如果你写代码只是为了自己运行,那么很可能你会成为你写的程序的唯一用户。更重要的是,如果你想找一个通过写代码赚钱的工作,你写的代码就应该让所有人都能运行。给你的用户选择权,比如提供使用方向键或 WASD 的选项,是一个优秀程序员的标志。 +注意:当你在编程时,同时考虑所有用户是非常重要的。如果你写代码只是为了自己运行,那么很可能你会成为你写的程序的唯一用户。更重要的是,如果你想找一个通过写代码赚钱的工作,你写的代码就应该让所有人都能运行。给你的用户选择权,比如提供使用方向键或 WASD 的选项,是一个优秀程序员的标志。 -使用 Python 启动你的游戏,并在你按下“上下左右”方向键或 A、D 和 W 键的时候查看控制台窗口的输出。 +使用 Python 启动你的游戏,并在你按下“上下左右”方向键或 `A`、`D` 和 `W` 键的时候查看控制台窗口的输出。 ``` $ python ./your-name_game.py @@ -77,9 +78,9 @@ $ python ./your-name_game.py 为了使你的妖精移动起来,你必须为你的妖精创建一个属性代表移动。当你的妖精没有在移动时,这个变量被设为 `0`。 -如果你正在为你的妖精设置动画,或者你决定在将来为他设置动画,你还必须跟踪帧来使走路循环保持在轨迹上。 +如果你正在为你的妖精设置动画,或者你决定在将来为它设置动画,你还必须跟踪帧来使走路循环保持在轨迹上。 -在 Player 类中创建如下变量。开头两行作为上下文对照(如果你一直跟着做,你的代码中就已经有这两行),因此只需要添加最后三行: +在 `Player` 类中创建如下变量。开头两行作为上下文对照(如果你一直跟着做,你的代码中就已经有这两行),因此只需要添加最后三行: ```     def __init__(self): @@ -91,9 +92,9 @@ $ python ./your-name_game.py 设置好了这些变量,是时候去为妖精移动编写代码了。 -玩家妖精不需要时刻响应控制,优势它并没有在移动。控制妖精的代码,仅仅只是玩家妖精所有能做的事情中的一小部分。在 Python 中,当你想要使一个对象做某件事并独立于剩余其他代码时,你可以将你的新代码放入一个函数。Python 的函数以关键词 `def` 开头,(该关键词)代表了定义函数。 +玩家妖精不需要时刻响应控制,有时它并没有在移动。控制妖精的代码,仅仅只是玩家妖精所有能做的事情中的一小部分。在 Python 中,当你想要使一个对象做某件事并独立于剩余其他代码时,你可以将你的新代码放入一个函数。Python 的函数以关键词 `def` 开头,(该关键词)代表了定义函数。 -在你的 Player 类中创建如下函数,来为你的妖精在屏幕上的位置增加几个像素。现在先不要担心你增加几个像素,这将在后续的代码中确定。 +在你的 `Player` 类中创建如下函数,来为你的妖精在屏幕上的位置增加几个像素。现在先不要担心你增加几个像素,这将在后续的代码中确定。 ```     def control(self,x,y): @@ -154,7 +155,7 @@ steps = 10  # 移动多少个像素 现在你已经有了适当的函数和变量,使用你的按键来触发函数并将变量传递给你的妖精。 -为此,将主循环中的 `print` 语句替换为玩家妖精的名字(player)、函数(.control)以及你希望玩家妖精在每个循环中沿 X 轴和 Y 轴移动的步数。 +为此,将主循环中的 `print` 语句替换为玩家妖精的名字(`player`)、函数(`.control`)以及你希望玩家妖精在每个循环中沿 X 轴和 Y 轴移动的步数。 ```         if event.type == pygame.KEYDOWN: @@ -176,7 +177,7 @@ steps = 10  # 移动多少个像素                 main = False ``` -记住,`steps` 变量代表了当一个按键被按下时,你的妖精会移动多少个像素。如果当你按下 D 或右方向键时,你的妖精的位置增加了 10 个像素。那么当你停止按下这个键时,你必须(将 `step`)减 10(`-steps`)来使你的妖精的动量回到 0。 +记住,`steps` 变量代表了当一个按键被按下时,你的妖精会移动多少个像素。如果当你按下 `D` 或右方向键时,你的妖精的位置增加了 10 个像素。那么当你停止按下这个键时,你必须(将 `step`)减 10(`-steps`)来使你的妖精的动量回到 0。 现在尝试你的游戏。注意:它不会像你预想的那样运行。 @@ -340,14 +341,14 @@ via: https://opensource.com/article/17/12/game-python-moving-player 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[cycoe](https://github.com/cycoe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/17/10/python-101 -[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world -[3]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player +[1]: https://linux.cn/article-9071-1.html +[2]: https://linux.cn/article-10850-1.html +[3]: https://linux.cn/article-10858-1.html [4]: http://pygame.org/docs/ref/joystick.html [5]: http://pygame.org/docs/ref/mouse.html#module-pygame.mouse From 496863bafe2b321fd7cd423118f2e9ef1057e16b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:13:09 +0800 Subject: [PATCH 0498/1154] PUB:20181218 Using Pygame to move your game character around.md @cycoe https://linux.cn/article-10874-1.html --- ...0181218 Using Pygame to move your game character around.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181218 Using Pygame to move your game character around.md (99%) diff --git a/translated/tech/20181218 Using Pygame to move your game character around.md b/published/20181218 Using Pygame to move your game character around.md similarity index 99% rename from translated/tech/20181218 Using Pygame to move your game character around.md rename to published/20181218 Using Pygame to move your game character around.md index 7b289f72c4..9605601ad7 100644 --- a/translated/tech/20181218 Using Pygame to move your game character around.md +++ b/published/20181218 Using Pygame to move your game character around.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10874-1.html) [#]: subject: (Using Pygame to move your game character around) [#]: via: (https://opensource.com/article/17/12/game-python-moving-player) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From e671efc2931bd55cff38f576fe93c45aa7ddfaab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:19:47 +0800 Subject: [PATCH 0499/1154] PRF:20190425 Automate backups with restic and systemd.md @geekpi --- ...utomate backups with restic and systemd.md | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/translated/tech/20190425 Automate backups with restic and systemd.md b/translated/tech/20190425 Automate backups with restic and systemd.md index f3ac58b09c..6a0dcc3878 100644 --- a/translated/tech/20190425 Automate backups with restic and systemd.md +++ b/translated/tech/20190425 Automate backups with restic and systemd.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Automate backups with restic and systemd) @@ -12,18 +12,17 @@ ![][1] -及时备份很重要。即使在 [Fedora Magazine][3] 中,[备份软件][2] 也是一个常见的讨论话题。本文演示了如何仅使用 systemd 以及 **restic** 来自动备份。 +及时备份很重要。即使在 [Fedora Magazine][3] 中,[备份软件][2] 也是一个常见的讨论话题。本文演示了如何仅使用 systemd 以及 `restic` 来自动备份。 +有关 `restic` 的介绍,请查看我们的文章[在 Fedora 上使用 restic 进行加密备份][4]。然后继续阅读以了解更多详情。 -有关 restic 的介绍,请查看我们的文章[在 Fedora 上使用 restic 进行加密备份][4]。然后继续阅读以了解更多详情。 - -为了自动创建快照以及清理数据,需要运行两个 systemd 服务。第一个运行_备份_命令的服务需要以常规频率运行。第二个服务负责数据清理。 +为了自动创建快照以及清理数据,需要运行两个 systemd 服务。第一个运行*备份*命令的服务需要以常规频率运行。第二个服务负责数据清理。 如果你根本不熟悉 systemd,那么这是个很好的学习机会。查看 [Magazine 上关于 systemd 的系列文章] [5],从单元文件的这个入门开始: -> [systemd 单元文件基础][6] +- [systemd 单元文件基础][6] -如果你还没有安装 restic,请注意它在官方的 Fedora 仓库中。要安装它,请[带上 sudo][7] 运行此命令: +如果你还没有安装 `restic`,请注意它在官方的 Fedora 仓库中。要安装它,请[带上 sudo][7] 运行此命令: ``` $ sudo dnf install restic @@ -31,7 +30,7 @@ $ sudo dnf install restic ### 备份 -首先,创建 _~/.config/systemd/user/restic-backup.service_。将下面的文本复制并粘贴到文件中以获得最佳效果。 +首先,创建 `~/.config/systemd/user/restic-backup.service`。将下面的文本复制并粘贴到文件中以获得最佳效果。 ``` [Unit] @@ -43,7 +42,7 @@ ExecStartPost=restic forget --verbose --tag systemd.timer --group-by "paths,tags EnvironmentFile=%h/.config/restic-backup.conf ``` -此服务引用环境文件来加载密钥(例如 _RESTIC_PASSWORD_)。创建 _~/.config/restic-backup.conf_。复制并粘贴以下内容以获得最佳效果。此示例使用 BackBlaze B2 存储。请相应地调整 ID、密钥、仓库和密码值。 +此服务引用环境文件来加载密钥(例如 `RESTIC_PASSWORD`)。创建 `~/.config/restic-backup.conf`。复制并粘贴以下内容以获得最佳效果。此示例使用 BackBlaze B2 存储。请相应地调整 ID、密钥、仓库和密码值。 ``` BACKUP_PATHS="/home/rupert" @@ -58,9 +57,9 @@ RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ``` -现在已安装该服务,请重新加载 systemd:_systemctl -user daemon-reload_。尝试手动运行该服务以创建备份:_systemctl -user start restic-backup_。 +现在已安装该服务,请重新加载 systemd:`systemctl -user daemon-reload`。尝试手动运行该服务以创建备份:`systemctl -user start restic-backup`。 -因为该服务类型是 _oneshot_,它将运行一次并退出。验证服务运行并根据需要创建快照后,设置计时器以定期运行此服务。例如,要每天运行 _restic-backup.service_,请按如下所示创建 _~/.config/systemd/user/restic-backup.timer_。再次复制并粘贴此文本: +因为该服务类型是*一次性*,它将运行一次并退出。验证服务运行并根据需要创建快照后,设置计时器以定期运行此服务。例如,要每天运行 `restic-backup.service`,请按如下所示创建 `~/.config/systemd/user/restic-backup.timer`。再次复制并粘贴此文本: ``` [Unit] @@ -80,7 +79,7 @@ $ systemctl --user enable --now restic-backup.timer ### 清理 -虽然主服务运行 _forget_ 命令仅保留保留策略中的快照,但实际上并未从 restic 仓库中删除数据。 _prune_ 命令检查仓库和当前快照,并删除与快照无关的所有数据。由于 _prune_ 可能是一个耗时的过程,因此无需在每次运行备份时运行。这是第二个服务和计时器的场景。首先,通过复制和粘贴此文本来创建文件 _~/.config/systemd/user/restic-prune.service_: +虽然主服务运行 `forget` 命令仅保留保留策略中的快照,但实际上并未从 `restic` 仓库中删除数据。 `prune` 命令检查仓库和当前快照,并删除与快照无关的所有数据。由于 `prune` 可能是一个耗时的过程,因此无需在每次运行备份时运行。这是第二个服务和计时器的场景。首先,通过复制和粘贴此文本来创建文件 `~/.config/systemd/user/restic-prune.service`: ``` [Unit] @@ -91,7 +90,7 @@ ExecStart=restic prune EnvironmentFile=%h/.config/restic-backup.conf ``` -与主 _restic-backup.service_ 服务类似,_restic-prune_ 也是 onehot 服务,并且可以手动运行。设置完服务后,创建 _~/.config/systemd/user/restic-prune.timer_ 并启用相应的计时器: +与主 `restic-backup.service` 服务类似,`restic-prune` 也是一次性服务,并且可以手动运行。设置完服务后,创建 `~/.config/systemd/user/restic-prune.timer` 并启用相应的计时器: ``` [Unit] @@ -103,11 +102,11 @@ Persistent=true WantedBy=timers.target ``` -就是这些了!restic 将会每日运行并按月清理数据。 +就是这些了!`restic` 将会每日运行并按月清理数据。 * * * -图片来自 _[Unsplash][9]_ 由 _[ Samuel Zeller][8]_ 拍摄。 +图片来自 [Unsplash][9] 由 [Samuel Zeller][8] 拍摄。 -------------------------------------------------------------------------------- @@ -116,7 +115,7 @@ via: https://fedoramagazine.org/automate-backups-with-restic-and-systemd/ 作者:[Link Dupont][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/) 荣誉推出 From 2528fabcfb34d6e0f5c31a3ce5fc344a09e60783 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:20:19 +0800 Subject: [PATCH 0500/1154] PUB:20190425 Automate backups with restic and systemd.md @geekpi https://linux.cn/article-10875-1.html --- .../20190425 Automate backups with restic and systemd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190425 Automate backups with restic and systemd.md (98%) diff --git a/translated/tech/20190425 Automate backups with restic and systemd.md b/published/20190425 Automate backups with restic and systemd.md similarity index 98% rename from translated/tech/20190425 Automate backups with restic and systemd.md rename to published/20190425 Automate backups with restic and systemd.md index 6a0dcc3878..677a87c3f4 100644 --- a/translated/tech/20190425 Automate backups with restic and systemd.md +++ b/published/20190425 Automate backups with restic and systemd.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10875-1.html) [#]: subject: (Automate backups with restic and systemd) [#]: via: (https://fedoramagazine.org/automate-backups-with-restic-and-systemd/) [#]: author: (Link Dupont https://fedoramagazine.org/author/linkdupont/) From 8ea452db99e52b4a9f7167627ea6dbb451af1334 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:38:54 +0800 Subject: [PATCH 0501/1154] PRF:20190501 Cisco issues critical security warning for Nexus data-center switches.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @hopefully2333 翻译的很好,就是不要丢失了链接标签。 --- ... warning for Nexus data-center switches.md | 45 ++++++++----------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md index c9df2cf407..ff02b8bdff 100644 --- a/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md +++ b/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -1,67 +1,60 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Cisco issues critical security warning for Nexus data-center switches) -[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all) +[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html) [#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) 思科针对 Nexus 数据中心交换机发出危急安全预警 ====== -思科围绕着 Nexus 的交换机、Firepower 防火墙和其他设备,发布了 40 个安全报告。 + +> 思科围绕着 Nexus 的交换机、Firepower 防火墙和其他设备,发布了 40 个安全报告。 + ![Thinkstock][1] -今天思科发布了 40 个左右的安全报告,但只有其中的一个被评定为“危急”-思科 Nexus 9000 系列应用中心基础设施(ACI)模式数据中心交换机中的一个漏洞,可能会让攻击者隐秘地访问到系统资源。 +日前,思科发布了 40 个左右的安全报告,但只有其中的一个被评定为“[危急][2]”:思科 Nexus 9000 系列应用中心基础设施(ACI)模式数据中心交换机中的一个漏洞,可能会让攻击者隐秘地访问到系统资源。 这个新发现的漏洞,被通用漏洞评分系统给到了 9.8 分(满分 10 分),思科表示,它是思科 Nexus 9000 系列的安全 shell (ssh)密钥管理方面的问题,这个漏洞允许远程攻击者以 root 用户的权限来连接到受影响的系统。 -**[ 另请阅读:如何规划一个软件定义的数据中心网络 ][3] ]** +思科表示,“**这个漏洞是因为所有的设备都存在一对默认的 ssh 密钥对**,攻击者可以使用提取到的密钥材料,并通过 IPv6 来创建连接到目标设备的 SSH 连接。这个漏洞仅能通过 IPv6 来进行利用,IPv4 不会被攻击”。 -思科表示,“这个漏洞是因为所有的设备都存在一对默认的 ssh 密钥对,攻击者可以使用提取到的密钥材料,并通过 IPv6 来创建连接到目标设备的 SSH 连接。这个漏洞仅能通过 IPv6 来进行利用,IPv4 不会被攻击”。 +型号为 Nexus 9000 系列且 NX-OS 软件版本在 14.1 之前的设备会受此漏洞的影响,该公司表示没有解决这个问题的变通办法。 -型号为 Nexus 9000 系列且 NX-OS 软件版本在 14.1 之前的设备会受此漏洞的影响,该公司表示没有解决这个问题的办法。 - -然而,思科公司已经为解决这个漏洞发布了免费的软件更新。 +然而,思科公司已经为解决这个漏洞[发布了免费的软件更新][4]。 该公司同样对 Nexus 9000 系列发布了一个“高危”级别的安全预警报告,报告中表示存在一种攻击,允许攻击者以 root 用户权限在受影响的设备上执行任意操作系统命令。思科表示,如果要用这种方式攻击成功,攻击者需要对应设备的有效的管理员用户凭证。 -思科表示,这个漏洞是由于过于宽泛的系统文件权限造成的。攻击者可以通过向受影响的设备进行认证,构造一个精心设计的命令字符串,并将这个字符串写入到特定位置的文件里。攻击者通过这种方式来利用这个漏洞。 - -**[[通过 PluralSight 的综合在线课程成为一名认证信息安全系统工程师。现在提供为期 10 天的免费试用!][6] ]** +[思科表示][5],这个漏洞是由于过于宽泛的系统文件权限造成的。攻击者可以通过向受影响的设备进行认证,构造一个精心设计的命令字符串,并将这个字符串写入到特定位置的文件里。攻击者通过这种方式来利用这个漏洞。 思科发布了解决这个漏洞的软件更新。 另外两个被评为“高危”级别的漏洞的影响范围同样包括 Nexus 9000 系列: -思科 Nexus 9000 系列软件后台操作功能中的漏洞,能够允许一个已认证的本地攻击者在受影响的设备上提升到 root 权限。这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。思科表示,攻击者可以通过登录到受影响设备的命令行界面,并在文件系统的特定目录中构造一个精心设计过的文件,以此来利用这个漏洞。 +- 思科 Nexus 9000 系列软件后台操作功能中的[漏洞][7],能够允许一个已认证的本地攻击者在受影响的设备上提权到 root 权限。这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。思科表示,攻击者可以通过登录到受影响设备的命令行界面,并在文件系统的特定目录中构造一个精心设计过的文件,以此来利用这个漏洞。 +- 交换机软件后台操作功能中的[弱点][7]能够允许攻击者登录到受影响设备的命令行界面,并在文件系统的特定目录里创建一个精心构造过的文件。思科表示,这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。 -交换机软件后台操作功能中的弱点能够允许攻击者登录到受影响设备的命令行界面,并在文件系统的特定目录里创建一个精心构造过的文件。思科表示,这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。 - - - -思科同样为这些漏洞发布了软件更新。 +思科同样为这些漏洞[发布了软件更新][4]。 此外,这些安全警告中的一部分是针对思科 FirePower 防火墙系列中大量的“高危”漏洞警告。 -例如,思科写道,思科 Firepower 威胁防御软件的 SMB 协议预处理检测引擎中的多个漏洞能够允许未认证的相邻、远程攻击者造成拒绝服务攻击(DoS)的情况。 +例如,思科[写道][8],思科 Firepower 威胁防御软件的 SMB 协议预处理检测引擎中的多个漏洞能够允许未认证的相邻、远程攻击者造成拒绝服务攻击(DoS)的情况。 -思科表示,思科 Firepower 2100 系列中思科 Firepower 软件里的内部数据包处理功能有另一个漏洞,能够让未认证的远程攻击者造成受影响的设备停止处理流量,从而导致 DOS 的情况。 +思科表示,思科 Firepower 2100 系列中思科 Firepower 软件里的内部数据包处理功能有[另一个漏洞][9],能够让未认证的远程攻击者造成受影响的设备停止处理流量,从而导致 DOS 的情况。 -软件补丁可用于这些漏洞。 +[软件补丁][4]可用于这些漏洞。 -其他的产品,比如思科自适应安全虚拟设备和 web 安全设备同样也有高优先级的补丁。 - -加入 Facebook 和 LinkedIn 中的网络世界社区,在最上面的主题里做评论。 +其他的产品,比如思科[自适应安全虚拟设备][10]和 [web 安全设备][11]同样也有高优先级的补丁。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html#tk.rss_all +via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html 作者:[Michael Cooney][a] 选题:[lujun9972][b] 译者:[hopefully2333](https://github.com/hopefully2333) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 364b0db74b6b77c85144f6a10492d33be50a2f33 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 May 2019 23:39:37 +0800 Subject: [PATCH 0502/1154] PUB:20190501 Cisco issues critical security warning for Nexus data-center switches.md @hopefully2333 https://linux.cn/article-10876-1.html --- ...ritical security warning for Nexus data-center switches.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190501 Cisco issues critical security warning for Nexus data-center switches.md (98%) diff --git a/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/published/20190501 Cisco issues critical security warning for Nexus data-center switches.md similarity index 98% rename from translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md rename to published/20190501 Cisco issues critical security warning for Nexus data-center switches.md index ff02b8bdff..e71bd21d6b 100644 --- a/translated/talk/20190501 Cisco issues critical security warning for Nexus data-center switches.md +++ b/published/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (hopefully2333) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10876-1.html) [#]: subject: (Cisco issues critical security warning for Nexus data-center switches) [#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html) [#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) From 58b7e81209fdbf89346955b4b1816078259241e5 Mon Sep 17 00:00:00 2001 From: Moelf Date: Sun, 19 May 2019 16:49:05 -0700 Subject: [PATCH 0503/1154] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20Use=20force=20in=20commandline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing the force at the Linux command line.md | 240 ------------------ ...ing the force at the Linux command line.md | 225 ++++++++++++++++ 2 files changed, 225 insertions(+), 240 deletions(-) delete mode 100644 sources/tech/20190504 Using the force at the Linux command line.md create mode 100644 translated/tech/20190504 Using the force at the Linux command line.md diff --git a/sources/tech/20190504 Using the force at the Linux command line.md b/sources/tech/20190504 Using the force at the Linux command line.md deleted file mode 100644 index b4a937797c..0000000000 --- a/sources/tech/20190504 Using the force at the Linux command line.md +++ /dev/null @@ -1,240 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Moelf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using the force at the Linux command line) -[#]: via: (https://opensource.com/article/19/5/may-the-force-linux) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) - -Using the force at the Linux command line -====== -Like the Jedi Force, -f is powerful, potentially destructive, and very -helpful when you know how to use it. -![Fireworks][1] - -Sometime in recent history, sci-fi nerds began an annual celebration of everything [_Star Wars_ on May the 4th][2], a pun on the Jedi blessing, "May the Force be with you." Although most Linux users are probably not Jedi, they still have ways to use the force. Of course, the movie might not have been quite as exciting if Yoda simply told Luke to type **man X-Wing fighter** or **man force**. Or if he'd said, "RTFM" (Read the Force Manual, of course). - -Many Linux commands have an **-f** option, which stands for, you guessed it, force! Sometimes when you execute a command, it fails or prompts you for additional input. This may be an effort to protect the files you are trying to change or inform the user that a device is busy or a file already exists. - -If you don't want to be bothered by prompts or don't care about errors, use the force! - -Be aware that using a command's force option to override these protections is, generally, destructive. Therefore, the user needs to pay close attention and be sure that they know what they are doing. Using the force can have consequences! - -Following are four Linux commands with a force option and a brief description of how and why you might want to use it. - -### cp - -The **cp** command is short for copy—it's used to copy (or duplicate) a file or directory. The [man page][3] describes the force option for **cp** as: - - -``` --f, --force -if an existing destination file cannot be opened, remove it -and try again -``` - -This example is for when you are working with read-only files: - - -``` -[alan@workstation ~]$ ls -l -total 8 --rw-rw---- 1 alan alan 13 May 1 12:24 Hoth --r--r----- 1 alan alan 14 May 1 12:23 Naboo -[alan@workstation ~]$ cat Hoth Naboo -Icy Planet - -Green Planet -``` - -If you want to copy a file called _Hoth_ to _Naboo_ , the **cp** command will not allow it since _Naboo_ is read-only: - - -``` -[alan@workstation ~]$ cp Hoth Naboo -cp: cannot create regular file 'Naboo': Permission denied -``` - -But by using the force, **cp** will not prompt. The contents and permissions of _Hoth_ will immediately be copied to _Naboo_ : - - -``` -[alan@workstation ~]$ cp -f Hoth Naboo -[alan@workstation ~]$ cat Hoth Naboo -Icy Planet - -Icy Planet - -[alan@workstation ~]$ ls -l -total 8 --rw-rw---- 1 alan alan 12 May 1 12:32 Hoth --rw-rw---- 1 alan alan 12 May 1 12:38 Naboo -``` - -Oh no! I hope they have winter gear on Naboo. - -### ln - -The **ln** command is used to make links between files. The [man page][4] describes the force option for **ln** as: - - -``` --f, --force -remove existing destination files -``` - -Suppose Princess Leia is maintaining a Java application server and she has a directory where all Java versions are stored. Here is an example: - - -``` -leia@workstation:/usr/lib/java$ ls -lt -total 28 -lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 -``` - -As you can see, there are several versions of the Java Development Kit (JDK) and a symbolic link pointing to the latest one. She uses a script with the following commands to install new JDK versions. However, it won't work without a force option or unless the root user runs it: - - -``` -tar xvzmf jdk1.8.0_181.tar.gz -C jdk1.8.0_181/ -ln -vs jdk1.8.0_181 jdk -``` - -The **tar** command will extract the .gz file to the specified directory, but the **ln** command will fail to upgrade the link because one already exists. The result will be that the link no longer points to the latest JDK: - - -``` -leia@workstation:/usr/lib/java$ ln -vs jdk1.8.0_181 jdk -ln: failed to create symbolic link 'jdk/jdk1.8.0_181': File exists -leia@workstation:/usr/lib/java$ ls -lt -total 28 -drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 -lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 -``` - -She can force **ln** to update the link correctly by passing the force option and one other, **-n**. The **-n** is needed because the link points to a directory. Now, the link again points to the latest JDK: - - -``` -leia@workstation:/usr/lib/java$ ln -vsnf jdk1.8.0_181 jdk -'jdk' -> 'jdk1.8.0_181' -leia@workstation:/usr/lib/java$ ls -lt -total 28 -lrwxrwxrwx 1 leia leia 12 May 1 16:13 jdk -> jdk1.8.0_181 -drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 -drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 -``` - -A Java application can be configured to find the JDK with the path **/usr/lib/java/jdk** instead of having to change it every time Java is updated. - -### rm - -The **rm** command is short for "remove" (which we often call delete, since some other operating systems have a **del** command for this action). The [man page][5] describes the force option for **rm** as: - - -``` --f, --force -ignore nonexistent files and arguments, never prompt -``` - -If you try to delete a read-only file, you will be prompted by **rm** : - - -``` -[alan@workstation ~]$ ls -l -total 4 --r--r----- 1 alan alan 16 May 1 11:38 B-wing -[alan@workstation ~]$ rm B-wing -rm: remove write-protected regular file 'B-wing'? -``` - -You must type either **y** or **n** to answer the prompt and allow the **rm** command to proceed. If you use the force option, **rm** will not prompt you and will immediately delete the file: - - -``` -[alan@workstation ~]$ rm -f B-wing -[alan@workstation ~]$ ls -l -total 0 -[alan@workstation ~]$ -``` - -The most common use of force with **rm** is to delete a directory. The **-r** (recursive) option tells **rm** to remove a directory. When combined with the force option, it will remove the directory and all its contents without prompting. - -The **rm** command with certain options can be disastrous. Over the years, online forums have filled with jokes and horror stories of users completely wiping their systems. This notorious usage is **rm -rf ***. This will immediately delete all files and directories without any prompt wherever it is used. - -### userdel - -The **userdel** command is short for user delete, which will delete a user. The [man page][6] describes the force option for **userdel** as: - - -``` --f, --force -This option forces the removal of the user account, even if the -user is still logged in. It also forces userdel to remove the -user's home directory and mail spool, even if another user uses -the same home directory or if the mail spool is not owned by the -specified user. If USERGROUPS_ENAB is defined to yes in -/etc/login.defs and if a group exists with the same name as the -deleted user, then this group will be removed, even if it is -still the primary group of another user. - -Note: This option is dangerous and may leave your system in an -inconsistent state. -``` - -When Obi-Wan reached the castle on Mustafar, he knew what had to be done. He had to delete Darth's user account—but Darth was still logged in. - - -``` -[root@workstation ~]# ps -fu darth -UID PID PPID C STIME TTY TIME CMD -darth 7663 7655 0 13:28 pts/3 00:00:00 -bash -[root@workstation ~]# userdel darth -userdel: user darth is currently used by process 7663 -``` - -Since Darth is currently logged in, Obi-Wan has to use the force option to **userdel**. This will delete the user account even though it's logged in. - - -``` -[root@workstation ~]# userdel -f darth -userdel: user darth is currently used by process 7663 -[root@workstation ~]# finger darth -finger: darth: no such user. -[root@workstation ~]# ps -fu darth -error: user name does not exist -``` - -As you can see, the **finger** and **ps** commands confirm the user Darth has been deleted. - -### Using force in shell scripts - -Many other commands have a force option. One place force is very useful is in shell scripts. Since we use scripts in cron jobs and other automated operations, avoiding any prompts is crucial, or else these automated processes will not complete. - -I hope the four examples I shared above help you understand how certain circumstances may require the use of force. You should have a strong understanding of the force option when used at the command line or in creating automation scripts. It's misuse can have devastating effects—sometimes across your infrastructure, and not only on a single machine. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/may-the-force-linux - -作者:[Alan Formy-Duval ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alanfdoss -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fireworks_light_art_design.jpg?itok=hfx9i4By (Fireworks) -[2]: https://www.starwars.com/star-wars-day -[3]: http://man7.org/linux/man-pages/man1/cp.1.html -[4]: http://man7.org/linux/man-pages/man1/ln.1.html -[5]: http://man7.org/linux/man-pages/man1/rm.1.html -[6]: http://man7.org/linux/man-pages/man8/userdel.8.html diff --git a/translated/tech/20190504 Using the force at the Linux command line.md b/translated/tech/20190504 Using the force at the Linux command line.md new file mode 100644 index 0000000000..e246a85e87 --- /dev/null +++ b/translated/tech/20190504 Using the force at the Linux command line.md @@ -0,0 +1,225 @@ +[#]: collector: (lujun9972) +[#]: translator: (Moelf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using the force at the Linux command line) +[#]: via: (https://opensource.com/article/19/5/may-the-force-linux) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +在 Linux 命令行下使用 force 参数 +====== +和绝地武士的原力一样,-f 参数是很强大的,并伴随着潜在的毁灭性,在你能用好的时候又很便利。 +![Fireworks][1] + +不久的过去,科幻发烧友开始庆祝每年的原力日(5月4日)[_星球大战_][2],英语里和”愿原力和你同在“双关。虽然大多数 Linux 用户可能不是绝地武士,但我们依然可以使用 force。自然,如果 Yoda 直接叫路克天行者输入什么 ”man X翼战机“ 或者 “man 原力"的话电影肯定会无聊不少。或者他可以直接说,"RTFM"(Read the Force Manual,肯定是这个意思对不对)(译者:通常 RTFM 是 Read The Fucking Manual 的缩写,读读该死的手册吧)。 + +很多 Linux 指令都有 -f 选项,意思你现在肯定也知道了,force(强制)!很多时候你先尝试执行指令然后失败了,或者提示你需要输入更多选项。通常这都是为了保护你的文件或者告诉用户设备正忙或者文件已经存在之类的设计。 + +如果你不想被这些提醒打扰或者压根就不在乎,使用 force ! + +不过要小心,通常使用 force 选项是摧毁性的。所以用户一定要格外注意并且确保你知道自己在做什么。用 force 就要承担后果! + +以下是一些常见 Linux 命令的 force 选项和他们的效果,以及常见使用场景。 + +### cp +**cp** 是 copy 的缩写,这是个被用来复制文件或者目录的命令。[man 页面][3] 说: + +``` +-f, --force +如果已经存在的目标文件无法被打开,删除并重试 +``` +你可能会用它来处理只读状态的文件: + +``` +[alan@workstation ~]$ ls -l +total 8 +-rw-rw---- 1 alan alan 13 May 1 12:24 Hoth +-r--r----- 1 alan alan 14 May 1 12:23 Naboo +[alan@workstation ~]$ cat Hoth Naboo +Icy Planet + +Green Planet +``` + +如果你想要复制一个叫做 _Hoth_ 的文件到 _Naboo_,但因为 _Naboo_ 目前是只读状态,**cp** 指令不会执行: + + +``` +[alan@workstation ~]$ cp Hoth Naboo +cp: cannot create regular file 'Naboo': Permission denied +``` + +但通过使用 force 选项,**cp** 会强制执行。_Hoth_ 的内容和文件权限会直接被复制到 _Naboo_: + + +``` +[alan@workstation ~]$ cp -f Hoth Naboo +[alan@workstation ~]$ cat Hoth Naboo +Icy Planet + +Icy Planet + +[alan@workstation ~]$ ls -l +total 8 +-rw-rw---- 1 alan alan 12 May 1 12:32 Hoth +-rw-rw---- 1 alan alan 12 May 1 12:38 Naboo +``` + +### ln + +**ln** 指令是用来在文件之间建立链接的,[man 页面][4] 描述的 force 选项如下: + + +``` +-f, --force +移除当前存在的文件 +``` + +假设 Leia 公主在 维护一个 Java 应用服务器并且当前在一个有所有 Java 版本的目录里,她可能会想这么做: + + +``` +leia@workstation:/usr/lib/java$ ls -lt +total 28 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +正如你所看到的,这里有很多个版本的 JDK 和一些符号链接指向最新版的 JDK。她接着用一个脚本来安装最新版本的 JDK。但是如果没有 force 选项的话以下命令是不会成功的: + + +``` +tar xvzmf jdk1.8.0_181.tar.gz -C jdk1.8.0_181/ +ln -vs jdk1.8.0_181 jdk +``` + +**tar** 命令会解压 .gz 文件到一个特定的目标目录,但 **ln** 指令会失败因为这个链接已经存在了。这样的结果是链接不会指向最新版本的 JDK: + + +``` +leia@workstation:/usr/lib/java$ ln -vs jdk1.8.0_181 jdk +ln: failed to create symbolic link 'jdk/jdk1.8.0_181': File exists +leia@workstation:/usr/lib/java$ ls -lt +total 28 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +她可以通过使用 force 选项强制 **ln** 更新链接,但这里她还需要使用 -n,-n 是因为这个情况下链接其实指向一个目录而非文件。这样的话,链接就会正确指向最新版本的JDK了。 + + +``` +leia@workstation:/usr/lib/java$ ln -vsnf jdk1.8.0_181 jdk +'jdk' -> 'jdk1.8.0_181' +leia@workstation:/usr/lib/java$ ls -lt +total 28 +lrwxrwxrwx 1 leia leia 12 May 1 16:13 jdk -> jdk1.8.0_181 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +你可以配置 Java 应用使其一直使用在 **/usr/lib/java/jdk** 处的 JDK 而不用每次升级都要更新链接。 + +### rm + +**rm** 指令是 remove 的缩写,叫做移除但也有一部分人喜欢叫它删除。[man 页面][5] 对 force 选项的描述如下: + + +``` +-f, --force +无视不存在的文件或者选项,不向用户确认 +``` +如果你尝试删除一个只读的文件,**rm** 会寻求用户的确认: + + +``` +[alan@workstation ~]$ ls -l +total 4 +-r--r----- 1 alan alan 16 May 1 11:38 B-wing +[alan@workstation ~]$ rm B-wing +rm: remove write-protected regular file 'B-wing'? +``` +你一定要输入 **y** 或者 **n** 来回答确认才能让 **rm** 命令继续。如果你使用 force 选项,**rm** 就不会寻求你的确认而直接删除文件: + + +``` +[alan@workstation ~]$ rm -f B-wing +[alan@workstation ~]$ ls -l +total 0 +[alan@workstation ~]$ +``` + +最常见的 **rm** force 选项是用来删除目录。 **-r** (递归)选项会让 **rm** 删除目录,和 force 选项结合起来,它会删除这个文件夹及其内容而无需用户确认。 + +**rm** 命令和一些选项结合起来是致命的,一直以来互联网上都有关于误用 **rm** 删除整个系统之类的玩笑和鬼故事。比如最出名的一不当心执行 **rm -rf .** 会直接删除目录和文件(没有用户确认)。 + +### userdel + +**userdel** 指令使用来删除用户的。[man 页面][6] 是这样描述它的 force 选项的: + + +``` +-f, --force +这个选项会强制移除用户,即便用户当前处于登入状态。它同时还会强制 +删除用户的目录和邮件,即便这个用户目录被别人共享或者邮件卷并不只 +属于这个用户。如果 USERGROUPS_ENAB 在 /etc/login.defs 里是 yes +并且有一个组和此用户同名的话,这个组也会被移除,即便这个组还是别 +的用户的主要用户组也一样。 + +注意:这个选项有风险并可能让系统处于不稳定状态。 +``` + +当欧比旺抵达穆斯塔法星的时候,他知道自己的使命。他需要删掉达斯·维达的用户账户——但达斯还登录在里面。 + + +``` +[root@workstation ~]# ps -fu darth +UID PID PPID C STIME TTY TIME CMD +darth 7663 7655 0 13:28 pts/3 00:00:00 -bash +[root@workstation ~]# userdel darth +userdel: user darth is currently used by process 7663 +``` + +因为达斯还登入在系统里,欧比旺需要使用 force 选项操作 **userdel**。这能强制删除正登入的用户。 + + +``` +[root@workstation ~]# userdel -f darth +userdel: user darth is currently used by process 7663 +[root@workstation ~]# finger darth +finger: darth: no such user. +[root@workstation ~]# ps -fu darth +error: user name does not exist +``` + +正如我们所见到的一样,**finger** 和 **ps** 命令让我们确认了达斯已经被删除了。 + +### 在 Shell 脚本里使用 force +很多指令都有 force 选项,而在 shell 脚本里他们特别游泳。因为我们经常使用脚本完成定期或者自动化的任务,避免用户输入至关重要,不然的话自动任务就无法完成了 + +我希望上面的几个例子能帮你理解在一些情况下 force 的用法。你在使用 force 或把他们写入脚本之前应当完全理解他们的作用。误用 force 会有毁灭性的后果——时常是对整个系统,甚至不仅限于一台设备。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/may-the-force-linux + +作者:[Alan Formy-Duval ][a] +选题:[lujun9972][b] +译者:[Jerry Ling](https://github.com/Moelf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fireworks_light_art_design.jpg?itok=hfx9i4By (Fireworks) +[2]: https://www.starwars.com/star-wars-day +[3]: http://man7.org/linux/man-pages/man1/cp.1.html +[4]: http://man7.org/linux/man-pages/man1/ln.1.html +[5]: http://man7.org/linux/man-pages/man1/rm.1.html +[6]: http://man7.org/linux/man-pages/man8/userdel.8.html From a1128e4e29b67e9cf67b5ad4660f306d83ffd15e Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 20 May 2019 08:55:14 +0800 Subject: [PATCH 0504/1154] translated --- ...pelling at the command line with Ispell.md | 81 ------------------- ...pelling at the command line with Ispell.md | 80 ++++++++++++++++++ 2 files changed, 80 insertions(+), 81 deletions(-) delete mode 100644 sources/tech/20190503 Check your spelling at the command line with Ispell.md create mode 100644 translated/tech/20190503 Check your spelling at the command line with Ispell.md diff --git a/sources/tech/20190503 Check your spelling at the command line with Ispell.md b/sources/tech/20190503 Check your spelling at the command line with Ispell.md deleted file mode 100644 index 3ddcad1024..0000000000 --- a/sources/tech/20190503 Check your spelling at the command line with Ispell.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Check your spelling at the command line with Ispell) -[#]: via: (https://opensource.com/article/19/5/spelling-command-line-ispell) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -Check your spelling at the command line with Ispell -====== -Ispell helps you stamp out typos in plain text files written in more -than 50 languages. -![Command line prompt][1] - -Good spelling is a skill. A skill that takes time to learn and to master. That said, there are people who never quite pick that skill up—I know a couple or three outstanding writers who can't spell to save their lives. - -Even if you spell well, the occasional typo creeps in. That's especially true if you're quickly banging on your keyboard to meet a deadline. Regardless of your spelling chops, it's always a good idea to run what you've written through a spelling checker. - -I do most of my writing in [plain text][2] and often use a command line spelling checker called [Aspell][3] to do the deed. Aspell isn't the only game in town. You might also want to check out the venerable [Ispell][4]. - -### Getting started - -Ispell's been around, in various forms, since 1971. Don't let its age fool you. Ispell is still a peppy application that you can use effectively in the 21st century. - -Before doing anything else, check whether or not Ispell is installed on your computer by cracking open a terminal window and typing **which ispell**. If it isn't installed, fire up your distribution's package manager and install Ispell from there. - -Don't forget to install dictionaries for the languages you work in, too. My only language is English, so I just need to worry about grabbing the US and British English dictionaries. You're not limited to my mother (and only) tongue. Ispell has [dictionaries for over 50 languages][5]. - -![Installing Ispell dictionaries][6] - -### Using Ispell - -If you haven't guessed already, Ispell only works with text files. That includes ones marked up with HTML, LaTeX, and [nroff or troff][7]. More on this in a few moments. - -To get to work, open a terminal window and navigate to the directory containing the file where you want to run a spelling check. Type **ispell** followed by the file's name and then press Enter. - -![Checking spelling with Ispell][8] - -Ispell highlights the first word it doesn't recognize. If the word is misspelled, Ispell usually offers one or more alternatives. Press **R** and then the number beside the correct choice. In the screen capture above, I'd press **R** and **0** to fix the error. - -If, on the other hand, the word is correctly spelled, press **A** to move to the next misspelled word. - -Keep doing that until you reach the end of the file. Ispell saves your changes, creates a backup of the file you just checked (with the extension _.bak_ ), and shuts down. - -### A few other options - -This example illustrates basic Ispell usage. The program has a [number of options][9], some of which you _might_ use and others you _might never_ use. Let's take a quick peek at some of the ones I regularly use. - -A few paragraphs ago, I mentioned that Ispell works with certain markup languages. You need to tell it a file's format. When starting Ispell, add **-t** for a TeX or LaTeX file, **-H** for an HTML file, or **-n** for a groff or troff file. For example, if you enter **ispell -t myReport.tex** , Ispell ignores all markup. - -If you don't want the backup file that Ispell creates after checking a file, add **-x** to the command line—for example, **ispell -x myFile.txt**. - -What happens if Ispell runs into a word that's spelled correctly but isn't in its dictionary, like a proper name? You can add that word to a personal word list by pressing **I**. This saves the word to a file called _.ispell_default_ in the root of your _/home_ directory. - -Those are the options I find most useful when working with Ispell, but check out [Ispell's man page][9] for descriptions of all its options. - -Is Ispell any better or faster than Aspell or any other command line spelling checker? I have to say it's no worse than any of them, nor is it any slower. Ispell's not for everyone. It might not be for you. But it is good to have options, isn't it? - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/spelling-command-line-ispell - -作者:[Scott Nesbitt ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) -[2]: https://plaintextproject.online -[3]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell -[4]: https://www.cs.hmc.edu/~geoff/ispell.html -[5]: https://www.cs.hmc.edu/~geoff/ispell-dictionaries.html -[6]: https://opensource.com/sites/default/files/uploads/ispell-install-dictionaries.png (Installing Ispell dictionaries) -[7]: https://opensource.com/article/18/2/how-format-academic-papers-linux-groff-me -[8]: https://opensource.com/sites/default/files/uploads/ispell-checking.png (Checking spelling with Ispell) -[9]: https://www.cs.hmc.edu/~geoff/ispell-man.html diff --git a/translated/tech/20190503 Check your spelling at the command line with Ispell.md b/translated/tech/20190503 Check your spelling at the command line with Ispell.md new file mode 100644 index 0000000000..1bc80a0019 --- /dev/null +++ b/translated/tech/20190503 Check your spelling at the command line with Ispell.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Check your spelling at the command line with Ispell) +[#]: via: (https://opensource.com/article/19/5/spelling-command-line-ispell) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +使用 Ispell 在命令行中检查拼写 +====== +Ispell 可以帮助你在纯文本中消除超过 50 种语言的拼写错误。 +![Command line prompt][1] + +好的拼写是一种技巧。它是一项需要时间学习和掌握的技能。也就是说,有些人从来没有完全掌握这种技能,我知道有两三个出色的作家无法完全掌握拼写。 + +即使你拼写得很好,偶尔也会输入错字。特别是在最后期限前如果你快速敲击键盘,那就更是如此。无论你的拼写的是什么,通过拼写检查器检查你所写的内容总是一个好主意。 + +我用[纯文本][2]完成了我的大部分写作,并经常使用名为 [Aspell][3] 的命令行拼写检查器来完成这项工作。Aspell 不是唯一的工具。你可能还想要看下不错的 [Ispell][4]。 + +### 入门 + +自 1971 年以来,Ispell 以各种形式出现过。不要被它的年龄欺骗。Ispell 仍然是一个可以在 21 世纪高效使用的应用。 + +在开始之前,请打开终端窗口并输入**which ispell** 来检查计算机上是否安装了 Ispell。如果未安装,请打开发行版的软件包管理器并从那里安装 Ispell。 + +不要忘记为你使用的语言安装词典。我唯一使用的语言是英语,所以我只需下载美国和英国英语字典。你可以不局限于我的(也是唯一的)母语。Ispell 有[超过 50 种语言的词典][5]。 + +![Installing Ispell dictionaries][6] + +### 使用 Ispell + +如果你还没有猜到,Ispell 只能用在文本文件。这包括用 HTML、LaTeX 和 [nroff 或 troff][7] 标记的文档。之后会有更多相关内容。 + +要开始使用,请打开终端窗口并进入包含要运行拼写检查的文件的目录。输入 **ispell** 后跟文件名,然后按回车键。 + +![Checking spelling with Ispell][8] + +Ispell 高亮了它无法识别的第一个词。如果单词拼写错误,Ispell 通常会提供一个或多个备选方案。按下 **R**,然后按下正确选择旁边的数字。在上面的截图中,我按了 **R** 和 **0** 来修复错误。 + +另一方面,如果单词拼写正确,请按下 **A** 然后移动到下一个拼写错误的单词。 + +继续这样做直到到达文件的末尾。Ispell 会保存你的更改,创建你刚检查的文件的备份(扩展名为 _.bak_),然后关闭。 + +### 其他几个选项 + +此示例说明了 Ispell 的基本用法。这个程序有[很多选项][9],有些你_可能_会用到,而另一些你_可能永远_不会使用。让我们快速看下我经常使用的一些。 + +之前我提到过 Ispell 可以用于某些标记语言。你需要告诉它文件的格式。启动 Ispell 时,为 TeX 或 LaTeX 文件添加 **-t**,为 HTML 文件添加 **-H**,对于 groff 或 troff 文件添加 **-n**。例如,如果输入 **ispell -t myReport.tex**,Ispell 将忽略所有标记。 + +如果你不想在检查文件后创建备份文件,请将 **-x** 添加到命令行。例如,**ispell -x myFile.txt**。 + +如果 Ispell 遇到拼写正确但不在其字典中的单词,像是名字,会发生什么?你可以按 **I** 将该单词添加到个人单词列表中。这会将单词保存到 _/home_ 家目录下的 _.ispell_default_ 的文件中。 + +这些是我在使用 Ispel l时最有用的选项,但请查看 [Ispell 的手册页][9]以了解其所有选项。 + +Ispell 比 Aspell 或其他命令行拼写检查器更好或者更快么?我会说它不比其他的差或者慢。Ispell 不是适合所有人。它也许也不适合你。但有更多选择也不错,不是么? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/spelling-command-line-ispell + +作者:[Scott Nesbitt ][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/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://plaintextproject.online +[3]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell +[4]: https://www.cs.hmc.edu/~geoff/ispell.html +[5]: https://www.cs.hmc.edu/~geoff/ispell-dictionaries.html +[6]: https://opensource.com/sites/default/files/uploads/ispell-install-dictionaries.png (Installing Ispell dictionaries) +[7]: https://opensource.com/article/18/2/how-format-academic-papers-linux-groff-me +[8]: https://opensource.com/sites/default/files/uploads/ispell-checking.png (Checking spelling with Ispell) +[9]: https://www.cs.hmc.edu/~geoff/ispell-man.html From 83bdcca20e5892a2e13ce0785a933b3bf04b13ed Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 20 May 2019 09:07:08 +0800 Subject: [PATCH 0505/1154] translating --- ...4 Add methods retroactively in Python with singledispatch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md b/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md index 022b06aa52..92f5063d57 100644 --- a/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md +++ b/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 13c9edd44a0325bf40fb579f61a45f695d7d54ba Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:00:49 +0800 Subject: [PATCH 0506/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20How?= =?UTF-8?q?=20To=20Map=20Oracle=20ASM=20Disk=20Against=20Physical=20Disk?= =?UTF-8?q?=20And=20LUNs=20In=20Linux=3F=20sources/tech/20190520=20How=20T?= =?UTF-8?q?o=20Map=20Oracle=20ASM=20Disk=20Against=20Physical=20Disk=20And?= =?UTF-8?q?=20LUNs=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Against Physical Disk And LUNs In Linux.md | 229 ++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md diff --git a/sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md b/sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md new file mode 100644 index 0000000000..4e9df8a0ff --- /dev/null +++ b/sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md @@ -0,0 +1,229 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux?) +[#]: via: (https://www.2daygeek.com/shell-script-map-oracle-asm-disks-physical-disk-lun-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux? +====== + +You might already know about ASM, Device Mapper Multipathing (DM-Multipathing) if you are working quit long time as a Linux administrator. + +There are multiple ways to check these information. However, you will be getting part of the information when you use the default commands. + +It doesn’t show you all together in the single output. + +If you want to check all together in the single output then we need to write a small shell script to achieve this. + +We have added two shell script to get those information and you can use which one is suitable for you. + +Major and Minor numbers can be used to match the physical devices in Linux system. + +This tutorial helps you to find which ASM disk maps to which Linux partition or DM Device. + +If you want to **[manage Oracle ASM disks][1]** (such as start, enable, stop, list, query and etc) then navigate to following URL. + +### What Is ASMLib? + +ASMLib is an optional support library for the Automatic Storage Management feature of the Oracle Database. + +Automatic Storage Management (ASM) simplifies database administration and greatly reduces kernel resource usage (e.g. the number of open file descriptors). + +It eliminates the need for the DBA to directly manage potentially thousands of Oracle database files, requiring only the management of groups of disks allocated to the Oracle Database. + +ASMLib allows an Oracle Database using ASM more efficient and capable access to the disk groups it is using. + +### What Is Device Mapper Multipathing (DM-Multipathing)? + +Device Mapper Multipathing or DM-multipathing is a Linux host-side native multipath tool, which allows us to configure multiple I/O paths between server nodes and storage arrays into a single device by utilizing device-mapper. + +### Method-1 : Shell Script To Map ASM Disks To Physical Devices? + +In this shell script we are using for loop to achieve the results. + +Also, we are not using any ASM related commands. + +``` +# vi asm_disk_mapping.sh + +#!/bin/bash + +ls -lh /dev/oracleasm/disks > /tmp/asmdisks1.txt + +for ASMdisk in `cat /tmp/asmdisks1.txt | tail -n +2 | awk '{print $10}'` + +do + +minor=$(grep -i "$ASMdisk" /tmp/asmdisks1.txt | awk '{print $6}') + +major=$(grep -i "$ASMdisk" /tmp/asmdisks1.txt | awk '{print $5}' | cut -d"," -f1) + +phy_disk=$(ls -l /dev/* | grep ^b | grep "$major, *$minor" | awk '{print $10}') + +echo "ASM disk $ASMdisk is associated on $phy_disk [$major, $minor]" + +done +``` + +Set an executable permission to port_scan.sh file. + +``` +$ chmod +x asm_disk_mapping.sh +``` + +Finally run the script to achieve this. + +``` +# sh asm_disk_mapping.sh + +ASM disk MP4E6D_DATA01 is associated on /dev/dm-1 +3600a0123456789012345567890234q11 [253, 1] +ASM disk MP4E6E_DATA02 is associated on /dev/dm-2 +3600a0123456789012345567890234q12 [253, 2] +ASM disk MP4E6F_DATA03 is associated on /dev/dm-3 +3600a0123456789012345567890234q13 [253, 3] +ASM disk MP4E70_DATA04 is associated on /dev/dm-4 +3600a0123456789012345567890234q14 [253, 4] +ASM disk MP4E71_DATA05 is associated on /dev/dm-5 +3600a0123456789012345567890234q15 [253, 5] +ASM disk MP4E72_DATA06 is associated on /dev/dm-6 +3600a0123456789012345567890234q16 [253, 6] +ASM disk MP4E73_DATA07 is associated on /dev/dm-7 +3600a0123456789012345567890234q17 [253, 7] +``` + +### Method-2 : Shell Script To Map ASM Disks To Physical Devices? + +In this shell script we are using while loop to achieve the results. + +Also, we are using ASM related commands. + +``` +# vi asm_disk_mapping_1.sh + +#!/bin/bash + +/etc/init.d/oracleasm listdisks > /tmp/asmdisks.txt + +while read -r ASM_disk + +do + +major="$(/etc/init.d/oracleasm querydisk -d $ASM_disk | awk -F[ '{ print $2 }'| awk -F] '{ print $1 }' | cut -d"," -f1)" + +minor="$(/etc/init.d/oracleasm querydisk -d $ASM_disk | awk -F[ '{ print $2 }'| awk -F] '{ print $1 }' | cut -d"," -f2)" + +phy_disk="$(ls -l /dev/* | grep ^b | grep "$major, *$minor" | awk '{ print $10 }')" + +echo "ASM disk $ASM_disk is associated on $phy_disk [$major, $minor]" + +done < /tmp/asmdisks.txt +``` + +Set an executable permission to port_scan.sh file. + +``` +$ chmod +x asm_disk_mapping_1.sh +``` + +Finally run the script to achieve this. + +``` +# sh asm_disk_mapping_1.sh + +ASM disk MP4E6D_DATA01 is associated on /dev/dm-1 +3600a0123456789012345567890234q11 [253, 1] +ASM disk MP4E6E_DATA02 is associated on /dev/dm-2 +3600a0123456789012345567890234q12 [253, 2] +ASM disk MP4E6F_DATA03 is associated on /dev/dm-3 +3600a0123456789012345567890234q13 [253, 3] +ASM disk MP4E70_DATA04 is associated on /dev/dm-4 +3600a0123456789012345567890234q14 [253, 4] +ASM disk MP4E71_DATA05 is associated on /dev/dm-5 +3600a0123456789012345567890234q15 [253, 5] +ASM disk MP4E72_DATA06 is associated on /dev/dm-6 +3600a0123456789012345567890234q16 [253, 6] +ASM disk MP4E73_DATA07 is associated on /dev/dm-7 +3600a0123456789012345567890234q17 [253, 7] +``` + +### How To List Oracle ASM Disks? + +If you would like to list only Oracle ASM disk then use the below command to List available/created Oracle ASM disks in Linux. + +``` +# oracleasm listdisks + +ASM_Disk1 +ASM_Disk2 +ASM_Disk3 +ASM_Disk4 +ASM_Disk5 +ASM_Disk6 +ASM_Disk7 +``` + +### How To List Oracle ASM Disks Against Major And Minor Number? + +If you would like to map Oracle ASM disks against major and minor number then use the below commands to List available/created Oracle ASM disks in Linux. + +``` +# for ASMdisk in `oracleasm listdisks`; do /etc/init.d/oracleasm querydisk -d $ASMdisk; done + +Disk "ASM_Disk1" is a valid Disk on device [253, 1] +Disk "ASM_Disk2" is a valid Disk on device [253, 2] +Disk "ASM_Disk3" is a valid Disk on device [253, 3] +Disk "ASM_Disk4" is a valid Disk on device [253, 4] +Disk "ASM_Disk5" is a valid Disk on device [253, 5] +Disk "ASM_Disk6" is a valid Disk on device [253, 6] +Disk "ASM_Disk7" is a valid Disk on device [253, 7] +``` + +Alternatively, we can get the same results using the ls command. + +``` +# ls -lh /dev/oracleasm/disks + +total 0 +brw-rw---- 1 oracle oinstall 253, 1 May 19 14:44 ASM_Disk1 +brw-rw---- 1 oracle oinstall 253, 2 May 19 14:44 ASM_Disk2 +brw-rw---- 1 oracle oinstall 253, 3 May 19 14:44 ASM_Disk3 +brw-rw---- 1 oracle oinstall 253, 4 May 19 14:44 ASM_Disk4 +brw-rw---- 1 oracle oinstall 253, 5 May 19 14:44 ASM_Disk5 +brw-rw---- 1 oracle oinstall 253, 6 May 19 14:44 ASM_Disk6 +brw-rw---- 1 oracle oinstall 253, 7 May 19 14:44 ASM_Disk7 +``` + +### How To List Physical Disks Against LUNs? + +If you would like to map physical disks against LUNs then use the below command. + +``` +# multipath -ll | grep NETAPP + +3600a0123456789012345567890234q11 dm-1 NETAPP,LUN C-Mode +3600a0123456789012345567890234q12 dm-2 NETAPP,LUN C-Mode +3600a0123456789012345567890234q13 dm-3 NETAPP,LUN C-Mode +3600a0123456789012345567890234q14 dm-4 NETAPP,LUN C-Mode +3600a0123456789012345567890234q15 dm-5 NETAPP,LUN C-Mode +3600a0123456789012345567890234q16 dm-6 NETAPP,LUN C-Mode +3600a0123456789012345567890234q17 dm-7 NETAPP,LUN C-Mode +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/shell-script-map-oracle-asm-disks-physical-disk-lun-in-linux/ + +作者:[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/start-stop-restart-enable-reload-oracleasm-service-linux-create-scan-list-query-rename-delete-configure-oracleasm-disk/ From 11cb9b0485829b7d9b472e87b2c331aee041be04 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:01:01 +0800 Subject: [PATCH 0507/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20xsos?= =?UTF-8?q?=20=E2=80=93=20A=20Tool=20To=20Read=20SOSReport=20In=20Linux=20?= =?UTF-8?q?sources/tech/20190520=20xsos=20-=20A=20Tool=20To=20Read=20SOSRe?= =?UTF-8?q?port=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sos - A Tool To Read SOSReport In Linux.md | 406 ++++++++++++++++++ 1 file changed, 406 insertions(+) create mode 100644 sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md diff --git a/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md b/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md new file mode 100644 index 0000000000..af4c38f06d --- /dev/null +++ b/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md @@ -0,0 +1,406 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (xsos – A Tool To Read SOSReport In Linux) +[#]: via: (https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +xsos – A Tool To Read SOSReport In Linux +====== + +We all are already know about **[sosreport][1]**. It’s used to collect system information that can be used for diagnostic. + +Redhat support advise us to provide a sosreport when we raise a case with them to analyze the current system status. + +It’s collecting all kind of reports that can help user to identify the root causes of issue. + +We can easily extract and read the sosreport but it’s very difficult to read. Since it has created a separate file for everything. + +If you are looking for performance bottleneck tool then i would recommend you to check the **[oswbb (OSWatcher) utility][2]**. + +So, what is the best way to read all together with syntax highlighting in Linux. + +Yes, it can be achieved via xsos tool. + +### What Is sosreport? + +The sosreport command is a tool that collects bunch of configuration details, system information and diagnostic information from running system (especially RHEL & OEL system). + +It helps technical support engineer to analyze the system in many aspect. + +This reports contains bunch of information about the system such as boot information, filesystem, memory, hostname, installed rpms, system IP, networking details, OS version, installed kernel, loaded kernel modules, list of open files, list of PCI devices, mount point and it’s details, running process information, process tree output, system routing, all the configuration files which is located in /etc folder, and all the log files which is located in /var folder. + +This will take a while to generate a report and it’s depends on your system installation and configuration. + +Once completed, sosreport will generate a compressed archive file under /tmp directory. + +### What Is xsos? + +[xsos][3] is a tool that help user to easily read sosreport on Linux systems. In other hand, we can say sosreport examiner. + +It instantly summarize system info from a sosreport or a running system. + +xsos will attempt to make it easy, parsing and calculating and formatting data from dozens of files (and commands) to give you a detailed overview about a system. + +You can instantly summarize your system information by running the following command. + +``` +# curl -Lo ./xsos bit.ly/xsos-direct; chmod +x ./xsos; ./xsos -ya +``` + +[![][4]![][4]][5] + +### How To Install xsos In Linux? + +We can easily install xsos using the following two methods. + +If you are looking for latest bleeding-edge version. Use the following steps. + +``` +# curl -Lo /usr/local/bin/xsos bit.ly/xsos-direct + +# chmod +x /usr/local/bin/xsos +``` + +This is the recommended method to install xsos. It will install xsos from rpm file. + +``` +# yum install http://people.redhat.com/rsawhill/rpms/latest-rsawaroha-release.rpm + +# yum install xsos +``` + +### How To Use xsos In Linux? + +Once xsos is installed by one of the above methods. Simply run the xsos command without any options, which show you the basic information about your system. + +``` +# xsos + +OS + Hostname: CentOS7.2daygeek.com + Distro: [redhat-release] CentOS Linux release 7.6.1810 (Core) + [centos-release] CentOS Linux release 7.6.1810 (Core) + [os-release] CentOS Linux 7 (Core) 7 (Core) + RHN: (missing) + RHSM: (missing) + YUM: 2 enabled plugins: fastestmirror, langpacks + Runlevel: N 5 (default graphical) + SELinux: enforcing (default enforcing) + Arch: mach=x86_64 cpu=x86_64 platform=x86_64 + Kernel: + Booted kernel: 3.10.0-957.el7.x86_64 + GRUB default: 3.10.0-957.el7.x86_64 + Build version: + Linux version 3.10.0-957.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red + Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018 + Booted kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + GRUB default kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + Taint-check: 0 (kernel untainted) + - - - - - - - - - - - - - - - - - - - + Sys time: Sun May 12 10:05:21 CDT 2019 + Boot time: Sun May 12 09:50:20 CDT 2019 (epoch: 1557672620) + Time Zone: America/Chicago + Uptime: 15 min, 1 user + LoadAvg: [1 CPU] 0.00 (0%), 0.04 (4%), 0.09 (9%) + /proc/stat: + procs_running: 2 procs_blocked: 0 processes [Since boot]: 6423 + cpu [Utilization since boot]: + us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% +``` + +### How To Use xsos Command To View Generated sosreport Output In Linux? + +We need the sosreport to read further using xsos command. To do so, navigate the following URL to install and generate sosreport on Linux. + +Yes, i have already generated a sosreport and file is below. + +``` +# ls -lls -lh /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz +9.8M -rw-------. 1 root root 9.8M May 12 10:13 /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz +``` + +Run the following command to untar it. + +``` +# tar xf sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz +``` + +To view all the info, run xsos with `-a, --all` switch. + +``` +# xsos --all /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +``` + +To view the bios info, run xsos with `-b, --bios` switch. + +``` +# xsos --bios /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +DMIDECODE + BIOS: + Vend: innotek GmbH + Vers: VirtualBox + Date: 12/01/2006 + BIOS Rev: + FW Rev: + System: + Mfr: innotek GmbH + Prod: VirtualBox + Vers: 1.2 + Ser: 0 + UUID: 002f47b8-2af2-48f5-be1d-67b67e03514c + CPU: + 0 of 0 CPU sockets populated, 0 cores/0 threads per CPU + 0 total cores, 0 total threads + Mfr: + Fam: + Freq: + Vers: + Memory: + Total: 0 MiB (0 GiB) + DIMMs: 0 of 0 populated + MaxCapacity: 0 MiB (0 GiB / 0.00 TiB) +``` + +To view the system basic info such as hostname, distro, SELinux, kernel info, uptime, etc, run xsos with `-o, --os` switch. + +``` +# xsos --os /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +OS + Hostname: CentOS7.2daygeek.com + Distro: [redhat-release] CentOS Linux release 7.6.1810 (Core) + [centos-release] CentOS Linux release 7.6.1810 (Core) + [os-release] CentOS Linux 7 (Core) 7 (Core) + RHN: (missing) + RHSM: (missing) + YUM: 2 enabled plugins: fastestmirror, langpacks + SELinux: enforcing (default enforcing) + Arch: mach=x86_64 cpu=x86_64 platform=x86_64 + Kernel: + Booted kernel: 3.10.0-957.el7.x86_64 + GRUB default: 3.10.0-957.el7.x86_64 + Build version: + Linux version 3.10.0-957.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red + Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018 + Booted kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + GRUB default kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + Taint-check: 536870912 (see https://access.redhat.com/solutions/40594) + 29 TECH_PREVIEW: Technology Preview code is loaded + - - - - - - - - - - - - - - - - - - - + Sys time: Sun May 12 10:12:22 CDT 2019 + Boot time: Sun May 12 09:50:20 CDT 2019 (epoch: 1557672620) + Time Zone: America/Chicago + Uptime: 22 min, 1 user + LoadAvg: [1 CPU] 1.19 (119%), 0.27 (27%), 0.14 (14%) + /proc/stat: + procs_running: 8 procs_blocked: 2 processes [Since boot]: 9005 + cpu [Utilization since boot]: + us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% +``` + +To view the kdump configuration, run xsos with `-k, --kdump` switch. + +``` +# xsos --kdump /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +KDUMP CONFIG + kexec-tools rpm version: + kexec-tools-2.0.15-21.el7.x86_64 + Service enablement: + UNIT STATE + kdump.service enabled + kdump initrd/initramfs: + 13585734 Feb 19 05:51 initramfs-3.10.0-957.el7.x86_64kdump.img + Memory reservation config: + /proc/cmdline { crashkernel=auto } + GRUB default { crashkernel=auto } + Actual memory reservation per /proc/iomem: + 2a000000-340fffff : Crash kernel + kdump.conf: + path /var/crash + core_collector makedumpfile -l --message-level 1 -d 31 + kdump.conf "path" available space: + System MemTotal (uncompressed core size) { 1.80 GiB } + Available free space on target path's fs { 22.68 GiB } (fs=/) + Panic sysctls: + kernel.sysrq [bitmask] = "16" (see proc man page) + kernel.panic [secs] = 0 (no autoreboot on panic) + kernel.hung_task_panic = 0 + kernel.panic_on_oops = 1 + kernel.panic_on_io_nmi = 0 + kernel.panic_on_unrecovered_nmi = 0 + kernel.panic_on_stackoverflow = 0 + kernel.softlockup_panic = 0 + kernel.unknown_nmi_panic = 0 + kernel.nmi_watchdog = 1 + vm.panic_on_oom [0-2] = 0 (no panic) +``` + +To view the information about CPU, run xsos with `-c, --cpu` switch. + +``` +# xsos --cpu /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +CPU + 1 logical processors + 1 Intel Core i7-6700HQ CPU @ 2.60GHz (flags: aes,constant_tsc,ht,lm,nx,pae,rdrand) +``` + +To view about memory utilization, run xsos with `-m, --mem` switch. + +``` +# xsos --mem /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +MEMORY + Stats graphed as percent of MemTotal: + MemUsed ▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊..................... 58.8% + Buffers .................................................. 0.6% + Cached ▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊................................... 29.9% + HugePages .................................................. 0.0% + Dirty .................................................. 0.7% + RAM: + 1.8 GiB total ram + 1.1 GiB (59%) used + 0.5 GiB (28%) used excluding Buffers/Cached + 0.01 GiB (1%) dirty + HugePages: + No ram pre-allocated to HugePages + LowMem/Slab/PageTables/Shmem: + 0.09 GiB (5%) of total ram used for Slab + 0.02 GiB (1%) of total ram used for PageTables + 0.01 GiB (1%) of total ram used for Shmem + Swap: + 0 GiB (0%) used of 2 GiB total +``` + +To view the added disks information, run xsos with `-d, --disks` switch. + +``` +# xsos --disks /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +STORAGE + Whole Disks from /proc/partitions: + 2 disks, totaling 40 GiB (0.04 TiB) + - - - - - - - - - - - - - - - - - - - - - + Disk Size in GiB + ---- ----------- + sda 30 + sdb 10 +``` + +To view the network interface configuration, run xsos with `-e, --ethtool` switch. + +``` +# xsos --ethtool /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +ETHTOOL + Interface Status: + enp0s10 0000:00:0a.0 link=up 1000Mb/s full (autoneg=Y) rx ring 256/4096 drv e1000 v7.3.21-k8-NAPI / fw UNKNOWN + enp0s9 0000:00:09.0 link=up 1000Mb/s full (autoneg=Y) rx ring 256/4096 drv e1000 v7.3.21-k8-NAPI / fw UNKNOWN + virbr0 N/A link=DOWN rx ring UNKNOWN drv bridge v2.3 / fw N/A + virbr0-nic tap link=DOWN rx ring UNKNOWN drv tun v1.6 / fw UNKNOWN +``` + +To view the information about IP address, run xsos with `-i, --ip` switch. + +``` +# xsos --ip /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +IP4 + Interface Master IF MAC Address MTU State IPv4 Address + ========= ========= ================= ====== ===== ================== + lo - - 65536 up 127.0.0.1/8 + enp0s9 - 08:00:27:0b:bc:e9 1500 up 192.168.1.8/24 + enp0s10 - 08:00:27:b2:08:91 1500 up 192.168.1.9/24 + virbr0 - 52:54:00:ae:01:94 1500 up 192.168.122.1/24 + virbr0-nic virbr0 52:54:00:ae:01:94 1500 DOWN - + +IP6 + Interface Master IF MAC Address MTU State IPv6 Address Scope + ========= ========= ================= ====== ===== =========================================== ===== + lo - - 65536 up ::1/128 host + enp0s9 - 08:00:27:0b:bc:e9 1500 up fe80::945b:8333:f4bc:9723/64 link + enp0s10 - 08:00:27:b2:08:91 1500 up fe80::7ed4:1fab:23c3:3790/64 link + virbr0 - 52:54:00:ae:01:94 1500 up - - + virbr0-nic virbr0 52:54:00:ae:01:94 1500 DOWN - - +``` + +To view the running processes via ps, run xsos with `-p, --ps` switch. + +``` +# xsos --ps /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +PS CHECK + Total number of threads/processes: + 501 / 171 + Top users of CPU & MEM: + USER %CPU %MEM RSS + root 20.6% 14.1% 0.30 GiB + gdm 0.3% 16.8% 0.33 GiB + postfix 0.0% 0.6% 0.01 GiB + polkitd 0.0% 0.6% 0.01 GiB + daygeek 0.0% 0.2% 0.00 GiB + colord 0.0% 0.4% 0.01 GiB + Uninteruptible sleep threads/processes (0/0): + [None] + Defunct zombie threads/processes (0/0): + [None] + Top CPU-using processes: + USER PID %CPU %MEM VSZ-MiB RSS-MiB TTY STAT START TIME COMMAND + root 6542 15.6 4.2 875 78 pts/0 Sl+ 10:11 0:07 /usr/bin/python /sbin/sosreport + root 7582 3.0 0.1 10 2 pts/0 S 10:12 0:00 /bin/bash /usr/sbin/dracut --print-cmdline + root 7969 0.7 0.1 95 4 ? Ss 10:12 0:00 /usr/sbin/certmonger -S -p + root 7889 0.4 0.2 24 4 ? Ss 10:12 0:00 /usr/lib/systemd/systemd-hostnamed + gdm 3866 0.3 7.1 2856 131 ? Sl 09:50 0:04 /usr/bin/gnome-shell + root 8553 0.2 0.1 47 3 ? S 10:12 0:00 /usr/lib/systemd/systemd-udevd + root 6971 0.2 0.4 342 9 ? Sl 10:12 0:00 /usr/sbin/abrt-dbus -t133 + root 3200 0.2 0.9 982 18 ? Ssl 09:50 0:02 /usr/sbin/libvirtd + root 2855 0.1 0.1 88 3 ? Ss 09:50 0:01 /sbin/rngd -f + rtkit 2826 0.0 0.0 194 2 ? SNsl 09:50 0:00 /usr/libexec/rtkit-daemon + Top MEM-using processes: + USER PID %CPU %MEM VSZ-MiB RSS-MiB TTY STAT START TIME COMMAND + gdm 3866 0.3 7.1 2856 131 ? Sl 09:50 0:04 /usr/bin/gnome-shell + root 6542 15.6 4.2 875 78 pts/0 Sl+ 10:11 0:07 /usr/bin/python /sbin/sosreport + root 3264 0.0 1.2 271 23 tty1 Ssl+ 09:50 0:00 /usr/bin/X :0 -background + root 3200 0.2 0.9 982 18 ? Ssl 09:50 0:02 /usr/sbin/libvirtd + root 3189 0.0 0.9 560 17 ? Ssl 09:50 0:00 /usr/bin/python2 -Es /usr/sbin/tuned + gdm 4072 0.0 0.9 988 17 ? Sl 09:50 0:00 /usr/libexec/gsd-media-keys + gdm 4076 0.0 0.8 625 16 ? Sl 09:50 0:00 /usr/libexec/gsd-power + gdm 4056 0.0 0.8 697 16 ? Sl 09:50 0:00 /usr/libexec/gsd-color + root 2853 0.0 0.7 622 14 ? Ssl 09:50 0:00 /usr/sbin/NetworkManager --no-daemon + gdm 4110 0.0 0.7 544 14 ? Sl 09:50 0:00 /usr/libexec/gsd-wacom + Top thread-spawning processes: + # USER PID %CPU %MEM VSZ-MiB RSS-MiB TTY STAT START TIME COMMAND + 17 root 3200 0.2 0.9 982 18 ? - 09:50 0:02 /usr/sbin/libvirtd + 12 root 6542 16.1 4.5 876 83 pts/0 - 10:11 0:07 /usr/bin/python /sbin/sosreport + 10 gdm 3866 0.3 7.1 2856 131 ? - 09:50 0:04 /usr/bin/gnome-shell + 7 polkitd 2864 0.0 0.6 602 13 ? - 09:50 0:01 /usr/lib/polkit-1/polkitd --no-debug + 6 root 2865 0.0 0.0 203 1 ? - 09:50 0:00 /usr/sbin/gssproxy -D + 5 root 3189 0.0 0.9 560 17 ? - 09:50 0:00 /usr/bin/python2 -Es /usr/sbin/tuned + 5 root 2823 0.0 0.3 443 6 ? - 09:50 0:00 /usr/libexec/udisks2/udisksd + 5 gdm 4102 0.0 0.2 461 5 ? - 09:50 0:00 /usr/libexec/gsd-smartcard + 4 root 3215 0.0 0.2 470 4 ? - 09:50 0:00 /usr/sbin/gdm + 4 gdm 4106 0.0 0.2 444 5 ? - 09:50 0:00 /usr/libexec/gsd-sound +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/ + +作者:[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/how-to-create-collect-sosreport-in-linux/ +[2]: https://www.2daygeek.com/oswbb-how-to-install-and-configure-oswatcher-black-box-for-system-diagnostics/ +[3]: https://github.com/ryran/xsos +[4]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[5]: https://www.2daygeek.com/wp-content/uploads/2019/05/xsos-a-tool-to-read-sosreport-in-linux-1.jpg From 5f11a40c62c99f26d8c76a37ef0bd2aa3b23e5cd Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:02:04 +0800 Subject: [PATCH 0508/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20Mana?= =?UTF-8?q?ge=20business=20documents=20with=20OpenAS2=20on=20Fedora=20sour?= =?UTF-8?q?ces/tech/20190513=20Manage=20business=20documents=20with=20Open?= =?UTF-8?q?AS2=20on=20Fedora.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...siness documents with OpenAS2 on Fedora.md | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md diff --git a/sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md b/sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md new file mode 100644 index 0000000000..c8e82151ef --- /dev/null +++ b/sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage business documents with OpenAS2 on Fedora) +[#]: via: (https://fedoramagazine.org/manage-business-documents-with-openas2-on-fedora/) +[#]: author: (Stuart D Gathman https://fedoramagazine.org/author/sdgathman/) + +Manage business documents with OpenAS2 on Fedora +====== + +![][1] + +Business documents often require special handling. Enter Electronic Document Interchange, or **EDI**. EDI is more than simply transferring files using email or http (or ftp), because these are documents like orders and invoices. When you send an invoice, you want to be sure that: + +1\. It goes to the right destination, and is not intercepted by competitors. +2\. Your invoice cannot be forged by a 3rd party. +3\. Your customer can’t claim in court that they never got the invoice. + +The first two goals can be accomplished by HTTPS or email with S/MIME, and in some situations, a simple HTTPS POST to a web API is sufficient. What EDI adds is the last part. + +This article does not cover the messy topic of formats for the files exchanged. Even when using a standardized format like ANSI or EDIFACT, it is ultimately up to the business partners. It is not uncommon for business partners to use an ad-hoc CSV file format. This article shows you how to configure Fedora to send and receive in an EDI setup. + +### Centralized EDI + +The traditional solution is to use a Value Added Network, or **VAN**. The VAN is a central hub that transfers documents between their customers. Most importantly, it keeps a secure record of the documents exchanged that can be used as evidence in disputes. The VAN can use different transfer protocols for each of its customers + +### AS Protocols and MDN + +The AS protocols are a specification for adding a digital signature with optional encryption to an electronic document. What it adds over HTTPS or S/MIME is the Message Disposition Notification, or **MDN**. The MDN is a signed and dated response that says, in essence, “We got your invoice.” It uses a secure hash to identify the specific document received. This addresses point #3 without involving a third party. + +The [AS2 protocol][2] uses HTTP or HTTPS for transport. Other AS protocols target [FTP][3] and [SMTP][4]. AS2 is used by companies big and small to avoid depending on (and paying) a VAN. + +### OpenAS2 + +OpenAS2 is an open source Java implemention of the AS2 protocol. It is available in Fedora since 28, and installed with: + +``` +$ sudo dnf install openas2 +$ cd /etc/openas2 +``` + +Configuration is done with a text editor, and the config files are in XML. The first order of business before starting OpenAS2 is to change the factory passwords. + +Edit _/etc/openas2/config.xml_ and search for _ChangeMe_. Change those passwords. The default password on the certificate store is _testas2_ , but that doesn’t matter much as anyone who can read the certificate store can read _config.xml_ and get the password. + +### What to share with AS2 partners + +There are 3 things you will exchange with an AS2 peer. + +#### AS2 ID + +Don’t bother looking up the official AS2 standard for legal AS2 IDs. While OpenAS2 implements the standard, your partners will likely be using a proprietary product which doesn’t. While AS2 allows much longer IDs, many implementations break with more than 16 characters. Using otherwise legal AS2 ID chars like ‘:’ that can appear as path separators on a proprietary OS is also a problem. Restrict your AS2 ID to upper and lower case alpha, digits, and ‘_’ with no more than 16 characters. + +#### SSL certificate + +For real use, you will want to generate a certificate with SHA256 and RSA. OpenAS2 ships with two factory certs to play with. Don’t use these for anything real, obviously. The certificate file is in PKCS12 format. Java ships with _keytool_ which can maintain your PKCS12 “keystore,” as Java calls it. This article skips using _openssl_ to generate keys and certificates. Simply note that _sudo keytool -list -keystore as2_certs.p12_ will list the two factory practice certs. + +#### AS2 URL + +This is an HTTP URL that will access your OpenAS2 instance. HTTPS is also supported, but is redundant. To use it you have to uncomment the https module configuration in _config.xml_ , and supply a certificate signed by a public CA. This requires another article and is entirely unnecessary here. + +By default, OpenAS2 listens on 10080 for HTTP and 10443 for HTTPS. OpenAS2 can talk to itself, so it ships with two partnerships using __ as the AS2 URL. If you don’t find this a convincing demo, and can install a second instance (on a VM, for instance), you can use private IPs for the AS2 URLs. Or install [Cjdns][5] to get IPv6 mesh addresses that can be used anywhere, resulting in AS2 URLs like _http://[fcbf:fc54:e597:7354:8250:2b2e:95e6:d6ba]:10080_. + +Most businesses will also want a list of IPs to add to their firewall. This is actually [bad practice][6]. An AS2 server has the same security risk as a web server, meaning you should isolate it in a VM or container. Also, the difficulty of keeping mutual lists of IPs up to date grows with the list of partners. The AS2 server rejects requests not signed by a configured partner. + +### OpenAS2 Partners + +With that in mind, open _partnerships.xml_ in your editor. At the top is a list of “partners.” Each partner has a name (referenced by the partnerships below as “sender” or “receiver”), AS2 ID, certificate, and email. You need a partner definition for yourself and those you exchange documents with. You can define multiple partners for yourself. OpenAS2 ships with two partners, OpenAS2A and OpenAS2B, which you’ll use to send a test document. + +### OpenAS2 Partnerships + +Next is a list of “partnerships,” one for each direction. Each partnership configuration includes the sender, receiver, and the AS2 URL used to send the documents. By default, partnerships use synchronous MDN. The MDN is returned on the same HTTP transaction. You could uncomment the _as2_receipt_option_ for asynchronous MDN, which is sent some time later. Use synchronous MDN whenever possible, as tracking pending MDNs adds complexity to your application. + +The other partnership options select encryption, signature hash, and other protocol options. A fully implemented AS2 receiver can handle any combination of options, but AS2 partners may have incomplete implementations or policy requirements. For example, DES3 is a comparatively weak encryption algorithm, and may not be acceptable. It is the default because it is almost universally implemented. + +If you went to the trouble to set up a second physical or virtual machine for this test, designate one as OpenAS2A and the other as OpenAS2B. Modify the _as2_url_ on the OpenAS2A-to-OpenAS2B partnership to use the IP (or hostname) of OpenAS2B, and vice versa for the OpenAS2B-to-OpenAS2A partnership. Unless they are using the FedoraWorkstation firewall profile, on both machines you’ll need: + +``` +# sudo firewall-cmd --zone=public --add-port=10080/tcp +``` + +Now start the _openas2_ service (on both machines if needed): + +``` +# sudo systemctl start openas2 +``` + +### Resetting the MDN password + +This initializes the MDN log database with the factory password, not the one you changed it to. This is a packaging bug to be fixed in the next release. To avoid frustration, here’s how to change the h2 database password: + +``` +$ sudo systemctl stop openas2 +$ cat >h2passwd <<'DONE' +#!/bin/bash +AS2DIR="/var/lib/openas2" +java -cp "$AS2DIR"/lib/h2* org.h2.tools.Shell \ + -url jdbc:h2:"$AS2DIR"/db/openas2 \ + -user sa -password "$1" <testdoc <<'DONE' +This is not a real EDI format, but is nevertheless a document. +DONE +$ sudo chown openas2 testdoc +$ sudo mv testdoc /var/spool/openas2/toOpenAS2B +$ sudo journalctl -f -u openas2 +... log output of sending file, Control-C to stop following log +^C +``` + +OpenAS2 does not send a document until it is writable by the _openas2_ user or group. As a consequence, your actual business application will copy, or generate in place, the document. Then it changes the group or permissions to send it on its way, to avoid sending a partial document. + +Now, on the OpenAS2B machine, _/var/spool/openas2/OpenAS2A_OID-OpenAS2B_OID/inbox_ shows the message received. That should get you started! + +* * * + +_Photo by _[ _Beatriz Pérez Moya_][7]_ on _[_Unsplash_][8]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/manage-business-documents-with-openas2-on-fedora/ + +作者:[Stuart D Gathman][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/sdgathman/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/openas2-816x345.jpg +[2]: https://en.wikipedia.org/wiki/AS2 +[3]: https://en.wikipedia.org/wiki/AS3_(networking) +[4]: https://en.wikipedia.org/wiki/AS1_(networking) +[5]: https://fedoramagazine.org/decentralize-common-fedora-apps-cjdns/ +[6]: https://www.ld.com/as2-part-2-best-practices/ +[7]: https://unsplash.com/photos/XN4T2PVUUgk?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/documents?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 3ac3aac3d6130ab7e68c337dde1db75c00069d89 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:02:23 +0800 Subject: [PATCH 0509/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190518=20Chan?= =?UTF-8?q?ge=20Power=20Modes=20in=20Ubuntu=20with=20Slimbook=20Battery=20?= =?UTF-8?q?Optimizer=20sources/tech/20190518=20Change=20Power=20Modes=20in?= =?UTF-8?q?=20Ubuntu=20with=20Slimbook=20Battery=20Optimizer.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Ubuntu with Slimbook Battery Optimizer.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md diff --git a/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md new file mode 100644 index 0000000000..874cd4ccf1 --- /dev/null +++ b/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Change Power Modes in Ubuntu with Slimbook Battery Optimizer) +[#]: via: (https://itsfoss.com/slimbook-battry-optimizer-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Change Power Modes in Ubuntu with Slimbook Battery Optimizer +====== + +_**Brief: Slimbook Battery is a nifty applet indicator that allows you to quickly change the power mode on your Linux laptop and thus save battery life.**_ + +[Slimbook][1], the Spanish computer vendor that sells [laptops preloaded with Linux][2], has released a handy little application to optimize battery performance in Ubuntu-based Linux distributions. + +Since Slimbook sells its own Linux systems, they have created a few applications to tweak the performance of Linux on their hardware. This battery optimizer is one such tool. + +You don’t need to buy a Slimbook product to use this nifty application because Slimbook has made it available via [their official PPA][3]. + +### Slimbook battery optimizer application + +The application is called Slimbook Battery. It is basically an applet indicator that sits on the top panel and gives you quick access to various power/battery modes. + +![Slimbook Battery Mode Ubuntu][4] + +You might have seen it in Windows where you can put your laptop in one of the power modes. Slimbook Battery also offers similar battery saving modes here: + + * Energy Saving: For maximum battery saving + * Balanced: A compromise between performance and power saving + * Maximum Performance: For maximum performance obviously + + + +You can configure all these modes from the advanced mode: + +![Configure various power modes][5] + +If you feel like you have messed up the configuration, you can set things back to normal with ‘restore default values’ option. + +You can also change the general configuration of the application like auto-start, default power mode etc. + +![Slimbook Battery general configuration][6] + +Skimbook has a dedicated page that provides more information on various power saving parameters. If you want to configure things on your own, you should refer to [this page][7]. + +I have noticed that the interface of Slimbook Battery needs some improvements. For example, the ‘question mark’ icon on some parameters should be clickable to provide more information. But clicking the question mark icon doesn’t do anything at the time of writing this article. + +Altogether, Slimbook Battery is a handy app you can use for quickly switching the power mode. If you decide to install it on Ubuntu and other Ubuntu-based distributions such as Linux Mint, elementary OS etc, you can use its official [PPA][8]. + +[][9] + +Suggested read Ubuntu Forums Hacked, User Data Stolen!!! + +#### Install Slimbook Batter in Ubuntu-based distributions + +Open a terminal and use the following commands one by one: + +``` +sudo add-apt-repository ppa:slimbook/slimbook +sudo apt update +sudo apt install slimbookbattery +``` + +Once installed, search for Slimbook Battery in the menu: + +![Start Slimbook Battery Optimizer][10] + +When you click on it to start it, you’ll find it in the top panel. From here, you can select your desired power mode. + +![Slimbook Battery power mode][4] + +#### Remove Slimbook Battery + +If you don’t want to use this application, you can remove it using the following commands: + +``` +sudo apt remove slimbookbattery +sudo add-apt-repository -r ppa:slimbook/slimbook +``` + +In my opinion, such applications serves a certain purpose and should be encouraged. This tool gives you an easy way to change the power mode and at the same time, it gives you more tweaking options for various performance settings. + +Did you use Slimbook Battery? What’s your experience with it? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/slimbook-battry-optimizer-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://slimbook.es/en/ +[2]: https://itsfoss.com/get-linux-laptops/ +[3]: https://launchpad.net/~slimbook/+archive/ubuntu/slimbook +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-mode-ubuntu.jpg?resize=800%2C400&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-2.jpg?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-1.jpg?ssl=1 +[7]: https://slimbook.es/en/tutoriales/aplicaciones-slimbook/398-slimbook-battery-3-application-for-optimize-battery-of-your-laptop +[8]: https://itsfoss.com/ppa-guide/ +[9]: https://itsfoss.com/ubuntu-forums-hacked-again/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer.jpg?ssl=1 From d514878a3657fc06176f6e1668c8f4e42f607785 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:02:32 +0800 Subject: [PATCH 0510/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190517=2010?= =?UTF-8?q?=20Places=20Where=20You=20Can=20Buy=20Linux=20Computers=20sourc?= =?UTF-8?q?es/tech/20190517=2010=20Places=20Where=20You=20Can=20Buy=20Linu?= =?UTF-8?q?x=20Computers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...laces Where You Can Buy Linux Computers.md | 311 ++++++++++++++++++ 1 file changed, 311 insertions(+) create mode 100644 sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md diff --git a/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md b/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md new file mode 100644 index 0000000000..36e3a0972b --- /dev/null +++ b/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md @@ -0,0 +1,311 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 Places Where You Can Buy Linux Computers) +[#]: via: (https://itsfoss.com/get-linux-laptops/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +10 Places Where You Can Buy Linux Computers +====== + +_**Looking for Linux laptops? Here I list some online shops that either sell Linux computers or specialize only in Linux systems.**_ + +Almost all the computers (except Apple) sold these days come with Windows preinstalled on it. The standard procedure for Linux users is to buy such a computer and then either remove Windows and install Linux or [dual boot Linux with Windows][1]. + +But you don’t always have to go through Windows. You can buy Linux computers as well. + +But why buy a computer preinstalled with Linux when you can easily install Linux on any computer? Here are some reasons: + + * A computer with Windows always has an extra cost for the Windows license. You can avoid that. + * Computers preinstalled with Linux are well-tested for hardware compatibility. You can be sure that your system will have WiFi and Bluetooth working instead of figuring these things on your own. + * Buying Linux laptops and desktops supports Linux indirectly. More sale indicates that there is a demand for Linux products and thus more vendors may incline to provide Linux as a choice of operating system. + + + +If you are looking to get a new Linux laptop, let me suggest you a few manufacturers and vendors that provide ready-to-use Linux systems. + +![][2] + +### 10 places to buy Linux laptops and computers + +A couple of disclaimer/information before you see the list of shops offering computers with Linux preloaded. + +Please make a purchase on your own decision. I am simply listing the Linux computer sellers here, I cannot vouch for their product quality, after sale service or other such things. + +This is not a ranking list. The items listed here are in no particular order. The numbers are used for the purpose of counting the items, not ranking them. + +Let’s see from where you can get desktops and laptops with Linux preinstalled. + +#### 1\. Dell + +![Dell XPS Ubuntu | Image Credit: Lifehacker][3] + +Dell has been offering Ubuntu laptops for several years now. Their flagship product XPS features a Developer Edition series that comes with Ubuntu preinstalled. + +If you read my [review of Dell XPS Ubuntu edition][4], you know that I loved this laptop. It’s been more than two years and this laptop is still in great condition and performance has not deteriorated. + +Dell XPS is an expensive device with a price tag of over $1000. If that’s out of your budget, Dell also has inexpensive offering in its Inspiron laptop range. + +Do note that Dell doesn’t display the Ubuntu/Linux laptops on its website. Unless you already know that Linux laptops are offered by Dell, you wouldn’t be able to find them. + +So, go to Dell’s website and enter Ubuntu in its search box to see the products that ship with Ubuntu Linux preinstalled. + +**Availability** : Most part of the world. + +[Dell][5] + +#### 2\. System76 + +[System76][6] is a prominent name in the Linux computers world. This US-based company specializes in high-end computing devices that run Linux. Their targeted user-base is software developers. + +Initially, System76 used to offer Ubuntu on their machines. In 2017, they released their own Linux distribution [Pop!_OS][7] based on Ubuntu. Since then, Pop!_OS is the default OS on their machine with Ubuntu still available as a choice. + +Apart from performance, System76 has put a great emphasis on the design of its computer. Their [Thelio desktop series][8] has a handcrafted wooden design. + +![System76 Thelio Desktop][9] + +You may check their Linux laptops offering [here][10]. They also offer [Linux-based mini PCs][11] and [servers][12]. + +Did I mention that System76 manufactures its computers in America instead of the obvious choice of China and Taiwan? The products are on the expensive side, perhaps for this reason. + +**Availability** : USA and 60 other countries. Extra custom duty may be applicable outside the US. More info [here][13]. + +[System76][6] + +#### 3\. Purism + +Purism is a US-based company that takes pride in creating products and services that help you secure your data and privacy. That’s the reason why Purism calls itself a ‘Social Purpose Corporation’. + +[][14] + +Suggested read How To Use Google Drive In Linux + +Purism started with a crowdfunding campaign for creating a high-end open source laptop with (almost) no proprietary software. The [successful $250,000 crowdfunding campaign][15] gave birth to [Librem 15][16] laptop in 2015. + +![Purism Librem 13][17] + +Later Purism released a 13″ version called [Librem 13][18]. Purism also created a Linux distribution [Pure OS][19] keeping privacy and security in mind. + +[Pure OS can run on both desktop and mobile devices][20] and it is the default choice of operating system on its Librem laptops and [Librem 5 Linux phone][21]. + +Purism gets its components from China, Taiwan, Japan, and the United States and builds/assemble them in the US. All their devices have hardware kill switches to turn off the microphone/camera and wireless/bluetooth. + +**Availability** : Worldwide with free international shipping. Custom duty may cost extra. + +[Purism][22] + +#### 4\. Slimbook + +Slimbook is a Linux computer vendor based in Spain. Slimbook came to limelight after launching the [first KDE branded laptop][23]. + +Their offering is not limited to just KDE Neon. They offer Ubuntu, Kubuntu, Ubuntu MATE, Linux Mint and Spanish distributions like [Lliurex][24] and [Max][25]. You can also choose Windows at an additional cost or opt for no operating system at all. + +Slimbook has a wide variety of Linux laptops, desktops and mini PCs available. An iMac like 24″ [curved monitor that has in-built CPU][26] is an awesome addition to their collection. + +![Slimbook Kymera Aqua Liquid Cool Linux Computer][27] + +Want a liquid cooled Linux computer? Slimbook’s [Kymera Aqua][28] is for you. + +**Availability** : Worldwide but may cost extra in shipping and custom duty + +[Slimbook][29] + +#### 5\. TUXEDO Computers + +Another European candidate in this list of Linux computer vendors. [TUXEDO Computers][30] is based out of Germany and mainly focuses on German users and then European users. + +TUXEDO Computers only uses Linux and the computers are ‘manufactured in Germany’ and come with 5 years of guarantee and lifetime support. + +TUXEDO Computers has put up some real good effort in customizing its hardware to run on Linux. And if you ever run into trouble or want to start afresh, you have the system recovery option to restore factory settings automatically. + +![Tuxedo Computers supports a wide variety of distributions][31] + +TUXEDO Computers has a number of Linux laptops, desktops, mini-PCs available. They have both Intel and AMD processors. Apart from the computers, TUXEDO Computers also has a range of Linux supported accessories like docking stations, DVD/Blue-Ray burners, power bank and other peripheral devices. + +**Availability** : Free shipping in Germany and Europe (for orders above 150 Euro). Extra shipping charges and custom duty for non-EU countries. More info [here][32]. + +[TUXEDO Computers][33] + +#### 6\. Vikings + +[Vikings][34] is based in Germany (instead of Scandinavia :D). Certified by [Free Software Foundation][35], Vikings focuses exclusively on Libre-friendly hardware. + +![Vikings’s products are certified by Free Software Foundation][36] + +The Linux laptops and desktops by Vikings come with [coreboot][37] or [Libreboot][38] instead of proprietary boot systems like BIOS and UEFI. You can also buy [server hardware][39] running no proprietary software. + +Vikings also has other accessories like router, docking station etc. The products are assembled in Germany. + +**Availability** : Worldwide (except North Korea). Non-EU countries may charge custom duty. More information [here][40]. + +[Vikings][41] + +#### 7\. Ubuntushop.be + +No! It’s not the official Ubuntu Shop even though it has Ubuntu in its name. Ubuntushop is based in Belgium and originally started selling computers installed with Ubuntu. + +Today, you can get laptops preloaded with Linux distributions like Mint, Manjaro, elementrayOS. You can also request a distribution of your choice to be installed on the system you buy. + +![][42] + +One unique thing about Ubuntushop is that all of its computers come with default Tails OS live option. So even if it has a Linux distribution installed for regular use, you can always choose to boot into the Tails OS (without live USB). [Tails OS][43] is a Debian based distribution that deletes all traces of its use after logging out and it uses Tor network by default. + +[][44] + +Suggested read Things to do After Installing Ubuntu 18.04 and 18.10 + +Unlike many other big players on this list, I feel that Ubuntushop is more of a ‘domestic operation’ where someone manually assembles your computer and installs Linux on it. But they have done quite some job on providing options like easy re-install, own cloud server etc. + +Got an old PC, send it to them while buying a new Linux computer and they will send it back to you after installing [lightweight Linux][45] on it so that the old computer is recycled and can still be put to some use. + +**Availability** : Belgium and rest of Europe. + +[Ubuntushop.be][46] + +#### 8\. Minifree + +[Minifree][47], short for Ministry of Freedom, is a company registered in England. + +You can guess that Minifree focuses on the freedom. It provides secure and privacy-respcting computers that come with [Libreboot][38] instead of BIOS or UEFI. + +Minifree devices are certified by [Free Software Foundation][48] which means that you can be sure that your computer adhere to guidelines and principals of Free and Open Source Software. + +![][49] + +Unlike many other Linux laptops vendors on this list, computers from Minifree are not super-expensive. You can get a Libreboot Linux laptop running [Trisquel GNU/Linux][50] from 200 euro. + +Apart from laptops, Minifree also has a range of accessories like a Libre Router, tablet, docking station, batteries, keyboard, mouse etc. + +If you care to run only 100% free software like [Richard Stallman][51], Minifree is for you. + +**Availability** : Worldwide. Shipping information is available [here][52]. + +[Minifree][47] + +#### 9\. Entroware + +[Entroware][53] is another UK-based vendor that specializes in Linux-based laptops, desktop and servers. + +Like many others on the list, Entroware also has Ubuntu as its choice of Linux distribution. [Ubuntu MATE is also available as a choice on Entroware Linux laptops][54]. + +![][55] + +Apart from laptops, desktop and servers, Entroware also has their [mini-PC Aura][56] and the iMac style [monitor with built-in CPU Ares][57]. + +Availability: UK, Ireland France, Germany, Italy, Spain + +[Entroware][58] + +#### 10\. Juno Computers + +This is a new Linux laptop vendor on our list. Juno Computers is also based in UK and offers computers preinstalled with Linux. elementary OS, Ubuntu and Solus OS are the choices of Linux distributions here. + +Juno offers a range of laptops and a mini-PC called Olympia. Like almost all the mini-PCs offered by other vendors here, Olympia is also basically [Intel NUC][59]. + +The main highlight from Juno Computers is a low-cost Chromebook alternative, Juve that costs £299. It runs a dual-booted system with Solus/elementray with an Android-based desktop operating system, [Prime OS][60]. + +![Juve With Android-based Prime Os][61] + +Availability: UK, USA, Canada, Mexico, Most part of South America and Europe, Australia, New Zealand, some part of Asia and Africa. More information [here][62]. + +[Juno Computers][63] + +#### Honorable mentions + +I have listed 10 places to get Linux computers but there are several other such shops available. I cannot include all of them in the main list and a couple of them seem to be out of stock for most products. However, I am going to mention them here so that you may check them on your own: + + * [ZaReason][64] + * [Libiquity][65] + * [StationX][66] + * [Linux Certified][67] + * [Think Penguin][68] + + + +Other mainstream computer manufacturers like Acer, Lenovo etc may also have some Linux systems in their catalog so you may check their products as well. + +Have you ever bought a Linux computer? Where did you buy it? How’s your experience with it? Is it worth buying a Linux laptop? Do share your thoughts. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/get-linux-laptops/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/buy-linux-laptops.jpeg?resize=800%2C450&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/dell-xps-ubuntu.jpg?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/dell-xps-13-ubuntu-review/ +[5]: https://www.dell.com +[6]: https://system76.com/ +[7]: https://itsfoss.com/pop-os-linux-review/ +[8]: https://system76.com/desktops +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/system76-thelio-desktop.jpg?ssl=1 +[10]: https://system76.com/laptops +[11]: https://itsfoss.com/4-linux-based-mini-pc-buy-2015/ +[12]: https://system76.com/servers +[13]: https://system76.com/shipping +[14]: https://itsfoss.com/use-google-drive-linux/ +[15]: https://www.crowdsupply.com/purism/librem-15 +[16]: https://puri.sm/products/librem-15/ +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/purism-librem-13.jpg?resize=800%2C471&ssl=1 +[18]: https://puri.sm/products/librem-13/ +[19]: https://www.pureos.net/ +[20]: https://itsfoss.com/pureos-convergence/ +[21]: https://itsfoss.com/librem-linux-phone/ +[22]: https://puri.sm/ +[23]: https://itsfoss.com/slimbook-kde/ +[24]: https://distrowatch.com/table.php?distribution=lliurex +[25]: https://en.wikipedia.org/wiki/MAX_(operating_system) +[26]: https://slimbook.es/en/aio-curve-all-in-one-for-gnu-linux +[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Slimbook-Kymera-Aqua-Liquid-Cool-Linux-Computer.jpg?ssl=1 +[28]: https://slimbook.es/en/kymera-aqua-the-gnu-linux-computer-with-custom-water-cooling +[29]: https://slimbook.es/en/ +[30]: https://www.tuxedocomputers.com/ +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/tuxedo-computers.jpeg?resize=800%2C400&ssl=1 +[32]: https://www.tuxedocomputers.com/en/Shipping-Returns.tuxedo +[33]: https://www.tuxedocomputers.com/en# +[34]: https://store.vikings.net/index.php?route=common/home +[35]: https://www.fsf.org +[36]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/vikings-computer.jpeg?resize=800%2C450&ssl=1 +[37]: https://www.coreboot.org/ +[38]: https://libreboot.org/ +[39]: https://store.vikings.net/libre-friendly-hardware/the-server-1u +[40]: https://store.vikings.net/index.php?route=information/information&information_id=8 +[41]: https://store.vikings.net/libre-friendly-hardware +[42]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/manjarobook-by-ubuntushop.jpeg?ssl=1 +[43]: https://tails.boum.org/ +[44]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/ +[45]: https://itsfoss.com/lightweight-linux-beginners/ +[46]: https://www.ubuntushop.be/index.php/en/ +[47]: https://minifree.org/ +[48]: https://www.fsf.org/ +[49]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/minifree.jpg?resize=800%2C550&ssl=1 +[50]: https://trisquel.info/ +[51]: https://en.wikipedia.org/wiki/Richard_Stallman +[52]: https://minifree.org/shipping-costs/ +[53]: https://www.entroware.com/ +[54]: https://itsfoss.com/ubuntu-mate-entroware/ +[55]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/entroware.jpg?resize=800%2C450&ssl=1 +[56]: https://itsfoss.com/ubuntu-entroware-aura-mini-pc/ +[57]: https://www.entroware.com/store/ares +[58]: https://www.entroware.com/store/index.php?route=common/home +[59]: https://www.amazon.com/Intel-NUC-Mainstream-Kit-NUC8i3BEH/dp/B07GX4X4PW?psc=1&SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07GX4X4PW (Intel NUC) +[60]: https://primeos.in/ +[61]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/juve-with-prime-os.jpeg?ssl=1 +[62]: https://junocomputers.com/shipping +[63]: https://junocomputers.com/ +[64]: https://zareason.com/ +[65]: https://libiquity.com/ +[66]: https://stationx.rocks/ +[67]: https://www.linuxcertified.com/linux_laptops.html +[68]: https://www.thinkpenguin.com/ From 7cbbb8f1aa43d39ca4374812e1e63259da589794 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:02:52 +0800 Subject: [PATCH 0511/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20How?= =?UTF-8?q?=20to=20SSH=20into=20a=20Raspberry=20Pi=20[Beginner=E2=80=99s?= =?UTF-8?q?=20Tip]=20sources/tech/20190513=20How=20to=20SSH=20into=20a=20R?= =?UTF-8?q?aspberry=20Pi=20-Beginner-s=20Tip.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...SSH into a Raspberry Pi -Beginner-s Tip.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md diff --git a/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md b/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md new file mode 100644 index 0000000000..d1bcf06138 --- /dev/null +++ b/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to SSH into a Raspberry Pi [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/ssh-into-raspberry/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +How to SSH into a Raspberry Pi [Beginner’s Tip] +====== + +_**In this Raspberry Pi article series, you’ll learn how to enable SSH in Raspberry Pi and then how to SSH into a Raspberry Pi device.**_ + +Out of all the things you can do with [Raspberry Pi][1], using it as a server in a home network is very popular. The tiny footprint and low power consumption makes it a perfect device to run light weight servers. + +One of the things you should be able to do in such a case is run commands on your Raspberry Pi without needing to plug in a display, keyboard, mouse and having to move yourself to the location of your Raspberry Pi each time. + +You achieve this by logging into your Raspberry Pi via SSH ([Secure Shell][2]) from any other computer, your laptop, desktop or even your phone. Let me show you how + +### How to SSH into Raspberry Pi + +![][3] + +I assume that you are [running Raspbian on your Pi][4] and have successfully connected to a network via Ethernet or WiFi. It’s important that your Raspberry Pi is connected to a network otherwise you won’t be able to connect to it via SSH (sorry for stating the obvious). + +#### Step 1: Enable SSH on Raspberry Pi + +SSH is disabled by default in Raspberry Pi, hence you’ll have to enable it when you turn on the Pi after a fresh installation of Raspbian. + +First go to the Raspberry Pi configuration window by navigating through the menu. + +![Raspberry Pi Menu, Raspberry Pi Configuration][5] + +Now, go to the interfaces tab, enable SSH and restart your Pi. + +![Enable SSH on Raspberry Pi][6] + +You can also enable SSH without via the terminal. Just enter the command _**sudo raspi-config**_ and then go to Advanced Options to enable SSH. + +#### Step 2. Find the IP Address of Raspberry Pi + +In most cases your Raspberry Pi will be assigned a local IP address which looks like **192.168.x.x** or **10.x.x.x**. You can [use various Linux commands to find the IP address][7]. + +[][8] + +Suggested read This Linux Malware Targets Unsecure Raspberry Pi Devices + +I am using the good old ifconfig command here but you can also use _**ip address**_. + +``` +ifconfig +``` + +![Raspberry Pi Network Configuration][9] + +This command shows all the list of active network adapters and their configuration. The first entry( **eth0** ) shows IP address as **192.168.2.105** which is valid.I have used Ethernet to connect my Raspberry Pi to the network, hence it is under **eth0**. If you use WiFi check under the entry named ‘ **wlan0** ‘ . + +You can also find out the IP address by other means like checking the network devices list on your router/modem. + +#### Step 3. SSH into your Raspberry Pi + +Now that you have enabled SSH and found out your IP address you can go ahead and SSH into your Raspberry Pi from any other computer. You’ll also need the username and the password for the Raspberry Pi. + +Default Username and Password is: + + * username: pi + * password: raspberry + + + +If you have changed the default password then use the new password instead of the above. Ideally you must change the default password. In the past, a [malware infected thousands of Raspberry Pi devices that were using the default username and password][8]. + +Open a terminal (on Mac and Linux) on the computer from which you want to SSH into your Pi and type the command below. On Windows, you can use a SSH client like [Putty][10]. + +Here, use the IP address you found out in the previous step. + +``` +ssh [email protected] +``` + +_**Note: Make sure your Raspberry Pi and the computer you are using to SSH into your Raspberry Pi are connected to the same network**_. + +![SSH through terminal][11] + +You’ll see a warning the first time, type **yes** and press enter. + +![Type the password \(default is ‘raspberry‘\)][12] + +Now, type in the password and press enter. + +![Successful Login via SSH][13] + +On a successful login you’ll be presented with the terminal of your Raspberry Pi. Now you can any commands on your Raspberry Pi through this terminal remotely(within the current network) without having to access your Raspberry Pi physically. + +[][14] + +Suggested read Speed Up Ubuntu Unity On Low End Systems [Quick Tip] + +Furthermore you can also set up SSH-Keys so that you don’t have to type in the password every time you log in via SSH, but that’s a different topic altogether. + +I hope you were able to SSH into your Raspberry Pi after following this tutorial. Let me know how you plan to use your Raspberry Pi in the comments below! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ssh-into-raspberry/ + +作者:[Chinmay][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/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://en.wikipedia.org/wiki/Secure_Shell +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/ssh-into-raspberry-pi.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Raspberry-pi-configuration.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/enable-ssh-raspberry-pi.png?ssl=1 +[7]: https://linuxhandbook.com/find-ip-address/ +[8]: https://itsfoss.com/raspberry-pi-malware-threat/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/ifconfig-rapberry-pi.png?ssl=1 +[10]: https://itsfoss.com/putty-linux/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-pi-warning.png?fit=800%2C199&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-pi-password.png?fit=800%2C202&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-Pi-successful-login.png?fit=800%2C306&ssl=1 +[14]: https://itsfoss.com/speed-up-ubuntu-unity-on-low-end-system/ From dd1c951c1b45f00d6b04813dd0083980519b546a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:03:04 +0800 Subject: [PATCH 0512/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190517=20Anno?= =?UTF-8?q?uncing=20Enarx=20for=20running=20sensitive=20workloads=20source?= =?UTF-8?q?s/tech/20190517=20Announcing=20Enarx=20for=20running=20sensitiv?= =?UTF-8?q?e=20workloads.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g Enarx for running sensitive workloads.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20190517 Announcing Enarx for running sensitive workloads.md diff --git a/sources/tech/20190517 Announcing Enarx for running sensitive workloads.md b/sources/tech/20190517 Announcing Enarx for running sensitive workloads.md new file mode 100644 index 0000000000..81d021f7d7 --- /dev/null +++ b/sources/tech/20190517 Announcing Enarx for running sensitive workloads.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Announcing Enarx for running sensitive workloads) +[#]: via: (https://opensource.com/article/19/5/enarx-security) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel/users/wgarry155) + +Announcing Enarx for running sensitive workloads +====== +Enarx leverages the capabilities of a TEE to change the trust model for +your application. +![cubes coming together to create a larger cube][1] + +Running software is something that most of us do without thinking about it. We run in "on premises"—our own machines—or we run it in the cloud - on somebody else's machines. We don't always think about what those differences mean, or about what assumptions we're making about the securtiy of the data that's being processed, or even of the software that's doing that processing. Specifically, when you run software (a "workload") on a system (a "host") on the cloud or on your own premises, there are lots and lots of layers. You often don't see those layers, but they're there. + +Here's an example of the layers that you might see in a standard cloud virtualisation architecture. The different colours represent different entities that "own" different layers or sets of layers. + +![Layers in a standard cloud virtualisation architecture][2] + +Here's a similar diagram depicting a standard cloud container architecture. As before, each different colour represents a different "owner" of a layer or set of layers. + +![Standard cloud container architecture][3] + +These owners may be of very different types, from hardware vendors to OEMs to cloud service providers (CSPs) to middleware vendors to operating system vendors to application vendors to you, the workload owner. And for each workload that you run, on each host, the exact list of layers is likely to be different. And even when they're the same, the versions of the layers instances may be different, whether it's a different BIOS version, a different bootloader, a different kernel version, or whatever else. + +Now, in many contexts, you might not worry about this, and your CSP goes out of its way to abstract these layers and their version details away from you. But this is a security article, for security people, and that means that anybody who's reading this probably does care. + +The reason we care is not just the different versions and the different layers, but the number of different things—and different entities—that we need to trust if we're going to be happy running any sort of sensitive workload on these types of stacks. I need to trust every single layer, and the owner of every single layer, not only to do what they say they will do, but also not to be compromised. This is a _big_ stretch when it comes to running my sensitive workloads. + +### What's Enarx? + +Enarx is a new project that is trying to address this problem of having to trust all of those layers. A few of us at Red Hat have been working on it for a few months now. My colleague Nathaniel McCallum demoed an early incarnation of it at [Red Hat Summit 2019][4] in Boston, and we're ready to start announcing it to the world. We have code, we have a demo, we have a GitHub repository, we have a logo: what more could a project want? Well, people—but we'll get to that. + +![Enarx logo][5] + +With Enarx, we made the decision that we wanted to allow people running workloads to be able to reduce the number of layers—and owners—that they need to trust to the absolute minimum. We plan to use trusted execution environments ("TEEs"—see "[Oh, how I love my TEE (or do I?)][6]") to provide an architecture that looks a little more like this: + +![Enarx architecture][7] + +In a world like this, you have to trust the CPU and firmware, and you need to trust some middleware—of which Enarx is part—but you don't need to trust all of the other layers, because we will leverage the capabilities of the TEE to ensure the integrity and confidentiality of your application. The Enarx project will provide attestation of the TEE, so that you know you're running on a true and trusted TEE, and will provide open source, auditable code to help you trust the layer directly beneath your application. + +The initial code is out there—working on AMD's SEV TEE at the momen—and enough of it works now that we're ready to tell you about it. + +Making sure that your application meets your own security requirements is down to you. :-) + +### How do I find out more? + +The easiest way to learn more is to visit the [Enarx GitHub][8]. + +We'll be adding more information there—it's currently just code—but bear with us: there are only a few of us on the project at the moment. A blog is on the list of things we'd like to have, but we wanted to get things started. + +We'd love to have people in the community getting involved in the project. It's currently quite low-level and requires quite a lot of knowledge to get running, but we'll work on that. You will need some specific hardware to make it work, of course. Oh, and if you're an early boot or a low-level KVM hacker, we're _particularly_ interested in hearing from you. + +I will, of course, respond to comments on this article. + +* * * + +_This article was originally published on[Alice, Eve, and Bob][9] and is reprinted with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/enarx-security + +作者:[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/users/wgarry155 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) +[2]: https://opensource.com/sites/default/files/uploads/classic-cloud-virt-arch-1.png (Layers in a standard cloud virtualisation architecture) +[3]: https://opensource.com/sites/default/files/uploads/cloud-container-arch.png (Standard cloud container architecture) +[4]: https://www.redhat.com/en/summit/2019 +[5]: https://opensource.com/sites/default/files/uploads/enarx.png (Enarx logo) +[6]: https://aliceevebob.com/2019/02/26/oh-how-i-love-my-tee-or-do-i/ +[7]: https://opensource.com/sites/default/files/uploads/reduced-arch.png (Enarx architecture) +[8]: https://github.com/enarx +[9]: https://aliceevebob.com/2019/05/07/announcing-enarx/ From 61716f452702cc2a6fdf8e213a16984f87cf43f5 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:03:15 +0800 Subject: [PATCH 0513/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190517=20Usin?= =?UTF-8?q?g=20Testinfra=20with=20Ansible=20to=20verify=20server=20state?= =?UTF-8?q?=20sources/tech/20190517=20Using=20Testinfra=20with=20Ansible?= =?UTF-8?q?=20to=20verify=20server=20state.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...fra with Ansible to verify server state.md | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 sources/tech/20190517 Using Testinfra with Ansible to verify server state.md diff --git a/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md b/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md new file mode 100644 index 0000000000..c14652a7f4 --- /dev/null +++ b/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md @@ -0,0 +1,168 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Testinfra with Ansible to verify server state) +[#]: via: (https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state) +[#]: author: (Clement Verna https://opensource.com/users/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert) + +Using Testinfra with Ansible to verify server state +====== +Testinfra is a powerful library for writing tests to verify an +infrastructure's state. Coupled with Ansible and Nagios, it offers a +simple solution to enforce infrastructure as code. +![Terminal command prompt on orange background][1] + +By design, [Ansible][2] expresses the desired state of a machine to ensure that the content of an Ansible playbook or role is deployed to the targeted machines. But what if you need to make sure all the infrastructure changes are in Ansible? Or verify the state of a server at any time? + +[Testinfra][3] is an infrastructure testing framework that makes it easy to write unit tests to verify the state of a server. It is a Python library and uses the powerful [pytest][4] test engine. + +### Getting started with Testinfra + +Testinfra can be easily installed using the Python package manager (pip) and a Python virtual environment. + + +``` +$ python3 -m venv venv +$ source venv/bin/activate +(venv) $ pip install testinfra +``` + +Testinfra is also available in the package repositories of Fedora and CentOS using the EPEL repository. For example, on CentOS 7 you can install it with the following commands: + + +``` +$ yum install -y epel-release +$ yum install -y python-testinfra +``` + +#### A simple test script + +Writing tests in Testinfra is easy. Using the code editor of your choice, add the following to a file named **test_simple.py** : + + +``` +import testinfra + +def test_os_release(host): +assert host.file("/etc/os-release").contains("Fedora") + +def test_sshd_inactive(host): +assert host.service("sshd").is_running is False +``` + +By default, Testinfra provides a host object to the test case; this object gives access to different helper modules. For example, the first test uses the **file** module to verify the content of the file on the host, and the second test case uses the **service** module to check the state of a systemd service. + +To run these tests on your local machine, execute the following command: + + +``` +(venv)$ pytest test_simple.py +================================ test session starts ================================ +platform linux -- Python 3.7.3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0 +rootdir: /home/cverna/Documents/Python/testinfra +plugins: testinfra-3.0.0 +collected 2 items +test_simple.py .. + +================================ 2 passed in 0.05 seconds ================================ +``` + +For a full list of Testinfra's APIs, you can consult the [documentation][5]. + +### Testinfra and Ansible + +One of Testinfra's supported backends is Ansible, which means Testinfra can directly use Ansible's inventory file and a group of machines defined in the inventory to run tests against them. + +Let's use the following inventory file as an example: + + +``` +[web] +app-frontend01 +app-frontend02 + +[database] +db-backend01 +``` + +We want to make sure that our Apache web server service is running on **app-frontend01** and **app-frontend02**. Let's write the test in a file called **test_web.py** : + + +``` +def check_httpd_service(host): +"""Check that the httpd service is running on the host""" +assert host.service("httpd").is_running +``` + +To run this test using Testinfra and Ansible, use the following command: + + +``` +(venv) $ pip install ansible +(venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible test_web.py +``` + +When invoking the tests, we use the Ansible inventory **[web]** group as the targeted machines and also specify that we want to use Ansible as the connection backend. + +#### Using the Ansible module + +Testinfra also provides a nice API to Ansible that can be used in the tests. The Ansible module enables access to run Ansible plays inside a test and makes it easy to inspect the result of the play. + + +``` +def check_ansible_play(host): +""" +Verify that a package is installed using Ansible +package module +""" +assert not host.ansible("package", "name=httpd state=present")["changed"] +``` + +By default, Ansible's [Check Mode][6] is enabled, which means that Ansible will report what would change if the play were executed on the remote host. + +### Testinfra and Nagios + +Now that we can easily run tests to validate the state of a machine, we can use those tests to trigger alerts on a monitoring system. This is a great way to catch unexpected changes. + +Testinfra offers an integration with [Nagios][7], a popular monitoring solution. By default, Nagios uses the [NRPE][8] plugin to execute checks on remote hosts, but using Testinfra allows you to run the tests directly from the Nagios master. + +To get a Testinfra output compatible with Nagios, we have to use the **\--nagios** flag when triggering the test. We also use the **-qq** pytest flag to enable pytest's **quiet** mode so all the test details will not be displayed. + + +``` +(venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible --nagios -qq line test.py +TESTINFRA OK - 1 passed, 0 failed, 0 skipped in 2.55 seconds +``` + +Testinfra is a powerful library for writing tests to verify an infrastructure's state. Coupled with Ansible and Nagios, it offers a simple solution to enforce infrastructure as code. It is also a key component of adding testing during the development of your Ansible roles using [Molecule][9]. + +* * * + +Sysadmins who think the cloud is a buzzword and a bunch of hype should check out Ansible. + +Can you really do DevOps without sharing scripts or code? DevOps manifesto proponents value cross-... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state + +作者:[Clement Verna][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/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://www.ansible.com/ +[3]: https://testinfra.readthedocs.io/en/latest/ +[4]: https://pytest.org/ +[5]: https://testinfra.readthedocs.io/en/latest/modules.html#modules +[6]: https://docs.ansible.com/ansible/playbooks_checkmode.html +[7]: https://www.nagios.org/ +[8]: https://en.wikipedia.org/wiki/Nagios#NRPE +[9]: https://github.com/ansible/molecule From 6346e592872ec9e55be9e80bed212b825fd8ca47 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:03:33 +0800 Subject: [PATCH 0514/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20Syst?= =?UTF-8?q?em76's=20secret=20sauce=20for=20success=20sources/tech/20190516?= =?UTF-8?q?=20System76-s=20secret=20sauce=20for=20success.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...516 System76-s secret sauce for success.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20190516 System76-s secret sauce for success.md diff --git a/sources/tech/20190516 System76-s secret sauce for success.md b/sources/tech/20190516 System76-s secret sauce for success.md new file mode 100644 index 0000000000..9409de535f --- /dev/null +++ b/sources/tech/20190516 System76-s secret sauce for success.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (System76's secret sauce for success) +[#]: via: (https://opensource.com/article/19/5/system76-secret-sauce) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/don-watkins) + +System76's secret sauce for success +====== +Linux computer maker's approach to community-informed software and +hardware development embodies the open source way. +![][1] + +In [_The Open Organization_][2], Jim Whitehurst says, "show passion for the purpose of your organization and constantly drive interest in it. People are drawn to and generally, want to follow passionate people." Carl Richell, the founder and CEO of Linux hardware maker [System76][3], pours that secret sauce to propel his company in the world of open hardware, Linux, and open source. + +Carl demonstrates quiet confidence and engages the team at System76 in a way that empowers their creative synergy. During a recent visit to System76's Denver factory, I could immediately tell that the employees love what they do, what they produce, and their interaction with each other and their customers, and Carl sets that example. They are as they [describe themselves][4]: a diverse team of creators, makers, and builders; a small company innovating the next big things; and a group of extremely hard-core nerds. + +### A revolutionary approach + +In 2005, Carl had a vision, which began as talk over some beers, to produce desktop and laptop computers that come installed with Linux. He's transformed that idea into a highly successful company founded on the [belief][5] that "the computer and operating system are the most powerful and versatile tools ever created." And by producing the best tools, System76 can inspire the curious to make their greatest discovery or complete their greatest project. + +![System 76 founder and CEO Carl Richell][6] + +Carl Richell's enthusiasm was obvious at System 76's [Thelio launch event][7]. + +System76 lives up to its name, which was inspired by the American Revolution of 1776. The company views itself as a leader in the open source revolution, granting people freedom and independence from proprietary hardware and software. + +But the revolution does not end there; it continues with the company's business practices and diverse environment that aims to close the gender gap in technology leadership. Eight of the company's 28 employees are women, including vice president of marketing Louisa Bisio, creative manager Kate Hazen, purchasing manager May Liu, head of technical support Emma Marshall, and manufacturing control and logistics manager Sarah Zinger. + +### Community-informed design + +The staff members' passion and ingenuity for making the Linux experience enjoyable for customers creates an outstanding culture. Because the company believes the Linux desktop deserves a dedicated PC manufacturer, in 2018, it brought manufacturing in-house. This allows System76's engineers to make design changes more quickly, based on their frequent interactions with Linux users to learn about their needs and wants. It also opens up its parts and process to the public, including publishing design files under GPL on [GitHub][8], consistent with its commitment to openness and open source. + +For example, when System76 decided to create its own version of Linux, [Pop!_OS][9], it hosted online meetings to discuss and learn what features and software its customers wanted. This decision to work closely with the community has been instrumental in making Pop!_OS successful. + +System76 again turned to the community when it began developing [Thelio][10], its new line of desktop computers. Marketing VP Louisa Bisio says, "Taking a similar approach to open hardware has been great. We started in-house design in 2016, prototyping different desktop designs. Then we moved from prototyping acrylic to sheet metal. Then the first few prototypes of Thelio were presented to our [Superfan][11] attendees in 2017, and their feedback was really important in adjusting the desktop designs and progressing Thelio iterations forward." + +Thelio is the product of research and development focusing on high-quality components and design. It features a unique cabling layout, innovative airflow within the computer case, and the Thelio Io open hardware SATA controller. Many of System76's customers use platforms like [CUDA][12] to do their work; to support them, System76 works backward and pulls out proprietary functionality, piece by piece, until everything is open. + +### Open roads ahead + +Manufacturing open laptops are on the long-range roadmap, but the company is actively working on an open motherboard and maintaining Pop!_OS and System76 drivers, which are open. This commitment to openness, customer-driven design, and culture give System 76 a unique place in computer manufacturing. All of this stems from founder Carl Richell and his philosophy "that technology should be open and accessible to everyone." [As Carl says][13], "open hardware benefits all of us. It's how we further advance technology and make it more available to everyone." + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/system76-secret-sauce + +作者:[Don Watkins ][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/don-watkins/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bubblehands_fromRHT_520_0612LL.png?itok=_iQ2dO3S +[2]: https://www.amazon.com/Open-Organization-Igniting-Passion-Performance/dp/1511392460 +[3]: https://system76.com/ +[4]: https://system76.com/about +[5]: https://system76.com/pop +[6]: https://opensource.com/sites/default/files/uploads/carl_richell.jpg (System 76 founder and CEO Carl Richell) +[7]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-w6XNmKS +[8]: https://github.com/system76 +[9]: https://opensource.com/article/18/1/behind-scenes-popos-linux +[10]: https://system76.com/desktops +[11]: https://system76.com/superfan +[12]: https://en.wikipedia.org/wiki/CUDA +[13]: https://opensource.com/article/19/4/system76-hardware From 2bb98a105647fddff4ff2e250852b57c703175ab Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:03:43 +0800 Subject: [PATCH 0515/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20Crea?= =?UTF-8?q?te=20flexible=20web=20content=20with=20a=20headless=20managemen?= =?UTF-8?q?t=20system=20sources/tech/20190516=20Create=20flexible=20web=20?= =?UTF-8?q?content=20with=20a=20headless=20management=20system.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntent with a headless management system.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20190516 Create flexible web content with a headless management system.md diff --git a/sources/tech/20190516 Create flexible web content with a headless management system.md b/sources/tech/20190516 Create flexible web content with a headless management system.md new file mode 100644 index 0000000000..df58e96d0d --- /dev/null +++ b/sources/tech/20190516 Create flexible web content with a headless management system.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create flexible web content with a headless management system) +[#]: via: (https://opensource.com/article/19/5/headless-cms) +[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) + +Create flexible web content with a headless management system +====== +Get the versatility and freedom to deliver content however you think is +best. +![Browser of things][1] + +In recent years, we’ve witnessed an explosion in the number of technological devices that deliver web-based content to users. Smartphones, tablets, smartwatches, and more—all with progressively advancing technical capabilities and support for an ever-widening list of operating systems and web browsers—swarm anew onto the market each year. + +What does this trend have to do with web development and headless versus traditional Content Management Systems (CMS)? Quite a lot. + +### CMS creates the internet + +A CMS is an application or set of computer programs used to manage digital content like images, videos, blog posts—essentially anything you would post on a website. An obvious example of a CMS is [WordPress][2]. + +The word "manage" is used broadly here. It can refer to creating, editing, or updating any kind of digital content on a website, as well as indexing the site to make it easily searchable. + +So, a CMS essentially separates the content displayed on a website from how that content is displayed. It also allows you, the website administrator, to set permissions on who can access, edit, modify, or otherwise manage that content. + +Suppose you want to post a new blog entry, update or correct something in an old post, write on your Facebook page, share a social media link to a video or article, or embed a video, music file, or pre-written set of text into a page on your website. If you have ever done anything like this, you have made use of CMS features. + +### Traditional CMS architecture: Benefits and flaws + +There are two major components that make up a CMS: the Content Management Application (CMA) and the Content Delivery Application (CDA). The CMA pertains to the front-end portion of the website. This is what allows authors or other content managers to edit and create content without help from a web developer. The CDA pertains to the back end portion of a website. By organizing and compiling content to make website content updates possible, it automates the function of a website administrator. + +Traditionally, these two pieces are joined into a single unit as a "coupled" CMS architecture. A **coupled CMS** uses a specific front-end delivery system (CMA) built into the application itself. The term "coupled" comes from the fact that the front-end framework—the templates and layout of the pages and how those pages respond to being opened in certain browsers—is coupled to the website’s content. In other words, in a coupled CMS architecture the Content Management Application (CMA) and Content Delivery Application (CDA) are inseparably merged. + +#### Benefits of the traditional CMS + +Coupled architecture does offer advantages, mainly in simplicity and ease of use for those who are not technically sophisticated. This fact explains why a platform like WordPress, which retains a traditional CMS setup, [remains so popular][3] for those who create websites or blogs. + +Further simplifying the web development process [are website builder applications][4], such as [Wix][5] and [Squarespace][6], which allow you to build drag-and-drop websites. The most popular of these builders use open source libraries but are themselves closed source. These sites allow almost anyone who can find the internet to put a website together without wading through the relatively short weeds of a CMS environment. While builder applications were [the object of derision][7] not so long ago amongst many in the open source community—mainly because they tended to give websites a generic and pre-packaged look and feel—they have grown increasingly functional and variegated. + +#### Security is an issue + +However, for all but the simplest web apps, a traditional CMS architecture results in inflexible technology. Modifying a static website or web app with a traditional CMS requires tremendous time and effort to produce updates, patches, and installations, preventing developers from keeping up with the growing number of devices and browsers. + +Furthermore, coupled CMSs have two built-in security flaws: + +**Risk #1** : Since content management and delivery are bound together, hackers who breach your website through the front end automatically gain access to the back-end database. This lack of separation between data and its presentation increases the likelihood that data will be stolen. Depending on the kind of user data stored on your website’s servers, a large-scale theft could be catastrophic. + +**Risk #2** : The risk of successful [Distributed Denial of Service][8] (DDoS) attacks increases without a separate system for delivering content to your website. DDoS attacks flood content delivery networks with so many traffic requests that they become overwhelmed and go offline. If your content delivery network is separated from your actual web servers, attackers will be less able to bring down your site. + +To avoid these problems, developers have introduced headless and decoupled CMSs. + +### Comparing headless and decoupled CMSs + +The "head" of a CMS is a catch-all term for the Content Delivery Application. Therefore, a CMS without one—and so with no way of delivering content to a user—is called "headless." + +This lack of an established delivery method gives headless CMSs enormous versatility. Without a CDA there is no pre-established delivery method, so developers can design separate frameworks as the need arises. The problem of constantly patching your website, web apps, and other code to guarantee compatibility disappears. + +Another option, a **decoupled CMS** , includes many of the same features and benefits as a headless CMS, but there is one crucial difference. Where a headless CMS leaves it entirely to the developer to deliver and present content to their users, a decoupled CMS offers pre-established delivery tools that developers can either take or leave. Decoupled CMSs thus offer both the simplicity of the traditional CMS and the versatility of the headless ones. + +In short, a decoupled CMS is sometimes called a **hybrid CMS ****since it's a hybrid of the coupled and headless designs. Decoupled CMSs are not a new concept. As far back as 2015, PHP core repository developer David Buchmann was [calling on devs][9] to decouple their CMSs to meet a wider set of challenges. + +### Security improvements with a headless CMS + +Perhaps the most important point to make about headless versus decoupled content management architectures, and how they both differ from traditional architecture, is the added security benefit. In both the headless and decoupled designs, content and user data are located on a separate back-end system protected by a firewall. The user can’t access the content management application itself. + +However, it's important to keep in mind that the major consequence of this change in architectures is that since the architecture is fragmented, developers have to fill in the gaps and design content delivery and presentation mechanisms on their own. This means that whether you opt to go headless or decoupled, your developer needs to understand security. While separating content management and content delivery gives hackers one fewer vector through which to attack, this isn’t a security benefit in itself. The burden will be on your devs to properly secure your resulting CDA. + +A firewall protecting the back end provides a [crucial layer of security][10]. Headless and decoupled architectures can distribute your content among multiple databases, so if you take advantage of this possibility you can lower the chance of successful DDoS attacks even further. Open source headless CMS can also benefit from the installation of a [Linux VPN][11] or Linux kernel firewall management tool like [iptables][12]. All of these options combine to provide the added security developers need to create no matter what kind of CDA or back end setup they choose. + +Benefits aside, keep in mind that headless CMS platforms are a fairly new tech. Before making the switch to headless or decoupled, consider whether the host you’re using can support your added security so that you can host your application behind network security systems to block attempts at unauthorized access. If they cannot, a host change might be in order. When evaluating new hosts, also consider any existing contracts or security and compliance restrictions in place (GDPR, CCPA, etc.) which could cause migration troubles. + +### Open source options + +As you can see, headless architecture offers designers the versatility and freedom to deliver content however they think best. This spirit of freedom fits naturally with the open source paradigm in software design, in which all source code is available to public view and may be taken and modified by anyone for any reason. + +There are a number of open source headless CMS platforms that allow developers to do just that: [Mura,][13] [dotCMS][14], and [Cockpit CMS][15] to name a few. For a deeper dive into the world of open source headless CMS platforms, [check out this article][16]. + +### Final thoughts + +For web designers and developers, the idea of a headless CMS marks a significant rethinking of how sites are built and delivered. Moving to this architecture is a great way to future-proof your website against changing preferences and whatever tricks future hackers may cook up, while at the same time creating a seamless user experience no matter what device or browser is used. You might also take a look at [this guide][17] for UX tips on designing your website in a way that meshes with headless and decoupled architectures. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/headless-cms + +作者:[Sam Bocetta][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sambocetta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://wordpress.org/ +[3]: https://kinsta.com/wordpress-market-share/ +[4]: https://hostingcanada.org/website-builders/ +[5]: https://www.wix.com/ +[6]: https://www.squarespace.com +[7]: https://arstechnica.com/information-technology/2016/11/wordpress-and-wix-trade-shots-over-alleged-theft-of-open-source-code/ +[8]: https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/ +[9]: https://opensource.com/business/15/3/decoupling-your-cms +[10]: https://www.hostpapa.com/blog/security/why-your-small-business-needs-a-firewall/ +[11]: https://surfshark.com/download/linux +[12]: https://www.linode.com/docs/security/firewalls/control-network-traffic-with-iptables/ +[13]: https://www.getmura.com/ +[14]: https://dotcms.com/ +[15]: https://getcockpit.com/ +[16]: https://www.cmswire.com/web-cms/13-headless-cmss-to-put-on-your-radar/ +[17]: https://medium.com/@mat_walker/tips-for-content-modelling-with-the-headless-cms-contentful-7e886a911962 From 1549059cd509415d08f8700011ca0ec502c32fbe Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:04:14 +0800 Subject: [PATCH 0516/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190515=20How?= =?UTF-8?q?=20to=20manage=20access=20control=20lists=20with=20Ansible=20so?= =?UTF-8?q?urces/tech/20190515=20How=20to=20manage=20access=20control=20li?= =?UTF-8?q?sts=20with=20Ansible.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...anage access control lists with Ansible.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20190515 How to manage access control lists with Ansible.md diff --git a/sources/tech/20190515 How to manage access control lists with Ansible.md b/sources/tech/20190515 How to manage access control lists with Ansible.md new file mode 100644 index 0000000000..692dd70599 --- /dev/null +++ b/sources/tech/20190515 How to manage access control lists with Ansible.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to manage access control lists with Ansible) +[#]: via: (https://opensource.com/article/19/5/manage-access-control-lists-ansible) +[#]: author: (Taz Brown https://opensource.com/users/heronthecli) + +How to manage access control lists with Ansible +====== +Automating ACL management with Ansible's ACL module is a smart way to +strengthen your security strategy. +![Data container block with hexagons][1] + +Imagine you're a new DevOps engineer in a growing agile environment, and recently your company has experienced phenomenal growth. To support expansion, the company increased hiring by 25% over the last quarter and added 5,000 more servers and network devices to its infrastructure. The company now has over 13,000 users, and you need a tool to scale the existing infrastructure and manage your large number of users and their thousands of files and directories. The company decided to adopt [Ansible][2] company-wide to manage [access control lists (ACLs)][3] and answer the call of effectively managing files and directories and permissions. + +Ansible can be used for a multitude of administration and maintenance tasks and, as a DevOps engineer or administrator, it's likely you've been tasked with using it to manage ACLs. + +### About managing ACLs + +ACLs allow regular users to share their files and directories selectively with other users and groups. With ACLs, a user can grant others the ability to read, write, and execute files and directories without leaving those filesystem elements open. + +ACLs are set and removed at the command line using the **setfacl** utility. The command is usually followed by the name of a file or directory. To set permissions, you would use the Linux command **setfacl -m d ⭕rx ** (e.g., **setfacl -m d ⭕rx Music/**). To view the current permissions on a directory, you would use the command **getfacl ** (e.g., **getfacl Music/** ). To remove an ACL from a file or directory, you would type the command, **# setfacl -x ** (to remove only the specified ACL from the file/directory) or **# setfacl -b ** (to remove all ACLs from the file/directory). + +Only the owner assigned to the file or directory can set ACLs. (It's important to understand this before you, as the admin, take on Ansible to manage your ACLs.) There are also default ACLs, which control directory access; if a file inside a directory has no ACL, then the default ACL is applied. + + +``` +sudo setfacl -m d⭕rx Music +getfacl Music/ +# file: Music/ +# owner: root +# group: root +user::rwx +group::--- +other::--- +default:user::rwx +default:group::--- +default:other::r-x +``` + +### Enter Ansible + +So how can Ansible, in all its wisdom, tackle the task of applying permissions to users, files, directories, and more? Ansible can play nicely with ACLs, just as it does with a lot of features, utilities, APIs, etc. Ansible has an out-of-the-box [ACL module][3] that allows you to create playbooks/roles around granting a user access to a file, removing ACLs for users on a specific file, setting default ACLs for users on files, or obtaining ACLs on particular files. + +Anytime you are administering ACLs, you should use the best practice of "least privilege," meaning you should give a user access only to what they need to perform their role or execute a task, and no more. Restraint and minimizing the attack surface are critical. The more access extended, the higher the risk of unauthorized access to company assets. + +Here's an example Ansible playbook: + +![Ansible playbook][4] + +As an admin, automating ACL management demands that your Ansible playbooks can scale across your infrastructure to increase speed, improve efficiency, and reduce the time it takes to achieve your goals. There will be times when you need to determine the ACL for a specific file. This is essentially the same as using **getfacl ** in Linux. If you want to determine the ACLs of many, specific files, start with a playbook that looks like this: + + +``` +\--- +\- hosts: all +tasks: +\- name: obtain the acl for a specific file +acl: +path: /etc/logrotate.d +user_nfsv4_acls: true +register: acl_info +``` + +You can use the following playbook to set permissions on files/directories: + +![Ansible playbook][5] + +This playbook grants user access to a file: + + +``` +\- hosts: +become: yes +gather_facts: no +tasks: +\- name: Grant user Shirley read access to a file +acl: +path: /etc/foo.conf +entity: shirley +etype: user +permissions: r +state: present +``` + +And this playbook grants user access to a directory: + + +``` +\--- +\- hosts: all +become: yes +gather_facts: no +tasks: +\- name: setting permissions on directory and user +acl: +path: /path/to/scripts/directory +entity: "{{ item }}" +etype: user +permissions: rwx +state: present +loop: +\- www-data +\- root +``` + +### Security realized? + +Applying ACLs to files and users is a practice you should take seriously in your role as a DevOps engineer. Security best practices and formal compliance often get little or no attention. When you allow access to files with sensitive data, you are always risking that the data will be tampered with, stolen, or deleted. Therefore, data protection must be a focal point in your security strategy. Ansible can be part of your security automation strategy, as demonstrated here, and your ACL application is as good a place to start as any. + +Automating your security practices will, of course, go beyond just managing ACLs; it might also involve [SELinux][6] configuration, cryptography, security, and compliance. Remember that Ansible also allows you to define your systems for security, whether it's locking down users and groups (e.g., managing ACLs), setting firewall rules, or applying custom security policies. + +Your security strategy should start with a baseline plan. As a DevOps engineer or admin, you should examine the current security strategy (or the lack thereof), then chart your plan for automating security in your environment. + +### Conclusion + +Using Ansible to manage your ACLs as part of your overall security automation strategy depends on the size of both the company you work for and the infrastructure you manage. Permissions, users, and files can quickly get out of control, potentially placing your security in peril and putting the company in a position you definitely don't want to it be. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/manage-access-control-lists-ansible + +作者:[Taz Brown ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/heronthecli +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_container_block.png?itok=S8MbXEYw (Data container block with hexagons) +[2]: https://opensource.com/article/19/2/quickstart-guide-ansible +[3]: https://docs.ansible.com/ansible/latest/modules/acl_module.html +[4]: https://opensource.com/sites/default/files/images/acl.yml_.png (Ansible playbook) +[5]: https://opensource.com/sites/default/files/images/set_filedir_permissions.png (Ansible playbook) +[6]: https://opensource.com/article/18/8/cheat-sheet-selinux From 406f6d1f7c8a13d669e76540782319c706328121 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:18:35 +0800 Subject: [PATCH 0517/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190517=20HPE?= =?UTF-8?q?=20to=20buy=20Cray,=20offer=20HPC=20as=20a=20service=20sources/?= =?UTF-8?q?talk/20190517=20HPE=20to=20buy=20Cray,=20offer=20HPC=20as=20a?= =?UTF-8?q?=20service.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...HPE to buy Cray, offer HPC as a service.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md diff --git a/sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md b/sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md new file mode 100644 index 0000000000..a1dafef683 --- /dev/null +++ b/sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HPE to buy Cray, offer HPC as a service) +[#]: via: (https://www.networkworld.com/article/3396220/hpe-to-buy-cray-offer-hpc-as-a-service.html) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +HPE to buy Cray, offer HPC as a service +====== +High-performance computing offerings from HPE plus Cray could enable things like AI, ML, high-speed financial trading, creation digital twins for entire enterprise networks. +![Cray Inc.][1] + +HPE has agreed to buy supercomputer-maker Cray for $1.3 billion, a deal that the companies say will bring their corporate customers high-performance computing as a service to help with analytics needed for artificial intelligence and machine learning, but also products supporting high-performance storage, compute and software. + +In addition to bringing HPC capabilities that can blend with and expand HPE’s current products, Cray brings with it customers in government and academia that might be interested in HPE’s existing portfolio as well. + +**[ Now read:[Who's developing quantum computers][2] ]** + +The companies say they expect to close the cash deal by the end of next April. + +The HPC-as-a-service would be offered through [HPE GreenLake][3], the company’s public-, private-, hybrid-cloud service. Such a service could address periodic enterprise need for fast computing that might otherwise be too expensive, says Tim Zimmerman, an analyst with Gartner. + +Businesses could use the service, for example, to create [digital twins][4] of their entire networks and use them to test new code to see how it will impact the network before deploying it live, Zimmerman says. + +Cray has HPC technology that HPE Labs might be exploring on its own, but that can be brought to market in a much quicker timeframe. + +HPE says that overall, buying cray give it technologies needed for massively data-intensive workloads such as AI and ML that is used for engineering services, transaction-based trading by financial firms, pharmaceutical research and academic studies into weather and genomes, for instance, Zimmerman says. + +As HPE puts it, Cray supercomputing platforms “have the ability to handle massive data sets, converged modelling, simulation, AI and analytics workloads.” + +Cray is working on [what it says will be the world’s fastest supercomputer][5] when it’s finished in 2021, cranking out 1.5 exaflops. The current fastest supercomputer is 143.5 petaflops. [Click [here][6] to see the current top 10 fastest supercomputers.] + +In general, HPE says it hopes to create a comprehensive line of products to support HPC infrastructure including “compute, high-performance storage, system interconnects, software and services.” + +Together, the talent in the two companies and their combined technologies should be able to increase innovation, HPE says. + +Earlier this month, HPE’s CEO Antonio Neri said in [an interview with _Network World_][7] that the company will be investing $4 billion over four years in a range of technology to boost “connectivity, security, and obviously cloud and analytics.” In laying out the company’s roadmap he made no specific mention of HPC. + +HPE net revenues last fiscal year were $30.9 billion. Cray’s total revenue was $456 million, with a gross profit of $130 million. + +The acquisition will pay $35 per share for Cray stock. + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396220/hpe-to-buy-cray-offer-hpc-as-a-service.html + +作者:[Tim Greene][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/06/the_cray_xc30_piz_daint_system_at_the_swiss_national_supercomputing_centre_via_cray_inc_3x2_978x652-100762113-large.jpg +[2]: https://www.networkworld.com/article/3275385/who-s-developing-quantum-computers.html +[3]: https://www.networkworld.com/article/3280996/hpe-adds-greenlake-hybrid-cloud-to-enterprise-service-offerings.html +[4]: https://www.networkworld.com/article/3280225/what-is-digital-twin-technology-and-why-it-matters.html +[5]: https://www.networkworld.com/article/3373539/doe-plans-worlds-fastest-supercomputer.html +[6]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html +[7]: https://www.networkworld.com/article/3394879/hpe-s-ceo-lays-out-his-technology-vision.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From d3da7124905f7feafe3deaa8c02da3bfab0babfb Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:19:00 +0800 Subject: [PATCH 0518/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190517=20The?= =?UTF-8?q?=20modern=20data=20center=20and=20the=20rise=20in=20open-source?= =?UTF-8?q?=20IP=20routing=20suites=20sources/talk/20190517=20The=20modern?= =?UTF-8?q?=20data=20center=20and=20the=20rise=20in=20open-source=20IP=20r?= =?UTF-8?q?outing=20suites.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e rise in open-source IP routing suites.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md diff --git a/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md b/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md new file mode 100644 index 0000000000..02063687a0 --- /dev/null +++ b/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The modern data center and the rise in open-source IP routing suites) +[#]: via: (https://www.networkworld.com/article/3396136/the-modern-data-center-and-the-rise-in-open-source-ip-routing-suites.html) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +The modern data center and the rise in open-source IP routing suites +====== +Open source enables passionate people to come together and fabricate work of phenomenal quality. This is in contrast to a single vendor doing everything. +![fdecomite \(CC BY 2.0\)][1] + +As the cloud service providers and search engines started with the structuring process of their business, they quickly ran into the problems of managing the networking equipment. Ultimately, after a few rounds of getting the network vendors to understand their problems, these hyperscale network operators revolted. + +Primarily, what the operators were looking for was a level of control in managing their network which the network vendors couldn’t offer. The revolution burned the path that introduced open networking, and network disaggregation to the work of networking. Let us first learn about disaggregation followed by open networking. + +### Disaggregation + +The concept of network disaggregation involves breaking-up of the vertical networking landscape into individual pieces, where each piece can be used in the best way possible. The hardware can be separated from the software, along with open or closed IP routing suites. This enables the network operators to use the best of breed for the hardware, software and the applications. + +**[ Now see[7 free network tools you must have][2]. ]** + +Networking has always been built as an appliance and not as a platform. The mindset is that the network vendor builds an appliance and as a specialized appliance, they will completely control what you can and cannot do on that box. In plain words, they will not enable anything that is not theirs. As a result, they act as gatekeepers and not gate-enablers. + +Network disaggregation empowers the network operators with the ability to lay hands on the features they need when they need them. However, this is impossible in case of non-disaggregated hardware. + +### Disaggregation leads to using best-of-breed + +In the traditional vertically integrated networking market, you’re forced to live with the software because you like the hardware, or vice-versa. But network disaggregation drives different people to develop things that matter to them. This allows multiple groups of people to connect, with each one focused on doing what he or she does the best. Switching silicon manufacturers can provide the best merchant silicon. Routing suites can be provided by those who are the best at that. And the OS vendors can provide the glue that enables all of these to work well together. + +With disaggregation, people are driven to do what they are good at. One company does the hardware, whereas another does the software and other company does the IP routing suites. Hence, today the networking world looks like more of the server world. + +### Open source + +Within this rise of the modern data center, there is another element that is driving network disaggregation; the notion of open source. Open source is “denoting software for which the original source code is made freely available, it may be redistributed and modified.” It enables passionate people to come together and fabricate work of phenomenal quality. This is in contrast to a single vendor doing everything. + +As a matter of fact, the networking world has always been very vendor driven. However, the advent of open source gives the opportunity to like-minded people rather than the vendor controlling the features. This eliminates the element of vendor lock-in, thereby enabling interesting work. Open source allows more than one company to be involved. + +### Open source in the data center + +The traditional enterprise and data center networks were primarily designed by bridging and Spanning Tree Protocol (STP). However, the modern data center is driven by IP routing and the CLOS topology. As a result, you need a strong IP routing suite. + +That was the point where the need for an open-source routing suite surfaced, the suite that can help drive the modern data center. The primary open-source routing suites are [FRRouting (FRR)][3], BIRD, GoBGP and ExaBGP. + +Open-source IP routing protocol suites are slowly but steadily gaining acceptance and are used in data centers of various sizes. Why? It is because they allow a community of developers and users to work on finding solutions to common problems. Open-source IP routing protocol suites equip them to develop the specific features that they need. It also helps the network operators to create simple designs that make sense to them, as opposed to having everything controlled by the vendor. They also enable routing suites to run on compute nodes. Kubernetes among others uses this model of running a routing protocol on a compute node. + +Today many startups are using FRR. Out of all of the IP routing suites, FRR is preferred in the data center as the primary open-source IP routing protocol suite. Some traditional network vendors have even demonstrated the use of FRR on their networking gear. + +There are lots of new features currently being developed for FRR, not just by the developers but also by the network operators. + +### Use cases for open-source routing suites + +When it comes to use-cases, where do IP routing protocol suites sit? First and foremost, if you want to do any type of routing in the disaggregated network world, you need an IP routing suite. + +Some operators are using FRR at the edge of the network as well, thereby receiving full BGP feeds. Many solutions which use Intel’s DPDK for packet forwarding use FRR as the control plane, receiving full BGP feeds. In addition, there are other vendors using FRR as the core IP routing suite for a full leaf and spine data center architecture. You can even get a version of FRR on pfSense which is a free and open source firewall. + +We need to keep in mind that reference implementations are important. Open source allows you to test at scale. But vendors don’t allow you to do that. However, with FRR, we have the ability to spin up virtual machines (VMs) or even containers by using software like Vagrant to test your network. Some vendors do offer software versions, but they are not fully feature-compatible. + +Also, with open source you do not need to wait. This empowers you with flexibility and speed which drives the modern data center. + +### Deep dive on FRRouting (FRR) + +FRR is a Linux foundation project. In a technical Linux sense, FRR is a group of daemons that work together, providing a complete routing suite that includes BGP, IS-IS, LDP, OSPF, BFD, PIM, and RIP. + +Each one of these daemons communicate with the common routing information base (RIB) daemon called Zebra in order to interface with the OS and to resolve conflicts between the multiple routing protocols providing the same information. Interfacing with the OS is used to receive the link up/down events, to add and delete routes etc. + +### FRRouting (FRR) components: Zebra + +Zebra is the RIB of the routing systems. It knows everything about the state of the system relevant to routing and is able to pass and disseminate this information to all the interested parties. + +The RIB in FRR acts just like a traditional RIB. When a route wins, it goes into the Linux kernel data plane where the forwarding occurs. All of the routing protocols run as separate processes and each of them have their source code in FRR. + +For example, when BGP starts up, it needs to know, for instance, what kind of virtual routing and forwarding (VRF) and IP interfaces are available. Zebra collects and passes this information back to the interested daemons. It passes all the relevant information about state of the machine. + +Furthermore, you can also register information with Zebra. For example, if a particular route changes, the daemon can be informed. This can also be used for reverse path forwarding (RPF). FRR doesn't need to do a pull when changes happen on the network. + +There are a myriad of ways through which you can control Linux and the state. Sometimes you have to use options like the Netlink bus and sometimes you may need to read the state in proc file system of Linux. The goal of Zebra is to gather all this data for the upper level protocols. + +### FRR supports remote data planes + +FRR also has the ability to manage the remote data planes. So, what does this mean? Typically, the data forwarding plane and the routing protocols run on the same box. Another model, adopted by Openflow and SDN for example, is one in which the data forwarding plane can be on one box while FRR runs on a different box on behalf of the first box and pushes the computed routing state on the first box. In other words, the data plane and the control plane run on different boxes. + +If you examine the traditional world, it’s like having one large chassis with different line cards with the ability to install routes in those different line cards. FRR operates with the same model which has one control plane and the capability to offer 3 boxes, if needed. It does this via the forwarding plane manager. + +### Forwarding plane manager + +Zebra can either install routes directly into the data plane of the box it is running on or use a forwarding plane manager to install routes on a remote box. When it installs a route, the forwarding plane manager abstracts the data which displays the route and the next hops. It then pushes the data to a remote system where the remote machine processes it and programs the ASIC appropriately. + +After the data is abstracted, you can use whatever protocol you want in order to push the data to the remote machine. You can even include the data in an email. + +### What is holding people back from open source? + +Since last 30 years the networking world meant that you need to go to a vendor to solve a problem. But now with open-source routing suites, such as, FRR, there is a major drift in the mindset as to how you approach troubleshooting. + +This causes the fear of not being able to use it properly because with open source you are the one who has to fix it. This at first can be scary and daunting. But it doesn’t necessarily have to be. Also, to switch to FRR on a traditional network gear, you need the vendor to enable it, but they may be reluctant as they are on competing platforms which can be another road blocker. + +### The future of FRR + +If we examine FRR from the use case perspective of the data center, FRR is feature-complete. Anyone building an IP based data center FRR has everything available. The latest 7.0 release of FRR adds Yang/NetConf, BGP Enhancements and OpenFabric. + +FRR is not just about providing features, boosting the performance or being the same as or better than the traditional network vendor’s software, it is also about simplifying the process for the end user. + +Since the modern data center is focused on automation and ease of use, FRR has made such progress that the vendors have not caught up with. FRR is very automation friendly. For example, FRR takes BGP and makes it automation-friendly without having to change the protocol. It supports BGP unnumbered that is unmatched by any other vendor suite. This is where the vendors are trying to catch up. + +Also, while troubleshooting, FRR shows peer’s and host’s names and not just the IP addresses. This allows you to understand without having spent much time. However, vendors show the peer’s IP addresses which can be daunting when you need to troubleshoot. + +FRR provides the features that you need to run an efficient network and data center. It makes easier to configure and manage the IP routing suite. Vendors just add keep adding features over features whether they are significant or not. Then you need to travel the certification paths that teach you how to twiddle 20 million nobs. How many of those networks are robust and stable? + +FRR is about supporting features that matter and not every imaginable feature. FRR is an open source project that brings like-minded people together, good work that is offered isn’t turned away. As a case in point, FRR has an open source implementation of EIGRP. + +The problem surfaces when you see a bunch of things, you think you need them. But in reality, you should try to keep the network as simple as possible. FRR is laser-focused on the ease of use and simplifying the use rather than implementing features that are mostly not needed to drive the modern data center. + +For more information and to contribute, why not join the [FRR][4] [mailing list group][4]. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][5]** + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396136/the-modern-data-center-and-the-rise-in-open-source-ip-routing-suites.html + +作者:[Matt Conran][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/Matt-Conran/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/12/modular_humanoid_polyhedra_connections_structure_building_networking_by_fdecomite_cc_by_2-0_via_flickr_1200x800-100782334-large.jpg +[2]: https://www.networkworld.com/article/2825879/7-free-open-source-network-monitoring-tools.html +[3]: https://frrouting.org/community/7.0-launch.html +[4]: https://frrouting.org/#participate +[5]: /contributor-network/signup.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 5280040401a0eea1e7bd6ed3c81af514849c3e0c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:20:44 +0800 Subject: [PATCH 0519/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20Will?= =?UTF-8?q?=205G=20be=20the=20first=20carbon-neutral=20network=3F=20source?= =?UTF-8?q?s/talk/20190516=20Will=205G=20be=20the=20first=20carbon-neutral?= =?UTF-8?q?=20network.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 5G be the first carbon-neutral network.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/talk/20190516 Will 5G be the first carbon-neutral network.md diff --git a/sources/talk/20190516 Will 5G be the first carbon-neutral network.md b/sources/talk/20190516 Will 5G be the first carbon-neutral network.md new file mode 100644 index 0000000000..decacfac5d --- /dev/null +++ b/sources/talk/20190516 Will 5G be the first carbon-neutral network.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Will 5G be the first carbon-neutral network?) +[#]: via: (https://www.networkworld.com/article/3395465/will-5g-be-the-first-carbon-neutral-network.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Will 5G be the first carbon-neutral network? +====== +Increased energy consumption in new wireless networks could become ecologically unsustainable. Engineers think they have solutions that apply to 5G, but all is not certain. +![Dushesina/Getty Images][1] + +If wireless networks transfer 1,000 times more data, does that mean they will use 1,000 times more energy? It probably would with the old 4G LTE wireless technologies— LTE doesn’t have much of a sleep-standby. But with 5G, we might have a more energy-efficient option. + +More customers want Earth-friendly options, and engineers are now working on how to achieve it — meaning 5G might introduce the first zero-carbon networks. It’s not all certain, though. + +**[ Related:[What is 5G wireless? And how it will change networking as we know it][2] ]** + +“When the 4G technology for wireless communication was developed, not many people thought about how much energy is consumed in transmitting bits of information,” says Emil Björnson, associate professor of communication systems at Linkoping University, [in an article on the school’s website][3]. + +Standby was never built into 4G, Björnson explains. Reasons include overbuilding — the architects wanted to ensure connections didn’t fail, so they just kept the power up. The downside to that redundancy was that almost the same amount of energy is used whether the system is transmitting data or not. + +“We now know that this is not necessary,” Björnson says. 5G networks don’t use much power during periods of low traffic, and that reduces power consumption. + +Björnson says he knows how to make future-networks — those 5G networks that one day may become the enterprise broadband replacement — super efficient even when there is heavy use. Massive-MIMO (multiple-in, multiple-out) antennas are the answer, he says. That’s hundreds of connected antennas taking advantage of multipath. + +I’ve written before about some of Björnson's Massive-MIMO ideas. He thinks [Massive-MIMO will remove all capacity ceilings from wireless networks][4]. However, he now adds calculations to his research that he claims prove that the Massive-MIMO antenna technology will also reduce power use. He and his group are actively promoting their academic theories in a paper ([pdf][5]). + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** + +### Nokia's plan to reduce wireless networks' CO2 emissions + +Björnson's isn’t the only 5G-aimed eco-concept out there. Nokia points out that it isn't just radios transmitting that use electricity. Cooling is actually the main electricity hog, says the telcommunications company, which is one of the world’s principal manufacturers of mobile network equipment. + +Nokia says the global energy cost of Radio Access Networks (RANs) in 2016 (the last year numbers were available), which includes base transceiver stations (BTSs) needed by mobile networks, was around $80 billion. That figure increases with more users coming on stream, something that’s probable. Of the BTS’s electricity use, about 90% “converts to waste heat,” [Harry Kuosa, a marketing executive, writes on Nokia’s blog][7]. And base station sites account for about 80% of a mobile network’s entire energy use, Nokia expands on its website. + +“A thousand-times more traffic that creates a thousand-times higher energy costs is unsustainable,” Nokia says in its [ebook][8] on the subject, “Turning the zero carbon vision into business opportunity,” and it’s why Nokia plans liquid-cooled 5G base stations among other things, including chip improvements. It says the liquid-cooling can reduce CO2 emissions by up to 80%. + +### Will those ideas work? + +Not all agree power consumption can be reduced when implementing 5G, though. Gabriel Brown of Heavy Reading, quotes [in a tweet][9] a China Mobile executive as saying that 5G BTSs will use three times as much power as 4G LTE ones because the higher frequencies used in 5G mean one needs more BTS units to provide the same geographic coverage: For physics reasons, higher frequencies equals shorter range. + +If, as is projected, 5G develops into the new enterprise broadband for the internet of things (IoT), along with associated private networks covering everything else, then these eco- and cost-important questions are going to be salient — and they need answers quickly. 5G will soon be here, and [Gartner estimates that 60% of organizations will adopt it][10]. + +**More about 5G networks:** + + * [How enterprises can prep for 5G networks][11] + * [5G vs 4G: How speed, latency and apps support differ][12] + * [Private 5G networks are coming][13] + * [5G and 6G wireless have security issues][14] + * [How millimeter-wave wireless could help support 5G and IoT][15] + + + +Join the Network World communities on [Facebook][16] and [LinkedIn][17] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395465/will-5g-be-the-first-carbon-neutral-network.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.idgesg.net/images/article/2019/01/4g-versus-5g_horizon_sunrise-100784230-large.jpg +[2]: https://www.networkworld.com/article/3203489/lan-wan/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html +[3]: https://liu.se/en/news-item/okningen-av-mobildata-kraver-energieffektivare-nat +[4]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html +[5]: https://arxiv.org/pdf/1812.01688.pdf +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.nokia.com/blog/nokia-has-ambitious-plans-reduce-network-power-consumption/ +[8]: https://pages.nokia.com/2364.Zero.Emissions.ebook.html?did=d000000001af&utm_campaign=5g_in_action_&utm_source=twitter&utm_medium=organic&utm_term=0dbf430c-1c94-47d7-8961-edc4f0ba3270 +[9]: https://twitter.com/Gabeuk/status/1099709788676636672?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1099709788676636672&ref_url=https%3A%2F%2Fwww.lightreading.com%2Fmobile%2F5g%2Fpower-consumption-5g-basestations-are-hungry-hungry-hippos%2Fd%2Fd-id%2F749979 +[10]: https://www.gartner.com/en/newsroom/press-releases/2018-12-18-gartner-survey-reveals-two-thirds-of-organizations-in +[11]: https://www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html +[12]: https://www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[13]: https://www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html +[14]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html +[15]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[16]: https://www.facebook.com/NetworkWorld/ +[17]: https://www.linkedin.com/company/network-world From d84d3f59358b75a0435eb7a20e9a751bba9ecffa Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:21:01 +0800 Subject: [PATCH 0520/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190515=20IBM?= =?UTF-8?q?=20overhauls=20mainframe-software=20pricing,=20adds=20hybrid,?= =?UTF-8?q?=20private-cloud=20services=20sources/talk/20190515=20IBM=20ove?= =?UTF-8?q?rhauls=20mainframe-software=20pricing,=20adds=20hybrid,=20priva?= =?UTF-8?q?te-cloud=20services.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng, adds hybrid, private-cloud services.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md diff --git a/sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md b/sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md new file mode 100644 index 0000000000..b69109641d --- /dev/null +++ b/sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services) +[#]: via: (https://www.networkworld.com/article/3395776/ibm-overhauls-mainframe-software-pricing-adds-hybrid-private-cloud-services.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services +====== +IBM brings cloud consumption model to the mainframe, adds Docker container extensions +![Thinkstock][1] + +IBM continues to adopt new tools and practices for its mainframe customers to keep the Big Iron relevant in a cloud world. + +First of all, the company switched-up its 20-year mainframe software pricing scheme to make it more palatable to hybrid and multicloud users who might be thinking of moving workloads off the mainframe and into the cloud. + +**[ Check out[What is hybrid cloud computing][2] and learn [what you need to know about multi-cloud][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +Specifically IBM rolled out Tailored Fit Pricing for the IBM Z mainframe which offers two consumption-based pricing models that can help customers cope with ever-changing workload – and hence software – costs. + +Tailored Fit Pricing removes the need for complex and restrictive capping, which typically weakens responsiveness and can impact service level availability, IBM said. IBM’s standard monthly mainframe licensing model calculates costs as a “rolling four-hour average” (R4HA) which would determine cost based on a customer’s peak usage during the month. Customers would many time cap usage to keep costs down, experts said + +Systems can now be configured to support optimal response times and service level agreements, rather than artificially slowing down workloads to manage software licensing costs, IBM stated. + +Predicting demand for IT services can be a major challenge and in the era of hybrid and multicloud, everything is connected and workload patterns constantly change, wrote IBM’s Ross Mauri, General Manager, IBM Z in a [blog][5] about the new pricing and services. “In this environment, managing demand for IT services can be a major challenge. As more customers shift to an enterprise IT model that incorporates on-premises, private cloud and public we’ve developed a simple cloud pricing model to drive the transformation forward.” + +[Tailored Fit Pricing][6] for IBM Z comes in two flavors, the Enterprise Consumption Solution and the Enterprise Capacity Solution. + +IBM said the Enterprise Consumption model is a tailored usage-based pricing model, where customers pay only for what they use, removing the need for complex and restrictive capping, IBM said. + +The Enterprise Capacity model lets customers mix and match workloads to help maximize use of the full capacity of the platform. Charges are referenced to the overall size of the physical environment and are calculated based on the estimated mix of workloads running, while providing the flexibility to vary actual usage across workloads, IBM said. + +The software pricing changes should be a welcome benefit to customers, experts said. + +“By making access to Z mainframes more flexible and ‘cloud-like,’ IBM is making it less likely that customers will consider shifting Z workloads to other systems and environments. As cloud providers become increasingly able to support mission critical applications, that’s a big deal,” wrote Charles King, president and principal analyst for Pund-IT in a [blog][7] about the IBM changes. + +“A notable point about both models is that discounted growth pricing is offered on all workloads – whether they be 40-year old Assembler programs or 4-day old JavaScript apps. This is in contrast to previous models which primarily rewarded only brand-new applications with growth pricing. By thinking outside the Big Iron box, the company has substantially eased the pain for its largest clients’ biggest mainframe-related headaches,” King wrote. + +IBM’s Tailored Fit Pricing supports an increasing number of enterprises that want to continue to grow and build new services on top of this mission-critical platform, wrote [John McKenny][8] vice president of strategy for ZSolutions Optimization at BMC Software. “In not yet released results from the 2019 BMC State of the Mainframe Survey, 62% of the survey respondents reported that they are planning to expand MIPS/MSU consumption and are growing their mainframe workloads. For customers with no current plans for growth, the affordability and cost-competitiveness of the new pricing model will re-ignite interest in also using this platform as an integral part of their hybrid cloud strategies.” + +In addition to the pricing, IBM announced some new services that bring the mainframe closer to cloud workloads. + +First, IBM rolled out z/OS Container Extensions (zCX), which makes it possible to run Linux on Z applications that are packaged as Docker Container images on z/OS. Application developers can develop and data centers can operate popular open source packages, Linux applications, IBM software, and third-party software together with z/OS applications and data, IBM said. zCX will let customers use the latest open source tools, popular NoSQL databases, analytics frameworks, application servers, and so on within the z/OS environment. + +“With z/OS Container Extensions, customers will be able to access the most recent development tools and processes available in Linux on the Z ecosystem, giving developers the flexibility to build new, cloud-native containerized apps and deploy them on z/OS without requiring Linux or a Linux partition,” IBM’s Mauri stated. + +Big Blue also rolled out z/OS Cloud Broker which will let customers access and deploy z/OS resources and services on [IBM Cloud Private][9]. [IBM Cloud Private][10] is the company’s Kubernetes-based Platform as a Service (PaaS) environment for developing and managing containerized applications. IBM said z/OS Cloud Broker is designed to help cloud application developers more easily provision and deprovision apps in z/OS environments. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395776/ibm-overhauls-mainframe-software-pricing-adds-hybrid-private-cloud-services.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2015/08/thinkstockphotos-520137237-100610459-large.jpg +[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html +[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.ibm.com/blogs/systems/ibm-z-defines-the-future-of-hybrid-cloud/ +[6]: https://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=AN&subtype=CA&htmlfid=897/ENUS219-014&appname=USN +[7]: https://www.pund-it.com/blog/ibm-reinvents-the-z-mainframe-again/ +[8]: https://www.bmc.com/blogs/bmc-supports-ibm-tailored-fit-pricing-ibm-z/ +[9]: https://www.ibm.com/marketplace/cloud-private-on-z-and-linuxone +[10]: https://www.networkworld.com/article/3340043/ibm-marries-on-premises-private-and-public-cloud-data.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From e6678516cdc50b4c2aac712d0e2ea51481e89ab5 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:21:32 +0800 Subject: [PATCH 0521/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190515=20Extr?= =?UTF-8?q?eme=20addresses=20networked-IoT=20security=20sources/talk/20190?= =?UTF-8?q?515=20Extreme=20addresses=20networked-IoT=20security.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...xtreme addresses networked-IoT security.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/talk/20190515 Extreme addresses networked-IoT security.md diff --git a/sources/talk/20190515 Extreme addresses networked-IoT security.md b/sources/talk/20190515 Extreme addresses networked-IoT security.md new file mode 100644 index 0000000000..1ad756eded --- /dev/null +++ b/sources/talk/20190515 Extreme addresses networked-IoT security.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Extreme addresses networked-IoT security) +[#]: via: (https://www.networkworld.com/article/3395539/extreme-addresses-networked-iot-security.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Extreme addresses networked-IoT security +====== +The ExtremeAI security app features machine learning that can understand typical behavior of IoT devices and alert when it finds anomalies. +![Getty Images][1] + +[Extreme Networks][2] has taken the wraps off a new security application it says will use machine learning and artificial intelligence to help customers effectively monitor, detect and automatically remediate security issues with networked IoT devices. + +The application – ExtremeAI security—features machine-learning technology that can understand typical behavior of IoT devices and automatically trigger alerts when endpoints act in unusual or unexpected ways, Extreme said. + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][3] + * [Edge computing best practices][4] + * [How edge computing can help secure the IoT][5] + + + +Extreme said that the ExtremeAI Security application can tie into all leading threat intelligence feeds, and had close integration with its existing [Extreme Workflow Composer][6] to enable automatic threat mitigation and remediation. + +The application integrates the company’s ExtremeAnalytics application which lets customers view threats by severity, category, high-risk endpoints and geography. An automated ticketing feature integrates with variety of popular IT tools such as Slack, Jira, and ServiceNow, and the application interoperates with many popular security tools, including existing network taps, the vendor stated. + +There has been an explosion of new endpoints ranging from million-dollar smart MRI machines to five-dollar sensors, which creates a complex and difficult job for network and security administrators, said Abby Strong, vice president of product marketing for Extreme. “We need smarter, secure and more self-healing networks especially where IT cybersecurity resources are stretched to the limit.” + +Extreme is trying to address an issue that is important to enterprise-networking customers: how to get actionable, usable insights as close to real-time as possible, said Rohit Mehra, Vice President of Network Infrastructure at IDC. “Extreme is melding automation, analytics and security that can look at network traffic patterns and allow the system to take action when needed.” + +The ExtremeAI application, which will be available in October, is but one layer of IoT security Extreme offers. Already on the market, its [Defender for IoT][7] package, which includes a Defender application and adapter, lets customers monitor, set policies and isolate IoT devices across an enterprise. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][8] ]** + +The Extreme AI and Defender packages are now part of what the company calls Extreme Elements, which is a menu of its new and existing Smart OmniEdge, Automated Campus and Agile Data Center software, hardware and services that customers can order to build a manageable, secure system. + +Aside from the applications, the Elements include Extreme Management Center, the company’s network management software; the company’s x86-based intelligent appliances, including the ExtremeCloud Appliance; and [ExtremeSwitching X465 premium][9], a stackable multi-rate gigabit Ethernet switch. + +The switch and applications are just the beginning of a very busy time for Extreme. In its [3Q earnings cal][10]l this month company CEO Ed Meyercord noted Extreme was in the “early stages of refreshing 70 percent of our products” and seven different products will become generally available this quarter – a record for Extreme, he said. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395539/extreme-addresses-networked-iot-security.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/iot_security_tablet_conference_digital-100787102-large.jpg +[2]: https://www.networkworld.com/article/3289508/extreme-facing-challenges-girds-for-future-networking-battles.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[5]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[6]: https://www.extremenetworks.com/product/workflow-composer/ +[7]: https://www.extremenetworks.com/product/extreme-defender-for-iot/ +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[9]: https://community.extremenetworks.com/extremeswitching-exos-223284/extremexos-30-2-and-smart-omniedge-premium-x465-switches-are-now-available-7823377 +[10]: https://seekingalpha.com/news/3457137-extreme-networks-minus-15-percent-quarterly-miss-light-guidance +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From b855033e8c1aa53187aa753efed44cd3c5794084 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:22:48 +0800 Subject: [PATCH 0522/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190514=20Las?= =?UTF-8?q?=20Vegas=20targets=20transport,=20public=20safety=20with=20IoT?= =?UTF-8?q?=20deployments=20sources/talk/20190514=20Las=20Vegas=20targets?= =?UTF-8?q?=20transport,=20public=20safety=20with=20IoT=20deployments.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ort, public safety with IoT deployments.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md diff --git a/sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md b/sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md new file mode 100644 index 0000000000..84a563c8bc --- /dev/null +++ b/sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Las Vegas targets transport, public safety with IoT deployments) +[#]: via: (https://www.networkworld.com/article/3395536/las-vegas-targets-transport-public-safety-with-iot-deployments.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Las Vegas targets transport, public safety with IoT deployments +====== + +![Franck V. \(CC0\)][1] + +The city of Las Vegas’ pilot program with NTT and Dell, designed to crack down on wrong-way driving on municipal roads, is just part of the big plans that Sin City has for leveraging IoT tech in the future, according to the city's director of technology Michael Sherwood, who sat down with Network World at the IoT World conference in Silicon Valley this week. + +The system uses smart cameras and does most of its processing at the edge, according to Sherwood. The only information that gets sent back to the city’s private cloud is metadata – aggregated information about overall patterns, for decision-making and targeting purposes, not data about individual traffic incidents and wrong-way drivers. + +**[ Also see[What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3].]** + +It’s an important public safety consideration, he said, but it’s a small part of the larger IoT-enabled framework that the city envisions for the future. + +“Our goal is to make our data open to the public, not only for transparency purposes, but to help spur development and create new applications to make Vegas a better place to live,” said Sherwood. + +[The city’s public data repository][4] already boasts a range of relevant data, some IoT-generated, some not. And efforts to make that data store more open have already begun to bear fruit, according to Sherwood. For example, one hackathon about a year ago resulted in an Alexa app that tells users how many traffic lights are out, by tracking energy usage data via the city’s portal, among other applications. + +As with IoT in general, Sherwood said that the city’s efforts have been bolstered by an influx of operational talen. Rather than additional IT staff to run the new systems, they’ve brought in experts from the traffic department to help get the most out of the framework. + +Another idea for leveraging the city’s traffic data involves tracking the status of the curb. Given the rise of Uber and Lyft and other on-demand transportation services, linking a piece of camera-generated information like “rideshares are parked along both sides of this street” directly into a navigation app could help truck drivers avoid gridlock. + +“We’re really looking to make the roads a living source of information,” Sherwood said. + +**Safer parks** + +Las Vegas is also pursuing related public safety initiatives. One pilot project aims to make public parks safer by installing infrared cameras so authorities can tell whether people are in parks after hours without incurring undue privacy concerns, given that facial recognition is very tricky in infrared. + +It’s the test-and-see method of IoT development, according to Sherwood. + +“That’s a way of starting with an IoT project: start with one park. The cost to do something like this is not astronomical, and it allows you to gauge some other information from it,” he said. + +The city has also worked to keep the costs of these projects low or even show a returnon investment, Sherwood added. Workforce development programs could train municipal workers to do simple maintenance on smart cameras in parks or along roadways, and the economic gains made from the successful use of the systems ought to outweigh deployment and operational outlay. + +“If it’s doing it’s job, those efficiencies should cover the system’s cost,” he said. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395536/las-vegas-targets-transport-public-safety-with-iot-deployments.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/07/pedestrian-walk-sign_go_start_begin_traffic-light_by-franck-v-unsplaash-100765089-large.jpg +[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://opendata.lasvegasnevada.gov/ +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From d2d3754d49c7fb54db301140e6bb162f517a5abe Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:23:13 +0800 Subject: [PATCH 0523/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190514=20Bril?= =?UTF-8?q?lio=20and=20Blue=20Planet=20Partner=20to=20Bring=20Network=20Au?= =?UTF-8?q?tomation=20to=20the=20Enterprise=20sources/talk/20190514=20Bril?= =?UTF-8?q?lio=20and=20Blue=20Planet=20Partner=20to=20Bring=20Network=20Au?= =?UTF-8?q?tomation=20to=20the=20Enterprise.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng Network Automation to the Enterprise.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md diff --git a/sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md b/sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md new file mode 100644 index 0000000000..e821405199 --- /dev/null +++ b/sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise) +[#]: via: (https://www.networkworld.com/article/3394687/brillio-and-blue-planet-partner-to-bring-network-automation-to-the-enterprise.html) +[#]: author: (Rick Hamilton, Senior Vice President, Blue Planet Software ) + +Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise +====== +Rick Hamilton, senior vice president of Blue Planet, a division of Ciena, explains how partnering with Brillio brings the next generation of network capabilities to enterprises—just when they need it most. +![Kritchanut][1] + +![][2] + +_Rick Hamilton, senior vice president of Blue Planet, a division of Ciena, explains how partnering with Brillio brings the next generation of network capabilities to enterprises—just when they need it most._ + +In February 2019, we announced that Blue Planet was evolving into a more independent division, helping us increase our focus on innovative intelligent automation solutions that help our enterprise and service provider customers accelerate and achieve their business transformation goals. + +Today we’re excited to make another leap forward in delivering these benefits to enterprises of all types via our partnership with digital transformation services and solutions leader Brillio. Together, we are co-creating intelligent cloud and network management solutions that increase service visibility and improve service assurance by effectively leveraging the convergence of cloud, IoT, and AI. + +**Accelerating digital transformation in the enterprise** + +Enterprises continue to look toward cloud services to create new and incremental revenue streams based on innovative solution offerings and on-demand product/solution delivery models, and to optimize their infrastructure investments. In fact, Gartner predicts that enterprise IT spending for cloud-based offerings will continue to grow faster than non-cloud IT offerings, making up 28% of spending by 2022, up from 19% in 2018. + +As enterprises adopt cloud, they realize there are many challenges associated with traditional approaches to operating and managing complex and hybrid multi-cloud environments. Our partnership with Brillio enables us to help these organizations across industries such as manufacturing, logistics, retail, and financial services meet their technical and business needs with high-impact solutions that improve customer experiences, drive operational efficiencies, and improve quality of service. + +This is achieved by combining the Blue Planet intelligent automation platform and the Brillio CLIP™services delivery excellence platform and user-centered design (UCD) lead solution framework. Together, we offer end-to-end visibility of application and infrastructure assets in a hybrid multi-cloud environment and provide service assurance and self-healing capabilities that improve network and service availability. + +**Partnering on research and development** + +Brillio will also partner with Blue Planet on longer-term R&D efforts. As one of a preferred product engineering services providers, Brillio will work closely with our engineering team to develop and deliver network intelligence and automation solutions to help enterprises build dynamic, programmable infrastructure that leverage analytics and automation to realize the Adaptive Network vision. + +Of course, a partnership like this is a two-way street, and we consider Brillio’s choice to work with us to be a testament to our expertise, vision, and execution. In the words of Brillio Chairman and CEO Raj Mamodia, “Blue Planet’s experience in end-to-end service orchestration coupled with Brillio’s expertise in cloudification, user-centered enterprise solutions design, and rapid software development delivers distinct advantages to the industry. Through integration of technologies like cloud, IoT, and AI into our combined solutions, our partnership spurs greater innovation and helps us address the large and growing enterprise networking automation market.” + +Co-creating intelligent hybrid cloud and network management solutions with Brillio is key to advancing enterprise digital transformation initiatives. Partnering with Brillio helps us address the plethora of challenges facing enterprises today on their digital journey. Our partnership enables Blue Planet to achieve faster time-to-market and greater efficiency in developing new solutions to enable enterprises to continue to thrive and grow. + +[Learn more about Blue Planet here][3] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394687/brillio-and-blue-planet-partner-to-bring-network-automation-to-the-enterprise.html + +作者:[Rick Hamilton, Senior Vice President, Blue Planet Software][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-952625346-100796314-large.jpg +[2]: https://images.idgesg.net/images/article/2019/05/rick-100796315-small.jpg +[3]: https://www.blueplanet.com/?utm_campaign=X1058319&utm_source=NWW&utm_term=BPWeb_Brillio&utm_medium=sponsoredpost3Q19 From dc706e33bf99540607430dd42c7302e400c8590c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:23:23 +0800 Subject: [PATCH 0524/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190514=20Mobi?= =?UTF-8?q?lity=20and=20SD-WAN,=20Part=201:=20SD-WAN=20with=204G=20LTE=20i?= =?UTF-8?q?s=20a=20Reality=20sources/talk/20190514=20Mobility=20and=20SD-W?= =?UTF-8?q?AN,=20Part=201-=20SD-WAN=20with=204G=20LTE=20is=20a=20Reality.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Part 1- SD-WAN with 4G LTE is a Reality.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md diff --git a/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md b/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md new file mode 100644 index 0000000000..1ecd68fa41 --- /dev/null +++ b/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mobility and SD-WAN, Part 1: SD-WAN with 4G LTE is a Reality) +[#]: via: (https://www.networkworld.com/article/3394866/mobility-and-sd-wan-part-1-sd-wan-with-4g-lte-is-a-reality.html) +[#]: author: (Francisca Segovia ) + +Mobility and SD-WAN, Part 1: SD-WAN with 4G LTE is a Reality +====== + +![istock][1] + +Without a doubt, 5G — the fifth generation of mobile wireless technology — is the hottest topic in wireless circles today. You can’t throw a stone without hitting 5G news. While telecommunications providers are in a heated competition to roll out 5G, it’s important to reflect on current 4G LTE (Long Term Evolution) business solutions as a preview of what we have learned and what’s possible. + +This is part one of a two-part blog series that will explore the [SD-WAN][2] journey through the evolution of these wireless technologies. + +### **Mobile SD-WAN is a reality** + +4G LTE commercialization continues to expand. According to [the GSM (Groupe Spéciale Mobile) Association][3], 710 operators have rolled out 4G LTE in 217 countries, reaching 83 percent of the world’s population. The evolution of 4G is transforming the mobile industry and is setting the stage for the advent of 5G. + +Mobile connectivity is increasingly integrated with SD-WAN, along with MPLS and broadband WAN services today. 4G LTE represents a very attractive transport alternative, as a backup or even an active member of the WAN transport mix to connect users to critical business applications. And in some cases, 4G LTE might be the only choice in locations where fixed lines aren’t available or reachable. Furthermore, an SD-WAN can optimize 4G LTE connectivity and bring new levels of performance and availability to mobile-based business use cases by selecting the best path available across several 4G LTE connections. + +### **Increasing application performance and availability with 4G LTE** + +Silver Peak has partnered with [BEC Technologies][4] to create a joint solution that enables customers to incorporate one or more low-cost 4G LTE services into any [Unity EdgeConnect™][5] SD-WAN edge platform deployment. All the capabilities of the EdgeConnect platform are supported across LTE links including packet-based link bonding, dynamic path control, path conditioning along with the optional [Unity Boost™ WAN Optimization][6] performance pack. This ensures always-consistent, always-available application performance even in the event of an outage or degraded service. + +EdgeConnect also incorporates sophisticated NAT traversal technology that eliminates the requirement for provisioning the LTE service with extra-cost static IP addresses. The Silver Peak [Unity Orchestrator™][7] management software enables the prioritization of LTE bandwidth usage based on branch and application requirements – active-active or backup-only. This solution is ideal in retail point-of-sale and other deployment use cases where always-available WAN connectivity is critical for the business. + +### **Automated SD-WAN enables innovative services** + +An example of an innovative mobile SD-WAN service is [swyMed’s DOT Telemedicine Backpack][8] powered by the EdgeConnect [Ultra Small][9] hardware platform. This integrated telemedicine solution enables first responders to connect to doctors and communicate patient vital statistics and real-time video anywhere, any time, greatly improving and expediting care for emergency patients. Using a lifesaving backpack provisioned with two LTE services from different carriers, EdgeConnect continuously monitors the underlying 4G LTE services for packet loss, latency and jitter. In the case of transport failure or brownout, EdgeConnect automatically initiates a sub-second failover so that voice, video and data connections continue without interruption over the remaining active 4G service. By bonding the two LTE links together with the EdgeConnect SD-WAN, swyMed can achieve an aggregate signal quality in excess of 90 percent, bringing mobile telemedicine to areas that would have been impossible in the past due to poor signal strength. + +To learn more about SD-WAN and the unique advantages that SD-WAN provides to enterprises across all industries, visit the [SD-WAN Explained][2] page on our website. + +### **Prepare for the 5G future** + +In summary, the adoption of 4G LTE is a reality. Service providers are taking advantage of the distinct benefits of SD-WAN to offer managed SD-WAN services that leverage 4G LTE. + +As the race for the 5G gains momentum, service providers are sure to look for ways to drive new revenue streams to capitalize on their initial investments. Stay tuned for part 2 of this 2-blog series where I will discuss how SD-WAN is one of the technologies that can help service providers to transition from 4G to 5G and enable the monetization of a new wave of managed 5G services. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394866/mobility-and-sd-wan-part-1-sd-wan-with-4g-lte-is-a-reality.html + +作者:[Francisca Segovia][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-952414660-100796279-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.gsma.com/futurenetworks/resources/all-ip-statistics/ +[4]: https://www.silver-peak.com/resource-center/edgeconnect-4glte-solution-bec-technologies +[5]: https://www.silver-peak.com/products/unity-edge-connect +[6]: https://www.silver-peak.com/products/unity-boost +[7]: https://www.silver-peak.com/products/unity-orchestrator +[8]: https://www.silver-peak.com/resource-center/mobile-telemedicine-helps-save-lives-streaming-real-time-clinical-data-and-patient +[9]: https://www.silver-peak.com/resource-center/edgeconnect-us-ec-us-specification-sheet From 8dd3bb25fdd7a0cdb41b9a0f876a0a274642d894 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:24:23 +0800 Subject: [PATCH 0525/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20When?= =?UTF-8?q?=20to=20be=20concerned=20about=20memory=20levels=20on=20Linux?= =?UTF-8?q?=20sources/tech/20190513=20When=20to=20be=20concerned=20about?= =?UTF-8?q?=20memory=20levels=20on=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... concerned about memory levels on Linux.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20190513 When to be concerned about memory levels on Linux.md diff --git a/sources/tech/20190513 When to be concerned about memory levels on Linux.md b/sources/tech/20190513 When to be concerned about memory levels on Linux.md new file mode 100644 index 0000000000..3306793c9f --- /dev/null +++ b/sources/tech/20190513 When to be concerned about memory levels on Linux.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When to be concerned about memory levels on Linux) +[#]: via: (https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +When to be concerned about memory levels on Linux +====== +Memory management on Linux systems is complicated. Seeing high usage doesn’t necessarily mean there’s a problem. There are other things you should also consider. +![Qfamily \(CC BY 2.0\)][1] + +Running out of memory on a Linux system is generally _not_ a sign that there's a serious problem. Why? Because a healthy Linux system will cache disk activity in memory, basically gobbling memory that isn't being used, which is a very good thing. + +In other words, it doesn't allow memory to go to waste. It uses the spare memory to increase disk access speed, and it does this _without_ taking memory away from running applications. This memory caching, as you might well imagine, is hundreds of times faster than working directly with the hard-disk drives (HDD) and significantly faster than solid-state drives. Full or near full memory normally means that a system is running as efficiently as it can — not that it's running into problems. + +**[ Also see:[Must-know Linux Commands][2] ]** + +### How caching works + +Disk caching simply means that a system is taking advantage of unused resources (free memory) to speed up disk reads and writes. Applications don't lose anything and most of the time can acquire more memory whenever they need it. In addition, disk caching does not cause applications to resort to using swap. Instead, memory used for disk caching is always returned immediately when needed and disk content updated. + +### Major and minor page faults + +Linux systems allocate memory to processes by breaking physical memory into chunks called "pages" and then mapping those pages into process virtual memory. Pages that appear to no longer be used may be removed from memory — even if the related process is still running. When a process needs a page that is no longer mapped or no longer in memory, a fault is generated. So, "fault" does not mean "error" but instead means "unavailable," and faults play an important role in memory management. + +A minor fault means the page is in memory but not allocated to the requesting process or not marked as present in the memory management unit. A major fault means the page in no longer in memory. + +If you'd like to get a feel for how often minor and major page faults occur, try a **ps** command like this one. Note that we're asking for the fields related to page faults and the commands to be listed. Numerous lines were omitted from the output. The MINFL displays the number of minor faults, while MAJFL represents the number of major faults. + +``` +$ ps -eo min_flt,maj_flt,cmd + MINFL MAJFL CMD +230760 150 /usr/lib/systemd/systemd --switched-root --system --deserialize 18 + 0 0 [kthreadd] + 0 0 [rcu_gp] + 0 0 [rcu_par_gp] + 0 0 [kworker/0:0H-kblockd] + ... + 166 20 gpg-agent --homedir /var/lib/fwupd/gnupg --use-standard-socket --daemon + 525 1 /usr/libexec/gvfsd-trash --spawner :1.16 /org/gtk/gvfs/exec_spaw/0 + 4966 4 /usr/libexec/gnome-terminal-server + 3617 0 bash + 0 0 [kworker/1:0H-kblockd] + 927 0 gdm-session-worker [pam/gdm-password] +``` + +To report on a single process, you might try a command like this: + +``` +$ ps -o min_flt,maj_flt 1 + MINFL MAJFL +230064 150 +``` + +You can also add other fields such as the process owner's UID and GID. + +``` +$ ps -o min_flt,maj_flt,cmd,args,uid,gid 1 + MINFL MAJFL CMD COMMAND UID GID +230064 150 /usr/lib/systemd/systemd -- /usr/lib/systemd/systemd -- 0 0 +``` + +### How full is full? + +One way to get a better handle on how memory is being used is with the **free -m** command. The **-m** option reports the numbers in mebibytes (MiBs) instead of bytes. + +``` +$ free -m + total used free shared buff/cache available +Mem: 3244 3069 35 49 140 667 +Swap: 3535 0 3535 +``` + +Note that "free" (unused) memory can be running low while "available" (available for starting new applications) might report a larger number. The distinction between these two fields is well worth paying attention to. Available means that it can be recovered and used when needed, while free means that it's available now. + +### When to worry + +If performance on a Linux systems appears to be good — applications are responsive, the command line shows no indications of a problem — chances are the system's in good shape. Keep in mind that some application might be slowed down for some reason that doesn't affect the overall system. + +An excessive number of hard faults may indeed indicate a problem, but balance this with observed performance. + +A good rule of thumb is to worry when available memory is close to zero or when the "swap used" field grows or fluctuates noticeably. Don't worry if the "available" figure is a reasonable percentage of the total memory available as it is in the example from above repeated here: + +``` +$ free -m + total used free shared buff/cache available +Mem: 3244 3069 35 49 140 667 +Swap: 3535 0 3535 +``` + +### Linux performance is complicated + +All that aside, memory on a Linux system can fill up and performance can slow down. Just don't take one report on memory usage as an indication that your system's in trouble. + +Memory management on Linux systems is complicated because of the measures taken to ensure the best use of system resources. Don't let the initial appearance of full memory trick you into believing that your system is in trouble when it isn't. + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][3] ]** + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/full-swimming-pool-100796221-large.jpg +[2]: https://www.networkworld.com/article/3391029/must-know-linux-commands.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 9d077cf2d282069cacdcacb454a8b4eb00991d78 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:24:46 +0800 Subject: [PATCH 0526/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20Top?= =?UTF-8?q?=20auto=20makers=20rely=20on=20cloud=20providers=20for=20IoT=20?= =?UTF-8?q?sources/talk/20190513=20Top=20auto=20makers=20rely=20on=20cloud?= =?UTF-8?q?=20providers=20for=20IoT.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... makers rely on cloud providers for IoT.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md diff --git a/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md b/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md new file mode 100644 index 0000000000..5adf5f65a7 --- /dev/null +++ b/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top auto makers rely on cloud providers for IoT) +[#]: via: (https://www.networkworld.com/article/3395137/top-auto-makers-rely-on-cloud-providers-for-iot.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Top auto makers rely on cloud providers for IoT +====== + +For the companies looking to implement the biggest and most complex [IoT][1] setups in the world, the idea of pairing up with [AWS][2], [Google Cloud][3] or [Azure][4] seems to be one whose time has come. Within the last two months, BMW and Volkswagen have both announced large-scale deals with Microsoft and Amazon, respectively, to help operate their extensive network of operational technology. + +According to Alfonso Velosa, vice president and analyst at Gartner, part of the impetus behind those two deals is that the automotive sector fits in very well with the architecture of the public cloud. Public clouds are great at collecting and processing data from a diverse array of different sources, whether they’re in-vehicle sensors, dealerships, mechanics, production lines or anything else. + +**[ RELATED:[What hybrid cloud means in practice][5]. | Get regularly scheduled insights by [signing up for Network World newsletters][6]. ]** + +“What they’re trying to do is create a broader ecosystem. They think they can leverage the capabilities from these folks,” Velosa said. + +### Cloud providers as IoT partners + +The idea is automated analytics for service and reliability data, manufacturing and a host of other operational functions. And while the full realization of that type of service is still very much a work in progress, it has clear-cut advantages for big companies – a skilled partner handling tricky implementation work, built-in capability for sophisticated analytics and security, and, of course, the ability to scale up in a big way. + +Hence, the structure of the biggest public clouds has upside for many large-scale IoT deployments, not just the ones taking place in the auto industry. The cloud giants have vast infrastructures, with multiple points of presence all over the world. + +To continue reading this article register now + +[Get Free Access][7] + +[Learn More][8] Existing Users [Sign In][7] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395137/top-auto-makers-rely-on-cloud-providers-for-iot.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[2]: https://www.networkworld.com/article/3324043/aws-does-hybrid-cloud-with-on-prem-hardware-vmware-help.html +[3]: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html +[4]: https://www.networkworld.com/article/3385078/microsoft-introduces-azure-stack-for-hci.html +[5]: https://www.networkworld.com/article/3249495/what-hybrid-cloud-mean-practice +[6]: https://www.networkworld.com/newsletters/signup.html +[7]: javascript:// +[8]: /learn-about-insider/ From 7960b918ea62ccbe292560c117ffd048e1268957 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 13:24:58 +0800 Subject: [PATCH 0527/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190513=20HPE?= =?UTF-8?q?=E2=80=99s=20CEO=20lays=20out=20his=20technology=20vision=20sou?= =?UTF-8?q?rces/talk/20190513=20HPE-s=20CEO=20lays=20out=20his=20technolog?= =?UTF-8?q?y=20vision.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...PE-s CEO lays out his technology vision.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 sources/talk/20190513 HPE-s CEO lays out his technology vision.md diff --git a/sources/talk/20190513 HPE-s CEO lays out his technology vision.md b/sources/talk/20190513 HPE-s CEO lays out his technology vision.md new file mode 100644 index 0000000000..c9a8de9c8a --- /dev/null +++ b/sources/talk/20190513 HPE-s CEO lays out his technology vision.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HPE’s CEO lays out his technology vision) +[#]: via: (https://www.networkworld.com/article/3394879/hpe-s-ceo-lays-out-his-technology-vision.html) +[#]: author: (Eric Knorr ) + +HPE’s CEO lays out his technology vision +====== +In an exclusive interview, HPE CEO Antonio Neri unpacks his portfolio of technology initiatives, from edge computing to tomorrow’s memory-driven architecture. +![HPE][1] + +Like Microsoft's Satya Nadella, HPE CEO Antonio Neri is a technologist with a long history of leading initiatives in his company. Meg Whitman, his former boss at HPE, showed her appreciation of Neri’s acumen by promoting him to HPE Executive Vice President in 2015 – and gave him the green light to acquire [Aruba][2], [SimpliVity][3], [Nimble Storage][4], and [Plexxi][5], all of which added key items to HPE’s portfolio. + +Neri succeeded Whitman as CEO just 16 months ago. In a recent interview with Network World, Neri’s engineering background was on full display as he explained HPE’s technology roadmap. First and foremost, he sees a huge opportunity in [edge computing][6], into which HPE is investing $4 billion over four years to further develop edge “connectivity, security, and obviously cloud and analytics.” + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][7] + * [Edge computing best practices][8] + * [How edge computing can help secure the IoT][9] + + + +Although his company abandoned its public cloud efforts in 2015, Neri is also bullish on the self-service “cloud experience,” which he asserts HPE is already implementing on-prem today in a software-defined, consumption-driven model. More fundamentally, he believes we are on the brink of a memory-driven computing revolution, where storage and memory become one and, depending on the use case, various compute engines are brought to bear on zettabytes of data. + +This interview, conducted by Network World Editor-in-Chief Eric Knorr and edited for length and clarity, digs into Neri’s technology vision. [A companion interview on CIO][10] centers on Neri’s views of innovation, management, and company culture. + +**Eric Knorr: ** Your biggest and highest profile investment so far has been in edge computing. My understanding of edge computing is that we’re really talking about mini-data centers, defined by IDC as less than 100 square feet in size. What’s the need for a $4 billion investment in that? + +**Antonio Neri:** It’s twofold. We focus first on connectivity. Think about Aruba as a platform company, a cloud-enabled company. Now we offer branch solutions and edge data center solutions that include [wireless][11], LAN, [WAN][12] connectivity and soon [5G][13]. We give you a control plane so that that connectivity experience can be seen consistently the same way. All the policy management, the provisioning and the security aspects of it. + +**Knorr:** Is 5G a big focus? + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][14] ]** + +**Neri:** It’s a big focus for us. What customers are telling us is that it’s hard to get 5G inside the building. How you do hand off between 5G and Wi-Fi and give them the same experience? Because the problem is that we have LAN, wireless, and WAN already fully integrated into the control plane, but 5G sits over here. If you are an enterprise, you have to manage these two pipes independently. + +With the new spectrum, though, they are kind of comingling anyway. [Customers ask] why don’t you give me [a unified] experience on top of that, with all this policy management and cloud-enablement, so I can provision the right connectivity for the right use case? A sensor can use a lower radio access or [Bluetooth][15] or other type of connectivity because you don’t need persistent connectivity and you don’t have the power to do it. + +In some cases, you just put a SIM on it, and you have 5G, but in another one it’s just wireless connectivity. Wi-Fi connectivity is significantly lower cost than 5G. The use cases will dictate what type of connectivity you need, but the reality is they all want one experience. And we can do that because we have a great platform and a great partnership with MSPs, telcos, and providers. + +**Knorr:** So it sounds like much of your investment is going into that integration. + +**Neri:** The other part is how we provide the ability to provision the right cloud computing at the edge for the right use cases. Think about, for example, a manufacturing floor. We can converge the OT and IT worlds through a converged infrastructure aspect that digitizes the analog process into a digital process. We bring the cloud compute in there, which is fully virtualized and containerized, we integrate Wi-Fi connectivity or LAN connectivity, and we eliminate all these analog processes that are multi-failure touchpoints because you have multiple things that have to come together. + +That’s a great example of a cloud at the edge. And maybe that small cloud is connected to a big cloud which could be in the large data center, which the customer owns – or it can be one of the largest public cloud providers. + +**Knorr:** It’s difficult to talk about the software-defined data center and private cloud without talking about [VMware][16]. Where do your software-defined solutions leave off and where does VMware begin? + +**Neri:** Where we stop is everything below the hypervisor, including the software-defined storage and things like SimpliVity. That has been the advantage we’ve had with [HPE OneView][17], so we can provision and manage the infrastructure-life-cycle and software-defined aspects at the infrastructure level. And let’s not forget security, because we’ve integrated [silicon root of trust][18] into our systems, which is a good advantage for us in the government space. + +Then above that we continue to develop capabilities. Customers want choice. That’s why [the partnership with Nutanix][19] was important. We offer an alternative to vSphere and vCloud Foundation with Nutanix Prism and Acropolis. + +**Knorr:** VMware has become the default for the private cloud, though. + +**Neri:** Obviously, VMware owns 60 percent of the on-prem virtualized environment, but more and more, containers are becoming the way to go in a cloud-native approach. For us, we own the full container stack, because we base our solution on Kubernetes. We deploy that. That’s why the partnership with Nutanix is important. With Nutanix, we offer KVM and the Prism stack and then we’re fully integrated with HPE OneView for the rest of the infrastructure. + +**Knorr:** You also offer GKE [Google [Kubernetes][20] Engine] on-prem. + +**Neri:** Correct. We’re working with Google on the next version of that. + +**Knorr:** How long do you think it will be before you start seeing Kubernetes and containers on bare metal? + +**Neri:** It’s an interesting question. Many customers tell us it’s like going back to the future. It’s like we’re paying this tax on the virtualization layer. + +**Knorr:** Exactly. + +**Neri:** I can go bare metal and containers and be way more efficient. It is a little bit back to the future. But it’s a different future. + +**Knorr:** And it makes the promise of [hybrid cloud][21] a little more real. I know HPE has been very bullish on hybrid. + +**Neri:** We have been the one to say the world would be hybrid. + +**Knorr:** But today, how hybrid is hybrid really? I mean, you have workloads in the public cloud, you have workloads in a [private cloud][22]. Can you really rope it all together into hybrid? + +**Neri:** I think you have to have portability eventually. + +**Knorr:** Eventually. It’s not really true now, though. + +**Neri:** No, not true now. If you look at it from the software brokering perspective that makes hybrid very small. We know this eventually has to be all connected, but it’s not there yet. More and more of these workloads have to go back and forth. + +If you ask me what the CIO role of the future will look like, it would be a service provider. I wake up in the morning, have a screen that says – oh, you know what? Today it’s cheaper to run that app here. I just slice it there and then it just moves. Whatever attributes on the data I want to manage and so forth – oh, today I have capacity here and by the way, why are you not using it? Slide it back here. That’s the hybrid world. + +Many people, when they started with the cloud, thought, “I’ll just virtualize everything,” but that’s not the cloud. You’re [virtualizing][23], but you have to make it self-service. Obviously, cloud-native applications have developed that are different today. That’s why containers are definitely a much more efficient way, and that’s why I agree that the bare-metal piece of this is coming back. + +**Knorr:** Do you worry about public cloud incursions into the [data center][24]? + +**Neri:** It’s happening. Of course I’m worried. But what at least gives me comfort is twofold. One is that the customer wants choice. They don’t want to be locked in. Service is important. It’s one thing to say: Here’s the system. The other is: Who’s going to maintain it for me? Who is going to run it for me? And even though you have all the automation tools in the world, somebody has to watch this thing. Our job is to bring the public-cloud experience on prem, so that the customer has that choice. + +**Knorr:** Part of that is economics. + +**Neri:** When you look at economics it’s no longer just the cost of compute anymore. What we see more and more is the cost of the data bandwidth back and forth. That’s why the first question a customer asks is: Where should I put my data? And that dictates a lot of things, because today the data transfer bill is way higher than the cost of renting a VM. + +The other thing is that when you go on the public cloud you can spin up a VM, but the problem is if you don’t shut it off, the bill keeps going. We brought, in the context of [composability][25], the ability to shut it off automatically. That’s why composability is important, because we can run, first of all, multi-workloads in the same infrastructure – whether it’s bare metal, virtualized or containerized. It’s called composable because the software layers of intelligence compose the right solutions from compute, storage, fabric and memory to that workload. When it doesn’t need it, it gives it back. + +**Knorr:** Is there any opportunity left at the hardware level to innovate? + +**Neri:** That’s why we think about memory-driven computing. Today we have a very CPU-centric approach. This is a limiting factor, and the reality is, if you believe data is the core of the architecture going forward, then the CPU can’t be the core of the architecture anymore. + +You have a bunch of inefficiency by moving data back and forth across the system, which also creates energy waste and so forth. What we are doing is basically rearchitecting this for once in 70 years. We take memory and storage and collapse the two into one, so this becomes one central pool, which is nonvolatile and becomes the core. And then we bring the right computing capability to the data. + +In an AI use case, you don’t move the data. You bring accelerators or GPUs to the data. For general purpose, you may use an X86, and maybe in video transcoding, you use an ARM-based architecture. The magic is this: You can do this on zettabytes of data and the benefit is there is no waste, very little power to keep it alive, and it’s persistent. + +We call this the Generation Z fabric, which is based on a data fabric and silicon photonics. Now we go from copper, which is generating a lot of waste and a lot of heat and energy, to silicon photonics. So we not only scale this to zettabytes, we can do massive amounts of computation by bringing the right compute at the speed that’s needed to the data – and we solve a cost and scale problem too, because copper today costs a significant amount of money, and gold-plated connectors are hundreds of dollars. + +We’re going to actually implement this capability in silicon photonics in our current architectures by the end of the year. In Synergy, for example, which is a composable blade system, at the back of the rack you can swap from Ethernet to silicon photonics. It was designed that way. We already prototyped this in a simple 2U chassis with 160 TB of memory and 2000 cores. We were able to process a billion-record database with 55 million combinations of algorithms in less than a minute. + +**Knorr:** So you’re not just focusing on the edge, but the core, too. + +**Neri:** As you go down from the cloud to the edge, that architecture actually scales to the smallest things. You can do it on a massive scale or you can do it on a small scale. We will deploy these technologies in our systems architectures now. Once the whole ecosystem is developed, because we also need an ISV ecosystem that can code applications in this new world or you’re not taking advantage of it. Also, the current Linux kernel can only handle so much memory, so you have to rewrite the kernel. We are working with two universities to do that. + +The hardware will continue to evolve and develop, but there still is a lot of innovation that has to happen. What’s holding us back, honestly, is the software. + +**Knorr:** And that’s where a lot of your investment is going? + +**Neri:** Correct. Exactly right. Systems software, not application software. It’s the system software that makes this infrastructure solution-oriented, workload-optimized, autonomous and efficient. + +Join the Network World communities on [Facebook][26] and [LinkedIn][27] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394879/hpe-s-ceo-lays-out-his-technology-vision.html + +作者:[Eric Knorr][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/antonio-neri_hpe_new-100796112-large.jpg +[2]: https://www.networkworld.com/article/2891130/aruba-networks-is-different-than-hps-failed-wireless-acquisitions.html +[3]: https://www.networkworld.com/article/3158784/hpe-buying-simplivity-for-650-million-to-boost-hyperconvergence.html +[4]: https://www.networkworld.com/article/3177376/hpe-to-pay-1-billion-for-nimble-storage-after-cutting-emc-ties.html +[5]: https://www.networkworld.com/article/3273113/hpe-snaps-up-hyperconverged-network-hcn-vendor-plexxi.html +[6]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[7]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[8]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[9]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[10]: https://www.cio.com/article/3394598/hpe-ceo-antonio-neri-rearchitects-for-the-future.html +[11]: https://www.networkworld.com/article/3238664/80211-wi-fi-standards-and-speeds-explained.html +[12]: https://www.networkworld.com/article/3248989/what-is-a-wide-area-network-a-definition-examples-and-where-wans-are-headed.html +[13]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[14]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[15]: https://www.networkworld.com/article/3235124/internet-of-things-definitions-a-handy-guide-to-essential-iot-terms.html +[16]: https://www.networkworld.com/article/3340259/vmware-s-transformation-takes-hold.html +[17]: https://www.networkworld.com/article/2174203/hp-expands-oneview-into-vmware-environs.html +[18]: https://www.networkworld.com/article/3199826/hpe-highlights-innovation-in-software-defined-it-security-at-discover.html +[19]: https://www.networkworld.com/article/3388297/hpe-and-nutanix-partner-for-hyperconverged-private-cloud-systems.html +[20]: https://www.infoworld.com/article/3268073/what-is-kubernetes-container-orchestration-explained.html +[21]: https://www.networkworld.com/article/3268448/what-is-hybrid-cloud-really-and-whats-the-best-strategy.html +[22]: https://www.networkworld.com/article/2159885/cloud-computing-gartner-5-things-a-private-cloud-is-not.html +[23]: https://www.networkworld.com/article/3285906/whats-the-future-of-server-virtualization.html +[24]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[25]: https://www.networkworld.com/article/3266106/what-is-composable-infrastructure.html +[26]: https://www.facebook.com/NetworkWorld/ +[27]: https://www.linkedin.com/company/network-world From 80cbde3451c3b40d4eef7c12a629e9aebd96994b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 16:35:18 +0800 Subject: [PATCH 0528/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20Gett?= =?UTF-8?q?ing=20Started=20With=20Docker=20sources/tech/20190520=20Getting?= =?UTF-8?q?=20Started=20With=20Docker.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190520 Getting Started With Docker.md | 499 ++++++++++++++++++ 1 file changed, 499 insertions(+) create mode 100644 sources/tech/20190520 Getting Started With Docker.md diff --git a/sources/tech/20190520 Getting Started With Docker.md b/sources/tech/20190520 Getting Started With Docker.md new file mode 100644 index 0000000000..873173e4ad --- /dev/null +++ b/sources/tech/20190520 Getting Started With Docker.md @@ -0,0 +1,499 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting Started With Docker) +[#]: via: (https://www.ostechnix.com/getting-started-with-docker/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Getting Started With Docker +====== + +![Getting Started With Docker][1] + +In our previous tutorial, we have explained **[how to install Docker in Ubuntu][2]** , and how to [**install Docker in CentOS**][3]. Today, we will see the basic usage of Docker. This guide covers the Docker basics, such as how to create a new container, how to run the container, remove a container, how to build your own Docker image from the Container and so on. Let us get started! All steps given below are tested in Ubuntu 18.04 LTS server edition. + +### Getting Started With Docker + +Before exploring the Docker basics, don’t confuse with Docker images and Docker Containers. As I already explained in the previous tutorial, Docker Image is the file that decides how a Container should behave, and Docker Container is the running or stopped stage of a Docker image. + +##### 1\. Search Docker images + +We can get the images from either from the registry, for example [**Docker hub**][4], or create our own, For those wondering, Docker hub is cloud hosted place where all Docker users build, test, and save their Docker images. + +Docker hub has tens of thousands of Docker images. You can search for the any Docker images with **“docker search”** command. + +For instance, to search for docker images based on Ubuntu, run: + +``` +$ sudo docker search ubuntu +``` + +**Sample output:** + +![][5] + +To search images based on CentOS, run: + +``` +$ sudo docker search ubuntu +``` + +To search images for AWS, run: + +``` +$ sudo docker search aws +``` + +For wordpress: + +``` +$ sudo docker search wordpress +``` + +Docker hub has almost all kind of images. Be it an operating system, application, or anything, you will find pre-built Docker images in Docker hub. If something you’re looking for is not available, you can build it and make it available for public or keep it private for your own use. + +##### 2\. Download Docker image + +To download Docker image for Ubuntu OS, run the following command from the Terminal: + +``` +$ sudo docker pull ubuntu +``` + +The above command will download the latest Ubuntu image from the **Docker hub**. + +**Sample output:** + +``` +Using default tag: latest +latest: Pulling from library/ubuntu +6abc03819f3e: Pull complete +05731e63f211: Pull complete +0bd67c50d6be: Pull complete +Digest: sha256:f08638ec7ddc90065187e7eabdfac3c96e5ff0f6b2f1762cf31a4f49b53000a5 +Status: Downloaded newer image for ubuntu:latest +``` + +![][6] + +Download docker images + +You can also download a specific version of Ubuntu image using command: + +``` +$ docker pull ubuntu:18.04 +``` + +Docker allows us to download any images and start the container regardless of the host OS. + +For example, to download CentOS image, run: + +``` +$ sudo docker pull centos +``` + +All downloaded Docker images will be saved in **/var/lib/docker/** directory. + +To view the list of downloaded Docker images, run: + +``` +$ sudo docker images +``` + +**Sample output:** + +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +ubuntu latest 7698f282e524 14 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +As you see above, I have downloaded three Docker images – **Ubuntu** , **CentOS** and **hello-world**. + +Now, let us go ahead and see how to start or run the containers based on the downloaded images. + +##### 3\. Run Docker Containers + +We can start the containers in two methods. We can start a container either using its **TAG** or **IMAGE ID**. **TAG** refers to a particular snapshot of the image and the **IMAGE ID** is the corresponding unique identifier for that image. + +As you in the above results **“latest”** is the TAG for all containers, and **7698f282e524** is the IMAGE ID of **Ubuntu** Docker image, **9f38484d220f** is the image id of CentOS Docker image and **fce289e99eb9** is the image id of **hello_world** Docker image. + +Once you downloaded the Docker images of your choice, run the following command to start a Docker container by using its TAG. + +``` +$ sudo docker run -t -i ubuntu:latest /bin/bash +``` + +Here, + + * **-t** : Assigns a new Terminal inside the Ubuntu container. + * **-i** : Allows us to make an interactive connection by grabbing the standard in (STDIN) of the container. + * **ubuntu:latest** : Ubuntu container with TAG “latest”. + * **/bin/bash** : BASH shell for the new container. + + + +Or, you can start the container using IMAGE ID as shown below: + +``` +sudo docker run -t -i 7698f282e524 /bin/bash +``` + +Here, + + * **7698f282e524** – Image id + + + +After starting the container, you’ll be landed automatically into the Container’s shell (Command prompt): + +![][7] + +Docker container’s shell + +To return back to the host system’s Terminal (In my case, it is Ubuntu 18.04 LTS) without terminating the Container (guest os), press **CTRL+P** followed by **CTRL+Q**. Now, you’ll be safely return back to your original host computer’s terminal window. Please note that the container is still running in the background and we didn’t terminate it yet. + +To view the list running of containers, run the following command: + +``` +$ sudo docker ps +``` + +**Sample output:** + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +32fc32ad0d54 ubuntu:latest "/bin/bash" 7 minutes ago Up 7 minutes modest_jones +``` + +![][8] + +List running containers + +Here, + + * **32fc32ad0d54** – Container ID + * **ubuntu:latest** – Docker image + + + +Please note that **Container ID and Docker image ID are different**. + +To list all available ( either running or stopped) containers: + +``` +$ sudo docker ps -a +``` + +To stop (power off the container) from the host’s shell, run the following command: + +``` +$ sudo docker stop +``` + +**Example:** + +``` +$ sudo docker stop 32fc32ad0d54 +``` + +To login back to or attach to the running container, just run: + +``` +$ sudo docker attach 32fc32ad0d54 +``` + +As you already know, **32fc32ad0d54** is the container’s ID. + +To power off a Container from inside it’s shell by typing the following command: + +``` +# exit +``` + +You can verify the list of running containers with command: + +``` +$ sudo docker ps +``` + +##### 4\. Build your custom Docker images + +Docker is not just for downloading and using the existing containers. You can create your own custom docker image as well. + +To do so, start any one the downloaded container: + +``` +$ sudo docker run -t -i ubuntu:latest /bin/bash +``` + +Now, you will be in the container’s shell. + +Then, install any software or do what ever you want to do in the container. + +For example, let us install **Apache web server** in the container. + +Once you did all tweaks, installed all necessary software, run the following command to build your custom Docker image: + +``` +# apt update +# apt install apache2 +``` + +Similarly, install and test any software of your choice in the Container. + +Once you all set, return back to the host system’s shell. Do not stop or poweroff the Container. To switch to the host system’s shell without stopping Container, press CTRL+P followed by CTRL+Q. + +From your host computer’s shell, run the following command to find the container ID: + +``` +$ sudo docker ps +``` + +Finally, create a Docker image of the running Container using command: + +``` +$ sudo docker commit 3d24b3de0bfc ostechnix/ubuntu_apache +``` + +**Sample Output:** + +``` +sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 +``` + +Here, + + * **3d24b3de0bfc** – Ubuntu container ID. As you already, we can + * **ostechnix** – Name of the user who created the container. + * **ubuntu_apache** – Name of the docker image created by user ostechnix. + + + +Let us check whether the new Docker image is created or not with command: + +``` +$ sudo docker images +``` + +**Sample output:** + +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +ostechnix/ubuntu_apache latest ce5aa74a48f1 About a minute ago 191MB +ubuntu latest 7698f282e524 15 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +![][9] + +List docker images + +As you see in the above output, the new Docker image has been created in our localhost system from the running Container. + +Now, you can create a new Container from the newly created Docker image as usual suing command: + +``` +$ sudo docker run -t -i ostechnix/ubuntu_apache /bin/bash +``` + +##### 5\. Removing Containers + +Once you’re done all R&D with Docker containers, you can delete if you don’t want them anymore. + +To do so, First we have to stop (power off) the running Containers. + +Let us find out the running containers with command: + +``` +$ sudo docker ps +``` + +**Sample output:** + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +3d24b3de0bfc ubuntu:latest "/bin/bash" 28 minutes ago Up 28 minutes goofy_easley +``` + +Stop the running container by using it’s ID: + +``` +$ sudo docker stop 3d24b3de0bfc +``` + +Now, delete the container using command: + +``` +$ sudo docker rm 3d24b3de0bfc +``` + +Similarly, stop all containers and delete them if they are no longer required. + +Deleting multiple containers one by one can be a tedious task. So, we can delete all stopped containers in one go, just run: + +``` +$ sudo docker container prune +``` + +Type **“Y”** and hit ENTER key to delete the containers. + +``` +WARNING! This will remove all stopped containers. +Are you sure you want to continue? [y/N] y +Deleted Containers: +32fc32ad0d5445f2dfd0d46121251c7b5a2aea06bb22588fb2594ddbe46e6564 +5ec614e0302061469ece212f0dba303c8fe99889389749e6220fe891997f38d0 + +Total reclaimed space: 5B +``` + +This command will work only with latest Docker versions. + +##### 6\. Removing Docker images + +Once you removed containers, you can delete the Docker images that you no longer need. + +To find the list of the Downloaded Docker images: + +``` +$ sudo docker images +``` + +**Sample output:** + +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +ostechnix/ubuntu_apache latest ce5aa74a48f1 5 minutes ago 191MB +ubuntu latest 7698f282e524 15 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +As you see above, we have three Docker images in our host system. + +Let us delete them by using their IMAGE id: + +``` +$ sudo docker rmi ce5aa74a48f1 +``` + +**Sample output:** + +``` +Untagged: ostechnix/ubuntu_apache:latest +Deleted: sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 +Deleted: sha256:d21c926f11a64b811dc75391bbe0191b50b8fe142419f7616b3cee70229f14cd +``` + +##### Troubleshooting + +Docker won’t let you to delete the Docker images if they are used by any running or stopped containers. + +For example, when I try to delete a Docker Image with ID **b72889fa879c** , from one of my old Ubuntu server. I got the following error: + +``` +Error response from daemon: conflict: unable to delete b72889fa879c (must be forced) - image is being used by stopped container dde4dd285377 +``` + +This is because the Docker image that you want to delete is currently being used by another Container. + +So, let us check the running Container using command: + +``` +$ sudo docker ps +``` + +**Sample output:** + +![][10] + +Oops! There is no running container. + +Let us again check for all containers (Running and stopped) with command: + +``` +$ sudo docker ps -a +``` + +**Sample output:** + +![][11] + +As you see there are still some stopped containers are using one of the Docker images. So, let us delete all of the containers. + +**Example:** + +``` +$ sudo docker rm 12e892156219 +``` + +Similarly, remove all containers as shown above using their respective container’s ID. + +Once you deleted all Containers, finally remove the Docker images. + +**Example:** + +``` +$ sudo docker rmi b72889fa879c +``` + +That’s it. Let us verify is there any other Docker images in the host with command: + +``` +$ sudo docker images +``` + +For more details, refer the official resource links given at the end of this guide or drop a comment in the comment section below. + +Also, download and use the following Docker Ebooks to get to know more about it. + +** **Download** – [**Free eBook: “Docker Containerization Cookbook”**][12] + +** **Download** – [**Free Guide: “Understanding Docker”**][13] + +** **Download** – [**Free Guide: “What is Docker and Why is it So Popular?”**][14] + +** **Download** – [**Free Guide: “Introduction to Docker”**][15] + +** **Download** – [**Free Guide: “Docker in Production”**][16] + +And, that’s all for now. Hope you a got the basic idea about Docker usage. + +More good stuffs to come. Stay tuned! + +Cheers!! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/getting-started-with-docker/ + +作者:[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/2016/04/docker-basics-720x340.png +[2]: http://www.ostechnix.com/install-docker-ubuntu/ +[3]: https://www.ostechnix.com/install-docker-centos/ +[4]: https://hub.docker.com/ +[5]: http://www.ostechnix.com/wp-content/uploads/2016/04/Search-Docker-images.png +[6]: http://www.ostechnix.com/wp-content/uploads/2016/04/Download-docker-images.png +[7]: http://www.ostechnix.com/wp-content/uploads/2016/04/Docker-containers-shell.png +[8]: http://www.ostechnix.com/wp-content/uploads/2016/04/List-running-containers.png +[9]: http://www.ostechnix.com/wp-content/uploads/2016/04/List-docker-images.png +[10]: http://www.ostechnix.com/wp-content/uploads/2016/04/sk@sk-_005-1-1.jpg +[11]: http://www.ostechnix.com/wp-content/uploads/2016/04/sk@sk-_006-1.jpg +[12]: https://ostechnix.tradepub.com/free/w_java39/prgm.cgi?a=1 +[13]: https://ostechnix.tradepub.com/free/w_pacb32/prgm.cgi?a=1 +[14]: https://ostechnix.tradepub.com/free/w_pacb31/prgm.cgi?a=1 +[15]: https://ostechnix.tradepub.com/free/w_pacb29/prgm.cgi?a=1 +[16]: https://ostechnix.tradepub.com/free/w_pacb28/prgm.cgi?a=1 From 8a452c05616b743fe619adf614f6ead0f6d531e7 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 16:37:15 +0800 Subject: [PATCH 0529/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20Bloc?= =?UTF-8?q?kchain=202.0=20=E2=80=93=20Explaining=20Distributed=20Computing?= =?UTF-8?q?=20And=20Distributed=20Applications=20[Part=2011]=20sources/tec?= =?UTF-8?q?h/20190520=20Blockchain=202.0=20-=20Explaining=20Distributed=20?= =?UTF-8?q?Computing=20And=20Distributed=20Applications=20-Part=2011.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g And Distributed Applications -Part 11.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md diff --git a/sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md b/sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md new file mode 100644 index 0000000000..c34effe6be --- /dev/null +++ b/sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Explaining Distributed Computing And Distributed Applications [Part 11]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – Explaining Distributed Computing And Distributed Applications [Part 11] +====== + +![Explaining Distributed Computing And Distributed Applications][1] + +### How DApps serve the purpose of [Blockchain 2.0][2] + +**Blockchain 1.0** was about introducing the “blockchain” into the list of modern buzzwords along with the advent of **bitcoin**. Multiple white papers detailing bitcoin’s underlying blockchain network specified the use of the blockchain for other uses as well. Although most of the said uses was around the basic concept of using the blockchain as a **decentralized medium** for storage, a use that stems from this property is utilizing it for carrying out **Distributed computing** on top of this layer. + +**DApps** or **Distributed Applications** are computer programs that are stored and run on a distributed storage system such as the [**Ethereum**][3] blockchain for instance. To understand how DApps function and how they’re different from traditional applications on your desktop or phone, we’ll need to delve into what distributed computing is. This post will explore some fundamental concepts of distributed computing and the role of blockchains in executing the said objective. Furthermore, well also look at a few applications or DApps, in blockchain lingo, to get a hang of things. + +### What is Distributed Computing? + +We’re assuming many readers are familiar with multi-threaded applications and multi-threading in general. Multi-threading is the reason why processor manufacturers are forever hell bent on increasing the core count on their products. Fundamentally speaking, some applications such as video rendering software suites are capable of dividing their work (in this case rendering effects and video styles) into multiple chunks and parallelly get them processed from a supporting computing system. This reduces the lead time on getting the work done and is generally more efficient in terms of time, money and energy usage. Applications such as some games however, cannot make use of this system since processing and responses need to be obtained real time based on user inputs rather than via planned execution. Nonetheless, the fact that more processing power may be exploited from existing hardware using these computing methods remains true and significant. + +Even supercomputers are basically a bunch of powerful CPUs all tied up together in a circuit to enable faster processing as mentioned above. The average core count on flagship CPUs from the lead manufacturers AMD and Intel have in fact gone up in the last few years, because increasing core count has recently been the only method to claim better processing and claim upgrades to their product lines. This information notwithstanding, the fact remains that distributed computing and related concepts of parallel computing are the only legitimate ways to improve processing capabilities in the near future. There are minor differences between distributed and parallel computing models as well, however that is beyond the scope off this post. + +Another method to get many computers executing programs simultaneously is to connect them through the internet and have a cloud-based program to be implemented in parts by all of the participating systems. This is the basic fundamental behind distributed applications. + +For a more detailed account and primer regarding what and how parallel computing works, interested readers may visit [this][4] webpage. For a more detailed study of the topic, for people who have a background in computer science, you may refer to [this][5] website and the accompanying book. + +### What are DApps or Distributed Applications + +Application that can make use of the capabilities offered by a distributed computing system is called a **distributed application**. The execution and structure of such an application’s back end needs to be carefully designed in order to be compatible with the system. + +The blockchain presents an opportunity to store data in a distributed system of participating nodes. Stepping up from this opportunity we can logically build systems and applications running on such a network (think about how you used to download files via the Torrent protocol). + +Such decentralized applications present a lot of benefits over conventional applications that typically run from a central server. Some highlights are: + + * DApps run on a network of such participating nodes and any user request is parsed through such network nodes to provide the user with the requested functionality. _**Program is executed on the network instead of a single computer or a server**_. + * DApps will have codified methods of filtering through requests and executing them so as to always be fair and transparent when users interact with it. To create a new block of data in the chain, the same has to be approved via a **consensus algorithm** by the participating nodes. This fundamental idea of peer to peer approval applies for DApps as well. This essentially means that DApps cannot by extension of this principle provide different outputs to the same query or input. All users will be given the same priority unless it is explicitly mentioned and all users will receive similar results from the DApp as well. This will prove to be important in developing better industry practices for insurance and finance companies for instance. A DApp that specializes in microlending, for instance, cannot differentiate and offer different interest rates for different borrowers other than their credit history. This also means that all users will eventually end up paying for their required operations uniformly depending on the computational complexity of the task they passed on to the application. For instance, combing through 10000 entries of data will cost proportionately more than combing through say 100. The payment or incentivisation system might be different for different applications and blockchain protocols though. + * Most DApps are by default redundant and fail safe. If you’re using a service which is run on a central server, a failure from the server end will freeze the application. Think of a service such as PayPal for instance. If the PayPal server in your immediate region fails due to some reason and somehow the central server cannot re route your request, your payment will not go through. However, even in case multiple participating nodes in the blockchain dies, you will still find the application live and running provided at least one node is live. This presents a use case for applications which are by definition supposed to be live all the time. Emergency services, insurance, communications etc., are some key areas where investors hope such DApps will bring in much needed reliability. + * DApps are usually cost-effective owing to them not requiring a central server to be maintained for their functionality. Once they become mainstream, the mean computing cost of running tasks on the same is also supposed to decrease. + * DApps will as mentioned exist till eternity at least until one participant is live on the chain. This essentially means that DApps cannot be censored or hacked into bowing and shutting down. + + + +The above list of features seems very few, however, combine that with all the other capabilities of the blockchain, the advancement of wireless network access, and, the increasing capabilities of millions of smartphones and here we have in our hands nothing less than a paradigm shift in how the apps that we rely on work. + +We will look deeper into how DApps function and how you can make your own DApps on the Ethereum blockchain in a proceeding post. To give you an idea of the DApp environment right now, we present 4 carefully chosen examples that are fairly advanced and popular. + +##### 1\. BITCOIN (or any Cryptocurrency) + +We’re very sure that readers did not expect BITCOIN to be one among a list of applications in this post. The point we’re trying to make here however, is that any cryptocurrency currently running on a blockchain backbone can be termed as a DApp. Cryptocurrencies are in fact the most popular DApp format out there and a revolutionary one at that too. + +##### 2\. [MELON][6] + +We’ve talked about how asset management can be an easier task utilizing blockchain and [**smart contracts**][7]. **Melon** is a company that aims to provide its users with usable relevant tools to manage and maximize their returns from the assets they own. They specialize in cryptographic assets as of now with plans to turn to real digitized assets in the future. + +##### 3\. [Request][8] + +**Request** is primarily a ledger system that handles financial transactions, invoicing, and taxation among other things. Working with other compatible databases and systems it is also capable of verifying payer data and statistics. Large corporations which typically have a significant number of defaulting customers will find it easier to handle their operations with a system such as this. + +##### 4\. [CryptoKitties][9] + +Known the world over as the video game that broke the Ethereum blockchain, **CryptoKitties** is a video game that runs on the Ethereum blockchain. The video game identifies each user individually by building your own digital profiles and gives you unique **virtual cats** in return. The game went viral and due to the sheer number of users it actually managed to slow down the Ethereum blockchain and its transaction capabilities. Transactions took longer than usual with users having to pay significantly extra money for simple transactions even. Concerns regarding scalability of the Ethereum blockchain have been raised by several stakeholders since then. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ + +作者:[editor][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/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Distributed-Computing-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[4]: https://www.techopedia.com/definition/7/distributed-computing-system +[5]: https://www.distributed-systems.net/index.php/books/distributed-systems-3rd-edition-2017/ +[6]: https://melonport.com/ +[7]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[8]: https://request.network/en/use-cases/ +[9]: https://www.cryptokitties.co/ From b2869e1cc5cd42b984acdf8046aa221e89f789e7 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 20 May 2019 16:39:28 +0800 Subject: [PATCH 0530/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20PiSh?= =?UTF-8?q?rink=20=E2=80=93=20Make=20Raspberry=20Pi=20Images=20Smaller=20s?= =?UTF-8?q?ources/tech/20190520=20PiShrink=20-=20Make=20Raspberry=20Pi=20I?= =?UTF-8?q?mages=20Smaller.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rink - Make Raspberry Pi Images Smaller.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md diff --git a/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md b/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md new file mode 100644 index 0000000000..ab26d62d93 --- /dev/null +++ b/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md @@ -0,0 +1,123 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PiShrink – Make Raspberry Pi Images Smaller) +[#]: via: (https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +PiShrink – Make Raspberry Pi Images Smaller +====== + +![Make Raspberry Pi Images Smaller With PiShrink In Linux][1] + +**Raspberry Pi** requires no introduction. It is a small, affordable and credit-card sized computer that can be connected to a Monitor or TV. We can attach a standard keyboard and mouse and use it as a full-blown desktop computer to do everyday tasks, such Internet browsing, playing videos/games, word processing and spreadsheet making and a lot more. It has been mainly developed for teaching Computer science in schools. Nowadays, Raspberry Pi is widely being used in colleges, small-medium organizations and institutes to teach coding. If you own a Raspberry Pi device, you might want to check out a bash script named **“PiShrink”** , which is used to make Raspberry Pi Images smaller. PiShrink will automatically shrink a pi image that will then resize to the max size of the SD card on boot. This will make putting the image back onto the SD card faster and the shrunk images will compress better. This can be useful to fit the large size images in your SD card. In this brief guide, we are going to learn to shrink Raspberry images to smaller size in Unix-like systems. + +### Installing PiShrink + +To install PiShrink on your Linux box, first download the latest version using command: + +``` +$ wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh +``` + +Next, make the downloaded PiShrink binary as executable: + +``` +$ chmod +x pishrink.sh +``` + +Finally, move it your path: + +``` +$ sudo mv pishrink.sh /usr/local/bin/ +``` + +### Make Raspberry Pi Images Smaller + +As you may already know, **Raspbian** is the official operating system for all models of Raspberry Pi. The Raspberry foundation has developed **Raspberry Pi Desktop** version for PC and Mac. You can create a live cd, run it in virtual machine and even install it in your desktop as well. There are also few unofficial OS images available for Raspberry Pi. For the purpose of testing, I’ve downloaded the official Raspbian OS from the [**official download page**][2]. + +Unzip the downloaded OS image: + +``` +$ unzip 2019-04-08-raspbian-stretch-lite.zip +``` + +The above command will extract contents of **2019-04-08-raspbian-stretch-lite.zip** file in the current working directory. + +Let check the actual size of the extracted file: + +``` +$ du -h 2019-04-08-raspbian-stretch-lite.img +1.7G 2019-04-08-raspbian-stretch-lite.img +``` + +As you can see, the size of the extracted Raspberry OS img file is **1.7G**. + +Now, shrink this file’s size using PiShrink like below: + +``` +$ sudo pishrink.sh 2019-04-08-raspbian-stretch-lite.img +``` + +Sample output: + +``` +Creating new /etc/rc.local +rootfs: 39795/107072 files (0.1% non-contiguous), 239386/428032 blocks +resize2fs 1.45.0 (6-Mar-2019) +resize2fs 1.45.0 (6-Mar-2019) +Resizing the filesystem on /dev/loop1 to 280763 (4k) blocks. +Begin pass 3 (max = 14) +Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 4 (max = 3728) +Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on /dev/loop1 is now 280763 (4k) blocks long. + +Shrunk 2019-04-08-raspbian-stretch-lite.img from 1.7G to 1.2G +``` + +[![Make Raspberry Pi Images Smaller Using PiShrink][1]][3] + +Make Raspberry Pi Images Smaller Using PiShrink + +As you see in the above output, the size of the Rasberry Pi image has been reduced to **1.2G**. + +You can also use **-s** flag to skip the autoexpanding part of the process. + +``` +$ sudo pishrink.sh -s 2019-04-08-raspbian-stretch-lite.img newpi.img +``` + +This will create a copy of source img file (i.e 2019-04-08-raspbian-stretch-lite.img) into a new img file (newpi.img) and work on it. For more details, check the official GitHub page given at the end. + +And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! + +And, that’s all for now. + +**Resource:** + + * [**PiShrink GitHub Repository**][4] + * [**Raspberry Pi website**][5] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/ + +作者:[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/2019/05/pishrink-720x340.png +[2]: https://www.raspberrypi.org/downloads/ +[3]: http://www.ostechnix.com/wp-content/uploads/2019/05/pishrink-1.png +[4]: https://github.com/Drewsif/PiShrink +[5]: https://www.raspberrypi.org/ From a6b5bfd91c28a1472145a020f5c281ebdaf4501d Mon Sep 17 00:00:00 2001 From: David Dai Date: Mon, 20 May 2019 17:31:22 +0800 Subject: [PATCH 0531/1154] Apply for translating Kubernetes on Fedora IoT with k3s --- sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md index 5650e80aee..c2f75bc1d4 100644 --- a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md +++ b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (StdioA) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -183,7 +183,7 @@ via: https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/ 作者:[Lennart Jern][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[StdioA](https://github.com/StdioA) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e8f92a6dfbafcdf901a2bb7e06c6bf92b168b3e6 Mon Sep 17 00:00:00 2001 From: ninifly <18328038336@163.com> Date: Mon, 20 May 2019 22:08:21 +0800 Subject: [PATCH 0532/1154] Update 20190423 Edge computing is in most industries- future.md --- ...3 Edge computing is in most industries- future.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/talk/20190423 Edge computing is in most industries- future.md b/sources/talk/20190423 Edge computing is in most industries- future.md index ec6366638b..f94e35ef05 100644 --- a/sources/talk/20190423 Edge computing is in most industries- future.md +++ b/sources/talk/20190423 Edge computing is in most industries- future.md @@ -24,24 +24,24 @@ - * **医疗保健机构** : 随着医疗成本的不断上升,这一行业已经在具备在提高生产能力与成本效率方面的创新能力。管理咨询公司已经确定,[McKinsey & Co. has identified][5] 至少有11个有益于患者、医疗机构或者两者都有的医疗保健用例。两个例子:跟踪移动医疗设备提高护理效率,同时也有助于优化设备;可穿戴设备跟踪用户锻炼并提供健康的建议。 + * **医疗保健机构** : 随着医疗成本的不断上升,这一行业已经在具备在提高生产能力与成本效率方面的创新能力。管理咨询公司已经确定,[McKinsey & Co. has identified][5] 至少有11个有益于患者、医疗机构或者两者都有的医疗保健用例。举两个例子:跟踪移动医疗设备提高护理效率,同时也有助于优化设备;可穿戴设备跟踪用户锻炼并提供健康的建议。 -虽然这些是强大的用例,随着边缘计算市场的扩大,使用它的行业也会增加。 +虽然以上这些是明显的用例,随着边缘计算市场的扩大,使用它的行业也会增加。 **数字化转型的优势** 随着边缘计算的快速处理能力完全符合数字化转型的提高效率、生产能力和市场发展速度和客户体验。以下是一些有潜力的应用及将被边缘计算改变的行业: **农业** :农名和组织已经使用无人机将农田和气候环境传给灌溉设备。其他的应用可能包括了工人、牲畜和设备的监测与位置跟踪从而改善生产能力、效率和成本。 -**能源** : 在这一领域有许多的qian that could benefit both consumers and providers. For example, smart meters help homeowners better manage energy use while reducing grid operators’ need for manual meter reading. Similarly, sensors on water pipes would detect leaks, while providing real-time consumption data. +**能源** : 在这一领域有许多的潜在的应用,可以使消费者与供应商都受益。例如,智能电表有助于业主更好地管理能源使用,同时减少电网运营商对手动抄表的需求。 同样的,水管上的传感器能够监测到泄露,同时提供实时漏水数据。 -**Financial services** : Banks are adopting interactive ATMs that quickly process data to provide better customer experiences. At the organizational level, transactional data can be more quickly analyzed for fraudulent activity. +**金融服务** : 银行正在采取交互式ATM机,这种交互式ATM机能够快速地处理数据以提供更好的用户体验。在管理层次,可以更快速地分析交易数据中的欺诈行为。 -**Logistics** : As consumers demand faster delivery of goods and services, logistics companies will need to transform mapping and routing capabilities to get real-time data, especially in terms of last-mile pla钱 nning and tracking. That could involve street-, package-, and car-based sensors transmitting data for processing. +**物流** : 由于消费者需要更快速地提供商品和服务,物流公司将需要转换映射和路由功能以获取实时数据,尤其在最后一公里计划和轨迹方面。这可能涉及到街道、数据包及汽车基于传感器的数据传输过程。 -All industries have the potential for transformation, thanks to edge computing. But it will depend on how they address their computing infrastructure. Discover how to overcome any IT obstacles at [APC.com][6]. +得益于边缘计算,所有行业都有转型的潜力。但是,这将取决于他们如何处理计算机基础设施。在APC.com发现如何克服任何IT阻碍。 -------------------------------------------------------------------------------- From b286284df1df6c5b483a0ee69ec03d2876728097 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Mon, 20 May 2019 22:41:02 +0800 Subject: [PATCH 0533/1154] Translating --- ...nge Power Modes in Ubuntu with Slimbook Battery Optimizer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md index 874cd4ccf1..d30c7a6f0c 100644 --- a/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md +++ b/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zhs852) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 51e36df900bd42806c00b0f659ed82c2ab463807 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 May 2019 23:03:25 +0800 Subject: [PATCH 0534/1154] PRF:20190502 Get started with Libki to manage public user computer access.md @geekpi --- ...i to manage public user computer access.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190502 Get started with Libki to manage public user computer access.md b/translated/tech/20190502 Get started with Libki to manage public user computer access.md index d8cda03623..94ea4a240b 100644 --- a/translated/tech/20190502 Get started with Libki to manage public user computer access.md +++ b/translated/tech/20190502 Get started with Libki to manage public user computer access.md @@ -1,28 +1,29 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Get started with Libki to manage public user computer access) [#]: via: (https://opensource.com/article/19/5/libki-computer-access) [#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) -开始使用 Libk i来管理公共用户访问计算机 +使用 Libki 来管理公共用户访问计算机 ====== -Libki 是一个跨平台的计算机预约和时间管理系统。 -![][1] +> Libki 是一个跨平台的计算机预约和用时管理系统。 -提供公共计算机的图书馆、学校、学院和其他组织需要一种管理用户访问权限的好方法 - 否则,就无法阻止某些人独占机器并确保每个人都有公平的时间。这是 [Libki][2] 要解决的问题。 +![](https://img.linux.net.cn/data/attachment/album/201905/20/230201d26yuo261uu6s61i.jpg) -Libki 是一个面向 Windows 和 Linux PC 的开源、跨平台的计算机预约和时间管理系统。它提供了一个基于 Web 的服务器和一个基于 Web 的管理系统,员工可以使用它来管理计算机访问,包括创建和删除用户、设置帐户时间限制、登出和禁止用户以及设置访问限制。 +提供公共计算机的图书馆、学校、学院和其他组织需要一种管理用户访问权限的好方法 —— 否则,就无法阻止某些人独占机器并确保每个人都有公平的用时。这是 [Libki][2] 要解决的问题。 -根据首席开发人员 [Kyle Hall][3] 所说,Libki 主要用于 PC 时间控制,作为 Envisionware 的专有计算机访问控制软件的开源替代品。当用户登录 Libki 管理的计算机时,他们会有一段时间来使用计算机。时间到了之后,他们就会被登出。时间默认设置为 45 分钟,但可以使用基于 Web 的管理系统轻松调整。一些组织在登出用户之前提供 24 小时访问权限,而有的组织则使用它来跟踪使用情况而不设置时间限制。 +Libki 是一个面向 Windows 和 Linux PC 的开源、跨平台的计算机预约和用时管理系统。它提供了一个基于 Web 的服务器和一个基于 Web 的管理系统,员工可以使用它来管理计算机访问,包括创建和删除用户、设置帐户用时限制、登出和禁止用户以及设置访问限制。 -Kyle 目前是 [ByWater Solutions][4] 的首席开发人员,该公司为图书馆提供开源软件解决方案(包括 Libki)。在职业生涯早期,他在宾夕法尼亚州的[米德维尔公共图书馆][5]担任 IT 技术时开发了 Libki。在其他员工的午休期间,偶尔会要求他关注孩子的房间。图书馆使用纸质注册表来管理对儿童房间计算机的访问,这意味着不断的监督和检查,以确保来到那里的人能够公平地使用。 +根据其首席开发人员 [Kyle Hall][3] 所说,Libki 主要用于 PC 用时控制,作为 Envisionware 出品的专有计算机访问控制软件的开源替代品。当用户登录 Libki 管理的计算机时,他们会有一段使用计算机的时间。时间到了之后,他们就会被登出。时间默认设置为 45 分钟,但可以使用基于 Web 的管理系统轻松调整。一些组织在登出用户之前提供 24 小时访问权限,而有的组织则使用它来跟踪使用情况而不设置用时限制。 -Kyle 说,“我发现这个系统很麻烦、很尴尬,我想找到一个解决方案。这个解决方案需要同时是 FOSS 和跨平台的。最后,没有现有的软件适合我们的特殊需求,那就是为什么我开发了 Libki。“ +Kyle 目前是 [ByWater Solutions][4] 的首席开发人员,该公司为图书馆提供开源软件解决方案(包括 Libki)。在职业生涯早期,他在宾夕法尼亚州的[米德维尔公共图书馆][5]担任 IT 技术时开发了 Libki。在其他员工的午休期间,偶尔会要求他关注孩子们的房间。图书馆使用纸质注册表来管理对儿童房间计算机的访问,这意味着不断的监督和检查,以确保来到那里的人能够公平地使用。 -或者,正如 Libki 的网站所宣称的那样,“Libki 的诞生是为了避免与青少年互动,现在允许图书馆员避免与世界各地的青少年互动!” +Kyle 说,“我发现这很笨拙而不便的,我想找到一个解决方案。这个解决方案需要同时是 FOSS 和跨平台的。最后,没有现有的软件适合我们的特殊需求,那就是为什么我开发了 Libki。“ + +或者,正如 Libki 的网站所宣称的那样,“Libki 的诞生是为了避免与青少年打交道(的麻烦),现在允许图书馆员避免与世界各地的青少年打交道(的麻烦)!” ### 易于安装和使用 @@ -30,7 +31,7 @@ Kyle 说,“我发现这个系统很麻烦、很尴尬,我想找到一个解 我计划在我们当地的图书馆支持 Libki,但我想知道在那些没有 IT 相关经验的人或者无法构建和部署服务器的图书馆是怎样的。Kyle 说:“ByWater Solutions 可以云端托管 Libki 服务器,这使得每个人的维护和管理变得更加简单。” -Kyle 表示,ByWater 并不打算将 Libki 与其最受欢迎的产品,开源集成图书馆系统 (ILS)Koha 或其支持的任何其他[项目][7]捆绑在一起。他说: “Libki 和 Koha 是不同[类型]的软件,满足不同的需求,但它们在图书馆中确实很好地协同工作。事实上,我很早就开发了 Libki 的 SIP2 集成,因此它可以支持使用 Koha 进行单点登录,“ 。 +Kyle 表示,ByWater 并不打算将 Libki 与其最受欢迎的产品,开源集成图书馆系统 (ILS)Koha 或其支持的任何其他[项目][7]捆绑在一起。他说: “Libki 和 Koha 是不同[类型]的软件,满足不同的需求,但它们在图书馆中确实很好地协同工作。事实上,我很早就开发了 Libki 的 SIP2 集成,因此它可以支持使用 Koha 进行单点登录。“ ### 如何贡献 @@ -40,10 +41,10 @@ Libki 客户端是 GPLv3 许可,Libki 服务器是 AGPLv3 许可。Kyle 说他 via: https://opensource.com/article/19/5/libki-computer-access -作者:[Don Watkins ][a] +作者:[Don Watkins][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/) 荣誉推出 From 6cac19045b1e573fb91c8020413639064c212c81 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 May 2019 23:03:59 +0800 Subject: [PATCH 0535/1154] PUB:20190502 Get started with Libki to manage public user computer access.md @geekpi https://linux.cn/article-10880-1.html --- ...tarted with Libki to manage public user computer access.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190502 Get started with Libki to manage public user computer access.md (98%) diff --git a/translated/tech/20190502 Get started with Libki to manage public user computer access.md b/published/20190502 Get started with Libki to manage public user computer access.md similarity index 98% rename from translated/tech/20190502 Get started with Libki to manage public user computer access.md rename to published/20190502 Get started with Libki to manage public user computer access.md index 94ea4a240b..347196d553 100644 --- a/translated/tech/20190502 Get started with Libki to manage public user computer access.md +++ b/published/20190502 Get started with Libki to manage public user computer access.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10880-1.html) [#]: subject: (Get started with Libki to manage public user computer access) [#]: via: (https://opensource.com/article/19/5/libki-computer-access) [#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) From f4d8c98d0252229fbafb13f3aef51ba17ebc7133 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 May 2019 23:25:32 +0800 Subject: [PATCH 0536/1154] APL:20190520 xsos - A Tool To Read SOSReport In Linux.md --- .../tech/20190520 xsos - A Tool To Read SOSReport In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md b/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md index af4c38f06d..69e21e3b1c 100644 --- a/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md +++ b/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2414824421056fcaa77a696b207c128d83d85ea5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 May 2019 23:44:02 +0800 Subject: [PATCH 0537/1154] TSL:20190520 xsos - A Tool To Read SOSReport In Linux.md --- ...sos - A Tool To Read SOSReport In Linux.md | 82 ++++++++----------- 1 file changed, 35 insertions(+), 47 deletions(-) rename {sources => translated}/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md (79%) diff --git a/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md b/translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md similarity index 79% rename from sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md rename to translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md index 69e21e3b1c..a37a77b769 100644 --- a/sources/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md +++ b/translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md @@ -7,74 +7,62 @@ [#]: via: (https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -xsos – A Tool To Read SOSReport In Linux +xsos:一个在 Linux 上阅读 SOSReport 的工具 ====== -We all are already know about **[sosreport][1]**. It’s used to collect system information that can be used for diagnostic. +我们都已经知道 [sosreport][1]。它用来收集可用于诊断的系统信息。Redhat 支持建议我们在提交案例时提供 sosreport 来分析当前的系统状态。 -Redhat support advise us to provide a sosreport when we raise a case with them to analyze the current system status. +它收集全部类型的报告,以帮助用户找出问题的根本原因。我们可以轻松地提取和阅读 sosreport,但它很难阅读。因为它给每个部分都创建了一个单独的文件。 -It’s collecting all kind of reports that can help user to identify the root causes of issue. +那么,在 Linux 中使用语法高亮显示阅读所有这些内容的最佳方法是什么。是的,这可以通过 xsos 工具做到。 -We can easily extract and read the sosreport but it’s very difficult to read. Since it has created a separate file for everything. +### sosreport -If you are looking for performance bottleneck tool then i would recommend you to check the **[oswbb (OSWatcher) utility][2]**. +`sosreport` 命令是一个从运行中的系统(尤其是 RHEL 和 OEL 系统)收集大量配置细节、系统信息和诊断信息的工具。它可以帮助技术支持工程师在很多方面分析系统。 -So, what is the best way to read all together with syntax highlighting in Linux. +此报告包含有关系统的大量信息,例如引导信息、文件系统、内存、主机名、已安装的 rpm、系统 IP、网络详细信息、操作系统版本、已安装的内核、已加载的内核模块、打开的文件列表、PCI 设备列表、挂载点及其细节、运行中的进程信息、进程树输出、系统路由、位于 `/etc` 文件夹中的所有配置文件,以及位于 `/var` 文件夹中的所有日志文件。 -Yes, it can be achieved via xsos tool. +这将需要一段时间来生成报告,这取决于您的系统安装和配置。 -### What Is sosreport? +完成后,`sosreport` 将在 `/tmp` 目录下生成一个压缩的归档文件。 -The sosreport command is a tool that collects bunch of configuration details, system information and diagnostic information from running system (especially RHEL & OEL system). +### xsos -It helps technical support engineer to analyze the system in many aspect. +[xsos][3] 是一个帮助用户轻松读取 Linux 系统上的 `sosreport` 的工具。另一方面,我们可以说它是 `sosreport` 考官。 -This reports contains bunch of information about the system such as boot information, filesystem, memory, hostname, installed rpms, system IP, networking details, OS version, installed kernel, loaded kernel modules, list of open files, list of PCI devices, mount point and it’s details, running process information, process tree output, system routing, all the configuration files which is located in /etc folder, and all the log files which is located in /var folder. +它可以立即从 `sosreport` 或正在运行的系统中汇总系统信息。 -This will take a while to generate a report and it’s depends on your system installation and configuration. +`xsos` 将尝试简化、解析、计算和格式化来自数十个文件(和命令)的数据,以便为你提供有关系统的详细概述。 -Once completed, sosreport will generate a compressed archive file under /tmp directory. - -### What Is xsos? - -[xsos][3] is a tool that help user to easily read sosreport on Linux systems. In other hand, we can say sosreport examiner. - -It instantly summarize system info from a sosreport or a running system. - -xsos will attempt to make it easy, parsing and calculating and formatting data from dozens of files (and commands) to give you a detailed overview about a system. - -You can instantly summarize your system information by running the following command. +你可以通过运行以下命令立即汇总系统信息。 ``` # curl -Lo ./xsos bit.ly/xsos-direct; chmod +x ./xsos; ./xsos -ya ``` -[![][4]![][4]][5] +![][5] -### How To Install xsos In Linux? +### 如何在 Linux 上安装 xsos -We can easily install xsos using the following two methods. +我们可以使用以下两种方法轻松安装 `xsos`。 -If you are looking for latest bleeding-edge version. Use the following steps. +如果你正在寻找最新的前沿版本。使用以下步骤: ``` # curl -Lo /usr/local/bin/xsos bit.ly/xsos-direct - # chmod +x /usr/local/bin/xsos ``` -This is the recommended method to install xsos. It will install xsos from rpm file. +下面是安装 `xsos` 的推荐方法。它将从 rpm 文件安装 `xsos`。 ``` # yum install http://people.redhat.com/rsawhill/rpms/latest-rsawaroha-release.rpm - # yum install xsos ``` -### How To Use xsos In Linux? +### 如何在 Linux 上使用 xsos -Once xsos is installed by one of the above methods. Simply run the xsos command without any options, which show you the basic information about your system. +一旦通过上述方法之一安装了 xsos。只需运行 `xsos` 命令,不带任何选项,它们会显示有关系统的基本信息。 ``` # xsos @@ -115,30 +103,30 @@ OS us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% ``` -### How To Use xsos Command To View Generated sosreport Output In Linux? +### 如何使用 xsos 命令在 Linux 中查看生成的 sosreport 输出? -We need the sosreport to read further using xsos command. To do so, navigate the following URL to install and generate sosreport on Linux. +我们需要份 sosreport 以使用 `xsos` 命令进一步阅读。 -Yes, i have already generated a sosreport and file is below. +是的,我已经生成了一个 sosreport,文件如下。 ``` # ls -lls -lh /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz 9.8M -rw-------. 1 root root 9.8M May 12 10:13 /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz ``` -Run the following command to untar it. +运行如下命令解开它。 ``` # tar xf sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz ``` -To view all the info, run xsos with `-a, --all` switch. +要查看全部信息,带上 `-a` 或 `--all` 开关运行 `xsos`: ``` # xsos --all /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa ``` -To view the bios info, run xsos with `-b, --bios` switch. +要查看 bios 信息,带上 `-b` 或 `--bios` 开关运行 `xsos`。 ``` # xsos --bios /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -168,7 +156,7 @@ DMIDECODE MaxCapacity: 0 MiB (0 GiB / 0.00 TiB) ``` -To view the system basic info such as hostname, distro, SELinux, kernel info, uptime, etc, run xsos with `-o, --os` switch. +要查看系统基本信息,如主机名、发行版、SELinux、内核信息、正常运行时间等,请使用 `-o` 或 `--os` 开关运行 `xsos`。 ``` # xsos --os /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -208,7 +196,7 @@ OS us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% ``` -To view the kdump configuration, run xsos with `-k, --kdump` switch. +要查看 kdump 配置,请使用 `-k` 或 `--kdump` 开关运行 `xsos`。 ``` # xsos --kdump /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -245,7 +233,7 @@ KDUMP CONFIG vm.panic_on_oom [0-2] = 0 (no panic) ``` -To view the information about CPU, run xsos with `-c, --cpu` switch. +要查看有关 CPU 的信息,请使用 `-c` 或 `--cpu` 开关运行 `xsos`。 ``` # xsos --cpu /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -280,7 +268,7 @@ MEMORY 0 GiB (0%) used of 2 GiB total ``` -To view the added disks information, run xsos with `-d, --disks` switch. +要查看添加的磁盘信息,请使用 `-d` 和 `-disks` 开关运行 `xsos`。 ``` # xsos --disks /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -294,7 +282,7 @@ STORAGE sdb 10 ``` -To view the network interface configuration, run xsos with `-e, --ethtool` switch. +要查看网络接口配置,请使用 `-e` 或 `--ethtool` 开关运行 `xsos`。 ``` # xsos --ethtool /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -306,7 +294,7 @@ ETHTOOL virbr0-nic tap link=DOWN rx ring UNKNOWN drv tun v1.6 / fw UNKNOWN ``` -To view the information about IP address, run xsos with `-i, --ip` switch. +要查看有关 IP 地址的信息,请使用 `-i` 或 `--ip` 开关运行 `xsos`。 ``` # xsos --ip /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -329,7 +317,7 @@ IP6 virbr0-nic virbr0 52:54:00:ae:01:94 1500 DOWN - - ``` -To view the running processes via ps, run xsos with `-p, --ps` switch. +要通过 `ps` 查看正在运行的进程,请使用 `-p` 或 `--ps` 开关运行 `xsos`。 ``` # xsos --ps /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -392,7 +380,7 @@ via: https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3d808503c50650aff92bc066ec506ef613cfdb90 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 May 2019 08:40:53 +0800 Subject: [PATCH 0538/1154] PRF:20190504 Using the force at the Linux command line.md @Moelf --- ...ing the force at the Linux command line.md | 136 +++++++++--------- 1 file changed, 65 insertions(+), 71 deletions(-) diff --git a/translated/tech/20190504 Using the force at the Linux command line.md b/translated/tech/20190504 Using the force at the Linux command line.md index e246a85e87..94c851344d 100644 --- a/translated/tech/20190504 Using the force at the Linux command line.md +++ b/translated/tech/20190504 Using the force at the Linux command line.md @@ -1,35 +1,38 @@ [#]: collector: (lujun9972) [#]: translator: (Moelf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using the force at the Linux command line) [#]: via: (https://opensource.com/article/19/5/may-the-force-linux) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) -在 Linux 命令行下使用 force 参数 +在 Linux 命令行下使用“原力” ====== -和绝地武士的原力一样,-f 参数是很强大的,并伴随着潜在的毁灭性,在你能用好的时候又很便利。 -![Fireworks][1] -不久的过去,科幻发烧友开始庆祝每年的原力日(5月4日)[_星球大战_][2],英语里和”愿原力和你同在“双关。虽然大多数 Linux 用户可能不是绝地武士,但我们依然可以使用 force。自然,如果 Yoda 直接叫路克天行者输入什么 ”man X翼战机“ 或者 “man 原力"的话电影肯定会无聊不少。或者他可以直接说,"RTFM"(Read the Force Manual,肯定是这个意思对不对)(译者:通常 RTFM 是 Read The Fucking Manual 的缩写,读读该死的手册吧)。 +> 和绝地武士的原力一样,`-f` 参数是很强大的,并伴随着潜在的毁灭性,在你能用好的时候又很便利。 -很多 Linux 指令都有 -f 选项,意思你现在肯定也知道了,force(强制)!很多时候你先尝试执行指令然后失败了,或者提示你需要输入更多选项。通常这都是为了保护你的文件或者告诉用户设备正忙或者文件已经存在之类的设计。 +![Fireworks](https://img.linux.net.cn/data/attachment/album/201905/21/083913jqbwn4ywq1jqnb9y.jpg) -如果你不想被这些提醒打扰或者压根就不在乎,使用 force ! +近些年来,科幻发烧友开始在每年的 5 月 4 日庆祝[星战节][2],其口号是绝地武士的祝福语”愿原力Force和你同在“。虽然大多数 Linux 用户可能不是绝地武士,但我们依然可以使用原力Force。自然,如果尤达大师只是叫天行者卢克输入什么 “man X-Wing 战机“、“man 原力”,或者 RTFM(去读原力手册,肯定是这个意思对不对),那这电影肯定没啥意思。(LCTT 译注:RTFM 是 “Read The Fucking Manual” 的缩写 —— 读读该死的手册吧)。 -不过要小心,通常使用 force 选项是摧毁性的。所以用户一定要格外注意并且确保你知道自己在做什么。用 force 就要承担后果! +很多 Linux 命令都有 `-f` 选项,意思你现在肯定也知道了,原力(LCTT 译注:force 选项原意是“强制”)!很多时候你先尝试执行命令然后失败了,或者提示你需要补充输入更多选项。通常这都是为了保护你试着改变的文件,或者告诉用户该设备正忙或文件已经存在之类的。 -以下是一些常见 Linux 命令的 force 选项和他们的效果,以及常见使用场景。 +如果你不想被这些提醒打扰或者压根就不在乎,就使用原力吧! + +不过要小心,通常使用原力选项是摧毁性的。所以用户一定要格外注意!并且确保你知道自己在做什么!用原力就要承担后果! + +以下是一些常见 Linux 命令的原力选项和它们的效果,以及常见使用场景。 ### cp -**cp** 是 copy 的缩写,这是个被用来复制文件或者目录的命令。[man 页面][3] 说: -``` --f, --force -如果已经存在的目标文件无法被打开,删除并重试 -``` -你可能会用它来处理只读状态的文件: +`cp` 是 “copy” 的缩写,这是个被用来复制文件或者目录的命令。其 [man 页面][3] 说: + +> -f, --force +> +> 如果已经存在的目标文件无法被打开,删除它并重试 + +你可能会用它来处理只读状态的文件: ``` [alan@workstation ~]$ ls -l @@ -42,15 +45,14 @@ Icy Planet Green Planet ``` -如果你想要复制一个叫做 _Hoth_ 的文件到 _Naboo_,但因为 _Naboo_ 目前是只读状态,**cp** 指令不会执行: - +如果你想要复制一个叫做 `Hoth` 的文件到 `Naboo`,但因为 `Naboo` 目前是只读状态,`cp` 命令不会执行: ``` [alan@workstation ~]$ cp Hoth Naboo cp: cannot create regular file 'Naboo': Permission denied ``` -但通过使用 force 选项,**cp** 会强制执行。_Hoth_ 的内容和文件权限会直接被复制到 _Naboo_: +但通过使用原力,`cp` 会强制执行。`Hoth` 的内容和文件权限会直接被复制到 `Naboo`: ``` @@ -68,49 +70,45 @@ total 8 ### ln -**ln** 指令是用来在文件之间建立链接的,[man 页面][4] 描述的 force 选项如下: +`ln` 命令是用来在文件之间建立链接的,其 [man 页面][4] 描述的原力选项如下: -``` --f, --force -移除当前存在的文件 -``` +> -f, --force +> +> 移除当前存在的文件 -假设 Leia 公主在 维护一个 Java 应用服务器并且当前在一个有所有 Java 版本的目录里,她可能会想这么做: +假设莱娅公主在维护一个 Java 应用服务器,并且她又一个存放这所有 Java 版本的目录,比如: ``` leia@workstation:/usr/lib/java$ ls -lt total 28 -lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 ``` -正如你所看到的,这里有很多个版本的 JDK 和一些符号链接指向最新版的 JDK。她接着用一个脚本来安装最新版本的 JDK。但是如果没有 force 选项的话以下命令是不会成功的: - +正如你所看到的,这里有很多个版本的 JDK,并有一个符号链接指向最新版的 JDK。她接着用一个脚本来安装最新版本的 JDK。但是如果没有原力选项的话以下命令是不会成功的: ``` tar xvzmf jdk1.8.0_181.tar.gz -C jdk1.8.0_181/ ln -vs jdk1.8.0_181 jdk ``` -**tar** 命令会解压 .gz 文件到一个特定的目标目录,但 **ln** 指令会失败因为这个链接已经存在了。这样的结果是链接不会指向最新版本的 JDK: - +`tar` 命令会解压 .gz 文件到一个特定的目标目录,但 `ln` 命令会失败,因为这个链接已经存在了。这样的结果是该符号链接不会指向最新版本的 JDK: ``` leia@workstation:/usr/lib/java$ ln -vs jdk1.8.0_181 jdk ln: failed to create symbolic link 'jdk/jdk1.8.0_181': File exists leia@workstation:/usr/lib/java$ ls -lt total 28 -drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 -lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 -drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 ``` -她可以通过使用 force 选项强制 **ln** 更新链接,但这里她还需要使用 -n,-n 是因为这个情况下链接其实指向一个目录而非文件。这样的话,链接就会正确指向最新版本的JDK了。 - +她可以通过使用原力选项强制 `ln` 更新链接,但这里她还需要使用 `-n`,`-n` 是因为这个情况下链接其实指向一个目录而非文件。这样的话,链接就会正确指向最新版本的JDK了。 ``` leia@workstation:/usr/lib/java$ ln -vsnf jdk1.8.0_181 jdk @@ -123,29 +121,28 @@ drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 ``` -你可以配置 Java 应用使其一直使用在 **/usr/lib/java/jdk** 处的 JDK 而不用每次升级都要更新链接。 +你可以配置 Java 应用使其一直使用在 `/usr/lib/java/jdk` 处的 JDK,而不用每次升级都更新。 ### rm -**rm** 指令是 remove 的缩写,叫做移除但也有一部分人喜欢叫它删除。[man 页面][5] 对 force 选项的描述如下: +`rm` 命令是 “remove” 的缩写(也叫做删除,因为某些系统 `del` 命令也干这事)。其 [man 页面][5] 对原力选项的描述如下: -``` --f, --force -无视不存在的文件或者选项,不向用户确认 -``` -如果你尝试删除一个只读的文件,**rm** 会寻求用户的确认: +> -f, --force +> +> 无视不存在的文件或者参数,不向用户确认 +如果你尝试删除一个只读的文件,`rm` 会寻求用户的确认: ``` [alan@workstation ~]$ ls -l total 4 --r--r----- 1 alan alan 16 May 1 11:38 B-wing -[alan@workstation ~]$ rm B-wing +-r--r----- 1 alan alan 16 May 1 11:38 B-wing +[alan@workstation ~]$ rm B-wing rm: remove write-protected regular file 'B-wing'? ``` -你一定要输入 **y** 或者 **n** 来回答确认才能让 **rm** 命令继续。如果你使用 force 选项,**rm** 就不会寻求你的确认而直接删除文件: +你一定要输入 `y` 或者 `n` 来回答确认才能让 `rm` 命令继续。如果你使用原力选项,`rm` 就不会寻求你的确认而直接删除文件: ``` [alan@workstation ~]$ rm -f B-wing @@ -154,39 +151,35 @@ total 0 [alan@workstation ~]$ ``` -最常见的 **rm** force 选项是用来删除目录。 **-r** (递归)选项会让 **rm** 删除目录,和 force 选项结合起来,它会删除这个文件夹及其内容而无需用户确认。 +最常见的 `rm` 原力选项用法是用来删除目录。 `-r`(递归)选项会让 `rm` 删除目录,当和原力选项结合起来,它会删除这个文件夹及其内容而无需用户确认。 -**rm** 命令和一些选项结合起来是致命的,一直以来互联网上都有关于误用 **rm** 删除整个系统之类的玩笑和鬼故事。比如最出名的一不当心执行 **rm -rf .** 会直接删除目录和文件(没有用户确认)。 +`rm` 命令和一些选项结合起来是致命的,一直以来互联网上都有关于误用 `rm` 删除整个系统之类的玩笑和鬼故事。比如最出名的一不当心执行 `rm -rf .` 会直接删除目录和文件(没有用户确认)。(LCTT 译注:真的这么干过的校对飘过~~请按下回车前再三确认:我是谁,我在哪里,我在干什么) ### userdel -**userdel** 指令使用来删除用户的。[man 页面][6] 是这样描述它的 force 选项的: +`userdel` 命令使用来删除用户的。其 [man 页面][6] 是这样描述它的原力选项的: - -``` --f, --force -这个选项会强制移除用户,即便用户当前处于登入状态。它同时还会强制 -删除用户的目录和邮件,即便这个用户目录被别人共享或者邮件卷并不只 -属于这个用户。如果 USERGROUPS_ENAB 在 /etc/login.defs 里是 yes +> -f, --force +> +> 这个选项会强制移除用户,即便用户当前处于登入状态。它同时还会强制 +删除用户的目录和邮件存储,即便这个用户目录被别人共享或者邮件存储并不 +属于这个用户。如果 `USERGROUPS_ENAB` 在 `/etc/login.defs` 里是 `yes` 并且有一个组和此用户同名的话,这个组也会被移除,即便这个组还是别 的用户的主要用户组也一样。 +> +> 注意:这个选项有风险并可能让系统处于不稳定状态。 -注意:这个选项有风险并可能让系统处于不稳定状态。 -``` - -当欧比旺抵达穆斯塔法星的时候,他知道自己的使命。他需要删掉达斯·维达的用户账户——但达斯还登录在里面。 - +当欧比旺抵达穆斯塔法星的时候,他知道自己的使命。他需要删掉达斯·维达的用户账户——而达斯还在里面呢。 ``` [root@workstation ~]# ps -fu darth -UID PID PPID C STIME TTY TIME CMD -darth 7663 7655 0 13:28 pts/3 00:00:00 -bash +UID PID PPID C STIME TTY TIME CMD +darth 7663 7655 0 13:28 pts/3 00:00:00 -bash [root@workstation ~]# userdel darth userdel: user darth is currently used by process 7663 ``` -因为达斯还登入在系统里,欧比旺需要使用 force 选项操作 **userdel**。这能强制删除正登入的用户。 - +因为达斯还登在系统里,欧比旺需要使用原力选项操作 `userdel`。这能强制删除当前登入的用户。 ``` [root@workstation ~]# userdel -f darth @@ -197,21 +190,22 @@ finger: darth: no such user. error: user name does not exist ``` -正如我们所见到的一样,**finger** 和 **ps** 命令让我们确认了达斯已经被删除了。 +正如我们所见到的一样,`finger` 和 `ps` 命令让我们确认了达斯已经被删除了。 -### 在 Shell 脚本里使用 force -很多指令都有 force 选项,而在 shell 脚本里他们特别游泳。因为我们经常使用脚本完成定期或者自动化的任务,避免用户输入至关重要,不然的话自动任务就无法完成了 +### 在 Shell 脚本里使用原力 -我希望上面的几个例子能帮你理解在一些情况下 force 的用法。你在使用 force 或把他们写入脚本之前应当完全理解他们的作用。误用 force 会有毁灭性的后果——时常是对整个系统,甚至不仅限于一台设备。 +很多命令都有原力选项,而在 shell 脚本里他们特别有用。因为我们经常使用脚本完成定期或者自动化的任务,避免用户输入至关重要,不然的话自动任务就无法完成了 + +我希望上面的几个例子能帮你理解一些需要使用原力的情况。你在命令行使用原力或把它们写入脚本之前应当完全理解它们的作用。误用原力会有毁灭性的后果——时常是对整个系统,甚至不仅限于一台设备。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/5/may-the-force-linux -作者:[Alan Formy-Duval ][a] +作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[Jerry Ling](https://github.com/Moelf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 44a5cc8f75583790fe3fe4052b2bc8ad6b62f66a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 May 2019 08:41:28 +0800 Subject: [PATCH 0539/1154] PUB:20190504 Using the force at the Linux command line.md @Moelf https://linux.cn/article-10881-1.html --- .../20190504 Using the force at the Linux command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190504 Using the force at the Linux command line.md (99%) diff --git a/translated/tech/20190504 Using the force at the Linux command line.md b/published/20190504 Using the force at the Linux command line.md similarity index 99% rename from translated/tech/20190504 Using the force at the Linux command line.md rename to published/20190504 Using the force at the Linux command line.md index 94c851344d..8b340047f6 100644 --- a/translated/tech/20190504 Using the force at the Linux command line.md +++ b/published/20190504 Using the force at the Linux command line.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Moelf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10881-1.html) [#]: subject: (Using the force at the Linux command line) [#]: via: (https://opensource.com/article/19/5/may-the-force-linux) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) From da90fb559ebd16ac293f9bfdc1ab2dc8882ef4e0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 21 May 2019 08:51:40 +0800 Subject: [PATCH 0540/1154] translated --- ...oactively in Python with singledispatch.md | 106 ------------------ ...oactively in Python with singledispatch.md | 106 ++++++++++++++++++ 2 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 sources/tech/20190504 Add methods retroactively in Python with singledispatch.md create mode 100644 translated/tech/20190504 Add methods retroactively in Python with singledispatch.md diff --git a/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md b/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md deleted file mode 100644 index 92f5063d57..0000000000 --- a/sources/tech/20190504 Add methods retroactively in Python with singledispatch.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Add methods retroactively in Python with singledispatch) -[#]: via: (https://opensource.com/article/19/5/python-singledispatch) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Add methods retroactively in Python with singledispatch -====== -Learn more about solving common Python problems in our series covering -seven PyPI libraries. -![][1] - -Python is one of the most [popular programming languages][2] in use today—and for good reasons: it's open source, it has a wide range of uses (such as web programming, business applications, games, scientific programming, and much more), and it has a vibrant and dedicated community supporting it. This community is the reason we have such a large, diverse range of software packages available in the [Python Package Index][3] (PyPI) to extend and improve Python and solve the inevitable glitches that crop up. - -In this series, we'll look at seven PyPI libraries that can help you solve common Python problems. Today, we'll examine [**singledispatch**][4], a library that allows you to add methods to Python libraries retroactively. - -### singledispatch - -Imagine you have a "shapes" library with a **Circle** class, a **Square** class, etc. - -A **Circle** has a **radius** , a **Square** has a **side** , and a **Rectangle** has **height** and **width**. Our library already exists; we do not want to change it. - -However, we do want to add an **area** calculation to our library. If we didn't share this library with anyone else, we could just add an **area** method so we could call **shape.area()** and not worry about what the shape is. - -While it is possible to reach into a class and add a method, this is a bad idea: nobody expects their class to grow new methods, and things might break in weird ways. - -Instead, the **singledispatch** function in **functools** can come to our rescue. - - -``` -@singledispatch -def get_area(shape): -raise NotImplementedError("cannot calculate area for unknown shape", -shape) -``` - -The "base" implementation for the **get_area** function fails. This makes sure that if we get a new shape, we will fail cleanly instead of returning a nonsense result. - - -``` -@get_area.register(Square) -def _get_area_square(shape): -return shape.side ** 2 -@get_area.register(Circle) -def _get_area_circle(shape): -return math.pi * (shape.radius ** 2) -``` - -One nice thing about doing things this way is that if someone writes a _new_ shape that is intended to play well with our code, they can implement **get_area** themselves. - - -``` -from area_calculator import get_area - -@attr.s(auto_attribs=True, frozen=True) -class Ellipse: -horizontal_axis: float -vertical_axis: float - -@get_area.register(Ellipse) -def _get_area_ellipse(shape): -return math.pi * shape.horizontal_axis * shape.vertical_axis -``` - -_Calling_ **get_area** is straightforward. - - -``` -`print(get_area(shape))` -``` - -This means we can change a function that has a long **if isintance()/elif isinstance()** chain to work this way, without changing the interface. The next time you are tempted to check **if isinstance** , try using **singledispatch**! - -In the next article in this series, we'll look at **tox** , a tool for automating tests on Python code. - -#### Review the previous articles in this series: - - * [Cython][5] - * [Black][6] - * [attrs][7] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/python-singledispatch - -作者:[Moshe Zadka ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV -[2]: https://opensource.com/article/18/5/numbers-python-community-trends -[3]: https://pypi.org/ -[4]: https://pypi.org/project/singledispatch/ -[5]: https://opensource.com/article/19/4/7-python-problems-solved-cython -[6]: https://opensource.com/article/19/4/python-problems-solved-black -[7]: https://opensource.com/article/19/4/python-problems-solved-attrs diff --git a/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md b/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md new file mode 100644 index 0000000000..40fae67d1a --- /dev/null +++ b/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Add methods retroactively in Python with singledispatch) +[#]: via: (https://opensource.com/article/19/5/python-singledispatch) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +使用 singledispatch 在 Python 中追溯地添加方法 +====== +在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 +![][1] + +Python 是当今使用最多[流行的编程语言][2]之一,因为:它是开源的,它具有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中提供如此庞大、多样化的软件包的原因,用以扩展和改进 Python。并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [**singledispatch**][4],这是一个能让你追溯地向 Python 库添加方法的库。 + +### singledispatch + +想象一下,你有一个有 **Circle**、**Square** 等类的“形状”库。 + +**Circle** 类有**半径**、**Square** 有 **边**、**Rectangle**有**高**和**宽**。我们的库已经存在,我们不想改变它。 + +然而,我们想给库添加一个**面积**计算。如果我们不会和其他人共享这个库,我们只需添加 **area** 方法,这样我们就能调用 **shape.area()** 而无需关心是什么形状。 + +虽然可以进入类并添加一个方法,但这是一个坏主意:没有人希望他们的类会被添加新的方法,程序因奇怪的方式出错。 + +相反,**functools** 中的 **singledispatch** 函数可以帮助我们。 + + +``` +@singledispatch +def get_area(shape): + raise NotImplementedError("cannot calculate area for unknown shape", + shape) +``` + +**get_area** 函数的“基类”实现会报错。这保证了如果我们出现一个新的形状时,我们会明确地报错而不是返回一个无意义的结果。 + + +``` +@get_area.register(Square) +def _get_area_square(shape): + return shape.side ** 2 +@get_area.register(Circle) +def _get_area_circle(shape): + return math.pi * (shape.radius ** 2) +``` + +这种方式的好处是如果某人写了一个匹配我们代码的_新_形状,它们可以自己实现 **get_area**。 + + +``` +from area_calculator import get_area + +@attr.s(auto_attribs=True, frozen=True) +class Ellipse: + horizontal_axis: float + vertical_axis: float + +@get_area.register(Ellipse) +def _get_area_ellipse(shape): + return math.pi * shape.horizontal_axis * shape.vertical_axis +``` + +_调用_ **get_area** 很直接。 + + +``` +`print(get_area(shape))` +``` + +这意味着我们可以将有大量 **if isintance()/elif isinstance()** 的代码以这种方式修改,而无需修改接口。下一次你要修改 **if isinstance**,你试试 **singledispatch**! + +在本系列的下一篇文章中,我们将介绍 **tox**,一个用于自动化 Python 代码测试的工具。 + + +#### 回顾本系列的前几篇文章: + + * [Cython][5] + * [Black][6] + * [attrs][7] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-singledispatch + +作者:[Moshe Zadka ][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/singledispatch/ +[5]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[6]: https://opensource.com/article/19/4/python-problems-solved-black +[7]: https://opensource.com/article/19/4/python-problems-solved-attrs From 504eb415f6fdb8da23f97129a6f20c9b532dadaa Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 21 May 2019 08:57:41 +0800 Subject: [PATCH 0541/1154] translating --- sources/tech/20190516 Building Smaller Container Images.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190516 Building Smaller Container Images.md b/sources/tech/20190516 Building Smaller Container Images.md index 30ea03f993..49700ce58a 100644 --- a/sources/tech/20190516 Building Smaller Container Images.md +++ b/sources/tech/20190516 Building Smaller Container Images.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4929423dfcbe6ffd4af48dea3ba69fc34139be0c Mon Sep 17 00:00:00 2001 From: David Dai Date: Tue, 21 May 2019 09:36:08 +0800 Subject: [PATCH 0542/1154] Finish translating Kubernetes on Fedora IoT with k3s_translated --- ...90415 Kubernetes on Fedora IoT with k3s.md | 106 +++++++++--------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md index c2f75bc1d4..82729f24a3 100644 --- a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md +++ b/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md @@ -7,100 +7,98 @@ [#]: via: (https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/) [#]: author: (Lennart Jern https://fedoramagazine.org/author/lennartj/) -Kubernetes on Fedora IoT with k3s +使用 k3s 在 Fedora IoT 上运行 Kubernetes ====== ![][1] -Fedora IoT is an upcoming Fedora edition targeted at the Internet of Things. It was introduced last year on Fedora Magazine in the article [How to turn on an LED with Fedora IoT][2]. Since then, it has continued to improve together with Fedora Silverblue to provide an immutable base operating system aimed at container-focused workflows. +Fedora IoT 是一个即将发布的、面相物联网的 Fedora 版本。去年 Fedora Magazine 中的《如何使用 Fedora IOT 点亮 LED》一文,第一次介绍了它。从那以后,它与 Fedora Silverblue 一起不断改进,以提供针对面相容器的工作流程的不可变基础操作系统。 -Kubernetes is an immensely popular container orchestration system. It is perhaps most commonly used on powerful hardware handling huge workloads. However, it can also be used on lightweight devices such as the Raspberry Pi 3. Read on to find out how. +Kubernetes 是一个颇受欢迎的容器编排系统。它可能最常用在那些能够处理巨大负载的强劲硬件上。不过,它也能在像树莓派 3 这样轻量级的设备上运行。我们继续阅读,来了解如何运行它。 -### Why Kubernetes? +### 为什么用 Kubernetes? -While Kubernetes is all the rage in the cloud, it may not be immediately obvious to run it on a small single board computer. But there are certainly reasons for doing it. First of all it is a great way to learn and get familiar with Kubernetes without the need for expensive hardware. Second, because of its popularity, there are [tons of applications][3] that comes pre-packaged for running in Kubernetes clusters. Not to mention the large community to provide help if you ever get stuck. +虽然 Kubernetes 在云计算领域风靡一时,但让它在小型单板机上运行可能并不是显而易见的。不过,我们有非常明确的理由来做这件事。首先,这是一个不需要昂贵硬件就可以学习并熟悉 Kubernetes 的好方法;其次,由于它的流行性,市面上有[大量应用][2]进行了预先打包,以用于在 Kubernetes 集群中运行。更不用说,当你遇到问题时,会有大规模的社区用户为你提供帮助。 -Last but not least, container orchestration may actually make things easier, even at the small scale in a home lab. This may not be apparent when tackling the the learning curve, but these skills will help when dealing with any cluster in the future. It doesn’t matter if it’s a single node Raspberry Pi cluster or a large scale machine learning farm. +最后但同样重要的是,即使是在家庭实验室这样的小规模环境中,容器编排也确实能事情变得更加简单。虽然在学习曲线方面,这一点并不明显,但这些技能在你将来与任何集群打交道的时候都会有帮助。不管你面对的是一个单节点树莓派集群,还是一个大规模的机器学习场,它们的操作方式都是类似的。 -#### K3s – a lightweight Kubernetes +#### K3s - 轻量级的 Kubernetes -A “normal” installation of Kubernetes (if such a thing can be said to exist) is a bit on the heavy side for IoT. The recommendation is a minimum of 2 GB RAM per machine! However, there are plenty of alternatives, and one of the newcomers is [k3s][4] – a lightweight Kubernetes distribution. +一个 Kubernetes 的“正常”安装(如果有这么一说的话)对于物联网来说有点沉重。K8s 的推荐内存配置,是每台机器 2GB!不过,我们也有一些替代品,其中一个新人是 [k3s][4]——一个轻量级的 Kubernetes 发行版。 -K3s is quite special in that it has replaced etcd with SQLite for its key-value storage needs. Another thing to note is that k3s ships as a single binary instead of one per component. This diminishes the memory footprint and simplifies the installation. Thanks to the above, k3s should be able to run k3s with just 512 MB of RAM, perfect for a small single board computer! +K3s 非常特殊,因为它将 etcd 替换成了 SQLite 以满足键值存储需求。还有一点,在于整个 k3s 将使用一个二进制文件分发,而不是每个组件一个。这减少了内存占用并简化了安装过程。基于上述原因,我们只需要 512MB 内存即可运行 k3s,简直适合小型单板电脑! -### What you will need +### 你需要的东西 - 1. Fedora IoT in a virtual machine or on a physical device. See the excellent getting started guide [here][5]. One machine is enough but two will allow you to test adding more nodes to the cluster. - 2. [Configure the firewall][6] to allow traffic on ports 6443 and 8472. Or simply disable it for this experiment by running “systemctl stop firewalld”. +1. 在虚拟机或实体设备中运行的 Fedora IoT。在[这里][5]可以看到优秀的入门指南。一台机器就足够了,不过两台可以用来测试向集群添加更多节点。 +2. [配置防火墙][6],允许 6443 和 8372 端口的通信。或者,你也可以简单地运行“systemctl stop firewalld”来为这次实验关闭防火墙。 +### 安装 k3s - -### Install k3s - -Installing k3s is very easy. Simply run the installation script: +安装 k3s 非常简单。直接运行安装脚本: ``` curl -sfL https://get.k3s.io | sh - ``` -This will download, install and start up k3s. After installation, get a list of nodes from the server by running the following command: +它会下载、安装并启动 k3s。安装完成后,运行以下命令来从服务器获取节点列表: ``` kubectl get nodes ``` -Note that there are several options that can be passed to the installation script through environment variables. These can be found in the [documentation][7]. And of course, there is nothing stopping you from installing k3s manually by downloading the binary directly. +需要注意的是,有几个选项可以通过环境变量传递给安装脚本。这些选项可以在[文档][7]中找到。当然,你也完全可以直接下载二进制文件来手动安装 k3s。 -While great for experimenting and learning, a single node cluster is not much of a cluster. Luckily, adding another node is no harder than setting up the first one. Just pass two environment variables to the installation script to make it find the first node and avoid running the server part of k3s +对于实验和学习来说,这样已经很棒了,不过单节点的集群也不是一个集群。幸运的是,添加另一个节点并不比设置第一个节点要难。只需要向安装脚本传递两个环境变量,它就可以找到第一个节点,避免运行 k3s 的服务器部分。 ``` curl -sfL https://get.k3s.io | K3S_URL=https://example-url:6443 \ K3S_TOKEN=XXX sh - ``` -The example-url above should be replaced by the IP address or fully qualified domain name of the first node. On that node the token (represented by XXX) is found in the file /var/lib/rancher/k3s/server/node-token. +上面的 example-url 应被替换为第一个节点的 IP 地址,或一个经过完全限定的域名。在该节点中,(用 XXX 表示的)令牌可以在 /var/lib/rancher/k3s/server/node-token 文件中找到。 -### Deploy some containers +### 部署一些容器 -Now that we have a Kubernetes cluster, what can we actually do with it? Let’s start by deploying a simple web server. +现在我们有了一个 Kubernetes 集群,我们可以真正做些什么呢?让我们从部署一个简单的 Web 服务器开始吧。 ``` kubectl create deployment my-server --image nginx ``` -This will create a [Deployment][8] named “my-server” from the container image “nginx” (defaulting to docker hub as registry and the latest tag). You can see the Pod created by running the following command. +这会从名为“nginx”的容器镜像中创建出一个名叫“my-server”的 [Deployment][8](镜像名默认使用 docker hub 注册中心,以及 latest 标签)。 ``` kubectl get pods ``` -In order to access the nginx server running in the pod, first expose the Deployment through a [Service][9]. The following command will create a Service with the same name as the deployment. +为了接触到 pod 中运行的 nginx 服务器,首先将 Deployment 通过一个 [Service][9] 来进行暴露。以下命令将创建一个与 Deployment 同名的 Service。 ``` kubectl expose deployment my-server --port 80 ``` -The Service works as a kind of load balancer and DNS record for the Pods. For instance, when running a second Pod, we will be able to _curl_ the nginx server just by specifying _my-server_ (the name of the Service). See the example below for how to do this. +Service 将作为一种负载均衡器和 Pod 的 DNS 记录来工作。比如,当运行第二个 Pod 时,我们只需指定 _my-server_(Service 名称)就可以通过 _curl_ 访问 nginx 服务器。有关如何操作,可以看下面的实例。 ``` -# Start a pod and run bash interactively in it +# 启动一个 pod,在里面以交互方式运行 bash kubectl run debug --generator=run-pod/v1 --image=fedora -it -- bash -# Wait for the bash prompt to appear +# 等待 bash 提示符出现 curl my-server -# You should get the "Welcome to nginx!" page as output +# 你可以看到“Welcome to nginx!”的输出页面 ``` -### Ingress controller and external IP +### Ingress 控制器及外部 IP -By default, a Service only get a ClusterIP (only accessible inside the cluster), but you can also request an external IP for the service by setting its type to [LoadBalancer][10]. However, not all applications require their own IP address. Instead, it is often possible to share one IP address among many services by routing requests based on the host header or path. You can accomplish this in Kubernetes with an [Ingress][11], and this is what we will do. Ingresses also provide additional features such as TLS encryption of the traffic without having to modify your application. +默认状态下,一个 Service 只能获得一个 ClusterIP(只能从集群内部访问),但你也可以通过把它的类型设置为 [LoadBalancer][10] 为服务申请一个外部 IP。不过,并非所有应用都需要自己的 IP 地址。相反,通常可以通过基于 Host 请求头部或请求路径进行路由,从而使多个服务共享一个 IP 地址。你可以在 Kubernetes 使用 [Ingress][11] 完成此操作,而这也是我们要做的。Ingress 也提供了额外的功能,比如无需配置应用,即可对流量进行 TLS 加密。 -Kubernetes needs an ingress controller to make the Ingress resources work and k3s includes [Traefik][12] for this purpose. It also includes a simple service load balancer that makes it possible to get an external IP for a Service in the cluster. The [documentation][13] describes the service like this: +Kubernetes 需要入口控制器来使 Ingress 资源工作,k3s 包含 [Traefik][12] 正是出于此目的。它还包含了一个简单的服务负载均衡器,可以为集群中的服务提供外部 IP。这篇[文档][13]描述了这种服务: -> k3s includes a basic service load balancer that uses available host ports. If you try to create a load balancer that listens on port 80, for example, it will try to find a free host in the cluster for port 80. If no port is available the load balancer will stay in Pending. +> k3s 包含一个使用可用主机端口的基础服务负载均衡器。比如,如果你尝试创建一个监听 80 端口的负载均衡器,它会尝试在集群中寻找一个 80 端口空闲的节点。如果没有可用端口,那么负载均衡器将保持在 Pending 状态。 > > k3s README -The ingress controller is already exposed with this load balancer service. You can find the IP address that it is using with the following command. +入口控制器已经通过这个负载均衡器暴露在外。你可以使用以下命令找到它正在使用的 IP 地址。 ``` $ kubectl get svc --all-namespaces @@ -111,13 +109,13 @@ NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) kube-system traefik LoadBalancer 10.43.145.104 10.0.0.8 80:31596/TCP,443:31539/TCP 33d ``` -Look for the Service named traefik. In the above example the IP we are interested in is 10.0.0.8. +找到名为 traefik 的 Service。在上面的例子中,我们感兴趣的 IP 是 10.0.0.8。 -### Route incoming requests +### 路由传入的请求 -Let’s create an Ingress that routes requests to our web server based on the host header. This example uses [xip.io][14] to avoid having to set up DNS records. It works by including the IP adress as a subdomain, to use any subdomain of 10.0.0.8.xip.io to reach the IP 10.0.0.8. In other words, my-server.10.0.0.8.xip.io is used to reach the ingress controller in the cluster. You can try this right now (with your own IP instead of 10.0.0.8). Without an ingress in place you should reach the “default backend” which is just a page showing “404 page not found”. +让我们创建一个 Ingress,使它通过基于 Host 头部的路由规则将请求路由至我们的服务器。这个例子中我们使用 [xip.io][14] 来避免必要的 DNS 记录配置工作。它的工作原理是将 IP 地址作为子域包含,以使用10.0.0.8.xip.io的任何子域来达到IP 10.0.0.8。换句话说,my-server.10.0.0.8.xip.io 被用于访问集群中的入口控制器。你现在就可以尝试(使用你自己的 IP,而不是 10.0.0.8)。如果没有入口,你应该会访问到“默认后端”,只是一个写着“404 page not found”的页面。 -We can tell the ingress controller to route requests to our web server Service with the following Ingress. +我们可以使用以下 Ingress 让入口控制器将请求路由到我们的 Web 服务器 Service。 ``` apiVersion: extensions/v1beta1 @@ -135,47 +133,47 @@ spec: servicePort: 80 ``` -Save the above snippet in a file named _my-ingress.yaml_ and add it to the cluster by running this command: +将以上片段保存到 _my-ingress.yaml_ 文件中,然后运行以下命令将其加入集群: ``` kubectl apply -f my-ingress.yaml ``` -You should now be able to reach the default nginx welcoming page on the fully qualified domain name you chose. In my example this would be my-server.10.0.0.8.xip.io. The ingress controller is routing the requests based on the information in the Ingress. A request to my-server.10.0.0.8.xip.io will be routed to the Service and port defined as backend in the Ingress (my-server and 80 in this case). +你现在应该能够在你选择的完全限定域名中访问到 nginx 的默认欢迎页面了。在我的例子中,它是 my-server.10.0.0.8.xip.io。入口控制器会通过 Ingress 中包含的信息来路由请求。对 my-server.10.0.0.8.xip.io 的请求将被路由到 Ingress 中定义为“后端”的 Service 和端口(在本例中为 my-server 和 80)。 -### What about IoT then? +### 那么,物联网呢? -Imagine the following scenario. You have dozens of devices spread out around your home or farm. It is a heterogeneous collection of IoT devices with various hardware capabilities, sensors and actuators. Maybe some of them have cameras, weather or light sensors. Others may be hooked up to control the ventilation, lights, blinds or blink LEDs. +想象如下场景:你的家伙农场周围有很多的设备。它是一个具有各种硬件功能,传感器和执行器的物联网设备的异构集合。也许某些设备拥有摄像头,天气或光线传感器。其它设备可能会被连接起来,用来控制通风、灯光、百叶窗或闪烁的LED。 -In this scenario, you want to gather data from all the sensors, maybe process and analyze it before you finally use it to make decisions and control the actuators. In addition to this, you may want to visualize what’s going on by setting up a dashboard. So how can Kubernetes help us manage something like this? How can we make sure that Pods run on suitable devices? +这种情况下,你想从所有传感器中收集数据,在最终使用它来制定决策和控制执行器之前,也可能会对其进行处理和分析。除此之外,你可能还想配置一个仪表盘来可视化那些正在发生的事情。那么 Kubernetes 如何帮助我们来管理这样的事情呢?我们怎么保证 Pod 在合适的设备上运行? -The simple answer is labels. You can label the nodes according to capabilities, like this: +简单的答案就是“标签”。你可以根据功能来标记节点,如下所示: ``` kubectl label nodes = -# Example +# 举例 kubectl label nodes node2 camera=available ``` -Once they are labeled, it is easy to select suitable nodes for your workload with [nodeSelectors][15]. The final piece to the puzzle, if you want to run your Pods on _all_ suitable nodes is to use [DaemonSets][16] instead of Deployments. In other words, create one DaemonSet for each data collecting application that uses some unique sensor and use nodeSelectors to make sure they only run on nodes with the proper hardware. +一旦它们被打上标签,我们就可以轻松地使用 [nodeSelector][15] 为你的工作负载选择合适的节点。拼图的最后一块:如果你想在_所有_合适的节点上运行 Pod,那应该使用 [DaemonSet][16] 而不是 Deployment。换句话说,应为每个使用唯一传感器的数据收集应用程序创建一个 DaemonSet,并使用 nodeSelectors 确保它们仅在具有适当硬件的节点上运行。 -The service discovery feature that allows Pods to find each other simply by Service name makes it quite easy to handle these kinds of distributed systems. You don’t need to know or configure IP addresses or custom ports for the applications. Instead, they can easily find each other through named Services in the cluster. +服务发现功能允许 Pod 通过 Service 名称来寻找彼此,这项功能使得这类分布式系统的管理工作变得易如反掌。你不需要为应用配置 IP 地址或自定义端口,也不需要知道它们。相反,它们可以通过集群中的具名 Service 轻松找到彼此。 -#### Utilize spare resources +#### 充分利用空闲资源 -With the cluster up and running, collecting data and controlling your lights and climate control you may feel that you are finished. However, there are still plenty of compute resources in the cluster that could be used for other projects. This is where Kubernetes really shines. +随着集群的启动并运行,收集数据并控制灯光和气候可能使你觉得你已经把它完成了。不过,集群中还有大量的计算资源可以用于其它项目。这才是 Kubernetes 真正出彩的地方。 -You shouldn’t have to worry about where exactly those resources are or calculate if there is enough memory to fit an extra application here or there. This is exactly what orchestration solves! You can easily deploy more applications in the cluster and let Kubernetes figure out where (or if) they will fit. +你不必担心这些资源的确切位置,或者去计算是否有足够的内存来容纳额外的应用程序。这正是编排系统所解决的问题!你可以轻松地在集群中部署更多的应用,让 Kubernetes 来找出适合运行它们的位置(或是否适合运行它们)。 -Why not run your own [NextCloud][17] instance? Or maybe [gitea][18]? You could also set up a CI/CD pipeline for all those IoT containers. After all, why would you build and cross compile them on your main computer if you can do it natively in the cluster? +为什么不运行一个你自己的 [NextCloud][17] 实例呢?或者运行 [gitea][18]?你还可以为你所有的物联网容器设置一套 CI/CD 流水线。毕竟,如果你可以在集群中进行本地构建,为什么还要在主计算机上构建并交叉编译它们呢? -The point here is that Kubernetes makes it easier to make use of the “hidden” resources that you often end up with otherwise. Kubernetes handles scheduling of Pods in the cluster based on available resources and fault tolerance so that you don’t have to. However, in order to help Kubernetes make reasonable decisions you should definitely add [resource requests][19] to your workloads. +这里的要点是,Kubernetes 可以更容易地利用那些你可能浪费掉的“隐藏”资源。Kubernetes 根据可用资源和容错处理规则来调度 Pod,因此你也无需手动完成这些工作。但是,为了帮助 Kubernetes 做出合理的决定,你绝对应该为你的工作负载添加[资源请求][19]配置。 -### Summary +### 总结 -While Kubernetes, or container orchestration in general, may not usually be associated with IoT, it certainly makes a lot of sense to have an orchestrator when you are dealing with distributed systems. Not only does is allow you to handle a diverse and heterogeneous fleet of devices in a unified way, but it also simplifies communication between them. In addition, Kubernetes makes it easier to utilize spare resources. +尽管 Kuberenetes 或一般的容器编排平台通常不会与物联网相关联,但在管理分布式系统时,使用一个编排系统肯定是有意义的。你不仅可以使用统一的方式来处理多样化和异构的设备,还可以简化它们的通信方式。此外,Kubernetes 还可以更好地对闲置资源加以利用。 -Container technology made it possible to build applications that could “run anywhere”. Now Kubernetes makes it easier to manage the “anywhere” part. And as an immutable base to build it all on, we have Fedora IoT. +容器技术使构建“随处运行”应用的想法成为可能。现在,Kubernetes 可以更轻松地来负责“随处”的部分。作为构建一切的不可变基础,我们使用 Fedora IoT。 -------------------------------------------------------------------------------- From c73ee9bca51ebd704b31a30a83fea041b1712334 Mon Sep 17 00:00:00 2001 From: David Dai Date: Tue, 21 May 2019 09:45:30 +0800 Subject: [PATCH 0543/1154] Move file to transalted folder --- .../tech/20190415 Kubernetes on Fedora IoT with k3s.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190415 Kubernetes on Fedora IoT with k3s.md (100%) diff --git a/sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md b/translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md similarity index 100% rename from sources/tech/20190415 Kubernetes on Fedora IoT with k3s.md rename to translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md From d66315d2a27dc4ad36f551a7ed5af2fbf8f2d784 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 21 May 2019 11:11:17 +0800 Subject: [PATCH 0544/1154] Translated --- ... Ubuntu with Slimbook Battery Optimizer.md | 108 ------------------ ... Ubuntu with Slimbook Battery Optimizer.md | 104 +++++++++++++++++ 2 files changed, 104 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md create mode 100644 translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md diff --git a/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md deleted file mode 100644 index d30c7a6f0c..0000000000 --- a/sources/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (zhs852) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Change Power Modes in Ubuntu with Slimbook Battery Optimizer) -[#]: via: (https://itsfoss.com/slimbook-battry-optimizer-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Change Power Modes in Ubuntu with Slimbook Battery Optimizer -====== - -_**Brief: Slimbook Battery is a nifty applet indicator that allows you to quickly change the power mode on your Linux laptop and thus save battery life.**_ - -[Slimbook][1], the Spanish computer vendor that sells [laptops preloaded with Linux][2], has released a handy little application to optimize battery performance in Ubuntu-based Linux distributions. - -Since Slimbook sells its own Linux systems, they have created a few applications to tweak the performance of Linux on their hardware. This battery optimizer is one such tool. - -You don’t need to buy a Slimbook product to use this nifty application because Slimbook has made it available via [their official PPA][3]. - -### Slimbook battery optimizer application - -The application is called Slimbook Battery. It is basically an applet indicator that sits on the top panel and gives you quick access to various power/battery modes. - -![Slimbook Battery Mode Ubuntu][4] - -You might have seen it in Windows where you can put your laptop in one of the power modes. Slimbook Battery also offers similar battery saving modes here: - - * Energy Saving: For maximum battery saving - * Balanced: A compromise between performance and power saving - * Maximum Performance: For maximum performance obviously - - - -You can configure all these modes from the advanced mode: - -![Configure various power modes][5] - -If you feel like you have messed up the configuration, you can set things back to normal with ‘restore default values’ option. - -You can also change the general configuration of the application like auto-start, default power mode etc. - -![Slimbook Battery general configuration][6] - -Skimbook has a dedicated page that provides more information on various power saving parameters. If you want to configure things on your own, you should refer to [this page][7]. - -I have noticed that the interface of Slimbook Battery needs some improvements. For example, the ‘question mark’ icon on some parameters should be clickable to provide more information. But clicking the question mark icon doesn’t do anything at the time of writing this article. - -Altogether, Slimbook Battery is a handy app you can use for quickly switching the power mode. If you decide to install it on Ubuntu and other Ubuntu-based distributions such as Linux Mint, elementary OS etc, you can use its official [PPA][8]. - -[][9] - -Suggested read Ubuntu Forums Hacked, User Data Stolen!!! - -#### Install Slimbook Batter in Ubuntu-based distributions - -Open a terminal and use the following commands one by one: - -``` -sudo add-apt-repository ppa:slimbook/slimbook -sudo apt update -sudo apt install slimbookbattery -``` - -Once installed, search for Slimbook Battery in the menu: - -![Start Slimbook Battery Optimizer][10] - -When you click on it to start it, you’ll find it in the top panel. From here, you can select your desired power mode. - -![Slimbook Battery power mode][4] - -#### Remove Slimbook Battery - -If you don’t want to use this application, you can remove it using the following commands: - -``` -sudo apt remove slimbookbattery -sudo add-apt-repository -r ppa:slimbook/slimbook -``` - -In my opinion, such applications serves a certain purpose and should be encouraged. This tool gives you an easy way to change the power mode and at the same time, it gives you more tweaking options for various performance settings. - -Did you use Slimbook Battery? What’s your experience with it? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/slimbook-battry-optimizer-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://slimbook.es/en/ -[2]: https://itsfoss.com/get-linux-laptops/ -[3]: https://launchpad.net/~slimbook/+archive/ubuntu/slimbook -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-mode-ubuntu.jpg?resize=800%2C400&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-2.jpg?ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-1.jpg?ssl=1 -[7]: https://slimbook.es/en/tutoriales/aplicaciones-slimbook/398-slimbook-battery-3-application-for-optimize-battery-of-your-laptop -[8]: https://itsfoss.com/ppa-guide/ -[9]: https://itsfoss.com/ubuntu-forums-hacked-again/ -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer.jpg?ssl=1 diff --git a/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md new file mode 100644 index 0000000000..bf57e58d12 --- /dev/null +++ b/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: (zhs852) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Change Power Modes in Ubuntu with Slimbook Battery Optimizer) +[#]: via: (https://itsfoss.com/slimbook-battry-optimizer-ubuntu/) +[#]: author: Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 Ubuntu 中使用 Slimbook Battery Optimizer 切换电源模式 +====== + +> Slimbook Battery Optimizer 是一个美观实用的指示器小程序,它可以让你你在安装 Linux 的笔记本上快速切换电源模式来延长续航时间。 + +[Slimbook][1] 是一个销售 [预装 Linux 的笔电][2] 的西班牙电脑制造商,他们发布了一款好用的小程序,用来在基于 Ubuntu 的 Linux 发行版下调整电池性能。 + +因为 Slimbook 销售他们自己的 Linux 系统,所以他们制作了一些在 Linux 上用于调整他们自己硬件性能的小工具。Battery Optimizer 就是这样一个工具。 + +要使用这个实用小程序,你不必购买 Slimbook 的产品,因为 Slimbook 已经将它在 [他们的官方 PPA 源][3] 发行了。 + +### Slimbook Battery Optimizer 简介 + +这个程序叫 Slimbook Battery。它是一个常驻顶栏的指示器小程序,使得你可以快速切换电源模式。 + +![Slimbook Battery Mode Ubuntu][4] + +你可能在 Windows 中见过类似的程序。Slimbook Battery 和它们一样,提供了类似的电源计划: + + * 节能:最大程度延长电池续航时间 + * 平衡:性能与节能间的最佳平衡 + * 高性能:最大程度提高性能 + +你可以在高级模式中配置这些模式: + +![配置多种多样的电源模式][5] + +如果你觉得你把设置调乱了,你可以用“恢复默认设置”的按钮还原它。 + +你也可以修改像程序自启或默认电源模式这样的通用设置。 + +![Slimbook Battery 通用设置][6] + +Slimbook 有专门为多种电源管理参数提供的页面。如果你希望自己配置,请参照 [此页][7]。 + +不过,我认为 Slimbook 的界面需要一些改进。例如,某些页面上的“问题标记”的图标应该改为可点击的,以此提供更多信息。然而,在我写这篇文章时,那个标记仍然无法点击。 + +总的来说,Slimbook Battery 是一个小巧精美的软件,你可以用它来快速切换电源模式。如果你决定在 Ubuntu 及其衍生发行版上(比如 Linux Mint 或 elementary OS 等),你可以使用官方 [PPA 源][8]。 + +说个题外话,推荐阅读大家阅读 [Ubuntu 论坛被入侵,用户数据被盗取][9] 这篇文章。 + +#### 在基于 Ubuntu 的发行版上安装 Slimbook Battery + +打开终端,一步一步地使用以下命令: + +``` +sudo add-apt-repository ppa:slimbook/slimbook +sudo apt update +sudo apt install slimbookbattery +``` + +安装好之后,在菜单中搜索 Slimbook Battery: + +![启动 Slimbook Battery Optimizer][10] + +在你点击它之后,你会发现它出现在了顶栏。你可以在这里选择你希望使用的电源模式。 + +![Slimbook Battery 电源模式][4] + +#### 卸载 Slimbook Battery + +如果你不再使用它,你可以通过以下命令来卸载它: + +``` +sudo apt remove slimbookbattery +sudo add-apt-repository -r ppa:slimbook/slimbook +``` + +在我看来,这样的应用程序为某些特定的目的服务,这是值得鼓励的。这个工具给了你一条调整电源模式的捷径,和调整性能的更多选项。 + +你用过 Slimbook Battery 吗?你觉得它如何? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/slimbook-battry-optimizer-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[zhs852](https://github.com/zhs852) +校对:[校对者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://slimbook.es/en/ +[2]: https://itsfoss.com/get-linux-laptops/ +[3]: https://launchpad.net/~slimbook/+archive/ubuntu/slimbook +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-mode-ubuntu.jpg?resize=800%2C400&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-2.jpg?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-1.jpg?ssl=1 +[7]: https://slimbook.es/en/tutoriales/aplicaciones-slimbook/398-slimbook-battery-3-application-for-optimize-battery-of-your-laptop +[8]: https://itsfoss.com/ppa-guide/ +[9]: https://itsfoss.com/ubuntu-forums-hacked-again/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer.jpg?ssl=1 From e55c1bd979f95f2236d67eafddda592b95a7c245 Mon Sep 17 00:00:00 2001 From: Lingxu Meng Date: Tue, 21 May 2019 15:42:20 +1000 Subject: [PATCH 0545/1154] Apply to translate --- ... Games Store is Now Available on Linux Thanks to Lutris.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md b/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md index b8432c522e..37c7dc869b 100644 --- a/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md +++ b/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Modrisco) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -106,7 +106,7 @@ via: https://itsfoss.com/epic-games-lutris-linux/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Modrisco](https://github.com/Modrisco) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5636e7c7db37ac5257d9f9df67595901bfe1fc7f Mon Sep 17 00:00:00 2001 From: Lingxu Meng Date: Tue, 21 May 2019 15:44:52 +1000 Subject: [PATCH 0546/1154] Apply to translate --- ... Games Store is Now Available on Linux Thanks to Lutris.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md b/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md index b8432c522e..37c7dc869b 100644 --- a/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md +++ b/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Modrisco) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -106,7 +106,7 @@ via: https://itsfoss.com/epic-games-lutris-linux/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Modrisco](https://github.com/Modrisco) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3ba87e1c0eac9880d2df7daefff114802b17254a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 May 2019 19:16:42 +0800 Subject: [PATCH 0547/1154] PRF:20180518 What-s a hero without a villain- How to add one to your Python game.md @cycoe --- ...ain- How to add one to your Python game.md | 110 +++++------------- 1 file changed, 29 insertions(+), 81 deletions(-) diff --git a/translated/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md b/translated/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md index a4a2138136..c4bb5c84f0 100644 --- a/translated/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md +++ b/translated/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md @@ -1,21 +1,22 @@ -没有恶棍,英雄又将如何?如何向你的 Python 游戏中添加一个敌人 +如何向你的 Python 游戏中添加一个敌人 ====== + +> 在本系列的第五部分,学习如何增加一个坏蛋与你的好人战斗。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/game-dogs-chess-play-lead.png?itok=NAuhav4Z) 在本系列的前几篇文章中(参见 [第一部分][1]、[第二部分][2]、[第三部分][3] 以及 [第四部分][4]),你已经学习了如何使用 Pygame 和 Python 在一个空白的视频游戏世界中生成一个可玩的角色。但没有恶棍,英雄又将如何? 如果你没有敌人,那将会是一个非常无聊的游戏。所以在此篇文章中,你将为你的游戏添加一个敌人并构建一个用于创建关卡的框架。 -在对玩家妖精实现全部功能仍有许多事情可做之前,跳向敌人似乎就很奇怪。但你已经学到了很多东西,创造恶棍与与创造玩家妖精非常相似。所以放轻松,使用你已经掌握的知识,看看能挑起怎样一些麻烦。 +在对玩家妖精实现全部功能之前,就来实现一个敌人似乎就很奇怪。但你已经学到了很多东西,创造恶棍与与创造玩家妖精非常相似。所以放轻松,使用你已经掌握的知识,看看能挑起怎样一些麻烦。 针对本次训练,你能够从 [Open Game Art][5] 下载一些预创建的素材。此处是我使用的一些素材: - -+ 印加花砖(译注:游戏中使用的花砖贴图) ++ 印加花砖(LCTT 译注:游戏中使用的花砖贴图) + 一些侵略者 + 妖精、角色、物体以及特效 - ### 创造敌方妖精 是的,不管你意识到与否,你其实已经知道如何去实现敌人。这个过程与创造一个玩家妖精非常相似: @@ -24,40 +25,27 @@ 2. 创建 `update` 方法使得敌人能够检测碰撞 3. 创建 `move` 方法使得敌人能够四处游荡 - - -从类入手。从概念上看,它与你的 Player 类大体相同。你设置一张或者一组图片,然后设置妖精的初始位置。 +从类入手。从概念上看,它与你的 `Player` 类大体相同。你设置一张或者一组图片,然后设置妖精的初始位置。 在继续下一步之前,确保你有一张你的敌人的图像,即使只是一张临时图像。将图像放在你的游戏项目的 `images` 目录(你放置你的玩家图像的相同目录)。 如果所有的活物都拥有动画,那么游戏看起来会好得多。为敌方妖精设置动画与为玩家妖精设置动画具有相同的方式。但现在,为了保持简单,我们使用一个没有动画的妖精。 在你代码 `objects` 节的顶部,使用以下代码创建一个叫做 `Enemy` 的类: + ``` class Enemy(pygame.sprite.Sprite): -     ''' - 生成一个敌人 -     ''' -     def __init__(self,x,y,img): -         pygame.sprite.Sprite.__init__(self) -         self.image = pygame.image.load(os.path.join('images',img)) -         self.image.convert_alpha() -         self.image.set_colorkey(ALPHA) -         self.rect = self.image.get_rect() -         self.rect.x = x -         self.rect.y = y - ``` 如果你想让你的敌人动起来,使用让你的玩家拥有动画的 [相同方式][4]。 @@ -67,25 +55,21 @@ class Enemy(pygame.sprite.Sprite): 你能够通过告诉类,妖精应使用哪张图像,应出现在世界上的什么地方,来生成不只一个敌人。这意味着,你能够使用相同的敌人类,在游戏世界的任意地方生成任意数量的敌方妖精。你需要做的仅仅是调用这个类,并告诉它应使用哪张图像,以及你期望生成点的 X 和 Y 坐标。 再次,这从原则上与生成一个玩家精灵相似。在你脚本的 `setup` 节添加如下代码: + ``` enemy   = Enemy(20,200,'yeti.png') # 生成敌人 - enemy_list = pygame.sprite.Group() # 创建敌人组 - enemy_list.add(enemy)              # 将敌人加入敌人组 - ``` -在示例代码中,X 坐标为 20,Y 坐标为 200。你可能需要根据你的敌方妖精的大小,来调整这些数字,但尽量生成在一个地方,使得你的玩家妖精能够到它。`Yeti.png` 是用于敌人的图像。 +在示例代码中,X 坐标为 20,Y 坐标为 200。你可能需要根据你的敌方妖精的大小,来调整这些数字,但尽量生成在一个范围内,使得你的玩家妖精能够碰到它。`Yeti.png` 是用于敌人的图像。 接下来,将敌人组的所有敌人绘制在屏幕上。现在,你只有一个敌人,如果你想要更多你可以稍后添加。一但你将一个敌人加入敌人组,它就会在主循环中被绘制在屏幕上。中间这一行是你需要添加的新行: + ```     player_list.draw(world) -     enemy_list.draw(world)  # 刷新敌人 -     pygame.display.flip() - ``` 启动你的游戏,你的敌人会出现在游戏世界中你选择的 X 和 Y 坐标处。 @@ -96,42 +80,31 @@ enemy_list.add(enemy)              # 将敌人加入敌人组 思考一下“关卡”是什么。你如何知道你是在游戏中的一个特定关卡中呢? -你可以把关卡想成一系列项目的集合。就像你刚刚创建的这个平台中,一个关卡,包含了平台、敌人放置、赃物等的一个特定排列。你可以创建一个类,用来在你的玩家附近创建关卡。最终,当你创建了超过一个关卡,你就可以在你的玩家达到特定目标时,使用这个类生成下一个关卡。 +你可以把关卡想成一系列项目的集合。就像你刚刚创建的这个平台中,一个关卡,包含了平台、敌人放置、战利品等的一个特定排列。你可以创建一个类,用来在你的玩家附近创建关卡。最终,当你创建了一个以上的关卡,你就可以在你的玩家达到特定目标时,使用这个类生成下一个关卡。 将你写的用于生成敌人及其群组的代码,移动到一个每次生成新关卡时都会被调用的新函数中。你需要做一些修改,使得每次你创建新关卡时,你都能够创建一些敌人。 + ``` class Level(): -     def bad(lvl,eloc): -         if lvl == 1: -             enemy = Enemy(eloc[0],eloc[1],'yeti.png') # 生成敌人 -             enemy_list = pygame.sprite.Group() # 生成敌人组 -             enemy_list.add(enemy)              # 将敌人加入敌人组 -         if lvl == 2: -             print("Level " + str(lvl) ) - -         return enemy_list - ``` `return` 语句确保了当你调用 `Level.bad` 方法时,你将会得到一个 `enemy_list` 变量包含了所有你定义的敌人。 因为你现在将创造敌人作为每个关卡的一部分,你的 `setup` 部分也需要做些更改。不同于创造一个敌人,取而代之的是你必须去定义敌人在那里生成,以及敌人属于哪个关卡。 + ``` eloc = [] - eloc = [200,20] - enemy_list = Level.bad( 1, eloc ) - ``` 再次运行游戏来确认你的关卡生成正确。与往常一样,你应该会看到你的玩家,并且能看到你在本章节中添加的敌人。 @@ -140,31 +113,27 @@ enemy_list = Level.bad( 1, eloc ) 一个敌人如果对玩家没有效果,那么它不太算得上是一个敌人。当玩家与敌人发生碰撞时,他们通常会对玩家造成伤害。 -因为你可能想要去跟踪玩家的生命值,因此碰撞检测发生在 Player 类,而不是 Enemy 类中。当然如果你想,你也可以跟踪敌人的生命值。它们之间的逻辑与代码大体相似,现在,我们只需要跟踪玩家的生命值。 +因为你可能想要去跟踪玩家的生命值,因此碰撞检测发生在 `Player` 类,而不是 `Enemy` 类中。当然如果你想,你也可以跟踪敌人的生命值。它们之间的逻辑与代码大体相似,现在,我们只需要跟踪玩家的生命值。 为了跟踪玩家的生命值,你必须为它确定一个变量。代码示例中的第一行是上下文提示,那么将第二行代码添加到你的 Player 类中: + ```         self.frame  = 0 -         self.health = 10 - ``` -在你 Player 类的 `update` 方法中,添加如下代码块: +在你 `Player` 类的 `update` 方法中,添加如下代码块: + ```         hit_list = pygame.sprite.spritecollide(self, enemy_list, False) -         for enemy in hit_list: -             self.health -= 1 -             print(self.health) - ``` 这段代码使用 Pygame 的 `sprite.spritecollide` 方法,建立了一个碰撞检测器,称作 `enemy_hit`。每当它的父类妖精(生成检测器的玩家妖精)的碰撞区触碰到 `enemy_list` 中的任一妖精的碰撞区时,碰撞检测器都会发出一个信号。当这个信号被接收,`for` 循环就会被触发,同时扣除一点玩家生命值。 -一旦这段代码出现在你 Player 类的 `update` 方法,并且 `update` 方法在你的主循环中被调用,Pygame 会在每个时钟 tick 检测一次碰撞。 +一旦这段代码出现在你 `Player` 类的 `update` 方法,并且 `update` 方法在你的主循环中被调用,Pygame 会在每个时钟滴答中检测一次碰撞。 ### 移动敌人 @@ -176,60 +145,41 @@ enemy_list = Level.bad( 1, eloc ) 举个例子,你告诉你的敌方妖精向右移动 10 步,向左移动 10 步。但敌方妖精不会计数,因此你需要创建一个变量来跟踪你的敌人已经移动了多少步,并根据计数变量的值来向左或向右移动你的敌人。 -首先,在你的 Enemy 类中创建计数变量。添加以下代码示例中的最后一行代码: +首先,在你的 `Enemy` 类中创建计数变量。添加以下代码示例中的最后一行代码: + ```         self.rect = self.image.get_rect() -         self.rect.x = x -         self.rect.y = y -         self.counter = 0 # 计数变量 - ``` -然后,在你的 Enemy 类中创建一个 `move` 方法。使用 if-else 循环来创建一个所谓的死循环: +然后,在你的 `Enemy` 类中创建一个 `move` 方法。使用 if-else 循环来创建一个所谓的死循环: * 如果计数在 0 到 100 之间,向右移动; * 如果计数在 100 到 200 之间,向左移动; * 如果计数大于 200,则将计数重置为 0。 - - 死循环没有终点,因为循环判断条件永远为真,所以它将永远循环下去。在此情况下,计数器总是介于 0 到 100 或 100 到 200 之间,因此敌人会永远地从左向右再从右向左移动。 你用于敌人在每个方向上移动距离的具体值,取决于你的屏幕尺寸,更确切地说,取决于你的敌人移动的平台大小。从较小的值开始,依据习惯逐步提高数值。首先进行如下尝试: + ```     def move(self): -         ''' - 敌人移动 -         ''' -         distance = 80 -         speed = 8 - -         if self.counter >= 0 and self.counter <= distance: -             self.rect.x += speed -         elif self.counter >= distance and self.counter <= distance*2: -             self.rect.x -= speed -         else: -             self.counter = 0 - -         self.counter += 1 - ``` 你可以根据需要调整距离和速度。 @@ -237,13 +187,11 @@ enemy_list = Level.bad( 1, eloc ) 当你现在启动游戏,这段代码有效果吗? 当然不,你应该也知道原因。你必须在主循环中调用 `move` 方法。如下示例代码中的第一行是上下文提示,那么添加最后两行代码: + ```     enemy_list.draw(world) #refresh enemy -     for e in enemy_list: -         e.move() - ``` 启动你的游戏看看当你打击敌人时发生了什么。你可能需要调整妖精的生成地点,使得你的玩家和敌人能够碰撞。当他们发生碰撞时,查看 [IDLE][6] 或 [Ninja-IDE][7] 的控制台,你可以看到生命值正在被扣除。 @@ -261,15 +209,15 @@ via: https://opensource.com/article/18/5/pygame-enemy 作者:[Seth Kenlon][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[cycoe](https://github.com/cycoe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth -[1]:https://opensource.com/article/17/10/python-101 -[2]:https://opensource.com/article/17/12/game-framework-python -[3]:https://opensource.com/article/17/12/game-python-add-a-player -[4]:https://opensource.com/article/17/12/game-python-moving-player +[1]:https://linux.cn/article-9071-1.html +[2]:https://linux.cn/article-10850-1.html +[3]:https://linux.cn/article-10858-1.html +[4]:https://linux.cn/article-10874-1.html [5]:https://opengameart.org [6]:https://docs.python.org/3/library/idle.html [7]:http://ninja-ide.org/ From ba56e107d61f32ade17b2176d1c39c400734e915 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 May 2019 19:18:47 +0800 Subject: [PATCH 0548/1154] PUB:20180518 What-s a hero without a villain- How to add one to your Python game.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @cycoe https://linux.cn/article-10883-1.html 这个系列似乎还有后面的?@lujun9972 --- ... hero without a villain- How to add one to your Python game.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180518 What-s a hero without a villain- How to add one to your Python game.md (100%) diff --git a/translated/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md b/published/20180518 What-s a hero without a villain- How to add one to your Python game.md similarity index 100% rename from translated/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md rename to published/20180518 What-s a hero without a villain- How to add one to your Python game.md From f06f664fdf4b670abe41703bd43a8d0f35ca344a Mon Sep 17 00:00:00 2001 From: XYenChi <466530436@qq.com> Date: Tue, 21 May 2019 20:27:17 +0800 Subject: [PATCH 0549/1154] Update 20180604 10 principles of resilience for women in tech.md XYenChi is translating --- ...nciples of resilience for women in tech.md | 187 +++++++++--------- 1 file changed, 94 insertions(+), 93 deletions(-) diff --git a/sources/talk/20180604 10 principles of resilience for women in tech.md b/sources/talk/20180604 10 principles of resilience for women in tech.md index 3f451089bb..e5d6b09401 100644 --- a/sources/talk/20180604 10 principles of resilience for women in tech.md +++ b/sources/talk/20180604 10 principles of resilience for women in tech.md @@ -1,93 +1,94 @@ -10 principles of resilience for women in tech -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/diversity-women-meeting-team.png?itok=BdDKxT1w) - -Being a woman in tech is pretty damn cool. For every headline about [what Silicon Valley thinks of women][1], there are tens of thousands of women building, innovating, and managing technology teams around the world. Women are helping build the future despite the hurdles they face, and the community of women and allies growing to support each other is stronger than ever. From [BetterAllies][2] to organizations like [Girls Who Code][3] and communities like the one I met recently at [Red Hat Summit][4], there are more efforts than ever before to create an inclusive community for women in tech. - -But the tech industry has not always been this welcoming, nor is the experience for women always aligned with the aspiration. And so we're feeling the pain. Women in technology roles have dropped from its peak in 1991 at 36% to 25% today, [according to a report by NCWIT][5]. [Harvard Business Review estimates][6] that more than half of the women in tech will eventually leave due to hostile work conditions. Meanwhile, Ernst & Young recently shared [a study][7] and found that merely 11% of high school girls are planning to pursue STEM careers. - -We have much work to do, lest we build a future that is less inclusive than the one we live in today. We need everyone at the table, in the lab, at the conference and in the boardroom. - -I've been interviewing both women and men for more than a year now about their experiences in tech, all as part of [The Chasing Grace Project][8], a documentary series about women in tech. The purpose of the series is to help recruit and retain female talent for the tech industry and to give women a platform to be seen, heard, and acknowledged for their experiences. We believe that compelling story can begin to transform culture. - -### What Chasing Grace taught me - -What I've learned is that no matter the dismal numbers, women want to keep building and they collectively possess a resilience unmatched by anything I've ever seen. And this is inspiring me. I've found a power, a strength, and a beauty in every story I've heard that is the result of resilience. I recently shared with the attendees at the Red Hat Summit Women’s Leadership Luncheon the top 10 principles of resilience I've heard from throughout my interviews so far. I hope that by sharing them here the ideas and concepts can support and inspire you, too. - -#### 1\. Practice optimism - -When taken too far, optimism can give you blind spots. But a healthy dose of optimism allows you to see the best in people and situations and that positive energy comes back to you 100-fold. I haven’t met a woman yet as part of this project who isn’t an optimist. - -#### 2\. Build mental toughness - -I haven’t met a woman yet as part of this project who isn’t an optimist. - -When I recently asked a 32-year-old tech CEO, who is also a single mom of three young girls, what being a CEO required she said _mental toughness_. It really summed up what I’d heard in other words from other women, but it connected with me on another level when she proceeded to tell me how caring for her daughter—who was born with a hole in heart—prepared her for what she would encounter as a tech CEO. Being mentally tough to her means fighting for what you love, persisting like a badass, and building your EQ as well as your IQ. - -#### 3\. Recognize your power - -When I recently asked a 32-year-old tech CEO, who is also a single mom of three young girls, what being a CEO required she said. It really summed up what I’d heard in other words from other women, but it connected with me on another level when she proceeded to tell me how caring for her daughter—who was born with a hole in heart—prepared her for what she would encounter as a tech CEO. Being mentally tough to her means fighting for what you love, persisting like a badass, and building your EQ as well as your IQ. - -Most of the women I’ve interviewed don’t know their own power and so they give it away unknowingly. Too many women have told me that they willingly took on the housekeeping roles on their teams—picking up coffee, donuts, office supplies, and making the team dinner reservations. Usually the only woman on their teams, this put them in a position to be seen as less valuable than their male peers who didn’t readily volunteer for such tasks. All of us, men and women, have innate powers. Identify and know what your powers are and understand how to use them for good. You have so much more power than you realize. Know it, recognize it, use it strategically, and don’t give it away. It’s yours. - -#### 4\. Know your strength - -Not sure whether you can confront your boss about why you haven’t been promoted? You can. You don’t know your strength until you exercise it. Then, you’re unstoppable. Test your strength by pushing your fear aside and see what happens. - -#### 5\. Celebrate vulnerability - -Every single successful women I've interviewed isn't afraid to be vulnerable. She finds her strength in acknowledging where she is vulnerable and she looks to connect with others in that same place. Exposing, sharing, and celebrating each other’s vulnerabilities allows us to tap into something far greater than simply asserting strength; it actually builds strength—mental and emotional muscle. One women with whom we’ve talked shared how starting her own tech company made her feel like she was letting her husband down. She shared with us the details of that conversation with her husband. Honest conversations that share our doubts and our aspirations is what makes women uniquely suited to lead in many cases. Allow yourself to be seen and heard. It’s where we grow and learn. - -#### 6\. Build community - -If it doesn't exist, build it. - -Building community seems like a no-brainer in the world of open source, right? But take a moment to think about how many minorities in tech, especially those outside the collaborative open source community, don’t always feel like part of the community. Many women in tech, for example, have told me they feel alone. Reach out and ask questions or answer questions in community forums, at meetups, and in IRC and Slack. When you see a woman alone at an event, consider engaging with her and inviting her into a conversation. Start a meetup group in your company or community for women in tech. I've been so pleased with the number of companies that host these groups. If it doesn't exists, build it. - -#### 7\. Celebrate victories - -Building community seems like a no-brainer in the world of open source, right? But take a moment to think about how many minorities in tech, especially those outside the collaborative open source community, don’t always feel like part of the community. Many women in tech, for example, have told me they feel alone. Reach out and ask questions or answer questions in community forums, at meetups, and in IRC and Slack. When you see a woman alone at an event, consider engaging with her and inviting her into a conversation. Start a meetup group in your company or community for women in tech. I've been so pleased with the number of companies that host these groups. If it doesn't exists, build it. - -One of my favorite Facebook groups is [TechLadies][9] because of its recurring hashtag #YEPIDIDTHAT. It allows women to share their victories in a supportive community. No matter how big or small, don't let a victory go unrecognized. When you recognize your wins, you own them. They become a part of you and you build on top of each one. - -#### 8\. Be curious - -Being curious in the tech community often means asking questions: How does that work? What language is that written in? How can I make this do that? When I've managed teams over the years, my best employees have always been those who ask a lot of questions, those who are genuinely curious about things. But in this context, I mean be curious when your gut tells you something doesn't seem right. _The energy in the meeting was off. Did he/she just say what I think he said?_ Ask questions. Investigate. Communicate openly and clearly. It's the only way change happens. - -#### 9\. Harness courage - -One women told me a story about a meeting in which the women in the room kept being dismissed and talked over. During the debrief roundtable portion of the meeting, she called it out and asked if others noticed it, too. Being a 20-year tech veteran, she'd witnessed and experienced this many times but she had never summoned the courage to speak up about it. She told me she was incredibly nervous and was texting other women in the room to see if they agreed it should be addressed. She didn't want to be a "troublemaker." But this kind of courage results in an increased understanding by everyone in that room and can translate into other meetings, companies, and across the industry. - -#### 10\. Share your story - -When people connect to compelling story, they begin to change behaviors. - -Share your experience with a friend, a group, a community, or an industry. Be empowered by the experience of sharing your experience. Stories change culture. When people connect to compelling story, they begin to change behaviors. When people act, companies and industries begin to transform. - -Share your experience with a friend, a group, a community, or an industry. Be empowered by the experience of sharing your experience. Stories change culture. When people connect to compelling story, they begin to change behaviors. When people act, companies and industries begin to transform. - -If you would like to support [The Chasing Grace Project][8], email Jennifer Cloer to learn more about how to get involved: [jennifer@wickedflicksproductions.com][10] - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/6/being-woman-tech-10-principles-resilience - -作者:[Jennifer Cloer][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jennifer-cloer -[1]:http://www.newsweek.com/2015/02/06/what-silicon-valley-thinks-women-302821.html%E2%80%9D -[2]:https://opensource.com/article/17/6/male-allies-tech-industry-needs-you%E2%80%9D -[3]:https://twitter.com/GirlsWhoCode%E2%80%9D -[4]:http://opensource.com/tags/red-hat-summit%E2%80%9D -[5]:https://www.ncwit.org/sites/default/files/resources/womenintech_facts_fullreport_05132016.pdf%E2%80%9D -[6]:Dhttp://www.latimes.com/business/la-fi-women-tech-20150222-story.html%E2%80%9D -[7]:http://www.ey.com/us/en/newsroom/news-releases/ey-news-new-research-reveals-the-differences-between-boys-and-girls-career-and-college-plans-and-an-ongoing-need-to-engage-girls-in-stem%E2%80%9D -[8]:https://www.chasinggracefilm.com/ -[9]:https://www.facebook.com/therealTechLadies/%E2%80%9D -[10]:mailto:jennifer@wickedflicksproductions.com +XYenChi is translating +10 principles of resilience for women in tech +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/diversity-women-meeting-team.png?itok=BdDKxT1w) + +Being a woman in tech is pretty damn cool. For every headline about [what Silicon Valley thinks of women][1], there are tens of thousands of women building, innovating, and managing technology teams around the world. Women are helping build the future despite the hurdles they face, and the community of women and allies growing to support each other is stronger than ever. From [BetterAllies][2] to organizations like [Girls Who Code][3] and communities like the one I met recently at [Red Hat Summit][4], there are more efforts than ever before to create an inclusive community for women in tech. + +But the tech industry has not always been this welcoming, nor is the experience for women always aligned with the aspiration. And so we're feeling the pain. Women in technology roles have dropped from its peak in 1991 at 36% to 25% today, [according to a report by NCWIT][5]. [Harvard Business Review estimates][6] that more than half of the women in tech will eventually leave due to hostile work conditions. Meanwhile, Ernst & Young recently shared [a study][7] and found that merely 11% of high school girls are planning to pursue STEM careers. + +We have much work to do, lest we build a future that is less inclusive than the one we live in today. We need everyone at the table, in the lab, at the conference and in the boardroom. + +I've been interviewing both women and men for more than a year now about their experiences in tech, all as part of [The Chasing Grace Project][8], a documentary series about women in tech. The purpose of the series is to help recruit and retain female talent for the tech industry and to give women a platform to be seen, heard, and acknowledged for their experiences. We believe that compelling story can begin to transform culture. + +### What Chasing Grace taught me + +What I've learned is that no matter the dismal numbers, women want to keep building and they collectively possess a resilience unmatched by anything I've ever seen. And this is inspiring me. I've found a power, a strength, and a beauty in every story I've heard that is the result of resilience. I recently shared with the attendees at the Red Hat Summit Women’s Leadership Luncheon the top 10 principles of resilience I've heard from throughout my interviews so far. I hope that by sharing them here the ideas and concepts can support and inspire you, too. + +#### 1\. Practice optimism + +When taken too far, optimism can give you blind spots. But a healthy dose of optimism allows you to see the best in people and situations and that positive energy comes back to you 100-fold. I haven’t met a woman yet as part of this project who isn’t an optimist. + +#### 2\. Build mental toughness + +I haven’t met a woman yet as part of this project who isn’t an optimist. + +When I recently asked a 32-year-old tech CEO, who is also a single mom of three young girls, what being a CEO required she said _mental toughness_. It really summed up what I’d heard in other words from other women, but it connected with me on another level when she proceeded to tell me how caring for her daughter—who was born with a hole in heart—prepared her for what she would encounter as a tech CEO. Being mentally tough to her means fighting for what you love, persisting like a badass, and building your EQ as well as your IQ. + +#### 3\. Recognize your power + +When I recently asked a 32-year-old tech CEO, who is also a single mom of three young girls, what being a CEO required she said. It really summed up what I’d heard in other words from other women, but it connected with me on another level when she proceeded to tell me how caring for her daughter—who was born with a hole in heart—prepared her for what she would encounter as a tech CEO. Being mentally tough to her means fighting for what you love, persisting like a badass, and building your EQ as well as your IQ. + +Most of the women I’ve interviewed don’t know their own power and so they give it away unknowingly. Too many women have told me that they willingly took on the housekeeping roles on their teams—picking up coffee, donuts, office supplies, and making the team dinner reservations. Usually the only woman on their teams, this put them in a position to be seen as less valuable than their male peers who didn’t readily volunteer for such tasks. All of us, men and women, have innate powers. Identify and know what your powers are and understand how to use them for good. You have so much more power than you realize. Know it, recognize it, use it strategically, and don’t give it away. It’s yours. + +#### 4\. Know your strength + +Not sure whether you can confront your boss about why you haven’t been promoted? You can. You don’t know your strength until you exercise it. Then, you’re unstoppable. Test your strength by pushing your fear aside and see what happens. + +#### 5\. Celebrate vulnerability + +Every single successful women I've interviewed isn't afraid to be vulnerable. She finds her strength in acknowledging where she is vulnerable and she looks to connect with others in that same place. Exposing, sharing, and celebrating each other’s vulnerabilities allows us to tap into something far greater than simply asserting strength; it actually builds strength—mental and emotional muscle. One women with whom we’ve talked shared how starting her own tech company made her feel like she was letting her husband down. She shared with us the details of that conversation with her husband. Honest conversations that share our doubts and our aspirations is what makes women uniquely suited to lead in many cases. Allow yourself to be seen and heard. It’s where we grow and learn. + +#### 6\. Build community + +If it doesn't exist, build it. + +Building community seems like a no-brainer in the world of open source, right? But take a moment to think about how many minorities in tech, especially those outside the collaborative open source community, don’t always feel like part of the community. Many women in tech, for example, have told me they feel alone. Reach out and ask questions or answer questions in community forums, at meetups, and in IRC and Slack. When you see a woman alone at an event, consider engaging with her and inviting her into a conversation. Start a meetup group in your company or community for women in tech. I've been so pleased with the number of companies that host these groups. If it doesn't exists, build it. + +#### 7\. Celebrate victories + +Building community seems like a no-brainer in the world of open source, right? But take a moment to think about how many minorities in tech, especially those outside the collaborative open source community, don’t always feel like part of the community. Many women in tech, for example, have told me they feel alone. Reach out and ask questions or answer questions in community forums, at meetups, and in IRC and Slack. When you see a woman alone at an event, consider engaging with her and inviting her into a conversation. Start a meetup group in your company or community for women in tech. I've been so pleased with the number of companies that host these groups. If it doesn't exists, build it. + +One of my favorite Facebook groups is [TechLadies][9] because of its recurring hashtag #YEPIDIDTHAT. It allows women to share their victories in a supportive community. No matter how big or small, don't let a victory go unrecognized. When you recognize your wins, you own them. They become a part of you and you build on top of each one. + +#### 8\. Be curious + +Being curious in the tech community often means asking questions: How does that work? What language is that written in? How can I make this do that? When I've managed teams over the years, my best employees have always been those who ask a lot of questions, those who are genuinely curious about things. But in this context, I mean be curious when your gut tells you something doesn't seem right. _The energy in the meeting was off. Did he/she just say what I think he said?_ Ask questions. Investigate. Communicate openly and clearly. It's the only way change happens. + +#### 9\. Harness courage + +One women told me a story about a meeting in which the women in the room kept being dismissed and talked over. During the debrief roundtable portion of the meeting, she called it out and asked if others noticed it, too. Being a 20-year tech veteran, she'd witnessed and experienced this many times but she had never summoned the courage to speak up about it. She told me she was incredibly nervous and was texting other women in the room to see if they agreed it should be addressed. She didn't want to be a "troublemaker." But this kind of courage results in an increased understanding by everyone in that room and can translate into other meetings, companies, and across the industry. + +#### 10\. Share your story + +When people connect to compelling story, they begin to change behaviors. + +Share your experience with a friend, a group, a community, or an industry. Be empowered by the experience of sharing your experience. Stories change culture. When people connect to compelling story, they begin to change behaviors. When people act, companies and industries begin to transform. + +Share your experience with a friend, a group, a community, or an industry. Be empowered by the experience of sharing your experience. Stories change culture. When people connect to compelling story, they begin to change behaviors. When people act, companies and industries begin to transform. + +If you would like to support [The Chasing Grace Project][8], email Jennifer Cloer to learn more about how to get involved: [jennifer@wickedflicksproductions.com][10] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/6/being-woman-tech-10-principles-resilience + +作者:[Jennifer Cloer][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jennifer-cloer +[1]:http://www.newsweek.com/2015/02/06/what-silicon-valley-thinks-women-302821.html%E2%80%9D +[2]:https://opensource.com/article/17/6/male-allies-tech-industry-needs-you%E2%80%9D +[3]:https://twitter.com/GirlsWhoCode%E2%80%9D +[4]:http://opensource.com/tags/red-hat-summit%E2%80%9D +[5]:https://www.ncwit.org/sites/default/files/resources/womenintech_facts_fullreport_05132016.pdf%E2%80%9D +[6]:Dhttp://www.latimes.com/business/la-fi-women-tech-20150222-story.html%E2%80%9D +[7]:http://www.ey.com/us/en/newsroom/news-releases/ey-news-new-research-reveals-the-differences-between-boys-and-girls-career-and-college-plans-and-an-ongoing-need-to-engage-girls-in-stem%E2%80%9D +[8]:https://www.chasinggracefilm.com/ +[9]:https://www.facebook.com/therealTechLadies/%E2%80%9D +[10]:mailto:jennifer@wickedflicksproductions.com From 3990486d2753421169b30ba5c55977dfdf700a19 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 May 2019 00:03:47 +0800 Subject: [PATCH 0550/1154] PRF:20190308 Virtual filesystems in Linux- Why we need them and how they work.md @wxy --- ...nux- Why we need them and how they work.md | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index cac4eb99b7..3b701727be 100644 --- a/translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -1,20 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Virtual filesystems in Linux: Why we need them and how they work) [#]: via: (https://opensource.com/article/19/3/virtual-filesystems-linux) [#]: author: (Alison Chariken ) -Linux 中的虚拟文件系统 +详解 Linux 中的虚拟文件系统 ====== > 虚拟文件系统是一种神奇的抽象,它使得 “一切皆文件” 哲学在 Linux 中成为了可能。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ) -什么是文件系统?根据早期的 Linux 贡献者和作家 [Robert Love][1] 所说,“文件系统是一个遵循特定结构的数据的分层存储。” 不过,这种描述也同样适用于 VFAT(虚拟文件分配表)、Git 和[Cassandra][2](一种 [NoSQL 数据库][3])。那么如何区别文件系统呢? +什么是文件系统?根据早期的 Linux 贡献者和作家 [Robert Love][1] 所说,“文件系统是一个遵循特定结构的数据的分层存储。” 不过,这种描述也同样适用于 VFAT(虚拟文件分配表Virtual File Allocation Table)、Git 和[Cassandra][2](一种 [NoSQL 数据库][3])。那么如何区别文件系统呢? ### 文件系统基础概念 @@ -22,72 +22,73 @@ Linux 内核要求文件系统必须是实体,它还必须在持久对象上 ![][5] -如果我们能够 `open()`、`read()` 和 `write()`,它就是一个文件,如这个主控台会话所示。 +*如果我们能够 `open()`、`read()` 和 `write()`,它就是一个文件,如这个主控台会话所示。* -VFS 是著名的类 Unix 系统中 “一切皆文件” 的基础。让我们看一下它有多奇怪,上面的小演示体现了字符设备 `/dev/console` 实际的工作。该图显示了一个在虚拟电传打字(tty)上的交互式 Bash 会话。将一个字符串发送到虚拟控制台设备会使其显示在虚拟屏幕上。而 VFS 甚至还有其它更奇怪的属性。例如,它[可以在其中寻址][6]。 +VFS 是著名的类 Unix 系统中 “一切皆文件” 概念的基础。让我们看一下它有多奇怪,上面的小小演示体现了字符设备 `/dev/console` 实际的工作。该图显示了一个在虚拟电传打字控制台(tty)上的交互式 Bash 会话。将一个字符串发送到虚拟控制台设备会使其显示在虚拟屏幕上。而 VFS 甚至还有其它更奇怪的属性。例如,它[可以在其中寻址][6]。 -熟悉的文件系统如 ext4、NFS 和 /proc 在名为 [file_operations] [7] 的 C 语言数据结构中都提供了三大函数的定义。此外,特定的文件系统会以熟悉的面向对象的方式扩展和覆盖了 VFS 功能。正如 Robert Love 指出的那样,VFS 的抽象使 Linux 用户可以轻松地将文件复制到(复制自)外部操作系统或抽象实体(如管道),而无需担心其内部数据格式。在用户空间,通过系统调用,进程可以使用一个文件系统的 `read()`方法从文件复制到内核的数据结构中,然后使用另一种文件系统的 `write()` 方法输出数据。 +我们熟悉的文件系统如 ext4、NFS 和 /proc 都在名为 [file_operations] [7] 的 C 语言数据结构中提供了三大函数的定义。此外,个别的文件系统会以熟悉的面向对象的方式扩展和覆盖了 VFS 功能。正如 Robert Love 指出的那样,VFS 的抽象使 Linux 用户可以轻松地将文件复制到(或复制自)外部操作系统或抽象实体(如管道),而无需担心其内部数据格式。在用户空间这一侧,通过系统调用,进程可以使用文件系统方法之一 `read()` 从文件复制到内核的数据结构中,然后使用另一种文件系统的方法 `write()` 输出数据。 -属于 VFS 基本类型的函数定义本身可以在内核源代码的 [fs/*.c 文件][8] 中找到,而 `fs/` 的子目录中包含了特定的文件系统。内核还包含了类似文件系统的实体,例如 cgroup、`/dev` 和 tmpfs,它们在引导过程的早期需要,因此定义在内核的 `init/` 子目录中。请注意,cgroup、`/dev` 和 tmpfs 不会调用 `file_operations` 的三大函数,而是直接读取和写入内存。 +属于 VFS 基本类型的函数定义本身可以在内核源代码的 [fs/*.c 文件][8] 中找到,而 `fs/` 的子目录中包含了特定的文件系统。内核还包含了类似文件系统的实体,例如 cgroup、`/dev` 和 tmpfs,在引导过程的早期需要它们,因此定义在内核的 `init/` 子目录中。请注意,cgroup、`/dev` 和 tmpfs 不会调用 `file_operations` 的三大函数,而是直接读取和写入内存。 -下图大致说明了用户空间如何访问通常挂载在 Linux 系统上的各种类型的文件系统。未显示的是像管道、dmesg 和 POSIX 时钟这样的结构,它们也实现了 `struct file_operations`,并且因此其访问要通过 VFS 层。 +下图大致说明了用户空间如何访问通常挂载在 Linux 系统上的各种类型文件系统。像管道、dmesg 和 POSIX 时钟这样的结构在此图中未显示,它们也实现了 `struct file_operations`,而且其访问也要通过 VFS 层。 ![How userspace accesses various types of filesystems][9] -VFS 是系统调用和特定 `file_operations` 的实现(如 ext4 和 procfs)之间的“垫片层”。然后,`file_operations` 函数可以与特定于设备的驱动程序或内存访问器进行通信。tmpfs、devtmpfs 和 cgroup 不使用 `file_operations` 而是直接访问内存。 +VFS 是个“垫片层”,位于系统调用和特定 `file_operations` 的实现(如 ext4 和 procfs)之间。然后,`file_operations` 函数可以与特定于设备的驱动程序或内存访问器进行通信。tmpfs、devtmpfs 和 cgroup 不使用 `file_operations` 而是直接访问内存。 -VFS 的存在促进了代码重用,因为与文件系统相关的基本方法不需要由每种文件系统类型重新实现。代码重用是一种被广泛接受的软件工程最佳实践!唉,如果重用的代码[引入了严重的错误][10],那么继承常用方法的所有实现都会受到影响。 +VFS 的存在促进了代码重用,因为与文件系统相关的基本方法不需要由每种文件系统类型重新实现。代码重用是一种被广泛接受的软件工程最佳实践!唉,但是如果重用的代码[引入了严重的错误][10],那么继承常用方法的所有实现都会受到影响。 ### /tmp:一个小提示 -找出系统中存在的 VFS 的简单方法是键入 `mount | grep -v sd | grep -v :/`,在大多数计算机上,它将列出所有未驻留在磁盘上也不是 NFS 的已挂载文件系统。其中一个列出的 VFS 挂载肯定是 `/ tmp`,对吧? +找出系统中存在的 VFS 的简单方法是键入 `mount | grep -v sd | grep -v :/`,在大多数计算机上,它将列出所有未驻留在磁盘上,同时也不是 NFS 的已挂载文件系统。其中一个列出的 VFS 挂载肯定是 `/tmp`,对吧? ![Man with shocked expression][11] -*每个人都知道把 /tmp 放在物理存储设备上简直是疯了!图片:* +*谁都知道把 /tmp 放在物理存储设备上简直是疯了!图片:* 为什么把 `/tmp` 留在存储设备上是不可取的?因为 `/tmp` 中的文件是临时的(!),并且存储设备比内存慢,所以创建了 tmpfs 这种文件系统。此外,比起内存,物理设备频繁写入更容易磨损。最后,`/tmp` 中的文件可能包含敏感信息,因此在每次重新启动时让它们消失是一项功能。 -不幸的是,默认情况下,某些 Linux 发行版的安装脚本仍会在存储设备上创建 /tmp。如果你的系统出现这种情况,请不要绝望。按照一直优秀的 [Arch Wiki][12] 上的简单说明来解决问题就行,记住分配给 tmpfs 的内存不能用于其他目的。换句话说,带有巨大 tmpfs 并且其中包含大文件的系统可能会耗尽内存并崩溃。另一个提示:编辑 `/etc/fstab` 文件时,请务必以换行符结束,否则系统将无法启动。(猜猜我怎么知道。) +不幸的是,默认情况下,某些 Linux 发行版的安装脚本仍会在存储设备上创建 /tmp。如果你的系统出现这种情况,请不要绝望。按照一直优秀的 [Arch Wiki][12] 上的简单说明来解决问题就行,记住分配给 tmpfs 的内存就不能用于其他目的了。换句话说,包含了大文件的庞大的 tmpfs 可能会让系统耗尽内存并崩溃。 + +另一个提示:编辑 `/etc/fstab` 文件时,请务必以换行符结束,否则系统将无法启动。(猜猜我怎么知道。) ### /proc 和 /sys -除了 `/tmp` 之外,大多数 Linux 用户最熟悉的 VFS 是 `/proc` 和 `/sys`。(`/dev` 依赖于共享内存,没有 `file_operations`)。为什么有两种?让我们来看看更多细节。 +除了 `/tmp` 之外,大多数 Linux 用户最熟悉的 VFS 是 `/proc` 和 `/sys`。(`/dev` 依赖于共享内存,而没有 `file_operations` 结构)。为什么有两种呢?让我们来看看更多细节。 -procfs 提供了内核的瞬时状态及其为用户空间控制的进程的快照。在 `/proc` 中,内核发布有关其提供的工具的信息,如中断、虚拟内存和调度程序。此外,`/proc/sys` 是存放可以通过 [sysctl 命令][13]配置的设置的地方,可供用户空间访问。单个进程的状态和统计信息在 `/proc/` 目录中报告。 +procfs 为用户空间提供了内核及其控制的进程的瞬时状态的快照。在 `/proc` 中,内核发布有关其提供的设施的信息,如中断、虚拟内存和调度程序。此外,`/proc/sys` 是存放可以通过 [sysctl 命令][13]配置的设置的地方,可供用户空间访问。单个进程的状态和统计信息在 `/proc/` 目录中报告。 ![Console][14] */proc/meminfo 是一个空文件,但仍包含有价值的信息。* -`/proc` 文件的行为说明了 VFS 可以与磁盘上的文件系统不同。一方面,`/proc/meminfo` 包含命令 `free` 提供的信息。另一方面,它还是空的!怎么会这样?这种情况让人联想起康奈尔大学物理学家 N. David Mermin 在 1985 年写的一篇名为“[没有人看见月亮的情况吗?][15]现实和量子理论。”事实是当进程从 `/proc` 请求内存时内核再收集有关内存的统计信息,并且当没有人在查看时,`/proc` 中的文件实际上没有任何内容。正如 [Mermin 所说][16],“这是一个基本的量子学说,一般来说,测量不会揭示被测属性的预先存在的价值。”(关于月球的问题的答案留作练习。) +`/proc` 文件的行为说明了 VFS 可以与磁盘上的文件系统不同。一方面,`/proc/meminfo` 包含了可由命令 `free` 展现出来的信息。另一方面,它还是空的!怎么会这样?这种情况让人联想起康奈尔大学物理学家 N. David Mermin 在 1985 年写的一篇名为《[没有人看见月亮的情况吗?][15]现实和量子理论》。事实是当进程从 `/proc` 请求数据时内核再收集有关内存的统计信息,而且当没有人查看它时,`/proc` 中的文件实际上没有任何内容。正如 [Mermin 所说][16],“这是一个基本的量子学说,一般来说,测量不会揭示被测属性的预先存在的价值。”(关于月球的问题的答案留作练习。) ![Full moon][17] *当没有进程访问它们时,/proc 中的文件为空。([来源][18])* -procfs 的空文件是有道理的,因为那里可用的信息是动态的。sysfs 的情况不同。让我们比较一下 `/proc` 与 `/sys` 中不为空的文件数量。 +procfs 的空文件是有道理的,因为那里可用的信息是动态的。sysfs 的情况则不同。让我们比较一下 `/proc` 与 `/sys` 中不为空的文件数量。 ![](https://opensource.com/sites/default/files/uploads/virtualfilesystems_6-filesize.png) -procfs 只有一个,即导出的内核配置,这是一个例外,因为每次启动只需要生成一次。另一方面,`/sys` 有许多较大的文件,其中大多数包含一页内存。通常,sysfs 文件只包含一个数字或字符串,与通过读取 `/proc/meminfo` 等文件生成的信息表格形成鲜明对比。 +procfs 只有一个不为空的文件,即导出的内核配置,这是一个例外,因为每次启动只需要生成一次。另一方面,`/sys` 有许多更大一些的文件,其中大多数由一页内存组成。通常,sysfs 文件只包含一个数字或字符串,与通过读取 `/proc/meminfo` 等文件生成的信息表格形成鲜明对比。 -sysfs 的目的是将内核称为“kobjects”的可读写属性公开给用户空间。kobjects 的唯一目的是引用计数:当删除对 kobject 的最后一个引用时,系统将回收与之关联的资源。然而,`/sys` 构成了内核著名的“[到用户空间的稳定 ABI][19]”,它的大部分内容[在任何情况下都没有人会“破坏”][20]。这并不意味着 sysfs 中的文件是静态,这与易失性对象的引用计数相反。 +sysfs 的目的是将内核称为 “kobject” 的可读写属性公开给用户空间。kobject 的唯一目的是引用计数:当删除对 kobject 的最后一个引用时,系统将回收与之关联的资源。然而,`/sys` 构成了内核著名的“[到用户空间的稳定 ABI][19]”,它的大部分内容[在任何情况下都没有人能“破坏”][20]。但这并不意味着 sysfs 中的文件是静态,这与易失性对象的引用计数相反。 -内核的稳定 ABI 反而限制了 `/sys` 中可能出现的内容,而不是任何给定时刻实际存在的内容。列出 sysfs 中文件的权限可以了解如何设置或读取设备、模块、文件系统等的可配置、可调参数。Logic 强调 procfs 也是内核稳定 ABI 的一部分的结论,尽管内核的[文档][19]没有明确说明。 +内核的稳定 ABI 限制了 `/sys` 中可能出现的内容,而不是任何给定时刻实际存在的内容。列出 sysfs 中文件的权限可以了解如何设置或读取设备、模块、文件系统等的可配置、可调参数。逻辑上强调 procfs 也是内核稳定 ABI 的一部分的结论,尽管内核的[文档][19]没有明确说明。 ![Console][21] -*sysfs 中的文件恰好描述了实体的每个属性,并且可以是可读的、可写的或两者兼而有之。文件中的“0”表示 SSD 不可移动的存储设备。* +*sysfs 中的文件确切地描述了实体的每个属性,并且可以是可读的、可写的,或两者兼而有之。文件中的“0”表示 SSD 不可移动的存储设备。* ### 用 eBPF 和 bcc 工具一窥 VFS 内部 -了解内核如何管理 sysfs 文件的最简单方法是观察它的运行情况,在 ARM64 或 x86_64 上观看的最简单方法是使用 eBPF。eBPF(扩展的伯克利数据包过滤器extended Berkeley Packet Filter)由[在内核中运行的虚拟机][22]组成,特权用户可以从命令行进行查询。内核源代码告诉读者内核可以做什么;在一个启动的系统上运行 eBPF 工具会显示内核实际上做了什么。 +了解内核如何管理 sysfs 文件的最简单方法是观察它的运行情况,在 ARM64 或 x86_64 上观看的最简单方法是使用 eBPF。eBPF(扩展的伯克利数据包过滤器extended Berkeley Packet Filter)由[在内核中运行的虚拟机][22]组成,特权用户可以从命令行进行查询。内核源代码告诉读者内核可以做什么;而在一个启动的系统上运行 eBPF 工具会显示内核实际上做了什么。 -令人高兴的是,通过 [bcc][23] 工具入门使用 eBPF 非常容易,这些工具在[主要 Linux 发行版的软件包][24] 中都有,并且已经由 Brendan Gregg [充分地给出了文档说明][25]。bcc 工具是带有小段嵌入式 C 语言片段的 Python 脚本,这意味着任何对这两种语言熟悉的人都可以轻松修改它们。当前统计,[bcc/tools 中有 80 个 Python 脚本][26],使系统管理员或开发人员很有可能能够找到与她/他的需求相关的现有脚本。 - -要了解 VFS 在正在运行的系统上的工作情况,请尝试使用简单的 [vfscount][27] 或 [vfsstat][28],这表明每秒都会发生数十次对 `vfs_open()` 及其相关的调用 +令人高兴的是,通过 [bcc][23] 工具入门使用 eBPF 非常容易,这些工具在[主要 Linux 发行版的软件包][24] 中都有,并且已经由 Brendan Gregg [给出了充分的文档说明][25]。bcc 工具是带有小段嵌入式 C 语言片段的 Python 脚本,这意味着任何对这两种语言熟悉的人都可以轻松修改它们。据当前统计,[bcc/tools 中有 80 个 Python 脚本][26],使得系统管理员或开发人员很有可能能够找到与她/他的需求相关的已有脚本。 +要了解 VFS 在正在运行中的系统上的工作情况,请尝试使用简单的 [vfscount][27] 或 [vfsstat][28] 脚本,这可以看到每秒都会发生数十次对 `vfs_open()` 及其相关的调用。 ![Console - vfsstat.py][29] @@ -95,37 +96,35 @@ sysfs 的目的是将内核称为“kobjects”的可读写属性公开给用户 作为一个不太重要的例子,让我们看一下在运行的系统上插入 USB 记忆棒时 sysfs 中会发生什么。 - ![Console when USB is inserted][30] *用 eBPF 观察插入 USB 记忆棒时 /sys 中会发生什么,简单的和复杂的例子。* -在上面的第一个简单示例中,只要 `sysfs_create_files()` 命令运行,[trace.py][31] bcc 工具脚本就会打印出一条消息。我们看到 `sysfs_create_files()` 由一个 kworker 线程启动,以响应 USB 棒插入事件,但是它创建了什么文件?第二个例子说明了 eBPF 的强大能力。这里,`trace.py` 正在打印内核回溯(`-K` 选项)以及 `sysfs_create_files()` 创建的文件的名称。单引号内的代码段是一些 C 源代码,包括一个易于识别的格式字符串,提供的 Python 脚本[引入 LLVM 即时编译器(JIT)][32] 在内核虚拟机内编译和执行它。必须在第二个命令中重现完整的 `sysfs_create_files()` 函数签名,以便格式字符串可以引用其中一个参数。在此 C 片段中出错会导致可识别的 C 编译器错误。例如,如果省略 `-I` 参数,则结果为“无法编译 BPF 文本”。熟悉 C 或 Python 的开发人员会发现 bcc 工具易于扩展和修改。 +在上面的第一个简单示例中,只要 `sysfs_create_files()` 命令运行,[trace.py][31] bcc 工具脚本就会打印出一条消息。我们看到 `sysfs_create_files()` 由一个 kworker 线程启动,以响应 USB 棒的插入事件,但是它创建了什么文件?第二个例子说明了 eBPF 的强大能力。这里,`trace.py` 正在打印内核回溯(`-K` 选项)以及 `sysfs_create_files()` 创建的文件的名称。单引号内的代码段是一些 C 源代码,包括一个易于识别的格式字符串,所提供的 Python 脚本[引入 LLVM 即时编译器(JIT)][32] 来在内核虚拟机内编译和执行它。必须在第二个命令中重现完整的 `sysfs_create_files()` 函数签名,以便格式字符串可以引用其中一个参数。在此 C 片段中出错会导致可识别的 C 编译器错误。例如,如果省略 `-I` 参数,则结果为“无法编译 BPF 文本”。熟悉 C 或 Python 的开发人员会发现 bcc 工具易于扩展和修改。 插入 USB 记忆棒后,内核回溯显示 PID 7711 是一个 kworker 线程,它在 sysfs 中创建了一个名为 `events` 的文件。使用 `sysfs_remove_files()` 进行相应的调用表明,删除 USB 记忆棒会导致删除该 `events` 文件,这与引用计数的想法保持一致。在 USB 棒插入期间(未显示)在 eBPF 中观察 `sysfs_create_link()` 表明创建了不少于 48 个符号链接。 -无论如何,`events` 文件的目的是什么?使用 [cscope][33] 查找函数 [`__device_add_disk()`][34] 显示它调用 `disk_add_events()`,并且可以将 “media_change” 或 “eject_request” 写入到该文件。这里,内核的块层通知用户空间 “磁盘” 的出现和消失。考虑一下这种调查 USB 棒插入工作原理的方法与试图仅从源头中找出该过程的速度有多快。 +无论如何,`events` 文件的目的是什么?使用 [cscope][33] 查找函数 [`__device_add_disk()`][34] 显示它调用 `disk_add_events()`,并且可以将 “media_change” 或 “eject_request” 写入到该文件。这里,内核的块层通知用户空间该 “磁盘” 的出现和消失。考虑一下这种检查 USB 棒的插入的工作原理的方法与试图仅从源头中找出该过程的速度有多快。 ### 只读根文件系统使得嵌入式设备成为可能 确实,没有人通过拔出电源插头来关闭服务器或桌面系统。为什么?因为物理存储设备上挂载的文件系统可能有挂起的(未完成的)写入,并且记录其状态的数据结构可能与写入存储器的内容不同步。当发生这种情况时,系统所有者将不得不在下次启动时等待 [fsck 文件系统恢复工具][35] 运行完成,在最坏的情况下,实际上会丢失数据。 -然而,狂热爱好者会听说许多物联网和嵌入式设备,如路由器、恒温器和汽车现在都运行 Linux。许多这些设备几乎完全没有用户界面,并且没有办法干净地“解除启动”它们。想一想使用启动电池耗尽的汽车,其中[运行 Linux 的主机设备][36] 的电源会不断加电断电。当引擎最终开始运行时,系统如何在没有长时间 fsck 的情况下启动呢?答案是嵌入式设备依赖于[只读根文件系统][37](简称 ro-rootfs)。 - +然而,狂热爱好者会听说许多物联网和嵌入式设备,如路由器、恒温器和汽车现在都运行着 Linux。许多这些设备几乎完全没有用户界面,并且没有办法干净地让它们“解除启动”。想一想启动电池耗尽的汽车,其中[运行 Linux 的主机设备][36] 的电源会不断加电断电。当引擎最终开始运行时,系统如何在没有长时间 fsck 的情况下启动呢?答案是嵌入式设备依赖于[只读根文件系统][37](简称 ro-rootfs)。 ![Photograph of a console][38] *ro-rootfs 是嵌入式系统不经常需要 fsck 的原因。 来源:* -ro-rootfs 提供了许多优点,虽然这些优点不如耐用性那么显然。一个是,如果没有 Linux 进程可以写入,那么恶意软件无法写入 `/usr` 或 `/lib`。另一个是,基本上不可变的文件系统对于远程设备的现场支持至关重要,因为支持人员拥有名义上与现场相同的本地系统。也许最重要(但也是最微妙)的优势是 ro-rootfs 迫使开发人员在项目的设计阶段就决定哪些系统对象是不可变的。处理 ro-rootfs 可能经常是不方便甚至是痛苦的,[编程语言中的常量变量][39]经常就是这样,但带来的好处很容易偿还额外的开销。 +ro-rootfs 提供了许多优点,虽然这些优点不如耐用性那么显然。一个是,如果 Linux 进程不可以写入,那么恶意软件也无法写入 `/usr` 或 `/lib`。另一个是,基本上不可变的文件系统对于远程设备的现场支持至关重要,因为支持人员拥有理论上与现场相同的本地系统。也许最重要(但也是最微妙)的优势是 ro-rootfs 迫使开发人员在项目的设计阶段就决定好哪些系统对象是不可变的。处理 ro-rootfs 可能经常是不方便甚至是痛苦的,[编程语言中的常量变量][39]经常就是这样,但带来的好处很容易偿还这种额外的开销。 -对于嵌入式开发人员,创建只读根文件系统确实需要做一些额外的工作,而这正是 VFS 的用武之地。Linux 需要 `/var` 中的文件可写,此外,嵌入式系统运行的许多流行应用程序将尝试在 `$HOME` 中创建配置点文件。放在家目录中的配置文件的一种解决方案通常是预生成它们并将它们构建到 rootfs 中。对于 `/var`,一种方法是将其挂载在单独的可写分区上,而 `/` 本身以只读方式挂载。使用绑定或叠加挂载是另一种流行的替代方案。 +对于嵌入式开发人员,创建只读根文件系统确实需要做一些额外的工作,而这正是 VFS 的用武之地。Linux 需要 `/var` 中的文件可写,此外,嵌入式系统运行的许多流行应用程序会尝试在 `$HOME` 中创建配置的点文件。放在家目录中的配置文件的一种解决方案通常是预生成它们并将它们构建到 rootfs 中。对于 `/var`,一种方法是将其挂载在单独的可写分区上,而 `/` 本身以只读方式挂载。使用绑定或叠加挂载是另一种流行的替代方案。 ### 绑定和叠加挂载以及在容器中的使用 -运行 [man mount][40] 是了解绑定挂载bind mount叠加挂载overlay mount的最好办法,这使嵌入式开发人员和系统管理员能够在一个路径位置创建文件系统,然后在另外一个路径将其提供给应用程序。对于嵌入式系统,这代表着可以将文件存储在 `/var` 中的不可写闪存设备上,但是在启动时将 tmpfs 中的路径叠加挂载或绑定挂载到 `/var` 路径上,这样应用程序就可以在那里随意写它们的内容了。下次加电时,`/var` 中的变化将会消失。叠加挂载提供了 tmpfs 和底层文件系统之间的联合,允许对 ro-rootfs 中的现有文件进行直接修改,而绑定挂载可以使新的空 tmpfs 目录在 ro-rootfs 路径中显示为可写。虽然叠加文件系统是一种适当的文件系统类型,但绑定挂载由 [VFS 命名空间工具][41] 实现的。 +运行 [man mount][40] 是了解绑定挂载bind mount叠加挂载overlay mount的最好办法,这种方法使得嵌入式开发人员和系统管理员能够在一个路径位置创建文件系统,然后以另外一个路径将其提供给应用程序。对于嵌入式系统,这代表着可以将文件存储在 `/var` 中的不可写闪存设备上,但是在启动时将 tmpfs 中的路径叠加挂载或绑定挂载到 `/var` 路径上,这样应用程序就可以在那里随意写它们的内容了。下次加电时,`/var` 中的变化将会消失。叠加挂载为 tmpfs 和底层文件系统提供了联合,允许对 ro-rootfs 中的现有文件进行直接修改,而绑定挂载可以使新的空 tmpfs 目录在 ro-rootfs 路径中显示为可写。虽然叠加文件系统是一种适当的文件系统类型,而绑定挂载由 [VFS 命名空间工具][41] 实现的。 -根据叠加挂载和绑定挂载的描述,没有人会对 [Linux容器][42] 大量使用它们感到惊讶。让我们通过运行 bcc 的 `mountsnoop` 工具监视当使用 [systemd-nspawn][43] 启动容器时会发生什么: +根据叠加挂载和绑定挂载的描述,没有人会对 [Linux 容器][42] 中大量使用它们感到惊讶。让我们通过运行 bcc 的 `mountsnoop` 工具监视当使用 [systemd-nspawn][43] 启动容器时会发生什么: ![Console - system-nspawn invocation][44] @@ -135,13 +134,13 @@ ro-rootfs 提供了许多优点,虽然这些优点不如耐用性那么显然 ![Console - Running mountsnoop][45] -在容器 “启动” 期间运行 `mountsnoop` 可以看到容器运行时很大程度上依赖于绑定挂载。(仅显示冗长输出的开头) +*在容器 “启动” 期间运行 `mountsnoop` 可以看到容器运行时很大程度上依赖于绑定挂载。(仅显示冗长输出的开头)* -这里,`systemd-nspawn` 将主机的 procfs 和 sysfs 中的选定文件其 rootfs 中的路径提供给容器按。除了设置绑定挂载时的 `MS_BIND` 标志之外,`mount` 系统调用的一些其他标志用于确定主机命名空间和容器中的更改之间的关系。例如,绑定挂载可以将 `/proc` 和 `/sys` 中的更改传播到容器,也可以隐藏它们,具体取决于调用。 +这里,`systemd-nspawn` 将主机的 procfs 和 sysfs 中的选定文件按其 rootfs 中的路径提供给容器。除了设置绑定挂载时的 `MS_BIND` 标志之外,`mount` 系统调用的一些其它标志用于确定主机命名空间和容器中的更改之间的关系。例如,绑定挂载可以将 `/proc` 和 `/sys` 中的更改传播到容器,也可以隐藏它们,具体取决于调用。 ### 总结 -理解 Linux 内部结构似乎是一项不可能完成的任务,因为除了 Linux 用户空间应用程序和 glibc 这样的 C 库中的系统调用接口,内核本身也包含大量代码。取得进展的一种方法是阅读一个内核子系统的源代码,重点是理解面向用户空间的系统调用和头文件以及主要的内核内部接口,这里以 `file_operations` 表为例的。`file_operations` 使得“一切都是文件”可以实际工作,因此掌握它们收获特别大。顶级 `fs/` 目录中的内核 C 源文件构成了虚拟文件系统的实现,虚拟文件​​系统是支持流行的文件系统和存储设备的广泛且相对简单的互操作性的垫片层。通过 Linux 命名空间进行绑定挂载和覆盖挂载是 VFS 魔术,它使容器和只读根文件系统成为可能。结合对源代码的研究,eBPF 内核工具及其 bcc 接口使得探测内核比以往任何时候都更简单。 +理解 Linux 内部结构看似是一项不可能完成的任务,因为除了 Linux 用户空间应用程序和 glibc 这样的 C 库中的系统调用接口,内核本身也包含大量代码。取得进展的一种方法是阅读一个内核子系统的源代码,重点是理解面向用户空间的系统调用和头文件以及主要的内核内部接口,这里以 `file_operations` 表为例。`file_operations` 使得“一切都是文件”得以可以实际工作,因此掌握它们收获特别大。顶级 `fs/` 目录中的内核 C 源文件构成了虚拟文件系统的实现,虚拟文件​​系统是支持流行的文件系统和存储设备的广泛且相对简单的互操作性的垫片层。通过 Linux 命名空间进行绑定挂载和覆盖挂载是 VFS 魔术,它使容器和只读根文件系统成为可能。结合对源代码的研究,eBPF 内核工具及其 bcc 接口使得探测内核比以往任何时候都更简单。 非常感谢 [Akkana Peck][46] 和 [Michael Eager][47] 的评论和指正。 @@ -154,7 +153,7 @@ via: https://opensource.com/article/19/3/virtual-filesystems-linux 作者:[Alison Chariken][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9180448672859c7a3b4c72c86b631b7c7d5d6bf8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 May 2019 00:04:21 +0800 Subject: [PATCH 0551/1154] PUB:20190308 Virtual filesystems in Linux- Why we need them and how they work.md @wxy https://linux.cn/article-10884-1.html --- ...ilesystems in Linux- Why we need them and how they work.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190308 Virtual filesystems in Linux- Why we need them and how they work.md (99%) diff --git a/translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/published/20190308 Virtual filesystems in Linux- Why we need them and how they work.md similarity index 99% rename from translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md rename to published/20190308 Virtual filesystems in Linux- Why we need them and how they work.md index 3b701727be..8ffd7c6ab0 100644 --- a/translated/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ b/published/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10884-1.html) [#]: subject: (Virtual filesystems in Linux: Why we need them and how they work) [#]: via: (https://opensource.com/article/19/3/virtual-filesystems-linux) [#]: author: (Alison Chariken ) From 998c3b3720c891d688381c72d684e415c426d55f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 22 May 2019 08:54:54 +0800 Subject: [PATCH 0552/1154] translated --- ...90516 Building Smaller Container Images.md | 117 ------------------ ...90516 Building Smaller Container Images.md | 117 ++++++++++++++++++ 2 files changed, 117 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20190516 Building Smaller Container Images.md create mode 100644 translated/tech/20190516 Building Smaller Container Images.md diff --git a/sources/tech/20190516 Building Smaller Container Images.md b/sources/tech/20190516 Building Smaller Container Images.md deleted file mode 100644 index 49700ce58a..0000000000 --- a/sources/tech/20190516 Building Smaller Container Images.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Building Smaller Container Images) -[#]: via: (https://fedoramagazine.org/building-smaller-container-images/) -[#]: author: (Muayyad Alsadi https://fedoramagazine.org/author/alsadi/) - -Building Smaller Container Images -====== - -![][1] - -Linux Containers have become a popular topic, making sure that a container image is not bigger than it should be is considered as a good practice. This article give some tips on how to create smaller Fedora container images. - -### microdnf - -Fedora’s DNF is written in Python and and it’s designed to be extensible as it has wide range of plugins. But Fedora has an alternative base container image which uses an smaller package manager called [microdnf][2] written in C. To use this minimal image in a Dockerfile the FROM line should look like this: - -``` -FROM registry.fedoraproject.org/fedora-minimal:30 -``` - -This is an important saving if your image does not need typical DNF dependencies like Python. For example, if you are making a NodeJS image. - -### Install and Clean up in one layer - -To save space it’s important to remove repos meta data using _dnf clean all_ or its microdnf equivalent _microdnf clean all_. But you should not do this in two steps because that would actually store those files in a container image layer then mark them for deletion in another layer. To do it properly you should do the installation and cleanup in one step like this - -``` -FROM registry.fedoraproject.org/fedora-minimal:30 -RUN microdnf install nodejs && microdnf clean all -``` - -### Modularity with microdnf - -Modularity is a way to offer you different versions of a stack to choose from. For example you might want non-LTS NodeJS version 11 for a project and old LTS NodeJS version 8 for another and latest LTS NodeJS version 10 for another. You can specify which stream using colon - -``` -# dnf module list -# dnf module install nodejs:8 -``` - -The _dnf module install_ command implies two commands one that enables the stream and one that install nodejs from it. - -``` -# dnf module enable nodejs:8 -# dnf install nodejs -``` - -Although microdnf does not offer any command related to modularity, it is possible to enable a module with a configuation file, and libdnf (which microdnf uses) [seems][3] to support modularity streams. The file looks like this - -``` -/etc/dnf/modules.d/nodejs.module -[nodejs] -name=nodejs -stream=8 -profiles= -state=enabled -``` - -A full Dockerfile using modularity with microdnf looks like this: - -``` -FROM registry.fedoraproject.org/fedora-minimal:30 -RUN \ - echo -e "[nodejs]\nname=nodejs\nstream=8\nprofiles=\nstate=enabled\n" > /etc/dnf/modules.d/nodejs.module && \ - microdnf install nodejs zopfli findutils busybox && \ - microdnf clean all -``` - -### Multi-staged builds - -In many cases you might have tons of build-time dependencies that are not needed to run the software for example building a Go binary, which statically link dependencies. Multi-stage build are an efficient way to separate the application build and the application runtime. - -For example the Dockerfile below builds [confd][4] a Go application. - -``` -# building container -FROM registry.fedoraproject.org/fedora-minimal AS build -RUN mkdir /go && microdnf install golang && microdnf clean all -WORKDIR /go -RUN export GOPATH=/go; CGO_ENABLED=0 go get github.com/kelseyhightower/confd - -FROM registry.fedoraproject.org/fedora-minimal -WORKDIR / -COPY --from=build /go/bin/confd /usr/local/bin -CMD ["confd"] -``` - -The multi-stage build is done by adding _AS_ after the _FROM_ instruction and by having another _FROM_ from a base container image then using C _OPY –from=_ instruction to copy content from the _build_ container to the second container. - -This Dockerfile can then be built and run using podman - -``` -$ podman build -t myconfd . -$ podman run -it myconfd -``` - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/building-smaller-container-images/ - -作者:[Muayyad Alsadi][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/alsadi/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/smaller-container-images-816x345.jpg -[2]: https://github.com/rpm-software-management/microdnf -[3]: https://bugzilla.redhat.com/show_bug.cgi?id=1575626 -[4]: https://github.com/kelseyhightower/confd diff --git a/translated/tech/20190516 Building Smaller Container Images.md b/translated/tech/20190516 Building Smaller Container Images.md new file mode 100644 index 0000000000..3f8a4d993a --- /dev/null +++ b/translated/tech/20190516 Building Smaller Container Images.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building Smaller Container Images) +[#]: via: (https://fedoramagazine.org/building-smaller-container-images/) +[#]: author: (Muayyad Alsadi https://fedoramagazine.org/author/alsadi/) + +构建更小的容器镜像 +====== + +![][1] + +Linux 容器已经成为一个热门话题,保证容器镜像较小被认为是一个好习惯。本文提供了有关如何构建较小 Fedora 容器镜像的一些提示。 + +### microdnf + +Fedora 的 DNF 是用 Python 编写的,因为它有各种各样的插件,因此它的设计是可扩展的。但是 Fedora 有一个替代的基本容器镜像,它使用一个名为 [microdnf][2] 的较小的包管理器,使用 C 编写。要在 Dockerfile 中使用这个最小的镜像,FROM 行应该如下所示: + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +``` + +如果你的镜像不需要像 Python 这样的典型 DNF 依赖项,那么这是一个重要的节省项。例如,如果你在制作 NodeJS 镜像。 + +### 在一个层中安装和清理 + +为了节省空间,使用 _dnf clean all_ 或其 microdnf 等效的 _microdnf clean all_ 删除仓库元数据非常重要。但是你不应该分两步执行此操作,因为这实际上会将这些文件保存在容器镜像中,然后在另一层中将其标记为删除。要正确地执行此操作,你应该像这样一步完成安装和清理: + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +RUN microdnf install nodejs && microdnf clean all +``` + +### 使用 microdnf 进行模块化 + +模块化是一种给你选择堆栈不同版本的方法。例如,你可能需要在项目中用非 LTS 的 NodeJS v11,旧的 LTS NodeJS v8 用于另一个,最新的 LTS NodeJS v10 用于另一个。你可以使用冒号指定流。 + +``` +# dnf module list +# dnf module install nodejs:8 +``` + +_dnf module install_ 命令意味着两个命令,一个启用流,另一个是从它安装 nodejs。 + +``` +# dnf module enable nodejs:8 +# dnf install nodejs +``` + +尽管 microdnf 不提供与模块化相关的任何命令,但是可以启用有配置文件的模块,并且 libdnf(被 microdnf 使用)[似乎][3]支持模块化流。该文件看起来像这样: + +``` +/etc/dnf/modules.d/nodejs.module +[nodejs] +name=nodejs +stream=8 +profiles= +state=enabled +``` + +使用模块化的 microdnf 的完整 Dockerfile 如下所示: + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +RUN \ + echo -e "[nodejs]\nname=nodejs\nstream=8\nprofiles=\nstate=enabled\n" > /etc/dnf/modules.d/nodejs.module && \ + microdnf install nodejs zopfli findutils busybox && \ + microdnf clean all +``` + +### 多阶段构建 + +在许多情况下,你可能需要大量的无需用于运行软件的构建时依赖项,例如构建一个静态链接依赖项的 Go 二进制文件。多阶段构建是分离应用构建和应用运行时的有效方法。 + +例如,下面的 Dockerfile 构建了一个 Go 应用 [confd][4]。 + +``` +# building container +FROM registry.fedoraproject.org/fedora-minimal AS build +RUN mkdir /go && microdnf install golang && microdnf clean all +WORKDIR /go +RUN export GOPATH=/go; CGO_ENABLED=0 go get github.com/kelseyhightower/confd + +FROM registry.fedoraproject.org/fedora-minimal +WORKDIR / +COPY --from=build /go/bin/confd /usr/local/bin +CMD ["confd"] +``` + +通过在 _FROM_ 指令之后添加 _AS_ 并从基本容器镜像中添加另一个 _FROM_ 然后使用 _COPY --from=_ 指令将内容从_构建_的容器复制到第二个容器来完成多阶段构建。 + +可以使用 podman 构建并运行此 Dockerfile + +``` +$ podman build -t myconfd . +$ podman run -it myconfd +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/building-smaller-container-images/ + +作者:[Muayyad Alsadi][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/alsadi/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/smaller-container-images-816x345.jpg +[2]: https://github.com/rpm-software-management/microdnf +[3]: https://bugzilla.redhat.com/show_bug.cgi?id=1575626 +[4]: https://github.com/kelseyhightower/confd From 7d3f59394548f1aa2f9426530e6bce1278c57f4c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 22 May 2019 08:59:12 +0800 Subject: [PATCH 0553/1154] translating --- .../20190520 PiShrink - Make Raspberry Pi Images Smaller.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md b/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md index ab26d62d93..ad4c0fadf3 100644 --- a/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md +++ b/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9ccf33572f0ee56fbc7b0ec9d331ed00d4515561 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 22 May 2019 21:27:27 +0800 Subject: [PATCH 0554/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190503 API evolution the right way.md | 735 ------------------ .../20190503 API evolution the right way.md | 719 +++++++++++++++++ 2 files changed, 719 insertions(+), 735 deletions(-) delete mode 100644 sources/tech/20190503 API evolution the right way.md create mode 100644 translated/tech/20190503 API evolution the right way.md diff --git a/sources/tech/20190503 API evolution the right way.md b/sources/tech/20190503 API evolution the right way.md deleted file mode 100644 index 087c71eead..0000000000 --- a/sources/tech/20190503 API evolution the right way.md +++ /dev/null @@ -1,735 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (API evolution the right way) -[#]: via: (https://opensource.com/article/19/5/api-evolution-right-way) -[#]: author: (A. Jesse https://opensource.com/users/emptysquare) - -API evolution the right way -====== -Ten covenants that responsible library authors keep with their users. -![Browser of things][1] - -Imagine you are a creator deity, designing a body for a creature. In your benevolence, you wish for the creature to evolve over time: first, because it must respond to changes in its environment, and second, because your wisdom grows and you think of better designs for the beast. It shouldn't remain in the same body forever! - -![Serpents][2] - -The creature, however, might be relying on features of its present anatomy. You can't add wings or change its scales without warning. It needs an orderly process to adapt its lifestyle to its new body. How can you, as a responsible designer in charge of this creature's natural history, gently coax it toward ever greater improvements? - -It's the same for responsible library maintainers. We keep our promises to the people who depend on our code: we release bugfixes and useful new features. We sometimes delete features if that's beneficial for the library's future. We continue to innovate, but we don't break the code of people who use our library. How can we fulfill all those goals at once? - -### Add useful features - -Your library shouldn't stay the same for eternity: you should add features that make your library better for your users. For example, if you have a Reptile class and it would be useful to have wings for flying, go for it. - - -``` -class Reptile: -@property -def teeth(self): -return 'sharp fangs' - -# If wings are useful, add them! -@property -def wings(self): -return 'majestic wings' -``` - -But beware, features come with risk. Consider the following feature in the Python standard library, and see what went wrong with it. - - -``` -bool(datetime.time(9, 30)) == True -bool(datetime.time(0, 0)) == False -``` - -This is peculiar: converting any time object to a boolean yields True, except for midnight. (Worse, the rules for timezone-aware times are even stranger.) - -I've been writing Python for more than a decade but I didn't discover this rule until last week. What kind of bugs can this odd behavior cause in users' code? - -Consider a calendar application with a function that creates events. If an event has an end time, the function requires it to also have a start time. - - -``` -def create_event(day, -start_time=None, -end_time=None): -if end_time and not start_time: -raise ValueError("Can't pass end_time without start_time") - -# The coven meets from midnight until 4am. -create_event(datetime.date.today(), -datetime.time(0, 0), -datetime.time(4, 0)) -``` - -Unfortunately for witches, an event starting at midnight fails this validation. A careful programmer who knows about the quirk at midnight can write this function correctly, of course. - - -``` -def create_event(day, -start_time=None, -end_time=None): -if end_time is not None and start_time is None: -raise ValueError("Can't pass end_time without start_time") -``` - -But this subtlety is worrisome. If a library creator wanted to make an API that bites users, a "feature" like the boolean conversion of midnight works nicely. - -![Man being chased by an alligator][3] - -The responsible creator's goal, however, is to make your library easy to use correctly. - -This feature was written by Tim Peters when he first made the datetime module in 2002. Even founding Pythonistas like Tim make mistakes. [The quirk was removed][4], and all times are True now. - - -``` -# Python 3.5 and later. - -bool(datetime.time(9, 30)) == True -bool(datetime.time(0, 0)) == True -``` - -Programmers who didn't know about the oddity of midnight are saved from obscure bugs, but it makes me nervous to think about any code that relies on the weird old behavior and didn't notice the change. It would have been better if this bad feature were never implemented at all. This leads us to the first promise of any library maintainer: - -#### First covenant: Avoid bad features - -The most painful change to make is when you have to delete a feature. One way to avoid bad features is to add few features in general! Make no public method, class, function, or property without a good reason. Thus: - -#### Second covenant: Minimize features - -Features are like children: conceived in a moment of passion, they must be supported for years. Don't do anything silly just because you can. Don't add feathers to a snake! - -![Serpents with and without feathers][5] - -But of course, there are plenty of occasions when users need something from your library that it does not yet offer. How do you choose the right feature to give them? Here's another cautionary tale. - -### A cautionary tale from asyncio - -As you may know, when you call a coroutine function, it returns a coroutine object: - - -``` -async def my_coroutine(): -pass - -print(my_coroutine()) - -[/code] [code]`` -``` - -Your code must "await" this object to run the coroutine. It's easy to forget this, so asyncio's developers wanted a "debug mode" that catches this mistake. Whenever a coroutine is destroyed without being awaited, the debug mode prints a warning with a traceback to the line where it was created. - -When Yury Selivanov implemented the debug mode, he added as its foundation a "coroutine wrapper" feature. The wrapper is a function that takes in a coroutine and returns anything at all. Yury used it to install the warning logic on each coroutine, but someone else could use it to turn coroutines into the string "hi!" - - -``` -import sys - -def my_wrapper(coro): -return 'hi!' - -sys.set_coroutine_wrapper(my_wrapper) - -async def my_coroutine(): -pass - -print(my_coroutine()) - -[/code] [code]`hi!` -``` - -That is one hell of a customization. It changes the very meaning of "async." Calling set_coroutine_wrapper once will globally and permanently change all coroutine functions. It is, [as Nathaniel Smith wrote][6], "a problematic API" that is prone to misuse and had to be removed. The asyncio developers could have avoided the pain of deleting the feature if they'd better shaped it to its purpose. Responsible creators must keep this in mind: - -#### Third covenant: Keep features narrow - -Luckily, Yury had the good judgment to mark this feature provisional, so asyncio users knew not to rely on it. Nathaniel was free to replace **set_coroutine_wrapper** with a narrower feature that only customized the traceback depth. - - -``` -import sys - -sys.set_coroutine_origin_tracking_depth(2) - -async def my_coroutine(): -pass - -print(my_coroutine()) - -[/code] [code] - - - -RuntimeWarning:'my_coroutine' was never awaited - -Coroutine created at (most recent call last) -File "script.py", line 8, in -print(my_coroutine()) -``` - -This is much better. There's no more global setting that can change coroutines' type, so asyncio users need not code as defensively. Deities should all be as farsighted as Yury. - -#### Fourth covenant: Mark experimental features "provisional" - -If you have merely a hunch that your creature wants horns and a quadruple-forked tongue, introduce the features but mark them "provisional." - -![Serpent with horns][7] - -You might discover that the horns are extraneous but the quadruple-forked tongue is useful after all. In the next release of your library, you can delete the former and mark the latter official. - -### Deleting features - -No matter how wisely we guide our creature's evolution, there may come a time when it's best to delete an official feature. For example, you might have created a lizard, and now you choose to delete its legs. Perhaps you want to transform this awkward creature into a sleek and modern python. - -![Lizard transformed to snake][8] - -There are two main reasons to delete features. First, you might discover a feature was a bad idea, through user feedback or your own growing wisdom. That was the case with the quirky behavior of midnight. Or, the feature might have been well-adapted to your library's environment at first, but the ecology changes. Perhaps another deity invents mammals. Your creature wants to squeeze into the mammals' little burrows and eat the tasty mammal filling, so it has to lose its legs. - -![A mouse][9] - -Similarly, the Python standard library deletes features in response to changes in the language itself. Consider asyncio's Lock. It has been awaitable ever since "await" was added as a keyword: - - -``` -lock = asyncio.Lock() - -async def critical_section(): -await lock -try: -print('holding lock') -finally: -lock.release() -``` - -But now, we can do "async with lock." - - -``` -lock = asyncio.Lock() - -async def critical_section(): -async with lock: -print('holding lock') -``` - -The new style is much better! It's short and less prone to mistakes in a big function with other try-except blocks. Since "there should be one and preferably only one obvious way to do it," [the old syntax is deprecated in Python 3.7][10] and it will be banned soon. - -It's inevitable that ecological change will have this effect on your code, too, so learn to delete features gently. Before you do so, consider the cost or benefit of deleting it. Responsible maintainers are reluctant to make their users change a large amount of their code or change their logic. (Remember how painful it was when Python 3 removed the "u" string prefix, before it was added back.) If the code changes are mechanical, however, like a simple search-and-replace, or if the feature is dangerous, it may be worth deleting. - -#### Whether to delete a feature - -![Balance scales][11] - -Con | Pro ----|--- -Code must change | Change is mechanical -Logic must change | Feature is dangerous - -In the case of our hungry lizard, we decide to delete its legs so it can slither into a mouse's hole and eat it. How do we go about this? We could just delete the **walk** method, changing code from this: - - -``` -class Reptile: -def walk(self): -print('step step step') -``` - -to this: - - -``` -class Reptile: -def slither(self): -print('slide slide slide') -``` - -That's not a good idea; the creature is accustomed to walking! Or, in terms of a library, your users have code that relies on the existing method. When they upgrade to the latest version of your library, their code will break. - - -``` -# User's code. Oops! -Reptile.walk() -``` - -Therefore, responsible creators make this promise: - -#### Fifth covenant: Delete features gently - -There are a few steps involved in deleting a feature gently. Starting with a lizard that walks with its legs, you first add the new method, "slither." Next, deprecate the old method. - - -``` -import warnings - -class Reptile: -def walk(self): -warnings.warn( -"walk is deprecated, use slither", -DeprecationWarning, stacklevel=2) -print('step step step') - -def slither(self): -print('slide slide slide') -``` - -The Python warnings module is quite powerful. By default it prints warnings to stderr, only once per code location, but you can silence warnings or turn them into exceptions, among other options. - -As soon as you add this warning to your library, PyCharm and other IDEs render the deprecated method with a strikethrough. Users know right away that the method is due for deletion. - -`Reptile().walk()` - -What happens when they run their code with the upgraded library? - - -``` -$ python3 script.py - -DeprecationWarning: walk is deprecated, use slither -script.py:14: Reptile().walk() - -step step step -``` - -By default, they see a warning on stderr, but the script succeeds and prints "step step step." The warning's traceback shows what line of the user's code must be fixed. (That's what the "stacklevel" argument does: it shows the call site that users need to change, not the line in your library where the warning is generated.) Notice that the error message is instructive, it describes what a library user must do to migrate to the new version. - -Your users will want to test their code and prove they call no deprecated library methods. Warnings alone won't make unit tests fail, but exceptions will. Python has a command-line option to turn deprecation warnings into exceptions. - - -``` -> python3 -Werror::DeprecationWarning script.py - -Traceback (most recent call last): -File "script.py", line 14, in -Reptile().walk() -File "script.py", line 8, in walk -DeprecationWarning, stacklevel=2) -DeprecationWarning: walk is deprecated, use slither -``` - -Now, "step step step" is not printed, because the script terminates with an error. - -So, once you've released a version of your library that warns about the deprecated "walk" method, you can delete it safely in the next release. Right? - -Consider what your library's users might have in their projects' requirements. - - -``` -# User's requirements.txt has a dependency on the reptile package. -reptile -``` - -The next time they deploy their code, they'll install the latest version of your library. If they haven't yet handled all deprecations, then their code will break, because it still depends on "walk." You need to be gentler than this. There are three more promises you must keep to your users: maintain a changelog, choose a version scheme, and write an upgrade guide. - -#### Sixth covenant: Maintain a changelog - -Your library must have a changelog; its main purpose is to announce when a feature that your users rely on is deprecated or deleted. - -#### Changes in Version 1.1 - -**New features** - - * New function Reptile.slither() - - - -**Deprecations** - - * Reptile.walk() is deprecated and will be removed in version 2.0, use slither() - - ---- - -Responsible creators use version numbers to express how a library has changed so users can make informed decisions about upgrading. A "version scheme" is a language for communicating the pace of change. - -#### Seventh covenant: Choose a version scheme - -There are two schemes in widespread use, [semantic versioning][12] and time-based versioning. I recommend semantic versioning for nearly any library. The Python flavor thereof is defined in [PEP 440][13], and tools like **pip** understand semantic version numbers. - -If you choose semantic versioning for your library, you can delete its legs gently with version numbers like: - -> 1.0: First "stable" release, with walk() -> 1.1: Add slither(), deprecate walk() -> 2.0: Delete walk() - -Your users should depend on a range of your library's versions, like so: - - -``` -# User's requirements.txt. -reptile>=1,<2 -``` - -This allows them to upgrade automatically within a major release, receiving bugfixes and potentially raising some deprecation warnings, but not upgrading to the _next_ major release and risking a change that breaks their code. - -If you follow time-based versioning, your releases might be numbered thus: - -> 2017.06.0: A release in June 2017 -> 2018.11.0: Add slither(), deprecate walk() -> 2019.04.0: Delete walk() - -And users can depend on your library like: - - -``` -# User's requirements.txt for time-based version. -reptile==2018.11.* -``` - -This is terrific, but how do your users know your versioning scheme and how to test their code for deprecations? You have to advise them how to upgrade. - -#### Eighth covenant: Write an upgrade guide - -Here's how a responsible library creator might guide users: - -#### Upgrading to 2.0 - -**Migrate from Deprecated APIs** - -See the changelog for deprecated features. - -**Enable Deprecation Warnings** - -Upgrade to 1.1 and test your code with: - -`python -Werror::DeprecationWarning` - -​​​​​​Now it's safe to upgrade. - ---- - -You must teach users how to handle deprecation warnings by showing them the command line options. Not all Python programmers know this—I certainly have to look up the syntax each time. And take note, you must _release_ a version that prints warnings from each deprecated API so users can test with that version before upgrading again. In this example, version 1.1 is the bridge release. It allows your users to rewrite their code incrementally, fixing each deprecation warning separately until they have entirely migrated to the latest API. They can test changes to their code and changes in your library, independently from each other, and isolate the cause of bugs. - -If you chose semantic versioning, this transitional period lasts until the next major release, from 1.x to 2.0, or from 2.x to 3.0, and so on. The gentle way to delete a creature's legs is to give it at least one version in which to adjust its lifestyle. Don't remove the legs all at once! - -![A skink][14] - -Version numbers, deprecation warnings, the changelog, and the upgrade guide work together to gently evolve your library without breaking the covenant with your users. The [Twisted project's Compatibility Policy][15] explains this beautifully: - -> "The First One's Always Free" -> -> Any application which runs without warnings may be upgraded one minor version of Twisted. -> -> In other words, any application which runs its tests without triggering any warnings from Twisted should be able to have its Twisted version upgraded at least once with no ill effects except the possible production of new warnings. - -Now, we creator deities have gained the wisdom and power to add features by adding methods and to delete them gently. We can also add features by adding parameters, but this brings a new level of difficulty. Are you ready? - -### Adding parameters - -Imagine that you just gave your snake-like creature a pair of wings. Now you must allow it the choice whether to move by slithering or flying. Currently its "move" function takes one parameter. - - -``` -# Your library code. -def move(direction): -print(f'slither {direction}') - -# A user's application. -move('north') -``` - -You want to add a "mode" parameter, but this breaks your users' code if they upgrade, because they pass only one argument. - - -``` -# Your library code. -def move(direction, mode): -assert mode in ('slither', 'fly') -print(f'{mode} {direction}') - -# A user's application. Error! -move('north') -``` - -A truly wise creator promises not to break users' code this way. - -#### Ninth covenant: Add parameters compatibly - -To keep this covenant, add each new parameter with a default value that preserves the original behavior. - - -``` -# Your library code. -def move(direction, mode='slither'): -assert mode in ('slither', 'fly') -print(f'{mode} {direction}') - -# A user's application. -move('north') -``` - -Over time, parameters are the natural history of your function's evolution. They're listed oldest first, each with a default value. Library users can pass keyword arguments to opt into specific new behaviors and accept the defaults for all others. - - -``` -# Your library code. -def move(direction, -mode='slither', -turbo=False, -extra_sinuous=False, -hail_lyft=False): -# ... - -# A user's application. -move('north', extra_sinuous=True) -``` - -There is a danger, however, that a user might write code like this: - - -``` -# A user's application, poorly-written. -move('north', 'slither', False, True) -``` - -What happens if, in the next major version of your library, you get rid of one of the parameters, like "turbo"? - - -``` -# Your library code, next major version. "turbo" is deleted. -def move(direction, -mode='slither', -extra_sinuous=False, -hail_lyft=False): -# ... - -# A user's application, poorly-written. -move('north', 'slither', False, True) -``` - -The user's code still compiles, and this is a bad thing. The code stopped moving extra-sinuously and started hailing a Lyft, which was not the intention. I trust that you can predict what I'll say next: Deleting a parameter requires several steps. First, of course, deprecate the "turbo" parameter. I like a technique like this one, which detects whether any user's code relies on this parameter. - - -``` -# Your library code. -_turbo_default = object() - -def move(direction, -mode='slither', -turbo=_turbo_default, -extra_sinuous=False, -hail_lyft=False): -if turbo is not _turbo_default: -warnings.warn( -"'turbo' is deprecated", -DeprecationWarning, -stacklevel=2) -else: -# The old default. -turbo = False -``` - -But your users might not notice the warning. Warnings are not very loud: they can be suppressed or lost in log files. Users might heedlessly upgrade to the next major version of your library, the version that deletes "turbo." Their code will run without error and silently do the wrong thing! As the Zen of Python says, "Errors should never pass silently." Indeed, reptiles hear poorly, so you must correct them very loudly when they make mistakes. - -![Woman riding an alligator][16] - -The best way to protect your users is with Python 3's star syntax, which requires callers to pass keyword arguments. - - -``` -# Your library code. -# All arguments after "*" must be passed by keyword. -def move(direction, -*, -mode='slither', -turbo=False, -extra_sinuous=False, -hail_lyft=False): -# ... - -# A user's application, poorly-written. -# Error! Can't use positional args, keyword args required. -move('north', 'slither', False, True) -``` - -With the star in place, this is the only syntax allowed: - - -``` -# A user's application. -move('north', extra_sinuous=True) -``` - -Now when you delete "turbo," you can be certain any user code that relies on it will fail loudly. If your library also supports Python 2, there's no shame in that; you can simulate the star syntax thus ([credit to Brett Slatkin][17]): - - -``` -# Your library code, Python 2 compatible. -def move(direction, **kwargs): -mode = kwargs.pop('mode', 'slither') -turbo = kwargs.pop('turbo', False) -sinuous = kwargs.pop('extra_sinuous', False) -lyft = kwargs.pop('hail_lyft', False) - -if kwargs: -raise TypeError('Unexpected kwargs: %r' -% kwargs) - -# ... -``` - -Requiring keyword arguments is a wise choice, but it requires foresight. If you allow an argument to be passed positionally, you cannot convert it to keyword-only in a later release. So, add the star now. You can observe in the asyncio API that it uses the star pervasively in constructors, methods, and functions. Even though "Lock" only takes one optional parameter so far, the asyncio developers added the star right away. This is providential. - - -``` -# In asyncio. -class Lock: -def __init__(self, *, loop=None): -# ... -``` - -Now we've gained the wisdom to change methods and parameters while keeping our covenant with users. The time has come to try the most challenging kind of evolution: changing behavior without changing either methods or parameters. - -### Changing behavior - -Let's say your creature is a rattlesnake, and you want to teach it a new behavior. - -![Rattlesnake][18] - -Sidewinding! The creature's body will appear the same, but its behavior will change. How can we prepare it for this step of its evolution? - -![][19] - -Image by HCA [[CC BY-SA 4.0][20]], [via Wikimedia Commons][21], modified by Opensource.com - -A responsible creator can learn from the following example in the Python standard library, when behavior changed without a new function or parameters. Once upon a time, the os.stat function was introduced to get file statistics, like the creation time. At first, times were always integers. - - -``` ->>> os.stat('file.txt').st_ctime -1540817862 -``` - -One day, the core developers decided to use floats for os.stat times to give sub-second precision. But they worried that existing user code wasn't ready for the change. They created a setting in Python 2.3, "stat_float_times," that was false by default. A user could set it to True to opt into floating-point timestamps. - - -``` ->>> # Python 2.3. ->>> os.stat_float_times(True) ->>> os.stat('file.txt').st_ctime -1540817862.598021 -``` - -Starting in Python 2.5, float times became the default, so any new code written for 2.5 and later could ignore the setting and expect floats. Of course, you could set it to False to keep the old behavior or set it to True to ensure the new behavior in all Python versions, and prepare your code for the day when stat_float_times is deleted. - -Ages passed. In Python 3.1, the setting was deprecated to prepare people for the distant future and finally, after its decades-long journey, [the setting was removed][22]. Float times are now the only option. It's a long road, but responsible deities are patient because we know this gradual process has a good chance of saving users from unexpected behavior changes. - -#### Tenth covenant: Change behavior gradually - -Here are the steps: - - * Add a flag to opt into the new behavior, default False, warn if it's False - * Change default to True, deprecate flag entirely - * Remove the flag - - - -If you follow semantic versioning, the versions might be like so: - -Library version | Library API | User code ----|---|--- -| | -1.0 | No flag | Expect old behavior -1.1 | Add flag, default False, -warn if it's False | Set flag True, -handle new behavior -2.0 | Change default to True, -deprecate flag entirely | Handle new behavior -3.0 | Remove flag | Handle new behavior - -You need _two_ major releases to complete the maneuver. If you had gone straight from "Add flag, default False, warn if it's False" to "Remove flag" without the intervening release, your users' code would be unable to upgrade. User code written correctly for 1.1, which sets the flag to True and handles the new behavior, must be able to upgrade to the next release with no ill effect except new warnings, but if the flag were deleted in the next release, that code would break. A responsible deity never violates the Twisted policy: "The First One's Always Free." - -### The responsible creator - -![Demeter][23] - -Our 10 covenants belong loosely in three categories: - -**Evolve cautiously** - - 1. Avoid bad features - 2. Minimize features - 3. Keep features narrow - 4. Mark experimental features "provisional" - 5. Delete features gently - - - -**Record history rigorously** - - 1. Maintain a changelog - 2. Choose a version scheme - 3. Write an upgrade guide - - - -**Change slowly and loudly** - - 1. Add parameters compatibly - 2. Change behavior gradually - - - -If you keep these covenants with your creature, you'll be a responsible creator deity. Your creature's body can evolve over time, forever improving and adapting to changes in its environment but without sudden changes the creature isn't prepared for. If you maintain a library, keep these promises to your users and you can innovate your library without breaking the code of the people who rely on you. - -* * * - -_This article originally appeared on[A. Jesse Jiryu Davis's blog][24] and is republished with permission._ - -Illustration credits: - - * [The World's Progress, The Delphian Society, 1913][25] - * [Essay Towards a Natural History of Serpents, Charles Owen, 1742][26] - * [On the batrachia and reptilia of Costa Rica: With notes on the herpetology and ichthyology of Nicaragua and Peru, Edward Drinker Cope, 1875][27] - * [Natural History, Richard Lydekker et. al., 1897][28] - * [Mes Prisons, Silvio Pellico, 1843][29] - * [Tierfotoagentur / m.blue-shadow][30] - * [Los Angeles Public Library, 1930][31] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/api-evolution-right-way - -作者:[A. Jesse][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/emptysquare -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) -[2]: https://opensource.com/sites/default/files/uploads/praise-the-creator.jpg (Serpents) -[3]: https://opensource.com/sites/default/files/uploads/bite.jpg (Man being chased by an alligator) -[4]: https://bugs.python.org/issue13936 -[5]: https://opensource.com/sites/default/files/uploads/feathers.jpg (Serpents with and without feathers) -[6]: https://bugs.python.org/issue32591 -[7]: https://opensource.com/sites/default/files/uploads/horns.jpg (Serpent with horns) -[8]: https://opensource.com/sites/default/files/uploads/lizard-to-snake.jpg (Lizard transformed to snake) -[9]: https://opensource.com/sites/default/files/uploads/mammal.jpg (A mouse) -[10]: https://bugs.python.org/issue32253 -[11]: https://opensource.com/sites/default/files/uploads/scale.jpg (Balance scales) -[12]: https://semver.org -[13]: https://www.python.org/dev/peps/pep-0440/ -[14]: https://opensource.com/sites/default/files/uploads/skink.jpg (A skink) -[15]: https://twistedmatrix.com/documents/current/core/development/policy/compatibility-policy.html -[16]: https://opensource.com/sites/default/files/uploads/loudly.jpg (Woman riding an alligator) -[17]: http://www.informit.com/articles/article.aspx?p=2314818 -[18]: https://opensource.com/sites/default/files/uploads/rattlesnake.jpg (Rattlesnake) -[19]: https://opensource.com/sites/default/files/articles/neonate_sidewinder_sidewinding_with_tracks_unlabeled.png -[20]: https://creativecommons.org/licenses/by-sa/4.0 -[21]: https://commons.wikimedia.org/wiki/File:Neonate_sidewinder_sidewinding_with_tracks_unlabeled.jpg -[22]: https://bugs.python.org/issue31827 -[23]: https://opensource.com/sites/default/files/uploads/demeter.jpg (Demeter) -[24]: https://emptysqua.re/blog/api-evolution-the-right-way/ -[25]: https://www.gutenberg.org/files/42224/42224-h/42224-h.htm -[26]: https://publicdomainreview.org/product-att/artist/charles-owen/ -[27]: https://archive.org/details/onbatrachiarepti00cope/page/n3 -[28]: https://www.flickr.com/photos/internetarchivebookimages/20556001490 -[29]: https://www.oldbookillustrations.com/illustrations/stationery/ -[30]: https://www.alamy.com/mediacomp/ImageDetails.aspx?ref=D7Y61W -[31]: https://www.vintag.es/2013/06/riding-alligator-c-1930s.html diff --git a/translated/tech/20190503 API evolution the right way.md b/translated/tech/20190503 API evolution the right way.md new file mode 100644 index 0000000000..a999b724f5 --- /dev/null +++ b/translated/tech/20190503 API evolution the right way.md @@ -0,0 +1,719 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (API evolution the right way) +[#]: via: (https://opensource.com/article/19/5/api-evolution-right-way) +[#]: author: (A. Jesse https://opensource.com/users/emptysquare) + +API 演进的正确方式 +====== +负责任的库作者与其用户保持的十个约定。 +![Browser of things][1] + +想象你是一个创造之神,为一个生物设计一个身体。出于仁慈,你希望这个生物能随着时间进化:首先,因为它必须对环境的变化作出反应,其次,因为你的智慧在增长,你想到了更好的设计。它不应该永远留在同一个身体里! + +![Serpents][2] + +然而,该生物可能依赖于其目前解剖学的特征。你不能在没有警告的情况下添加翅膀或改变它的比例。它需要一个有序的过程来适应新的身体。作为一个负责任的设计师,你如何才能温柔地引导这种生物走向更大的进步呢? + +对于负责任的库维护者也是如此。我们向依赖我们代码的人保证我们的承诺:我们发布 bug 修复和有用的新特性。如果对库的未来有利,我们有时会删除特性。我们不断创新,但我们不会破坏使用我们库的人的代码。我们怎样才能一次实现所有这些目标呢? + +### 添加有用的特性 + +你的库不应该永远保持不变:你应该添加一些特性,使你的库更适合用户。例如,如果你有一个爬行动物类,并且有翅膀飞行是有用的,那就去添加吧。 + +``` +class Reptile: + @property + def teeth(self): + return 'sharp fangs' + + # 如果 wings 是有用的,那就添加它! + @property + def wings(self): + return 'majestic wings' +``` + +但要注意,特性是有风险的。考虑 Python 标准库中以下功能,看看它出了什么问题。 + +``` +bool(datetime.time(9, 30)) == True +bool(datetime.time(0, 0)) == False +``` + +这很奇怪:将任何时间对象转换为布尔值都会得到 True,但午夜时间除外。(更糟糕的是,时区感知时间的规则更加奇怪。) + +我已经写了十多年的 Python 了,但直到上周才发现这条规则。这种奇怪的行为会在用户代码中引起什么样的 bug? + +考虑一个日历应用程序,它带有一个创建事件的函数。如果一个事件有一个结束时间,那么函数也应该要求它有一个开始时间。 +``` +def create_event(day, + start_time=None, + end_time=None): + if end_time and not start_time: + raise ValueError("Can't pass end_time without start_time") + + # 女巫集会从午夜一直开到凌晨 4 点 +create_event(datetime.date.today(), + datetime.time(0, 0), + datetime.time(4, 0)) +``` + +不幸的是,对于女巫来说,从午夜开始的事件无法通过验证。当然,一个了解午夜怪癖的细心程序员可以正确地编写这个函数。 + +``` +def create_event(day, + start_time=None, + end_time=None): + if end_time is not None and start_time is None: + raise ValueError("Can't pass end_time without start_time") +``` + +但这种微妙之处令人担忧。如果一个库作者想要创建一个对用户有害的 API,那么像午夜的布尔转换这样的“特性”很有效。 + +![Man being chased by an alligator][3] + +但是,负责任的创建者的目标是使你的库易于正确使用。 + +这个功能是由 Tim Peters 在 2002 年首次编写 datetime 模块时造成的。即时是像 Tim 这样的 Python 创始人也会犯错误。[这个怪异后来被消除了][4],现在所有时间的布尔值都是 True。 + +``` +# Python 3.5 以后 + +bool(datetime.time(9, 30)) == True +bool(datetime.time(0, 0)) == True +``` + +不知道午夜古怪之处的程序员现在可以从晦涩的 bug 中解脱出来,但是一想到任何依赖于古怪的旧行为的代码现在没有注意变化,我会感到紧张。如果根本不实现这个糟糕的特性,情况会更好。这就引出了库维护者的第一个承诺: + +#### 第一个约定:避免糟糕的特性 + +最痛苦的变化是你必须删除一个特性。一般来说,避免糟糕特性的一种方法是添加少的特性!没有充分的理由,不要使用公共方法、类、功能或属性。因此: + +#### 第二个约定:最小化特性 + +特性就像孩子:在充满激情的瞬间孕育,(to 校正:我怀疑作者在开车,可是我没有证据)它们必须得到多年的支持。不要因为你能做傻事就去做傻事。不要画蛇添足(to 校正:我认为这里内在是这个意思)! + +![Serpents with and without feathers][5] + +但是,当然,在很多情况下,用户需要你的库中尚未提供的东西,你如何选择合适的功能给他们?以下另一个警示故事。 + +### 一个来自 asyncio 的警示故事 + +你可能知道,当你调用一个协程函数,它会返回一个协程对象: + +``` +async def my_coroutine(): + pass + +print(my_coroutine()) +``` +``` + +``` + +你的代码必须 "await" 这个对象以此来运行协程。很容易忘记这一点,所以 asyncio 的开发人员想要一个“调试模式”来捕捉这个错误。但协程在没有 await 的情况下被销毁时,调试模式将打印一个警告,并在其创建的行上进行回溯。 + +当 Yury Selivanov 实现调试模式时,他在其基础上添加了一个“协程装饰器”特性。装饰器是一个函数,它接收一个协程并返回所有内容。Yury 使用它在每个协程上安装警告逻辑,但是其他人可以使用它将协程转换为字符串 "hi!"。 + +``` +import sys + +def my_wrapper(coro): + return 'hi!' + +sys.set_coroutine_wrapper(my_wrapper) + +async def my_coroutine(): + pass + +print(my_coroutine()) +``` +``` +hi! +``` + +这是一个地狱般的定制。它改变了 "async" 的含义。一次调用 `set_coroutine_wrapper` 将在全局永久改变所有的协程函数。正如 [Nathaniel Smith 所说][6]:“一个有问题的 API” 很容易被误用,必须被删除。如果异步开发人员能够更好地按照其目标来设计该特性,他们就可以避免删除该特性的痛苦。负责任的创建者必须牢记这一点: + +#### 第三个约定:保持特性单一 + +幸运的是,Yury 有良好的判断力,他将特性标记为临时,所以 asyncio 用户知道不能依赖它。Nathaniel 可以用更单一的功能替换 **set_coroutine_wrapper** ,该特性只定制回溯深度。 + +``` +import sys + +sys.set_coroutine_origin_tracking_depth(2) + +async def my_coroutine(): + pass + +print(my_coroutine()) + +``` +``` + + +RuntimeWarning:'my_coroutine' was never awaited + +Coroutine created at (most recent call last) + File "script.py", line 8, in + print(my_coroutine()) +``` + +这样好多了。没有其他全局设置可以更改协程的类型,因此 asyncio 用户无需编写防御代码。神灵应该像 Yury 一样有远见。 + +#### 第四个约定:标记实验特征“临时” + +如果你只是预感你的生物需要犄角和四叉舌,那就介绍一下这些特性,但将它们标记为“临时”。 + +![Serpent with horns][7] + +你可能会发现犄角是无关紧要的,但是四叉舌是有用的。在库的下一个版本中,你可以删除前者并标记后者。 + +### 删除特性 + +无论我们如何明智地指导我们的生物进化,总会有一天最好删除一个官方特征。例如,你可能已经创建了一只蜥蜴,现在你选择删除它的腿。也许你想把这个笨拙的家伙变成一条时尚而现代的蟒蛇。 + +![Lizard transformed to snake][8] + +删除特性主要有两个原因。首先,通过用户反馈或者你自己不断增长的智慧,你可能会发现某个特性是个坏主意。午夜的古怪行为就是这种情况。或者,最初该特性可能已经很好地适应了你的库环境,但现在生态环境发生了变化,也许另一个神发明了哺乳动物,你的生物想要挤进哺乳动物的小洞穴里,吃掉里面美味的哺乳动物,所以它不得不失去双腿。 + +![A mouse][9] + +同样,Python 标准库会根据语言本身的变化删除特性。考虑 asyncio 的 Lock 功能,在把 "await" 作为一个关键字添加进来之前,它一直在等待: + +``` +lock = asyncio.Lock() + +async def critical_section(): + await lock + try: + print('holding lock') + finally: + lock.release() +``` + +但是现在,我们可以做“锁同步”: + + +``` +lock = asyncio.Lock() + +async def critical_section(): + async with lock: + print('holding lock') +``` + +新方法好多了!很短,并且在一个大函数中使用其他 try-except 块时不容易出错。因为“尽量找一种,最好是唯一一种明显的解决方案”,[旧语法在 Python 3.7 中被弃用][10],并且很快就会被禁止。 + +不可避免的是,生态变化会对你的代码产生影响,因此要学会温柔地删除特性。在此之前,请考虑删除它的成本或好处。负责任的维护者不愿意让用户更改大量代码或逻辑。(还记得 Python 3 在重新添加 "u" 字符串前缀之前删除它是多么痛苦吗?)如果代码删除是机械性的,就像一个简单的搜索和替换,或者如果该特性是危险的,那么它可能值得删除。 + +#### 是否删除特性 + +![Balance scales][11] + +Con | Pro +---|--- +代码必须改变 | 改变是机械性的 +逻辑必须改变 | 特性是危险的 + +就我们饥饿的蜥蜴而言,我们决定删除它的腿,这样它就可以滑进老鼠洞里吃掉它。我们该怎么做呢?我们可以删除 **walk** 方法,像下面一样修改代码: + +``` +class Reptile: + def walk(self): + print('step step step') +``` + +变成这样: + + +``` +class Reptile: + def slither(self): + print('slide slide slide') +``` + +这不是一个好主意,这个生物习惯于走路!或者,就库而言,你的用户拥有依赖于现有方法的代码。当他们升级到最新库版本时,他们的代码将会崩溃。 + + +``` +# 用户的代码,哦,不! +Reptile.walk() +``` + +因此,负责任的创建者承诺: + +#### 第五条预定:温柔地删除 + +温柔删除一个特性需要几个步骤。从用腿走路的蜥蜴开始,首先添加新方法 "slither"。接下来,弃用旧方法。 + +``` +import warnings + +class Reptile: + def walk(self): + warnings.warn( + "walk is deprecated, use slither", + DeprecationWarning, stacklevel=2) + print('step step step') + + def slither(self): + print('slide slide slide') +``` + +Python 的 warnings 模块非常强大。默认情况下,它会将警告输出到 stderr,每个代码位置只显示一次,但你可以在其它选项中禁用警告或将其转换为异常。 + +一旦将这个警告添加到库中,PyCharm 和其他 IDE 就会使用删除线呈现这个被弃用的方法。用户马上就知道该删除这个方法。 + +`Reptile().walk()` + + +当他们使用升级后的库运行代码时会发生什么? + +``` +$ python3 script.py + +DeprecationWarning: walk is deprecated, use slither + script.py:14: Reptile().walk() + +step step step +``` + +默认情况下,他们会在 stderr 上看到警告,但脚本会成功并打印 "step step step"。警告的回溯显示必须修复用户代码的哪一行。(这就是 "stacklevel" 参数的作用:它显示了用户需要更改的调用,而不是库中生成警告的行。)请注意,错误消息有指导意义,它描述了库用户迁移到新版本必须做的事情。 + +你的用户将希望测试他们的代码,并证明他们没有调用不推荐的库方法。仅警告不会使单元测试失败,但异常会失败。Python 有一个命令行选项,可以将弃用警告转换为异常。 + + +``` +> python3 -Werror::DeprecationWarning script.py + +Traceback (most recent call last): + File "script.py", line 14, in + Reptile().walk() + File "script.py", line 8, in walk + DeprecationWarning, stacklevel=2) +DeprecationWarning: walk is deprecated, use slither +``` + +现在,"step step step" 没有输出出来,因为脚本以一个错误终止。 + +因此,一旦你发布了库的一个版本,该版本会警告已启用的 "walk" 方法,你就可以在下一个版本中安全地删除它。对吧? + +考虑一下你的库用户在他们项目的 requirements 中可能有什么。 + +``` +# 用户的 requirements.txt 显示 reptile 包的依赖关系 +reptile +``` + +下次他们部署代码时,他们将安装最新版本的库。如果他们尚未处理所有的弃用,那么他们的代码将会崩溃,因为代码仍然依赖 "walk"。你需要温柔一点,你必须向用户做出三个承诺:维护更改日志,选择版本方案和编写升级指南。 + +#### 第六个约定:维护变更日志 + +你的库必须有更改日志,其主要目的是宣布用户所依赖的功能何时被弃用或删除。 + +--- +#### 版本 1.1 中的更改 + +**新特性** + + * 新功能 Reptile.slither() + +**弃用** + + * Reptile.walk() 已弃用,将在 2.0 版本中删除,请使用 slither() + +--- + +负责任的创建者使用版本号来表示库发生了怎样的变化,以便用户能够对升级做出明智的决定。“版本方案”是一种用于交流变化速度的语言。 + +#### 第七个约定:选择一个版本方案 + +有两种广泛使用的方案,[语义版本控制][12]和基于时间的版本控制。我推荐任何库都进行语义版本控制。Python 的风格在 [PEP 440][13] 中定义,像 **pip** 这样的工具可以理解语义版本号。 + +如果你为库选择语义版本控制,你可以使用版本号温柔地删除腿,例如: + +> 1.0: First "stable" release, with walk() +> 1.1: Add slither(), deprecate walk() +> 2.0: Delete walk() + +你的用户依赖于你的库的版本应该有一个范围,例如: + +``` +# 用户的 requirements.txt +reptile>=1,<2 +``` + +这允许他们在主要版本中自动升级,接收错误修正并可能引发一些弃用警告,但不会升级到 _下_ 个主要版本并冒着破坏其代码的更改的风险。 + +如果你遵循基于时间的版本控制,则你的版本可能会编号: + +> 2017.06.0: A release in June 2017 +> 2018.11.0: Add slither(), deprecate walk() +> 2019.04.0: Delete walk() + +用户可以依赖于你的库: + +``` +# User's requirements.txt for time-based version. +reptile==2018.11.* +``` + +这允许他们在一个主要版本中自动升级,接收错误修复,并可能引发一些弃用警告,但不能升级到 _下_ 个主要版本,并冒着改变破坏代码的风险。 + +如果你遵循基于时间的版本控制,你的版本号可能是这样: + +> 2017.06.0: A release in June 2017 +> 2018.11.0: Add slither(), deprecate walk() +> 2019.04.0: Delete walk() + +用户可以依赖你的库: + +``` +# 用户的 requirements.txt,对于基于时间的版本 +reptile==2018.11.* +``` + +这非常棒,但你的用户如何知道你的版本方案,以及如何测试代码来进行弃用呢?你必须告诉他们如何升级。 + +#### 第八个约定:写一个升级指南 + +下面是一个负责任的库创建者如何指导用户: + +--- +#### 升级到 2.0 + +**从弃用的 API 迁移** + +请参阅更改日志以了解已弃用的特性。 + +**启用弃用警告** + +升级到 1.1 并使用以下代码测试代码: + +`python -Werror::DeprecationWarning` + +​​​​​​现在可以安全地升级了。 + +--- + +你必须通过向用户显示命令行选项来教会用户如何处理弃用警告。并非所有 Python 程序员都知道这一点 - 当然,我每次都必须查找语法。注意,你必须 _release_ 一个版本,它输出来自每个弃用的 API 的警告,以便用户可以在再次升级之前使用该版本进行测试。在本例中,1.1 版本是小版本。它允许你的用户逐步重写代码,分别修复每个弃用警告,直到他们完全迁移到最新的 API。他们可以彼此独立地测试代码和库的更改,并隔离 bug 的原因。 + +如果你选择语义版本控制,则此过渡期将持续到下一个主要版本,从 1.x 到 2.0,或从 2.x 到 3.0 以此类推。删除生物腿部的温柔方法是至少给它一个版本来调整其生活方式。不要一次性把腿删掉! + +![A skink][14] + +版本号,弃用警告,更改日志和升级指南可以协同工作,在不违背与用户约定的情况下温柔地改进你的库。[Twisted 项目的兼容性政策][15] 解释的很漂亮: + +> "The First One's Always Free" +> +> Any application which runs without warnings may be upgraded one minor version of Twisted. +> +> In other words, any application which runs its tests without triggering any warnings from Twisted should be able to have its Twisted version upgraded at least once with no ill effects except the possible production of new warnings. + +现在,我们的造物之神已经获得了智慧和力量,可以通过添加方法来添加特性,并温柔地删除它们。我们还可以通过添加参数来添加特性,但这带来了新的难度。你准备好了吗? + +### 添加参数 + +想象一下,你只是给了你的蛇形生物一对翅膀。现在你必须允许它选择是滑行还是飞行。目前它的 "move" 功能只接受一个参数。 + + +``` +# 你的库代码 +def move(direction): + print(f'slither {direction}') + +# 用户的应用 +move('north') +``` + +你想要添加一个 "mode" 参数,但如果用户升级库,这会破坏他们的代码,因为他们只传递一个参数。 + + +``` +# 你的库代码 +def move(direction, mode): + assert mode in ('slither', 'fly') + print(f'{mode} {direction}') + +# 一个用户的代码,出现错误! +move('north') +``` + +一个真正聪明的创建者者承诺不会以这种方式破坏用户的代码。 + +#### 第九条约定:兼容地添加参数 + +要保持这个约定,请使用保留原始行为的默认值添加每个新参数。 + +``` +# 你的库代码 +def move(direction, mode='slither'): + assert mode in ('slither', 'fly') + print(f'{mode} {direction}') + +# 用户的应用 +move('north') +``` + +随着时间推移,参数是函数演化的自然历史。它们首先列出最老的,每个都有默认值。库用户可以传递关键字参数以选择特定的新行为,并接受所有其他行为的默认值。 + +``` +# 你的库代码 +def move(direction, + mode='slither', + turbo=False, + extra_sinuous=False, + hail_lyft=False): + # ... + +# 用户应用 +move('north', extra_sinuous=True) +``` + +但是有一个危险,用户可能会编写如下代码: + +``` +# 用户应用,简写 +move('north', 'slither', False, True) +``` + +如果在你在库的下一个主要版本中去掉其中一个参数,例如 "turbo",会发生什么? + +``` +# 你的库代码,下一个主要版本中 "turbo" 被删除 +def move(direction, + mode='slither', + extra_sinuous=False, + hail_lyft=False): + # ... + +# 用户应用,简写 +move('north', 'slither', False, True) +``` + +用户的代码仍然编译,这是一件坏事。代码停止了曲折的移动并开始欢呼 Lyft,这不是它的本意。我相信你可以预测我接下来要说的内容:删除参数需要几个步骤。当然,首先弃用 "trubo" 参数。我喜欢这种技术,它可以检测任何用户的代码是否依赖于这个参数。 + +``` +# 你的库代码 +_turbo_default = object() + +def move(direction, + mode='slither', + turbo=_turbo_default, + extra_sinuous=False, + hail_lyft=False): + if turbo is not _turbo_default: + warnings.warn( + "'turbo' is deprecated", + DeprecationWarning, + stacklevel=2) + else: + # The old default. + turbo = False +``` + +但是你的用户可能不会注意到警告。警告声音不是很大:它们可以在日志文件中被抑制或丢失。用户可能会漫不经心地升级到库的下一个主要版本,即删除 "turbo" 的版本。他们的代码运行将没有错误,默默做错误的事情!正如 Python 之禅所说:“错误绝不应该被默默 pass”。实际上,爬行动物的听力很差,所有当它们犯错误时,你必须非常大声地纠正它们。 + +![Woman riding an alligator][16] + +保护用户的最佳方法是使用 Python 3 的星型语法,它要求调用者传递关键字参数。 + +``` +# 你的库代码 +# All arguments after "*" must be passed by keyword. +def move(direction, + *, + mode='slither', + turbo=False, + extra_sinuous=False, + hail_lyft=False): + # ... + +# 用户代码,简写 +# 错误!不能使用位置参数,关键字参数是必须的 +move('north', 'slither', False, True) +``` + +有了这个星,以下唯一允许的语法: + +``` +# 用户代码 +move('north', extra_sinuous=True) +``` + +现在,当你删除 "turbo" 时,你可以确定任何依赖于它的用户代码都会明显地提示失败。如果你的库也支持 Python2,这没有什么大不了。你可以模拟星型语法([归功于 Brett Slatkin][17]): + +``` +# 你的库代码,兼容 Python 2 +def move(direction, **kwargs): + mode = kwargs.pop('mode', 'slither') + turbo = kwargs.pop('turbo', False) + sinuous = kwargs.pop('extra_sinuous', False) + lyft = kwargs.pop('hail_lyft', False) + + if kwargs: + raise TypeError('Unexpected kwargs: %r' + % kwargs) + +# ... +``` + +要求关键字参数是一个明智的选择,但它需要远见。如果允许按位置传递参数,则不能仅在以后的版本中将其转换为仅关键字。所以,现在加上星号,你可以在 asyncio API 中观察到,它在构造函数、方法和函数中普遍使用星号。尽管到目前为止,"Lock" 只接受一个可选参数,但 asyncio 开发人员立即添加了星号。这是幸运的。 + +``` +# In asyncio. +class Lock: + def __init__(self, *, loop=None): + # ... +``` + +现在,我们已经获得了改变方法和参数的智慧,同时保持与用户的约定。现在是时候尝试最具挑战性的进化了:在不改变方法或参数的情况下改变行为。 + +### 改变行为 + +假设你创造的生物是一条响尾蛇,你想教它一种新行为。 + +![Rattlesnake][18] + +横向的!这个生物的身体看起来是一样的,但它的行为会发生变化。我们如何为这一进化步骤做好准备? + +![][19] + +Image by HCA [[CC BY-SA 4.0][20]], [via Wikimedia Commons][21], 由 Opensource.com 修改 + +当行为在没有新函数或新参数的情况下发生更改时,负责的创建者可以从 Python 标准库中学习。很久以前,os 模块引入了stat 函数来获取文件统计信息,比如创建时间。起初,这个时间总是整数。 + +``` +>>> os.stat('file.txt').st_ctime +1540817862 +``` + +有一天,核心开发人员决定在 os.stat 中使用浮点数来提供亚秒级精度。但他们担心现有的用户代码还没有做好准备更改。于是他们在 Python 2.3 中创建了一个设置 "stat_float_times",默认情况下是 false 。用户可以将其设置为 True 来选择浮点时间戳。 + +``` +>>> # Python 2.3. +>>> os.stat_float_times(True) +>>> os.stat('file.txt').st_ctime +1540817862.598021 +``` + +从 Python 2.5 开始,浮点时间成为默认值,因此 2.5 及之后版本编写的任何新代码都可以忽略该设置并期望得到浮点数。当然,你可以将其设置为 False 以保持旧行为,或将其设置为 True 以确保所有 Python 版本都得到浮点数,并为删除 stat_float_times 的那一天准备代码。 + +多年过去了,在 Python 3.1 中,该设置已被弃用,以便为人们为遥远的未来做好准备,最后,经过数十年的旅程,[这个设置被删除][22]。浮点时间现在是唯一的选择。这是一个漫长的过程,但负责任的神灵是有耐心的,因为我们知道这个渐进的过程很有可能于意外的行为变化拯救用户。 + +#### 第十个约定:逐渐改变行为 + +以下是步骤: + + * 添加一个标志来选择新行为,默认为 False,如果为 False 则发出警告 + * 将默认值更改为 True,表示完全弃用标记 + * 删除标志 + + +如果你遵循语义版本控制,版本可能如下: + +Library version | Library API | User code +---|---|--- +| | +1.0 | 没有标志 | 期望的旧行为 +1.1 | 添加标志,默认为 False,如果是 False,则警告 | 设置标志为 True,处理新行为 +2.0 | 改变默认为 True,完全弃用标志 | 处理新行为 +3.0 | 移除标志 | 处理新行为 + +你需要 _两_ 个主要版本来完成该操作。如果你直接从“添加标志,默认为 False,如果是 False 则发出警告到“删除标志”,而没有中间版本,那么用户的代码将无法升级。为 1.1 正确编写的用户代码必须能够升级到下一个版本,除了新警告之外,没有任何不良影响,但如果在下一个版本中删除了该标志,那么该代码将崩溃。一个负责任的神明从不违反扭曲的政策:“第一个总是自由的”。 + +### 负责任的创建者 + +![Demeter][23] + +我们的 10 个约定大致可以分为三类: + +**谨慎发展** + + 1. 避免不良功能 + 2. 最小化特性 + 3. 保持功能单一 + 4. 标记实验特征“临时” + 5. 温柔删除功能 + + +**严格记录历史** + + 1. 维护更改日志 + 2. 选择版本方案 + 3. 编写升级指南 + + +**缓慢而明显地改变** + + 1. 兼容添加参数 + 2. 逐渐改变行为 + + +如果你对你所创造的物种保持这些约定,你将成为一个负责任的创造之神。你的生物的身体可以随着时间的推移而进化,永远改善和适应环境的变化,而不是在生物没有准备好就突然改变。如果你维护一个库,请向用户保留这些承诺,这样你就可以在不破坏依赖库的人的代码的情况下对库进行更新。 + + +* * * + +_这篇文章最初是在 [A. Jesse Jiryu Davis 的博客上'][24]出现的,经允许转载。_ + +插图参考: + + * [《世界进步》, Delphian Society, 1913][25] + * [《走进蛇的历史》, Charles Owen, 1742][26] + * [关于哥斯达黎加的 batrachia 和爬行动物,关于尼加拉瓜和秘鲁的爬行动物和鱼类学的记录, Edward Drinker Cope, 1875][27] + * [《自然史》, Richard Lydekker et. al., 1897][28] + * [Mes Prisons, Silvio Pellico, 1843][29] + * [Tierfotoagentur / m.blue-shadow][30] + * [洛杉矶公共图书馆, 1930][31] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/api-evolution-right-way + +作者:[A. Jesse][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/emptysquare +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://opensource.com/sites/default/files/uploads/praise-the-creator.jpg (Serpents) +[3]: https://opensource.com/sites/default/files/uploads/bite.jpg (Man being chased by an alligator) +[4]: https://bugs.python.org/issue13936 +[5]: https://opensource.com/sites/default/files/uploads/feathers.jpg (Serpents with and without feathers) +[6]: https://bugs.python.org/issue32591 +[7]: https://opensource.com/sites/default/files/uploads/horns.jpg (Serpent with horns) +[8]: https://opensource.com/sites/default/files/uploads/lizard-to-snake.jpg (Lizard transformed to snake) +[9]: https://opensource.com/sites/default/files/uploads/mammal.jpg (A mouse) +[10]: https://bugs.python.org/issue32253 +[11]: https://opensource.com/sites/default/files/uploads/scale.jpg (Balance scales) +[12]: https://semver.org +[13]: https://www.python.org/dev/peps/pep-0440/ +[14]: https://opensource.com/sites/default/files/uploads/skink.jpg (A skink) +[15]: https://twistedmatrix.com/documents/current/core/development/policy/compatibility-policy.html +[16]: https://opensource.com/sites/default/files/uploads/loudly.jpg (Woman riding an alligator) +[17]: http://www.informit.com/articles/article.aspx?p=2314818 +[18]: https://opensource.com/sites/default/files/uploads/rattlesnake.jpg (Rattlesnake) +[19]: https://opensource.com/sites/default/files/articles/neonate_sidewinder_sidewinding_with_tracks_unlabeled.png +[20]: https://creativecommons.org/licenses/by-sa/4.0 +[21]: https://commons.wikimedia.org/wiki/File:Neonate_sidewinder_sidewinding_with_tracks_unlabeled.jpg +[22]: https://bugs.python.org/issue31827 +[23]: https://opensource.com/sites/default/files/uploads/demeter.jpg (Demeter) +[24]: https://emptysqua.re/blog/api-evolution-the-right-way/ +[25]: https://www.gutenberg.org/files/42224/42224-h/42224-h.htm +[26]: https://publicdomainreview.org/product-att/artist/charles-owen/ +[27]: https://archive.org/details/onbatrachiarepti00cope/page/n3 +[28]: https://www.flickr.com/photos/internetarchivebookimages/20556001490 +[29]: https://www.oldbookillustrations.com/illustrations/stationery/ +[30]: https://www.alamy.com/mediacomp/ImageDetails.aspx?ref=D7Y61W +[31]: https://www.vintag.es/2013/06/riding-alligator-c-1930s.html From 9be9efb801072a9f9d7aa075a0a9bf879637b384 Mon Sep 17 00:00:00 2001 From: LCTT Bot <33473206+LCTT-Bot@users.noreply.github.com> Date: Wed, 22 May 2019 21:35:33 +0800 Subject: [PATCH 0555/1154] =?UTF-8?q?Revert=20"=E7=94=B3=E8=AF=B7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91"=20(#13773)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d5722e28a8ca937474cc5fba23c05d7bd0edf30f. --- ...0190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md index 56f8b8d8c1..9e85b82f2c 100644 --- a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md +++ b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (sanfusu) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b1cc71bac80e5f80dace2c012ed86516ec275011 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 22 May 2019 21:36:15 +0800 Subject: [PATCH 0556/1154] PRF&PUB:20190516 Building Smaller Container Images (#13776) * PRF:20190516 Building Smaller Container Images.md @geekpi * PUB:20190516 Building Smaller Container Images.md @geekpi https://linux.cn/article-10885-1.html --- ...90516 Building Smaller Container Images.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) rename {translated/tech => published}/20190516 Building Smaller Container Images.md (69%) diff --git a/translated/tech/20190516 Building Smaller Container Images.md b/published/20190516 Building Smaller Container Images.md similarity index 69% rename from translated/tech/20190516 Building Smaller Container Images.md rename to published/20190516 Building Smaller Container Images.md index 3f8a4d993a..35efa5ea3a 100644 --- a/translated/tech/20190516 Building Smaller Container Images.md +++ b/published/20190516 Building Smaller Container Images.md @@ -1,32 +1,32 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10885-1.html) [#]: subject: (Building Smaller Container Images) [#]: via: (https://fedoramagazine.org/building-smaller-container-images/) [#]: author: (Muayyad Alsadi https://fedoramagazine.org/author/alsadi/) -构建更小的容器镜像 +构建更小的容器镜像的技巧 ====== ![][1] -Linux 容器已经成为一个热门话题,保证容器镜像较小被认为是一个好习惯。本文提供了有关如何构建较小 Fedora 容器镜像的一些提示。 +Linux 容器已经成为一个热门话题,保证容器镜像较小被认为是一个好习惯。本文提供了有关如何构建较小 Fedora 容器镜像的一些技巧。 ### microdnf -Fedora 的 DNF 是用 Python 编写的,因为它有各种各样的插件,因此它的设计是可扩展的。但是 Fedora 有一个替代的基本容器镜像,它使用一个名为 [microdnf][2] 的较小的包管理器,使用 C 编写。要在 Dockerfile 中使用这个最小的镜像,FROM 行应该如下所示: +Fedora 的 DNF 是用 Python 编写的,因为它有各种各样的插件,因此它的设计是可扩展的。但是 有一个 Fedora 基本容器镜像替代品,它使用一个较小的名为 [microdnf][2] 的包管理器,使用 C 编写。要在 Dockerfile 中使用这个最小的镜像,`FROM` 行应该如下所示: ``` FROM registry.fedoraproject.org/fedora-minimal:30 ``` -如果你的镜像不需要像 Python 这样的典型 DNF 依赖项,那么这是一个重要的节省项。例如,如果你在制作 NodeJS 镜像。 +如果你的镜像不需要像 Python 这样的典型 DNF 依赖项,例如,如果你在制作 NodeJS 镜像时,那么这是一个重要的节省项。 ### 在一个层中安装和清理 -为了节省空间,使用 _dnf clean all_ 或其 microdnf 等效的 _microdnf clean all_ 删除仓库元数据非常重要。但是你不应该分两步执行此操作,因为这实际上会将这些文件保存在容器镜像中,然后在另一层中将其标记为删除。要正确地执行此操作,你应该像这样一步完成安装和清理: +为了节省空间,使用 `dnf clean all` 或其 microdnf 等效的 `microdnf clean all` 删除仓库元数据非常重要。但是你不应该分两步执行此操作,因为这实际上会将这些文件保存在容器镜像中,然后在另一层中将其标记为删除。要正确地执行此操作,你应该像这样一步完成安装和清理: ``` FROM registry.fedoraproject.org/fedora-minimal:30 @@ -35,21 +35,21 @@ RUN microdnf install nodejs && microdnf clean all ### 使用 microdnf 进行模块化 -模块化是一种给你选择堆栈不同版本的方法。例如,你可能需要在项目中用非 LTS 的 NodeJS v11,旧的 LTS NodeJS v8 用于另一个,最新的 LTS NodeJS v10 用于另一个。你可以使用冒号指定流。 +模块化是一种给你选择不同堆栈版本的方法。例如,你可能需要在项目中用非 LTS 的 NodeJS v11,旧的 LTS NodeJS v8 用于另一个,最新的 LTS NodeJS v10 用于另一个。你可以使用冒号指定流。 ``` # dnf module list # dnf module install nodejs:8 ``` -_dnf module install_ 命令意味着两个命令,一个启用流,另一个是从它安装 nodejs。 +`dnf module install` 命令意味着两个命令,一个启用流,另一个是从它安装 nodejs。 ``` # dnf module enable nodejs:8 # dnf install nodejs ``` -尽管 microdnf 不提供与模块化相关的任何命令,但是可以启用有配置文件的模块,并且 libdnf(被 microdnf 使用)[似乎][3]支持模块化流。该文件看起来像这样: +尽管 `microdnf` 不提供与模块化相关的任何命令,但是可以启用带有配置文件的模块,并且 libdnf(被 microdnf 使用)[似乎][3]支持模块化流。该文件看起来像这样: ``` /etc/dnf/modules.d/nodejs.module @@ -60,7 +60,7 @@ profiles= state=enabled ``` -使用模块化的 microdnf 的完整 Dockerfile 如下所示: +使用模块化的 `microdnf` 的完整 Dockerfile 如下所示: ``` FROM registry.fedoraproject.org/fedora-minimal:30 @@ -89,9 +89,9 @@ COPY --from=build /go/bin/confd /usr/local/bin CMD ["confd"] ``` -通过在 _FROM_ 指令之后添加 _AS_ 并从基本容器镜像中添加另一个 _FROM_ 然后使用 _COPY --from=_ 指令将内容从_构建_的容器复制到第二个容器来完成多阶段构建。 +通过在 `FROM` 指令之后添加 `AS` 并从基本容器镜像中添加另一个 `FROM` 然后使用 `COPY --from=` 指令将内容从*构建*的容器复制到第二个容器来完成多阶段构建。 -可以使用 podman 构建并运行此 Dockerfile +可以使用 `podman` 构建并运行此 Dockerfile: ``` $ podman build -t myconfd . @@ -105,7 +105,7 @@ via: https://fedoramagazine.org/building-smaller-container-images/ 作者:[Muayyad Alsadi][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/) 荣誉推出 From 9d7d3fbb4a190985e1492546bb01b65a16cedf26 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Wed, 22 May 2019 08:36:42 -0500 Subject: [PATCH 0557/1154] Apply for Translating (#13777) Apply for Translating --- ...20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md b/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md index d1bcf06138..ab55e44f0f 100644 --- a/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md +++ b/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tomjlw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -107,7 +107,7 @@ via: https://itsfoss.com/ssh-into-raspberry/ 作者:[Chinmay][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tomjlw](https://github.com/tomjlw) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a83ac0667423446b7f4e5751fe8f1b6e77e6b736 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Wed, 22 May 2019 09:35:41 -0500 Subject: [PATCH 0558/1154] Submit Translated Passage for Review Submit Translated Passage for Review --- ...SSH into a Raspberry Pi -Beginner-s Tip.md | 130 ------------------ ...SSH into a Raspberry Pi -Beginner-s Tip.md | 130 ++++++++++++++++++ 2 files changed, 130 insertions(+), 130 deletions(-) delete mode 100644 sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md create mode 100644 translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md diff --git a/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md b/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md deleted file mode 100644 index ab55e44f0f..0000000000 --- a/sources/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tomjlw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to SSH into a Raspberry Pi [Beginner’s Tip]) -[#]: via: (https://itsfoss.com/ssh-into-raspberry/) -[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) - -How to SSH into a Raspberry Pi [Beginner’s Tip] -====== - -_**In this Raspberry Pi article series, you’ll learn how to enable SSH in Raspberry Pi and then how to SSH into a Raspberry Pi device.**_ - -Out of all the things you can do with [Raspberry Pi][1], using it as a server in a home network is very popular. The tiny footprint and low power consumption makes it a perfect device to run light weight servers. - -One of the things you should be able to do in such a case is run commands on your Raspberry Pi without needing to plug in a display, keyboard, mouse and having to move yourself to the location of your Raspberry Pi each time. - -You achieve this by logging into your Raspberry Pi via SSH ([Secure Shell][2]) from any other computer, your laptop, desktop or even your phone. Let me show you how - -### How to SSH into Raspberry Pi - -![][3] - -I assume that you are [running Raspbian on your Pi][4] and have successfully connected to a network via Ethernet or WiFi. It’s important that your Raspberry Pi is connected to a network otherwise you won’t be able to connect to it via SSH (sorry for stating the obvious). - -#### Step 1: Enable SSH on Raspberry Pi - -SSH is disabled by default in Raspberry Pi, hence you’ll have to enable it when you turn on the Pi after a fresh installation of Raspbian. - -First go to the Raspberry Pi configuration window by navigating through the menu. - -![Raspberry Pi Menu, Raspberry Pi Configuration][5] - -Now, go to the interfaces tab, enable SSH and restart your Pi. - -![Enable SSH on Raspberry Pi][6] - -You can also enable SSH without via the terminal. Just enter the command _**sudo raspi-config**_ and then go to Advanced Options to enable SSH. - -#### Step 2. Find the IP Address of Raspberry Pi - -In most cases your Raspberry Pi will be assigned a local IP address which looks like **192.168.x.x** or **10.x.x.x**. You can [use various Linux commands to find the IP address][7]. - -[][8] - -Suggested read This Linux Malware Targets Unsecure Raspberry Pi Devices - -I am using the good old ifconfig command here but you can also use _**ip address**_. - -``` -ifconfig -``` - -![Raspberry Pi Network Configuration][9] - -This command shows all the list of active network adapters and their configuration. The first entry( **eth0** ) shows IP address as **192.168.2.105** which is valid.I have used Ethernet to connect my Raspberry Pi to the network, hence it is under **eth0**. If you use WiFi check under the entry named ‘ **wlan0** ‘ . - -You can also find out the IP address by other means like checking the network devices list on your router/modem. - -#### Step 3. SSH into your Raspberry Pi - -Now that you have enabled SSH and found out your IP address you can go ahead and SSH into your Raspberry Pi from any other computer. You’ll also need the username and the password for the Raspberry Pi. - -Default Username and Password is: - - * username: pi - * password: raspberry - - - -If you have changed the default password then use the new password instead of the above. Ideally you must change the default password. In the past, a [malware infected thousands of Raspberry Pi devices that were using the default username and password][8]. - -Open a terminal (on Mac and Linux) on the computer from which you want to SSH into your Pi and type the command below. On Windows, you can use a SSH client like [Putty][10]. - -Here, use the IP address you found out in the previous step. - -``` -ssh [email protected] -``` - -_**Note: Make sure your Raspberry Pi and the computer you are using to SSH into your Raspberry Pi are connected to the same network**_. - -![SSH through terminal][11] - -You’ll see a warning the first time, type **yes** and press enter. - -![Type the password \(default is ‘raspberry‘\)][12] - -Now, type in the password and press enter. - -![Successful Login via SSH][13] - -On a successful login you’ll be presented with the terminal of your Raspberry Pi. Now you can any commands on your Raspberry Pi through this terminal remotely(within the current network) without having to access your Raspberry Pi physically. - -[][14] - -Suggested read Speed Up Ubuntu Unity On Low End Systems [Quick Tip] - -Furthermore you can also set up SSH-Keys so that you don’t have to type in the password every time you log in via SSH, but that’s a different topic altogether. - -I hope you were able to SSH into your Raspberry Pi after following this tutorial. Let me know how you plan to use your Raspberry Pi in the comments below! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ssh-into-raspberry/ - -作者:[Chinmay][a] -选题:[lujun9972][b] -译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/chinmay/ -[b]: https://github.com/lujun9972 -[1]: https://www.raspberrypi.org/ -[2]: https://en.wikipedia.org/wiki/Secure_Shell -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/ssh-into-raspberry-pi.png?resize=800%2C450&ssl=1 -[4]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Raspberry-pi-configuration.png?ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/enable-ssh-raspberry-pi.png?ssl=1 -[7]: https://linuxhandbook.com/find-ip-address/ -[8]: https://itsfoss.com/raspberry-pi-malware-threat/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/ifconfig-rapberry-pi.png?ssl=1 -[10]: https://itsfoss.com/putty-linux/ -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-pi-warning.png?fit=800%2C199&ssl=1 -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-pi-password.png?fit=800%2C202&ssl=1 -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-Pi-successful-login.png?fit=800%2C306&ssl=1 -[14]: https://itsfoss.com/speed-up-ubuntu-unity-on-low-end-system/ diff --git a/translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md b/translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md new file mode 100644 index 0000000000..d09a117e88 --- /dev/null +++ b/translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to SSH into a Raspberry Pi [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/ssh-into-raspberry/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +如何 SSH 进入树莓派 [新手教程] +====== + +_**在这篇树莓派文章中,你将学到如何在树莓派中启用 SSH 以及之后如何通过 SSH 进入树莓派**_ + +在你可以用[树莓派][1]做的所有事情中,将其作为一个家庭网络的服务器是十分流行的做法。小体积与低功耗使它成为运行轻量级服务器的完美设备。 + +在这种情况下你做得到的事情之一是能够每次在树莓派上无须接上显示器、键盘、鼠标以及移动到放置你的树莓派的地方就可以运行指令。 + +你可以从其它任意电脑、笔记本、台式机甚至你的手机通过 SSH([Secure Shell][2])登入你的树莓派来做到这一点。让我展示给你看: + +### 如何 SSH 进入树莓派 + +![][3] + +我假设你已经[在你的树莓派上运行 Raspbian][4] 并已经成功通过有线或者无线网连进网络了。你的树莓派接入网络这点是很重要的否则你无法通过 SSH 连接树莓派(抱歉说出这种显而易见的事实) + +### 步骤一:在树莓派上启用 SSH + +SSH 在树莓派上是默认关闭的,因此在你安装好全新的 Raspbian 后打开树莓派时,你将不得不启用它。 + +首先通过菜单进入树莓派的配置界面。 + +![树莓派菜单,树莓派配置][5] + +现在进入接口(interfaces)标签,启动 SSH 并重启你的树莓派。 + +![在树莓派上启动 SSH][6] + +你也可以通过终端直接启动 SSH。仅需输入命令_**sudo raspi-config**_ 然后进入高级设置以启用 SSH。 + +#### 步骤二: 找到树莓派的 IP 地址 + +在大多数情况下,你的树莓派会被分配一个看起来长得像**192.168.x.x**或者**10.x.x.x**的本地 IP 地址。你可以[使用多种 Linux 命令来找到 IP 地址][7]。 + +[][8] + +推荐阅读《这款 Linux 恶意软件将矛头指向不安全的树莓派设备》 + +我在这使用古老而美好的 ifconfig 命令但是你也可以使用 _**ip address**_。 + +``` +ifconfig +``` + +![树莓派网络配置][9] + +这行命令展现了所有活跃中的网络适配器以及其配置的列表。第一个条目(**eth0**)展示了例如**192.168.2.105**的有效 IP 地址。我用有线网将我的树莓派连入网络,因此这里显示的是 **eth0**。如果你用无线网的话在叫做 **wlan0** 的条目下查看。 + +你也可以用其他方法例如查看你的路由器或者调制解调器的网络设备表以找到 IP 地址。 + + +#### 步骤三:SSH 进你的树莓派 + +既然你已经启用了 SSH 功能并且找到了 IP 地址,你可以从任何电脑向前 SSH 进你的树莓派。你同样需要树莓派的用户名和密码。 + +默认用户名和密码是: + + * username: pi + * password: raspberry + + +如果你已改变了默认的密码那就使用新的而不是以上的密码。理想状态下你必须改变默认的密码。在过去,一款[恶意软件感染数千使用默认用户名和密码的树莓派设备][8]。 + +(在 Mac 或 Linux 上)从你想要 SSH 进树莓派的电脑上打开终端输入以下命令,在 Windows 上,你可以用类似 [Putty][10] 的 SSH 客户端。 + +这里,使用你在之前步骤中找到的 IP 地址。 + +``` +ssh [受保护的邮件] +``` + +_**注意: 确保你的树莓派和你用来 SSH 进入树莓派的电脑接入了同一个网络**_。 + +![通过命令行 SSH][11] + +第一次你会看到一个警告,输入 **yes** 并按下回车。 + +![输入密码 \(默认是 ‘raspberry‘\)][12] + +现在,输入密码按下回车。 + +![成功通过 SSH 登入][13] + +成功登入你将会看到树莓派的终端。现在你可以通过这个终端无序物理上访问你的树莓派就可以远程(在当前网络内)在它上面运行指令。 + +[][14] + +推荐阅读《在低端系统上加速 Ubuntu Unity [快速指南]》 + +在此之上你也可以设置 SSH 密钥这样每次通过 SSH 登入时就可以无序输入密码,但那完全是另一个话题了。 + +我希望你通过跟着这个教程已能够 SSH 进入你的树莓派。在下方评论中让我知道你打算用你的树莓派做些什么! + +-------------------------------------------------------------------------- + +via: https://itsfoss.com/ssh-into-raspberry/ + +作者:[Chinmay][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://en.wikipedia.org/wiki/Secure_Shell +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/ssh-into-raspberry-pi.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Raspberry-pi-configuration.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/enable-ssh-raspberry-pi.png?ssl=1 +[7]: https://linuxhandbook.com/find-ip-address/ +[8]: https://itsfoss.com/raspberry-pi-malware-threat/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/ifconfig-rapberry-pi.png?ssl=1 +[10]: https://itsfoss.com/putty-linux/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-pi-warning.png?fit=800%2C199&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-pi-password.png?fit=800%2C202&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-Pi-successful-login.png?fit=800%2C306&ssl=1 +[14]: https://itsfoss.com/speed-up-ubuntu-unity-on-low-end-system/ From 4a666289d1688f92ca6db343b0a176132918d3da Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Wed, 22 May 2019 19:21:03 -0500 Subject: [PATCH 0559/1154] Apply for Translating Apply for Translating --- ...Collection Of Tools To Inspect And Visualize Disk Usage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md b/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md index edba21d327..2f7c8687c4 100644 --- a/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md +++ b/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tomjlw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -238,7 +238,7 @@ via: https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualiz 作者:[sk][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tomjlw](https://github.com/tomjlw) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4551fdb2f6e62cdaf1d48d8c962c4b110b6cc4ea Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 23 May 2019 08:52:44 +0800 Subject: [PATCH 0560/1154] translated --- ...rink - Make Raspberry Pi Images Smaller.md | 123 ------------------ ...rink - Make Raspberry Pi Images Smaller.md | 123 ++++++++++++++++++ 2 files changed, 123 insertions(+), 123 deletions(-) delete mode 100644 sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md create mode 100644 translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md diff --git a/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md b/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md deleted file mode 100644 index ad4c0fadf3..0000000000 --- a/sources/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md +++ /dev/null @@ -1,123 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (PiShrink – Make Raspberry Pi Images Smaller) -[#]: via: (https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -PiShrink – Make Raspberry Pi Images Smaller -====== - -![Make Raspberry Pi Images Smaller With PiShrink In Linux][1] - -**Raspberry Pi** requires no introduction. It is a small, affordable and credit-card sized computer that can be connected to a Monitor or TV. We can attach a standard keyboard and mouse and use it as a full-blown desktop computer to do everyday tasks, such Internet browsing, playing videos/games, word processing and spreadsheet making and a lot more. It has been mainly developed for teaching Computer science in schools. Nowadays, Raspberry Pi is widely being used in colleges, small-medium organizations and institutes to teach coding. If you own a Raspberry Pi device, you might want to check out a bash script named **“PiShrink”** , which is used to make Raspberry Pi Images smaller. PiShrink will automatically shrink a pi image that will then resize to the max size of the SD card on boot. This will make putting the image back onto the SD card faster and the shrunk images will compress better. This can be useful to fit the large size images in your SD card. In this brief guide, we are going to learn to shrink Raspberry images to smaller size in Unix-like systems. - -### Installing PiShrink - -To install PiShrink on your Linux box, first download the latest version using command: - -``` -$ wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh -``` - -Next, make the downloaded PiShrink binary as executable: - -``` -$ chmod +x pishrink.sh -``` - -Finally, move it your path: - -``` -$ sudo mv pishrink.sh /usr/local/bin/ -``` - -### Make Raspberry Pi Images Smaller - -As you may already know, **Raspbian** is the official operating system for all models of Raspberry Pi. The Raspberry foundation has developed **Raspberry Pi Desktop** version for PC and Mac. You can create a live cd, run it in virtual machine and even install it in your desktop as well. There are also few unofficial OS images available for Raspberry Pi. For the purpose of testing, I’ve downloaded the official Raspbian OS from the [**official download page**][2]. - -Unzip the downloaded OS image: - -``` -$ unzip 2019-04-08-raspbian-stretch-lite.zip -``` - -The above command will extract contents of **2019-04-08-raspbian-stretch-lite.zip** file in the current working directory. - -Let check the actual size of the extracted file: - -``` -$ du -h 2019-04-08-raspbian-stretch-lite.img -1.7G 2019-04-08-raspbian-stretch-lite.img -``` - -As you can see, the size of the extracted Raspberry OS img file is **1.7G**. - -Now, shrink this file’s size using PiShrink like below: - -``` -$ sudo pishrink.sh 2019-04-08-raspbian-stretch-lite.img -``` - -Sample output: - -``` -Creating new /etc/rc.local -rootfs: 39795/107072 files (0.1% non-contiguous), 239386/428032 blocks -resize2fs 1.45.0 (6-Mar-2019) -resize2fs 1.45.0 (6-Mar-2019) -Resizing the filesystem on /dev/loop1 to 280763 (4k) blocks. -Begin pass 3 (max = 14) -Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -Begin pass 4 (max = 3728) -Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -The filesystem on /dev/loop1 is now 280763 (4k) blocks long. - -Shrunk 2019-04-08-raspbian-stretch-lite.img from 1.7G to 1.2G -``` - -[![Make Raspberry Pi Images Smaller Using PiShrink][1]][3] - -Make Raspberry Pi Images Smaller Using PiShrink - -As you see in the above output, the size of the Rasberry Pi image has been reduced to **1.2G**. - -You can also use **-s** flag to skip the autoexpanding part of the process. - -``` -$ sudo pishrink.sh -s 2019-04-08-raspbian-stretch-lite.img newpi.img -``` - -This will create a copy of source img file (i.e 2019-04-08-raspbian-stretch-lite.img) into a new img file (newpi.img) and work on it. For more details, check the official GitHub page given at the end. - -And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! - -And, that’s all for now. - -**Resource:** - - * [**PiShrink GitHub Repository**][4] - * [**Raspberry Pi website**][5] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/ - -作者:[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/2019/05/pishrink-720x340.png -[2]: https://www.raspberrypi.org/downloads/ -[3]: http://www.ostechnix.com/wp-content/uploads/2019/05/pishrink-1.png -[4]: https://github.com/Drewsif/PiShrink -[5]: https://www.raspberrypi.org/ diff --git a/translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md b/translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md new file mode 100644 index 0000000000..11ba537a1e --- /dev/null +++ b/translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md @@ -0,0 +1,123 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PiShrink – Make Raspberry Pi Images Smaller) +[#]: via: (https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +PiShrink - 使树莓派镜像更小 +====== + +![Make Raspberry Pi Images Smaller With PiShrink In Linux][1] + +**树莓派**不需要过多介绍。它是一款小巧、价格实惠,只有信用卡大小的电脑,它可以连接到显示器或电视。我们可以连接一个标准的键盘和鼠标,并将其用作一台成熟的台式计算机来完成日常任务,如互联网浏览、播放视频/玩游戏、文字处理和电子表格制作等。它主要是为学校的计算机科学教学而开发的。如今,树莓派被广泛用于大学、中小型组织和研究所来教授编码。如果你有一台树莓派,你可能需要了解一个名为 **“PiShrink”** 的 bash 脚本,该脚本可使树莓派镜像更小。PiShrink 将自动缩小镜像,然后在启动时将其调整为 SD 卡的最大大小。这能更快地将镜像复制到 SD 卡中,同时缩小的镜像将更好地压缩。这对于将大容量镜像放入 SD 卡非常有用。在这个简短的指南中,我们将学习如何在类 Unix 系统中将树莓派镜像缩小到更小的大小。 + +### 安装 PiShrink + +要在 Linux 机器上安装 PiShrink,请先使用以下命令下载最新版本: + +``` +$ wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh +``` + +接下来,将下载的 PiShrink 变成二进制可执行文件: + +``` +$ chmod +x pishrink.sh +``` + +最后,移动到目录: + +``` +$ sudo mv pishrink.sh /usr/local/bin/ +``` + +### 使树莓派镜像更小 + +你可能已经知道,**Raspbian** 是所有树莓派型号的官方操作系统。树莓派基金会为 PC 和 Mac 开发了**树莓派桌面**版本。你可以创建 live CD,并在虚拟机中运行它,甚至也可以将其安装在桌面上。树莓派也有少量非官方​​操作系统镜像。为了测试,我从[**官方下载页面**][2]下载了官方的 Raspbian 系统。 + + +解压下载的系统镜像: + +``` +$ unzip 2019-04-08-raspbian-stretch-lite.zip +``` + +上面的命令将提取当前目录中 **2019-04-08-raspbian-stretch-lite.zip** 文件的内容。 + +让我们看下提取文件的实际大小: + +``` +$ du -h 2019-04-08-raspbian-stretch-lite.img +1.7G 2019-04-08-raspbian-stretch-lite.img +``` + +如你所见,提取的树莓派系统镜像大小为 **1.7G**。 + +现在,使用 PiShrink 缩小此文件的大小,如下所示: + +``` +$ sudo pishrink.sh 2019-04-08-raspbian-stretch-lite.img +``` + +示例输出: + +``` +Creating new /etc/rc.local +rootfs: 39795/107072 files (0.1% non-contiguous), 239386/428032 blocks +resize2fs 1.45.0 (6-Mar-2019) +resize2fs 1.45.0 (6-Mar-2019) +Resizing the filesystem on /dev/loop1 to 280763 (4k) blocks. +Begin pass 3 (max = 14) +Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 4 (max = 3728) +Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on /dev/loop1 is now 280763 (4k) blocks long. + +Shrunk 2019-04-08-raspbian-stretch-lite.img from 1.7G to 1.2G +``` + +[![Make Raspberry Pi Images Smaller Using PiShrink][1]][3] + +使用 PiShrink 使树莓派镜像更小 + +正如你在上面的输出中看到的,树莓派镜像的大小已减少到 **1.2G**。 + +你还可以使用 **-s** 标志跳过该过程的自动扩展部分。 + +``` +$ sudo pishrink.sh -s 2019-04-08-raspbian-stretch-lite.img newpi.img +``` + +这将创建一个源镜像文件(即 2019-04-08-raspbian-stretch-lite.img)的副本到一个新镜像文件(newpi.img)并进行处理。有关更多详细信息,请查看最后给出的官方 GitHub 页面。 + +就是这些了。希望本文有用。还有更多好东西,敬请期待! + + +**资源:** + + * [**PiShrink 的 GitHub 仓库**][4] + * [**树莓派网站**][5] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/ + +作者:[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/2019/05/pishrink-720x340.png +[2]: https://www.raspberrypi.org/downloads/ +[3]: http://www.ostechnix.com/wp-content/uploads/2019/05/pishrink-1.png +[4]: https://github.com/Drewsif/PiShrink +[5]: https://www.raspberrypi.org/ From f5dc01033cc0d12c1693ddee367096ab79ce7de5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 May 2019 09:38:08 +0800 Subject: [PATCH 0561/1154] PRF:20190504 Add methods retroactively in Python with singledispatch.md @geekpi --- ...oactively in Python with singledispatch.md | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md b/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md index 40fae67d1a..4ce1958215 100644 --- a/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md +++ b/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Add methods retroactively in Python with singledispatch) @@ -9,24 +9,26 @@ 使用 singledispatch 在 Python 中追溯地添加方法 ====== -在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 -![][1] + +> 在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 + +![](https://img.linux.net.cn/data/attachment/album/201905/23/093515sgmu4auml9caz54l.jpg) Python 是当今使用最多[流行的编程语言][2]之一,因为:它是开源的,它具有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中提供如此庞大、多样化的软件包的原因,用以扩展和改进 Python。并解决不可避免的问题。 -在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [**singledispatch**][4],这是一个能让你追溯地向 Python 库添加方法的库。 +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [singledispatch][4],这是一个能让你追溯地向 Python 库添加方法的库。 ### singledispatch -想象一下,你有一个有 **Circle**、**Square** 等类的“形状”库。 +想象一下,你有一个有 Circle、Square 等类的“形状”库。 -**Circle** 类有**半径**、**Square** 有 **边**、**Rectangle**有**高**和**宽**。我们的库已经存在,我们不想改变它。 +Circle 类有半径、Square 有边、Rectangle 有高和宽。我们的库已经存在,我们不想改变它。 -然而,我们想给库添加一个**面积**计算。如果我们不会和其他人共享这个库,我们只需添加 **area** 方法,这样我们就能调用 **shape.area()** 而无需关心是什么形状。 +然而,我们想给库添加一个面积计算。如果我们不会和其他人共享这个库,我们只需添加 `area` 方法,这样我们就能调用 `shape.area()` 而无需关心是什么形状。 -虽然可以进入类并添加一个方法,但这是一个坏主意:没有人希望他们的类会被添加新的方法,程序因奇怪的方式出错。 +虽然可以进入类并添加一个方法,但这是一个坏主意:没有人希望他们的类会被添加新的方法,程序会因奇怪的方式出错。 -相反,**functools** 中的 **singledispatch** 函数可以帮助我们。 +相反,functools 中的 `singledispatch` 函数可以帮助我们。 ``` @@ -36,7 +38,7 @@ def get_area(shape): shape) ``` -**get_area** 函数的“基类”实现会报错。这保证了如果我们出现一个新的形状时,我们会明确地报错而不是返回一个无意义的结果。 +`get_area` 函数的“基类”实现会报错。这保证了如果我们出现一个新的形状时,我们会明确地报错而不是返回一个无意义的结果。 ``` @@ -48,7 +50,7 @@ def _get_area_circle(shape): return math.pi * (shape.radius ** 2) ``` -这种方式的好处是如果某人写了一个匹配我们代码的_新_形状,它们可以自己实现 **get_area**。 +这种方式的好处是如果某人写了一个匹配我们代码的*新*形状,它们可以自己实现 `get_area`。 ``` @@ -64,17 +66,16 @@ def _get_area_ellipse(shape): return math.pi * shape.horizontal_axis * shape.vertical_axis ``` -_调用_ **get_area** 很直接。 +*调用* `get_area` 很直接。 ``` -`print(get_area(shape))` +print(get_area(shape)) ``` -这意味着我们可以将有大量 **if isintance()/elif isinstance()** 的代码以这种方式修改,而无需修改接口。下一次你要修改 **if isinstance**,你试试 **singledispatch**! - -在本系列的下一篇文章中,我们将介绍 **tox**,一个用于自动化 Python 代码测试的工具。 +这意味着我们可以将大量的 `if isintance()`/`elif isinstance()` 的代码以这种方式修改,而无需修改接口。下一次你要修改 if isinstance,你试试 `singledispatch! +在本系列的下一篇文章中,我们将介绍 tox,一个用于自动化 Python 代码测试的工具。 #### 回顾本系列的前几篇文章: @@ -82,16 +83,14 @@ _调用_ **get_area** 很直接。 * [Black][6] * [attrs][7] - - -------------------------------------------------------------------------------- via: https://opensource.com/article/19/5/python-singledispatch -作者:[Moshe Zadka ][a] +作者:[Moshe Zadka][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/) 荣誉推出 @@ -101,6 +100,6 @@ via: https://opensource.com/article/19/5/python-singledispatch [2]: https://opensource.com/article/18/5/numbers-python-community-trends [3]: https://pypi.org/ [4]: https://pypi.org/project/singledispatch/ -[5]: https://opensource.com/article/19/4/7-python-problems-solved-cython -[6]: https://opensource.com/article/19/4/python-problems-solved-black -[7]: https://opensource.com/article/19/4/python-problems-solved-attrs +[5]: https://linux.cn/article-10859-1.html +[6]: https://linux.cn/article-10864-1.html +[7]: https://linux.cn/article-10871-1.html From 7cbc6b2c0523702afac685e12f0ac650117e5e34 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 May 2019 09:38:38 +0800 Subject: [PATCH 0562/1154] PUB:20190504 Add methods retroactively in Python with singledispatch.md @geekpi https://linux.cn/article-10887-1.html --- ...Add methods retroactively in Python with singledispatch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190504 Add methods retroactively in Python with singledispatch.md (98%) diff --git a/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md b/published/20190504 Add methods retroactively in Python with singledispatch.md similarity index 98% rename from translated/tech/20190504 Add methods retroactively in Python with singledispatch.md rename to published/20190504 Add methods retroactively in Python with singledispatch.md index 4ce1958215..b0704dd59f 100644 --- a/translated/tech/20190504 Add methods retroactively in Python with singledispatch.md +++ b/published/20190504 Add methods retroactively in Python with singledispatch.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10887-1.html) [#]: subject: (Add methods retroactively in Python with singledispatch) [#]: via: (https://opensource.com/article/19/5/python-singledispatch) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 47ed3ae97c0576a9bc18baabbb1df6d1d6fc8efb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 May 2019 10:07:40 +0800 Subject: [PATCH 0563/1154] PRF:20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md @tomjlw --- ...SSH into a Raspberry Pi -Beginner-s Tip.md | 52 ++++++++----------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md b/translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md index d09a117e88..b3cdc7e4e2 100644 --- a/translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md +++ b/translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md @@ -1,20 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to SSH into a Raspberry Pi [Beginner’s Tip]) [#]: via: (https://itsfoss.com/ssh-into-raspberry/) [#]: author: (Chinmay https://itsfoss.com/author/chinmay/) -如何 SSH 进入树莓派 [新手教程] +新手教程:如何 SSH 进入树莓派 ====== -_**在这篇树莓派文章中,你将学到如何在树莓派中启用 SSH 以及之后如何通过 SSH 进入树莓派**_ +> 在这篇树莓派文章中,你将学到如何在树莓派中启用 SSH 以及之后如何通过 SSH 进入树莓派。 在你可以用[树莓派][1]做的所有事情中,将其作为一个家庭网络的服务器是十分流行的做法。小体积与低功耗使它成为运行轻量级服务器的完美设备。 -在这种情况下你做得到的事情之一是能够每次在树莓派上无须接上显示器、键盘、鼠标以及移动到放置你的树莓派的地方就可以运行指令。 +在这种情况下你做得到的事情之一是能够每次在树莓派上无须接上显示器、键盘、鼠标以及走到放置你的树莓派的地方就可以运行指令。 你可以从其它任意电脑、笔记本、台式机甚至你的手机通过 SSH([Secure Shell][2])登入你的树莓派来做到这一点。让我展示给你看: @@ -22,31 +22,27 @@ _**在这篇树莓派文章中,你将学到如何在树莓派中启用 SSH 以 ![][3] -我假设你已经[在你的树莓派上运行 Raspbian][4] 并已经成功通过有线或者无线网连进网络了。你的树莓派接入网络这点是很重要的否则你无法通过 SSH 连接树莓派(抱歉说出这种显而易见的事实) +我假设你已经[在你的树莓派上运行 Raspbian][4] 并已经成功通过有线或者无线网连进网络了。你的树莓派接入网络这点是很重要的,否则你无法通过 SSH 连接树莓派(抱歉说出这种显而易见的事实)。 -### 步骤一:在树莓派上启用 SSH +#### 步骤一:在树莓派上启用 SSH -SSH 在树莓派上是默认关闭的,因此在你安装好全新的 Raspbian 后打开树莓派时,你将不得不启用它。 +SSH 在树莓派上是默认关闭的,因此在你安装好全新的 Raspbian 后打开树莓派时,你需要启用它。 首先通过菜单进入树莓派的配置界面。 ![树莓派菜单,树莓派配置][5] -现在进入接口(interfaces)标签,启动 SSH 并重启你的树莓派。 +现在进入接口interfaces标签,启动 SSH 并重启你的树莓派。 ![在树莓派上启动 SSH][6] -你也可以通过终端直接启动 SSH。仅需输入命令_**sudo raspi-config**_ 然后进入高级设置以启用 SSH。 +你也可以通过终端直接启动 SSH。仅需输入命令 `sudo raspi-config` 然后进入高级设置以启用 SSH。 #### 步骤二: 找到树莓派的 IP 地址 -在大多数情况下,你的树莓派会被分配一个看起来长得像**192.168.x.x**或者**10.x.x.x**的本地 IP 地址。你可以[使用多种 Linux 命令来找到 IP 地址][7]。 +在大多数情况下,你的树莓派会被分配一个看起来长得像 `192.168.x.x` 或者 `10.x.x.x` 的本地 IP 地址。你可以[使用多种 Linux 命令来找到 IP 地址][7]。 -[][8] - -推荐阅读《这款 Linux 恶意软件将矛头指向不安全的树莓派设备》 - -我在这使用古老而美好的 ifconfig 命令但是你也可以使用 _**ip address**_。 +我在这使用古老而好用的 `ifconfig` 命令,但是你也可以使用 `ip address`。 ``` ifconfig @@ -54,22 +50,20 @@ ifconfig ![树莓派网络配置][9] -这行命令展现了所有活跃中的网络适配器以及其配置的列表。第一个条目(**eth0**)展示了例如**192.168.2.105**的有效 IP 地址。我用有线网将我的树莓派连入网络,因此这里显示的是 **eth0**。如果你用无线网的话在叫做 **wlan0** 的条目下查看。 +这行命令展现了所有活跃中的网络适配器以及其配置的列表。第一个条目(`eth0`)展示了例如`192.168.2.105` 的有效 IP 地址。我用有线网将我的树莓派连入网络,因此这里显示的是 `eth0`。如果你用无线网的话在叫做 `wlan0` 的条目下查看。 你也可以用其他方法例如查看你的路由器或者调制解调器的网络设备表以找到 IP 地址。 - #### 步骤三:SSH 进你的树莓派 -既然你已经启用了 SSH 功能并且找到了 IP 地址,你可以从任何电脑向前 SSH 进你的树莓派。你同样需要树莓派的用户名和密码。 +既然你已经启用了 SSH 功能并且找到了 IP 地址,你可以从任何电脑 SSH 进入你的树莓派。你同样需要树莓派的用户名和密码。 默认用户名和密码是: - * username: pi - * password: raspberry + * 用户名:`pi` + * 密码:`raspberry` - -如果你已改变了默认的密码那就使用新的而不是以上的密码。理想状态下你必须改变默认的密码。在过去,一款[恶意软件感染数千使用默认用户名和密码的树莓派设备][8]。 +如果你已改变了默认的密码,那就使用新的而不是以上的密码。理想状态下你必须改变默认的密码。在过去,有一款[恶意软件感染数千使用默认用户名和密码的树莓派设备][8]。 (在 Mac 或 Linux 上)从你想要 SSH 进树莓派的电脑上打开终端输入以下命令,在 Windows 上,你可以用类似 [Putty][10] 的 SSH 客户端。 @@ -79,11 +73,11 @@ ifconfig ssh [受保护的邮件] ``` -_**注意: 确保你的树莓派和你用来 SSH 进入树莓派的电脑接入了同一个网络**_。 +> 注意: 确保你的树莓派和你用来 SSH 进入树莓派的电脑接入了同一个网络。 ![通过命令行 SSH][11] -第一次你会看到一个警告,输入 **yes** 并按下回车。 +第一次你会看到一个警告,输入 `yes` 并按下回车。 ![输入密码 \(默认是 ‘raspberry‘\)][12] @@ -91,13 +85,9 @@ _**注意: 确保你的树莓派和你用来 SSH 进入树莓派的电脑接入 ![成功通过 SSH 登入][13] -成功登入你将会看到树莓派的终端。现在你可以通过这个终端无序物理上访问你的树莓派就可以远程(在当前网络内)在它上面运行指令。 +成功登入你将会看到树莓派的终端。现在你可以通过这个终端无需物理上访问你的树莓派就可以远程(在当前网络内)在它上面运行指令。 -[][14] - -推荐阅读《在低端系统上加速 Ubuntu Unity [快速指南]》 - -在此之上你也可以设置 SSH 密钥这样每次通过 SSH 登入时就可以无序输入密码,但那完全是另一个话题了。 +在此之上你也可以设置 SSH 密钥这样每次通过 SSH 登入时就可以无需输入密码,但那完全是另一个话题了。 我希望你通过跟着这个教程已能够 SSH 进入你的树莓派。在下方评论中让我知道你打算用你的树莓派做些什么! @@ -108,7 +98,7 @@ via: https://itsfoss.com/ssh-into-raspberry/ 作者:[Chinmay][a] 选题:[lujun9972][b] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From da3f484ee0d664cb59be1559333657d5c2a28caa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 May 2019 10:08:25 +0800 Subject: [PATCH 0564/1154] PUB:20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md @tomjlw https://linux.cn/article-10888-1.html --- ...20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md (98%) diff --git a/translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md b/published/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md similarity index 98% rename from translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md rename to published/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md index b3cdc7e4e2..ca59e6c392 100644 --- a/translated/tech/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md +++ b/published/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10888-1.html) [#]: subject: (How to SSH into a Raspberry Pi [Beginner’s Tip]) [#]: via: (https://itsfoss.com/ssh-into-raspberry/) [#]: author: (Chinmay https://itsfoss.com/author/chinmay/) From f6d3aada2c7a872b45585d5c83bf125bbc5ab005 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 May 2019 10:29:10 +0800 Subject: [PATCH 0565/1154] PRF:20190416 Detecting malaria with deep learning.md PART --- ...16 Detecting malaria with deep learning.md | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/translated/tech/20190416 Detecting malaria with deep learning.md b/translated/tech/20190416 Detecting malaria with deep learning.md index 2089636e6a..9643be6315 100644 --- a/translated/tech/20190416 Detecting malaria with deep learning.md +++ b/translated/tech/20190416 Detecting malaria with deep learning.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Detecting malaria with deep learning) @@ -9,22 +9,24 @@ 使用深度学习检测疟疾 ================== -人工智能结合开源硬件工具能够提升严重传染病疟疾的诊断。 + +> 人工智能结合开源硬件工具能够提升严重传染病疟疾的诊断。 + ![][1] -人工智能(AI)和开源工具,技术,和框架是促进社会进步的强有力的结合。_“健康就是财富”_可能有点陈词滥调,但它却是非常准确的!在本篇文章,我们将测试 AI 是如何与低花费,有效,精确的开源深度学习方法一起被利用来检测致死的传染病疟疾。 +人工智能(AI)和开源工具、技术和框架是促进社会进步的强有力的结合。“健康就是财富”可能有点陈词滥调,但它却是非常准确的!在本篇文章,我们将测试 AI 是如何与低成本、有效、精确的开源深度学习方法一起被利用来检测致死的传染病疟疾。 我既不是一个医生,也不是一个医疗保健研究者,我也绝不像他们那样合格,我只是对将 AI 应用到医疗保健研究感兴趣。在这片文章中我的想法是展示 AI 和开源解决方案如何帮助疟疾检测和减少人工劳动的方法。 ![Python and TensorFlow][2] -Python and TensorFlow: 一个构建开源深度学习方法的很棒的结合 +*Python and TensorFlow: 一个构建开源深度学习方法的很棒的结合* -感谢 Python 的强大 和像 TensorFlow 这样的深度学习框架,我们能够构建鲁棒的,大规模的,有效的深度学习方法。因为这些工具是自由和开源的,我们能够构建低成本的能够轻易被任何人采纳和使用的解决方案。让我们开始吧! +感谢 Python 的强大和像 TensorFlow 这样的深度学习框架,我们能够构建健壮的、大规模的、有效的深度学习方法。因为这些工具是自由和开源的,我们能够构建低成本的、能够轻易被任何人采纳和使用的解决方案。让我们开始吧! ### 项目动机 -疟疾是由_疟原虫_造成的致死的,有传染性的,蚊子传播的疾病,主要通过受感染的雌性按蚊叮咬传播。共有五种寄生虫能够造成疟疾,但是样例中的大多数是这两种类型- _恶性疟原虫_ 和 _间日疟原虫_ 造成的。 +疟疾是由*疟原虫*造成的致死的、有传染性的、蚊子传播的疾病,主要通过受感染的雌性按蚊叮咬传播。共有五种寄生虫能够造成疟疾,但是样例中的大多数是这两种类型造成的:恶性疟原虫和间日疟原虫。 ![疟疾热图][3] @@ -32,19 +34,19 @@ Python and TensorFlow: 一个构建开源深度学习方法的很棒的结合 如果一个雌性蚊子咬了你,蚊子携带的寄生虫进入你的血液并且开始破坏携带氧气的红细胞(RBC)。通常,疟疾的最初症状类似于流感病毒,在蚊子叮咬后,他们通常在几天或几周内发作。然而,这些致死的寄生虫可以在你的身体里生存长达一年并且不会造成任何症状,延迟治疗可能造成并发症甚至死亡。因此,早期的检查能够挽救生命。 -世界健康组织(WHO)的[疟疾事件][4]暗示世界近乎一半的人口面临疟疾的风险,有超过 2 亿 的疟疾病例,每年由于疟疾造成的死亡近乎 40 万。这是使疟疾检测和诊断快速,简单和有效的一个动机。 +世界健康组织(WHO)的[疟疾事件][4]暗示世界近乎一半的人口面临疟疾的风险,有超过 2 亿 的疟疾病例,每年由于疟疾造成的死亡近乎 40 万。这是使疟疾检测和诊断快速、简单和有效的一个动机。 ### 检测疟疾的方法 -有几种方法能够用来检测和诊断疟疾。该文中的项目就是基于 Rajaraman,et al. 的论文:“[预先训练的卷积神经网络作为特征提取器,用于改善薄血涂片图像中的疟疾寄生虫检测][5]”,介绍了一些方法,包含聚合酶链反应(PCR)和快速诊断测试(RDT)。这两种测试通常在高质量的显微镜下使用,但这样的设备不是轻易能够获得的。 +有几种方法能够用来检测和诊断疟疾。该文中的项目就是基于 Rajaraman,et al. 的论文:“[预先训练的卷积神经网络作为特征提取器,用于改善薄血涂片图像中的疟疾寄生虫检测][5]”介绍的一些方法,包含聚合酶链反应(PCR)和快速诊断测试(RDT)。这两种测试通常在高质量的显微镜下使用,但这样的设备不是轻易能够获得的。 标准的疟疾诊断通常使基于血液涂片工作流的,根据 Carlos Ariza 的文章“[Malaria Hero: 一个更快诊断疟原虫的网络应用][6]”,我从中了解到 Adrian Rosebrock 的“[使用 Keras 的深度学习和医学图像分析][7]”。我感激这些优秀的资源的作者,让我在疟原虫预防,诊断和治疗方面有了更多的想法。 ![疟原虫检测的血涂片工作流程][8] -一个疟原虫检测的血涂片工作流程 +*一个疟原虫检测的血涂片工作流程* -根据 WHO 草案,诊断通常包括对放大 100 倍的血涂片的集中检测。训练人们人工计数在 5000 个细胞中有多少红细胞中包含疟原虫。正如上述解释中引用的 Rajaraman, et al. 的论文: +根据 WHO 草案,诊断通常包括对放大 100 倍的血涂片的集中检测。训练人们在 5000 个细胞中人工计数有多少红细胞中包含疟原虫。正如上述解释中引用的 Rajaraman, et al. 的论文: > 薄血涂片帮助检测疟原虫的存在性并且帮助识别造成传染(疾病控制和抑制中心,2012)的物种。诊断准确性在很大程度上取决于人类的专业知识,并且可能受到观察者间差异和疾病流行/资源受限区域大规模诊断所造成的不利影响(Mitiku, Mengistu, and Gelaw, 2003)。可替代的技术是使用聚合酶链反应(PCR)和快速诊断测试(RDT);然而,PCR 分析受限于它的性能(Hommelsheim, et al., 2014),RDT 在疾病流行的地区成本效益低(Hawkes,Katsuva, and Masumbuko, 2009)。 @@ -54,17 +56,17 @@ Python and TensorFlow: 一个构建开源深度学习方法的很棒的结合 人工诊断血涂片是一个加强的人工过程,需要专业知识来分类和计数被寄生虫感染的和未感染的细胞。这个过程可能不能很好的规模化,尤其在那些专业人士不足的地区。在利用最先进的图像处理和分析技术提取人工选取特征和构建基于机器学习的分类模型方面取得了一些进展。然而,这些模型不能大规模推广,因为没有更多的数据用来训练,并且人工选取特征需要花费很长时间。 -深度学习模型,或者更具体地讲,卷积神经网络(CNNs),已经被证明在各种计算机视觉任务中非常有效。(如果你想有额外的关于 CNNs 的背景知识,我推荐你阅读[视觉识别的 CS2331n 卷积神经网络][9]。)简单地讲,CNN 模型的关键层包含卷积和池化层,正如下面图像显示。 +深度学习模型,或者更具体地讲,卷积神经网络(CNN),已经被证明在各种计算机视觉任务中非常有效。(如果你想更多的了解关于 CNN 的背景知识,我推荐你阅读[视觉识别的 CS2331n 卷积神经网络][9]。)简单地讲,CNN 模型的关键层包含卷积和池化层,正如下面图像显示。 ![A typical CNN architecture][10] -一个典型的 CNN 架构 +*一个典型的 CNN 架构* -卷积层从数据中学习空间层级模式,它是平移不变的,因此它们能够学习不同方面的图像。例如,第一个卷积层将学习小的和本地图案,例如边缘和角落,第二个卷积层学习基于第一层的特征的更大的图案,等等。这允许 CNNs 自动化提取特征并且学习对于新数据点通用的有效的特征。池化层帮助下采样和降维。 +卷积层从数据中学习空间层级模式,它是平移不变的,因此它们能够学习不同方面的图像。例如,第一个卷积层将学习小的和局部图案,例如边缘和角落,第二个卷积层学习基于第一层的特征的更大的图案,等等。这允许 CNN 自动化提取特征并且学习对于新数据点通用的有效的特征。池化层有助于降采样和降维。 -因此,CNNs 帮助自动化和规模化的特征工程。同样,在模型末尾加上密集层允许我们执行像图像分类这样的任务。使用像 CNNs 者的深度学习模型自动的疟疾检测可能非常有效,便宜和具有规模性,尤其是迁移学习和预训练模型效果非常好,甚至在少量数据的约束下。 +因此,CNN 有助于自动化和规模化的特征工程。同样,在模型末尾加上密集层允许我们执行像图像分类这样的任务。使用像 CNN 这样的深度学习模型自动的疟疾检测可能非常有效、便宜和具有规模性,尤其是迁移学习和预训练模型效果非常好,甚至在少量数据的约束下。 -Rajaraman, et al. 的论文在一个数据集上利用六个预训练模型在检测疟疾 vs 无感染样本获取到令人吃惊的 95.9% 的准确率。我们的关注点是从头开始尝试一些简单的 CNN 模型和用一个预训练的训练模型使用迁移学习来查看我们能够从相同的数据集中得到什么。我们将使用开源工具和框架,包括 Python 和 TensorFlow,来构建我们的模型。 +Rajaraman, et al. 的论文在一个数据集上利用六个预训练模型在检测疟疾 vs 无感染样本获取到令人吃惊的 95.9% 的准确率。我们的关注点是从头开始尝试一些简单的 CNN 模型和用一个预训练的训练模型使用迁移学习来查看我们能够从相同的数据集中得到什么。我们将使用开源工具和框架,包括 Python 和 TensorFlow,来构建我们的模型。 ### 数据集 From 9fb90fec0201f91fc29fe38165bb7ff33cc07213 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 May 2019 13:33:50 +0800 Subject: [PATCH 0566/1154] PRF:20190520 xsos - A Tool To Read SOSReport In Linux.md @wxy --- ...sos - A Tool To Read SOSReport In Linux.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md b/translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md index a37a77b769..9a0e8250b1 100644 --- a/translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md +++ b/translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (xsos – A Tool To Read SOSReport In Linux) @@ -10,19 +10,21 @@ xsos:一个在 Linux 上阅读 SOSReport 的工具 ====== -我们都已经知道 [sosreport][1]。它用来收集可用于诊断的系统信息。Redhat 支持建议我们在提交案例时提供 sosreport 来分析当前的系统状态。 +![](https://img.linux.net.cn/data/attachment/album/201905/23/133305accwpsvhk1epsisc.jpg) -它收集全部类型的报告,以帮助用户找出问题的根本原因。我们可以轻松地提取和阅读 sosreport,但它很难阅读。因为它给每个部分都创建了一个单独的文件。 +我们都已经知道 [SOSReport][1]。它用来收集可用于诊断的系统信息。Redhat 的支持服务建议我们在提交案例时提供 SOSReport 来分析当前的系统状态。 -那么,在 Linux 中使用语法高亮显示阅读所有这些内容的最佳方法是什么。是的,这可以通过 xsos 工具做到。 +它会收集全部类型的报告,以帮助用户找出问题的根本原因。我们可以轻松地提取和阅读 SOSReport,但它很难阅读。因为它的每个部分都是一个单独的文件。 + +那么,在 Linux 中使用语法高亮显示阅读所有这些内容的最佳方法是什么。是的,这可以通过 `xsos` 工具做到。 ### sosreport `sosreport` 命令是一个从运行中的系统(尤其是 RHEL 和 OEL 系统)收集大量配置细节、系统信息和诊断信息的工具。它可以帮助技术支持工程师在很多方面分析系统。 -此报告包含有关系统的大量信息,例如引导信息、文件系统、内存、主机名、已安装的 rpm、系统 IP、网络详细信息、操作系统版本、已安装的内核、已加载的内核模块、打开的文件列表、PCI 设备列表、挂载点及其细节、运行中的进程信息、进程树输出、系统路由、位于 `/etc` 文件夹中的所有配置文件,以及位于 `/var` 文件夹中的所有日志文件。 +此报告包含有关系统的大量信息,例如引导信息、文件系统、内存、主机名、已安装的 RPM、系统 IP、网络详细信息、操作系统版本、已安装的内核、已加载的内核模块、打开的文件列表、PCI 设备列表、挂载点及其细节、运行中的进程信息、进程树输出、系统路由、位于 `/etc` 文件夹中的所有配置文件,以及位于 `/var` 文件夹中的所有日志文件。 -这将需要一段时间来生成报告,这取决于您的系统安装和配置。 +这将需要一段时间来生成报告,这取决于你的系统安装和配置。 完成后,`sosreport` 将在 `/tmp` 目录下生成一个压缩的归档文件。 @@ -32,7 +34,7 @@ xsos:一个在 Linux 上阅读 SOSReport 的工具 它可以立即从 `sosreport` 或正在运行的系统中汇总系统信息。 -`xsos` 将尝试简化、解析、计算和格式化来自数十个文件(和命令)的数据,以便为你提供有关系统的详细概述。 +`xsos` 将尝试简化、解析、计算并格式化来自数十个文件(和命令)的数据,以便为你提供有关系统的详细概述。 你可以通过运行以下命令立即汇总系统信息。 @@ -103,11 +105,11 @@ OS us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% ``` -### 如何使用 xsos 命令在 Linux 中查看生成的 sosreport 输出? +### 如何使用 xsos 命令在 Linux 中查看生成的 SOSReport 输出? -我们需要份 sosreport 以使用 `xsos` 命令进一步阅读。 +我们需要份 SOSReport 以使用 `xsos` 命令进一步阅读。 -是的,我已经生成了一个 sosreport,文件如下。 +是的,我已经生成了一个 SOSReport,文件如下。 ``` # ls -lls -lh /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz @@ -126,7 +128,7 @@ OS # xsos --all /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa ``` -要查看 bios 信息,带上 `-b` 或 `--bios` 开关运行 `xsos`。 +要查看 BIOS 信息,带上 `-b` 或 `--bios` 开关运行 `xsos`。 ``` # xsos --bios /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -242,7 +244,7 @@ CPU 1 Intel Core i7-6700HQ CPU @ 2.60GHz (flags: aes,constant_tsc,ht,lm,nx,pae,rdrand) ``` -To view about memory utilization, run xsos with `-m, --mem` switch. +要查看内存利用情况,请使用 `-m` 或 `--mem` 开关运行 `xsos`。 ``` # xsos --mem /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa @@ -381,7 +383,7 @@ via: https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fc05a5bc1f95b39c0cf591f87079a82a80c43584 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 May 2019 13:35:23 +0800 Subject: [PATCH 0567/1154] PUB:20190520 xsos - A Tool To Read SOSReport In Linux.md @wxy https://linux.cn/article-10889-1.html --- .../20190520 xsos - A Tool To Read SOSReport In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190520 xsos - A Tool To Read SOSReport In Linux.md (99%) diff --git a/translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md b/published/20190520 xsos - A Tool To Read SOSReport In Linux.md similarity index 99% rename from translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md rename to published/20190520 xsos - A Tool To Read SOSReport In Linux.md index 9a0e8250b1..af4e47f976 100644 --- a/translated/tech/20190520 xsos - A Tool To Read SOSReport In Linux.md +++ b/published/20190520 xsos - A Tool To Read SOSReport In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10889-1.html) [#]: subject: (xsos – A Tool To Read SOSReport In Linux) [#]: via: (https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 1114f47b9e80adfea3c53208e873acb6d0b6103a Mon Sep 17 00:00:00 2001 From: MjSeven Date: Thu, 23 May 2019 14:39:36 +0800 Subject: [PATCH 0568/1154] translating by MjSeven --- sources/tech/20180429 The Easiest PDO Tutorial (Basics).md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/tech/20180429 The Easiest PDO Tutorial (Basics).md b/sources/tech/20180429 The Easiest PDO Tutorial (Basics).md index 9bda5fa335..b6a76a27aa 100644 --- a/sources/tech/20180429 The Easiest PDO Tutorial (Basics).md +++ b/sources/tech/20180429 The Easiest PDO Tutorial (Basics).md @@ -1,3 +1,6 @@ +Translating by MjSeven + + The Easiest PDO Tutorial (Basics) ====== From 5aed183ec955907ebc4115a0955a462ae0e478f0 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Thu, 23 May 2019 10:54:17 -0500 Subject: [PATCH 0569/1154] Submit Translated Passage for Review Submit Translated Passage for Review --- ...ols To Inspect And Visualize Disk Usage.md | 261 ------------------ ...ols To Inspect And Visualize Disk Usage.md | 257 +++++++++++++++++ 2 files changed, 257 insertions(+), 261 deletions(-) delete mode 100644 sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md create mode 100644 translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md diff --git a/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md b/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md deleted file mode 100644 index 2f7c8687c4..0000000000 --- a/sources/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md +++ /dev/null @@ -1,261 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tomjlw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Duc – A Collection Of Tools To Inspect And Visualize Disk Usage) -[#]: via: (https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Duc – A Collection Of Tools To Inspect And Visualize Disk Usage -====== - -![Duc - A Collection Of Tools To Inspect And Visualize Disk Usage][1] - -**Duc** is a collection of tools that can be used to index, inspect and visualize disk usage on Unix-like operating systems. Don’t think of it as a simple CLI tool that merely displays a fancy graph of your disk usage. It is built to scale quite well on huge filesystems. Duc has been tested on systems that consisted of more than 500 million files and several petabytes of storage without any problems. - -Duc is quite fast and versatile tool. It stores your disk usage in an optimized database, so you can quickly find where your bytes are as soon as the index is completed. In addition, it comes with various user interfaces and back-ends to access the database and draw the graphs. - -Here is the list of currently supported user interfaces (UI): - - 1. Command line interface (ls), - 2. Ncurses console interface (ui), - 3. X11 GUI (duc gui), - 4. OpenGL GUI (duc gui). - - - -List of supported database back-ends: - - * Tokyocabinet, - * Leveldb, - * Sqlite3. - - - -Duc uses **Tokyocabinet** as default database backend. - -### Install Duc - -Duc is available in the default repositories of Debian and its derivatives such as Ubuntu. So installing Duc on DEB-based systems is a piece of cake. - -``` -$ sudo apt-get install duc -``` - -On other Linux distributions, you may need to manually compile and install Duc from source as shown below. - -Download latest duc source .tgz file from the [**releases**][2] page on github. As of writing this guide, the latest version was **1.4.4**. - -``` -$ wget https://github.com/zevv/duc/releases/download/1.4.4/duc-1.4.4.tar.gz -``` - -Then run the following commands one by one to install DUC. - -``` -$ tar -xzf duc-1.4.4.tar.gz -$ cd duc-1.4.4 -$ ./configure -$ make -$ sudo make install -``` - -### Duc Usage - -The typical usage of duc is: - -``` -$ duc -``` - -You can view the list of general options and sub-commands by running the following command: - -``` -$ duc help -``` - -You can also know the the usage of a specific subcommand as below. - -``` -$ duc help -``` - -To view the extensive list of all commands and their options, simply run: - -``` -$ duc help --all -``` - -Let us now se some practical use cases of duc utility. - -### Create Index (database) - -First of all, you need to create an index file (database) of your filesystem. To create an index file, use “duc index” command. - -For example, to create an index of your **/home** directory, simply run: - -``` -$ duc index /home -``` - -The above command will create the index of your /home/ directory and save it in **$HOME/.duc.db** file. If you have added new files/directories in the /home directory in future, just re-run the above command at any time later to rebuild the index. - -### Query Index - -Duc has various sub-commands to query and explore the index. - -To view the list of available indexes, run: - -``` -$ duc info -``` - -**Sample output:** - -``` -Date Time Files Dirs Size Path -2019-04-09 15:45:55 3.5K 305 654.6M /home -``` - -As you see in the above output, I have already indexed the /home directory. - -To list all files and directories in the current working directory, you can do: - -``` -$ duc ls -``` - -To list files/directories in a specific directory, for example **/home/sk/Downloads** , just pass the path as argument like below. - -``` -$ duc ls /home/sk/Downloads -``` - -Similarly, run **“duc ui”** command to open a **ncurses** based console user interface for exploring the file system usage and run **“duc gui”** to start a **graphical (X11)** interface to explore the file system. - -To know more about a sub-command usage, simply refer the help section. - -``` -$ duc help ls -``` - -The above command will display the help section of “ls” subcommand. - -### Visualize Disk Usage - -In the previous section, we have seen how to list files and directories using duc subcommands. In addition, you can even show the file sizes in a fancy graph. - -To show the graph of a given path, use “ls” subcommand like below. - -``` -$ duc ls -Fg /home/sk -``` - -Sample output: - -![][3] - -Visualize disk usage using “duc ls” command - -As you see in the above output, the “ls” subcommand queries the duc database and lists the inclusive size of all -files and directories of the given path i.e **/home/sk/** in this case. - -Here, the **“-F”** option is used to append file type indicator (one of */) to entries and the **“-g”** option is used to draw graph with relative size for each entry. - -Please note that if no path is given, the current working directory is explored. - -You can use **-R** option to view the disk usage result in [**tree**][4] structure. - -``` -$ duc ls -R /home/sk -``` - -![][5] - -Visualize disk usage in tree structure - -To query the duc database and open a **ncurses** based console user interface for exploring the disk usage of given path, use **“ui”** subcommand like below. - -``` -$ duc ui /home/sk -``` - -![][6] - -Similarly, we use **“gui”** subcommand to query the duc database and start a **graphical (X11)** interface to explore the disk usage of the given path: - -``` -$ duc gui /home/sk -``` - -![][7] - -Like I already mentioned earlier, we can learn more about a subcommand usage like below. - -``` -$ duc help -``` - -I covered the basic usage part only. Refer man pages for more details about “duc” tool. - -``` -$ man duc -``` - -* * * - -**Related read:** - - * [**Filelight – Visualize Disk Usage On Your Linux System**][8] - * [**Some Good Alternatives To ‘du’ Command**][9] - * [**How To Check Disk Space Usage In Linux Using Ncdu**][10] - * [**Agedu – Find Out Wasted Disk Space In Linux**][11] - * [**How To Find The Size Of A Directory In Linux**][12] - * [**The df Command Tutorial With Examples For Beginners**][13] - - - -* * * - -### Conclusion - -Duc is simple yet useful disk usage viewer. If you want to quickly and easily know which files/directories are eating up your disk space, Duc might be a good choice. What are you waiting for? Go get this tool already, scan your filesystem and get rid of unused files/directories. - -And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! - -Cheers! - -**Resource:** - - * [**Duc website**][14] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/ - -作者:[sk][a] -选题:[lujun9972][b] -译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者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/2019/04/duc-720x340.png -[2]: https://github.com/zevv/duc/releases -[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-1-1.png -[4]: https://www.ostechnix.com/view-directory-tree-structure-linux/ -[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-2.png -[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-3.png -[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-4.png -[8]: https://www.ostechnix.com/filelight-visualize-disk-usage-on-your-linux-system/ -[9]: https://www.ostechnix.com/some-good-alternatives-to-du-command/ -[10]: https://www.ostechnix.com/check-disk-space-usage-linux-using-ncdu/ -[11]: https://www.ostechnix.com/agedu-find-out-wasted-disk-space-in-linux/ -[12]: https://www.ostechnix.com/find-size-directory-linux/ -[13]: https://www.ostechnix.com/the-df-command-tutorial-with-examples-for-beginners/ -[14]: https://duc.zevv.nl/ diff --git a/translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md b/translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md new file mode 100644 index 0000000000..49cc72415c --- /dev/null +++ b/translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md @@ -0,0 +1,257 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Duc – A Collection Of Tools To Inspect And Visualize Disk Usage) +[#]: via: (https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Duc——一个能够洞察并可视化硬盘使用情况的工具包 +====== + +![Duc——一个能够洞察并可视化硬盘使用情况的工具包][1] + +**Duc** 是一个在类 Unix 操作系统上可以用来索引、洞察及可视化硬盘使用情况的工具包。别把它当成一个仅能用漂亮图表展现硬盘使用情况的 CLI 工具。它被设计成在巨大的文件系统上也可以延展得很好。Duc 已在由超过五亿个文件和几 PB 的存储组成的系统上测试过,没有任何问题。 + +Duc 是一个快速而且多变的工具。它将你的硬盘使用情况存在一个优化过的数据库里,这样你就可以在索引完成后迅速找到你的数据。此外,它自带不同的用户交互界面与后端以访问数据库并绘制图表。 + +以下列出的是目前支持的用户界面(UI): + + 1. 命令行界面 (ls), + 2. Ncurses 控制台界面 (ui), + 3. X11 GUI (duc gui), + 4. OpenGL GUI (duc gui)。 + + + +支持的后端数据库: + + * Tokyocabinet, + * Leveldb, + * Sqlite3. + + + +Duc 使用 **Tokyocabinet** 作为默认的后端数据库。 + +### 安装 Duc + +Duc 可以从 Debian 以及其衍生品例如 Ubuntu 的默认仓库中获取。因此在基于 DEB 的系统上安装 Duc 小菜一碟。 + +``` +$ sudo apt-get install duc +``` + +在其它 Linux 发行版上你需要像以下所展示的那样手动从源编译安装 Duc。 + +从 github 上的[**发行**][2]页面下载最新的 Duc 源 .tgz 文件。在写这篇教程的时候,最新的版本是**1.4.4**。 + +``` +$ wget https://github.com/zevv/duc/releases/download/1.4.4/duc-1.4.4.tar.gz +``` + +然后一个接一个地运行以下命令来安装 DUC。 + +``` +$ tar -xzf duc-1.4.4.tar.gz +$ cd duc-1.4.4 +$ ./configure +$ make +$ sudo make install +``` + +### 使用 Duc + +duc 的典型用法是: + +``` +$ duc +``` + +你可以通过运行以下命令来浏览总的选项列表以及副命令: + +``` +$ duc help +``` + +你也可以像下面这样了解一个特定副命令的用法。 + +``` +$ duc help +``` + +要查看所有命令与其选项的列表,仅需运行: + +``` +$ duc help --all +``` + +让我们看看一些 duc 工具的特定用法。 + +### 创建索引(数据库) + +首先,你需要创建一个你文件系统的索引文件(数据库)。使用“duc index”命令以创建索引文件。 + +比如说,要创建你的 **/home** 目录的索引,仅需运行: + +``` +$ duc index /home +``` + +上述命令将会创建你的 /home/ 目录的索引并将其保存在 **$HOME/.duc.db** 文件中。如果你以后需要往 /home 目录添加新的文件/目录,只要在之后重新运行一下上面的命令来重建索引。 + +### 查询索引 + +Duc 有不同的副命令来查询并探索索引。 + +要查看可访问的索引列表,运行: + +``` +$ duc info +``` + +**示例输出:** + +``` +日期 时间 文件 目录 大小 路径 +2019-04-09 15:45:55 3.5K 305 654.6M /home +``` + +如你在上述输出所见,我已经索引好了 /home 目录。 + +要列出当前工作目录中所有的文件和目录,你可以这样做: + +``` +$ duc ls +``` + +要列出所提供目录例如 **/home/sk/Downloads** 中的文件/目录,仅需像下面这样将路径作为参数传过去。 + +``` +$ duc ls /home/sk/Downloads +``` + +类似的,运行**“duc ui”**命令来打开基于 **ncurses** 的控制台用户界面以探索文件系统使用情况,运行**“duc gui”**以打开 **graphical (X11)** 界面来探索文件系统。 + +要了解更多副命令的用法,仅需参考帮助部分。 + +``` +$ duc help ls +``` + +上述命令将会展现 “ls” 副命令的帮助部分。 + +### 可视化硬盘使用状况 + +在之前的部分我们以及看到如何用 duc 副命令列出文件和目录。在此之外,你甚至可以用一张漂亮的图表展示文件大小。 + +要展示所提供目录的图表,像以下这样使用“ls”副命令。 + +``` +$ duc ls -Fg /home/sk +``` + +示例输出: + +![使用 “duc ls” 命令可视化硬盘使用情况][3] + +如你在上述输出所见,“ls”副命令查询 duc 数据库并列出了所提供目录,在这里就是 **/home/sk/**,所包含的文件与目录的大小。 + +这里 **-F** 选项是往条目中用来添加文件类型显示(*/之一),**-g** 选项是用来绘制每个条目相对大小的图表。 + +请注意如果未提供任何路径,当前工作目录就会被探索。 + +你可以使用 **-R** 选项来用[**树状结构**][4]浏览硬盘使用情况。 + +``` +$ duc ls -R /home/sk +``` + +![用树状结构可视化硬盘使用情况][5] + +要查询 duc 数据库并打开基于 **ncurses** 的控制台以探索所提供的目录,像以下这样使用**“ui”**副命令。 + +``` +$ duc ui /home/sk +``` + +![][6] + +类似的,我们使用**“gui”* 副命令来查询 duc 数据库以及打开一个 **graphical (X11)** 界面来探索提供路径的硬盘使用情况。 + +``` +$ duc gui /home/sk +``` + +![][7] + +像我之前所提到的,我们可以像下面这样了解更多关于特定副命令的用法。 + +``` +$ duc help <副命令名字> +``` + +我仅仅覆盖了基本用法的部分,参考 man 页面了解关于“duc”工具的更多细节。 + +``` +$ man duc +``` + +* * * + +**相关阅读:** + + * [**Filelight – 在你的 Linux 系统上可视化硬盘使用情况**][8] + * [**一些好的‘du’命令的替代品**][9] + * [**如何在 Linux 中用 Ncdu 检查硬盘使用情况**][10] + * [**Agedu——发现 Linux 中被浪费的硬盘空间**][11] + * [**如何在 Linux 中找到目录大小**][12] + * [**为初学者打造的带有示例的 df 命令教程**][13] + + + +* * * + +### 总结 + +Duc 是一款简单却有用的硬盘使用查看器。如果你想要快速简便地知道哪个文件/目录占用你的硬盘空间,Duc 可能是一个好的选择。你还等什么呢?获取这个工具,扫描你的文件系统,摆脱无用的文件/目录。 + +现在就到此为止了。希望这篇文章有用处。更多好东西马上就到。保持关注! + +欢呼吧! + +**资源:** + + + * [**Duc 网站**][14] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[校对者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/2019/04/duc-720x340.png +[2]: https://github.com/zevv/duc/releases +[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-1-1.png +[4]: https://www.ostechnix.com/view-directory-tree-structure-linux/ +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-2.png +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-3.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-4.png +[8]: https://www.ostechnix.com/filelight-visualize-disk-usage-on-your-linux-system/ +[9]: https://www.ostechnix.com/some-good-alternatives-to-du-command/ +[10]: https://www.ostechnix.com/check-disk-space-usage-linux-using-ncdu/ +[11]: https://www.ostechnix.com/agedu-find-out-wasted-disk-space-in-linux/ +[12]: https://www.ostechnix.com/find-size-directory-linux/ +[13]: https://www.ostechnix.com/the-df-command-tutorial-with-examples-for-beginners/ +[14]: https://duc.zevv.nl/ From 104d49c5a2ef8057b7b592e8b7f0391d7ab251d4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 May 2019 02:00:48 +0800 Subject: [PATCH 0570/1154] PRF:20190416 Detecting malaria with deep learning.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @warmfrog 辛苦了! --- ...16 Detecting malaria with deep learning.md | 397 +++++++++--------- 1 file changed, 192 insertions(+), 205 deletions(-) diff --git a/translated/tech/20190416 Detecting malaria with deep learning.md b/translated/tech/20190416 Detecting malaria with deep learning.md index 9643be6315..b76bacd836 100644 --- a/translated/tech/20190416 Detecting malaria with deep learning.md +++ b/translated/tech/20190416 Detecting malaria with deep learning.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Detecting malaria with deep learning) [#]: via: (https://opensource.com/article/19/4/detecting-malaria-deep-learning) -[#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) +[#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) 使用深度学习检测疟疾 ================== @@ -14,74 +14,73 @@ ![][1] -人工智能(AI)和开源工具、技术和框架是促进社会进步的强有力的结合。“健康就是财富”可能有点陈词滥调,但它却是非常准确的!在本篇文章,我们将测试 AI 是如何与低成本、有效、精确的开源深度学习方法一起被利用来检测致死的传染病疟疾。 +人工智能(AI)和开源工具、技术和框架是促进社会进步的强有力的结合。“健康就是财富”可能有点陈词滥调,但它却是非常准确的!在本篇文章,我们将测试 AI 是如何与低成本、有效、精确的开源深度学习方法结合起来一起用来检测致死的传染病疟疾。 我既不是一个医生,也不是一个医疗保健研究者,我也绝不像他们那样合格,我只是对将 AI 应用到医疗保健研究感兴趣。在这片文章中我的想法是展示 AI 和开源解决方案如何帮助疟疾检测和减少人工劳动的方法。 ![Python and TensorFlow][2] -*Python and TensorFlow: 一个构建开源深度学习方法的很棒的结合* +*Python 和 TensorFlow: 一个构建开源深度学习方法的很棒的结合* -感谢 Python 的强大和像 TensorFlow 这样的深度学习框架,我们能够构建健壮的、大规模的、有效的深度学习方法。因为这些工具是自由和开源的,我们能够构建低成本的、能够轻易被任何人采纳和使用的解决方案。让我们开始吧! +感谢 Python 的强大和像 TensorFlow 这样的深度学习框架,我们能够构建健壮的、大规模的、有效的深度学习方法。因为这些工具是自由和开源的,我们能够构建非常经济且易于被任何人采纳和使用的解决方案。让我们开始吧! ### 项目动机 -疟疾是由*疟原虫*造成的致死的、有传染性的、蚊子传播的疾病,主要通过受感染的雌性按蚊叮咬传播。共有五种寄生虫能够造成疟疾,但是样例中的大多数是这两种类型造成的:恶性疟原虫和间日疟原虫。 +疟疾是由*疟原虫*造成的致死的、有传染性的、蚊子传播的疾病,主要通过受感染的雌性按蚊叮咬传播。共有五种寄生虫能够引起疟疾,但是大多数病例是这两种类型造成的:恶性疟原虫和间日疟原虫。 ![疟疾热图][3] 这个地图显示了疟疾在全球传播分布形势,尤其在热带地区,但疾病的性质和致命性是该项目的主要动机。 -如果一个雌性蚊子咬了你,蚊子携带的寄生虫进入你的血液并且开始破坏携带氧气的红细胞(RBC)。通常,疟疾的最初症状类似于流感病毒,在蚊子叮咬后,他们通常在几天或几周内发作。然而,这些致死的寄生虫可以在你的身体里生存长达一年并且不会造成任何症状,延迟治疗可能造成并发症甚至死亡。因此,早期的检查能够挽救生命。 +如果一只受感染雌性蚊子叮咬了你,蚊子携带的寄生虫进入你的血液,并且开始破坏携带氧气的红细胞(RBC)。通常,疟疾的最初症状类似于流感病毒,在蚊子叮咬后,他们通常在几天或几周内发作。然而,这些致死的寄生虫可以在你的身体里生存长达一年并且不会造成任何症状,延迟治疗可能造成并发症甚至死亡。因此,早期的检查能够挽救生命。 -世界健康组织(WHO)的[疟疾事件][4]暗示世界近乎一半的人口面临疟疾的风险,有超过 2 亿 的疟疾病例,每年由于疟疾造成的死亡近乎 40 万。这是使疟疾检测和诊断快速、简单和有效的一个动机。 +世界健康组织(WHO)的[疟疾实情][4]表明,世界近乎一半的人口面临疟疾的风险,有超过 2 亿的疟疾病例,每年由于疟疾造成的死亡将近 40 万。这是使疟疾检测和诊断快速、简单和有效的一个动机。 ### 检测疟疾的方法 -有几种方法能够用来检测和诊断疟疾。该文中的项目就是基于 Rajaraman,et al. 的论文:“[预先训练的卷积神经网络作为特征提取器,用于改善薄血涂片图像中的疟疾寄生虫检测][5]”介绍的一些方法,包含聚合酶链反应(PCR)和快速诊断测试(RDT)。这两种测试通常在高质量的显微镜下使用,但这样的设备不是轻易能够获得的。 +有几种方法能够用来检测和诊断疟疾。该文中的项目就是基于 Rajaraman, et al. 的论文:“[预先训练的卷积神经网络作为特征提取器,用于改善薄血涂片图像中的疟疾寄生虫检测][5]”介绍的一些方法,包含聚合酶链反应(PCR)和快速诊断测试(RDT)。这两种测试通常用于无法提供高质量显微镜服务的地方。 -标准的疟疾诊断通常使基于血液涂片工作流的,根据 Carlos Ariza 的文章“[Malaria Hero: 一个更快诊断疟原虫的网络应用][6]”,我从中了解到 Adrian Rosebrock 的“[使用 Keras 的深度学习和医学图像分析][7]”。我感激这些优秀的资源的作者,让我在疟原虫预防,诊断和治疗方面有了更多的想法。 +标准的疟疾诊断通常是基于血液涂片工作流程的,根据 Carlos Ariza 的文章“[Malaria Hero:一个更快诊断疟原虫的网络应用][6]”,我从中了解到 Adrian Rosebrock 的“[使用 Keras 的深度学习和医学图像分析][7]”。我感激这些优秀的资源的作者,让我在疟原虫预防、诊断和治疗方面有了更多的想法。 ![疟原虫检测的血涂片工作流程][8] *一个疟原虫检测的血涂片工作流程* -根据 WHO 草案,诊断通常包括对放大 100 倍的血涂片的集中检测。训练人们在 5000 个细胞中人工计数有多少红细胞中包含疟原虫。正如上述解释中引用的 Rajaraman, et al. 的论文: +根据 WHO 方案,诊断通常包括对放大 100 倍的血涂片的集中检测。受过训练的人们手工计算在 5000 个细胞中有多少红细胞中包含疟原虫。正如上述解释中引用的 Rajaraman, et al. 的论文: -> 薄血涂片帮助检测疟原虫的存在性并且帮助识别造成传染(疾病控制和抑制中心,2012)的物种。诊断准确性在很大程度上取决于人类的专业知识,并且可能受到观察者间差异和疾病流行/资源受限区域大规模诊断所造成的不利影响(Mitiku, Mengistu, and Gelaw, 2003)。可替代的技术是使用聚合酶链反应(PCR)和快速诊断测试(RDT);然而,PCR 分析受限于它的性能(Hommelsheim, et al., 2014),RDT 在疾病流行的地区成本效益低(Hawkes,Katsuva, and Masumbuko, 2009)。 +> 厚血涂片有助于检测寄生虫的存在,而薄血涂片有助于识别引起感染的寄生虫种类(疾病控制和预防中心, 2012)。诊断准确性在很大程度上取决于诊断人的专业知识,并且可能受到观察者间差异和疾病流行/资源受限区域大规模诊断所造成的不利影响(Mitiku, Mengistu 和 Gelaw, 2003)。可替代的技术是使用聚合酶链反应(PCR)和快速诊断测试(RDT);然而,PCR 分析受限于它的性能(Hommelsheim, et al., 2014),RDT 在疾病流行的地区成本效益低(Hawkes, Katsuva 和 Masumbuko, 2009)。 因此,疟疾检测可能受益于使用机器学习的自动化。 -### 疟原虫检测的深度学习 +### 疟疾检测的深度学习 -人工诊断血涂片是一个加强的人工过程,需要专业知识来分类和计数被寄生虫感染的和未感染的细胞。这个过程可能不能很好的规模化,尤其在那些专业人士不足的地区。在利用最先进的图像处理和分析技术提取人工选取特征和构建基于机器学习的分类模型方面取得了一些进展。然而,这些模型不能大规模推广,因为没有更多的数据用来训练,并且人工选取特征需要花费很长时间。 +人工诊断血涂片是一个繁重的手工过程,需要专业知识来分类和计数被寄生虫感染的和未感染的细胞。这个过程可能不能很好的规模化,尤其在那些专业人士不足的地区。在利用最先进的图像处理和分析技术提取人工选取特征和构建基于机器学习的分类模型方面取得了一些进展。然而,这些模型不能大规模推广,因为没有更多的数据用来训练,并且人工选取特征需要花费很长时间。 -深度学习模型,或者更具体地讲,卷积神经网络(CNN),已经被证明在各种计算机视觉任务中非常有效。(如果你想更多的了解关于 CNN 的背景知识,我推荐你阅读[视觉识别的 CS2331n 卷积神经网络][9]。)简单地讲,CNN 模型的关键层包含卷积和池化层,正如下面图像显示。 +深度学习模型,或者更具体地讲,卷积神经网络(CNN),已经被证明在各种计算机视觉任务中非常有效。(如果你想更多的了解关于 CNN 的背景知识,我推荐你阅读[视觉识别的 CS2331n 卷积神经网络][9]。)简单地讲,CNN 模型的关键层包含卷积和池化层,正如下图所示。 ![A typical CNN architecture][10] *一个典型的 CNN 架构* -卷积层从数据中学习空间层级模式,它是平移不变的,因此它们能够学习不同方面的图像。例如,第一个卷积层将学习小的和局部图案,例如边缘和角落,第二个卷积层学习基于第一层的特征的更大的图案,等等。这允许 CNN 自动化提取特征并且学习对于新数据点通用的有效的特征。池化层有助于降采样和降维。 +卷积层从数据中学习空间层级模式,它是平移不变的,因此它们能够学习图像的不同方面。例如,第一个卷积层将学习小的和局部图案,例如边缘和角落,第二个卷积层将基于第一层的特征学习更大的图案,等等。这允许 CNN 自动化提取特征并且学习对于新数据点通用的有效的特征。池化层有助于下采样和减少尺寸。 因此,CNN 有助于自动化和规模化的特征工程。同样,在模型末尾加上密集层允许我们执行像图像分类这样的任务。使用像 CNN 这样的深度学习模型自动的疟疾检测可能非常有效、便宜和具有规模性,尤其是迁移学习和预训练模型效果非常好,甚至在少量数据的约束下。 -Rajaraman, et al. 的论文在一个数据集上利用六个预训练模型在检测疟疾 vs 无感染样本获取到令人吃惊的 95.9% 的准确率。我们的关注点是从头开始尝试一些简单的 CNN 模型和用一个预训练的训练模型使用迁移学习来查看我们能够从相同的数据集中得到什么。我们将使用开源工具和框架,包括 Python 和 TensorFlow,来构建我们的模型。 +Rajaraman, et al. 的论文在一个数据集上利用六个预训练模型在检测疟疾对比无感染样本获取到令人吃惊的 95.9% 的准确率。我们的重点是从头开始尝试一些简单的 CNN 模型和用一个预训练的训练模型使用迁移学习来查看我们能够从相同的数据集中得到什么。我们将使用开源工具和框架,包括 Python 和 TensorFlow,来构建我们的模型。 ### 数据集 -我们分析的数据来自 Lister Hill 国家生物医学交流中心(LHNCBC),国家医学图书馆(NLM)的一部分,他们细心收集和标记了健康和受感染的血涂片图像的[公众可获得的数据集][11]。这些研究者已经开发了一个运行在 Android 智能手机的移动[疟疾检测应用][12],连接到一个传统的光学显微镜。它们使用 吉姆萨染液 将 150 个受恶性疟原虫感染的和 50 个健康病人的薄血涂片染色,这些薄血涂片是在孟加拉的吉大港医学院附属医院收集和照相的。使用智能手机的内置相机获取每个显微镜视窗内的图像。这些图片由在泰国曼谷的马希多-牛津热带医学研究所的一个专家使用幻灯片阅读器标记的。 +我们分析的数据来自 Lister Hill 国家生物医学交流中心(LHNCBC)的研究人员,该中心是国家医学图书馆(NLM)的一部分,他们细心收集和标记了公开可用的健康和受感染的血涂片图像的[数据集][11]。这些研究者已经开发了一个运行在 Android 智能手机的[疟疾检测手机应用][12],连接到一个传统的光学显微镜。它们使用吉姆萨染液将 150 个受恶性疟原虫感染的和 50 个健康病人的薄血涂片染色,这些薄血涂片是在孟加拉的吉大港医学院附属医院收集和照相的。使用智能手机的内置相机获取每个显微镜视窗内的图像。这些图片由在泰国曼谷的马希多-牛津热带医学研究所的一个专家使用幻灯片阅读器标记的。 -让我们简洁的查看数据集的结构。首先,我将安装一些基础的依赖(基于使用的操作系统)。 +让我们简要地查看一下数据集的结构。首先,我将安装一些基础的依赖(基于使用的操作系统)。 ![Installing dependencies][13] -我使用的是云上的带有一个 GPU 的基于 Debian 的操作系统,这样我能更快的运行我的模型。为了查看目录结构,我们必须安装 tree 依赖(如果我们没有安装的话)使用 **sudo apt install tree**。 +我使用的是云上的带有一个 GPU 的基于 Debian 的操作系统,这样我能更快的运行我的模型。为了查看目录结构,我们必须使用 `sudo apt install tree` 安装 `tree` 及其依赖(如果我们没有安装的话)。 ![Installing the tree dependency][14] -我们有两个文件夹包含血细胞的图像,包括受感染的和健康的。我们可以获取关于图像总数更多的细节通过输入: - +我们有两个文件夹包含血细胞的图像,包括受感染的和健康的。我们通过输入可以获取关于图像总数更多的细节: ``` import os @@ -99,7 +98,7 @@ len(infected_files), len(healthy_files) (13779, 13779) ``` -看起来我们有一个平衡的 13,779 张疟疾的 和 13,779 张非疟疾的(健康的)血细胞图像。让我们根据这些构建数据帧,我们将用这些数据帧来构建我们的数据集。 +看起来我们有一个平衡的数据集,包含 13,779 张疟疾的和 13,779 张非疟疾的(健康的)血细胞图像。让我们根据这些构建数据帧,我们将用这些数据帧来构建我们的数据集。 ``` @@ -109,8 +108,8 @@ import pandas as pd np.random.seed(42) files_df = pd.DataFrame({ -'filename': infected_files + healthy_files, -'label': ['malaria'] * len(infected_files) + ['healthy'] * len(healthy_files) + 'filename': infected_files + healthy_files, + 'label': ['malaria'] * len(infected_files) + ['healthy'] * len(healthy_files) }).sample(frac=1, random_state=42).reset_index(drop=True) files_df.head() @@ -118,9 +117,9 @@ files_df.head() ![Datasets][15] -### 构建和参所图像数据集 +### 构建和了解图像数据集 -为了构建深度学习模型,我们需要训练数据,但是我们还需要使用不可见的数据测试模型的性能。相应的,我们将使用 60:10:30 的划分用于训练,验证和测试数据集。我们将在训练期间应用训练和验证数据集并用测试数据集来检查模型的性能。 +为了构建深度学习模型,我们需要训练数据,但是我们还需要使用不可见的数据测试模型的性能。相应的,我们将使用 60:10:30 的比例来划分用于训练、验证和测试的数据集。我们将在训练期间应用训练和验证数据集,并用测试数据集来检查模型的性能。 ``` @@ -128,24 +127,23 @@ from sklearn.model_selection import train_test_split from collections import Counter train_files, test_files, train_labels, test_labels = train_test_split(files_df['filename'].values, -files_df['label'].values, -test_size=0.3, random_state=42) + files_df['label'].values, + test_size=0.3, random_state=42) train_files, val_files, train_labels, val_labels = train_test_split(train_files, -train_labels, -test_size=0.1, random_state=42) + train_labels, + test_size=0.1, random_state=42) print(train_files.shape, val_files.shape, test_files.shape) print('Train:', Counter(train_labels), '\nVal:', Counter(val_labels), '\nTest:', Counter(test_labels)) # Output (17361,) (1929,) (8268,) -Train: Counter({'healthy': 8734, 'malaria': 8627}) -Val: Counter({'healthy': 970, 'malaria': 959}) +Train: Counter({'healthy': 8734, 'malaria': 8627}) +Val: Counter({'healthy': 970, 'malaria': 959}) Test: Counter({'malaria': 4193, 'healthy': 4075}) ``` -这些图片维度并不相同,因此血涂片和细胞图像是基于人类,测试方法,图片的朝向。让我们总结我们的训练数据集的统计信息来决定最佳的图像维度(牢记,我们根本不会碰测试数据集)。 - +这些图片尺寸并不相同,因为血涂片和细胞图像是基于人、测试方法、图片方向不同而不同的。让我们总结我们的训练数据集的统计信息来决定最佳的图像尺寸(牢记,我们根本不会碰测试数据集)。 ``` import cv2 @@ -153,24 +151,25 @@ from concurrent import futures import threading def get_img_shape_parallel(idx, img, total_imgs): -if idx % 5000 == 0 or idx == (total_imgs - 1): -print('{}: working on img num: {}'.format(threading.current_thread().name, -idx)) -return cv2.imread(img).shape - + if idx % 5000 == 0 or idx == (total_imgs - 1): + print('{}: working on img num: {}'.format(threading.current_thread().name, + idx)) + return cv2.imread(img).shape + ex = futures.ThreadPoolExecutor(max_workers=None) data_inp = [(idx, img, len(train_files)) for idx, img in enumerate(train_files)] print('Starting Img shape computation:') -train_img_dims_map = ex.map(get_img_shape_parallel, -[record[0] for record in data_inp], -[record[1] for record in data_inp], -[record[2] for record in data_inp]) +train_img_dims_map = ex.map(get_img_shape_parallel, + [record[0] for record in data_inp], + [record[1] for record in data_inp], + [record[2] for record in data_inp]) train_img_dims = list(train_img_dims_map) -print('Min Dimensions:', np.min(train_img_dims, axis=0)) +print('Min Dimensions:', np.min(train_img_dims, axis=0)) print('Avg Dimensions:', np.mean(train_img_dims, axis=0)) print('Median Dimensions:', np.median(train_img_dims, axis=0)) print('Max Dimensions:', np.max(train_img_dims, axis=0)) + # Output Starting Img shape computation: ThreadPoolExecutor-0_0: working on img num: 0 @@ -178,27 +177,26 @@ ThreadPoolExecutor-0_17: working on img num: 5000 ThreadPoolExecutor-0_15: working on img num: 10000 ThreadPoolExecutor-0_1: working on img num: 15000 ThreadPoolExecutor-0_7: working on img num: 17360 -Min Dimensions: [46 46 3] -Avg Dimensions: [132.77311215 132.45757733 3.] -Median Dimensions: [130. 130. 3.] -Max Dimensions: [385 394 3] +Min Dimensions: [46 46 3] +Avg Dimensions: [132.77311215 132.45757733 3.] +Median Dimensions: [130. 130. 3.] +Max Dimensions: [385 394 3] ``` -我们应用并行处理来加速图像读取,并且在总结统计时,我们将重新调整每幅图片到 125x125 像素。让我们载入我们所有的图像并重新调整它们为这些固定的大小。 - +我们应用并行处理来加速图像读取,并且基于汇总统计结果,我们将每幅图片的尺寸重新调整到 125x125 像素。让我们载入我们所有的图像并重新调整它们为这些固定尺寸。 ``` IMG_DIMS = (125, 125) def get_img_data_parallel(idx, img, total_imgs): -if idx % 5000 == 0 or idx == (total_imgs - 1): -print('{}: working on img num: {}'.format(threading.current_thread().name, -idx)) -img = cv2.imread(img) -img = cv2.resize(img, dsize=IMG_DIMS, -interpolation=cv2.INTER_CUBIC) -img = np.array(img, dtype=np.float32) -return img + if idx % 5000 == 0 or idx == (total_imgs - 1): + print('{}: working on img num: {}'.format(threading.current_thread().name, + idx)) + img = cv2.imread(img) + img = cv2.resize(img, dsize=IMG_DIMS, + interpolation=cv2.INTER_CUBIC) + img = np.array(img, dtype=np.float32) + return img ex = futures.ThreadPoolExecutor(max_workers=None) train_data_inp = [(idx, img, len(train_files)) for idx, img in enumerate(train_files)] @@ -206,27 +204,28 @@ val_data_inp = [(idx, img, len(val_files)) for idx, img in enumerate(val_files)] test_data_inp = [(idx, img, len(test_files)) for idx, img in enumerate(test_files)] print('Loading Train Images:') -train_data_map = ex.map(get_img_data_parallel, -[record[0] for record in train_data_inp], -[record[1] for record in train_data_inp], -[record[2] for record in train_data_inp]) +train_data_map = ex.map(get_img_data_parallel, + [record[0] for record in train_data_inp], + [record[1] for record in train_data_inp], + [record[2] for record in train_data_inp]) train_data = np.array(list(train_data_map)) print('\nLoading Validation Images:') -val_data_map = ex.map(get_img_data_parallel, -[record[0] for record in val_data_inp], -[record[1] for record in val_data_inp], -[record[2] for record in val_data_inp]) +val_data_map = ex.map(get_img_data_parallel, + [record[0] for record in val_data_inp], + [record[1] for record in val_data_inp], + [record[2] for record in val_data_inp]) val_data = np.array(list(val_data_map)) print('\nLoading Test Images:') -test_data_map = ex.map(get_img_data_parallel, -[record[0] for record in test_data_inp], -[record[1] for record in test_data_inp], -[record[2] for record in test_data_inp]) +test_data_map = ex.map(get_img_data_parallel, + [record[0] for record in test_data_inp], + [record[1] for record in test_data_inp], + [record[2] for record in test_data_inp]) test_data = np.array(list(test_data_map)) -train_data.shape, val_data.shape, test_data.shape +train_data.shape, val_data.shape, test_data.shape + # Output Loading Train Images: @@ -247,23 +246,22 @@ ThreadPoolExecutor-1_8: working on img num: 8267 ((17361, 125, 125, 3), (1929, 125, 125, 3), (8268, 125, 125, 3)) ``` -我们再次应用并行处理来加速有关图像载入和重新调整大小。最终,我们获得了想要的维度的图片张量,正如之前描述的。我们现在查看一些血细胞图像样本来对我们的数据什么样有个印象。 - +我们再次应用并行处理来加速有关图像载入和重新调整大小的计算。最终,我们获得了所需尺寸的图片张量,正如前面的输出所示。我们现在查看一些血细胞图像样本,以对我们的数据有个印象。 ``` import matplotlib.pyplot as plt %matplotlib inline plt.figure(1 , figsize = (8 , 8)) -n = 0 +n = 0 for i in range(16): -n += 1 -r = np.random.randint(0 , train_data.shape[0] , 1) -plt.subplot(4 , 4 , n) -plt.subplots_adjust(hspace = 0.5 , wspace = 0.5) -plt.imshow(train_data[r[0]]/255.) -plt.title('{}'.format(train_labels[r[0]])) -plt.xticks([]) , plt.yticks([]) + n += 1 + r = np.random.randint(0 , train_data.shape[0] , 1) + plt.subplot(4 , 4 , n) + plt.subplots_adjust(hspace = 0.5 , wspace = 0.5) + plt.imshow(train_data[r[0]]/255.) + plt.title('{}'.format(train_labels[r[0]])) + plt.xticks([]) , plt.yticks([]) ``` ![Malaria cell samples][16] @@ -272,7 +270,6 @@ plt.xticks([]) , plt.yticks([]) 开始我们的模型训练前,我们必须建立一些基础的配置设置。 - ``` BATCH_SIZE = 64 NUM_CLASSES = 2 @@ -292,12 +289,12 @@ val_labels_enc = le.transform(val_labels) print(train_labels[:6], train_labels_enc[:6]) + # Output ['malaria' 'malaria' 'malaria' 'healthy' 'healthy' 'malaria'] [1 1 1 0 0 1] ``` -我们修复我们的图像维度,批大小,和历元并编码我们的分类类标签。TensorFlow 2.0 于 2019 年三月发布,这个练习是非常好的借口来试用它。 - +我们修复我们的图像尺寸、批量大小,和纪元,并编码我们的分类的类标签。TensorFlow 2.0 于 2019 年三月发布,这个练习是尝试它的完美理由。 ``` import tensorflow as tf @@ -314,24 +311,23 @@ tf.__version__ ### 深度学习训练 -在模型训练阶段,我们将构建三个深度训练模型,使用我们的训练集训练,使用验证数据比较它们的性能。我们然后保存这些模型并在之后的模型评估阶段使用它们。 +在模型训练阶段,我们将构建三个深度训练模型,使用我们的训练集训练,使用验证数据比较它们的性能。然后,我们保存这些模型并在之后的模型评估阶段使用它们。 #### 模型 1:从头开始的 CNN 我们的第一个疟疾检测模型将从头开始构建和训练一个基础的 CNN。首先,让我们定义我们的模型架构, - ``` inp = tf.keras.layers.Input(shape=INPUT_SHAPE) -conv1 = tf.keras.layers.Conv2D(32, kernel_size=(3, 3), -activation='relu', padding='same')(inp) +conv1 = tf.keras.layers.Conv2D(32, kernel_size=(3, 3), + activation='relu', padding='same')(inp) pool1 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv1) -conv2 = tf.keras.layers.Conv2D(64, kernel_size=(3, 3), -activation='relu', padding='same')(pool1) +conv2 = tf.keras.layers.Conv2D(64, kernel_size=(3, 3), + activation='relu', padding='same')(pool1) pool2 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv2) -conv3 = tf.keras.layers.Conv2D(128, kernel_size=(3, 3), -activation='relu', padding='same')(pool2) +conv3 = tf.keras.layers.Conv2D(128, kernel_size=(3, 3), + activation='relu', padding='same')(pool2) pool3 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv3) flat = tf.keras.layers.Flatten()(pool3) @@ -345,31 +341,32 @@ out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) model = tf.keras.Model(inputs=inp, outputs=out) model.compile(optimizer='adam', -loss='binary_crossentropy', -metrics=['accuracy']) + loss='binary_crossentropy', + metrics=['accuracy']) model.summary() + # Output Model: "model" _________________________________________________________________ -Layer (type) Output Shape Param # +Layer (type) Output Shape Param # ================================================================= -input_1 (InputLayer) [(None, 125, 125, 3)] 0 +input_1 (InputLayer) [(None, 125, 125, 3)] 0 _________________________________________________________________ -conv2d (Conv2D) (None, 125, 125, 32) 896 +conv2d (Conv2D) (None, 125, 125, 32) 896 _________________________________________________________________ -max_pooling2d (MaxPooling2D) (None, 62, 62, 32) 0 +max_pooling2d (MaxPooling2D) (None, 62, 62, 32) 0 _________________________________________________________________ -conv2d_1 (Conv2D) (None, 62, 62, 64) 18496 +conv2d_1 (Conv2D) (None, 62, 62, 64) 18496 _________________________________________________________________ ... ... _________________________________________________________________ -dense_1 (Dense) (None, 512) 262656 +dense_1 (Dense) (None, 512) 262656 _________________________________________________________________ -dropout_1 (Dropout) (None, 512) 0 +dropout_1 (Dropout) (None, 512) 0 _________________________________________________________________ -dense_2 (Dense) (None, 1) 513 +dense_2 (Dense) (None, 1) 513 ================================================================= Total params: 15,102,529 Trainable params: 15,102,529 @@ -377,26 +374,26 @@ Non-trainable params: 0 _________________________________________________________________ ``` -基于这些代码的架构,我们的 CNN 模型有三个卷积和一个池化层,跟随两个致密层,以及用于正则化的丢失。让我们训练我们的模型。 +基于这些代码的架构,我们的 CNN 模型有三个卷积和一个池化层,其后是两个致密层,以及用于正则化的失活。让我们训练我们的模型。 ``` import datetime -logdir = os.path.join('/home/dipanzan_sarkar/projects/tensorboard_logs', -datetime.datetime.now().strftime("%Y%m%d-%H%M%S")) +logdir = os.path.join('/home/dipanzan_sarkar/projects/tensorboard_logs', + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")) tensorboard_callback = tf.keras.callbacks.TensorBoard(logdir, histogram_freq=1) reduce_lr = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.5, -patience=2, min_lr=0.000001) + patience=2, min_lr=0.000001) callbacks = [reduce_lr, tensorboard_callback] -history = model.fit(x=train_imgs_scaled, y=train_labels_enc, -batch_size=BATCH_SIZE, -epochs=EPOCHS, -validation_data=(val_imgs_scaled, val_labels_enc), -callbacks=callbacks, -verbose=1) - +history = model.fit(x=train_imgs_scaled, y=train_labels_enc, + batch_size=BATCH_SIZE, + epochs=EPOCHS, + validation_data=(val_imgs_scaled, val_labels_enc), + callbacks=callbacks, + verbose=1) + # Output Train on 17361 samples, validate on 1929 samples @@ -441,57 +438,53 @@ l2 = ax2.legend(loc="best") ![Learning curves for basic CNN][17] -基础 CNN 学习曲线 - -我们可以看在在第五个历元,情况并没有改善很多。让我们保存这个模型用于将来的评估。 +*基础 CNN 学习曲线* +我们可以看在在第五个纪元,情况并没有改善很多。让我们保存这个模型用于将来的评估。 ``` -`model.save('basic_cnn.h5')` +model.save('basic_cnn.h5') ``` #### 深度迁移学习 -就像人类有与生俱来的能力在不同任务间传输知识,迁移学习允许我们利用从以前任务学到的知识用到新的任务,相关的任务,甚至在机器学习或深度学习的上下文中。如果想深入探究迁移学习,你应该看我的文章“[一个易于理解与现实应用一起学习深度学习中的迁移学习的指导实践][18]”和我的书[ Python 迁移学习实践][19]。 +就像人类有与生俱来在不同任务间传输知识的能力一样,迁移学习允许我们利用从以前任务学到的知识用到新的相关的任务,即使在机器学习或深度学习的情况下也是如此。如果想深入探究迁移学习,你应该看我的文章“[一个易于理解与现实应用一起学习深度学习中的迁移学习的指导实践][18]”和我的书《[Python 迁移学习实践][19]》。 ![深度迁移学习的想法][20] 在这篇实践中我们想要探索的想法是: -> 在我们的问题上下文中,我们能够利用一个预训练深度学习模型(在大数据集上训练的,像 ImageNet)通过应用和迁移知识来解决疟疾检测的问题吗? +> 在我们的问题背景下,我们能够利用一个预训练深度学习模型(在大数据集上训练的,像 ImageNet)通过应用和迁移知识来解决疟疾检测的问题吗? -我们将应用两个深度迁移学习的最流行的策略。 +我们将应用两个最流行的深度迁移学习策略。 * 预训练模型作为特征提取器 * 微调的预训练模型 - - -我们将使用预训练的 VGG-19 深度训练模型,由剑桥大学的视觉几何组(VGG)开发,作为我们的实验。一个像 VGG-19 的预训练模型在一个大的数据集上使用了很多不同的图像分类训练([Imagenet][21])。因此,这个模型应该已经学习到了鲁棒的特征层级结构,相对于你的 CNN 模型学到的特征,是空间不变的,转动不变的,平移不变的。因此,这个模型,已经从百万幅图片中学习到了一个好的特征显示,对于像疟疾检测这样的计算机视觉问题,可以作为一个好的合适新图像的特征提取器。在我们的问题中释放迁移学习的能力之前,让我们先讨论 VGG-19 模型。 +我们将使用预训练的 VGG-19 深度训练模型(由剑桥大学的视觉几何组(VGG)开发)进行我们的实验。像 VGG-19 这样的预训练模型是在一个大的数据集([Imagenet][21])上使用了很多不同的图像分类训练的。因此,这个模型应该已经学习到了健壮的特征层级结构,相对于你的 CNN 模型学到的特征,是空间不变的、转动不变的、平移不变的。因此,这个模型,已经从百万幅图片中学习到了一个好的特征显示,对于像疟疾检测这样的计算机视觉问题,可以作为一个好的合适新图像的特征提取器。在我们的问题中发挥迁移学习的能力之前,让我们先讨论 VGG-19 模型。 ##### 理解 VGG-19 模型 -VGG-19 模型是一个构建在 ImageNet 数据库之上的 19 层(卷积和全连接的)的深度学习网络,该数据库为了图像识别和分类的目的而开发。该模型由 Karen Simonyan 和 Andrew Zisserman 构建,在它们的论文”[大规模图像识别的非常深的卷积网络][22]“中描述。VGG-19 的架构模型是: +VGG-19 模型是一个构建在 ImageNet 数据库之上的 19 层(卷积和全连接的)的深度学习网络,ImageNet 数据库为了图像识别和分类的目的而开发。该模型是由 Karen Simonyan 和 Andrew Zisserman 构建的,在他们的论文“[大规模图像识别的非常深的卷积网络][22]”中进行了描述。VGG-19 的架构模型是: ![VGG-19 模型架构][23] -你可以看到我们总共有 16 个使用 3x3 卷积过滤器的卷积层,与最大的池化层来下采样,和由 4096 个单元组成的两个全连接的隐藏层,每个隐藏层之后跟随一个由 1000 个单元组成的致密层,每个单元代表 ImageNet 数据库中的一个分类。我们不需要最后三层,因为我们将使用我们自己的全连接致密层来预测疟疾。我们更关心前五块,因此我们可以利用 VGG 模型作为一个有效的特征提取器。 +你可以看到我们总共有 16 个使用 3x3 卷积过滤器的卷积层,与最大的池化层来下采样,和由 4096 个单元组成的两个全连接的隐藏层,每个隐藏层之后跟随一个由 1000 个单元组成的致密层,每个单元代表 ImageNet 数据库中的一个分类。我们不需要最后三层,因为我们将使用我们自己的全连接致密层来预测疟疾。我们更关心前五个块,因此我们可以利用 VGG 模型作为一个有效的特征提取器。 -我们将使用模型之一作为一个简单的特征提取器通过冻结五个卷积块的方式来确保它们的位权在每个时期后不会更新。对于最后一个模型,我们会应用微调到 VGG 模型,我们会解冻最后两个块(第 4 和第 5)因此当我们训练我们的模型时,它们的位权在每个时期(每批数据)被更新。 +我们将使用模型之一作为一个简单的特征提取器,通过冻结五个卷积块的方式来确保它们的位权在每个纪元后不会更新。对于最后一个模型,我们会对 VGG 模型进行微调,我们会解冻最后两个块(第 4 和第 5)因此当我们训练我们的模型时,它们的位权在每个时期(每批数据)被更新。 #### 模型 2:预训练的模型作为一个特征提取器 -为了构建这个模型,我们将利用 TensorFlow 载入 VGG-19 模型并且冻结卷积块因此我们用够将他们用作特征提取器。我们插入我们自己的致密层在末尾来执行分类任务。 - +为了构建这个模型,我们将利用 TensorFlow 载入 VGG-19 模型并冻结卷积块,因此我们能够将它们用作特征提取器。我们在末尾插入我们自己的致密层来执行分类任务。 ``` -vgg = tf.keras.applications.vgg19.VGG19(include_top=False, weights='imagenet', -input_shape=INPUT_SHAPE) +vgg = tf.keras.applications.vgg19.VGG19(include_top=False, weights='imagenet', + input_shape=INPUT_SHAPE) vgg.trainable = False # Freeze the layers for layer in vgg.layers: -layer.trainable = False - + layer.trainable = False + base_vgg = vgg base_out = base_vgg.output pool_out = tf.keras.layers.Flatten()(base_out) @@ -504,37 +497,38 @@ out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) model = tf.keras.Model(inputs=base_vgg.input, outputs=out) model.compile(optimizer=tf.keras.optimizers.RMSprop(lr=1e-4), -loss='binary_crossentropy', -metrics=['accuracy']) + loss='binary_crossentropy', + metrics=['accuracy']) model.summary() + # Output Model: "model_1" _________________________________________________________________ -Layer (type) Output Shape Param # +Layer (type) Output Shape Param # ================================================================= -input_2 (InputLayer) [(None, 125, 125, 3)] 0 +input_2 (InputLayer) [(None, 125, 125, 3)] 0 _________________________________________________________________ -block1_conv1 (Conv2D) (None, 125, 125, 64) 1792 +block1_conv1 (Conv2D) (None, 125, 125, 64) 1792 _________________________________________________________________ -block1_conv2 (Conv2D) (None, 125, 125, 64) 36928 +block1_conv2 (Conv2D) (None, 125, 125, 64) 36928 _________________________________________________________________ ... ... _________________________________________________________________ -block5_pool (MaxPooling2D) (None, 3, 3, 512) 0 +block5_pool (MaxPooling2D) (None, 3, 3, 512) 0 _________________________________________________________________ -flatten_1 (Flatten) (None, 4608) 0 +flatten_1 (Flatten) (None, 4608) 0 _________________________________________________________________ -dense_3 (Dense) (None, 512) 2359808 +dense_3 (Dense) (None, 512) 2359808 _________________________________________________________________ -dropout_2 (Dropout) (None, 512) 0 +dropout_2 (Dropout) (None, 512) 0 _________________________________________________________________ -dense_4 (Dense) (None, 512) 262656 +dense_4 (Dense) (None, 512) 262656 _________________________________________________________________ -dropout_3 (Dropout) (None, 512) 0 +dropout_3 (Dropout) (None, 512) 0 _________________________________________________________________ -dense_5 (Dense) (None, 1) 513 +dense_5 (Dense) (None, 1) 513 ================================================================= Total params: 22,647,361 Trainable params: 2,622,977 @@ -542,45 +536,42 @@ Non-trainable params: 20,024,384 _________________________________________________________________ ``` -输出是很明白的,在我们的模型中我们有了很多层,我们将只利用 VGG-19 模型的冻结层作为特征提取器。你可以使用下列代码来验证我们的模型有多少层是实际训练的,我们的网络中总共存在多少层。 - +从整个输出可以明显看出,在我们的模型中我们有了很多层,我们将只利用 VGG-19 模型的冻结层作为特征提取器。你可以使用下列代码来验证我们的模型有多少层是实际可训练的,以及我们的网络中总共存在多少层。 ``` print("Total Layers:", len(model.layers)) -print("Total trainable layers:", -sum([1 for l in model.layers if l.trainable])) +print("Total trainable layers:", + sum([1 for l in model.layers if l.trainable])) # Output Total Layers: 28 Total trainable layers: 6 ``` -我们将使用和我们之前的模型相似的配置和回调来训练我们的模型。参考 [我的 GitHub 仓库][24] 获取训练模型的完整代码。我们观察下列显示模型精确度和损失曲线。 +我们将使用和我们之前的模型相似的配置和回调来训练我们的模型。参考[我的 GitHub 仓库][24]以获取训练模型的完整代码。我们观察下列图表,以显示模型精确度和损失曲线。 ![Learning curves for frozen pre-trained CNN][25] -冻结的预训练的 CNN 的学习曲线 - -这显示了我们的模型没有像我们的基础 CNN 模型那样过拟合,但是性能有点不如我们的基础的 CNN 模型。让我们保存这个模型用户将来的评估。 +*冻结的预训练的 CNN 的学习曲线* +这表明我们的模型没有像我们的基础 CNN 模型那样过拟合,但是性能有点不如我们的基础的 CNN 模型。让我们保存这个模型,以备将来的评估。 ``` -`model.save('vgg_frozen.h5')` +model.save('vgg_frozen.h5') ``` #### 模型 3:使用图像增强来微调预训练的模型 -在我们的最后一个模型中,我们微调预定义好的 VGG-19 模型的最后两个块中层的位权。我们同样引入图像增强的概念。图像增强背后的想法和名字一样。我们从训练数据集中载入已存在的图像,并且应用转换操作,例如旋转,裁剪,转换,放大缩小,等等,来产生新的,改变的版本。由于这些随机的转换,我们每次获取到的图像不一样。我们将应用一个在 **tf.keras** 的优秀的工具叫做 **ImageDataGenerator** 来帮助构建图像增强器。 - +在我们的最后一个模型中,我们将在预定义好的 VGG-19 模型的最后两个块中微调层的位权。我们同样引入了图像增强的概念。图像增强背后的想法和其名字一样。我们从训练数据集中载入现有图像,并且应用转换操作,例如旋转、裁剪、转换、放大缩小等等,来产生新的、改变过的版本。由于这些随机转换,我们每次获取到的图像不一样。我们将应用 tf.keras 中的一个名为 ImageDataGenerator 的优秀工具来帮助构建图像增强器。 ``` train_datagen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255, -zoom_range=0.05, -rotation_range=25, -width_shift_range=0.05, -height_shift_range=0.05, -shear_range=0.05, horizontal_flip=True, -fill_mode='nearest') + zoom_range=0.05, + rotation_range=25, + width_shift_range=0.05, + height_shift_range=0.05, + shear_range=0.05, horizontal_flip=True, + fill_mode='nearest') val_datagen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255) @@ -589,13 +580,12 @@ train_generator = train_datagen.flow(train_data, train_labels_enc, batch_size=BA val_generator = val_datagen.flow(val_data, val_labels_enc, batch_size=BATCH_SIZE, shuffle=False) ``` -我们不会应用任何转换在我们的验证数据集上(除非是调整大小,它是强制性适应的)因为我们将在每个时期来评估我们的模型性能。对于在传输学习上下文中的图像增强的详细解释,请自由查看我们上述引用的[文章][18]。让我们从一批图像增强转换中查看一些样本结果。 - +我们不会对我们的验证数据集应用任何转换(除非是调整大小,因为这是必须的),因为我们将使用它评估每个纪元的模型性能。对于在传输学习环境中的图像增强的详细解释,请随时查看我上面引用的[文章][18]。让我们从一批图像增强转换中查看一些样本结果。 ``` img_id = 0 sample_generator = train_datagen.flow(train_data[img_id:img_id+1], train_labels[img_id:img_id+1], -batch_size=1) + batch_size=1) sample = [next(sample_generator) for i in range(0,5)] fig, ax = plt.subplots(1,5, figsize=(16, 6)) print('Labels:', [item[1][0] for item in sample]) @@ -604,24 +594,23 @@ l = [ax[i].imshow(sample[i][0][0]) for i in range(0,5)] ![Sample augmented images][26] -你可以清晰的看到与之前的输出中我们图像的轻微变化。我们现在构建我们的学习模型,确保 VGG-19 模型的最后两块是可以训练的。 - +你可以清晰的看到与之前的输出的我们图像的轻微变化。我们现在构建我们的学习模型,确保 VGG-19 模型的最后两块是可以训练的。 ``` -vgg = tf.keras.applications.vgg19.VGG19(include_top=False, weights='imagenet', -input_shape=INPUT_SHAPE) +vgg = tf.keras.applications.vgg19.VGG19(include_top=False, weights='imagenet', + input_shape=INPUT_SHAPE) # Freeze the layers vgg.trainable = True set_trainable = False for layer in vgg.layers: -if layer.name in ['block5_conv1', 'block4_conv1']: -set_trainable = True -if set_trainable: -layer.trainable = True -else: -layer.trainable = False - + if layer.name in ['block5_conv1', 'block4_conv1']: + set_trainable = True + if set_trainable: + layer.trainable = True + else: + layer.trainable = False + base_vgg = vgg base_out = base_vgg.output pool_out = tf.keras.layers.Flatten()(base_out) @@ -634,31 +623,32 @@ out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) model = tf.keras.Model(inputs=base_vgg.input, outputs=out) model.compile(optimizer=tf.keras.optimizers.RMSprop(lr=1e-5), -loss='binary_crossentropy', -metrics=['accuracy']) + loss='binary_crossentropy', + metrics=['accuracy']) print("Total Layers:", len(model.layers)) print("Total trainable layers:", sum([1 for l in model.layers if l.trainable])) + # Output Total Layers: 28 Total trainable layers: 16 ``` -在我们的模型中我们降低了学习率,因为我们微调的时候不想在预训练的数据集上做大的位权更新。模型的训练过程可能有轻微的不同,因为我们使用了数据生成器,因此我们应用了 **fit_generator(...)** 函数。 - +在我们的模型中我们降低了学习率,因为我们不想在微调的时候对预训练的层做大的位权更新。模型的训练过程可能有轻微的不同,因为我们使用了数据生成器,因此我们将应用 `fit_generator(...)` 函数。 ``` tensorboard_callback = tf.keras.callbacks.TensorBoard(logdir, histogram_freq=1) reduce_lr = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.5, -patience=2, min_lr=0.000001) + patience=2, min_lr=0.000001) callbacks = [reduce_lr, tensorboard_callback] train_steps_per_epoch = train_generator.n // train_generator.batch_size val_steps_per_epoch = val_generator.n // val_generator.batch_size history = model.fit_generator(train_generator, steps_per_epoch=train_steps_per_epoch, epochs=EPOCHS, -validation_data=val_generator, validation_steps=val_steps_per_epoch, -verbose=1) + validation_data=val_generator, validation_steps=val_steps_per_epoch, + verbose=1) + # Output Epoch 1/25 @@ -677,21 +667,20 @@ Epoch 25/25 ![Learning curves for fine-tuned pre-trained CNN][27] -微调预训练的 CNN 的学习曲线 +*微调过的预训练 CNN 的学习曲线* 让我们保存这个模型,因此我们能够在测试集上使用。 ``` -`model.save('vgg_finetuned.h5')` +model.save('vgg_finetuned.h5') ``` -这完成了我们的模型训练阶段。我们准备好在测试集上测试我们模型的性能。 +这就完成了我们的模型训练阶段。现在我们准备好了在测试集上测试我们模型的性能。 ### 深度学习模型性能评估 -我们将评估我们在训练阶段构建的三个模型,通过在我们的测试集上做预测,因为仅仅验证是不够的!我们同样构建了一个检测工具模块叫做 **model_evaluation_utils**,我们可以使用相关分类指标用来评估使用我们深度学习模型的性能。第一步是测量我们的数据集。 - +我们将通过在我们的测试集上做预测来评估我们在训练阶段构建的三个模型,因为仅仅验证是不够的!我们同样构建了一个检测工具模块叫做 `model_evaluation_utils`,我们可以使用相关分类指标用来评估使用我们深度学习模型的性能。第一步是扩展我们的数据集。 ``` test_imgs_scaled = test_data / 255. @@ -703,7 +692,6 @@ test_imgs_scaled.shape, test_labels.shape 下一步包括载入我们保存的深度学习模型,在测试集上预测。 - ``` # Load Saved Deep Learning Models basic_cnn = tf.keras.models.load_model('./basic_cnn.h5') @@ -715,16 +703,15 @@ basic_cnn_preds = basic_cnn.predict(test_imgs_scaled, batch_size=512) vgg_frz_preds = vgg_frz.predict(test_imgs_scaled, batch_size=512) vgg_ft_preds = vgg_ft.predict(test_imgs_scaled, batch_size=512) -basic_cnn_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 -for pred in basic_cnn_preds.ravel()]) -vgg_frz_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 -for pred in vgg_frz_preds.ravel()]) -vgg_ft_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 -for pred in vgg_ft_preds.ravel()]) +basic_cnn_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 + for pred in basic_cnn_preds.ravel()]) +vgg_frz_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 + for pred in vgg_frz_preds.ravel()]) +vgg_ft_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 + for pred in vgg_ft_preds.ravel()]) ``` -下一步是应用我们的 **model_evaluation_utils** 模块根据相应分类指标来检查每个模块的性能。 - +下一步是应用我们的 `model_evaluation_utils` 模块根据相应分类指标来检查每个模块的性能。 ``` import model_evaluation_utils as meu @@ -734,30 +721,30 @@ basic_cnn_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=ba vgg_frz_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=vgg_frz_pred_labels) vgg_ft_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=vgg_ft_pred_labels) -pd.DataFrame([basic_cnn_metrics, vgg_frz_metrics, vgg_ft_metrics], -index=['Basic CNN', 'VGG-19 Frozen', 'VGG-19 Fine-tuned']) +pd.DataFrame([basic_cnn_metrics, vgg_frz_metrics, vgg_ft_metrics], + index=['Basic CNN', 'VGG-19 Frozen', 'VGG-19 Fine-tuned']) ``` ![Model accuracy][28] -看起来我们的第三个模型在我们的测试集上执行的最好,给出了一个模型精确性为 96% 的 F1得分,比起上述我们早期引用的研究论文和文章中提及的复杂的模型是相当好的。 +看起来我们的第三个模型在我们的测试集上执行的最好,给出了一个模型精确性为 96% 的 F1 得分,这非常好,与我们之前提到的研究论文和文章中的更复杂的模型相当。 ### 总结 -疟疾检测不是一个简单的程序,全球的合格的人员的可获得性在样例诊断和治疗当中是一个严重的问题。我们看到一个关于疟疾的有趣的真实世界的医学影像案例。易于构建的,开源的技术利用 AI 在检测疟疾方面可以给我们最先进的精确性,因此允许 AI 对社会是有益的。 +疟疾检测不是一个简单的过程,全球的合格人员的不足在病例诊断和治疗当中是一个严重的问题。我们研究了一个关于疟疾的有趣的真实世界的医学影像案例。利用 AI 的、易于构建的、开源的技术在检测疟疾方面可以为我们提供最先进的精确性,因此使 AI 具有社会效益。 -我鼓励你检查这片文章中提到的文章和研究论文,没有它们,我就不能形成概念并写出来。如果你对运行和采纳这些技术感兴趣,本篇文章所有的代码都可以在[我的 GitHub 仓库][24]获得。记得从[官方网站][11]下载数据。 +我鼓励你查看这篇文章中提到的文章和研究论文,没有它们,我就不能形成概念并写出来。如果你对运行和采纳这些技术感兴趣,本篇文章所有的代码都可以在[我的 GitHub 仓库][24]获得。记得从[官方网站][11]下载数据。 -让我们希望在健康医疗方面更多的采纳开源的 AI 能力,使它在世界范围内变得便宜些,易用些。 +让我们希望在健康医疗方面更多的采纳开源的 AI 能力,使它在世界范围内变得更便宜、更易用。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/4/detecting-malaria-deep-learning -作者:[Dipanjan (DJ) Sarkar (Red Hat)][a] +作者:[Dipanjan (DJ) Sarkar][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8c41f4603494e63c190f9e2e1f22f5f421c3c030 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 May 2019 02:02:13 +0800 Subject: [PATCH 0571/1154] PUB:20190416 Detecting malaria with deep learning.md @warmfrog https://linux.cn/article-10891-1.html --- .../20190416 Detecting malaria with deep learning.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190416 Detecting malaria with deep learning.md (99%) diff --git a/translated/tech/20190416 Detecting malaria with deep learning.md b/published/20190416 Detecting malaria with deep learning.md similarity index 99% rename from translated/tech/20190416 Detecting malaria with deep learning.md rename to published/20190416 Detecting malaria with deep learning.md index b76bacd836..a1ce049292 100644 --- a/translated/tech/20190416 Detecting malaria with deep learning.md +++ b/published/20190416 Detecting malaria with deep learning.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10891-1.html) [#]: subject: (Detecting malaria with deep learning) [#]: via: (https://opensource.com/article/19/4/detecting-malaria-deep-learning) [#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) From 13f65c6aff277a01f81b57c1420bda8e00717ee7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 24 May 2019 08:56:25 +0800 Subject: [PATCH 0572/1154] translated --- ...s to manage personal finances in Fedora.md | 73 ------------------- ...s to manage personal finances in Fedora.md | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20190501 3 apps to manage personal finances in Fedora.md create mode 100644 translated/tech/20190501 3 apps to manage personal finances in Fedora.md diff --git a/sources/tech/20190501 3 apps to manage personal finances in Fedora.md b/sources/tech/20190501 3 apps to manage personal finances in Fedora.md deleted file mode 100644 index afa5eb889f..0000000000 --- a/sources/tech/20190501 3 apps to manage personal finances in Fedora.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 apps to manage personal finances in Fedora) -[#]: via: (https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/) -[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) - -3 apps to manage personal finances in Fedora -====== - -![][1] - -There are numerous services available on the web for managing your personal finances. Although they may be convenient, they also often mean leaving your most valuable personal data with a company you can’t monitor. Some people are comfortable with this level of trust. - -Whether you are or not, you might be interested in an app you can maintain on your own system. This means your data never has to leave your own computer if you don’t want. One of these three apps might be what you’re looking for. - -### HomeBank - -HomeBank is a fully featured way to manage multiple accounts. It’s easy to set up and keep updated. It has multiple ways to categorize and graph income and liabilities so you can see where your money goes. It’s available through the official Fedora repositories. - -![A simple account set up in HomeBank with a few transactions.][2] - -To install HomeBank, open the _Software_ app, search for _HomeBank_ , and select the app. Then click _Install_ to add it to your system. HomeBank is also available via a Flatpak. - -### KMyMoney - -The KMyMoney app is a mature app that has been around for a long while. It has a robust set of features to help you manage multiple accounts, including assets, liabilities, taxes, and more. KMyMoney includes a full set of tools for managing investments and making forecasts. It also sports a huge set of reports for seeing how your money is doing. - -![A subset of the many reports available in KMyMoney.][3] - -To install, use a software center app, or use the command line: - -``` -$ sudo dnf install kmymoney -``` - -### GnuCash - -One of the most venerable free GUI apps for personal finance is GnuCash. GnuCash is not just for personal finances. It also has functions for managing income, assets, and liabilities for a business. That doesn’t mean you can’t use it for managing just your own accounts. Check out [the online tutorial and guide][4] to get started. - -![Checking account records shown in GnuCash.][5] - -Open the _Software_ app, search for _GnuCash_ , and select the app. Then click _Install_ to add it to your system. Or use _dnf install_ as above to install the _gnucash_ package. - -It’s now available via Flathub which makes installation easy. If you don’t have Flathub support, check out [this article on the Fedora Magazine][6] for how to use it. Then you can also use the _flatpak install GnuCash_ command with a terminal. - -* * * - -*Photo by _[_Fabian Blank_][7]_ on *[ _Unsplash_][8]. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/ - -作者:[Paul W. Frields][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/pfrields/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/personal-finance-3-apps-816x345.jpg -[2]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-16-16-1024x637.png -[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-27-10-1-1024x649.png -[4]: https://www.gnucash.org/viewdoc.phtml?rev=3&lang=C&doc=guide -[5]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-41-27-1024x631.png -[6]: https://fedoramagazine.org/install-flathub-apps-fedora/ -[7]: https://unsplash.com/photos/pElSkGRA2NU?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[8]: https://unsplash.com/search/photos/money?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20190501 3 apps to manage personal finances in Fedora.md b/translated/tech/20190501 3 apps to manage personal finances in Fedora.md new file mode 100644 index 0000000000..05015d29b3 --- /dev/null +++ b/translated/tech/20190501 3 apps to manage personal finances in Fedora.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 apps to manage personal finances in Fedora) +[#]: via: (https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +3 款在 Fedora 中管理个人财务的应用 +====== + +![][1] + +网上有很多可以用来管理你个人财务的服务。虽然它们可能很方便,但这通常也意味着将你最宝贵的个人数据放在你无法监控的公司。也有些人对这些不太在意。 + +无论你是否在意,你可能会对你自己系统上的应用感兴趣。这意味着如果你不想,你的数据永远不会离开莫自己的计算机。这三款之一可能就是你想找的。 + +### HomeBank + +HomeBank 是一款可以管理多个账户的全功能软件。它很容易设置并保持更新。它有多种方式画出你的分类和负载,以便你可以看到资金流向何处。它可以通过官方 Fedora 仓库下载。 + +![A simple account set up in HomeBank with a few transactions.][2] + +要安装 HomeBank,请打开_软件中心_,搜索 _HomeBank_,然后选择该应用。单击_安装_将其添加到你的系统中。HomeBank 也可以通过 Flatpak 安装。 + +### KMyMoney + +KMyMoney 是一个成熟的应用,它已经存在了很长一段时间。它有一系列稳定的功能,可帮助你管理多个帐户,包括资产、负债、税收等。KMyMoney 包含一整套用于管理投资和进行预测的工具。它还提供大量报告,以了解你的资金运作方式。 + +![A subset of the many reports available in KMyMoney.][3] + +要安装它,请使用软件中心,或使用命令行: + +``` +$ sudo dnf install kmymoney +``` + +### GnuCash + +用于个人财务的最受欢迎的免费 GUI 应用之一是 GnuCash。GnuCash 不仅可以用于个人财务。它还有管理企业收入、资产和负债的功能。这并不意味着你不能用它来管理自己的账户。从查看[在线教程和指南][4]开始了解。 + +![Checking account records shown in GnuCash.][5] + +打开_软件中心_,搜索 _GnuCash_,然后选择应用。单击_安装_将其添加到你的系统中。或者如上所述使用 _dnf install_ 来安装 _gnucash_ 包。 + +它现在可以通过 Flathub 安装,这使得安装变得简单。如果你没有安装 Flathub,请查看 [Fedora Magazine 上的这篇文章][6]了解如何使用它。这样你也可以在终端使用 _flatpak install GnuCash_ 命令。 + +* * * + +照片由 _[_Fabian Blank_][7]_ 拍摄,发布在 [ _Unsplash_][8] 上。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/ + +作者:[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/2019/04/personal-finance-3-apps-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-16-16-1024x637.png +[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-27-10-1-1024x649.png +[4]: https://www.gnucash.org/viewdoc.phtml?rev=3&lang=C&doc=guide +[5]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-41-27-1024x631.png +[6]: https://fedoramagazine.org/install-flathub-apps-fedora/ +[7]: https://unsplash.com/photos/pElSkGRA2NU?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/money?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From e958c1116c3bdaf5460c529b06b7ae1f3c3bf5f1 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Thu, 23 May 2019 19:58:02 -0500 Subject: [PATCH 0573/1154] Apply for Translating Apply for Translating --- ... a mobile particulate matter sensor with a Raspberry Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md b/sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md index 7eea0bd556..8efc47ae76 100644 --- a/sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md +++ b/sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tomjlw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -109,7 +109,7 @@ via: https://opensource.com/article/19/3/mobile-particulate-matter-sensor 作者:[Stephan Tetzel][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tomjlw](https://github.com/tomjlw) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9128e62d0959f3733130b3da21092fe577e65d57 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 24 May 2019 09:05:45 +0800 Subject: [PATCH 0574/1154] translating --- .../tech/20190422 4 open source apps for plant-based diets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190422 4 open source apps for plant-based diets.md b/sources/tech/20190422 4 open source apps for plant-based diets.md index 6d77b66eea..2e27ab4b44 100644 --- a/sources/tech/20190422 4 open source apps for plant-based diets.md +++ b/sources/tech/20190422 4 open source apps for plant-based diets.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6bb7d6c14e00d5f0fa988301d6c02b4871968543 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 May 2019 12:27:53 +0800 Subject: [PATCH 0575/1154] PRF:20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md @tomjlw --- ...ols To Inspect And Visualize Disk Usage.md | 119 ++++++++---------- 1 file changed, 53 insertions(+), 66 deletions(-) diff --git a/translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md b/translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md index 49cc72415c..d1f3ddbb4c 100644 --- a/translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md +++ b/translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md @@ -1,51 +1,47 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Duc – A Collection Of Tools To Inspect And Visualize Disk Usage) [#]: via: (https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/) [#]: author: (sk https://www.ostechnix.com/author/sk/) -Duc——一个能够洞察并可视化硬盘使用情况的工具包 +Duc:一个能够可视化洞察硬盘使用情况的工具包 ====== -![Duc——一个能够洞察并可视化硬盘使用情况的工具包][1] +![Duc:一个能够洞察并可视化硬盘使用情况的工具包][1] -**Duc** 是一个在类 Unix 操作系统上可以用来索引、洞察及可视化硬盘使用情况的工具包。别把它当成一个仅能用漂亮图表展现硬盘使用情况的 CLI 工具。它被设计成在巨大的文件系统上也可以延展得很好。Duc 已在由超过五亿个文件和几 PB 的存储组成的系统上测试过,没有任何问题。 +Duc 是一个在类 Unix 操作系统上可以用来索引、洞察及可视化硬盘使用情况的工具包。别把它当成一个仅能用漂亮图表展现硬盘使用情况的 CLI 工具。它对巨大的文件系统也支持的很好。Duc 已在由超过五亿个文件和几 PB 的存储组成的系统上测试过,没有任何问题。 -Duc 是一个快速而且多变的工具。它将你的硬盘使用情况存在一个优化过的数据库里,这样你就可以在索引完成后迅速找到你的数据。此外,它自带不同的用户交互界面与后端以访问数据库并绘制图表。 +Duc 是一个快速而且灵活的工具。它将你的硬盘使用情况存在一个优化过的数据库里,这样你就可以在索引完成后迅速找到你的数据。此外,它自带不同的用户交互界面与后端以访问数据库并绘制图表。 以下列出的是目前支持的用户界面(UI): - 1. 命令行界面 (ls), - 2. Ncurses 控制台界面 (ui), - 3. X11 GUI (duc gui), - 4. OpenGL GUI (duc gui)。 - - + 1. 命令行界面(`duc ls`) + 2. Ncurses 控制台界面(`duc ui`) + 3. X11 GUI(`duc gui`) + 4. OpenGL GUI(`duc gui`) 支持的后端数据库: - * Tokyocabinet, - * Leveldb, - * Sqlite3. + * Tokyocabinet + * Leveldb + * Sqlite3 - - -Duc 使用 **Tokyocabinet** 作为默认的后端数据库。 +Duc 默认使用 Tokyocabinet 作为后端数据库。 ### 安装 Duc -Duc 可以从 Debian 以及其衍生品例如 Ubuntu 的默认仓库中获取。因此在基于 DEB 的系统上安装 Duc 小菜一碟。 +Duc 可以从 Debian 以及其衍生品例如 Ubuntu 的默认仓库中获取。因此在基于 DEB 的系统上安装 Duc 是小菜一碟。 ``` $ sudo apt-get install duc ``` -在其它 Linux 发行版上你需要像以下所展示的那样手动从源编译安装 Duc。 +在其它 Linux 发行版上你需要像以下所展示的那样手动从源代码编译安装 Duc。 -从 github 上的[**发行**][2]页面下载最新的 Duc 源 .tgz 文件。在写这篇教程的时候,最新的版本是**1.4.4**。 +可以从 Github 上的[发行][2]页面下载最新的 Duc 源代码的 .tgz 文件。在写这篇教程的时候,最新的版本是1.4.4。 ``` $ wget https://github.com/zevv/duc/releases/download/1.4.4/duc-1.4.4.tar.gz @@ -63,19 +59,19 @@ $ sudo make install ### 使用 Duc -duc 的典型用法是: +`duc` 的典型用法是: ``` $ duc ``` -你可以通过运行以下命令来浏览总的选项列表以及副命令: +你可以通过运行以下命令来浏览总的选项列表以及子命令: ``` $ duc help ``` -你也可以像下面这样了解一个特定副命令的用法。 +你也可以像下面这样了解一个特定子命令的用法。 ``` $ duc help @@ -87,23 +83,23 @@ $ duc help $ duc help --all ``` -让我们看看一些 duc 工具的特定用法。 +让我们看看一些 `duc` 工具的特定用法。 ### 创建索引(数据库) -首先,你需要创建一个你文件系统的索引文件(数据库)。使用“duc index”命令以创建索引文件。 +首先,你需要创建一个你文件系统的索引文件(数据库)。使用 `duc index` 命令以创建索引文件。 -比如说,要创建你的 **/home** 目录的索引,仅需运行: +比如说,要创建你的 `/home` 目录的索引,仅需运行: ``` $ duc index /home ``` -上述命令将会创建你的 /home/ 目录的索引并将其保存在 **$HOME/.duc.db** 文件中。如果你以后需要往 /home 目录添加新的文件/目录,只要在之后重新运行一下上面的命令来重建索引。 +上述命令将会创建你的 `/home` 目录的索引,并将其保存在 `$HOME/.duc.db` 文件中。如果你以后需要往 `/home` 目录添加新的文件或目录,只要在之后重新运行一下上面的命令来重建索引。 ### 查询索引 -Duc 有不同的副命令来查询并探索索引。 +Duc 有不同的子命令来查询并探索索引。 要查看可访问的索引列表,运行: @@ -111,14 +107,14 @@ Duc 有不同的副命令来查询并探索索引。 $ duc info ``` -**示例输出:** +示例输出: ``` -日期 时间 文件 目录 大小 路径 +Date Time Files Dirs Size Path 2019-04-09 15:45:55 3.5K 305 654.6M /home ``` -如你在上述输出所见,我已经索引好了 /home 目录。 +如你在上述输出所见,我已经索引好了 `/home` 目录。 要列出当前工作目录中所有的文件和目录,你可以这样做: @@ -126,27 +122,27 @@ $ duc info $ duc ls ``` -要列出所提供目录例如 **/home/sk/Downloads** 中的文件/目录,仅需像下面这样将路径作为参数传过去。 +要列出指定的目录,例如 `/home/sk/Downloads` 中的文件/目录,仅需像下面这样将路径作为参数传过去。 ``` $ duc ls /home/sk/Downloads ``` -类似的,运行**“duc ui”**命令来打开基于 **ncurses** 的控制台用户界面以探索文件系统使用情况,运行**“duc gui”**以打开 **graphical (X11)** 界面来探索文件系统。 +类似的,运行 `duc ui` 命令来打开基于 ncurses 的控制台用户界面以探索文件系统使用情况,运行`duc gui` 以打开图形界面(X11)来探索文件系统。 -要了解更多副命令的用法,仅需参考帮助部分。 +要了解更多子命令的用法,仅需参考帮助部分。 ``` $ duc help ls ``` -上述命令将会展现 “ls” 副命令的帮助部分。 +上述命令将会展现 `ls` 子命令的帮助部分。 ### 可视化硬盘使用状况 -在之前的部分我们以及看到如何用 duc 副命令列出文件和目录。在此之外,你甚至可以用一张漂亮的图表展示文件大小。 +在之前的部分我们以及看到如何用 duc 子命令列出文件和目录。在此之外,你甚至可以用一张漂亮的图表展示文件大小。 -要展示所提供目录的图表,像以下这样使用“ls”副命令。 +要展示所提供目录的图表,像以下这样使用 `ls` 子命令。 ``` $ duc ls -Fg /home/sk @@ -156,13 +152,13 @@ $ duc ls -Fg /home/sk ![使用 “duc ls” 命令可视化硬盘使用情况][3] -如你在上述输出所见,“ls”副命令查询 duc 数据库并列出了所提供目录,在这里就是 **/home/sk/**,所包含的文件与目录的大小。 +如你在上述输出所见,`ls` 子命令查询 duc 数据库并列出了所提供目录包含的文件与目录的大小,在这里就是 `/home/sk/`。 -这里 **-F** 选项是往条目中用来添加文件类型显示(*/之一),**-g** 选项是用来绘制每个条目相对大小的图表。 +这里 `-F` 选项是往条目中用来添加文件类型指示符(`/`),`-g` 选项是用来绘制每个条目相对大小的图表。 -请注意如果未提供任何路径,当前工作目录就会被探索。 +请注意如果未提供任何路径,就会使用当前工作目录。 -你可以使用 **-R** 选项来用[**树状结构**][4]浏览硬盘使用情况。 +你可以使用 `-R` 选项来用[树状结构][4]浏览硬盘使用情况。 ``` $ duc ls -R /home/sk @@ -170,7 +166,7 @@ $ duc ls -R /home/sk ![用树状结构可视化硬盘使用情况][5] -要查询 duc 数据库并打开基于 **ncurses** 的控制台以探索所提供的目录,像以下这样使用**“ui”**副命令。 +要查询 duc 数据库并打开基于 ncurses 的控制台以探索所提供的目录,像以下这样使用 `ui` 子命令。 ``` $ duc ui /home/sk @@ -178,7 +174,7 @@ $ duc ui /home/sk ![][6] -类似的,我们使用**“gui”* 副命令来查询 duc 数据库以及打开一个 **graphical (X11)** 界面来探索提供路径的硬盘使用情况。 +类似的,我们使用 `gui *` 子命令来查询 duc 数据库以及打开一个图形界面(X11)来了解指定路径的硬盘使用情况。 ``` $ duc gui /home/sk @@ -186,47 +182,38 @@ $ duc gui /home/sk ![][7] -像我之前所提到的,我们可以像下面这样了解更多关于特定副命令的用法。 +像我之前所提到的,我们可以像下面这样了解更多关于特定子命令的用法。 ``` -$ duc help <副命令名字> +$ duc help <子命令名字> ``` -我仅仅覆盖了基本用法的部分,参考 man 页面了解关于“duc”工具的更多细节。 +我仅仅覆盖了基本用法的部分,参考 man 页面了解关于 `duc` 工具的更多细节。 ``` $ man duc ``` -* * * +相关阅读: -**相关阅读:** - - * [**Filelight – 在你的 Linux 系统上可视化硬盘使用情况**][8] - * [**一些好的‘du’命令的替代品**][9] - * [**如何在 Linux 中用 Ncdu 检查硬盘使用情况**][10] - * [**Agedu——发现 Linux 中被浪费的硬盘空间**][11] - * [**如何在 Linux 中找到目录大小**][12] - * [**为初学者打造的带有示例的 df 命令教程**][13] - - - -* * * + * [Filelight – 在你的 Linux 系统上可视化硬盘使用情况][8] + * [一些好的 du 命令的替代品][9] + * [如何在 Linux 中用 Ncdu 检查硬盘使用情况][10] + * [Agedu——发现 Linux 中被浪费的硬盘空间][11] + * [如何在 Linux 中找到目录大小][12] + * [为初学者打造的带有示例的 df 命令教程][13] ### 总结 -Duc 是一款简单却有用的硬盘使用查看器。如果你想要快速简便地知道哪个文件/目录占用你的硬盘空间,Duc 可能是一个好的选择。你还等什么呢?获取这个工具,扫描你的文件系统,摆脱无用的文件/目录。 +Duc 是一款简单却有用的硬盘用量查看器。如果你想要快速简便地知道哪个文件/目录占用你的硬盘空间,Duc 可能是一个好的选择。你还等什么呢?获取这个工具,扫描你的文件系统,摆脱无用的文件/目录。 现在就到此为止了。希望这篇文章有用处。更多好东西马上就到。保持关注! 欢呼吧! -**资源:** - - - * [**Duc 网站**][14] - +资源: + * [Duc 网站][14] -------------------------------------------------------------------------------- @@ -235,7 +222,7 @@ via: https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualiz 作者:[sk][a] 选题:[lujun9972][b] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e8d0b466979e389aba22c1ab57a085ec0923bc83 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 May 2019 12:29:03 +0800 Subject: [PATCH 0576/1154] PUB:20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md @tomjlw https://linux.cn/article-10892-1.html --- ...Collection Of Tools To Inspect And Visualize Disk Usage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md (99%) diff --git a/translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md b/published/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md similarity index 99% rename from translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md rename to published/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md index d1f3ddbb4c..13d10c9c57 100644 --- a/translated/tech/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md +++ b/published/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10892-1.html) [#]: subject: (Duc – A Collection Of Tools To Inspect And Visualize Disk Usage) [#]: via: (https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 07c6fd1e93aa40a8ba0772870d33a7a08acf8c17 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Fri, 24 May 2019 16:31:51 +0800 Subject: [PATCH 0577/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...80429 The Easiest PDO Tutorial (Basics).md | 173 ------------------ ...80429 The Easiest PDO Tutorial (Basics).md | 170 +++++++++++++++++ 2 files changed, 170 insertions(+), 173 deletions(-) delete mode 100644 sources/tech/20180429 The Easiest PDO Tutorial (Basics).md create mode 100644 translated/tech/20180429 The Easiest PDO Tutorial (Basics).md diff --git a/sources/tech/20180429 The Easiest PDO Tutorial (Basics).md b/sources/tech/20180429 The Easiest PDO Tutorial (Basics).md deleted file mode 100644 index b6a76a27aa..0000000000 --- a/sources/tech/20180429 The Easiest PDO Tutorial (Basics).md +++ /dev/null @@ -1,173 +0,0 @@ -Translating by MjSeven - - -The Easiest PDO Tutorial (Basics) -====== - -![](http://www.theitstuff.com/wp-content/uploads/2018/04/php-language.jpg) - -Approximately 80% of the web is powered by PHP. And similarly, high number goes for SQL as well. Up until PHP version 5.5, we had the **mysql_** commands for accessing mysql databases but they were eventually deprecated due to insufficient security. - -This happened with PHP 5.5 in 2013 and as I write this article, the year is 2018 and we are on PHP 7.2. The deprecation of mysql**_** brought 2 major ways of accessing the database, the **mysqli** and the **PDO** libraries. - -Now though the mysqli library was the official successor, PDO gained more fame due to a simple reason that mysqli could only support mysql databases whereas PDO could support 12 different types of database drivers. Also, PDO had several more features that made it the better choice for most developers. You can see some of the feature comparisons in the table below; - -| | PDO | MySQLi | -| Database support** | 12 drivers | Only MySQL | -| Paradigm | OOP | Procedural + OOP | -| Prepared Statements Client Side) | Yes | No | -| Named Parameters | Yes | No | - -Now I guess it is pretty clear why PDO is the choice for most developers, so let’s dig into it and hopefully we will try to cover most of the PDO you need in this article itself. - -### Connection - -The first step is connecting to the database and since PDO is completely Object Oriented, we will be using the instance of a PDO class. - -The first thing we do is we define the host, database name, user, password and the database charset. - -`$host = 'localhost';` - -`$db = 'theitstuff';` - -`$user = 'root';` - -`$pass = 'root';` - -`$charset = 'utf8mb4';` - -`$dsn = "mysql:host=$host;dbname=$db;charset=$charset";` - -`$conn = new PDO($dsn, $user, $pass);` - -After that, as you can see in the code above we have created the **DSN** variable, the DSN variable is simply a variable that holds the information about the database. For some people running mysql on external servers, you could also adjust your port number by simply supplying a **port=$port_number**. - -Finally, you can create an instance of the PDO class, I have used the **$conn** variable and I have supplied the **$dsn, $user, $pass** parameters. If you have followed this, you should now have an object named $conn that is an instance of the PDO connection class. Now it’s time to get into the database and run some queries. - -### A simple SQL Query - -Let us now run a simple SQL query. - -`$tis = $conn->query('SELECT name, age FROM students');` - -`while ($row = $tis->fetch())` - -`{` - -`echo $row['name']."\t";` - -`echo $row['age'];` - -`echo "
";` - -`}` - -This is the simplest form of running a query with PDO. We first created a variable called **tis( **short for TheITStuff** )** and then you can see the syntax as we used the query function from the $conn object that we had created. - -We then ran a while loop and created a **$row** variable to fetch the contents from the **$tis** object and finally echoed out each row by calling out the column name. - -Easy wasn’t it ?. Now let’s get to the prepared statement. - -### Prepared Statements - -Prepared statements were one of the major reasons people started using PDO as it had prepared statements that could prevent SQL injections. - -There are 2 basic methods available, you could either use positional or named parameters. - -#### Position parameters - -Let us see an example of a query using positional parameters. - -`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)");` - -`$tis->bindValue(1,'mike');` - -`$tis->bindValue(2,22);` - -`$tis->execute();` - -In the above example, we have placed 2 question marks and later used the **bindValue()** function to map the values into the query. The values are bound to the position of the question mark in the statement. - -I could also use variables instead of directly supplying values by using the **bindParam()** function and example for the same would be this. - -`$name='Rishabh'; $age=20;` - -`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)");` - -`$tis->bindParam(1,$name);` - -`$tis->bindParam(2,$age);` - -`$tis->execute();` - -### Named Parameters - -Named parameters are also prepared statements that map values/variables to a named position in the query. Since there is no positional binding, it is very efficient in queries that use the same variable multiple time. - -`$name='Rishabh'; $age=20;` - -`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(:name, :age)");` - -`$tis->bindParam(':name', $name);` - -`$tis->bindParam(':age', $age);` - -`$tis->execute();` - -The only change you can notice is that I used **:name** and **:age** as placeholders and then mapped variables to them. The colon is used before the parameter and it is of extreme importance to let PDO know that the position is for a variable. - -You can similarly use **bindValue()** to directly map values using Named parameters as well. - -### Fetching the Data - -PDO is very rich when it comes to fetching data and it actually offers a number of formats in which you can get the data from your database. - -You can use the **PDO::FETCH_ASSOC** to fetch associative arrays, **PDO::FETCH_NUM** to fetch numeric arrays and **PDO::FETCH_OBJ** to fetch object arrays. - -`$tis = $conn->prepare("SELECT * FROM STUDENTS");` - -`$tis->execute();` - -`$result = $tis->fetchAll(PDO::FETCH_ASSOC);` - -You can see that I have used **fetchAll** since I wanted all matching records. If only one row is expected or desired, you can simply use **fetch.** - -Now that we have fetched the data it is time to loop through it and that is extremely easy. - -`foreach($result as $lnu){` - -`echo $lnu['name'];` - -`echo $lnu['age']."
";` - -`}` - -You can see that since I had requested associative arrays, I am accessing individual members by their names. - -Though there is absolutely no problem in defining how you want your data delivered, you could actually set one as default when defining the connection variable itself. - -All you need to do is create an options array where you put in all your default configs and simply pass the array in the connection variable. - -`$options = [` - -` PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,` - -`];` - -`$conn = new PDO($dsn, $user, $pass, $options);` - -This was a very brief and quick intro to PDO we will be making an advanced tutorial soon. If you had any difficulties understanding any part of the tutorial, do let me know in the comment section and I’ll be there for you. - - --------------------------------------------------------------------------------- - -via: http://www.theitstuff.com/easiest-pdo-tutorial-basics - -作者:[Rishabh Kandari][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.theitstuff.com/author/reevkandari diff --git a/translated/tech/20180429 The Easiest PDO Tutorial (Basics).md b/translated/tech/20180429 The Easiest PDO Tutorial (Basics).md new file mode 100644 index 0000000000..df3e8581e3 --- /dev/null +++ b/translated/tech/20180429 The Easiest PDO Tutorial (Basics).md @@ -0,0 +1,170 @@ +最简单的 PDO 教程(基础知识) +====== + +![](http://www.theitstuff.com/wp-content/uploads/2018/04/php-language.jpg) + +大约 80% 的 Web 应用程序由 PHP 提供支持。类似地,SQL 也是如此。PHP 5.5 版本之前,我们有用于访问 mysql 数据库的 **mysql_** 命令,但由于安全性不足,它们最终被弃用。 + +**这发生在 2013 年的 PHP 5.5 上,我写这篇文章的时间是 2018 年,PHP 版本为 7.2。mysql_** 的弃用带来了访问数据库的两种主要方法:**mysqli** 和 **PDO** 库。 + +虽然 mysqli 库是官方指定的,但由于 mysqli 只能支持 mysql 数据库,而 PDO 可以支持 12 种不同类型的数据库驱动程序,因此 PDO 获得了更多的赞誉。此外,PDO 还有其它一些特性,使其成为大多数开发人员的更好选择。你可以在下表中看到一些特性比较: + +| | PDO | MySQLi +---|---|--- +| **数据库支持** | 12 种驱动 | 只有 MySQL +| **范例** | OOP | 过程 + OOP +| **预处理语句(客户端侧)** | Yes | No +| **命名参数** | Yes | No + +现在我想对于大多数开发人员来说,PDO 是首选的原因已经很清楚了。所以让我们深入研究它,并希望在本文中尽量涵盖关于 PDO 你需要的了解的。 + +### 连接 + +第一步是连接到数据库,由于 PDO 是完全面向对象的,所以我们将使用 PDO 类的实例。 + +我们要做的第一件事是定义主机、数据库名称、用户名、密码和数据库字符集。 + +`$host = 'localhost';` + +`$db = 'theitstuff';` + +`$user = 'root';` + +`$pass = 'root';` + +`$charset = 'utf8mb4';` + +`$dsn = "mysql:host=$host;dbname=$db;charset=$charset";` + +`$conn = new PDO($dsn, $user, $pass);` + +之后,正如你在上面的代码中看到的,我们创建了 **DSN** 变量,DSN 变量只是一个保存数据库信息的变量。对于一些在外部服务器上运行 mysql 的人,你还可以通过提供一个 **port=$port_number** 来调整端口号。 + +最后,你可以创建一个 PDO 类的实例,我使用了 **\$conn** 变量,并提供了 **\$dsn、\$user、\$pass** 参数。如果你遵循这些步骤,你现在应该有一个名为 $conn 的对象,它是 PDO 连接类的一个实例。现在是时候进入数据库并运行一些查询。 + +### 一个简单的 SQL 查询 + +现在让我们运行一个简单的 SQL 查询。 + +`$tis = $conn->query('SELECT name, age FROM students');` + +`while ($row = $tis->fetch())` + +`{` + +`echo $row['name']."\t";` + +`echo $row['age'];` + +`echo "
";` + +`}` + +这是使用 PDO 运行查询的最简单形式。我们首先创建了一个名为 **tis(TheITStuff 的缩写 )** 的变量,然后你可以看到我们使用了创建的 $conn 对象中的查询函数。 + +然后我们运行一个 while 循环并创建了一个 **$row** 变量来从 **$tis** 对象中获取内容,最后通过调用列名来显示每一行。 + +很简单,不是吗?现在让我们来看看预处理语句。 + +### 预处理语句 + +预处理语句是人们开始使用 PDO 的主要原因之一,因为它准备了可以阻止 SQL 注入的语句。 + +有两种基本方法可供使用,你可以使用位置参数或命名参数。 + +#### 位置参数 + +让我们看一个使用位置参数的查询示例。 + +`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)");` + +`$tis->bindValue(1,'mike');` + +`$tis->bindValue(2,22);` + +`$tis->execute();` + +在上面的例子中,我们放置了两个问号,然后使用 **bindValue()** 函数将值映射到查询中。这些值绑定到语句问号中的位置。 + +我还可以使用变量而不是直接提供值,通过使用 **bindParam()** 函数相同例子如下: + +`$name='Rishabh'; $age=20;` + +`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)");` + +`$tis->bindParam(1,$name);` + +`$tis->bindParam(2,$age);` + +`$tis->execute();` + +### 命名参数 + +命名参数也是预处理语句,它将值/变量映射到查询中的命名位置。由于没有位置绑定,因此在多次使用相同变量的查询中非常有效。 + +`$name='Rishabh'; $age=20;` + +`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(:name, :age)");` + +`$tis->bindParam(':name', $name);` + +`$tis->bindParam(':age', $age);` + +`$tis->execute();` + +你可以注意到,唯一的变化是我使用 **:name** 和 **:age** 作为占位符,然后将变量映射到它们。冒号在参数之前使用,让 PDO 知道该位置是一个变量,这非常重要。 + +你也可以类似地使用 **bindValue()** 来使用命名参数直接映射值。 + +### 获取数据 + +PDO 在获取数据时非常丰富,它实际上提供了许多格式来从数据库中获取数据。 + +你可以使用 **PDO::FETCH_ASSOC** 来获取关联数组,**PDO::FETCH_NUM** 来获取数字数组,使用 **PDO::FETCH_OBJ** 来获取对象数组。 + +`$tis = $conn->prepare("SELECT * FROM STUDENTS");` + +`$tis->execute();` + +`$result = $tis->fetchAll(PDO::FETCH_ASSOC);` + +你可以看到我使用了 **fetchAll**,因为我想要所有匹配的记录。如果只需要一行,你可以简单地使用 **fetch**。 + +现在我们已经获取了数据,现在是时候循环它了,这非常简单。 + +`foreach($result as $lnu){` + +`echo $lnu['name'];` + +`echo $lnu['age']."
";` + +`}` + +你可以看到,因为我请求了关联数组,所以我正在按名称访问各个成员。 + +虽然在定义希望如何传输递数据方面没有要求,但在定义 conn 变量本身时,实际上可以将其设置为默认值。 + +你需要做的就是创建一个 options 数组,你可以在其中放入所有默认配置,只需在 conn 变量中传递数组即可。 + +`$options = [` + +` PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,` + +`];` + +`$conn = new PDO($dsn, $user, $pass, $options);` + +这是一个非常简短和快速的 PDO 介绍,我们很快就会制作一个高级教程。如果你在理解本教程的任何部分时遇到任何困难,请在评论部分告诉我,我会在那你为你解答。 + +-------------------------------------------------------------------------------- + +via: http://www.theitstuff.com/easiest-pdo-tutorial-basics + +作者:[Rishabh Kandari][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.theitstuff.com/author/reevkandari From 377d7b8fdf901e797534f4a8734b52cf89820b89 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 May 2019 19:10:53 +0800 Subject: [PATCH 0578/1154] PRF:20190520 PiShrink - Make Raspberry Pi Images Smaller.md @geekpi --- ...rink - Make Raspberry Pi Images Smaller.md | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md b/translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md index 11ba537a1e..c23b088901 100644 --- a/translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md +++ b/translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md @@ -1,18 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (PiShrink – Make Raspberry Pi Images Smaller) [#]: via: (https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/) [#]: author: (sk https://www.ostechnix.com/author/sk/) -PiShrink - 使树莓派镜像更小 +PiShrink:使树莓派镜像更小 ====== ![Make Raspberry Pi Images Smaller With PiShrink In Linux][1] -**树莓派**不需要过多介绍。它是一款小巧、价格实惠,只有信用卡大小的电脑,它可以连接到显示器或电视。我们可以连接一个标准的键盘和鼠标,并将其用作一台成熟的台式计算机来完成日常任务,如互联网浏览、播放视频/玩游戏、文字处理和电子表格制作等。它主要是为学校的计算机科学教学而开发的。如今,树莓派被广泛用于大学、中小型组织和研究所来教授编码。如果你有一台树莓派,你可能需要了解一个名为 **“PiShrink”** 的 bash 脚本,该脚本可使树莓派镜像更小。PiShrink 将自动缩小镜像,然后在启动时将其调整为 SD 卡的最大大小。这能更快地将镜像复制到 SD 卡中,同时缩小的镜像将更好地压缩。这对于将大容量镜像放入 SD 卡非常有用。在这个简短的指南中,我们将学习如何在类 Unix 系统中将树莓派镜像缩小到更小的大小。 +树莓派不需要过多介绍。它是一款小巧、价格实惠,只有信用卡大小的电脑,它可以连接到显示器或电视。我们可以连接一个标准的键盘和鼠标,并将其用作一台成熟的台式计算机来完成日常任务,如互联网浏览、播放视频/玩游戏、文字处理和电子表格制作等。它主要是为学校的计算机科学教学而开发的。如今,树莓派被广泛用于大学、中小型组织和研究所来教授编码。 + +如果你有一台树莓派,你可能需要了解一个名为 PiShrink 的 bash 脚本,该脚本可使树莓派镜像更小。PiShrink 将自动缩小镜像,然后在启动时将其调整为 SD 卡的最大大小。这能更快地将镜像复制到 SD 卡中,同时缩小的镜像将更好地压缩。这对于将大容量镜像放入 SD 卡非常有用。在这个简短的指南中,我们将学习如何在类 Unix 系统中将树莓派镜像缩小到更小。 ### 安装 PiShrink @@ -36,8 +38,7 @@ $ sudo mv pishrink.sh /usr/local/bin/ ### 使树莓派镜像更小 -你可能已经知道,**Raspbian** 是所有树莓派型号的官方操作系统。树莓派基金会为 PC 和 Mac 开发了**树莓派桌面**版本。你可以创建 live CD,并在虚拟机中运行它,甚至也可以将其安装在桌面上。树莓派也有少量非官方​​操作系统镜像。为了测试,我从[**官方下载页面**][2]下载了官方的 Raspbian 系统。 - +你可能已经知道,Raspbian 是所有树莓派型号的官方操作系统。树莓派基金会为 PC 和 Mac 开发了树莓派桌面版本。你可以创建一个 live CD,并在虚拟机中运行它,甚至也可以将其安装在桌面上。树莓派也有少量非官方​​操作系统镜像。为了测试,我从[官方下载页面][2]下载了官方的 Raspbian 系统。 解压下载的系统镜像: @@ -45,7 +46,7 @@ $ sudo mv pishrink.sh /usr/local/bin/ $ unzip 2019-04-08-raspbian-stretch-lite.zip ``` -上面的命令将提取当前目录中 **2019-04-08-raspbian-stretch-lite.zip** 文件的内容。 +上面的命令将提取当前目录中 `2019-04-08-raspbian-stretch-lite.zip` 文件的内容。 让我们看下提取文件的实际大小: @@ -54,7 +55,7 @@ $ du -h 2019-04-08-raspbian-stretch-lite.img 1.7G 2019-04-08-raspbian-stretch-lite.img ``` -如你所见,提取的树莓派系统镜像大小为 **1.7G**。 +如你所见,提取的树莓派系统镜像大小为 1.7G。 现在,使用 PiShrink 缩小此文件的大小,如下所示: @@ -79,29 +80,23 @@ The filesystem on /dev/loop1 is now 280763 (4k) blocks long. Shrunk 2019-04-08-raspbian-stretch-lite.img from 1.7G to 1.2G ``` -[![Make Raspberry Pi Images Smaller Using PiShrink][1]][3] +正如你在上面的输出中看到的,树莓派镜像的大小已减少到 1.2G。 -使用 PiShrink 使树莓派镜像更小 - -正如你在上面的输出中看到的,树莓派镜像的大小已减少到 **1.2G**。 - -你还可以使用 **-s** 标志跳过该过程的自动扩展部分。 +你还可以使用 `-s` 标志跳过该过程的自动扩展部分。 ``` $ sudo pishrink.sh -s 2019-04-08-raspbian-stretch-lite.img newpi.img ``` -这将创建一个源镜像文件(即 2019-04-08-raspbian-stretch-lite.img)的副本到一个新镜像文件(newpi.img)并进行处理。有关更多详细信息,请查看最后给出的官方 GitHub 页面。 +这将创建一个源镜像文件(即 `2019-04-08-raspbian-stretch-lite.img`)的副本到一个新镜像文件(`newpi.img`)并进行处理。有关更多详细信息,请查看最后给出的官方 GitHub 页面。 就是这些了。希望本文有用。还有更多好东西,敬请期待! -**资源:** - - * [**PiShrink 的 GitHub 仓库**][4] - * [**树莓派网站**][5] - +资源: + * [PiShrink 的 GitHub 仓库][4] + * [树莓派网站][5] -------------------------------------------------------------------------------- @@ -110,7 +105,7 @@ via: https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/ 作者:[sk][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/) 荣誉推出 From 8ea8f3386f7a1ecd5896c0f9ff0ba9673e7f49ec Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 May 2019 19:11:29 +0800 Subject: [PATCH 0579/1154] PUB:20190520 PiShrink - Make Raspberry Pi Images Smaller.md @geekpi https://linux.cn/article-10894-1.html --- .../20190520 PiShrink - Make Raspberry Pi Images Smaller.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190520 PiShrink - Make Raspberry Pi Images Smaller.md (98%) diff --git a/translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md b/published/20190520 PiShrink - Make Raspberry Pi Images Smaller.md similarity index 98% rename from translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md rename to published/20190520 PiShrink - Make Raspberry Pi Images Smaller.md index c23b088901..3913d663df 100644 --- a/translated/tech/20190520 PiShrink - Make Raspberry Pi Images Smaller.md +++ b/published/20190520 PiShrink - Make Raspberry Pi Images Smaller.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10894-1.html) [#]: subject: (PiShrink – Make Raspberry Pi Images Smaller) [#]: via: (https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 06bd938ade1bc1498d4e068561ec7a75cbe13b5e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 May 2019 19:27:11 +0800 Subject: [PATCH 0580/1154] PRF:20190503 Check your spelling at the command line with Ispell.md @geekpi --- ...pelling at the command line with Ispell.md | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/translated/tech/20190503 Check your spelling at the command line with Ispell.md b/translated/tech/20190503 Check your spelling at the command line with Ispell.md index 1bc80a0019..1d119ba85b 100644 --- a/translated/tech/20190503 Check your spelling at the command line with Ispell.md +++ b/translated/tech/20190503 Check your spelling at the command line with Ispell.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Check your spelling at the command line with Ispell) @@ -9,10 +9,12 @@ 使用 Ispell 在命令行中检查拼写 ====== -Ispell 可以帮助你在纯文本中消除超过 50 种语言的拼写错误。 -![Command line prompt][1] -好的拼写是一种技巧。它是一项需要时间学习和掌握的技能。也就是说,有些人从来没有完全掌握这种技能,我知道有两三个出色的作家无法完全掌握拼写。 +> Ispell 可以帮助你在纯文本中消除超过 50 种语言的拼写错误。 + +![Command line prompt](https://img.linux.net.cn/data/attachment/album/201905/24/192644wqqv6d0lztmqoqyl.jpg) + +好的拼写是一种技巧。它是一项需要时间学习和掌握的技能。也就是说,有些人从来没有完全掌握这种技能,我知道有两三个出色的作家就无法完全掌握拼写。 即使你拼写得很好,偶尔也会输入错字。特别是在最后期限前如果你快速敲击键盘,那就更是如此。无论你的拼写的是什么,通过拼写检查器检查你所写的内容总是一个好主意。 @@ -20,9 +22,9 @@ Ispell 可以帮助你在纯文本中消除超过 50 种语言的拼写错误。 ### 入门 -自 1971 年以来,Ispell 以各种形式出现过。不要被它的年龄欺骗。Ispell 仍然是一个可以在 21 世纪高效使用的应用。 +自 1971 年以来,Ispell 就以各种形式出现过。不要被它的年龄欺骗。Ispell 仍然是一个可以在 21 世纪高效使用的应用。 -在开始之前,请打开终端窗口并输入**which ispell** 来检查计算机上是否安装了 Ispell。如果未安装,请打开发行版的软件包管理器并从那里安装 Ispell。 +在开始之前,请打开终端窗口并输入 `which ispell` 来检查计算机上是否安装了 Ispell。如果未安装,请打开发行版的软件包管理器并从那里安装 Ispell。 不要忘记为你使用的语言安装词典。我唯一使用的语言是英语,所以我只需下载美国和英国英语字典。你可以不局限于我的(也是唯一的)母语。Ispell 有[超过 50 种语言的词典][5]。 @@ -32,27 +34,27 @@ Ispell 可以帮助你在纯文本中消除超过 50 种语言的拼写错误。 如果你还没有猜到,Ispell 只能用在文本文件。这包括用 HTML、LaTeX 和 [nroff 或 troff][7] 标记的文档。之后会有更多相关内容。 -要开始使用,请打开终端窗口并进入包含要运行拼写检查的文件的目录。输入 **ispell** 后跟文件名,然后按回车键。 +要开始使用,请打开终端窗口并进入包含要运行拼写检查的文件的目录。输入 `ispell` 后跟文件名,然后按回车键。 ![Checking spelling with Ispell][8] -Ispell 高亮了它无法识别的第一个词。如果单词拼写错误,Ispell 通常会提供一个或多个备选方案。按下 **R**,然后按下正确选择旁边的数字。在上面的截图中,我按了 **R** 和 **0** 来修复错误。 +Ispell 高亮了它无法识别的第一个词。如果单词拼写错误,Ispell 通常会提供一个或多个备选方案。按下 `R`,然后按下正确选择旁边的数字。在上面的截图中,我按了 `R` 和 `0` 来修复错误。 -另一方面,如果单词拼写正确,请按下 **A** 然后移动到下一个拼写错误的单词。 +另一方面,如果单词拼写正确,请按下 `A` 然后移动到下一个拼写错误的单词。 -继续这样做直到到达文件的末尾。Ispell 会保存你的更改,创建你刚检查的文件的备份(扩展名为 _.bak_),然后关闭。 +继续这样做直到到达文件的末尾。Ispell 会保存你的更改,创建你刚检查的文件的备份(扩展名为 `.bak`),然后关闭。 ### 其他几个选项 -此示例说明了 Ispell 的基本用法。这个程序有[很多选项][9],有些你_可能_会用到,而另一些你_可能永远_不会使用。让我们快速看下我经常使用的一些。 +此示例说明了 Ispell 的基本用法。这个程序有[很多选项][9],有些你*可能*会用到,而另一些你*可能永远*不会使用。让我们快速看下我经常使用的一些。 -之前我提到过 Ispell 可以用于某些标记语言。你需要告诉它文件的格式。启动 Ispell 时,为 TeX 或 LaTeX 文件添加 **-t**,为 HTML 文件添加 **-H**,对于 groff 或 troff 文件添加 **-n**。例如,如果输入 **ispell -t myReport.tex**,Ispell 将忽略所有标记。 +之前我提到过 Ispell 可以用于某些标记语言。你需要告诉它文件的格式。启动 Ispell 时,为 TeX 或 LaTeX 文件添加 `-t`,为 HTML 文件添加 `-H`,对于 groff 或 troff 文件添加 `-n`。例如,如果输入 `ispell -t myReport.tex`,Ispell 将忽略所有标记。 -如果你不想在检查文件后创建备份文件,请将 **-x** 添加到命令行。例如,**ispell -x myFile.txt**。 +如果你不想在检查文件后创建备份文件,请将 `-x` 添加到命令行。例如,`ispell -x myFile.txt`。 -如果 Ispell 遇到拼写正确但不在其字典中的单词,像是名字,会发生什么?你可以按 **I** 将该单词添加到个人单词列表中。这会将单词保存到 _/home_ 家目录下的 _.ispell_default_ 的文件中。 +如果 Ispell 遇到拼写正确但不在其字典中的单词,比如名字,会发生什么?你可以按 `I` 将该单词添加到个人单词列表中。这会将单词保存到 `/home` 目录下的 `.ispell_default` 的文件中。 -这些是我在使用 Ispel l时最有用的选项,但请查看 [Ispell 的手册页][9]以了解其所有选项。 +这些是我在使用 Ispell 时最有用的选项,但请查看 [Ispell 的手册页][9]以了解其所有选项。 Ispell 比 Aspell 或其他命令行拼写检查器更好或者更快么?我会说它不比其他的差或者慢。Ispell 不是适合所有人。它也许也不适合你。但有更多选择也不错,不是么? @@ -60,10 +62,10 @@ Ispell 比 Aspell 或其他命令行拼写检查器更好或者更快么?我 via: https://opensource.com/article/19/5/spelling-command-line-ispell -作者:[Scott Nesbitt ][a] +作者:[Scott Nesbitt][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/) 荣誉推出 From 0bd3ac6a5da99a1f2f0edd633df1aea6c086f4b8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 May 2019 19:28:03 +0800 Subject: [PATCH 0581/1154] PUB:20190503 Check your spelling at the command line with Ispell.md @geekpi https://linux.cn/article-10895-1.html --- ...503 Check your spelling at the command line with Ispell.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190503 Check your spelling at the command line with Ispell.md (98%) diff --git a/translated/tech/20190503 Check your spelling at the command line with Ispell.md b/published/20190503 Check your spelling at the command line with Ispell.md similarity index 98% rename from translated/tech/20190503 Check your spelling at the command line with Ispell.md rename to published/20190503 Check your spelling at the command line with Ispell.md index 1d119ba85b..a4c84a78d8 100644 --- a/translated/tech/20190503 Check your spelling at the command line with Ispell.md +++ b/published/20190503 Check your spelling at the command line with Ispell.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10895-1.html) [#]: subject: (Check your spelling at the command line with Ispell) [#]: via: (https://opensource.com/article/19/5/spelling-command-line-ispell) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) From 5f7cf27f4bd81e90fd5880c6467fbdd067da4c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 24 May 2019 20:08:06 +0800 Subject: [PATCH 0582/1154] Translated --- ... platforms in a Python game with Pygame.md | 150 +++++++++--------- 1 file changed, 75 insertions(+), 75 deletions(-) rename {sources => translated}/tech/20180725 Put platforms in a Python game with Pygame.md (51%) diff --git a/sources/tech/20180725 Put platforms in a Python game with Pygame.md b/translated/tech/20180725 Put platforms in a Python game with Pygame.md similarity index 51% rename from sources/tech/20180725 Put platforms in a Python game with Pygame.md rename to translated/tech/20180725 Put platforms in a Python game with Pygame.md index 74d2536942..35b951cc02 100644 --- a/sources/tech/20180725 Put platforms in a Python game with Pygame.md +++ b/translated/tech/20180725 Put platforms in a Python game with Pygame.md @@ -7,33 +7,33 @@ [#]: via: (https://opensource.com/article/18/7/put-platforms-python-game) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -Put platforms in a Python game with Pygame +放置舞台到一个使用 Pygame 的 Python 游戏中 ====== -In part six of this series on building a Python game from scratch, create some platforms for your characters to travel. +在这系列的第六部分中,在从零构建一个 Python 游戏时,为你的角色创建一些舞台来旅行。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/header.png?itok=iq8HFoEJ) -This is part 6 in an ongoing series about creating video games in Python 3 using the Pygame module. Previous articles are: +这是关于使用 Pygame 模块来在 Python 3 中创建电脑游戏的仍在进行的一系列的文章的第六部分。先前的文章是: -+ [Learn how to program in Python by building a simple dice game][24] -+ [Build a game framework with Python using the Pygame module][25] -+ [How to add a player to your Python game][26] -+ [Using Pygame to move your game character around][27] -+ [What's a hero without a villain? How to add one to your Python game][28] ++ [通过构建一个简单的骰子游戏来学习如何用 Python 编程][24] ++ [使用 Python 和 Pygame 模块构建一个游戏框架][25] ++ [如何添加一个玩家到你的 Python 游戏][26] ++ [使用 Pygame 来在周围移动你的游戏角色][27] ++ [没有一个坏蛋的一个英雄是什么?如何添加一个坏蛋到你的 Python 游戏][28] -A platformer game needs platforms. +一个舞台游戏需要舞台。 -In [Pygame][1], the platforms themselves are sprites, just like your playable sprite. That's important because having platforms that are objects makes it a lot easier for your player sprite to interact with them. +在 [Pygame][1] 中,舞台本身是小精灵,正像你的可玩的小精灵。这一点是重要的,因为有对象的舞台,使你的玩家小精灵很简单地与舞台一起作用。. -There are two major steps in creating platforms. First, you must code the objects, and then you must map out where you want the objects to appear. +创建舞台有两个主要步骤。首先,你必须编码对象,然后,你必须设计你希望对象来出现的位置。 -### Coding platform objects +### 编码舞台对象 -To build a platform object, you create a class called `Platform`. It's a sprite, just like your [`Player`][2] [sprite][2], with many of the same properties. +为构建一个舞台对象,你创建一个称为`Platform`的类。它是一个小精灵,正像你的[`玩家`][2] [小精灵][2],带有很多相同的属性。 -Your `Platform` class needs to know a lot of information about what kind of platform you want, where it should appear in the game world, and what image it should contain. A lot of that information might not even exist yet, depending on how much you have planned out your game, but that's all right. Just as you didn't tell your Player sprite how fast to move until the end of the [Movement article][3], you don't have to tell `Platform` everything upfront. +你的`舞台`类需要知道很多你想要的舞台的类型的信息 ,它应该出现在游戏世界的哪里,和它应该包含的什么图片。它们中很多信息可能还尚不存在,依赖于你计划了多少游戏,但是,没有关系。正像直到[移到文章][3]的结尾时,你不告诉你的玩家小精灵多快速度移到,你没有必要告诉`Platform`预交的每一件事。 -Near the top of the script you've been writing in this series, create a new class. The first three lines in this code sample are for context, so add the code below the comment: +在你所写的这系列中脚本的顶部附近,创建一个新的类。在这代码示例中前三行是用于上下文,因此在注释的下面添加代码: ``` import pygame @@ -53,55 +53,55 @@ def __init__(self,xloc,yloc,imgw,imgh,img):     self.rect.x = xloc ``` -When called, this class creates an object onscreen in some X and Y location, with some width and height, using some image file for texture. It's very similar to how players or enemies are drawn onscreen. +当被调用时,这个类在一些 X 和 Y 位置上创建一个对象 onscreen, 带有一些宽度和高度,对于纹理使用一些图片文件。它非常类似于如何玩家或敌人绘制onscreen。 -### Types of platforms +### 舞台的类型 -The next step is to map out where all your platforms need to appear. +下一步是设计你所有舞台需要出现的地方。 -#### The tile method +#### 瓷砖方法 -There are a few different ways to implement a platform game world. In the original side-scroller games, such as Mario Super Bros. and Sonic the Hedgehog, the technique was to use "tiles," meaning that there were a few blocks to represent the ground and various platforms, and these blocks were used and reused to make a level. You have only eight or 12 different kinds of blocks, and you line them up onscreen to create the ground, floating platforms, and whatever else your game needs. Some people find this the easier way to make a game since you just have to make (or download) a small set of level assets to create many different levels. The code, however, requires a little more math. +这里有几个不同的方法来实施一个舞台游戏世界。在最初的侧面滚动游戏,例如,马里奥超级兄弟和刺猬索尼克,这个技巧是来使用"瓷砖",意味着这里有几个块“瓷砖”来代表地面和各种各样的舞台,并且这些块被使用和重复使用来制作一个层次。你仅有8或12种不同的块,你排列它们在屏幕上来创建地面,浮动的舞台,和你游戏需要的其它的一切事物。一些人找到这最容易的方法来制作一个游戏,尽管你不得不制作(或下载)一小组价值相等的有用的事物来创建很多不同的有用的事物。然而,代码需要一点更多的数学。 ![Supertux, a tile-based video game][5] -[SuperTux][6], a tile-based video game. +[SuperTux][6] ,一个基于瓷砖的电脑游戏。 -#### The hand-painted method +#### 手工绘制方法 -Another method is to make each and every asset as one whole image. If you enjoy creating assets for your game world, this is a great excuse to spend time in a graphics application, building each and every part of your game world. This method requires less math, because all the platforms are whole, complete objects, and you tell [Python][7] where to place them onscreen. +另一个方法是来使各个和每一个有用的事物作为一整个图像。如果你享受为你的游戏世界创建有用的事物,在一个图形应用程序中花费时间来构建你的游戏世界的各个和每一部件是一个极好的理由。这个方法需要较少的数学,因为所有的舞台是完整的对象,并且你告诉 [Python][7] 在屏幕上放置它们的位置。 -Each method has advantages and disadvantages, and the code you must use is slightly different depending on the method you choose. I'll cover both so you can use one or the other, or even a mix of both, in your project. +每种方法都有优势和劣势,并且依赖于你的选择使用的代码是稍微不同的.我将覆盖这两方面,所以你可以在你的工程中使用一个或另一个,甚至两者的混合。 -### Level mapping +### 层次映射 -Mapping out your game world is a vital part of level design and game programming in general. It does involve math, but nothing too difficult, and Python is good at math so it can help some. +总的来说,映射出你的游戏世界是层次设计和游戏程序的一个重要的部分。这需要数学,但是没有什么太难的,而且 Python 擅长数学,因此它可以帮助一些。 -You might find it helpful to design on paper first. Get a sheet of paper and draw a box to represent your game window. Draw platforms in the box, labeling each with its X and Y coordinates, as well as its intended width and height. The actual positions in the box don't have to be exact, as long as you keep the numbers realistic. For instance, if your screen is 720 pixels wide, then you can't fit eight platforms at 100 pixels each all on one screen. +你可以发现先在纸张上设计是有益的。获取纸张的一个表格,并绘制一个方框来代表你的游戏窗体。在方框中绘制舞台,用 X 和 Y 坐标标记每一个,以及它的意欲达到的宽度和高度。在方框中的实际位置没有必要是精确的,只要你保持实际的数字。譬如,假如你的屏幕是 720 像素宽,那么你不能在一个屏幕上以 100 像素处容纳8块舞台。 -Of course, not all platforms in your game have to fit in one screen-sized box, because your game will scroll as your player walks through it. So keep drawing your game world to the right of the first screen until the end of the level. +当然,在你的游戏中不是所有的舞台不得不容纳在一个屏幕大小的方框,因为你的游戏将随着你的玩家行走而滚动。所以保持绘制你的游戏世界到第一屏幕的右侧,直到层次的右侧。 -If you prefer a little more precision, you can use graph paper. This is especially helpful when designing a game with tiles because each grid square can represent one tile. +如果你更喜欢精确一点,你可以使用方格纸。当设计一个带有瓷砖的游戏时,这是特别有用的,因为每个方格可以代表一个瓷砖。 ![Example of a level map][9] -Example of a level map. +一个平面地图示例。 -#### Coordinates +#### 坐标系 -You may have learned in school about the [Cartesian coordinate system][10]. What you learned applies to Pygame, except that in Pygame, your game world's coordinates place `0,0` in the top-left corner of your screen instead of in the middle, which is probably what you're used to from Geometry class. +你可能已经在学校中学习[笛卡尔坐标系][10]。你学习的东西应用到 Pygame,除了在 Pygame 中,你的游戏世界的坐标系放置 `0,0` 在你的屏幕的左上角而不是在中间,中间可能是你which is probably what you're used to from Geometry class. ![Example of coordinates in Pygame][12] -Example of coordinates in Pygame. +在 Pygame 中的坐标示例。 -The X axis starts at 0 on the far left and increases infinitely to the right. The Y axis starts at 0 at the top of the screen and extends down. +X 轴起始于最左边的 0 ,无限地向右增加。Y 轴起始于屏幕顶部的 0 ,向下延伸。 -#### Image sizes +#### 图片大小 -Mapping out a game world is meaningless if you don't know how big your players, enemies, and platforms are. You can find the dimensions of your platforms or tiles in a graphics program. In [Krita][13], for example, click on the **Image** menu and select **Properties**. You can find the dimensions at the very top of the **Properties** window. +映射出一个游戏世界不是毫无意义的,如果你不知道你的玩家,敌人,舞台是多大的。你可以找到你的舞台的尺寸或在一个图形程序中的标题。在 [Krita][13] 中,例如,单击**图形**菜单,并选择**属性**。你可以在**属性**窗口的非常顶部处找到尺寸。 -Alternately, you can create a simple Python script to tell you the dimensions of an image. Open a new text file and type this code into it: +可选地,你可以创建一个简单点的 Python 脚本来告诉你的一个图形的尺寸。打开一个新的文本文件,并输入这些代码到其中: ``` #!/usr/bin/env python3 @@ -123,44 +123,44 @@ Y   = dim.size[1] print(X,Y) ``` -Save the text file as `identify.py`. +保存文本文件为 `identify.py` 。 -To set up this script, you must install an extra set of Python modules that contain the new keywords used in the script: +为安装这个脚本,你必需安装安装一组额外的 Python 模块,它们包含使用在脚本中新的关键字: ``` $ pip3 install Pillow --user ``` -Once that is installed, run your script from within your game project directory: +一旦这些被安装,在你游戏工程目录中运行你的脚本: ``` $ python3 ./identify.py images/ground.png (1080, 97) ``` -The image size of the ground platform in this example is 1080 pixels wide and 97 high. +在这个示例中的地面舞台的图形的大小是1080像素宽和97像素高。 -### Platform blocks +### 舞台块 -If you choose to draw each asset individually, you must create several platforms and any other elements you want to insert into your game world, each within its own file. In other words, you should have one file per asset, like this: +如果你选择单独地绘制每个有用的事物,你必需创建一些舞台和一些你希望插入到你的游戏世界中其它的元素,每个元素都在它自己的文件中。换句话说,你应该每个有用的事物都有一个文件,像这: ![One image file per object][15] -One image file per object. +每个对象一个图形文件。 -You can reuse each platform as many times as you want, just make sure that each file only contains one platform. You cannot use a file that contains everything, like this: +你可以按照你希望的次数重复使用每个舞台,只要确保每个文件仅包含一个舞台。你不能使用一个包含每一件事物的文件,像这: ![Your level cannot be one image file][17] -Your level cannot be one image file. +你的层次不能是一个图形。 -You might want your game to look like that when you've finished, but if you create your level in one big file, there is no way to distinguish a platform from the background, so either paint your objects in their own file or crop them from a large file and save individual copies. +当你完成时,你可能希望你的游戏看起来像这样,但是如果你在一个大文件中创建你的层次,没有方法从背景中区分一个舞台,因此,要么在它们拥有的文件中绘制你的对象,要么从一个大规模文件中复制它们,并单独地保存副本。 -**Note:** As with your other assets, you can use [GIMP][18], Krita, [MyPaint][19], or [Inkscape][20] to create your game assets. +**注意:** 如同你的其它的有用的事物,你可以使用[GIMP][18],Krita,[MyPaint][19],或[Inkscape][20] 来创建你的游戏的有用的事物。 -Platforms appear on the screen at the start of each level, so you must add a `platform` function in your `Level` class. The special case here is the ground platform, which is important enough to be treated as its own platform group. By treating the ground as its own special kind of platform, you can choose whether it scrolls or whether it stands still while other platforms float over the top of it. It's up to you. +舞台出现在每个层次开始的屏幕上,因此你必需在你的`Level`类中添加一个`platform`函数。在这里特殊的情况是地面舞台,作为它自身拥有的舞台组来对待是足够重要的。通过把地面看作它自身拥有的特殊类型的舞台,你可以选择它是否滚动,或在其它舞台漂浮在它上面期间是否仍然站立。它取决于你。 -Add these two functions to your `Level` class: +添加这两个函数到你的`Level`类: ``` def ground(lvl,x,y,w,h): @@ -187,15 +187,15 @@ def platform( lvl ):     return plat_list ``` -The `ground` function requires an X and Y location so Pygame knows where to place the ground platform. It also requires the width and height of the platform so Pygame knows how far the ground extends in each direction. The function uses your `Platform` class to generate an object onscreen, and then adds that object to the `ground_list` group. + `ground` 函数需要一个 X 和 Y 位置,以便 Pygame 知道在哪里放置地面舞台。它也需要舞台的宽度和高度,这样 Pygame 知道地面延伸到每个方向有多远。该函数使用你的 `Platform` 来来生成一个对象 onscreen ,然后他就这个对象到 `ground_list` 组。 -The `platform` function is essentially the same, except that there are more platforms to list. In this example, there are only two, but you can have as many as you like. After entering one platform, you must add it to the `plat_list` before listing another. If you don't add a platform to the group, then it won't appear in your game. +`platform` 函数本质上是相同的,除了其有更多的舞台来列出。在这个示例中,仅有两个,但是你可以想多少就多少。在进入一个舞台后,在列出另一个前,你必需添加它到 `plat_list` 中。如果你不添加一个舞台到组中,那么它将不出现在你的游戏中。 -> **Tip:** It can be difficult to think of your game world with 0 at the top, since the opposite is what happens in the real world; when figuring out how tall you are, you don't measure yourself from the sky down, you measure yourself from your feet to the top of your head. +> **提示:** 很难想象你的游戏世界的0在顶部,因为在真实世界中发生的情况是相反的;当估计你多高时,你不要从天空下面测量你自己,从脚到头的顶部来测量。 > -> If it's easier for you to build your game world from the "ground" up, it might help to express Y-axis values as negatives. For instance, you know that the bottom of your game world is the value of `worldy`. So `worldy` minus the height of the ground (97, in this example) is where your player is normally standing. If your character is 64 pixels tall, then the ground minus 128 is exactly twice as tall as your player. Effectively, a platform placed at 128 pixels is about two stories tall, relative to your player. A platform at -320 is three more stories. And so on. +> 如果对你来说从“地面”上来构建你的游戏世界更容易,它可能有助于表示 Y 轴值为负数。例如,你知道你的游戏世界的底部是 `worldy` 的值。因此 `worldy` 减去地面(97,在这个示例中)的高度是你的玩家正常站立的位置。如果你的角色是64像素高,那么地面减去128正好是你的玩家的两倍。事实上,一个放置在128像素处舞台大约是两层楼高度,相对于你的玩家。一个舞台在-320处是三层楼高。等等 -As you probably know by now, none of your classes and functions are worth much if you don't use them. Add this code to your setup section (the first line is just for context, so add the last two lines): +正像你现在可能所知的,如果你不使用它们,你的类和函数是没有有价值的。添加这些代码到你的 setup 部分(第一行只是上下文,所以添加最后两行): ``` enemy_list  = Level.bad( 1, eloc ) @@ -203,7 +203,7 @@ ground_list = Level.ground( 1,0,worldy-97,1080,97 ) plat_list   = Level.platform( 1 ) ``` -And add these lines to your main loop (again, the first line is just for context): +并提交这些行到你的主循环(再一次,第一行仅用于上下文): ``` enemy_list.draw(world)  # refresh enemies @@ -211,24 +211,24 @@ ground_list.draw(world)  # refresh ground plat_list.draw(world)  # refresh platforms ``` -### Tiled platforms +### 瓷砖舞台 -Tiled game worlds are considered easier to make because you just have to draw a few blocks upfront and can use them over and over to create every platform in the game. There are even sets of tiles for you to use on sites like [OpenGameArt.org][21]. +瓷砖游戏世界被认为更容易制作,因为你只需要绘制一些在前面的块,就能在游戏中反反复复创建每一个舞台。在网站上甚至有一组供你来使用的瓷砖,像 [OpenGameArt.org][21]。 -The `Platform` class is the same as the one provided in the previous sections. +`Platform` 类与在前面部分中的类是相同的。 -The `ground` and `platform` in the `Level` class, however, must use loops to calculate how many blocks to use to create each platform. +在 `Level` 类中的 `ground` 和 `platform` , 然而,必需使用循环来计算使用多少块来创建每个舞台。 -If you intend to have one solid ground in your game world, the ground is simple. You just "clone" your ground tile across the whole window. For instance, you could create a list of X and Y values to dictate where each tile should be placed, and then use a loop to take each value and draw one tile. This is just an example, so don't add this to your code: +如果你打算在你的游戏世界中有一个坚固的地面,地面是简单的。你仅从整个窗口一边到另一边"克隆"你的地面瓷砖。例如,你可以创建一个 X 和 Y 值的列表来规定每个瓷砖应该放置的位置,然后使用一个循环来获取每个值和绘制一个瓷砖。这仅是一个示例,所以不要添加这到你的代码: ``` # Do not add this to your code gloc = [0,656,64,656,128,656,192,656,256,656,320,656,384,656] ``` -If you look carefully, though, you can see all the Y values are always the same, and the X values increase steadily in increments of 64, which is the size of the tiles. That kind of repetition is exactly what computers are good at, so you can use a little bit of math logic to have the computer do all the calculations for you: +如果你仔细看,不过,你也可以看到所有的 Y 值是相同的,X 值以64的增量不断地增加,这是瓷砖的东西。这种类型的重复是精确地,是计算机擅长的,因此你可以使用一点数学逻辑来让计算机为你做所有的计算: -Add this to the setup part of your script: +添加这代你的脚本的 setup 部分: ``` gloc = [] @@ -243,9 +243,9 @@ while i <= (worldx/tx)+tx: ground_list = Level.ground( 1,gloc,tx,ty ) ``` -Now, regardless of the size of your window, Python divides the width of the game world by the width of the tile and creates an array listing each X value. This doesn't calculate the Y value, but that never changes on flat ground anyway. +现在,不管你的窗口的大小,Python 通过瓷砖的宽度 分割游戏世界的宽度,并创建一个数组列表列出每个 X 值。这不计算 Y 值,但是无论如何,从不在平的地面上更改。 -To use the array in a function, use a `while` loop that looks at each entry and adds a ground tile at the appropriate location: +为在一个函数中使用数组,使用一个`while`循环,查看每个条目并在适当的位置添加一个地面瓷砖: ``` def ground(lvl,gloc,tx,ty): @@ -263,13 +263,13 @@ def ground(lvl,gloc,tx,ty):     return ground_list ``` -This is nearly the same code as the `ground` function for the block-style platformer, provided in a previous section above, aside from the `while` loop. +除了 `while` 循环,这几乎与在上面一部分中提供的块样式平台游戏 `ground` 函数的代码相同。 -For moving platforms, the principle is similar, but there are some tricks you can use to make your life easier. +对于移到舞台,原理是相似的,但是这里有一些你可以使用的技巧来使你的生活更简单。 -Rather than mapping every platform by pixels, you can define a platform by its starting pixel (its X value), the height from the ground (its Y value), and how many tiles to draw. That way, you don't have to worry about the width and height of every platform. +而不通过像素映射每个舞台,你可以通过它的起始像素(它的 X 值),从地面(它的 Y 值)的高度,绘制多少瓷砖来定义一个舞台。用那种方法,你不必担心每个舞台的宽度和高度。 -The logic for this trick is a little more complex, so copy this code carefully. There is a `while` loop inside of another `while` loop because this function must look at all three values within each array entry to successfully construct a full platform. In this example, there are only three platforms defined as `ploc.append` statements, but your game probably needs more, so define as many as you need. Of course, some won't appear yet because they're far offscreen, but they'll come into view once you implement scrolling. +这个技巧的逻辑有一点更复杂,因此仔细复制这些代码。有一个 `while` 循环在另一个 `while` 循环的内部,因为这个函数必需考虑在每个数组入口处的所有三个值来成功地建造一个完整的舞台。在这个示例中,这里仅有三个舞台被定义为 `ploc.append` 语句,但是你的游戏可能需要更多,因此你需要多少就定义多少。当然,一些也将不出现,因为它们远在屏幕外,但是一旦你实施滚动,它们将呈现眼前。 ``` def platform(lvl,tx,ty): @@ -295,7 +295,7 @@ def platform(lvl,tx,ty):     return plat_list ``` -To get the platforms to appear in your game world, they must be in your main loop. If you haven't already done so, add these lines to your main loop (again, the first line is just for context): +为获取舞台,使其出现在你的游戏世界,它们必需在你的主循环中。如果你还没有这样做,添加这些行到你的主循环(再一次,第一行仅被用于上下文)中: ```         enemy_list.draw(world)  # refresh enemies @@ -303,16 +303,16 @@ To get the platforms to appear in your game world, they must be in your main loo         plat_list.draw(world)   # refresh platforms ``` -Launch your game, and adjust the placement of your platforms as needed. Don't worry that you can't see the platforms that are spawned offscreen; you'll fix that soon. +启动你的游戏,根据需要调整你的舞台的放置位置。不要担心,你不能看见在屏幕外面产生的舞台;你将不久后修复。 -Here is the game so far in a picture and in code: +到目前为止,这是在一个图片和在代码中游戏: ![Pygame game][23] -Our Pygame platformer so far. +到目前为止,我们的 Pygame 舞台。 ``` -    #!/usr/bin/env python3 +#!/usr/bin/env python3 # draw a world # add a player and player control # add player movement @@ -552,7 +552,7 @@ via: https://opensource.com/article/18/7/put-platforms-python-game 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[robsan](https://github.com/robsean) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8716e8849c14d14c190e10724d69abf7916add13 Mon Sep 17 00:00:00 2001 From: Northurland <40388212+Northurland@users.noreply.github.com> Date: Fri, 24 May 2019 20:32:04 +0800 Subject: [PATCH 0583/1154] Update 20180818 What Did Ada Lovelace-s Program Actually Do.md --- .../20180818 What Did Ada Lovelace-s Program Actually Do.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20180818 What Did Ada Lovelace-s Program Actually Do.md b/sources/talk/20180818 What Did Ada Lovelace-s Program Actually Do.md index 8bbb651cfd..fc669a1a3c 100644 --- a/sources/talk/20180818 What Did Ada Lovelace-s Program Actually Do.md +++ b/sources/talk/20180818 What Did Ada Lovelace-s Program Actually Do.md @@ -1,3 +1,5 @@ +Northurland Translating + What Did Ada Lovelace's Program Actually Do? ====== The story of Microsoft’s founding is one of the most famous episodes in computing history. In 1975, Paul Allen flew out to Albuquerque to demonstrate the BASIC interpreter that he and Bill Gates had written for the Altair microcomputer. Because neither of them had a working Altair, Allen and Gates tested their interpreter using an emulator that they wrote and ran on Harvard’s computer system. The emulator was based on nothing more than the published specifications for the Intel 8080 processor. When Allen finally ran their interpreter on a real Altair—in front of the person he and Gates hoped would buy their software—he had no idea if it would work. But it did. The next month, Allen and Gates officially founded their new company. From 595b933d37c858ddc319d51b0339f240830c85a5 Mon Sep 17 00:00:00 2001 From: FSSlc Date: Fri, 24 May 2019 20:42:18 +0800 Subject: [PATCH 0584/1154] [Translated] 0190417 Inter-process communication in Linux- Sockets and signals.md Signed-off-by: FSSlc --- ...unication in Linux- Sockets and signals.md | 388 ------------------ ...unication in Linux- Sockets and signals.md | 372 +++++++++++++++++ 2 files changed, 372 insertions(+), 388 deletions(-) delete mode 100644 sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md create mode 100644 translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md diff --git a/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md b/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md deleted file mode 100644 index 3d306d35af..0000000000 --- a/sources/tech/20190417 Inter-process communication in Linux- Sockets and signals.md +++ /dev/null @@ -1,388 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (FSSlc) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Inter-process communication in Linux: Sockets and signals) -[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-networking) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) - -Inter-process communication in Linux: Sockets and signals -====== - -Learn how processes synchronize with each other in Linux. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mesh_networking_dots_connected.png?itok=ovINTRR3) - -This is the third and final article in a series about [interprocess communication][1] (IPC) in Linux. The [first article][2] focused on IPC through shared storage (files and memory segments), and the [second article][3] does the same for basic channels: pipes (named and unnamed) and message queues. This article moves from IPC at the high end (sockets) to IPC at the low end (signals). Code examples flesh out the details. - -### Sockets - -Just as pipes come in two flavors (named and unnamed), so do sockets. IPC sockets (aka Unix domain sockets) enable channel-based communication for processes on the same physical device (host), whereas network sockets enable this kind of IPC for processes that can run on different hosts, thereby bringing networking into play. Network sockets need support from an underlying protocol such as TCP (Transmission Control Protocol) or the lower-level UDP (User Datagram Protocol). - -By contrast, IPC sockets rely upon the local system kernel to support communication; in particular, IPC sockets communicate using a local file as a socket address. Despite these implementation differences, the IPC socket and network socket APIs are the same in the essentials. The forthcoming example covers network sockets, but the sample server and client programs can run on the same machine because the server uses network address localhost (127.0.0.1), the address for the local machine on the local machine. - -Sockets configured as streams (discussed below) are bidirectional, and control follows a client/server pattern: the client initiates the conversation by trying to connect to a server, which tries to accept the connection. If everything works, requests from the client and responses from the server then can flow through the channel until this is closed on either end, thereby breaking the connection. - -An iterative server, which is suited for development only, handles connected clients one at a time to completion: the first client is handled from start to finish, then the second, and so on. The downside is that the handling of a particular client may hang, which then starves all the clients waiting behind. A production-grade server would be concurrent, typically using some mix of multi-processing and multi-threading. For example, the Nginx web server on my desktop machine has a pool of four worker processes that can handle client requests concurrently. The following code example keeps the clutter to a minimum by using an iterative server; the focus thus remains on the basic API, not on concurrency. - -Finally, the socket API has evolved significantly over time as various POSIX refinements have emerged. The current sample code for server and client is deliberately simple but underscores the bidirectional aspect of a stream-based socket connection. Here's a summary of the flow of control, with the server started in a terminal then the client started in a separate terminal: - - * The server awaits client connections and, given a successful connection, reads the bytes from the client. - - * To underscore the two-way conversation, the server echoes back to the client the bytes received from the client. These bytes are ASCII character codes, which make up book titles. - - * The client writes book titles to the server process and then reads the same titles echoed from the server. Both the server and the client print the titles to the screen. Here is the server's output, essentially the same as the client's: - -``` -Listening on port 9876 for clients... -War and Peace -Pride and Prejudice -The Sound and the Fury -``` - - - - -#### Example 1. The socket server - -``` -#include -#include -#include -#include -#include -#include -#include -#include -#include "sock.h" - -void report(const char* msg, int terminate) { -  perror(msg); -  if (terminate) exit(-1); /* failure */ -} - -int main() { -  int fd = socket(AF_INET,     /* network versus AF_LOCAL */ -                  SOCK_STREAM, /* reliable, bidirectional, arbitrary payload size */ -                  0);          /* system picks underlying protocol (TCP) */ -  if (fd < 0) report("socket", 1); /* terminate */ - -  /* bind the server's local address in memory */ -  struct sockaddr_in saddr; -  memset(&saddr, 0, sizeof(saddr));          /* clear the bytes */ -  saddr.sin_family = AF_INET;                /* versus AF_LOCAL */ -  saddr.sin_addr.s_addr = htonl(INADDR_ANY); /* host-to-network endian */ -  saddr.sin_port = htons(PortNumber);        /* for listening */ - -  if (bind(fd, (struct sockaddr *) &saddr, sizeof(saddr)) < 0) -    report("bind", 1); /* terminate */ - -  /* listen to the socket */ -  if (listen(fd, MaxConnects) < 0) /* listen for clients, up to MaxConnects */ -    report("listen", 1); /* terminate */ - -  fprintf(stderr, "Listening on port %i for clients...\n", PortNumber); -  /* a server traditionally listens indefinitely */ -  while (1) { -    struct sockaddr_in caddr; /* client address */ -    int len = sizeof(caddr);  /* address length could change */ - -    int client_fd = accept(fd, (struct sockaddr*) &caddr, &len);  /* accept blocks */ -    if (client_fd < 0) { -      report("accept", 0); /* don't terminate, though there's a problem */ -      continue; -    } - -    /* read from client */ -    int i; -    for (i = 0; i < ConversationLen; i++) { -      char buffer[BuffSize + 1]; -      memset(buffer, '\0', sizeof(buffer)); -      int count = read(client_fd, buffer, sizeof(buffer)); -      if (count > 0) { -        puts(buffer); -        write(client_fd, buffer, sizeof(buffer)); /* echo as confirmation */ -      } -    } -    close(client_fd); /* break connection */ -  }  /* while(1) */ -  return 0; -} -``` - -The server program above performs the classic four-step to ready itself for client requests and then to accept individual requests. Each step is named after a system function that the server calls: - - 1. **socket(…)** : get a file descriptor for the socket connection - 2. **bind(…)** : bind the socket to an address on the server's host - 3. **listen(…)** : listen for client requests - 4. **accept(…)** : accept a particular client request - - - -The **socket** call in full is: - -``` -int sockfd = socket(AF_INET,      /* versus AF_LOCAL */ -                    SOCK_STREAM,  /* reliable, bidirectional */ -                    0);           /* system picks protocol (TCP) */ -``` - -The first argument specifies a network socket as opposed to an IPC socket. There are several options for the second argument, but **SOCK_STREAM** and **SOCK_DGRAM** (datagram) are likely the most used. A stream-based socket supports a reliable channel in which lost or altered messages are reported; the channel is bidirectional, and the payloads from one side to the other can be arbitrary in size. By contrast, a datagram-based socket is unreliable (best try), unidirectional, and requires fixed-sized payloads. The third argument to **socket** specifies the protocol. For the stream-based socket in play here, there is a single choice, which the zero represents: TCP. Because a successful call to **socket** returns the familiar file descriptor, a socket is written and read with the same syntax as, for example, a local file. - -The **bind** call is the most complicated, as it reflects various refinements in the socket API. The point of interest is that this call binds the socket to a memory address on the server machine. However, the **listen** call is straightforward: - -``` -if (listen(fd, MaxConnects) < 0) -``` - -The first argument is the socket's file descriptor and the second specifies how many client connections can be accommodated before the server issues a connection refused error on an attempted connection. ( **MaxConnects** is set to 8 in the header file sock.h.) - -The **accept** call defaults to a blocking wait: the server does nothing until a client attempts to connect and then proceeds. The **accept** function returns **-1** to indicate an error. If the call succeeds, it returns another file descriptor—for a read/write socket in contrast to the accepting socket referenced by the first argument in the **accept** call. The server uses the read/write socket to read requests from the client and to write responses back. The accepting socket is used only to accept client connections. - -By design, a server runs indefinitely. Accordingly, the server can be terminated with a **Ctrl+C** from the command line. - -#### Example 2. The socket client - -``` -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "sock.h" - -const char* books[] = {"War and Peace", -                       "Pride and Prejudice", -                       "The Sound and the Fury"}; - -void report(const char* msg, int terminate) { -  perror(msg); -  if (terminate) exit(-1); /* failure */ -} - -int main() { -  /* fd for the socket */ -  int sockfd = socket(AF_INET,      /* versus AF_LOCAL */ -                      SOCK_STREAM,  /* reliable, bidirectional */ -                      0);           /* system picks protocol (TCP) */ -  if (sockfd < 0) report("socket", 1); /* terminate */ - -  /* get the address of the host */ -  struct hostent* hptr = gethostbyname(Host); /* localhost: 127.0.0.1 */ -  if (!hptr) report("gethostbyname", 1); /* is hptr NULL? */ -  if (hptr->h_addrtype != AF_INET)       /* versus AF_LOCAL */ -    report("bad address family", 1); - -  /* connect to the server: configure server's address 1st */ -  struct sockaddr_in saddr; -  memset(&saddr, 0, sizeof(saddr)); -  saddr.sin_family = AF_INET; -  saddr.sin_addr.s_addr = -     ((struct in_addr*) hptr->h_addr_list[0])->s_addr; -  saddr.sin_port = htons(PortNumber); /* port number in big-endian */ - -  if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) -    report("connect", 1); - -  /* Write some stuff and read the echoes. */ -  puts("Connect to server, about to write some stuff..."); -  int i; -  for (i = 0; i < ConversationLen; i++) { -    if (write(sockfd, books[i], strlen(books[i])) > 0) { -      /* get confirmation echoed from server and print */ -      char buffer[BuffSize + 1]; -      memset(buffer, '\0', sizeof(buffer)); -      if (read(sockfd, buffer, sizeof(buffer)) > 0) -        puts(buffer); -    } -  } -  puts("Client done, about to exit..."); -  close(sockfd); /* close the connection */ -  return 0; -} -``` - -The client program's setup code is similar to the server's. The principal difference between the two is that the client neither listens nor accepts, but instead connects: - -``` -if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) -``` - -The **connect** call might fail for several reasons; for example, the client has the wrong server address or too many clients are already connected to the server. If the **connect** operation succeeds, the client writes requests and then reads the echoed responses in a **for** loop. After the conversation, both the server and the client **close** the read/write socket, although a close operation on either side is sufficient to close the connection. The client exits thereafter but, as noted earlier, the server remains open for business. - -The socket example, with request messages echoed back to the client, hints at the possibilities of arbitrarily rich conversations between the server and the client. Perhaps this is the chief appeal of sockets. It is common on modern systems for client applications (e.g., a database client) to communicate with a server through a socket. As noted earlier, local IPC sockets and network sockets differ only in a few implementation details; in general, IPC sockets have lower overhead and better performance. The communication API is essentially the same for both. - -### Signals - -A signal interrupts an executing program and, in this sense, communicates with it. Most signals can be either ignored (blocked) or handled (through designated code), with **SIGSTOP** (pause) and **SIGKILL** (terminate immediately) as the two notable exceptions. Symbolic constants such as **SIGKILL** have integer values, in this case, 9. - -Signals can arise in user interaction. For example, a user hits **Ctrl+C** from the command line to terminate a program started from the command-line; **Ctrl+C** generates a **SIGTERM** signal. **SIGTERM** for terminate, unlike **SIGKILL** , can be either blocked or handled. One process also can signal another, thereby making signals an IPC mechanism. - -Consider how a multi-processing application such as the Nginx web server might be shut down gracefully from another process. The **kill** function: - -``` -int kill(pid_t pid, int signum); /* declaration */ -``` - -can be used by one process to terminate another process or group of processes. If the first argument to function **kill** is greater than zero, this argument is treated as the pid (process ID) of the targeted process; if the argument is zero, the argument identifies the group of processes to which the signal sender belongs. - -The second argument to **kill** is either a standard signal number (e.g., **SIGTERM** or **SIGKILL** ) or 0, which makes the call to **signal** a query about whether the pid in the first argument is indeed valid. The graceful shutdown of a multi-processing application thus could be accomplished by sending a terminate signal—a call to the **kill** function with **SIGTERM** as the second argument—to the group of processes that make up the application. (The Nginx master process could terminate the worker processes with a call to **kill** and then exit itself.) The **kill** function, like so many library functions, houses power and flexibility in a simple invocation syntax. - -#### Example 3. The graceful shutdown of a multi-processing system - -``` -#include -#include -#include -#include -#include - -void graceful(int signum) { -  printf("\tChild confirming received signal: %i\n", signum); -  puts("\tChild about to terminate gracefully..."); -  sleep(1); -  puts("\tChild terminating now..."); -  _exit(0); /* fast-track notification of parent */ -} - -void set_handler() { -  struct sigaction current; -  sigemptyset(¤t.sa_mask);         /* clear the signal set */ -  current.sa_flags = 0;                  /* enables setting sa_handler, not sa_action */ -  current.sa_handler = graceful;         /* specify a handler */ -  sigaction(SIGTERM, ¤t, NULL);    /* register the handler */ -} - -void child_code() { -  set_handler(); - -  while (1) {   /** loop until interrupted **/ -    sleep(1); -    puts("\tChild just woke up, but going back to sleep."); -  } -} - -void parent_code(pid_t cpid) { -  puts("Parent sleeping for a time..."); -  sleep(5); - -  /* Try to terminate child. */ -  if (-1 == kill(cpid, SIGTERM)) { -    perror("kill"); -    exit(-1); -  } -  wait(NULL); /** wait for child to terminate **/ -  puts("My child terminated, about to exit myself..."); -} - -int main() { -  pid_t pid = fork(); -  if (pid < 0) { -    perror("fork"); -    return -1; /* error */ -  } -  if (0 == pid) -    child_code(); -  else -    parent_code(pid); -  return 0;  /* normal */ -} -``` - -The shutdown program above simulates the graceful shutdown of a multi-processing system, in this case, a simple one consisting of a parent process and a single child process. The simulation works as follows: - - * The parent process tries to fork a child. If the fork succeeds, each process executes its own code: the child executes the function **child_code** , and the parent executes the function **parent_code**. - * The child process goes into a potentially infinite loop in which the child sleeps for a second, prints a message, goes back to sleep, and so on. It is precisely a **SIGTERM** signal from the parent that causes the child to execute the signal-handling callback function **graceful**. The signal thus breaks the child process out of its loop and sets up the graceful termination of both the child and the parent. The child prints a message before terminating. - * The parent process, after forking the child, sleeps for five seconds so that the child can execute for a while; of course, the child mostly sleeps in this simulation. The parent then calls the **kill** function with **SIGTERM** as the second argument, waits for the child to terminate, and then exits. - - - -Here is the output from a sample run: - -``` -% ./shutdown -Parent sleeping for a time... -        Child just woke up, but going back to sleep. -        Child just woke up, but going back to sleep. -        Child just woke up, but going back to sleep. -        Child just woke up, but going back to sleep. -        Child confirming received signal: 15  ## SIGTERM is 15 -        Child about to terminate gracefully... -        Child terminating now... -My child terminated, about to exit myself... -``` - -For the signal handling, the example uses the **sigaction** library function (POSIX recommended) rather than the legacy **signal** function, which has portability issues. Here are the code segments of chief interest: - - * If the call to **fork** succeeds, the parent executes the **parent_code** function and the child executes the **child_code** function. The parent waits for five seconds before signaling the child: - -``` - puts("Parent sleeping for a time..."); -sleep(5); -if (-1 == kill(cpid, SIGTERM)) { -...sleepkillcpidSIGTERM... -``` - -If the **kill** call succeeds, the parent does a **wait** on the child's termination to prevent the child from becoming a permanent zombie; after the wait, the parent exits. - - * The **child_code** function first calls **set_handler** and then goes into its potentially infinite sleeping loop. Here is the **set_handler** function for review: - -``` - void set_handler() { -  struct sigaction current;            /* current setup */ -  sigemptyset(¤t.sa_mask);       /* clear the signal set */ -  current.sa_flags = 0;                /* for setting sa_handler, not sa_action */ -  current.sa_handler = graceful;       /* specify a handler */ -  sigaction(SIGTERM, ¤t, NULL);  /* register the handler */ -} -``` - -The first three lines are preparation. The fourth statement sets the handler to the function **graceful** , which prints some messages before calling **_exit** to terminate. The fifth and last statement then registers the handler with the system through the call to **sigaction**. The first argument to **sigaction** is **SIGTERM** for terminate, the second is the current **sigaction** setup, and the last argument ( **NULL** in this case) can be used to save a previous **sigaction** setup, perhaps for later use. - - - - -Using signals for IPC is indeed a minimalist approach, but a tried-and-true one at that. IPC through signals clearly belongs in the IPC toolbox. - -### Wrapping up this series - -These three articles on IPC have covered the following mechanisms through code examples: - - * Shared files - * Shared memory (with semaphores) - * Pipes (named and unnamed) - * Message queues - * Sockets - * Signals - - - -Even today, when thread-centric languages such as Java, C#, and Go have become so popular, IPC remains appealing because concurrency through multi-processing has an obvious advantage over multi-threading: every process, by default, has its own address space, which rules out memory-based race conditions in multi-processing unless the IPC mechanism of shared memory is brought into play. (Shared memory must be locked in both multi-processing and multi-threading for safe concurrency.) Anyone who has written even an elementary multi-threading program with communication via shared variables knows how challenging it can be to write thread-safe yet clear, efficient code. Multi-processing with single-threaded processes remains a viable—indeed, quite appealing—way to take advantage of today's multi-processor machines without the inherent risk of memory-based race conditions. - -There is no simple answer, of course, to the question of which among the IPC mechanisms is the best. Each involves a trade-off typical in programming: simplicity versus functionality. Signals, for example, are a relatively simple IPC mechanism but do not support rich conversations among processes. If such a conversion is needed, then one of the other choices is more appropriate. Shared files with locking is reasonably straightforward, but shared files may not perform well enough if processes need to share massive data streams; pipes or even sockets, with more complicated APIs, might be a better choice. Let the problem at hand guide the choice. - -Although the sample code ([available on my website][4]) is all in C, other programming languages often provide thin wrappers around these IPC mechanisms. The code examples are short and simple enough, I hope, to encourage you to experiment. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/interprocess-communication-linux-networking - -作者:[Marty Kalin][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/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Inter-process_communication -[2]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 -[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-2 -[4]: http://condor.depaul.edu/mkalin diff --git a/translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md b/translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md new file mode 100644 index 0000000000..4e7a06c983 --- /dev/null +++ b/translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md @@ -0,0 +1,372 @@ +[#]: collector: "lujun9972" +[#]: translator: "FSSlc" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Inter-process communication in Linux: Sockets and signals" +[#]: via: "https://opensource.com/article/19/4/interprocess-communication-linux-networking" +[#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu" + +Linux 下的进程间通信:套接字和信号 +====== + +学习在 Linux 中进程是如何与其他进程进行同步的。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mesh_networking_dots_connected.png?itok=ovINTRR3) + +本篇是 Linux 下[进程间通信][1](IPC)系列的第三篇同时也是最后一篇文章。[第一篇文章][2]聚焦在通过共享存储(文件和共享内存段)来进行 IPC,[第二篇文章][3]则通过管道(无名的或者有名的)及消息队列来达到相同的目的。这篇文章将目光从高处(套接字)然后到低处(信号)来关注 IPC。代码示例将用力地充实下面的解释细节。 + +### 套接字 + +正如管道有两种类型(有名和无名)一样,套接字也有两种类型。IPC 套接字(即 Unix domain socket)给予进程在相同设备(主机)上基于通道的通信能力;而网络套接字给予进程运行在不同主机的能力,因此也带来了网络通信的能力。网络套接字需要底层协议的支持,例如 TCP(传输控制协议)或 UDP(用户数据报协议)。 + +与之相反,IPC 套接字依赖于本地系统内核的支持来进行通信;特别的,IPC 通信使用一个本地的文件作为套接字地址。尽管这两种套接字的实现有所不同,但在本质上,IPC 套接字和网络套接字的 API 是一致的。接下来的例子将包含网络套接字的内容,但示例服务器和客户端程序可以在相同的机器上运行,因为服务器使用了 localhost(127.0.0.1)这个网络地址,该地址表示的是本地机器上的本地机器的地址。 + +套接字以流的形式(下面将会讨论到)被配置为双向的,并且其控制遵循 C/S(客户端/服务器端)模式:客户端通过尝试连接一个服务器来初始化对话,而服务器端将尝试接受该连接。假如万事顺利,来自客户端的请求和来自服务器端的响应将通过管道进行传输,直到其中任意一方关闭该通道,从而断开这个连接。 + +一个`迭代服务器`(只适用于开发)将一直和连接它的客户端打交道:从最开始服务第一个客户端,然后到这个连接关闭,然后服务第二个客户端,循环往复。这种方式的一个缺点是处理一个特定的客户端可能会一直持续下去,使得其他的客户端一直在后面等待。生产级别的服务器将是并发的,通常使用了多进程或者多线程的混合。例如,我台式机上的 Nginx 网络服务器有一个 4 个 worker 的进程池,它们可以并发地处理客户端的请求。在下面的代码示例中,我们将使用迭代服务器,使得我们将要处理的问题达到一个很小的规模,只关注基本的 API,而不去关心并发的问题。 + +最后,随着各种 POSIX 改进的出现,套接字 API 随着时间的推移而发生了显著的变化。当前针对服务器端和客户端的示例代码特意写的比较简单,但是它着重强调了基于流的套接字中连接的双方。下面是关于流控制的一个总结,其中服务器端在一个终端中开启,而客户端在另一个不同的终端中开启: + + * 服务器端等待客户端的连接,对于给定的一个成功连接,它就读取来自客户端的数据。 + * 为了强调是双方的会话,服务器端会对接收自客户端的数据做回应。这些数据都是 ASCII 字符代码,它们组成了一些书的标题。 + * 客户端将书的标题写给服务器端的进程,并从服务器端的回应中读取到相同的标题。然后客户端和服务器端都在屏幕上打印出标题。下面是服务器端的输出,客户端的输出也和它完全一样: + +``` +Listening on port 9876 for clients... +War and Peace +Pride and Prejudice +The Sound and the Fury +``` + +#### 示例 1. 使用套接字的客户端程序 + +```c +#include +#include +#include +#include +#include +#include +#include +#include +#include "sock.h" + +void report(const char* msg, int terminate) { + perror(msg); + if (terminate) exit(-1); /* failure */ +} + +int main() { + int fd = socket(AF_INET, /* network versus AF_LOCAL */ + SOCK_STREAM, /* reliable, bidirectional: TCP */ + 0); /* system picks underlying protocol */ + if (fd < 0) report("socket", 1); /* terminate */ + + /* bind the server's local address in memory */ + struct sockaddr_in saddr; + memset(&saddr, 0, sizeof(saddr)); /* clear the bytes */ + saddr.sin_family = AF_INET; /* versus AF_LOCAL */ + saddr.sin_addr.s_addr = htonl(INADDR_ANY); /* host-to-network endian */ + saddr.sin_port = htons(PortNumber); /* for listening */ + + if (bind(fd, (struct sockaddr *) &saddr, sizeof(saddr)) < 0) + report("bind", 1); /* terminate */ + + /* listen to the socket */ + if (listen(fd, MaxConnects) < 0) /* listen for clients, up to MaxConnects */ + report("listen", 1); /* terminate */ + + fprintf(stderr, "Listening on port %i for clients...\n", PortNumber); + /* a server traditionally listens indefinitely */ + while (1) { + struct sockaddr_in caddr; /* client address */ + int len = sizeof(caddr); /* address length could change */ + + int client_fd = accept(fd, (struct sockaddr*) &caddr, &len); /* accept blocks */ + if (client_fd < 0) { + report("accept", 0); /* don't terminated, though there's a problem */ + continue; + } + + /* read from client */ + int i; + for (i = 0; i < ConversationLen; i++) { + char buffer[BuffSize + 1]; + memset(buffer, '\0', sizeof(buffer)); + int count = read(client_fd, buffer, sizeof(buffer)); + if (count > 0) { + puts(buffer); + write(client_fd, buffer, sizeof(buffer)); /* echo as confirmation */ + } + } + close(client_fd); /* break connection */ + } /* while(1) */ + return 0; +} +``` + +上面的服务器端程序执行典型的 4 个步骤来准备回应客户端的请求,然后接受其他的独立请求。这里每一个步骤都以服务器端程序调用的系统函数来命名。 + + 1. `socket(…)` : 为套接字连接获取一个文件描述符 + 2. `bind(…)` : 将套接字和服务器主机上的一个地址进行绑定 + 3. `listen(…)` : 监听客户端请求 + 4. `accept(…)` :接受一个特定的客户端请求 + +上面的 `socket` 调用的完整形式为: + +``` +int sockfd = socket(AF_INET,      /* versus AF_LOCAL */ +                    SOCK_STREAM,  /* reliable, bidirectional */ +                    0);           /* system picks protocol (TCP) */ +``` + +第一个参数特别指定了使用的是一个网络套接字,而不是 IPC 套接字。对于第二个参数有多种选项,但 `SOCK_STREAM` 和 `SOCK_DGRAM`(数据报)是最为常用的。基于流的套接字支持可信通道,在这种通道中如果发生了信息的丢失或者更改,都将会被报告。这种通道是双向的,并且从一端到另外一端的有效载荷在大小上可以是任意的。相反的,基于数据报的套接字大多是不可信的,没有方向性,并且需要固定大小的载荷。`socket` 的第三个参数特别指定了协议。对于这里展示的基于流的套接字,只有一种协议选择:TCP,在这里表示的 `0`;。因为对 `socket` 的一次成功调用将返回相似的文件描述符,一个套接字将会被读写,对应的语法和读写一个本地文件是类似的。 + +对 `bind` 的调用是最为复杂的,因为它反映出了在套接字 API 方面上的各种改进。我们感兴趣的点是这个调用将一个套接字和服务器端所在机器中的一个内存地址进行绑定。但对 `listen` 的调用就非常直接了: + +``` +if (listen(fd, MaxConnects) < 0) +``` + +第一个参数是套接字的文件描述符,第二个参数则指定了在服务器端处理一个拒绝连接错误之前,有多少个客户端连接被允许连接。(在头文件 `sock.h` 中 `MaxConnects` 的值被设置为 `8`。) + +`accept` 调用默认将是一个拥塞等待:服务器端将不做任何事情直到一个客户端尝试连接它,然后进行处理。`accept` 函数返回的值如果是 `-1` 则暗示有错误发生。假如这个调用是成功的,则它将返回另一个文件描述符,这个文件描述符被用来指代另一个可读可写的套接字,它与 `accept` 调用中的第一个参数对应的接收套接字有所不同。服务器端使用这个可读可写的套接字来从客户端读取请求然后写回它的回应。接收套接字只被用于接受客户端的连接。 + +在设计上,一个服务器端可以一直运行下去。当然服务器端可以通过在命令行中使用 `Ctrl+C` 来终止它。 + +#### 示例 2. 使用套接字的客户端 + +```c +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sock.h" + +const char* books[] = {"War and Peace", + "Pride and Prejudice", + "The Sound and the Fury"}; + +void report(const char* msg, int terminate) { + perror(msg); + if (terminate) exit(-1); /* failure */ +} + +int main() { + /* fd for the socket */ + int sockfd = socket(AF_INET, /* versus AF_LOCAL */ + SOCK_STREAM, /* reliable, bidirectional */ + 0); /* system picks protocol (TCP) */ + if (sockfd < 0) report("socket", 1); /* terminate */ + + /* get the address of the host */ + struct hostent* hptr = gethostbyname(Host); /* localhost: 127.0.0.1 */ + if (!hptr) report("gethostbyname", 1); /* is hptr NULL? */ + if (hptr->h_addrtype != AF_INET) /* versus AF_LOCAL */ + report("bad address family", 1); + + /* connect to the server: configure server's address 1st */ + struct sockaddr_in saddr; + memset(&saddr, 0, sizeof(saddr)); + saddr.sin_family = AF_INET; + saddr.sin_addr.s_addr = + ((struct in_addr*) hptr->h_addr_list[0])->s_addr; + saddr.sin_port = htons(PortNumber); /* port number in big-endian */ + + if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) + report("connect", 1); + + /* Write some stuff and read the echoes. */ + puts("Connect to server, about to write some stuff..."); + int i; + for (i = 0; i < ConversationLen; i++) { + if (write(sockfd, books[i], strlen(books[i])) > 0) { + /* get confirmation echoed from server and print */ + char buffer[BuffSize + 1]; + memset(buffer, '\0', sizeof(buffer)); + if (read(sockfd, buffer, sizeof(buffer)) > 0) + puts(buffer); + } + } + puts("Client done, about to exit..."); + close(sockfd); /* close the connection */ + return 0; +} +``` + +客户端程序的设置代码和服务器端类似。两者主要的区别既不是在于监听也不在于接收,而是连接: + +``` +if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) +``` + +对 `connect` 的调用可能因为多种原因而导致失败,例如客户端拥有错误的服务器端地址或者已经有太多的客户端连接上了服务器端。假如 `connect` 操作成功,客户端将在一个 `for` 循环中,写入它的响应然后读取返回的响应。在经过会话后,服务器端和客户端都将调用 `close` 去关闭可读可写套接字,尽管其中一个关闭操作已经足以关闭他们之间的连接,但此时客户端可能就此关闭,但正如前面提到的那样,服务器端将一直保持开放以处理其他事务。 + +从上面的套接示例中,我们看到了请求信息被返回给客户端,这使得客户端和服务器端之间拥有进行丰富对话的可能性。也许这就是套接字的主要魅力。在现代系统中,客户端应用(例如一个数据库客户端)和服务器端通过套接字进行通信非常常见。正如先前提及的那样,本地 IPC 套接字和网络套接字只在某些实现细节上面有所不同,一般来说,IPC 套接字有着更低的消耗和更好的性能。它们的通信 API 基本是一样的。 + +### 信号 + +一个信号中断了一个正在执行的程序,在这种意义下,就是用信号与这个程序进行通信。大多数的信号要么可以被忽略(阻塞)或者被处理(通过特别设计的代码)。`SIGSTOP` (暂停)和 `SIGKILL`(立即停止)是最应该提及的两种信号。符号常数拥有整数类型的值,例如 `SIGKILL` 对应的值为 `9`。 + +信号可以在与用户交互的情况下发生。例如,一个用户从命令行中敲了 `Ctrl+C` 来从命令行中终止一个程序;`Ctrl+C` 将产生一个 `SIGTERM` 信号。针对终止,`SIGTERM` 信号可以被阻塞或者被处理,而不像 `SIGKILL` 信号那样。一个进程也可以通过信号和另一个进程通信,这样使得信号也可以作为一种 IPC 机制。 + +考虑一下一个多进程应用,例如 Nginx 网络服务器是如何被另一个进程优雅地关闭的。`kill` 函数: + +``` +int kill(pid_t pid, int signum); /* declaration */ +``` +bei +可以被一个进程用来终止另一个进程或者一组进程。假如 `kill` 函数的第一个参数是大于 `0` 的,那么这个参数将会被认为是目标进程的 pid(进程 ID),假如这个参数是 `0`,则这个参数将会被识别为信号发送者所属的那组进程。 + +`kill` 的第二个参数要么是一个标准的信号数字(例如 `SIGTERM` 或 `SIGKILL`),要么是 `0` ,这将会对信号做一次询问,确认第一个参数中的 pid 是否是有效的。这样将一个多进程应用的优雅地关闭就可以通过向组成该应用的一组进程发送一个终止信号来完成,具体来说就是调用一个 `kill` 函数,使得这个调用的第二个参数是 `SIGTERM` 。(Nginx 主进程可以通过调用 `kill` 函数来终止其他 worker 进程,然后再停止自己。)就像许多库函数一样,`kill` 函数通过一个简单的可变语法拥有更多的能力和灵活性。 + +#### 示例 3. 一个多进程系统的优雅停止 + +```c +#include +#include +#include +#include +#include + +void graceful(int signum) { +  printf("\tChild confirming received signal: %i\n", signum); +  puts("\tChild about to terminate gracefully..."); +  sleep(1); +  puts("\tChild terminating now..."); +  _exit(0); /* fast-track notification of parent */ +} + +void set_handler() { +  struct sigaction current; +  sigemptyset(¤t.sa_mask);         /* clear the signal set */ +  current.sa_flags = 0;                  /* enables setting sa_handler, not sa_action */ +  current.sa_handler = graceful;         /* specify a handler */ +  sigaction(SIGTERM, ¤t, NULL);    /* register the handler */ +} + +void child_code() { +  set_handler(); + +  while (1) {   /` loop until interrupted `/ +    sleep(1); +    puts("\tChild just woke up, but going back to sleep."); +  } +} + +void parent_code(pid_t cpid) { +  puts("Parent sleeping for a time..."); +  sleep(5); + +  /* Try to terminate child. */ +  if (-1 == kill(cpid, SIGTERM)) { +    perror("kill"); +    exit(-1); +  } +  wait(NULL); /` wait for child to terminate `/ +  puts("My child terminated, about to exit myself..."); +} + +int main() { +  pid_t pid = fork(); +  if (pid < 0) { +    perror("fork"); +    return -1; /* error */ +  } +  if (0 == pid) +    child_code(); +  else +    parent_code(pid); +  return 0;  /* normal */ +} +``` + +上面的停止程序模拟了一个多进程系统的优雅退出,在这个例子中,这个系统由一个父进程和一个子进程组成。这次模拟的工作流程如下: + + * 父进程尝试去 fork 一个子进程。假如这个 fork 操作成功了,每个进程就执行它自己的代码:子进程就执行函数 `child_code`,而父进程就执行函数 `parent_code`。 + * 子进程将会进入一个潜在的无限循环,在这个循环中子进程将睡眠一秒,然后打印一个信息,接着再次进入睡眠状态,以此循环往复。来自父进程的一个 `SIGTERM` 信号将引起子进程去执行一个信号处理回调函数 `graceful`。这样这个信号就使得子进程可以跳出循环,然后进行子进程和父进程之间的优雅终止。在终止之前子,进程将打印一个信息。 + * 在 fork 一个子进程后,父进程将睡眠 5 秒,使得子进程可以执行一会儿;当然在这个模拟中,子进程大多数时间都在睡眠。然后父进程调用 `SIGTERM` 作为第二个参数的 `kill` 函数,等待子进程的终止,然后自己再终止。 + +下面是一次运行的输出: + +``` +% ./shutdown +Parent sleeping for a time... +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child confirming received signal: 15  ## SIGTERM is 15 +        Child about to terminate gracefully... +        Child terminating now... +My child terminated, about to exit myself... +``` + +对于信号的处理,上面的示例使用了 `sigaction` 库函数(POSIX 推荐的用法)而不是传统的 `signal` 函数,`signal` 函数有轻便性问题。下面是我们主要关心的代码片段: + + * 假如对 `fork` 的调用成功了,父进程将执行 `parent_code` 函数,而子进程将执行 `child_code` 函数。在给子进程发送信号之前,父进程将会等待 5 秒: + +``` + puts("Parent sleeping for a time..."); +sleep(5); +if (-1 == kill(cpid, SIGTERM)) { +...sleepkillcpidSIGTERM... +``` + +假如 `kill` 调用成功了,父进程将在子进程终止时做等待,使得子进程不会变成一个僵尸进程。在等待完成后,父进程再退出。 + * `child_code` 函数首先调用 `set_handler` 然后进入它的可能永久睡眠的循环。下面是我们将要查看的 `set_handler` 函数: + +``` + void set_handler() { +  struct sigaction current;            /* current setup */ +  sigemptyset(¤t.sa_mask);       /* clear the signal set */ +  current.sa_flags = 0;                /* for setting sa_handler, not sa_action */ +  current.sa_handler = graceful;       /* specify a handler */ +  sigaction(SIGTERM, ¤t, NULL);  /* register the handler */ +} +``` + +上面代码的前三行在做相关的准备。第四个语句将为 `graceful` 设定 handler ,它将在调用 `_exit` 来停止之前打印一些信息。第 5 行和最后一行的语句将通过调用 `sigaction` 来向系统注册上面的 handler。`sigaction` 的第一个参数是 `SIGTERM` ,用作终止;第二个参数是当前的 `sigaction` 设定,而最后的参数(在这个例子中是 `NULL` )可被用来保存前面的 `sigaction` 设定,以备后面的可能使用。 + +使用信号来作为 IPC 的确是一个很轻量的方法,但确实值得尝试。通过信号来做 IPC 显然可以被归入 IPC 工具箱中。 + +### 这个系列的总结 + +在这个系列中,我们通过三篇有关 IPC 的文章,用示例代码介绍了如下机制: + * 共享文件 + * 共享内存(通过信号量) + * 管道(有名和无名) + * 消息队列 + * 套接字 + * 信号 + +甚至在今天,在以线程为中心的语言,例如 Java、C# 和 Go 等变得越来越流行的情况下,IPC 仍然很受欢迎,因为相比于使用多线程,通过多进程来实现并发有着一个明显的优势:默认情况下,每个进程都有它自己的地址空间,除非使用了基于共享内存的 IPC 机制(为了达到安全的并发,竞争条件在多线程和多进程的时候必须被加上锁。),在多进程中可以排除掉基于内存的竞争条件。对于任何一个写过甚至是通过共享变量来通信的基本多线程程序的人来说,TA 都会知道想要写一个清晰、高效、线程安全的代码是多么具有挑战性。使用单线程的多进程的确是很有吸引力的,这是一个切实可行的方式,使用它可以利用好今天多处理器的机器,而不需要面临基于内存的竞争条件的风险。 + +当然,没有一个简单的答案能够回答上述 IPC 机制中的哪一个更好。在编程中每一种 IPC 机制都会涉及到一个取舍问题:是追求简洁,还是追求功能强大。以信号来举例,它是一个相对简单的 IPC 机制,但并不支持多个进程之间的丰富对话。假如确实需要这样的对话,另外的选择可能会更合适一些。带有锁的共享文件则相对直接,但是当要处理大量共享的数据流时,共享文件并不能很高效地工作。管道,甚至是套接字,有着更复杂的 API,可能是更好的选择。让具体的问题去指导我们的选择吧。 + +尽管所有的示例代码(可以在[我的网站][4]上获取到)都是使用 C 写的,其他的编程语言也经常提供这些 IPC 机制的轻量包装。这些代码示例都足够短小简单,希望这样能够鼓励你去进行实验。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-networking + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Inter-process_communication +[2]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 +[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-2 +[4]: http://condor.depaul.edu/mkalin From b7b6513e4b8c62490a23dbd42c1d28628829c1f7 Mon Sep 17 00:00:00 2001 From: Beini Gu Date: Fri, 24 May 2019 13:03:40 -0400 Subject: [PATCH 0585/1154] Finish translating --- ... source alternatives to Adobe Lightroom.md | 84 ------------------- ... source alternatives to Adobe Lightroom.md | 83 ++++++++++++++++++ 2 files changed, 83 insertions(+), 84 deletions(-) delete mode 100644 sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md create mode 100644 translated/tech/20180611 3 open source alternatives to Adobe Lightroom.md diff --git a/sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md b/sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md deleted file mode 100644 index 664c054913..0000000000 --- a/sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md +++ /dev/null @@ -1,84 +0,0 @@ -3 open source alternatives to Adobe Lightroom -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/camera-photography-film.jpg?itok=oe2ixyu6) - -You wouldn't be wrong to wonder whether the smartphone, that modern jack-of-all-trades, is taking over photography. While that might be valid in the point-and-shoot camera market, there are a sizeable number of photography professionals and hobbyists who recognize that a camera that fits in your pocket can never replace a high-end DSLR camera and the depth, clarity, and realism of its photos. - -All of that power comes with a small price in terms of convenience; like negatives from traditional film cameras, the [raw image][1] files produced by DSLRs must be processed before they can be edited or printed. For this, a digital image processing application is indispensable, and the go-to application has been Adobe Lightroom. But for many reasons—including its expensive, subscription-based pricing model and its proprietary license—there's a lot of interest in open source and other alternatives. - -Lightroom has two main functions: processing raw image files and digital asset management (DAM)—organizing images with tags, ratings, and other metadata to make it easier to keep track of them. - -In this article, we'll look at three open source image processing applications: Darktable, LightZone, and RawTherapee. All of them have DAM capabilities, but none has Lightroom's machine learning-based image categorization and tagging features. If you're looking for more information about open source DAM software, check out Terry Hancock's article "[Digital asset management for an open movie project][2]," where he shares his research on software to organize multimedia files for his [_Lunatics!_][3] open movie project. - -### Darktable - -![Darktable][4] - -Like the other applications on our list, [darktable][5] processes raw images into usable file formats—it exports into JPEG, PNG, TIFF, PPM, PFM, and EXR, and it also supports Google and Facebook web albums, Flickr uploads, email attachments, and web gallery creation. - -Its 61 image operation modules allow you to adjust contrast, tone, exposure, color, noise, etc.; add watermarks; crop and rotate; and much more. As with the other applications described in this article, those edits are "non-destructive"—that is, your original raw image is preserved no matter how many tweaks and modifications you make. - -Darktable imports raw images from more than 400 cameras plus JPEG, CR2, DNG, OpenEXR, and PFM; images are managed in a database so you can filter and search using metadata including tags, ratings, and color. It's also available in 21 languages and is supported on Linux, MacOS, BSD, Solaris 11/GNOME, and Windows. (The [Windows port][6] is new, and darktable warns it may have "rough edges or missing functionality" compared to other versions.) - -Darktable is licensed under [GPLv3][7]; you can learn more by perusing its [features][8], viewing the [user manual][9], or accessing its [source code][10] on GitHub. - -### LightZone - -![LightZone's tool stack][11] - -As a non-destructive raw image processing tool, [LightZone][12] is similar to the other two applications on this list: it's cross-platform, operating on Windows, MacOS, and Linux, and it supports JPG and TIFF images in addition to raw. But it's also unique in several ways. - -For one thing, it started out in 2005 as a proprietary image processing tool and later became an open source project under a BSD license. Also, before you can download the application, you must register for a free account; this is so the LightZone development community can track downloads and build the community. (Approval is quick and automated, so it's not a large barrier.) - -Another difference is that image modifications are done using stackable tools, rather than filters (like most image-editing applications); tool stacks can be rearranged or removed, as well as saved and copied to a batch of images. You can also edit certain parts of an image using a vector-based tool or by selecting pixels based on color or brightness. - -You can get more information on LightZone by searching its [forums][13] or accessing its [source code][14] on GitHub. - -### RawTherapee - -![RawTherapee][15] - -[RawTherapee][16] is another popular open source ([GPL][17]) raw image processor worth your attention. Like darktable and LightZone, it is cross-platform (Windows, MacOS, and Linux) and implements edits in a non-destructive fashion, so you maintain access to your original raw image file no matter what filters or changes you make. - -RawTherapee uses a panel-based interface, including a history panel to keep track of your changes and revert to a previous point; a snapshot panel that allows you to work with multiple versions of a photo; and scrollable tool panels to easily select a tool without worrying about accidentally using the wrong one. Its tools offer a wide variety of exposure, color, detail, transformation, and demosaicing features. - -The application imports raw files from most cameras and is localized to more than 25 languages, making it widely usable. Features like batch processing and [SSE][18] optimizations improve speed and CPU performance. - -RawTherapee offers many other [features][19]; check out its [documentation][20] and [source code][21] for details. - -Do you use another open source raw image processing tool in your photography? Do you have any related tips or suggestions for other photographers? If so, please share your recommendations in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/alternatives/adobe-lightroom - -作者:[Opensource.com][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com -[1]:https://en.wikipedia.org/wiki/Raw_image_format -[2]:https://opensource.com/article/18/3/movie-open-source-software -[3]:http://lunatics.tv/ -[4]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_darkroom1.jpg?itok=0fjk37tC (Darktable) -[5]:http://www.darktable.org/ -[6]:https://www.darktable.org/about/faq/#faq-windows -[7]:https://github.com/darktable-org/darktable/blob/master/LICENSE -[8]:https://www.darktable.org/about/features/ -[9]:https://www.darktable.org/resources/ -[10]:https://github.com/darktable-org/darktable -[11]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_lightzone1tookstack.jpg?itok=1e3s85CZ (LightZone's tool stack) -[12]:http://www.lightzoneproject.org/ -[13]:http://www.lightzoneproject.org/Forum -[14]:https://github.com/ktgw0316/LightZone -[15]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_rawtherapee.jpg?itok=meiuLxPw (RawTherapee) -[16]:http://rawtherapee.com/ -[17]:https://github.com/Beep6581/RawTherapee/blob/dev/LICENSE.txt -[18]:https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions -[19]:http://rawpedia.rawtherapee.com/Features -[20]:http://rawpedia.rawtherapee.com/Main_Page -[21]:https://github.com/Beep6581/RawTherapee diff --git a/translated/tech/20180611 3 open source alternatives to Adobe Lightroom.md b/translated/tech/20180611 3 open source alternatives to Adobe Lightroom.md new file mode 100644 index 0000000000..1ac86027b9 --- /dev/null +++ b/translated/tech/20180611 3 open source alternatives to Adobe Lightroom.md @@ -0,0 +1,83 @@ +# Adobe Lightroom 的三个开源替代 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/camera-photography-film.jpg?itok=oe2ixyu6) + +如今智能手机的摄像功能已经完备到多数人认为可以代替传统摄影了。虽然这在傻瓜相机的市场中是个事实,但是对于许多摄影爱好者和专业摄影师看来,一个高端单反相机所能带来的照片景深,清晰度以及真实质感是无法和口袋中的智能手机相比的。 + +所有的这些功能在便利性上仅有很小的代价;就像传统的胶片相机中的反色负片,单反照相得到的RAW格式文件必须预先处理才能印刷或编辑;因此对于单反相机,照片的后期处理是无可替代的,因此Adobe Lightroom便无可替代。但是Adobe Lightroom的昂贵价格,月付的订阅费用以及专有许可证都使更多人开始关注其开源替代的软件。 + +Lightroom 有两大主要功能:处理 RAW 格式的图片文件,以及数字资产管理系统(DAM:Digital Asset Management) —— 通过标签,评星以及其他的元数据信息来简单清晰地整理照片。 + +在这篇文章中,我们将介绍三个开源的图片处理软件:Darktable,LightZone 以及 RawTherapee。所有的软件都有 DAM 系统,但没有任何一个有 Lightroom 基于机器学习的图像分类和标签功能。如果你想要知道更多关于 开源的 DAM 系统的软件,可以看 Terry Hacock 的文章:"[开源项目的 DAM 管理][2]“,他分享了他在自己的 [_Lunatics!_][3] 电影项目研究过的开源多媒体软件。 + +### Darktable + +![Darktable][4] + +类似其他两个软件,darktable 可以处理RAW 格式的图像并将他们转换成可用的文件格式—— JPEG,PNG,TIFF, PPM, PFM 和 EXR,它同时支持Google 和 Facebook 的在线相册,上传至Flikr,通过邮件附件发送以及创建在线相册。 + +它有 61 个图像处理模块,可以调整图像的对比度、色调、明暗、色彩、噪点;添加水印;切割以及旋转;等等。如同另外两个软件一样,不论你做出多少次修改,这些修改都是”无损的“ —— 你的初始 RAW 图像文件始终会被保存。 + +Darktable 可以从 400 多种相机型号中直接导入照片,以及有 JPEG,CR2,DNG ,OpenEXR和PFM等格式的支持。图像在一个数据库中显示,因此你可以轻易地filter并查询这些元数据,包括了文字标签,评星以及颜色标签。软件同时支持21种语言,支持 Linux,MacOS,BSD,Solaris 11/GNOME 以及 Windows (Windows 版本是最新发布的,Darktable 声明它比起其他版本可能还有一些不完备之处,有一些未实现的功能) + +Darktable 在开源证书 [GPLv3][7] 下被公开,你可以了解更多它的 [特性][8],查阅它的 [用户手册][9],或者直接去 Github 上看[源代码][10] 。 + +### LightZone + +![LightZone's tool stack][11] + + [LightZone][12] 和其他两个软件类似同样是无损的 RAW 格式图像处理工具:它跨平台,有 Windows,MacOS 和 Linux 版本,除 RAW 格式之外,它还支持 JPG 和 TIFF 格式的图像处理。接下来说LightZone 其他的特性。 + +这个软件最初是一个在专有许可证下的图像处理软件,后来在 BSD 证书下开源。以及,在你下载这个软件之前,你必须注册一个免费账号。因此 LightZone的 开发团队可以跟踪软件的下载数量以及建立相关社区。(许可很快,而且是自动的,因此这不是一个很大的使用障碍。) + +除此之外的一个特性是这个软件的图像处理通常是通过很多可组合的工具实现的,而不是叠加滤镜(就像大多数图像处理软件),这些工具组可以被重新编排以及移除,以及被保存并且复制到另一些图像。如果想要编辑图片的一部分,你还可以通过矢量工具或者根据色彩和亮度来选择像素。 + +想要了解更多,见 LightZone 的[论坛][13] 或者查看Github上的 [源代码][14]。 + +### RawTherapee + +![RawTherapee][15] + +[RawTherapee][16] 是另一个开源([GPL][17])的RAW图像处理器。就像 Darktable 和 LightZone,它是跨平台的(支持 Windows,MacOS 和 Linux),一切修改都在无损条件下进行,因此不论你叠加多少滤镜做出多少改变,你都可以回到你最初的 RAW 文件。 + +RawTherapee 采用的是一个面板式的界面,包括一个历史记录面板来跟踪你做出的修改方便随时回到先前的图像;一个快照面板可以让你同时处理一张照片的不同版本;一个可滚动的工具面板方便准确选择工具。这些工具包括了一系列的调整曝光、色彩、细节、图像变换以及去马赛克功能。 + +这个软件可以从多数相机直接导入 RAW 文件,并且支持超过25种语言得以广泛使用。批量处理以及 [SSE][18] 优化这类功能也进一步提高了图像处理的速度以及 CPU 性能。 + +RawTherapee 还提供了很多其他 [功能][19];可以查看它的 [官方文档][20] 以及 [源代码][21] 了解更多细节。 + +你是否在摄影中使用另一个开源的 RAW图像处理工具?有任何建议和推荐都可以在评论中分享。 + +------ + +via: https://opensource.com/alternatives/adobe-lightroom + +作者:[Opensource.com][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[scoutydren](https://github.com/scoutydren) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com +[1]: https://en.wikipedia.org/wiki/Raw_image_format +[2]: https://opensource.com/article/18/3/movie-open-source-software +[3]: http://lunatics.tv/ +[4]: https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_darkroom1.jpg?itok=0fjk37tC "Darktable" +[5]: http://www.darktable.org/ +[6]: https://www.darktable.org/about/faq/#faq-windows +[7]: https://github.com/darktable-org/darktable/blob/master/LICENSE +[8]: https://www.darktable.org/about/features/ +[9]: https://www.darktable.org/resources/ +[10]: https://github.com/darktable-org/darktable +[11]: https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_lightzone1tookstack.jpg?itok=1e3s85CZ "LightZone's tool stack" +[12]: http://www.lightzoneproject.org/ +[13]: http://www.lightzoneproject.org/Forum +[14]: https://github.com/ktgw0316/LightZone +[15]: https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_rawtherapee.jpg?itok=meiuLxPw "RawTherapee" +[16]: http://rawtherapee.com/ +[17]: https://github.com/Beep6581/RawTherapee/blob/dev/LICENSE.txt +[18]: https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions +[19]: http://rawpedia.rawtherapee.com/Features +[20]: http://rawpedia.rawtherapee.com/Main_Page +[21]: https://github.com/Beep6581/RawTherapee From 0578939e4f4c5268929e13cb7340c8cc3967eb27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sat, 25 May 2019 09:39:51 +0800 Subject: [PATCH 0586/1154] Translanting --- sources/tech/20190329 How to manage your Linux environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190329 How to manage your Linux environment.md b/sources/tech/20190329 How to manage your Linux environment.md index 2c4ca113e3..74aab10896 100644 --- a/sources/tech/20190329 How to manage your Linux environment.md +++ b/sources/tech/20190329 How to manage your Linux environment.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 18e154f7dd4ca57ab26bcefdd6458f9623e861de Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 May 2019 10:14:14 +0800 Subject: [PATCH 0587/1154] PRF:20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @zhs852 --- ...odes in Ubuntu with Slimbook Battery Optimizer.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md index bf57e58d12..08355ef70e 100644 --- a/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md +++ b/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (zhs852) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Change Power Modes in Ubuntu with Slimbook Battery Optimizer) [#]: via: (https://itsfoss.com/slimbook-battry-optimizer-ubuntu/) -[#]: author: Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) 在 Ubuntu 中使用 Slimbook Battery Optimizer 切换电源模式 ====== -> Slimbook Battery Optimizer 是一个美观实用的指示器小程序,它可以让你你在安装 Linux 的笔记本上快速切换电源模式来延长续航时间。 +> Slimbook Battery Optimizer 是一个美观实用的指示器小程序,它可以让你在安装了 Linux 的笔记本上快速切换电源模式来延长续航时间。 -[Slimbook][1] 是一个销售 [预装 Linux 的笔电][2] 的西班牙电脑制造商,他们发布了一款好用的小程序,用来在基于 Ubuntu 的 Linux 发行版下调整电池性能。 +[Slimbook][1] 是一个销售 [预装 Linux 的笔记本电脑][2] 的西班牙电脑制造商,他们发布了一款好用的小程序,用来在基于 Ubuntu 的 Linux 发行版下调整电池性能。 因为 Slimbook 销售他们自己的 Linux 系统,所以他们制作了一些在 Linux 上用于调整他们自己硬件性能的小工具。Battery Optimizer 就是这样一个工具。 @@ -46,8 +46,6 @@ Slimbook 有专门为多种电源管理参数提供的页面。如果你希望 总的来说,Slimbook Battery 是一个小巧精美的软件,你可以用它来快速切换电源模式。如果你决定在 Ubuntu 及其衍生发行版上(比如 Linux Mint 或 elementary OS 等),你可以使用官方 [PPA 源][8]。 -说个题外话,推荐阅读大家阅读 [Ubuntu 论坛被入侵,用户数据被盗取][9] 这篇文章。 - #### 在基于 Ubuntu 的发行版上安装 Slimbook Battery 打开终端,一步一步地使用以下命令: @@ -86,7 +84,7 @@ via: https://itsfoss.com/slimbook-battry-optimizer-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[zhs852](https://github.com/zhs852) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5fa30ba853b2545969500471c3103478ff5a7249 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 May 2019 10:15:21 +0800 Subject: [PATCH 0588/1154] PUB:20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @zhs852 https://linux.cn/article-10897-1.html --- ...e Power Modes in Ubuntu with Slimbook Battery Optimizer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md (98%) diff --git a/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/published/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md similarity index 98% rename from translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md rename to published/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md index 08355ef70e..15c51dc608 100644 --- a/translated/tech/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md +++ b/published/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (zhs852) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10897-1.html) [#]: subject: (Change Power Modes in Ubuntu with Slimbook Battery Optimizer) [#]: via: (https://itsfoss.com/slimbook-battry-optimizer-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 78a8ad139ab1f280f7d9d7ec35c15712dfa976b0 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 25 May 2019 16:11:51 +0800 Subject: [PATCH 0589/1154] translating by MjSeven --- ... Command Line Tool To Search DuckDuckGo From The Terminal.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md b/sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md index 555a475651..b4f891d16c 100644 --- a/sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md +++ b/sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md @@ -1,3 +1,5 @@ +Translating by MjSeve + ddgr – A Command Line Tool To Search DuckDuckGo From The Terminal ====== Bash tricks are really awesome in Linux that makes everything is possible in Linux. From 863f765617a2cd8dd6f1d4b500ed5c8be1bd42ba Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 May 2019 10:47:09 +0800 Subject: [PATCH 0590/1154] PRF:20180429 The Easiest PDO Tutorial (Basics).md @MjSeven --- ...80429 The Easiest PDO Tutorial (Basics).md | 167 ++++++++---------- 1 file changed, 76 insertions(+), 91 deletions(-) diff --git a/translated/tech/20180429 The Easiest PDO Tutorial (Basics).md b/translated/tech/20180429 The Easiest PDO Tutorial (Basics).md index df3e8581e3..cadc526b0f 100644 --- a/translated/tech/20180429 The Easiest PDO Tutorial (Basics).md +++ b/translated/tech/20180429 The Easiest PDO Tutorial (Basics).md @@ -1,20 +1,20 @@ -最简单的 PDO 教程(基础知识) +PHP PDO 简单教程 ====== ![](http://www.theitstuff.com/wp-content/uploads/2018/04/php-language.jpg) -大约 80% 的 Web 应用程序由 PHP 提供支持。类似地,SQL 也是如此。PHP 5.5 版本之前,我们有用于访问 mysql 数据库的 **mysql_** 命令,但由于安全性不足,它们最终被弃用。 +大约 80% 的 Web 应用程序由 PHP 提供支持。类似地,SQL 也是如此。PHP 5.5 版本之前,我们有用于访问 MySQL 数据库的 mysql_ 命令,但由于安全性不足,它们最终被弃用。 -**这发生在 2013 年的 PHP 5.5 上,我写这篇文章的时间是 2018 年,PHP 版本为 7.2。mysql_** 的弃用带来了访问数据库的两种主要方法:**mysqli** 和 **PDO** 库。 +弃用这件事是发生在 2013 年的 PHP 5.5 上,我写这篇文章的时间是 2018 年,PHP 版本为 7.2。mysql_ 的弃用带来了访问数据库的两种主要方法:mysqli 和 PDO 库。 虽然 mysqli 库是官方指定的,但由于 mysqli 只能支持 mysql 数据库,而 PDO 可以支持 12 种不同类型的数据库驱动程序,因此 PDO 获得了更多的赞誉。此外,PDO 还有其它一些特性,使其成为大多数开发人员的更好选择。你可以在下表中看到一些特性比较: | | PDO | MySQLi ---|---|--- -| **数据库支持** | 12 种驱动 | 只有 MySQL -| **范例** | OOP | 过程 + OOP -| **预处理语句(客户端侧)** | Yes | No -| **命名参数** | Yes | No +| 数据库支持 | 12 种驱动 | 只有 MySQL +| 范例 | OOP | 过程 + OOP +| 预处理语句(客户端侧) | Yes | No +| 1命名参数 | Yes | No 现在我想对于大多数开发人员来说,PDO 是首选的原因已经很清楚了。所以让我们深入研究它,并希望在本文中尽量涵盖关于 PDO 你需要的了解的。 @@ -24,51 +24,43 @@ 我们要做的第一件事是定义主机、数据库名称、用户名、密码和数据库字符集。 -`$host = 'localhost';` +``` +$host = 'localhost'; +$db = 'theitstuff'; +$user = 'root'; +$pass = 'root'; +$charset = 'utf8mb4'; +$dsn = "mysql:host=$host;dbname=$db;charset=$charset"; +$conn = new PDO($dsn, $user, $pass); +``` -`$db = 'theitstuff';` +之后,正如你在上面的代码中看到的,我们创建了 DSN 变量,DSN 变量只是一个保存数据库信息的变量。对于一些在外部服务器上运行 MySQL 的人,你还可以通过提供一个 `port=$port_number` 来调整端口号。 -`$user = 'root';` - -`$pass = 'root';` - -`$charset = 'utf8mb4';` - -`$dsn = "mysql:host=$host;dbname=$db;charset=$charset";` - -`$conn = new PDO($dsn, $user, $pass);` - -之后,正如你在上面的代码中看到的,我们创建了 **DSN** 变量,DSN 变量只是一个保存数据库信息的变量。对于一些在外部服务器上运行 mysql 的人,你还可以通过提供一个 **port=$port_number** 来调整端口号。 - -最后,你可以创建一个 PDO 类的实例,我使用了 **\$conn** 变量,并提供了 **\$dsn、\$user、\$pass** 参数。如果你遵循这些步骤,你现在应该有一个名为 $conn 的对象,它是 PDO 连接类的一个实例。现在是时候进入数据库并运行一些查询。 +最后,你可以创建一个 PDO 类的实例,我使用了 `$conn` 变量,并提供了 `$dsn`、`$user`、`$pass` 参数。如果你遵循这些步骤,你现在应该有一个名为 `$conn` 的对象,它是 PDO 连接类的一个实例。现在是时候进入数据库并运行一些查询。 ### 一个简单的 SQL 查询 现在让我们运行一个简单的 SQL 查询。 -`$tis = $conn->query('SELECT name, age FROM students');` +``` +$tis = $conn->query('SELECT name, age FROM students'); +while ($row = $tis->fetch()) +{ + echo $row['name']."\t"; + echo $row['age']; + echo "
"; +} +``` -`while ($row = $tis->fetch())` +这是使用 PDO 运行查询的最简单形式。我们首先创建了一个名为 `tis`(TheITStuff 的缩写 )的变量,然后你可以看到我们使用了创建的 `$conn` 对象中的查询函数。 -`{` - -`echo $row['name']."\t";` - -`echo $row['age'];` - -`echo "
";` - -`}` - -这是使用 PDO 运行查询的最简单形式。我们首先创建了一个名为 **tis(TheITStuff 的缩写 )** 的变量,然后你可以看到我们使用了创建的 $conn 对象中的查询函数。 - -然后我们运行一个 while 循环并创建了一个 **$row** 变量来从 **$tis** 对象中获取内容,最后通过调用列名来显示每一行。 +然后我们运行一个 `while` 循环并创建了一个 `$row` 变量来从 `$tis` 对象中获取内容,最后通过调用列名来显示每一行。 很简单,不是吗?现在让我们来看看预处理语句。 ### 预处理语句 -预处理语句是人们开始使用 PDO 的主要原因之一,因为它准备了可以阻止 SQL 注入的语句。 +预处理语句是人们开始使用 PDO 的主要原因之一,因为它提供了可以阻止 SQL 注入的语句。 有两种基本方法可供使用,你可以使用位置参数或命名参数。 @@ -76,83 +68,76 @@ 让我们看一个使用位置参数的查询示例。 -`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)");` +``` +$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)"); +$tis->bindValue(1,'mike'); +$tis->bindValue(2,22); +$tis->execute(); +``` -`$tis->bindValue(1,'mike');` +在上面的例子中,我们放置了两个问号,然后使用 `bindValue()` 函数将值映射到查询中。这些值绑定到语句问号中的位置。 -`$tis->bindValue(2,22);` +我还可以使用变量而不是直接提供值,通过使用 `bindParam()` 函数相同例子如下: -`$tis->execute();` - -在上面的例子中,我们放置了两个问号,然后使用 **bindValue()** 函数将值映射到查询中。这些值绑定到语句问号中的位置。 - -我还可以使用变量而不是直接提供值,通过使用 **bindParam()** 函数相同例子如下: - -`$name='Rishabh'; $age=20;` - -`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)");` - -`$tis->bindParam(1,$name);` - -`$tis->bindParam(2,$age);` - -`$tis->execute();` +``` +$name='Rishabh'; $age=20; +$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)"); +$tis->bindParam(1,$name); +$tis->bindParam(2,$age); +$tis->execute(); +``` ### 命名参数 命名参数也是预处理语句,它将值/变量映射到查询中的命名位置。由于没有位置绑定,因此在多次使用相同变量的查询中非常有效。 -`$name='Rishabh'; $age=20;` +``` +$name='Rishabh'; $age=20; +$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(:name, :age)"); +$tis->bindParam(':name', $name); +$tis->bindParam(':age', $age); +$tis->execute(); +``` -`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(:name, :age)");` +你可以注意到,唯一的变化是我使用 `:name` 和 `:age` 作为占位符,然后将变量映射到它们。冒号在参数之前使用,让 PDO 知道该位置是一个变量,这非常重要。 -`$tis->bindParam(':name', $name);` - -`$tis->bindParam(':age', $age);` - -`$tis->execute();` - -你可以注意到,唯一的变化是我使用 **:name** 和 **:age** 作为占位符,然后将变量映射到它们。冒号在参数之前使用,让 PDO 知道该位置是一个变量,这非常重要。 - -你也可以类似地使用 **bindValue()** 来使用命名参数直接映射值。 +你也可以类似地使用 `bindValue()` 来使用命名参数直接映射值。 ### 获取数据 PDO 在获取数据时非常丰富,它实际上提供了许多格式来从数据库中获取数据。 -你可以使用 **PDO::FETCH_ASSOC** 来获取关联数组,**PDO::FETCH_NUM** 来获取数字数组,使用 **PDO::FETCH_OBJ** 来获取对象数组。 +你可以使用 `PDO::FETCH_ASSOC` 来获取关联数组,`PDO::FETCH_NUM` 来获取数字数组,使用 `PDO::FETCH_OBJ` 来获取对象数组。 -`$tis = $conn->prepare("SELECT * FROM STUDENTS");` +``` +$tis = $conn->prepare("SELECT * FROM STUDENTS"); +$tis->execute(); +$result = $tis->fetchAll(PDO::FETCH_ASSOC); +``` -`$tis->execute();` - -`$result = $tis->fetchAll(PDO::FETCH_ASSOC);` - -你可以看到我使用了 **fetchAll**,因为我想要所有匹配的记录。如果只需要一行,你可以简单地使用 **fetch**。 +你可以看到我使用了 `fetchAll`,因为我想要所有匹配的记录。如果只需要一行,你可以简单地使用 `fetch`。 现在我们已经获取了数据,现在是时候循环它了,这非常简单。 -`foreach($result as $lnu){` - -`echo $lnu['name'];` - -`echo $lnu['age']."
";` - -`}` +``` +foreach ($result as $lnu){ + echo $lnu['name']; + echo $lnu['age']."
"; +} +``` 你可以看到,因为我请求了关联数组,所以我正在按名称访问各个成员。 -虽然在定义希望如何传输递数据方面没有要求,但在定义 conn 变量本身时,实际上可以将其设置为默认值。 +虽然在定义希望如何传输递数据方面没有要求,但在定义 `$conn` 变量本身时,实际上可以将其设置为默认值。 -你需要做的就是创建一个 options 数组,你可以在其中放入所有默认配置,只需在 conn 变量中传递数组即可。 +你需要做的就是创建一个 `$options` 数组,你可以在其中放入所有默认配置,只需在 `$conn` 变量中传递数组即可。 -`$options = [` - -` PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,` - -`];` - -`$conn = new PDO($dsn, $user, $pass, $options);` +``` +$options = [ + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, +]; +$conn = new PDO($dsn, $user, $pass, $options); +``` 这是一个非常简短和快速的 PDO 介绍,我们很快就会制作一个高级教程。如果你在理解本教程的任何部分时遇到任何困难,请在评论部分告诉我,我会在那你为你解答。 @@ -163,7 +148,7 @@ via: http://www.theitstuff.com/easiest-pdo-tutorial-basics 作者:[Rishabh Kandari][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a2b9d960a4caeb5d32c7cf789fc3815e104c681a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 May 2019 10:47:38 +0800 Subject: [PATCH 0591/1154] PUB:20180429 The Easiest PDO Tutorial (Basics).md @MjSeven https://linux.cn/article-10899-1.html --- .../20180429 The Easiest PDO Tutorial (Basics).md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180429 The Easiest PDO Tutorial (Basics).md (100%) diff --git a/translated/tech/20180429 The Easiest PDO Tutorial (Basics).md b/published/20180429 The Easiest PDO Tutorial (Basics).md similarity index 100% rename from translated/tech/20180429 The Easiest PDO Tutorial (Basics).md rename to published/20180429 The Easiest PDO Tutorial (Basics).md From d8863509c197508181042fd88c1b49fe1d5a8dfb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 May 2019 13:42:05 +0800 Subject: [PATCH 0592/1154] PRF:20190503 API evolution the right way.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @MjSeven 翻译的很好! --- .../20190503 API evolution the right way.md | 246 ++++++++---------- 1 file changed, 110 insertions(+), 136 deletions(-) diff --git a/translated/tech/20190503 API evolution the right way.md b/translated/tech/20190503 API evolution the right way.md index a999b724f5..b8ef4f9911 100644 --- a/translated/tech/20190503 API evolution the right way.md +++ b/translated/tech/20190503 API evolution the right way.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (API evolution the right way) @@ -9,20 +9,22 @@ API 演进的正确方式 ====== -负责任的库作者与其用户保持的十个约定。 -![Browser of things][1] -想象你是一个创造之神,为一个生物设计一个身体。出于仁慈,你希望这个生物能随着时间进化:首先,因为它必须对环境的变化作出反应,其次,因为你的智慧在增长,你想到了更好的设计。它不应该永远留在同一个身体里! +> 负责任的库作者与其用户的十个约定。 + +![Browser of things](https://img.linux.net.cn/data/attachment/album/201905/26/134131jnymeg7t7gmo6qcy.jpg) + +想象一下你是一个造物主,为一个生物设计一个身体。出于仁慈,你希望它能随着时间进化:首先,因为它必须对环境的变化作出反应;其次,因为你的智慧在增长,你对这个小东西想到了更好的设计,它不应该永远保持一个样子。 ![Serpents][2] -然而,该生物可能依赖于其目前解剖学的特征。你不能在没有警告的情况下添加翅膀或改变它的比例。它需要一个有序的过程来适应新的身体。作为一个负责任的设计师,你如何才能温柔地引导这种生物走向更大的进步呢? +然而,这个生物可能有赖于其目前解剖学的特征。你不能无所顾忌地添加翅膀或改变它的身材比例。它需要一个有序的过程来适应新的身体。作为一个负责任的设计者,你如何才能温柔地引导这种生物走向更大的进步呢? -对于负责任的库维护者也是如此。我们向依赖我们代码的人保证我们的承诺:我们发布 bug 修复和有用的新特性。如果对库的未来有利,我们有时会删除特性。我们不断创新,但我们不会破坏使用我们库的人的代码。我们怎样才能一次实现所有这些目标呢? +对于负责任的库维护者也是如此。我们向依赖我们代码的人保证我们的承诺:我们会发布 bug 修复和有用的新特性。如果对库的未来有利,我们有时会删除某些特性。我们会不断创新,但我们不会破坏使用我们库的人的代码。我们怎样才能一次实现所有这些目标呢? ### 添加有用的特性 -你的库不应该永远保持不变:你应该添加一些特性,使你的库更适合用户。例如,如果你有一个爬行动物类,并且有翅膀飞行是有用的,那就去添加吧。 +你的库不应该永远保持不变:你应该添加一些特性,使你的库更适合用户。例如,如果你有一个爬行动物类,并且如果有个可以飞行的翅膀是有用的,那就去添加吧。 ``` class Reptile: @@ -47,7 +49,8 @@ bool(datetime.time(0, 0)) == False 我已经写了十多年的 Python 了,但直到上周才发现这条规则。这种奇怪的行为会在用户代码中引起什么样的 bug? -考虑一个日历应用程序,它带有一个创建事件的函数。如果一个事件有一个结束时间,那么函数也应该要求它有一个开始时间。 +比如说一个日历应用程序,它带有一个创建事件的函数。如果一个事件有一个结束时间,那么函数也应该要求它有一个开始时间。 + ``` def create_event(day, start_time=None, @@ -61,7 +64,7 @@ create_event(datetime.date.today(), datetime.time(4, 0)) ``` -不幸的是,对于女巫来说,从午夜开始的事件无法通过验证。当然,一个了解午夜怪癖的细心程序员可以正确地编写这个函数。 +不幸的是,对于女巫来说,从午夜开始的事件无法通过校验。当然,一个了解午夜怪癖的细心程序员可以正确地编写这个函数。 ``` def create_event(day, @@ -71,13 +74,13 @@ def create_event(day, raise ValueError("Can't pass end_time without start_time") ``` -但这种微妙之处令人担忧。如果一个库作者想要创建一个对用户有害的 API,那么像午夜的布尔转换这样的“特性”很有效。 +但这种微妙之处令人担忧。如果一个库作者想要创建一个伤害用户的 API,那么像午夜的布尔转换这样的“特性”很有效。 ![Man being chased by an alligator][3] 但是,负责任的创建者的目标是使你的库易于正确使用。 -这个功能是由 Tim Peters 在 2002 年首次编写 datetime 模块时造成的。即时是像 Tim 这样的 Python 创始人也会犯错误。[这个怪异后来被消除了][4],现在所有时间的布尔值都是 True。 +这个功能是由 Tim Peters 在 2002 年首次编写 datetime 模块时造成的。即时是像 Tim 这样的奠基 Python 的高手也会犯错误。[这个怪异之处后来被消除了][4],现在所有时间的布尔值都是 True。 ``` # Python 3.5 以后 @@ -86,15 +89,15 @@ bool(datetime.time(9, 30)) == True bool(datetime.time(0, 0)) == True ``` -不知道午夜古怪之处的程序员现在可以从晦涩的 bug 中解脱出来,但是一想到任何依赖于古怪的旧行为的代码现在没有注意变化,我会感到紧张。如果根本不实现这个糟糕的特性,情况会更好。这就引出了库维护者的第一个承诺: +不知道午夜怪癖的古怪之处的程序员现在可以从这种晦涩的 bug 中解脱出来,但是一想到任何依赖于古怪的旧行为的代码现在没有注意变化,我就会感到紧张。如果从来没有实现这个糟糕的特性,情况会更好。这就引出了库维护者的第一个承诺: #### 第一个约定:避免糟糕的特性 -最痛苦的变化是你必须删除一个特性。一般来说,避免糟糕特性的一种方法是添加少的特性!没有充分的理由,不要使用公共方法、类、功能或属性。因此: +最痛苦的变化是你必须删除一个特性。一般来说,避免糟糕特性的一种方法是少添加特性!没有充分的理由,不要使用公共方法、类、功能或属性。因此: #### 第二个约定:最小化特性 -特性就像孩子:在充满激情的瞬间孕育,(to 校正:我怀疑作者在开车,可是我没有证据)它们必须得到多年的支持。不要因为你能做傻事就去做傻事。不要画蛇添足(to 校正:我认为这里内在是这个意思)! +特性就像孩子:在充满激情的瞬间孕育,但是它们必须要支持多年(LCTT 译注:我怀疑作者在开车,可是我没有证据)。不要因为你能做傻事就去做傻事。不要画蛇添足! ![Serpents with and without feathers][5] @@ -110,13 +113,14 @@ async def my_coroutine(): print(my_coroutine()) ``` + ``` ``` -你的代码必须 "await" 这个对象以此来运行协程。很容易忘记这一点,所以 asyncio 的开发人员想要一个“调试模式”来捕捉这个错误。但协程在没有 await 的情况下被销毁时,调试模式将打印一个警告,并在其创建的行上进行回溯。 +你的代码必须 “等待await” 这个对象以此来运行协程。人们很容易忘记这一点,所以 asyncio 的开发人员想要一个“调试模式”来捕捉这个错误。当协程在没有等待的情况下被销毁时,调试模式将打印一个警告,并在其创建的行上进行回溯。 -当 Yury Selivanov 实现调试模式时,他在其基础上添加了一个“协程装饰器”特性。装饰器是一个函数,它接收一个协程并返回所有内容。Yury 使用它在每个协程上安装警告逻辑,但是其他人可以使用它将协程转换为字符串 "hi!"。 +当 Yury Selivanov 实现调试模式时,他添加了一个“协程装饰器”的基础特性。装饰器是一个函数,它接收一个协程并返回任何内容。Yury 使用它在每个协程上接入警告逻辑,但是其他人可以使用它将协程转换为字符串 “hi!”。 ``` import sys @@ -131,15 +135,16 @@ async def my_coroutine(): print(my_coroutine()) ``` + ``` hi! ``` -这是一个地狱般的定制。它改变了 "async" 的含义。一次调用 `set_coroutine_wrapper` 将在全局永久改变所有的协程函数。正如 [Nathaniel Smith 所说][6]:“一个有问题的 API” 很容易被误用,必须被删除。如果异步开发人员能够更好地按照其目标来设计该特性,他们就可以避免删除该特性的痛苦。负责任的创建者必须牢记这一点: +这是一个地狱般的定制。它改变了 “异步async" 的含义。调用一次 `set_coroutine_wrapper` 将在全局永久改变所有的协程函数。正如 [Nathaniel Smith 所说][6]:“一个有问题的 API” 很容易被误用,必须被删除。如果 asyncio 开发人员能够更好地按照其目标来设计该特性,他们就可以避免删除该特性的痛苦。负责任的创建者必须牢记这一点: #### 第三个约定:保持特性单一 -幸运的是,Yury 有良好的判断力,他将特性标记为临时,所以 asyncio 用户知道不能依赖它。Nathaniel 可以用更单一的功能替换 **set_coroutine_wrapper** ,该特性只定制回溯深度。 +幸运的是,Yury 有良好的判断力,他将该特性标记为临时,所以 asyncio 用户知道不能依赖它。Nathaniel 可以用更单一的功能替换 `set_coroutine_wrapper`,该特性只定制回溯深度。 ``` import sys @@ -152,6 +157,7 @@ async def my_coroutine(): print(my_coroutine()) ``` + ``` @@ -162,27 +168,27 @@ Coroutine created at (most recent call last) print(my_coroutine()) ``` -这样好多了。没有其他全局设置可以更改协程的类型,因此 asyncio 用户无需编写防御代码。神灵应该像 Yury 一样有远见。 +这样好多了。没有可以更改协程的类型的其他全局设置,因此 asyncio 用户无需编写防御代码。造物主应该像 Yury 一样有远见。 #### 第四个约定:标记实验特征“临时” -如果你只是预感你的生物需要犄角和四叉舌,那就介绍一下这些特性,但将它们标记为“临时”。 +如果你只是预感你的生物需要犄角和四叉舌,那就引入这些特性,但将它们标记为“临时”。 ![Serpent with horns][7] -你可能会发现犄角是无关紧要的,但是四叉舌是有用的。在库的下一个版本中,你可以删除前者并标记后者。 +你可能会发现犄角是无关紧要的,但是四叉舌是有用的。在库的下一个版本中,你可以删除前者并标记后者为正式的。 ### 删除特性 -无论我们如何明智地指导我们的生物进化,总会有一天最好删除一个官方特征。例如,你可能已经创建了一只蜥蜴,现在你选择删除它的腿。也许你想把这个笨拙的家伙变成一条时尚而现代的蟒蛇。 +无论我们如何明智地指导我们的生物进化,总会有一天想要删除一个正式特征。例如,你可能已经创建了一只蜥蜴,现在你选择删除它的腿。也许你想把这个笨拙的家伙变成一条时尚而现代的蟒蛇。 ![Lizard transformed to snake][8] -删除特性主要有两个原因。首先,通过用户反馈或者你自己不断增长的智慧,你可能会发现某个特性是个坏主意。午夜的古怪行为就是这种情况。或者,最初该特性可能已经很好地适应了你的库环境,但现在生态环境发生了变化,也许另一个神发明了哺乳动物,你的生物想要挤进哺乳动物的小洞穴里,吃掉里面美味的哺乳动物,所以它不得不失去双腿。 +删除特性主要有两个原因。首先,通过用户反馈或者你自己不断增长的智慧,你可能会发现某个特性是个坏主意。午夜怪癖的古怪行为就是这种情况。或者,最初该特性可能已经很好地适应了你的库环境,但现在生态环境发生了变化,也许另一个神发明了哺乳动物,你的生物想要挤进哺乳动物的小洞穴里,吃掉里面美味的哺乳动物,所以它不得不失去双腿。 ![A mouse][9] -同样,Python 标准库会根据语言本身的变化删除特性。考虑 asyncio 的 Lock 功能,在把 "await" 作为一个关键字添加进来之前,它一直在等待: +同样,Python 标准库会根据语言本身的变化删除特性。考虑 asyncio 的 Lock 功能,在把 `await` 作为一个关键字添加进来之前,它一直在等待: ``` lock = asyncio.Lock() @@ -195,7 +201,7 @@ async def critical_section(): lock.release() ``` -但是现在,我们可以做“锁同步”: +但是现在,我们可以做“异步锁”: ``` @@ -208,18 +214,18 @@ async def critical_section(): 新方法好多了!很短,并且在一个大函数中使用其他 try-except 块时不容易出错。因为“尽量找一种,最好是唯一一种明显的解决方案”,[旧语法在 Python 3.7 中被弃用][10],并且很快就会被禁止。 -不可避免的是,生态变化会对你的代码产生影响,因此要学会温柔地删除特性。在此之前,请考虑删除它的成本或好处。负责任的维护者不愿意让用户更改大量代码或逻辑。(还记得 Python 3 在重新添加 "u" 字符串前缀之前删除它是多么痛苦吗?)如果代码删除是机械性的,就像一个简单的搜索和替换,或者如果该特性是危险的,那么它可能值得删除。 +不可避免的是,生态变化会对你的代码产生影响,因此要学会温柔地删除特性。在此之前,请考虑删除它的成本或好处。负责任的维护者不会愿意让用户更改大量代码或逻辑。(还记得 Python 3 在重新添加会 `u` 字符串前缀之前删除它是多么痛苦吗?)如果代码删除是机械性的动作,就像一个简单的搜索和替换,或者如果该特性是危险的,那么它可能值得删除。 #### 是否删除特性 ![Balance scales][11] -Con | Pro +反对 | 支持 ---|--- 代码必须改变 | 改变是机械性的 逻辑必须改变 | 特性是危险的 -就我们饥饿的蜥蜴而言,我们决定删除它的腿,这样它就可以滑进老鼠洞里吃掉它。我们该怎么做呢?我们可以删除 **walk** 方法,像下面一样修改代码: +就我们饥饿的蜥蜴而言,我们决定删除它的腿,这样它就可以滑进老鼠洞里吃掉它。我们该怎么做呢?我们可以删除 `walk` 方法,像下面一样修改代码: ``` class Reptile: @@ -229,7 +235,6 @@ class Reptile: 变成这样: - ``` class Reptile: def slither(self): @@ -238,7 +243,6 @@ class Reptile: 这不是一个好主意,这个生物习惯于走路!或者,就库而言,你的用户拥有依赖于现有方法的代码。当他们升级到最新库版本时,他们的代码将会崩溃。 - ``` # 用户的代码,哦,不! Reptile.walk() @@ -248,7 +252,7 @@ Reptile.walk() #### 第五条预定:温柔地删除 -温柔删除一个特性需要几个步骤。从用腿走路的蜥蜴开始,首先添加新方法 "slither"。接下来,弃用旧方法。 +温柔地删除一个特性需要几个步骤。从用腿走路的蜥蜴开始,首先添加新方法 `slither`。接下来,弃用旧方法。 ``` import warnings @@ -264,12 +268,11 @@ class Reptile: print('slide slide slide') ``` -Python 的 warnings 模块非常强大。默认情况下,它会将警告输出到 stderr,每个代码位置只显示一次,但你可以在其它选项中禁用警告或将其转换为异常。 +Python 的 warnings 模块非常强大。默认情况下,它会将警告输出到 stderr,每个代码位置只显示一次,但你可以禁用警告或将其转换为异常,以及其它选项。 一旦将这个警告添加到库中,PyCharm 和其他 IDE 就会使用删除线呈现这个被弃用的方法。用户马上就知道该删除这个方法。 -`Reptile().walk()` - +> Reptile().~~walk()~~ 当他们使用升级后的库运行代码时会发生什么? @@ -282,10 +285,9 @@ DeprecationWarning: walk is deprecated, use slither step step step ``` -默认情况下,他们会在 stderr 上看到警告,但脚本会成功并打印 "step step step"。警告的回溯显示必须修复用户代码的哪一行。(这就是 "stacklevel" 参数的作用:它显示了用户需要更改的调用,而不是库中生成警告的行。)请注意,错误消息有指导意义,它描述了库用户迁移到新版本必须做的事情。 - -你的用户将希望测试他们的代码,并证明他们没有调用不推荐的库方法。仅警告不会使单元测试失败,但异常会失败。Python 有一个命令行选项,可以将弃用警告转换为异常。 +默认情况下,他们会在 stderr 上看到警告,但脚本会成功并打印 “step step step”。警告的回溯显示必须修复用户代码的哪一行。(这就是 `stacklevel` 参数的作用:它显示了用户需要更改的调用,而不是库中生成警告的行。)请注意,错误消息有指导意义,它描述了库用户迁移到新版本必须做的事情。 +你的用户可能会希望测试他们的代码,并证明他们没有调用弃用的库方法。仅警告不会使单元测试失败,但异常会失败。Python 有一个命令行选项,可以将弃用警告转换为异常。 ``` > python3 -Werror::DeprecationWarning script.py @@ -298,47 +300,44 @@ Traceback (most recent call last): DeprecationWarning: walk is deprecated, use slither ``` -现在,"step step step" 没有输出出来,因为脚本以一个错误终止。 +现在,“step step step” 没有输出出来,因为脚本以一个错误终止。 -因此,一旦你发布了库的一个版本,该版本会警告已启用的 "walk" 方法,你就可以在下一个版本中安全地删除它。对吧? +因此,一旦你发布了库的一个版本,该版本会警告已启用的 `walk` 方法,你就可以在下一个版本中安全地删除它。对吧? -考虑一下你的库用户在他们项目的 requirements 中可能有什么。 +考虑一下你的库用户在他们项目的 `requirements` 中可能有什么。 ``` # 用户的 requirements.txt 显示 reptile 包的依赖关系 reptile ``` -下次他们部署代码时,他们将安装最新版本的库。如果他们尚未处理所有的弃用,那么他们的代码将会崩溃,因为代码仍然依赖 "walk"。你需要温柔一点,你必须向用户做出三个承诺:维护更改日志,选择版本方案和编写升级指南。 +下次他们部署代码时,他们将安装最新版本的库。如果他们尚未处理所有的弃用,那么他们的代码将会崩溃,因为代码仍然依赖 `walk`。你需要温柔一点,你必须向用户做出三个承诺:维护更改日志,选择版本化方案和编写升级指南。 #### 第六个约定:维护变更日志 你的库必须有更改日志,其主要目的是宣布用户所依赖的功能何时被弃用或删除。 ---- -#### 版本 1.1 中的更改 +> **版本 1.1 中的更改** +> +> **新特性** +> +> * 新功能 Reptile.slither() +> +> **弃用** +> +> * Reptile.walk() 已弃用,将在 2.0 版本中删除,请使用 slither() -**新特性** +负责任的创建者会使用版本号来表示库发生了怎样的变化,以便用户能够对升级做出明智的决定。“版本化方案”是一种用于交流变化速度的语言。 - * 新功能 Reptile.slither() +#### 第七个约定:选择一个版本化方案 -**弃用** - - * Reptile.walk() 已弃用,将在 2.0 版本中删除,请使用 slither() - ---- - -负责任的创建者使用版本号来表示库发生了怎样的变化,以便用户能够对升级做出明智的决定。“版本方案”是一种用于交流变化速度的语言。 - -#### 第七个约定:选择一个版本方案 - -有两种广泛使用的方案,[语义版本控制][12]和基于时间的版本控制。我推荐任何库都进行语义版本控制。Python 的风格在 [PEP 440][13] 中定义,像 **pip** 这样的工具可以理解语义版本号。 +有两种广泛使用的方案,[语义版本控制][12]和基于时间的版本控制。我推荐任何库都进行语义版本控制。Python 的风格在 [PEP 440][13] 中定义,像 `pip` 这样的工具可以理解语义版本号。 如果你为库选择语义版本控制,你可以使用版本号温柔地删除腿,例如: -> 1.0: First "stable" release, with walk() -> 1.1: Add slither(), deprecate walk() -> 2.0: Delete walk() +> 1.0: 第一个“稳定”版,带有 `walk()` +> 1.1: 添加 `slither()`,废弃 `walk()` +> 2.0: 删除 `walk()` 你的用户依赖于你的库的版本应该有一个范围,例如: @@ -347,33 +346,18 @@ reptile reptile>=1,<2 ``` -这允许他们在主要版本中自动升级,接收错误修正并可能引发一些弃用警告,但不会升级到 _下_ 个主要版本并冒着破坏其代码的更改的风险。 +这允许他们在主要版本中自动升级,接收错误修正并可能引发一些弃用警告,但不会升级到**下**个主要版本并冒着更改破坏其代码的风险。 如果你遵循基于时间的版本控制,则你的版本可能会编号: -> 2017.06.0: A release in June 2017 -> 2018.11.0: Add slither(), deprecate walk() -> 2019.04.0: Delete walk() +> 2017.06.0: 2017 年 6 月的版本 +> 2018.11.0: 添加 `slither()`,废弃 `walk()` +> 2019.04.0: 删除 `walk()` -用户可以依赖于你的库: +用户可以这样依赖于你的库: ``` -# User's requirements.txt for time-based version. -reptile==2018.11.* -``` - -这允许他们在一个主要版本中自动升级,接收错误修复,并可能引发一些弃用警告,但不能升级到 _下_ 个主要版本,并冒着改变破坏代码的风险。 - -如果你遵循基于时间的版本控制,你的版本号可能是这样: - -> 2017.06.0: A release in June 2017 -> 2018.11.0: Add slither(), deprecate walk() -> 2019.04.0: Delete walk() - -用户可以依赖你的库: - -``` -# 用户的 requirements.txt,对于基于时间的版本 +# 用户的 requirements.txt,基于时间控制的版本 reptile==2018.11.* ``` @@ -383,43 +367,40 @@ reptile==2018.11.* 下面是一个负责任的库创建者如何指导用户: ---- -#### 升级到 2.0 +> **升级到 2.0** +> +> **从弃用的 API 迁移** +> +> 请参阅更改日志以了解已弃用的特性。 +> +> **启用弃用警告** +> +> 升级到 1.1 并使用以下代码测试代码: +> +> `python -Werror::DeprecationWarning` +> +>​​​​​​ 现在可以安全地升级了。 -**从弃用的 API 迁移** - -请参阅更改日志以了解已弃用的特性。 - -**启用弃用警告** - -升级到 1.1 并使用以下代码测试代码: - -`python -Werror::DeprecationWarning` - -​​​​​​现在可以安全地升级了。 - ---- - -你必须通过向用户显示命令行选项来教会用户如何处理弃用警告。并非所有 Python 程序员都知道这一点 - 当然,我每次都必须查找语法。注意,你必须 _release_ 一个版本,它输出来自每个弃用的 API 的警告,以便用户可以在再次升级之前使用该版本进行测试。在本例中,1.1 版本是小版本。它允许你的用户逐步重写代码,分别修复每个弃用警告,直到他们完全迁移到最新的 API。他们可以彼此独立地测试代码和库的更改,并隔离 bug 的原因。 +你必须通过向用户显示命令行选项来教会用户如何处理弃用警告。并非所有 Python 程序员都知道这一点 —— 我自己就每次都得查找这个语法。注意,你必须*发布*一个版本,它输出来自每个弃用的 API 的警告,以便用户可以在再次升级之前使用该版本进行测试。在本例中,1.1 版本是小版本。它允许你的用户逐步重写代码,分别修复每个弃用警告,直到他们完全迁移到最新的 API。他们可以彼此独立地测试代码和库的更改,并隔离 bug 的原因。 如果你选择语义版本控制,则此过渡期将持续到下一个主要版本,从 1.x 到 2.0,或从 2.x 到 3.0 以此类推。删除生物腿部的温柔方法是至少给它一个版本来调整其生活方式。不要一次性把腿删掉! ![A skink][14] -版本号,弃用警告,更改日志和升级指南可以协同工作,在不违背与用户约定的情况下温柔地改进你的库。[Twisted 项目的兼容性政策][15] 解释的很漂亮: +版本号、弃用警告、更改日志和升级指南可以协同工作,在不违背与用户约定的情况下温柔地改进你的库。[Twisted 项目的兼容性政策][15] 解释的很漂亮: -> "The First One's Always Free" +> “先行者总是自由的” > -> Any application which runs without warnings may be upgraded one minor version of Twisted. +> 运行的应用程序在没有任何警告的情况下都可以升级为 Twisted 的一个次要版本。 +> +> 换句话说,任何运行其测试而不触发 Twisted 警告的应用程序应该能够将其 Twisted 版本升级至少一次,除了可能产生新警告之外没有任何不良影响。 > -> In other words, any application which runs its tests without triggering any warnings from Twisted should be able to have its Twisted version upgraded at least once with no ill effects except the possible production of new warnings. -现在,我们的造物之神已经获得了智慧和力量,可以通过添加方法来添加特性,并温柔地删除它们。我们还可以通过添加参数来添加特性,但这带来了新的难度。你准备好了吗? +现在,我们的造物主已经获得了智慧和力量,可以通过添加方法来添加特性,并温柔地删除它们。我们还可以通过添加参数来添加特性,但这带来了新的难度。你准备好了吗? ### 添加参数 -想象一下,你只是给了你的蛇形生物一对翅膀。现在你必须允许它选择是滑行还是飞行。目前它的 "move" 功能只接受一个参数。 - +想象一下,你只是给了你的蛇形生物一对翅膀。现在你必须允许它选择是滑行还是飞行。目前它的 `move` 功能只接受一个参数。 ``` # 你的库代码 @@ -430,8 +411,7 @@ def move(direction): move('north') ``` -你想要添加一个 "mode" 参数,但如果用户升级库,这会破坏他们的代码,因为他们只传递一个参数。 - +你想要添加一个 `mode` 参数,但如果用户升级库,这会破坏他们的代码,因为他们只传递了一个参数。 ``` # 你的库代码 @@ -443,7 +423,7 @@ def move(direction, mode): move('north') ``` -一个真正聪明的创建者者承诺不会以这种方式破坏用户的代码。 +一个真正聪明的创建者者会承诺不会以这种方式破坏用户的代码。 #### 第九条约定:兼容地添加参数 @@ -459,7 +439,7 @@ def move(direction, mode='slither'): move('north') ``` -随着时间推移,参数是函数演化的自然历史。它们首先列出最老的,每个都有默认值。库用户可以传递关键字参数以选择特定的新行为,并接受所有其他行为的默认值。 +随着时间推移,参数是函数演化的自然历史。它们首先列出最老的参数,每个都有默认值。库用户可以传递关键字参数以选择特定的新行为,并接受所有其他行为的默认值。 ``` # 你的库代码 @@ -481,7 +461,7 @@ move('north', extra_sinuous=True) move('north', 'slither', False, True) ``` -如果在你在库的下一个主要版本中去掉其中一个参数,例如 "turbo",会发生什么? +如果在你在库的下一个主要版本中去掉其中一个参数,例如 `turbo`,会发生什么? ``` # 你的库代码,下一个主要版本中 "turbo" 被删除 @@ -495,7 +475,7 @@ def move(direction, move('north', 'slither', False, True) ``` -用户的代码仍然编译,这是一件坏事。代码停止了曲折的移动并开始欢呼 Lyft,这不是它的本意。我相信你可以预测我接下来要说的内容:删除参数需要几个步骤。当然,首先弃用 "trubo" 参数。我喜欢这种技术,它可以检测任何用户的代码是否依赖于这个参数。 +用户的代码仍然能编译,这是一件坏事。代码停止了曲折的移动并开始招呼 Lyft,这不是它的本意。我相信你可以预测我接下来要说的内容:删除参数需要几个步骤。当然,首先弃用 `trubo` 参数。我喜欢这种技术,它可以检测任何用户的代码是否依赖于这个参数。 ``` # 你的库代码 @@ -516,7 +496,7 @@ def move(direction, turbo = False ``` -但是你的用户可能不会注意到警告。警告声音不是很大:它们可以在日志文件中被抑制或丢失。用户可能会漫不经心地升级到库的下一个主要版本,即删除 "turbo" 的版本。他们的代码运行将没有错误,默默做错误的事情!正如 Python 之禅所说:“错误绝不应该被默默 pass”。实际上,爬行动物的听力很差,所有当它们犯错误时,你必须非常大声地纠正它们。 +但是你的用户可能不会注意到警告。警告声音不是很大:它们可以在日志文件中被抑制或丢失。用户可能会漫不经心地升级到库的下一个主要版本——那个删除 `turbo` 的版本。他们的代码运行时将没有错误、默默做错误的事情!正如 Python 之禅所说:“错误绝不应该被默默 pass”。实际上,爬行动物的听力很差,所有当它们犯错误时,你必须非常大声地纠正它们。 ![Woman riding an alligator][16] @@ -524,7 +504,7 @@ def move(direction, ``` # 你的库代码 -# All arguments after "*" must be passed by keyword. +# 所有 “*” 后的参数必须以关键字方式传输。 def move(direction, *, mode='slither', @@ -538,14 +518,14 @@ def move(direction, move('north', 'slither', False, True) ``` -有了这个星,以下唯一允许的语法: +有了这个星,以下是唯一允许的语法: ``` # 用户代码 move('north', extra_sinuous=True) ``` -现在,当你删除 "turbo" 时,你可以确定任何依赖于它的用户代码都会明显地提示失败。如果你的库也支持 Python2,这没有什么大不了。你可以模拟星型语法([归功于 Brett Slatkin][17]): +现在,当你删除 `turbo` 时,你可以确定任何依赖于它的用户代码都会明显地提示失败。如果你的库也支持 Python2,这没有什么大不了。你可以模拟星型语法([归功于 Brett Slatkin][17]): ``` # 你的库代码,兼容 Python 2 @@ -562,7 +542,7 @@ def move(direction, **kwargs): # ... ``` -要求关键字参数是一个明智的选择,但它需要远见。如果允许按位置传递参数,则不能仅在以后的版本中将其转换为仅关键字。所以,现在加上星号,你可以在 asyncio API 中观察到,它在构造函数、方法和函数中普遍使用星号。尽管到目前为止,"Lock" 只接受一个可选参数,但 asyncio 开发人员立即添加了星号。这是幸运的。 +要求关键字参数是一个明智的选择,但它需要远见。如果允许按位置传递参数,则不能仅在以后的版本中将其转换为仅关键字。所以,现在加上星号。你可以在 asyncio API 中观察到,它在构造函数、方法和函数中普遍使用星号。尽管到目前为止,`Lock` 只接受一个可选参数,但 asyncio 开发人员立即添加了星号。这是幸运的。 ``` # In asyncio. @@ -579,20 +559,20 @@ class Lock: ![Rattlesnake][18] -横向的!这个生物的身体看起来是一样的,但它的行为会发生变化。我们如何为这一进化步骤做好准备? +横向移动!这个生物的身体看起来是一样的,但它的行为会发生变化。我们如何为这一进化步骤做好准备? ![][19] -Image by HCA [[CC BY-SA 4.0][20]], [via Wikimedia Commons][21], 由 Opensource.com 修改 +*Image by HCA [[CC BY-SA 4.0][20]], [via Wikimedia Commons][21], 由 Opensource.com 修改* -当行为在没有新函数或新参数的情况下发生更改时,负责的创建者可以从 Python 标准库中学习。很久以前,os 模块引入了stat 函数来获取文件统计信息,比如创建时间。起初,这个时间总是整数。 +当行为在没有新函数或新参数的情况下发生更改时,负责任的创建者可以从 Python 标准库中学习。很久以前,os 模块引入了 `stat` 函数来获取文件统计信息,比如创建时间。起初,这个时间总是整数。 ``` >>> os.stat('file.txt').st_ctime 1540817862 ``` -有一天,核心开发人员决定在 os.stat 中使用浮点数来提供亚秒级精度。但他们担心现有的用户代码还没有做好准备更改。于是他们在 Python 2.3 中创建了一个设置 "stat_float_times",默认情况下是 false 。用户可以将其设置为 True 来选择浮点时间戳。 +有一天,核心开发人员决定在 `os.stat` 中使用浮点数来提供亚秒级精度。但他们担心现有的用户代码还没有做好准备更改。于是他们在 Python 2.3 中创建了一个设置 `stat_float_times`,默认情况下是 `False` 。用户可以将其设置为 True 来选择浮点时间戳。 ``` >>> # Python 2.3. @@ -601,7 +581,7 @@ Image by HCA [[CC BY-SA 4.0][20]], [via Wikimedia Commons][21], 由 Opensource.c 1540817862.598021 ``` -从 Python 2.5 开始,浮点时间成为默认值,因此 2.5 及之后版本编写的任何新代码都可以忽略该设置并期望得到浮点数。当然,你可以将其设置为 False 以保持旧行为,或将其设置为 True 以确保所有 Python 版本都得到浮点数,并为删除 stat_float_times 的那一天准备代码。 +从 Python 2.5 开始,浮点时间成为默认值,因此 2.5 及之后版本编写的任何新代码都可以忽略该设置并期望得到浮点数。当然,你可以将其设置为 `False` 以保持旧行为,或将其设置为 `True` 以确保所有 Python 版本都得到浮点数,并为删除 `stat_float_times` 的那一天准备代码。 多年过去了,在 Python 3.1 中,该设置已被弃用,以便为人们为遥远的未来做好准备,最后,经过数十年的旅程,[这个设置被删除][22]。浮点时间现在是唯一的选择。这是一个漫长的过程,但负责任的神灵是有耐心的,因为我们知道这个渐进的过程很有可能于意外的行为变化拯救用户。 @@ -609,22 +589,20 @@ Image by HCA [[CC BY-SA 4.0][20]], [via Wikimedia Commons][21], 由 Opensource.c 以下是步骤: - * 添加一个标志来选择新行为,默认为 False,如果为 False 则发出警告 - * 将默认值更改为 True,表示完全弃用标记 - * 删除标志 - + * 添加一个标志来选择新行为,默认为 `False`,如果为 `False` 则发出警告 + * 将默认值更改为 `True`,表示完全弃用标记 + * 删除该标志 如果你遵循语义版本控制,版本可能如下: -Library version | Library API | User code +库版本 | 库 API | 用户代码 ---|---|--- -| | -1.0 | 没有标志 | 期望的旧行为 -1.1 | 添加标志,默认为 False,如果是 False,则警告 | 设置标志为 True,处理新行为 -2.0 | 改变默认为 True,完全弃用标志 | 处理新行为 +1.0 | 没有标志 | 预期的旧行为 +1.1 | 添加标志,默认为 `False`,如果是 `False`,则警告 | 设置标志为 `True`,处理新行为 +2.0 | 改变默认为 `True`,完全弃用标志 | 处理新行为 3.0 | 移除标志 | 处理新行为 -你需要 _两_ 个主要版本来完成该操作。如果你直接从“添加标志,默认为 False,如果是 False 则发出警告到“删除标志”,而没有中间版本,那么用户的代码将无法升级。为 1.1 正确编写的用户代码必须能够升级到下一个版本,除了新警告之外,没有任何不良影响,但如果在下一个版本中删除了该标志,那么该代码将崩溃。一个负责任的神明从不违反扭曲的政策:“第一个总是自由的”。 +你需要**两**个主要版本来完成该操作。如果你直接从“添加标志,默认为 `False`,如果是 `False` 则发出警告”变到“删除标志”,而没有中间版本,那么用户的代码将无法升级。为 1.1 正确编写的用户代码必须能够升级到下一个版本,除了新警告之外,没有任何不良影响,但如果在下一个版本中删除了该标志,那么该代码将崩溃。一个负责任的神明从不违反扭曲的政策:“先行者总是自由的”。 ### 负责任的创建者 @@ -640,22 +618,18 @@ Library version | Library API | User code 4. 标记实验特征“临时” 5. 温柔删除功能 - **严格记录历史** 1. 维护更改日志 2. 选择版本方案 3. 编写升级指南 - **缓慢而明显地改变** 1. 兼容添加参数 2. 逐渐改变行为 - -如果你对你所创造的物种保持这些约定,你将成为一个负责任的创造之神。你的生物的身体可以随着时间的推移而进化,永远改善和适应环境的变化,而不是在生物没有准备好就突然改变。如果你维护一个库,请向用户保留这些承诺,这样你就可以在不破坏依赖库的人的代码的情况下对库进行更新。 - +如果你对你所创造的物种保持这些约定,你将成为一个负责任的造物主。你的生物的身体可以随着时间的推移而进化,一直在改善和适应环境的变化,而不是在生物没有准备好就突然改变。如果你维护一个库,请向用户保留这些承诺,这样你就可以在不破坏依赖该库的代码的情况下对库进行更新。 * * * @@ -680,7 +654,7 @@ via: https://opensource.com/article/19/5/api-evolution-right-way 作者:[A. Jesse][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d6987bf53d05f39800626d5451bf9df96ab34ed3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 May 2019 13:44:56 +0800 Subject: [PATCH 0593/1154] PUB:20190503 API evolution the right way.md @MjSeven https://linux.cn/article-10900-1.html --- .../20190503 API evolution the right way.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20190503 API evolution the right way.md (99%) diff --git a/translated/tech/20190503 API evolution the right way.md b/published/20190503 API evolution the right way.md similarity index 99% rename from translated/tech/20190503 API evolution the right way.md rename to published/20190503 API evolution the right way.md index b8ef4f9911..069687be7a 100644 --- a/translated/tech/20190503 API evolution the right way.md +++ b/published/20190503 API evolution the right way.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10900-1.html) [#]: subject: (API evolution the right way) [#]: via: (https://opensource.com/article/19/5/api-evolution-right-way) [#]: author: (A. Jesse https://opensource.com/users/emptysquare) @@ -58,7 +58,7 @@ def create_event(day, if end_time and not start_time: raise ValueError("Can't pass end_time without start_time") - # 女巫集会从午夜一直开到凌晨 4 点 +# 女巫集会从午夜一直开到凌晨 4 点 create_event(datetime.date.today(), datetime.time(0, 0), datetime.time(4, 0)) From c3f5680d9dc7b4481ddeb2afec802ac4f68f2f56 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 May 2019 20:37:35 +0800 Subject: [PATCH 0594/1154] PRF:20180725 Put platforms in a Python game with Pygame.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @robsean 我几乎重译了整篇,太不认真了。 --- ... platforms in a Python game with Pygame.md | 173 +++++++++--------- 1 file changed, 88 insertions(+), 85 deletions(-) diff --git a/translated/tech/20180725 Put platforms in a Python game with Pygame.md b/translated/tech/20180725 Put platforms in a Python game with Pygame.md index 35b951cc02..de9e987eb8 100644 --- a/translated/tech/20180725 Put platforms in a Python game with Pygame.md +++ b/translated/tech/20180725 Put platforms in a Python game with Pygame.md @@ -1,45 +1,46 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Put platforms in a Python game with Pygame) [#]: via: (https://opensource.com/article/18/7/put-platforms-python-game) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -放置舞台到一个使用 Pygame 的 Python 游戏中 +在 Pygame 游戏中放置平台 ====== -在这系列的第六部分中,在从零构建一个 Python 游戏时,为你的角色创建一些舞台来旅行。 + +> 在这个从零构建一个 Python 游戏系列的第六部分中,为你的角色创建一些平台来旅行。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/header.png?itok=iq8HFoEJ) -这是关于使用 Pygame 模块来在 Python 3 中创建电脑游戏的仍在进行的一系列的文章的第六部分。先前的文章是: +这是仍在进行中的关于使用 Pygame 模块来在 Python 3 中创建电脑游戏的系列文章的第六部分。先前的文章是: -+ [通过构建一个简单的骰子游戏来学习如何用 Python 编程][24] ++ [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][24] + [使用 Python 和 Pygame 模块构建一个游戏框架][25] -+ [如何添加一个玩家到你的 Python 游戏][26] -+ [使用 Pygame 来在周围移动你的游戏角色][27] -+ [没有一个坏蛋的一个英雄是什么?如何添加一个坏蛋到你的 Python 游戏][28] ++ [如何在你的 Python 游戏中添加一个玩家][26] ++ [用 Pygame 使你的游戏角色移动起来][27] ++ [如何向你的 Python 游戏中添加一个敌人][28] +一个平台类游戏需要平台。 -一个舞台游戏需要舞台。 +在 [Pygame][1] 中,平台本身也是个妖精,正像你那个可玩的妖精。这一点是重要的,因为有个是对象的平台,可以使你的玩家妖精更容易与之互动。 -在 [Pygame][1] 中,舞台本身是小精灵,正像你的可玩的小精灵。这一点是重要的,因为有对象的舞台,使你的玩家小精灵很简单地与舞台一起作用。. +创建平台有两个主要步骤。首先,你必须给该对象编写代码,然后,你必须映射出你希望该对象出现的位置。 -创建舞台有两个主要步骤。首先,你必须编码对象,然后,你必须设计你希望对象来出现的位置。 +### 编码平台对象 -### 编码舞台对象 +要构建一个平台对象,你要创建一个名为 `Platform` 的类。它是一个妖精,正像你的 `Player` [妖精][2] 一样,带有很多相同的属性。 -为构建一个舞台对象,你创建一个称为`Platform`的类。它是一个小精灵,正像你的[`玩家`][2] [小精灵][2],带有很多相同的属性。 +你的 `Platform` 类需要知道很多平台类型的信息,它应该出现在游戏世界的哪里、它应该包含的什么图片等等。这其中很多信息可能还尚不存在,这要看你为你的游戏计划了多少,但是没有关系。正如直到[移动你的游戏角色][3]那篇文章结束时,你都没有告诉你的玩家妖精移动速度有多快,你不必事先告诉 `Platform` 每一件事。 -你的`舞台`类需要知道很多你想要的舞台的类型的信息 ,它应该出现在游戏世界的哪里,和它应该包含的什么图片。它们中很多信息可能还尚不存在,依赖于你计划了多少游戏,但是,没有关系。正像直到[移到文章][3]的结尾时,你不告诉你的玩家小精灵多快速度移到,你没有必要告诉`Platform`预交的每一件事。 - -在你所写的这系列中脚本的顶部附近,创建一个新的类。在这代码示例中前三行是用于上下文,因此在注释的下面添加代码: +在这系列中你所写的脚本的开头附近,创建一个新的类。在这个代码示例中前三行是用于说明上下文,因此在注释的下面添加代码: ``` import pygame import sys import os -## new code below: +## 新代码如下: class Platform(pygame.sprite.Sprite): # x location, y location, img width, img height, img file     @@ -53,55 +54,55 @@ def __init__(self,xloc,yloc,imgw,imgh,img):     self.rect.x = xloc ``` -当被调用时,这个类在一些 X 和 Y 位置上创建一个对象 onscreen, 带有一些宽度和高度,对于纹理使用一些图片文件。它非常类似于如何玩家或敌人绘制onscreen。 +当被调用时,这个类在某个 X 和 Y 位置上创建一个屏上对象,具有某种宽度和高度,并使用某种图像作为纹理。这与如何在屏上绘制出玩家或敌人非常类似。 -### 舞台的类型 +### 平台的类型 -下一步是设计你所有舞台需要出现的地方。 +下一步是绘制出你的平台需要出现的地方。 -#### 瓷砖方法 +#### 瓷砖方式 -这里有几个不同的方法来实施一个舞台游戏世界。在最初的侧面滚动游戏,例如,马里奥超级兄弟和刺猬索尼克,这个技巧是来使用"瓷砖",意味着这里有几个块“瓷砖”来代表地面和各种各样的舞台,并且这些块被使用和重复使用来制作一个层次。你仅有8或12种不同的块,你排列它们在屏幕上来创建地面,浮动的舞台,和你游戏需要的其它的一切事物。一些人找到这最容易的方法来制作一个游戏,尽管你不得不制作(或下载)一小组价值相等的有用的事物来创建很多不同的有用的事物。然而,代码需要一点更多的数学。 +实现平台类游戏世界有几种不同的方法。在最初的横向滚轴游戏中,例如,马里奥超级兄弟和刺猬索尼克,这个技巧是使用“瓷砖”方式,也就是说有几个代表地面和各种平台的块,并且这些块被重复使用来制作一个关卡。你只能有 8 或 12 种不同的块,你可以将它们排列在屏幕上来创建地面、浮动的平台,以及你游戏中需要的一切其它的事物。有人发现这是制作游戏最容易的方法了,因为你只需要制作(或下载)一小组关卡素材就能创建很多不同的关卡。然而,这里的代码需要一点数学知识。 ![Supertux, a tile-based video game][5] -[SuperTux][6] ,一个基于瓷砖的电脑游戏。 +*[SuperTux][6] ,一个基于瓷砖的电脑游戏。* -#### 手工绘制方法 +#### 手工绘制方式 -另一个方法是来使各个和每一个有用的事物作为一整个图像。如果你享受为你的游戏世界创建有用的事物,在一个图形应用程序中花费时间来构建你的游戏世界的各个和每一部件是一个极好的理由。这个方法需要较少的数学,因为所有的舞台是完整的对象,并且你告诉 [Python][7] 在屏幕上放置它们的位置。 +另一种方法是将每个素材作为一个整体图像。如果你喜欢为游戏世界创建素材,那你会在用图形应用程序构建游戏世界的每个部分上花费很多时间。这种方法不需要太多的数学知识,因为所有的平台都是整体的、完整的对象,你只需要告诉 [Python][7] 将它们放在屏幕上的什么位置。 -每种方法都有优势和劣势,并且依赖于你的选择使用的代码是稍微不同的.我将覆盖这两方面,所以你可以在你的工程中使用一个或另一个,甚至两者的混合。 +每种方法都有优势和劣势,并且根据于你选择使用的方式,代码稍有不同。我将覆盖这两方面,所以你可以在你的工程中使用一种或另一种,甚至两者的混合。 -### 层次映射 +### 关卡绘制 -总的来说,映射出你的游戏世界是层次设计和游戏程序的一个重要的部分。这需要数学,但是没有什么太难的,而且 Python 擅长数学,因此它可以帮助一些。 +总的来说,绘制你的游戏世界是关卡设计和游戏编程中的一个重要的部分。这需要数学知识,但是没有什么太难的,而且 Python 擅长数学,它会有所帮助。 -你可以发现先在纸张上设计是有益的。获取纸张的一个表格,并绘制一个方框来代表你的游戏窗体。在方框中绘制舞台,用 X 和 Y 坐标标记每一个,以及它的意欲达到的宽度和高度。在方框中的实际位置没有必要是精确的,只要你保持实际的数字。譬如,假如你的屏幕是 720 像素宽,那么你不能在一个屏幕上以 100 像素处容纳8块舞台。 +你也许发现先在纸张上设计是有用的。拿一张表格纸,并绘制一个方框来代表你的游戏窗体。在方框中绘制平台,并标记其每一个平台的 X 和 Y 坐标,以及它的宽度和高度。在方框中的实际位置没有必要是精确的,你只要保持数字合理即可。譬如,假设你的屏幕是 720 像素宽,那么你不能在一个屏幕上放 8 块 100 像素的平台。 -当然,在你的游戏中不是所有的舞台不得不容纳在一个屏幕大小的方框,因为你的游戏将随着你的玩家行走而滚动。所以保持绘制你的游戏世界到第一屏幕的右侧,直到层次的右侧。 +当然,不是你游戏中的所有平台都必须容纳在一个屏幕大小的方框里,因为你的游戏将随着你的玩家行走而滚动。所以,可以继续绘制你的游戏世界到第一屏幕的右侧,直到关卡结束。 -如果你更喜欢精确一点,你可以使用方格纸。当设计一个带有瓷砖的游戏时,这是特别有用的,因为每个方格可以代表一个瓷砖。 +如果你更喜欢精确一点,你可以使用方格纸。当设计一个瓷砖类的游戏时,这是特别有用的,因为每个方格可以代表一个瓷砖。 ![Example of a level map][9] -一个平面地图示例。 +*一个关卡地图示例。* #### 坐标系 -你可能已经在学校中学习[笛卡尔坐标系][10]。你学习的东西应用到 Pygame,除了在 Pygame 中,你的游戏世界的坐标系放置 `0,0` 在你的屏幕的左上角而不是在中间,中间可能是你which is probably what you're used to from Geometry class. +你可能已经在学校中学习过[笛卡尔坐标系][10]。你学习的东西也适用于 Pygame,除了在 Pygame 中你的游戏世界的坐标系的原点 `0,0` 是放置在你的屏幕的左上角而不是在中间,是你在地理课上用过的坐标是在中间的。 ![Example of coordinates in Pygame][12] -在 Pygame 中的坐标示例。 +*在 Pygame 中的坐标示例。* -X 轴起始于最左边的 0 ,无限地向右增加。Y 轴起始于屏幕顶部的 0 ,向下延伸。 +X 轴起始于最左边的 0,向右无限增加。Y 轴起始于屏幕顶部的 0,向下延伸。 #### 图片大小 -映射出一个游戏世界不是毫无意义的,如果你不知道你的玩家,敌人,舞台是多大的。你可以找到你的舞台的尺寸或在一个图形程序中的标题。在 [Krita][13] 中,例如,单击**图形**菜单,并选择**属性**。你可以在**属性**窗口的非常顶部处找到尺寸。 +如果你不知道你的玩家、敌人、平台是多大的,绘制出一个游戏世界是毫无意义的。你可以在图形程序中找到你的平台或瓷砖的尺寸。例如在 [Krita][13] 中,单击“图像”菜单,并选择“属性”。你可以在“属性”窗口的最顶部处找到它的尺寸。 -可选地,你可以创建一个简单点的 Python 脚本来告诉你的一个图形的尺寸。打开一个新的文本文件,并输入这些代码到其中: +另外,你也可以创建一个简单的 Python 脚本来告诉你的一个图像的尺寸。打开一个新的文本文件,并输入这些代码到其中: ``` #!/usr/bin/env python3 @@ -123,44 +124,44 @@ Y   = dim.size[1] print(X,Y) ``` -保存文本文件为 `identify.py` 。 +保存该文本文件为 `identify.py`。 -为安装这个脚本,你必需安装安装一组额外的 Python 模块,它们包含使用在脚本中新的关键字: +要使用这个脚本,你必须安装一些额外的 Python 模块,它们包含了这个脚本中新使用的关键字: ``` $ pip3 install Pillow --user ``` -一旦这些被安装,在你游戏工程目录中运行你的脚本: +一旦安装好,在你游戏工程目录中运行这个脚本: ``` $ python3 ./identify.py images/ground.png (1080, 97) ``` -在这个示例中的地面舞台的图形的大小是1080像素宽和97像素高。 +在这个示例中,地面平台的图形的大小是 1080 像素宽和 97 像素高。 -### 舞台块 +### 平台块 -如果你选择单独地绘制每个有用的事物,你必需创建一些舞台和一些你希望插入到你的游戏世界中其它的元素,每个元素都在它自己的文件中。换句话说,你应该每个有用的事物都有一个文件,像这: +如果你选择单独地绘制每个素材,你必须创建想要插入到你的游戏世界中的几个平台和其它元素,每个素材都放在它自己的文件中。换句话说,你应该让每个素材都有一个文件,像这样: ![One image file per object][15] -每个对象一个图形文件。 +*每个对象一个图形文件。* -你可以按照你希望的次数重复使用每个舞台,只要确保每个文件仅包含一个舞台。你不能使用一个包含每一件事物的文件,像这: +你可以按照你希望的次数重复使用每个平台,只要确保每个文件仅包含一个平台。你不能使用一个文件包含全部素材,像这样: ![Your level cannot be one image file][17] -你的层次不能是一个图形。 +*你的关卡不能是一个图形文件。* -当你完成时,你可能希望你的游戏看起来像这样,但是如果你在一个大文件中创建你的层次,没有方法从背景中区分一个舞台,因此,要么在它们拥有的文件中绘制你的对象,要么从一个大规模文件中复制它们,并单独地保存副本。 +当你完成时,你可能希望你的游戏看起来像这样,但是如果你在一个大文件中创建你的关卡,你就没有方法从背景中区分出一个平台,因此,要么把对象绘制在它们自己的文件中,要么从一个更大的文件中裁剪出它们,并保存为单独的副本。 -**注意:** 如同你的其它的有用的事物,你可以使用[GIMP][18],Krita,[MyPaint][19],或[Inkscape][20] 来创建你的游戏的有用的事物。 +**注意:** 如同你的其它素材,你可以使用 [GIMP][18]、Krita、[MyPaint][19],或 [Inkscape][20] 来创建你的游戏素材。 -舞台出现在每个层次开始的屏幕上,因此你必需在你的`Level`类中添加一个`platform`函数。在这里特殊的情况是地面舞台,作为它自身拥有的舞台组来对待是足够重要的。通过把地面看作它自身拥有的特殊类型的舞台,你可以选择它是否滚动,或在其它舞台漂浮在它上面期间是否仍然站立。它取决于你。 +平台出现在每个关卡开始的屏幕上,因此你必须在你的 `Level` 类中添加一个 `platform` 函数。在这里特例是地面平台,它重要到应该拥有它自己的一个组。通过把地面看作一组特殊类型的平台,你可以选择它是否滚动,或它上面是否可以站立,而其它平台可以漂浮在它上面。这取决于你。 -添加这两个函数到你的`Level`类: +添加这两个函数到你的 `Level` 类: ``` def ground(lvl,x,y,w,h): @@ -187,15 +188,15 @@ def platform( lvl ):     return plat_list ``` - `ground` 函数需要一个 X 和 Y 位置,以便 Pygame 知道在哪里放置地面舞台。它也需要舞台的宽度和高度,这样 Pygame 知道地面延伸到每个方向有多远。该函数使用你的 `Platform` 来来生成一个对象 onscreen ,然后他就这个对象到 `ground_list` 组。 +`ground` 函数需要一个 X 和 Y 位置,以便 Pygame 知道在哪里放置地面平台。它也需要知道平台的宽度和高度,这样 Pygame 知道地面延伸到每个方向有多远。该函数使用你的 `Platform` 类来生成一个屏上对象,然后将这个对象添加到 `ground_list` 组。 -`platform` 函数本质上是相同的,除了其有更多的舞台来列出。在这个示例中,仅有两个,但是你可以想多少就多少。在进入一个舞台后,在列出另一个前,你必需添加它到 `plat_list` 中。如果你不添加一个舞台到组中,那么它将不出现在你的游戏中。 +`platform` 函数本质上是相同的,除了其有更多的平台。在这个示例中,仅有两个平台,但是你可以想有多少就有多少。在进入一个平台后,在列出另一个前你必须添加它到 `plat_list` 中。如果你不添加平台到组中,那么它将不出现在你的游戏中。 -> **提示:** 很难想象你的游戏世界的0在顶部,因为在真实世界中发生的情况是相反的;当估计你多高时,你不要从天空下面测量你自己,从脚到头的顶部来测量。 +> **提示:** 很难想象你的游戏世界的 0 是在顶部,因为在真实世界中发生的情况是相反的;当估计你有多高时,你不会从上往下测量你自己,而是从脚到头顶来测量。 > -> 如果对你来说从“地面”上来构建你的游戏世界更容易,它可能有助于表示 Y 轴值为负数。例如,你知道你的游戏世界的底部是 `worldy` 的值。因此 `worldy` 减去地面(97,在这个示例中)的高度是你的玩家正常站立的位置。如果你的角色是64像素高,那么地面减去128正好是你的玩家的两倍。事实上,一个放置在128像素处舞台大约是两层楼高度,相对于你的玩家。一个舞台在-320处是三层楼高。等等 +> 如果对你来说从“地面”上来构建你的游戏世界更容易,将 Y 轴值表示为负数可能有帮助。例如,你知道你的游戏世界的底部是 `worldy` 的值。因此 `worldy` 减去地面的高度(在这个示例中是 97)是你的玩家正常站立的位置。如果你的角色是 64 像素高,那么地面减去 128 正好是你的玩家的两倍高。事实上,一个放置在 128 像素处平台大约是相对于你的玩家的两层楼高度。一个平台在 -320 处比三层楼更高。等等。 -正像你现在可能所知的,如果你不使用它们,你的类和函数是没有有价值的。添加这些代码到你的 setup 部分(第一行只是上下文,所以添加最后两行): +正像你现在可能所知的,如果你不使用它们,你的类和函数是没有价值的。添加这些代码到你的设置部分(第一行只是上下文,所以添加最后两行): ``` enemy_list  = Level.bad( 1, eloc ) @@ -203,32 +204,32 @@ ground_list = Level.ground( 1,0,worldy-97,1080,97 ) plat_list   = Level.platform( 1 ) ``` -并提交这些行到你的主循环(再一次,第一行仅用于上下文): +并把这些行加到你的主循环(再一次,第一行仅用于上下文): ``` -enemy_list.draw(world)  # refresh enemies -ground_list.draw(world)  # refresh ground -plat_list.draw(world)  # refresh platforms +enemy_list.draw(world)  # 刷新敌人 +ground_list.draw(world)  # 刷新地面 +plat_list.draw(world)  # 刷新平台 ``` -### 瓷砖舞台 +### 瓷砖平台 -瓷砖游戏世界被认为更容易制作,因为你只需要绘制一些在前面的块,就能在游戏中反反复复创建每一个舞台。在网站上甚至有一组供你来使用的瓷砖,像 [OpenGameArt.org][21]。 +瓷砖类游戏世界更容易制作,因为你只需要在前面绘制一些块,就能在游戏中一再使用它们创建每个平台。在像 [OpenGameArt.org][21] 这样的网站上甚至有一套瓷砖供你来使用。 `Platform` 类与在前面部分中的类是相同的。 -在 `Level` 类中的 `ground` 和 `platform` , 然而,必需使用循环来计算使用多少块来创建每个舞台。 +`ground` 和 `platform` 在 `Level` 类中,然而,必须使用循环来计算使用多少块来创建每个平台。 -如果你打算在你的游戏世界中有一个坚固的地面,地面是简单的。你仅从整个窗口一边到另一边"克隆"你的地面瓷砖。例如,你可以创建一个 X 和 Y 值的列表来规定每个瓷砖应该放置的位置,然后使用一个循环来获取每个值和绘制一个瓷砖。这仅是一个示例,所以不要添加这到你的代码: +如果你打算在你的游戏世界中有一个坚固的地面,这种地面是很简单的。你只需要从整个窗口的一边到另一边“克隆”你的地面瓷砖。例如,你可以创建一个 X 和 Y 值的列表来规定每个瓷砖应该放置的位置,然后使用一个循环来获取每个值并绘制每一个瓷砖。这仅是一个示例,所以不要添加这到你的代码: ``` # Do not add this to your code gloc = [0,656,64,656,128,656,192,656,256,656,320,656,384,656] ``` -如果你仔细看,不过,你也可以看到所有的 Y 值是相同的,X 值以64的增量不断地增加,这是瓷砖的东西。这种类型的重复是精确地,是计算机擅长的,因此你可以使用一点数学逻辑来让计算机为你做所有的计算: +不过,如果你仔细看,你可以看到所有的 Y 值是相同的,X 值以 64 的增量不断地增加 —— 这就是瓷砖的大小。这种重复是精确地,是计算机擅长的,因此你可以使用一点数学逻辑来让计算机为你做所有的计算: -添加这代你的脚本的 setup 部分: +添加这些到你的脚本的设置部分: ``` gloc = [] @@ -243,9 +244,9 @@ while i <= (worldx/tx)+tx: ground_list = Level.ground( 1,gloc,tx,ty ) ``` -现在,不管你的窗口的大小,Python 通过瓷砖的宽度 分割游戏世界的宽度,并创建一个数组列表列出每个 X 值。这不计算 Y 值,但是无论如何,从不在平的地面上更改。 +现在,不管你的窗口的大小,Python 会通过瓷砖的宽度分割游戏世界的宽度,并创建一个数组列表列出每个 X 值。这里不计算 Y 值,因为在平的地面上这个从不会变化。 -为在一个函数中使用数组,使用一个`while`循环,查看每个条目并在适当的位置添加一个地面瓷砖: +为了在一个函数中使用数组,使用一个 `while` 循环,查看每个条目并在适当的位置添加一个地面瓷砖: ``` def ground(lvl,gloc,tx,ty): @@ -263,13 +264,13 @@ def ground(lvl,gloc,tx,ty):     return ground_list ``` -除了 `while` 循环,这几乎与在上面一部分中提供的块样式平台游戏 `ground` 函数的代码相同。 +除了 `while` 循环,这几乎与在上面一部分中提供的瓷砖类平台的 `ground` 函数的代码相同。 -对于移到舞台,原理是相似的,但是这里有一些你可以使用的技巧来使你的生活更简单。 +对于移动的平台,原理是相似的,但是这里有一些技巧可以使它简单。 -而不通过像素映射每个舞台,你可以通过它的起始像素(它的 X 值),从地面(它的 Y 值)的高度,绘制多少瓷砖来定义一个舞台。用那种方法,你不必担心每个舞台的宽度和高度。 +你可以通过它的起始像素(它的 X 值)、距地面的高度(它的 Y 值)、绘制多少瓷砖来定义一个平台,而不是通过像素绘制每个平台。这样,你不必操心每个平台的宽度和高度。 -这个技巧的逻辑有一点更复杂,因此仔细复制这些代码。有一个 `while` 循环在另一个 `while` 循环的内部,因为这个函数必需考虑在每个数组入口处的所有三个值来成功地建造一个完整的舞台。在这个示例中,这里仅有三个舞台被定义为 `ploc.append` 语句,但是你的游戏可能需要更多,因此你需要多少就定义多少。当然,一些也将不出现,因为它们远在屏幕外,但是一旦你实施滚动,它们将呈现眼前。 +这个技巧的逻辑有一点复杂,因此请仔细复制这些代码。有一个 `while` 循环嵌套在另一个 `while` 循环的内部,因为这个函数必须考虑每个数组项的三个值来成功地建造一个完整的平台。在这个示例中,这里仅有三个平台以 `ploc.append` 语句定义,但是你的游戏可能需要更多,因此你需要多少就定义多少。当然,有一些不会出现,因为它们远在屏幕外,但是一旦当你进行滚动时,它们将呈现在眼前。 ``` def platform(lvl,tx,ty): @@ -295,21 +296,21 @@ def platform(lvl,tx,ty):     return plat_list ``` -为获取舞台,使其出现在你的游戏世界,它们必需在你的主循环中。如果你还没有这样做,添加这些行到你的主循环(再一次,第一行仅被用于上下文)中: +要让这些平台出现在你的游戏世界,它们必须出现在你的主循环中。如果你还没有这样做,添加这些行到你的主循环(再一次,第一行仅被用于上下文)中: ``` -        enemy_list.draw(world)  # refresh enemies -        ground_list.draw(world) # refresh ground -        plat_list.draw(world)   # refresh platforms +        enemy_list.draw(world)  # 刷新敌人 +        ground_list.draw(world) # 刷新地面 +        plat_list.draw(world)   # 刷新平台 ``` -启动你的游戏,根据需要调整你的舞台的放置位置。不要担心,你不能看见在屏幕外面产生的舞台;你将不久后修复。 +启动你的游戏,根据需要调整你的平台的放置位置。如果你看不见屏幕外产生的平台,不要担心;你不久后就可以修复它。 -到目前为止,这是在一个图片和在代码中游戏: +到目前为止,这是游戏的图片和代码: ![Pygame game][23] -到目前为止,我们的 Pygame 舞台。 +*到目前为止,我们的 Pygame 平台。* ``` #!/usr/bin/env python3 @@ -546,14 +547,16 @@ while main == True:     clock.tick(fps) ``` +(LCTT 译注:到本文翻译完为止,该系列已经近一年没有继续更新了~) + -------------------------------------------------------------------------------- via: https://opensource.com/article/18/7/put-platforms-python-game 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[robsan](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -582,9 +585,9 @@ via: https://opensource.com/article/18/7/put-platforms-python-game [21]: https://opengameart.org/content/simplified-platformer-pack [22]: /file/403886 [23]: https://opensource.com/sites/default/files/uploads/pygame_platforms.jpg (Pygame game) -[24]: Learn how to program in Python by building a simple dice game -[25]: https://opensource.com/article/17/12/game-framework-python -[26]: https://opensource.com/article/17/12/game-python-add-a-player -[27]: https://opensource.com/article/17/12/game-python-moving-player -[28]: https://opensource.com/article/18/5/pygame-enemy +[24]: https://linux.cn/article-9071-1.html +[25]: https://linux.cn/article-10850-1.html +[26]: https://linux.cn/article-10858-1.html +[27]: https://linux.cn/article-10874-1.html +[28]: https://linux.cn/article-10883-1.html From 3641940c443f97186e23b649757ceec660aceafd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 May 2019 20:38:33 +0800 Subject: [PATCH 0595/1154] PUB:20180725 Put platforms in a Python game with Pygame.md @robsean https://linux.cn/article-10902-1.html --- .../20180725 Put platforms in a Python game with Pygame.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20180725 Put platforms in a Python game with Pygame.md (99%) diff --git a/translated/tech/20180725 Put platforms in a Python game with Pygame.md b/published/20180725 Put platforms in a Python game with Pygame.md similarity index 99% rename from translated/tech/20180725 Put platforms in a Python game with Pygame.md rename to published/20180725 Put platforms in a Python game with Pygame.md index de9e987eb8..d5f6a910d2 100644 --- a/translated/tech/20180725 Put platforms in a Python game with Pygame.md +++ b/published/20180725 Put platforms in a Python game with Pygame.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10902-1.html) [#]: subject: (Put platforms in a Python game with Pygame) [#]: via: (https://opensource.com/article/18/7/put-platforms-python-game) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 8f413fa888e11e6fa29c7ae9ffce88c127b32dba Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 May 2019 21:50:35 +0800 Subject: [PATCH 0596/1154] APL:20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io --- ...g 10 years of GitHub data with GHTorrent and Libraries.io.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md b/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md index c7ec1de513..fe7f9a2478 100644 --- a/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md +++ b/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 94ca7c94d1a824ac10991625c08b32fea981dd88 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 May 2019 22:38:25 +0800 Subject: [PATCH 0597/1154] TSL:20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md --- ...ub data with GHTorrent and Libraries.io.md | 164 ------------------ ...ub data with GHTorrent and Libraries.io.md | 156 +++++++++++++++++ 2 files changed, 156 insertions(+), 164 deletions(-) delete mode 100644 sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md create mode 100644 translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md diff --git a/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md b/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md deleted file mode 100644 index fe7f9a2478..0000000000 --- a/sources/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md +++ /dev/null @@ -1,164 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Querying 10 years of GitHub data with GHTorrent and Libraries.io) -[#]: via: (https://opensource.com/article/19/5/chaossearch-github-ghtorrent) -[#]: author: (Pete Cheslock https://opensource.com/users/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes) - -Querying 10 years of GitHub data with GHTorrent and Libraries.io -====== -There is a way to explore GitHub data without any local infrastructure -using open source datasets. -![magnifying glass on computer screen][1] - -I’m always on the lookout for new datasets that we can use to show off the power of my team's work. [**CHAOS** SEARCH][2] turns your [Amazon S3][3] object storage data into a fully searchable [Elasticsearch][4]-like cluster. With the Elasticsearch API or tools like [Kibana][5], you can then query whatever data you find. - -I was excited when I found the [GHTorrent][6] project to explore. GHTorrent aims to build an offline version of all data available through the GitHub APIs. If datasets are your thing, this is a project worth checking out or even consider [donating one of your GitHub API keys][7]. - -### Accessing GHTorrent data - -There are many ways to gain access to and use [GHTorrent’s data][8], which is available in [NDJSON][9]** **format. This project does a great job making the data available in multiple forms, including[CSV][10] for restoring into a [MySQL][11] database, [MongoDB][12] dumps of all objects, and Google Big Query** **(free) for exporting data directly into Google’s object storage. There is one caveat: this dataset has a nearly complete dataset from 2008 to 2017 but is not as complete from 2017 to today. That will impact our ability to query with certainty, but it is still an exciting amount of information. - -I chose Google Big Query to avoid running any database myself, so I was quickly able to download a full corpus of data including users and projects. **CHAOS** SEARCH can natively analyze the NDJSON format, so after uploading the data to Amazon S3 I was able to index it in just a few minutes. The **CHAOS** SEARCH platform doesn’t require users to set up index schemas or define mappings for their data, so it discovered all of the fields—strings, integers, etc.—itself. - -With my data fully indexed and ready for search and aggregation, I wanted to dive in and see what insights we can learn, like which software languages are the most popular for GitHub projects. - -(A note on formatting: this is a valid JSON query that we won't format correctly here to avoid scroll fatigue. To properly format it, you can copy it locally and send to a command-line utility like [jq][13].) - - -``` -`{"aggs":{"2":{"date_histogram":{"field":"root.created_at","interval":"1M","time_zone":"America/New_York","min_doc_count":1}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["root.created_at","root.updated_at"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"root.language":{"query":""}}}]}}}` -``` - -This result is of little surprise to anyone who’s followed the state of open source languages over recent years. - -![Which software languages are the most popular on GitHub.][14] - -[JavaScript][15] is still the reigning champion, and while some believe JavaScript is on its way out, it remains the 800-pound gorilla and is likely to remain that way for some time. [Java][16] faces similar rumors and this data shows that it's a major part of the open source ecosystem. - -Given the popularity of projects like [Docker][17] and [Kubernetes][18], you might be wondering, “What about Go ([Golang][19])?” This is a good time for a reminder that the GitHub dataset discussed here contains some gaps, most significantly after 2017, which is about when I saw Golang projects popping up everywhere. I hope to repeat this search with a complete GitHub dataset and see if it changes the rankings at all. - -Now let's explore the rate of project creation. (Reminder: this is valid JSON consolidated for readability.) - - -``` -`{"aggs":{"2":{"date_histogram":{"field":"root.created_at","interval":"1M","time_zone":"America/New_York","min_doc_count":1}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["root.created_at","root.updated_at"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"root.language":{"query":""}}}]}}}` -``` - -Seeing the rate at which new projects are created would be fun impressive as well, with tremendous growth starting around 2012: - -![The rate at which new projects are created on GitHub.][20] - -Now that I knew the rate of projects created as well as the most popular languages used to create these projects, I wanted to find out what open source licenses these projects chose. Unfortunately, this data doesn’t exist in the GitHub projects dataset, but the fantastic team over at [Tidelift][21] publishes a detailed list of GitHub projects, licenses used, and other details regarding the state of open source software in their [Libraries.io][22][ data][23]. Ingesting this dataset into **CHAOS** SEARCH took just minutes, letting me see which open source software licenses are the most popular on GitHub: - -(Reminder: this is valid JSON consolidated for readability.) - - -``` -`{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}}` -``` - -The results show some significant outliers: - -![Which open source software licenses are the most popular on GitHub.][24] - -As you can see, the [MIT license][25] and the [Apache 2.0 license][26] by far outweighs most of the other open source licenses used for these projects, while [various BSD and GPL licenses][27] follow far behind. I can’t say that I’m surprised by these results given GitHub’s open model. I would guess that users, not companies, create most projects and that they use the MIT license to make it simple for other people to use, share, and contribute. That Apache 2.0** **licensing is right behind also makes sense, given just how many companies want to ensure their trademarks are respected and have an open source component to their businesses. - -Now that I identified the most popular licenses, I was curious to see the least used ones. By adjusting my last query, I reversed the top 10 into the bottom 10 and was able to find just two projects using the [University of Illinois—NCSA Open Source License][28]. I had never heard of this license before, but it’s pretty close to Apache 2.0. It’s interesting to see just how many different software licenses are in use across all GitHub projects. - -![The University of Illinois/NCSA open source license.][29] - -The University of Illinois/NCSA open source license. - -After that, I dove into a specific language (JavaScript) to see the most popular license used there. (Reminder: this is valid JSON consolidated for readability.) - - -``` -`{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[{"match_phrase":{"Repository Language":{"query":"JavaScript"}}}],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}}` -``` - -There were some surprises in this output. - -![The most popular open source licenses used for GitHub JavaScript projects.][30] - -Even though the default license for [NPM][31] modules when created with **npm init **is the one from [Internet Systems Consortium (ISC)][32], you can see that a considerable number of these projects use MIT as well as Apache 2.0 for their open source license. - -Since the Libraries.io dataset is rich in open source project content, and since the GHTorrent data is missing the last few years’ data (and thus missing any details about Golang projects), I decided to run a similar query to see how Golang projects license their code. - -(Reminder: this is valid JSON consolidated for readability.) - - -``` -`{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[{"match_phrase":{"Repository Language":{"query":"Go"}}}],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}}` -``` - -The results were quite different than Javascript. - -![How Golang projects license their GitHub code.][33] - -Golang offers a stunning reversal from JavaScript—nearly three times as many Golang projects are licensed with Apache 2.0 over MIT. While it’s hard precisely explain why this is the case, over the last few years there’s been massive growth in Golang, especially among companies building projects and software offerings, both open source and commercially. - -As we learned above, many of these companies want to enforce their trademarks, thus the move to the Apache 2.0 license makes sense. - -#### Conclusion - -In the end, I found some interesting results by diving into the GitHub users and projects data dump. Some of these I definitely would have guessed, but a few results were surprises to me as well, especially the outliers like the rarely-used NCSA license. - -All in all, you can see how quickly and easily the **CHAOS** SEARCH platform lets us find complicated answers to interesting questions. I dove into this dataset and received deep analytics without having to run any databases myself, and even stored the data inexpensively on Amazon S3—so there’s little maintenance involved. Now I can ask any other questions regarding the data anytime I want. - -What other questions are you asking your data, and what data sets do you use? Let me know in the comments or on Twitter [@petecheslock][34]. - -_A version of this article was originally posted on[ **CHAOS** SEARCH][35]._ - -* * * - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/chaossearch-github-ghtorrent - -作者:[Pete Cheslock][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/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0 (magnifying glass on computer screen) -[2]: https://chaossearch.io/ -[3]: https://aws.amazon.com/s3/ -[4]: https://www.elastic.co/ -[5]: https://www.elastic.co/products/kibana -[6]: http://ghtorrent.org -[7]: http://ghtorrent.org/services.html -[8]: http://ghtorrent.org/downloads.html -[9]: http://ndjson.org -[10]: https://en.wikipedia.org/wiki/Comma-separated_values -[11]: https://en.wikipedia.org/wiki/MySQL -[12]: https://www.mongodb.com/ -[13]: https://stedolan.github.io/jq/ -[14]: https://opensource.com/sites/default/files/uploads/github-1_500.png (Which software languages are the most popular on GitHub.) -[15]: https://en.wikipedia.org/wiki/JavaScript -[16]: /resources/java -[17]: /resources/what-docker -[18]: /resources/what-is-kubernetes -[19]: https://golang.org/ -[20]: https://opensource.com/sites/default/files/uploads/github-2_500.png (The rate at which new projects are created on GitHub.) -[21]: https://tidelift.com -[22]: http://libraries.io/ -[23]: https://libraries.io/data -[24]: https://opensource.com/sites/default/files/uploads/github-3_500.png (Which open source software licenses are the most popular on GitHub.) -[25]: https://opensource.org/licenses/MIT -[26]: https://opensource.org/licenses/Apache-2.0 -[27]: https://opensource.org/licenses -[28]: https://tldrlegal.com/license/university-of-illinois---ncsa-open-source-license-(ncsa) -[29]: https://opensource.com/sites/default/files/uploads/github-4_500_0.png (The University of Illinois/NCSA open source license.) -[30]: https://opensource.com/sites/default/files/uploads/github-5_500_0.png (The most popular open source licenses used for GitHub JavaScript projects.) -[31]: https://www.npmjs.com/ -[32]: https://en.wikipedia.org/wiki/ISC_license -[33]: https://opensource.com/sites/default/files/uploads/github-6_500.png (How Golang projects license their GitHub code.) -[34]: https://twitter.com/petecheslock -[35]: https://chaossearch.io/blog/where-are-the-github-users-part-1/ diff --git a/translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md b/translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md new file mode 100644 index 0000000000..b51f375a48 --- /dev/null +++ b/translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Querying 10 years of GitHub data with GHTorrent and Libraries.io) +[#]: via: (https://opensource.com/article/19/5/chaossearch-github-ghtorrent) +[#]: author: (Pete Cheslock https://opensource.com/users/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes) + +用 GHTorrent 和 Libraries.io 查询 10 年的 GitHub 数据 +====== +> 有一种方法可以在没有任何本地基础设施的情况下使用开源数据集探索 GitHub 数据. + +![magnifying glass on computer screen][1] + +我一直在寻找新的数据集,以用它们来展示我团队工作的力量。[CHAOSSEARCH][2] 可以将你的 [Amazon S3][3] 对象存储数据转换为完全可搜索的 [Elasticsearch][4] 式集群。使用 Elasticsearch API 或 [Kibana][5] 等工具,你可以查询你找的任何数据。 + +当我找到 [GHTorrent][6] 项目进行探索时,我很兴奋。GHTorrent 旨在通过 GitHub API 构建所有可用数据的离线版本。如果你喜欢数据集,这是一个值得一看的项目,甚至你可以考虑[捐赠一个 GitHub API 密钥][7]。 + +### 访问 GHTorrent 数据 + +有许多方法可以访问和使用 [GHTorrent 的数据][8],它以 [NDJSON][9] 格式提供。这个项目可以以多种形式提供数据,包括用于恢复到 [MySQL][11] 数据库的 [CSV][10],可以转储所有对象的 [MongoDB][12],以及用于将数据直接导出到 Google 对象存储中的 Google Big Query(免费)。 有一点需要注意:这个数据集有从 2008 年到 2017 年的几乎完整的数据集,但从 2017 年到现在的数据还不完整。这将影响我们确定性查询的能力,但它仍然是一个令人兴奋的信息量。 + +我选择 Google Big Query 来避免自己运行任何数据库,那么我就可以很快下载包括用户和项目在内的完整数据库。 CHAOSSEARCH 可以原生分析 NDJSON 格式,因此在将数据上传到 Amazon S3 之后,我能够在几分钟内对其进行索引。 CHAOSSEARCH 平台不要求用户设置索引模式或定义其数据的映射,它可以发现所有字段本身(字符串、整数等)。 + +随着我的数据完全索引并准备好进行搜索和聚合,我想深入了解看看我们可以发现什么,比如哪些软件语言是 GitHub 项目最受欢迎的。 + +(关于格式化的说明:下面这是一个有效的 JSON 查询,我们不会在这里正确格式化以避免滚动疲劳。要正确格式化它,你可以在本地复制它并发送到命令行实用程序,如 [jq][13]。) + +``` +{"aggs":{"2":{"date_histogram":{"field":"root.created_at","interval":"1M","time_zone":"America/New_York","min_doc_count":1}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["root.created_at","root.updated_at"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"root.language":{"query":""}}}]}}} +``` + +对于那些近年来跟踪开源语言状态的人来说,这个结果并不令人惊讶。 + +![Which software languages are the most popular on GitHub.][14] + +[JavaScript][15] 仍然是卫冕冠军,虽然有些人认为 JavaScript 正在逐渐消失,但它仍然是 800 磅重的大猩猩,很可能会保持这种状态一段时间。[Java][16] 面临类似的谣言,但这些数据表明它是开源生态系统的重要组成部分。 + +考虑到像 [Docker][17] 和 [Kubernetes][18] 这样的项目的流行,你可能会想,“Go([Golang][19])怎么样?”这是一个提醒的好时机,这里讨论的 GitHub 数据集包含一些空缺,最明显的是在 2017 年之后我看到 Golang 项目随处可见,而这里并没有显示。我希望用完整的 GitHub 数据集重复此搜索,看看它是否会改变排名。 + +现在让我们来探讨项目创建的速度。 (提醒:这是为了便于阅读而合并的有效 JSON。) + +``` +{"aggs":{"2":{"date_histogram":{"field":"root.created_at","interval":"1M","time_zone":"America/New_York","min_doc_count":1}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["root.created_at","root.updated_at"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"root.language":{"query":""}}}]}}} +``` + +我们可以看到创建新项目的速度,也会给人留下深刻的印象,从 2012 年左右开始大幅增长: + +![The rate at which new projects are created on GitHub.][20] + +既然我知道了创建的项目的速度以及用于创建这些项目的最流行的语言,我还想知道这些项目选择的开源许可证。遗憾的是,这个 GitHub 项目数据集中并不存在这些数据,但是 [Tidelift][21] 的精彩团队在 [Libraries.io][22] [数据][23] 里发布了一个 GitHub 项目的详细列表,包括使用的许可证以及其中有关开源软件状态的其他详细信息。将此数据集导入 CHAOSSEARCH 只花了几分钟,让我看看哪些开源软件许可证在 GitHub 上最受欢迎: + +(提醒:这是为了便于阅读而合并的有效 JSON。) + + +``` +{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}} +``` + +结果显示了一些重要的异常值: + +![Which open source software licenses are the most popular on GitHub.][24] + +如你所见,[MIT 许可证][25] 和 [Apache 2.0 许可证][26] 的开源项目远远超过了其他大多数开源许可证,而 [各种 BSD 和 GPL 许可证][27] 则差得很远。鉴于 GitHub 的开放模式,我不能说我对这些结果感到惊讶。我猜想用户(而不是公司)创建了大多数项目,并且他们使用 MIT 许可证可以使其他人轻松使用、共享和贡献。而鉴于有不少公司希望确保其商标得到尊重并为其业务提供开源组件,那么 Apache 2.0 许可证数量高企的背后也是有道理的。 + +现在我确定了最受欢迎的许可证,我很想看看到最少使用的许可证。通过调整我的上一个查询,我将前 10 名逆转为最后 10 名,并且只找到了两个使用 [伊利诺伊大学 - NCSA 开源许可证][28] 的项目。我之前从未听说过这个许可证,但它与 Apache 2.0 非常接近。看到了所有 GitHub 项目中使用了多少个不同的软件许可证,这很有意思。 + +![The University of Illinois/NCSA open source license.][29] + +之后,我针对特定语言(JavaScript)来查看最常用的许可证。(提醒:这是为了便于阅读而合并的有效JSON。) + +``` +{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[{"match_phrase":{"Repository Language":{"query":"JavaScript"}}}],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}} +``` + +这个输出有一些意外。 + +![The most popular open source licenses used for GitHub JavaScript projects.][30] + +尽管使用 `npm init` 创建的 [NPM][31] 模块的默认许可证是 [Internet Systems Consortium(ISC)][32] 的许可证,但你可以看到相当多的这些项目使用 MIT 以及 Apache 2.0 的开源许可证。 + +由于 Libraries.io 数据集中包含丰富的开源项目内容,并且由于 GHTorrent 数据缺少最近几年的数据(因此缺少有关 Golang 项目的任何细节),因此我决定运行类似的查询来查看 Golang 项目是如何许可他们的代码的。 + +(提醒:这是为了便于阅读而合并的有效 JSON。) + +``` +{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[{"match_phrase":{"Repository Language":{"query":"Go"}}}],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}} +``` + +结果与 Javascript 完全不同。 + +![How Golang projects license their GitHub code.][33] + +Golang 项目与 JavaScript 项目惊人逆转 —— 使用 Apache 2.0 的 Golang 项目几乎是 MIT 许可证的三倍。虽然很难准确地解释为什么会出现这种情况,但在过去的几年中,Golang 已经出现了大规模的增长,特别是在开源和商业化的项目和软件产品公司中。 + +正如我们上面所了解的,这些公司中的许多公司都希望强制执行其商标,因此转向 Apache 2.0 许可证是有道理的。 + +#### 总结 + +最后,我通过深入了解 GitHub 用户和项目的数据找到了一些有趣的结果。其中一些我肯定会猜到,但是一些结果对我来说也是惊喜,特别是像很少使用的 NCSA 许可证这样的异常值。 + +总而言之,你可以看到 CHAOSSEARCH 平台能够快速轻松地找到有趣问题的复杂答案。我无需自己运行任何数据库就可以深入研究这个数据集,甚至可以在 Amazon S3 上以低成本的方式存储数据,因此无需维护。 现在,我可以随时查询有关这些数据的任何其他问题。 + +你对数据提出了哪些其他问题,以及你使用了哪些数据集?请在评论或推特上告诉我 [@petecheslock] [34]。 + +本文的一个版本最初发布在 [CHAOSSEARCH][35]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/chaossearch-github-ghtorrent + +作者:[Pete Cheslock][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0 (magnifying glass on computer screen) +[2]: https://chaossearch.io/ +[3]: https://aws.amazon.com/s3/ +[4]: https://www.elastic.co/ +[5]: https://www.elastic.co/products/kibana +[6]: http://ghtorrent.org +[7]: http://ghtorrent.org/services.html +[8]: http://ghtorrent.org/downloads.html +[9]: http://ndjson.org +[10]: https://en.wikipedia.org/wiki/Comma-separated_values +[11]: https://en.wikipedia.org/wiki/MySQL +[12]: https://www.mongodb.com/ +[13]: https://stedolan.github.io/jq/ +[14]: https://opensource.com/sites/default/files/uploads/github-1_500.png (Which software languages are the most popular on GitHub.) +[15]: https://en.wikipedia.org/wiki/JavaScript +[16]: /resources/java +[17]: /resources/what-docker +[18]: /resources/what-is-kubernetes +[19]: https://golang.org/ +[20]: https://opensource.com/sites/default/files/uploads/github-2_500.png (The rate at which new projects are created on GitHub.) +[21]: https://tidelift.com +[22]: http://libraries.io/ +[23]: https://libraries.io/data +[24]: https://opensource.com/sites/default/files/uploads/github-3_500.png (Which open source software licenses are the most popular on GitHub.) +[25]: https://opensource.org/licenses/MIT +[26]: https://opensource.org/licenses/Apache-2.0 +[27]: https://opensource.org/licenses +[28]: https://tldrlegal.com/license/university-of-illinois---ncsa-open-source-license-(ncsa) +[29]: https://opensource.com/sites/default/files/uploads/github-4_500_0.png (The University of Illinois/NCSA open source license.) +[30]: https://opensource.com/sites/default/files/uploads/github-5_500_0.png (The most popular open source licenses used for GitHub JavaScript projects.) +[31]: https://www.npmjs.com/ +[32]: https://en.wikipedia.org/wiki/ISC_license +[33]: https://opensource.com/sites/default/files/uploads/github-6_500.png (How Golang projects license their GitHub code.) +[34]: https://twitter.com/petecheslock +[35]: https://chaossearch.io/blog/where-are-the-github-users-part-1/ From 759c477794116960b89cf8310c53d1e65098e84b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 May 2019 23:37:47 +0800 Subject: [PATCH 0598/1154] PRF:20190501 3 apps to manage personal finances in Fedora.md @geekpi --- ...apps to manage personal finances in Fedora.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/tech/20190501 3 apps to manage personal finances in Fedora.md b/translated/tech/20190501 3 apps to manage personal finances in Fedora.md index 05015d29b3..5ca559313e 100644 --- a/translated/tech/20190501 3 apps to manage personal finances in Fedora.md +++ b/translated/tech/20190501 3 apps to manage personal finances in Fedora.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 apps to manage personal finances in Fedora) @@ -14,15 +14,15 @@ 网上有很多可以用来管理你个人财务的服务。虽然它们可能很方便,但这通常也意味着将你最宝贵的个人数据放在你无法监控的公司。也有些人对这些不太在意。 -无论你是否在意,你可能会对你自己系统上的应用感兴趣。这意味着如果你不想,你的数据永远不会离开莫自己的计算机。这三款之一可能就是你想找的。 +无论你是否在意,你可能会对你自己系统上的应用感兴趣。这意味着如果你不想,你的数据永远不会离开自己的计算机。这三款之一可能就是你想找的。 ### HomeBank -HomeBank 是一款可以管理多个账户的全功能软件。它很容易设置并保持更新。它有多种方式画出你的分类和负载,以便你可以看到资金流向何处。它可以通过官方 Fedora 仓库下载。 +HomeBank 是一款可以管理多个账户的全功能软件。它很容易设置并保持更新。它有多种方式画出你的分类和负债,以便你可以看到资金流向何处。它可以通过官方 Fedora 仓库下载。 ![A simple account set up in HomeBank with a few transactions.][2] -要安装 HomeBank,请打开_软件中心_,搜索 _HomeBank_,然后选择该应用。单击_安装_将其添加到你的系统中。HomeBank 也可以通过 Flatpak 安装。 +要安装 HomeBank,请打开“软件中心”,搜索 “HomeBank”,然后选择该应用。单击“安装”将其添加到你的系统中。HomeBank 也可以通过 Flatpak 安装。 ### KMyMoney @@ -42,13 +42,13 @@ $ sudo dnf install kmymoney ![Checking account records shown in GnuCash.][5] -打开_软件中心_,搜索 _GnuCash_,然后选择应用。单击_安装_将其添加到你的系统中。或者如上所述使用 _dnf install_ 来安装 _gnucash_ 包。 +打开“软件中心”,搜索 “GnuCash”,然后选择应用。单击“安装”将其添加到你的系统中。或者如上所述使用 `dnf install` 来安装 “gnucash” 包。 -它现在可以通过 Flathub 安装,这使得安装变得简单。如果你没有安装 Flathub,请查看 [Fedora Magazine 上的这篇文章][6]了解如何使用它。这样你也可以在终端使用 _flatpak install GnuCash_ 命令。 +它现在可以通过 Flathub 安装,这使得安装变得简单。如果你没有安装 Flathub,请查看 [Fedora Magazine 上的这篇文章][6]了解如何使用它。这样你也可以在终端使用 `flatpak install gnucash` 命令。 * * * -照片由 _[_Fabian Blank_][7]_ 拍摄,发布在 [ _Unsplash_][8] 上。 +照片由 [Fabian Blank][7] 拍摄,发布在 [Unsplash][8] 上。 -------------------------------------------------------------------------------- @@ -57,7 +57,7 @@ via: https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/ 作者:[Paul W. Frields][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/) 荣誉推出 From 7ac5acf15a0fd5affefa472e732ffa74ff6f87cc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 May 2019 23:38:21 +0800 Subject: [PATCH 0599/1154] PUB:20190501 3 apps to manage personal finances in Fedora.md @geekpi https://linux.cn/article-10903-1.html --- .../20190501 3 apps to manage personal finances in Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190501 3 apps to manage personal finances in Fedora.md (98%) diff --git a/translated/tech/20190501 3 apps to manage personal finances in Fedora.md b/published/20190501 3 apps to manage personal finances in Fedora.md similarity index 98% rename from translated/tech/20190501 3 apps to manage personal finances in Fedora.md rename to published/20190501 3 apps to manage personal finances in Fedora.md index 5ca559313e..dee4fb0985 100644 --- a/translated/tech/20190501 3 apps to manage personal finances in Fedora.md +++ b/published/20190501 3 apps to manage personal finances in Fedora.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10903-1.html) [#]: subject: (3 apps to manage personal finances in Fedora) [#]: via: (https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/) [#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) From 7ece246ac5b4c57be574053e72fb52dc7eb4d427 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 27 May 2019 08:54:33 +0800 Subject: [PATCH 0600/1154] translated --- ... open source apps for plant-based diets.md | 68 ------------------- ... open source apps for plant-based diets.md | 67 ++++++++++++++++++ 2 files changed, 67 insertions(+), 68 deletions(-) delete mode 100644 sources/tech/20190422 4 open source apps for plant-based diets.md create mode 100644 translated/tech/20190422 4 open source apps for plant-based diets.md diff --git a/sources/tech/20190422 4 open source apps for plant-based diets.md b/sources/tech/20190422 4 open source apps for plant-based diets.md deleted file mode 100644 index 2e27ab4b44..0000000000 --- a/sources/tech/20190422 4 open source apps for plant-based diets.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 open source apps for plant-based diets) -[#]: via: (https://opensource.com/article/19/4/apps-plant-based-diets) -[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) - -4 open source apps for plant-based diets -====== -These apps make it easier for vegetarians and vegans—and omnivores who -want to eat healthier—to find food they can eat. -![][1] - -Reducing your consumption of meat, dairy, and processed foods is better for the planet and better for your health. Changing your diet can be difficult, but several open source Android applications can help you switch to a more plant-based diet. Whether you are taking part in [Meatless Monday][2], following Mark Bittman's [Vegan Before 6:00][3] guidelines, or switching entirely to a [whole-food, plant-based diet][4], these apps can aid you on your journey by helping you figure out what to eat, discover vegan- and vegetarian-friendly restaurants, and easily communicate your dietary preferences to others. All of these apps are open source and available from the [F-Droid repository][5]. - -### Daily Dozen - -![Daily Dozen app][6] - -The [Daily Dozen][7] app provides a checklist of items that Michael Greger, MD, FACLM, recommends as part of a healthy diet and lifestyle. Dr. Greger recommends consuming a whole-food, plant-based diet consisting of diverse foods and supported by daily exercise. This app lets you keep track of how many servings of each type of food you have eaten, how many servings of water (or other approved beverage, such as tea) you drank, and if you exercised each day. Each category of food provides serving sizes and lists of foods that fall under that category; for example, the Cruciferous Vegetable category includes bok choy, broccoli, brussels sprouts, and many other suggestions. - -### Food Restrictions - -![Food Restrictions app][8] - -[Food Restrictions][9] is a simple app that can help you communicate your dietary restrictions to others, even if those people do not speak your language. Users can enter their food restrictions for seven different categories: chicken, beef, pork, fish, cheese, milk, and peppers. There is an "I don't eat" and an "I'm allergic" option for each of those categories. The "don't eat" option shows the icon with a red X over it. The "allergic" option displays the X and a small skull icon. The same information can be displayed using text instead of icons, but the text is only available in English and Portuguese. There is also an option for displaying a text message that says the user is vegetarian or vegan, which summarizes those dietary restrictions more succinctly and more accurately than the pick-and-choose options. The vegan text clearly mentions not eating eggs and honey, which are not options in the pick-and-choose method. However, just like the text version of the pick-and-choose option, these sentences are only available in English and Portuguese. - -### OpenFoodFacts - -![Open Food Facts app][10] - -Avoiding unwanted ingredients when buying groceries can be frustrating, but [OpenFoodFacts][11] can help make the process easier. This app lets you scan the barcodes on products to get a report about the ingredients in a product and how healthy the product is. A product can still be very unhealthy even if it meets the criteria to be a vegan product. Having both the ingredients list and the nutrition facts lets you make informed choices when shopping. The only drawback for this app is that the data is user contributed, so not every product is available, but you can contribute new items, if you want to give back to the project. - -### OpenVegeMap - -![OpenVegeMap app][12] - -Find vegan and vegetarian restaurants in your neighborhood with the [OpenVegeMap][13] app. This app lets you search by either using your phone's current location or by entering an address. Restaurants are classified as Vegan only, Vegan friendly, Vegetarian only, Vegetarian friendly, Non-vegetarian, and Unknown. The app uses data from [OpenStreetMap][14] and user-contributed information about the restaurants, so be sure to double-check to make sure the information provided is up-to-date and accurate. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/apps-plant-based-diets - -作者:[Joshua Allen Holm ][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/holmja -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_041x_0.png?itok=tfg6_I78 -[2]: https://www.meatlessmonday.com/ -[3]: https://www.amazon.com/dp/0385344740/ -[4]: https://nutritionstudies.org/whole-food-plant-based-diet-guide/ -[5]: https://f-droid.org/ -[6]: https://opensource.com/sites/default/files/uploads/daily_dozen.png (Daily Dozen app) -[7]: https://f-droid.org/en/packages/org.nutritionfacts.dailydozen/ -[8]: https://opensource.com/sites/default/files/uploads/food_restrictions.png (Food Restrictions app) -[9]: https://f-droid.org/en/packages/br.com.frs.foodrestrictions/ -[10]: https://opensource.com/sites/default/files/uploads/openfoodfacts.png (Open Food Facts app) -[11]: https://f-droid.org/en/packages/openfoodfacts.github.scrachx.openfood/ -[12]: https://opensource.com/sites/default/files/uploads/openvegmap.png (OpenVegeMap app) -[13]: https://f-droid.org/en/packages/pro.rudloff.openvegemap/ -[14]: https://www.openstreetmap.org/ diff --git a/translated/tech/20190422 4 open source apps for plant-based diets.md b/translated/tech/20190422 4 open source apps for plant-based diets.md new file mode 100644 index 0000000000..96107a526a --- /dev/null +++ b/translated/tech/20190422 4 open source apps for plant-based diets.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 open source apps for plant-based diets) +[#]: via: (https://opensource.com/article/19/4/apps-plant-based-diets) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) + +4 款基于植物饮食的开源应用 +====== +这些应用使素食者、纯素食主义者和那些想吃得更健康的杂食者找到可以吃的食物。 +![][1] + +减少对肉类、乳制品和加工食品的消费对地球来说更好,也对你的健康更有益。改变你的饮食习惯可能很困难,但是一些开源的 Android 应用可以帮助你切换成基于植物的饮食。无论你是参加[无肉星期一][2],参加 Mark Bittman 的 [6:00 前的素食][3]指南,还是完全切换到[全植物性饮食][4],这些应用能帮助你找出要吃什么,发现素食和素食友好的餐馆,并轻松地将你的饮食偏好传达给他人,来助你更好地走这条路。所有这些应用都是开源的,可从 [F-Droid 仓库][5]下载。 + +### Daily Dozen + +![Daily Dozen app][6] + +[Daily Dozen][7] 提供了医学博士、美国法律医学院院士 Michael Greger 推荐的项目清单,作为健康饮食和生活方式的一部分。Greger 博士建议食用全食,由多种食物组成的基于植物的饮食,并坚持日常锻炼。该应用可以让你跟踪你吃的每种食物的份数,你喝了多少份水(或其他获准的饮料,如茶),以及你是否每天锻炼。每类食物都提供食物分量和属于该类别的食物清单。例如,十字花科蔬菜类包括白菜、花椰菜、芽甘蓝等许多其他建议。 + +### Food Restrictions + +![Food Restrictions app][8] + +[Food Restrictions][9] 是一个简单的应用,它可以帮助你将饮食限制传达给他人,即使这些人不会说你的语言。用户可以输入七种不同类别的食物限制:鸡肉、牛肉、猪肉、鱼、奶酪、牛奶和辣椒。每种类别都有“我不吃”和“我过敏”选项。“不吃”选项会显示带有红色 X 的图标。“过敏” 选项显示 X 和小骷髅图标。可以使用文本而不是图标显示相同的信息,但文本仅提供英语和葡萄牙语。还有一个选项可以显示一条文字信息,说明用户是素食主义者或纯素食主义者,它比选择更简洁、更准确地总结了这些饮食限制。纯素食主义者的文本清楚地提到不吃鸡蛋和蜂蜜,这在挑选中是没有的。但是,就像挑选方式的文字版本一样,这些句子仅提供英语和葡萄牙语。 + +### OpenFoodFacts + +![Open Food Facts app][10] + +购买杂货时避免不必要的成分可能令人沮丧,但 [OpenFoodFacts][11] 可以帮助简化流程。该应用可让你扫描产品上的条形码,以获得有关产品成分和是否健康的报告。即使产品符合纯素产品的标准,产品仍然可能非常不健康。拥有成分列表和营养成分可让你在购物时做出明智的选择。此应用的唯一缺点是数据是用户贡献的,因此并非每个产品都可有数据,但如果你想回馈项目,你可以贡献新数据。 + +### OpenVegeMap + +![OpenVegeMap app][12] + +使用 [OpenVegeMap][13] 查找你附近的纯素食或素食主义餐厅。此应用可以通过手机的当前位置或者输入地址来搜索。餐厅分类为仅限纯素食者、纯素友好,仅限素食主义者,素食友好者,非素食和未知。该应用使用来自 [OpenStreetMap][14] 的数据和用户提供的有关餐馆的信息,因此请务必仔细检查以确保所提供的信息是最新且准确的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/apps-plant-based-diets + +作者:[Joshua Allen Holm ][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/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_041x_0.png?itok=tfg6_I78 +[2]: https://www.meatlessmonday.com/ +[3]: https://www.amazon.com/dp/0385344740/ +[4]: https://nutritionstudies.org/whole-food-plant-based-diet-guide/ +[5]: https://f-droid.org/ +[6]: https://opensource.com/sites/default/files/uploads/daily_dozen.png (Daily Dozen app) +[7]: https://f-droid.org/en/packages/org.nutritionfacts.dailydozen/ +[8]: https://opensource.com/sites/default/files/uploads/food_restrictions.png (Food Restrictions app) +[9]: https://f-droid.org/en/packages/br.com.frs.foodrestrictions/ +[10]: https://opensource.com/sites/default/files/uploads/openfoodfacts.png (Open Food Facts app) +[11]: https://f-droid.org/en/packages/openfoodfacts.github.scrachx.openfood/ +[12]: https://opensource.com/sites/default/files/uploads/openvegmap.png (OpenVegeMap app) +[13]: https://f-droid.org/en/packages/pro.rudloff.openvegemap/ +[14]: https://www.openstreetmap.org/ From c447eea9eefd2de50b53feae5ad17f901fd84d30 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 27 May 2019 09:00:51 +0800 Subject: [PATCH 0601/1154] translating --- ...20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md b/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md index 11659592fb..b7a2707cfe 100644 --- a/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md +++ b/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 87d53f338bcee5022684345e273703c6e130e224 Mon Sep 17 00:00:00 2001 From: zhang5788 <1109750079@qq.com> Date: Mon, 27 May 2019 11:01:08 +0800 Subject: [PATCH 0602/1154] zhang5788 translating --- sources/tech/20190520 Getting Started With Docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190520 Getting Started With Docker.md b/sources/tech/20190520 Getting Started With Docker.md index 873173e4ad..596fb27801 100644 --- a/sources/tech/20190520 Getting Started With Docker.md +++ b/sources/tech/20190520 Getting Started With Docker.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zhang5788) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b95df6303df76584ef84e5124913ef12f00636d2 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 12:19:19 +0800 Subject: [PATCH 0603/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190405=20Bloc?= =?UTF-8?q?kchain=202.0=20=E2=80=93=20Ongoing=20Projects=20(The=20State=20?= =?UTF-8?q?Of=20Smart=20Contracts=20Now)=20[Part=206]=20sources/tech/20190?= =?UTF-8?q?405=20Blockchain=202.0=20-=20Ongoing=20Projects=20(The=20State?= =?UTF-8?q?=20Of=20Smart=20Contracts=20Now)=20-Part=206.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e State Of Smart Contracts Now) -Part 6.md | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md diff --git a/sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md b/sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md new file mode 100644 index 0000000000..3674b73954 --- /dev/null +++ b/sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Ongoing Projects (The State Of Smart Contracts Now) [Part 6]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – Ongoing Projects (The State Of Smart Contracts Now) [Part 6] +====== + +![The State Of Smart Contracts Now][1] + +Continuing from our [**earlier post on smart contracts**][2], this post aims to discuss the state of Smart contracts, highlight some current projects and companies currently undertaking developments in the area. Smart contracts as discussed in the previous article of the series are programs that exist and execute themselves on a blockchain network. We explored how smart contracts work and why they are superior to traditional digital platforms. Companies described here operate in a wide variety of industries however most of them deal with identity management systems, financial services, crowd funding systems etc., as these are the areas thought to be most suitable for switching to blockchain based data base systems. + +### Open platforms + +Platforms such as **Counterparty** [1] and **Solidity(Ethereum)** are fully public building blocks for developers to create their own smart contracts. Wide spread developer participation in such projects have allowed these to become de facto standards for developing smart contracts, designing your own cryptocurrency token systems, and creating protocols for the blockchains to function. Many commendable projects have derived from them. **Quorum** , by JP Morgan, derived from Ethereum, is an example. **Ripple** is another example for the same. + +### Managing financial transactions + +Transferring cryptocurrencies over the internet is touted to be the norm in the coming years. The shortfalls with the same are: + + * Identities and wallet addresses are anonymous. The payer doesn’t have any first recourse if the receiver does not honor the transaction. + * Erroneous transactions if any will cannot be traced. + * Cryptographically generated hash keys are difficult to work with for humans and human errors are a prime concern. + + + +Having someone else take in the transaction momentarily and settle it with the receiver after due diligence is preferred in this case. + +**EscrowMyEther** [3] and **PAYFAIR** [4] are two such escrow platforms. Basically, the escrow company takes the agreed upon amount and sends a token to the receiver. Once the receiver delivers what the payer wants via the same escrow platform, both confirm and the final payment is released. These are used extensively by freelancers and hobbyist collectors online. + +### Financial services + +Developments in micro-financing and micro-insurance projects will improve the banking infrastructure for much of the world’s poor and unbanked. Involving the poorer “unbanked” sections of the society is estimated to increase revenues for banks and institutions involved by **$380 billion** [5]. This amount supersedes the savings in operational expenses that can be expected by switching to blockchain DLT for banks. + +**BankQu Inc.** based in Midwest United States goes by the slogan “Dignity through identity”. Their platform allows for individuals to setup their own digital identity record where all their transactions will be vetted and processed real time on the blockchain. Overtime the underlying code records and builds a unique online identity for its users allowing for ultra-quick transactions and settlements. The BankQu case studies exploring more about how they’re helping individuals and companies this way is available [here][3]. + +**Stratumn** is helping insurance companies offer better insurance services by automating tasks which were earlier micromanaged by humans. By automation, end to end traceability, and efficient data privacy methods they’ve radically changed how insurance claims are settled. Improved customer experience along with significant cost reductions present a win-win situation for clients as well as firms involved[6]. + +A similar endeavor is being run on a trial basis currently by the French Insurance firm, **AXA**. The product _**“fizzy”**_ allows users to subscribe to its service for a small fee and enter their flight details. In case, the flight gets delayed or comes across some other issue, the program automatically scours online databases, checks with the insurance terms and credits the insurance amount to the user’s account. This eliminates the need for the user or the customer to file a claim after checking with the terms manually and in the long-run once such systems become mainstream, increase accountability from airlines[7][8]. + +### Keeping track of ownership rights + +It is theoretically possible to track media from creation to end user consumption utilizing timestamped blocks of data in a DLT. Companies **Peertracks** and **Mycelia** are currently helping musicians publish content without worrying about their content being stolen or misused. They help artists sell directly to fans and clients while getting paid for their work without having to go through rights and record labels[9]. + +### Identity management platforms + +Blockchain based identity management platforms store your identity on a distributed ledger. Once an account is setup, it is securely encrypted and sent to all the participating nodes after. However, as the owner of the data block only the user has access to the data. Once your identity is established on the network and you begin transactions, an automated program within the network will verify all previous transactions associated with your account, send it for regulatory filings after checking requirements and execute the settlement automatically provided the program deems the transaction legitimate. The upside here being that since the data on the blockchain is tamper-proof and the smart contract checks the input with zero bias (or subjectivity), the transaction doesn’t, as previously mentioned, require oversight or approval from anyone and is taken care of instantaneously. + +Start-ups like **ShoCard** , **Credits** , and **OneName** are currently rolling out similar services and are currently in talks with government and social institutions for integrating them into mainstream use. + +Other independent projects by developers like **Chris Ellis** and **David Duccini** have respectively developed or proposed alternative identity management systems such as **“[World Citizenship][4]”** , and **[IDCoin][5]** , respectively. Mr Ellis even demonstrated the capabilities of his work by creating passports on the a blockchain network[10][11] [12][5]. + +### Resource sharing + +**Share & Charge (Slock.It)** is a European blockchain start-up. Their mobile app allows homeowners and other individuals who’ve invested their money in setting up a charging station share their resource with other individuals who’re looking for a quick. This not only allows owners to get back some of their investment, but also allows EV drivers to access significantly more charging points in their near-by geographical area allowing for suppliers to meet demands in a convenient manner. Once a “customer” is done charging their vehicle, the hardware associated creates a secure time stamped block consisting of the data and a smart contract working on the platform automatically credits the corresponding amount of money into the owners account. A track of all such transactions is recorded and proper security verifications kept in place. Interested readers can take a look [here][6], to know the technical angle behind their product[13][14]. The company’s platforms will gradually enable users to share other products and services with individuals in need and earn a passive income from the same. + +The companies we’ve looked at here, comprise a very short list of ongoing projects that make use of smart contracts and blockchain database systems. Platform such as these help in building a secure “box” full of information to be accessed only by the users themselves and the overlying code or the smart contract. The information is vetted in real time based on a trigger, examined, and the algorithm is executed by the system. Such platforms with minimal human oversight, a much-needed step in the right direction with respect to secure digital automation, something which has never been thought of at this scale previously. + +The next post will shed some light on the **different types of blockchains**. Click the following link to know more about this topic. + + * [**Blockchain 2.0 – Public Vs Private Blockchain Comparison**][7] + + + +**References:** + + * **[1][About | Counterparty][8]** + * **[2] [Quorum | J.P. Morgan][9] +** + * **[3][Escrow My Ether][10]** + * **[4][PayFair][11]** + * **[5] B. Pani, “Blockchain Powered Financial Inclusion,” 2016.** + * **[6][STRATUMN | Insurance Claim Automation Across Europe][12]** + * **[7][fizzy][13]** + * **[8][AXA goes blockchain with fizzy | AXA][14]** + * **[9] M. Gates, “Blockchain. Ultimate guide to understanding blockchain bitcoin cryptocurrencies smart-contracts and the future of money.pdf.” 2017.** + * **[10][ShoCard Is A Digital Identity Card On The Blockchain | TechCrunch][15]** + * **[11][J. Biggs, “Your Next Passport Could Be On The Blockchain | TechCrunch][16]** + * **[12][OneName – Namecoin Wiki][17]** + * **[13][Share&Charge launches its app, on-boards over 1,000 charging stations on the blockchain][18]** + * **[14][slock.it – Landing][19]** + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/ + +作者:[editor][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/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/State-Of-Smart-Contracts-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[3]: https://banqu.co/case-study/ +[4]: https://github.com/MrChrisJ/World-Citizenship +[5]: https://github.com/IDCoin/IDCoin +[6]: https://blog.slock.it/share-charge-smart-contracts-the-technical-angle-58b93ce80f15 +[7]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ +[8]: https://counterparty.io/platform/ +[9]: https://www.jpmorgan.com/global/Quorum +[10]: http://escrowmyether.com/ +[11]: https://payfair.io/ +[12]: https://stratumn.com/business-case/insurance-claim-automation-across-europe/ +[13]: https://fizzy.axa/en-gb/ +[14]: https://group.axa.com/en/newsroom/news/axa-goes-blockchain-with-fizzy +[15]: https://techcrunch.com/2015/05/05/shocard-is-a-digital-identity-card-on-the-blockchain/ +[16]: https://techcrunch.com/2014/10/31/your-next-passport-could-be-on-the-blockchain/ +[17]: https://wiki.namecoin.org/index.php?title=OneName +[18]: https://blog.slock.it/share-charge-launches-its-app-on-boards-over-1-000-charging-stations-on-the-blockchain-ba8275390309 +[19]: https://slock.it/ From 125e4c5abf2fff34d0c1c4b48060b4ba6d172b90 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 12:20:42 +0800 Subject: [PATCH 0604/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190308=20Bloc?= =?UTF-8?q?kchain=202.0=20=E2=80=93=20Explaining=20Smart=20Contracts=20And?= =?UTF-8?q?=20Its=20Types=20[Part=205]=20sources/tech/20190308=20Blockchai?= =?UTF-8?q?n=202.0=20-=20Explaining=20Smart=20Contracts=20And=20Its=20Type?= =?UTF-8?q?s=20-Part=205.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g Smart Contracts And Its Types -Part 5.md | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md diff --git a/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md b/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md new file mode 100644 index 0000000000..072cbd63ee --- /dev/null +++ b/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Explaining Smart Contracts And Its Types [Part 5]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – Explaining Smart Contracts And Its Types [Part 5] +====== + +![Explaining Smart Contracts And Its Types][1] + +This is the 5th article in **Blockchain 2.0** series. The previous article of this series explored how can we implement [**Blockchain in real estate**][2]. This post briefly explores the topic of **Smart Contracts** within the domain of Blockchains and related technology. Smart Contracts, which are basic protocols to verify and create new “blocks” of data on the blockchain, are touted to be a focal point for future developments and applications of the system. However, like all “cure-all” medications, it is not the answer to everything. We explore the concept from the basics to understand what “smart contracts” are and what they’re not. + +### Evolving Contracts + +The world is built on contracts. No individual or firm on earth can function in current society without the use and reuse of contracts. The task of creating, maintaining, and enforcing contracts have become so complicated that entire judicial and legal systems have had to be setup in the name of **“contract law”** to support it. Most of all contracts are in fact overseen by a “trusted” third party to make sure the stakeholders at the ends are taken care of as per the conditions arrived. There are contracts that even talk about a third-party beneficiary. Such contracts are intended to have an effect on a third party who is not an active (or participating) party to the contract. Settling and arguing over contractual obligations takes up the bulk of most legal battles that civil lawsuits are involved in. Surely enough a better way to take care of contracts would be a godsend for individuals and enterprises alike. Not to mention the enormous paperwork it would save the government in the name of verifications and attestations[1][2]. + +Most posts in this series have looked at how existing blockchain tech is being leveraged today. In contrast, this post will be more about what to expect in the coming years. A natural discussion about “smart contracts” evolve from the property discussions presented in the previous post. The current post aims to provide an overview of the capabilities of blockchain to automate and carry out “smart” executable programs. Dealing with this issue pragmatically means we’ll first have to define and explore what these “smart contracts” are and how they fit into the existing system of contracts. We look at major present-day applications and projects going on in the field in the next post titled, **“Blockchain 2.0: Ongoing Projects”**. + +### Defining Smart Contracts + +The [**first article of this series**][3] looked at blockchain from a fundamental point of view as a **“distributed ledger”** consisting of blocks of data that were: + + * Tamper-proof + * Non-repudiable (Meaning every block of data is explicitly created by someone and that someone cannot deny any accountability of the same) + * Secure and is resilient to traditional methods of cyber attack + * Almost permanent (of course this depends on the blockchain protocol overlay) + * Highly redundant, by existing on multiple network nodes or participant systems, the failure of one of these nodes will not affect the capabilities of the system in any way, and, + * Offers faster processing depending on application. + + + +Because every instance of data is securely stored and accessible by suitable credentials, a blockchain network can provide easy basis for precise verification of facts and information without the need for third party oversight. blockchain 2.0 developments also allow for **“distributed applications”** (a term which we’ll be looking at in detail in coming posts). Such distributed applications exist and run on the network as per requirements. They’re called when a user needs them and executed by making use of information that has already been vetted and stored on the blockchain. + +The last paragraph provides a foundation for defining smart contracts. _**The Chamber for Digital Commerce**_ , provides a definition for smart contracts which many experts agree on. + +_**“Computer code that, upon the occurrence of a specified condition or conditions, is capable of running automatically according to prespecified functions. The code can be stored and processed on a distributed ledger and would write any resulting change into the distributed ledger”[1].**_ + +Smart contracts are as mentioned above simple computer programs working like “if-then” or “if-else if” statements. The “smart” aspect about the same comes from the fact that the predefined inputs for the program comes from the blockchain ledger, which as proven above, is a secure and reliable source of recorded information. The program can call upon external services or sources to get information as well, if need be, to verify the terms of operation and will only execute once all the predefined conditions are met. + +It has to be kept in mind that unlike what the name implies, smart contracts are not usually autonomous entities nor are they strictly speaking contracts. A very early mention of smart contracts was made by **Nick Szabo** in 1996, where he compared the same with a vending machine accepting payment and delivering the product chosen by the user[3]. The full text can be accessed **[here][4]**. Furthermore, Legal frameworks allowing the entry of smart contracts into mainstream contract use are still being developed and as such the use of the technology currently is limited to areas where legal oversight is less explicit and stringent[4]. + +### Major types of smart contracts + +Assuming the reader has a basic understanding of contracts and computer programming, and building on from our definition of smart contracts, we can roughly classify smart contracts and protocols into the following major categories. + +##### 1\. Smart legal contracts + +These are presumably the most obvious kind. Most, if not, all contracts are legally enforceable. Without going into much technicalities, a smart legal contact is one that involves strict legal recourses in case parties involved in the same were to not fulfill their end of the bargain. As previously mentioned, the current legal framework in different countries and contexts lack sufficient support for smart and automated contracts on the blockchain and their legal status is unclear. However, once the laws are made, smart contracts can be made to simplify processes which currently involve strict regulatory oversight such as transactions in the financial and real estate market, government subsidies, international trade etc. + +##### 2\. DAOs + +**Decentralized Autonomous Organizations** , shortly DAO, can be loosely defined as communities that exist on the blockchain. The community may be defined by a set of rules arrived at and put into code via smart contracts. Every action by every participant would then be subject to these sets of rules with the task of enforcing and reaching at recourse in case of a break being left to the program. Multitudes of smart contracts make up these rules and they work in tandem policing and watching over participants. + +A DAO called the **Genesis DAO** was created by **Ethereum** participants in may of 2016. The community was meant to be a crowdfunding and venture capital platform. In a surprisingly short period of time they managed to raise an astounding **$150 million**. However, hacker(s) found loopholes in the system and managed to steal about **$50 million** dollars’ worth of Ethers from the crowdfund investors. The hack and its fallout resulted in a fork of the Ethereum blockchain into two, **Ethereum** and **Ethereum Classic** [5]. + +##### 3\. Application logic contracts (ALCs) + +If you’ve heard about the internet of things in conjunction with the blockchain, chances are that the matter talked about **Application logic contacts** , shortly ALC. Such smart contracts contain application specific code that work in conjunction with other smart contracts and programs on the blockchain. They aid in communicating with and validating communication between devices (while in the domain of IoT). ALCs are a pivotal piece of every multi-function smart contract and mostly always work under a managing program. They find applications everywhere in most examples cited here[6][7]. + +_Since development is ongoing in the area, any definition or standard so to speak of will be fluidic and vague at best currently._ + +### How smart contracts work** + +To simplify things, let’s proceed by taking an example. + +John and Peter are two individuals debating about the scores in a football match. They have conflicting views about the outcome with both of them supporting different teams (context). Since both of them need to go elsewhere and won’t be able to finish the match then, John bets that team A will beat team B in the match and _offers_ Peter $100 in that case. Peter _considers_ and _accepts_ the bet while making it clear that they are _bound_ to the terms. However, neither of them _trusts_ each other to honour the bet and they don’t have the time nor the money to appoint a _third party_ to oversee the same. + +Assuming both John and Peter were to use a smart contract platform such as **[Etherparty][5]** , to automatically settle the bet at the time of the contract negotiation, they’ll both link their blockchain based identities to the contract and set the terms, making it clear that as soon as the match is over, the program will find out who the winning side is and automatically credit the amount to the winners bank account from the losers. As soon as the match ends and media outlets report the same, the program will scour the internet for the prescribed sources, identify which team won, relate it to the terms of the contract, in this case since B won Peter gets the money from John and after intimating both the parties transfers $100 from John’s to Peter’s account. After having executed, the smart contract will terminate and be inactive for all the time to come unless otherwise mentioned. + +The simplicity of the example aside, the situation involved a classic contract (paying attention to the italicized words) and the participants chose to implement the same using a smart contract. All smart contracts basically work on a similar principle, with the program being coded to execute on predefined parameters and spitting out expected outputs only. The outside sources the smart contract consults for information is may a times referred to as the _Oracle_ in the IT world. Oracles are a common part of many smart contract systems worldwide today. + +The use of a smart contract in this situation allowed the participants the following benefits: + + * It was faster than getting together and settling the bet manually. + * Removed the issue of trust from the equation. + * Eliminated the need for a trusted third party to handle the settlement on behalf of the parties involved. + * Costed nothing to execute. + * Is secure in how it handles parameters and sensitive data. + * The associated data will remain in the blockchain platform they ran it on permanently and future bets can be placed on by calling the same function and giving it added inputs. + * Gradually over time, assuming John and Peter develop gambling addictions, the program will help them develop reliable statistics to gauge their winning streaks. + + + +Now that we know **what smart contracts are** and **how they work** , we’re still yet to address **why we need them**. + +### The need for smart contracts + +As the previous example we visited highlights we need smart contracts for a variety of reasons. + +##### **Transparency** + +The terms and conditions involved are very clear to the counterparties. Furthermore, since the execution of the program or the smart contract involves certain explicit inputs, users have a very direct way of verifying the factors that would impact them and the contract beneficiaries. + +##### Time Efficient + +As mentioned, smart contracts go to work immediately once they’re triggered by a control variable or a user call. Since data is made available to the system instantaneously by the blockchain and from other sources in the network, the execution does not take any time at all to verify and process information and settle the transaction. Transferring land title deeds for instance, a process which involved manual verification of tons of paperwork and takes weeks on normal can be processed in a matter of minutes or even seconds with the help of smart contract programs working to vet the documents and the parties involved. + +##### Precision + +Since the platform is basically just computer code and everything predefined, there can be no subjective errors and all the results will be precise and completely free of human errors. + +##### Safety + +An inherent feature of the blockchain is that every block of data is cryptographically encrypted. Meaning even though the data is stored on a multitude of nodes on the network for redundancy, **only the owner of the data has access to see and use the data**. Similarly, all process will be completely secure and tamper proof with the execution utilizing the blockchain for storing important variables and outcomes in the process. The same also simplifies auditing and regulatory affairs by providing auditors with a native, un-changed and non-repudiable version of the data chronologically. + +##### Trust + +The article series started by saying that blockchain adds a much-needed layer of trust to the internet and the services that run on it. The fact that smart contracts will under no circumstances show bias or subjectivity in executing the agreement means that parties involved are fully bound the outcomes and can trust the system with no strings attached. This also means that the **“trusted third-party”** required in conventional contracts of significant value is not required here. Foul play between the parties involved and oversight will be issues of the past. + +##### Cost effective + +As highlighted in the example, utilizing a smart contract involves minimal costs. Enterprises usually have administrative staff who work exclusively for making that transactions they undertake are legitimate and comply with regulations. If the deal involved multiple parties, duplication of the effort is unavoidable. Smart contracts essentially make the former irrelevant and duplication is eliminated since both the parties can simultaneously have their due diligence done. + +### Applications of Smart Contracts + +Basically, if two or more parties use a common blockchain platform and agree on a set of principles or business logic, they can come together to create a smart contract on the blockchain and it is executed with no human intervention at all. No one can tamper with the conditions set and, any changes, if the original code allows for it, is timestamped and carries the editor’s fingerprint increasing accountability. Imagine a similar situation at a much larger enterprise scale and you understand what smart contracts are capable of and in fact a **Capgemini study** from 2016 found that smart contracts could actually be commercially mainstream **“in the early years of the next decade”** [8]. Commercial applications involve uses in Insurance, Financial Markets, IoT, Loans, Identity Management systems, Escrow Accounts, Employment contracts, and Patent & Royalty contracts among others. Platforms such as Ethereum, a blockchain designed keeping smart contracts in mind, allow for individual private users to utilize smart contracts free of cost as well. + +A more comprehensive overview of the applications of smart contracts on current technological problems will be presented in the next article of the series by exploring the companies that deal with it. + +### So, what are the drawbacks? + +This is not to say that smart contracts come with no concerns regarding their use whatsoever. Such concerns have actually slowed down development in this aspect as well. The tamper-proof nature of everything blockchain essentially makes it next to impossible to modify or add new clauses to existing clauses if the parties involved need to without major overhaul or legal recourse. + +Secondly, even though activity on a public blockchain is open for all to see and observe. The personal identities of the parties involved in a transaction are not always known. This anonymity raises question regarding legal impunity in case either party defaults especially since current laws and lawmakers are not exactly accommodative of modern technology. + +Thirdly, blockchains and smart contracts are still subject to security flaws in many ways because the technology for all the interest in it is still in a very nascent stage of development. This inexperience with the code and platform is what ultimately led to the DAO incident in 2016. + +All of this is keeping aside the significant initial investment that might be needed in case an enterprise or firm needs to adapt a blockchain for its use. The fact that these are initial one-time investments and come with potential savings down the road however is what interests people. + +### Conclusion + +Current legal frameworks don’t really support a full-on smart contract enabled society and won’t in the near future due to obvious reasons. A solution is to opt for **“hybrid” contracts** that combine traditional legal texts and documents with smart contract code running on blockchains designed for the purpose[4]. However, even hybrid contracts remain largely unexplored as innovative legislature is required to bring them into fruition. The applications briefly mentioned here and many more are explored in detail in the [**next post of the series**][6]. + +**References:** + + * **[1] S. C. A. Chamber of Digital Commerce, “Smart contracts – Is the law ready,” no. September, 2018.** + * **[2] [Legal Definition of ius quaesitum tertio][7]. +** + * **[3][N. Szabo, “Nick Szabo — Smart Contracts: Building Blocks for Digital Markets,” 1996.][4]** + * **[4] Cardozo Blockchain Project, “‘Smart Contracts’ & Legal Enforceability,” vol. 2, p. 28, 2018.** + * **[5][The DAO Heist Undone: 97% of ETH Holders Vote for the Hard Fork.][8]** + * **[6] F. Idelberger, G. Governatori, R. Riveret, and G. Sartor, “Evaluation of Logic-Based Smart Contracts for Blockchain Systems,” 2016, pp. 167–183.** + * **[7][Types of Smart Contracts Based on Applications | Market InsightsTM – Everest Group.][9]** + * **[8] B. Cant et al., “Smart Contracts in Financial Services : Getting from Hype to Reality,” Capgemini Consult., pp. 1–24, 2016.** + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ + +作者:[editor][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/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/03/smart-contracts-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/ +[3]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[4]: http://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart_contracts_2.html +[5]: https://etherparty.com/ +[6]: https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/ +[7]: http://www.legal-glossary.org/ +[8]: https://futurism.com/the-dao-heist-undone-97-of-eth-holders-vote-for-the-hard-fork/ +[9]: https://www.everestgrp.com/2016-10-types-smart-contracts-based-applications-market-insights-36573.html/ From f805f926eff070c27ff6f0cd3fb7b7f71422eda9 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:26:47 +0800 Subject: [PATCH 0605/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190527=20How?= =?UTF-8?q?=20To=20Check=20Available=20Security=20Updates=20On=20Red=20Hat?= =?UTF-8?q?=20(RHEL)=20And=20CentOS=20System=3F=20sources/tech/20190527=20?= =?UTF-8?q?How=20To=20Check=20Available=20Security=20Updates=20On=20Red=20?= =?UTF-8?q?Hat=20(RHEL)=20And=20CentOS=20System.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tes On Red Hat (RHEL) And CentOS System.md | 320 ++++++++++++++++++ 1 file changed, 320 insertions(+) create mode 100644 sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md diff --git a/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md b/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md new file mode 100644 index 0000000000..531612777a --- /dev/null +++ b/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md @@ -0,0 +1,320 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Check Available Security Updates On Red Hat (RHEL) And CentOS System?) +[#]: via: (https://www.2daygeek.com/check-list-view-find-available-security-updates-on-redhat-rhel-centos-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Check Available Security Updates On Red Hat (RHEL) And CentOS System? +====== + +As per your organization policy you may need to push only security updates due to varies reasons. + +In most cases, it could be an application compatibility issues. + +How to do that? Is it possible to limit yum to perform only security updates? + +Yes, it’s possible and can be done easily through yum package manager. + +In this article, we are not giving only the required information. + +Instead, we have added lot more commands that help you to gather many information about a given security package. + +This may give you an idea or opportunity to understand and fix the list of vulnerabilities, which you have it. + +If security vulnerabilities are discovered, the affected software must be updated in order to limit any potential security risks on system. + +For RHEL/CentOS 6 systems, run the following **[Yum Command][1]** to install yum security plugin. + +``` +# yum -y install yum-plugin-security +``` + +The plugin is already a part of yum itself so, no need to install this on RHEL 7&8/CentOS 7&8. + +To list all available erratas (it includes Security, Bug Fix and Product Enhancement) without installing them. + +``` +# yum updateinfo list available +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock +RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 +RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 +RHBA-2015:0626 bugfix 389-ds-base-1.3.3.1-15.el7_1.x86_64 +RHSA-2015:0895 Important/Sec. 389-ds-base-1.3.3.1-16.el7_1.x86_64 +RHBA-2015:1554 bugfix 389-ds-base-1.3.3.1-20.el7_1.x86_64 +RHBA-2015:1960 bugfix 389-ds-base-1.3.3.1-23.el7_1.x86_64 +RHBA-2015:2351 bugfix 389-ds-base-1.3.4.0-19.el7.x86_64 +RHBA-2015:2572 bugfix 389-ds-base-1.3.4.0-21.el7_2.x86_64 +RHSA-2016:0204 Important/Sec. 389-ds-base-1.3.4.0-26.el7_2.x86_64 +RHBA-2016:0550 bugfix 389-ds-base-1.3.4.0-29.el7_2.x86_64 +RHBA-2016:1048 bugfix 389-ds-base-1.3.4.0-30.el7_2.x86_64 +RHBA-2016:1298 bugfix 389-ds-base-1.3.4.0-32.el7_2.x86_64 +``` + +To count the number of erratas, run the following command. + +``` +# yum updateinfo list available | wc -l +11269 +``` + +To list all available security updates without installing them. + +It used to display information about both installed and available advisories on your system. + +``` +# yum updateinfo list security all +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock + RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 + RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 + RHSA-2015:0895 Important/Sec. 389-ds-base-1.3.3.1-16.el7_1.x86_64 + RHSA-2016:0204 Important/Sec. 389-ds-base-1.3.4.0-26.el7_2.x86_64 + RHSA-2016:2594 Moderate/Sec. 389-ds-base-1.3.5.10-11.el7.x86_64 + RHSA-2017:0920 Important/Sec. 389-ds-base-1.3.5.10-20.el7_3.x86_64 + RHSA-2017:2569 Moderate/Sec. 389-ds-base-1.3.6.1-19.el7_4.x86_64 + RHSA-2018:0163 Important/Sec. 389-ds-base-1.3.6.1-26.el7_4.x86_64 + RHSA-2018:0414 Important/Sec. 389-ds-base-1.3.6.1-28.el7_4.x86_64 + RHSA-2018:1380 Important/Sec. 389-ds-base-1.3.7.5-21.el7_5.x86_64 + RHSA-2018:2757 Moderate/Sec. 389-ds-base-1.3.7.5-28.el7_5.x86_64 + RHSA-2018:3127 Moderate/Sec. 389-ds-base-1.3.8.4-15.el7.x86_64 + RHSA-2014:1031 Important/Sec. 389-ds-base-libs-1.3.1.6-26.el7_0.x86_64 +``` + +To print all available advisories security packages (It prints all kind of packages like installed and not-installed). + +``` +# yum updateinfo list security all | grep -v "i" + + RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 + RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 + RHSA-2015:0895 Important/Sec. 389-ds-base-1.3.3.1-16.el7_1.x86_64 + RHSA-2016:0204 Important/Sec. 389-ds-base-1.3.4.0-26.el7_2.x86_64 + RHSA-2016:2594 Moderate/Sec. 389-ds-base-1.3.5.10-11.el7.x86_64 + RHSA-2017:0920 Important/Sec. 389-ds-base-1.3.5.10-20.el7_3.x86_64 + RHSA-2017:2569 Moderate/Sec. 389-ds-base-1.3.6.1-19.el7_4.x86_64 + RHSA-2018:0163 Important/Sec. 389-ds-base-1.3.6.1-26.el7_4.x86_64 + RHSA-2018:0414 Important/Sec. 389-ds-base-1.3.6.1-28.el7_4.x86_64 + RHSA-2018:1380 Important/Sec. 389-ds-base-1.3.7.5-21.el7_5.x86_64 + RHSA-2018:2757 Moderate/Sec. 389-ds-base-1.3.7.5-28.el7_5.x86_64 +``` + +To count the number of available security package, run the following command. + +``` +# yum updateinfo list security all | wc -l +3522 +``` + +It’s used to list all of the relevant errata notice information, from the updateinfo.xml data in yum. This includes bugzillas, CVEs, security updates and new. + +``` +# yum updateinfo list security + +or + +# yum updateinfo list sec + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock + +RHSA-2018:3665 Important/Sec. NetworkManager-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-adsl-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-bluetooth-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-config-server-1:1.12.0-8.el7_6.noarch +RHSA-2018:3665 Important/Sec. NetworkManager-glib-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-libnm-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-ppp-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-team-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-tui-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-wifi-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-wwan-1:1.12.0-8.el7_6.x86_64 +``` + +To display all updates that are security relevant, and get a return code on whether there are security updates. + +``` +# yum --security check-update +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +rhel-7-server-rpms | 2.0 kB 00:00:00 +--> policycoreutils-devel-2.2.5-20.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo) +--> smc-raghumalayalam-fonts-6.0-7.el7.noarch from rhel-7-server-rpms excluded (updateinfo) +--> amanda-server-3.3.3-17.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo) +--> 389-ds-base-libs-1.3.4.0-26.el7_2.x86_64 from rhel-7-server-rpms excluded (updateinfo) +--> 1:cups-devel-1.6.3-26.el7.i686 from rhel-7-server-rpms excluded (updateinfo) +--> openwsman-client-2.6.3-3.git4391e5c.el7.i686 from rhel-7-server-rpms excluded (updateinfo) +--> 1:emacs-24.3-18.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo) +--> augeas-libs-1.4.0-2.el7_4.2.i686 from rhel-7-server-rpms excluded (updateinfo) +--> samba-winbind-modules-4.2.3-10.el7.i686 from rhel-7-server-rpms excluded (updateinfo) +--> tftp-5.2-11.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo) +. +. +35 package(s) needed for security, out of 115 available +NetworkManager.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-adsl.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-bluetooth.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-config-server.noarch 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-glib.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-libnm.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-ppp.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +``` + +To list all available security updates with verbose descriptions of the issues. + +``` +# yum info-sec +. +. +=============================================================================== + tzdata bug fix and enhancement update +=============================================================================== + Update ID : RHBA-2019:0689 + Release : 0 + Type : bugfix + Status : final + Issued : 2019-03-28 19:27:44 UTC +Description : The tzdata packages contain data files with rules for various + : time zones. + : + : The tzdata packages have been updated to version + : 2019a, which addresses recent time zone changes. + : Notably: + : + : * The Asia/Hebron and Asia/Gaza zones will start + : DST on 2019-03-30, rather than 2019-03-23 as + : previously predicted. + : * Metlakatla rejoined Alaska time on 2019-01-20, + : ending its observances of Pacific standard time. + : + : (BZ#1692616, BZ#1692615, BZ#1692816) + : + : Users of tzdata are advised to upgrade to these + : updated packages. + Severity : None +``` + +If you would like to know more information about the given advisory, run the following command. + +``` +# yum updateinfo RHSA-2019:0163 + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +rhel-7-server-rpms | 2.0 kB 00:00:00 +=============================================================================== + Important: kernel security, bug fix, and enhancement update +=============================================================================== + Update ID : RHSA-2019:0163 + Release : 0 + Type : security + Status : final + Issued : 2019-01-29 15:21:23 UTC + Updated : 2019-01-29 15:23:47 UTC Bugs : 1641548 - CVE-2018-18397 kernel: userfaultfd bypasses tmpfs file permissions + : 1641878 - CVE-2018-18559 kernel: Use-after-free due to race condition in AF_PACKET implementation + CVEs : CVE-2018-18397 + : CVE-2018-18559 +Description : The kernel packages contain the Linux kernel, the core of any + : Linux operating system. + : + : Security Fix(es): + : + : * kernel: Use-after-free due to race condition in + : AF_PACKET implementation (CVE-2018-18559) + : + : * kernel: userfaultfd bypasses tmpfs file + : permissions (CVE-2018-18397) + : + : For more details about the security issue(s), + : including the impact, a CVSS score, and other + : related information, refer to the CVE page(s) + : listed in the References section. + : + : Bug Fix(es): + : + : These updated kernel packages include also + : numerous bug fixes and enhancements. Space + : precludes documenting all of the bug fixes in this + : advisory. See the descriptions in the related + : Knowledge Article: + : https://access.redhat.com/articles/3827321 + Severity : Important +updateinfo info done +``` + +Similarly, you can view CVEs which affect the system using the following command. + +``` +# yum updateinfo list cves + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock +CVE-2018-15688 Important/Sec. NetworkManager-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-adsl-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-bluetooth-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-config-server-1:1.12.0-8.el7_6.noarch +CVE-2018-15688 Important/Sec. NetworkManager-glib-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-libnm-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-ppp-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-team-1:1.12.0-8.el7_6.x86_64 +``` + +Similarly, you can view the packages which is belongs to bugfixs by running the following command. + +``` +# yum updateinfo list bugfix | less + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock +RHBA-2018:3349 bugfix NetworkManager-1:1.12.0-7.el7_6.x86_64 +RHBA-2019:0519 bugfix NetworkManager-1:1.12.0-10.el7_6.x86_64 +RHBA-2018:3349 bugfix NetworkManager-adsl-1:1.12.0-7.el7_6.x86_64 +RHBA-2019:0519 bugfix NetworkManager-adsl-1:1.12.0-10.el7_6.x86_64 +RHBA-2018:3349 bugfix NetworkManager-bluetooth-1:1.12.0-7.el7_6.x86_64 +RHBA-2019:0519 bugfix NetworkManager-bluetooth-1:1.12.0-10.el7_6.x86_64 +RHBA-2018:3349 bugfix NetworkManager-config-server-1:1.12.0-7.el7_6.noarch +RHBA-2019:0519 bugfix NetworkManager-config-server-1:1.12.0-10.el7_6.noarch +``` + +To get a summary of advisories, which needs to be installed on your system. + +``` +# yum updateinfo summary +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +rhel-7-server-rpms | 2.0 kB 00:00:00 +Updates Information Summary: updates + 13 Security notice(s) + 9 Important Security notice(s) + 3 Moderate Security notice(s) + 1 Low Security notice(s) + 35 Bugfix notice(s) + 1 Enhancement notice(s) +updateinfo summary done +``` + +To print only specific pattern of security advisories, run the following command. Similarly, you can check Important or Moderate security advisories info alone. + +``` +# yum updateinfo list sec | grep -i "Low" + +RHSA-2019:0201 Low/Sec. libgudev1-219-62.el7_6.3.x86_64 +RHSA-2019:0201 Low/Sec. systemd-219-62.el7_6.3.x86_64 +RHSA-2019:0201 Low/Sec. systemd-libs-219-62.el7_6.3.x86_64 +RHSA-2019:0201 Low/Sec. systemd-sysv-219-62.el7_6.3.x86_64 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-list-view-find-available-security-updates-on-redhat-rhel-centos-system/ + +作者:[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/yum-command-examples-manage-packages-rhel-centos-systems/ From bcc7c5e38daa3e319c0716c96c789b05f679b0cb Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:26:58 +0800 Subject: [PATCH 0606/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190527=20How?= =?UTF-8?q?=20To=20Enable=20Or=20Disable=20SSH=20Access=20For=20A=20Partic?= =?UTF-8?q?ular=20User=20Or=20Group=20In=20Linux=3F=20sources/tech/2019052?= =?UTF-8?q?7=20How=20To=20Enable=20Or=20Disable=20SSH=20Access=20For=20A?= =?UTF-8?q?=20Particular=20User=20Or=20Group=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...For A Particular User Or Group In Linux.md | 300 ++++++++++++++++++ 1 file changed, 300 insertions(+) create mode 100644 sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md diff --git a/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md b/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md new file mode 100644 index 0000000000..a717d05ed8 --- /dev/null +++ b/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md @@ -0,0 +1,300 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Enable Or Disable SSH Access For A Particular User Or Group In Linux?) +[#]: via: (https://www.2daygeek.com/allow-deny-enable-disable-ssh-access-user-group-in-linux/) +[#]: author: (2daygeek http://www.2daygeek.com/author/2daygeek/) + +How To Enable Or Disable SSH Access For A Particular User Or Group In Linux? +====== + +As per your organization standard policy, you may need to allow only the list of users that are allowed to access the Linux system. + +Or you may need to allow only few groups, which are allowed to access the Linux system. + +How to achieve this? What is the best way? How to achieve this in a simple way? + +Yes, there are many ways are available to perform this. + +However, we need to go with simple and easy method. + +If so, it can be done by making the necessary changes in `/etc/ssh/sshd_config` file. + +In this article we will show you, how to perform this in details. + +Why are we doing this? due to security reason. Navigate to the following URL to know more about **[openSSH][1]** usage. + +### What Is SSH? + +openssh stands for OpenBSD Secure Shell. Secure Shell (ssh) is a free open source networking tool which allow us to access remote system over an unsecured network using Secure Shell (SSH) protocol. + +It’s a client-server architecture. It handles user authentication, encryption, transferring files between computers and tunneling. + +These can be accomplished via traditional tools such as telnet or rcp, these are insecure and use transfer password in cleartext format while performing any action. + +### How To Allow A User To Access SSH In Linux? + +We can allow/enable the ssh access for a particular user or list of the users using the following method. + +If you would like to allow more than one user then you have to add the users with space in the same line. + +To do so, just append the following value into `/etc/ssh/sshd_config` file. In this example, we are going to allow ssh access for `user3`. + +``` +# echo "AllowUsers user3" >> /etc/ssh/sshd_config +``` + +You can double check this by running the following command. + +``` +# cat /etc/ssh/sshd_config | grep -i allowusers +AllowUsers user3 +``` + +That’s it. Just bounce the ssh service and see the magic. + +``` +# systemctl restart sshd + +# service restart sshd +``` + +Simple open a new terminal or session and try to access the Linux system with different user. Yes, `user2` isn’t allowed for SSH login and will be getting an error message as shown below. + +``` +# ssh [email protected] +[email protected]'s password: +Permission denied, please try again. +``` + +Output: + +``` +Mar 29 02:00:35 CentOS7 sshd[4900]: User user2 from 192.168.1.6 not allowed because not listed in AllowUsers +Mar 29 02:00:35 CentOS7 sshd[4900]: input_userauth_request: invalid user user2 [preauth] +Mar 29 02:00:40 CentOS7 unix_chkpwd[4902]: password check failed for user (user2) +Mar 29 02:00:40 CentOS7 sshd[4900]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user2 +Mar 29 02:00:43 CentOS7 sshd[4900]: Failed password for invalid user user2 from 192.168.1.6 port 42568 ssh2 +``` + +At the same time `user3` is allowed to login into the system because it’s in allowed users list. + +``` +# ssh [email protected] +[email protected]'s password: +[[email protected] ~]$ +``` + +Output: + +``` +Mar 29 02:01:13 CentOS7 sshd[4939]: Accepted password for user3 from 192.168.1.6 port 42590 ssh2 +Mar 29 02:01:13 CentOS7 sshd[4939]: pam_unix(sshd:session): session opened for user user3 by (uid=0) +``` + +### How To Deny Users To Access SSH In Linux? + +We can deny/disable the ssh access for a particular user or list of the users using the following method. + +If you would like to disable more than one user then you have to add the users with space in the same line. + +To do so, just append the following value into `/etc/ssh/sshd_config` file. In this example, we are going to disable ssh access for `user1`. + +``` +# echo "DenyUsers user1" >> /etc/ssh/sshd_config +``` + +You can double check this by running the following command. + +``` +# cat /etc/ssh/sshd_config | grep -i denyusers +DenyUsers user1 +``` + +That’s it. Just bounce the ssh service and see the magic. + +``` +# systemctl restart sshd + +# service restart sshd +``` + +Simple open a new terminal or session and try to access the Linux system with Deny user. Yes, `user1` is in denyusers list. So, you will be getting an error message as shown below when you are try to login. + +``` +# ssh [email protected] +[email protected]'s password: +Permission denied, please try again. +``` + +Output: + +``` +Mar 29 01:53:42 CentOS7 sshd[4753]: User user1 from 192.168.1.6 not allowed because listed in DenyUsers +Mar 29 01:53:42 CentOS7 sshd[4753]: input_userauth_request: invalid user user1 [preauth] +Mar 29 01:53:46 CentOS7 unix_chkpwd[4755]: password check failed for user (user1) +Mar 29 01:53:46 CentOS7 sshd[4753]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user1 +Mar 29 01:53:48 CentOS7 sshd[4753]: Failed password for invalid user user1 from 192.168.1.6 port 42522 ssh2 +``` + +### How To Allow Groups To Access SSH In Linux? + +We can allow/enable the ssh access for a particular group or groups using the following method. + +If you would like to allow more than one group then you have to add the groups with space in the same line. + +To do so, just append the following value into `/etc/ssh/sshd_config` file. In this example, we are going to disable ssh access for `2g-admin` group. + +``` +# echo "AllowGroups 2g-admin" >> /etc/ssh/sshd_config +``` + +You can double check this by running the following command. + +``` +# cat /etc/ssh/sshd_config | grep -i allowgroups +AllowGroups 2g-admin +``` + +Run the following command to know the list of the users are belongs to this group. + +``` +# getent group 2g-admin +2g-admin:x:1005:user1,user2,user3 +``` + +That’s it. Just bounce the ssh service and see the magic. + +``` +# systemctl restart sshd + +# service restart sshd +``` + +Yes, `user3` is allowed to login into the system because user3 is belongs to `2g-admin` group. + +``` +# ssh [email protected] +[email protected]'s password: +[[email protected] ~]$ +``` + +Output: + +``` +Mar 29 02:10:21 CentOS7 sshd[5165]: Accepted password for user1 from 192.168.1.6 port 42640 ssh2 +Mar 29 02:10:22 CentOS7 sshd[5165]: pam_unix(sshd:session): session opened for user user1 by (uid=0) +``` + +Yes, `user2` is allowed to login into the system because user2 is belongs to `2g-admin` group. + +``` +# ssh [email protected] +[email protected]'s password: +[[email protected] ~]$ +``` + +Output: + +``` +Mar 29 02:10:38 CentOS7 sshd[5225]: Accepted password for user2 from 192.168.1.6 port 42642 ssh2 +Mar 29 02:10:38 CentOS7 sshd[5225]: pam_unix(sshd:session): session opened for user user2 by (uid=0) +``` + +When you are try to login into the system with other users which are not part of this group then you will be getting an error message as shown below. + +``` +# ssh [email protected] +[email protected]'s password: +Permission denied, please try again. +``` + +Output: + +``` +Mar 29 02:12:36 CentOS7 sshd[5306]: User ladmin from 192.168.1.6 not allowed because none of user's groups are listed in AllowGroups +Mar 29 02:12:36 CentOS7 sshd[5306]: input_userauth_request: invalid user ladmin [preauth] +Mar 29 02:12:56 CentOS7 unix_chkpwd[5310]: password check failed for user (ladmin) +Mar 29 02:12:56 CentOS7 sshd[5306]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=ladmin +Mar 29 02:12:58 CentOS7 sshd[5306]: Failed password for invalid user ladmin from 192.168.1.6 port 42674 ssh2 +``` + +### How To Deny Group To Access SSH In Linux? + +We can deny/disable the ssh access for a particular group or groups using the following method. + +If you would like to disable more than one group then you need to add the group with space in the same line. + +To do so, just append the following value into `/etc/ssh/sshd_config` file. + +``` +# echo "DenyGroups 2g-admin" >> /etc/ssh/sshd_config +``` + +You can double check this by running the following command. + +``` +# # cat /etc/ssh/sshd_config | grep -i denygroups +DenyGroups 2g-admin + +# getent group 2g-admin +2g-admin:x:1005:user1,user2,user3 +``` + +That’s it. Just bounce the ssh service and see the magic. + +``` +# systemctl restart sshd + +# service restart sshd +``` + +Yes `user3` isn’t allowed to login into the system because it’s not part of `2g-admin` group. It’s in Denygroups. + +``` +# ssh [email protected] +[email protected]'s password: +Permission denied, please try again. +``` + +Output: + +``` +Mar 29 02:17:32 CentOS7 sshd[5400]: User user1 from 192.168.1.6 not allowed because a group is listed in DenyGroups +Mar 29 02:17:32 CentOS7 sshd[5400]: input_userauth_request: invalid user user1 [preauth] +Mar 29 02:17:38 CentOS7 unix_chkpwd[5402]: password check failed for user (user1) +Mar 29 02:17:38 CentOS7 sshd[5400]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user1 +Mar 29 02:17:41 CentOS7 sshd[5400]: Failed password for invalid user user1 from 192.168.1.6 port 42710 ssh2 +``` + +Anyone can login into the system except `2g-admin` group. Hence, `ladmin` user is allowed to login into the system. + +``` +# ssh [email protected] +[email protected]'s password: +[[email protected] ~]$ +``` + +Output: + +``` +Mar 29 02:19:13 CentOS7 sshd[5432]: Accepted password for ladmin from 192.168.1.6 port 42716 ssh2 +Mar 29 02:19:13 CentOS7 sshd[5432]: pam_unix(sshd:session): session opened for user ladmin by (uid=0) +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/allow-deny-enable-disable-ssh-access-user-group-in-linux/ + +作者:[2daygeek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.2daygeek.com/author/2daygeek/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/ssh-tutorials/ From af4c94ea6d315cae7e7ea45f0ac261dbdca3966c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:27:12 +0800 Subject: [PATCH 0607/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190527=205=20?= =?UTF-8?q?GNOME=20keyboard=20shortcuts=20to=20be=20more=20productive=20so?= =?UTF-8?q?urces/tech/20190527=205=20GNOME=20keyboard=20shortcuts=20to=20b?= =?UTF-8?q?e=20more=20productive.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eyboard shortcuts to be more productive.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md diff --git a/sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md b/sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md new file mode 100644 index 0000000000..989d69e524 --- /dev/null +++ b/sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 GNOME keyboard shortcuts to be more productive) +[#]: via: (https://fedoramagazine.org/5-gnome-keyboard-shortcuts-to-be-more-productive/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) + +5 GNOME keyboard shortcuts to be more productive +====== + +![][1] + +For some people, using GNOME Shell as a traditional desktop manager may be frustrating since it often requires more action of the mouse. In fact, GNOME Shell is also a [desktop manager][2] designed for and meant to be driven by the keyboard. Learn how to be more efficient with GNOME Shell with these 5 ways to use the keyboard instead of the mouse. + +### GNOME activities overview + +The activities overview can be easily opened using the **Super** key from the keyboard. (The **Super** key usually has a logo on it.) This is really useful when it comes to start an application. For example, it’s easy to start the Firefox web browser with the following key sequence **Super + f i r + Enter.** + +![][3] + +### Message tray + +In GNOME, notifications are available in the message tray. This is also the place where the calendar and world clocks are available. To open the message tray using the keyboard use the **Super+m** shortcut. To close the message tray simply use the same shortcut again. + + * ![][4] + + + +### Managing workspaces in GNOME + +Gnome Shell uses dynamic workspaces, meaning it creates additional workspaces as they are needed. A great way to be more productive using Gnome is to use one workspace per application or per dedicated activity, and then use the keyboard to navigate between these workspaces. + +Let’s look at a practical example. To open a Terminal in the current workspace press the following keys: **Super + t e r + Enter.** Then, to open a new workspace press **Super + PgDn**. Open Firefox ( **Super + f i r + Enter)**. To come back to the terminal, use **Super + PgUp**. + +![][5] + +### Managing an application window + +Using the keyboard it is also easy to manage the size of an application window. Minimizing, maximizing and moving the application to the left or the right of the screen can be done with only a few key strokes. Use **Super+**🠝 to maximize, **Super+**🠟 to minimize, **Super+**🠜 and **Super+**🠞 to move the window left and right. + +![][6] + +### Multiple windows from the same application + +Using the activities overview to start an application is very efficient. But trying to open a new window from an application already running only results in focusing on the open window. To create a new window, instead of simply hitting **Enter** to start the application, use **Ctrl+Enter**. + +So for example, to start a second instance of the terminal using the application overview, **Super + t e r + (Ctrl+Enter)**. + +![][7] + +Then you can use **Super+`** to switch between windows of the same application. + +![][8] + +As shown, GNOME Shell is a really powerful desktop environment when controlled from the keyboard. Learning to use these shortcuts and train your muscle memory to not use the mouse will give you a better user experience, and make you more productive when using GNOME. For other useful shortcuts, check out [this page on the GNOME wiki][9]. + +* * * + +_Photo by _[ _1AmFcS_][10]_ on _[_Unsplash_][11]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/5-gnome-keyboard-shortcuts-to-be-more-productive/ + +作者:[Clément Verna][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/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/5-gnome-keycombos-816x345.jpg +[2]: https://fedoramagazine.org/gnome-3-32-released-coming-to-fedora-30/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-10-50.gif +[4]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-11-01.gif +[5]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-12-57.gif +[6]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-06.gif +[7]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-19.gif +[8]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-22.gif +[9]: https://wiki.gnome.org/Design/OS/KeyboardShortcuts +[10]: https://unsplash.com/photos/MuTWth_RnEs?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[11]: https://unsplash.com/search/photos/keyboard?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From dd4f9ffd9016f19fcdcaa727bf2dd11a834dba59 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:27:21 +0800 Subject: [PATCH 0608/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190522=20Secu?= =?UTF-8?q?ring=20telnet=20connections=20with=20stunnel=20sources/tech/201?= =?UTF-8?q?90522=20Securing=20telnet=20connections=20with=20stunnel.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ecuring telnet connections with stunnel.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 sources/tech/20190522 Securing telnet connections with stunnel.md diff --git a/sources/tech/20190522 Securing telnet connections with stunnel.md b/sources/tech/20190522 Securing telnet connections with stunnel.md new file mode 100644 index 0000000000..d69b6237cd --- /dev/null +++ b/sources/tech/20190522 Securing telnet connections with stunnel.md @@ -0,0 +1,202 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Securing telnet connections with stunnel) +[#]: via: (https://fedoramagazine.org/securing-telnet-connections-with-stunnel/) +[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) + +Securing telnet connections with stunnel +====== + +![][1] + +Telnet is a client-server protocol that connects to a remote server through TCP over port 23. Telnet does not encrypt data and is considered insecure and passwords can be easily sniffed because data is sent in the clear. However there are still legacy systems that need to use it. This is where **stunnel** comes to the rescue. + +Stunnel is designed to add SSL encryption to programs that have insecure connection protocols. This article shows you how to use it, with telnet as an example. + +### Server Installation + +Install stunnel along with the telnet server and client [using sudo][2]: + +``` +sudo dnf -y install stunnel telnet-server telnet +``` + +Add a firewall rule, entering your password when prompted: + +``` +firewall-cmd --add-service=telnet --perm +firewall-cmd --reload +``` + +Next, generate an RSA private key and an SSL certificate: + +``` +openssl genrsa 2048 > stunnel.key +openssl req -new -key stunnel.key -x509 -days 90 -out stunnel.crt +``` + +You will be prompted for the following information one line at a time. When asked for _Common Name_ you must enter the correct host name or IP address, but everything else you can skip through by hitting the **Enter** key. + +``` +You are about to be asked to enter information that will be +incorporated into your certificate request. +What you are about to enter is what is called a Distinguished Name or a DN. +There are quite a few fields but you can leave some blank +For some fields there will be a default value, +If you enter '.', the field will be left blank. +----- +Country Name (2 letter code) [XX]: +State or Province Name (full name) []: +Locality Name (eg, city) [Default City]: +Organization Name (eg, company) [Default Company Ltd]: +Organizational Unit Name (eg, section) []: +Common Name (eg, your name or your server's hostname) []: +Email Address [] +``` + +Merge the RSA key and SSL certificate into a single _.pem_ file, and copy that to the SSL certificate directory: + +``` +cat stunnel.crt stunnel.key > stunnel.pem +sudo cp stunnel.pem /etc/pki/tls/certs/ +``` + +Now it’s time to define the service and the ports to use for encrypting your connection. Choose a port that is not already in use. This example uses port 450 for tunneling telnet. Edit or create the _/etc/stunnel/telnet.conf_ file: + +``` +cert = /etc/pki/tls/certs/stunnel.pem +sslVersion = TLSv1 +chroot = /var/run/stunnel +setuid = nobody +setgid = nobody +pid = /stunnel.pid +socket = l:TCP_NODELAY=1 +socket = r:TCP_NODELAY=1 +[telnet] +accept = 450 +connect = 23 +``` + +The **accept** option is the port the server will listen to for incoming telnet requests. The **connect** option is the internal port the telnet server listens to. + +Next, make a copy of the systemd unit file that allows you to override the packaged version: + +``` +sudo cp /usr/lib/systemd/system/stunnel.service /etc/systemd/system +``` + +Edit the _/etc/systemd/system/stunnel.service_ file to add two lines. These lines create a chroot jail for the service when it starts. + +``` +[Unit] +Description=TLS tunnel for network daemons +After=syslog.target network.target + +[Service] +ExecStart=/usr/bin/stunnel +Type=forking +PrivateTmp=true +ExecStartPre=-/usr/bin/mkdir /var/run/stunnel +ExecStartPre=/usr/bin/chown -R nobody:nobody /var/run/stunnel + +[Install] +WantedBy=multi-user.target +``` + +Next, configure SELinux to listen to telnet on the new port you just specified: + +``` +sudo semanage port -a -t telnetd_port_t -p tcp 450 +``` + +Finally, add a new firewall rule: + +``` +firewall-cmd --add-port=450/tcp --perm +firewall-cmd --reload +``` + +Now you can enable and start telnet and stunnel. + +``` +systemctl enable telnet.socket stunnel@telnet.service --now +``` + +A note on the _systemctl_ command is in order. Systemd and the stunnel package provide an additional [template unit file][3] by default. The template lets you drop multiple configuration files for stunnel into _/etc/stunnel_ , and use the filename to start the service. For instance, if you had a _foobar.conf_ file, you could start that instance of stunnel with _systemctl start[stunnel@foobar.service][4]_ , without having to write any unit files yourself. + +If you want, you can set this stunnel template service to start on boot: + +``` +systemctl enable stunnel@telnet.service +``` + +### Client Installation + +This part of the article assumes you are logged in as a normal user ([with sudo privileges][2]) on the client system. Install stunnel and the telnet client: + +``` +dnf -y install stunnel telnet +``` + +Copy the _stunnel.pem_ file from the remote server to your client _/etc/pki/tls/certs_ directory. In this example, the IP address of the remote telnet server is 192.168.1.143. + +``` +sudo scp myuser@192.168.1.143:/etc/pki/tls/certs/stunnel.pem +/etc/pki/tls/certs/ +``` + +Create the _/etc/stunnel/telnet.conf_ file: + +``` +cert = /etc/pki/tls/certs/stunnel.pem +client=yes +[telnet] +accept=450 +connect=192.168.1.143:450 +``` + +The **accept** option is the port that will be used for telnet sessions. The **connect** option is the IP address of your remote server and the port it’s listening on. + +Next, enable and start stunnel: + +``` +systemctl enable stunnel@telnet.service --now +``` + +Test your connection. Since you have a connection established, you will telnet to _localhost_ instead of the hostname or IP address of the remote telnet server: + +``` +[user@client ~]$ telnet localhost 450 +Trying ::1... +telnet: connect to address ::1: Connection refused +Trying 127.0.0.1... +Connected to localhost. +Escape character is '^]'. + +Kernel 5.0.9-301.fc30.x86_64 on an x86_64 (0) +server login: myuser +Password: XXXXXXX +Last login: Sun May 5 14:28:22 from localhost +[myuser@server ~]$ +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/securing-telnet-connections-with-stunnel/ + +作者:[Curt Warfield][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/rcurtiswarfield/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/stunnel-816x345.jpg +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://fedoramagazine.org/systemd-template-unit-files/ +[4]: mailto:stunnel@foobar.service From c98bc1a6e68ec7ac7c40f855ed7bfe22dc7ef1bf Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:27:47 +0800 Subject: [PATCH 0609/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190525=204=20?= =?UTF-8?q?Ways=20to=20Run=20Linux=20Commands=20in=20Windows=20sources/tec?= =?UTF-8?q?h/20190525=204=20Ways=20to=20Run=20Linux=20Commands=20in=20Wind?= =?UTF-8?q?ows.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 Ways to Run Linux Commands in Windows.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md diff --git a/sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md b/sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md new file mode 100644 index 0000000000..2de100ce08 --- /dev/null +++ b/sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 Ways to Run Linux Commands in Windows) +[#]: via: (https://itsfoss.com/run-linux-commands-in-windows/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +4 Ways to Run Linux Commands in Windows +====== + +_**Brief: Want to use Linux commands but don’t want to leave Windows? Here are several ways to run Linux bash commands in Windows.**_ + +If you are learning Shell scripting probably as a part of your course curriculum, you need to use Linux commands to practice the commands and scripting. + +Your school lab might have Linux installed but personally you don’t have a [Linux laptop][1] but the regular Windows computer like everyone else. Your homework needs to run Linux commands and you wonder how to run Bash commands and scripts on Windows. + +You can [install Linux alongside Windows in dual boot mode][2]. This method allows you to choose either Linux or Windows when you start your computer. But taking all the trouble to mess with partitions for the sole purpose of running Linux command may not be for everyone. + +You can also [use Linux terminals online][3] but your work won’t be saved here. + +The good news is that there are several ways you can run Linux commands inside Windows, like any regular application. Isn’t it cool? + +### Using Linux commands inside Windows + +![][4] + +As an ardent Linux user and promoter, I would like to see more and more people using ‘real’ Linux but I understand that at times, that’s not the priority. If you are just looking to practice Linux to pass your exams, you can use one of these methods for running Bash commands on Windows. + +#### 1\. Use Linux Bash Shell on Windows 10 + +Did you know that you can run a Linux distribution inside Windows 10? The [Windows Subsystem for Linux (WSL)][5] allows you to run Linux inside Windows. The upcoming version of WSL will be using the real Linux kernel inside Windows. + +This WSL, also called Bash on Windows, gives you a Linux distribution in command line mode running as a regular Windows application. Don’t be scared with the command line mode because your purpose is to run Linux commands. That’s all you need. + +![Ubuntu Linux inside Windows][6] + +You can find some popular Linux distributions like Ubuntu, Kali Linux, openSUSE etc in Windows Store. You just have to download and install it like any other Windows application. Once installed, you can run all the Linux commands you want. + +[][7] + +Suggested read 6 Non-Ubuntu Linux Distributions For Beginners + +![Linux distributions in Windows 10 Store][8] + +Please refer to this tutorial about [installing Linux bash shell on Windows][9]. + +#### 2\. Use Git Bash to run Bash commands on Windows + +You probably know what [Git][10] is. It’s a version control system developed by [Linux creator Linus Torvalds][11]. + +[Git for Windows][12] is a set of tools that allows you to use Git in both command line and graphical interfaces. One of the tools included in Git for Windows is Git Bash. + +Git Bash application provides and emulation layer for Git command line. Apart from Git commands, Git Bash also supports many Bash utilities such as ssh, scp, cat, find etc. + +![Git Bash][13] + +In other words, you can run many common Linux/Bash commands using the Git Bash application. + +You can install Git Bash in Windows by downloading and installing the Git for Windows tool for free from its website. + +[Download Git for Windows][12] + +#### 3\. Using Linux commands in Windows with Cygwin + +If you want to run Linux commands in Windows, Cygwin is a recommended tool. Cygwin was created in 1995 to provide a POSIX-compatible environment that runs natively on Windows. Cygwin is a free and open source software maintained by Red Hat employees and many other volunteers. + +For two decades, Windows users use Cygwin for running and practicing Linux/Bash commands. Even I used Cygwin to learn Linux commands more than a decade ago. + +![Cygwin | Image Credit][14] + +You can download Cygwin from its official website below. I also advise you to refer to this [Cygwin cheat sheet][15] to get started with it. + +[Download Cygwin][16] + +#### 4\. Use Linux in virtual machine + +Another way is to use a virtualization software and install Linux in it. This way, you install a Linux distribution (with graphical interface) inside Windows and run it like a regular Windows application. + +This method requires that your system has a good amount of RAM, at least 4 GB but better if you have over 8 GB of RAM. The good thing here is that you get the real feel of using a desktop Linux. If you like the interface, you may later decide to [switch to Linux][17] completely. + +![Ubuntu Running in Virtual Machine Inside Windows][18] + +There are two popular tools for creating virtual machines on Windows, Oracle VirtualBox and VMware Workstation Player. You can use either of the two. Personally, I prefer VirtualBox. + +[][19] + +Suggested read 9 Simple Ways To Free Up Space On Ubuntu and Linux Mint + +You can follow [this tutorial to learn how to install Linux in VirtualBox][20]. + +**Conclusion** + +The best way to run Linux commands is to use Linux. When installing Linux is not an option, these tools allow you to run Linux commands on Windows. Give them a try and see which method is best suited for you. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/run-linux-commands-in-windows/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/get-linux-laptops/ +[2]: https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/ +[3]: https://itsfoss.com/online-linux-terminals/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/run-linux-commands-in-windows.png?resize=800%2C450&ssl=1 +[5]: https://itsfoss.com/bash-on-windows/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/08/install-ubuntu-windows-10-linux-subsystem-10.jpeg?resize=800%2C268&ssl=1 +[7]: https://itsfoss.com/non-ubuntu-beginner-linux/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/08/install-ubuntu-windows-10-linux-subsystem-4.jpeg?resize=800%2C632&ssl=1 +[9]: https://itsfoss.com/install-bash-on-windows/ +[10]: https://itsfoss.com/basic-git-commands-cheat-sheet/ +[11]: https://itsfoss.com/linus-torvalds-facts/ +[12]: https://gitforwindows.org/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/git-bash.png?ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/cygwin-shell.jpg?ssl=1 +[15]: http://www.voxforge.org/home/docs/cygwin-cheat-sheet +[16]: https://www.cygwin.com/ +[17]: https://itsfoss.com/reasons-switch-linux-windows-xp/ +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/ubuntu-running-in-virtual-machine-inside-windows.jpeg?resize=800%2C450&ssl=1 +[19]: https://itsfoss.com/free-up-space-ubuntu-linux/ +[20]: https://itsfoss.com/install-linux-in-virtualbox/ From d49ae38141715161fc6bc1bcacba71f1b785bbfb Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:28:16 +0800 Subject: [PATCH 0610/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190522=20Damn?= =?UTF-8?q?!=20Antergos=20Linux=20has=20been=20Discontinued=20sources/tech?= =?UTF-8?q?/20190522=20Damn-=20Antergos=20Linux=20has=20been=20Discontinue?= =?UTF-8?q?d.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n- Antergos Linux has been Discontinued.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20190522 Damn- Antergos Linux has been Discontinued.md diff --git a/sources/tech/20190522 Damn- Antergos Linux has been Discontinued.md b/sources/tech/20190522 Damn- Antergos Linux has been Discontinued.md new file mode 100644 index 0000000000..38c11508bf --- /dev/null +++ b/sources/tech/20190522 Damn- Antergos Linux has been Discontinued.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Damn! Antergos Linux has been Discontinued) +[#]: via: (https://itsfoss.com/antergos-linux-discontinued/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Damn! Antergos Linux has been Discontinued +====== + +_**Beginner-friendly Arch Linux based distribution Antergos has announced that the project is being discontinued.**_ + +Arch Linux has always been considered a no-go zone for the beginners. Antergos challenged this status quo and made Arch Linux accessible to everyone by providing easier installation method. People who wouldn’t dare [installing Arch Linux][1], opted for Antergos. + +![Antergos provided easy access to Arch with its easy to use GUI tools][2] + +The project started in 2012-13 and started gaining popularity around 2014. I used Antergos, liked it and covered it here on It’s FOSS and perhaps (slightly) contributed to its popularity. In last five years, Antergos was downloaded close to a million times. + +But for past year or so, I felt that this project was stagnating. Antergos hardly made any news. Neither the forum nor the social media handles were active. The community around Antergos grew thinner though a few dedicated users still remain. + +### The end of Antergos Linux project + +![][3] + +On May 21, 2019, Antergos [announced][4] its discontinuation. Lack of free time cited as the main reason behind this decision. + +> Today, we are announcing the end of this project. As many of you probably noticed over the past several months, we no longer have enough free time to properly maintain Antergos. We came to this decision because we believe that continuing to neglect the project would be a huge disservice to the community. +> +> Antergos Team + +Antergos developers also mentioned that since the project’s code still works, it’s an opportunity for interested developers to take what they find useful and start their own projects. + +#### What happens to Existing Antergos users? + +If you are an Antergos user, you don’t have to worry a lot. It’s not that your system will be unusable from today. Your system will continue to get updates directly from Arch Linux. + +Antergos team plans to release an update to remove the Antergos repositories from your system along with any Antergos-specific packages that no longer serve a purpose as the project is ending. After that any packages installed from the Antergos repo that are in the AUR will begin to receive updates from [AUR][5]. + +[][6] + +Suggested read Peppermint 8 Released. Download Now! + +The Antergos forum and wiki will be functional but only for some time. + +If you think using an ‘unmaintained’ project is not a good idea, you should switch your distribution. The most appropriate choice would be [Manjaro Linux][7]. + +Manjaro Linux started around the same time as Antergos. Both Antergos and Manjaro were sort of competitors as both of them tried to make Arch Linux accessible for everyone. + +Manjaro gained a huge userbase in the last few years and its community is thriving. If you want to remain in Arch domain but don’t want to install Arch Linux itself, Manjaro is the best choice for you. + +Just note that Manjaro Linux doesn’t provide all the updates immediately as Arch or Antergos. It is a rolling release but with stability in mind. So the updates are tested first. + +#### Inevitable fate for smaller distributions? + +_Here’s my opinion on the discontinuation on Antergos and other similar open source projects._ + +Antergos was a niche distribution. It had a smaller but dedicated userbase. The developers cited lack of free time as the main reason for their decision. However, I believe that lack of motivation plays a bigger role in such cases. + +What motivates the people behind a project? They start it mostly as a side project and if the project is good, they start gaining users. This growth of userbase drives their motivation to work on the project. + +If the userbase starts declining or gets stagnated, the motivation takes a hit. + +If the userbase keeps on growing, the motivation increases but only to a certain point. More users require more effort in various tasks around the project. Keeping the wiki and forum along with social media itself is a challenging part, leave aside the actual code development. The situation becomes overwhelming. + +When a project grows in considerable size, project owners have two choices. First choice is to form a community of volunteers and start delegating tasks that could be delegated. Having volunteers dedicated to project is not easy but it can surely be achieved as Debian and Manjaro have done it already. + +[][8] + +Suggested read Lightweight Distribution Linux Lite 4.0 Released With Brand New Look + +Second choice is to create some revenue generation channel around the project. The additional revenue may ‘justify’ those extra hours and in some cases, it could drive the developer to work full time on the project. [elementary OS][9] is trying to achieve something similar by developing an ecosystem of ‘payable apps’ in their software center. + +You may argue that money should not be a factor in Free and Open Source Software culture but the unfortunate truth is that money is always a factor, in every aspect of our life. I am not saying that a project should be purely driven by money but a project must be sustainable in every aspect. + +We have see how other smaller but moderately popular Linux distributions like Korora has been discontinued due to lack of free time. [Solus creator Ikey Doherty had to leave the project][10] to focus on his personal life. Developing and maintaining a successful open source project is not an easy task. + +That’s just my opinion. Please feel free to disagree with it and voice your opinion in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/antergos-linux-discontinued/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-arch-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2015/08/Installing_Antergos_Linux_7.png?ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/antergos-linux-dead.jpg?resize=800%2C450&ssl=1 +[4]: https://antergos.com/blog/antergos-linux-project-ends/ +[5]: https://itsfoss.com/best-aur-helpers/ +[6]: https://itsfoss.com/peppermint-8-released/ +[7]: https://manjaro.org/ +[8]: https://itsfoss.com/linux-lite-4/ +[9]: https://elementary.io/ +[10]: https://itsfoss.com/ikey-leaves-solus/ From 9aa2969d321168d2b018730e75482ff3a8aeece6 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:28:31 +0800 Subject: [PATCH 0611/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190521=20How?= =?UTF-8?q?=20to=20Disable=20IPv6=20on=20Ubuntu=20Linux=20sources/tech/201?= =?UTF-8?q?90521=20How=20to=20Disable=20IPv6=20on=20Ubuntu=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...521 How to Disable IPv6 on Ubuntu Linux.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md diff --git a/sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md b/sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md new file mode 100644 index 0000000000..4420b034e6 --- /dev/null +++ b/sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md @@ -0,0 +1,219 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Disable IPv6 on Ubuntu Linux) +[#]: via: (https://itsfoss.com/disable-ipv6-ubuntu-linux/) +[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) + +How to Disable IPv6 on Ubuntu Linux +====== + +Are you looking for a way to **disable IPv6** connections on your Ubuntu machine? In this article, I’ll teach you exactly how to do it and why you would consider this option. I’ll also show you how to **enable or re-enable IPv6** in case you change your mind. + +### What is IPv6 and why would you want to disable IPv6 on Ubuntu? + +**[Internet Protocol version 6][1]** [(][1] **[IPv6][1]**[)][1] is the most recent version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet. It was developed in 1998 to replace the **IPv4** protocol. + +**IPv6** aims to improve security and performance, while also making sure we don’t run out of addresses. It assigns unique addresses globally to every device, storing them in **128-bits** , compared to just 32-bits used by IPv4. + +![Disable IPv6 Ubuntu][2] + +Although the goal is for IPv4 to be replaced by IPv6, there is still a long way to go. Less than **30%** of the sites on the Internet makes IPv6 connectivity available to users (tracked by Google [here][3]). IPv6 can also cause [problems with some applications at time][4]. + +Since **VPNs** provide global services, the fact that IPv6 uses globally routed addresses (uniquely assigned) and that there (still) are ISPs that don’t offer IPv6 support shifts this feature lower down their priority list. This way, they can focus on what matters the most for VPN users: security. + +Another possible reason you might want to disable IPv6 on your system is not wanting to expose yourself to various threats. Although IPv6 itself is safer than IPv4, the risks I am referring to are of another nature. If you aren’t actively using IPv6 and its features, [having IPv6 enabled leaves you vulnerable to various attacks][5], offering the hacker another possible exploitable tool. + +On the same note, configuring basic network rules is not enough. You have to pay the same level of attention to tweaking your IPv6 configuration as you do for IPv4. This can prove to be quite a hassle to do (and also to maintain). With IPv6 comes a suite of problems different to those of IPv4 (many of which can be referenced online, given the age of this protocol), giving your system another layer of complexity. + +[][6] + +Suggested read How To Remove Drive Icons From Unity Launcher In Ubuntu 14.04 [Beginner Tips] + +### Disabling IPv6 on Ubuntu [For Advanced Users Only] + +In this section, I’ll be covering how you can disable IPv6 protocol on your Ubuntu machine. Open up a terminal ( **default:** CTRL+ALT+T) and let’s get to it! + +**Note:** _For most of the commands you are going to input in the terminal_ _you are going to need root privileges ( **sudo** )._ + +Warning! + +If you are a regular desktop Linux user and prefer a stable working system, please avoid this tutorial. This is for advanced users who know what they are doing and why they are doing so. + +#### 1\. Disable IPv6 using Sysctl + +First of all, you can **check** if you have IPv6 enabled with: + +``` +ip a +``` + +You should see an IPv6 address if it is enabled (the name of your internet card might be different): + +![IPv6 Address Ubuntu][7] + +You have see the sysctl command in the tutorial about [restarting network in Ubuntu][8]. We are going to use it here as well. To **disable IPv6** you only have to input 3 commands: + +``` +sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 +sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 +sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 +``` + +You can check if it worked using: + +``` +ip a +``` + +You should see no IPv6 entry: + +![IPv6 Disabled Ubuntu][9] + +However, this only **temporarily disables IPv6**. The next time your system boots, IPv6 will be enabled again. + +One method to make this option persist is modifying **/etc/sysctl.conf**. I’ll be using vim to edit the file, but you can use any editor you like. Make sure you have **administrator rights** (use **sudo** ): + +![Sysctl Configuration][10] + +Add the following lines to the file: + +``` +net.ipv6.conf.all.disable_ipv6=1 +net.ipv6.conf.default.disable_ipv6=1 +net.ipv6.conf.lo.disable_ipv6=1 +``` + +For the settings to take effect use: + +``` +sudo sysctl -p +``` + +If IPv6 is still enabled after rebooting, you must create (with root privileges) the file **/etc/rc.local** and fill it with: + +``` +#!/bin/bash +# /etc/rc.local + +/etc/sysctl.d +/etc/init.d/procps restart + +exit 0 +``` + +Now use [chmod command][11] to make the file executable: + +``` +sudo chmod 755 /etc/rc.local +``` + +What this will do is manually read (during the boot time) the kernel parameters from your sysctl configuration file. + +[][12] + +Suggested read 3 Ways to Check Linux Kernel Version in Command Line + +#### 2\. Disable IPv6 using GRUB + +An alternative method is to configure **GRUB** to pass kernel parameters at boot time. You’ll have to edit **/etc/default/grub**. Once again, make sure you have administrator privileges: + +![GRUB Configuration][13] + +Now you need to modify **GRUB_CMDLINE_LINUX_DEFAULT** and **GRUB_CMDLINE_LINUX** to disable IPv6 on boot: + +``` +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1" +GRUB_CMDLINE_LINUX="ipv6.disable=1" +``` + +Save the file and run: + +``` +sudo update-grub +``` + +The settings should now persist on reboot. + +### Re-enabling IPv6 on Ubuntu + +To re-enable IPv6, you’ll have to undo the changes you made. To enable IPv6 until reboot, enter: + +``` +sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 +sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0 +sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 +``` + +Otherwise, if you modified **/etc/sysctl.conf** you can either remove the lines you added or change them to: + +``` +net.ipv6.conf.all.disable_ipv6=0 +net.ipv6.conf.default.disable_ipv6=0 +net.ipv6.conf.lo.disable_ipv6=0 +``` + +You can optionally reload these values: + +``` +sudo sysctl -p +``` + +You should once again see a IPv6 address: + +![IPv6 Reenabled in Ubuntu][14] + +Optionally, you can remove **/etc/rc.local** : + +``` +sudo rm /etc/rc.local +``` + +If you modified the kernel parameters in **/etc/default/grub** , go ahead and delete the added options: + +``` +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +``` + +Now do: + +``` +sudo update-grub +``` + +**Wrapping Up** + +In this guide I provided you ways in which you can **disable IPv6** on Linux, as well as giving you an idea about what IPv6 is and why you would want to disable it. + +Did you find this article useful? Do you disable IPv6 connectivity? Let us know in the comment section! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/disable-ipv6-ubuntu-linux/ + +作者:[Sergiu][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/sergiu/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/IPv6 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/disable_ipv6_ubuntu.png?fit=800%2C450&ssl=1 +[3]: https://www.google.com/intl/en/ipv6/statistics.html +[4]: https://whatismyipaddress.com/ipv6-issues +[5]: https://www.internetsociety.org/blog/2015/01/ipv6-security-myth-1-im-not-running-ipv6-so-i-dont-have-to-worry/ +[6]: https://itsfoss.com/remove-drive-icons-from-unity-launcher-in-ubuntu/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/ipv6_address_ubuntu.png?fit=800%2C517&ssl=1 +[8]: https://itsfoss.com/restart-network-ubuntu/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/ipv6_disabled_ubuntu.png?fit=800%2C442&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/sysctl_configuration.jpg?fit=800%2C554&ssl=1 +[11]: https://linuxhandbook.com/chmod-command/ +[12]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/grub_configuration-1.jpg?fit=800%2C565&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/ipv6_address_ubuntu-1.png?fit=800%2C517&ssl=1 From 2953b59ff99672f929ed6534275d831d2d0c191f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:28:44 +0800 Subject: [PATCH 0612/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20Zett?= =?UTF-8?q?lr=20=E2=80=93=20Markdown=20Editor=20for=20Writers=20and=20Rese?= =?UTF-8?q?archers=20sources/tech/20190520=20Zettlr=20-=20Markdown=20Edito?= =?UTF-8?q?r=20for=20Writers=20and=20Researchers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...down Editor for Writers and Researchers.md | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md diff --git a/sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md b/sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md new file mode 100644 index 0000000000..92d6278ed4 --- /dev/null +++ b/sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Zettlr – Markdown Editor for Writers and Researchers) +[#]: via: (https://itsfoss.com/zettlr-markdown-editor/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Zettlr – Markdown Editor for Writers and Researchers +====== + +There are quite a few [Markdown editors available for Linux][1], with more popping up all of the time. The problem is that like [Boostnote][2], most are designed for coders and may not be as welcoming to non-techie people. Let’s take a look at a Markdown editor that wants to replace Word and expensive word processors for the non-techies. Let’s take a look at Zettlr. + +### Zettlr Markdown Editor + +![Zettlr Light Mode][3] + +I may have mentioned it a time or two on this site, but I prefer to write all of my documents in [Markdown][4]. It is simple to learn and does not leave you tied to a proprietary document format. I have also mentioned Markdown editor among my [list of open source tools for writers][5]. + +I have used a number of Markdown editors and am always interested to try out someone’s new take on the idea. Recently, I came across Zettlr, an open source markdown editor. + +[Zettlr][6] is the creation of a German sociologist/political theorist named [Hendrik Erz][7]. Hendrik created Zettlr because he was frustrated by the current line up of word processors. He wanted something that would allow him to “focus on writing and reading only”. + +After discovering Markdown, he tried several Markdown editors on different operating systems. But none of them had what he was looking for. [According to Hendrik][8], “But I had to realize that there are simply none written for the needs of organizing a huge amount of text efficiently. Most editors have been written by coders, therefore tailored to the needs of engineers and mathematicians. No luck for a student of social sciences, history or political science like me.” + +So he decided to create his own. In November of 2017, he started to work on Zettlr. + +![Zettlr About][9] + +#### Zettlr Features + +Zettlr has a number of neat features, including: + + * Import sources from your [Zotero database][10] and cite them in your document + * Focus on your writing with the distraction free mode with optional line muting + * Support for code highlighting + * Use tags to sort information + * Ability to set writing goals for the session + * View writing stats over time + * Pomodoro Timer + * Light/Dark theme + * Create presentation using [reveal.js][11] + * Quick preview of a document + * Search all Markdown documents in a project folder with heatmap showing the density of word searched + * Export files to HTML, PDF, ODT, DOC, reStructuredText, LaTex, TXT, Emacs ORG, [TextBundle][12], and Textpack + * Add custom CSS to your document + + + +[][13] + +Suggested read Manage Your PDF Files In Style With Great Little Book Shelf + +As I am writing this article, a dialog box popped up telling me about the recently released [1.3.0 beta][14]. This beta will include several new themes, as well as, a boatload of fixes, new features and under the hood improvements. + +![Zettlr Night Mode][15] + +#### Installing Zettlr + +Currently, the only Linux repository that has Zettlr for you to install is the [AUR][16]. If your Linux distro is not Arch-based, you can [download an installer][17] from the website for macOS, Windows, Debian, and Fedora. + +#### Final Thoughts on Zettlr + +Note: In order to test Zettlr, I used it to write this article. + +Zettlr has a number of neat features that I wish my Markdown editor of choice (ghostwriter) had, such as the ability to set a word count goal for the document. I also like the option to preview a document without having to open it. + +![Zettlr Settings][18] + +I did run into a couple issues, but they had more to do with the fact that Zettlr works a little bit different than ghostwriter. For example, when I tried to copy a quote or name from a web site, it pasted the in-line styling into Zettlr. Fortunately, there is an option to “Paste without Style”. A couple times I ran into a slight delay when I was trying to type. But that could because it is an Electron app. + +Overall, I think that Zettlr is a good option for a first time Markdown user. It has features that many Markdown editors already have and adds a few more for those who only ever used word processors + +As Hendrik says on the [Zettlr site][8], “Free yourselves from the fetters of word processors and see how your writing process can be improved by using technology that’s right at hand!” + +If you do find Zettlr useful, please consider supporting [Hendrik][19]. As he says on the site, “And this free of any charge, because I do not believe in the fast-living, early-dying startup culture. I simply want to help.” + +[][20] + +Suggested read Calligra Office App Brings ODT Support To Android + +Have you ever used Zettlr? What is your favorite Markdown editor? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][21]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zettlr-markdown-editor/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-markdown-editors-linux/ +[2]: https://itsfoss.com/boostnote-linux-review/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/Zettlr-light-mode.png?fit=800%2C462&ssl=1 +[4]: https://daringfireball.net/projects/markdown/ +[5]: https://itsfoss.com/open-source-tools-writers/ +[6]: https://www.zettlr.com/ +[7]: https://github.com/nathanlesage +[8]: https://www.zettlr.com/about +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/zettlr-about.png?fit=800%2C528&ssl=1 +[10]: https://www.zotero.org/ +[11]: https://revealjs.com/#/ +[12]: http://textbundle.org/ +[13]: https://itsfoss.com/great-little-book-shelf-review/ +[14]: https://github.com/Zettlr/Zettlr/releases/tag/v1.3.0-beta +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Zettlr-night-mode.png?fit=800%2C469&ssl=1 +[16]: https://aur.archlinux.org/packages/zettlr-bin/ +[17]: https://www.zettlr.com/download +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/zettlr-settings.png?fit=800%2C353&ssl=1 +[19]: https://www.zettlr.com/supporters +[20]: https://itsfoss.com/calligra-android-app-coffice/ +[21]: http://reddit.com/r/linuxusersgroup From 586717b02b797214ae115c58fad4192c3e919b16 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:29:04 +0800 Subject: [PATCH 0613/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190527=20How?= =?UTF-8?q?=20to=20write=20a=20good=20C=20main=20function=20sources/tech/2?= =?UTF-8?q?0190527=20How=20to=20write=20a=20good=20C=20main=20function.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...527 How to write a good C main function.md | 490 ++++++++++++++++++ 1 file changed, 490 insertions(+) create mode 100644 sources/tech/20190527 How to write a good C main function.md diff --git a/sources/tech/20190527 How to write a good C main function.md b/sources/tech/20190527 How to write a good C main function.md new file mode 100644 index 0000000000..55fd091d73 --- /dev/null +++ b/sources/tech/20190527 How to write a good C main function.md @@ -0,0 +1,490 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to write a good C main function) +[#]: via: (https://opensource.com/article/19/5/how-write-good-c-main-function) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) + +How to write a good C main function +====== +Learn how to structure a C file and write a C main function that handles +command line arguments like a champ. +![Hand drawing out the word "code"][1] + +I know, Python and JavaScript are what the kids are writing all their crazy "apps" with these days. But don't be so quick to dismiss C—it's a capable and concise language that has a lot to offer. If you need speed, writing in C could be your answer. If you are looking for job security and the opportunity to learn how to hunt down [null pointer dereferences][2], C could also be your answer! In this article, I'll explain how to structure a C file and write a C main function that handles command line arguments like a champ. + +**Me** : a crusty Unix system programmer. +**You** : someone with an editor, a C compiler, and some time to kill. + +_Let's do this._ + +### A boring but correct C program + +![Parody O'Reilly book cover, "Hating Other People's Code"][3] + +A C program starts with a **main()** function, usually kept in a file named **main.c**. + + +``` +/* main.c */ +int main(int argc, char *argv[]) { + +} +``` + +This program _compiles_ but doesn't _do_ anything. + + +``` +$ gcc main.c +$ ./a.out -o foo -vv +$ +``` + +Correct and boring. + +### Main functions are unique + +The **main()** function is the first function in your program that is executed when it begins executing, but it's not the first function executed. The _first_ function is **_start()** , which is typically provided by the C runtime library, linked in automatically when your program is compiled. The details are highly dependent on the operating system and compiler toolchain, so I'm going to pretend I didn't mention it. + +The **main()** function has two arguments that traditionally are called **argc** and **argv** and return a signed integer. Most Unix environments expect programs to return **0** (zero) on success and **-1** (negative one) on failure. + +Argument | Name | Description +---|---|--- +argc | Argument count | Length of the argument vector +argv | Argument vector | Array of character pointers + +The argument vector, **argv** , is a tokenized representation of the command line that invoked your program. In the example above, **argv** would be a list of the following strings: + + +``` +`argv = [ "/path/to/a.out", "-o", "foo", "-vv" ];` +``` + +The argument vector is guaranteed to always have at least one string in the first index, **argv[0]** , which is the full path to the program executed. + +### Anatomy of a main.c file + +When I write a **main.c** from scratch, it's usually structured like this: + + +``` +/* main.c */ +/* 0 copyright/licensing */ +/* 1 includes */ +/* 2 defines */ +/* 3 external declarations */ +/* 4 typedefs */ +/* 5 global variable declarations */ +/* 6 function prototypes */ + +int main(int argc, char *argv[]) { +/* 7 command-line parsing */ +} + +/* 8 function declarations */ +``` + +I'll talk about each of these numbered sections, except for zero, below. If you have to put copyright or licensing text in your source, put it there. + +Another thing I won't talk about adding to your program is comments. + + +``` +"Comments lie." +\- A cynical but smart and good looking programmer. +``` + +Instead of comments, use meaningful function and variable names. + +Appealing to the inherent laziness of programmers, once you add comments, you've doubled your maintenance load. If you change or refactor the code, you need to update or expand the comments. Over time, the code mutates away from anything resembling what the comments describe. + +If you have to write comments, do not write about _what_ the code is doing. Instead, write about _why_ the code is doing what it's doing. Write comments that you would want to read five years from now when you've forgotten everything about this code. And the fate of the world is depending on you. _No pressure_. + +#### 1\. Includes + +The first things I add to a **main.c** file are includes to make a multitude of standard C library functions and variables available to my program. The standard C library does lots of things; explore header files in **/usr/include** to find out what it can do for you. + +The **#include** string is a [C preprocessor][4] (cpp) directive that causes the inclusion of the referenced file, in its entirety, in the current file. Header files in C are usually named with a **.h** extension and should not contain any executable code; only macros, defines, typedefs, and external variable and function prototypes. The string **< header.h>** tells cpp to look for a file called **header.h** in the system-defined header path, usually **/usr/include**. + + +``` +/* main.c */ +#include +#include +#include +#include +#include +#include +#include +#include +``` + +This is the minimum set of global includes that I'll include by default for the following stuff: + +#include File | Stuff It Provides +---|--- +stdio | Supplies FILE, stdin, stdout, stderr, and the fprint() family of functions +stdlib | Supplies malloc(), calloc(), and realloc() +unistd | Supplies EXIT_FAILURE, EXIT_SUCCESS +libgen | Supplies the basename() function +errno | Defines the external errno variable and all the values it can take on +string | Supplies memcpy(), memset(), and the strlen() family of functions +getopt | Supplies external optarg, opterr, optind, and getopt() function +sys/types | Typedef shortcuts like uint32_t and uint64_t + +#### 2\. Defines + + +``` +/* main.c */ +<...> + +#define OPTSTR "vi⭕f:h" +#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" +#define ERR_FOPEN_INPUT "fopen(input, r)" +#define ERR_FOPEN_OUTPUT "fopen(output, w)" +#define ERR_DO_THE_NEEDFUL "do_the_needful blew up" +#define DEFAULT_PROGNAME "george" +``` + +This doesn't make a lot of sense right now, but the **OPTSTR** define is where I will state what command line switches the program will recommend. Consult the [**getopt(3)**][5] man page to learn how **OPTSTR** will affect **getopt()** 's behavior. + +The **USAGE_FMT** define is a **printf()** -style format string that is referenced in the **usage()** function. + +I also like to gather string constants as **#defines** in this part of the file. Collecting them makes it easier to fix spelling, reuse messages, and internationalize messages, if required. + +Finally, use all capital letters when naming a **#define** to distinguish it from variable and function names. You can run the words together if you want or separate words with an underscore; just make sure they're all upper case. + +#### 3\. External declarations + + +``` +/* main.c */ +<...> + +extern int errno; +extern char *optarg; +extern int opterr, optind; +``` + +An **extern** declaration brings that name into the namespace of the current compilation unit (aka "file") and allows the program to access that variable. Here we've brought in the definitions for three integer variables and a character pointer. The **opt** prefaced variables are used by the **getopt()** function, and **errno** is used as an out-of-band communication channel by the standard C library to communicate why a function might have failed. + +#### 4\. Typedefs + + +``` +/* main.c */ +<...> + +typedef struct { +int verbose; +uint32_t flags; +FILE *input; +FILE *output; +} options_t; +``` + +After external declarations, I like to declare **typedefs** for structures, unions, and enumerations. Naming a **typedef** is a religion all to itself; I strongly prefer a **_t** suffix to indicate that the name is a type. In this example, I've declared **options_t** as a **struct** with four members. C is a whitespace-neutral programming language, so I use whitespace to line up field names in the same column. I just like the way it looks. For the pointer declarations, I prepend the asterisk to the name to make it clear that it's a pointer. + +#### 5\. Global variable declarations + + +``` +/* main.c */ +<...> + +int dumb_global_variable = -11; +``` + +Global variables are a bad idea and you should never use them. But if you have to use a global variable, declare them here and be sure to give them a default value. Seriously, _don't use global variables_. + +#### 6\. Function prototypes + + +``` +/* main.c */ +<...> + +void usage(char *progname, int opt); +int do_the_needful(options_t *options); +``` + +As you write functions, adding them after the **main()** function and not before, include the function prototypes here. Early C compilers used a single-pass strategy, which meant that every symbol (variable or function name) you used in your program had to be declared before you used it. Modern compilers are nearly all multi-pass compilers that build a complete symbol table before generating code, so using function prototypes is not strictly required. However, you sometimes don't get to choose what compiler is used on your code, so write the function prototypes and drive on. + +As a matter of course, I always include a **usage()** function that **main()** calls when it doesn't understand something you passed in from the command line. + +#### 7\. Command line parsing + + +``` +/* main.c */ +<...> + +int main(int argc, char *argv[]) { +int opt; +options_t options = { 0, 0x0, stdin, stdout }; + +opterr = 0; + +while ((opt = getopt(argc, argv, OPTSTR)) != EOF) +switch(opt) { +case 'i': +if (!(options.input = [fopen][6](optarg, "r")) ){ +[perror][7](ERR_FOPEN_INPUT); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} +break; + +case 'o': +if (!(options.output = [fopen][6](optarg, "w")) ){ +[perror][7](ERR_FOPEN_OUTPUT); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} +break; + +case 'f': +options.flags = (uint32_t )[strtoul][9](optarg, NULL, 16); +break; + +case 'v': +options.verbose += 1; +break; + +case 'h': +default: +usage(basename(argv[0]), opt); +/* NOTREACHED */ +break; +} + +if (do_the_needful(&options) != EXIT_SUCCESS) { +[perror][7](ERR_DO_THE_NEEDFUL); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} + +return EXIT_SUCCESS; +} +``` + +OK, that's a lot. The purpose of the **main()** function is to collect the arguments that the user provides, perform minimal input validation, and then pass the collected arguments to functions that will use them. This example declares an **options** variable initialized with default values and parse the command line, updating **options** as necessary. + +The guts of this **main()** function is a **while** loop that uses **getopt()** to step through **argv** looking for command line options and their arguments (if any). The **OPTSTR** **#define** earlier in the file is the template that drives **getopt()** 's behavior. The **opt** variable takes on the character value of any command line options found by **getopt()** , and the program's response to the detection of the command line option happens in the **switch** statement. + +Those of you paying attention will now be questioning why **opt** is declared as a 32-bit **int** but is expected to take on an 8-bit **char**? It turns out that **getopt()** returns an **int** that takes on a negative value when it gets to the end of **argv** , which I check against **EOF** (the _End of File_ marker). A **char** is a signed quantity, but I like matching variables to their function return values. + +When a known command line option is detected, option-specific behavior happens. Some options have an argument, specified in **OPTSTR** with a trailing colon. When an option has an argument, the next string in **argv** is available to the program via the externally defined variable **optarg**. I use **optarg** to open files for reading and writing or converting a command line argument from a string to an integer value. + +There are a couple of points for style here: + + * Initialize **opterr** to 0, which disables **getopt** from emiting a **?**. + * Use **exit(EXIT_FAILURE);** or **exit(EXIT_SUCCESS);** in the middle of **main()**. + * **/* NOTREACHED */** is a lint directive that I like. + * Use **return EXIT_SUCCESS;** at the end of functions that return **int**. + * Explicitly cast implicit type conversions. + + + +The command line signature for this program, if it were compiled, would look something like this: + + +``` +$ ./a.out -h +a.out [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h] +``` + +In fact, that's what **usage()** will emit to **stderr** once compiled. + +#### 8\. Function declarations + + +``` +/* main.c */ +<...> + +void usage(char *progname, int opt) { +[fprintf][10](stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} + +int do_the_needful(options_t *options) { + +if (!options) { +errno = EINVAL; +return EXIT_FAILURE; +} + +if (!options->input || !options->output) { +errno = ENOENT; +return EXIT_FAILURE; +} + +/* XXX do needful stuff */ + +return EXIT_SUCCESS; +} +``` + +Finally, I write functions that aren't boilerplate. In this example, function **do_the_needful()** accepts a pointer to an **options_t** structure. I validate that the **options** pointer is not **NULL** and then go on to validate the **input** and **output** structure members. **EXIT_FAILURE** returns if either test fails and, by setting the external global variable **errno** to a conventional error code, I signal to the caller a general reason. The convenience function **perror()** can be used by the caller to emit human-readable-ish error messages based on the value of **errno**. + +Functions should almost always validate their input in some way. If full validation is expensive, try to do it once and treat the validated data as immutable. The **usage()** function validates the **progname** argument using a conditional assignment in the **fprintf()** call. The **usage()** function is going to exit anyway, so I don't bother setting **errno** or making a big stink about using a correct program name. + +The big class of errors I am trying to avoid here is de-referencing a **NULL** pointer. This will cause the operating system to send a special signal to my process called **SYSSEGV** , which results in unavoidable death. The last thing users want to see is a crash due to **SYSSEGV**. It's much better to catch a **NULL** pointer in order to emit better error messages and shut down the program gracefully. + +Some people complain about having multiple **return** statements in a function body. They make arguments about "continuity of control flow" and other stuff. Honestly, if something goes wrong in the middle of a function, it's a good time to return an error condition. Writing a ton of nested **if** statements to just have one return is never a "good idea."™ + +Finally, if you write a function that takes four or more arguments, consider bundling them in a structure and passing a pointer to the structure. This makes the function signatures simpler, making them easier to remember and not screw up when they're called later. It also makes calling the function slightly faster, since fewer things need to be copied into the function's stack frame. In practice, this will only become a consideration if the function is called millions or billions of times. Don't worry about it if that doesn't make sense. + +### Wait, you said no comments!?!! + +In the **do_the_needful()** function, I wrote a specific type of comment that is designed to be a placeholder rather than documenting the code: + + +``` +`/* XXX do needful stuff */` +``` + +When you are in the zone, sometimes you don't want to stop and write some particularly gnarly bit of code. You'll come back and do it later, just not now. That's where I'll leave myself a little breadcrumb. I insert a comment with a **XXX** prefix and a short remark describing what needs to be done. Later on, when I have more time, I'll grep through source looking for **XXX**. It doesn't matter what you use, just make sure it's not likely to show up in your codebase in another context, as a function name or variable, for instance. + +### Putting it all together + +OK, this program _still_ does almost nothing when you compile and run it. But now you have a solid skeleton to build your own command line parsing C programs. + + +``` +/* main.c - the complete listing */ + +#include +#include +#include +#include +#include +#include +#include + +#define OPTSTR "vi⭕f:h" +#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" +#define ERR_FOPEN_INPUT "fopen(input, r)" +#define ERR_FOPEN_OUTPUT "fopen(output, w)" +#define ERR_DO_THE_NEEDFUL "do_the_needful blew up" +#define DEFAULT_PROGNAME "george" + +extern int errno; +extern char *optarg; +extern int opterr, optind; + +typedef struct { +int verbose; +uint32_t flags; +FILE *input; +FILE *output; +} options_t; + +int dumb_global_variable = -11; + +void usage(char *progname, int opt); +int do_the_needful(options_t *options); + +int main(int argc, char *argv[]) { +int opt; +options_t options = { 0, 0x0, stdin, stdout }; + +opterr = 0; + +while ((opt = getopt(argc, argv, OPTSTR)) != EOF) +switch(opt) { +case 'i': +if (!(options.input = [fopen][6](optarg, "r")) ){ +[perror][7](ERR_FOPEN_INPUT); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} +break; + +case 'o': +if (!(options.output = [fopen][6](optarg, "w")) ){ +[perror][7](ERR_FOPEN_OUTPUT); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} +break; + +case 'f': +options.flags = (uint32_t )[strtoul][9](optarg, NULL, 16); +break; + +case 'v': +options.verbose += 1; +break; + +case 'h': +default: +usage(basename(argv[0]), opt); +/* NOTREACHED */ +break; +} + +if (do_the_needful(&options) != EXIT_SUCCESS) { +[perror][7](ERR_DO_THE_NEEDFUL); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} + +return EXIT_SUCCESS; +} + +void usage(char *progname, int opt) { +[fprintf][10](stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} + +int do_the_needful(options_t *options) { + +if (!options) { +errno = EINVAL; +return EXIT_FAILURE; +} + +if (!options->input || !options->output) { +errno = ENOENT; +return EXIT_FAILURE; +} + +/* XXX do needful stuff */ + +return EXIT_SUCCESS; +} +``` + +Now you're ready to write C that will be easier to maintain. If you have any questions or feedback, please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/how-write-good-c-main-function + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjny +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") +[2]: https://www.owasp.org/index.php/Null_Dereference +[3]: https://opensource.com/sites/default/files/uploads/hatingotherpeoplescode-big.png (Parody O'Reilly book cover, "Hating Other People's Code") +[4]: https://en.wikipedia.org/wiki/C_preprocessor +[5]: https://linux.die.net/man/3/getopt +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/strtoul.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html From 4a373a6088f5a4d73f81c1c209383f5452e708c2 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:29:19 +0800 Subject: [PATCH 0614/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190527=204=20?= =?UTF-8?q?open=20source=20mobile=20apps=20for=20Nextcloud=20sources/tech/?= =?UTF-8?q?20190527=204=20open=20source=20mobile=20apps=20for=20Nextcloud.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 open source mobile apps for Nextcloud.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20190527 4 open source mobile apps for Nextcloud.md diff --git a/sources/tech/20190527 4 open source mobile apps for Nextcloud.md b/sources/tech/20190527 4 open source mobile apps for Nextcloud.md new file mode 100644 index 0000000000..c97817e3c1 --- /dev/null +++ b/sources/tech/20190527 4 open source mobile apps for Nextcloud.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 open source mobile apps for Nextcloud) +[#]: via: (https://opensource.com/article/19/5/mobile-apps-nextcloud) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +4 open source mobile apps for Nextcloud +====== +Increase Nextcloud's value by turning it into an on-the-go information +hub. +![][1] + +I've been using [Nextcloud][2] (and before that, ownCloud), an open source alternative to file syncing and storage services like Dropbox and Google Drive, for many years. It's been both reliable and useful, and it respects my privacy. + +While Nextcloud is great at both syncing and storage, it's much more than a place to dump your files. Thanks to applications that you can fold into Nextcloud, it becomes more of an information hub than a storage space. + +While I usually interact with Nextcloud using the desktop client or in a browser, I'm not always at my computer (or any computer that I trust). So it's important that I can work with Nextcloud using my [LineageOS][3]-powered smartphone or tablet. + +To do that, I use several open source apps that work with Nextcloud. Let's take a look at four of them. + +As you've probably guessed, this article looks at the Android version of those apps. I grabbed mine from [F-Droid][4], although you get them from other Android app markets. You might be able to get some or all of them from Apple's App Store if you're an iOS person. + +### Working with files and folders + +The obvious app to start with is the [Nextcloud sync client][5]. This little app links your phone or tablet to your Nextcloud account. + +![Nextcloud mobile app][6] + +Using the app, you can: + + * Create folders + * Upload one or more files + * Sync files between your device and server + * Rename or remove files + * Make files available offline + + + +You can also tap a file to view or edit it. If your device doesn't have an app that can open the file, then you're out of luck. You can still download it to your phone or tablet though. + +### Reading news feeds + +Remember all the whining that went on when Google pulled the plug on Google Reader in 2013? This despite Google giving users several months to find an alternative. And, yes, there are alternatives. One of them, believe it or not, is Nextcloud. + +Nextcloud has a built-in RSS reader. All you need to do to get started is upload an [OPML][7] file containing your feeds or manually add a site's RSS feed to Nextcloud. + +Going mobile is easy, too, with the Nextcloud [News Reader app][8]. + +![Nextcloud News app][9] + +Unless you configure the app to sync when you start it up, you'll need to swipe down from the top of the app to load updates to your feeds. Depending on how many feeds you have, and how many unread items are in those feeds, syncing takes anywhere from a few seconds to half a minute. + +From there, tap an item to read it in the News app. + +![Nextcloud News app][10] + +You can also add feeds or open what you're reading in your device's default web browser. + +### Reading and writing notes + +I don't use Nextcloud's [Notes][11] app all that often (I'm more of a [Standard Notes][12] person). That said, you might find the Notes app comes in handy. + +How? By giving you a lightweight way to take [plain text][13] notes on your mobile device. The Notes app syncs any notes you have in your Nextcloud account and displays them in chronological order—newest or last-edited notes first. + +![Nextcloud Notes app][14] + +Tap a note to read or edit it. You can also create a note by tapping the **+** button, then typing what you need to type. + +![Nextcloud Notes app][15] + +There's no formatting, although you can add markup (like Markdown) to the note. Once you're done editing, the app syncs your note with Nextcloud. + +### Accessing your bookmarks + +Nextcloud has a decent bookmarking tool, and its [Bookmarks][16] app makes it easy to work with the tool on your phone or tablet. + +![Nextcloud Bookmarks app][17] + +Like the Notes app, Bookmarks displays your bookmarks in chronological order, with the newest appearing first in the list. + +If you tagged your bookmarks in Nextcloud, you can swipe left in the app to see a list of those tags rather than a long list of bookmarks. Tap a tag to view the bookmarks under it. + +![Nextcloud Bookmarks app][18] + +From there, just tap a bookmark. It opens in your device's default browser. + +You can also add a bookmark within the app. To do that, tap the **+** menu and add the bookmark. + +![Nextcloud Bookmarks app][19] + +You can include: + + * The URL + * A title for the bookmark + * A description + * One or more tags + + + +### Is that all? + +Definitely not. There are apps for [Nextcloud Deck][20] (a personal kanban tool) and [Nextcloud Talk][21] (a voice and video chat app). There are also a number of third-party apps that work with Nextcloud. Just do a search for _Nextcloud_ or _ownCloud_ in your favorite app store to track them down. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/mobile-apps-nextcloud + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_BUS_cloudagenda_20140341_jehb.png?itok=1NGs3_n4 +[2]: https://nextcloud.com/ +[3]: https://lineageos.org/ +[4]: https://opensource.com/life/15/1/going-open-source-android-f-droid +[5]: https://f-droid.org/en/packages/com.nextcloud.client/ +[6]: https://opensource.com/sites/default/files/uploads/nextcloud-app.png (Nextcloud mobile app) +[7]: http://en.wikipedia.org/wiki/OPML +[8]: https://f-droid.org/en/packages/de.luhmer.owncloudnewsreader/ +[9]: https://opensource.com/sites/default/files/uploads/nextcloud-news.png (Nextcloud News app) +[10]: https://opensource.com/sites/default/files/uploads/nextcloud-news-reading.png (Nextcloud News app) +[11]: https://f-droid.org/en/packages/it.niedermann.owncloud.notes +[12]: https://opensource.com/article/18/12/taking-notes-standard-notes +[13]: https://plaintextproject.online +[14]: https://opensource.com/sites/default/files/uploads/nextcloud-notes.png (Nextcloud Notes app) +[15]: https://opensource.com/sites/default/files/uploads/nextcloud-notes-add.png (Nextcloud Notes app) +[16]: https://f-droid.org/en/packages/org.schabi.nxbookmarks/ +[17]: https://opensource.com/sites/default/files/uploads/nextcloud-bookmarks.png (Nextcloud Bookmarks app) +[18]: https://opensource.com/sites/default/files/uploads/nextcloud-bookmarks-tags.png (Nextcloud Bookmarks app) +[19]: https://opensource.com/sites/default/files/uploads/nextcloud-bookmarks-add.png (Nextcloud Bookmarks app) +[20]: https://f-droid.org/en/packages/it.niedermann.nextcloud.deck +[21]: https://f-droid.org/en/packages/com.nextcloud.talk2 From 241a451d25d5c4f3f1bf4e07281f8a3bb4baadd5 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:30:13 +0800 Subject: [PATCH 0615/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190524=20Choo?= =?UTF-8?q?sing=20the=20right=20model=20for=20maintaining=20and=20enhancin?= =?UTF-8?q?g=20your=20IoT=20project=20sources/tech/20190524=20Choosing=20t?= =?UTF-8?q?he=20right=20model=20for=20maintaining=20and=20enhancing=20your?= =?UTF-8?q?=20IoT=20project.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntaining and enhancing your IoT project.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20190524 Choosing the right model for maintaining and enhancing your IoT project.md diff --git a/sources/tech/20190524 Choosing the right model for maintaining and enhancing your IoT project.md b/sources/tech/20190524 Choosing the right model for maintaining and enhancing your IoT project.md new file mode 100644 index 0000000000..06b8fd6de3 --- /dev/null +++ b/sources/tech/20190524 Choosing the right model for maintaining and enhancing your IoT project.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Choosing the right model for maintaining and enhancing your IoT project) +[#]: via: (https://opensource.com/article/19/5/model-choose-embedded-iot-development) +[#]: author: (Drew Moseley https://opensource.com/users/drewmoseley) + +Choosing the right model for maintaining and enhancing your IoT project +====== +Learn more about these two models: Centralized Golden Master and +Distributed Build System +![][1] + +In today's connected embedded device market, driven by the [Internet of things (IoT)][2], a large share of devices in development are based on Linux of one form or another. The prevalence of low-cost boards with ready-made Linux distributions is a key driver in this. Acquiring hardware, building your custom code, connecting the devices to other hardware peripherals and the internet as well as device management using commercial cloud providers has never been easier. A developer or development team can quickly prototype a new application and get the devices in the hands of potential users. This is a good thing and results in many interesting new applications, as well as many questionable ones. + +When planning a system design for beyond the prototyping phase, things get a little more complex. In this post, we want to consider mechanisms for developing and maintaining your base [operating system (OS) image][3]. There are many tools to help with this but we won't be discussing individual tools; of interest here is the underlying model for maintaining and enhancing this image and how it will make your life better or worse. + +There are two primary models for generating these images: + + 1. Centralized Golden Master + 2. Distributed Build System + + + +These categories mirror the driving models for [Source Code Management (SCM)][4] systems, and many of the arguments regarding centralized vs. distributed are applicable when discussing OS images. + +### Centralized Golden Master + +Hobbyist and maker projects primarily use the Centralized Golden Master method of creating and maintaining application images. This fact gives this model the benefit of speed and familiarity, allowing developers to quickly set up such a system and get it running. The speed comes from the fact that many device manufacturers provide canned images for their off-the-shelf hardware. For example, boards from such families as the [BeagleBone][5] and [Raspberry Pi][6] offer ready-to-use OS images and [flashing][7]. Relying on these images means having your system up and running in just a few mouse clicks. The familiarity is due to the fact that these images are generally based on a desktop distro many device developers have already used, such as [Debian][8]. Years of using Linux can then directly transfer to the embedded design, including the fact that the packaging utilities remain largely the same, and it is simple for designers to get the extra software packages they need. + +There are a few downsides of such an approach. The first is that the [golden master image][9] is generally a choke point, resulting in lost developer productivity after the prototyping stage since everyone must wait for their turn to access the latest image and make their changes. In the SCM realm, this practice is equivalent to a centralized system with individual [file locking][10]. Only the developer with the lock can work on any given file. + +![Development flow with the Centralized Golden Master model.][11] + +The second downside with this approach is image reproducibility. This issue is usually managed by manually logging into the target systems, installing packages using the native package manager, configuring applications and dot files, and then modifying the system configuration files in place. Once this process is completed, the disk is imaged using the **dd** utility, or an equivalent, and then distributed. + +Again, this approach creates a minefield of potential issues. For example, network-based package feeds may cease to exist, and the base software provided by the vendor image may change. Scripting can help mitigate these issues. However, these scripts tend to be fragile and break when changes are made to configuration file formats or the vendor's base software packages. + +The final issue that arises with this development model is reliance on third parties. If the hardware vendor's image changes don't work for your design, you may need to invest significant time to adapt. To make matters even more complicated, as mentioned before, the hardware vendors often based their images on an upstream project such as Debian or Ubuntu. This situation introduces even more third parties who can affect your design. + +### Distributed Build System + +This method of creating and maintaining an image for your application relies on the generation of target images separate from the target hardware. The developer workflow here is similar to standard software development using an SCM system; the image is fully buildable by tooling and each developer can work independently. Changes to the system are made via edits to metadata files (scripting, recipes, configuration files, etc) and then the tooling is rerun to generate an updated image. These metadata files are then managed using an SCM system. Individual developers can merge the latest changes into their working copies to produce their development images. In this case, no golden master image is needed and developers can avoid the associated bottleneck. + +Release images are then produced by a build system using standard SCM techniques to pull changes from all the developers. + +![Development flow with the Distributed Build System model.][12] + +Working in this fashion allows the size of your development team to increase without reducing productivity of individual developers. All engineers can work independently of the others. Additionally, this build setup ensures that your builds can be reproduced. Using standard SCM workflows can ensure that, at any future time, you can regenerate a specific build allowing for long term maintenance, even if upstream providers are no longer available. Similar to working with distributed SCM tools however, there is additional policy that needs to be in place to enable reproducible, release candidate images. Individual developers have their own copies of the source and can build their own test images but for a proper release engineering effort, development teams will need to establish merging and branching standards and ensure that all changes targeted for release eventually get merged into a well-defined branch. Many upstream projects already have well-defined processes for this kind of release strategy (for instance, using *-stable and *-next branches). + +The primary downside of this approach is the lack of familiarity. For example, adding a package to the image normally requires creating a recipe of some kind and then updating the definitions so that the package binaries are included in the image. This is very different from running apt while logged into a running system. The learning curve of these systems can be daunting but the results are more predictable and scalable and are likely a better choice when considering a design for a product that will be mass produced. + +Dedicated build systems such as [OpenEmbedded][13] and [Buildroot][14] use this model as do distro packaging tools such as [debootstrap][15] and [multistrap][16]. Newer tools such as [Isar][17], [debos][18], and [ELBE][19] also use this basic model. Choices abound, and it is worth the investment to learn one or more of these packages for your designs. The long term maintainability and reproducibility of these systems will reduce risk in your design by allowing you to generate reproducible builds, track all the source code, and remove your dependency on third-party providers continued existence. + +#### Conclusion + +To be clear, the distributed model does suffer some of the same issues as mentioned for the Golden Master Model; especially the reliance on third parties. This is a consequence of using systems designed by others and cannot be completely avoided unless you choose a completely roll-your-own approach which comes with a significant cost in development and maintenance. + +For prototyping and proof-of-concept level design, and a team of just a few developers, the Golden Master Model may well be the right choice given restrictions in time and budget that are present at this stage of development. For low volume, high touch designs, this may be an acceptable trade-off for production use. + +For general production use, the benefits in terms of team size scalability, image reproducibility and developer productivity greatly outweigh the learning curve and overhead of systems implementing the distributed model. Support from board and chip vendors is also widely available in these systems reducing the upfront costs of developing with them. For your next product, I strongly recommend starting the design with a serious consideration of the model being used to generate the base OS image. If you choose to prototype with the golden master model with the intention of migrating to the distributed model, make sure to build sufficient time in your schedule for this effort; the estimates will vary widely depending on the specific tooling you choose as well as the scope of the requirements and the out-of-the-box availability of software packages your code relies on. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/model-choose-embedded-iot-development + +作者:[Drew Moseley][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/drewmoseley +[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 +[2]: https://en.wikipedia.org/wiki/Internet_of_things +[3]: https://en.wikipedia.org/wiki/System_image +[4]: https://en.wikipedia.org/wiki/Version_control +[5]: http://beagleboard.org/ +[6]: https://www.raspberrypi.org/ +[7]: https://en.wikipedia.org/wiki/Flash_memory +[8]: https://www.debian.org/ +[9]: https://en.wikipedia.org/wiki/Software_release_life_cycle#RTM +[10]: https://en.wikipedia.org/wiki/File_locking +[11]: https://opensource.com/sites/default/files/uploads/cgm1_500.png (Development flow with the Centralized Golden Master model.) +[12]: https://opensource.com/sites/default/files/uploads/cgm2_500.png (Development flow with the Distributed Build System model.) +[13]: https://www.openembedded.org/ +[14]: https://buildroot.org/ +[15]: https://wiki.debian.org/Debootstrap +[16]: https://wiki.debian.org/Multistrap +[17]: https://github.com/ilbers/isar +[18]: https://github.com/go-debos/debos +[19]: https://elbe-rfs.org/ From bbc4a9f6b36f32cce521e1bba511bd5d0428bec3 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:30:30 +0800 Subject: [PATCH 0616/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190524=20Dual?= =?UTF-8?q?=20booting=20Windows=20and=20Linux=20using=20UEFI=20sources/tec?= =?UTF-8?q?h/20190524=20Dual=20booting=20Windows=20and=20Linux=20using=20U?= =?UTF-8?q?EFI.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...al booting Windows and Linux using UEFI.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20190524 Dual booting Windows and Linux using UEFI.md diff --git a/sources/tech/20190524 Dual booting Windows and Linux using UEFI.md b/sources/tech/20190524 Dual booting Windows and Linux using UEFI.md new file mode 100644 index 0000000000..b281b6036b --- /dev/null +++ b/sources/tech/20190524 Dual booting Windows and Linux using UEFI.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Dual booting Windows and Linux using UEFI) +[#]: via: (https://opensource.com/article/19/5/dual-booting-windows-linux-uefi) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/ckrzen) + +Dual booting Windows and Linux using UEFI +====== +A quick rundown of setting up Linux and Windows to dual boot on the same +machine, using the Unified Extensible Firmware Interface (UEFI). +![Linux keys on the keyboard for a desktop computer][1] + +Rather than doing a step-by-step how-to guide to configuring your system to dual boot, I’ll highlight the important points. As an example, I will refer to my new laptop that I purchased a few months ago. I first installed [Ubuntu Linux][2] onto the entire hard drive, which destroyed the pre-installed [Windows 10][3] installation. After a few months, I decided to install a different Linux distribution, and so also decided to re-install Windows 10 alongside [Fedora Linux][4] in a dual boot configuration. I’ll highlight some essential facts to get started. + +### Firmware + +Dual booting is not just a matter of software. Or, it is, but it involves changing your firmware, which among other things tells your machine how to begin the boot process. Here are some firmware-related issues to keep in mind. + +#### UEFI vs. BIOS + +Before attempting to install, make sure your firmware configuration is optimal. Most computers sold today have a new type of firmware known as [Unified Extensible Firmware Interface (UEFI)][5], which has pretty much replaced the other firmware known as [Basic Input Output System (BIOS)][6], which is often included through the mode many providers call Legacy Boot. + +I had no need for BIOS, so I chose UEFI mode. + +#### Secure Boot + +One other important setting is Secure Boot. This feature detects whether the boot path has been tampered with, and stops unapproved operating systems from booting. For now, I disabled this option to ensure that I could install Fedora Linux. According to the Fedora Project Wiki [Features/Secure Boot ][7] Fedora Linux will work with it enabled. This may be different for other Linux distributions —I plan to revisit this setting in the future. + +In short, if you find that you cannot install your Linux OS with this setting active, disable Secure Boot and try again. + +### Partitioning the boot drive + +If you choose to dual boot and have both operating systems on the same drive, you have to break it into partitions. Even if you dual boot using two different drives, most Linux installations are best broken into a few basic partitions for a variety of reasons. Here are some options to consider. + +#### GPT vs MBR + +If you decide to manually partition your boot drive in advance, I recommend using the [GUID Partition Table (GPT)][8] rather than the older [Master Boot Record (MBR)][9]. Among the reasons for this change, there are two specific limitations of MBR that GPT doesn’t have: + + * MBR can hold up to 15 partitions, while GPT can hold up to 128. + * MBR only supports up to 2 terabytes, while GPT uses 64-bit addresses which allows it to support disks up to 8 million terabytes. + + + +If you have shopped for hard drives recently, then you know that many of today’s drives exceed the 2 terabyte limit. + +#### The EFI system partition + +If you are doing a fresh installation or using a new drive, there are probably no partitions to begin with. In this case, the OS installer will create the first one, which is the [EFI System Partition (ESP)][10]. If you choose to manually partition your drive using a tool such as [gdisk][11], you will need to create this partition with several parameters. Based on the existing ESP, I set the size to around 500MB and assigned it the ef00 (EFI System) partition type. The UEFI specification requires the format to be FAT32/msdos, most likely because it is supportable by a wide range of operating systems. + +![Partitions][12] + +### Operating System Installation + +Once you accomplish the first two tasks, you can install your operating systems. While I focus on Windows 10 and Fedora Linux here, the process is fairly similar when installing other combinations as well. + +#### Windows 10 + +I started the Windows 10 installation and created a 20 Gigabyte Windows partition. Since I had previously installed Linux on my laptop, the drive had an ESP, which I chose to keep. I deleted all existing Linux and swap partitions to start fresh, and then started my Windows installation. The Windows installer automatically created another small partition—16 Megabytes—called the [Microsoft Reserved Partition (MSR)][13]. Roughly 400 Gigabytes of unallocated space remained on the 512GB boot drive once this was finished. + +I then proceeded with and completed the Windows 10 installation process. I then rebooted into Windows to make sure it was working, created my user account, set up wi-fi, and completed other tasks that need to be done on a first-time OS installation. + +#### Fedora Linux + +I next moved to install Linux. I started the process, and when it reached the disk configuration steps, I made sure not to change the Windows NTFS and MSR partitions. I also did not change the EPS, but I did set its mount point to **/boot/efi**. I then created the usual ext4 formatted partitions, **/** (root), **/boot** , and **/home**. The last partition I created was Linux **swap**. + +As with Windows, I continued and completed the Linux installation, and then rebooted. To my delight, at boot time the [GRand][14] [Unified Boot Loader (GRUB)][14] menu provided the choice to select either Windows or Linux, which meant I did not have to do any additional configuration. I selected Linux and completed the usual steps such as creating my user account. + +### Conclusion + +Overall, the process was painless. In past years, there has been some difficulty navigating the changes from UEFI to BIOS, plus the introduction of features such as Secure Boot. I believe that we have now made it past these hurdles and can reliably set up multi-boot systems. + +I don’t miss the [Linux LOader (LILO)][15] anymore! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/dual-booting-windows-linux-uefi + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss/users/ckrzen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://www.ubuntu.com +[3]: https://www.microsoft.com/en-us/windows +[4]: https://getfedora.org +[5]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface +[6]: https://en.wikipedia.org/wiki/BIOS +[7]: https://fedoraproject.org/wiki/Features/SecureBoot +[8]: https://en.wikipedia.org/wiki/GUID_Partition_Table +[9]: https://en.wikipedia.org/wiki/Master_boot_record +[10]: https://en.wikipedia.org/wiki/EFI_system_partition +[11]: https://sourceforge.net/projects/gptfdisk/ +[12]: /sites/default/files/u216961/gdisk_screenshot_s.png +[13]: https://en.wikipedia.org/wiki/Microsoft_Reserved_Partition +[14]: https://en.wikipedia.org/wiki/GNU_GRUB +[15]: https://en.wikipedia.org/wiki/LILO_(boot_loader) From 28a1d3d5eb10a27bd33ebaea75d28bdd09cd6310 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:30:43 +0800 Subject: [PATCH 0617/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190523=20Run?= =?UTF-8?q?=20your=20blog=20on=20GitHub=20Pages=20with=20Python=20sources/?= =?UTF-8?q?tech/20190523=20Run=20your=20blog=20on=20GitHub=20Pages=20with?= =?UTF-8?q?=20Python.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n your blog on GitHub Pages with Python.md | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 sources/tech/20190523 Run your blog on GitHub Pages with Python.md diff --git a/sources/tech/20190523 Run your blog on GitHub Pages with Python.md b/sources/tech/20190523 Run your blog on GitHub Pages with Python.md new file mode 100644 index 0000000000..1e3634a327 --- /dev/null +++ b/sources/tech/20190523 Run your blog on GitHub Pages with Python.md @@ -0,0 +1,235 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run your blog on GitHub Pages with Python) +[#]: via: (https://opensource.com/article/19/5/run-your-blog-github-pages-python) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani) + +Run your blog on GitHub Pages with Python +====== +Create a blog with Pelican, a Python-based blogging platform that works +well with GitHub. +![Raspberry Pi and Python][1] + +[GitHub][2] is a hugely popular web service for source code control that uses [Git][3] to synchronize local files with copies kept on GitHub's servers so you can easily share and back up your work. + +In addition to providing a user interface for code repositories, GitHub also enables users to [publish web pages][4] directly from a repository. The website generation package GitHub recommends is [Jekyll][5], written in Ruby. Since I'm a bigger fan of [Python][6], I prefer [Pelican][7], a Python-based blogging platform that works well with GitHub. + +Pelican and Jekyll both transform content written in [Markdown][8] or [reStructuredText][9] into HTML to generate static websites, and both generators support themes that allow unlimited customization. + +In this article, I'll describe how to install Pelican, set up your GitHub repository, run a quickstart helper, write some Markdown files, and publish your first page. I'll assume that you have a [GitHub account][10], are comfortable with [basic Git commands][11], and want to publish a blog using Pelican. + +### Install Pelican and create the repo + +First things first, Pelican (and **ghp-import** ) must be installed on your local machine. This is super easy with [pip][12], the Python package installation tool (you have pip right?): + + +``` +`$ pip install pelican ghp-import` +``` + +Next, open a browser and create a new repository on GitHub for your sweet new blog. Name it as follows (substituting your GitHub username for here and throughout this tutorial): + + +``` +`https://GitHub.com/username/username.github.io` +``` + +Leave it empty; we will fill it with compelling blog content in a moment. + +Using a command line (you command line right?), clone your empty Git repository to your local machine: + + +``` +$ git clone blog +$ cd blog +``` + +### That one weird trick… + +Here's a not-super-obvious trick about publishing web content on GitHub. For user pages (pages hosted in repos named _username.github.io_ ), the content is served from the **master** branch. + +I strongly prefer not to keep all the Pelican configuration files and raw Markdown files in **master** , rather just the web content. So I keep the Pelican configuration and the raw content in a separate branch I like to call **content**. (You can call it whatever you want, but the following instructions will call it **content**.) I like this structure since I can throw away all the files in **master** and re-populate it with the **content** branch. + + +``` +$ git checkout -b content +Switched to a new branch 'content' +``` + +### Configure Pelican + +Now it's time for content configuration. Pelican provides a great initialization tool called **pelican-quickstart** that will ask you a series of questions about your blog. + + +``` +$ pelican-quickstart +Welcome to pelican-quickstart v3.7.1. + +This script will help you create a new Pelican-based website. + +Please answer the following questions so this script can generate the files +needed by Pelican. + +> Where do you want to create your new web site? [.] +> What will be the title of this web site? Super blog +> Who will be the author of this web site? username +> What will be the default language of this web site? [en] +> Do you want to specify a URL prefix? e.g., (Y/n) n +> Do you want to enable article pagination? (Y/n) +> How many articles per page do you want? [10] +> What is your time zone? [Europe/Paris] US/Central +> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n) y +> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n) y +> Do you want to upload your website using FTP? (y/N) n +> Do you want to upload your website using SSH? (y/N) n +> Do you want to upload your website using Dropbox? (y/N) n +> Do you want to upload your website using S3? (y/N) n +> Do you want to upload your website using Rackspace Cloud Files? (y/N) n +> Do you want to upload your website using GitHub Pages? (y/N) y +> Is this your personal page (username.github.io)? (y/N) y +Done. Your new project is available at /Users/username/blog +``` + +You can take the defaults on every question except: + + * Website title, which should be unique and special + * Website author, which can be a personal username or your full name + * Time zone, which may not be in Paris + * Upload to GitHub Pages, which is a "y" in our case + + + +After answering all the questions, Pelican leaves the following in the current directory: + + +``` +$ ls +Makefile content/ develop_server.sh* +fabfile.py output/ pelicanconf.py +publishconf.py +``` + +You can check out the [Pelican docs][13] to find out how to use those files, but we're all about getting things done _right now_. No, I haven't read the docs yet either. + +### Forge on + +Add all the Pelican-generated files to the **content** branch of the local Git repo, commit the changes, and push the local changes to the remote repo hosted on GitHub by entering: + + +``` +$ git add . +$ git commit -m 'initial pelican commit to content' +$ git push origin content +``` + +This isn't super exciting, but it will be handy if we need to revert edits to one of these files. + +### Finally getting somewhere + +OK, now you can get bloggy! All of your blog posts, photos, images, PDFs, etc., will live in the **content** directory, which is initially empty. To begin creating a first post and an About page with a photo, enter: + + +``` +$ cd content +$ mkdir pages images +$ cp /Users/username/SecretStash/HotPhotoOfMe.jpg images +$ touch first-post.md +$ touch pages/about.md +``` + +Next, open the empty file **first-post.md** in your favorite text editor and add the following: + + +``` +title: First Post on My Sweet New Blog +date: +author: Your Name Here + +# I am On My Way To Internet Fame and Fortune! + +This is my first post on my new blog. While not super informative it +should convey my sense of excitement and eagerness to engage with you, +the reader! +``` + +The first three lines contain metadata that Pelican uses to organize things. There are lots of different metadata you can put there; again, the docs are your best bet for learning more about the options. + +Now, open the empty file **pages/about.md** and add this text: + + +``` +title: About +date: + +![So Schmexy][my_sweet_photo] + +Hi, I am and I wrote this epic collection of Interweb +wisdom. In days of yore, much of this would have been deemed sorcery +and I would probably have been burned at the stake. + +😆 + +[my_sweet_photo]: {filename}/images/HotPhotoOfMe.jpg +``` + +You now have three new pieces of web content in your content directory. Of the content branch. That's a lot of content. + +### Publish + +Don't worry; the payoff is coming! + +All that's left to do is: + + * Run Pelican to generate the static HTML files in **output** : [code]`$ pelican content -o output -s publishconf.py` +``` +* Use **ghp-import** to add the contents of the **output** directory to the **master** branch: [code]`$ ghp-import -m "Generate Pelican site" --no-jekyll -b master output` +``` + * Push the local master branch to the remote repo: [code]`$ git push origin master` +``` + * Commit and push the new content to the **content** branch: [code] $ git add content +$ git commit -m 'added a first post, a photo and an about page' +$ git push origin content +``` + + + +### OMG, I did it! + +Now the exciting part is here, when you get to view what you've published for everyone to see! Open your browser and enter: + + +``` +`https://username.github.io` +``` + +Congratulations on your new blog, self-published on GitHub! You can follow this pattern whenever you want to add more pages or articles. Happy blogging. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/run-your-blog-github-pages-python + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) +[2]: https://github.com/ +[3]: https://git-scm.com +[4]: https://help.github.com/en/categories/github-pages-basics +[5]: https://jekyllrb.com +[6]: https://python.org +[7]: https://blog.getpelican.com +[8]: https://guides.github.com/features/mastering-markdown +[9]: http://docutils.sourceforge.net/docs/user/rst/quickref.html +[10]: https://github.com/join?source=header-home +[11]: https://git-scm.com/docs +[12]: https://pip.pypa.io/en/stable/ +[13]: https://docs.getpelican.com From 10df00cab9d108538191ec52917b8dec7e16dadd Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:30:56 +0800 Subject: [PATCH 0618/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190523=20Hard?= =?UTF-8?q?ware=20bootstrapping=20with=20Ansible=20sources/tech/20190523?= =?UTF-8?q?=20Hardware=20bootstrapping=20with=20Ansible.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...523 Hardware bootstrapping with Ansible.md | 223 ++++++++++++++++++ 1 file changed, 223 insertions(+) create mode 100644 sources/tech/20190523 Hardware bootstrapping with Ansible.md diff --git a/sources/tech/20190523 Hardware bootstrapping with Ansible.md b/sources/tech/20190523 Hardware bootstrapping with Ansible.md new file mode 100644 index 0000000000..94842453cc --- /dev/null +++ b/sources/tech/20190523 Hardware bootstrapping with Ansible.md @@ -0,0 +1,223 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Hardware bootstrapping with Ansible) +[#]: via: (https://opensource.com/article/19/5/hardware-bootstrapping-ansible) +[#]: author: (Mark Phillips https://opensource.com/users/markp/users/feeble/users/markp) + +Hardware bootstrapping with Ansible +====== + +![computer servers processing data][1] + +At a recent [Ansible London Meetup][2], I got chatting with somebody about automated hardware builds. _"It's all cloud now!"_ I hear you say. Ah, but for many large organisations it's not—they still have massive data centres full of hardware. Almost regularly somebody pops up on our internal mail list and asks, *"can Ansible do hardware provisioning?" *Well yes, you can provision hardware with Ansible… + +### Requirements + +Bootstrapping hardware is mostly about network services. Before we do any operating system (OS) installing then, we must set up some services. We will need: + + * DHCP + * PXE + * TFTP + * Operating system media + * Web server + + + +### Setup + +Besides the DHCP configuration, everything else in this article is handled by the Ansible plays included in [this repository][3]. + +#### DHCP server + +I'm writing here on the assumption you can control your DHCP configuration. If you don't have access to your DHCP server, you'll need to ask the owner to set two options. DHCP option 67 needs to be set to **pxelinux.0** and **next-server** (which is option 66—but you may not need to know that; often a DHCP server will have a field/option for 'next server') needs to be set to the IP address of your TFTP server. + +If you can own the DHCP server, I'd suggest using dnsmasq. It's small and simple. I will not cover configuring it here, but look at [the man page][4] and the **\--enable-tftp** option. + +#### TFTP + +The **next-server** setting for our DHCP server, above, will point to a machine serving [TFTP][5]. Here I've used a [CentOS Linux][6] virtual machine, as it only takes one package (syslinux-tftpboot) and a service to start to have TFTP up and running. We'll stick with the default path, **/var/lib/tftpboot**. + +#### PXE + +If you're not already familiar with PXE, you might like to take a quick look at [the Wikipedia page][7]. For this article I'll keep it short—we will serve some files over TFTP, which DHCP guides our hardware to. + +You'll want **images/pxeboot/{initrd.img,vmlinuz}** from the OS distribution media for pxeboot. These need to be copied to **/var/lib/tftpboot/pxeboot**. The referenced Ansible plays **do not do this step, **so you need to copy them over yourself. + +We'll also need to serve the OS installation files. There are two approaches to this: 1) install, via HTTP, from the internet or 2) install, again via HTTP, from a local server. For my testing, since I'm on a private LAN (and I guess you are too), the fastest installation method is the second. The easiest way to prepare this is to mount the DVD image and rsync the `images`, **`Packages` **and `repodata` directories to your webserver location. The referenced Ansible plays will install **httpd** but won't copy over these files, so don't forget to do that after running [the play][8]. For this article, we'll once again stick with defaults for simplicity—so files need to be copied to Apache's standard docroot, **/var/www/html**. + +#### Directories + +We should end up with directory structures like this: + +##### PXE/TFTP + + +``` +[root@c7 ~]# tree /var/lib/tftpboot/pxe{b*,l*cfg} +/var/lib/tftpboot/pxeboot +└── 6 +├── initrd.img +└── vmlinuz +``` + +##### httpd + + +``` +[root@c7 ~]# tree -d /var/www/html/ +/var/www/html/ +├── 6 -> centos/6 +├── 7 -> centos/7 +├── centos +│ ├── 6 +│ │ └── os +│ │ └── x86_64 +│ │ ├── images +│ │ │ └── pxeboot +│ │ ├── Packages +│ │ └── repodata +│ └── 7 +│ └── os +│ └── x86_64 +│ ├── images +│ │ └── pxeboot +│ ├── Packages +│ └── repodata +└── ks +``` + +You'll notice my web setup appears a little less simple than the words above! I've pasted my actual structure to give you some ideas. The hardware I'm using is really old, and even getting CentOS 7 to work was horrible (if you're interested, it's due to the lack of [cciss][9] drivers for the HP Smart Array controller—yes, [there is an answer][10], but it takes a lot of faffing to make work), so all examples are of CentOS 6. I also wanted a flexible setup that could install many versions. Here I've done that using symlinks—this arrangement will work just fine for RHEL too, for example. The basic structure is present though—note the images, Packages and repodata directories. + +These paths relate directly to [the PXE menu][11] file we'll serve up and [the kickstart file][12] too. + +#### If you don't have DHCP + +If you can't manage your own DHCP server or the owners of your infrastructure can't help, there is another option. In the past, I've used [iPXE][13] to create a boot image that I've loaded as virtual media. A lot of out-of-band/lights-out-management (LOM) interfaces on modern hardware support this functionality. You can make a custom embedded PXE menu in seconds with iPXE. I won't cover that here, but if it turns out to be a problem for you, then drop me a line [on Twitter][14] and I'll look at doing a follow-up blog post if enough people request it. + +### Installing hardware + +We've got our structure in place now, and we can [kickstart][15] a server. Before we do, we have to add some configuration to the TFTP setup to enable a given piece of hardware to pick up the PXE boot menu. + +It's here we come across a small chicken/egg problem. We need a host's MAC address to create a link to the specific piece of hardware we want to kickstart. If the hardware is already running and we can access it with Ansible, that's great—we have a way of finding out the boot interface MAC address via the setup module (see [the reinstall play][16]). If it's a new piece of tin, however, we need to get the MAC address and tell our setup what to do with it. This probably means some manual intervention—booting the server and looking at a screen or maybe getting the MAC from a manifest or such like. Whichever way you get hold of it, we can tell our play about it via the inventory. + +Let's put a custom variable into our simple INI format [inventory file][17], but run a play to set up TFTP… + + +``` +(pip)iMac:ansible-hw-bootstrap$ ansible-inventory --host hp.box +{ +"ilo_ip": "192.168.1.68", +"ilo_password": "administrator" +} +(pip)iMac:ansible-hw-bootstrap$ ansible-playbook plays/install.yml + +PLAY [kickstart] ******************************************************************************************************* + +TASK [Host inventory entry has a MAC address] ************************************************************************** +failed: [ks.box] (item=hp.box) => { +"assertion": "hostvars[item]['mac'] is defined", +"changed": false, +"evaluated_to": false, +"item": "hp.box", +"msg": "Assertion failed" +} + +PLAY RECAP ************************************************************************************************************* +ks.box : ok=0 changed=0 unreachable=0 failed=1 +``` + +Uh oh, play failed. It [contains a check][18] that the host we're about to install actually has a MAC address added. Let's fix that and run the play again… + + +``` +(pip)iMac:ansible-hw-bootstrap$ ansible-inventory --host hp.box +{ +"ilo_ip": "192.168.1.68", +"ilo_password": "administrator", +"mac": "00:AA:BB:CC:DD:EE" +} +(pip)iMac:ansible-hw-bootstrap$ ansible-playbook plays/install.yml + +PLAY [kickstart] ******************************************************************************************************* + +TASK [Host inventory entry has a MAC address] ************************************************************************** +ok: [ks.box] => (item=hp.box) => { +"changed": false, +"item": "hp.box", +"msg": "All assertions passed" +} + +TASK [Set PXE menu to install] ***************************************************************************************** +ok: [ks.box] => (item=hp.box) + +TASK [Reboot target host for PXE boot] ********************************************************************************* +skipping: [ks.box] => (item=hp.box) + +PLAY RECAP ************************************************************************************************************* +ks.box : ok=2 changed=0 unreachable=0 failed=0 +``` + +That worked! What did it do? Looking at the pxelinux.cfg directory under our TFTP root, we can see a symlink… + + +``` +[root@c7 pxelinux.cfg]# pwd +/var/lib/tftpboot/pxelinux.cfg +[root@c7 pxelinux.cfg]# l +total 12 +drwxr-xr-x. 2 root root 65 May 13 14:23 ./ +drwxr-xr-x. 4 root root 4096 May 2 22:13 ../ +-r--r--r--. 1 root root 515 May 2 12:22 00README +lrwxrwxrwx. 1 root root 7 May 13 14:12 01-00-aa-bb-cc-dd-ee -> install +-rw-r--r--. 1 root root 682 May 2 22:07 install +``` + +The **install** file is symlinked to a file named after our MAC address. This is the key, useful piece. It will ensure our hardware with MAC address **00-aa-bb-cc-dd-ee** is served a PXE menu when it boots from its network card. + +So let's boot our machine. + +Usefully, Ansible has some [remote management modules][19]. We're working with an HP server here, so we can use the [hpilo_boot][20] module to save us from having to interact directly with the LOM web interface. + +Let's run the reinstall play on a booted server… + +The neat thing about the **hpilo_boot** module, you'll notice, is it sets the boot medium to be the network. When the installation completes, the server restarts and boots from its hard drive. The eagle-eyed amongst you will have spotted the critical problem with this—what happens if the server boots to its network card again? It will pick up the PXE menu and promptly reinstall itself. I would suggest removing the symlink as a "belt and braces" step then. I will leave that as an exercise for you, dear reader. Hint: I would make the new server do a 'phone home' on boot, to somewhere, which runs a clean-up job. Since you wouldn't need the console open, as I had here to demonstrate what's going on in the background, a 'phone home' job would also give a nice indication that the process completed. Ansible, [naturally][21]. Good luck! + +If you've any thoughts or comments on this process, please let me know. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/hardware-bootstrapping-ansible + +作者:[Mark Phillips][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/markp/users/feeble/users/markp +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/server_data_system_admin.png?itok=q6HCfNQ8 (computer servers processing data) +[2]: https://www.meetup.com/Ansible-London/ +[3]: https://github.com/phips/ansible-hw-bootstrap +[4]: http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html +[5]: https://en.m.wikipedia.org/wiki/Trivial_File_Transfer_Protocol +[6]: https://www.centos.org +[7]: https://en.m.wikipedia.org/wiki/Preboot_Execution_Environment +[8]: https://github.com/phips/ansible-hw-bootstrap/blob/master/plays/kickstart.yml +[9]: https://linux.die.net/man/4/cciss +[10]: https://serverfault.com/questions/611182/centos-7-x64-and-hp-proliant-dl360-g5-scsi-controller-compatibility +[11]: https://github.com/phips/ansible-hw-bootstrap/blob/master/roles/kickstart/templates/pxe_install.j2#L10 +[12]: https://github.com/phips/ansible-hw-bootstrap/blob/master/roles/kickstart/templates/local6.ks.j2#L3 +[13]: https://ipxe.org +[14]: https://twitter.com/thismarkp +[15]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/installation_guide/ch-kickstart2 +[16]: https://github.com/phips/ansible-hw-bootstrap/blob/master/plays/reinstall.yml +[17]: https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html +[18]: https://github.com/phips/ansible-hw-bootstrap/blob/master/plays/install.yml#L9 +[19]: https://docs.ansible.com/ansible/latest/modules/list_of_remote_management_modules.html +[20]: https://docs.ansible.com/ansible/latest/modules/hpilo_boot_module.html#hpilo-boot-module +[21]: https://github.com/phips/ansible-demos/tree/master/roles/phone_home From b3ed0b9739f1cd84b6068f6fe344105b2e5b31e6 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:31:06 +0800 Subject: [PATCH 0619/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190523=20Test?= =?UTF-8?q?ing=20a=20Go-based=20S2I=20builder=20image=20sources/tech/20190?= =?UTF-8?q?523=20Testing=20a=20Go-based=20S2I=20builder=20image.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...23 Testing a Go-based S2I builder image.md | 222 ++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 sources/tech/20190523 Testing a Go-based S2I builder image.md diff --git a/sources/tech/20190523 Testing a Go-based S2I builder image.md b/sources/tech/20190523 Testing a Go-based S2I builder image.md new file mode 100644 index 0000000000..a6facd515d --- /dev/null +++ b/sources/tech/20190523 Testing a Go-based S2I builder image.md @@ -0,0 +1,222 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Testing a Go-based S2I builder image) +[#]: via: (https://opensource.com/article/19/5/source-image-golang-part-3) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) + +Testing a Go-based S2I builder image +====== +In the third article in this series on Source-to-Image for Golang +applications, build your application image and take it out for a spin. +![gopher illustrations][1] + +In the first two articles in this series, we explored the general [requirements of a Source To Image (S2I) system][2] and [prepared an environment][3] specifically for a Go (Golang) application. Now let's give it a spin. + +### Building the builder image + +Once the Dockerfile and Source-to-Image (S2I) scripts are ready, the Golang builder image can be created with the **docker build** command: + + +``` +`docker build -t golang-builder .` +``` + +This will produce a builder image named **golang-builder** with the context of our current directory. + +### Building the application image + +The golang-builder image is not much use without an application to build. For this exercise, we will build a simple **hello-world** application. + +#### GoHelloWorld + +Let's meet our test app, [GoHelloWorld][4]. Download the latest [version of Go][5] if you want to follow along. There are two important (for this exercise) files in this repository: + + +``` +// goHelloWorld.go +package main + +import "fmt" + +func main() { +fmt.Println("Hello World!") +} +``` + +This is a very basic app, but it will work fine for testing the builder image. We also have a basic test for GoHelloWorld: + + +``` +// goHelloWorld_test.go +package main + +import "testing" + +func TestMain(t *testing.T) { +t.Log("Hello World!") +} +``` + +#### Build the application image + +Building the application image entails running the **s2i build** command with arguments for the repository containing the code to build (or **.** to build with code from the current directory), the name of the builder image to use, and the name of the resulting application image to create. + + +``` +`$ s2i build https://github.com/clcollins/goHelloWorld.git golang-builder go-hello-world` +``` + +To build from a local directory on a filesystem, replace the Git URL with a period to represent the current directory. For example: + + +``` +`$ s2i build . golang-builder go-hello-world` +``` + +_Note:_ If a Git repository is initialized in the current directory, S2I will fetch the code from the repository URL rather than using the local code. This results in local, uncommitted changes not being used when building the image (if you're unfamiliar with what I mean by "uncommitted changes," brush up on your [Git terminology over here][6]). Directories that are not Git-initialized repositories behave as expected. + +#### Run the application image + +Once the application image is built, it can be tested by running it with the **Docker** command. Source-to-Image has replaced the **CMD** in the image with the run script created earlier so it will execute the **/go/src/app/app** binary created during the build process: + + +``` +$ docker run go-hello-world +Hello World! +``` + +Success! We now have a compiled Go application inside a Docker image created by passing the contents of a Git repo to S2I and without needing a special Dockerfile for our application. + +The application image we just built includes not only the application, but also its source code, test code, the S2I scripts, Golang libraries, and _much of the Debian Linux distribution_ (because the Golang image is based on the Debian base image). The resulting image is not small: + + +``` +$ docker images | grep go-hello-world +go-hello-world latest 75a70c79a12f 4 minutes ago 789 MB +``` + +For applications written in languages that are interpreted at runtime and depend on linked libraries, like Ruby or Python, having all the source code and operating system are necessary to run. The build images will be pretty large as a result, but at least we know it will be able to run. With these languages, we could stop here with our S2I builds. + +There is the option, however, to more explicitly define the production requirements for the application. + +Since the resulting application image would be the same image that would run the production app, I want to assure the required ports, volumes, and environment variables are added to the Dockerfile for the builder image. By writing these in a declarative way, our app is closer to the [Twelve-Factor App][7] recommended practice. For example, if we were to use the builder image to create application images for a Ruby on Rails application running [Puma][8], we would want to open a port to access the webserver. We should add the line **PORT 3000** in the builder Dockerfile so it can be inherited by all the images generated from it. + +But for the Go app, we can do better. + +### Build a runtime image + +Since our builder image created a statically compiled Go binary with our application, we can create a final "runtime" image containing _only_ the binary and none of the other cruft. + +Once the application image is created, the compiled GoHelloWorld app can be extracted and put into a new, empty image using the save-artifacts script. + +#### Runtime files + +Only the application binary and a Dockerfile are required to create the runtime image. + +##### Application binary + +Inside of the application image, the save-artifacts script is written to stream a tar archive of the app binary to stdout. We can check the files included in the tar archive created by save-artifacts with the **-vt** flags for tar: + + +``` +$ docker run go-hello-world /usr/libexec/s2i/save-artifacts | tar -tvf - +-rwxr-xr-x 1001/root 1997502 2019-05-03 18:20 app +``` + +If this results in errors along the lines of "This does not appear to be a tar archive," the save-artifacts script is probably outputting other data in addition to the tar stream, as mentioned above. We must make sure to suppress all output other than the tar stream. + +If everything looks OK, we can use **save-artifacts** to copy the binary out of the application image: + + +``` +`$ docker run go-hello-world /usr/libexec/s2i/save-artifacts | tar -xf -` +``` + +This will copy the app file into the current directory, ready to be added to its own image. + +##### Dockerfile + +The Dockerfile is extremely simple, with only three lines. The **FROM scratch** source denotes that it uses an empty, blank parent image. The rest of the Dockerfile specifies copying the app binary into **/app** in the image and using that binary as the image **ENTRYPOINT** : + + +``` +FROM scratch +COPY app /app +ENTRYPOINT ["/app"] +``` + +Save this Dockerfile as **Dockerfile-runtime**. + +Why **ENTRYPOINT** and not **CMD**? We could do either, but since there is nothing else in the image (no filesystem, no shell), we couldn't run anything else anyway. + +#### Building the runtime image + +With the Dockerfile and binary ready to go, we can build the new runtime image: + + +``` +`$ docker build -f Dockerfile-runtime -t go-hello-world:slim .` +``` + +The new runtime image is considerably smaller—just 2MB! + + +``` +$ docker images | grep -e 'go-hello-world *slim' +go-hello-world slim 4bd091c43816 3 minutes ago 2 MB +``` + +We can test that it still works as expected with **docker run** : + + +``` +$ docker run go-hello-world:slim +Hello World! +``` + +### Bootstrapping s2i with s2i create + +While we hand-created all the S2I files in this example, the **s2i** command has a sub-command to help scaffold all the files we might need for a Source-to-Image build: **s2i create**. + +Using the **s2i create** command, we can generate a new project, creatively named **go-hello-world-2** in the **./ghw2** directory: + + +``` +$ s2i create go-hello-world-2 ./ghw2 +$ ls ./ghw2/ +Dockerfile Makefile README.md s2i test +``` + +The **create** sub-command creates a placeholder Dockerfile, a README.md with information about how to use Source-to-Image, some example S2I scripts, a basic test framework, and a Makefile. The Makefile is a great way to automate building and testing the Source-to-Image builder image. Out of the box, running **make** will build our image, and it can be extended to do more. For example, we could add steps to build a base application image, run tests, or generate a runtime Dockerfile. + +### Conclusion + +In this tutorial, we have learned how to use Source-to-Image to build a custom Golang builder image, create an application image using **s2i build** , and extract the application binary to create a super-slim runtime image. + +In a future extension to this series, I would like to look at how to use the builder image we created with [OKD][9] to automatically deploy our Golang apps with **buildConfigs** , **imageStreams** , and **deploymentConfigs**. Please let me know in the comments if you are interested in me continuing the series, and thanks for reading. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/source-image-golang-part-3 + +作者:[Chris Collins][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/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/go-golang.png?itok=OAW9BXny (gopher illustrations) +[2]: https://opensource.com/article/19/5/source-image-golang-part-1 +[3]: https://opensource.com/article/19/5/source-image-golang-part-2 +[4]: https://github.com/clcollins/goHelloWorld.git +[5]: https://golang.org/doc/install +[6]: /article/19/2/git-terminology +[7]: https://12factor.net/ +[8]: http://puma.io/ +[9]: https://okd.io/ From 224463e3d5fa252c55caa3da9306888e542b295e Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:31:18 +0800 Subject: [PATCH 0620/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190522=20Conv?= =?UTF-8?q?ert=20Markdown=20files=20to=20word=20processor=20docs=20using?= =?UTF-8?q?=20pandoc=20sources/tech/20190522=20Convert=20Markdown=20files?= =?UTF-8?q?=20to=20word=20processor=20docs=20using=20pandoc.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...les to word processor docs using pandoc.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20190522 Convert Markdown files to word processor docs using pandoc.md diff --git a/sources/tech/20190522 Convert Markdown files to word processor docs using pandoc.md b/sources/tech/20190522 Convert Markdown files to word processor docs using pandoc.md new file mode 100644 index 0000000000..8fab8bfcae --- /dev/null +++ b/sources/tech/20190522 Convert Markdown files to word processor docs using pandoc.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Convert Markdown files to word processor docs using pandoc) +[#]: via: (https://opensource.com/article/19/5/convert-markdown-to-word-pandoc) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt/users/jason-van-gumster/users/kikofernandez) + +Convert Markdown files to word processor docs using pandoc +====== +Living that plaintext life? Here's how to create the word processor +documents people ask for without having to work in a word processor +yourself. +![][1] + +If you live your life in [plaintext][2], there invariably comes a time when someone asks for a word processor document. I run into this issue frequently, especially at the Day JobTM. Although I've introduced one of the development teams I work with to a [Docs Like Code][3] workflow for writing and reviewing release notes, there are a small number of people who have no interest in GitHub or working with [Markdown][4]. They prefer documents formatted for a certain proprietary application. + +The good news is that you're not stuck copying and pasting unformatted text into a word processor document. Using **[pandoc][5]** , you can quickly give people what they want. Let's take a look at how to convert a document from Markdown to a word processor format in [Linux][6] using **pandoc.** ​​​​ + +Note that **pandoc** is also available for a wide variety of operating systems, ranging from two flavors of BSD ([NetBSD][7] and [FreeBSD][8]) to Chrome OS, MacOS, and Windows. + +### Converting basics + +To begin, [install **pandoc**][9] on your computer. Then, crack open a console terminal window and navigate to the directory containing the file that you want to convert. + +Type this command to create an ODT file (which you can open with a word processor like [LibreOffice Writer][10] or [AbiWord][11]): + +**pandoc -t odt filename.md -o filename.odt** + +Remember to replace **filename** with the file's actual name. And if you need to create a file for that other word processor (you know the one I mean), replace **odt** on the command line with **docx**. Here's what this article looks like when converted to an ODT file: + +![Basic conversion results with pandoc.][12] + +These results are serviceable, but a bit bland. Let's look at how to add a bit more style to the converted documents. + +### Converting with style + +**pandoc** has a nifty feature enabling you to specify a style template when converting a marked-up plaintext file to a word processor format. In this file, you can edit a small number of styles in the document, including those that control the look of paragraphs, headings, captions, titles and subtitles, a basic table, and hyperlinks. + +Let's look at the possibilities. + +#### Creating a template + +In order to style your documents, you can't just use _any_ template. You need to generate what **pandoc** calls a _reference_ template, which is the template it uses when converting text files to word processor documents. To create this file, type the following in a terminal window: + +**pandoc -o custom-reference.odt --print-default-data-file reference.odt** + +This command creates a file called **custom-reference.odt**. If you're using that other word processor, change the references to **odt** on the command line to **docx**. + +Open the template file in LibreOffice Writer, and then press **F11** to open LibreOffice Writer's **Styles** pane. Although the [pandoc manual][13] advises against making other changes to the file, I change the page size and add headers and footers when necessary. + +#### Using the template + +So, how do you use that template you just created? There are two ways to do this. + +The easiest way is to drop the template in your **/home** directory's **.pandoc** folder—you might have to create the folder first if it doesn't exist. When it's time to convert a document, **pandoc** uses this template file. See the next section on how to choose from multiple templates if you need more than one. + +The other way to use your template is to type this set of conversion options at the command line: + +**pandoc -t odt file-name.md --reference-doc=path-to-your-file/reference.odt -o file-name.odt** + +If you're wondering what a converted file looks like with a customized template, here's an example: + +![A document converted using a pandoc style template.][14] + +#### Choosing from multiple templates + +Many people only need one **pandoc** template. Some people, however, need more than one. + +At my day job, for example, I use several templates—one with a DRAFT watermark, one with a watermark stating FOR INTERNAL USE, and one for a document's final versions. Each type of document needs a different template. + +If you have similar needs, start the same way you do for a single template, by creating the file **custom-reference.odt**. Rename the resulting file—for example, to **custom-reference-draft.odt** —then open it in LibreOffice Writer and modify the styles. Repeat this process for each template you need. + +Next, copy the files into your **/home** directory. You can even put them in the **.pandoc** folder if you want to. + +To select a specific template at conversion time, you'll need to run this command in a terminal: + +**pandoc -t odt file-name.md --reference-doc=path-to-your-file/custom-template.odt -o file-name.odt** + +Change **custom-template.odt** to your template file's name. + +### Wrapping up + +To avoid having to remember a set of options I don't regularly use, I cobbled together some simple, very lame one-line scripts that encapsulate the options for each template. For example, I run the script **todraft.sh** to create a word processor document using the template with a DRAFT watermark. You might want to do the same. + +Here's an example of a script using the template containing a DRAFT watermark: + +`pandoc -t odt $1.md -o $1.odt --reference-doc=~/Documents/pandoc-templates/custom-reference-draft.odt` + +Using **pandoc** is a great way to provide documents in the format that people ask for, without having to give up the command line life. This tool doesn't just work with Markdown, either. What I've discussed in this article also allows you to create and convert documents between a wide variety of markup languages. See the **pandoc** site linked earlier for more details. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/convert-markdown-to-word-pandoc + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt/users/jason-van-gumster/users/kikofernandez +[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 +[2]: https://plaintextproject.online/ +[3]: https://www.docslikecode.com/ +[4]: https://en.wikipedia.org/wiki/Markdown +[5]: https://pandoc.org/ +[6]: /resources/linux +[7]: https://www.netbsd.org/ +[8]: https://www.freebsd.org/ +[9]: https://pandoc.org/installing.html +[10]: https://www.libreoffice.org/discover/writer/ +[11]: https://www.abisource.com/ +[12]: https://opensource.com/sites/default/files/uploads/pandoc-wp-basic-conversion_600_0.png (Basic conversion results with pandoc.) +[13]: https://pandoc.org/MANUAL.html +[14]: https://opensource.com/sites/default/files/uploads/pandoc-wp-conversion-with-tpl_600.png (A document converted using a pandoc style template.) From 314aad18840c8444a3199a75ba04d36aaa27e2a0 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:31:41 +0800 Subject: [PATCH 0621/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190523=20Cisc?= =?UTF-8?q?o=20ties=20its=20security/SD-WAN=20gear=20with=20Teridion?= =?UTF-8?q?=E2=80=99s=20cloud=20WAN=20service=20sources/talk/20190523=20Ci?= =?UTF-8?q?sco=20ties=20its=20security-SD-WAN=20gear=20with=20Teridion-s?= =?UTF-8?q?=20cloud=20WAN=20service.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... gear with Teridion-s cloud WAN service.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/talk/20190523 Cisco ties its security-SD-WAN gear with Teridion-s cloud WAN service.md diff --git a/sources/talk/20190523 Cisco ties its security-SD-WAN gear with Teridion-s cloud WAN service.md b/sources/talk/20190523 Cisco ties its security-SD-WAN gear with Teridion-s cloud WAN service.md new file mode 100644 index 0000000000..2638987b16 --- /dev/null +++ b/sources/talk/20190523 Cisco ties its security-SD-WAN gear with Teridion-s cloud WAN service.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco ties its security/SD-WAN gear with Teridion’s cloud WAN service) +[#]: via: (https://www.networkworld.com/article/3396628/cisco-ties-its-securitysd-wan-gear-with-teridions-cloud-wan-service.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco ties its security/SD-WAN gear with Teridion’s cloud WAN service +====== +An agreement links Cisco Meraki MX Security/SD-WAN appliances and its Auto VPN technology to Teridion’s cloud-based WAN service that claims to accelerate TCP-based applications by up to 5X. +![istock][1] + +Cisco and Teridion have tied the knot to deliver faster enterprise [software-defined WAN][2] services. + +The agreement links [Cisco Meraki][3] MX Security/SD-WAN appliances and its Auto [VPN][4] technology which lets users quickly bring up and configure secure sessions between branches and data centers with [Teridion’s cloud-based WAN service][5]. Teridion’s service promises customers better performance and control over traffic running from remote offices over the public internet to the [data center][6]. The service features what Teridion calls “Curated Routing” which fuses WAN acceleration techniques with route optimization to speed traffic. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][7] + * [How to pick an off-site data-backup method][8] + * [SD-Branch: What it is and why you’ll need it][9] + * [What are the options for security SD-WAN?][10] + + + +For example, Teridion says its WAN service can accelerate TCP-based applications like file transfers, backups and page loads, by as much as three to five times. + +“[The service] improves network performance for UDP based applications like voice, video, RDP, and VDI. Enterprises can get carrier grade performance over broadband and dedicated internet access. Depending on the locations of the sites, [customers] can expect to see a 15 to 30 percent reduction in latency. That’s the difference between a great quality video conference and an unworkable, choppy mess” Teridion [stated][11]. + +Teridion says the Meraki integration creates an IPSec connection from the Cisco Meraki MX to the Teridion edge. “Customers create locations in the Teridion portal and apply the preconfigured Meraki template to them, or just upload a csv file if you have a lot of locations. Then, from each Meraki MX, create a 3rd party IPSec tunnel to the Teridion edge IP addresses that are generated as part of the Teridion configuration.” + +The combined Cisco Meraki and Teridion offering brings SD-WAN and security capabilities at the WAN edge that are tightly integrated with a WAN service delivered over cost-effective broadband or dedicated Internet access, said Raviv Levi, director of product management at Cisco Meraki in a statement. “This brings better reliability and consistency to the enterprise WAN across multiple sites, as well as high performance access to all SaaS applications and cloud workloads.” + +Meraki’s MX family supports everything from SD-WAN and [Wi-Fi][12] features to next-generation [firewall][13] and intrusion prevention in a single package. + +Some studies show that by 2021 over 75 percent of enterprise traffic will be SaaS-oriented, so giving branch offices SD-WAN's reliable, secure transportation options will be a necessity, Cisco said when it [upgraded the Meraki][3] boxes last year. + +Cisco Meraki isn’t the only SD-WAN service Teridion supports. The company also has agreements Citrix, Silver Peak, VMware (VeloCloud). Teridion also has partnerships with over 25 cloud partners, including Google, Amazon Web Services and Microsoft Azure. + +[Teridion for Cisco Meraki][14] is available now from authorized Teridion resellers. Pricing starts at $50 per site per month. + +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/3396628/cisco-ties-its-securitysd-wan-gear-with-teridions-cloud-wan-service.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/istock-820219662-100749695-large.jpg +[2]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[3]: https://www.networkworld.com/article/3301169/cisco-meraki-amps-up-throughput-wi-fi-to-sd-wan-family.html +[4]: https://www.networkworld.com/article/3138952/5-things-you-need-to-know-about-virtual-private-networks.html +[5]: https://www.networkworld.com/article/3284285/teridion-enables-higher-performing-and-more-responsive-saas-applications.html +[6]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[7]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[8]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[9]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[10]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[11]: https://www.teridion.com/blog/teridion-announces-deep-integration-with-cisco-meraki-mx/ +[12]: https://www.networkworld.com/article/3318119/what-to-expect-from-wi-fi-6-in-2019.html +[13]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[14]: https://www.teridion.com/meraki +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world From e4d5626abf97e99c9593ba2b415fe134210a2fe4 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:32:11 +0800 Subject: [PATCH 0622/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190523=20Stud?= =?UTF-8?q?y:=20Most=20enterprise=20IoT=20transactions=20are=20unencrypted?= =?UTF-8?q?=20sources/talk/20190523=20Study-=20Most=20enterprise=20IoT=20t?= =?UTF-8?q?ransactions=20are=20unencrypted.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rprise IoT transactions are unencrypted.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md diff --git a/sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md b/sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md new file mode 100644 index 0000000000..51098dad33 --- /dev/null +++ b/sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Study: Most enterprise IoT transactions are unencrypted) +[#]: via: (https://www.networkworld.com/article/3396647/study-most-enterprise-iot-transactions-are-unencrypted.html) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +Study: Most enterprise IoT transactions are unencrypted +====== +A Zscaler report finds 91.5% of IoT communications within enterprises are in plaintext and so susceptible to interference. +![HYWARDS / Getty Images][1] + +Of the millions of enterprise-[IoT][2] transactions examined in a recent study, the vast majority were sent without benefit of encryption, leaving the data vulnerable to theft and tampering. + +The research by cloud-based security provider Zscaler found that about 91.5 percent of transactions by internet of things devices took place over plaintext, while 8.5 percent were encrypted with [SSL][3]. That means if attackers could intercept the unencrypted traffic, they’d be able to read it and possibly alter it, then deliver it as if it had not been changed. + +**[ For more on IoT security, see[our corporate guide to addressing IoT security concerns][4]. | Get regularly scheduled insights by [signing up for Network World newsletters][5]. ]** + +Researchers looked through one month’s worth of enterprise traffic traversing Zscaler’s cloud seeking the digital footprints of IoT devices. It found and analyzed 56 million IoT-device transactions over that time, and identified the type of devices, protocols they used, the servers they communicated with, how often communication went in and out and general IoT traffic patterns. + +The team tried to find out which devices generate the most traffic and the threats they face. It discovered that 1,015 organizations had at least one IoT device. The most common devices were set-top boxes (52 percent), then smart TVs (17 percent), wearables (8 percent), data-collection terminals (8 percent), printers (7 percent), IP cameras and phones (5 percent) and medical devices (1 percent). + +While they represented only 8 percent of the devices, data-collection terminals generated 80 percent of the traffic. + +The breakdown is that 18 percent of the IoT devices use SSL to communicate all the time, and of the remaining 82 percent, half used it part of the time and half never used it. +The study also found cases of plaintext HTTP being used to authenticate devices and to update software and firmware, as well as use of outdated crypto libraries and weak default credentials. + +While IoT devices are common in enterprises, “many of the devices are employee owned, and this is just one of the reasons they are a security concern,” the report says. Without strict policies and enforcement, these devices represent potential vulnerabilities. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][6] ]** + +Another reason employee-owned IoT devices are a concern is that many businesses don’t consider them a threat because no data is stored on them. But if the data they gather is transmitted insecurely, it is at risk. + +### 5 tips to protect enterprise IoT + +Zscaler recommends these security precautions: + + * Change default credentials to something more secure. As employees bring in devices, encourage them to use strong passwords and to keep their firmware current. + * Isolate IoT devices on networks and restrict inbound and outbound network traffic. + * Restrict access to IoT devices from external networks and block unnecessary ports from external access. + * Apply regular security and firmware updates to IoT devices, and secure network traffic. + * Deploy tools to gain visibility of shadow-IoT devices already inside the network so they can be protected. + + + +**More on IoT:** + + * [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][13] + * [Building IoT-ready networks must become a priority][14] + * [What is the Industrial IoT? [And why the stakes are so high]][15] + + + +Join the Network World communities on [Facebook][16] and [LinkedIn][17] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396647/study-most-enterprise-iot-transactions-are-unencrypted.html + +作者:[Tim Greene][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/network_security_network_traffic_scanning_by_hywards_gettyimages-673891964_2400x1600-100796830-large.jpg +[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/3045953/5-things-you-need-to-know-about-ssl.html +[4]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html +[5]: https://www.networkworld.com/newsletters/signup.html +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[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/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[14]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[15]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[16]: https://www.facebook.com/NetworkWorld/ +[17]: https://www.linkedin.com/company/network-world From 2c0761d24cdb6d652e75a35eef681be7d145b648 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:32:41 +0800 Subject: [PATCH 0623/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190523=20Onli?= =?UTF-8?q?ne=20performance=20benchmarks=20all=20companies=20should=20try?= =?UTF-8?q?=20to=20achieve=20sources/talk/20190523=20Online=20performance?= =?UTF-8?q?=20benchmarks=20all=20companies=20should=20try=20to=20achieve.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rks all companies should try to achieve.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md diff --git a/sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md b/sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md new file mode 100644 index 0000000000..829fb127f8 --- /dev/null +++ b/sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Online performance benchmarks all companies should try to achieve) +[#]: via: (https://www.networkworld.com/article/3397322/online-performance-benchmarks-all-companies-should-try-to-achieve.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +Online performance benchmarks all companies should try to achieve +====== +With digital performance more important than ever, companies must ensure their online performance meets customers’ needs. A new ThousandEyes report can help them determine that. +![Thinkstock][1] + +There's no doubt about it: We have entered the experience economy, and digital performance is more important than ever. + +Customer experience is the top brand differentiator, topping price and every other factor. And businesses that provide a poor digital experience will find customers will actively seek a competitor. In fact, recent ZK Research found that in 2018, about two-thirds of millennials changed loyalties to a brand because of a bad experience. (Note: I am an employee of ZK Research.) + +To help companies determine if their online performance is leading, lacking, or on par with some of the top companies, ThousandEyes this week released its [2019 Digital Experience Performance Benchmark Report][2]. This document provides a comparative analysis of web, infrastructure, and network performance from the top 20 U.S. digital retail, travel, and media websites. Although this is a small sampling of companies, those three industries are the most competitive when it comes to using their digital platforms for competitive advantage. The aggregated data from this report can be used as an industry-agnostic performance benchmark that all companies should strive to meet. + +**[ Read also:[IoT providers need to take responsibility for performance][3] ]** + +The methodology of the study was for ThousandEyes to use its own platform to provide an independent view of performance. It uses active monitoring and a global network of monitoring agents to measure application and network layer performance for websites, applications, and services. The company collected data from 36 major cities scattered across the U.S. Six of the locations (Ashburn, Chicago, Dallas, Los Angeles, San Jose, and Seattle) also included vantage points connected to six major broadband ISPs (AT&T, CenturyLink, Charter, Comcast, Cox, and Verizon). This acts as a good proxy for what a user would experience. + +The test involved page load tests against the websites of the major companies in retail, media, and travel and looked at several factors, including DNS response time, round-trip latency, network time (one-way latency), HTTP response time, and page load. The averages and median times can be seen in the table below. Those can be considered the average benchmarks that all companies should try to attain. + +![][4] + +### Choice of content delivery network matters by location + +ThousandEyes' report also looked at how the various services that companies use impacts web performance. For example, the study measured the performance of the content delivery network (CDN) providers in the 36 markets. It found that in Albuquerque, Akamai and Fastly had the most latency, whereas Edgecast had the least. It also found that in Boston, all of the CDN providers were close. Companies can use this type of data to help them select a CDN. Without it, decision makers are essentially guessing and hoping. + +### CDN performance is impacted by ISP + +Another useful set of data was cross-referencing CDN performance by ISP, which lead to some fascinating information. With Comcast, Akamai, Cloudfront, Google and Incapula all had high amounts of latency. Only Edgecast and Fastly offered average latency. On the other hand, all of the CDNs worked great with CenturyLink. This tells a buyer, "If my customer base is largely in Comcast’s footprint, I should look at Edgecast or Fastly or my customers will be impacted." + +### DNS and latency directly impact page load times + +The ThousandEyes study also confirmed some points that many people believe as true but until now had no quantifiable evidence to support it. For example, it's widely accepted that DNS response time and network latency to the CDN edge correlate to web performance; the data in the report now supports that belief. ThousandEyes did some regression analysis and fancy math and found that in general, companies that were in the top quartile of HTTP performance had above-average DNS response time and network performance. There were a few exceptions, but in most cases, this is true. + +Based on all the data, the below are the benchmarks for the three infrastructure metrics gathered and is what businesses, even ones outside the three verticals studied, should hope to achieve to support a high-quality digital experience. + + * DNS response time 25 ms + * Round trip network latency 15 ms + * HTTP response time 250 ms + + + +### Operations teams need to focus on digital performance + +Benchmarking certainly provides value, but the report also offers some recommendations on how operations teams can use the data to improve digital performance. Those include: + + * **Measure site from distributed user vantage points**. There is no single point that will provide a view of digital performance everywhere. Instead, measure from a range of ISPs in different regions and take a multi-layered approach to visibility (application, network and routing). + * **Use internet performance information as a baseline**. Compare your organization's data to the baselines, and if you’re not meeting it in some markets, focus on improvement there. + * **Compare performance to industry peers**. In highly competitive industries, it’s important to understand how you rank versus the competition. Don’t be satisfied with hitting the benchmarks if your key competitors exceed them. + * **Build a strong performance stack.** The data shows that solid DNS and HTTP response times and low latency are correlated to solid page load times. Focus on optimizing those factors and consider them foundational to digital performance. + + + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397322/online-performance-benchmarks-all-companies-should-try-to-achieve.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/2017/07/racing_speed_runners_internet-speed-100728363-large.jpg +[2]: https://www.thousandeyes.com/research/digital-experience +[3]: https://www.networkworld.com/article/3340318/iot-providers-need-to-take-responsibility-for-performance.html +[4]: https://images.idgesg.net/images/article/2019/05/thousandeyes-100797290-large.jpg +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From b5f76b41738dff239c92170f07a7d1e7ffafd041 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:33:01 +0800 Subject: [PATCH 0624/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190523=20Edge?= =?UTF-8?q?-based=20caching=20and=20blockchain-nodes=20speed=20up=20data?= =?UTF-8?q?=20transmission=20sources/talk/20190523=20Edge-based=20caching?= =?UTF-8?q?=20and=20blockchain-nodes=20speed=20up=20data=20transmission.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...kchain-nodes speed up data transmission.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md diff --git a/sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md b/sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md new file mode 100644 index 0000000000..54ddf76db3 --- /dev/null +++ b/sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Edge-based caching and blockchain-nodes speed up data transmission) +[#]: via: (https://www.networkworld.com/article/3397105/edge-based-caching-and-blockchain-nodes-speed-up-data-transmission.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Edge-based caching and blockchain-nodes speed up data transmission +====== +Using a combination of edge-based data caches and blockchain-like distributed networks, Bluzelle claims it can significantly speed up the delivery of data across the globe. +![OlgaSalt / /getty][1] + +The combination of a blockchain-like distributed network, along with the ability to locate data at the edge will massively speed up future networks, such as those used by the internet of things (IoT), claims Bluzelle in announcing what is says is the first decentralized data delivery network (DDN). + +Distributed DDNs will be like content delivery networks (CDNs) that now cache content around the world to speed up the web, but in this case, it will be for data, the Singapore-based company explains. Distributed key-value (blockchain) networks and edge computing built into Bluzelle's system will provide significantly faster delivery than existing caching, the company claims in a press release announcing its product. + +“The future of data delivery can only ever be de-centrally distributed,” says Pavel Bains, CEO and co-founder of Bluzelle. It’s because the world requires instant access to data that’s being created at the edge, he argues. + +“But delivery is hampered by existing technology,” he says. + +**[ Also read:[What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3]. ]** + +Bluzelle says decentralized caching is the logical next step to generalized data caching, used for reducing latency. “Decentralized caching expands the theory of caching,” the company writes in a [report][4] (Dropbox pdf) on its [website][5]. It says the cache must be expanded from simply being located at one unique location. + +“Using a combination of distributed networks, the edge and the cloud, [it’s] thereby increasing the transactional throughput of data,” the company says. + +This kind of thing is particularly important in consumer gaming now, where split-second responses from players around the world make or break a game experience, but it will likely be crucial for the IoT, higher-definition media, artificial intelligence, and virtual reality as they gain more of a role in digitization—including at critical enterprise applications. + +“Currently applications are limited to data caching technologies that require complex configuration and management of 10-plus-year-old technology constrained to a few data centers,” Bains says. “These were not designed to handle the ever-increasing volumes of data.” + +Bains says one of the key selling points of Bluzelle's network is that developers should be able to implement and run networks without having to also physically expand the networks manually. + +“Software developers don’t want to react to where their customers come from. Our architecture is designed to always have the data right where the customer is. This provides a superior consumer experience,” he says. + +Data caches are around now, but Bluzelle claims its system, written in C++ and available on Linux and Docker containers, among other platforms, is faster than others. It further says that if its system and a more traditional cache would connect to the same MySQL database in Virginia, say, their users will get the data three to 16 times faster than a traditional “non-edge-caching” network. Write updates to all Bluzelle nodes around the world takes 875 milliseconds (ms), it says. + +The company has been concentrating its efforts on gaming, and with a test setup in Virginia, it says it was able to deliver data 33 times faster—at 22ms to Singapore—than a normal, cloud-based data cache. That traditional cache (located near the database) took 727ms in the Bluzelle-published test. In a test to Ireland, it claims 16ms over 223ms using a traditional cache. + +An algorithm is partly the reason for the gains, the company explains. It “allows the nodes to make decisions and take actions without the need for masternodes,” the company says. Masternodes are the server-like parts of blockchain systems. + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][3] + * [Edge computing best practices][6] + * [How edge computing can help secure the IoT][7] + + + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397105/edge-based-caching-and-blockchain-nodes-speed-up-data-transmission.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.idgesg.net/images/article/2019/02/blockchain_crypotocurrency_bitcoin-by-olgasalt-getty-100787949-large.jpg +[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://www.dropbox.com/sh/go5bnhdproy1sk5/AAC5MDoafopFS7lXUnmiLAEFa?dl=0&preview=Bluzelle+Report+-+The+Decentralized+Internet+Is+Here.pdf +[5]: https://bluzelle.com/ +[6]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[7]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From dcfa2a3f103271205e09c54b50d131e3b1f4d277 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:33:17 +0800 Subject: [PATCH 0625/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190523=20Benc?= =?UTF-8?q?hmarks=20of=20forthcoming=20Epyc=202=20processor=20leaked=20sou?= =?UTF-8?q?rces/talk/20190523=20Benchmarks=20of=20forthcoming=20Epyc=202?= =?UTF-8?q?=20processor=20leaked.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... of forthcoming Epyc 2 processor leaked.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md diff --git a/sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md b/sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md new file mode 100644 index 0000000000..61ae9e656b --- /dev/null +++ b/sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md @@ -0,0 +1,55 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Benchmarks of forthcoming Epyc 2 processor leaked) +[#]: via: (https://www.networkworld.com/article/3397081/benchmarks-of-forthcoming-epyc-2-processor-leaked.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Benchmarks of forthcoming Epyc 2 processor leaked +====== +Benchmarks of AMD's second-generation Epyc server briefly found their way online and show the chip is larger but a little slower than the Epyc 7601 on the market now. +![Gordon Mah Ung][1] + +Benchmarks of engineering samples of AMD's second-generation Epyc server, code-named “Rome,” briefly found their way online and show a very beefy chip running a little slower than its predecessor. + +Rome is based on the Zen 2 architecture, believed to be more of an incremental improvement over the prior generation than a major leap. It’s already known that Rome would feature a 64-core, 128-thread design, but that was about all of the details. + +**[ Also read:[Who's developing quantum computers][2] ]** + +The details came courtesy of SiSoftware's Sandra PC analysis and benchmarking tool. It’s very popular and has been used by hobbyists and benchmarkers alike for more than 20 years. New benchmarks are uploaded to the Sandra database all the time, and what I suspect happened is someone running a Rome sample ran the benchmark, not realizing the results would be uploaded to the Sandra database. + +The benchmarks were from two different servers, a Dell PowerEdge R7515 and a Super Micro Super Server. The Dell product number is not on the market, so this would indicate a future server with Rome processors. The entry has since been deleted, but several sites, including the hobbyist site Tom’s Hardware Guide, managed to [take a screenshot][3]. + +According to the entry, the chip is a mid-range processor with a base clock speed of 1.4GHz, jumping up to 2.2GHz in turbo mode, with 16MB of Level 2 cache and 256MB of Level 3 cache, the latter of which is crazy. The first-generation Epyc had just 32MB of L3 cache. + +That’s a little slower than the Epyc 7601 on the market now, but when you double the number of cores in the same space, something’s gotta give, and in this case, it’s electricity. The thermal envelope was not revealed by the benchmark. Previous Epyc processors ranged from 120 watts to 180 watts. + +Sandra ranked the processor at #3 for arithmetic and #5 for multimedia processing, which makes me wonder what on Earth beat the Rome chip. Interestingly, the servers were running Windows 10, not Windows Server 2019. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][4] ]** + +Rome is expected to be officially launched at the massive Computex trade show in Taiwan on May 27 and will begin shipping in the third quarter of the year. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397081/benchmarks-of-forthcoming-epyc-2-processor-leaked.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/11/rome_2-100779395-large.jpg +[2]: https://www.networkworld.com/article/3275385/who-s-developing-quantum-computers.html +[3]: https://www.tomshardware.co.uk/amd-epyc-rome-processor-data-center,news-60265.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 6d94c478aeaa275734d95a520e21da18fdb315dd Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:33:45 +0800 Subject: [PATCH 0626/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190522=20Expe?= =?UTF-8?q?rts:=20Enterprise=20IoT=20enters=20the=20mass-adoption=20phase?= =?UTF-8?q?=20sources/talk/20190522=20Experts-=20Enterprise=20IoT=20enters?= =?UTF-8?q?=20the=20mass-adoption=20phase.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rise IoT enters the mass-adoption phase.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md diff --git a/sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md b/sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md new file mode 100644 index 0000000000..86d7bf0efe --- /dev/null +++ b/sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Experts: Enterprise IoT enters the mass-adoption phase) +[#]: via: (https://www.networkworld.com/article/3397317/experts-enterprise-iot-enters-the-mass-adoption-phase.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Experts: Enterprise IoT enters the mass-adoption phase +====== +Dropping hardware prices, 5G boost business internet-of-things deployments; technical complexity encourages partnerships. +![Avgust01 / Getty Images][1] + +[IoT][2] in general has taken off quickly over the past few years, but experts at the recent IoT World highlighted that the enterprise part of the market has been particularly robust of late – it’s not just an explosion of connected home gadgets anymore. + +Donna Moore, chairwoman of the LoRa Alliance, an industry group that works to develop and scale low-power WAN technology for mass usage, said on a panel that she’s never seen growth this fast in the sector. “I’d say we’re now in the early mass adopters [stage],” she said. + +**More on IoT:** + + * [Most powerful Internet of Things companies][3] + * [10 Hot IoT startups to watch][4] + * [The 6 ways to make money in IoT][5] + * [What is digital twin technology? [and why it matters]][6] + * [Blockchain, service-centric networking key to IoT success][7] + * [Getting grounded in IoT networking and security][8] + * [Building IoT-ready networks must become a priority][9] + * [What is the Industrial IoT? [And why the stakes are so high]][10] + + + +The technology itself has pushed adoption to these heights, said Graham Trickey, head of IoT for the GSMA, a trade organization for mobile network operators. Along with price drops for wireless connectivity modules, the array of upcoming technologies nestling under the umbrella label of [5G][11] could simplify the process of connecting devices to [edge-computing][12] hardware – and the edge to the cloud or [data center][13]. + +“Mobile operators are not just providers of connectivity now, they’re farther up the stack,” he said. Technologies like narrow-band IoT and support for highly demanding applications like telehealth are all set to be part of the final 5G spec. + +### Partnerships needed to deal with IoT complexity** + +** + +That’s not to imply that there aren’t still huge tasks facing both companies trying to implement their own IoT frameworks and the creators of the technology underpinning them. For one thing, IoT tech requires a huge array of different sets of specialized knowledge. + +“That means partnerships, because you need an expert in your [vertical] area to know what you’re looking for, you need an expert in communications, and you might need a systems integrator,” said Trickey. + +Phil Beecher, the president and CEO of the Wi-SUN Alliance (the acronym stands for Smart Ubiquitous Networks, and the group is heavily focused on IoT for the utility sector), concurred with that, arguing that broad ecosystems of different technologies and different partners would be needed. “There’s no one technology that’s going to solve all these problems, no matter how much some parties might push it,” he said. + +One of the central problems – [IoT security][14] – is particularly dear to Beecher’s heart, given the consequences of successful hacks of the electrical grid or other utilities. More than one panelist praised the passage of the EU’s General Data Protection Regulation, saying that it offered concrete guidelines for entities developing IoT tech – a crucial consideration for some companies that may not have a lot of in-house expertise in that area. + +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/3397317/experts-enterprise-iot-enters-the-mass-adoption-phase.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/iot_internet_of_things_mobile_connections_by_avgust01_gettyimages-1055659210_2400x1600-100788447-large.jpg +[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[4]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[5]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[6]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[7]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[8]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[9]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[10]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[11]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[12]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html?nsdr=true +[13]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[14]: https://www.networkworld.com/article/3269736/getting-grounded-in-iot-networking-and-security.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world From 3158ae0c2f248a3ab7c3fe4808bfaedfde364c89 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:33:59 +0800 Subject: [PATCH 0627/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190522=20Fren?= =?UTF-8?q?ch=20IT=20giant=20Atos=20enters=20the=20edge-computing=20busine?= =?UTF-8?q?ss=20sources/talk/20190522=20French=20IT=20giant=20Atos=20enter?= =?UTF-8?q?s=20the=20edge-computing=20business.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Atos enters the edge-computing business.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/talk/20190522 French IT giant Atos enters the edge-computing business.md diff --git a/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md b/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md new file mode 100644 index 0000000000..def37a0025 --- /dev/null +++ b/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (French IT giant Atos enters the edge-computing business) +[#]: via: (https://www.networkworld.com/article/3397139/atos-is-the-latest-to-enter-the-edge-computing-business.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +French IT giant Atos enters the edge-computing business +====== +Atos takes a different approach to edge computing with a device called BullSequana Edge that's the size of a suitcase. +![iStock][1] + +French IT giant Atos is the latest to jump into the edge computing business with a small device called BullSequana Edge. Unlike devices from its competitors that are the size of a shipping container, including those from Vapor IO and Schneider Electronics, Atos' edge device can sit in a closet. + +Atos says the device uses artificial intelligence (AI) applications to offer fast response times that are needed in areas such as manufacturing 4.0, autonomous vehicles, healthcare and retail/airport security – where data needs to be processed and analyzed at the edge in real time. + +**[ Also see:[What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3].]** + +The BullSequana Edge can be purchased as standalone infrastructure or bundled with Atos’ software edge software, and that software is pretty impressive. Atos says the BullSequana Edge supports three main categories of use cases: + + * AI: Atos Edge Computer Vision software for surveillance cameras provide advanced extraction and analysis of features such as people, faces, emotions, and behaviors so that automatic actions can be carried out based on that analysis. + * Big data: Atos Edge Data Analytics enables organizations to improve their business models with predictive and prescriptive solutions. It utilizes data lake capabilities to make data trustworthy and useable. + * Containers: Atos Edge Data Container (EDC) is an all-in-one container solution that is ready to run at the edge and serves as a decentralized IT system that can run autonomously in non-data center environments with no need for local on-site operation. + + + +Because of its small size, the BullSequana Edge doesn’t pack a lot of processing power. It comes with a 16-core Intel Xeon CPU and can hold up to two Nvidia Tesla T4 GPUs or optional FPGAs. Atos says that is enough to handle the inference of complex AI models with low latency at the edge. + +Because it handles sensitive data, BullSequana Edge also comes with an intrusion sensor that will disable the machine in case of physical attacks. + +Most edge devices are placed near cell towers, but since the edge system can be placed anywhere, it can communicate via radio, Global System for Mobile Communications (GSM), or Wi-Fi. + +Atos may not be a household name in the U.S., but it’s on par with IBM in Europe, having acquired IT giants Bull SA, Xerox IT Outsourcing, and Siemens IT all in this past decade. + +**More about edge networking:** + + * [How edge networking and IoT will reshape data centers][3] + * [Edge computing best practices][4] + * [How edge computing can help secure the IoT][5] + + + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397139/atos-is-the-latest-to-enter-the-edge-computing-business.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/01/huawei-18501-edge-gartner-100786331-large.jpg +[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[5]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 2642601e01f92a39a44d82ad83e48b3f9b953bfa Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:34:22 +0800 Subject: [PATCH 0628/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190522=20The?= =?UTF-8?q?=20Traffic=20Jam=20Whopper=20project=20may=20be=20the=20coolest?= =?UTF-8?q?/dumbest=20IoT=20idea=20ever=20sources/talk/20190522=20The=20Tr?= =?UTF-8?q?affic=20Jam=20Whopper=20project=20may=20be=20the=20coolest-dumb?= =?UTF-8?q?est=20IoT=20idea=20ever.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ay be the coolest-dumbest IoT idea ever.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md diff --git a/sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md b/sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md new file mode 100644 index 0000000000..be8a4833cc --- /dev/null +++ b/sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Traffic Jam Whopper project may be the coolest/dumbest IoT idea ever) +[#]: via: (https://www.networkworld.com/article/3396188/the-traffic-jam-whopper-project-may-be-the-coolestdumbest-iot-idea-ever.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +The Traffic Jam Whopper project may be the coolest/dumbest IoT idea ever +====== +Burger King uses real-time IoT data to deliver burgers to drivers stuck in traffic — and it seems to be working. +![Mike Mozart \(CC BY 2.0\)][1] + +People love to eat in their cars. That’s why we invented the drive-in and the drive-thru. + +But despite a fast-food outlet on the corner of every major intersection, it turns out we were only scratching the surface of this idea. Burger King is taking this concept to the next logical step with its new IoT-powered Traffic Jam Whopper project. + +I have to admit, when I first heard about this, I thought it was a joke, but apparently the [Traffic Jam Whopper project is totally real][2] and has already passed a month-long test in Mexico City. While the company hasn’t specified a timeline, it plans to roll out the Traffic Jam Whopper project in Los Angeles (where else?) and other traffic-plagued megacities such as São Paulo and Shanghai. + +**[ Also read:[Is IoT in the enterprise about making money or saving money?][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** + +### How Burger King's Traffic Jam Whopper project works + +According to [Nations Restaurant News][5], this is how Burger King's Traffic Jam Whopper project works: + +The project uses real-time data to target hungry drivers along congested roads and highways for food delivery by couriers on motorcycles. + +The system leverages push notifications to the Burger King app and personalized messaging on digital billboards positioned along busy roads close to a Burger King restaurant. + +[According to the We Believers agency][6] that put it all together, “By leveraging traffic and drivers’ real-time data [location and speed], we adjusted our billboards’ location and content, displaying information about the remaining time in traffic to order, and personalized updates about deliveries in progress.” The menu is limited to Whopper Combos to speed preparation (though the company plans to offer a wider menu as it works out the kinks). + +**[[Become a Microsoft Office 365 administrator in record time with this quick start course from PluralSight.][7] ]** + +The company said orders in Mexico City were delivered in an average of 15 minutes. Fortunately (or unfortunately, depending on how you look at it) many traffic jams hold drivers captive for far longer than that. + +Once the order is ready, the motorcyclist uses Google maps and GPS technology embedded into the app to locate the car that made the order. The delivery person then weaves through traffic to hand over the Whopper. (Lane-splitting is legal in California, but I have no idea if there are other potential safety or law-enforcement issues involved here. For drivers ordering burgers, at least, the Burger King app supports voice ordering. I also don’t know what happens if traffic somehow clears up before the burger arrives.) + +Here’s a video of the pilot program in Mexico City: + +#### **New technology = > new opportunities** + +Even more amazing, this is not _just_ a publicity stunt. NRN quotes Bruno Cardinali, head of marketing for Burger King Latin America and Caribbean, claiming the project boosted sales during rush hour, when app orders are normally slow: + +“Thanks to The Traffic Jam Whopper campaign, we’ve increased deliveries by 63% in selected locations across the month of April, adding a significant amount of orders per restaurant per day, just during rush hours." + +If nothing else, this project shows that creative thinking really can leverage IoT technology into new businesses. In this case, it’s turning notoriously bad traffic—pretty much required for this process to work—from a problem into an opportunity to generate additional sales during slow periods. + +**More on IoT:** + + * [What is the IoT? How the internet of things works][8] + * [What is edge computing and how it’s changing the network][9] + * [Most powerful Internet of Things companies][10] + * [10 Hot IoT startups to watch][11] + * [The 6 ways to make money in IoT][12] + * [What is digital twin technology? [and why it matters]][13] + * [Blockchain, service-centric networking key to IoT success][14] + * [Getting grounded in IoT networking and security][15] + * [Building IoT-ready networks must become a priority][16] + * [What is the Industrial IoT? [And why the stakes are so high]][17] + + + +Join the Network World communities on [Facebook][18] and [LinkedIn][19] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396188/the-traffic-jam-whopper-project-may-be-the-coolestdumbest-iot-idea-ever.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/burger-king-gift-card-100797164-large.jpg +[2]: https://abc7news.com/food/burger-king-to-deliver-to-drivers-stuck-in-traffic/5299073/ +[3]: https://www.networkworld.com/article/3343917/the-big-picture-is-iot-in-the-enterprise-about-making-money-or-saving-money.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.nrn.com/technology/tech-tracker-burger-king-deliver-la-motorists-stuck-traffic?cid= +[6]: https://www.youtube.com/watch?v=LXNgEZV7lNg +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fadministering-office-365-quick-start +[8]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[9]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[10]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[11]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[12]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[13]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[14]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[15]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[16]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[17]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[18]: https://www.facebook.com/NetworkWorld/ +[19]: https://www.linkedin.com/company/network-world From 4925b0d9146b9c0619f6cd6c97d8ab7ad7e8499a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:34:53 +0800 Subject: [PATCH 0629/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190521=20Ente?= =?UTF-8?q?rprise=20IoT:=20Companies=20want=20solutions=20in=20these=204?= =?UTF-8?q?=20areas=20sources/talk/20190521=20Enterprise=20IoT-=20Companie?= =?UTF-8?q?s=20want=20solutions=20in=20these=204=20areas.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...mpanies want solutions in these 4 areas.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md diff --git a/sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md b/sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md new file mode 100644 index 0000000000..9df4495f05 --- /dev/null +++ b/sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Enterprise IoT: Companies want solutions in these 4 areas) +[#]: via: (https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Enterprise IoT: Companies want solutions in these 4 areas +====== +Based on customer pain points, PwC identified four areas companies are seeking enterprise solutions for, including energy use and sustainability. +![Jackie Niam / Getty Images][1] + +Internet of things (IoT) vendors and pundits like to crow about the billions and billions of connected devices that make the IoT so ubiquitous and powerful. But how much of that installed base is really relevant to the enterprise? + +To find out, I traded emails with Rob Mesirow, principal at [PwC’s Connected Solutions][2], the firm’s new one-stop-shop of IoT solutions, who suggests that consumer adoption may not paint a true picture of the enterprise opportunities. If you remove the health trackers and the smart thermostats from the market, he suggested, there are very few connected devices left. + +So, I wondered, what is actually happening on the enterprise side of IoT? What kinds of devices are we talking about, and in what kinds of numbers? + +**[ Read also:[Forget 'smart homes,' the new goal is 'autonomous buildings'][3] ]** + +“When people talk about the IoT,” Mesirow told me, “they usually focus on [consumer devices, which far outnumber business devices][4]. Yet [connected buildings currently represent only 12% of global IoT projects][5],” he noted, “and that’s without including wearables and smart home projects.” (Mesirow is talking about buildings that “use various IoT devices, including occupancy sensors that determine when people are present in a room in order to keep lighting and temperature controls at optimal levels, lowering energy costs and aiding sustainability goals. Sensors can also detect water and gas leaks and aid in predictive maintenance for HVAC systems.”) + +### 4 key enterprise IoT opportunities + +More specifically, based on customer pain points, PwC’s Connected Solutions is focusing on a few key opportunities, which Mesirow laid out in a [blog post][6] earlier this year. (Not surprisingly, the opportunities seem tied to [the group’s products][7].) + +“A lot of these solutions came directly from our customers’ request,” he noted. “We pre-qualify our solutions with customers before we build them.” + +Let’s take a look at the top four areas, along with a quick reality check on how important they are and whether the technology is ready for prime time. + +#### **1\. Energy use and sustainability** + +The IoT makes it possible to manage buildings and spaces more efficiently, with savings of 25% or more. Occupancy sensors can tell whether anyone is actually in a room, adjusting lighting and temperature to saving money and conserve energy. + +Connected buildings can also help determine when meeting spaces are available, which can boost occupancy at large businesses and universities by 40% while cutting infrastructure and maintenance costs. Other sensors, meanwhile, can detect water and gas leaks and aid in predictive maintenance for HVAC systems. + +**Reality check:** Obviously, much of this technology is not new, but there’s a real opportunity to make it work better by integrating disparate systems and adding better analytics to the data to make planning more effective. + +#### **2. Asset tracking + +** + +“Businesses can also use the IoT to track their assets,“ Mesirow told me, “which can range from trucks to hotel luggage carts to medical equipment. It can even assist with monitoring trash by alerting appropriate people when dumpsters need to be emptied.” + +Asset trackers can instantly identify the location of all kinds of equipment (saving employee time and productivity), and they can reduce the number of lost, stolen, and misplaced devices and machines as well as provide complete visibility into the location of your assets. + +Such trackers can also save employees from wasting time hunting down the devices and machines they need. For example, PwC noted that during an average hospital shift, more than one-third of nurses spend at least an hour looking for equipment such as blood pressure monitors and insulin pumps. Just as important, location tracking often improves asset optimization, reduced inventory needs, and improved customer experience. + +**Reality check:** Asset tracking offers clear value. The real question is whether a given use case is cost effective or not, as well as how the data gathered will actually be used. Too often, companies spend a lot of money and effort tracking their assets, but don’t do much with the information. + +#### **3\. Security and compliance** + +Connected solutions can create better working environments, Mesirow said. “In a hotel, for example, these smart devices can ensure that air and water quality is up to standards, provide automated pest traps, monitor dumpsters and recycling bins, detect trespassers, determine when someone needs assistance, or discover activity in an unauthorized area. Monitoring the water quality of hotel swimming pools can lower chemical and filtering costs,” he said. + +Mesirow cited an innovative use case where, in response to workers’ complaints about harassment, hotel operators—in conjunction with the [American Hotel and Lodging Association][8]—are giving their employees portable devices that alert security staff when workers request assistance. + +**Reality check:** This seems useful, but the ROI might be difficult to calculate. + +#### **4\. Customer experience** + +According to PwC, “Sensors, facial recognition, analytics, dashboards, and notifications can elevate and even transform the customer experience. … Using connected solutions, you can identify and reward your best customers by offering perks, reduced wait times, and/or shorter lines.” + +Those kinds of personalized customer experiences can potentially boost customer loyalty and increase revenue, Mesirow said, adding that the technology can also make staff deployments more efficient and “enhance safety by identifying trespassers and criminals who are tampering with company property.” + +**Reality check:** Creating a great customer experience is critical for businesses today, and this kind of personalized targeting promises to make it more efficient and effective. However, it has to be done in a way that makes customers comfortable and not creeped out. Privacy concerns are very real, especially when it comes to working with facial recognition and other kinds of surveillance technology. For example, [San Francisco recently banned city agencies from using facial recognition][9], and others may follow. + +**More on IoT:** + + * [What is the IoT? How the internet of things works][10] + * [What is edge computing and how it’s changing the network][11] + * [Most powerful Internet of Things companies][12] + * [10 Hot IoT startups to watch][13] + * [The 6 ways to make money in IoT][14] + * [What is digital twin technology? [and why it matters]][15] + * [Blockchain, service-centric networking key to IoT success][16] + * [Getting grounded in IoT networking and security][17] + * [Building IoT-ready networks must become a priority][18] + * [What is the Industrial IoT? [And why the stakes are so high]][19] + + + +Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/iot_internet_of_things_by_jackie_niam_gettyimages-996958260_2400x1600-100788446-large.jpg +[2]: https://digital.pwc.com/content/pwc-digital/en/products/connected-solutions.html#get-connected +[3]: https://www.networkworld.com/article/3309420/forget-smart-homes-the-new-goal-is-autonomous-buildings.html +[4]: https://www.statista.com/statistics/370350/internet-of-things-installed-base-by-category/) +[5]: https://iot-analytics.com/top-10-iot-segments-2018-real-iot-projects/ +[6]: https://www.digitalpulse.pwc.com.au/five-unexpected-ways-internet-of-things/ +[7]: https://digital.pwc.com/content/pwc-digital/en/products/connected-solutions.html +[8]: https://www.ahla.com/ +[9]: https://www.nytimes.com/2019/05/14/us/facial-recognition-ban-san-francisco.html +[10]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[11]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[12]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[13]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[14]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[15]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[16]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[17]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[18]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[19]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[20]: https://www.facebook.com/NetworkWorld/ +[21]: https://www.linkedin.com/company/network-world From d1d93d7634f5c088dbd29dd65cde8b5f5c192845 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:35:07 +0800 Subject: [PATCH 0630/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190520=20When?= =?UTF-8?q?=20IoT=20systems=20fail:=20The=20risk=20of=20having=20bad=20IoT?= =?UTF-8?q?=20data=20sources/talk/20190520=20When=20IoT=20systems=20fail-?= =?UTF-8?q?=20The=20risk=20of=20having=20bad=20IoT=20data.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s fail- The risk of having bad IoT data.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md diff --git a/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md b/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md new file mode 100644 index 0000000000..0aeaa32a36 --- /dev/null +++ b/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When IoT systems fail: The risk of having bad IoT data) +[#]: via: (https://www.networkworld.com/article/3396230/when-iot-systems-fail-the-risk-of-having-bad-iot-data.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +When IoT systems fail: The risk of having bad IoT data +====== +As the use of internet of things (IoT) devices grows, the data they generate can lead to significant savings for consumers and new opportunities for businesses. But what happens when errors inevitably crop up? +![Oonal / Getty Images][1] + +No matter what numbers you look at, it’s clear that the internet of things (IoT) continues to worm its way into more and more areas of personal and private life. That growth brings many benefits, but it also poses new risks. A big question is who takes responsibility when things go wrong. + +Perhaps the biggest issue surrounds the use of IoT-generated data to personalize the offering and pricing of various products and services. [Insurance companies have long struggled with how best to use IoT data][2], but last year I wrote about how IoT sensors are beginning to be used to help home insurers reduce water damage losses. And some companies are looking into the potential for insurers to bid for consumers: business based on the risks (or lack thereof) revealed by their smart-home data. + +But some of the biggest progress has come in the area of automobile insurance, where many automobile insurers already let customers install tracking devices in their cars in exchange for discounts for demonstrating safe-driving habits. + +**[ Also read:[Finally, a smart way for insurers to leverage IoT in smart homes][3] ]** + +### **The rise of usage-based insurance** + +Called usage-based insurance (UBI), this “pay-as-you-drive” approach tracks speed, location, and other factors to assess risk and calculate auto insurance premiums. An estimated [50 million U.S. drivers][4] will have enrolled in UBI programs by 2020. + +Not surprisingly, insurers love UBI because it helps them calculate their risks more precisely. In fact, [AIG Ireland is trying to get the country to require UBI for drivers under 25][5]. And demonstrably safe drivers are also often happy save some money. There has been pushback, of course, mostly from privacy advocates and groups who might have to pay more under this model. + +### **What happens when something goes wrong?** + +But there’s another, more worrisome, potential issue: What happens when the data provided by the IoT device is wrong or gets garbled somewhere along the way? Because despite all the automation, error-checking, and so on, occasional errors inevitably slip through the cracks. + +Unfortunately, this isn’t just an academic concern that might someday accidentally cost some careful drivers a few extra bucks on their insurance. It’s already a real-world problem with serious consequences. And just like [the insurance industry still hasn’t figured out who should “own” data generated by customer-facing IoT devices][6], it’s not clear who would take responsibility for dealing with problems with that data. + +Though not strictly an IoT issue, computer “glitches” allegedly led to Hertz rental cars erroneously being reported stolen and innocent renters being arrested and detained. The result? Criminal charges, years of litigation, and finger pointing. Lots and lots of finger pointing. + +With that in mind, it’s easy to imagine, for example, an IoT sensor getting confused and indicating that a car was speeding even while safely under the speed limit. Think of the hassles of trying to fight _that_ in court, or arguing with your insurance company over it. + +(Of course, there’s also the flip side of this problem: Consumers may find ways to hack the data shared by their IoT devices to fraudulently qualify for lower rates or deflect blame for an incident. There’s no real plan in place to deal with _that_ , either.) + +### **Studying the need for government regulation** + +Given the potential impacts of these issues, and the apparent lack of interest in dealing with them from the many companies involved, it seems legitimate to wonder if government intervention is warranted. + +That could be one motivation behind the [reintroduction of the SMART (State of Modern Application, Research, and Trends of) IoT Act][7] by Rep. Bob Latta (R-Ohio). [The bill][8], stemming from a bipartisan IoT working group helmed by Latta and Rep. Peter Welch (D-Vt.), passed the House last fall but failed in the Senate. It would require the Commerce Department to study the state of the IoT industry and report back to the House Energy & Commerce and Senate Commerce Committee in two years. + +In a statement, Latta said, “With a projected economic impact in the trillions of dollars, we need to look at the policies, opportunities, and challenges that IoT presents. The SMART IoT Act will make it easier to understand what the government is doing on IoT policy, what it can do better, and how federal policies can impact the research and discovery of cutting-edge technologies.” + +The research is welcome, but the bill may not even pass. Even it does, with its two-year wait time, the IoT will likely evolve too fast for the government to keep up. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396230/when-iot-systems-fail-the-risk-of-having-bad-iot-data.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/08/cloud_connected_smart_cars_by_oonal_gettyimages-692819426_1200x800-100767788-large.jpg +[2]: https://www.networkworld.com/article/3264655/most-insurance-carriers-not-ready-to-use-iot-data.html +[3]: https://www.networkworld.com/article/3296706/finally-a-smart-way-for-insurers-to-leverage-iot-in-smart-homes.html +[4]: https://www.businessinsider.com/iot-is-changing-the-auto-insurance-industry-2015-8 +[5]: https://www.iotforall.com/iot-data-is-disrupting-the-insurance-industry/ +[6]: https://www.sas.com/en_us/insights/articles/big-data/5-challenges-for-iot-in-insurance-industry.html +[7]: https://www.multichannel.com/news/latta-re-ups-smart-iot-act +[8]: https://latta.house.gov/uploadedfiles/smart_iot_116th.pdf +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 3c744fc34a7c253ada8ba8adfa657d8842b7b9a4 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:42:57 +0800 Subject: [PATCH 0631/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190527=20Dock?= =?UTF-8?q?ly=20=E2=80=93=20Manage=20Docker=20Containers=20From=20Terminal?= =?UTF-8?q?=20sources/tech/20190527=20Dockly=20-=20Manage=20Docker=20Conta?= =?UTF-8?q?iners=20From=20Terminal.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Manage Docker Containers From Terminal.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md diff --git a/sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md b/sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md new file mode 100644 index 0000000000..9c5bf68840 --- /dev/null +++ b/sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Dockly – Manage Docker Containers From Terminal) +[#]: via: (https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Dockly – Manage Docker Containers From Terminal +====== + +![][1] + +A few days ago, we published a guide which covered almost all details you ever need to know to [**getting started with Docker**][2]. In that guide, we have shown you how to create and manage Docker containers in detail. There are also some non-official tools available for managing Docker containers. If you’ve looked at our old archives, you might have stumbled upon two web-based tools namely [**“Portainer”**][3] and [**“PiCluster”**][4]. Both of them makes the Docker management task much easier and simpler from a web browser. Today, I came across yet another Docker management tool named **“Dockly”**. + +Unlike the aforementioned tools, Dockly is a TUI (text user interface) utility to manage Docker containers and services from the Terminal in Unix-like systems. It is free, open source tool built with **NodeJS**. In this brief guide, we will see how to install Dockly and how to manage Docker containers from command line. + +### Installing Dockly + +Make sure you have installed NodeJS on your Linux box. If you haven’t installed it yet, refer the following guide. + + * [**How To Install NodeJS On Linux**][5] + + + +Once NodeJS is installed, run the following command to install Dockly: + +``` +# npm install -g dockly +``` + +### Manage Docker Containers With Dockly From Terminal + +Managing Docker containers with Dockly is easy! All you have to do is to open the terminal and run the following command: + +``` +# dockly +``` + +Dockly will will automatically connect to your localhost docker daemon through the unix socket and display the list of running containers in the Terminal as shown below. + +![][6] + +Manage Docker Containers Using Dockly + +As you can see in the above screenshot, Dockly displays the following information of running containers on the top: + + * Container ID, + * Name of the container(s), + * Docker image, + * Command, + * State of the running container(s), + * Status. + + + +On the top right side, you will see the CPU an Memory utilization of containers. Use UP/DOWN arrow keys to move between Containers. + +At the bottom, there are few keyboard shortcut keys to do various docker management tasks. Here are the list of currently available keyboard shortcuts: + + * **=** – Refresh the Dockly interface, + * **/** – Search the containers list view, + * **i** – Display the information about the currently selected container or service, + * **< RETURN>** – Show logs of the current container or service, + * **v** – Toggle between Containers and Services view, + * **l** – Launch a /bin/bash session on the selected Container, + * **r** – Restart the selected Container, + * **s** – Stop the selected Container, + * **h** – Show HELP window, + * **q** – Quit Dockly. + + + +##### **Viewing information of a container** + +Choose a Container using UP/DOWN arrow and press **“i”** to display the information of the selected Container. + +![][7] + +View container’s information + +##### Restart Containers + +If you want to restart your Containers at any time, just choose it and press **“r”** to restart. + +![][8] + +Restart Docker containers + +##### Stop/Remove Containers and Images + +We can stop and/or remove one or all containers at once if they are no longer required. To do so, press **“m”** to open **Menu**. + +![][9] + +Stop, remove Docker containers and images + +From here, you can do the following operations. + + * Stop all Docker containers, + * Remove selected container, + * Remove all containers, + * Remove all Docker images etc. + + + +##### Display Dockly help section + +If you have any questions, just press **“h”** to open the help section. + +![][10] + +Dockly Help + +For more details, refer the official GitHub page given at the end. + +And, that’s all for now. Hope this was useful. If you spend a lot of time working with Docker containers, give Dockly a try and see if it helps. + +* * * + +**Suggested read:** + + * **[How To Automatically Update Running Docker Containers][11]** + * [**ctop – A Commandline Monitoring Tool For Linux Containers**][12] + + + +* * * + +**Resource:** + + * [**Dockly GitHub Repository**][13] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/ + +作者:[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/2019/05/Dockly-720x340.png +[2]: https://www.ostechnix.com/getting-started-with-docker/ +[3]: https://www.ostechnix.com/portainer-an-easiest-way-to-manage-docker/ +[4]: https://www.ostechnix.com/picluster-simple-web-based-docker-management-application/ +[5]: https://www.ostechnix.com/install-node-js-linux/ +[6]: http://www.ostechnix.com/wp-content/uploads/2019/05/Manage-Docker-Containers-Using-Dockly.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/05/View-containers-information.png +[8]: http://www.ostechnix.com/wp-content/uploads/2019/05/Restart-containers.png +[9]: http://www.ostechnix.com/wp-content/uploads/2019/05/stop-remove-containers-and-images.png +[10]: http://www.ostechnix.com/wp-content/uploads/2019/05/Dockly-Help.png +[11]: https://www.ostechnix.com/automatically-update-running-docker-containers/ +[12]: https://www.ostechnix.com/ctop-commandline-monitoring-tool-linux-containers/ +[13]: https://github.com/lirantal/dockly From 6bc2bf4c35ad9203347d86aca3b50f1fcd7a71dd Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:43:42 +0800 Subject: [PATCH 0632/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190527=20Bloc?= =?UTF-8?q?kchain=202.0=20=E2=80=93=20Introduction=20To=20Hyperledger=20Sa?= =?UTF-8?q?wtooth=20[Part=2012]=20sources/tech/20190527=20Blockchain=202.0?= =?UTF-8?q?=20-=20Introduction=20To=20Hyperledger=20Sawtooth=20-Part=2012.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...uction To Hyperledger Sawtooth -Part 12.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20190527 Blockchain 2.0 - Introduction To Hyperledger Sawtooth -Part 12.md diff --git a/sources/tech/20190527 Blockchain 2.0 - Introduction To Hyperledger Sawtooth -Part 12.md b/sources/tech/20190527 Blockchain 2.0 - Introduction To Hyperledger Sawtooth -Part 12.md new file mode 100644 index 0000000000..8ab4b5b0b8 --- /dev/null +++ b/sources/tech/20190527 Blockchain 2.0 - Introduction To Hyperledger Sawtooth -Part 12.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Introduction To Hyperledger Sawtooth [Part 12]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-sawtooth/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – Introduction To Hyperledger Sawtooth [Part 12] +====== + +![Introduction To Hyperledger Sawtooth][1] + +After having discussed the [**Hyperledger Fabric**][2] project in detail on this blog, its time we moved on to the next project of interest at the Hyperledger camp. **Hyperledger Sawtooth** is Intel’s contribution to the [**Blockchain**][3] consortium mission to develop enterprise ready modular distributed ledgers and applications. Sawtooth is another attempt at creating an easy to roll out blockchain ledger for businesses keeping their resource constraints and security requirements in mind. While platforms such as [**Ethereum**][4] will in theory offer similar functionality when placed in capable hands, Sawtooth readily provides a lot of customizability and is built from the ground up for specific enterprise level use cases. + +The Hyperledger project page has an introductory video detailing the Sawtooth architecture and platform. We’re attaching it here for readers to get a quick round-up about the product. + +Moving to the intricacies of the Sawtooth project, there are **five primary and significant differences** between Sawtooth and its alternatives. The post from now and on will explore these differences and at the end will mention an example real world use case for Hyperledger Sawtooth in managing supply chains. + +### Distinction 1: The consensus algorithm – PoET + +This is perhaps amongst the most notable and significant changes that Sawtooth brings to the fore. While exploring all the different consensus algorithms that exist for blockchain platforms these days is out of the scope of this post, what is to be noted is that Sawtooth uses a **Proof Of Elapsed Time** (POET) based consensus algorithm. Such a system for validating transactions and blocks on the blockchain is considered to be resources efficient unlike other computation heavy systems which use the likes of **Proof of work** or **Proof of stake** algorithms. + +POET is designed to utilize the security and tamper proof features of modern processors with reference implementations utilizing **Intel’s trusted execution environment** (TEE) architecture on its modern CPUs. The fact that the execution of the validating program takes use of a TEE along with a **“lottery”** system that is implemented to choose the **validator** or **node** to fulfill the request makes the process of creating blocks on the Sawtooth architecture secure and resource efficient at the same time. + +The POET algorithm basically elects a validator randomly based on a stochastic process. The probability of a particular node being selected depends on a host of pointers one of which depends on the amount of computing resources the said node has contributed to the ledger so far. The chosen validator then proceeds to timestamp the said block of data and shares it with the permissioned nodes in the network so that there remains a reliable record of the blockchains immutability. This method of electing the “validator” node was developed by **Intel** and so far, has been shown to exhibit zero bias and or error in executing its function. + +### Distinction 2: A fully separated level of abstraction between the application level and core system + +As mentioned, the Sawtooth platform takes modularity to the next level. Here in the reference implementation that is shared by the [**Hyperledger project**][5] foundation, the core system that enables users to create a distributed ledger, and, the application run-time environment (the virtual environment where applications developed to run on the blockchain otherwise known as [**smart contracts**][6] or **chaincode** ) are separated by a full level of abstraction. This essentially means that developers can separately code applications in any programming language of their choice instead of having to conform to and follow platform specific languages. The Sawtooth platform provides support for the following contract languages out of the box: **Java** , **Python** , **C++** , **Go** , **JavaScript** and **Rust**. This distinction between the core system and application levels are obtained by defining a custom transaction family for each application that is developed on the platform. + +A transaction family contains the following: + + * **A transaction processor** : basically, your applications logic or business logic. + * **Data model** : a system that defines and handles data storage and processing at the system level. + * **Client-side handler** to handle the end user side of your application. + + + +Multiple low-level transaction families such as this may be defined in a permissioned blockchain and used in a modular fashion throughout the network. For instance, if a consortium of banks chose to implement it, they could come together and define common functionalities or rules for their applications and then plug and play the transaction families they need in their respective systems without having to develop everything on their own. + +### Distinction 3: SETH + +It is without doubt that a blockchain future would for sure have Ethereum as one of the key players. People at the Hyperledger foundation know this well. The **Hyperledger Burrow project** is in fact meant to address the existence of entities working on multiple platforms by providing a way for developers to use Ethereum blockchain specifications to build custom distributed applications using the **EVM** (Ethereum virtual machine). + +Basically speaking, Burrow lets you customize and deploy Ethereum based [**DApps**][7] (written in **solidity** ) in non-public blockchains (the kind developed for use at the Hyperledger foundation). The Burrow and Sawtooth projects teamed up and created **SETH**. **Sawtooth-Ethereum Integration project** (SETH) is meant to add Ethereum (solidity) smart contract functionality and compatibility to Sawtooth based distributed ledger networks. A much-less known agenda to SETH is the fact that applications (DApps) and smart contracts written for EVM can now be easily ported to Sawtooth. + +### Distinction 4: ACID principle and ability to batch process + +A rather path breaking feature of Sawtooth is its ability to batch transactions together and then package them into a block. The blocks and transactions will still be subject to the **ACID** principle ( **A** tomicity, **C** onsistency, **I** solation and **D** urability). The implication of these two facts are highlighted using an example as follows. + +Let’s say you have **6 transactions** to be packaged into **two blocks (4+2)**. Block A has 4 transactions which individually needs to succeed in order for the next block of 2 transactions to be timestamped and validated. Assuming they succeed, the next block of 2 transactions is processed and assuming even they are successful the entire package of 6 transactions are deemed successful and the overall business logic is deemed successful. For instance, assume you’re selling a car. Different transactions at the ends of the buyer (block A) and the seller (block B) will need be completed in order for the trade to be deemed valid. Ownership is transferred only if both the sides are successful in carrying out their individual transactions. + +Such a feature will improve accountability on individual ends by separating responsibilities and improve the recognizability of faults and errors by the same principle. The ACID principle is implemented by coding for a custom transaction processor and defining a transaction family that will store data in the said block structure. + +### Distinction 5: Parallel transaction execution + +Blockchain platforms usually follow a serial **first come first serve route** to executing transactions and follow a queueing system for the same. Sawtooth provides support for both **serial** and **parallel execution** of transactions. Parallel transaction processing offers significant performance gains for even faster transactions by reducing overall transaction latencies. More faster transactions will be processed along with slower and bigger transactions at the same time on the platform instead of transactions of all types to be kept waiting. + +The methodology followed to implement the parallel transaction paradigm efficiently takes care of the double spending problems and errors due to multiple changes being made to the same state by defining a custom scheduler for the network which can identity processes and their predecessors. + +Real world use case: Supply Chain Management using Sawtooth applied with IoT + +The Sawtooth **official website** lists seafood traceability as an example use case for the Sawtooth platform. The basic template is applicable for almost all supply chain related use cases. + +![][8] + +Figure 1 From the Hyperledger Sawtooth Official Website + +Traditional supply chain management solutions in this space work majorly through manual record keeping which leaves room for massive frauds, errors, and significant quality control issues. IoT has been cited as a solution to overcome such issues with supply chains in day to day use. Inexpensive GPS enabled RFID-tags can be attached to fresh catch or produce as the case may be and can be scanned for updating at the individual processing centres automatically. Buyers or middle men can verify and or track the information easily using a client on their mobile device to know the route their dinner has taken before arriving on their plates. + +While tracking seafood seems to be a first world problem in countries like India, the change an IoT enabled system can bring to public delivery systems in developing countries can be a welcome change. The application is available for demo at this **[link][9]** and users are encouraged to fiddle with it and adopt it to suit their needs. + +**Reference:** + + * [**The Official Hyperledger Sawtooth Docs**][10] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-sawtooth/ + +作者:[editor][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/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Hyperledger-Sawtooth-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-fabric/ +[3]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[4]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[5]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ +[6]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[7]: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ +[8]: http://www.ostechnix.com/wp-content/uploads/2019/05/Sawtooth.png +[9]: https://sawtooth.hyperledger.org/examples/seafood.html +[10]: https://sawtooth.hyperledger.org/docs/core/releases/1.0/contents.html From 161f623c249795bb24f2ce8e404b0d87b1a3d3cb Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 27 May 2019 16:44:56 +0800 Subject: [PATCH 0633/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190527=2020+?= =?UTF-8?q?=20FFmpeg=20Commands=20For=20Beginners=20sources/tech/20190527?= =?UTF-8?q?=2020-=20FFmpeg=20Commands=20For=20Beginners.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...90527 20- FFmpeg Commands For Beginners.md | 497 ++++++++++++++++++ 1 file changed, 497 insertions(+) create mode 100644 sources/tech/20190527 20- FFmpeg Commands For Beginners.md diff --git a/sources/tech/20190527 20- FFmpeg Commands For Beginners.md b/sources/tech/20190527 20- FFmpeg Commands For Beginners.md new file mode 100644 index 0000000000..cf8798d96a --- /dev/null +++ b/sources/tech/20190527 20- FFmpeg Commands For Beginners.md @@ -0,0 +1,497 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (20+ FFmpeg Commands For Beginners) +[#]: via: (https://www.ostechnix.com/20-ffmpeg-commands-beginners/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +20+ FFmpeg Commands For Beginners +====== + +![FFmpeg Commands][1] + +In this guide, I will be explaining how to use FFmpeg multimedia framework to do various audio, video transcoding and conversion operations with examples. I have compiled most commonly and frequently used 20+ FFmpeg commands for beginners. I will keep updating this guide by adding more examples from time to time. Please bookmark this guide and come back in a while to check for the updates. Let us get started, shall we? If you haven’t installed FFmpeg in your Linux system yet, refer the following guide. + + * [**Install FFmpeg in Linux**][2] + + + +### 20+ FFmpeg Commands For Beginners + +The typical syntax of the FFmpeg command is: + +``` +ffmpeg [global_options] {[input_file_options] -i input_url} ... + {[output_file_options] output_url} ... +``` + +We are now going to see some important and useful FFmpeg commands. + +##### **1\. Getting audio/video file information** + +To display your media file details, run: + +``` +$ ffmpeg -i video.mp4 +``` + +**Sample output:** + +``` +ffmpeg version n4.1.3 Copyright (c) 2000-2019 the FFmpeg developers +built with gcc 8.2.1 (GCC) 20181127 +configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3 +libavutil 56. 22.100 / 56. 22.100 +libavcodec 58. 35.100 / 58. 35.100 +libavformat 58. 20.100 / 58. 20.100 +libavdevice 58. 5.100 / 58. 5.100 +libavfilter 7. 40.101 / 7. 40.101 +libswscale 5. 3.100 / 5. 3.100 +libswresample 3. 3.100 / 3. 3.100 +libpostproc 55. 3.100 / 55. 3.100 +Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4': +Metadata: +major_brand : isom +minor_version : 512 +compatible_brands: isomiso2avc1mp41 +encoder : Lavf58.20.100 +Duration: 00:00:28.79, start: 0.000000, bitrate: 454 kb/s +Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 1920x1080 [SAR 1:1 DAR 16:9], 318 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default) +Metadata: +handler_name : ISO Media file produced by Google Inc. Created on: 04/08/2019. +Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) +Metadata: +handler_name : ISO Media file produced by Google Inc. Created on: 04/08/2019. +At least one output file must be specified +``` + +As you see in the above output, FFmpeg displays the media file information along with FFmpeg details such as version, configuration details, copyright notice, build and library options etc. + +If you don’t want to see the FFmpeg banner and other details, but only the media file information, use **-hide_banner** flag like below. + +``` +$ ffmpeg -i video.mp4 -hide_banner +``` + +**Sample output:** + +![][3] + +View audio, video file information using FFMpeg + +See? Now, it displays only the media file details. + +** **Recommended Download** – [**Free Guide: “Spotify Music Streaming: The Unofficial Guide”**][4] + +##### **2\. Converting video files to different formats** + +FFmpeg is powerful audio and video converter, so It’s possible to convert media files between different formats. Say for example, to convert **mp4 file to avi file** , run: + +``` +$ ffmpeg -i video.mp4 video.avi +``` + +Similarly, you can convert media files to any format of your choice. + +For example, to convert youtube **flv** format videos to **mpeg** format, run: + +``` +$ ffmpeg -i video.flv video.mpeg +``` + +If you want to preserve the quality of your source video file, use ‘-qscale 0’ parameter: + +``` +$ ffmpeg -i input.webm -qscale 0 output.mp4 +``` + +To check list of supported formats by FFmpeg, run: + +``` +$ ffmpeg -formats +``` + +##### **3\. Converting video files to audio files** + +To convert a video file to audio file, just specify the output format as .mp3, or .ogg, or any other audio formats. + +The above command will convert **input.mp4** video file to **output.mp3** audio file. + +``` +$ ffmpeg -i input.mp4 -vn output.mp3 +``` + +Also, you can use various audio transcoding options to the output file as shown below. + +``` +$ ffmpeg -i input.mp4 -vn -ar 44100 -ac 2 -ab 320 -f mp3 output.mp3 +``` + +Here, + + * **-vn** – Indicates that we have disabled video recording in the output file. + * **-ar** – Set the audio frequency of the output file. The common values used are 22050, 44100, 48000 Hz. + * **-ac** – Set the number of audio channels. + * **-ab** – Indicates the audio bitrate. + * **-f** – Output file format. In our case, it’s mp3 format. + + + +##### **4\. Change resolution of video files** + +If you want to set a particular resolution to a video file, you can use following command: + +``` +$ ffmpeg -i input.mp4 -filter:v scale=1280:720 -c:a copy output.mp4 +``` + +Or, + +``` +$ ffmpeg -i input.mp4 -s 1280x720 -c:a copy output.mp4 +``` + +The above command will set the resolution of the given video file to 1280×720. + +Similarly, to convert the above file to 640×480 size, run: + +``` +$ ffmpeg -i input.mp4 -filter:v scale=640:480 -c:a copy output.mp4 +``` + +Or, + +``` +$ ffmpeg -i input.mp4 -s 640x480 -c:a copy output.mp4 +``` + +This trick will help you to scale your video files to smaller display devices such as tablets and mobiles. + +##### **5\. Compressing video files** + +It is always an good idea to reduce the media files size to lower size to save the harddrive’s space. + +The following command will compress and reduce the output file’s size. + +``` +$ ffmpeg -i input.mp4 -vf scale=1280:-1 -c:v libx264 -preset veryslow -crf 24 output.mp4 +``` + +Please note that you will lose the quality if you try to reduce the video file size. You can lower that **crf** value to **23** or lower if **24** is too aggressive. + +You could also transcode the audio down a bit and make it stereo to reduce the size by including the following options. + +``` +-ac 2 -c:a aac -strict -2 -b:a 128k +``` + +** **Recommended Download** – [**Free Guide: “PLEX, a Manual: Your Media, With Style”**][5] + +##### **6\. Compressing Audio files** + +Just like compressing video files, you can also compress audio files using **-ab** flag in order to save some disk space. + +Let us say you have an audio file of 320 kbps bitrate. You want to compress it by changing the bitrate to any lower value like below. + +``` +$ ffmpeg -i input.mp3 -ab 128 output.mp3 +``` + +The list of various available audio bitrates are: + + 1. 96kbps + 2. 112kbps + 3. 128kbps + 4. 160kbps + 5. 192kbps + 6. 256kbps + 7. 320kbps + + + +##### **7. Removing audio stream from a video file + +** + +If you don’t want to a audio from a video file, use **-an** flag. + +``` +$ ffmpeg -i input.mp4 -an output.mp4 +``` + +Here, ‘an’ indicates no audio recording. + +The above command will undo all audio related flags, because we don’t audio from the input.mp4. + +##### **8\. Removing video stream from a media file** + +Similarly, if you don’t want video stream, you could easily remove it from the media file using ‘vn’ flag. vn stands for no video recording. In other words, this command converts the given media file into audio file. + +The following command will remove the video from the given media file. + +``` +$ ffmpeg -i input.mp4 -vn output.mp3 +``` + +You can also mention the output file’s bitrate using ‘-ab’ flag as shown in the following example. + +``` +$ ffmpeg -i input.mp4 -vn -ab 320 output.mp3 +``` + +##### **9. Extracting images from the video ** + +Another useful feature of FFmpeg is we can easily extract images from a video file. This could be very useful, if you want to create a photo album from a video file. + +To extract images from a video file, use the following command: + +``` +$ ffmpeg -i input.mp4 -r 1 -f image2 image-%2d.png +``` + +Here, + + * **-r** – Set the frame rate. I.e the number of frames to be extracted into images per second. The default value is **25**. + * **-f** – Indicates the output format i.e image format in our case. + * **image-%2d.png** – Indicates how we want to name the extracted images. In this case, the names should start like image-01.png, image-02.png, image-03.png and so on. If you use %3d, then the name of images will start like image-001.png, image-002.png and so on. + + + +##### **10\. Cropping videos** + +FFMpeg allows to crop a given media file in any dimension of our choice. + +The syntax to crop a vide ofile is given below: + +``` +ffmpeg -i input.mp4 -filter:v "crop=w:h:x:y" output.mp4 +``` + +Here, + + * **input.mp4** – source video file. + * **-filter:v** – Indicates the video filter. + * **crop** – Indicates crop filter. + * **w** – **Width** of the rectangle that we want to crop from the source video. + * **h** – Height of the rectangle. + * **x** – **x coordinate** of the rectangle that we want to crop from the source video. + * **y** – y coordinate of the rectangle. + + + +Let us say you want to a video with a **width of 640 pixels** and a **height of 480 pixels** , from the **position (200,150)** , the command would be: + +``` +$ ffmpeg -i input.mp4 -filter:v "crop=640:480:200:150" output.mp4 +``` + +Please note that cropping videos will affect the quality. Do not do this unless it is necessary. + +##### **11\. Convert a specific portion of a video** + +Sometimes, you might want to convert only a specific portion of the video file to different format. Say for example, the following command will convert the **first 50 seconds** of given video.mp4 file to video.avi format. + +``` +$ ffmpeg -i input.mp4 -t 10 output.avi +``` + +Here, we specify the the time in seconds. Also, it is possible to specify the time in **hh.mm.ss** format. + +##### **12\. Set the aspect ratio to video** + +You can set the aspect ration to a video file using **-aspect** flag like below. + +``` +$ ffmpeg -i input.mp4 -aspect 16:9 output.mp4 +``` + +The commonly used aspect ratios are: + + * 16:9 + * 4:3 + * 16:10 + * 5:4 + * 2:21:1 + * 2:35:1 + * 2:39:1 + + + +##### **13\. Adding poster image to audio files** + +You can add the poster images to your files, so that the images will be displayed while playing the audio files. This could be useful to host audio files in Video hosting or sharing websites. + +``` +$ ffmpeg -loop 1 -i inputimage.jpg -i inputaudio.mp3 -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest output.mp4 +``` + +##### **14. Trim a media file using start and stop times + +** + +To trim down a video to smaller clip using start and stop times, we can use the following command. + +``` +$ ffmpeg -i input.mp4 -ss 00:00:50 -codec copy -t 50 output.mp4 +``` + +Here, + + * –s – Indicates the starting time of the video clip. In our example, starting time is the 50th second. + * -t – Indicates the total time duration. + + + +This is very helpful when you want to cut a part from an audio or video file using starting and ending time. + +Similarly, we can trim down the audio file like below. + +``` +$ ffmpeg -i audio.mp3 -ss 00:01:54 -to 00:06:53 -c copy output.mp3 +``` + +##### **15\. Split video files into multiple parts** + +Some websites will allow you to upload only a specific size of video. In such cases, you can split the large video files into multiple smaller parts like below. + +``` +$ ffmpeg -i input.mp4 -t 00:00:30 -c copy part1.mp4 -ss 00:00:30 -codec copy part2.mp4 +``` + +Here, **-t 00:00:30** indicates a part that is created from the start of the video to the 30th second of video. **-ss 00:00:30** shows the starting time stamp for the next part of video. It means that the 2nd part will start from the 30th second and will continue up to the end of the original video file. + +** **Recommended Download** – [**Free Guide: “How to Start Your Own Successful Podcast”**][6] + +##### **16\. Joining or merging multiple video parts into one** + +FFmpeg will also join the multiple video parts and create a single video file. + +Create **join.txt** file that contains the exact paths of the files that you want to join. All files should be same format (same codec). The path name of all files should be mentioned one by one like below. + +``` +file /home/sk/myvideos/part1.mp4 +file /home/sk/myvideos/part2.mp4 +file /home/sk/myvideos/part3.mp4 +file /home/sk/myvideos/part4.mp4 +``` + +Now, join all files using command: + +``` +$ ffmpeg -f concat -i join.txt -c copy output.mp4 +``` + +If you get an error something like below; + +``` +[concat @ 0x555fed174cc0] Unsafe file name '/path/to/mp4' +join.txt: Operation not permitted +``` + +Add **“-safe 0”** : + +``` +$ ffmpeg -f concat -safe 0 -i join.txt -c copy output.mp4 +``` + +The above command will join part1.mp4, part2.mp4, part3.mp4, and part4.mp4 files into a single file called “output.mp4”. + +##### **17\. Add subtitles to a video file** + +We can also add subtitles to a video file using FFmpeg. Download the correct subtitle for your video and add it your video as shown below. + +``` +$ fmpeg -i input.mp4 -i subtitle.srt -map 0 -map 1 -c copy -c:v libx264 -crf 23 -preset veryfast output.mp4 +``` + +##### **18\. Preview or test video or audio files** + +You might want to preview to verify or test whether the output file has been properly transcoded or not. To do so, you can play it from your Terminal with command: + +``` +$ ffplay video.mp4 +``` + +[![][1]][7] + +Similarly, you can test the audio files as shown below. + +``` +$ ffplay audio.mp3 +``` + +[![][1]][8] + +##### **19\. Increase/decrease video playback speed** + +FFmpeg allows you to adjust the video playback speed. + +To increase the video playback speed, run: + +``` +$ ffmpeg -i input.mp4 -vf "setpts=0.5*PTS" output.mp4 +``` + +The command will double the speed of the video. + +To slow down your video, you need to use a multiplier **greater than 1**. To decrease playback speed, run: + +``` +$ ffmpeg -i input.mp4 -vf "setpts=4.0*PTS" output.mp4 +``` + +##### **20. Create Animated GIF + +** + +We use GIF images on almost all social and professional networks for various purposes. Using FFmpeg, we can easily and quickly create animated video files. The following guide explains how to create an animated GIF file using FFmpeg and ImageMagick in Unix-like systems. + + * [**How To Create Animated GIF In Linux**][9] + + + +##### **21.** Create videos from PDF files + +I collected many PDF files, mostly Linux tutorials, over the years and saved in my Tablet PC. Sometimes I feel too lazy to read them from the tablet. So, I decided to create a video from PDF files and watch it in a big screen devices like a TV or a Computer. If you ever wondered how to make a movie file from a collection of PDF files, the following guide will help. + + * [**How To Create A Video From PDF Files In Linux**][10] + + + +##### **22\. Getting help** + +In this guide, I have covered the most commonly used FFmpeg commands. It has a lot more different options to do various advanced functions. To learn more about it, refer the man page. + +``` +$ man ffmpeg +``` + +And, that’s all. I hope this guide will help you to getting started with FFmpeg. If you find this guide useful, please share it on your social, and professional networks. More good stuffs to come. Stay tuned! + +Cheers! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/20-ffmpeg-commands-beginners/ + +作者:[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/2017/05/FFmpeg-Commands-720x340.png +[2]: https://www.ostechnix.com/install-ffmpeg-linux/ +[3]: http://www.ostechnix.com/wp-content/uploads/2017/05/sk@sk_001.png +[4]: https://ostechnix.tradepub.com/free/w_make141/prgm.cgi +[5]: https://ostechnix.tradepub.com/free/w_make75/prgm.cgi +[6]: https://ostechnix.tradepub.com/free/w_make235/prgm.cgi +[7]: http://www.ostechnix.com/wp-content/uploads/2017/05/Menu_004.png +[8]: http://www.ostechnix.com/wp-content/uploads/2017/05/Menu_005-3.png +[9]: https://www.ostechnix.com/create-animated-gif-ubuntu-16-04/ +[10]: https://www.ostechnix.com/create-video-pdf-files-linux/ From 7a6e45028882b2685a5eb9a7f76cbc8b01db1278 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Mon, 27 May 2019 19:56:31 +0800 Subject: [PATCH 0634/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... To Search DuckDuckGo From The Terminal.md | 233 ------------------ ... To Search DuckDuckGo From The Terminal.md | 228 +++++++++++++++++ 2 files changed, 228 insertions(+), 233 deletions(-) delete mode 100644 sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md create mode 100644 translated/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md diff --git a/sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md b/sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md deleted file mode 100644 index b4f891d16c..0000000000 --- a/sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md +++ /dev/null @@ -1,233 +0,0 @@ -Translating by MjSeve - -ddgr – A Command Line Tool To Search DuckDuckGo From The Terminal -====== -Bash tricks are really awesome in Linux that makes everything is possible in Linux. - -It really works well for developers or system admins because they are spending most of the time with terminal. Did you know why they are preferring this tricks? - -These trick will improve their productivity and also make them to work fast. - -### What Is ddgr - -[ddgr][1] is a command-line utility to search DuckDuckGo from the terminal. ddgr works out of the box with several text-based browsers if the BROWSER environment variable is set. - -Make sure your system should have installed any text-based browsers. You may know about [googler][2] that allow users to perform Google searches from the Linux command line. - -It’s highly popular among cmdline users and they are expect the similar utility for privacy-aware DuckDuckGo, that’s why ddgr came to picture. - -Unlike the web interface, you can specify the number of search results you would like to see per page. - -**Suggested Read :** -**(#)** [Googler – Google Search From The Linux Command Line][2] -**(#)** [Buku – A Powerful Command-line Bookmark Manager for Linux][3] -**(#)** [SoCLI – Easy Way To Search And Browse Stack Overflow From The Terminal][4] -**(#)** [RTV (Reddit Terminal Viewer) – A Simple Terminal Viewer For Reddit][5] - -### What Is DuckDuckGo - -DDG stands for DuckDuckGo. DuckDuckGo (DDG) is an Internet search engine that really protecting users search and privacy. - -They didn’t filter users personalized search results and It’s showing the same search results to all users for a given search term. - -Most of the users prefer google search engine, if you really worrying about privacy then you can blindly go with DuckDuckGo. - -### ddgr Features - - * Fast and clean (no ads, stray URLs or clutter), custom color - * Designed to deliver maximum readability at minimum space - * Specify the number of search results to show per page - * Navigate result pages from omniprompt, open URLs in browser - * Search and option completion scripts for Bash, Zsh and Fish - * DuckDuckGo Bang support (along with completion) - * Open the first result directly in browser (as in I’m Feeling Ducky) - * Non-stop searches: fire new searches at omniprompt without exiting - * Keywords (e.g. filetype:mime, site:somesite.com) support - * Limit search by time, specify region, disable safe search - * HTTPS proxy support, Do Not Track set, optionally disable User Agent - * Support custom url handler script or cmdline utility - * Comprehensive documentation, man page with handy usage examples - * Minimal dependencies - - - -### Prerequisites - -ddgr requires Python 3.4 or later. So, make sure you system should have Python 3.4 or later version. -``` -$ python3 --version -Python 3.6.3 - -``` - -### How To Install ddgr In Linux - -We can easily install ddgr using the following command based on the distributions. - -For **`Fedora`** , use [DNF Command][6] to install ddgr. -``` -# dnf install ddgr - -``` - -Alternatively we can use [SNAP Command][7] to install ddgr. -``` -# snap install ddgr - -``` - -For **`LinuxMint/Ubuntu`** , use [APT-GET Command][8] or [APT Command][9] to install ddgr. -``` -$ sudo add-apt-repository ppa:twodopeshaggy/jarun -$ sudo apt-get update -$ sudo apt-get install ddgr - -``` - -For **`Arch Linux`** based systems, use [Yaourt Command][10] or [Packer Command][11] to install ddgr from AUR repository. -``` -$ yaourt -S ddgr -or -$ packer -S ddgr - -``` - -For **`Debian`** , use [DPKG Command][12] to install ddgr. -``` -# wget https://github.com/jarun/ddgr/releases/download/v1.2/ddgr_1.2-1_debian9.amd64.deb -# dpkg -i ddgr_1.2-1_debian9.amd64.deb - -``` - -For **`CentOS 7`** , use [YUM Command][13] to install ddgr. -``` -# yum install https://github.com/jarun/ddgr/releases/download/v1.2/ddgr-1.2-1.el7.3.centos.x86_64.rpm - -``` - -For **`opensuse`** , use [zypper Command][14] to install ddgr. -``` -# zypper install https://github.com/jarun/ddgr/releases/download/v1.2/ddgr-1.2-1.opensuse42.3.x86_64.rpm - -``` - -### How To Launch ddgr - -Enter the `ddgr` command without any option on terminal to bring DuckDuckGo search. You will get the same output similar to below. -``` -$ ddgr - -``` - -![][16] - -### How To Search Using ddgr - -We can initiate the search through two ways. Either from omniprompt or directly from terminal. You can search any phrases which you want. - -Directly from terminal. -``` -$ ddgr 2daygeek - -``` - -![][17] - -From `omniprompt`. -![][18] - -### Omniprompt Shortcut - -Enter `?` to obtain the `omniprompt`, which will show you list of keywords and shortcut to work further with ddgr. -![][19] - -### How To Move Next,Previous, and Fist Page - -It allows user to move next page or previous page or first page. - - * `n:` Move to next set of search results - * `p:` Move to previous set of search results - * `f:` Jump to the first page - - - -![][20] - -### How To Initiate A New Search - -“ **d** ” option allow users to initiate a new search from omniprompt. For example, i searched about `2daygeek website` and now i’m going to initiate a new search with phrase “ **Magesh Maruthamuthu** “. - -From `omniprompt`. -``` -ddgr (? for help) d magesh maruthmuthu - -``` - -![][21] - -### Show Complete URLs In Search Result - -By default it shows only an article heading, add the “ **x** ” option in search to show complete article urls in search result. -``` -$ ddgr -n 5 -x 2daygeek - -``` - -![][22] - -### Limit Search Results - -By default search results shows 10 results per page. If you want to limit the page results for your convenience, you can do by passing `--num or -n` argument with ddgr. -``` -$ ddgr -n 5 2daygeek - -``` - -![][23] - -### Website Specific Search - -To search specific pages from the particular website, use the below format. This will fetch the results for given keywords from the website. For example, We are going search about “ **Package Manager** ” from 2daygeek website. See the results. -``` -$ ddgr -n 5 --site 2daygeek "package manager" - -``` - -![][24] - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/ddgr-duckduckgo-search-from-the-command-line-in-linux/ - -作者:[Magesh Maruthamuthu][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.2daygeek.com/author/magesh/ -[1]:https://github.com/jarun/ddgr -[2]:https://www.2daygeek.com/googler-google-search-from-the-command-line-on-linux/ -[3]:https://www.2daygeek.com/buku-command-line-bookmark-manager-linux/ -[4]:https://www.2daygeek.com/socli-search-and-browse-stack-overflow-from-linux-terminal/ -[5]:https://www.2daygeek.com/rtv-reddit-terminal-viewer-a-simple-terminal-viewer-for-reddit/ -[6]:https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[7]:https://www.2daygeek.com/snap-command-examples/ -[8]:https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[9]:https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[10]:https://www.2daygeek.com/install-yaourt-aur-helper-on-arch-linux/ -[11]:https://www.2daygeek.com/install-packer-aur-helper-on-arch-linux/ -[12]:https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ -[13]:https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[14]:https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ -[15]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[16]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux1.png -[17]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-3.png -[18]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-2.png -[19]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-4.png -[20]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-5a.png -[21]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-6a.png -[22]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-7a.png -[23]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-8.png -[24]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-9a.png diff --git a/translated/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md b/translated/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md new file mode 100644 index 0000000000..f14f1ebaae --- /dev/null +++ b/translated/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md @@ -0,0 +1,228 @@ +ddgr - 一个从终端搜索 DuckDuckGo 的命令行工具 +====== +在 Linux 中,Bash 技巧非常棒,它使 Linux 中的一切成为可能。 + +对于开发人员或系统管理员来说,它真的很管用,因为他们大部分时间都在使用终端。你知道他们为什么喜欢这种技巧吗? + +因为这些技巧可以提高他们的工作效率,也能使他们工作更快。 + +### 什么是 ddgr + +[ddgr][1] 是一个命令行实用程序,用于从终端搜索 DuckDuckGo。如果设置了 BROWSER 环境变量,ddgr 可以在几个基于文本的浏览器中开箱即用。 + +确保你的系统安装了任何基于文本的浏览器。你可能知道 [googler][2],它允许用户从 Linux 命令行进行 Google 搜索。 + +它在命令行用户中非常受欢迎,他们期望对隐私敏感的 DuckDuckGo 也有类似的实用程序,这就是 ddgr 出现的原因。 + +与 Web 界面不同,你可以指定每页要查看的搜索结果数。 + +**建议阅读:** +**(#)** [Googler – 从 Linux 命令行搜索 Google][2] +**(#)** [Buku – Linux 中一个强大的命令行书签管理器][3] +**(#)** [SoCLI – 从终端搜索和浏览堆栈溢出的简单方法][4] +**(#)** [RTV(Reddit 终端查看器)- 一个简单的 Reddit 终端查看器][5] + +### 什么是 DuckDuckGo + +DDG 即 DuckDuckGo。DuckDuckGo(DDG)是一个真正保护用户搜索和隐私的互联网搜索引擎。 + +它们没有过滤用户的个性化搜索结果,对于给定的搜索词,它会向所有用户显示相同的搜索结果。 + +大多数用户更喜欢谷歌搜索引擎,但是如果你真的担心隐私,那么你可以放心地使用 DuckDuckGo。 + +### ddgr 特性 + + * 快速且干净(没有广告,多余的 URL 或杂物),自定义颜色 + * 旨在以最小的空间提供最高的可读性 + * 指定每页显示的搜索结果数 + * 从浏览器中打开的 omniprompt URL 导航结果页面 + * Bash、Zsh 和 Fish 的搜索和配置脚本 + * DuckDuckGo Bang 支持(自动完成) + * 直接在浏览器中打开第一个结果(就像我感觉 Ducky) + * 不间断搜索:无需退出即可在 omniprompt 中触发新搜索 + * 关键字支持(例如:filetype:mime、site:somesite.com) + * 按时间、指定区域、禁用安全搜索 + * HTTPS 代理支持,无跟踪,可选择禁用用户代理 + * 支持自定义 URL 处理程序脚本或命令行实用程序 + * 全面的文档,man 页面有方便的使用示例 + * 最小的依赖关系 + + +### 需要条件 + +ddgr 需要 Python 3.4 或更高版本。因此,确保你的系统应具有 Python 3.4 或更高版本。 +``` +$ python3 --version +Python 3.6.3 + +``` + +### 如何在 Linux 中安装 ddgr + +我们可以根据发行版使用以下命令轻松安装 ddgr。 + +对于 **`Fedora`** ,使用 [DNF 命令][6]来安装 ddgr。 +``` +# dnf install ddgr + +``` + +或者我们可以使用 [SNAP 命令][7]来安装 ddgr。 +``` +# snap install ddgr + +``` + +对于 **`LinuxMint/Ubuntu`**,使用 [APT-GET 命令][8] 或 [APT 命令][9]来安装 ddgr。 +``` +$ sudo add-apt-repository ppa:twodopeshaggy/jarun +$ sudo apt-get update +$ sudo apt-get install ddgr + +``` + +对于基于 **`Arch Linux`** 的系统,使用 [Yaourt 命令][10]或 [Packer 命令][11]从 AUR 仓库安装 ddgr。 +``` +$ yaourt -S ddgr +or +$ packer -S ddgr + +``` + +对于 **`Debian`**,使用 [DPKG 命令][12] 安装 ddgr。 +``` +# wget https://github.com/jarun/ddgr/releases/download/v1.2/ddgr_1.2-1_debian9.amd64.deb +# dpkg -i ddgr_1.2-1_debian9.amd64.deb + +``` + +对于 **`CentOS 7`**,使用 [YUM 命令][13]来安装 ddgr。 +``` +# yum install https://github.com/jarun/ddgr/releases/download/v1.2/ddgr-1.2-1.el7.3.centos.x86_64.rpm + +``` + +对于 **`opensuse`**,使用 [zypper 命令][14]来安装 ddgr。 +``` +# zypper install https://github.com/jarun/ddgr/releases/download/v1.2/ddgr-1.2-1.opensuse42.3.x86_64.rpm + +``` + +### 如何启动 ddgr + +在终端上输入 `ddgr` 命令,不带任何选项来进行 DuckDuckGo 搜索。你将获得类似于下面的输出。 +``` +$ ddgr + +``` + +![][16] + +### 如何使用 ddgr 进行搜索 + +我们可以通过两种方式启动搜索。从omniprompt 或者直接从终端开始。你可以搜索任何你想要的短语。 + +直接从终端: +``` +$ ddgr 2daygeek + +``` + +![][17] + +从 `omniprompt`: +![][18] + +### Omniprompt 快捷方式 + +输入 `?` 以获得 `omniprompt`,它将显示关键字列表和进一步使用 ddgr 的快捷方式。 +![][19] + +### 如何移动下一页、上一页和第一页 + +它允许用户移动下一页、上一页或第一页。 + + * `n:` 移动到下一组搜索结果 + * `p:` 移动到上一组搜索结果 + * `f:` 跳转到第一页 + +![][20] + +### 如何启动新搜索 + +“**d**” 选项允许用户从 omniprompt 发起新的搜索。例如,我搜索了 `2daygeek 网站`,现在我将搜索 **Magesh Maruthamuthu** 这个新短语。 + +从 `omniprompt`. +``` +ddgr (? for help) d magesh maruthmuthu + +``` + +![][21] + +### 在搜索结果中显示完整的 URL + +默认情况下,它仅显示文章标题,在搜索中添加 **x** 选项以在搜索结果中显示完整的文章网址。 +``` +$ ddgr -n 5 -x 2daygeek + +``` + +![][22] + +### 限制搜索结果 + +默认情况下,搜索结果每页显示 10 个结果。如果你想为方便起见限制页面结果,可以使用 ddgr 带有 `--num` 或 ` -n` 参数。 +``` +$ ddgr -n 5 2daygeek + +``` + +![][23] + +### 网站特定搜索 + +要搜索特定网站的特定页面,使用以下格式。这将从网站获取给定关键字的结果。例如,我们在 2daygeek 网站搜索 **Package Manager**,查看结果。 +``` +$ ddgr -n 5 --site 2daygeek "package manager" + +``` + +![][24] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/ddgr-duckduckgo-search-from-the-command-line-in-linux/ + +作者:[Magesh Maruthamuthu][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) +选题:[lujun9972](https://github.com/lujun9972) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.2daygeek.com/author/magesh/ +[1]:https://github.com/jarun/ddgr +[2]:https://www.2daygeek.com/googler-google-search-from-the-command-line-on-linux/ +[3]:https://www.2daygeek.com/buku-command-line-bookmark-manager-linux/ +[4]:https://www.2daygeek.com/socli-search-and-browse-stack-overflow-from-linux-terminal/ +[5]:https://www.2daygeek.com/rtv-reddit-terminal-viewer-a-simple-terminal-viewer-for-reddit/ +[6]:https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[7]:https://www.2daygeek.com/snap-command-examples/ +[8]:https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[9]:https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[10]:https://www.2daygeek.com/install-yaourt-aur-helper-on-arch-linux/ +[11]:https://www.2daygeek.com/install-packer-aur-helper-on-arch-linux/ +[12]:https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ +[13]:https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[14]:https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[15]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[16]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux1.png +[17]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-3.png +[18]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-2.png +[19]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-4.png +[20]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-5a.png +[21]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-6a.png +[22]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-7a.png +[23]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-8.png +[24]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-9a.png From ae8e81fcb936c66089b4d20a0ee5ee69ad5ea6dc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 May 2019 22:03:15 +0800 Subject: [PATCH 0635/1154] PRF:20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md @wxy --- ...ub data with GHTorrent and Libraries.io.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md b/translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md index b51f375a48..837d127990 100644 --- a/translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md +++ b/translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Querying 10 years of GitHub data with GHTorrent and Libraries.io) @@ -9,19 +9,20 @@ 用 GHTorrent 和 Libraries.io 查询 10 年的 GitHub 数据 ====== -> 有一种方法可以在没有任何本地基础设施的情况下使用开源数据集探索 GitHub 数据. - -![magnifying glass on computer screen][1] -我一直在寻找新的数据集,以用它们来展示我团队工作的力量。[CHAOSSEARCH][2] 可以将你的 [Amazon S3][3] 对象存储数据转换为完全可搜索的 [Elasticsearch][4] 式集群。使用 Elasticsearch API 或 [Kibana][5] 等工具,你可以查询你找的任何数据。 +> 有一种方法可以在没有任何本地基础设施的情况下使用开源数据集探索 GitHub 数据。 + +![magnifying glass on computer screen](https://img.linux.net.cn/data/attachment/album/201905/27/220200jlzrlz333vkfl8ok.jpg) + +我一直在寻找新的数据集,以用它们来展示我们团队工作的力量。[CHAOSSEARCH][2] 可以将你的 [Amazon S3][3] 对象存储数据转换为完全可搜索的 [Elasticsearch][4] 式集群。使用 Elasticsearch API 或 [Kibana][5] 等工具,你可以查询你所要找的任何数据。 当我找到 [GHTorrent][6] 项目进行探索时,我很兴奋。GHTorrent 旨在通过 GitHub API 构建所有可用数据的离线版本。如果你喜欢数据集,这是一个值得一看的项目,甚至你可以考虑[捐赠一个 GitHub API 密钥][7]。 ### 访问 GHTorrent 数据 -有许多方法可以访问和使用 [GHTorrent 的数据][8],它以 [NDJSON][9] 格式提供。这个项目可以以多种形式提供数据,包括用于恢复到 [MySQL][11] 数据库的 [CSV][10],可以转储所有对象的 [MongoDB][12],以及用于将数据直接导出到 Google 对象存储中的 Google Big Query(免费)。 有一点需要注意:这个数据集有从 2008 年到 2017 年的几乎完整的数据集,但从 2017 年到现在的数据还不完整。这将影响我们确定性查询的能力,但它仍然是一个令人兴奋的信息量。 +有许多方法可以访问和使用 [GHTorrent 的数据][8],它以 [NDJSON][9] 格式提供。这个项目可以以多种形式提供数据,包括用于恢复到 [MySQL][11] 数据库的 [CSV][10],可以转储所有对象的 [MongoDB][12],以及用于将数据直接导出到 Google 对象存储中的 Google Big Query(免费)。 有一点需要注意:这个数据集有从 2008 年到 2017 年几乎完整的数据集,但从 2017 年到现在的数据还不完整。这将影响我们确定性查询的能力,但它仍然是一个令人兴奋的信息量。 -我选择 Google Big Query 来避免自己运行任何数据库,那么我就可以很快下载包括用户和项目在内的完整数据库。 CHAOSSEARCH 可以原生分析 NDJSON 格式,因此在将数据上传到 Amazon S3 之后,我能够在几分钟内对其进行索引。 CHAOSSEARCH 平台不要求用户设置索引模式或定义其数据的映射,它可以发现所有字段本身(字符串、整数等)。 +我选择 Google Big Query 来避免自己运行任何数据库,那么我就可以很快下载包括用户和项目在内的完整数据库。CHAOSSEARCH 可以原生分析 NDJSON 格式,因此在将数据上传到 Amazon S3 之后,我能够在几分钟内对其进行索引。CHAOSSEARCH 平台不要求用户设置索引模式或定义其数据的映射,它可以发现所有字段本身(字符串、整数等)。 随着我的数据完全索引并准备好进行搜索和聚合,我想深入了解看看我们可以发现什么,比如哪些软件语言是 GitHub 项目最受欢迎的。 @@ -49,11 +50,10 @@ ![The rate at which new projects are created on GitHub.][20] -既然我知道了创建的项目的速度以及用于创建这些项目的最流行的语言,我还想知道这些项目选择的开源许可证。遗憾的是,这个 GitHub 项目数据集中并不存在这些数据,但是 [Tidelift][21] 的精彩团队在 [Libraries.io][22] [数据][23] 里发布了一个 GitHub 项目的详细列表,包括使用的许可证以及其中有关开源软件状态的其他详细信息。将此数据集导入 CHAOSSEARCH 只花了几分钟,让我看看哪些开源软件许可证在 GitHub 上最受欢迎: +既然我知道了创建项目的速度以及用于创建这些项目的最流行的语言,我还想知道这些项目选择的开源许可证。遗憾的是,这个 GitHub 项目数据集中并不存在这些数据,但是 [Tidelift][21] 的精彩团队在 [Libraries.io][22] [数据][23] 里发布了一个 GitHub 项目的详细列表,包括使用的许可证以及其中有关开源软件状态的其他详细信息。将此数据集导入 CHAOSSEARCH 只花了几分钟,让我看看哪些开源软件许可证在 GitHub 上最受欢迎: (提醒:这是为了便于阅读而合并的有效 JSON。) - ``` {"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}} ``` @@ -62,9 +62,9 @@ ![Which open source software licenses are the most popular on GitHub.][24] -如你所见,[MIT 许可证][25] 和 [Apache 2.0 许可证][26] 的开源项目远远超过了其他大多数开源许可证,而 [各种 BSD 和 GPL 许可证][27] 则差得很远。鉴于 GitHub 的开放模式,我不能说我对这些结果感到惊讶。我猜想用户(而不是公司)创建了大多数项目,并且他们使用 MIT 许可证可以使其他人轻松使用、共享和贡献。而鉴于有不少公司希望确保其商标得到尊重并为其业务提供开源组件,那么 Apache 2.0 许可证数量高企的背后也是有道理的。 +如你所见,[MIT 许可证][25] 和 [Apache 2.0 许可证][26] 的开源项目远远超过了其他大多数开源许可证,而 [各种 BSD 和 GPL 许可证][27] 则差得很远。鉴于 GitHub 的开放模式,我不能说我对这些结果感到惊讶。我猜想是用户(而不是公司)创建了大多数项目,并且他们使用 MIT 许可证可以使其他人轻松地使用、共享和贡献。而鉴于有不少公司希望确保其商标得到尊重并为其业务提供开源组件,那么 Apache 2.0 许可证数量高企的背后也是有道理的。 -现在我确定了最受欢迎的许可证,我很想看看到最少使用的许可证。通过调整我的上一个查询,我将前 10 名逆转为最后 10 名,并且只找到了两个使用 [伊利诺伊大学 - NCSA 开源许可证][28] 的项目。我之前从未听说过这个许可证,但它与 Apache 2.0 非常接近。看到了所有 GitHub 项目中使用了多少个不同的软件许可证,这很有意思。 +现在我确定了最受欢迎的许可证,我很想看看最少使用的许可证。通过调整我的上一个查询,我将前 10 名逆转为最后 10 名,并且只找到了两个使用 [伊利诺伊大学 - NCSA 开源许可证][28] 的项目。我之前从未听说过这个许可证,但它与 Apache 2.0 非常接近。看到所有 GitHub 项目中使用了多少个不同的软件许可证,这很有意思。 ![The University of Illinois/NCSA open source license.][29] @@ -78,7 +78,7 @@ ![The most popular open source licenses used for GitHub JavaScript projects.][30] -尽管使用 `npm init` 创建的 [NPM][31] 模块的默认许可证是 [Internet Systems Consortium(ISC)][32] 的许可证,但你可以看到相当多的这些项目使用 MIT 以及 Apache 2.0 的开源许可证。 +尽管使用 `npm init` 创建的 [NPM][31] 模块的默认许可证是来自 [Internet Systems Consortium(ISC)][32] 的许可证,但你可以看到相当多的这些项目使用 MIT 以及 Apache 2.0 的开源许可证。 由于 Libraries.io 数据集中包含丰富的开源项目内容,并且由于 GHTorrent 数据缺少最近几年的数据(因此缺少有关 Golang 项目的任何细节),因此我决定运行类似的查询来查看 Golang 项目是如何许可他们的代码的。 @@ -94,7 +94,7 @@ Golang 项目与 JavaScript 项目惊人逆转 —— 使用 Apache 2.0 的 Golang 项目几乎是 MIT 许可证的三倍。虽然很难准确地解释为什么会出现这种情况,但在过去的几年中,Golang 已经出现了大规模的增长,特别是在开源和商业化的项目和软件产品公司中。 -正如我们上面所了解的,这些公司中的许多公司都希望强制执行其商标,因此转向 Apache 2.0 许可证是有道理的。 +正如我们上面所了解的,这些公司中的许多公司都希望强制执行其商标策略,因此转向 Apache 2.0 许可证是有道理的。 #### 总结 @@ -104,7 +104,7 @@ Golang 项目与 JavaScript 项目惊人逆转 —— 使用 Apache 2.0 的 Gola 你对数据提出了哪些其他问题,以及你使用了哪些数据集?请在评论或推特上告诉我 [@petecheslock] [34]。 -本文的一个版本最初发布在 [CHAOSSEARCH][35]。 +本文的一个版本最初发布在 [CHAOSSEARCH][35],有更多结果可供发现。 -------------------------------------------------------------------------------- @@ -113,7 +113,7 @@ via: https://opensource.com/article/19/5/chaossearch-github-ghtorrent 作者:[Pete Cheslock][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9ef0a30259efcc79344f06a70f492371275fd3d5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 May 2019 22:04:23 +0800 Subject: [PATCH 0636/1154] PUB:20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md @wxy https://linux.cn/article-10906-1.html --- ...10 years of GitHub data with GHTorrent and Libraries.io.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md (99%) diff --git a/translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md b/published/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md similarity index 99% rename from translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md rename to published/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md index 837d127990..5c51721c84 100644 --- a/translated/tech/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md +++ b/published/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10906-1.html) [#]: subject: (Querying 10 years of GitHub data with GHTorrent and Libraries.io) [#]: via: (https://opensource.com/article/19/5/chaossearch-github-ghtorrent) [#]: author: (Pete Cheslock https://opensource.com/users/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes) From 23953d1f10c6cbd01b83a58d944e20b1adfbad85 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Mon, 27 May 2019 22:31:30 +0800 Subject: [PATCH 0637/1154] Translating by MjSeven --- sources/tech/20190527 How to write a good C main function.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190527 How to write a good C main function.md b/sources/tech/20190527 How to write a good C main function.md index 55fd091d73..6193f4a04a 100644 --- a/sources/tech/20190527 How to write a good C main function.md +++ b/sources/tech/20190527 How to write a good C main function.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -471,7 +471,7 @@ via: https://opensource.com/article/19/5/how-write-good-c-main-function 作者:[Erik O'Shaughnessy][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MjSeven](https://github.com/MjSeven) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 158946a3abd3b5fb2d1655cef782a841668a310c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 May 2019 23:16:11 +0800 Subject: [PATCH 0638/1154] APL:20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4 --- ...0190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md index 9e85b82f2c..243ea5e28f 100644 --- a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md +++ b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 04be0276a8a9a107090586d86a2df057878974e0 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Mon, 27 May 2019 17:00:21 +0000 Subject: [PATCH 0639/1154] Revert "LuuMing translating" This reverts commit 0761f24917201fb4cc8e026f01fb1ca9e98e3692. --- .../tech/20170410 Writing a Time Series Database from Scratch.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20170410 Writing a Time Series Database from Scratch.md b/sources/tech/20170410 Writing a Time Series Database from Scratch.md index 7fb7fe9a6a..a7f8289b63 100644 --- a/sources/tech/20170410 Writing a Time Series Database from Scratch.md +++ b/sources/tech/20170410 Writing a Time Series Database from Scratch.md @@ -1,4 +1,3 @@ -LuMing Translating Writing a Time Series Database from Scratch ============================================================ From 00f59d0789c9365e3f3d189db631a8a103acedc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 28 May 2019 07:03:06 +0800 Subject: [PATCH 0640/1154] Translated --- ...29 How to manage your Linux environment.md | 177 ------------------ ...29 How to manage your Linux environment.md | 177 ++++++++++++++++++ 2 files changed, 177 insertions(+), 177 deletions(-) delete mode 100644 sources/tech/20190329 How to manage your Linux environment.md create mode 100644 translated/tech/20190329 How to manage your Linux environment.md diff --git a/sources/tech/20190329 How to manage your Linux environment.md b/sources/tech/20190329 How to manage your Linux environment.md deleted file mode 100644 index 74aab10896..0000000000 --- a/sources/tech/20190329 How to manage your Linux environment.md +++ /dev/null @@ -1,177 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to manage your Linux environment) -[#]: via: (https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html#tk.rss_all) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How to manage your Linux environment -====== - -### Linux user environments help you find the command you need and get a lot done without needing details about how the system is configured. Where the settings come from and how they can be modified is another matter. - -![IIP Photo Archive \(CC BY 2.0\)][1] - -The configuration of your user account on a Linux system simplifies your use of the system in a multitude of ways. You can run commands without knowing where they're located. You can reuse previously run commands without worrying how the system is keeping track of them. You can look at your email, view man pages, and get back to your home directory easily no matter where you might have wandered off to in the file system. And, when needed, you can tweak your account settings so that it works even more to your liking. - -Linux environment settings come from a series of files — some are system-wide (meaning they affect all user accounts) and some are configured in files that are sitting in your home directory. The system-wide settings take effect when you log in and local ones take effect right afterwards, so the changes that you make in your account will override system-wide settings. For bash users, these files include these system files: - -``` -/etc/environment -/etc/bash.bashrc -/etc/profile -``` - -And some of these local files: - -``` -~/.bashrc -~/.profile -- not read if ~/.bash_profile or ~/.bash_login -~/.bash_profile -~/.bash_login -``` - -You can modify any of the local four that exist, since they sit in your home directory and belong to you. - -**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** - -### Viewing your Linux environment settings - -To view your environment settings, use the **env** command. Your output will likely look similar to this: - -``` -$ env -LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33; -01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32: -*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31: -*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31: -*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01; -31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31: -*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31: -*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31: -*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35: -*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35: -*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35: -*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35: -*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35: -*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35: -*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35: -*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36: -*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36: -*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.spf=00;36: -SSH_CONNECTION=192.168.0.21 34975 192.168.0.11 22 -LESSCLOSE=/usr/bin/lesspipe %s %s -LANG=en_US.UTF-8 -OLDPWD=/home/shs -XDG_SESSION_ID=2253 -USER=shs -PWD=/home/shs -HOME=/home/shs -SSH_CLIENT=192.168.0.21 34975 22 -XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop -SSH_TTY=/dev/pts/0 -MAIL=/var/mail/shs -TERM=xterm -SHELL=/bin/bash -SHLVL=1 -LOGNAME=shs -DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus -XDG_RUNTIME_DIR=/run/user/1000 -PATH=/home/shs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin -LESSOPEN=| /usr/bin/lesspipe %s -_=/usr/bin/env -``` - -While you're likely to get a _lot_ of output, the first big section shown above deals with the colors that are used on the command line to identify various file types. When you see something like ***.tar=01;31:** , this tells you that tar files will be displayed in a file listing in red, while ***.jpg=01;35:** tells you that jpg files will show up in purple. These colors are meant to make it easy to pick out certain files from a file listing. You can learn more about these colors are defined and how to customize them at [Customizing your colors on the Linux command line][3]. - -One easy way to turn colors off when you prefer a simpler display is to use a command such as this one: - -``` -$ ls -l --color=never -``` - -That command could easily be turned into an alias: - -``` -$ alias ll2='ls -l --color=never' -``` - -You can also display individual settings using the **echo** command. In this command, we display the number of commands that will be remembered in our history buffer: - -``` -$ echo $HISTSIZE -1000 -``` - -Your last location in the file system will be remembered if you've moved. - -``` -PWD=/home/shs -OLDPWD=/tmp -``` - -### Making changes - -You can make changes to environment settings with a command like this, but add a line lsuch as "HISTSIZE=1234" in your ~/.bashrc file if you want to retain this setting. - -``` -$ export HISTSIZE=1234 -``` - -### What it means to "export" a variable - -Exporting a variable makes the setting available to your shell and possible subshells. By default, user-defined variables are local and are not exported to new processes such as subshells and scripts. The export command makes variables available to functions to child processes. - -### Adding and removing variables - -You can create new variables and make them available to you on the command line and subshells quite easily. However, these variables will not survive your logging out and then back in again unless you also add them to ~/.bashrc or a similar file. - -``` -$ export MSG="Hello, World!" -``` - -You can unset a variable if you need by using the **unset** command: - -``` -$ unset MSG -``` - -If the variable is defined locally, you can easily set it back up by sourcing your startup file(s). For example: - -``` -$ echo $MSG -Hello, World! -$ unset $MSG -$ echo $MSG - -$ . ~/.bashrc -$ echo $MSG -Hello, World! -``` - -### Wrap-up - -User accounts are set up with an appropriate set of startup files for creating a userful user environment, but both individual users and sysadmins can change the default settings by editing their personal setup files (users) or the files from which many of the settings originate (sysadmins). - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html#tk.rss_all - -作者:[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/03/environment-rocks-leaves-100792229-large.jpg -[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua -[3]: https://www.networkworld.com/article/3269587/customizing-your-text-colors-on-the-linux-command-line.html -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190329 How to manage your Linux environment.md b/translated/tech/20190329 How to manage your Linux environment.md new file mode 100644 index 0000000000..a8af83c687 --- /dev/null +++ b/translated/tech/20190329 How to manage your Linux environment.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to manage your Linux environment) +[#]: via: (https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何管理你的 Linux 环境 +====== + +### Linux 用户环境变量帮助你找到你需要的命令,获取很多完成的细节,而不需要知道系统如何配置的。 设置来自哪里和如何被修改它们是另一个课题。 + +![IIP Photo Archive \(CC BY 2.0\)][1] + +在 Linux 系统上的用户配置可以用多种方法简化你的使用。你可以运行命令,而不需要知道它们的位置。你可以重新使用先前运行的命令,而不用发愁系统是如何保持它们的踪迹。你可以查看你的电子邮件,查看手册页,并容易地回到你的 home 目录,而不管你在文件系统可能已经迷失方向。并且,当需要的时候,你可以调整你的账户设置,以便它向着你喜欢的方式来工作。 + +Linux 环境设置来自一系列的文件 — 一些是系统范围(意味着它们影响所有用户账户),一些是配置处于你的 home 目录中文件中。系统范围设置在你登陆时生效,本地设置在以后生效,所以,你在你账户中作出的更改将覆盖系统范围设置。对于 bash 用户,这些文件包含这些系统文件: + +``` +/etc/environment +/etc/bash.bashrc +/etc/profile +``` + +和其中一些本地文件: + +``` +~/.bashrc +~/.profile -- not read if ~/.bash_profile or ~/.bash_login +~/.bash_profile +~/.bash_login +``` + +你可以修改本地存在的四个文件的任何一个,因为它们处于你的 home 目录,并且它们是属于你的。 + +**[ 两分钟 Linux 提示:[学习如何在2分钟视频教程中掌握很多 Linux 命令][2] ]** + +### 查看你的 Linux 环境设置 + +为查看你的环境设置,使用 **env** 命令。你的输出将可能与这相似: + +``` +$ env +LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33; +01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32: +*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31: +*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31: +*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01; +31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31: +*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31: +*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31: +*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35: +*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35: +*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35: +*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35: +*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35: +*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35: +*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35: +*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36: +*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36: +*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.spf=00;36: +SSH_CONNECTION=192.168.0.21 34975 192.168.0.11 22 +LESSCLOSE=/usr/bin/lesspipe %s %s +LANG=en_US.UTF-8 +OLDPWD=/home/shs +XDG_SESSION_ID=2253 +USER=shs +PWD=/home/shs +HOME=/home/shs +SSH_CLIENT=192.168.0.21 34975 22 +XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop +SSH_TTY=/dev/pts/0 +MAIL=/var/mail/shs +TERM=xterm +SHELL=/bin/bash +SHLVL=1 +LOGNAME=shs +DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +XDG_RUNTIME_DIR=/run/user/1000 +PATH=/home/shs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin +LESSOPEN=| /usr/bin/lesspipe %s +_=/usr/bin/env +``` + +虽然你可能会得到大量的输出,第一个大部分用颜色显示上面的细节,颜色被用于命令行上来识别各种各样文件类型。当你看到一些东西,像 ***.tar=01;31:** ,这告诉你 tar 文件将以红色显示在文件列表中,然而 ***.jpg=01;35:** 告诉你 jpg 文件将以紫色显现出来。这些颜色本意是使它易于从一个文件列表中分辨出某些文件。你可以在[在 Linux 命令行中自定义你的颜色][3]处学习更多关于这些颜色的定义,和如何自定义它们, + +当你更喜欢一种不加装饰的显示时,一种简单关闭颜色方法是使用一个命令,例如这一个: + +``` +$ ls -l --color=never +``` + +这个命令可以简单地转换到一个别名: + +``` +$ alias ll2='ls -l --color=never' +``` + +你也可以使用 **echo** 命令来单独地显现设置。在这个命令中,我们显示在历史缓存区中将被记忆命令的数量: + +``` +$ echo $HISTSIZE +1000 +``` + +如果你已经移动,你在文件系统中的最后位置将被记忆。 + +``` +PWD=/home/shs +OLDPWD=/tmp +``` + +### 作出更改 + +你可以使用一个像这样的命令更改环境设置的,但是,如果你希望保持这个设置,在你的 ~/.bashrc 文件中添加一行代码,例如 "HISTSIZE=1234" 。 + +``` +$ export HISTSIZE=1234 +``` + +### "export" 一个变量的本意是什么 + +导出一个变量使设置可用于你的 shell 和可能的子shell。默认情况下,用户定义的变量是本地的,并不被导出到新的进程,例如,子 shell 和脚本。export 命令使变量可用于子进程的函数。 + +### 添加和移除变量 + +你可以创建新的变量,并使它们在命令行和子 shell 上非常容易地可用。然而,这些变量将不存活于你的登出和再次回来,除非你也添加它们到 ~/.bashrc 或一个类似的文件。 + +``` +$ export MSG="Hello, World!" +``` + +如果你需要,你可以使用 **unset** 命令来消除一个变量: + +``` +$ unset MSG +``` + +如果变量被局部定义,你可以通过获得你的启动文件来简单地设置它回来。例如: + +``` +$ echo $MSG +Hello, World! +$ unset $MSG +$ echo $MSG + +$ . ~/.bashrc +$ echo $MSG +Hello, World! +``` + +### 小结 + +用户账户是为创建一个有用的用户环境,而使用一组恰当的启动文件建立,但是,独立的用户和系统管理员都可以通过编辑他们的个人设置文件(对于用户)或很多来自设置起源的文件(对于系统管理员)来更改默认设置。 + +Join the Network World communities on 在 [Facebook][4] 和 [LinkedIn][5] 上加入网络世界社区来评论重要话题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html#tk.rss_all + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者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/03/environment-rocks-leaves-100792229-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: https://www.networkworld.com/article/3269587/customizing-your-text-colors-on-the-linux-command-line.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From d913e2294b3d40f85ccefe56684bc4d841fa3d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 28 May 2019 07:15:08 +0800 Subject: [PATCH 0641/1154] Translating --- sources/tech/20190527 20- FFmpeg Commands For Beginners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190527 20- FFmpeg Commands For Beginners.md b/sources/tech/20190527 20- FFmpeg Commands For Beginners.md index cf8798d96a..5a09ad4a01 100644 --- a/sources/tech/20190527 20- FFmpeg Commands For Beginners.md +++ b/sources/tech/20190527 20- FFmpeg Commands For Beginners.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 712a5b51766b0ecf7a59f6af28991d6da3ac91b7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 28 May 2019 08:49:21 +0800 Subject: [PATCH 0642/1154] translated --- ...g Budgie Desktop on Ubuntu -Quick Guide.md | 116 ------------------ ...g Budgie Desktop on Ubuntu -Quick Guide.md | 116 ++++++++++++++++++ 2 files changed, 116 insertions(+), 116 deletions(-) delete mode 100644 sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md create mode 100644 translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md diff --git a/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md b/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md deleted file mode 100644 index b7a2707cfe..0000000000 --- a/sources/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md +++ /dev/null @@ -1,116 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Installing Budgie Desktop on Ubuntu [Quick Guide]) -[#]: via: (https://itsfoss.com/install-budgie-ubuntu/) -[#]: author: (Atharva Lele https://itsfoss.com/author/atharva/) - -Installing Budgie Desktop on Ubuntu [Quick Guide] -====== - -_**Brief: Learn how to install Budgie desktop on Ubuntu in this step-by-step tutorial.**_ - -Among all the [various Ubuntu versions][1], [Ubuntu Budgie][2] is the most underrated one. It looks elegant and it’s not heavy on resources. - -Read this [Ubuntu Budgie review][3] or simply watch this video to see what Ubuntu Budgie 18.04 looks like. - -[Subscribe to our YouTube channel for more Linux Videos][4] - -If you like [Budgie desktop][5] but you are using some other version of Ubuntu such as the default Ubuntu with GNOME desktop, I have good news for you. You can install Budgie on your current Ubuntu system and switch the desktop environments. - -In this post, I’m going to tell you exactly how to do that. But first, a little introduction to Budgie for those who are unaware about it. - -Budgie desktop environment is developed mainly by [Solus Linux team.][6] It is designed with focus on elegance and modern usage. Budgie is available for all major Linux distributions for users to try and experience this new desktop environment. Budgie is pretty mature by now and provides a great desktop experience. - -Warning - -Installing multiple desktops on the same system MAY result in conflicts and you may see some issue like missing icons in the panel or multiple icons of the same program. - -You may not see any issue at all as well. It’s your call if you want to try different desktop. - -### Install Budgie on Ubuntu - -This method is not tested on Linux Mint, so I recommend that you not follow this guide for Mint. - -For those on Ubuntu, Budgie is now a part of the Ubuntu repositories by default. Hence, we don’t need to add any PPAs in order to get Budgie. - -To install Budgie, simply run this command in terminal. We’ll first make sure that the system is fully updated. - -``` -sudo apt update && sudo apt upgrade -sudo apt install ubuntu-budgie-desktop -``` - -When everything is done downloading, you will get a prompt to choose your display manager. Select ‘lightdm’ to get the full Budgie experience. - -![Select lightdm][7] - -After the installation is complete, reboot your computer. You will be then greeted by the Budgie login screen. Enter your password to go into the homescreen. - -![Budgie Desktop Home][8] - -### Switching to other desktop environments - -![Budgie login screen][9] - -You can click the Budgie icon next to your name to get options for login. From there you can select between the installed Desktop Environments (DEs). In my case, I see Budgie and the default Ubuntu (GNOME) DEs. - -![Select your DE][10] - -Hence whenever you feel like logging into GNOME, you can do so using this menu. - -[][11] - -Suggested read Get Rid of 'snapd returned status code 400: Bad Request' Error in Ubuntu - -### How to Remove Budgie - -If you don’t like Budgie or just want to go back to your regular old Ubuntu, you can switch back to your regular desktop as described in the above section. - -However, if you really want to remove Budgie and its component, you can follow the following commands to get back to a clean slate. - -_**Switch to some other desktop environments before using these commands:**_ - -``` -sudo apt remove ubuntu-budgie-desktop ubuntu-budgie* lightdm -sudo apt autoremove -sudo apt install --reinstall gdm3 -``` - -After running all the commands successfully, reboot your computer. - -Now, you will be back to GNOME or whichever desktop environment you had. - -**What you think of Budgie?** - -Budgie is one of the [best desktop environments for Linux][12]. Hope this short guide helped you install the awesome Budgie desktop on your Ubuntu system. - -If you did install Budgie, what do you like about it the most? Let us know in the comments below. And as usual, any questions or suggestions are always welcome. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-budgie-ubuntu/ - -作者:[Atharva Lele][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/atharva/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/which-ubuntu-install/ -[2]: https://ubuntubudgie.org/ -[3]: https://itsfoss.com/ubuntu-budgie-18-review/ -[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[5]: https://github.com/solus-project/budgie-desktop -[6]: https://getsol.us/home/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_select_dm.png?fit=800%2C559&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_homescreen.jpg?fit=800%2C500&ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_lockscreen.png?fit=800%2C403&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_lockscreen_select_de.png?fit=800%2C403&ssl=1 -[11]: https://itsfoss.com/snapd-error-ubuntu/ -[12]: https://itsfoss.com/best-linux-desktop-environments/ diff --git a/translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md b/translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md new file mode 100644 index 0000000000..7e5d6fbbda --- /dev/null +++ b/translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing Budgie Desktop on Ubuntu [Quick Guide]) +[#]: via: (https://itsfoss.com/install-budgie-ubuntu/) +[#]: author: (Atharva Lele https://itsfoss.com/author/atharva/) + +在 Ubuntu 上安装 Budgie 桌面 [快速指南] +====== + +_ **简介:在这一步步的教程中学习如何在 Ubuntu 上安装 Budgie 桌面。** _ + +在所有[各种 Ubuntu 版本][1]中,[Ubuntu Budgie][2] 是最被低估的版本。它看起来很优雅,而且需要的资源也不多。 + +阅读这篇 [Ubuntu Budgie 的评论][3]或观看此视频,了解 Ubuntu Budgie 18.04 的外观。 + +[Subscribe to our YouTube channel for more Linux Videos][4] + +如果你喜欢 [Budgie 桌面][5]但你正在使用其他版本的 Ubuntu,例如默认的 GNOME 桌面的 Ubuntu,我有个好消息。你可以在当前的 Ubuntu 系统上安装 Budgie 并切换桌面环境。 + +在这篇文章中,我将告诉你到底该怎么做。但首先,对那些不了解 Budgie 的人进行一点介绍。 + +Budgie 桌面环境主要由 [Solus Linux 团队开发][6]。它的设计注重优雅和现代使用。Budgie 适用于所有主流 Linux 发行版,供用户尝试体验这种新的桌面环境。Budgie 现在非常成熟,并提供了出色的桌面体验。 + +警告 + +在同一系统上安装多个桌面可能会导致冲突,你可能会遇到一些问题,如面板中缺少图标或同一程序的多个图标。 + +你也许不会遇到任何问题。是否要尝试不同桌面由你决定。 + +### 在 Ubuntu 上安装 Budgie + +此方法未在 Linux Mint 上进行测试,因此我建议你 Mint 上不要按照此指南进行操作。 + +对于正在使用 Ubuntu 的人,Budgie 现在默认是 Ubuntu 仓库的一部分。因此,我们不需要添加任何 PPA 来下载 Budgie。 + +要安装 Budgie,只需在终端中运行此命令即可。我们首先要确保系统已完全更新。 + +``` +sudo apt update && sudo apt upgrade +sudo apt install ubuntu-budgie-desktop +``` + +下载完成后,你将看到选择显示管理器的提示。选择 “lightdm” 以获得完整的 Budgie 体验。 + +![Select lightdm][7] + +安装完成后,重启计算机。然后,你会看到 Budgie 的登录页面。输入你的密码进入主屏幕。 + +![Budgie Desktop Home][8] + +### 切换到其他桌面环境 + +![Budgie login screen][9] + +你可以单击登录名旁边的 Budgie 图标获取登录选项。在那里,你可以在已安装的桌面环境 (DE) 之间进行选择。就我而言,我看到了 Budgie 和默认的 Ubuntu(GNOME)桌面。 + +![Select your DE][10] + +因此,无论何时你想登录 GNOME,都可以使用此菜单执行此操作。 + +[][11] + +建议阅读:在 Ubuntu中 摆脱 “snapd returned status code 400: Bad Request” 错误。 + +### 如何删除 Budgie + +如果你不喜欢 Budgie 或只是想回到常规的以前的 Ubuntu,你可以如上节所述切换回常规桌面。 + +但是,如果你真的想要删除 Budgie 及其组件,你可以按照以下命令回到之前的状态。 + +_ **在使用这些命令之前先切换到其他桌面环境:** _ + +``` +sudo apt remove ubuntu-budgie-desktop ubuntu-budgie* lightdm +sudo apt autoremove +sudo apt install --reinstall gdm3 +``` + +成功运行所有命令后,重启计算机。 + +现在,你将回到 GNOME 或其他你有的桌面。 + +**你对Budgie有什么看法?** + +Budgie 是[最佳 Linux 桌面环境][12]之一。希望这个简短的指南帮助你在 Ubuntu 上安装了很棒的 Budgie 桌面。 + +如果你安装了 Budgie,你最喜欢它的什么?请在下面的评论中告诉我们。像往常一样,欢迎任何问题或建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-budgie-ubuntu/ + +作者:[Atharva Lele][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/atharva/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/which-ubuntu-install/ +[2]: https://ubuntubudgie.org/ +[3]: https://itsfoss.com/ubuntu-budgie-18-review/ +[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[5]: https://github.com/solus-project/budgie-desktop +[6]: https://getsol.us/home/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_select_dm.png?fit=800%2C559&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_homescreen.jpg?fit=800%2C500&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_lockscreen.png?fit=800%2C403&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_lockscreen_select_de.png?fit=800%2C403&ssl=1 +[11]: https://itsfoss.com/snapd-error-ubuntu/ +[12]: https://itsfoss.com/best-linux-desktop-environments/ From 161da01d742b6b8c53868ca0d0e60dc3e1cf88ee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 May 2019 08:54:10 +0800 Subject: [PATCH 0643/1154] TSL:20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md part --- ...hain 2.0- Blockchain In Real Estate -Part 4.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md index 243ea5e28f..9b752327db 100644 --- a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md +++ b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @@ -7,20 +7,19 @@ [#]: via: (https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/) [#]: author: (EDITOR https://www.ostechnix.com/author/editor/) -Blockchain 2.0: Blockchain In Real Estate [Part 4] +区块链 2.0:房地产区块链(四) ====== ![](https://www.ostechnix.com/wp-content/uploads/2019/03/Blockchain-In-Real-Estate-720x340.png) -### Blockchain 2.0: Smart‘er’ Real Estate +### 区块链 2.0:“更”智能的房地产 -The [**previous article**][1] of this series explored the features of blockchain which will enable institutions to transform and interlace **traditional banking** and **financing systems** with it. This part will explore – **Blockchain in real estate**. The real estate industry is ripe for a revolution. It’s among the most actively traded most significant asset classes known to man. However, filled with regulatory hurdles and numerous possibilities of fraud and deceit, it’s also one of the toughest to participate in. The distributed ledger capabilities of the blockchain utilizing an appropriate consensus algorithm are touted as the way forward for the industry which is traditionally regarded as conservative in its attitude to change. +在本系列的[上一篇文章][1]中探讨了区块链的特征,这些区块链将使机构能够将**传统银行**和**融资系统**转换和交织在一起。这部分将探讨**房地产区块链**。房地产业正在走向革命。它是人类已知的最活跃、交易最重要的资产类别之一。然而,由于充满了监管障碍和欺诈、欺骗的无数可能性,它也是最难参与交易的之一。利用适当的共识算法的区块链的分布式分类账本功能被吹捧为这个行业的前进方向,而这个行业传统上被认为其面对变革是保守的。 -Real estate has always been a very conservative industry in terms of its myriad operations. Somewhat rightfully so as well. A major economic crisis such as the 2008 financial crisis or the great depression from the early half of the 20th century managed to destroy the industry and its participants. However, like most products of economic value, the real estate industry is resilient and this resilience is rooted in its conservative nature. +就其无数的业务而言,房地产一直是一个非常保守的行业。这似乎也是理所当然的。2008 年金融危机或 20 世纪上半叶的大萧条等重大经济危机成功摧毁了该行业及其参与者。然而,与大多数具有经济价值的产品一样,房地产行业具有弹性,而这种弹性则源于其保守性。 -The global real estate market comprises an asset class worth **$228 trillion dollars** [1]. Give or take. Other investment assets such as stocks, bonds, and shares combined are only worth **$170 trillion**. Obviously, any and all transactions implemented in such an industry is naturally carefully planned and meticulously executed, for the most part. For the most part, because real estate is also notorious for numerous instances of fraud and devastating loses which ensue them. The industry because of the very conservative nature of its operations is also tough to navigate. It’s heavily regulated with complex laws creating an intertwined web of nuances that are just too difficult for an average person to understand fully. This makes entry and participation near impossible for most people. If you’ve ever been involved in one such deal, you’ll know how heavy and long the paper trail was. +全球房地产市场包括价值 228 万亿 [^1] 美元的资产类别。给予或接受。其他投资资产,如股票、债券和股票合计价值仅为 170 万亿美元。显然,在这样一个行业中实施的任何和所有交易在很大程度上都是自然精心策划和精心执行的。在大多数情况下,房地产也因许多欺诈事件而臭名昭着,并且随之而来的是毁灭性的损失。由于其运营非常保守,该行业也难以驾驭。它受到严格法律的严格监管,创造了一个交织在一起的细微差别网络,这对于普通人来说太难以完全理解。使得大多数人无法进入和参与。如果你曾参与过这样的交易,那么你就会知道纸质文件的重要性和长期性。 -This hard reality is now set to change, albeit a slow and gradual transformation. The very reasons the industry has stuck to its hardy tested roots all this while can finally give way to its modern-day counterpart. The backbone of the real estate industry has always been its paper records. Land deeds, titles, agreements, rental insurance, proofs, and declarations etc., are just the tip of the iceberg here. If you’ve noticed the pattern here, this should be obvious, the distributed ledger technology that is blockchain, fits in perfectly with the needs here. Forget paper records, conventional database systems are also points of major failure. They can be modified by multiple participants, is not tamper proof or un-hackable, has a complicated set of ever-changing regulatory parameters making auditing and verifying data a nightmare. The blockchain perfectly solves all of these issues and more. Starting with a trivial albeit an important example to show just how bad the current record management practices are in the real estate sector, consider the **Title Insurance business** [2], [3]. Title Insurance is used to hedge against the possibility of the land’s titles and ownership records being inadmissible and hence unenforceable. An insurance product such as this is also referred to as an indemnity cover. It is by law required in many cases that properties have title insurance, especially when dealing with property that has changed hands multiple times over the years. Mortgage firms might insist on the same as well when they back real estate deals. The fact that a product of this kind has existed since the 1850s and that it does business worth at least **$1.5 trillion a year in the US alone** is a testament to the statement at the start. A revolution in terms of how these records are maintained is imperative to have in this situation and the blockchain provides a sustainable solution. Title fraud averages around $100k per case on average as per the **American Land Title Association** and 25% of all titles involved in transactions have an issue regarding their documents[4]. The blockchain allows for setting up an immutable permanent database that will track the property itself, recording each and every transaction or investment that has gone into it. Such a ledger system will make life easier for everyone involved in the real estate industry including one-time home buyers and make financial products such as Title Insurance basically irrelevant. Converting a physical asset such as real estate to a digital asset like this is unconventional and is extant only in theory at the moment. However, such a change is imminent sooner rather than later[5]. @@ -32,7 +31,7 @@ However, another significant and arguably a very democratic change that the bloc However, even with all of that said, Blockchain technology is still in very early stages of adoption in the real estate sector and current regulations are not exactly defined for it to be either[8]. Concepts such as distributed applications, distributed anonymous organizations, smart contracts etc., are unheard of in the legal domain in many countries. A complete overhaul of existing regulations and guidelines once all the stakeholders are well educated on the intricacies of the blockchain is the most pragmatic way forward. Again, it’ll be a slow and gradual change to go through, however a much-needed one nonetheless. The next article of the series will look at how **“Smart Contracts”** , such as those implemented by companies such as UBITQUITY and XYO are created and executed in the blockchain. - +[^1]: HSBC, “Global Real Estate,” no. April, 2008 -------------------------------------------------------------------------------- @@ -47,4 +46,4 @@ via: https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/ [a]: https://www.ostechnix.com/author/editor/ [b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/blockchain-2-0-redefining-financial-services/ +[1]: https://linux.cn/article-10689-1.html From cb57ab1099c3c6db78780b5f6737b0ba694c5752 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 28 May 2019 08:54:12 +0800 Subject: [PATCH 0644/1154] translating --- .../20190527 Dockly - Manage Docker Containers From Terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md b/sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md index 9c5bf68840..55de1756c6 100644 --- a/sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md +++ b/sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a901e9e0425e4f049366c0d0328422a19e2c76df Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 May 2019 09:41:55 +0800 Subject: [PATCH 0645/1154] PRF:20190415 Kubernetes on Fedora IoT with k3s.md @StdioA --- ...90415 Kubernetes on Fedora IoT with k3s.md | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md b/translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md index 82729f24a3..425fc175d9 100644 --- a/translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md +++ b/translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md @@ -1,37 +1,37 @@ [#]: collector: (lujun9972) [#]: translator: (StdioA) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Kubernetes on Fedora IoT with k3s) [#]: via: (https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/) [#]: author: (Lennart Jern https://fedoramagazine.org/author/lennartj/) -使用 k3s 在 Fedora IoT 上运行 Kubernetes +使用 k3s 在 Fedora IoT 上运行 K8S ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/201905/28/094048yrzlik9oek5rbs5s.jpg) -Fedora IoT 是一个即将发布的、面相物联网的 Fedora 版本。去年 Fedora Magazine 中的《如何使用 Fedora IOT 点亮 LED》一文,第一次介绍了它。从那以后,它与 Fedora Silverblue 一起不断改进,以提供针对面相容器的工作流程的不可变基础操作系统。 +Fedora IoT 是一个即将发布的、面向物联网的 Fedora 版本。去年 Fedora Magazine 的《[如何使用 Fedora IoT 点亮 LED 灯][2]》一文第一次介绍了它。从那以后,它与 Fedora Silverblue 一起不断改进,以提供针对面向容器的工作流的不可变基础操作系统。 -Kubernetes 是一个颇受欢迎的容器编排系统。它可能最常用在那些能够处理巨大负载的强劲硬件上。不过,它也能在像树莓派 3 这样轻量级的设备上运行。我们继续阅读,来了解如何运行它。 +Kubernetes 是一个颇受欢迎的容器编排系统。它可能最常用在那些能够处理巨大负载的强劲硬件上。不过,它也能在像树莓派 3 这样轻量级的设备上运行。让我们继续阅读,来了解如何运行它。 ### 为什么用 Kubernetes? -虽然 Kubernetes 在云计算领域风靡一时,但让它在小型单板机上运行可能并不是显而易见的。不过,我们有非常明确的理由来做这件事。首先,这是一个不需要昂贵硬件就可以学习并熟悉 Kubernetes 的好方法;其次,由于它的流行性,市面上有[大量应用][2]进行了预先打包,以用于在 Kubernetes 集群中运行。更不用说,当你遇到问题时,会有大规模的社区用户为你提供帮助。 +虽然 Kubernetes 在云计算领域风靡一时,但让它在小型单板机上运行可能并不是常见的。不过,我们有非常明确的理由来做这件事。首先,这是一个不需要昂贵硬件就可以学习并熟悉 Kubernetes 的好方法;其次,由于它的流行性,市面上有[大量应用][3]进行了预先打包,以用于在 Kubernetes 集群中运行。更不用说,当你遇到问题时,会有大规模的社区用户为你提供帮助。 -最后但同样重要的是,即使是在家庭实验室这样的小规模环境中,容器编排也确实能事情变得更加简单。虽然在学习曲线方面,这一点并不明显,但这些技能在你将来与任何集群打交道的时候都会有帮助。不管你面对的是一个单节点树莓派集群,还是一个大规模的机器学习场,它们的操作方式都是类似的。 +最后但同样重要的是,即使是在家庭实验室这样的小规模环境中,容器编排也确实能够使事情变得更加简单。虽然在学习曲线方面,这一点并不明显,但这些技能在你将来与任何集群打交道的时候都会有帮助。不管你面对的是一个单节点树莓派集群,还是一个大规模的机器学习场,它们的操作方式都是类似的。 #### K3s - 轻量级的 Kubernetes -一个 Kubernetes 的“正常”安装(如果有这么一说的话)对于物联网来说有点沉重。K8s 的推荐内存配置,是每台机器 2GB!不过,我们也有一些替代品,其中一个新人是 [k3s][4]——一个轻量级的 Kubernetes 发行版。 +一个“正常”安装的 Kubernetes(如果有这么一说的话)对于物联网来说有点沉重。K8s 的推荐内存配置,是每台机器 2GB!不过,我们也有一些替代品,其中一个新人是 [k3s][4] —— 一个轻量级的 Kubernetes 发行版。 -K3s 非常特殊,因为它将 etcd 替换成了 SQLite 以满足键值存储需求。还有一点,在于整个 k3s 将使用一个二进制文件分发,而不是每个组件一个。这减少了内存占用并简化了安装过程。基于上述原因,我们只需要 512MB 内存即可运行 k3s,简直适合小型单板电脑! +K3s 非常特殊,因为它将 etcd 替换成了 SQLite 以满足键值存储需求。还有一点,在于整个 k3s 将使用一个二进制文件分发,而不是每个组件一个。这减少了内存占用并简化了安装过程。基于上述原因,我们只需要 512MB 内存即可运行 k3s,极度适合小型单板电脑! ### 你需要的东西 -1. 在虚拟机或实体设备中运行的 Fedora IoT。在[这里][5]可以看到优秀的入门指南。一台机器就足够了,不过两台可以用来测试向集群添加更多节点。 -2. [配置防火墙][6],允许 6443 和 8372 端口的通信。或者,你也可以简单地运行“systemctl stop firewalld”来为这次实验关闭防火墙。 +1. Fedora IoT 运行在虚拟机或实体设备中运行的。在[这里][5]可以看到优秀的入门指南。一台机器就足够了,不过两台可以用来测试向集群添加更多节点。 +2. [配置防火墙][6],允许 6443 和 8372 端口的通信。或者,你也可以简单地运行 `systemctl stop firewalld` 来为这次实验关闭防火墙。 ### 安装 k3s @@ -49,14 +49,14 @@ kubectl get nodes 需要注意的是,有几个选项可以通过环境变量传递给安装脚本。这些选项可以在[文档][7]中找到。当然,你也完全可以直接下载二进制文件来手动安装 k3s。 -对于实验和学习来说,这样已经很棒了,不过单节点的集群也不是一个集群。幸运的是,添加另一个节点并不比设置第一个节点要难。只需要向安装脚本传递两个环境变量,它就可以找到第一个节点,避免运行 k3s 的服务器部分。 +对于实验和学习来说,这样已经很棒了,不过单节点的集群也不能算一个集群。幸运的是,添加另一个节点并不比设置第一个节点要难。只需要向安装脚本传递两个环境变量,它就可以找到第一个节点,而不用运行 k3s 的服务器部分。 ``` curl -sfL https://get.k3s.io | K3S_URL=https://example-url:6443 \ K3S_TOKEN=XXX sh - ``` -上面的 example-url 应被替换为第一个节点的 IP 地址,或一个经过完全限定的域名。在该节点中,(用 XXX 表示的)令牌可以在 /var/lib/rancher/k3s/server/node-token 文件中找到。 +上面的 `example-url` 应被替换为第一个节点的 IP 地址,或一个完全限定域名。在该节点中,(用 XXX 表示的)令牌可以在 `/var/lib/rancher/k3s/server/node-token` 文件中找到。 ### 部署一些容器 @@ -66,19 +66,19 @@ curl -sfL https://get.k3s.io | K3S_URL=https://example-url:6443 \ kubectl create deployment my-server --image nginx ``` -这会从名为“nginx”的容器镜像中创建出一个名叫“my-server”的 [Deployment][8](镜像名默认使用 docker hub 注册中心,以及 latest 标签)。 +这会从名为 `nginx` 的容器镜像中创建出一个名叫 `my-server` 的 [部署][8](默认使用 docker hub 注册中心,以及 `latest` 标签)。 ``` kubectl get pods ``` -为了接触到 pod 中运行的 nginx 服务器,首先将 Deployment 通过一个 [Service][9] 来进行暴露。以下命令将创建一个与 Deployment 同名的 Service。 +为了访问到 pod 中运行的 nginx 服务器,首先通过一个 [服务][9] 来暴露该部署。以下命令将创建一个与该部署同名的服务。 ``` kubectl expose deployment my-server --port 80 ``` -Service 将作为一种负载均衡器和 Pod 的 DNS 记录来工作。比如,当运行第二个 Pod 时,我们只需指定 _my-server_(Service 名称)就可以通过 _curl_ 访问 nginx 服务器。有关如何操作,可以看下面的实例。 +服务将作为一种负载均衡器和 Pod 的 DNS 记录来工作。比如,当运行第二个 Pod 时,我们只需指定 `my-server`(服务名称)就可以通过 `curl` 访问 nginx 服务器。有关如何操作,可以看下面的实例。 ``` # 启动一个 pod,在里面以交互方式运行 bash @@ -90,15 +90,15 @@ curl my-server ### Ingress 控制器及外部 IP -默认状态下,一个 Service 只能获得一个 ClusterIP(只能从集群内部访问),但你也可以通过把它的类型设置为 [LoadBalancer][10] 为服务申请一个外部 IP。不过,并非所有应用都需要自己的 IP 地址。相反,通常可以通过基于 Host 请求头部或请求路径进行路由,从而使多个服务共享一个 IP 地址。你可以在 Kubernetes 使用 [Ingress][11] 完成此操作,而这也是我们要做的。Ingress 也提供了额外的功能,比如无需配置应用,即可对流量进行 TLS 加密。 +默认状态下,一个服务只能获得一个 ClusterIP(只能从集群内部访问),但你也可以通过把它的类型设置为 [LoadBalancer][10] 为该服务申请一个外部 IP。不过,并非所有应用都需要自己的 IP 地址。相反,通常可以通过基于 Host 请求头部或请求路径进行路由,从而使多个服务共享一个 IP 地址。你可以在 Kubernetes 使用 [Ingress][11] 完成此操作,而这也是我们要做的。Ingress 也提供了额外的功能,比如无需配置应用即可对流量进行 TLS 加密。 -Kubernetes 需要入口控制器来使 Ingress 资源工作,k3s 包含 [Traefik][12] 正是出于此目的。它还包含了一个简单的服务负载均衡器,可以为集群中的服务提供外部 IP。这篇[文档][13]描述了这种服务: +Kubernetes 需要 Ingress 控制器来使 Ingress 资源工作,k3s 包含 [Traefik][12] 正是出于此目的。它还包含了一个简单的服务负载均衡器,可以为集群中的服务提供外部 IP。这篇[文档][13]描述了这种服务: > k3s 包含一个使用可用主机端口的基础服务负载均衡器。比如,如果你尝试创建一个监听 80 端口的负载均衡器,它会尝试在集群中寻找一个 80 端口空闲的节点。如果没有可用端口,那么负载均衡器将保持在 Pending 状态。 > > k3s README -入口控制器已经通过这个负载均衡器暴露在外。你可以使用以下命令找到它正在使用的 IP 地址。 +Ingress 控制器已经通过这个负载均衡器暴露在外。你可以使用以下命令找到它正在使用的 IP 地址。 ``` $ kubectl get svc --all-namespaces @@ -109,13 +109,13 @@ NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) kube-system traefik LoadBalancer 10.43.145.104 10.0.0.8 80:31596/TCP,443:31539/TCP 33d ``` -找到名为 traefik 的 Service。在上面的例子中,我们感兴趣的 IP 是 10.0.0.8。 +找到名为 `traefik` 的服务。在上面的例子中,我们感兴趣的 IP 是 10.0.0.8。 ### 路由传入的请求 -让我们创建一个 Ingress,使它通过基于 Host 头部的路由规则将请求路由至我们的服务器。这个例子中我们使用 [xip.io][14] 来避免必要的 DNS 记录配置工作。它的工作原理是将 IP 地址作为子域包含,以使用10.0.0.8.xip.io的任何子域来达到IP 10.0.0.8。换句话说,my-server.10.0.0.8.xip.io 被用于访问集群中的入口控制器。你现在就可以尝试(使用你自己的 IP,而不是 10.0.0.8)。如果没有入口,你应该会访问到“默认后端”,只是一个写着“404 page not found”的页面。 +让我们创建一个 Ingress,使它通过基于 Host 头部的路由规则将请求路由至我们的服务器。这个例子中我们使用 [xip.io][14] 来避免必要的 DNS 记录配置工作。它的工作原理是将 IP 地址作为子域包含,以使用 `10.0.0.8.xip.io` 的任何子域来达到 IP `10.0.0.8`。换句话说,`my-server.10.0.0.8.xip.io` 被用于访问集群中的 Ingress 控制器。你现在就可以尝试(使用你自己的 IP,而不是 10.0.0.8)。如果没有 Ingress,你应该会访问到“默认后端”,只是一个写着“404 page not found”的页面。 -我们可以使用以下 Ingress 让入口控制器将请求路由到我们的 Web 服务器 Service。 +我们可以使用以下 Ingress 让 Ingress 控制器将请求路由到我们的 Web 服务器的服务。 ``` apiVersion: extensions/v1beta1 @@ -133,17 +133,17 @@ spec: servicePort: 80 ``` -将以上片段保存到 _my-ingress.yaml_ 文件中,然后运行以下命令将其加入集群: +将以上片段保存到 `my-ingress.yaml` 文件中,然后运行以下命令将其加入集群: ``` kubectl apply -f my-ingress.yaml ``` -你现在应该能够在你选择的完全限定域名中访问到 nginx 的默认欢迎页面了。在我的例子中,它是 my-server.10.0.0.8.xip.io。入口控制器会通过 Ingress 中包含的信息来路由请求。对 my-server.10.0.0.8.xip.io 的请求将被路由到 Ingress 中定义为“后端”的 Service 和端口(在本例中为 my-server 和 80)。 +你现在应该能够在你选择的完全限定域名中访问到 nginx 的默认欢迎页面了。在我的例子中,它是 `my-server.10.0.0.8.xip.io`。Ingress 控制器会通过 Ingress 中包含的信息来路由请求。对 `my-server.10.0.0.8.xip.io` 的请求将被路由到 Ingress 中定义为 `backend` 的服务和端口(在本例中为 `my-server` 和 `80`)。 ### 那么,物联网呢? -想象如下场景:你的家伙农场周围有很多的设备。它是一个具有各种硬件功能,传感器和执行器的物联网设备的异构集合。也许某些设备拥有摄像头,天气或光线传感器。其它设备可能会被连接起来,用来控制通风、灯光、百叶窗或闪烁的LED。 +想象如下场景:你的家或农场周围有很多的设备。它是一个具有各种硬件功能、传感器和执行器的物联网设备的异构集合。也许某些设备拥有摄像头、天气或光线传感器。其它设备可能会被连接起来,用来控制通风、灯光、百叶窗或闪烁的 LED。 这种情况下,你想从所有传感器中收集数据,在最终使用它来制定决策和控制执行器之前,也可能会对其进行处理和分析。除此之外,你可能还想配置一个仪表盘来可视化那些正在发生的事情。那么 Kubernetes 如何帮助我们来管理这样的事情呢?我们怎么保证 Pod 在合适的设备上运行? @@ -155,13 +155,13 @@ kubectl label nodes = kubectl label nodes node2 camera=available ``` -一旦它们被打上标签,我们就可以轻松地使用 [nodeSelector][15] 为你的工作负载选择合适的节点。拼图的最后一块:如果你想在_所有_合适的节点上运行 Pod,那应该使用 [DaemonSet][16] 而不是 Deployment。换句话说,应为每个使用唯一传感器的数据收集应用程序创建一个 DaemonSet,并使用 nodeSelectors 确保它们仅在具有适当硬件的节点上运行。 +一旦它们被打上标签,我们就可以轻松地使用 [nodeSelector][15] 为你的工作负载选择合适的节点。拼图的最后一块:如果你想在*所有*合适的节点上运行 Pod,那应该使用 [DaemonSet][16] 而不是部署。换句话说,应为每个使用唯一传感器的数据收集应用程序创建一个 DaemonSet,并使用 nodeSelector 确保它们仅在具有适当硬件的节点上运行。 -服务发现功能允许 Pod 通过 Service 名称来寻找彼此,这项功能使得这类分布式系统的管理工作变得易如反掌。你不需要为应用配置 IP 地址或自定义端口,也不需要知道它们。相反,它们可以通过集群中的具名 Service 轻松找到彼此。 +服务发现功能允许 Pod 通过服务名称来寻找彼此,这项功能使得这类分布式系统的管理工作变得易如反掌。你不需要为应用配置 IP 地址或自定义端口,也不需要知道它们。相反,它们可以通过集群中的命名服务轻松找到彼此。 #### 充分利用空闲资源 -随着集群的启动并运行,收集数据并控制灯光和气候可能使你觉得你已经把它完成了。不过,集群中还有大量的计算资源可以用于其它项目。这才是 Kubernetes 真正出彩的地方。 +随着集群的启动并运行,收集数据并控制灯光和气候,可能使你觉得你已经把它完成了。不过,集群中还有大量的计算资源可以用于其它项目。这才是 Kubernetes 真正出彩的地方。 你不必担心这些资源的确切位置,或者去计算是否有足够的内存来容纳额外的应用程序。这正是编排系统所解决的问题!你可以轻松地在集群中部署更多的应用,让 Kubernetes 来找出适合运行它们的位置(或是否适合运行它们)。 @@ -182,14 +182,14 @@ via: https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/ 作者:[Lennart Jern][a] 选题:[lujun9972][b] 译者:[StdioA](https://github.com/StdioA) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://fedoramagazine.org/author/lennartj/ [b]: https://github.com/lujun9972 [1]: https://fedoramagazine.org/wp-content/uploads/2019/04/k3s-1-816x345.png -[2]: https://fedoramagazine.org/turnon-led-fedora-iot/ +[2]: https://linux.cn/article-10380-1.html [3]: https://hub.helm.sh/ [4]: https://k3s.io [5]: https://docs.fedoraproject.org/en-US/iot/getting-started/ From ab6a6fe8b235c9e64b049d058d3d3fc745af1961 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 May 2019 09:43:09 +0800 Subject: [PATCH 0646/1154] PUB:20190415 Kubernetes on Fedora IoT with k3s.md @StdioA https://linux.cn/article-10908-1.html --- .../20190415 Kubernetes on Fedora IoT with k3s.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190415 Kubernetes on Fedora IoT with k3s.md (99%) diff --git a/translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md b/published/20190415 Kubernetes on Fedora IoT with k3s.md similarity index 99% rename from translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md rename to published/20190415 Kubernetes on Fedora IoT with k3s.md index 425fc175d9..a8293d4d3b 100644 --- a/translated/tech/20190415 Kubernetes on Fedora IoT with k3s.md +++ b/published/20190415 Kubernetes on Fedora IoT with k3s.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (StdioA) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10908-1.html) [#]: subject: (Kubernetes on Fedora IoT with k3s) [#]: via: (https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/) [#]: author: (Lennart Jern https://fedoramagazine.org/author/lennartj/) From dbd9118c8156584d4b8e499dbfccd96fccc1353a Mon Sep 17 00:00:00 2001 From: cycoe Date: Tue, 28 May 2019 15:17:29 +0800 Subject: [PATCH 0647/1154] translating by cycoe --- .../20190427 Monitoring CPU and GPU Temperatures on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md b/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md index 89f942ce66..dcc3cec871 100644 --- a/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md +++ b/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cycoe) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c1ac757c7b1827c1b49026879698ca8f00338ba7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 28 May 2019 20:00:20 +0800 Subject: [PATCH 0648/1154] translating --- sources/tech/20190411 Be your own certificate authority.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190411 Be your own certificate authority.md b/sources/tech/20190411 Be your own certificate authority.md index f6ea26aba4..9ecdd54315 100644 --- a/sources/tech/20190411 Be your own certificate authority.md +++ b/sources/tech/20190411 Be your own certificate authority.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7ffa5d2b5268716c851b1f1629c70b42e2c1e48e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 May 2019 22:29:06 +0800 Subject: [PATCH 0649/1154] TSL:20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md --- ... 2.0- Blockchain In Real Estate -Part 4.md | 49 ---------------- ... 2.0- Blockchain In Real Estate -Part 4.md | 56 +++++++++++++++++++ 2 files changed, 56 insertions(+), 49 deletions(-) delete mode 100644 sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md create mode 100644 translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md diff --git a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md deleted file mode 100644 index 9b752327db..0000000000 --- a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md +++ /dev/null @@ -1,49 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Blockchain 2.0: Blockchain In Real Estate [Part 4]) -[#]: via: (https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/) -[#]: author: (EDITOR https://www.ostechnix.com/author/editor/) - -区块链 2.0:房地产区块链(四) -====== - -![](https://www.ostechnix.com/wp-content/uploads/2019/03/Blockchain-In-Real-Estate-720x340.png) - -### 区块链 2.0:“更”智能的房地产 - -在本系列的[上一篇文章][1]中探讨了区块链的特征,这些区块链将使机构能够将**传统银行**和**融资系统**转换和交织在一起。这部分将探讨**房地产区块链**。房地产业正在走向革命。它是人类已知的最活跃、交易最重要的资产类别之一。然而,由于充满了监管障碍和欺诈、欺骗的无数可能性,它也是最难参与交易的之一。利用适当的共识算法的区块链的分布式分类账本功能被吹捧为这个行业的前进方向,而这个行业传统上被认为其面对变革是保守的。 - -就其无数的业务而言,房地产一直是一个非常保守的行业。这似乎也是理所当然的。2008 年金融危机或 20 世纪上半叶的大萧条等重大经济危机成功摧毁了该行业及其参与者。然而,与大多数具有经济价值的产品一样,房地产行业具有弹性,而这种弹性则源于其保守性。 - -全球房地产市场包括价值 228 万亿 [^1] 美元的资产类别。给予或接受。其他投资资产,如股票、债券和股票合计价值仅为 170 万亿美元。显然,在这样一个行业中实施的任何和所有交易在很大程度上都是自然精心策划和精心执行的。在大多数情况下,房地产也因许多欺诈事件而臭名昭着,并且随之而来的是毁灭性的损失。由于其运营非常保守,该行业也难以驾驭。它受到严格法律的严格监管,创造了一个交织在一起的细微差别网络,这对于普通人来说太难以完全理解。使得大多数人无法进入和参与。如果你曾参与过这样的交易,那么你就会知道纸质文件的重要性和长期性。 - - -Starting with a trivial albeit an important example to show just how bad the current record management practices are in the real estate sector, consider the **Title Insurance business** [2], [3]. Title Insurance is used to hedge against the possibility of the land’s titles and ownership records being inadmissible and hence unenforceable. An insurance product such as this is also referred to as an indemnity cover. It is by law required in many cases that properties have title insurance, especially when dealing with property that has changed hands multiple times over the years. Mortgage firms might insist on the same as well when they back real estate deals. The fact that a product of this kind has existed since the 1850s and that it does business worth at least **$1.5 trillion a year in the US alone** is a testament to the statement at the start. A revolution in terms of how these records are maintained is imperative to have in this situation and the blockchain provides a sustainable solution. Title fraud averages around $100k per case on average as per the **American Land Title Association** and 25% of all titles involved in transactions have an issue regarding their documents[4]. The blockchain allows for setting up an immutable permanent database that will track the property itself, recording each and every transaction or investment that has gone into it. Such a ledger system will make life easier for everyone involved in the real estate industry including one-time home buyers and make financial products such as Title Insurance basically irrelevant. Converting a physical asset such as real estate to a digital asset like this is unconventional and is extant only in theory at the moment. However, such a change is imminent sooner rather than later[5]. - -Among the areas in which blockchain will have the most impact within real estate is as highlighted above in maintaining a transparent and secure title management system for properties. A blockchain based record of the property can contain information about the property, its location, history of ownership, and any related public record of the same[6]. This will permit closing real estate deals fast and obliviates the need for 3rd party monitoring and oversight. Tasks such as real estate appraisal and tax calculations become matters of tangible objective parameters rather than subjective measures and guesses because of reliable historical data which is publicly verifiable. **UBITQUITY** is one such platform that offers customized blockchain-based solutions to enterprise customers. The platform allows customers to keep track of all property details, payment records, mortgage records and even allows running smart contracts that’ll take care of taxation and leasing automatically[7]. - -This brings us to the second biggest opportunity and use case of blockchains in real estate. Since the sector is highly regulated by numerous 3rd parties apart from the counterparties involved in the trade, due-diligence and financial evaluations can be significantly time-consuming. These processes are predominantly carried out using offline channels and paperwork needs to travel for days before a final evaluation report comes out. This is especially true for corporate real estate deals and forms a bulk of the total billable hours charged by consultants. In case the transaction is backed by a mortgage, duplication of these processes is unavoidable. Once combined with digital identities for the people and institutions involved along with the property, the current inefficiencies can be avoided altogether and transactions can take place in a matter of seconds. The tenants, investors, institutions involved, consultants etc., could individually validate the data and arrive at a critical consensus thereby validating the property records for perpetuity[8]. This increases the accuracy of verification manifold. Real estate giant **RE/MAX** has recently announced a partnership with service provider **XYO Network Partners** for building a national database of real estate listings in Mexico. They hope to one day create one of the largest (as of yet) decentralized real estate title registry in the world[9]. - -However, another significant and arguably a very democratic change that the blockchain can bring about is with respect to investing in real estate. Unlike other investment asset classes where even small household investors can potentially participate, real estate often requires large hands-down payments to participate. Companies such as **ATLANT** and **BitOfProperty** tokenize the book value of a property and convert them into equivalents of a cryptocurrency. These tokens are then put for sale on their exchanges similar to how stocks and shares are traded. Any cash flow that the real estate property generates afterward is credited or debited to the token owners depending on their “share” in the property[4]. - -However, even with all of that said, Blockchain technology is still in very early stages of adoption in the real estate sector and current regulations are not exactly defined for it to be either[8]. Concepts such as distributed applications, distributed anonymous organizations, smart contracts etc., are unheard of in the legal domain in many countries. A complete overhaul of existing regulations and guidelines once all the stakeholders are well educated on the intricacies of the blockchain is the most pragmatic way forward. Again, it’ll be a slow and gradual change to go through, however a much-needed one nonetheless. The next article of the series will look at how **“Smart Contracts”** , such as those implemented by companies such as UBITQUITY and XYO are created and executed in the blockchain. - -[^1]: HSBC, “Global Real Estate,” no. April, 2008 - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/ - -作者:[EDITOR][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/editor/ -[b]: https://github.com/lujun9972 -[1]: https://linux.cn/article-10689-1.html diff --git a/translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md new file mode 100644 index 0000000000..bb560c72d4 --- /dev/null +++ b/translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0: Blockchain In Real Estate [Part 4]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/) +[#]: author: (ostechnix https://www.ostechnix.com/author/editor/) + +区块链 2.0:房地产区块链(四) +====== + +![](https://www.ostechnix.com/wp-content/uploads/2019/03/Blockchain-In-Real-Estate-720x340.png) + +### 区块链 2.0:“更”智能的房地产 + +在本系列的[上一篇文章][1]中探讨了区块链的特征,这些区块链将使机构能够将**传统银行**和**融资系统**转换和交织在一起。这部分将探讨**房地产区块链**。房地产业正在走向革命。它是人类已知的最活跃、交易最重要的资产类别之一。然而,由于充满了监管障碍和欺诈、欺骗的无数可能性,它也是最难参与交易的之一。利用适当的共识算法的区块链的分布式分类账本功能被吹捧为这个行业的前进方向,而这个行业传统上被认为其面对变革是保守的。 + +就其无数的业务而言,房地产一直是一个非常保守的行业。这似乎也是理所当然的。2008 年金融危机或 20 世纪上半叶的大萧条等重大经济危机成功摧毁了该行业及其参与者。然而,与大多数具有经济价值的产品一样,房地产行业具有弹性,而这种弹性则源于其保守性。 + +全球房地产市场包括价值 228 万亿 [^1] 美元的资产类别。给予或接受。其他投资资产,如股票、债券和股票合计价值仅为 170 万亿美元。显然,在这样一个行业中实施的任何和所有交易在很大程度上都是自然精心策划和精心执行的。在大多数情况下,房地产也因许多欺诈事件而臭名昭着,并且随之而来的是毁灭性的损失。由于其运营非常保守,该行业也难以驾驭。它受到严格法律的严格监管,创造了一个交织在一起的细微差别网络,这对于普通人来说太难以完全理解。使得大多数人无法进入和参与。如果你曾参与过这样的交易,那么你就会知道纸质文件的重要性和长期性。 + +从一个微不足道的开始,虽然是一个重要的例子,以显示当前的记录管理实践在房地产行业有多糟糕,考虑一下[产权保险业务][2][^3]。产权保险用于对冲土地所有权和所有权记录不可接受且从而无法执行的可能性。诸如此类的保险产品也称为赔偿保险。在许多情况下,法律要求财产拥有产权保险,特别是在处理多年来多次易手的财产时。抵押贷款公司在支持房地产交易时也可能坚持同样的要求。事实上,这种产品自 19 世纪 50 年代就已存在,并且仅在美国每年至少有 1.5 万亿美元的商业价值这一事实证明了一开始的说法。在这种情况下,这些记录的维护方式必须进行改革,区块链提供了一个可持续解决方案。根据[美国土地产权协会][4],平均每个案例的欺诈平均约为 10 万美元,并且涉及交易的所有产权中有 25% 的文件存在问题。区块链允许设置一个不可变的永久数据库,该数据库将跟踪属性本身,记录已经进入的每个交易或投资。这样的分类帐本系统将使包括一次性购房者在内的房地产行业的每个人的生活更加轻松,并使诸如产权保险等金融产品基本上无关紧要。将诸如房地产之类的实物资产转换为这样的数字资产是非常规的,并且目前仅在理论上存在。然而,这种变化迫在眉睫,而不是迟到[^5]。 + +区块链在房地产中影响最大的领域如上所述,在维护透明和安全的产权管理系统方面。基于区块链的财产记录可以包含有关财产、其所在地、所有权历史以及相同公共记录的[信息][6]。这将允许快速完成房地产交易,并且无需第三方监控和监督。房地产评估和税收计算等任务成为有形的客观参数的问题,而不是主观测量和猜测,因为可靠的历史数据是可公开验证的。[UBITQUITY][7] 就是这样一个平台,为企业客户提供定制的基于区块链的解决方案。该平台允许客户跟踪所有房产细节、付款记录、抵押记录,甚至允许运行智能合约,自动处理税收和租赁。 + +这为我们带来了房地产区块链的第二大机遇和用例。由于该行业受到众多第三方的高度监管,除了参与交易的交易对手外,尽职调查和财务评估可能非常耗时。这些流程主要使用离线渠道进行,文书工作需要在最终评估报告出来之前进行数天。对于公司房地产交易尤其如此,这构成了顾问收取的总计费时间的大部分。如果交易由抵押支持,则这些过程的重复是不可避免的。一旦与所涉及的人员和机构的数字身份相结合,就可以完全避免当前的低效率,并且可以在几秒钟内完成交易。租户、投资者、相关机构、顾问等可以单独验证数据并达成一致的共识,从而验证永久性的财产记录[^8]。这提高了验证流形的准确性。房地产巨头 RE/MAX 最近宣布与服务提供商 XYO Network Partners 合作,[建立墨西哥房地产上市国家数据库][9]。他们希望有朝一日能够创建世界上最大的(截至目前)去中心化房地产登记处之一。 + +然而,区块链可以带来的另一个重要且可以说是非常民主的变化是投资房地产。与其他投资资产类别不同,即使是小型家庭投资者也可能参与其中,房地产通常需要大量的手工付款才能参与。诸如 ATLANT 和 BitOfProperty 之类的公司将房产的账面价值代币化并将其转换为加密货币的等价物。这些代币随后在交易所出售,类似于股票和股票的交易方式。[房地产后续产生的任何现金流都会根据其在财产中的“份额”记入贷方或借记给代币所有者][4]。 + +然而,尽管如此,区块链技术仍处于房地产领域的早期采用阶段,目前的法规还没有明确定义它。诸如分布式应用程序、分布式匿名组织(DAO)、智能合约等概念在许多国家的法律领域是闻所未闻的。一旦所有利益相关者充分接受了区块链复杂性的良好教育,就会彻底改革现有的法规和指导方针,这是最务实的前进方式。 同样,这将是一个缓慢而渐进的变化,但不过是一个急需的变化。本系列的下一篇文章将介绍 “智能合约”,例如由 UBITQUITY 和 XYO 等公司实施的那些是如何在区块链中创建和执行的。 + +[^1]: HSBC, “Global Real Estate,” no. April, 2008 +[^3]: D. B. Burke, Law of title insurance. Aspen Law & Business, 2000. +[^5]: M. Swan, O’Reilly – Blockchain. Blueprint for a New Economy – 2015. +[^8]: Deloite, “Blockchain in commercial real estate The future is here ! Table of contents.” + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/ + +作者:[EDITOR][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10689-1.html +[2]: https://www.forbes.com/sites/jordanlulich/2018/06/21/what-is-title-insurance-and-why-its-important/#1472022b12bb +[4]: https://www.cbinsights.com/research/blockchain-real-estate-disruption/#financing +[6]: https://www2.deloitte.com/us/en/pages/financial-services/articles/blockchain-in-commercial-real-estate.html +[7]: https://www.ubitquity.io/ +[9]: https://www.businesswire.com/news/home/20181012005068/en/XYO-Network-Partners-REMAX-M%C3%A9xico-Bring-Blockchain From 0365015f620360eb1f18c1c77de3fc8302c6d688 Mon Sep 17 00:00:00 2001 From: LuMing <784315443@qq.com> Date: Wed, 29 May 2019 00:13:35 +0800 Subject: [PATCH 0650/1154] translated by LuuMing --- ...ing a Time Series Database from Scratch.md | 438 ------------------ ...ing a Time Series Database from Scratch.md | 431 +++++++++++++++++ 2 files changed, 431 insertions(+), 438 deletions(-) delete mode 100644 sources/tech/20170410 Writing a Time Series Database from Scratch.md create mode 100644 translated/tech/20170410 Writing a Time Series Database from Scratch.md diff --git a/sources/tech/20170410 Writing a Time Series Database from Scratch.md b/sources/tech/20170410 Writing a Time Series Database from Scratch.md deleted file mode 100644 index a7f8289b63..0000000000 --- a/sources/tech/20170410 Writing a Time Series Database from Scratch.md +++ /dev/null @@ -1,438 +0,0 @@ -Writing a Time Series Database from Scratch -============================================================ - - -I work on monitoring. In particular on [Prometheus][2], a monitoring system that includes a custom time series database, and its integration with [Kubernetes][3]. - -In many ways Kubernetes represents all the things Prometheus was designed for. It makes continuous deployments, auto scaling, and other features of highly dynamic environments easily accessible. The query language and operational model, among many other conceptual decisions make Prometheus particularly well-suited for such environments. Yet, if monitored workloads become significantly more dynamic, this also puts new strains on monitoring system itself. With this in mind, rather than doubling back on problems Prometheus already solves well, we specifically aim to increase its performance in environments with highly dynamic, or transient services. - -Prometheus's storage layer has historically shown outstanding performance, where a single server is able to ingest up to one million samples per second as several million time series, all while occupying a surprisingly small amount of disk space. While the current storage has served us well, I propose a newly designed storage subsystem that corrects for shortcomings of the existing solution and is equipped to handle the next order of scale. - -> Note: I've no background in databases. What I say might be wrong and mislead. You can channel your criticism towards me (fabxc) in #prometheus on Freenode. - -### Problems, Problems, Problem Space - -First, a quick outline of what we are trying to accomplish and what key problems it raises. For each, we take a look at Prometheus' current approach, what it does well, and which problems we aim to address with the new design. - -### Time series data - -We have a system that collects data points over time. - -``` -identifier -> (t0, v0), (t1, v1), (t2, v2), (t3, v3), .... -``` - -Each data point is a tuple of a timestamp and a value. For the purpose of monitoring, the timestamp is an integer and the value any number. A 64 bit float turns out to be a good representation for counter as well as gauge values, so we go with that. A sequence of data points with strictly monotonically increasing timestamps is a series, which is addressed by an identifier. Our identifier is a metric name with a dictionary of  _label dimensions_ . Label dimensions partition the measurement space of a single metric. Each metric name plus a unique set of labels is its own  _time series_  that has a value stream associated with it. - -This is a typical set of series identifiers that are part of metric counting requests: - -``` -requests_total{path="/status", method="GET", instance=”10.0.0.1:80”} -requests_total{path="/status", method="POST", instance=”10.0.0.3:80”} -requests_total{path="/", method="GET", instance=”10.0.0.2:80”} -``` - -Let's simplify this representation right away: A metric name can be treated as just another label dimension — `__name__` in our case. At the query level, it might be be treated specially but that doesn't concern our way of storing it, as we will see later. - -``` -{__name__="requests_total", path="/status", method="GET", instance=”10.0.0.1:80”} -{__name__="requests_total", path="/status", method="POST", instance=”10.0.0.3:80”} -{__name__="requests_total", path="/", method="GET", instance=”10.0.0.2:80”} -``` - -When querying time series data, we want to do so by selecting series by their labels. In the simplest case `{__name__="requests_total"}` selects all series belonging to the `requests_total` metric. For all selected series, we retrieve data points within a specified time window. -In more complex queries, we may wish to select series satisfying several label selectors at once and also represent more complex conditions than equality. For example, negative (`method!="GET"`) or regular expression matching (`method=~"PUT|POST"`). - -This largely defines the stored data and how it is recalled. - -### Vertical and Horizontal - -In a simplified view, all data points can be laid out on a two-dimensional plane. The  _horizontal_  dimension represents the time and the series identifier space spreads across the  _vertical_  dimension. - -``` -series - ^ - │ . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="GET"} - │ . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="POST"} - │ . . . . . . . - │ . . . . . . . . . . . . . . . . . . . ... - │ . . . . . . . . . . . . . . . . . . . . . - │ . . . . . . . . . . . . . . . . . . . . . {__name__="errors_total", method="POST"} - │ . . . . . . . . . . . . . . . . . {__name__="errors_total", method="GET"} - │ . . . . . . . . . . . . . . - │ . . . . . . . . . . . . . . . . . . . ... - │ . . . . . . . . . . . . . . . . . . . . - v - <-------------------- time ---------------------> -``` - -Prometheus retrieves data points by periodically scraping the current values for a set of time series. The entity from which we retrieve such a batch is called a  _target_ . Thereby, the write pattern is completely vertical and highly concurrent as samples from each target are ingested independently. -To provide some measurement of scale: A single Prometheus instance collects data points from tens of thousands of  _targets_ , which expose hundreds to thousands of different time series each. - -At the scale of collecting millions of data points per second, batching writes is a non-negotiable performance requirement. Writing single data points scattered across our disk would be painfully slow. Thus, we want to write larger chunks of data in sequence. -This is an unsurprising fact for spinning disks, as their head would have to physically move to different sections all the time. While SSDs are known for fast random writes, they actually can't modify individual bytes but only write in  _pages_  of 4KiB or more. This means writing a 16 byte sample is equivalent to writing a full 4KiB page. This behavior is part of what is known as [ _write amplification_ ][4], which as a bonus causes your SSD to wear out – so it wouldn't just be slow, but literally destroy your hardware within a few days or weeks. -For more in-depth information on the problem, the blog series ["Coding for SSDs" series][5] is a an excellent resource. Let's just consider the main take away: sequential and batched writes are the ideal write pattern for spinning disks and SSDs alike. A simple rule to stick to. - -The querying pattern is significantly more differentiated than the write the pattern. We can query a single datapoint for a single series, a single datapoint for 10000 series, weeks of data points for a single series, weeks of data points for 10000 series, etc. So on our two-dimensional plane, queries are neither fully vertical or horizontal, but a rectangular combination of the two. -[Recording rules][6] mitigate the problem for known queries but are not a general solution for ad-hoc queries, which still have to perform reasonably well. - -We know that we want to write in batches, but the only batches we get are vertical sets of data points across series. When querying data points for a series over a time window, not only would it be hard to figure out where the individual points can be found, we'd also have to read from a lot of random places on disk. With possibly millions of touched samples per query, this is slow even on the fastest SSDs. Reads will also retrieve more data from our disk than the requested 16 byte sample. SSDs will load a full page, HDDs will at least read an entire sector. Either way, we are wasting precious read throughput. -So ideally, samples for the same series would be stored sequentially so we can just scan through them with as few reads as possible. On top, we only need to know where this sequence starts to access all data points. - -There's obviously a strong tension between the ideal pattern for writing collected data to disk and the layout that would be significantly more efficient for serving queries. It is  _the_  fundamental problem our TSDB has to solve. - -#### Current solution - -Time to take a look at how Prometheus's current storage, let's call it "V2", addresses this problem. -We create one file per time series that contains all of its samples in sequential order. As appending single samples to all those files every few seconds is expensive, we batch up 1KiB chunks of samples for a series in memory and append those chunks to the individual files, once they are full. This approach solves a large part of the problem. Writes are now batched, samples are stored sequentially. It also enables incredibly efficient compression formats, based on the property that a given sample changes only very little with respect to the previous sample in the same series. Facebook's paper on their Gorilla TSDB describes a similar chunk-based approach and [introduces a compression format][7] that reduces 16 byte samples to an average of 1.37 bytes. The V2 storage uses various compression formats including a variation of Gorilla’s. - -``` - ┌──────────┬─────────┬─────────┬─────────┬─────────┐ series A - └──────────┴─────────┴─────────┴─────────┴─────────┘ - ┌──────────┬─────────┬─────────┬─────────┬─────────┐ series B - └──────────┴─────────┴─────────┴─────────┴─────────┘ - . . . - ┌──────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ series XYZ - └──────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ - chunk 1 chunk 2 chunk 3 ... -``` - -While the chunk-based approach is great, keeping a separate file for each series is troubling the V2 storage for various reasons: - -* We actually need a lot more files than the number of time series we are currently collecting data for. More on that in the section on "Series Churn". With several million files, sooner or later way may run out of [inodes][1] on our filesystem. This is a condition we can only recover from by reformatting our disks, which is as invasive and disruptive as it could be. We generally want to avoid formatting disks specifically to fit a single application. -* Even when chunked, several thousands of chunks per second are completed and ready to be persisted. This still requires thousands of individual disk writes every second. While it is alleviated by also batching up several completed chunks for a series, this in return increases the total memory footprint of data which is waiting to be persisted. -* It's infeasible to keep all files open for reads and writes. In particular because ~99% of data is never queried again after 24 hours. If it is queried though though, we have to open up to thousands of files, find and read relevant data points into memory, and close them again. As this would result in high query latencies, data chunks are cached rather aggressively leading to problems outlined further in the section on "Resource Consumption". -* Eventually, old data has to be deleted and data needs to be removed from the front of millions of files. This means that deletions are actually write intensive operations. Additionally, cycling through millions of files and analyzing them makes this a process that often takes hours. By the time it completes, it might have to start over again. Oh yea, and deleting the old files will cause further write amplification for your SSD! -* Chunks that are currently accumulating are only held in memory. If the application crashes, data will be lost. To avoid this, the memory state is periodically checkpointed to disk, which may take significantly longer than the window of data loss we are willing to accept. Restoring the checkpoint may also take several minutes, causing painfully long restart cycles. - -The key take away from the existing design is the concept of chunks, which we most certainly want to keep. The most recent chunks always being held in memory is also generally good. After all, the most recent data is queried the most by a large margin. -Having one file per time series is a concept we would like to find an alternative to. - -### Series Churn - -In the Prometheus context, we use the term  _series churn_  to describe that a set of time series becomes inactive, i.e. receives no more data points, and a new set of active series appears instead. -For example, all series exposed by a given microservice instance have a respective “instance” label attached that identifies its origin. If we perform a rolling update of our microservice and swap out every instance with a newer version, series churn occurs. In more dynamic environments those events may happen on an hourly basis. Cluster orchestration systems like Kubernetes allow continuous auto-scaling and frequent rolling updates of applications, potentially creating tens of thousands of new application instances, and with them completely new sets of time series, every day. - -``` -series - ^ - │ . . . . . . - │ . . . . . . - │ . . . . . . - │ . . . . . . . - │ . . . . . . . - │ . . . . . . . - │ . . . . . . - │ . . . . . . - │ . . . . . - │ . . . . . - │ . . . . . - v - <-------------------- time ---------------------> -``` - -So even if the entire infrastructure roughly remains constant in size, over time there's a linear growth of time series in our database. While a Prometheus server will happily collect data for 10 million time series, query performance is significantly impacted if data has to be found among a billion series. - -#### Current solution - -The current V2 storage of Prometheus has an index based on LevelDB for all series that are currently stored. It allows querying series containing a given label pair, but lacks a scalable way to combine results from different label selections. -For example, selecting all series with label `__name__="requests_total"` works efficiently, but selecting all series with `instance="A" AND __name__="requests_total"` has scalability problems. We will later revisit what causes this and which tweaks are necessary to improve lookup latencies. - -This problem is in fact what spawned the initial hunt for a better storage system. Prometheus needed an improved indexing approach for quickly searching hundreds of millions of time series. - -### Resource consumption - -Resource consumption is one of the consistent topics when trying to scale Prometheus (or anything, really). But it's not actually the absolute resource hunger that is troubling users. In fact, Prometheus manages an incredible throughput given its requirements. The problem is rather its relative unpredictability and instability in face of changes. By its architecture the V2 storage slowly builds up chunks of sample data, which causes the memory consumption to ramp up over time. As chunks get completed, they are written to disk and can be evicted from memory. Eventually, Prometheus's memory usage reaches a steady state. That is until the monitored environment changes —  _series churn_  increases the usage of memory, CPU, and disk IO every time we scale an application or do a rolling update. -If the change is ongoing, it will yet again reach a steady state eventually but it will be significantly higher than in a more static environment. Transition periods are often multiple hours long and it is hard to determine what the maximum resource usage will be. - -The approach of having a single file per time series also makes it way too easy for a single query to knock out the Prometheus process. When querying data that is not cached in memory, the files for queried series are opened and the chunks containing relevant data points are read into memory. If the amount of data exceeds the memory available, Prometheus quits rather ungracefully by getting OOM-killed. -After the query is completed the loaded data can be released again but it is generally cached much longer to serve subsequent queries on the same data faster. The latter is a good thing obviously. - -Lastly, we looked at write amplification in the context of SSDs and how Prometheus addresses it by batching up writes to mitigate it. Nonetheless, in several places it still causes write amplification by having too small batches and not aligning data precisely on page boundaries. For larger Prometheus servers, a reduced hardware lifetime was observed in the real world. Chances are that this is still rather normal for database applications with high write throughput, but we should keep an eye on whether we can mitigate it. - -### Starting Over - -By now we have a good idea of our problem domain, how the V2 storage solves it, and where its design has issues. We also saw some great concepts that we want to adapt more or less seamlessly. A fair amount of V2's problems can be addressed with improvements and partial redesigns, but to keep things fun (and after carefully evaluating my options, of course), I decided to take a stab at writing an entire time series database — from scratch, i.e. writing bytes to the file system. - -The critical concerns of performance and resource usage are a direct consequence of the chosen storage format. We have to find the right set of algorithms and disk layout for our data to implement a well-performing storage layer. - -This is where I take the shortcut and drive straight to the solution — skip the headache, failed ideas, endless sketching, tears, and despair. - -### V3 — Macro Design - -What's the macro layout of our storage? In short, everything that is revealed when running `tree` on our data directory. Just looking at that gives us a surprisingly good picture of what is going on. - -``` -$ tree ./data -./data -├── b-000001 -│ ├── chunks -│ │ ├── 000001 -│ │ ├── 000002 -│ │ └── 000003 -│ ├── index -│ └── meta.json -├── b-000004 -│ ├── chunks -│ │ └── 000001 -│ ├── index -│ └── meta.json -├── b-000005 -│ ├── chunks -│ │ └── 000001 -│ ├── index -│ └── meta.json -└── b-000006 - ├── meta.json - └── wal - ├── 000001 - ├── 000002 - └── 000003 -``` - -At the top level, we have a sequence of numbered blocks, prefixed with `b-`. Each block obviously holds a file containing an index and a "chunk" directory holding more numbered files. The “chunks” directory contains nothing but raw chunks of data points for various series. Just as for V2, this makes reading series data over a time windows very cheap and allows us to apply the same efficient compression algorithms. The concept has proven to work well and we stick with it. Obviously, there is no longer a single file per series but instead a handful of files holds chunks for many of them. -The existence of an “index” file should not be surprising. Let's just assume it contains a lot of black magic allowing us to find labels, their possible values, entire time series and the chunks holding their data points. - -But why are there several directories containing the layout of index and chunk files? And why does the last one contain a "wal" directory instead? Understanding those two questions, solves about 90% of our problems. - -#### Many Little Databases - -We partition our  _horizontal_  dimension, i.e. the time space, into non-overlapping blocks. Each block acts as a fully independent database containing all time series data for its time window. Hence, it has its own index and set of chunk files. - -``` - -t0 t1 t2 t3 now - ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ - │ │ │ │ │ │ │ │ ┌────────────┐ - │ │ │ │ │ │ │ mutable │ <─── write ──── ┤ Prometheus │ - │ │ │ │ │ │ │ │ └────────────┘ - └───────────┘ └───────────┘ └───────────┘ └───────────┘ ^ - └──────────────┴───────┬──────┴──────────────┘ │ - │ query - │ │ - merge ─────────────────────────────────────────────────┘ -``` - -Every block of data is immutable. Of course, we must be able to add new series and samples to the most recent block as we collect new data. For this block, all new data is written to an in-memory database that provides the same lookup properties as our persistent blocks. The in-memory data structures can be updated efficiently. To prevent data loss, all incoming data is also written to a temporary  _write ahead log_ , which is the set of files in our “wal” directory, from which we can re-populate the in-memory database on restart. -All these files come with their own serialization format, which comes with all the things one would expect: lots of flags, offsets, varints, and CRC32 checksums. Good fun to come up with, rather boring to read about. - -This layout allows us to fan out queries to all blocks relevant to the queried time range. The partial results from each block are merged back together to form the overall result. - -This horizontal partitioning adds a few great capabilities: - -* When querying a time range, we can easily ignore all data blocks outside of this range. It trivially addresses the problem of  _series churn_  by reducing the set of inspected data to begin with. -* When completing a block, we can persist the data from our in-memory database by sequentially writing just a handful of larger files. We avoid any write-amplification and serve SSDs and HDDs equally well. -* We keep the good property of V2 that recent chunks, which are queried most, are always hot in memory. -* Nicely enough, we are also no longer bound to the fixed 1KiB chunk size to better align data on disk. We can pick any size that makes the most sense for the individual data points and chosen compression format. -* Deleting old data becomes extremely cheap and instantaneous. We merely have to delete a single directory. Remember, in the old storage we had to analyze and re-write up to hundreds of millions of files, which could take hours to converge. - -Each block also contains a `meta.json` file. It simply holds human-readable information about the block to easily understand the state of our storage and the data it contains. - -##### mmap - -Moving from millions of small files to a handful of larger allows us to keep all files open with little overhead. This unblocks the usage of [`mmap(2)`][8], a system call that allows us to transparently back a virtual memory region by file contents. For simplicity, you might want to think of it like swap space, just that all our data is on disk already and no writes occur when swapping data out of memory. - -This means we can treat all contents of our database as if they were in memory without occupying any physical RAM. Only if we access certain byte ranges in our database files, the operating system lazily loads pages from disk. This puts the operating system in charge of all memory management related to our persisted data. Generally, it is more qualified to make such decisions, as it has the full view on the entire machine and all its processes. Queried data can be rather aggressively cached in memory, yet under memory pressure the pages will be evicted. If the machine has unused memory, Prometheus will now happily cache the entire database, yet will immediately return it once another application needs it. -Therefore, queries can longer easily OOM our process by querying more persisted data than fits into RAM. The memory cache size becomes fully adaptive and data is only loaded once the query actually needs it. - -From my understanding, this is how a lot of databases work today and an ideal way to do it if the disk format allows — unless one is confident to outsmart the OS from within the process. We certainly get a lot of capabilities with little work from our side. - -#### Compaction - -The storage has to periodically "cut" a new block and write the previous one, which is now completed, onto disk. Only after the block was successfully persisted, the write ahead log files, which are used to restore in-memory blocks, are deleted. -We are interested in keeping each block reasonably short (about two hours for a typical setup) to avoid accumulating too much data in memory. When querying multiple blocks, we have to merge their results into an overall result. This merge procedure obviously comes with a cost and a week-long query should not have to merge 80+ partial results. - -To achieve both, we introduce  _compaction_ . Compaction describes the process of taking one or more blocks of data and writing them into a, potentially larger, block. It can also modify existing data along the way, e.g. dropping deleted data, or restructuring our sample chunks for improved query performance. - -``` - -t0 t1 t2 t3 t4 now - ┌────────────┐ ┌──────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ - │ 1 │ │ 2 │ │ 3 │ │ 4 │ │ 5 mutable │ before - └────────────┘ └──────────┘ └───────────┘ └───────────┘ └───────────┘ - ┌─────────────────────────────────────────┐ ┌───────────┐ ┌───────────┐ - │ 1 compacted │ │ 4 │ │ 5 mutable │ after (option A) - └─────────────────────────────────────────┘ └───────────┘ └───────────┘ - ┌──────────────────────────┐ ┌──────────────────────────┐ ┌───────────┐ - │ 1 compacted │ │ 3 compacted │ │ 5 mutable │ after (option B) - └──────────────────────────┘ └──────────────────────────┘ └───────────┘ -``` - -In this example we have the sequential blocks `[1, 2, 3, 4]`. Blocks 1, 2, and 3 can be compacted together and the new layout is `[1, 4]`. Alternatively, compact them in pairs of two into `[1, 3]`. All time series data still exist but now in fewer blocks overall. This significantly reduces the merging cost at query time as fewer partial query results have to be merged. - -#### Retention - -We saw that deleting old data was a slow process in the V2 storage and put a toll on CPU, memory, and disk alike. How can we drop old data in our block based design? Quite simply, by just deleting the directory of a block that has no data within our configured retention window. In the example below, block 1 can safely be deleted, whereas 2 has to stick around until it falls fully behind the boundary. - -``` - | - ┌────────────┐ ┌────┼─────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ - │ 1 │ │ 2 | │ │ 3 │ │ 4 │ │ 5 │ . . . - └────────────┘ └────┼─────┘ └───────────┘ └───────────┘ └───────────┘ - | - | - retention boundary -``` - -The older data gets, the larger the blocks may become as we keep compacting previously compacted blocks. An upper limit has to be applied so blocks don’t grow to span the entire database and thus diminish the original benefits of our design. -Conveniently, this also limits the total disk overhead of blocks that are partially inside and partially outside of the retention window, i.e. block 2 in the example above. When setting the maximum block size at 10% of the total retention window, our total overhead of keeping block 2 around is also bound by 10%. - -Summed up, retention deletion goes from very expensive, to practically free. - -> _If you've come this far and have some background in databases, you might be asking one thing by now: Is any of this new? — Not really; and probably for the better._ -> -> _The pattern of batching data up in memory, tracked in a write ahead log, and periodically flushed to disk is ubiquitous today._ -> _The benefits we have seen apply almost universally regardless of the data's domain specifics. Prominent open source examples following this approach are LevelDB, Cassandra, InfluxDB, or HBase. The key takeaway is to avoid reinventing an inferior wheel, researching proven methods, and applying them with the right twist._ -> _Running out of places to add your own magic dust later is an unlikely scenario._ - -### The Index - -The initial motivation to investigate storage improvements were the problems brought by  _series churn_ . The block-based layout reduces the total number of series that have to be considered for serving a query. So assuming our index lookup was of complexity  _O(n^2)_ , we managed to reduce the  _n_  a fair amount and now have an improved complexity of  _O(n^2)_  — uhm, wait... damnit. -A quick flashback to "Algorithms 101" reminds us that this, in theory, did not buy us anything. If things were bad before, they are just as bad now. Theory can be depressing. - -In practice, most of our queries will already be answered significantly faster. Yet, queries spanning the full time range remain slow even if they just need to find a handful of series. My original idea, dating back way before all this work was started, was a solution to exactly this problem: we need a more capable [ _inverted index_ ][9]. -An inverted index provides a fast lookup of data items based on a subset of their contents. Simply put, I can look up all series that have a label `app=”nginx"` without having to walk through every single series and check whether it contains that label. - -For that, each series is assigned a unique ID by which it can be retrieved in constant time, i.e. O(1). In this case the ID is our  _forward index_ . - -> Example: If the series with IDs 10, 29, and 9 contain the label `app="nginx"`, the inverted index for the label "nginx" is the simple list `[10, 29, 9]`, which can be used to quickly retrieve all series containing the label. Even if there were 20 billion further series, it would not affect the speed of this lookup. - -In short, if  _n_  is our total number of series, and  _m_  is the result size for a given query, the complexity of our query using the index is now  _O(m)_ . Queries scaling along the amount of data they retrieve ( _m_ ) instead of the data body being searched ( _n_ ) is a great property as  _m_  is generally significantly smaller. -For brevity, let’s assume we can retrieve the inverted index list itself in constant time. - -Actually, this is almost exactly the kind of inverted index V2 has and a minimum requirement to serve performant queries across millions of series. The keen observer will have noticed, that in the worst case, a label exists in all series and thus  _m_  is, again, in  _O(n)_ . This is expected and perfectly fine. If you query all data, it naturally takes longer. Things become problematic once we get involved with more complex queries. - -#### Combining Labels - -Labels associated with millions of series are common. Suppose a horizontally scaling “foo” microservice with hundreds of instances with thousands of series each. Every single series will have the label `app="foo"`. Of course, one generally won't query all series but restrict the query by further labels, e.g. I want to know how many requests my service instances received and query `__name__="requests_total" AND app="foo"`. - -To find all series satisfying both label selectors, we take the inverted index list for each and intersect them. The resulting set will typically be orders of magnitude smaller than each input list individually. As each input list has the worst case size O(n), the brute force solution of nested iteration over both lists, has a runtime of O(n^2). The same cost applies for other set operations, such as the union (`app="foo" OR app="bar"`). When adding further label selectors to the query, the exponent increases for each to O(n^3), O(n^4), O(n^5), ... O(n^k). A lot of tricks can be played to minimize the effective runtime by changing the execution order. The more sophisticated, the more knowledge about the shape of the data and the relationships between labels is needed. This introduces a lot of complexity, yet does not decrease our algorithmic worst case runtime. - -This is essentially the approach in the V2 storage and luckily a seemingly slight modification is enough gain significant improvements. What happens if we assume that the IDs in our inverted indices are sorted? - -Suppose this example of lists for our initial query: - -``` -__name__="requests_total" -> [ 9999, 1000, 1001, 2000000, 2000001, 2000002, 2000003 ] - app="foo" -> [ 1, 3, 10, 11, 12, 100, 311, 320, 1000, 1001, 10002 ] - - intersection => [ 1000, 1001 ] -``` - -The intersection is fairly small. We can find it by setting a cursor at the beginning of each list and always advancing the one at the smaller number. When both numbers are equal, we add the number to our result and advance both cursors. Overall, we scan both lists in this zig-zag pattern and thus have a total cost of  _O(2n) = O(n)_  as we only ever move forward in either list. - -The procedure for more than two lists of different set operations works similarly. So the number of  _k_  set operations merely modifies the factor ( _O(k*n)_ ) instead of the exponent ( _O(n^k)_ ) of our worst-case lookup runtime. A great improvement. -What I described here is a simplified version of the canonical search index used by practically any [full text search engine][10] out there. Every series descriptor is treated as a short "document", and every label (name + fixed value) as a "word" inside of it. We can ignore a lot of additional data typically encountered in search engine indices, such as word position and frequency data. -Seemingly endless research exists on approaches improving the practical runtime, often making some assumptions about the input data. Unsurprisingly, there are also plenty of techniques to compress inverted indices that come with their own benefits and drawbacks. As our "documents" are tiny and the “words” are hugely repetitive across all series, compression becomes almost irrelevant. For example, a real-world dataset of ~4.4 million series with about 12 labels each has less than 5,000 unique labels. For our initial storage version, we stick to the basic approach without compression, and just a few simple tweaks added to skip over large ranges of non-intersecting IDs. - -While keeping the IDs sorted may sound simple, it is not always a trivial invariant to keep up. For instance, the V2 storage assigns hashes as IDs to new series and we cannot efficiently build up sorted inverted indices. -Another daunting task is modifying the indices on disk as data gets deleted or updated. Typically, the easiest approach is to simply recompute and rewrite them but doing so while keeping the database queryable and consistent. The V3 storage does exactly this by having a separate immutable index per block that is only modified via rewrite on compaction. Only the indices for the mutable blocks, which are held entirely in memory, need to be updated. - -### Benchmarking - -I started initial development of the storage with a benchmark based on ~4.4 million series descriptors extracted from a real world data set and generated synthetic data points to feed into those series. This iteration just tested the stand-alone storage and was crucial to quickly identify performance bottlenecks and trigger deadlocks only experienced under highly concurrent load. - -After the conceptual implementation was done, the benchmark could sustain a write throughput of 20 million data points per second on my Macbook Pro — all while a dozen Chrome tabs and Slack were running. So while this sounded all great it also indicated that there's no further point in pushing this benchmark (or running it in a less random environment for that matter). After all, it is synthetic and thus not worth much beyond a good first impression. Starting out about 20x above the initial design target, it was time to embed this into an actual Prometheus server, adding all the practical overhead and flakes only experienced in more realistic environments. - -We actually had no reproducible benchmarking setup for Prometheus, in particular none that allowed A/B testing of different versions. Concerning in hindsight, but [now we have one][11]! - -Our tool allows us to declaratively define a benchmarking scenario, which is then deployed to a Kubernetes cluster on AWS. While this is not the best environment for all-out benchmarking, it certainly reflects our user base better than dedicated bare metal servers with 64 cores and 128GB of memory. -We deploy two Prometheus 1.5.2 servers (V2 storage) and two Prometheus servers from the 2.0 development branch (V3 storage). Each Prometheus server runs on a dedicated machine with an SSD. A horizontally scaled application exposing typical microservice metrics is deployed to worker nodes. Additionally, the Kubernetes cluster itself and the nodes are being monitored. The whole setup is supervised by yet another Meta-Prometheus, monitoring each Prometheus server for health and performance. -To simulate series churn, the microservice is periodically scaled up and down to remove old pods and spawn new pods, exposing new series. Query load is simulated by a selection of "typical" queries, run against one server of each Prometheus version. - -Overall the scaling and querying load as well as the sampling frequency significantly exceed today's production deployments of Prometheus. For instance, we swap out 60% of our microservice instances every 15 minutes to produce series churn. This would likely only happen 1-5 times a day in a modern infrastructure. This ensures that our V3 design is capable of handling the workloads of the years ahead. As a result, the performance differences between Prometheus 1.5.2 and 2.0 are larger than in a more moderate environment. -In total, we are collecting about 110,000 samples per second from 850 targets exposing half a million series at a time. - -After leaving this setup running for a while, we can take a look at the numbers. We evaluate several metrics over the first 12 hours within both versiones reached a steady state. - -> Be aware of the slightly truncated Y axis in screen shots from the Prometheus graph UI. - - ![Heap usage GB](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/heap_usage.png) -> _Heap memory usage in GB_ - -Memory usage is the most troubling resource for users today as it is relatively unpredictable and it may cause the process to crash. -Obviously, the queried servers are consuming more memory, which can largely be attributed to overhead of the query engine, which will be subject to future optimizations. Overall, Prometheus 2.0's memory consumption is reduced by 3-4x. After about six hours, there is a clear spike in Prometheus 1.5, which aligns with the our retention boundary at six hours. As deletions are quite costly, resource consumption ramps up. This will become visible throughout various other graphs below. - - ![CPU usage cores](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/cpu_usage.png) -> _CPU usage in cores/second_ - -A similar pattern shows for CPU usage, but the delta between queried and non-queried servers is more significant. Averaging at about 0.5 cores/sec while ingesting about 110,000 samples/second, our new storage becomes almost negligible compared to the cycles spent on query evaluation. In total the new storage needs 3-10 times fewer CPU resources. - - ![Disk writes](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/disk_writes.png) ->_Disk writes in MB/second_ - -The by far most dramatic and unexpected improvement shows in write utilization of our disk. It clearly shows why Prometheus 1.5 is prone to wear out SSDs. We see an initial ramp-up as soon as the first chunks are persisted into the series files and a second ramp-up once deletion starts rewriting them. Surprisingly, the queried and non-queried server show a very different utilization. -Prometheus 2.0 on the other hand, merely writes about a single Megabyte per second to its write ahead log. Writes periodically spike when blocks are compacted to disk. Overall savings: staggering 97-99%. - - ![Disk usage](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/disk_usage.png) -> _Disk size in GB_ - -Closely related to disk writes is the total amount of occupied disk space. As we are using almost the same compression algorithm for samples, which is the bulk of our data, they should be about the same. In a more stable setup that would largely be true, but as we are dealing with high  _series churn_ , there's also the per-series overhead to consider. -As we can see, Prometheus 1.5 ramps up storage space a lot faster before both versions reach a steady state as the retention kicks in. Prometheus 2.0 seems to have a significantly lower overhead per individual series. We can nicely see how space is linearly filled up by the write ahead log and instantaneously drops as its gets compacted. The fact that the lines for both Prometheus 2.0 servers do not exactly match is a fact that needs further investigation. - -This all looks quite promising. The important piece left is query latency. The new index should have improved our lookup complexity. What has not substantially changed is processing of this data, e.g. in `rate()` functions or aggregations. Those aspects are part of the query engine. - - ![Query latency](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/query_latency.png) ->_99th percentile query latency in seconds_ - -Expectations are completely met by the data. In Prometheus 1.5 the query latency increases over time as more series are stored. It only levels off once retention starts and old series are deleted. In contrast, Prometheus 2.0 stays in place right from the beginning. -Some caution must be taken on how this data was collected. The queries fired against the servers were chosen by estimating a good mix of range and instant queries, doing heavier and more lightweight computations, and touching few or many series. It does not necessarily represent a real-world distribution of queries. It is also not representative for queries hitting cold data and we can assume that all sample data is practically always hot in memory in either storage. -Nonetheless, we can say with good confidence, that the overall query performance became very resilient to series churn and improved by up to 4x in our straining benchmarking scenario. In a more static environment, we can assume query time to be mostly spent in the query engine itself and the improvement to be notably lower. - - ![Ingestion rate](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/ingestion_rate.png) ->_Ingested samples/second_ - -Lastly, a quick look into our ingestion rates of the different Prometheus servers. We can see that both servers with the V3 storage have the same ingestion rate. After a few hours it becomes unstable, which is caused by various nodes of the benchmarking cluster becoming unresponsive due to high load rather than the Prometheus instances. (The fact that both 2.0 lines exactly match is hopefully convincing enough.) -Both Prometheus 1.5.2 servers start suffering from significant drops in ingestion rate even though more CPU and memory resources are available. The high stress of series churn causes a larger amount of data to not be collected. - -But what's the  _absolute maximum_  number of samples per second you could ingest now? - -I don't know — and deliberately don't care. - -There are a lot of factors that shape the data flowing into Prometheus and there is no single number capable of capturing quality. Maximum ingestion rate has historically been a metric leading to skewed benchmarks and neglect of more important aspects such as query performance and resilience to series churn. The rough assumption that resource usage increases linearly was confirmed by some basic testing. It is easy to extrapolate what could be possible. - -Our benchmarking setup simulates a highly dynamic environment stressing Prometheus more than most real-world setups today. The results show we went way above our initial design goal, while running on non-optimal cloud servers. Ultimately, success will be determined by user feedback rather than benchmarking numbers. - -> Note:  _At time of writing this, Prometheus 1.6 is in development, which will allow configuring the maximum memory usage more reliably and may notably reduce overall consumption in favor of slightly increased CPU utilization. I did not repeat the tests against this as the overall results still hold, especially when facing high series churn._ - -### Conclusion - -Prometheus sets out to handle high cardinality of series and throughput of individual samples. It remains a challenging task, but the new storage seems to position us well for the hyper-scale, hyper-convergent, GIFEE infrastructure of the futu... well, it seems to work pretty well. - -A [first alpha release of Prometheus 2.0][12] with the new V3 storage is available for testing. Expect crashes, deadlocks, and other bugs at this early stage. - -The code for the storage itself can be found [in a separate project][13]. It's surprisingly agnostic to Prometheus itself and could be widely useful for a wider range of applications looking for an efficient local storage time series database. - -> _There's a long list of people to thank for their contributions to this work. Here they go in no particular order:_ -> -> _The groundlaying work by Bjoern Rabenstein and Julius Volz on the V2 storage engine and their feedback on V3 was fundamental to everything seen in this new generation._ -> -> _Wilhelm Bierbaum's ongoing advice and insight contributed significantly to the new design. Brian Brazil's continous feedback ensured that we ended up with a semantically sound approach. Insightful discussions with Peter Bourgon validated the design and shaped this write-up._ -> -> _Not to forget my entire team at CoreOS and the company itself for supporting and sponsoring this work. Thanks to everyone who listened to my ramblings about SSDs, floats, and serialization formats again and again._ - - --------------------------------------------------------------------------------- - -via: https://fabxc.org/blog/2017-04-10-writing-a-tsdb/ - -作者:[Fabian Reinartz ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://twitter.com/fabxc -[1]:https://en.wikipedia.org/wiki/Inode -[2]:https://prometheus.io/ -[3]:https://kubernetes.io/ -[4]:https://en.wikipedia.org/wiki/Write_amplification -[5]:http://codecapsule.com/2014/02/12/coding-for-ssds-part-1-introduction-and-table-of-contents/ -[6]:https://prometheus.io/docs/practices/rules/ -[7]:http://www.vldb.org/pvldb/vol8/p1816-teller.pdf -[8]:https://en.wikipedia.org/wiki/Mmap -[9]:https://en.wikipedia.org/wiki/Inverted_index -[10]:https://en.wikipedia.org/wiki/Search_engine_indexing#Inverted_indices -[11]:https://github.com/prometheus/prombench -[12]:https://prometheus.io/blog/2017/04/10/promehteus-20-sneak-peak/ -[13]:https://github.com/prometheus/tsdb diff --git a/translated/tech/20170410 Writing a Time Series Database from Scratch.md b/translated/tech/20170410 Writing a Time Series Database from Scratch.md new file mode 100644 index 0000000000..3ebf00a14f --- /dev/null +++ b/translated/tech/20170410 Writing a Time Series Database from Scratch.md @@ -0,0 +1,431 @@ +从零写一个时间序列数据库 +============================================================ + + +我从事监控工作。特别是在 [Prometheus][2] 上,监控系统包含一个自定义的时间序列数据库,并且集成在 [Kubernetes][3] 上。 + +在许多方面上 Kubernetes 展现出了所有 Prometheus 的设计用途。它使得持续部署continuous deployments弹性伸缩auto scaling和其他高动态环境highly dynamic environments下的功能可以轻易地访问。在众多概念上的决策中,查询语句和操作模型使得 Prometheus 特别适合这种环境。但是,如果监控的工作负载动态程度显著地增加,这就会给监控系统本身带来新的压力。记住了这一点,而不是回过头来看 Prometheus 已经解决的很好的问题,我们就可以明确目标去提升它高动态或瞬态服务transient services环境下的表现。 + +Prometheus 的存储层在很长一段时间里都展现出卓越的性能,单一服务器就能够以每秒数百多万个时间序列的速度摄入多达一百万个样本,同时只占用了很少的磁盘空间。尽管当前的存储做的很好,但我依旧提出一个新设计的存储子系统,它更正了现存解决方案的缺点,并具备处理更大规模数据的能力。 + +注释:我没有数据库方面的背景。我说的东西可能是错的并让你误入歧途。你可以在 Freenode 的 #prometheus 频道上提出你的批评(fabxc) + +### 问题,难题,问题域 + +首先,快速地概览一下我们要完成的东西和它的关键难题。我们可以先看一下 Prometheus 当前的做法 ,它为什么做的这么好,以及我们打算用新设计解决哪些问题。 + +### 时间序列数据 + +我们有一个收集一段时间数据的系统。 + +``` +identifier -> (t0, v0), (t1, v1), (t2, v2), (t3, v3), .... +``` + +每个数据点是一个时间戳和值的元组。在监控中,时间戳是一个整数,值可以是任意数字。64 位浮点数对于计数器和测量值来说是一个好的表示方法,因此我们将会使用它。一系列严格单调递增的时间戳数据点是一个序列,它由标识符所引用。我们的标识符是一个带有标签维度label dimensions字典的度量名称。标签维度分开了单一指标的测量空间。每一个指标名称加上一个独一无二的标签集就成了它自己的时间序列,它有一个与之关联的数据流value stream。 + +这是一个典型的序列标识符series identifiers 集,它是统计请求指标的一部分: + +``` +requests_total{path="/status", method="GET", instance=”10.0.0.1:80”} +requests_total{path="/status", method="POST", instance=”10.0.0.3:80”} +requests_total{path="/", method="GET", instance=”10.0.0.2:80”} +``` + +让我们简化一下表示方法:度量名称可以当作另一个维度标签,在我们的例子中是 `__name__`。对于查询语句,可以对它进行特殊处理,但与我们存储的方式无关,我们后面也会见到。 + +``` +{__name__="requests_total", path="/status", method="GET", instance=”10.0.0.1:80”} +{__name__="requests_total", path="/status", method="POST", instance=”10.0.0.3:80”} +{__name__="requests_total", path="/", method="GET", instance=”10.0.0.2:80”} +``` + +我们想通过标签来查询时间序列数据。在最简单的情况下,使用 `{__name__="requests_total"}` 选择所有属于 `requests_total` 指标的数据。对于所有选择的序列,我们在给定的时间窗口内获取数据点。 +在更复杂的语句中,我们或许想一次性选择满足多个标签的序列,并且表示比相等条件更复杂的情况。例如,非语句(`method!="GET"`)或正则表达式匹配(`method=~"PUT|POST"`)。 + +这些在很大程度上定义了存储的数据和它的获取方式。 + +### 纵与横 + +在简化的视图中,所有的数据点可以分布在二维平面上。水平维度代表着时间,序列标识符域经纵轴展开。 + +``` +series + ^ + │ . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="GET"} + │ . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="POST"} + │ . . . . . . . + │ . . . . . . . . . . . . . . . . . . . ... + │ . . . . . . . . . . . . . . . . . . . . . + │ . . . . . . . . . . . . . . . . . . . . . {__name__="errors_total", method="POST"} + │ . . . . . . . . . . . . . . . . . {__name__="errors_total", method="GET"} + │ . . . . . . . . . . . . . . + │ . . . . . . . . . . . . . . . . . . . ... + │ . . . . . . . . . . . . . . . . . . . . + v + <-------------------- time ---------------------> +``` + +Prometheus 通过定期地抓取一组时间序列的当前值来获取数据点。我们获取到的实体称为目标。因此,写入模式完全地垂直且高度并发,因为来自每个目标的样本是独立摄入的。这里提供一些测量的规模:单一 Prometheus 实例从成千上万的目标中收集数据点,每个数据点都暴露在成百上千个不同的时间序列中。 + +在每秒采集数百万数据点这种规模下,批量写入是一个不能妥协的性能要求。在磁盘上分散地写入单个数据点会相当地缓慢。因此,我们想要按顺序写入更大的数据块。 +对于旋转式磁盘,它的磁头始终得物理上地向不同的扇区上移动,这是一个不足为奇的事实。而我们都知道 SSD 具有快速随机写入的特点,但事实上它不能修改单独的字节,只能写入一页 4KiB 或更多的数据量。这就意味着写入 16 字节的样本相当于写入满满一个 4Kib 的页。这一行为部分上属于[写入放大][4],这种特性会损耗你的 SSD。因此它不仅影响速度,而且还毫不夸张地在几天或几个周内破坏掉你的硬件。 +关于此问题更深层次的资料,[“Coding for SSDs”系列][5]博客是极好的资源。让我们想想有什么收获:顺序写入和批量写入对于旋转式磁盘和 SSD 来说都是理想的写入模式。大道至简。 + +查询模式比起写入模式千差万别。我们可以查询单一序列的一个数据点,也可以为 10000 个序列查询一个数据点,还可以查询一个序列几个周的数据点,甚至是 10000 个序列几个周的数据点。因此在我们的二维平面上,查询范围不是完全水平或垂直的,而是二者形成矩形似的组合。 +[记录规则][6]减轻了已知查询的问题,但对于点对点ad-hoc查询来说并不是一个通用的解决方法。 + +我们知道自己想要批量地写入,但我们得到的仅仅是一系列垂直数据点的集合。当查询一段时间窗口内的数据点时,我们不仅很难弄清楚在哪才能找到这些单独的点,而且不得不从磁盘上大量随机的地方读取。也许一条查询语句会有数百万的样本,即使在最快的 SSD 上也会很慢。读入也会从磁盘上获取更多的数据而不仅仅是 16 字节的样本。SSD 会加载一整页,HDD 至少会读取整个扇区。不论哪一种,我们都在浪费宝贵的读吞吐量。 +因此在理想上,相同序列的样本将按顺序存储,这样我们就能通过尽可能少的读取来扫描它们。在上层,我们仅需要知道序列的起始位置就能访问所有的数据点。 + +显然,将收集到的数据写入磁盘的理想模式与能够显著提高查询效率的布局之间存在着很强的张力。这是我们 TSDB 需要解决的一个基本问题。 + +#### 当前的解法 + +是时候看一下当前 Prometheus 是如何存储数据来解决这一问题的,让我们称它为“V2”。 +我们创建一个时间序列的文件,它包含所有样本并按顺序存储。因为每几秒附加一个样本数据到所有文件中非常昂贵,我们打包 1Kib 样本序列的数据块在内存中,一旦打包完成就附加这些数据块到单独的文件中。这一方法解决了大部分问题。写入目前是批量的,样本也是按顺序存储的。它还支持非常高效的压缩格式,基于给定的同一序列的样本相对之前的数据仅发生非常小的改变这一特性。Facebook 在他们 Gorilla TSDB 上的论文中描述了一个相似的基于数据块的方法,并且[引入了一种压缩格式][7],它能够减少 16 字节的样本到平均 1.37 字节。V2 存储使用了包含 Gorilla 等的各种压缩格式。 + +``` + ┌──────────┬─────────┬─────────┬─────────┬─────────┐ series A + └──────────┴─────────┴─────────┴─────────┴─────────┘ + ┌──────────┬─────────┬─────────┬─────────┬─────────┐ series B + └──────────┴─────────┴─────────┴─────────┴─────────┘ + . . . + ┌──────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ series XYZ + └──────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ + chunk 1 chunk 2 chunk 3 ... +``` + +尽管基于块存储的方法非常棒,但为每个序列保存一个独立的文件会给 V2 存储带来麻烦,因为: + +* 我们实际上需要比当前收集的时间序列数目使用更多的文件。多出的部分在序列分流Series Churn上。拥有几百万个文件,迟早会使用光文件系统中的 [inodes][1]。这种情况我们只可以通过重新格式化来恢复磁盘,这种方式是最具有破坏性的。我们通常想要避免为了适应一个应用程序而格式化磁盘。 +* 即使是分块写入,每秒也会产生几千万块的数据块并且准备持久化。这依然需要每秒数千个次的磁盘写入量。尽管通过为每个序列打包好多个块来缓解,但反过来还是增加了等待持久化数据的总内存占用。 +* 要保持所有文件的打开状态进行读写是不可行的。特别是因为 99% 的数据在 24 小时之后不再会被查询到。如果它还是被查询到,我们就得打开数千个文件,找到并读取相关的数据点到内存中,然后再关掉。这样做就会引起很高的查询延迟,数据块缓存加剧会导致新的问题,这一点在“资源消耗”一节另作讲述。 +* 最终,旧的数据需要被删除并且数据需要从数百万文件的头部删除。这就意味着删除实际上是高强度的写入操作。此外,循环遍历数百万文件并且进行分析通常会导致这一过程花费数小时。当它完成时,可能又得重新来过。喔天,继续删除旧文件又会进一步导致 SSD 产生写入放大。 +* 目前所积累的数据块仅维持在内存中。如果应用崩溃,数据就会丢失。为了避免这种情况,内存状态会定期的保存在磁盘上,这比我们能接受数据丢失的时间要长的多。恢复检查点也会花费数分钟,导致很长的重启周期。 + +我们能够从现有的设计中学到的关键部分是数据块的概念,这一点会依旧延续。最近一段时间的数据块会保持在内存中也大体上不错。毕竟,最近时间段的数据会大量的查询到。一个时间序列对应一个文件,这种概念是我们想要替换掉的。 + +### 序列分流 + +在 Prometheus 的上下文context中,我们使用术语序列分流series churn来描述不活越的时间序列集合,即不再接收数据点,取而代之的是出现一组新的活跃序列。 +例如,由给定微服务实例产生的所有序列都有一个相对的“instance”标签来标识它的起源。如果我们为微服务执行了滚动更新rolling update,并且为每个实例替换一个新的版本,序列分流便会发生。在更加动态的环境中,这些事情基本上每小时都会发生。像 Kubernetes 这样的集群编排Cluster orchestration系统允许应用连续性的自动伸缩和频繁的滚动更新,这样也许会创建成千上万个新的应用程序实例,并且伴随着全新的时间序列集合,每天都是如此。 + +``` +series + ^ + │ . . . . . . + │ . . . . . . + │ . . . . . . + │ . . . . . . . + │ . . . . . . . + │ . . . . . . . + │ . . . . . . + │ . . . . . . + │ . . . . . + │ . . . . . + │ . . . . . + v + <-------------------- time ---------------------> +``` + +所以即便整个基础设施的规模基本保持不变,过一段时间后数据库内的时间序列还是会成线性增长。尽管 Prometheus 很愿意采集 1000 万个时间序列数据,但要想在 10 亿的序列中找到数据,查询效果还是会受到严重的影响。 + +#### 当前解法 + +当前 Prometheus 的 V2 存储系统对所有保存的序列拥有基于 LevelDB 的索引。它允许查询语句含有给定的标签对label pair,但是缺乏可伸缩的方法来从不同的标签选集中组合查询结果。 +例如,从所有的序列中选择标签 `__name__="requests_total"` 非常高效,但是选择  `instance="A" AND __name__="requests_total"` 就有了可伸缩性的问题。我们稍后会重新考虑导致这一点的原因和能够提升查找延迟的调整方法。 + +事实上正是这个问题才催生出了对更好的存储系统的最初探索。Prometheus 需要为查找亿万的时间序列改进索引方法。 + +### 资源消耗 + +当试图量化 Prometheus (或其他任何事情,真的)时,资源消耗是永恒不变的话题之一。但真正困扰用户的并不是对资源的绝对渴求。事实上,由于给定的需求,Prometheus 管理着令人难以置信的吞吐量。问题更在于面对变化时的相对未知性与不稳定性。由于自身的架构设计,V2 存储系统构建样本数据块相当缓慢,这一点导致内存占用随时间递增。当数据块完成之后,它们可以写到磁盘上并从内存中清除。最终,Prometheus 的内存使用到达平衡状态。直到监测环境发生了改变——每次我们扩展应用或者进行滚动更新,序列分流都会增加内存、CPU、磁盘 IO 的使用。如果变更正在进行,那么它最终还是会到达一个稳定的状态,但比起更加静态的环境,它的资源消耗会显著地提高。过渡时间通常为数个小时,而且难以确定最大资源使用量。 + +为每个时间序列保存一个文件这种方法也使得单一查询很容易崩溃 Prometheus 进程。当查询的数据没有缓存在内存中,查询的序列文件就会被打开,然后将含有相关数据点的数据块读入内存。如果数据量超出内存可用量,Prometheus 就会因 OOM 被杀死而退出。 +在查询语句完成之后,加载的数据便可以被再次释放掉,但通常会缓存更长的时间,以便更快地查询相同的数据。后者看起来是件不错的事情。 + +最后,我们看看之前提到的 SSD 的写入放大,以及 Prometheus 是如何通过批量写入来解决这个问题的。尽管如此,在许多地方还是存在因为拥有太多小批量数据以及在页的边界上未精确对齐的数据而导致的写入放大。对于更大规模的 Prometheus 服务器,现实当中发现会缩减硬件寿命的问题。这一点对于数据库应用的高写入吞吐量来说仍然相当普遍,但我们应该放眼看看是否可以解决它。 + +### 重新开始 + +到目前为止我们对于问题域,V2 存储系统是如何解决它的,以及设计上的问题有了一个清晰的认识。我们也看到了许多很棒的想法,这些或多或少都可以拿来直接使用。V2 存储系统相当数量的问题都可以通过改进和部分的重新设计来解决,但为了好玩(当然,在我仔细的验证想法之后),我决定试着写一个完整的时间序列数据库——从头开始,即向文件系统写入字节。 + +性能与资源使用这种最关键的部分直接导致了存储格式的选取。我们需要为数据找到正确的算法和磁盘布局来实现一个高性能的存储层。 + +这就是我解决问题的捷径——跳过令人头疼,失败的想法,数不尽的草图,泪水与绝望。 + +### V3—宏观设计 + +我们存储系统的宏观布局是什么?简而言之,是当我们在数据文件夹里运行 `tree` 命令时显示的一切。看看它能给我们带来怎样一副惊喜的画面。 + +``` +$ tree ./data +./data +├── b-000001 +│ ├── chunks +│ │ ├── 000001 +│ │ ├── 000002 +│ │ └── 000003 +│ ├── index +│ └── meta.json +├── b-000004 +│ ├── chunks +│ │ └── 000001 +│ ├── index +│ └── meta.json +├── b-000005 +│ ├── chunks +│ │ └── 000001 +│ ├── index +│ └── meta.json +└── b-000006 + ├── meta.json + └── wal + ├── 000001 + ├── 000002 + └── 000003 +``` + +在最顶层,我们有一系列以 `b-` 为前缀编号的block。每个块中显然保存了索引文件和含有更多编号文件的 `chunk` 文件夹。`chunks` 目录只包含不同序列数据点的原始块raw chunks of data points。与 V2存储系统一样,这使得通过时间窗口读取序列数据非常高效并且允许我们使用相同的有效压缩算法。这一点被证实行之有效,我们也打算沿用。显然,这里并不存在含有单个序列的文件,而是一堆保存着许多序列的数据块。 +`index`文件的存在应不足为奇。让我们假设它拥有黑魔法,可以让我们找到标签、可能的值、整个时间序列和存放数据点的数据块。 + +但为什么这里有好几个文件夹都是索引和块文件的布局?并且为什么存在最后一个包含“wal”文件夹?理解这两个疑问便能解决九成的问题 。 + +#### 许多小型数据库 + +我们分割横轴,即将时间域分割为不重叠的块。每一块扮演者完全独立的数据库,它包含该时间窗口所有的时间序列数据。因此,它拥有自己的索引和一系列块文件。 + +``` + +t0 t1 t2 t3 now + ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ + │ │ │ │ │ │ │ │ ┌────────────┐ + │ │ │ │ │ │ │ mutable │ <─── write ──── ┤ Prometheus │ + │ │ │ │ │ │ │ │ └────────────┘ + └───────────┘ └───────────┘ └───────────┘ └───────────┘ ^ + └──────────────┴───────┬──────┴──────────────┘ │ + │ query + │ │ + merge ─────────────────────────────────────────────────┘ +``` + +每一块的数据都是不可变的immutable。当然,当我们采集新数据时,我们必须能向最近的块中添加新的序列和样本。对于该数据块,所有新的数据都将写入内存中的数据库中,它与我们的持久化的数据块一样提供了查找属性。内存中的数据结构可以高效地更新。为了防止数据丢失,所有预传入的数据同样被写入临时的预写日志write ahead log中,这就是 `wal` 文件夹中的一些列文件,我们可以在重新启动时通过它们加载内存数据库。 +所有这些文件都带有序列化格式,有我们所期望的所有东西:许多标志,偏移量,变体和 CRC32 校验。纸上得来终觉浅,绝知此事要躬行。 + +这种布局允许我们扩展查询范围到所有相关的块上。每个块上的部分结果最终合并成完整的结果。 + +这种横向分割增加了一些很棒的功能: + +* 当查询一个时间范围,我们可以简单地忽略所有范围之外的数据块。通过减少需要检查的一系列数据,它可以初步解决序列分流的问题。 +* 当完成一个块,我们可以通过顺序的写入大文件从内存数据库中保存数据。这样可以避免任何的写入放大,并且 SSD 与 HDD 均适用。 +* 我们延续了 V2 存储系统的一个好的特性,最近使用而被多次查询的数据块,总是保留在内存中。 +* 足够好了,我们也不再限定 1KiB 的数据块尺寸来使数据在磁盘上更好地对齐。我们可以挑选对单个数据点和压缩格式最合理的尺寸。 +* 删除旧数据变得极为简单快捷。我们仅仅只需删除一个文件夹。记住,在旧的存储系统中我们不得不花数个小时分析并重写数亿个文件。 + +每个块还包含了 `meta.json` 文件。它简单地保存了关于块的存储状态和包含的数据以供人们简单的阅读。 + +##### mmap + +将数百万个小文件合并为一个大文件使得我们用很小的开销就能保持所有的文件都打开。这就引出了 [`mmap(2)`][8] 的使用,一个允许我们通过文件透明地回传虚拟内存的系统调用。为了简便,你也许想到了交换空间swap space,只是我们所有的数据已经保存在了磁盘上,并且当数据换出内存后不再会发生写入。 + +这意味着我们可以当作所有数据库的内容都保留在内存中却不占用任何物理内存。仅当我们访问数据库文件确定的字节范围时,操作系统从磁盘上惰性加载lazy loads页数据。这使得我们将所有数据持久化相关的内存管理都交给了操作系统。大体上,操作系统已足够资格作出决定,因为它拥有整个机器和进程的视图。查询的数据可以相当积极的缓存进内存,但内存压力会使得页被逐出。如果机器拥有未使用的内存,Prometheus 目前将会高兴地缓存整个数据库,但是一旦其他进程需要,它就会立刻返回。 +因此,查询不再轻易地使我们的进程 OOM,因为查询的是更多的持久化的数据而不是装入内存中的数据。内存缓存大小变得完全自适应,并且仅当查询真正需要时数据才会被加载。 + +就个人理解,如果磁盘格式允许,这就是当今大多数数据库的理想工作方式——除非有人自信的在进程中智胜操作系统。我们做了很少的工作但确实从外面获得了很多功能。 + +#### 压缩 + +存储系统需要定期的“切”出新块并写入之前完成的块到磁盘中。仅在块成功的持久化之后,写之前用来恢复内存块的日志文件(wal)才会被删除。 +我们很乐意将每个块的保存时间设置的相对短一些(通常配置为 2 小时)以避免内存中积累太多的数据。当查询多个块,我们必须合并它们的结果为一个完成的结果。合并过程显然会消耗资源,一个周的查询不应该由 80 多个部分结果所合并。 + +为了实现两者,我们引入压缩compaction。压缩描述了一个过程:取一个或更多个数据块并将其写入一个可能更大的块中。它也可以在此过程中修改现有的数据。例如,清除已经删除的数据,或为提升查询性能重建样本块。 + +``` + +t0 t1 t2 t3 t4 now + ┌────────────┐ ┌──────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ + │ 1 │ │ 2 │ │ 3 │ │ 4 │ │ 5 mutable │ before + └────────────┘ └──────────┘ └───────────┘ └───────────┘ └───────────┘ + ┌─────────────────────────────────────────┐ ┌───────────┐ ┌───────────┐ + │ 1 compacted │ │ 4 │ │ 5 mutable │ after (option A) + └─────────────────────────────────────────┘ └───────────┘ └───────────┘ + ┌──────────────────────────┐ ┌──────────────────────────┐ ┌───────────┐ + │ 1 compacted │ │ 3 compacted │ │ 5 mutable │ after (option B) + └──────────────────────────┘ └──────────────────────────┘ └───────────┘ +``` + +在这个例子中我们有一系列块`[1,2,3,4]`。块 1,2 ,3 可以压缩在一起,新的布局将会是 `[1,4]`。或者,将它们成对压缩为 `[1,3]`。所有的时间序列数据仍然存在,但现在整体上保存在更少的块中。这极大程度地缩减了查询时间的消耗,因为需要合并的部分查询结果变得更少了。 + +#### 保留 + +我们看到了删除旧的数据在 V2 存储系统中是一个缓慢的过程,并且消耗 CPU、内存和磁盘。如何才能在我们基于块的设计上清除旧的数据?相当简单,只要根据块文件夹下的配置的保留窗口里有无数据而删除该文件夹。在下面的例子中,块 1 可以被安全地删除,而块 2 则必须一直保持到界限后面。 + +``` + | + ┌────────────┐ ┌────┼─────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ + │ 1 │ │ 2 | │ │ 3 │ │ 4 │ │ 5 │ . . . + └────────────┘ └────┼─────┘ └───────────┘ └───────────┘ └───────────┘ + | + | + retention boundary +``` + +得到越旧的数据,保存的块也就越大,因为我们会压缩之前的压缩块。因此必须为其设置一个上限,以防数据块扩展到整个数据库而损失我们设计的最初优势。 +方便的是,这一点也限制了部分存在于保留窗口内部分存在于保留窗口外的总磁盘块的消耗。例如上面例子中的块 2。当设置了最大块尺寸为总保留窗口的 10% 后,我们保留块 2 的总开销也有了 10% 的上限。 + +总结一下,保留与删除从非常昂贵到了几乎没有成本。 + +> 如果你读到这里并有一些数据库的背景知识,现在你也许会问:这些都是最新的技术吗?——并不是。而且可能还会做的更好。 + +> 在内存中打包数据,定期的写入日志并刷新磁盘的模式在现在相当普遍。 +> 我们看到的好处无论在什么领域的数据里都是适用的。遵循这一方法最著名的开源案例是 LevelDB,Cassandra,InfluxDB 和 HBase。关键是避免重复发明劣质的轮子,采用经得起验证的方法,并正确地运用它们。 +> 这里仍有地方来添加你自己的黑魔法。 + +### 索引 + +研究存储改进的最初想法是解决序列分流的问题。基于块的布局减少了查询所要考虑的序列总数。因此假设我们索引查找的复杂度是 `O(n^2)`,我们就要设法减少 n 个相当数量的复杂度,之后就有了改进后 `O(n^2)` 的复杂度。——恩,等等...糟糕。 +快速地想想“算法 101”课上提醒我们的,在理论上它并未带来任何好处。如果之前就很糟糕,那么现在也一样。理论是如此的残酷。 + +实际上,我们大多数的查询已经可以相当快地被相应。但是,跨越整个时间范围的查询仍然很慢,尽管只需要找到少部分数据。追溯到所有这些工作之前,最初我用来解决这个问题的想法是:我们需要一个更大容量的[倒排索引][9]。倒排索引基于数据项内容的子集提供了一种快速的查找方式。简单地说,我可以通过标签 `app=”nginx"` 查找所有的序列而无需遍历每个文件来看它是否包含该标签。 + +为此,每个序列被赋上一个唯一的 ID 来在常数时间内获取,例如 O(1)。在这个例子中 ID 就是 我们的正向索引。 + +> 示例:如果 ID 为 10,29 ,9 的序列包含标签 `app="nginx"`,那么 “nginx”的倒排索引就是简单的列表 `[10, 29, 9]`,它就能用来快速地获取所有包含标签的序列。即使有 200 多亿个数据也不会影响查找速度。 + +简而言之,如果 n 是我们序列总数,m 是给定查询结果的大小,使用索引的查询复杂度现在就是 O(m)。查询语句跟随它获取数据的数量 m 而不是被搜索的数据体 n 所扩展是一个很好的特性,因为 m 一般相当小。 +为了简单起见,我们假设可以在常数时间内查找到倒排索引对应的列表。 + +实际上,这几乎就是 V2 存储系统已有的倒排索引,也是提供在数百万序列中查询性能的最低需求。敏锐的人会注意到,在最坏情况下,所有的序列都含有标签,因此 m 又成了 O(n)。这一点在预料之中也相当合理。如果你查询所有的数据,它自然就会花费更多时间。一旦我们牵扯上了更复杂的查询语句就会有问题出现。 + +#### 标签组合 + +数百万个带有标签的数据很常见。假设横向扩展着数百个实例的“foo”微服务,并且每个实例拥有数千个序列。每个序列都会带有标签`app="foo"`。当然,用户通常不会查询所有的序列而是会通过进一步的标签来限制查询。例如,我想知道服务实例接收到了多少请求,那么查询语句便是 `__name__="requests_total" AND app="foo"`。 + +为了找到适应所有标签选择子的序列,我们得到每一个标签的倒排索引列表并取其交集。结果集通常会比任何一个输入列表小一个数量级。因为每个输入列表最坏情况下的尺寸为 O(n),所以在嵌套地为每个列表进行暴力求解brute force solution下,运行时间为 O(n^2)。与其他的集合操作耗费相同,例如取并集 (`app="foo" OR app="bar"`)。当添加更多标签选择子在查询语句上,耗费就会指数增长到 O(n^3), O(n^4), O(n^5), ... O(n^k)。有很多手段都能通过改变执行顺序优化运行效率。越复杂,越是需要关于数据特征和标签之间相关性的知识。这引入了大量的复杂度,但是并没有减少算法的最坏运行时间。 + +这便是 V2 存储系统使用的基本方法,幸运的是,似乎稍微的改动就能获得很大的提升。如果我们假设倒排索引中的 ID 都是排序好的会怎么样? + +假设这个例子的列表用于我们最初的查询: + +``` +__name__="requests_total" -> [ 9999, 1000, 1001, 2000000, 2000001, 2000002, 2000003 ] + app="foo" -> [ 1, 3, 10, 11, 12, 100, 311, 320, 1000, 1001, 10002 ] + + intersection => [ 1000, 1001 ] +``` + +它的交集相当小。我们可以为每个列表的起始位置设置游标,每次从最小的游标处移动来找到交集。当二者的数字相等,我们就添加它到结果中并移动二者的游标。总体上,我们以锯齿形扫描两个列表,因此总耗费是 O(2n)=O(n),因为我们总是在一个列表上移动。 + +两个以上列表的不同集合操作也类似。因此 k 个集合操作仅仅改变了因子 O(k*n) 而不是最坏查找运行时间下的指数 O(n^k)。 +我在这里所描述的是任意一个[全文搜索引擎][10]使用的标准搜索索引的简化版本。每个序列描述符都视作一个简短的“文档”,每个标签(名称 + 固定值)作为其中的“单词”。我们可以忽略搜索引擎索引中很多附加的数据,例如单词位置和和频率。 +似乎存在着无止境的研究来提升实际的运行时间,通常都是对输入数据做一些假设。不出意料的是,仍有大量技术来压缩倒排索引,其中各有利弊。因为我们的“文档”比较小,而且“单词”在所有的序列里大量重复,压缩变得几乎无关紧要。例如,一个真实的数据集约有 440 万个序列与大约 12 个标签,每个标签拥有少于 5000 个单独的标签。对于最初的存储版本,我们坚持基本的方法不使用压缩,仅做微小的调整来跳过大范围非交叉的 ID。 + +尽管维持排序好的 ID 听起来很简单,但实践过程中不是总能完成的。例如,V2 存储系统为新的序列赋上一个哈希值来当作 ID,我们就不能轻易地排序倒排索引。另一个艰巨的任务是当磁盘上的数据被更新或删除掉后修改其索引。通常,最简单的方法是重新计算并写入,但是要保证数据库在此期间可查询且具有一致性。V3 存储系统通过每块上独立的不可变索引来解决这一问题,仅通过压缩时的重写来进行修改。只有可变块上的索引需要被更新,它完全保存在内存中。 + +### 基准测试 + +我发起了一个最初版本的基准测试,它基于现实世界数据集中提取的大约 440 万个序列描述符,并生成合成数据点对应到这些序列中。这个方法仅仅测试单独的存储系统,快速的找到高并发负载场景下的运行瓶颈和触发死锁至关重要。 + +在概念性的运用完成之后,基准测试能够在我的 Macbook Pro 上维持每秒 2000 万的吞吐量—并且所有 Chrome 的页面和 Slack 都保持着运行。因此,尽管这听起来都很棒,它这也表明推动这项测试没有的进一步价值。(或者是没有在高随机环境下运行)。毕竟,它是合成的数据,因此在除了好的第一印象外没有多大价值。比起最初的设计目标高出 20 倍,是时候将它部署到真正的 Prometheus 服务器上了,为它添加更多现实环境中的开销和场景。 + +我们实际上没有可重复的 Prometheus 基准测试配置,特别是对于不同版本的 A/B 测试。亡羊补牢为时不晚,[现在就有一个了][11]! + +工具可以让我们声明性地定义基准测试场景,然后部署到 AWS 的 Kubernetes 集群上。尽管对于全面的基准测试来说不是最好环境,但它肯定比 64 核 128GB 内存的专用裸机服务器bare metal servers更能反映出用户基础。我们部署两个 Prometheus 1.5.2 服务器(V2 存储系统)和两个从 2.0 分支继续开发的 Prometheus (V3 存储系统) 。每个 Prometheus 运行在配备 SSD 的专用服务器上。我们将横向扩展的应用部署在了工作节点上,并且让其暴露典型的微服务量。此外,Kubernetes 集群本身和节点也被监控着。整个配置由另一个 Meta-Prometheus 所监督,它监控每个 Prometheus 的健康状况和性能。为了模拟序列分流,微服务定期的扩展和收缩来移除旧的 pods 并衍生新的 pods,生成新的序列。查询负载通过典型的查询选择来模拟,对每个 Prometheus 版本都执行一次。 + +总体上,伸缩与查询的负载和采样频率一样极大的超出了 Prometheus 的生产部署。例如,我们每隔 15 分钟换出 60% 的微服务实例去产生序列分流。在现代的基础设施上,一天仅大约会发生 1-5 次。这就保证了我们的 V3 设计足以处理未来几年的工作量。就结果而言,Prometheus 1.5.2 和 2.0 之间的性能差异在不温和的环境下会变得更大。 +总而言之,我们每秒从 850 个暴露 50 万数据的目标里收集了大约 11 万份样本。 + +在此配置运行一段时间之后,我们可以看一下数字。我们评估了两个版本在 12 个小时之后到达稳定时的几个指标。 + +> 请注意从 Prometheus 图形界面的截图中轻微截断的 Y 轴 + + ![Heap usage GB](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/heap_usage.png) +> 堆内存使用(GB) + +内存资源使用对用户来说是最为困扰的问题,因为它相对的不可预测且能够导致进程崩溃。 +显然,被查询的服务器正在消耗内存,这极大程度上归咎于查询引擎的开销,这一点可以当作以后优化的主题。总的来说,Prometheus 2.0 的内存消耗减少了 3-4 倍。大约 6 小时之后,在 Prometheus 1.5 上有一个明显的峰值,与我们设置 6 小时的保留边界相对应。因为删除操作成本非常高,所以资源消耗急剧提升。这一点在下面几张图中均有体现。 + + ![CPU usage cores](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/cpu_usage.png) +> CPU 使用(核心/秒) + +类似的模式展示 CPU 使用,但是查询的服务器与非查询的服务器之间的差异尤为明显。每秒获取大约 11 万个数据需要 0.5 核心/秒的 CPU 资源,比起评估查询所花费的时间,我们新的存储系统 CPU 消耗可忽略不计。 + + ![Disk writes](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/disk_writes.png) +> 磁盘写入(MB/秒) + +图片展示出的磁盘利用率取得了令人意想不到的提升。这就清楚的展示了为什么 Prometheus 1.5 很容易造成 SSD 损耗。我们看到最初的上升发生在第一个块被持久化到序列文件中的时期,然后一旦删除操作引发了重写就会带来第二个上升。令人惊讶的是,查询的服务器与非查询的服务器显示出了非常不同的利用率。 +Prometheus 2.0 on the other hand, merely writes about a single Megabyte per second to its write ahead log. Writes periodically spike when blocks are compacted to disk. Overall savings: staggering 97-99%.Prometheus 2.0 在另一方面,每秒仅仅写入大约一兆字节的日志文件。当块压缩到磁盘之时,写入定期地出现峰值。这在总体上节省了:惊人的 97-99%。 + + ![Disk usage](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/disk_usage.png) +> 磁盘大小(GB) + +与磁盘写入密切相关的是总磁盘空间占用量。由于我们对样本几乎使用了相同的压缩算法,因此磁盘占用量应当相同。在更为稳定的配置中,这样做很大程度上是正确地,但是因为我们需要处理高序列分流,所以还要考虑每个序列的开销。 +如我们所见,Prometheus 1.5 在两个版本达到稳定状态之前,使用的存储空间因保留操作而急速上升。Prometheus 2.0 似乎在每个序列上具有更少的消耗。我们可以清楚的看到写入日志线性地充满整个存储空间,然后当压缩完成后立刻掉下来。事实上对于两个 Prometheus 2.0 服务器,它们的曲线并不是完全匹配的,这一点需要进一步的调查。 + +前景大好。剩下最重要的部分是查询延迟。新的索引应当优化了查找的复杂度。没有实质上发生改变的是处理数据的过程,例如 `rate()` 函数或聚合。这些就是查询引擎要做的东西了。 + + ![Query latency](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/query_latency.png) +> 第 99 个百分位查询延迟(秒) + +数据完全符合预期。在 Prometheus 1.5 上,查询延迟随着存储的数据而增加。只有在保留操作开始且旧的序列被删除后才会趋于稳定。作为对比,Prometheus 从一开始就保持在合适的位置。 +我们需要花一些心思在数据是如何被采集上,对服务器发出的查询请求通过估计以下方面被选中:查询范围和即时查询的组合,进行或轻或重的计算,访问或多或少的文件。它并不需要代表真实世界里查询的分布。也不能代表冷数据的查询性能,我们可以假设所有的样本数据都是保存在内存中的热数据。 +尽管如此,我们可以相当自信地说,整体查询效果对序列分流变得非常有弹性,并且提升了高压基准测试场景下 4 倍的性能。在更为静态的环境下,我们可以假设查询时间大多数花费在了查询引擎上,改善程度明显较低。 + + ![Ingestion rate](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/ingestion_rate.png) +> 摄入的样本/秒 + +最后,快速地看一下不同 Prometheus 服务器的摄入率。我们可以看到搭载 V3 存储系统的两个服务器具有相同的摄入速率。在几个小时之后变得不稳定,这是因为不同的基准测试集群节点由于高负载变得无响应,与 Prometheus 实例无关。(两点之前的曲线完全匹配这一事实希望足够具有说服力) +尽管还有更多 CPU 和内存资源,两个 Prometheus 1.5.2 服务器的摄入率大大降低。序列分流高压导致了无法采集更多的数据。 + +那么现在每秒可以摄入的绝对最大absolute maximum样本数是多少? + +我不知道——而且故意忽略。 + +存在的很多因素都会影响 Prometheus 数据流量,而且没有一个单独的数字能够描述捕获质量。最大摄入率在历史上是一个导致基准出现偏差的度量量,并且忽视了更多重要的层面,例如查询性能和对序列分流的弹性。关于资源使用线性增长的大致猜想通过一些基本的测试被证实。很容易推断出其中的原因。 + +我们的基准测试模拟了高动态环境下 Prometheus 的压力,它比起真实世界中的更大。结果表明,虽然运行在没有优化的云服务器上,但是已经超出了预期的效果。 + +> 注意:在撰写本文的同时,Prometheus 1.6 正在开发当中,它允许更可靠地配置最大内存使用量,并且可能会显著地减少整体的消耗,提高 CPU 使用率。我没有重复进行测试,因为整体结果变化不大,尤其是面对高序列分流的情况。 + +### 总结 + +Prometheus 开始应对高基数序列与单独样本的吞吐量。这仍然是一项富有挑战性的任务,但是新的存储系统似乎向我们展示了未来的一些好东西:超大规模hyper-scale高收敛度hyper-convergent,GIFEE 基础设施。好吧,它似乎运行的不错。 + +第一个配备 V3 存储系统的 [alpha 版本 Prometheus 2.0][12] 已经可以用来测试了。在早期阶段预计还会出现崩溃,死锁和其他 bug。 + +存储系统的代码可以在[这个单独的项目中找到][13]。Prometheus 对于寻找高效本地存储时间序列数据库的应用来说可能非常有用,之一点令人非常惊讶。 + +> 这里需要感谢很多人作出的贡献,以下排名不分先后: + +> Bjoern Rabenstein 和 Julius Volz 在 V2 存储引擎上的打磨工作以及 V3 存储系统的反馈,这为新一代的设计奠定了基础。 + +> Wilhelm Bierbaum 对新设计不断的建议与见解作出了很大的贡献。Brian Brazil 不断的反馈确保了我们最终得到的是语义上合理的方法。与 Peter Bourgon 深刻的讨论验证了设计并形成了这篇文章。 + +> 别忘了我们整个 CoreOS 团队与公司对于这项工作的赞助与支持。感谢所有那些听我一遍遍唠叨 SSD,浮点数,序列化格式的同学。 + + +-------------------------------------------------------------------------------- + +via: https://fabxc.org/blog/2017-04-10-writing-a-tsdb/ + +作者:[Fabian Reinartz ][a] +译者:[译者ID](https://github.com/LuuMing) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://twitter.com/fabxc +[1]:https://en.wikipedia.org/wiki/Inode +[2]:https://prometheus.io/ +[3]:https://kubernetes.io/ +[4]:https://en.wikipedia.org/wiki/Write_amplification +[5]:http://codecapsule.com/2014/02/12/coding-for-ssds-part-1-introduction-and-table-of-contents/ +[6]:https://prometheus.io/docs/practices/rules/ +[7]:http://www.vldb.org/pvldb/vol8/p1816-teller.pdf +[8]:https://en.wikipedia.org/wiki/Mmap +[9]:https://en.wikipedia.org/wiki/Inverted_index +[10]:https://en.wikipedia.org/wiki/Search_engine_indexing#Inverted_indices +[11]:https://github.com/prometheus/prombench +[12]:https://prometheus.io/blog/2017/04/10/promehteus-20-sneak-peak/ +[13]:https://github.com/prometheus/tsdb From 30030434911830af8a46052d13c7a2158ea895df Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 May 2019 07:10:58 +0800 Subject: [PATCH 0651/1154] PRF:20180611 3 open source alternatives to Adobe Lightroom.md @scoutydren --- ... source alternatives to Adobe Lightroom.md | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/translated/tech/20180611 3 open source alternatives to Adobe Lightroom.md b/translated/tech/20180611 3 open source alternatives to Adobe Lightroom.md index 1ac86027b9..4cebea72fa 100644 --- a/translated/tech/20180611 3 open source alternatives to Adobe Lightroom.md +++ b/translated/tech/20180611 3 open source alternatives to Adobe Lightroom.md @@ -1,52 +1,55 @@ -# Adobe Lightroom 的三个开源替代 +Adobe Lightroom 的三个开源替代品 +======= + +> 摄影师们:在没有 Lightroom 套件的情况下,可以看看这些 RAW 图像处理器。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/camera-photography-film.jpg?itok=oe2ixyu6) -如今智能手机的摄像功能已经完备到多数人认为可以代替传统摄影了。虽然这在傻瓜相机的市场中是个事实,但是对于许多摄影爱好者和专业摄影师看来,一个高端单反相机所能带来的照片景深,清晰度以及真实质感是无法和口袋中的智能手机相比的。 +如今智能手机的摄像功能已经完备到多数人认为可以代替传统摄影了。虽然这在傻瓜相机的市场中是个事实,但是对于许多摄影爱好者和专业摄影师看来,一个高端单反相机所能带来的照片景深、清晰度以及真实质感是口袋中的智能手机无法与之相比的。 -所有的这些功能在便利性上仅有很小的代价;就像传统的胶片相机中的反色负片,单反照相得到的RAW格式文件必须预先处理才能印刷或编辑;因此对于单反相机,照片的后期处理是无可替代的,因此Adobe Lightroom便无可替代。但是Adobe Lightroom的昂贵价格,月付的订阅费用以及专有许可证都使更多人开始关注其开源替代的软件。 +所有的这些功能在便利性上要付出一些很小的代价;就像传统的胶片相机中的反色负片,单反照相得到的 RAW 格式文件必须预先处理才能印刷或编辑;因此对于单反相机,照片的后期处理是无可替代的,并且 首选应用就是 Adobe Lightroom。但是由于 Adobe Lightroom 的昂贵价格、基于订阅的定价模式以及专有许可证都使更多人开始关注其开源替代品。 -Lightroom 有两大主要功能:处理 RAW 格式的图片文件,以及数字资产管理系统(DAM:Digital Asset Management) —— 通过标签,评星以及其他的元数据信息来简单清晰地整理照片。 +Lightroom 有两大主要功能:处理 RAW 格式的图片文件,以及数字资产管理系统(DAM) —— 通过标签、评星以及其他元数据信息来简单清晰地整理照片。 -在这篇文章中,我们将介绍三个开源的图片处理软件:Darktable,LightZone 以及 RawTherapee。所有的软件都有 DAM 系统,但没有任何一个有 Lightroom 基于机器学习的图像分类和标签功能。如果你想要知道更多关于 开源的 DAM 系统的软件,可以看 Terry Hacock 的文章:"[开源项目的 DAM 管理][2]“,他分享了他在自己的 [_Lunatics!_][3] 电影项目研究过的开源多媒体软件。 +在这篇文章中,我们将介绍三个开源的图片处理软件:Darktable、LightZone 以及 RawTherapee。所有的软件都有 DAM 系统,但没有任何一个具有 Lightroom 基于机器学习的图像分类和标签功能。如果你想要知道更多关于开源的 DAM 系统的软件,可以看 Terry Hacock 的文章:“[开源项目的 DAM 管理][2]”,他分享了他在自己的 [Lunatics!][3] 电影项目研究过的开源多媒体软件。 ### Darktable ![Darktable][4] -类似其他两个软件,darktable 可以处理RAW 格式的图像并将他们转换成可用的文件格式—— JPEG,PNG,TIFF, PPM, PFM 和 EXR,它同时支持Google 和 Facebook 的在线相册,上传至Flikr,通过邮件附件发送以及创建在线相册。 +类似其他两个软件,Darktable 可以处理 RAW 格式的图像并将它们转换成可用的文件格式 —— JPEG、PNG、TIFF、PPM、PFM 和 EXR,它同时支持 Google 和 Facebook 的在线相册,上传至 Flikr,通过邮件附件发送以及创建在线相册。 -它有 61 个图像处理模块,可以调整图像的对比度、色调、明暗、色彩、噪点;添加水印;切割以及旋转;等等。如同另外两个软件一样,不论你做出多少次修改,这些修改都是”无损的“ —— 你的初始 RAW 图像文件始终会被保存。 +它有 61 个图像处理模块,可以调整图像的对比度、色调、明暗、色彩、噪点;添加水印;切割以及旋转;等等。如同另外两个软件一样,不论你做出多少次修改,这些修改都是“无损的” —— 你的初始 RAW 图像文件始终会被保存。 -Darktable 可以从 400 多种相机型号中直接导入照片,以及有 JPEG,CR2,DNG ,OpenEXR和PFM等格式的支持。图像在一个数据库中显示,因此你可以轻易地filter并查询这些元数据,包括了文字标签,评星以及颜色标签。软件同时支持21种语言,支持 Linux,MacOS,BSD,Solaris 11/GNOME 以及 Windows (Windows 版本是最新发布的,Darktable 声明它比起其他版本可能还有一些不完备之处,有一些未实现的功能) +Darktable 可以从 400 多种相机型号中直接导入照片,以及有 JPEG、CR2、DNG、OpenEXR 和 PFM 等格式的支持。图像在一个数据库中显示,因此你可以轻易地过滤并查询这些元数据,包括了文字标签、评星以及颜色标签。软件同时支持 21 种语言,支持 Linux、MacOS、BSD、Solaris 11/GNOME 以及 Windows(Windows 版本是最新发布的,Darktable 声明它比起其他版本可能还有一些不完备之处,有一些未实现的功能)。 -Darktable 在开源证书 [GPLv3][7] 下被公开,你可以了解更多它的 [特性][8],查阅它的 [用户手册][9],或者直接去 Github 上看[源代码][10] 。 +Darktable 在开源许可证 [GPLv3][7] 下发布,你可以了解更多它的 [特性][8],查阅它的 [用户手册][9],或者直接去 Github 上看[源代码][10] 。 ### LightZone ![LightZone's tool stack][11] - [LightZone][12] 和其他两个软件类似同样是无损的 RAW 格式图像处理工具:它跨平台,有 Windows,MacOS 和 Linux 版本,除 RAW 格式之外,它还支持 JPG 和 TIFF 格式的图像处理。接下来说LightZone 其他的特性。 +[LightZone][12] 和其他两个软件类似同样是无损的 RAW 格式图像处理工具:它是跨平台的,有 Windows、MacOS 和 Linux 版本,除 RAW 格式之外,它还支持 JPG 和 TIFF 格式的图像处理。接下来说说 LightZone 其他独特特性。 -这个软件最初是一个在专有许可证下的图像处理软件,后来在 BSD 证书下开源。以及,在你下载这个软件之前,你必须注册一个免费账号。因此 LightZone的 开发团队可以跟踪软件的下载数量以及建立相关社区。(许可很快,而且是自动的,因此这不是一个很大的使用障碍。) +这个软件最初在 2005 年时,是以专有许可证发布的图像处理软件,后来在 BSD 证书下开源。此外,在你下载这个软件之前,你必须注册一个免费账号,以便 LightZone的 开发团队可以跟踪软件的下载数量以及建立相关社区。(许可很快,而且是自动的,因此这不是一个很大的使用障碍。) -除此之外的一个特性是这个软件的图像处理通常是通过很多可组合的工具实现的,而不是叠加滤镜(就像大多数图像处理软件),这些工具组可以被重新编排以及移除,以及被保存并且复制到另一些图像。如果想要编辑图片的一部分,你还可以通过矢量工具或者根据色彩和亮度来选择像素。 +除此之外的一个特性是这个软件的图像处理通常是通过很多可组合的工具实现的,而不是叠加滤镜(就像大多数图像处理软件),这些工具组可以被重新编排以及移除,以及被保存并且复制用到另一些图像上。如果想要编辑图片的部分区域,你还可以通过矢量工具或者根据色彩和亮度来选择像素。 -想要了解更多,见 LightZone 的[论坛][13] 或者查看Github上的 [源代码][14]。 +想要了解更多,见 LightZone 的[论坛][13] 或者查看 Github上的 [源代码][14]。 ### RawTherapee ![RawTherapee][15] -[RawTherapee][16] 是另一个开源([GPL][17])的RAW图像处理器。就像 Darktable 和 LightZone,它是跨平台的(支持 Windows,MacOS 和 Linux),一切修改都在无损条件下进行,因此不论你叠加多少滤镜做出多少改变,你都可以回到你最初的 RAW 文件。 +[RawTherapee][16] 是另一个值得关注的开源([GPL][17])的 RAW 图像处理器。就像 Darktable 和 LightZone,它是跨平台的(支持 Windows、MacOS 和 Linux),一切修改都在无损条件下进行,因此不论你叠加多少滤镜做出多少改变,你都可以回到你最初的 RAW 文件。 -RawTherapee 采用的是一个面板式的界面,包括一个历史记录面板来跟踪你做出的修改方便随时回到先前的图像;一个快照面板可以让你同时处理一张照片的不同版本;一个可滚动的工具面板方便准确选择工具。这些工具包括了一系列的调整曝光、色彩、细节、图像变换以及去马赛克功能。 +RawTherapee 采用的是一个面板式的界面,包括一个历史记录面板来跟踪你做出的修改,以方便随时回到先前的图像;一个快照面板可以让你同时处理一张照片的不同版本;一个可滚动的工具面板可以方便准确地选择工具。这些工具包括了一系列的调整曝光、色彩、细节、图像变换以及去马赛克功能。 -这个软件可以从多数相机直接导入 RAW 文件,并且支持超过25种语言得以广泛使用。批量处理以及 [SSE][18] 优化这类功能也进一步提高了图像处理的速度以及 CPU 性能。 +这个软件可以从多数相机直接导入 RAW 文件,并且支持超过 25 种语言,得到了广泛使用。批量处理以及 [SSE][18] 优化这类功能也进一步提高了图像处理的速度以及对 CPU 性能的利用。 RawTherapee 还提供了很多其他 [功能][19];可以查看它的 [官方文档][20] 以及 [源代码][21] 了解更多细节。 -你是否在摄影中使用另一个开源的 RAW图像处理工具?有任何建议和推荐都可以在评论中分享。 +你是否在摄影中使用另外的开源 RAW 图像处理工具?有任何建议和推荐都可以在评论中分享。 ------ @@ -55,7 +58,7 @@ via: https://opensource.com/alternatives/adobe-lightroom 作者:[Opensource.com][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[scoutydren](https://github.com/scoutydren) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -70,7 +73,7 @@ via: https://opensource.com/alternatives/adobe-lightroom [8]: https://www.darktable.org/about/features/ [9]: https://www.darktable.org/resources/ [10]: https://github.com/darktable-org/darktable -[11]: https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_lightzone1tookstack.jpg?itok=1e3s85CZ "LightZone's tool stack" +[11]: https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_lightzone1tookstack.jpg?itok=1e3s85CZ [12]: http://www.lightzoneproject.org/ [13]: http://www.lightzoneproject.org/Forum [14]: https://github.com/ktgw0316/LightZone From a78217f82f0ed7301fc697501e83bedfd9715843 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 May 2019 07:11:32 +0800 Subject: [PATCH 0652/1154] PUB:20180611 3 open source alternatives to Adobe Lightroom.md @scoutydren https://linux.cn/article-10912-1.html --- .../20180611 3 open source alternatives to Adobe Lightroom.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180611 3 open source alternatives to Adobe Lightroom.md (100%) diff --git a/translated/tech/20180611 3 open source alternatives to Adobe Lightroom.md b/published/20180611 3 open source alternatives to Adobe Lightroom.md similarity index 100% rename from translated/tech/20180611 3 open source alternatives to Adobe Lightroom.md rename to published/20180611 3 open source alternatives to Adobe Lightroom.md From 2108ba4b63ca25640842e02677b7982244e72133 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 29 May 2019 11:05:02 +0800 Subject: [PATCH 0653/1154] translated --- ... Manage Docker Containers From Terminal.md | 162 ------------------ ... Manage Docker Containers From Terminal.md | 162 ++++++++++++++++++ 2 files changed, 162 insertions(+), 162 deletions(-) delete mode 100644 sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md create mode 100644 translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md diff --git a/sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md b/sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md deleted file mode 100644 index 55de1756c6..0000000000 --- a/sources/tech/20190527 Dockly - Manage Docker Containers From Terminal.md +++ /dev/null @@ -1,162 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Dockly – Manage Docker Containers From Terminal) -[#]: via: (https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Dockly – Manage Docker Containers From Terminal -====== - -![][1] - -A few days ago, we published a guide which covered almost all details you ever need to know to [**getting started with Docker**][2]. In that guide, we have shown you how to create and manage Docker containers in detail. There are also some non-official tools available for managing Docker containers. If you’ve looked at our old archives, you might have stumbled upon two web-based tools namely [**“Portainer”**][3] and [**“PiCluster”**][4]. Both of them makes the Docker management task much easier and simpler from a web browser. Today, I came across yet another Docker management tool named **“Dockly”**. - -Unlike the aforementioned tools, Dockly is a TUI (text user interface) utility to manage Docker containers and services from the Terminal in Unix-like systems. It is free, open source tool built with **NodeJS**. In this brief guide, we will see how to install Dockly and how to manage Docker containers from command line. - -### Installing Dockly - -Make sure you have installed NodeJS on your Linux box. If you haven’t installed it yet, refer the following guide. - - * [**How To Install NodeJS On Linux**][5] - - - -Once NodeJS is installed, run the following command to install Dockly: - -``` -# npm install -g dockly -``` - -### Manage Docker Containers With Dockly From Terminal - -Managing Docker containers with Dockly is easy! All you have to do is to open the terminal and run the following command: - -``` -# dockly -``` - -Dockly will will automatically connect to your localhost docker daemon through the unix socket and display the list of running containers in the Terminal as shown below. - -![][6] - -Manage Docker Containers Using Dockly - -As you can see in the above screenshot, Dockly displays the following information of running containers on the top: - - * Container ID, - * Name of the container(s), - * Docker image, - * Command, - * State of the running container(s), - * Status. - - - -On the top right side, you will see the CPU an Memory utilization of containers. Use UP/DOWN arrow keys to move between Containers. - -At the bottom, there are few keyboard shortcut keys to do various docker management tasks. Here are the list of currently available keyboard shortcuts: - - * **=** – Refresh the Dockly interface, - * **/** – Search the containers list view, - * **i** – Display the information about the currently selected container or service, - * **< RETURN>** – Show logs of the current container or service, - * **v** – Toggle between Containers and Services view, - * **l** – Launch a /bin/bash session on the selected Container, - * **r** – Restart the selected Container, - * **s** – Stop the selected Container, - * **h** – Show HELP window, - * **q** – Quit Dockly. - - - -##### **Viewing information of a container** - -Choose a Container using UP/DOWN arrow and press **“i”** to display the information of the selected Container. - -![][7] - -View container’s information - -##### Restart Containers - -If you want to restart your Containers at any time, just choose it and press **“r”** to restart. - -![][8] - -Restart Docker containers - -##### Stop/Remove Containers and Images - -We can stop and/or remove one or all containers at once if they are no longer required. To do so, press **“m”** to open **Menu**. - -![][9] - -Stop, remove Docker containers and images - -From here, you can do the following operations. - - * Stop all Docker containers, - * Remove selected container, - * Remove all containers, - * Remove all Docker images etc. - - - -##### Display Dockly help section - -If you have any questions, just press **“h”** to open the help section. - -![][10] - -Dockly Help - -For more details, refer the official GitHub page given at the end. - -And, that’s all for now. Hope this was useful. If you spend a lot of time working with Docker containers, give Dockly a try and see if it helps. - -* * * - -**Suggested read:** - - * **[How To Automatically Update Running Docker Containers][11]** - * [**ctop – A Commandline Monitoring Tool For Linux Containers**][12] - - - -* * * - -**Resource:** - - * [**Dockly GitHub Repository**][13] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/ - -作者:[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/2019/05/Dockly-720x340.png -[2]: https://www.ostechnix.com/getting-started-with-docker/ -[3]: https://www.ostechnix.com/portainer-an-easiest-way-to-manage-docker/ -[4]: https://www.ostechnix.com/picluster-simple-web-based-docker-management-application/ -[5]: https://www.ostechnix.com/install-node-js-linux/ -[6]: http://www.ostechnix.com/wp-content/uploads/2019/05/Manage-Docker-Containers-Using-Dockly.png -[7]: http://www.ostechnix.com/wp-content/uploads/2019/05/View-containers-information.png -[8]: http://www.ostechnix.com/wp-content/uploads/2019/05/Restart-containers.png -[9]: http://www.ostechnix.com/wp-content/uploads/2019/05/stop-remove-containers-and-images.png -[10]: http://www.ostechnix.com/wp-content/uploads/2019/05/Dockly-Help.png -[11]: https://www.ostechnix.com/automatically-update-running-docker-containers/ -[12]: https://www.ostechnix.com/ctop-commandline-monitoring-tool-linux-containers/ -[13]: https://github.com/lirantal/dockly diff --git a/translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md b/translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md new file mode 100644 index 0000000000..d5ac3339f4 --- /dev/null +++ b/translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Dockly – Manage Docker Containers From Terminal) +[#]: via: (https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Dockly - 从终端管理 Docker 容器 +====== + +![][1] + +几天前,我们发布了一篇指南,其中涵盖了[**开始使用 Docker**][2] 时需要了解的几乎所有细节。在该指南中,我们向你展示了如何详细创建和管理 Docker 容器。还有一些非官方工具可用于管理 Docker 容器。如果你看过我们以前的文字,你可能会看到两个基于网络的工具,[**“Portainer”**][3] 和 [**“PiCluster”**][4]。它们都使得 Docker 管理任务在 Web 浏览器中变得更加容易和简单。今天,我遇到了另一个名为 **“Dockly”** 的 Docker 管理工具。 + +与上面的工具不同,Dockly 是一个 TUI(文本界面)程序,用于在类 Unix 系统中从终端管理 Docker 容器和服务。它是使用 **NodeJS** 编写的免费开源工具。在本简要指南中,我们将了解如何安装 Dockly 以及如何从命令行管理 Docker 容器。 + +### 安装 Dockly + +确保已在 Linux 上安装了 NodeJS。如果尚未安装,请参阅以下指南。 + + * [**如何在 Linux 上安装 NodeJS**][5] + + + +安装 NodeJS 后,运行以下命令安装 Dockly: + +``` +# npm install -g dockly +``` + +### 使用 Dockly 在终端管理 Docker 容器 + +使用 Dockly 管理 Docker 容器非常简单!你所要做的就是打开终端并运行以下命令: + +``` +# dockly +``` + +Dockly 将通过 unix 套接字自动连接到你的本机 docker 守护进程,并在终端中显示正在运行的容器列表,如下所示。 + +![][6] + +使用 Dockly 管理 Docker 容器 + +正如你在上面的截图中看到的,Dockly 在顶部显示了运行容器的以下信息: + + * 容器 ID, +  * 容器名称, +  * Docker 镜像, +  * 命令, +  * 运行中容器的状态, +  * 状态。 + + + +在右上角,你将看到容器的 CPU 和内存利用率。使用向上/向下箭头键在容器之间移动。 + +在底部,有少量的键盘快捷键来执行各种 Docker 管理任务。以下是目前可用的键盘快捷键列表: + + * **=** - 刷新 Dockly 界面, +  * **/** - 搜索容器列表视图, +  * **i** - 显示有关当前所选容器或服务的信息, +  * **回车** - 显示当前容器或服务的日志, +  * **v** - 在容器和服务视图之间切换, +  * **l** - 在选定的容器上启动 /bin/bash 会话, +  * **r** - 重启选定的容器, +  * **s** - 停止选定的容器, +  * **h** - 显示帮助窗口, +  * **q** - 退出 Dockly。 + + + +##### **查看容器的信息** + +使用向上/向下箭头选择一个容器,然后按 **“i”** 以显示所选容器的信息。 + +![][7] + +查看容器的信息 + +##### 重启容器 + +如果你想随时重启容器,只需选择它并按 **“r”** 即可重新启动。 + +![][8] + +重启 Docker 容器 + +##### 停止/删除容器和镜像 + +如果不再需要容器,我们可以立即停止和/或删除一个或所有容器。为此,请按 **“m”** 打开**菜单**。 + +![][9] + +停止,删除 Docker 容器和镜像 + +在这里,你可以执行以下操作。 + + * 停止所有 Docker 容器, +  * 删除选定的容器, +  * 删除所有容器, +  * 删除所有 Docker 镜像等。 + + + +##### 显示 Dockly 帮助部分 + +如果你有任何疑问,只需按 **“h”** 即可打开帮助部分。 + +![][10] + +Dockly 帮助 + +有关更多详细信息,请参考最后给出的官方 GitHub 页面。 + +就是这些了。希望这篇文章有用。如果你一直在使用 Docker 容器,请试试 Dockly,看它是否有帮助。 + +* * * + +**建议阅读:** + + * **[如何自动更新正在运行的 Docker 容器][11]** + * **[ctop -一个 Linux 容器的命令行监控工具][12]** + + + +* * * + +**资源:** + + * [**Dockly 的 GitHub 仓库**][13] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/ + +作者:[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/2019/05/Dockly-720x340.png +[2]: https://www.ostechnix.com/getting-started-with-docker/ +[3]: https://www.ostechnix.com/portainer-an-easiest-way-to-manage-docker/ +[4]: https://www.ostechnix.com/picluster-simple-web-based-docker-management-application/ +[5]: https://www.ostechnix.com/install-node-js-linux/ +[6]: http://www.ostechnix.com/wp-content/uploads/2019/05/Manage-Docker-Containers-Using-Dockly.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/05/View-containers-information.png +[8]: http://www.ostechnix.com/wp-content/uploads/2019/05/Restart-containers.png +[9]: http://www.ostechnix.com/wp-content/uploads/2019/05/stop-remove-containers-and-images.png +[10]: http://www.ostechnix.com/wp-content/uploads/2019/05/Dockly-Help.png +[11]: https://www.ostechnix.com/automatically-update-running-docker-containers/ +[12]: https://www.ostechnix.com/ctop-commandline-monitoring-tool-linux-containers/ +[13]: https://github.com/lirantal/dockly From 377b4f8694064301852235fc15820b0067c600a7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 May 2019 21:56:22 +0800 Subject: [PATCH 0654/1154] PRF:20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @wxy --- ... 2.0- Blockchain In Real Estate -Part 4.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md index bb560c72d4..a598b38c04 100644 --- a/translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md +++ b/translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Blockchain 2.0: Blockchain In Real Estate [Part 4]) @@ -14,21 +14,21 @@ ### 区块链 2.0:“更”智能的房地产 -在本系列的[上一篇文章][1]中探讨了区块链的特征,这些区块链将使机构能够将**传统银行**和**融资系统**转换和交织在一起。这部分将探讨**房地产区块链**。房地产业正在走向革命。它是人类已知的最活跃、交易最重要的资产类别之一。然而,由于充满了监管障碍和欺诈、欺骗的无数可能性,它也是最难参与交易的之一。利用适当的共识算法的区块链的分布式分类账本功能被吹捧为这个行业的前进方向,而这个行业传统上被认为其面对变革是保守的。 +在本系列的[上一篇文章][1]中我们探讨了区块链的特征,这些区块链将使机构能够将**传统银行**和**融资系统**转换和交织在一起。这部分将探讨**房地产区块链**。房地产业正在走向革命。它是人类已知的交易最活跃、最重要的资产类别之一。然而,由于充满了监管障碍和欺诈、欺骗的无数可能性,它也是最难参与交易的之一。利用适当的共识算法的区块链的分布式分类账本功能被吹捧为这个行业的前进方向,而这个行业传统上被认为其面对变革是保守的。 就其无数的业务而言,房地产一直是一个非常保守的行业。这似乎也是理所当然的。2008 年金融危机或 20 世纪上半叶的大萧条等重大经济危机成功摧毁了该行业及其参与者。然而,与大多数具有经济价值的产品一样,房地产行业具有弹性,而这种弹性则源于其保守性。 -全球房地产市场包括价值 228 万亿 [^1] 美元的资产类别。给予或接受。其他投资资产,如股票、债券和股票合计价值仅为 170 万亿美元。显然,在这样一个行业中实施的任何和所有交易在很大程度上都是自然精心策划和精心执行的。在大多数情况下,房地产也因许多欺诈事件而臭名昭着,并且随之而来的是毁灭性的损失。由于其运营非常保守,该行业也难以驾驭。它受到严格法律的严格监管,创造了一个交织在一起的细微差别网络,这对于普通人来说太难以完全理解。使得大多数人无法进入和参与。如果你曾参与过这样的交易,那么你就会知道纸质文件的重要性和长期性。 +全球房地产市场由价值 228 万亿 [^1] 美元的资产类别组成,出入不大。其他投资资产,如股票、债券和股票合计价值仅为 170 万亿美元。显然,在这样一个行业中实施的交易在很大程度上都是精心策划和执行的。很多时候,房地产也因许多欺诈事件而臭名昭著,并且随之而来的是毁灭性的损失。由于其运营非常保守,该行业也难以驾驭。它受到了法律的严格监管,创造了一个交织在一起的细微差别网络,这对于普通人来说太难以完全理解,使得大多数人无法进入和参与。如果你曾参与过这样的交易,那么你就会知道纸质文件的重要性和长期性。 -从一个微不足道的开始,虽然是一个重要的例子,以显示当前的记录管理实践在房地产行业有多糟糕,考虑一下[产权保险业务][2][^3]。产权保险用于对冲土地所有权和所有权记录不可接受且从而无法执行的可能性。诸如此类的保险产品也称为赔偿保险。在许多情况下,法律要求财产拥有产权保险,特别是在处理多年来多次易手的财产时。抵押贷款公司在支持房地产交易时也可能坚持同样的要求。事实上,这种产品自 19 世纪 50 年代就已存在,并且仅在美国每年至少有 1.5 万亿美元的商业价值这一事实证明了一开始的说法。在这种情况下,这些记录的维护方式必须进行改革,区块链提供了一个可持续解决方案。根据[美国土地产权协会][4],平均每个案例的欺诈平均约为 10 万美元,并且涉及交易的所有产权中有 25% 的文件存在问题。区块链允许设置一个不可变的永久数据库,该数据库将跟踪属性本身,记录已经进入的每个交易或投资。这样的分类帐本系统将使包括一次性购房者在内的房地产行业的每个人的生活更加轻松,并使诸如产权保险等金融产品基本上无关紧要。将诸如房地产之类的实物资产转换为这样的数字资产是非常规的,并且目前仅在理论上存在。然而,这种变化迫在眉睫,而不是迟到[^5]。 +从一个微不足道的开始,虽然是一个重要的例子,以显示当前的记录管理实践在房地产行业有多糟糕,考虑一下[产权保险业务][2] [^3]。产权保险用于对冲土地所有权和所有权记录不可接受且从而无法执行的可能性。诸如此类的保险产品也称为赔偿保险。在许多情况下,法律要求财产拥有产权保险,特别是在处理多年来多次易手的财产时。抵押贷款公司在支持房地产交易时也可能坚持同样的要求。事实上,这种产品自 19 世纪 50 年代就已存在,并且仅在美国每年至少有 1.5 万亿美元的商业价值这一事实证明了一开始的说法。在这种情况下,这些记录的维护方式必须进行改革,区块链提供了一个可持续解决方案。根据[美国土地产权协会][4],平均每个案例的欺诈平均约为 10 万美元,并且涉及交易的所有产权中有 25% 的文件存在问题。区块链允许设置一个不可变的永久数据库,该数据库将跟踪资产本身,记录已经进入的每个交易或投资。这样的分类帐本系统将使包括一次性购房者在内的房地产行业的每个人的生活更加轻松,并使诸如产权保险等金融产品基本上无关紧要。将诸如房地产之类的实物资产转换为这样的数字资产是非常规的,并且目前仅在理论上存在。然而,这种变化迫在眉睫,而不是迟到 [^5]。 -区块链在房地产中影响最大的领域如上所述,在维护透明和安全的产权管理系统方面。基于区块链的财产记录可以包含有关财产、其所在地、所有权历史以及相同公共记录的[信息][6]。这将允许快速完成房地产交易,并且无需第三方监控和监督。房地产评估和税收计算等任务成为有形的客观参数的问题,而不是主观测量和猜测,因为可靠的历史数据是可公开验证的。[UBITQUITY][7] 就是这样一个平台,为企业客户提供定制的基于区块链的解决方案。该平台允许客户跟踪所有房产细节、付款记录、抵押记录,甚至允许运行智能合约,自动处理税收和租赁。 +区块链在房地产中影响最大的领域如上所述,在维护透明和安全的产权管理系统方面。基于区块链的财产记录可以包含有关财产、其所在地、所有权历史以及相关的公共记录的[信息][6]。这将允许房地产交易快速完成,并且无需第三方监控和监督。房地产评估和税收计算等任务成为有形的、客观的参数问题,而不是主观测量和猜测,因为可靠的历史数据是可公开验证的。[UBITQUITY][7] 就是这样一个平台,为企业客户提供定制的基于区块链的解决方案。该平台允许客户跟踪所有房产细节、付款记录、抵押记录,甚至允许运行智能合约,自动处理税收和租赁。 -这为我们带来了房地产区块链的第二大机遇和用例。由于该行业受到众多第三方的高度监管,除了参与交易的交易对手外,尽职调查和财务评估可能非常耗时。这些流程主要使用离线渠道进行,文书工作需要在最终评估报告出来之前进行数天。对于公司房地产交易尤其如此,这构成了顾问收取的总计费时间的大部分。如果交易由抵押支持,则这些过程的重复是不可避免的。一旦与所涉及的人员和机构的数字身份相结合,就可以完全避免当前的低效率,并且可以在几秒钟内完成交易。租户、投资者、相关机构、顾问等可以单独验证数据并达成一致的共识,从而验证永久性的财产记录[^8]。这提高了验证流形的准确性。房地产巨头 RE/MAX 最近宣布与服务提供商 XYO Network Partners 合作,[建立墨西哥房地产上市国家数据库][9]。他们希望有朝一日能够创建世界上最大的(截至目前)去中心化房地产登记处之一。 +这为我们带来了房地产区块链的第二大机遇和用例。由于该行业受到众多第三方的高度监管,除了参与交易的交易对手外,尽职调查和财务评估可能非常耗时。这些流程主要通过离线渠道进行,文书工作需要在最终评估报告出来之前进行数天。对于公司房地产交易尤其如此,这构成了顾问所收取的总计费时间的大部分。如果交易由抵押背书,则这些过程的重复是不可避免的。一旦与所涉及的人员和机构的数字身份相结合,就可以完全避免当前的低效率,并且可以在几秒钟内完成交易。租户、投资者、相关机构、顾问等可以单独验证数据并达成一致的共识,从而验证永久性的财产记录 [^8]。这提高了验证流程的准确性。房地产巨头 RE/MAX 最近宣布与服务提供商 XYO Network Partners 合作,[建立墨西哥房上市地产国家数据库][9]。他们希望有朝一日能够创建世界上最大的(截至目前)去中心化房地产登记中心之一。 -然而,区块链可以带来的另一个重要且可以说是非常民主的变化是投资房地产。与其他投资资产类别不同,即使是小型家庭投资者也可能参与其中,房地产通常需要大量的手工付款才能参与。诸如 ATLANT 和 BitOfProperty 之类的公司将房产的账面价值代币化并将其转换为加密货币的等价物。这些代币随后在交易所出售,类似于股票和股票的交易方式。[房地产后续产生的任何现金流都会根据其在财产中的“份额”记入贷方或借记给代币所有者][4]。 +然而,区块链可以带来的另一个重要且可以说是非常民主的变化是投资房地产。与其他投资资产类别不同,即使是小型家庭投资者也可能参与其中,房地产通常需要大量的手工付款才能参与。诸如 ATLANT 和 BitOfProperty 之类的公司将房产的账面价值代币化,并将其转换为加密货币的等价物。这些代币随后在交易所出售,类似于股票和股票的交易方式。[房地产后续产生的任何现金流都会根据其在财产中的“份额”记入贷方或借记给代币所有者][4]。 -然而,尽管如此,区块链技术仍处于房地产领域的早期采用阶段,目前的法规还没有明确定义它。诸如分布式应用程序、分布式匿名组织(DAO)、智能合约等概念在许多国家的法律领域是闻所未闻的。一旦所有利益相关者充分接受了区块链复杂性的良好教育,就会彻底改革现有的法规和指导方针,这是最务实的前进方式。 同样,这将是一个缓慢而渐进的变化,但不过是一个急需的变化。本系列的下一篇文章将介绍 “智能合约”,例如由 UBITQUITY 和 XYO 等公司实施的那些是如何在区块链中创建和执行的。 +然而,尽管如此,区块链技术仍处于房地产领域的早期采用阶段,目前的法规还没有明确定义它。诸如分布式应用程序、分布式匿名组织(DAO)、智能合约等概念在许多国家的法律领域是闻所未闻的。一旦所有利益相关者充分接受了区块链复杂性的良好教育,就会彻底改革现有的法规和指导方针,这是最务实的前进方式。 同样,这将是一个缓慢而渐进的变化,但是它是一个急需的变化。本系列的下一篇文章将介绍 “智能合约”,例如由 UBITQUITY 和 XYO 等公司实施的那些是如何在区块链中创建和执行的。 [^1]: HSBC, “Global Real Estate,” no. April, 2008 [^3]: D. B. Burke, Law of title insurance. Aspen Law & Business, 2000. @@ -39,10 +39,10 @@ via: https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/ -作者:[EDITOR][a] +作者:[ostechnix][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e81f9c008f3e3d080958841a92173aafa2fe3134 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 May 2019 21:56:49 +0800 Subject: [PATCH 0655/1154] PUB:20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @wxy https://linux.cn/article-10914-1.html --- ...90319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md (99%) diff --git a/translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/published/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md similarity index 99% rename from translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md rename to published/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md index a598b38c04..0ea20b929a 100644 --- a/translated/talk/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md +++ b/published/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10914-1.html) [#]: subject: (Blockchain 2.0: Blockchain In Real Estate [Part 4]) [#]: via: (https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/) [#]: author: (ostechnix https://www.ostechnix.com/author/editor/) From 38064ecd5015eee3ee379baaacd3798a05cde31a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 May 2019 22:43:04 +0800 Subject: [PATCH 0656/1154] PRF:20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md @MjSeven --- ... To Search DuckDuckGo From The Terminal.md | 113 +++++++++--------- 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/translated/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md b/translated/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md index f14f1ebaae..3d8083d440 100644 --- a/translated/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md +++ b/translated/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md @@ -1,5 +1,6 @@ -ddgr - 一个从终端搜索 DuckDuckGo 的命令行工具 +ddgr:一个从终端搜索 DuckDuckGo 的命令行工具 ====== + 在 Linux 中,Bash 技巧非常棒,它使 Linux 中的一切成为可能。 对于开发人员或系统管理员来说,它真的很管用,因为他们大部分时间都在使用终端。你知道他们为什么喜欢这种技巧吗? @@ -8,184 +9,184 @@ ddgr - 一个从终端搜索 DuckDuckGo 的命令行工具 ### 什么是 ddgr -[ddgr][1] 是一个命令行实用程序,用于从终端搜索 DuckDuckGo。如果设置了 BROWSER 环境变量,ddgr 可以在几个基于文本的浏览器中开箱即用。 +[ddgr][1] 是一个命令行实用程序,用于从终端搜索 DuckDuckGo。如果设置了 `BROWSER` 环境变量,ddgr 可以在几个基于文本的浏览器中开箱即用。 -确保你的系统安装了任何基于文本的浏览器。你可能知道 [googler][2],它允许用户从 Linux 命令行进行 Google 搜索。 +确保你的系统安装了任何一个基于文本的浏览器。你可能知道 [googler][2],它允许用户从 Linux 命令行进行 Google 搜索。 -它在命令行用户中非常受欢迎,他们期望对隐私敏感的 DuckDuckGo 也有类似的实用程序,这就是 ddgr 出现的原因。 +它在命令行用户中非常受欢迎,他们期望对隐私敏感的 DuckDuckGo 也有类似的实用程序,这就是 `ddgr` 出现的原因。 与 Web 界面不同,你可以指定每页要查看的搜索结果数。 **建议阅读:** -**(#)** [Googler – 从 Linux 命令行搜索 Google][2] -**(#)** [Buku – Linux 中一个强大的命令行书签管理器][3] -**(#)** [SoCLI – 从终端搜索和浏览堆栈溢出的简单方法][4] -**(#)** [RTV(Reddit 终端查看器)- 一个简单的 Reddit 终端查看器][5] + +- [Googler – 从 Linux 命令行搜索 Google][2] +- [Buku – Linux 中一个强大的命令行书签管理器][3] +- [SoCLI – 从终端搜索和浏览 StackOverflow 的简单方法][4] +- [RTV(Reddit 终端查看器)- 一个简单的 Reddit 终端查看器][5] ### 什么是 DuckDuckGo -DDG 即 DuckDuckGo。DuckDuckGo(DDG)是一个真正保护用户搜索和隐私的互联网搜索引擎。 - -它们没有过滤用户的个性化搜索结果,对于给定的搜索词,它会向所有用户显示相同的搜索结果。 +DDG 即 DuckDuckGo。DuckDuckGo(DDG)是一个真正保护用户搜索和隐私的互联网搜索引擎。它没有过滤用户的个性化搜索结果,对于给定的搜索词,它会向所有用户显示相同的搜索结果。 大多数用户更喜欢谷歌搜索引擎,但是如果你真的担心隐私,那么你可以放心地使用 DuckDuckGo。 ### ddgr 特性 - * 快速且干净(没有广告,多余的 URL 或杂物),自定义颜色 + * 快速且干净(没有广告、多余的 URL 或杂物参数),自定义颜色 * 旨在以最小的空间提供最高的可读性 * 指定每页显示的搜索结果数 - * 从浏览器中打开的 omniprompt URL 导航结果页面 - * Bash、Zsh 和 Fish 的搜索和配置脚本 - * DuckDuckGo Bang 支持(自动完成) - * 直接在浏览器中打开第一个结果(就像我感觉 Ducky) + * 可以在 omniprompt 中导航结果,在浏览器中打开 URL + * 用于 Bash、Zsh 和 Fish 的搜索和选项补完脚本 + * 支持 DuckDuckGo Bang(带有自动补完) + * 直接在浏览器中打开第一个结果(如同 “I’m Feeling Ducky”) * 不间断搜索:无需退出即可在 omniprompt 中触发新搜索 * 关键字支持(例如:filetype:mime、site:somesite.com) - * 按时间、指定区域、禁用安全搜索 - * HTTPS 代理支持,无跟踪,可选择禁用用户代理 + * 按时间、指定区域搜索,禁用安全搜索 + * 支持 HTTPS 代理,支持 Do Not Track,可选择禁用用户代理字符串 * 支持自定义 URL 处理程序脚本或命令行实用程序 * 全面的文档,man 页面有方便的使用示例 * 最小的依赖关系 - ### 需要条件 -ddgr 需要 Python 3.4 或更高版本。因此,确保你的系统应具有 Python 3.4 或更高版本。 +`ddgr` 需要 Python 3.4 或更高版本。因此,确保你的系统应具有 Python 3.4 或更高版本。 + ``` $ python3 --version Python 3.6.3 - ``` ### 如何在 Linux 中安装 ddgr -我们可以根据发行版使用以下命令轻松安装 ddgr。 +我们可以根据发行版使用以下命令轻松安装 `ddgr`。 + +对于 Fedora ,使用 [DNF 命令][6]来安装 `ddgr`。 -对于 **`Fedora`** ,使用 [DNF 命令][6]来安装 ddgr。 ``` # dnf install ddgr - ``` -或者我们可以使用 [SNAP 命令][7]来安装 ddgr。 +或者我们可以使用 [SNAP 命令][7]来安装 `ddgr`。 + ``` # snap install ddgr - ``` -对于 **`LinuxMint/Ubuntu`**,使用 [APT-GET 命令][8] 或 [APT 命令][9]来安装 ddgr。 +对于 LinuxMint/Ubuntu,使用 [APT-GET 命令][8] 或 [APT 命令][9]来安装 `ddgr`。 + ``` $ sudo add-apt-repository ppa:twodopeshaggy/jarun $ sudo apt-get update $ sudo apt-get install ddgr - ``` -对于基于 **`Arch Linux`** 的系统,使用 [Yaourt 命令][10]或 [Packer 命令][11]从 AUR 仓库安装 ddgr。 +对于基于 Arch Linux 的系统,使用 [Yaourt 命令][10]或 [Packer 命令][11]从 AUR 仓库安装 `ddgr`。 + ``` $ yaourt -S ddgr -or +或 $ packer -S ddgr - ``` -对于 **`Debian`**,使用 [DPKG 命令][12] 安装 ddgr。 +对于 Debian,使用 [DPKG 命令][12] 安装 `ddgr`。 + ``` # wget https://github.com/jarun/ddgr/releases/download/v1.2/ddgr_1.2-1_debian9.amd64.deb # dpkg -i ddgr_1.2-1_debian9.amd64.deb - ``` -对于 **`CentOS 7`**,使用 [YUM 命令][13]来安装 ddgr。 +对于 CentOS 7,使用 [YUM 命令][13]来安装 `ddgr`。 + ``` # yum install https://github.com/jarun/ddgr/releases/download/v1.2/ddgr-1.2-1.el7.3.centos.x86_64.rpm - ``` -对于 **`opensuse`**,使用 [zypper 命令][14]来安装 ddgr。 +对于 opensuse,使用 [zypper 命令][14]来安装 `ddgr`。 + ``` # zypper install https://github.com/jarun/ddgr/releases/download/v1.2/ddgr-1.2-1.opensuse42.3.x86_64.rpm - ``` ### 如何启动 ddgr 在终端上输入 `ddgr` 命令,不带任何选项来进行 DuckDuckGo 搜索。你将获得类似于下面的输出。 + ``` $ ddgr - ``` ![][16] ### 如何使用 ddgr 进行搜索 -我们可以通过两种方式启动搜索。从omniprompt 或者直接从终端开始。你可以搜索任何你想要的短语。 +我们可以通过两种方式启动搜索。从 omniprompt 或者直接从终端开始。你可以搜索任何你想要的短语。 直接从终端: + ``` $ ddgr 2daygeek - ``` ![][17] -从 `omniprompt`: +从 omniprompt: + ![][18] ### Omniprompt 快捷方式 -输入 `?` 以获得 `omniprompt`,它将显示关键字列表和进一步使用 ddgr 的快捷方式。 +输入 `?` 以获得 omniprompt,它将显示关键字列表和进一步使用 `ddgr` 的快捷方式。 + ![][19] ### 如何移动下一页、上一页和第一页 它允许用户移动下一页、上一页或第一页。 - * `n:` 移动到下一组搜索结果 - * `p:` 移动到上一组搜索结果 - * `f:` 跳转到第一页 + * `n`: 移动到下一组搜索结果 + * `p`: 移动到上一组搜索结果 + * `f`: 跳转到第一页 ![][20] ### 如何启动新搜索 -“**d**” 选项允许用户从 omniprompt 发起新的搜索。例如,我搜索了 `2daygeek 网站`,现在我将搜索 **Magesh Maruthamuthu** 这个新短语。 +`d` 选项允许用户从 omniprompt 发起新的搜索。例如,我搜索了 “2daygeek website”,现在我将搜索 “Magesh Maruthamuthu” 这个新短语。 + +从 omniprompt: -从 `omniprompt`. ``` ddgr (? for help) d magesh maruthmuthu - ``` ![][21] ### 在搜索结果中显示完整的 URL -默认情况下,它仅显示文章标题,在搜索中添加 **x** 选项以在搜索结果中显示完整的文章网址。 +默认情况下,它仅显示文章标题,在搜索中添加 `x` 选项以在搜索结果中显示完整的文章网址。 + ``` $ ddgr -n 5 -x 2daygeek - ``` ![][22] ### 限制搜索结果 -默认情况下,搜索结果每页显示 10 个结果。如果你想为方便起见限制页面结果,可以使用 ddgr 带有 `--num` 或 ` -n` 参数。 +默认情况下,搜索结果每页显示 10 个结果。如果你想为方便起见限制页面结果,可以使用 `ddgr` 带有 `--num` 或 ` -n` 参数。 + ``` $ ddgr -n 5 2daygeek - ``` ![][23] ### 网站特定搜索 -要搜索特定网站的特定页面,使用以下格式。这将从网站获取给定关键字的结果。例如,我们在 2daygeek 网站搜索 **Package Manager**,查看结果。 +要搜索特定网站的特定页面,使用以下格式。这将从网站获取给定关键字的结果。例如,我们在 2daygeek 网站下搜索 “Package Manager”,查看结果。 + ``` $ ddgr -n 5 --site 2daygeek "package manager" - ``` ![][24] @@ -195,8 +196,8 @@ $ ddgr -n 5 --site 2daygeek "package manager" via: https://www.2daygeek.com/ddgr-duckduckgo-search-from-the-command-line-in-linux/ 作者:[Magesh Maruthamuthu][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) 选题:[lujun9972](https://github.com/lujun9972) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4fa0e0cb003d0c85f009ad635b26ade6157cc3ea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 May 2019 22:49:11 +0800 Subject: [PATCH 0657/1154] PUB:20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md @MjSeven https://linux.cn/article-10915-1.html --- ... A Command Line Tool To Search DuckDuckGo From The Terminal.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md (100%) diff --git a/translated/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md b/published/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md similarity index 100% rename from translated/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md rename to published/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md From 7fc28b10aa39e9c58ebcfa1bffde19de184c62f1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 May 2019 23:41:50 +0800 Subject: [PATCH 0658/1154] PRF:20190329 How to manage your Linux environment.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @robsean 这篇比较好 --- ...29 How to manage your Linux environment.md | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/translated/tech/20190329 How to manage your Linux environment.md b/translated/tech/20190329 How to manage your Linux environment.md index a8af83c687..36b64fd80f 100644 --- a/translated/tech/20190329 How to manage your Linux environment.md +++ b/translated/tech/20190329 How to manage your Linux environment.md @@ -1,22 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to manage your Linux environment) -[#]: via: (https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html#tk.rss_all) +[#]: via: (https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -如何管理你的 Linux 环境 +如何管理你的 Linux 环境变量 ====== -### Linux 用户环境变量帮助你找到你需要的命令,获取很多完成的细节,而不需要知道系统如何配置的。 设置来自哪里和如何被修改它们是另一个课题。 +> Linux 用户环境变量可以帮助你找到你需要的命令,无须了解系统如何配置的细节而完成大量工作。而这些设置来自哪里和如何被修改它们是另一个话题。 ![IIP Photo Archive \(CC BY 2.0\)][1] -在 Linux 系统上的用户配置可以用多种方法简化你的使用。你可以运行命令,而不需要知道它们的位置。你可以重新使用先前运行的命令,而不用发愁系统是如何保持它们的踪迹。你可以查看你的电子邮件,查看手册页,并容易地回到你的 home 目录,而不管你在文件系统可能已经迷失方向。并且,当需要的时候,你可以调整你的账户设置,以便它向着你喜欢的方式来工作。 +在 Linux 系统上的用户账户配置以多种方法简化了系统的使用。你可以运行命令,而不需要知道它们的位置。你可以重新使用先前运行的命令,而不用发愁系统是如何追踪到它们的。你可以查看你的电子邮件,查看手册页,并容易地回到你的家目录,而不用管你在文件系统中身在何方。并且,当需要的时候,你可以调整你的账户设置,以便其更符合你喜欢的方式。 -Linux 环境设置来自一系列的文件 — 一些是系统范围(意味着它们影响所有用户账户),一些是配置处于你的 home 目录中文件中。系统范围设置在你登陆时生效,本地设置在以后生效,所以,你在你账户中作出的更改将覆盖系统范围设置。对于 bash 用户,这些文件包含这些系统文件: +Linux 环境设置来自一系列的文件:一些是系统范围(意味着它们影响所有用户账户),一些是处于你的家目录中的配置文件里。系统范围的设置在你登录时生效,而本地设置在其后生效,所以,你在你账户中作出的更改将覆盖系统范围设置。对于 bash 用户,这些文件包含这些系统文件: ``` /etc/environment @@ -24,22 +24,20 @@ Linux 环境设置来自一系列的文件 — 一些是系统范围(意味着 /etc/profile ``` -和其中一些本地文件: +以及一些本地文件: ``` ~/.bashrc -~/.profile -- not read if ~/.bash_profile or ~/.bash_login +~/.profile # 如果有 ~/.bash_profile 或 ~/.bash_login 就不会读此文件 ~/.bash_profile ~/.bash_login ``` -你可以修改本地存在的四个文件的任何一个,因为它们处于你的 home 目录,并且它们是属于你的。 - -**[ 两分钟 Linux 提示:[学习如何在2分钟视频教程中掌握很多 Linux 命令][2] ]** +你可以修改本地存在的四个文件的任何一个,因为它们处于你的家目录,并且它们是属于你的。 ### 查看你的 Linux 环境设置 -为查看你的环境设置,使用 **env** 命令。你的输出将可能与这相似: +为查看你的环境设置,使用 `env` 命令。你的输出将可能与这相似: ``` $ env @@ -84,9 +82,9 @@ LESSOPEN=| /usr/bin/lesspipe %s _=/usr/bin/env ``` -虽然你可能会得到大量的输出,第一个大部分用颜色显示上面的细节,颜色被用于命令行上来识别各种各样文件类型。当你看到一些东西,像 ***.tar=01;31:** ,这告诉你 tar 文件将以红色显示在文件列表中,然而 ***.jpg=01;35:** 告诉你 jpg 文件将以紫色显现出来。这些颜色本意是使它易于从一个文件列表中分辨出某些文件。你可以在[在 Linux 命令行中自定义你的颜色][3]处学习更多关于这些颜色的定义,和如何自定义它们, +虽然你可能会看到大量的输出,上面显示的第一大部分用于在命令行上使用颜色标识各种文件类型。当你看到类似 `*.tar=01;31:` 这样的东西,这告诉你 `tar` 文件将以红色显示在文件列表中,然而 `*.jpg=01;35:` 告诉你 jpg 文件将以紫色显现出来。这些颜色旨在使它易于从一个文件列表中分辨出某些文件。你可以在《[在 Linux 命令行中自定义你的颜色][3]》处学习更多关于这些颜色的定义,和如何自定义它们。 -当你更喜欢一种不加装饰的显示时,一种简单关闭颜色方法是使用一个命令,例如这一个: +当你更喜欢一种不加装饰的显示时,一种关闭颜色显示的简单方法是使用如下命令: ``` $ ls -l --color=never @@ -98,14 +96,14 @@ $ ls -l --color=never $ alias ll2='ls -l --color=never' ``` -你也可以使用 **echo** 命令来单独地显现设置。在这个命令中,我们显示在历史缓存区中将被记忆命令的数量: +你也可以使用 `echo` 命令来单独地显现某个设置。在这个命令中,我们显示在历史缓存区中将被记忆命令的数量: ``` $ echo $HISTSIZE 1000 ``` -如果你已经移动,你在文件系统中的最后位置将被记忆。 +如果你已经移动到某个位置,你在文件系统中的最后位置会被记在这里: ``` PWD=/home/shs @@ -114,31 +112,31 @@ OLDPWD=/tmp ### 作出更改 -你可以使用一个像这样的命令更改环境设置的,但是,如果你希望保持这个设置,在你的 ~/.bashrc 文件中添加一行代码,例如 "HISTSIZE=1234" 。 +你可以使用一个像这样的命令更改环境设置,但是,如果你希望保持这个设置,在你的 `~/.bashrc` 文件中添加一行代码,例如 `HISTSIZE=1234`。 ``` $ export HISTSIZE=1234 ``` -### "export" 一个变量的本意是什么 +### “export” 一个变量的本意是什么 -导出一个变量使设置可用于你的 shell 和可能的子shell。默认情况下,用户定义的变量是本地的,并不被导出到新的进程,例如,子 shell 和脚本。export 命令使变量可用于子进程的函数。 +导出一个环境变量可使设置用于你的 shell 和可能的子 shell。默认情况下,用户定义的变量是本地的,并不被导出到新的进程,例如,子 shell 和脚本。`export` 命令使得环境变量可用在子进程中发挥功用。 ### 添加和移除变量 -你可以创建新的变量,并使它们在命令行和子 shell 上非常容易地可用。然而,这些变量将不存活于你的登出和再次回来,除非你也添加它们到 ~/.bashrc 或一个类似的文件。 +你可以很容易地在命令行和子 shell 上创建新的变量,并使它们可用。然而,当你登出并再次回来时这些变量将消失,除非你也将它们添加到 `~/.bashrc` 或一个类似的文件中。 ``` $ export MSG="Hello, World!" ``` -如果你需要,你可以使用 **unset** 命令来消除一个变量: +如果你需要,你可以使用 `unset` 命令来消除一个变量: ``` $ unset MSG ``` -如果变量被局部定义,你可以通过获得你的启动文件来简单地设置它回来。例如: +如果变量是局部定义的,你可以通过加载你的启动文件来简单地将其设置回来。例如: ``` $ echo $MSG @@ -153,18 +151,16 @@ Hello, World! ### 小结 -用户账户是为创建一个有用的用户环境,而使用一组恰当的启动文件建立,但是,独立的用户和系统管理员都可以通过编辑他们的个人设置文件(对于用户)或很多来自设置起源的文件(对于系统管理员)来更改默认设置。 - -Join the Network World communities on 在 [Facebook][4] 和 [LinkedIn][5] 上加入网络世界社区来评论重要话题。 +用户账户是用一组恰当的启动文件设立的,创建了一个有用的用户环境,而个人用户和系统管理员都可以通过编辑他们的个人设置文件(对于用户)或很多来自设置起源的文件(对于系统管理员)来更改默认设置。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html#tk.rss_all +via: https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html 作者:[Sandra Henry-Stocker][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/) 荣誉推出 From a5421f9bcbbcffa02f3f4cc51e51b54981ce704e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 May 2019 23:42:39 +0800 Subject: [PATCH 0659/1154] PUB:20190329 How to manage your Linux environment.md @robsean https://linux.cn/article-10916-1.html --- .../20190329 How to manage your Linux environment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190329 How to manage your Linux environment.md (99%) diff --git a/translated/tech/20190329 How to manage your Linux environment.md b/published/20190329 How to manage your Linux environment.md similarity index 99% rename from translated/tech/20190329 How to manage your Linux environment.md rename to published/20190329 How to manage your Linux environment.md index 36b64fd80f..0a226f79f7 100644 --- a/translated/tech/20190329 How to manage your Linux environment.md +++ b/published/20190329 How to manage your Linux environment.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10916-1.html) [#]: subject: (How to manage your Linux environment) [#]: via: (https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 62c587d2b2fdd1c2b5bc8eb8fe75d94fbfd42ab9 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Thu, 30 May 2019 08:44:25 +0800 Subject: [PATCH 0660/1154] translating by arrowfeng --- sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md b/sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md index 4420b034e6..d25298583c 100644 --- a/sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md +++ b/sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2fd722a37058b3791961b58aa86732d3a5bed80b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 May 2019 08:46:44 +0800 Subject: [PATCH 0661/1154] APL:20190107 Aliases- To Protect and Serve.md --- sources/tech/20190107 Aliases- To Protect and Serve.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sources/tech/20190107 Aliases- To Protect and Serve.md b/sources/tech/20190107 Aliases- To Protect and Serve.md index 783c59dc41..c556206fd4 100644 --- a/sources/tech/20190107 Aliases- To Protect and Serve.md +++ b/sources/tech/20190107 Aliases- To Protect and Serve.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,11 +7,14 @@ [#]: via: (https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve) [#]: author: (Paul Brown https://www.linux.com/users/bro66) -Aliases: To Protect and Serve +命令别名:保护和服务 ====== +> Linux shell 允许你将命令链接在一起以一次触发执行复杂的操作,并创建别名以充当快捷方式。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/prairie-path_1920.jpg?itok=wRARsM7p) +让我们将继续我们的别名系列。到目前为止,你可能已经阅读了我们的[关于别名的第一篇文章][1],并且应该非常清楚它们是如何为自己省去很多麻烦的最简单方法。 例如,你已经看到他们帮助了肌肉记忆,但让我们看看其他几个别名派上用场的案例。 + Happy 2019! Here in the new year, we’re continuing our series on aliases. By now, you’ve probably read our [first article on aliases][1], and it should be quite clear how they are the easiest way to save yourself a lot of trouble. You already saw, for example, that they helped with muscle-memory, but let's see several other cases in which aliases come in handy. ### Aliases as Shortcuts @@ -170,7 +173,7 @@ via: https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve [a]: https://www.linux.com/users/bro66 [b]: https://github.com/lujun9972 -[1]: https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve +[1]: https://linux.cn/article-10377-1.html [2]: https://www.linux.com/files/images/fig01png-0 [3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/fig01_0.png?itok=crqTm_va (aliases) [4]: https://www.linux.com/licenses/category/used-permission From f21b04dc13b5829da5efb69db6b2495ac3419285 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 30 May 2019 08:49:15 +0800 Subject: [PATCH 0662/1154] translated --- ...90411 Be your own certificate authority.md | 135 ------------------ ...90411 Be your own certificate authority.md | 133 +++++++++++++++++ 2 files changed, 133 insertions(+), 135 deletions(-) delete mode 100644 sources/tech/20190411 Be your own certificate authority.md create mode 100644 translated/tech/20190411 Be your own certificate authority.md diff --git a/sources/tech/20190411 Be your own certificate authority.md b/sources/tech/20190411 Be your own certificate authority.md deleted file mode 100644 index 9ecdd54315..0000000000 --- a/sources/tech/20190411 Be your own certificate authority.md +++ /dev/null @@ -1,135 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Be your own certificate authority) -[#]: via: (https://opensource.com/article/19/4/certificate-authority) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/elenajon123) - -Be your own certificate authority -====== -Create a simple, internal CA for your microservice architecture or -integration testing. -![][1] - -The Transport Layer Security ([TLS][2]) model, which is sometimes referred to by the older name SSL, is based on the concept of [certificate authorities][3] (CAs). These authorities are trusted by browsers and operating systems and, in turn, _sign_ servers' certificates to validate their ownership. - -However, for an intranet, a microservice architecture, or integration testing, it is sometimes useful to have a _local CA_ : one that is trusted only internally and, in turn, signs local servers' certificates. - -This especially makes sense for integration tests. Getting certificates can be a burden because the servers will be up for minutes. But having an "ignore certificate" option in the code could allow it to be activated in production, leading to a security catastrophe. - -A CA certificate is not much different from a regular server certificate; what matters is that it is trusted by local code. For example, in the **requests** library, this can be done by setting the **REQUESTS_CA_BUNDLE** variable to a directory containing this certificate. - -In the example of creating a certificate for integration tests, there is no need for a _long-lived_ certificate: if your integration tests take more than a day, you have already failed. - -So, calculate **yesterday** and **tomorrow** as the validity interval: - - -``` ->>> import datetime ->>> one_day = datetime.timedelta(days=1) ->>> today = datetime.date.today() ->>> yesterday = today - one_day ->>> tomorrow = today - one_day -``` - -Now you are ready to create a simple CA certificate. You need to generate a private key, create a public key, set up the "parameters" of the CA, and then self-sign the certificate: a CA certificate is _always_ self-signed. Finally, write out both the certificate file as well as the private key file. - - -``` -from cryptography.hazmat.primitives.asymmetric import rsa -from cryptography.hazmat.primitives import hashes, serialization -from cryptography import x509 -from cryptography.x509.oid import NameOID - -private_key = rsa.generate_private_key( -public_exponent=65537, -key_size=2048, -backend=default_backend() -) -public_key = private_key.public_key() -builder = x509.CertificateBuilder() -builder = builder.subject_name(x509.Name([ -x509.NameAttribute(NameOID.COMMON_NAME, 'Simple Test CA'), -])) -builder = builder.issuer_name(x509.Name([ -x509.NameAttribute(NameOID.COMMON_NAME, 'Simple Test CA'), -])) -builder = builder.not_valid_before(yesterday) -builder = builder.not_valid_after(tomorrow) -builder = builder.serial_number(x509.random_serial_number()) -builder = builder.public_key(public_key) -builder = builder.add_extension( -x509.BasicConstraints(ca=True, path_length=None), -critical=True) -certificate = builder.sign( -private_key=private_key, algorithm=hashes.SHA256(), -backend=default_backend() -) -private_bytes = private_key.private_bytes( -encoding=serialization.Encoding.PEM, -format=serialization.PrivateFormat.TraditionalOpenSSL, -encryption_algorithm=serialization.NoEncrption()) -public_bytes = certificate.public_bytes( -encoding=serialization.Encoding.PEM) -with open("ca.pem", "wb") as fout: -fout.write(private_bytes + public_bytes) -with open("ca.crt", "wb") as fout: -fout.write(public_bytes) -``` - -In general, a real CA will expect a [certificate signing request][4] (CSR) to sign a certificate. However, when you are your own CA, you can make your own rules! Just go ahead and sign what you want. - -Continuing with the integration test example, you can create the private keys and sign the corresponding public keys right then. Notice **COMMON_NAME** needs to be the "server name" in the **https** URL. If you've configured name lookup, the needed server will respond on **service.test.local**. - - -``` -service_private_key = rsa.generate_private_key( -public_exponent=65537, -key_size=2048, -backend=default_backend() -) -service_public_key = service_private_key.public_key() -builder = x509.CertificateBuilder() -builder = builder.subject_name(x509.Name([ -x509.NameAttribute(NameOID.COMMON_NAME, 'service.test.local') -])) -builder = builder.not_valid_before(yesterday) -builder = builder.not_valid_after(tomorrow) -builder = builder.public_key(public_key) -certificate = builder.sign( -private_key=private_key, algorithm=hashes.SHA256(), -backend=default_backend() -) -private_bytes = service_private_key.private_bytes( -encoding=serialization.Encoding.PEM, -format=serialization.PrivateFormat.TraditionalOpenSSL, -encryption_algorithm=serialization.NoEncrption()) -public_bytes = certificate.public_bytes( -encoding=serialization.Encoding.PEM) -with open("service.pem", "wb") as fout: -fout.write(private_bytes + public_bytes) -``` - -Now the **service.pem** file has a private key and a certificate that is "valid": it has been signed by your local CA. The file is in a format that can be given to, say, Nginx, HAProxy, or most other HTTPS servers. - -By applying this logic to testing scripts, it's easy to create servers that look like authentic HTTPS servers, as long as the client is configured to trust the right CA. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/certificate-authority - -作者:[Moshe Zadka (Community Moderator)][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez/users/elenajon123 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_commun_4604_02_mech_connections_rhcz0.5x.png?itok=YPPU4dMj -[2]: https://en.wikipedia.org/wiki/Transport_Layer_Security -[3]: https://en.wikipedia.org/wiki/Certificate_authority -[4]: https://en.wikipedia.org/wiki/Certificate_signing_request diff --git a/translated/tech/20190411 Be your own certificate authority.md b/translated/tech/20190411 Be your own certificate authority.md new file mode 100644 index 0000000000..21c698982c --- /dev/null +++ b/translated/tech/20190411 Be your own certificate authority.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Be your own certificate authority) +[#]: via: (https://opensource.com/article/19/4/certificate-authority) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/elenajon123) + + +自己成为证书颁发机构 +====== +为你的微服务架构或者集成测试创建一个简单的内部 CA +![][1] + +传输层安全([TLS][2])模型,有时也称它的旧名称 SSL,是基于[证书颁发机构][3] (CA) 的概念。这些机构受到浏览器和操作系统的信任,然后_签名_服务器的的证书则用于验证其所有权。 + +但是,对于内部网络,微服务架构或集成测试,有时候_本地 CA_ 更有用:一个只在内部受信任的CA,然后签名本地服务器的证书。 + +这对集成测试特别有意义。获取证书可能会带来负担,因为这会占用服务器几分钟。但是在代码中使用“忽略证书”可能会引入生产环境,从而导致安全灾难。 + +CA 证书与常规服务器证书没有太大区别。重要的是它被本地代码信任。例如,在 **requests** 库中,可以通过将 **REQUESTS_CA_BUNDLE** 变量设置为包含此证书的目录来完成。 + +在为集成测试创建证书的例子中,不需要_长期的_证书:如果你的集成测试需要超过一天,那么你会失败。 + +因此,计算**昨天**和**明天**作为有效期间隔: + +``` +>>> import datetime +>>> one_day = datetime.timedelta(days=1) +>>> today = datetime.date.today() +>>> yesterday = today - one_day +>>> tomorrow = today - one_day +``` + +现在你已准备好创建一个简单的 CA 证书。你需要生成私钥,创建公钥,设置 CA 的“参数”,然后自签名证书:CA 证书_总是_自签名的。最后,导出证书文件以及私钥文件。 + +``` +from cryptography.hazmat.primitives.asymmetric import rsa +from cryptography.hazmat.primitives import hashes, serialization +from cryptography import x509 +from cryptography.x509.oid import NameOID + + +private_key = rsa.generate_private_key( + public_exponent=65537, + key_size=2048, + backend=default_backend() +) +public_key = private_key.public_key() +builder = x509.CertificateBuilder() +builder = builder.subject_name(x509.Name([ + x509.NameAttribute(NameOID.COMMON_NAME, 'Simple Test CA'), +])) +builder = builder.issuer_name(x509.Name([ + x509.NameAttribute(NameOID.COMMON_NAME, 'Simple Test CA'), +])) +builder = builder.not_valid_before(yesterday) +builder = builder.not_valid_after(tomorrow) +builder = builder.serial_number(x509.random_serial_number()) +builder = builder.public_key(public_key) +builder = builder.add_extension( + x509.BasicConstraints(ca=True, path_length=None), + critical=True) +certificate = builder.sign( + private_key=private_key, algorithm=hashes.SHA256(), + backend=default_backend() +) +private_bytes = private_key.private_bytes( + encoding=serialization.Encoding.PEM, + format=serialization.PrivateFormat.TraditionalOpenSSL, + encryption_algorithm=serialization.NoEncrption()) +public_bytes = certificate.public_bytes( + encoding=serialization.Encoding.PEM) +with open("ca.pem", "wb") as fout: + fout.write(private_bytes + public_bytes) +with open("ca.crt", "wb") as fout: + fout.write(public_bytes) +``` + +通常,真正的 CA 会有[证书签名请求][4] (CSR) 来签名证书。但是,当你是自己的 CA 时,你可以制定自己的规则!请继续并签名你想要的内容。 + +继续集成测试的例子,你可以创建私钥并立即签名相应的公钥。注意 **COMMON_NAME** 需要是 **https** URL 中的“服务器名称”。如果你已配置名称查询,则相应的服务器会响应 **service.test.local**。 + +``` +service_private_key = rsa.generate_private_key( + public_exponent=65537, + key_size=2048, + backend=default_backend() +) +service_public_key = service_private_key.public_key() +builder = x509.CertificateBuilder() +builder = builder.subject_name(x509.Name([ + x509.NameAttribute(NameOID.COMMON_NAME, 'service.test.local') +])) +builder = builder.not_valid_before(yesterday) +builder = builder.not_valid_after(tomorrow) +builder = builder.public_key(public_key) +certificate = builder.sign( + private_key=private_key, algorithm=hashes.SHA256(), + backend=default_backend() +) +private_bytes = service_private_key.private_bytes( + encoding=serialization.Encoding.PEM, + format=serialization.PrivateFormat.TraditionalOpenSSL, + encryption_algorithm=serialization.NoEncrption()) +public_bytes = certificate.public_bytes( + encoding=serialization.Encoding.PEM) +with open("service.pem", "wb") as fout: + fout.write(private_bytes + public_bytes) +``` + +现在 **service.pem** 文件有一个私钥和一个“有效”的证书:它已由本地的 CA 签名。该文件的格式可以给 Nginx、HAProxy 或大多数其他 HTTPS 服务器使用。 + +通过将此逻辑用在测试脚本中,只要客户端配置信任该 CA,那么就可以轻松创建看起来真实的 HTTPS 服务器。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/certificate-authority + +作者:[Moshe Zadka (Community Moderator)][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/moshez/users/elenajon123 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_commun_4604_02_mech_connections_rhcz0.5x.png?itok=YPPU4dMj +[2]: https://en.wikipedia.org/wiki/Transport_Layer_Security +[3]: https://en.wikipedia.org/wiki/Certificate_authority +[4]: https://en.wikipedia.org/wiki/Certificate_signing_request \ No newline at end of file From 9e368c8e230a297a9e694b29ae601e52178a99ab Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 30 May 2019 08:54:44 +0800 Subject: [PATCH 0663/1154] translating --- ...0520 Zettlr - Markdown Editor for Writers and Researchers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md b/sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md index 92d6278ed4..54949e4f29 100644 --- a/sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md +++ b/sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d487f6bb696bb1e9df654d79406aa2523f5d33d5 Mon Sep 17 00:00:00 2001 From: HALO Feng <289716347@qq.com> Date: Thu, 30 May 2019 09:04:46 +0800 Subject: [PATCH 0664/1154] translating by arrowfeng --- .../tech/20190509 5 essential values for the DevOps mindset.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190509 5 essential values for the DevOps mindset.md b/sources/tech/20190509 5 essential values for the DevOps mindset.md index 4746d2ffaa..e9dafbd673 100644 --- a/sources/tech/20190509 5 essential values for the DevOps mindset.md +++ b/sources/tech/20190509 5 essential values for the DevOps mindset.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (arrowfeng) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8ec93b8da535d825ad1c71347da9e34e8899a62b Mon Sep 17 00:00:00 2001 From: cycoe Date: Thu, 30 May 2019 09:20:27 +0800 Subject: [PATCH 0665/1154] translated by cycoe --- ...oring CPU and GPU Temperatures on Linux.md | 166 ------------------ ...oring CPU and GPU Temperatures on Linux.md | 164 +++++++++++++++++ 2 files changed, 164 insertions(+), 166 deletions(-) delete mode 100644 sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md create mode 100644 translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md diff --git a/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md b/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md deleted file mode 100644 index dcc3cec871..0000000000 --- a/sources/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md +++ /dev/null @@ -1,166 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (cycoe) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Monitoring CPU and GPU Temperatures on Linux) -[#]: via: (https://itsfoss.com/monitor-cpu-gpu-temp-linux/) -[#]: author: (It's FOSS Community https://itsfoss.com/author/itsfoss/) - -Monitoring CPU and GPU Temperatures on Linux -====== - -_**Brief: This articles discusses two simple ways of monitoring CPU and GPU temperatures in Linux command line.**_ - -Because of **[Steam][1]** (including _[Steam Play][2]_ , aka _Proton_ ) and other developments, **GNU/Linux** is becoming the gaming platform of choice for more and more computer users everyday. A good number of users are also going for **GNU/Linux** when it comes to other resource-consuming computing tasks such as [video editing][3] or graphic design ( _Kdenlive_ and _[Blender][4]_ are good examples of programs for these). - -Whether you are one of those users or otherwise, you are bound to have wondered how hot your computer’s CPU and GPU can get (even more so if you do overclocking). If that is the case, keep reading. We will be looking at a couple of very simple commands to monitor CPU and GPU temps. - -My setup includes a [Slimbook Kymera][5] and two displays (a TV set and a PC monitor) which allows me to use one for playing games and the other to keep an eye on the temperatures. Also, since I use [Zorin OS][6] I will be focusing on **Ubuntu** and **Ubuntu** derivatives. - -To monitor the behaviour of both CPU and GPU we will be making use of the useful `watch` command to have dynamic readings every certain number of seconds. - -![][7] - -### Monitoring CPU Temperature in Linux - -For CPU temps, we will combine `watch` with the `sensors` command. An interesting article about a [gui version of this tool has already been covered on It’s FOSS][8]. However, we will use the terminal version here: - -``` -watch -n 2 sensors -``` - -`watch` guarantees that the readings will be updated every 2 seconds (and this value can — of course — be changed to what best fit your needs): - -``` -Every 2,0s: sensors - -iwlwifi-virtual-0 -Adapter: Virtual device -temp1: +39.0°C - -acpitz-virtual-0 -Adapter: Virtual device -temp1: +27.8°C (crit = +119.0°C) -temp2: +29.8°C (crit = +119.0°C) - -coretemp-isa-0000 -Adapter: ISA adapter -Package id 0: +37.0°C (high = +82.0°C, crit = +100.0°C) -Core 0: +35.0°C (high = +82.0°C, crit = +100.0°C) -Core 1: +35.0°C (high = +82.0°C, crit = +100.0°C) -Core 2: +33.0°C (high = +82.0°C, crit = +100.0°C) -Core 3: +36.0°C (high = +82.0°C, crit = +100.0°C) -Core 4: +37.0°C (high = +82.0°C, crit = +100.0°C) -Core 5: +35.0°C (high = +82.0°C, crit = +100.0°C) -``` - -Amongst other things, we get the following information: - - * We have 5 cores in use at the moment (with the current highest temperature being 37.0ºC). - * Values higher than 82.0ºC are considered high. - * A value over 100.0ºC is deemed critical. - - - -[][9] - -Suggested read Top 10 Command Line Games For Linux - -The values above lead us to the conclusion that the computer’s workload is very light at the moment. - -### Monitoring GPU Temperature in Linux - -Let us turn to the graphics card now. I have never used an **AMD** dedicated graphics card, so I will be focusing on **Nvidia** ones. The first thing to do is download the appropriate, current driver through [additional drivers in Ubuntu][10]. - -On **Ubuntu** (and its forks such as **Zorin** or **Linux Mint** ), going to _Software & Updates_ > _Additional Drivers_ and selecting the most recent one normally suffices. Additionally, you can add/enable the official _ppa_ for graphics cards (either through the command line or via _Software & Updates_ > _Other Software_ ). After installing the driver you will have at your disposal the _Nvidia X Server_ gui application along with the command line utility _nvidia-smi_ (Nvidia System Management Interface). So we will use `watch` and `nvidia-smi`: - -``` -watch -n 2 nvidia-smi -``` - -And — the same as for the CPU — we will get updated readings every two seconds: - -``` -Every 2,0s: nvidia-smi - -Fri Apr 19 20:45:30 2019 -+-----------------------------------------------------------------------------+ -| Nvidia-SMI 418.56 Driver Version: 418.56 CUDA Version: 10.1 | -|-------------------------------+----------------------+----------------------+ -| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | -| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | -|===============================+======================+======================| -| 0 GeForce GTX 106... Off | 00000000:01:00.0 On | N/A | -| 0% 54C P8 10W / 120W | 433MiB / 6077MiB | 4% Default | -+-------------------------------+----------------------+----------------------+ - -+-----------------------------------------------------------------------------+ -| Processes: GPU Memory | -| GPU PID Type Process name Usage | -|=============================================================================| -| 0 1557 G /usr/lib/xorg/Xorg 190MiB | -| 0 1820 G /usr/bin/gnome-shell 174MiB | -| 0 7820 G ...equest-channel-token=303407235874180773 65MiB | -+-----------------------------------------------------------------------------+ -``` - -The chart gives the following information about the graphics card: - - * it is using the open source driver version 418.56. - * the current temperature of the card is 54.0ºC — with the fan at 0% of its capacity. - * the power consumption is very low: only 10W. - * out of 6 GB of vram (video random access memory), it is only using 433 MB. - * the used vram is being taken by three processes whose IDs are — respectively — 1557, 1820 and 7820. - - - -[][11] - -Suggested read Googler: Now You Can Google From Linux Terminal! - -Most of these facts/values show that — clearly — we are not playing any resource-consuming games or dealing with heavy workloads. Should we started playing a game, processing a video — or the like —, the values would start to go up. - -#### Conclusion - -Althoug there are gui tools, I find these two commands very handy to check on your hardware in real time. - -What do you make of them? You can learn more about the utilities involved by reading their man pages. - -Do you have other preferences? Share them with us in the comments, ;). - -Halof!!! (Have a lot of fun!!!). - -![avatar][12] - -### Alejandro Egea-Abellán - -It’s FOSS Community Contributor - -I developed a liking for electronics, linguistics, herpetology and computers (particularly GNU/Linux and FOSS). I am LPIC-2 certified and currently work as a technical consultant and Moodle administrator in the Department for Lifelong Learning at the Ministry of Education in Murcia, Spain. I am a firm believer in lifelong learning, the sharing of knowledge and computer-user freedom. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/monitor-cpu-gpu-temp-linux/ - -作者:[It's FOSS Community][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/itsfoss/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/install-steam-ubuntu-linux/ -[2]: https://itsfoss.com/steam-play-proton/ -[3]: https://itsfoss.com/best-video-editing-software-linux/ -[4]: https://www.blender.org/ -[5]: https://slimbook.es/ -[6]: https://zorinos.com/ -[7]: https://itsfoss.com/wp-content/uploads/2019/04/monitor-cpu-gpu-temperature-linux-800x450.png -[8]: https://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ -[9]: https://itsfoss.com/best-command-line-games-linux/ -[10]: https://itsfoss.com/install-additional-drivers-ubuntu/ -[11]: https://itsfoss.com/review-googler-linux/ -[12]: https://itsfoss.com/wp-content/uploads/2019/04/EGEA-ABELLAN-Alejandro.jpg diff --git a/translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md b/translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md new file mode 100644 index 0000000000..50706c1fe4 --- /dev/null +++ b/translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: (cycoe) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Monitoring CPU and GPU Temperatures on Linux) +[#]: via: (https://itsfoss.com/monitor-cpu-gpu-temp-linux/) +[#]: author: (It's FOSS Community https://itsfoss.com/author/itsfoss/) + +在 Linux 上监控 CPU 和 GPU 温度 +====== + +_**摘要:本篇文章讨论了在 Linux 命令行中监控 CPU 和 GPU 温度的两种简单方式。**_ + +由于 **[Steam][1]**(包括 _[Steam Play][2]_,也就是我们所熟知的 _Proton_)和一些其他的发展,**GNU/Linux** 正在成为越来越多计算机用户的日常游戏平台的选择。也有相当一部分用户在遇到像[视频编辑][3]或图形设计等(_Kdenlive_ 和 _[Blender][4]_ 是这类应用程序中很好的例子)资源消耗型计算任务时,也会使用 **GNU/Linux**。 + +不管你是否是这些用户中的一员或其他用户,你也一定想知道你的电脑 CPU 和 GPU 能有多热(如果你想要超频的话更会如此)。如果情况是这样,那么继续读下去。我们会介绍两个非常简单的命令来监控 CPU 和 GPU 温度。 + +我的装置包括一台 [Slimbook Kymera][5] 和两台显示器(一台 TV 和一台 PC 监视器),使得我可以用一台来玩游戏,另一台来留意监控温度。另外,因为我使用 [Zorin OS][6],我会将关注点放在 **Ubuntu** 和 **Ubuntu** 的衍生发行版上。 + +为了监控 CPU 和 GPU 的行为,我们将利用实用的 `watch` 命令在每几秒钟之后动态地得到示数。 + +![][7] + +### 在 Linux 中监控 CPU 温度 + +对于 CPU 温度,我们将结合使用 `watch` 与 `sensors` 命令。一篇关于[此工具的图形用户界面版本][8]的有趣文章已经在 It's FOSS 中介绍过了。然而,我们将在此处使用命令行版本: + +``` +watch -n 2 sensors +``` + +`watch` 保证了示数会在每 2 秒钟更新一次(-当然- 这个周期值能够根据你的需要去更改): + +``` +Every 2,0s: sensors + +iwlwifi-virtual-0 +Adapter: Virtual device +temp1: +39.0°C + +acpitz-virtual-0 +Adapter: Virtual device +temp1: +27.8°C (crit = +119.0°C) +temp2: +29.8°C (crit = +119.0°C) + +coretemp-isa-0000 +Adapter: ISA adapter +Package id 0: +37.0°C (high = +82.0°C, crit = +100.0°C) +Core 0: +35.0°C (high = +82.0°C, crit = +100.0°C) +Core 1: +35.0°C (high = +82.0°C, crit = +100.0°C) +Core 2: +33.0°C (high = +82.0°C, crit = +100.0°C) +Core 3: +36.0°C (high = +82.0°C, crit = +100.0°C) +Core 4: +37.0°C (high = +82.0°C, crit = +100.0°C) +Core 5: +35.0°C (high = +82.0°C, crit = +100.0°C) +``` + +除此之外,我们还能得到如下信息: + + * 我们有 5 个核心正在被使用(并且当前的最高温度为 37.0ºC)。 + * 温度超过 82.0ºC 会被认为是过热。 + * 超过 100.0ºC 的温度会被认为是超过临界值。 + + + +[推荐阅读:Linux 上排行前 10 的命令行游戏][9] + + +根据以上的温度值我们可以得出结论,我的电脑目前的工作负载非常小。 + +### 在 Linux 中监控 GPU 温度 + +现在让我们来看看显示卡。我从来没使用过 **AMD** 的显示卡,因此我会将重点放在 **Nvidia** 的显示卡上。我们需要做的第一件事是从 [Ubuntu 的附加驱动][10] 中下载合适的最新驱动。 + +在 **Ubuntu**(**Zorin** 或 **Linux Mint** 也是相同的)中,进入_软件和更新_ > _附加驱动_选项,选择最新的可用驱动。另外,你可以添加或启用显示卡的官方 _ppa_(通过命令行或通过_软件和更新_ > _其他软件_来实现)。安装驱动程序后,你将可以使用 _Nvidia X Server_ 的 GUI 程序以及命令行工具 _nvidia-smi_(Nvidia 系统管理界面)。因此我们将使用 `watch` 和 `nvidia-smi`: + +``` +watch -n 2 nvidia-smi +``` + +与 CPU 的情况一样,我们会在每两秒得到一次更新的示数: + +``` +Every 2,0s: nvidia-smi + +Fri Apr 19 20:45:30 2019 ++-----------------------------------------------------------------------------+ +| Nvidia-SMI 418.56 Driver Version: 418.56 CUDA Version: 10.1 | +|-------------------------------+----------------------+----------------------+ +| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | +| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | +|===============================+======================+======================| +| 0 GeForce GTX 106... Off | 00000000:01:00.0 On | N/A | +| 0% 54C P8 10W / 120W | 433MiB / 6077MiB | 4% Default | ++-------------------------------+----------------------+----------------------+ + ++-----------------------------------------------------------------------------+ +| Processes: GPU Memory | +| GPU PID Type Process name Usage | +|=============================================================================| +| 0 1557 G /usr/lib/xorg/Xorg 190MiB | +| 0 1820 G /usr/bin/gnome-shell 174MiB | +| 0 7820 G ...equest-channel-token=303407235874180773 65MiB | ++-----------------------------------------------------------------------------+ +``` + +从这个表格中我们得到了关于显示卡的如下信息: + + * 它正在使用版本号为 418.56 的开源驱动。 + * 显示卡的当前温度为 54.0ºC,并且风扇的使用量为 0%。 + * 电量的消耗非常低:仅仅 10W。 + * 总量为 6GB 的 vram(视频随机存取存储器),只使用了 433MB。 + * vram 正在被 3 个进程使用,他们的 ID 分别为 1557、1820 和 7820。 + + + +[推荐阅读:现在你可以在 Linux 终端中使用谷歌了!][11] + + +大部分这些事实或数值都清晰地表明,我们没有在玩任何消耗系统资源的游戏或处理大负载的任务。当我们开始玩游戏、处理视频或其他类似任务时,这些值就会开始上升。 + +#### 结论 + +即便我们有 GUI 工具,但我还是发现这两个命令对于实时监控硬件非常的顺手。 + +你将如何去使用它们呢?你可以通过阅读他们的 man 手册来学习更多关于这些工具的使用技巧。 + +你有其他偏爱的工具吗?在评论里分享给我们吧 ;)。 + +玩得开心! + +![化身][12] + +### Alejandro Egea-Abellán + +It's FOSS 社区贡献者 + +我对电子、语言学、爬虫学、计算机(尤其是 GNU/Linux 和 FOSS)有着浓厚兴趣。我通过了 LPIC-2 认证,目前在西班牙穆尔西亚教育部终身学习部们担任技术顾问和 Moodle(译注:Moodle 是一个开源课程管理系统)管理员。我是终身学习、知识共享和计算机用户自由的坚定信奉者。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/monitor-cpu-gpu-temp-linux/ + +作者:[It's FOSS Community][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-steam-ubuntu-linux/ +[2]: https://itsfoss.com/steam-play-proton/ +[3]: https://itsfoss.com/best-video-editing-software-linux/ +[4]: https://www.blender.org/ +[5]: https://slimbook.es/ +[6]: https://zorinos.com/ +[7]: https://itsfoss.com/wp-content/uploads/2019/04/monitor-cpu-gpu-temperature-linux-800x450.png +[8]: https://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ +[9]: https://itsfoss.com/best-command-line-games-linux/ +[10]: https://itsfoss.com/install-additional-drivers-ubuntu/ +[11]: https://itsfoss.com/review-googler-linux/ +[12]: https://itsfoss.com/wp-content/uploads/2019/04/EGEA-ABELLAN-Alejandro.jpg From 3c45bb694b99c028793400b7e57ea61385c01374 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 May 2019 21:19:29 +0800 Subject: [PATCH 0666/1154] TSL:20190107 Aliases- To Protect and Serve.md --- .../20190107 Aliases- To Protect and Serve.md | 179 ------------------ .../20190107 Aliases- To Protect and Serve.md | 171 +++++++++++++++++ 2 files changed, 171 insertions(+), 179 deletions(-) delete mode 100644 sources/tech/20190107 Aliases- To Protect and Serve.md create mode 100644 translated/tech/20190107 Aliases- To Protect and Serve.md diff --git a/sources/tech/20190107 Aliases- To Protect and Serve.md b/sources/tech/20190107 Aliases- To Protect and Serve.md deleted file mode 100644 index c556206fd4..0000000000 --- a/sources/tech/20190107 Aliases- To Protect and Serve.md +++ /dev/null @@ -1,179 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Aliases: To Protect and Serve) -[#]: via: (https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) - -命令别名:保护和服务 -====== -> Linux shell 允许你将命令链接在一起以一次触发执行复杂的操作,并创建别名以充当快捷方式。 - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/prairie-path_1920.jpg?itok=wRARsM7p) - -让我们将继续我们的别名系列。到目前为止,你可能已经阅读了我们的[关于别名的第一篇文章][1],并且应该非常清楚它们是如何为自己省去很多麻烦的最简单方法。 例如,你已经看到他们帮助了肌肉记忆,但让我们看看其他几个别名派上用场的案例。 - -Happy 2019! Here in the new year, we’re continuing our series on aliases. By now, you’ve probably read our [first article on aliases][1], and it should be quite clear how they are the easiest way to save yourself a lot of trouble. You already saw, for example, that they helped with muscle-memory, but let's see several other cases in which aliases come in handy. - -### Aliases as Shortcuts - -One of the most beautiful things about Linux's shells is how you can use zillions of options and chain commands together to carry out really sophisticated operations in one fell swoop. All right, maybe beauty is in the eye of the beholder, but let's agree that this feature published practical. - -The downside is that you often come up with recipes that are often hard to remember or cumbersome to type. Say space on your hard disk is at a premium and you want to do some New Year's cleaning. Your first step may be to look for stuff to get rid off in you home directory. One criteria you could apply is to look for stuff you don't use anymore. `ls` can help with that: - -``` -ls -lct -``` - -The instruction above shows the details of each file and directory (`-l`) and also shows when each item was last accessed (`-c`). It then orders the list from most recently accessed to least recently accessed (`-t`). - -Is this hard to remember? You probably don’t use the `-c` and `-t` options every day, so perhaps. In any case, defining an alias like - -``` -alias lt='ls -lct' -``` - -will make it easier. - -Then again, you may want to have the list show the oldest files first: - -``` -alias lo='lt -F | tac' -``` - -![aliases][3] - -Figure 1: The lt and lo aliases in action. - -[Used with permission][4] - -There are a few interesting things going here. First, we are using an alias (`lt`) to create another alias -- which is perfectly okay. Second, we are passing a new parameter to `lt` (which, in turn gets passed to `ls` through the definition of the `lt` alias). - -The `-F` option appends special symbols to the names of items to better differentiate regular files (that get no symbol) from executable files (that get an `*`), files from directories (end in `/`), and all of the above from links, symbolic and otherwise (that end in an `@` symbol). The `-F` option is throwback to the days when terminals where monochrome and there was no other way to easily see the difference between items. You use it here because, when you pipe the output from `lt` through to `tac` you lose the colors from `ls`. - -The third thing to pay attention to is the use of piping. Piping happens when you pass the output from an instruction to another instruction. The second instruction can then use that output as its own input. In many shells (including Bash), you pipe something using the pipe symbol (`|`). - -In this case, you are piping the output from `lt -F` into `tac`. `tac`'s name is a bit of a joke. You may have heard of `cat`, the instruction that was nominally created to con _cat_ enate files together, but that in practice is used to print out the contents of a file to the terminal. `tac` does the same, but prints out the contents it receives in reverse order. Get it? `cat` and `tac`. Developers, you so funny! - -The thing is both `cat` and `tac` can also print out stuff piped over from another instruction, in this case, a list of files ordered chronologically. - -So... after that digression, what comes out of the other end is the list of files and directories of the current directory in inverse order of freshness. - -The final thing you have to bear in mind is that, while `lt` will work the current directory and any other directory... - -``` -# This will work: -lt -# And so will this: -lt /some/other/directory -``` - -... `lo` will only work with the current directory: - -``` -# This will work: -lo -# But this won't: -lo /some/other/directory -``` - -This is because Bash expands aliases into their components. When you type this: - -``` -lt /some/other/directory -``` - -Bash REALLY runs this: - -``` -ls -lct /some/other/directory -``` - -which is a valid Bash command. - -However, if you type this: - -``` -lo /some/other/directory -``` - -Bash tries to run this: - -``` -ls -lct -F | tac /some/other/directory -``` - -which is not a valid instruction, because `tac` mainly because _/some/other/directory_ is a directory, and `cat` and `tac` don't do directories. - -### More Alias Shortcuts - - * `alias lll='ls -R'` prints out the contents of a directory and then drills down and prints out the contents of its subdirectories and the subdirectories of the subdirectories, and so on and so forth. It is a way of seeing everything you have under a directory. - - * `mkdir='mkdir -pv'` let's you make directories within directories all in one go. With the base form of `mkdir`, to make a new directory containing a subdirectory you have to do this: - -``` - mkdir newdir -mkdir newdir/subdir -``` - -Or this: - -``` -mkdir -p newdir/subdir -``` - -while with the alias you would only have to do this: - -``` -mkdir newdir/subdir -``` - -Your new `mkdir` will also tell you what it is doing while is creating new directories. - - - - -### Aliases as Safeguards - -The other thing aliases are good for is as safeguards against erasing or overwriting your files accidentally. At this stage you have probably heard the legendary story about the new Linux user who ran: - -``` -rm -rf / -``` - -as root, and nuked the whole system. Then there's the user who decided that: - -``` -rm -rf /some/directory/ * -``` - -was a good idea and erased the complete contents of their home directory. Notice how easy it is to overlook that space separating the directory path and the `*`. - -Both things can be avoided with the `alias rm='rm -i'` alias. The `-i` option makes `rm` ask the user whether that is what they really want to do and gives you a second chance before wreaking havoc in your file system. - -The same goes for `cp`, which can overwrite a file without telling you anything. Create an alias like `alias cp='cp -i'` and stay safe! - -### Next Time - -We are moving more and more into scripting territory. Next time, we'll take the next logical step and see how combining instructions on the command line gives you really interesting and sophisticated solutions to everyday admin problems. - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve - -作者:[Paul Brown][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/bro66 -[b]: https://github.com/lujun9972 -[1]: https://linux.cn/article-10377-1.html -[2]: https://www.linux.com/files/images/fig01png-0 -[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/fig01_0.png?itok=crqTm_va (aliases) -[4]: https://www.linux.com/licenses/category/used-permission diff --git a/translated/tech/20190107 Aliases- To Protect and Serve.md b/translated/tech/20190107 Aliases- To Protect and Serve.md new file mode 100644 index 0000000000..63475900bc --- /dev/null +++ b/translated/tech/20190107 Aliases- To Protect and Serve.md @@ -0,0 +1,171 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Aliases: To Protect and Serve) +[#]: via: (https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) + +命令别名:保护和服务 +====== +> Linux shell 允许你将命令链接在一起以一次触发执行复杂的操作,并创建别名以充当快捷方式。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/prairie-path_1920.jpg?itok=wRARsM7p) + +让我们将继续我们的别名系列。到目前为止,你可能已经阅读了我们的[关于别名的第一篇文章][1],并且应该非常清楚它们是如何为你省去很多麻烦的最简单方法。例如,你已经看到它们帮助我们减少了输入,让我们看看别名派上用场的其他几个案例。 + +### 别名即快捷方式 + +Linux shell 最美妙的事情之一是使用数以万计的选项和把命令连接在一起执行真正复杂的操作。好吧,也许这种美丽是在旁观者的眼中,但是我们觉得这个功能很实用。 + +不利的一面是,你经常需记得通常难以记忆或难以打字出来的命令组合。比如说硬盘上的空间非常宝贵,而你想要做一些清洁工作。你的第一步可能是寻找隐藏在你的主目录里的东西。你可以用来判断的一个标准是查找不再使用的内容。`ls` 可以帮助你: + +``` +ls -lct +``` + +上面的命令显示了每个文件和目录的详细信息(`-l`),并显示了每一项上次访问的时间(`-c`),然后它按从最近访问到最少访问的顺序排序这个列表(`-t`)。 + +这难以记住吗?你可能不会每天都使用 `-c` 和 `-t` 选项,所以也许是吧。无论如何,定义一个别名,如: + +``` +alias lt='ls -lct' +``` + +会更容易一些。 + +然后,你也可能希望列表首先显示最旧的文件: + +``` +alias lo='lt -F | tac' +``` + +![aliases][3] + +*图 1:使用 lt 和 lo 别名。* + +这里有一些有趣的事情。首先,我们使用别名(`lt`)来创建另一个别名 —— 这是完全可以的。其次,我们将一个新参数传递给 `lt`(后者又通过 `lt` 别名的定义传递给了 `ls`)。 + +`-F` 选项会将特殊符号附加到项目的名称后,以便更好地区分常规文件(没有符号)和可执行文件(附加了 `*`)、目录文件(以 `/` 结尾),以及所有链接文件、符号链接文件(以 `@` 符号结尾)等等。`-F` 选项是当你回归到单色终端的日子里,没有其他方法可以轻松看到列表项之间的差异时用的。在这里使用它是因为当你将输出从 `lt` 传递到 `tac` 时,你会丢失 `ls` 的颜色。 + +第三件我们需要注意的事情是我们使用了管道。管道用于你将一个命令的输出传递给另外一个命令时。第二个命令可以使用这些输出作为它的输入。在包括 Bash 在内的许多 shell 里,你可以使用管道符(`|`) 来传递。 + +在这里,你将来自 `lt -F` 的输出导给 `tac`。`tac` 这个命令有点玩笑的意思,你或许听说过 `cat` 命令,它原本用于将文件彼此连接(con`cat`),而在实践中,它被用于将一个文件的内容打印到终端。`tac` 做的事情一样,但是它是以逆序将接收到的内容输出出来。明白了吗?`cat` 和 `tac`,技术人有时候也挺有趣的。 + +`cat` 和 `tac` 都能输出通过管道传递过来的内容,在这里,也就是一个按时间顺序排序的文件列表。 + +那么,在有些离题之后,最终我们得到的就是这个列表将当前目录中的文件和目录以新鲜度的逆序列出(即老的在前)。 + +最后你需要注意的是,当在当前目录或任何目录运行 `lt` 时: + +``` +# 这可以工作: +lt +# 这也可以: +lt /some/other/directory +``` + +……而 `lo` 只能在当前目录奏效: + +``` +# 这可工作: +lo +# 而这不行: +lo /some/other/directory +``` + +这是因为 Bash 会展开别名的组件。当你键入: + +``` +lt /some/other/directory +``` + +Bash 实际上运行的是: + +``` +ls -lct /some/other/directory +``` + +这是一个有效的 Bash 命令。 + +而当你键入: + +``` +lo /some/other/directory +``` + +Bash 试图运行: + +``` +ls -lct -F | tac /some/other/directory +``` + +这不是一个有效的命令,主要是因为 `/some/other/directory` 是个目录,而 `cat` 和 `tac` 不能用于目录。 + +### 更多的别名快捷方式 + + * `alias lll='ls -R'` 会打印出目录的内容,并深入到子目录里面打印子目录的内容,以及子目录的子目录,等等。这是一个查看一个目录下所有内容的方式。 + * `mkdir='mkdir -pv'` 可以让你一次性创建目录下的目录。按照 `mkdir` 的基本形式,要创建一个包含子目录的目录,你必须这样: + +``` +mkdir newdir +mkdir newdir/subdir +``` + +或这样: + +``` +mkdir -p newdir/subdir +``` + +而用这个别名你将只需要这样就行: + +``` +mkdir newdir/subdir +``` + +你的新 `mkdir` 也会告诉你创建子目录时都做了什么。 + +### 别名也是一种防护 + +别名的另一方面是它可以很好地防止你意外地删除或覆写已有的文件。你可能这个 Linux 新用户的传言,当他们以 root 身份运行: + +``` +rm -rf / +``` + +整个系统就爆了。而决定输入如下命令的用户: + +``` +rm -rf /some/directory/ * +``` + +就很好地干掉了他们的家目录的全部内容。这里不小心键入的目录和 `*` 之间的那个空格有时候很容易就会被忽视掉。 + +这两种情况我们都可以通过 `alias rm='rm -i'` 别名来避免。`-i` 选项会使 `rm` 询问用户是否真的要做这个操作,在你对你的文件系统做出不可弥补的损失之前给你第二次机会。 + +对于 `cp` 也是一样,它能够覆盖一个文件而不会给你任何提示。创建一个类似 `alias cp='cp -i'` 来保持安全吧。 + +### 下一次 + +我们越来越深入到了脚本领域,下一次,我们将沿着这个方向,看看如何在命令行组合命令以给你真正的乐趣,并可靠地解决系统管理员每天面临的问题。 + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve + +作者:[Paul Brown][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10377-1.html +[2]: https://www.linux.com/files/images/fig01png-0 +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/fig01_0.png?itok=crqTm_va (aliases) +[4]: https://www.linux.com/licenses/category/used-permission From a6dd92e68f2f2851820f5765b42169e673023151 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 May 2019 21:45:50 +0800 Subject: [PATCH 0667/1154] PRF:20190107 Aliases- To Protect and Serve.md @wxy --- .../20190107 Aliases- To Protect and Serve.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/translated/tech/20190107 Aliases- To Protect and Serve.md b/translated/tech/20190107 Aliases- To Protect and Serve.md index 63475900bc..1e2008861f 100644 --- a/translated/tech/20190107 Aliases- To Protect and Serve.md +++ b/translated/tech/20190107 Aliases- To Protect and Serve.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Aliases: To Protect and Serve) @@ -9,7 +9,8 @@ 命令别名:保护和服务 ====== -> Linux shell 允许你将命令链接在一起以一次触发执行复杂的操作,并创建别名以充当快捷方式。 + +> Linux shell 允许你将命令彼此链接在一起,一次触发执行复杂的操作,并且可以对此创建别名作为快捷方式。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/prairie-path_1920.jpg?itok=wRARsM7p) @@ -17,9 +18,9 @@ ### 别名即快捷方式 -Linux shell 最美妙的事情之一是使用数以万计的选项和把命令连接在一起执行真正复杂的操作。好吧,也许这种美丽是在旁观者的眼中,但是我们觉得这个功能很实用。 +Linux shell 最美妙的事情之一是可以使用数以万计的选项和把命令连接在一起执行真正复杂的操作。好吧,也许这种美丽是在旁观者的眼中的,但是我们觉得这个功能很实用。 -不利的一面是,你经常需记得通常难以记忆或难以打字出来的命令组合。比如说硬盘上的空间非常宝贵,而你想要做一些清洁工作。你的第一步可能是寻找隐藏在你的主目录里的东西。你可以用来判断的一个标准是查找不再使用的内容。`ls` 可以帮助你: +不利的一面是,你经常需要记得难以记忆或难以打字出来的命令组合。比如说硬盘上的空间非常宝贵,而你想要做一些清洁工作。你的第一步可能是寻找隐藏在你的家目录里的东西。你可以用来判断的一个标准是查找不再使用的内容。`ls` 可以帮助你: ``` ls -lct @@ -49,9 +50,9 @@ alias lo='lt -F | tac' `-F` 选项会将特殊符号附加到项目的名称后,以便更好地区分常规文件(没有符号)和可执行文件(附加了 `*`)、目录文件(以 `/` 结尾),以及所有链接文件、符号链接文件(以 `@` 符号结尾)等等。`-F` 选项是当你回归到单色终端的日子里,没有其他方法可以轻松看到列表项之间的差异时用的。在这里使用它是因为当你将输出从 `lt` 传递到 `tac` 时,你会丢失 `ls` 的颜色。 -第三件我们需要注意的事情是我们使用了管道。管道用于你将一个命令的输出传递给另外一个命令时。第二个命令可以使用这些输出作为它的输入。在包括 Bash 在内的许多 shell 里,你可以使用管道符(`|`) 来传递。 +第三件我们需要注意的事情是我们使用了管道。管道用于你将一个命令的输出传递给另外一个命令时。第二个命令可以使用这些输出作为它的输入。在包括 Bash 在内的许多 shell 里,你可以使用管道符(`|`) 来做传递。 -在这里,你将来自 `lt -F` 的输出导给 `tac`。`tac` 这个命令有点玩笑的意思,你或许听说过 `cat` 命令,它原本用于将文件彼此连接(con`cat`),而在实践中,它被用于将一个文件的内容打印到终端。`tac` 做的事情一样,但是它是以逆序将接收到的内容输出出来。明白了吗?`cat` 和 `tac`,技术人有时候也挺有趣的。 +在这里,你将来自 `lt -F` 的输出导给 `tac`。`tac` 这个命令有点玩笑的意思,你或许听说过 `cat` 命令,它名义上用于将文件彼此连接(con`cat`),而在实践中,它被用于将一个文件的内容打印到终端。`tac` 做的事情一样,但是它是以逆序将接收到的内容输出出来。明白了吗?`cat` 和 `tac`,技术人有时候也挺有趣的。 `cat` 和 `tac` 都能输出通过管道传递过来的内容,在这里,也就是一个按时间顺序排序的文件列表。 @@ -75,7 +76,7 @@ lo lo /some/other/directory ``` -这是因为 Bash 会展开别名的组件。当你键入: +这是因为 Bash 会展开别名的组分。当你键入: ``` lt /some/other/directory @@ -127,9 +128,9 @@ mkdir newdir/subdir 你的新 `mkdir` 也会告诉你创建子目录时都做了什么。 -### 别名也是一种防护 +### 别名也是一种保护 -别名的另一方面是它可以很好地防止你意外地删除或覆写已有的文件。你可能这个 Linux 新用户的传言,当他们以 root 身份运行: +别名的另一个好处是它可以作为防止你意外地删除或覆写已有的文件的保护措施。你可能听说过这个 Linux 新用户的传言,当他们以 root 身份运行: ``` rm -rf / @@ -159,7 +160,7 @@ via: https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve 作者:[Paul Brown][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ef2339ad2cdfa3caffbf76f03e40b458f4b247c7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 May 2019 21:46:21 +0800 Subject: [PATCH 0668/1154] PUB:20190107 Aliases- To Protect and Serve.md @wxy https://linux.cn/article-10918-1.html --- .../20190107 Aliases- To Protect and Serve.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190107 Aliases- To Protect and Serve.md (98%) diff --git a/translated/tech/20190107 Aliases- To Protect and Serve.md b/published/20190107 Aliases- To Protect and Serve.md similarity index 98% rename from translated/tech/20190107 Aliases- To Protect and Serve.md rename to published/20190107 Aliases- To Protect and Serve.md index 1e2008861f..60299f61c5 100644 --- a/translated/tech/20190107 Aliases- To Protect and Serve.md +++ b/published/20190107 Aliases- To Protect and Serve.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10918-1.html) [#]: subject: (Aliases: To Protect and Serve) [#]: via: (https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve) [#]: author: (Paul Brown https://www.linux.com/users/bro66) From adadb6c7fd39846d9e63e061bc19735990a85ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Thu, 30 May 2019 23:17:16 +0800 Subject: [PATCH 0669/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20170414 5 projects for Raspberry Pi at home.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20170414 5 projects for Raspberry Pi at home.md b/sources/tech/20170414 5 projects for Raspberry Pi at home.md index 69aeaf32ac..d4a3d3c1b4 100644 --- a/sources/tech/20170414 5 projects for Raspberry Pi at home.md +++ b/sources/tech/20170414 5 projects for Raspberry Pi at home.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From dd8786aee20b77356d1e023c1357abc3782dca09 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 31 May 2019 08:50:24 +0800 Subject: [PATCH 0670/1154] PRF:20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md @geekpi --- ...g Budgie Desktop on Ubuntu -Quick Guide.md | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md b/translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md index 7e5d6fbbda..2aade50b1a 100644 --- a/translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md +++ b/translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md @@ -1,34 +1,34 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Installing Budgie Desktop on Ubuntu [Quick Guide]) [#]: via: (https://itsfoss.com/install-budgie-ubuntu/) [#]: author: (Atharva Lele https://itsfoss.com/author/atharva/) -在 Ubuntu 上安装 Budgie 桌面 [快速指南] +在 Ubuntu 上安装 Budgie 桌面 ====== -_ **简介:在这一步步的教程中学习如何在 Ubuntu 上安装 Budgie 桌面。** _ +> 在这个逐步的教程中学习如何在 Ubuntu 上安装 Budgie 桌面。 -在所有[各种 Ubuntu 版本][1]中,[Ubuntu Budgie][2] 是最被低估的版本。它看起来很优雅,而且需要的资源也不多。 +在所有[各种 Ubuntu 版本][1]中,[Ubuntu Budgie][2] 是最被低估的版本。它外观优雅,而且需要的资源也不多。 -阅读这篇 [Ubuntu Budgie 的评论][3]或观看此视频,了解 Ubuntu Budgie 18.04 的外观。 +阅读这篇 《[Ubuntu Budgie 点评][3]》或观看下面的视频,了解 Ubuntu Budgie 18.04 的外观如何。 -[Subscribe to our YouTube channel for more Linux Videos][4] +- [Ubuntu 18.04 Budgie Desktop Tour [It's Elegant]](https://youtu.be/KXgreWOK33k) -如果你喜欢 [Budgie 桌面][5]但你正在使用其他版本的 Ubuntu,例如默认的 GNOME 桌面的 Ubuntu,我有个好消息。你可以在当前的 Ubuntu 系统上安装 Budgie 并切换桌面环境。 +如果你喜欢 [Budgie 桌面][5]但你正在使用其他版本的 Ubuntu,例如默认 Ubuntu 带有 GNOME 桌面,我有个好消息。你可以在当前的 Ubuntu 系统上安装 Budgie 并切换桌面环境。 在这篇文章中,我将告诉你到底该怎么做。但首先,对那些不了解 Budgie 的人进行一点介绍。 -Budgie 桌面环境主要由 [Solus Linux 团队开发][6]。它的设计注重优雅和现代使用。Budgie 适用于所有主流 Linux 发行版,供用户尝试体验这种新的桌面环境。Budgie 现在非常成熟,并提供了出色的桌面体验。 +Budgie 桌面环境主要由 [Solus Linux 团队开发][6]。它的设计注重优雅和现代使用。Budgie 适用于所有主流 Linux 发行版,可以让用户在其上尝试体验这种新的桌面环境。Budgie 现在非常成熟,并提供了出色的桌面体验。 -警告 - -在同一系统上安装多个桌面可能会导致冲突,你可能会遇到一些问题,如面板中缺少图标或同一程序的多个图标。 - -你也许不会遇到任何问题。是否要尝试不同桌面由你决定。 +> 警告 +> +> 在同一系统上安装多个桌面可能会导致冲突,你可能会遇到一些问题,如面板中缺少图标或同一程序的多个图标。 +> +> 你也许不会遇到任何问题。是否要尝试不同桌面由你决定。 ### 在 Ubuntu 上安装 Budgie @@ -55,23 +55,19 @@ sudo apt install ubuntu-budgie-desktop ![Budgie login screen][9] -你可以单击登录名旁边的 Budgie 图标获取登录选项。在那里,你可以在已安装的桌面环境 (DE) 之间进行选择。就我而言,我看到了 Budgie 和默认的 Ubuntu(GNOME)桌面。 +你可以单击登录名旁边的 Budgie 图标获取登录选项。在那里,你可以在已安装的桌面环境(DE)之间进行选择。就我而言,我看到了 Budgie 和默认的 Ubuntu(GNOME)桌面。 ![Select your DE][10] 因此,无论何时你想登录 GNOME,都可以使用此菜单执行此操作。 -[][11] - -建议阅读:在 Ubuntu中 摆脱 “snapd returned status code 400: Bad Request” 错误。 - ### 如何删除 Budgie 如果你不喜欢 Budgie 或只是想回到常规的以前的 Ubuntu,你可以如上节所述切换回常规桌面。 但是,如果你真的想要删除 Budgie 及其组件,你可以按照以下命令回到之前的状态。 -_ **在使用这些命令之前先切换到其他桌面环境:** _ +**在使用这些命令之前先切换到其他桌面环境:** ``` sudo apt remove ubuntu-budgie-desktop ubuntu-budgie* lightdm @@ -83,7 +79,7 @@ sudo apt install --reinstall gdm3 现在,你将回到 GNOME 或其他你有的桌面。 -**你对Budgie有什么看法?** +### 你对 Budgie 有什么看法? Budgie 是[最佳 Linux 桌面环境][12]之一。希望这个简短的指南帮助你在 Ubuntu 上安装了很棒的 Budgie 桌面。 @@ -96,7 +92,7 @@ via: https://itsfoss.com/install-budgie-ubuntu/ 作者:[Atharva Lele][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/) 荣誉推出 From 8f20a358cfc01b8daeff5cf70f2b25e70ff73daa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 31 May 2019 08:51:00 +0800 Subject: [PATCH 0671/1154] PUB:20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md @geekpi https://linux.cn/article-10919-1.html --- ...190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md (98%) diff --git a/translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md b/published/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md similarity index 98% rename from translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md rename to published/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md index 2aade50b1a..457caaa69a 100644 --- a/translated/tech/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md +++ b/published/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10919-1.html) [#]: subject: (Installing Budgie Desktop on Ubuntu [Quick Guide]) [#]: via: (https://itsfoss.com/install-budgie-ubuntu/) [#]: author: (Atharva Lele https://itsfoss.com/author/atharva/) From a6eead09359fb323075457ace83f952412c162ea Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 31 May 2019 08:55:47 +0800 Subject: [PATCH 0672/1154] translated --- ...down Editor for Writers and Researchers.md | 120 ------------------ ...down Editor for Writers and Researchers.md | 110 ++++++++++++++++ 2 files changed, 110 insertions(+), 120 deletions(-) delete mode 100644 sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md create mode 100644 translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md diff --git a/sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md b/sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md deleted file mode 100644 index 54949e4f29..0000000000 --- a/sources/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md +++ /dev/null @@ -1,120 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Zettlr – Markdown Editor for Writers and Researchers) -[#]: via: (https://itsfoss.com/zettlr-markdown-editor/) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -Zettlr – Markdown Editor for Writers and Researchers -====== - -There are quite a few [Markdown editors available for Linux][1], with more popping up all of the time. The problem is that like [Boostnote][2], most are designed for coders and may not be as welcoming to non-techie people. Let’s take a look at a Markdown editor that wants to replace Word and expensive word processors for the non-techies. Let’s take a look at Zettlr. - -### Zettlr Markdown Editor - -![Zettlr Light Mode][3] - -I may have mentioned it a time or two on this site, but I prefer to write all of my documents in [Markdown][4]. It is simple to learn and does not leave you tied to a proprietary document format. I have also mentioned Markdown editor among my [list of open source tools for writers][5]. - -I have used a number of Markdown editors and am always interested to try out someone’s new take on the idea. Recently, I came across Zettlr, an open source markdown editor. - -[Zettlr][6] is the creation of a German sociologist/political theorist named [Hendrik Erz][7]. Hendrik created Zettlr because he was frustrated by the current line up of word processors. He wanted something that would allow him to “focus on writing and reading only”. - -After discovering Markdown, he tried several Markdown editors on different operating systems. But none of them had what he was looking for. [According to Hendrik][8], “But I had to realize that there are simply none written for the needs of organizing a huge amount of text efficiently. Most editors have been written by coders, therefore tailored to the needs of engineers and mathematicians. No luck for a student of social sciences, history or political science like me.” - -So he decided to create his own. In November of 2017, he started to work on Zettlr. - -![Zettlr About][9] - -#### Zettlr Features - -Zettlr has a number of neat features, including: - - * Import sources from your [Zotero database][10] and cite them in your document - * Focus on your writing with the distraction free mode with optional line muting - * Support for code highlighting - * Use tags to sort information - * Ability to set writing goals for the session - * View writing stats over time - * Pomodoro Timer - * Light/Dark theme - * Create presentation using [reveal.js][11] - * Quick preview of a document - * Search all Markdown documents in a project folder with heatmap showing the density of word searched - * Export files to HTML, PDF, ODT, DOC, reStructuredText, LaTex, TXT, Emacs ORG, [TextBundle][12], and Textpack - * Add custom CSS to your document - - - -[][13] - -Suggested read Manage Your PDF Files In Style With Great Little Book Shelf - -As I am writing this article, a dialog box popped up telling me about the recently released [1.3.0 beta][14]. This beta will include several new themes, as well as, a boatload of fixes, new features and under the hood improvements. - -![Zettlr Night Mode][15] - -#### Installing Zettlr - -Currently, the only Linux repository that has Zettlr for you to install is the [AUR][16]. If your Linux distro is not Arch-based, you can [download an installer][17] from the website for macOS, Windows, Debian, and Fedora. - -#### Final Thoughts on Zettlr - -Note: In order to test Zettlr, I used it to write this article. - -Zettlr has a number of neat features that I wish my Markdown editor of choice (ghostwriter) had, such as the ability to set a word count goal for the document. I also like the option to preview a document without having to open it. - -![Zettlr Settings][18] - -I did run into a couple issues, but they had more to do with the fact that Zettlr works a little bit different than ghostwriter. For example, when I tried to copy a quote or name from a web site, it pasted the in-line styling into Zettlr. Fortunately, there is an option to “Paste without Style”. A couple times I ran into a slight delay when I was trying to type. But that could because it is an Electron app. - -Overall, I think that Zettlr is a good option for a first time Markdown user. It has features that many Markdown editors already have and adds a few more for those who only ever used word processors - -As Hendrik says on the [Zettlr site][8], “Free yourselves from the fetters of word processors and see how your writing process can be improved by using technology that’s right at hand!” - -If you do find Zettlr useful, please consider supporting [Hendrik][19]. As he says on the site, “And this free of any charge, because I do not believe in the fast-living, early-dying startup culture. I simply want to help.” - -[][20] - -Suggested read Calligra Office App Brings ODT Support To Android - -Have you ever used Zettlr? What is your favorite Markdown editor? Please let us know in the comments below. - -If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][21]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/zettlr-markdown-editor/ - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/best-markdown-editors-linux/ -[2]: https://itsfoss.com/boostnote-linux-review/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/Zettlr-light-mode.png?fit=800%2C462&ssl=1 -[4]: https://daringfireball.net/projects/markdown/ -[5]: https://itsfoss.com/open-source-tools-writers/ -[6]: https://www.zettlr.com/ -[7]: https://github.com/nathanlesage -[8]: https://www.zettlr.com/about -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/zettlr-about.png?fit=800%2C528&ssl=1 -[10]: https://www.zotero.org/ -[11]: https://revealjs.com/#/ -[12]: http://textbundle.org/ -[13]: https://itsfoss.com/great-little-book-shelf-review/ -[14]: https://github.com/Zettlr/Zettlr/releases/tag/v1.3.0-beta -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Zettlr-night-mode.png?fit=800%2C469&ssl=1 -[16]: https://aur.archlinux.org/packages/zettlr-bin/ -[17]: https://www.zettlr.com/download -[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/zettlr-settings.png?fit=800%2C353&ssl=1 -[19]: https://www.zettlr.com/supporters -[20]: https://itsfoss.com/calligra-android-app-coffice/ -[21]: http://reddit.com/r/linuxusersgroup diff --git a/translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md b/translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md new file mode 100644 index 0000000000..3ca9b20403 --- /dev/null +++ b/translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Zettlr – Markdown Editor for Writers and Researchers) +[#]: via: (https://itsfoss.com/zettlr-markdown-editor/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Zettlr - 适合作者和研究人员的 Markdown 编辑器 +====== + +有很多[适用于 Linux 的 Markdown 编辑器][1],并且还在继续增加。问题是,像 [Boostnote][2] 一样,大多数是为编码人员设计的,可能不会受到非技术人员的欢迎。让我们看一个想要替代 Word 和昂贵的文字处理器,适用于非技术人员的 Markdown 编辑器。我们来看看 Zettlr 吧。 + +### Zettlr Markdown 编辑器 + +![Zettlr Light Mode][3] + +我可能在网站上提到过一两次,但我更喜欢用 [Markdown][4] 写下我的所有文档。它易于学习,不会让你与专有文档格式相关联。我还在我的[适合作者的开源工具列表][5]中提到了 Markdown 编辑器。 + +我用过许多 Markdown 编辑器,但是我一直有兴趣尝试新的。最近,我遇到了 Zettlr,一个开源 markdown 编辑器。 + +[Zettlr][6] 是一位名叫 [Hendrik Erz][7] 的德国社会学家/政治理论家创建的。Hendrik 创建了 Zettlr,因为他对目前的文字处理器感到沮丧。他想要可以让他“专注于写作和阅读”的编辑器。 + +在发现 Markdown 之后,他在不同的操作系统上尝试了几个 Markdown 编辑器。但他们都没有他想要的东西。[根据 Hendrik 的说法][8],“但我不得不意识到没有为高效组织大量文本而写的编辑器。大多数编辑都是由编码人员编写的,因此可以满足工程师和数学家的需求。没有为我这样的社会科学,历史或政治学的学生的编辑器。“ + +So he decided to create his own. In November of 2017, he started to work on Zettlr. +所以他决定创造自己的。2017 年 11 月,他开始编写 Zettlr。 + +![Zettlr About][9] + +#### Zettlr 功能 + +Zettlr有许多简洁的功能,包括: + + * 从 [Zotero 数据库][10]导入源并在文档中引用它们 +  * 使用可选的行屏蔽,让你无打扰地专注于写作 +  * 支持代码高亮 +  * 使用标签对信息进行排序 +  * 能够为会话设定写作目标 +  * 查看一段时间的写作统计 +  * 番茄钟计时器 +  * 浅色/深色主题 +  * 使用 [reveal.js][11] 创建演示文稿 +  * 快速预览文档 +  * 在一个项目文档中搜索 Markdown 文档,并用热图展示文字搜索密度。 +  * 将文件导出为 HTML、PDF、ODT、DOC、reStructuredText、LaTex、TXT、Emacs ORG、[TextBundle][12] 和 Textpack +  * 将自定义 CSS 添加到你的文档 + +当我写这篇文章时,一个对话框弹出来告诉我最近发布了 [1.3.0 beta][14]。此测试版将包括几个新的主题,以及一大堆修复,新功能和改进。 + +![Zettlr Night Mode][15] + +#### 安装 Zettlr + +目前,唯一可安装 Zettlr 的 Linux 存储库是 [AUR][16]。如果你的 Linux 发行版不是基于 Arch 的,你可以从网站上下载 macOS、Windows、Debian 和 Fedora 的[安装程序][17]。 + +#### 对 Zettlr 的最后一点想法 + +注意:为了测试 Zettlr,我用它来写这篇文章。 + +Zettlr 有许多我希望我之前选择的编辑器 (ghostwriter) 有的简洁的功能,例如为文档设置字数目标。我也喜欢在不打开文档的情况下预览文档的功能。 + +![Zettlr Settings][18] + +我也遇到了几个问题,但这些更多的是因为 Zettlr 与 ghostwriter 的工作方式略有不同。例如,当我尝试从网站复制引用或名称时,它会将内嵌样式粘贴到 Zettlr 中。幸运的是,它有一个“不带样式粘贴”的选项。有几次我在打字时有轻微的延迟。但那可能是因为它是一个 Electron 程序。 + +总的来说,我认为 Zettlr 是第一次使用 Markdown 用户的好选择。它有许多 Markdown 编辑器已有的功能,并为那些只使用过文字处理器的用户增加了一些功能。 + +正如 Hendrik 在 [Zettlr 网站][8]中所说的那样,“让自己摆脱文字处理器的束缚,看看你的写作过程如何通过身边的技术得到改善!” + +如果你觉得 Zettlr 有用,请考虑支持 [Hendrik][19]。正如他在网站上所说,“它是免费的,因为我不相信激烈竞争,早逝的创业文化。我只是想帮忙。“ + +你有没有用过 Zettlr?你最喜欢的 Markdown 编辑器是什么?请在下面的评论中告诉我们。 + +如果你觉得这篇文章有趣,请在社交媒体,Hacker News 或 [Reddit][21] 上分享它。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zettlr-markdown-editor/ + +作者:[John Paul][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/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-markdown-editors-linux/ +[2]: https://itsfoss.com/boostnote-linux-review/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/Zettlr-light-mode.png?fit=800%2C462&ssl=1 +[4]: https://daringfireball.net/projects/markdown/ +[5]: https://itsfoss.com/open-source-tools-writers/ +[6]: https://www.zettlr.com/ +[7]: https://github.com/nathanlesage +[8]: https://www.zettlr.com/about +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/zettlr-about.png?fit=800%2C528&ssl=1 +[10]: https://www.zotero.org/ +[11]: https://revealjs.com/#/ +[12]: http://textbundle.org/ +[13]: https://itsfoss.com/great-little-book-shelf-review/ +[14]: https://github.com/Zettlr/Zettlr/releases/tag/v1.3.0-beta +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Zettlr-night-mode.png?fit=800%2C469&ssl=1 +[16]: https://aur.archlinux.org/packages/zettlr-bin/ +[17]: https://www.zettlr.com/download +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/zettlr-settings.png?fit=800%2C353&ssl=1 +[19]: https://www.zettlr.com/supporters +[21]: http://reddit.com/r/linuxusersgroup From 7c2438f6a78fdb0fcf79f1c950b4e99565ee9928 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 31 May 2019 09:02:38 +0800 Subject: [PATCH 0673/1154] translating --- .../tech/20190525 4 Ways to Run Linux Commands in Windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md b/sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md index 2de100ce08..3d93b35034 100644 --- a/sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md +++ b/sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a8abc8f32d574f0737847aba710fa10ec48ab18c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 31 May 2019 09:10:48 +0800 Subject: [PATCH 0674/1154] PRF:20190411 Be your own certificate authority.md @geekpi --- ...90411 Be your own certificate authority.md | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/translated/tech/20190411 Be your own certificate authority.md b/translated/tech/20190411 Be your own certificate authority.md index 21c698982c..63e085e027 100644 --- a/translated/tech/20190411 Be your own certificate authority.md +++ b/translated/tech/20190411 Be your own certificate authority.md @@ -1,27 +1,29 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Be your own certificate authority) [#]: via: (https://opensource.com/article/19/4/certificate-authority) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/elenajon123) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/elenajon123) -自己成为证书颁发机构 +自己成为一个证书颁发机构(CA) ====== -为你的微服务架构或者集成测试创建一个简单的内部 CA -![][1] -传输层安全([TLS][2])模型,有时也称它的旧名称 SSL,是基于[证书颁发机构][3] (CA) 的概念。这些机构受到浏览器和操作系统的信任,然后_签名_服务器的的证书则用于验证其所有权。 +> 为你的微服务架构或者集成测试创建一个简单的内部 CA。 -但是,对于内部网络,微服务架构或集成测试,有时候_本地 CA_ 更有用:一个只在内部受信任的CA,然后签名本地服务器的证书。 +![](https://img.linux.net.cn/data/attachment/album/201905/31/091023sg9s0ss11rsoseqg.jpg) -这对集成测试特别有意义。获取证书可能会带来负担,因为这会占用服务器几分钟。但是在代码中使用“忽略证书”可能会引入生产环境,从而导致安全灾难。 +传输层安全([TLS][2])模型(有时也称它的旧名称 SSL)基于[证书颁发机构][3]certificate authoritie(CA)的概念。这些机构受到浏览器和操作系统的信任,从而*签名*服务器的的证书以用于验证其所有权。 -CA 证书与常规服务器证书没有太大区别。重要的是它被本地代码信任。例如,在 **requests** 库中,可以通过将 **REQUESTS_CA_BUNDLE** 变量设置为包含此证书的目录来完成。 +但是,对于内部网络,微服务架构或集成测试,有时候*本地 CA*更有用:一个只在内部受信任的 CA,然后签名本地服务器的证书。 -在为集成测试创建证书的例子中,不需要_长期的_证书:如果你的集成测试需要超过一天,那么你会失败。 +这对集成测试特别有意义。获取证书可能会带来负担,因为这会占用服务器几分钟。但是在代码中使用“忽略证书”可能会被引入到生产环境,从而导致安全灾难。 + +CA 证书与常规服务器证书没有太大区别。重要的是它被本地代码信任。例如,在 Python `requests` 库中,可以通过将 `REQUESTS_CA_BUNDLE` 变量设置为包含此证书的目录来完成。 + +在为集成测试创建证书的例子中,不需要*长期的*证书:如果你的集成测试需要超过一天,那么你应该已经测试失败了。 因此,计算**昨天**和**明天**作为有效期间隔: @@ -33,7 +35,7 @@ CA 证书与常规服务器证书没有太大区别。重要的是它被本地 >>> tomorrow = today - one_day ``` -现在你已准备好创建一个简单的 CA 证书。你需要生成私钥,创建公钥,设置 CA 的“参数”,然后自签名证书:CA 证书_总是_自签名的。最后,导出证书文件以及私钥文件。 +现在你已准备好创建一个简单的 CA 证书。你需要生成私钥,创建公钥,设置 CA 的“参数”,然后自签名证书:CA 证书*总是*自签名的。最后,导出证书文件以及私钥文件。 ``` from cryptography.hazmat.primitives.asymmetric import rsa @@ -78,9 +80,9 @@ with open("ca.crt", "wb") as fout: fout.write(public_bytes) ``` -通常,真正的 CA 会有[证书签名请求][4] (CSR) 来签名证书。但是,当你是自己的 CA 时,你可以制定自己的规则!请继续并签名你想要的内容。 +通常,真正的 CA 会需要[证书签名请求][4](CSR)来签名证书。但是,当你是自己的 CA 时,你可以制定自己的规则!可以径直签名你想要的内容。 -继续集成测试的例子,你可以创建私钥并立即签名相应的公钥。注意 **COMMON_NAME** 需要是 **https** URL 中的“服务器名称”。如果你已配置名称查询,则相应的服务器会响应 **service.test.local**。 +继续集成测试的例子,你可以创建私钥并立即签名相应的公钥。注意 `COMMON_NAME` 需要是 `https` URL 中的“服务器名称”。如果你已配置名称查询,你需要服务器能响应对 `service.test.local` 的请求。 ``` service_private_key = rsa.generate_private_key( @@ -110,7 +112,7 @@ with open("service.pem", "wb") as fout: fout.write(private_bytes + public_bytes) ``` -现在 **service.pem** 文件有一个私钥和一个“有效”的证书:它已由本地的 CA 签名。该文件的格式可以给 Nginx、HAProxy 或大多数其他 HTTPS 服务器使用。 +现在 `service.pem` 文件有一个私钥和一个“有效”的证书:它已由本地的 CA 签名。该文件的格式可以给 Nginx、HAProxy 或大多数其他 HTTPS 服务器使用。 通过将此逻辑用在测试脚本中,只要客户端配置信任该 CA,那么就可以轻松创建看起来真实的 HTTPS 服务器。 @@ -118,10 +120,10 @@ with open("service.pem", "wb") as fout: via: https://opensource.com/article/19/4/certificate-authority -作者:[Moshe Zadka (Community Moderator)][a] +作者:[Moshe Zadka][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/) 荣誉推出 @@ -130,4 +132,4 @@ via: https://opensource.com/article/19/4/certificate-authority [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_commun_4604_02_mech_connections_rhcz0.5x.png?itok=YPPU4dMj [2]: https://en.wikipedia.org/wiki/Transport_Layer_Security [3]: https://en.wikipedia.org/wiki/Certificate_authority -[4]: https://en.wikipedia.org/wiki/Certificate_signing_request \ No newline at end of file +[4]: https://en.wikipedia.org/wiki/Certificate_signing_request From bb38017bae9fd82b3027b08df0eb8068a6c04254 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 31 May 2019 09:11:27 +0800 Subject: [PATCH 0675/1154] PUB:20190411 Be your own certificate authority.md @geekpi https://linux.cn/article-10921-1.html --- .../20190411 Be your own certificate authority.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190411 Be your own certificate authority.md (98%) diff --git a/translated/tech/20190411 Be your own certificate authority.md b/published/20190411 Be your own certificate authority.md similarity index 98% rename from translated/tech/20190411 Be your own certificate authority.md rename to published/20190411 Be your own certificate authority.md index 63e085e027..e5f09b6935 100644 --- a/translated/tech/20190411 Be your own certificate authority.md +++ b/published/20190411 Be your own certificate authority.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10921-1.html) [#]: subject: (Be your own certificate authority) [#]: via: (https://opensource.com/article/19/4/certificate-authority) [#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/elenajon123) From d2b0453d0d8daf96f9250a4e36b1bdb1e2e84e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Fri, 31 May 2019 10:36:08 +0800 Subject: [PATCH 0676/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...414 5 projects for Raspberry Pi at home.md | 146 ----------------- ...414 5 projects for Raspberry Pi at home.md | 149 ++++++++++++++++++ 2 files changed, 149 insertions(+), 146 deletions(-) delete mode 100644 sources/tech/20170414 5 projects for Raspberry Pi at home.md create mode 100644 translated/tech/20170414 5 projects for Raspberry Pi at home.md diff --git a/sources/tech/20170414 5 projects for Raspberry Pi at home.md b/sources/tech/20170414 5 projects for Raspberry Pi at home.md deleted file mode 100644 index d4a3d3c1b4..0000000000 --- a/sources/tech/20170414 5 projects for Raspberry Pi at home.md +++ /dev/null @@ -1,146 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 projects for Raspberry Pi at home) -[#]: via: (https://opensource.com/article/17/4/5-projects-raspberry-pi-home) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) - -5 projects for Raspberry Pi at home -====== - -![5 projects for Raspberry Pi at home][1] - -The [Raspberry Pi][2] computer can be used in all kinds of settings and for a variety of purposes. It obviously has a place in education for helping students with learning programming and maker skills in the classroom and the hackspace, and it has plenty of industrial applications in the workplace and in factories. I'm going to introduce five projects you might want to build in your own home. - -### Media center - -One of the most common uses for Raspberry Pi in people's homes is behind the TV running media center software serving multimedia files. It's easy to set this up, and the Raspberry Pi provides plenty of GPU (Graphics Processing Unit) power to render HD TV shows and movies to your big screen TV. [Kodi][3] (formerly XBMC) on a Raspberry Pi is a great way to playback any media you have on a hard drive or network-attached storage. You can also install a plugin to play YouTube videos. - -There are a few different options available, most prominently [OSMC][4] (Open Source Media Center) and [LibreELEC][5], both based on Kodi. They both perform well at playing media content, but OSMC has a more visually appearing user interface, while LibreElec is much more lightweight. All you have to do is choose a distribution, download the image and install on an SD card (or just use [NOOBS][6]), boot it up, and you're ready to go. - -![LibreElec ][7] - -LibreElec; Raspberry Pi Foundation, CC BY-SA - -![OSMC][8] - -OSMC.tv, Copyright, Used with permission - -Before proceeding you'll need to decide [w][9][hich Raspberry Pi model to use][9]. These distributions will work on any Pi (1, 2, 3, or Zero), and video playback will essentially be matched on each of these. Apart from the Pi 3 (and Zero W) having built-in Wi-Fi, the only noticeable difference is the reaction speed of the user interface, which will be much faster on a Pi 3. A Pi 2 will not be much slower, so that's fine if you don't need Wi-Fi, but the Pi 3 will noticeably outperform the Pi 1 and Zero when it comes to flicking through the menus. - -### SSH gateway - -If you want to be able to access computers and devices on your home network from outside over the internet, you have to open up ports on those devices to allow outside traffic. Opening ports to the internet is a security risk, meaning you're always at risk of attack, misuse, or any kind of unauthorized access. However, if you install a Raspberry Pi on your network and set up port forwarding to allow only SSH access to that Pi, you can use that as a secure gateway to hop onto other Pis and PCs on the network. - -Most routers allow you to configure port-forwarding rules. You'll need to give your Pi a fixed internal IP address and set up port 22 on your router to map to port 22 on your Raspberry Pi. If your ISP provides you with a static IP address, you'll be able to SSH into it with this as the host address (for example, **ssh pi@123.45.56.78** ). If you have a domain name, you can configure a subdomain to point to this IP address, so you don't have to remember it (for example, **ssh[pi@home.mydomain.com][10]** ). - -![][11] - -However, if you're going to expose a Raspberry Pi to the internet, you should be very careful not to put your network at risk. There are a few simple procedures you can follow to make it sufficiently secure: - -1\. Most people suggest you change your login password (which makes sense, seeing as the default password “raspberry” is well known), but this does not protect against brute-force attacks. You could change your password and add a two-factor authentication (so you need your password _and_ a time-dependent passcode generated by your phone), which is more secure. However, I believe the best way to secure your Raspberry Pi from intruders is to [disable][12] [“password authentication”][12] in your SSH configuration, so you allow only SSH key access. This means that anyone trying to SSH in by guessing your password will never succeed. Only with your private SSH key can anyone gain access. Similarly, most people suggest changing the SSH port from the default 22 to something unexpected, but a simple [Nmap][13] of your IP address will reveal your true SSH port. - -2\. Ideally, you would not run much in the way of other software on this Pi, so you don't end up accidentally exposing anything else. If you want to run other software, you might be better running it on another Pi on the network that is not exposed to the internet. Ensure that you keep your packages up to date by upgrading regularly, particularly the **openssh-server** package, so that any security vulnerabilities are patched. - -3\. Install [sshblack][14] or [fail2ban][15] to blacklist any users who seem to be acting maliciously, such as attempting to brute force your SSH password. - -Once you've secured your Raspberry Pi and put it online, you'll be able to log in to your network from anywhere in the world. Once you're on your Raspberry Pi, you can SSH into other devices on the network using their local IP address (for example, 192.168.1.31). If you have passwords on these devices, just use the password. If they're also SSH-key-only, you'll need to ensure your key is forwarded over SSH by using the **-A** flag: **ssh -A pi@123.45.67.89**. - -### CCTV / pet camera - -Another great home project is to set up a camera module to take photos or stream video, capture and save files, or streamed internally or to the internet. There are many reasons you might want to do this, but two common use cases are for a homemade security camera or to monitor a pet. - -The [Raspberry Pi camera module][16] is a brilliant accessory. It provides full HD photo and video, lots of advanced configuration, and is [easy to][17] [program][17]. The [infrared camera][18] is ideal for this kind of use, and with an infrared LED (which the Pi can control) you can see in the dark! - -If you want to take still images on a regular basis to keep an eye on things, you can just write a short [Python][19] script or use the command line tool [raspistill][20], and schedule it to recur in [Cron][21]. You might want to have it save them to [Dropbox][22] or another web service, upload them to a web server, or you can even create a [web app][23] to display them. - -If you want to stream video, internally or externally, that's really easy, too. A simple MJPEG (Motion JPEG) example is provided in the [picamera documentation][24] (under “web streaming”). Just download or copy that code into a file, run it and visit the Pi's IP address at port 8000, and you'll see your camera's output live. - -A more advanced streaming project, [pistreaming][25], is available, which uses [JSMpeg][26] (a JavaScript video player) with the web server and a websocket for the camera stream running separately. This method is more performant and is just as easy to get running as the previous example, but there is more code involved and if set up to stream on the internet, requires you to open two ports. - -Once you have web streaming set up, you can position the camera where you want it. I have one set up to keep an eye on my pet tortoise: - -![Tortoise ][27] - -Ben Nuttall, CC BY-SA - -If you want to be able to control where the camera actually points, you can do so using servos. A neat solution is to use Pimoroni's [Pan-Tilt HAT][28], which allows you to move the camera easily in two dimensions. To integrate this with pistreaming, see the project's [pantilthat branch][29]. - -![Pan-tilt][30] - -Pimoroni.com, Copyright, Used with permission - -If you want to position your Pi outside, you'll need a waterproof enclosure and some way of getting power to the Pi. PoE (Power-over-Ethernet) cables can be a good way of achieving this. - -### Home automation and IoT - -It's 2017 and there are internet-connected devices everywhere, especially in the home. Our lightbulbs have Wi-Fi, our toasters are smarter than they used to be, and our tea kettles are at risk of attack from Russia. As long as you keep your devices secure, or don't connect them to the internet if they don't need to be, then you can make great use of IoT devices to automate tasks around the home. - -There are plenty of services you can buy or subscribe to, like Nest Thermostat or Philips Hue lightbulbs, which allow you to control your heating or your lighting from your phone, respectively—whether you're inside or away from home. You can use a Raspberry Pi to boost the power of these kinds of devices by automating interactions with them according to a set of rules involving timing or even sensors. One thing you can't do with Philips Hue is have the lights come on when you enter the room, but with a Raspberry Pi and a motion sensor, you can use a Python API to turn on the lights. Similarly, you can configure your Nest to turn on the heating when you're at home, but what if you only want it to turn on if there's at least two people home? Write some Python code to check which phones are on the network and if there are at least two, tell the Nest to turn on the heat. - -You can do a great deal more without integrating with existing IoT devices and with only using simple components. A homemade burglar alarm, an automated chicken coop door opener, a night light, a music box, a timed heat lamp, an automated backup server, a print server, or whatever you can imagine. - -### Tor proxy and blocking ads - -Adafruit's [Onion Pi][31] is a [Tor][32] proxy that makes your web traffic anonymous, allowing you to use the internet free of snoopers and any kind of surveillance. Follow Adafruit's tutorial on setting up Onion Pi and you're on your way to a peaceful anonymous browsing experience. - -![Onion-Pi][33] - -Onion-pi from Adafruit, Copyright, Used with permission - -![Pi-hole][34]You can install a Raspberry Pi on your network that intercepts all web traffic and filters out any advertising. Simply download the [Pi-hole][35] software onto the Pi, and all devices on your network will be ad-free (it even blocks in-app ads on your mobile devices). - -There are plenty more uses for the Raspberry Pi at home. What do you use Raspberry Pi for at home? What do you want to use it for? - -Let us know in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/4/5-projects-raspberry-pi-home - -作者:[Ben Nuttall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_home_automation.png?itok=2TnmJpD8 (5 projects for Raspberry Pi at home) -[2]: https://www.raspberrypi.org/ -[3]: https://kodi.tv/ -[4]: https://osmc.tv/ -[5]: https://libreelec.tv/ -[6]: https://www.raspberrypi.org/downloads/noobs/ -[7]: https://opensource.com/sites/default/files/libreelec_0.png (LibreElec ) -[8]: https://opensource.com/sites/default/files/osmc.png (OSMC) -[9]: https://opensource.com/life/16/10/which-raspberry-pi-should-you-choose-your-project -[10]: mailto:pi@home.mydomain.com -[11]: https://opensource.com/sites/default/files/resize/screenshot_from_2017-04-07_15-13-01-700x380.png -[12]: http://stackoverflow.com/questions/20898384/ssh-disable-password-authentication -[13]: https://nmap.org/ -[14]: http://www.pettingers.org/code/sshblack.html -[15]: https://www.fail2ban.org/wiki/index.php/Main_Page -[16]: https://www.raspberrypi.org/products/camera-module-v2/ -[17]: https://opensource.com/life/15/6/raspberry-pi-camera-projects -[18]: https://www.raspberrypi.org/products/pi-noir-camera-v2/ -[19]: http://picamera.readthedocs.io/ -[20]: https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md -[21]: https://www.raspberrypi.org/documentation/linux/usage/cron.md -[22]: https://github.com/RZRZR/plant-cam -[23]: https://github.com/bennuttall/bett-bot -[24]: http://picamera.readthedocs.io/en/release-1.13/recipes2.html#web-streaming -[25]: https://github.com/waveform80/pistreaming -[26]: http://jsmpeg.com/ -[27]: https://opensource.com/sites/default/files/tortoise.jpg (Tortoise) -[28]: https://shop.pimoroni.com/products/pan-tilt-hat -[29]: https://github.com/waveform80/pistreaming/tree/pantilthat -[30]: https://opensource.com/sites/default/files/pan-tilt.gif (Pan-tilt) -[31]: https://learn.adafruit.com/onion-pi/overview -[32]: https://www.torproject.org/ -[33]: https://opensource.com/sites/default/files/onion-pi.jpg (Onion-Pi) -[34]: https://opensource.com/sites/default/files/resize/pi-hole-250x250.png (Pi-hole) -[35]: https://pi-hole.net/ diff --git a/translated/tech/20170414 5 projects for Raspberry Pi at home.md b/translated/tech/20170414 5 projects for Raspberry Pi at home.md new file mode 100644 index 0000000000..fabc841426 --- /dev/null +++ b/translated/tech/20170414 5 projects for Raspberry Pi at home.md @@ -0,0 +1,149 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 projects for Raspberry Pi at home) +[#]: via: (https://opensource.com/article/17/4/5-projects-raspberry-pi-home) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +5 个可在家中使用的与 Raspberry Pi 相关的项目 +====================================== + +![5 projects for Raspberry Pi at home][1] + +[Raspberry Pi][2] 电脑可被用来进行多种设置用于不同的目的。明显它在教育市场帮助学生在教室中学习编程与创客技巧和创客空间方面占有一席之地,它在工作场所和工厂中有大量应用。我打算介绍五个你可能想要在你的家中构建的项目。 + +### 媒体中心 + +在人们家中人们常用 Raspberry Pi 作为媒体中心来服务多媒体文件。它很容易建立,Raspberry Pi 提供了大量的 GPU(图形处理单元)运算能力来渲染你的大屏电视上的高清电视节目和电影。将 [Kodi][3](从前的 XBMC)运行在 Raspberry Pi 上是一个很棒的方式来播放你的硬盘或网络存储上的任何媒体。你同样可以安装一个包来播放 YouTube 视频。 + +也有一些少量不同的选项,显然是 [OSMC][4](开源媒体中心)和 [LibreELEC][5],都是基于 Kodi 的。它们在放映媒体内容方面表现的都非常好,但是 OSMC 有一个更酷炫的用户界面,而 LibreElec 更轻量级。你要做的只是选择一个发行版,下载镜像并安装到一个 SD 卡中(或者仅仅使用 [NOOBS][6]),启动,然后你就准备好了。 + +![LibreElec ][7] + +LibreElec; Raspberry Pi 基金会, CC BY-SA + +![OSMC][8] + +OSMC.tv, Copyright, 凭权限使用 + +在往下走之前,你需要决定[使用哪种 Raspberry Pi 开发板][9]。这些发行版在任何 Pi(1, 2, 3, or Zero)上都能运行,视频播放在这些开发板中的任何一个上都能胜任。除了 Pi 3(和 Zero W)有内置 Wi-Fi,可察觉的不同是用户界面的反应速度,在 Pi 3 上更快。一个 Pi 2 不会慢太多,所以如果你不需要 Wi-Fi 是可以的,但是当切换菜单时,你会注意到 Pi 3 比 Pi 1 和 Zero 表现的更好。 + +### SSH 网关 + +如果你想从广域网访问你的家庭局域网的电脑和设备,你必须打开这些设备的端口来允许外部访问。在互联网中开放这些端口有安全风险,意味着你总是你总是处于被攻击、滥用或者其他各种未授权访问的风险中。然而,如果你在你的网络中安装一个 Raspberry Pi,并且设置端口映射到仅通过 SSH 访问 Pi 的端口,你可以这么用来作为一个安全的网关来跳到网络中的其他 Pi 和 PC。 + +大多数路由允许你配置端口映射规则。你需要给你的 Pi 一个固定的内网 IP 地址来设置你的路由器端口 22 映射到你的 Raspberry Pi 端口 22。如果你的网络服务提供商给你提供了一个静态 IP 地址,你能够通过 SSH 和主机的 IP 地址访问(例如,**ssh pi@123.45.56.78** )。如果你有一个域名,你可以配置一个子域名指向这个 IP 地址,所以你没必要记住它(例如,**ssh[pi@home.mydomain.com][10]**)。 + +![][11] + +然而,如果你不想将 Raspberry Pi 暴露在互联网上,你应该非常小心,不要让你的网络处于危险之中。如果你遵循一些简单的步骤来使它更安全: + +1\. 大多数人建议你更换你的登录密码(有道理,默认密码 “raspberry” 是众所周知的),但是这不能阻挡暴力攻击。你可以改变你的密码并添加一个双重验证(所以你需要你的密码_和_一个手机生成的与时间无关的密码),这么做更安全。但是,我相信最好的方法阻止入侵者访问你的 Raspberry Pi 是在你的 SSH 配置中[禁止][12][密码认证][12],这样只能通过 SSH 密匙进入。这意味着任何试图猜测你的密码尝试登录的人都不会成功。只有你的私有密匙可以访问。简单来说,很多人建议将 SSH 端口从默认的 22 换成其他的,但是通过简单的 [Nmap][13] 扫描你的 IP 地址,你信任的 SSH 端口就会暴露。 + +2\. 最好,不要在这个 Pi 上运行其他的软件,这样你不会意外暴露其他东西。如果你想要运行其他软件,你最好在网络中的其他 Pi 上运行,它们没有暴露在互联网上。确保你经常升级来保证你的包是最新的,尤其是 **openssh-server** 包,这样你的安全缺陷就被打补丁了。 + +3\. 安装 [sshblack][14] 或 [fail2ban][15] 来将任何表露出恶意的用户加入黑名单,例如试图暴力破解你的 SSH 密码。 + +一旦你是 Raspberry Pi 安全后,让它在线,你将在世界的任何地方登录你的网络。一旦你登录到你的树莓派,你可以用 SSH 访问本地网络上的局域网地址(例如,192.168.1.31)访问其他设备。如果你在这些设备上有密码,用密码就好了。如果它们同样只允许 SSH 密匙,你需要确保你的密匙通过 SSH 传播,使用 **-A** 参数:**ssh -A pi@123.45.67.89**。 + +### CCTV / 宠物相机 + +另一个很棒的家庭项目是建立一个相机模块来拍照和录视频,录制并保存文件,在内网或者外网中进行流式传输。你想这么做有很多原因,但两个常见的情况是一个家庭安防相机或监控你的宠物。 + +[Raspberry Pi 相机模块][16] 是一个优秀的配件。它提供全高清的相片和视频,包括很多高级配置,很[容易][17][编程][17]。[红外线相机][18]用于这种目的是非常理想的,通过一个红外线 LED(Pi 可以控制的),你就能够在黑暗中看见东西。 + +如果你想通过一定频率拍摄静态图片来留意某件事,你可以仅仅写一个短的 [Python][19] 脚本或者使用命令行工具 [raspistill][20], 在 [Cron][21] 中规划它多次运行。你可能想将它们保存到 [Dropbox][22] 或另一个网络服务,上传到一个网络服务器,你甚至可以创建一个[网络应用][23]来显示他们。 + +如果你想要在内网或外网中流式传输视频,那也相当简单。在 [picamera 文档][24]中(在 “web streaming” 章节)有一个简单的 MJPEG(运动的 JPEG)例子。简单下载或者拷贝代码到文件中,运行并访问 Pi 的 IP 地址的 8000 端口,你会看见你的相机的直播输出。 + +有一个更高级的流式传输项目 [pistreaming][25] 可获得,它通过在网络服务器中用 [JSMpeg][26] (一个 JavaScript 视频播放器)和一个用于相机流的单独运行的 websocket。这种方法性能更好,并且和之前的例子一样简单,但是如果要在互联网中流式传输,则需要包含更多代码,并且需要你开放两个端口。 + +一旦你的网络流建立起来,你可以将你的相机放在你想要的地方。我用一个来观察我的宠物龟: + +![Tortoise ][27] + +Ben Nuttall, CC BY-SA + +如果你想控制相机位置,你可以用一个舵机。一个优雅的方案是用 Pimoroni 的 [Pan-Tilt HAT][28],它可以让你简单的在二维方向上移动相机。为了与 pistreaming 集成,看项目的 [pantilthat 分支][29]. + +![Pan-tilt][30] + +Pimoroni.com, Copyright, Used with permission + +如果你想将你的 Pi 放到户外,你将需要一个防水的外围附件,并且需要一种给 Pi 供电的方式。POE(通过以太网提供电力)电缆是一个不错的实现方式。 + +### 家庭自动化或物联网 + +现在是 2017 年,到处都有很多物联网设备,尤其是家中。我们的电灯有 Wi-Fi,我们的面包烤箱比过去更智能,我们的茶壶处于俄国攻击的风险中,除非你确保你的设备安全,不然别将没有必要的设备连接到互联网,之后你可以在家中充分的利用物联网设备来完成自动化任务。 + +市场上有大量你可以购买或订阅的服务,像 Nest Thermostat 或 Philips Hue 电灯泡,允许你通过你的手机控制你的温度或者你的亮度,无论你是否在家。你可以用一个树莓派来催动这些设备的电源,通过一系列规则包括时间甚至是传感器来完成自动交互。用 Philips Hue ,有一件事你不能做的是当你进房间是打开灯光,但是有一个树莓派和一个运动传感器,你可以用 Python API 来打开灯光。类似,当你在家的时候你可以通过配置你的 Nest 打开加热系统,但是如果你想在房间里至少有两个人时才打开呢?写一些 Python 代码来检查网络中有哪些手机,如果至少有两个,告诉 Nest 来打开加热器。 + +不选择集成已存在的物联网设备,你可以用简单的组件来做的更多。一个自制的窃贼警报器,一个自动化的鸡笼门开关,一个夜灯,一个音乐盒,一个定时的加热灯,一个自动化的备份服务器,一个打印服务器,或者任何你能想到的。 + +### Tor 协议和屏蔽广告 + +Adafruit 的 [Onion Pi][31] 是一个 [Tor][32] 协议来使你的网络交通匿名,允许你使用互联网,而不用担心窥探者和各种形式的监视。跟随 Adafruit 的指南来设置 Onion Pi,你会找到一个舒服的匿名的浏览体验。 + +![Onion-Pi][33] + +Onion-pi from Adafruit, Copyright, Used with permission + +![Pi-hole][34] 你可以在你的网络中安装一个树莓派来拦截所有的网络交通并过滤所有广告。简单下载 [Pi-hole][35] 软件到 Pi 中,你的网络中的所有设备都将没有广告(甚至屏蔽你的移动设备应用内的广告)。 + +Raspberry Pi 在家中有很多用法。你在家里用树莓派来干什么?你想用它干什么? + +在下方评论让我们知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/4/5-projects-raspberry-pi-home + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_home_automation.png?itok=2TnmJpD8 (5 projects for Raspberry Pi at home) +[2]: https://www.raspberrypi.org/ +[3]: https://kodi.tv/ +[4]: https://osmc.tv/ +[5]: https://libreelec.tv/ +[6]: https://www.raspberrypi.org/downloads/noobs/ +[7]: https://opensource.com/sites/default/files/libreelec_0.png (LibreElec ) +[8]: https://opensource.com/sites/default/files/osmc.png (OSMC) +[9]: https://opensource.com/life/16/10/which-raspberry-pi-should-you-choose-your-project +[10]: mailto:pi@home.mydomain.com +[11]: https://opensource.com/sites/default/files/resize/screenshot_from_2017-04-07_15-13-01-700x380.png +[12]: http://stackoverflow.com/questions/20898384/ssh-disable-password-authentication +[13]: https://nmap.org/ +[14]: http://www.pettingers.org/code/sshblack.html +[15]: https://www.fail2ban.org/wiki/index.php/Main_Page +[16]: https://www.raspberrypi.org/products/camera-module-v2/ +[17]: https://opensource.com/life/15/6/raspberry-pi-camera-projects +[18]: https://www.raspberrypi.org/products/pi-noir-camera-v2/ +[19]: http://picamera.readthedocs.io/ +[20]: https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md +[21]: https://www.raspberrypi.org/documentation/linux/usage/cron.md +[22]: https://github.com/RZRZR/plant-cam +[23]: https://github.com/bennuttall/bett-bot +[24]: http://picamera.readthedocs.io/en/release-1.13/recipes2.html#web-streaming +[25]: https://github.com/waveform80/pistreaming +[26]: http://jsmpeg.com/ +[27]: https://opensource.com/sites/default/files/tortoise.jpg (Tortoise) +[28]: https://shop.pimoroni.com/products/pan-tilt-hat +[29]: https://github.com/waveform80/pistreaming/tree/pantilthat +[30]: https://opensource.com/sites/default/files/pan-tilt.gif (Pan-tilt) +[31]: https://learn.adafruit.com/onion-pi/overview +[32]: https://www.torproject.org/ +[33]: https://opensource.com/sites/default/files/onion-pi.jpg (Onion-Pi) +[34]: https://opensource.com/sites/default/files/resize/pi-hole-250x250.png (Pi-hole) +[35]: https://pi-hole.net/ + + + From 833ecc8a944bfdf9ed9fa75f2b1fd336d3a5810e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Fri, 31 May 2019 10:58:33 +0800 Subject: [PATCH 0677/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20180629 100 Best Ubuntu Apps.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180629 100 Best Ubuntu Apps.md b/sources/tech/20180629 100 Best Ubuntu Apps.md index 581d22b527..4c50ffa756 100644 --- a/sources/tech/20180629 100 Best Ubuntu Apps.md +++ b/sources/tech/20180629 100 Best Ubuntu Apps.md @@ -1,3 +1,5 @@ +warmfrog translating + 100 Best Ubuntu Apps ====== From 2618c2c08d6446f3291bf62618fdf05296d4af29 Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Fri, 31 May 2019 18:37:42 +0800 Subject: [PATCH 0678/1154] Update 20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md --- ...able Security Updates On Red Hat (RHEL) And CentOS System.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md b/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md index 531612777a..91008ca5e3 100644 --- a/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md +++ b/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( jdh8383 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 741ba60936ab19564d7e6dcd2c6c104b6e54c1b3 Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Fri, 31 May 2019 22:25:43 +0800 Subject: [PATCH 0679/1154] Update 20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md (#13883) --- ...able Security Updates On Red Hat (RHEL) And CentOS System.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md b/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md index 531612777a..91008ca5e3 100644 --- a/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md +++ b/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( jdh8383 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9324e4766bcaf45da1c9addc67d6b18fafd1b2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 31 May 2019 22:27:19 +0800 Subject: [PATCH 0680/1154] Translated (#13884) --- ...90527 20- FFmpeg Commands For Beginners.md | 497 ------------------ ...90527 20- FFmpeg Commands For Beginners.md | 496 +++++++++++++++++ 2 files changed, 496 insertions(+), 497 deletions(-) delete mode 100644 sources/tech/20190527 20- FFmpeg Commands For Beginners.md create mode 100644 translated/tech/20190527 20- FFmpeg Commands For Beginners.md diff --git a/sources/tech/20190527 20- FFmpeg Commands For Beginners.md b/sources/tech/20190527 20- FFmpeg Commands For Beginners.md deleted file mode 100644 index 5a09ad4a01..0000000000 --- a/sources/tech/20190527 20- FFmpeg Commands For Beginners.md +++ /dev/null @@ -1,497 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (20+ FFmpeg Commands For Beginners) -[#]: via: (https://www.ostechnix.com/20-ffmpeg-commands-beginners/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -20+ FFmpeg Commands For Beginners -====== - -![FFmpeg Commands][1] - -In this guide, I will be explaining how to use FFmpeg multimedia framework to do various audio, video transcoding and conversion operations with examples. I have compiled most commonly and frequently used 20+ FFmpeg commands for beginners. I will keep updating this guide by adding more examples from time to time. Please bookmark this guide and come back in a while to check for the updates. Let us get started, shall we? If you haven’t installed FFmpeg in your Linux system yet, refer the following guide. - - * [**Install FFmpeg in Linux**][2] - - - -### 20+ FFmpeg Commands For Beginners - -The typical syntax of the FFmpeg command is: - -``` -ffmpeg [global_options] {[input_file_options] -i input_url} ... - {[output_file_options] output_url} ... -``` - -We are now going to see some important and useful FFmpeg commands. - -##### **1\. Getting audio/video file information** - -To display your media file details, run: - -``` -$ ffmpeg -i video.mp4 -``` - -**Sample output:** - -``` -ffmpeg version n4.1.3 Copyright (c) 2000-2019 the FFmpeg developers -built with gcc 8.2.1 (GCC) 20181127 -configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3 -libavutil 56. 22.100 / 56. 22.100 -libavcodec 58. 35.100 / 58. 35.100 -libavformat 58. 20.100 / 58. 20.100 -libavdevice 58. 5.100 / 58. 5.100 -libavfilter 7. 40.101 / 7. 40.101 -libswscale 5. 3.100 / 5. 3.100 -libswresample 3. 3.100 / 3. 3.100 -libpostproc 55. 3.100 / 55. 3.100 -Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4': -Metadata: -major_brand : isom -minor_version : 512 -compatible_brands: isomiso2avc1mp41 -encoder : Lavf58.20.100 -Duration: 00:00:28.79, start: 0.000000, bitrate: 454 kb/s -Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 1920x1080 [SAR 1:1 DAR 16:9], 318 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default) -Metadata: -handler_name : ISO Media file produced by Google Inc. Created on: 04/08/2019. -Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) -Metadata: -handler_name : ISO Media file produced by Google Inc. Created on: 04/08/2019. -At least one output file must be specified -``` - -As you see in the above output, FFmpeg displays the media file information along with FFmpeg details such as version, configuration details, copyright notice, build and library options etc. - -If you don’t want to see the FFmpeg banner and other details, but only the media file information, use **-hide_banner** flag like below. - -``` -$ ffmpeg -i video.mp4 -hide_banner -``` - -**Sample output:** - -![][3] - -View audio, video file information using FFMpeg - -See? Now, it displays only the media file details. - -** **Recommended Download** – [**Free Guide: “Spotify Music Streaming: The Unofficial Guide”**][4] - -##### **2\. Converting video files to different formats** - -FFmpeg is powerful audio and video converter, so It’s possible to convert media files between different formats. Say for example, to convert **mp4 file to avi file** , run: - -``` -$ ffmpeg -i video.mp4 video.avi -``` - -Similarly, you can convert media files to any format of your choice. - -For example, to convert youtube **flv** format videos to **mpeg** format, run: - -``` -$ ffmpeg -i video.flv video.mpeg -``` - -If you want to preserve the quality of your source video file, use ‘-qscale 0’ parameter: - -``` -$ ffmpeg -i input.webm -qscale 0 output.mp4 -``` - -To check list of supported formats by FFmpeg, run: - -``` -$ ffmpeg -formats -``` - -##### **3\. Converting video files to audio files** - -To convert a video file to audio file, just specify the output format as .mp3, or .ogg, or any other audio formats. - -The above command will convert **input.mp4** video file to **output.mp3** audio file. - -``` -$ ffmpeg -i input.mp4 -vn output.mp3 -``` - -Also, you can use various audio transcoding options to the output file as shown below. - -``` -$ ffmpeg -i input.mp4 -vn -ar 44100 -ac 2 -ab 320 -f mp3 output.mp3 -``` - -Here, - - * **-vn** – Indicates that we have disabled video recording in the output file. - * **-ar** – Set the audio frequency of the output file. The common values used are 22050, 44100, 48000 Hz. - * **-ac** – Set the number of audio channels. - * **-ab** – Indicates the audio bitrate. - * **-f** – Output file format. In our case, it’s mp3 format. - - - -##### **4\. Change resolution of video files** - -If you want to set a particular resolution to a video file, you can use following command: - -``` -$ ffmpeg -i input.mp4 -filter:v scale=1280:720 -c:a copy output.mp4 -``` - -Or, - -``` -$ ffmpeg -i input.mp4 -s 1280x720 -c:a copy output.mp4 -``` - -The above command will set the resolution of the given video file to 1280×720. - -Similarly, to convert the above file to 640×480 size, run: - -``` -$ ffmpeg -i input.mp4 -filter:v scale=640:480 -c:a copy output.mp4 -``` - -Or, - -``` -$ ffmpeg -i input.mp4 -s 640x480 -c:a copy output.mp4 -``` - -This trick will help you to scale your video files to smaller display devices such as tablets and mobiles. - -##### **5\. Compressing video files** - -It is always an good idea to reduce the media files size to lower size to save the harddrive’s space. - -The following command will compress and reduce the output file’s size. - -``` -$ ffmpeg -i input.mp4 -vf scale=1280:-1 -c:v libx264 -preset veryslow -crf 24 output.mp4 -``` - -Please note that you will lose the quality if you try to reduce the video file size. You can lower that **crf** value to **23** or lower if **24** is too aggressive. - -You could also transcode the audio down a bit and make it stereo to reduce the size by including the following options. - -``` --ac 2 -c:a aac -strict -2 -b:a 128k -``` - -** **Recommended Download** – [**Free Guide: “PLEX, a Manual: Your Media, With Style”**][5] - -##### **6\. Compressing Audio files** - -Just like compressing video files, you can also compress audio files using **-ab** flag in order to save some disk space. - -Let us say you have an audio file of 320 kbps bitrate. You want to compress it by changing the bitrate to any lower value like below. - -``` -$ ffmpeg -i input.mp3 -ab 128 output.mp3 -``` - -The list of various available audio bitrates are: - - 1. 96kbps - 2. 112kbps - 3. 128kbps - 4. 160kbps - 5. 192kbps - 6. 256kbps - 7. 320kbps - - - -##### **7. Removing audio stream from a video file - -** - -If you don’t want to a audio from a video file, use **-an** flag. - -``` -$ ffmpeg -i input.mp4 -an output.mp4 -``` - -Here, ‘an’ indicates no audio recording. - -The above command will undo all audio related flags, because we don’t audio from the input.mp4. - -##### **8\. Removing video stream from a media file** - -Similarly, if you don’t want video stream, you could easily remove it from the media file using ‘vn’ flag. vn stands for no video recording. In other words, this command converts the given media file into audio file. - -The following command will remove the video from the given media file. - -``` -$ ffmpeg -i input.mp4 -vn output.mp3 -``` - -You can also mention the output file’s bitrate using ‘-ab’ flag as shown in the following example. - -``` -$ ffmpeg -i input.mp4 -vn -ab 320 output.mp3 -``` - -##### **9. Extracting images from the video ** - -Another useful feature of FFmpeg is we can easily extract images from a video file. This could be very useful, if you want to create a photo album from a video file. - -To extract images from a video file, use the following command: - -``` -$ ffmpeg -i input.mp4 -r 1 -f image2 image-%2d.png -``` - -Here, - - * **-r** – Set the frame rate. I.e the number of frames to be extracted into images per second. The default value is **25**. - * **-f** – Indicates the output format i.e image format in our case. - * **image-%2d.png** – Indicates how we want to name the extracted images. In this case, the names should start like image-01.png, image-02.png, image-03.png and so on. If you use %3d, then the name of images will start like image-001.png, image-002.png and so on. - - - -##### **10\. Cropping videos** - -FFMpeg allows to crop a given media file in any dimension of our choice. - -The syntax to crop a vide ofile is given below: - -``` -ffmpeg -i input.mp4 -filter:v "crop=w:h:x:y" output.mp4 -``` - -Here, - - * **input.mp4** – source video file. - * **-filter:v** – Indicates the video filter. - * **crop** – Indicates crop filter. - * **w** – **Width** of the rectangle that we want to crop from the source video. - * **h** – Height of the rectangle. - * **x** – **x coordinate** of the rectangle that we want to crop from the source video. - * **y** – y coordinate of the rectangle. - - - -Let us say you want to a video with a **width of 640 pixels** and a **height of 480 pixels** , from the **position (200,150)** , the command would be: - -``` -$ ffmpeg -i input.mp4 -filter:v "crop=640:480:200:150" output.mp4 -``` - -Please note that cropping videos will affect the quality. Do not do this unless it is necessary. - -##### **11\. Convert a specific portion of a video** - -Sometimes, you might want to convert only a specific portion of the video file to different format. Say for example, the following command will convert the **first 50 seconds** of given video.mp4 file to video.avi format. - -``` -$ ffmpeg -i input.mp4 -t 10 output.avi -``` - -Here, we specify the the time in seconds. Also, it is possible to specify the time in **hh.mm.ss** format. - -##### **12\. Set the aspect ratio to video** - -You can set the aspect ration to a video file using **-aspect** flag like below. - -``` -$ ffmpeg -i input.mp4 -aspect 16:9 output.mp4 -``` - -The commonly used aspect ratios are: - - * 16:9 - * 4:3 - * 16:10 - * 5:4 - * 2:21:1 - * 2:35:1 - * 2:39:1 - - - -##### **13\. Adding poster image to audio files** - -You can add the poster images to your files, so that the images will be displayed while playing the audio files. This could be useful to host audio files in Video hosting or sharing websites. - -``` -$ ffmpeg -loop 1 -i inputimage.jpg -i inputaudio.mp3 -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest output.mp4 -``` - -##### **14. Trim a media file using start and stop times - -** - -To trim down a video to smaller clip using start and stop times, we can use the following command. - -``` -$ ffmpeg -i input.mp4 -ss 00:00:50 -codec copy -t 50 output.mp4 -``` - -Here, - - * –s – Indicates the starting time of the video clip. In our example, starting time is the 50th second. - * -t – Indicates the total time duration. - - - -This is very helpful when you want to cut a part from an audio or video file using starting and ending time. - -Similarly, we can trim down the audio file like below. - -``` -$ ffmpeg -i audio.mp3 -ss 00:01:54 -to 00:06:53 -c copy output.mp3 -``` - -##### **15\. Split video files into multiple parts** - -Some websites will allow you to upload only a specific size of video. In such cases, you can split the large video files into multiple smaller parts like below. - -``` -$ ffmpeg -i input.mp4 -t 00:00:30 -c copy part1.mp4 -ss 00:00:30 -codec copy part2.mp4 -``` - -Here, **-t 00:00:30** indicates a part that is created from the start of the video to the 30th second of video. **-ss 00:00:30** shows the starting time stamp for the next part of video. It means that the 2nd part will start from the 30th second and will continue up to the end of the original video file. - -** **Recommended Download** – [**Free Guide: “How to Start Your Own Successful Podcast”**][6] - -##### **16\. Joining or merging multiple video parts into one** - -FFmpeg will also join the multiple video parts and create a single video file. - -Create **join.txt** file that contains the exact paths of the files that you want to join. All files should be same format (same codec). The path name of all files should be mentioned one by one like below. - -``` -file /home/sk/myvideos/part1.mp4 -file /home/sk/myvideos/part2.mp4 -file /home/sk/myvideos/part3.mp4 -file /home/sk/myvideos/part4.mp4 -``` - -Now, join all files using command: - -``` -$ ffmpeg -f concat -i join.txt -c copy output.mp4 -``` - -If you get an error something like below; - -``` -[concat @ 0x555fed174cc0] Unsafe file name '/path/to/mp4' -join.txt: Operation not permitted -``` - -Add **“-safe 0”** : - -``` -$ ffmpeg -f concat -safe 0 -i join.txt -c copy output.mp4 -``` - -The above command will join part1.mp4, part2.mp4, part3.mp4, and part4.mp4 files into a single file called “output.mp4”. - -##### **17\. Add subtitles to a video file** - -We can also add subtitles to a video file using FFmpeg. Download the correct subtitle for your video and add it your video as shown below. - -``` -$ fmpeg -i input.mp4 -i subtitle.srt -map 0 -map 1 -c copy -c:v libx264 -crf 23 -preset veryfast output.mp4 -``` - -##### **18\. Preview or test video or audio files** - -You might want to preview to verify or test whether the output file has been properly transcoded or not. To do so, you can play it from your Terminal with command: - -``` -$ ffplay video.mp4 -``` - -[![][1]][7] - -Similarly, you can test the audio files as shown below. - -``` -$ ffplay audio.mp3 -``` - -[![][1]][8] - -##### **19\. Increase/decrease video playback speed** - -FFmpeg allows you to adjust the video playback speed. - -To increase the video playback speed, run: - -``` -$ ffmpeg -i input.mp4 -vf "setpts=0.5*PTS" output.mp4 -``` - -The command will double the speed of the video. - -To slow down your video, you need to use a multiplier **greater than 1**. To decrease playback speed, run: - -``` -$ ffmpeg -i input.mp4 -vf "setpts=4.0*PTS" output.mp4 -``` - -##### **20. Create Animated GIF - -** - -We use GIF images on almost all social and professional networks for various purposes. Using FFmpeg, we can easily and quickly create animated video files. The following guide explains how to create an animated GIF file using FFmpeg and ImageMagick in Unix-like systems. - - * [**How To Create Animated GIF In Linux**][9] - - - -##### **21.** Create videos from PDF files - -I collected many PDF files, mostly Linux tutorials, over the years and saved in my Tablet PC. Sometimes I feel too lazy to read them from the tablet. So, I decided to create a video from PDF files and watch it in a big screen devices like a TV or a Computer. If you ever wondered how to make a movie file from a collection of PDF files, the following guide will help. - - * [**How To Create A Video From PDF Files In Linux**][10] - - - -##### **22\. Getting help** - -In this guide, I have covered the most commonly used FFmpeg commands. It has a lot more different options to do various advanced functions. To learn more about it, refer the man page. - -``` -$ man ffmpeg -``` - -And, that’s all. I hope this guide will help you to getting started with FFmpeg. If you find this guide useful, please share it on your social, and professional networks. More good stuffs to come. Stay tuned! - -Cheers! - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/20-ffmpeg-commands-beginners/ - -作者:[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/2017/05/FFmpeg-Commands-720x340.png -[2]: https://www.ostechnix.com/install-ffmpeg-linux/ -[3]: http://www.ostechnix.com/wp-content/uploads/2017/05/sk@sk_001.png -[4]: https://ostechnix.tradepub.com/free/w_make141/prgm.cgi -[5]: https://ostechnix.tradepub.com/free/w_make75/prgm.cgi -[6]: https://ostechnix.tradepub.com/free/w_make235/prgm.cgi -[7]: http://www.ostechnix.com/wp-content/uploads/2017/05/Menu_004.png -[8]: http://www.ostechnix.com/wp-content/uploads/2017/05/Menu_005-3.png -[9]: https://www.ostechnix.com/create-animated-gif-ubuntu-16-04/ -[10]: https://www.ostechnix.com/create-video-pdf-files-linux/ diff --git a/translated/tech/20190527 20- FFmpeg Commands For Beginners.md b/translated/tech/20190527 20- FFmpeg Commands For Beginners.md new file mode 100644 index 0000000000..33d0d26052 --- /dev/null +++ b/translated/tech/20190527 20- FFmpeg Commands For Beginners.md @@ -0,0 +1,496 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (20+ FFmpeg Commands For Beginners) +[#]: via: (https://www.ostechnix.com/20-ffmpeg-commands-beginners/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +针对初学者的20多个 FFmpeg 命令 +====== + +![FFmpeg Commands][1] + +在这个指南中,我将阐明如何使用 FFmpeg 多多媒体框架来做各种各样的音频,视频转换编码和转换操作示例。我已经为初学者编写最通常频繁使用的20多个 FFmpeg 命令,我将通过不是地添加更多的示例来保持更新这个指南。请给这个指南加书签,以后回来检查更新。让我们开始吧?如果你还没有在你的 Linux 系统中安装 FFmpeg ,参考下面的指南。 + + * [**在 Linux 中安装 FFmpeg**][2] + + + +### 针对初学者的20多个 FFmpeg 命令 + +FFmpeg 命令的典型语法是: + +``` +ffmpeg [全局选项] {[输入文件选项] -i 输入url地址} ... + {[输出文件选项] 输出url地址} ... +``` + +现在我们将查看一些重要的和有用的 FFmpeg 命令。 + +##### **1\. 获取音频/视频文件信息** + +为显示你的多媒体文件细节,运行: + +``` +$ ffmpeg -i video.mp4 +``` + +**样本输出:** + +``` +ffmpeg version n4.1.3 Copyright (c) 2000-2019 the FFmpeg developers +built with gcc 8.2.1 (GCC) 20181127 +configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3 +libavutil 56. 22.100 / 56. 22.100 +libavcodec 58. 35.100 / 58. 35.100 +libavformat 58. 20.100 / 58. 20.100 +libavdevice 58. 5.100 / 58. 5.100 +libavfilter 7. 40.101 / 7. 40.101 +libswscale 5. 3.100 / 5. 3.100 +libswresample 3. 3.100 / 3. 3.100 +libpostproc 55. 3.100 / 55. 3.100 +Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4': +Metadata: +major_brand : isom +minor_version : 512 +compatible_brands: isomiso2avc1mp41 +encoder : Lavf58.20.100 +Duration: 00:00:28.79, start: 0.000000, bitrate: 454 kb/s +Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 1920x1080 [SAR 1:1 DAR 16:9], 318 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default) +Metadata: +handler_name : ISO Media file produced by Google Inc. Created on: 04/08/2019. +Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) +Metadata: +handler_name : ISO Media file produced by Google Inc. Created on: 04/08/2019. +At least one output file must be specified +``` + +如你在上面的输出中看到的,FFmpeg 显示多媒体文件信息,以及 FFmpeg 细节,例如版本,配置细节,版权标记,构建和库选项等等。 + +如果你不想看 FFmpeg 标语和其它细节,而仅仅想看多媒体文件信息,使用 **-hide_banner** 标示,像下面。 + +``` +$ ffmpeg -i video.mp4 -hide_banner +``` + +**样本输出:** + +![][3] + +使用 FFMpeg 查看音频,视频文件信息。 + +看见了吗?现在,它仅显示多媒体文件细节。 + +** **推荐下载** – [**免费指南:“Spotify 音乐流:非官方指南”**][4] + +##### **2\. 转换视频文件到不同的格式** + +FFmpeg 是强有力的音频和视频转换器,因此,在不同格式之间转换多媒体文件是可能的。以示例说明,转换 **mp4 文件到 avi 文件**,运行: + +``` +$ ffmpeg -i video.mp4 video.avi +``` + +类似地,你可以转换多媒体文件到你选择的任何格式。 + +例如,为转换 youtube **flv** 格式视频为 **mpeg** 格式,运行: + +``` +$ ffmpeg -i video.flv video.mpeg +``` + +如果你想维持你的源视频文件的质量,使用 “-qscale 0” 参数: + +``` +$ ffmpeg -i input.webm -qscale 0 output.mp4 +``` + +为检查 FFmpeg 的支持列表,运行: + +``` +$ ffmpeg -formats +``` + +##### **3\. 转换视频文件到音频文件** + +我转换一个视频文件到音频文件,只需具体指明输出格式,像 .mp3,或 .ogg,或其它任意音频格式。 + +上面的命令将转换 **input.mp4** 视频文件到 **output.mp3** 音频文件。 + +``` +$ ffmpeg -i input.mp4 -vn output.mp3 +``` + +此外,你也可以使用各种各样的音频转换编码选项到输出文件,像下面演示。 + +``` +$ ffmpeg -i input.mp4 -vn -ar 44100 -ac 2 -ab 320 -f mp3 output.mp3 +``` + +在这里, + + * **-vn** – 表明我们已经在输出文件中禁用视频录制。 + * **-ar** – 设置输出文件的音频频率。通常使用的值是22050,44100,48000 Hz。 + * **-ac** – 设置音频通道的数目。 + * **-ab** – 表明音频比特率。 + * **-f** – 输出文件格式。在我们的实例中,它是 mp3 格式。 + + + +##### **4\. 更改视频文件的分辨率** + +如果你想设置一个具体的分辨率到一个视频文件中,你可以使用下面的命令: + +``` +$ ffmpeg -i input.mp4 -filter:v scale=1280:720 -c:a copy output.mp4 +``` + +或, + +``` +$ ffmpeg -i input.mp4 -s 1280x720 -c:a copy output.mp4 +``` + +上面的命令将设置所给定视频文件的分辨率到1280×720。 + +类似地,为转换上面的文件到640×480大小,运行: + +``` +$ ffmpeg -i input.mp4 -filter:v scale=640:480 -c:a copy output.mp4 +``` + +或者, + +``` +$ ffmpeg -i input.mp4 -s 640x480 -c:a copy output.mp4 +``` + +这个技巧将帮助你缩放你的视频文件到较小的显示设备,例如平板电脑和手机。 + +##### **5\. 压缩视频文件** + +减小多媒体文件的大小到较低大小来节省硬件的空间总是一个好主意. + +下面的命令将压缩和减少输出文件的大小。 + +``` +$ ffmpeg -i input.mp4 -vf scale=1280:-1 -c:v libx264 -preset veryslow -crf 24 output.mp4 +``` + +请注意,如果你尝试减小视频文件的大小,你将丢失视频质量。如果 **24** 太有侵略性,你可以降低 **crf** 值到或更低值。 + +你也可以转换编码音频向下一点结果是使其有立体声感,通过包含下面的选项来减小大小。 + +``` +-ac 2 -c:a aac -strict -2 -b:a 128k +``` + +** **推荐下载** – [**免费指南: “PLEX, 一本手册:你的多媒体,具有样式”**][5] + +##### **6\. 压缩音频文件** + +正像压缩视频文件一样,为节省一些磁盘空间,你也可以使用 **-ab** 标示压缩音频文件。 + +例如,你有一个320 kbps 比特率的音频文件。你想通过更改比特率到任意较低的值来压缩它,像下面。 + +``` +$ ffmpeg -i input.mp3 -ab 128 output.mp3 +``` + +各种各样可用的音频比特率列表是: + + 1. 96kbps + 2. 112kbps + 3. 128kbps + 4. 160kbps + 5. 192kbps + 6. 256kbps + 7. 320kbps + + + +##### **7. 从一个视频文件移除音频流** + +如果你不想从一个视频文件中要一个音频,使用 **-an** 标示。 + +``` +$ ffmpeg -i input.mp4 -an output.mp4 +``` + +在这里,‘an’ 表示没有音频录制。 + +上面的命令会撤销所有音频相关的标示,因为我们没有从 input.mp4 中音频操作。 + +##### **8\. 从一个多媒体文件移除视频流** + +类似地,如果你不想要视频流,你可以使用 ‘vn’ 标示从多媒体文件中简单地移除它。vn 代表没有视频录制。换句话说,这个里面转换所给定多媒体文件到音频文件中。 + +下面的命令将从所给定多媒体文件中移除视频。 + +``` +$ ffmpeg -i input.mp4 -vn output.mp3 +``` + +你也可以使用 ‘-ab’ 标示来提出输出文件的比特率,如下面的示例所示。 + +``` +$ ffmpeg -i input.mp4 -vn -ab 320 output.mp3 +``` + +##### **9. 从视频中提取图像 ** + +FFmpeg 的另一个有用的特色是我们可以从一个视频文件中简单地提取图像。这可能是非常有用的,如果你想从一个视频文件中创建一个相册。 + +为从一个视频文件中提取图像,使用下面的命令: + +``` +$ ffmpeg -i input.mp4 -r 1 -f image2 image-%2d.png +``` + +在这里, + + * **-r** – 设置帧速度。即,每秒提取帧到图像的数字。默认值是 **25**。 + * **-f** – 表示输出格式,即,在我们的实例中是图像。 + * **image-%2d.png** – 表明我们如何想命名提取的图像。在这个实例中,命名应该开端,像这样image-01.png,image-02.png,image-03.png 等等。如果你使用 %3d ,那么图像的命名将开始,像 image-001.png,image-002.png 等等。 + + + +##### **10\. 裁剪视频** + +FFMpeg 允许裁剪一个给定的多媒体文件到我们选择的任何范围。 + +裁剪一个视频文件的语法如下给定: + +``` +ffmpeg -i input.mp4 -filter:v "crop=w:h:x:y" output.mp4 +``` + +在这里, + + * **input.mp4** – 源视频文件。 + * **-filter:v** – 表示视频过滤器。 + * **crop** – 表示裁剪过滤器。 + * **w** – 我们想自源视频中来裁剪的矩形的 **宽度** 。 + * **h** – 矩形的高度。 + * **x** – 我们想自源视频中来裁剪的矩形的 **x 坐标** 。 + * **y** – 矩形的 y 坐标。 + + +让我们表达,你想要一个来自视频的**位置(200,150)**,且具有**640像素的宽度**和**480像素的高度**视频, 命令应该是: + +``` +$ ffmpeg -i input.mp4 -filter:v "crop=640:480:200:150" output.mp4 +``` + +请注意,剪切视频将影响质量。除非必要,请勿剪切。 + +##### **11\. 转换一个视频的具体的部分** + +有时,你可能想仅转换视频文件的一个具体的部分到不同的格式。以示例说明,下面的命令将转换所给定视频input.mp4 文件的**第一个50秒**到视频 .avi 格式。 + +``` +$ ffmpeg -i input.mp4 -t 10 output.avi +``` + +在这里,我们以秒具体说明时间。此外,以**hh.mm.ss** 格式具体说明时间也是可接受的。 + +##### **12\. 设置视频的屏幕高宽比** + +你可以使用 **-aspect** 标示设置一个视频文件的屏幕高宽比,像下面。 + +``` +$ ffmpeg -i input.mp4 -aspect 16:9 output.mp4 +``` + +通常使用的 aspect 比例是: + + * 16:9 + * 4:3 + * 16:10 + * 5:4 + * 2:21:1 + * 2:35:1 + * 2:39:1 + + + +##### **13\. 添加海报图像到音频文件** + +你可以添加海报图像到你的文件,以便图像将在播放音频文件时显示。这对托管在视频托管主机或共享网站中的音频文件是有用的。 + +``` +$ ffmpeg -loop 1 -i inputimage.jpg -i inputaudio.mp3 -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest output.mp4 +``` + +##### **14. 使用开始和停止时间剪下一段多媒体文件 + +** + +为剪下一段视频到小块的剪辑,使用开始和停止时间,我们可以使用下面的命令。 + +``` +$ ffmpeg -i input.mp4 -ss 00:00:50 -codec copy -t 50 output.mp4 +``` + +在这里, + + * –s – 表示视频剪辑的开始时间。在我们的示例中,开始时间是第50秒。 + * -t – 表示总的持续时间。 + + + +当你想从一个音频或视频文件剪切一部分,使用开始和结束时间是非常有帮助的 + +类似地,我们可以像下面剪下音频。 + +``` +$ ffmpeg -i audio.mp3 -ss 00:01:54 -to 00:06:53 -c copy output.mp3 +``` + +##### **15\. 分裂视频文件到多个部分** + +一些网站将仅允许你上传一个具体指定大小的视频。在这样的情况下,你可以分裂大的视频文件到多个较小的部分,像下面。 + +``` +$ ffmpeg -i input.mp4 -t 00:00:30 -c copy part1.mp4 -ss 00:00:30 -codec copy part2.mp4 +``` + +在这里, +**-t 00:00:30** 表示从视频的开始到视频的第30秒创建一部分视频。 +**-ss 00:00:30** 为视频的下一部分显示开始时间戳。它意味着第2部分将从第30秒开始,并将持续到原始视频文件的结尾。 + +** **推荐下载** – [**免费指南:“如何开始你自己的成功的博客”**][6] + +##### **16\. 接合或合并多个视频部分到一个** + +FFmpeg 也将接合多个视频部分,并创建一个单个视频文件。 + +创建包含你想接合文件的准确的路径的 **join.txt** 。所有的玩家应该是相同的格式(相同格式)。所有文件的路径应该依次地提到,像下面。 + +``` +file /home/sk/myvideos/part1.mp4 +file /home/sk/myvideos/part2.mp4 +file /home/sk/myvideos/part3.mp4 +file /home/sk/myvideos/part4.mp4 +``` + +现在,接合所有文件,使用命令: + +``` +$ ffmpeg -f concat -i join.txt -c copy output.mp4 +``` + +如果你得到一些像下面的错误; + +``` +[concat @ 0x555fed174cc0] Unsafe file name '/path/to/mp4' +join.txt: Operation not permitted +``` + +添加 **“-safe 0”** : + +``` +$ ffmpeg -f concat -safe 0 -i join.txt -c copy output.mp4 +``` + +上面的命令将接合 part1.mp4,part2.mp4,part3.mp4,和 part4.mp4 文件到一个称为“output.mp4”的单个文件中。 + +##### **17\. 添加字幕到一个视频文件** + +我们可以使用 FFmpeg 来添加字幕到一个视频文件。为你的视频下载正确的字母,并如下所示添加它到你的视频。 + +``` +$ fmpeg -i input.mp4 -i subtitle.srt -map 0 -map 1 -c copy -c:v libx264 -crf 23 -preset veryfast output.mp4 +``` + +##### **18\. 预览或测试视频或音频文件** + +你可能希望通过预览来验证或测试输出的文件是否已经被恰当地转码编码。为完成预览,你可以从你的终端播放它,用命令: + +``` +$ ffplay video.mp4 +``` + +[![][1]][7] + +类似地,你可以测试音频文件,像下面所示。 + +``` +$ ffplay audio.mp3 +``` + +[![][1]][8] + +##### **19\. 增加/减少视频播放速度** + +FFmpeg 允许你调整视频播放速度。 + +为增加视频播放速度,运行: + +``` +$ ffmpeg -i input.mp4 -vf "setpts=0.5*PTS" output.mp4 +``` + +该命令将双倍视频的速度。 + +为降低你的视频速度,你需要使用一个倍数 **大于 1** 。为减少播放速度,运行: + +``` +$ ffmpeg -i input.mp4 -vf "setpts=4.0*PTS" output.mp4 +``` + +##### **20. 创建动画的 GIF + +** + +我们在几乎所有的社交和专业网络上为各种各样的目的使用 GIF 图像。使用 FFmpeg,我们可以简单地和快速地创建动画的视频文件。下面的指南阐释,如何在类 Unix 系统中使用 FFmpeg 和 ImageMagick T创建一个动画的 GIF 文件。 + + * [**在 Linux 中如何创建动画的 GIF**][9] + + + +##### **21.** 从 PDF 文件中创建视频 + +我长年累月的收集很多 PDF 文件,大多数是 Linux 教程,保存在我的平板电脑中。有时我懒得从平板电脑中月度它们。因此,我决定从 PDF 文件中创建一个视频,在一个大屏幕设备(像一台电视机或一台电脑)中观看它们。如果你曾经想知道如何从一批 PDF 文件中制作一个电影,下面的指南将帮助你。. + + * [**在 Linux 中如何从 PDF 文件中创建一个视频**][10] + + + +##### **22\. 获取帮助** + +在这个指南中,我已经覆盖大多数常常使用的 FFmpeg 命令。 它有很多不同的选项来做各种各样的高级功能。为学习更多,参考手册页。 + +``` +$ man ffmpeg +``` + +然后,这就是全部。我希望这个指南将帮助你 FFmpeg 入门。如果你发现这个指南有用,请在你的社交和专业网络上分享它。更多好东西将要来。敬请期待! + +谢谢! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/20-ffmpeg-commands-beginners/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者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/2017/05/FFmpeg-Commands-720x340.png +[2]: https://www.ostechnix.com/install-ffmpeg-linux/ +[3]: http://www.ostechnix.com/wp-content/uploads/2017/05/sk@sk_001.png +[4]: https://ostechnix.tradepub.com/free/w_make141/prgm.cgi +[5]: https://ostechnix.tradepub.com/free/w_make75/prgm.cgi +[6]: https://ostechnix.tradepub.com/free/w_make235/prgm.cgi +[7]: http://www.ostechnix.com/wp-content/uploads/2017/05/Menu_004.png +[8]: http://www.ostechnix.com/wp-content/uploads/2017/05/Menu_005-3.png +[9]: https://www.ostechnix.com/create-animated-gif-ubuntu-16-04/ +[10]: https://www.ostechnix.com/create-video-pdf-files-linux/ From 34ea26e18af0a323db0144bdf280be2ff422e10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sat, 1 Jun 2019 08:09:01 +0800 Subject: [PATCH 0681/1154] Translating MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 我已经翻译这篇文章很久了,已经翻译了大约1/5的样子,看到还没有其他人申请翻译。我就申请翻译了。可能需要翻译的时间很长。英语原文语句很长也很难理解 --- sources/tech/20180902 Learning BASIC Like It-s 1983.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180902 Learning BASIC Like It-s 1983.md b/sources/tech/20180902 Learning BASIC Like It-s 1983.md index 5790ef6e88..83ef0ff982 100644 --- a/sources/tech/20180902 Learning BASIC Like It-s 1983.md +++ b/sources/tech/20180902 Learning BASIC Like It-s 1983.md @@ -1,3 +1,4 @@ +Translating by robsean Learning BASIC Like It's 1983 ====== I was not yet alive in 1983. This is something that I occasionally regret. I am especially sorry that I did not experience the 8-bit computer era as it was happening, because I think the people that first encountered computers when they were relatively simple and constrained have a huge advantage over the rest of us. From 7510343c726bc20192f79bf5326f7d1eb1bfb0e6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Jun 2019 12:36:21 +0800 Subject: [PATCH 0682/1154] PRF:20190520 Zettlr - Markdown Editor for Writers and Researchers.md @geekpi --- ...down Editor for Writers and Researchers.md | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md b/translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md index 3ca9b20403..251d5c4f3c 100644 --- a/translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md +++ b/translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md @@ -1,13 +1,13 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Zettlr – Markdown Editor for Writers and Researchers) [#]: via: (https://itsfoss.com/zettlr-markdown-editor/) [#]: author: (John Paul https://itsfoss.com/author/john/) -Zettlr - 适合作者和研究人员的 Markdown 编辑器 +Zettlr:适合写作者和研究人员的 Markdown 编辑器 ====== 有很多[适用于 Linux 的 Markdown 编辑器][1],并且还在继续增加。问题是,像 [Boostnote][2] 一样,大多数是为编码人员设计的,可能不会受到非技术人员的欢迎。让我们看一个想要替代 Word 和昂贵的文字处理器,适用于非技术人员的 Markdown 编辑器。我们来看看 Zettlr 吧。 @@ -16,34 +16,33 @@ Zettlr - 适合作者和研究人员的 Markdown 编辑器 ![Zettlr Light Mode][3] -我可能在网站上提到过一两次,但我更喜欢用 [Markdown][4] 写下我的所有文档。它易于学习,不会让你与专有文档格式相关联。我还在我的[适合作者的开源工具列表][5]中提到了 Markdown 编辑器。 +我可能在网站上提到过一两次,我更喜欢用 [Markdown][4] 写下我的所有文档。它易于学习,不会让你受困于专有文档格式。我还在我的[适合作者的开源工具列表][5]中提到了 Markdown 编辑器。 -我用过许多 Markdown 编辑器,但是我一直有兴趣尝试新的。最近,我遇到了 Zettlr,一个开源 markdown 编辑器。 +我用过许多 Markdown 编辑器,但是我一直有兴趣尝试新的。最近,我遇到了 Zettlr,一个开源 Markdown 编辑器。 -[Zettlr][6] 是一位名叫 [Hendrik Erz][7] 的德国社会学家/政治理论家创建的。Hendrik 创建了 Zettlr,因为他对目前的文字处理器感到沮丧。他想要可以让他“专注于写作和阅读”的编辑器。 +[Zettlr][6] 是一位名叫 [Hendrik Erz][7] 的德国社会学家/政治理论家创建的。Hendrik 创建了 Zettlr,因为他对目前的文字处理器感到不满意。他想要可以让他“专注于写作和阅读”的编辑器。 -在发现 Markdown 之后,他在不同的操作系统上尝试了几个 Markdown 编辑器。但他们都没有他想要的东西。[根据 Hendrik 的说法][8],“但我不得不意识到没有为高效组织大量文本而写的编辑器。大多数编辑都是由编码人员编写的,因此可以满足工程师和数学家的需求。没有为我这样的社会科学,历史或政治学的学生的编辑器。“ +在发现 Markdown 之后,他在不同的操作系统上尝试了几个 Markdown 编辑器。但它们都没有他想要的东西。[根据 Hendrik 的说法][8],“但我不得不意识到没有为高效组织大量文本而写的编辑器。大多数编辑都是由编码人员编写的,因此可以满足工程师和数学家的需求。没有为我这样的社会科学、历史或政治学的学生的编辑器。“ -So he decided to create his own. In November of 2017, he started to work on Zettlr. 所以他决定创造自己的。2017 年 11 月,他开始编写 Zettlr。 ![Zettlr About][9] #### Zettlr 功能 -Zettlr有许多简洁的功能,包括: +Zettlr 有许多简洁的功能,包括: * 从 [Zotero 数据库][10]导入源并在文档中引用它们   * 使用可选的行屏蔽,让你无打扰地专注于写作   * 支持代码高亮   * 使用标签对信息进行排序 -  * 能够为会话设定写作目标 +  * 能够为该任务设定写作目标   * 查看一段时间的写作统计   * 番茄钟计时器   * 浅色/深色主题   * 使用 [reveal.js][11] 创建演示文稿   * 快速预览文档 -  * 在一个项目文档中搜索 Markdown 文档,并用热图展示文字搜索密度。 +  * 可以在一个项目文件夹中搜索 Markdown 文档,并用热图展示文字搜索密度。   * 将文件导出为 HTML、PDF、ODT、DOC、reStructuredText、LaTex、TXT、Emacs ORG、[TextBundle][12] 和 Textpack   * 将自定义 CSS 添加到你的文档 @@ -69,7 +68,7 @@ Zettlr 有许多我希望我之前选择的编辑器 (ghostwriter) 有的简 正如 Hendrik 在 [Zettlr 网站][8]中所说的那样,“让自己摆脱文字处理器的束缚,看看你的写作过程如何通过身边的技术得到改善!” -如果你觉得 Zettlr 有用,请考虑支持 [Hendrik][19]。正如他在网站上所说,“它是免费的,因为我不相信激烈竞争,早逝的创业文化。我只是想帮忙。“ +如果你觉得 Zettlr 有用,请考虑支持 [Hendrik][19]。正如他在网站上所说,“它是免费的,因为我不相信激烈竞争、早逝的创业文化。我只是想帮忙。” 你有没有用过 Zettlr?你最喜欢的 Markdown 编辑器是什么?请在下面的评论中告诉我们。 @@ -82,7 +81,7 @@ via: https://itsfoss.com/zettlr-markdown-editor/ 作者:[John Paul][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/) 荣誉推出 From 38063eade3e71253b1316f32bf5df13c8bd9eefa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Jun 2019 12:36:55 +0800 Subject: [PATCH 0683/1154] PUB:20190520 Zettlr - Markdown Editor for Writers and Researchers.md @geekpi https://linux.cn/article-10922-1.html --- ...20 Zettlr - Markdown Editor for Writers and Researchers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190520 Zettlr - Markdown Editor for Writers and Researchers.md (98%) diff --git a/translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md b/published/20190520 Zettlr - Markdown Editor for Writers and Researchers.md similarity index 98% rename from translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md rename to published/20190520 Zettlr - Markdown Editor for Writers and Researchers.md index 251d5c4f3c..487c0f0fe3 100644 --- a/translated/tech/20190520 Zettlr - Markdown Editor for Writers and Researchers.md +++ b/published/20190520 Zettlr - Markdown Editor for Writers and Researchers.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10922-1.html) [#]: subject: (Zettlr – Markdown Editor for Writers and Researchers) [#]: via: (https://itsfoss.com/zettlr-markdown-editor/) [#]: author: (John Paul https://itsfoss.com/author/john/) From 81df60efd7076aeee4a18154f393822bc3c21d51 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Jun 2019 12:56:07 +0800 Subject: [PATCH 0684/1154] PRF:20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @way-ww --- ...ll Listed Packages From A File In Linux.md | 80 ++++++++----------- 1 file changed, 34 insertions(+), 46 deletions(-) diff --git a/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md index b825435dcb..a72fc883e9 100644 --- a/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md +++ b/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (way-ww) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Install/Uninstall Listed Packages From A File In Linux?) @@ -10,25 +10,17 @@ 如何在 Linux 上安装/卸载一个文件中列出的软件包? ====== -在某些情况下,你可能想要将一个服务器上的软件包列表安装到另一个服务器上。 +在某些情况下,你可能想要将一个服务器上的软件包列表安装到另一个服务器上。例如,你已经在服务器 A 上安装了 15 个软件包并且这些软件包也需要被安装到服务器 B、服务器 C 上等等。 -例如,你已经在服务器A 上安装了 15 个软件包并且这些软件包也需要被安装到服务器B,服务器C 上等等。 +我们可以手动去安装这些软件但是这将花费大量的时间。你可以手动安装一俩个服务器,但是试想如果你有大概十个服务器呢。在这种情况下你无法手动完成工作,那么怎样才能解决问题呢? -我们可以手动去安装这些软件但是这将花费大量的时间。 - -你可以手动安装一俩个服务器,但是试想如果你有大概十个服务器呢。 - -在这种情况下你无法手动完成工作,那么怎样才能解决问题呢? - -不要担心我们可以帮你摆脱这样的情况和场景。 - -我们在这篇文章中增加了四种方法来克服困难。 +不要担心我们可以帮你摆脱这样的情况和场景。我们在这篇文章中增加了四种方法来克服困难。 我希望这可以帮你解决问题。我已经在 Centos7 和 Ubuntu 18.04 上测试了这些命令。 我也希望这可以在其他发行版上工作。这仅仅需要使用该发行版的官方包管理器命令替代本文中的包管理器命令就行了。 -如果想要 **[检查 Linux 系统上已安装的软件包列表][1]** 请点击链接。 +如果想要 [检查 Linux 系统上已安装的软件包列表][1],请点击链接。 例如,如果你想要在基于 RHEL 系统上创建软件包列表请使用以下步骤。其他发行版也一样。 @@ -53,11 +45,9 @@ apr-util-1.5.2-6.el7.x86_64 apr-1.4.8-3.el7_4.1.x86_64 ``` -### 方法一 : 如何在 Linux 上使用 cat 命令安装文件中列出的包? +### 方法一:如何在 Linux 上使用 cat 命令安装文件中列出的包? -为实现这个目标,我将使用简单明了的第一种方法。 - -为此,创建一个文件并添加上你想要安装的包列表。 +为实现这个目标,我将使用简单明了的第一种方法。为此,创建一个文件并添加上你想要安装的包列表。 出于测试的目的,我们将只添加以下的三个软件包名到文件中。 @@ -69,7 +59,7 @@ mariadb-server nano ``` -只要简单的运行 **[apt 命令][2]** 就能在 Ubuntu/Debian 系统上一次性安装所有的软件包。 +只要简单的运行 [apt 命令][2] 就能在 Ubuntu/Debian 系统上一次性安装所有的软件包。 ``` # apt -y install $(cat /tmp/pack1.txt) @@ -138,20 +128,19 @@ Processing triggers for install-info (6.5.0.dfsg.1-2) ... Processing triggers for man-db (2.8.3-2ubuntu0.1) ... ``` -使用 **[yum 命令][3]** 在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上安装文件中列出的软件包。 - +使用 [yum 命令][3] 在基于 RHEL (如 Centos、RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上安装文件中列出的软件包。 ``` # yum -y install $(cat /tmp/pack1.txt) ``` -使用以命令在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上卸载文件中列出的软件包。 +使用以命令在基于 RHEL (如 Centos、RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上卸载文件中列出的软件包。 ``` # yum -y remove $(cat /tmp/pack1.txt) ``` -使用以下 **[dnf 命令][4]** 在 Fedora 系统上安装文件中列出的软件包。 +使用以下 [dnf 命令][4] 在 Fedora 系统上安装文件中列出的软件包。 ``` # dnf -y install $(cat /tmp/pack1.txt) @@ -163,7 +152,7 @@ Processing triggers for man-db (2.8.3-2ubuntu0.1) ... # dnf -y remove $(cat /tmp/pack1.txt) ``` -使用以下 **[zypper 命令][5]** 在 openSUSE 系统上安装文件中列出的软件包。 +使用以下 [zypper 命令][5] 在 openSUSE 系统上安装文件中列出的软件包。 ``` # zypper -y install $(cat /tmp/pack1.txt) @@ -175,7 +164,7 @@ Processing triggers for man-db (2.8.3-2ubuntu0.1) ... # zypper -y remove $(cat /tmp/pack1.txt) ``` -使用以下 **[pacman 命令][6]** 在基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上安装文件中列出的软件包。 +使用以下 [pacman 命令][6] 在基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上安装文件中列出的软件包。 ``` # pacman -S $(cat /tmp/pack1.txt) @@ -188,36 +177,35 @@ Processing triggers for man-db (2.8.3-2ubuntu0.1) ... # pacman -Rs $(cat /tmp/pack1.txt) ``` -### 方法二 : 如何使用 cat 和 xargs 命令在 Linux 中安装文件中列出的软件包。 +### 方法二:如何使用 cat 和 xargs 命令在 Linux 中安装文件中列出的软件包。 甚至,我更喜欢使用这种方法,因为这是一种非常简单直接的方法。 -使用以下 apt 命令在基于 Debian 的系统 (如 Debian,Ubuntu和Linux Mint) 上安装文件中列出的软件包。 - +使用以下 `apt` 命令在基于 Debian 的系统 (如 Debian、Ubuntu 和 Linux Mint) 上安装文件中列出的软件包。 ``` # cat /tmp/pack1.txt | xargs apt -y install ``` -使用以下 apt 命令 从基于 Debian 的系统 (如 Debian,Ubuntu和Linux Mint) 上卸载文件中列出的软件包。 +使用以下 `apt` 命令 从基于 Debian 的系统 (如 Debian、Ubuntu 和 Linux Mint) 上卸载文件中列出的软件包。 ``` # cat /tmp/pack1.txt | xargs apt -y remove ``` -使用以下 yum 命令在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上安装文件中列出的软件包。 +使用以下 `yum` 命令在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上安装文件中列出的软件包。 ``` # cat /tmp/pack1.txt | xargs yum -y install ``` -使用以命令从基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上卸载文件中列出的软件包。 +使用以命令从基于 RHEL (如 Centos、RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上卸载文件中列出的软件包。 ``` # cat /tmp/pack1.txt | xargs yum -y remove ``` -使用以下 dnf 命令在 Fedora 系统上安装文件中列出的软件包。 +使用以下 `dnf` 命令在 Fedora 系统上安装文件中列出的软件包。 ``` # cat /tmp/pack1.txt | xargs dnf -y install @@ -229,7 +217,7 @@ Processing triggers for man-db (2.8.3-2ubuntu0.1) ... # cat /tmp/pack1.txt | xargs dnf -y remove ``` -使用以下 zypper 命令在 openSUSE 系统上安装文件中列出的软件包。 +使用以下 `zypper` 命令在 openSUSE 系统上安装文件中列出的软件包。 ``` @@ -242,7 +230,7 @@ Processing triggers for man-db (2.8.3-2ubuntu0.1) ... # cat /tmp/pack1.txt | xargs zypper -y remove ``` -使用以下 pacman 命令在基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上安装文件中列出的软件包。 +使用以下 `pacman` 命令在基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上安装文件中列出的软件包。 ``` # cat /tmp/pack1.txt | xargs pacman -S @@ -254,17 +242,17 @@ Processing triggers for man-db (2.8.3-2ubuntu0.1) ... # cat /tmp/pack1.txt | xargs pacman -Rs ``` -### 方法三 : 如何使用 For Loop 在 Linux 上安装文件中列出的软件包? -我们也可以使用 For 循环命令来实现此目的。 +### 方法三 : 如何使用 For 循环在 Linux 上安装文件中列出的软件包 -安装批量包可以使用以下一条 For 循环的命令。 +我们也可以使用 `for` 循环命令来实现此目的。 + +安装批量包可以使用以下一条 `for` 循环的命令。 ``` # for pack in `cat /tmp/pack1.txt` ; do apt -y install $i; done ``` -要使用 shell 脚本安装批量包,请使用以下 For 循环。 - +要使用 shell 脚本安装批量包,请使用以下 `for` 循环。 ``` # vi /opt/scripts/bulk-package-install.sh @@ -275,7 +263,7 @@ do apt -y remove $pack done ``` -为 bulk-package-install.sh 设置可执行权限。 +为 `bulk-package-install.sh` 设置可执行权限。 ``` # chmod + bulk-package-install.sh @@ -287,17 +275,17 @@ done # sh bulk-package-install.sh ``` -### 方法四 : 如何使用 While 循环在 Linux 上安装文件中列出的软件包。 +### 方法四:如何使用 While 循环在 Linux 上安装文件中列出的软件包 -我们也可以使用 While 循环命令来实现目的。 +我们也可以使用 `while` 循环命令来实现目的。 -安装批量包可以使用以下一条 While 循环的命令。 +安装批量包可以使用以下一条 `while` 循环的命令。 ``` # file="/tmp/pack1.txt"; while read -r pack; do apt -y install $pack; done < "$file" ``` -要使用 shell 脚本安装批量包,请使用以下 While 循环。 +要使用 shell 脚本安装批量包,请使用以下 `while` 循环。 ``` # vi /opt/scripts/bulk-package-install.sh @@ -309,7 +297,7 @@ do apt -y remove $pack done < "$file" ``` -为 bulk-package-install.sh 设置可执行权限。 +为 `bulk-package-install.sh` 设置可执行权限。 ``` # chmod + bulk-package-install.sh @@ -328,13 +316,13 @@ via: https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-fi 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[way-ww](https://github.com/way-ww) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/check-installed-packages-in-rhel-centos-fedora-debian-ubuntu-opensuse-arch-linux/ +[1]: https://linux.cn/article-10116-1.html [2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ [3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ [4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ From 20a380fc7e7811477d9fdee0f7638513ac7d78a3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Jun 2019 12:58:22 +0800 Subject: [PATCH 0685/1154] PUB:20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @way-ww https://linux.cn/article-10923-1.html --- ... Install-Uninstall Listed Packages From A File In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md (99%) diff --git a/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/published/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md similarity index 99% rename from translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md rename to published/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md index a72fc883e9..4960672f5a 100644 --- a/translated/tech/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md +++ b/published/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (way-ww) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10923-1.html) [#]: subject: (How To Install/Uninstall Listed Packages From A File In Linux?) [#]: via: (https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From ffc4681426cf54124acecd99d7a40a29612c4ad9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Jun 2019 14:41:25 +0800 Subject: [PATCH 0686/1154] PRF:20190527 Dockly - Manage Docker Containers From Terminal.md @geekpi --- ... Manage Docker Containers From Terminal.md | 104 ++++++++---------- 1 file changed, 44 insertions(+), 60 deletions(-) diff --git a/translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md b/translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md index d5ac3339f4..45d1fbb4d9 100644 --- a/translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md +++ b/translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md @@ -1,28 +1,26 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Dockly – Manage Docker Containers From Terminal) [#]: via: (https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/) [#]: author: (sk https://www.ostechnix.com/author/sk/) -Dockly - 从终端管理 Docker 容器 +Dockly:从终端管理 Docker 容器 ====== ![][1] -几天前,我们发布了一篇指南,其中涵盖了[**开始使用 Docker**][2] 时需要了解的几乎所有细节。在该指南中,我们向你展示了如何详细创建和管理 Docker 容器。还有一些非官方工具可用于管理 Docker 容器。如果你看过我们以前的文字,你可能会看到两个基于网络的工具,[**“Portainer”**][3] 和 [**“PiCluster”**][4]。它们都使得 Docker 管理任务在 Web 浏览器中变得更加容易和简单。今天,我遇到了另一个名为 **“Dockly”** 的 Docker 管理工具。 +几天前,我们发布了一篇指南,其中涵盖了[开始使用 Docker][2] 时需要了解的几乎所有细节。在该指南中,我们向你展示了如何详细创建和管理 Docker 容器。还有一些可用于管理 Docker 容器的非官方工具。如果你看过我们以前的文章,你可能会看到两个基于 Web 的工具,[Portainer][3] 和 [PiCluster][4]。它们都使得 Docker 管理任务在 Web 浏览器中变得更加容易和简单。今天,我遇到了另一个名为 Dockly 的 Docker 管理工具。 -与上面的工具不同,Dockly 是一个 TUI(文本界面)程序,用于在类 Unix 系统中从终端管理 Docker 容器和服务。它是使用 **NodeJS** 编写的免费开源工具。在本简要指南中,我们将了解如何安装 Dockly 以及如何从命令行管理 Docker 容器。 +与上面的工具不同,Dockly 是一个 TUI(文本界面)程序,用于在类 Unix 系统中从终端管理 Docker 容器和服务。它是使用 NodeJS 编写的自由开源工具。在本简要指南中,我们将了解如何安装 Dockly 以及如何从命令行管理 Docker 容器。 ### 安装 Dockly 确保已在 Linux 上安装了 NodeJS。如果尚未安装,请参阅以下指南。 - * [**如何在 Linux 上安装 NodeJS**][5] - - +* [如何在 Linux 上安装 NodeJS][5] 安装 NodeJS 后,运行以下命令安装 Dockly: @@ -42,97 +40,83 @@ Dockly 将通过 unix 套接字自动连接到你的本机 docker 守护进程 ![][6] -使用 Dockly 管理 Docker 容器 +*使用 Dockly 管理 Docker 容器* 正如你在上面的截图中看到的,Dockly 在顶部显示了运行容器的以下信息: - * 容器 ID, -  * 容器名称, -  * Docker 镜像, -  * 命令, -  * 运行中容器的状态, -  * 状态。 - - +* 容器 ID, +* 容器名称, +* Docker 镜像, +* 命令, +* 运行中容器的状态, +* 状态。 在右上角,你将看到容器的 CPU 和内存利用率。使用向上/向下箭头键在容器之间移动。 在底部,有少量的键盘快捷键来执行各种 Docker 管理任务。以下是目前可用的键盘快捷键列表: - * **=** - 刷新 Dockly 界面, -  * **/** - 搜索容器列表视图, -  * **i** - 显示有关当前所选容器或服务的信息, -  * **回车** - 显示当前容器或服务的日志, -  * **v** - 在容器和服务视图之间切换, -  * **l** - 在选定的容器上启动 /bin/bash 会话, -  * **r** - 重启选定的容器, -  * **s** - 停止选定的容器, -  * **h** - 显示帮助窗口, -  * **q** - 退出 Dockly。 +* `=` - 刷新 Dockly 界面, +* `/` - 搜索容器列表视图, +* `i` - 显示有关当前所选容器或服务的信息, +* `回车` - 显示当前容器或服务的日志, +* `v` - 在容器和服务视图之间切换, +* `l` - 在选定的容器上启动 `/bin/bash` 会话, +* `r` - 重启选定的容器, +* `s` - 停止选定的容器, +* `h` - 显示帮助窗口, +* `q` - 退出 Dockly。 +#### 查看容器的信息 - -##### **查看容器的信息** - -使用向上/向下箭头选择一个容器,然后按 **“i”** 以显示所选容器的信息。 +使用向上/向下箭头选择一个容器,然后按 `i` 以显示所选容器的信息。 ![][7] -查看容器的信息 +*查看容器的信息* -##### 重启容器 +#### 重启容器 -如果你想随时重启容器,只需选择它并按 **“r”** 即可重新启动。 +如果你想随时重启容器,只需选择它并按 `r` 即可重新启动。 ![][8] -重启 Docker 容器 +*重启 Docker 容器* -##### 停止/删除容器和镜像 +#### 停止/删除容器和镜像 -如果不再需要容器,我们可以立即停止和/或删除一个或所有容器。为此,请按 **“m”** 打开**菜单**。 +如果不再需要容器,我们可以立即停止和/或删除一个或所有容器。为此,请按 `m` 打开菜单。 ![][9] -停止,删除 Docker 容器和镜像 +*停止,删除 Docker 容器和镜像* 在这里,你可以执行以下操作。 - * 停止所有 Docker 容器, -  * 删除选定的容器, -  * 删除所有容器, -  * 删除所有 Docker 镜像等。 +* 停止所有 Docker 容器, +* 删除选定的容器, +* 删除所有容器, +* 删除所有 Docker 镜像等。 +#### 显示 Dockly 帮助部分 - -##### 显示 Dockly 帮助部分 - -如果你有任何疑问,只需按 **“h”** 即可打开帮助部分。 +如果你有任何疑问,只需按 `h` 即可打开帮助部分。 ![][10] -Dockly 帮助 +*Dockly 帮助* 有关更多详细信息,请参考最后给出的官方 GitHub 页面。 就是这些了。希望这篇文章有用。如果你一直在使用 Docker 容器,请试试 Dockly,看它是否有帮助。 -* * * +建议阅读: -**建议阅读:** - - * **[如何自动更新正在运行的 Docker 容器][11]** - * **[ctop -一个 Linux 容器的命令行监控工具][12]** - - - -* * * - -**资源:** - - * [**Dockly 的 GitHub 仓库**][13] + * [如何自动更新正在运行的 Docker 容器][11] + * [ctop:一个 Linux 容器的命令行监控工具][12] +资源: + * [Dockly 的 GitHub 仓库][13] -------------------------------------------------------------------------------- @@ -141,7 +125,7 @@ via: https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/ 作者:[sk][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/) 荣誉推出 From f340f26ebf1db32f3f08fb4613aaf8177a5c76d7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Jun 2019 14:44:52 +0800 Subject: [PATCH 0687/1154] PUB:20190527 Dockly - Manage Docker Containers From Terminal.md @geekpi https://linux.cn/article-10925-1.html --- ...90527 Dockly - Manage Docker Containers From Terminal.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20190527 Dockly - Manage Docker Containers From Terminal.md (97%) diff --git a/translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md b/published/20190527 Dockly - Manage Docker Containers From Terminal.md similarity index 97% rename from translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md rename to published/20190527 Dockly - Manage Docker Containers From Terminal.md index 45d1fbb4d9..44e9dc2c21 100644 --- a/translated/tech/20190527 Dockly - Manage Docker Containers From Terminal.md +++ b/published/20190527 Dockly - Manage Docker Containers From Terminal.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10925-1.html) [#]: subject: (Dockly – Manage Docker Containers From Terminal) [#]: via: (https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/) [#]: author: (sk https://www.ostechnix.com/author/sk/) @@ -10,7 +10,7 @@ Dockly:从终端管理 Docker 容器 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/201906/01/144422bfwx1e7fqx1ee11x.jpg) 几天前,我们发布了一篇指南,其中涵盖了[开始使用 Docker][2] 时需要了解的几乎所有细节。在该指南中,我们向你展示了如何详细创建和管理 Docker 容器。还有一些可用于管理 Docker 容器的非官方工具。如果你看过我们以前的文章,你可能会看到两个基于 Web 的工具,[Portainer][3] 和 [PiCluster][4]。它们都使得 Docker 管理任务在 Web 浏览器中变得更加容易和简单。今天,我遇到了另一个名为 Dockly 的 Docker 管理工具。 From ba75f23d3d0494d7ab44fe765de8e2e815f70282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Sat, 1 Jun 2019 14:59:45 +0800 Subject: [PATCH 0688/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20180629 100 Best Ubuntu Apps.md | 1186 ---------------- .../tech/20180629 100 Best Ubuntu Apps.md | 1195 +++++++++++++++++ 2 files changed, 1195 insertions(+), 1186 deletions(-) delete mode 100644 sources/tech/20180629 100 Best Ubuntu Apps.md create mode 100644 translated/tech/20180629 100 Best Ubuntu Apps.md diff --git a/sources/tech/20180629 100 Best Ubuntu Apps.md b/sources/tech/20180629 100 Best Ubuntu Apps.md deleted file mode 100644 index 4c50ffa756..0000000000 --- a/sources/tech/20180629 100 Best Ubuntu Apps.md +++ /dev/null @@ -1,1186 +0,0 @@ -warmfrog translating - -100 Best Ubuntu Apps -====== - -Earlier this year we have published the list of [20 Best Ubuntu Applications for 2018][1] which can be very useful to many users. Now we are almost in the second half of 2018, so today we are going to have a look at 100 best applications for Ubuntu which you will find very useful. - -![100 Best Ubuntu Apps][2] - -Many users who have recently switched to Ubuntu from Microsoft Windows or any other operating system face the dilemma of finding best alternative to application software they have been using for years on their previous OS. Ubuntu has thousands of free to use and open-source application software’s that perform way better than many paid software’s on Windows and other OS. - -Following list features many application software in various categories, so that you can find best application which best matched to your requirements. - -### **1\. Google Chrome Browser** - -Almost all the Linux distributions feature Mozilla Firefox web browser by default and it is a tough competitor to Google Chrome. But Chrome has its own advantages over Firefox like Chrome gives you direct access to your Google account from where you can sync bookmarks, browser history, extensions, etc. from Chrome browser on other operating systems and mobile phones. - -![Chrome][3] - -Google Chrome features up-to-date Flash player for Linux which is not the case with other web browsers on Linux including Mozilla Firefox and Opera web browser. If you continuously use Chrome on Windows then it is best choice to use it on Linux too. - -### 2\. **Steam** - -Gaming on Linux is a real deal now, which was a distant dream few years ago. In 2013, Valve announced Steam gaming client for Linux and everything has changed since then. Earlier users were hesitant to switch to Linux from Windows just because they would not be able to play their favourite games on Ubuntu but that is not the case now. - -![Steam][4] - -Some users might find installing Steam on Linux tricky but it worth all your efforts as thousands of Steam games are available for Linux. Some popular high-end games like Counter Strike: Global Offensive, Hitman, Dota 2 are available for Linux, you just need to make sure you have minimum hardware required to play these games. - -``` -$ sudo add-apt-repository multiverse - -$ sudo apt-get update - -$ sudo apt-get install steam -``` - -### **3\. WordPress Desktop Client** - -Yes you read it correct, WordPress has its dedicated desktop client for Ubuntu from where you can manage your WordPress sites. You can also write and design separately on desktop client without need for switching browser tabs. - -![][5] - -If you have websites backed by WordPress then this desktop client is must have application for you as you can also keep track of all the WordPress notifications in one single window. You can also check stats for performance of posts on website. Desktop client is available in Ubuntu Software Centre from where you can download and install it. - -### **4\. VLC Media Player** - -VLC is a very popular cross-platform and open-source media player which is also available for Ubuntu. What makes VLC a best media player is that it can play videos in all the Audio and Video formats available on planet without any issue. - -![][6] - -VLC has a slick user interface which is very easy to use and apart from that it offers lot of features such as online video streaming, audio and video customization, etc. - -``` -$ sudo add-apt-repository ppa:videolan/master-daily -$ sudo apt update -$ sudo apt-get install vlc qtwayland5 -``` - -### **5\. Atom Text Editor** - -Having developed by Github, Atom is a free and open-source text editor which can also be used as Integrated Development Environment (IDE) for coding and editing in major programming languages. Atom developers claim it to be a completely hackable text editor for 21st Century. - -![][7] - -Atom Text Editor has one of the best user interfaces and it is a feature rich text editor with offerings like auto-completion, syntax highlighting and support of extensions and plug-ins. - -``` -$ sudo add-apt-repository ppa:webupd8team/atom -$ sudo apt-get update -$ sudo apt-get install atom -``` - -### **6\. GIMP Photo Editor** - -GIMP (GNU Image Manipulation Programme) is free and open-source photo editor for Ubuntu. It is arguably a best alternative to Adobe Photoshop on Windows. If you have been continuously using Adobe Photoshop and finding it difficult to get used to GIMP, then you can customize GIMP to look very similar to Photoshop. - -![][8] - -GIMP is a feature rich Photo editor and you can always use additional features by installing extensions and plug-ins anytime. - -``` -$ sudo apt-get install gimp -``` - -### **7\. Google Play Music Desktop Player** - -Google Play Music Desktop Player is an open-source music player which is replica of Google Play Music or you can say it’s better than that. Google always lacked a desktop music client but this third-party app fills the void perfectly. - -![][9] - -Like you can see in above screenshot, its interface is second to none in terms of look and feel. You just need to sign in into Google account and then it will import all your music and favorites into this desktop client. You can download installation files from its official [website][10] and install it using Software Center. - -### **8\. Franz** - -Franz is an instant messaging client that combines chat and messaging services into one application. It is one of the modern instant messaging platforms and it supports Facebook Messenger, WhatsApp, Telegram, HipChat, WeChat, Google Hangouts, Skype integration under one single application. - -![][11] - -Franz is complete messaging platform which you can use for business as well to manage mass customer service. To install Franz you need to download installation package from its [website][12] and open it using Software Center. - -### **9\. Synaptic Package Manager** - -Synaptic Package Manager is one of the must have tools on Ubuntu because it works for graphical interface for ‘apt-get’ command which we usually use to install apps on Ubuntu using Terminal. It gives tough competition to default app stores on various Linux distros. - -![][13] - -Synaptic comes with very simple user interface which is very fast and easy to use as compared to other app stores. On left-hand side you can browse various apps in different categories from where you can easily install and uninstall apps. - -``` -$ sudo apt-get install synaptic -``` - -### **10\. Skype** - -Skype is a very popular cross-platform video calling application which is now also available for Linux as a Snap app. Skype is an instant messaging application which offers features like voice and video calls, desktop screen sharing, etc. - -![][14] - -Skype has an excellent user interface which very similar to desktop client on Windows and it is very easy to use. It could be very useful app for many switchers from Windows. - -``` -$ sudo snap install skype -``` - -### **13\. VirtualBox** - -VirtualBox is a cross-platform virtualization software application developed by Oracle Corporation. If you love trying out new operating systems then VirtualBox is the must have Ubuntu application for you. You can tryout Linux, Mac inside Windows Operating System or Windows and Mac inside Linux. - -![][15] - -What VB actually does is it lets you run guest operating system on host operating system virtually. It creates virtual hard drive and installs guest OS on it. You can download and install VB directly from Ubuntu Software Center. - -### **12\. Unity Tweak Tool** - -Unity Tweak Tool (Gnome Tweak Tool) is must have tool for every Linux user because it gives user ability to customize desktop according to your need. You can try new GTK themes, set up desktop hot corners, customize icon set, tweak unity launcher, etc. - -![][16] - -Unity Tweak Tool can be very useful to user as it has everything covered right from the basic to advanced configurations. - -``` -$ sudo apt-get install unity-tweak-tool -``` - -### **13\. Ubuntu Cleaner** - -Ubuntu Cleaner is a system maintenance tool especially designed to remove packages that are no longer useful, remove unnecessary apps and clean-up browser caches. Ubuntu Cleaner has very simple user interface which is very easy to use. - -![][17] - -Ubuntu Cleaner is one of the best alternatives to BleachBit which is also a decent cleaning tool available for Linux distros. - -``` -$ sudo add-apt-repository ppa:gerardpuig/ppa -$ sudo apt-get update -$ sudo apt-get install ubuntu-cleaner -``` - -### 14\. Visual Studio Code - -Visual Studio Code is code editor which you will find very similar to Atom Text Editor and Sublime Text if you have already used them. Visual Studio Code proves to be very good educational tool as it explains everything from HTML tags to syntax in programming. - -![][18] - -Visual Studio comes with Git integration out of the box and it has excellent user interface which you will find very similar to likes of Atom Text Editor and Sublime Text. You can download and install it from Ubuntu Software Center. - -### **15\. Corebird** - -If you are looking for desktop client where you can use your Twitter then Corebird Twitter Client is the app you are looking for. It is arguably best Twitter client available for Linux distros and it offers features very similar to Twitter app on your mobile phone. - -![][19] - -Corebird Twitter Client also gives notifications whenever someone likes and retweets your tweet or messages you. You can also add multiple Twitter accounts on this client. - -``` -$ sudo snap install corebird -``` - -### **16\. Pixbuf** - -Pixbuf is a desktop client from Pixbuf photo community hub which lets you upload, share and sale your photos. It supports photo sharing to social media networks like Facebook, Pinterest, Instagram, Twitter, etc. and photography services including Flickr, 500px and Youpic. - -![][20] - -Pixbuf offers features like analytics which gives you stats about clicks, retweets, repins on your photo, scheduled posts, dedicated iOS extension. It also has mobile app, so that you can always be connected with your Pixbuf account from anywhere. Pixbuf is available for download in Ubuntu Software Center as a snap package. - -### **17\. Clementine Music Player** - -Clementine is a cross-platform music player and a good competitor to Rhythmbox which is default music player on Ubuntu. It is fast and easy to use music player thanks to its user friendly interface. It supports audio playback in all the major audio file formats. - -![][21] - -Apart from playing music from local library you can also listen to online radio from Spotify, SKY.fm, Soundcloud, etc. It also offers other features like smart and dynamic playlists, syncing music from cloud storages like Dropbox, Google Drive, etc. - -``` -$ sudo add-apt-repository ppa:me-davidsansome/clementine -$ sudo apt-get update -$ sudo apt-get install clementine -``` - -### **18\. Blender** - -Blender is free and open-source 3D creation application software which you can use to create 3D printed models, animated films, video games, etc. It comes with integrated game engine out of the box which you can use to develop and test video games. - -![blender][22] - -Blender has catchy user interface which is easy to use and it includes features like built-in render engine, digital sculpturing, simulation tool, animation tools and many more. It is one of the best applications you will ever find for Ubuntu considering it’s free and features it offers. - -### **19\. Audacity** - -Audacity is an open-source audio editing application which you can use to record, edit audio files. You can record audio from various inputs like microphone, electric guitar, etc. It also gives ability to edit and trim audio clips according to your need. - -![][23] - -Recently Audacity released with new features for Ubuntu which includes theme improvements, zoom toggle command, etc. Apart from these it offers features like various audio effects including noise reduction and many more. - -``` -$ sudo add-apt-repository ppa:ubuntuhandbook1/audacity -$ sudo apt-get update -$ sudo apt-get install audacity -``` - -### **20\. Vim** - -Vim is an Integrated Development Environment which you can use as standalone application or command line interface for programming in various major programming languages like Python. - -![][24] - -Most of the programmers prefer coding in Vim because it is fast and highly customizable IDE. Initially you might find it difficult to use but you will quickly get used to it. - -``` -$ sudo apt-get install vim -``` - -### **21\. Inkscape** - -Inkscape is an open-source and cross-platform vector graphics editor which you will find very much similar to Corel Draw and Adobe Illustrator. Using it you can create and edit vector graphics such as charts, logos, diagrams, illustrations, etc. - -![][25] - -Inkscape uses Scalable Vector Graphics (SVG) and an open XML-based W3C standard as a primary format. It supports various formats including JPEG, PNG, GIF, PDF, AI (Adobe Illustrator Format), VSD, etc. - -``` -$ sudo add-apt-repository ppa:inkscape.dev/stable -$ sudo apt-get update -$ sudo apt-get install inkscape -``` - -### **22\. Shotcut** - -Shotcut is a free, open-source and cross-platform video editing application developed by Meltytech, LLC on the MLT Multimedia Framework. It is one of the most powerful video editors you will ever find for Linux distros as it supports all the major audio, video and image formats. - -![][26] - -It gives ability to edit multiple tracks with various file formats using non-linear video editing. It also comes with support for 4K video resolutions and features like various audio and video filters, tone generator, audio mixing and many others. - -``` -snap install shotcut -- classic -``` - -### **23\. SimpleScreenRecorder** - -SimpleScreenRecorder is a free and lightweight screen video recorder for Ubuntu. This screen recorder can be very useful tool for you if you are a YouTube creator or application developer. - -![][27] - -It can capture a video/audio record of desktop screen or record video games directly. You can set video resolution, frame rate, etc. before starting the screen recording. It has simple user interface which you will find very easy to use. - -``` -$ sudo add-apt-repository ppa:marten-baert/simplescreenrecorder -$ sudo apt-get update -$ sudo apt-get install simplescreenrecorder -``` - -### **24\. Telegram** - -Telegram is a cloud-based instant messaging and VoIP platform which has got lot of popularity in recent years. It is an open-source and cross-platform messenger where user can send messages, share videos, photos, audio and other files. - -![][28] - -Some of the notable features in Telegram are secrete chats, voice messages, bots, telescope for video messages, live locations and social login. Privacy and security is at highest priority in Telegram, so all messages you send and receive are end-to-end encrypted. - -``` -``` -$ sudo snap install telegram-desktop - -### **25\. ClamTk** - -As we know viruses meant to harm Windows PC cannot do any harm to Ubuntu but it is always prone to get infected by some mails from Windows PC containing harmful files. So it is safe to have some antivirus applications on Linux too. - -![][29] - -ClamTk is a lightweight malware scanner which scans files and folders on your system and cleans if any harmful files are found. ClamTk is available as a Snap package and can be downloaded from Ubuntu Software Center. - -### **26\. MailSpring** - -MailSpring earlier known as Nylas Mail or Nylas N1 is an open-source email client. It saves all the mails locally on computer so that you can access them anytime you need. It features advanced search which uses AND and OR operations so that you can search for mails based on different parameters. - -![][30] - -MailSpring comes with excellent user interface which you will find only on handful of other mail clients. Privacy and security, scheduler, contact manager, calendar are some of the features MailSpring offers. - -### **27\. PyCharm** - -PyCharm is one of my favorite Python IDEs after Vim because it has slick user interface with lot of extensions and plug-in support. Basically it comes in two editions, one is community edition which is free and open-source and other is professional edition which is paid one. - -![][31] - -PyCharm is highly customizable IDE and sports features such as error highlighting, code analysis, integrated unit testing and Python debugger, etc. PyCharm is the preferred IDE by most of the Python programmers and developers. - -### **28\. Caffeine** - -Imagine you are watching something on YouTube or reading a news article and suddenly Ubuntu locks your screen, I know that is very annoying. It happens with many of us, so Caffeine is the tool that will help you block the Ubuntu lock screen or screensaver. - -![][32] - -Caffeine Inhibitor is lightweight tool, it adds icon on notification bar from where you can activate or deactivate it easily. No additional setting needs to be done in order to use this tool. - -``` -$ sudo add-apt-repository ppa:eugenesan/ppa -$ sudo apt-get update -$ sudo apt-get install caffeine -y -``` - -### **29\. Etcher USB Image Writer** - -Etcher is an open-source USB Image Writer developed by resin.io. It is a cross-platform application which helps you burn image files like ZIP, ISO, IMG to USB storage. If you always try out new OS then Etcher is the must have tool for you as it is easy to use and reliable. - -![][33] - -Etcher has clean user interface that guides you through process of burning image file to USB drive or SD card in three easy steps. Steps involve selecting Image file, selecting USB drive and finally flash (writes files to USB drive). You can download and install Etcher from its [website][34]. - -### **30\. Neofetch** - -Neofetch is a cool system information tool that gives you all the information about your system by running “neofetch” command in Terminal. It is cool tool to have because it gives you information about desktop environment, kernel version, bash version and GTK theme you are running. - -![][35] - -As compared to other system information tools Nefetch is highly customizable tool. You can perform various customizations using command line. - -``` -$ sudo add-apt-repository ppa:dawidd0811/neofetch -$ sudo apt-get update -$ sudo apt-get update install neofetch -``` - -### 31\. Liferea - -Liferea (Linux Feed Reader) is a free and open-source news aggregator for online news feeds. It is a fast and easy to use new aggregator that supports various formats such as RSS/RDF, Atom, etc. - -![][36] -Liferea comes with sync support with TinyTinyRSS out of the box and it gives you an ability to read feeds in offline mode. It is one of the best feed readers you will find for Linux in terms of reliability and flexibility. - -``` -$ sudo add-apt-repository ppa:ubuntuhandbook1/apps -$ sudo apt-get update -$ sudo apt-get install liferea -``` - -### 32\. Shutter - -It is easy to take screenshots in Ubuntu but when it comes to edit screenshots Shutter is the must have application for you. It helps you capture, edit and share screenshots easily. Using Shutter’s selector tool you can select particular part of your screen to take screenshot. - -![][37] - -Shutter is a feature-rich screenshot tool which offers features like adding effects to screenshot, draw lines, etc. It also gives you option to upload your screenshot to various image hosting sites. You can directly download and install Shutter from Software Center. - -### 33\. Weather - -Weather is a small application which gives you real-time weather information for your city or any other location in the world. It is simple and lightweight tool which gives you detailed forecast of up to 7 days and hourly details for current and next day. - -![][38] - -It integrates with GNOME shell to give you information about current weather conditions at recently searched locations. It has minimalist user interface which works smoothly on minimum hardware requirement. - -### 34\. Ramme - -Ramme is cool unofficial Instagram desktop client which gives you feel of Instagram mobile phone app. It is an Electron-based client so it replicates Instagram app and offers features like theme customization, etc. - -![][39] - -But due to Instagram’s API restrictions you can’t upload image using Ramme client but you can always go through Instagram feed, like and comment on posts, message friends. You can download Ramme installation files from[Github.][40] - -### **35\. Thunderbird** - -Thunderbird is an open-source email client which is also a default email client in most of the Linux distributions. Despite parting ways with Mozilla in 2017, Thunderbird is still very popular and best email client on Linux platform. It comes with features like spam filtering, IMAP and POP email syncing, calendar support, address book integration and many other features out of the box. - -![][41] - -It is a cross-platform email client with full community support across all supported platforms. You can always change its look and feel thanks to its highly customizable nature. - -### **36\. Pidgin** - -Pidgin is an instant messaging client where you can login into different instant messaging networks under single window. You can login to instant messaging networks like Google Talk, XMPP, AIM, Bonjour, etc. - -![][42] - -Pidgin has all the features you can expect in an instant messenger and you can always enhance its performance by installing additional plug-ins. - -``` -``` -$ sudo apt-get install pidgin - -### **37\. Krita** - -Krita is a free and open-source digital painting, editing and animation application developed by KDE. It has excellent user interface with everything placed perfectly so that you can easily find the tool you need. - -![][43] - -It uses OpenGL canvas which boosts Krita’s performance and it offers many features like different painting tools, animation tools, vector tools, layers and masks and many more. Krita is available in Ubuntu Software Center, you can easily download it from there. - -### **38\. Dropbox** - -Dropbox is stand-out player in cloud storage and its Linux clients works really well on Ubuntu once installed properly. While Google Drive comes out of the box on Ubuntu 16.04 LTS and later, Dropbox is still a preferred cloud storage tool on Linux in terms of features it offers. - -![][44] -It always works in background and back up new files from your system to cloud storage, syncs files continuously between your computer and its cloud storage. - -``` -$ sudo apt-get install nautilus-dropbox -``` - -### 39\. Kodi - -Kodi formerly known as Xbox Media Center (XBMC) is an open-source media player. You can play music, videos, podcasts and video games both in online and offline mode. This software was first developed for first generation of Xbox gaming console and then slowly ported to personal computers. - -![][45] - -Kodi has very impressive video interface which is fast and powerful. It is highly customizable media player and by installing additional plug-ins you can access online streaming services like Pandora, Spotify, Amazon Prime Video, Netflix and YouTube. - -### **40\. Spotify** - -Spotify is one of the best online media streaming sites. It provides music, podcast and video streaming services both on free and paid subscription basis. Earlier Spotify was not supported on Linux but now it has its own fully functional desktop client for Ubuntu. - -![][46] - -Alongside Google Play Music Desktop Player, Spotify is must have media player for you. You just need to login to your Spotify account to access your favorite online content from anywhere. - -### 41\. Brackets - -Brackets is an open-source text editor developed by Adobe. It can be used for web development and design in web technologies such as HTML, CSS and JavaScript. It sports live preview mode which is great feature to have as it can get real-time view of whatever the changes you make in script. - -![][47] - -It is one of the modern text editors on Ubuntu and has slick user interface which takes web development task to new level. It also offers features like inline editor and supports for popular extensions like Emmet, Beautify, Git, File Icons, etc. - -### 42\. Bitwarden - -Account safety is serious concern now as we can see rise in security breaches in which users passwords are stolen and important data being compromised. So Bitwarden is recommended tool for you which stores all your account logins and passwords safe and secure at one place. - -![][48] - -Bitwarden uses AES-256 bit encryption technique to store all the login details and only user has access to his data. It also helps you to create strong passwords which are less likely to be hacked. - -### 43\. Terminator - -Terminator is an open-source terminal emulator programmed and developed in Java. It is a cross-platform emulator which lets you have privilege of multiple terminals in one single window which is not the case in Linux default terminal emulator. - -![][49] - -Other stand-out feature in Terminator includes automatic logging, drag and drop, intelligent vertical and horizontal scrolling, etc. - -``` -$ sudo apt-get install terminator -``` - -### 44\. Yak Yak - -Yak Yak is an open-source unofficial desktop client for Google Hangouts messenger. It could be good alternative to Microsoft’s Skype as it comes with bunch of some amazing features out of the box. You can enable desktop notifications, language preferences, and works on minimal memory and power requirements. - -![][50] - -Yak Yak comes with all the features you would expect in any instant messaging app such as typing indicator, drag and drop media files, and audio/video calling. - -### 45\. **Thonny** - -Thonny is a simple and lightweight IDE especially designed for beginners in programming. If you are new to programming then this is the must have IDE for you because it lets you learn while programming in Python. - -![][51] - -Thonny is also great tool for debugging as it supports live variables during debugging, apart from this it offers features like separate windows for executing function call, simple user interface, etc. - -``` -$ sudo apt-get install thonny -``` - -### **46\. Font Manager** - -Font Manager is a lightweight tool for managing, adding or removing fonts on your Ubuntu system. It is specially built for Gnome desktop environment, users don’t having idea about managing fonts using command line will find this tool very useful. - -![][52] - -Gtk+ Font Manager is not meant to be for professional users, it has simple user interface which you will find very easy to navigate. You just need to download font files from internet and add them using Font Manager. - -$ sudo add-apt-repository ppa:font-manager/staging -$ sudo apt-get update -$ sudo apt-get install font-manager - -### **47\. Atril Document Viewer** - -Atril is a simple document viewer which supports file formats like Portable Document Format (PDF), PostScript (PS), Encapsulated PostScript (EPS), DJVU and DVI. Atril comes bundled with MATE desktop environment and it is identical to Evince which is default document on the most of the Linux distros. - -![][53] - -Atril has simple and lightweight user interface which is highly customizable and offers features like search, bookmarks and UI includes thumbnails on the left-hand side. - -``` -$ sudo apt-get install atril -``` - -### **48\. Notepadqq** - -If you have ever used Notepad++ on Windows and looking for similar program on Linux then don’t worry developers have ported it to Linux as Notepadqq. It is a simple yet powerful text editor which you can use for daily tasks or programming in various languages. - -![][54] - -Despite being a simple text editor it has some amazing features like you can set theme between dark and light color scheme, multiple selection, regular expression search and real-time highlighting. - -``` -$ sudo add-apt-repository ppa:notpadqq-team/notepadqq -$ sudo apt-get update -$ sudo apt-get install notepadqq -``` - -### **49\. Amarok** - -Amarok is an open-source music player developed under KDE projetct. It has an intuitive interface which makes you feel home so you can discover your favorite music easily. Besides Clementine, Amarok is very good choice to have when you are looking for perfect music player for Ubuntu. - -![][55] - -Some of the top features in Amarok include intelligent playlist support, integration support for online services like MP3tunes, Last.fm, Magnatune, etc. - -### **50\. Cheese** - -Cheese is a Linux default webcam application which can be useful to you in some video chat or instant messaging applications. Apart from that you can also use this app to take photos and videos with fancy effects. - -![][56] - -It also sports burst mode which lets you take multiple snaps in quick succession and option to share your photos with friends and family. Cheese come pre-installed with most of the Linux distros but you can also download and install it from Software Center. - -### **51\. MyPaint** - -MyPaint is a free and open-source raster graphics editor which focuses on digital painting rather than image manipulation and post processing. It is cross-platform application and more or less similar to Corel Painter. - -![][57] - -MyPaint could be good alternative to those who use Microsoft Paint application on Windows. It has simple user interface which is fast and powerful. MyPaint is available is Software Center for download. - -### **52\. PlayOnLinux** - -PlayOnLinux is a front-end for WINE emulator which allows you to run Windows applications on Linux. You just need to install Windows applications and game on WINE then you can easily launch applications and games using PlayOnLinux. - -![][58] - -### **53\. Akregator** - -Akregator is a default RSS reader for KDE Plasma Environment developed under KDE project. It has simple user interface and comes with KDE’s Konqueror browser so that you don’t need to switch between apps while reading news feeds. - -![][59] - -Akregator also offers features like desktop notifications, automatic feeds, etc. It is one of the best feed readers you will find for across most of the Linux distros. - -### **54\. Brave** - -Brave is an open-source web browser which blocks ads and trackers so that you can browse your content fast and safely. What it actually does is that it pays to websites and YouTubers on behalf of you. If you prefer contributing to websites and YouTubers rather than seeing advertisements then this browser is for you. - -![][60] - -This is a new concept and could be good browser for those who prefer safe browsing without compromising important data on internet. - -### **55\. Bitcoin Core** - -Bitcoin Core is an official Bitcoin client which is highly secure and reliable. It keeps track of all your transactions and makes sure all transactions are valid. It restricts Bitcoin miners and banks from taking full control of your Bitcoin wallet. - -![][61] - -Bitcoin Core also offers other important features like, private keys backup, cold storage, security notifications. - -``` -$ sudo add-apt-repository ppa:bitcoin/bitcoin -$ sudo apt-get update -$ sudo apt-get install bitcoin-qt -``` - -### **56\. Speedy Duplicate Finder** - -Speedy Duplicate Finder is a cross-platform file finder which helps you find duplicate files on your system and free-up disk space. It is a smart tool which searches for duplicate files on entire hard disk and also features smart filter which helps you find file by file type, extension or size. - -![][62] - -It has a simple and clean user interface which is very easy to handle. As soon as you download it from Software Center you are good to go with disk space clean-up. - -### **57\. Zulip** - -Zulip is a free and open-source group chat application which was acquired by Dropbox. It is written in Python and uses PostgreSQL database. It was designed and developed to be a good alternative to other chat applications like Slack and HipChat. - -![][63] - -Zulip is a feature-rich application with features such as drag and drop files, group chats, private messaging, image previews and many more. It also supports integration with likes of Github, JIRA, Sentry, and hundreds of other services. - -### **58\. Okular** - -Okular is a cross-platform document viewer developed by KDE for KDE desktop environment. It is a simple document viewer and supports file formats like Portable Document Format (PDF), PostScript, DjVu, Microsoft Compiled HTML help, and many other major file formats. - -![][64] - -Okular is one of the best document viewers you should try on Ubuntu as it offers features like commenting on PDF documents, drawing lines, highlighting and much more. You can also extract text from PDF document to text file. - -### **59\. FocusWriter** - -FocusWriter is a distraction-free word processor which hides your desktop screen so that you can only focus on writing. Like you can see in the screenshot below whole Ubuntu screen is hidden, it’s just you and your word processor. But you can always access Ubuntu screen whenever you need it by just moving your mouse cursor to the edges of the screen. - -![][65] - -It is a lightweight word processor with support for file formats like TXT, RTF and ODT files. It also offers fully customizable user interface and features like timers and alarms, daily goals, sound effects and support for translation into 20 languages. - -### **60\. Guake** - -Guake is a cool drop-down terminal for GNOME Desktop Environment. Guake comes in a flash whenever you need it and disappears as soon as your task is completed. You just need to click F12 button to launch or exit it so launching Guake is way faster than launching new Terminal window. - -![][66] - -Guake is a feature-rich terminal with features like support for multiple tabs, ability to save your terminal content to file in few clicks, and fully customizable user interface. - -``` -$ sudo apt-get install guake -``` - -### **61\. KDE Connect** - -KDE Connect is an awesome application on Ubuntu and I would have loved to list this application much higher in this marathon article but competition is intense. Anyways KDE Connect helps you get your Android smartphone notifications directly on Ubuntu desktop. - -![][67] - -With KDE Connect you can do whole lot of other things like check your phones battery level, exchange files between computer and Android phone, clipboard sync, send SMS, and you can also use your phone as wireless mouse or keyboard. - -``` -$ sudo add-apt-repository ppa:webupd8team/indicator-kedeconnect -$ sudo apt-get update -$ sudo apt-get install kdeconnect indicator-kdeconnect -``` - -### **62\. CopyQ** - -CopyQ is a simple but very useful clipboard manager which stores content of the system clipboard whenever any changes you make so that you can search and restore it back whenever you need. It is a great tool to have as it supports text, images, HTML and other formats. - -![][68] - -CopyQ comes pre-loaded with features like drag and drop, copy/paste, edit, remove, sort, create, etc. It also supports integration with text editors like Vim, so it could be very useful tool if you are a programmer. - -``` -$ sudo add-apt-repository ppa:hluk/copyq -$ sudo apt-get update -$ sudo apt-get install copyq -``` - -### **63\. Tilix** - -Tilix is feature-rich advanced GTK3 tiling terminal emulator. If you uses GNOME desktop environment then you’re going to love Tilix as it follows GNOME Human Interface Guidelines. What Tilix emulator offers different than default terminal emulators on most of the Linux distros is it gives you ability to split terminal window into multiple terminal panes. - -![][69] - -Tilix offers features like custom links, image support, multiple panes, drag and drop, persistent layout and many more. It also has support for keyboard shortcuts and you can customize shortcuts from the Preferences settings according to your need. - -``` -$ sudo add-apt-repository ppa:webupd8team/terminix -$ sudo apt-get update -$ sudo apt-get install tilix -``` - -### **64\. Anbox** - -Anbox is an Android emulator which lets you install and run Android apps on your Linux system. It is free and open-source Android emulator that executes Android runtime environment by using Linux Containers. It uses latest Linux technologies and Android releases so that you can run any Android app like any other native application. - -![][70] - -Anbox is one of the modern and feature-rich emulators and offers features like no limit for application use, powerful user interface, and seamless integration with host operating system. - -First you need to install kernel modules. - -``` -$ sudo add-apt-repository ppa:morphis/anbox-support -$ sudo apt-get update -$ sudo apt install anbox-modules-dkms Now install Anbox using snap -$ snap install --devmode -- beta anbox -``` - -### **65\. OpenShot** - -OpenShot is the best open-source video editor you will find for Linux distros. It is a cross-platform video editor which is very easy to use without any compromise with its performance. It supports all the major audio, video and image formats. - -![][71] - -OpenShot has clean user interface and offers features like drag and drop, clip resizing, scaling, trimming, snapping, real-time previews, audio mixing and editing and many other features. - -``` -$ sudo add-apt-repository ppa:openshot.developers/ppa -$ sudo apt-get update -$ sudo apt-get install openshot -qt -``` - -### **66\. Plank** - -If you are looking for cool and simple dock for your Ubuntu desktop then Plank should be #1 choice for you. It is perfect dock and you don’t need to make any tweaks after installation but if you want to, then it has built-in preferences panel where you can customize themes, dock size and position. - -![][72] - -Despite being a simple dock, Plank offers features like item rearrangement by simple drag and drop, pinned and running apps icon, transparent theme support. - -``` -$ sudo add-apt-repository ppa:ricotz/docky -$ sudo apt-get update -$ sudo apt-get install plank -``` - -### **67\. Filezilla** - -Filezilla is a free and cross-platform FTP application which sports FileZilla client and server. It lets you transfer files using FTP and encrypted FTP like FTPS and SFTP and supports IPv6 internet protocol. - -![][73] - -It is simple file transfer application with features like drag and drop, support for various languages used worldwide, powerful user interface for multitasking, control and configures transfer speed and many other features. - -### **68\. Stacer** - -Stacer is an open-source system diagnostic tool and optimizer developed using Electron development framework. It has an excellent user interface and you can clean cache memory, start-up applications, uninstall apps that are no longer needed, monitor background system processes. - -![][74] - -It also lets you check disk, memory and CPU usage and also gives real-time stats of downloads and uploads. It looks like a tough competitor to Ubuntu cleaner but both have unique features that separate them apart. - -``` -$ sudo add-apt-repository ppa:oguzhaninan/stacer -$ sudo apt-get update -$ sudo apt-get install stacer -``` - -### **69\. 4K Video Downloader** - -4K Video Downloader is simple video downloading tool which you can use to download videos, playlists, channels from Vimeo, Facebook, YouTube and other online video streaming sites. It supports downloading YouTube playlists and channels in MP4, MKV, M4A, 3GP and many other video/audio file formats. - -![][75] - -4K Video Downloader is not as simple as you would think, apart from normal video downloads it supports 3D and 360 degree video downloading. It also offers features like in-app proxy setup and direct transfer to iTunes. You can download it from [here][76]. - -### 70\. **Qalculate** - -Qalculate is multi-purpose, cross-platform desktop calculator which is simple but very powerful calculator. It can be used for solving complicated maths problems and equations, currency conversions, and many other daily calculations. - -![][77] - -It has an excellent user interface and offers features such as customizable functions, unit calculations, symbolic calculations, arithmetic, plotting and many other functions you will find in any scientific calculator. - -### **71\. Hiri** - -Hiri is a cross-platform email client developed in Python programming language. It has slick user interface and it can be a good alternative to Microsoft Outlook in terms of features and services offered. This is great email client that can be used for sending and receiving emails, managing contacts, calendars and tasks. - -![][78] - -It is a feature-rich email client that offers features like integrated task manager, email synchronization, email rating, email filtering and many more. - -``` -$ sudo snap install hiri -``` - -### **72\. Sublime Text** - -Sublime Text is a cross-platform source code editor programmed in C++ and Python. It has Python Application Programming Interface (API) and supports all the major programming and markup languages. It is simple and lightweight text editor which can be used as IDE with features like auto-completion, syntax highlighting, split editing, etc. - -![][79] - -Some additional features in this text editor include Goto anything, Goto definition, multiple selections, command palette and fully customizable user interface. - -``` -$ sudo apt-get install sublime-text -``` - -### **73\. TeXstudio** - -TeXstudio is an integrated writing environment for creating and editing LaTex documents. It is an open-source editor which offers features like syntax highlighting, integrated viewer, interactive spelling checker, code folding, drag and drop, etc. - -![][80] - -It is a cross-platform editor and has very simple, lightweight user interface which is easy to use. It ships in with integration for BibTex and BibLatex bibliographies managers and also integrated PDF viewer. You can download TeXstudio installation package from its [website][81] or Ubuntu Software Center. - -### **74\. QtQR** - -QtQR is a Qt based application that lets you create and read QR codes in Ubuntu. It is developed in Python and Qt and has simple and lightweight user interface. You can encode website URL, email, text, SMS, etc. and you can also decode barcode using webcam camera. - -![][82] - -QtQR could prove to be useful tool to have if you generally deal with product sales and services because I don’t think we have any other similar tool to QtQR which requires minimal hardware to function smoothly. - -``` -$ sudo add-apt-repository ppa: qr-tools-developers/qr-tools-stable -$ sudo apt-get update -$ sudo apt-get install qtqr -``` - -### **75\. Kontact** - -Kontact is an integrated personal information manager (PIM) developed by KDE for KDE desktop environment. It is all-in-one software suite that integrates KMail, KOrganizer and KAddressBook into a single user interface from where you can manage all your mails, contacts, schedules, etc. - -![][83] - -It could be very good alternative to Microsoft Outlook as it is fast and highly configurable information manager. It has very good user interface which you will find very easy to use. - -``` -$ sudo apt-get install kontact -``` - -### **76\. NitroShare** - -NitroShare is a cross-platform, open-source network file sharing application. It lets you easily share files between multiple operating systems local network. It is a simple yet powerful application and it automatically detects other devices running NitroShare on local network. - -![][84] - -File transfer speed is what makes NitroShare a stand-out file sharing application as it achieves gigabit speed on capable hardware. There is no need for additional configuration required, you can start file transfer as soon as you install it. - -``` -$ sudo apt-add-repository ppa:george-edison55/nitroshare -$ sudo apt-get update -$ sudo apt-get install nitroshare -``` - -### **77\. Konversation** - -Konversation is an open-source Internet Relay Chat (IRC) client developed for KDE desktop environment. It gives speedy access to Freenode network’s channels where you can find support for most distributions. - -![][85] - -It is simple chat client with features like support for IPv6 connection, SSL server support, bookmarks, on-screen notifications, UTF-8 detection, and additional themes. It has easy to use GUI which is highly configurable. - -``` -$ sudo apt-get install konversation -``` - -### **78\. Discord** - -If you’re hardcore gamer and play online games frequently then I have a great application for you. Discord which is free Voice over Internet Protocol (VoIP) application especially designed for online gamers around the world. It is a cross-platform application and can be used for text and audio chats. - -![][86] - -Discord is very popular VoIP application gaming community and as it is completely free application, it is very good competitor to likes of Skype, Ventrilo and Teamspeak. It also offers features like crystal clear voice quality, modern text chat where you can share images, videos and links. - -### **79\. QuiteRSS** - -QuiteRSS is an open-source news aggregator for RSS and Atom news feeds. It is cross-platform feed reader written in Qt and C++. It has simple user interface which you can tweak in either classic or newspaper mode. It comes integrated with webkit browser out of the box so that you can perform all the tasks under single window. - -![][87] - -QuiteRSS comes with features such as content blocking, automatic scheduled feeds, import/export OPML, system tray integration and many other features you could expect in any feed reader. - -``` -$ sudo apt-get install quiterss -``` - -### **80\. MPV Media Player** - -MPV is a free and open-source media player based on MPlayer and MPlayer 2. It has simple user interface where user just needs to drag and drop audio/video files to play them as there is no option to add media files on GUI. - -![][88] - -One of the things about MPV is that it can play 4K videos effortlessly which is not the case with other media players on Linux distros. It also gives user ability to play videos from online video streaming sites including YouTube and Dailymotion. - -``` -$ sudo add-apt-repository ppa:mc3man/mpv-tests -$ sudo apt-get update -$ sudo apt-get install -y mpv -``` - -### **81\. Plume Creator** - -If you’re a writer then Plume Creator is must have application for you because you will not find other app for Ubuntu with privileges like Plume Creator. Writing and editing stories, chapters is tedious task and Plume Creator will ease this task for you with the help of some amazing tools it has to offer. - -![][89] - -It is an open-source application with minimal user interface which you could find confusing in the beginning but you will get used to it in some time. It offers features like edit notes, synopses, export in HTML and ODT formats support, and rich text editing. - -``` -$ sudo apt-get install plume-creator -``` - -### **82\. Chromium Web Browser** - -Chromium is an open-source web browser developed and distributed by Google. Chromium is very identical to Google Chrome web browser in terms of appearance and features. It is a lightweight and fast web browser with minimalist user interface. - -![][90] - -If you use Google Chrome regularly on Windows and looking for similar browser for Linux then Chromium is the best browser for you as you can login into your Google account to access all your Google services including Gmail. - -### **83\. Simple Weather Indicator** - -Simple Weather Indicator is an open-source weather indicator app developed in Python. It automatically detects your location and shows you weather information like temperature, possibility of rain, humidity, wind speed and visibility. - -![][91] - -Weather indicator comes with configurable options such as location detection, temperature SI unit, location visibility on/off, etc. It is cool app to have which adjusts with your desktop comfortably. - -### **84\. SpeedCrunch** - -SpeedCrunch is a fast and high-precision scientific calculator. It comes preloaded with math functions, user-defined functions, complex numbers and unit conversions support. It has simple user interface which is easy to use. - -![][92] - -This scientific calculator has some amazing features like result preview, syntax highlighting and auto-completion. It is a cross-platform calculator with multi-language support. - -### **85\. Scribus** - -Scribus is a free and open-source desktop publishing application that lets you create posters, magazines and books. It is a cross-platform application based on Qt toolkit and released under GNU general public license. It is a professional application with features like CMYK and ICC color management, Python based scripting engine, and PDF creation. - -![][93] - -Scribus comes with decent user interface which is easy to use and works effortlessly on systems with low hardware. It could be downloaded and installed from Software Center on all the latest Linux distros. - -### **86.** **Cura** - -Cura is an open-source 3D printing application developed by David Braam. Ultimaker Cura is the most popular software in 3D printing world and used by millions of users worldwide. It follows 3 step 3D printing model: Design, Prepare and Print. - -![][94] - -It is a feature-rich 3D printing application with seamless integration support for CAD plug-ins and add-ons. It is very simple and easy to use tool, novice artists can start right away. It supports major file formats like STL, 3MF and OBJ file formats. - -### **87\. Nomacs** - -Nomacs is an open-source, cross-platform image viewer which is supports all the major image formats including RAW and psd images. It has ability to browse images in zip or Microsoft Office files and extract them to a directory. - -![][95] - -Nomacs has very simple user interface with image thumbnails at the top and it offers some basic image manipulation features like crop, resize, rotate, color correction, etc. - -``` -$ sudo add-apt-repository ppa:nomacs/stable -$ sudo apt-get update -$ sudo apt-get install nomacs -``` - -### **88\. BitTicker** - -BitTicker is a live bitcoin-USDT Ticker for Ubuntu. It is a simple tool that connects to bittrex.com market and retrieves the latest price for BTC-USDT and display Ubuntu clock on system tray. - -![][96] - -It is simple but very useful too if you invest in Bitcoin regularly and have to study price fluctuations regulary. - -### **89\. Organize My Files** - -Organize My Files is cross-platform one click file organizer and it is available in Ubuntu as a snap package. It is a simple but powerful tool that will help you find unorganized files in a simple click and take them under control. - -![][97] - -It has intuitive user interface which is powerful and fast. It offers features such as auto organizing, recursive organizing, smart filters and multi folders organizing. - -### **90\. GnuCash** - -GnuCash is financial accounting software licensed under GNU general public license for free usage. It is an ideal software for personal and small business accounting. It has simple user interface which allows you to keep track of bank accounts, stocks, income and expenses. - -![][98] - -GnuCash implements double-entry bookkeeping system and based on professional accounting principle to ensure balanced books and accurate reports. - -### **91\. Calibre** - -Calibre is a cross-platform, open-source solution to all your e-book needs. It is a simple e-book organizer that offers features like displaying, creating, editing e-books, organizing existing e-books into virtual libraries, syncing and many more. - -![][99] - -Calibre also helps you convert e-books into whichever format you need and send them to your e-book reading device. Calibre is a very good tool to have if you regularly read and manage e-books. - -### **92\. MATE Dictionary** - -MATE Dictionary is a simple dictionary basically developed for MATE desktop environment. You just need to type the word and then this dictionary will display the meaning and references for it. - -![][100] - -It is simple and lightweight online dictionary with minimalist user interface. - -### **93\. Converseen** - -Converseen is a free cross-platform batch image processing application that lets you convert, edit, resize, rotate and flip large number of images with a single mouse click. It offers features like renaming bunch of images using prefix/suffix, extract image from a Windows icon file, etc. - -![][101] - -It has very good user interface which is easy to use even if you are a novice user. It can also convert entire PDF file into collection of images. - -### **94\. Tiled Map Editor** - -Tiled is a free software level map editor which you can use to edit the maps in various projections such as orthogonal, isometric and hexagonal. This tool can be very useful for game developers during game engine development cycle. - -![][102] - -Tiled is a versatile map editor which lets you create power boost positions, map layouts, collision areas, and enemy positions. It saves all the data in tmx format. - -### **95.** **Qmmp** - -Qmmp is a free and open-source audio player developed in Qt and C++. It is a cross-platform audio player with user interface very similar to Winamp. It has simple and intuitive user interface, Winamp skins can be used instead of default UI. - -![][103] - -It offers features such as automatic album cover fetching, multiple artists support, additional plug-ins and add-ons support and other features similar to Winamp. - -``` -$ sudo add-apt-repository ppa:forkotov02/ppa -$ sudo apt-get update -$ sudo apt-get install qmmp qmmp-q4 qmmp-plugin-pack-qt4 -``` - -### **96\. Arora** - -Arora is free and open-source web browser which offers features like dedicated download manager, bookmarks, privacy mode and tabbed browsing. - -![][104] - -Arora web browser is developed by Benjamin C. Meyer and it is popular among Linux users for its lightweight nature and flexibility. - -### **97\. XnSketch** - -XnSketch is a cool application for Ubuntu that will help you transform your photos into cartoon or sketch images in few clicks. It sports 18 different effects such as black strokes, white strokes, pencil sketch and others. - -![][105] - -It has an excellent user interface which you will find easy to use. Some additional features in XnSketch include opacity and edge strength adjustment, contrast, brightness and saturation adjustment. - -### **98\. Geany** - -Geany is a simple and lightweight text editor which works like an Integrated Development Environment (IDE). It is a cross-platform text editor and supports all the major programming languages including Python, C++, LaTex, Pascal, C#, etc. - -![][106] - -Geany has simple user interface which resembles to programming editors like Notepad++. It offers IDE like features such as code navigation, auto-completion, syntax highlighting, and extensions support. - -``` -$ sudo apt-get install geany -``` - -### **99\. Mumble** - -Mumble is another Voice over Internet Protocol application very similar to Discord. Mumble is also basically designed for online gamers and uses client-server architecture for end-to-end chat. Voice quality is very good on Mumble and it offers end-to-end encryption to ensure privacy. - -![][107] - -Mumble is an open-source application and features very simple user interface which is easy to use. Mumble is available for download in Ubuntu Software Center. - -``` -$ sudo apt-get install mumble-server -``` - -### **100\. Deluge** - -Deluge is a cross-platform and lightweight BitTorrent client that can be used for downloading files on Ubuntu. BitTorrent client come bundled with many Linux distros but Deluge is the best BitTorrent client which has simple user interface which is easy to use. - -![][108] - -Deluge comes with all the features you will find in BitTorrent clients but one feature that stands out is it gives user ability to access the client from other devices as well so that you can download files to your computer even if you are not at home. - -``` -$ sudo add-apt-repository ppa:deluge-team/ppa -$ sudo apt-get update -$ sudo apt-get install deluge -``` - -So these are my picks for best 100 applications for Ubuntu in 2018 which you should try. All the applications listed here are tested on Ubuntu 18.04 and will definitely work on older versions too. Feel free to share your view about the article at [@LinuxHint][109] and [@SwapTirthakar][110]. - --------------------------------------------------------------------------------- - -via: https://linuxhint.com/100_best_ubuntu_apps/ - -作者:[Swapnil Tirthakar][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://linuxhint.com/author/swapnil/ -[1]:https://linuxhint.com/applications-2018-ubuntu/ -[2]:https://linuxhint.com/wp-content/uploads/2018/06/100-Best-Ubuntu-Apps.png -[3]:https://linuxhint.com/wp-content/uploads/2018/06/Chrome.png -[4]:https://linuxhint.com/wp-content/uploads/2018/06/Steam.png -[5]:https://linuxhint.com/wp-content/uploads/2018/06/Wordpress.png -[6]:https://linuxhint.com/wp-content/uploads/2018/06/VLC.png -[7]:https://linuxhint.com/wp-content/uploads/2018/06/Atom-Text-Editor.png -[8]:https://linuxhint.com/wp-content/uploads/2018/06/GIMP.png -[9]:https://linuxhint.com/wp-content/uploads/2018/06/Google-Play.png -[10]:https://www.googleplaymusicdesktopplayer.com/ -[11]:https://linuxhint.com/wp-content/uploads/2018/06/Franz.png -[12]:https://meetfranz.com/#download -[13]:https://linuxhint.com/wp-content/uploads/2018/06/Synaptic.png -[14]:https://linuxhint.com/wp-content/uploads/2018/06/Skype.png -[15]:https://linuxhint.com/wp-content/uploads/2018/06/VirtualBox.png -[16]:https://linuxhint.com/wp-content/uploads/2018/06/Unity-Tweak-Tool.png -[17]:https://linuxhint.com/wp-content/uploads/2018/06/Ubuntu-Cleaner.png -[18]:https://linuxhint.com/wp-content/uploads/2018/06/Visual-Studio-Code.png -[19]:https://linuxhint.com/wp-content/uploads/2018/06/Corebird.png -[20]:https://linuxhint.com/wp-content/uploads/2018/06/Pixbuf.png -[21]:https://linuxhint.com/wp-content/uploads/2018/06/Clementine.png -[22]:https://linuxhint.com/wp-content/uploads/2016/06/blender.jpg -[23]:https://linuxhint.com/wp-content/uploads/2018/06/Audacity.png -[24]:https://linuxhint.com/wp-content/uploads/2018/06/Vim.png -[25]:https://linuxhint.com/wp-content/uploads/2018/06/Inkscape-1.png -[26]:https://linuxhint.com/wp-content/uploads/2018/06/ShotCut.png -[27]:https://linuxhint.com/wp-content/uploads/2018/06/Simple-Screen-Recorder.png -[28]:https://linuxhint.com/wp-content/uploads/2018/06/Telegram.png -[29]:https://linuxhint.com/wp-content/uploads/2018/06/ClamTk.png -[30]:https://linuxhint.com/wp-content/uploads/2018/06/Mailspring.png -[31]:https://linuxhint.com/wp-content/uploads/2018/06/PyCharm.png -[32]:https://linuxhint.com/wp-content/uploads/2018/06/Caffeine.png -[33]:https://linuxhint.com/wp-content/uploads/2018/06/Etcher.png -[34]:https://etcher.io/ -[35]:https://linuxhint.com/wp-content/uploads/2018/06/Neofetch.png -[36]:https://linuxhint.com/wp-content/uploads/2018/06/Liferea.png -[37]:https://linuxhint.com/wp-content/uploads/2018/06/Shutter.png -[38]:https://linuxhint.com/wp-content/uploads/2018/06/Weather.png -[39]:https://linuxhint.com/wp-content/uploads/2018/06/Ramme.png -[40]:https://github.com/terkelg/ramme/releases -[41]:https://linuxhint.com/wp-content/uploads/2018/06/Thunderbird.png -[42]:https://linuxhint.com/wp-content/uploads/2018/06/Pidgin.png -[43]:https://linuxhint.com/wp-content/uploads/2018/06/Krita.png -[44]:https://linuxhint.com/wp-content/uploads/2018/06/Dropbox.png -[45]:https://linuxhint.com/wp-content/uploads/2018/06/kodi.png -[46]:https://linuxhint.com/wp-content/uploads/2018/06/Spotify.png -[47]:https://linuxhint.com/wp-content/uploads/2018/06/Brackets.png -[48]:https://linuxhint.com/wp-content/uploads/2018/06/Bitwarden.png -[49]:https://linuxhint.com/wp-content/uploads/2018/06/Terminator.png -[50]:https://linuxhint.com/wp-content/uploads/2018/06/Yak-Yak.png -[51]:https://linuxhint.com/wp-content/uploads/2018/06/Thonny.png -[52]:https://linuxhint.com/wp-content/uploads/2018/06/Font-Manager.png -[53]:https://linuxhint.com/wp-content/uploads/2018/06/Atril.png -[54]:https://linuxhint.com/wp-content/uploads/2018/06/Notepadqq.png -[55]:https://linuxhint.com/wp-content/uploads/2018/06/Amarok.png -[56]:https://linuxhint.com/wp-content/uploads/2018/06/Cheese.png -[57]:https://linuxhint.com/wp-content/uploads/2018/06/MyPaint.png -[58]:https://linuxhint.com/wp-content/uploads/2018/06/PlayOnLinux.png -[59]:https://linuxhint.com/wp-content/uploads/2018/06/Akregator.png -[60]:https://linuxhint.com/wp-content/uploads/2018/06/Brave.png -[61]:https://linuxhint.com/wp-content/uploads/2018/06/Bitcoin-Core.png -[62]:https://linuxhint.com/wp-content/uploads/2018/06/Speedy-Duplicate-Finder.png -[63]:https://linuxhint.com/wp-content/uploads/2018/06/Zulip.png -[64]:https://linuxhint.com/wp-content/uploads/2018/06/Okular.png -[65]:https://linuxhint.com/wp-content/uploads/2018/06/Focus-Writer.png -[66]:https://linuxhint.com/wp-content/uploads/2018/06/Guake.png -[67]:https://linuxhint.com/wp-content/uploads/2018/06/KDE-Connect.png -[68]:https://linuxhint.com/wp-content/uploads/2018/06/CopyQ.png -[69]:https://linuxhint.com/wp-content/uploads/2018/06/Tilix.png -[70]:https://linuxhint.com/wp-content/uploads/2018/06/Anbox.png -[71]:https://linuxhint.com/wp-content/uploads/2018/06/OpenShot.png -[72]:https://linuxhint.com/wp-content/uploads/2018/06/Plank.png -[73]:https://linuxhint.com/wp-content/uploads/2018/06/FileZilla.png -[74]:https://linuxhint.com/wp-content/uploads/2018/06/Stacer.png -[75]:https://linuxhint.com/wp-content/uploads/2018/06/4K-Video-Downloader.png -[76]:https://www.4kdownload.com/download -[77]:https://linuxhint.com/wp-content/uploads/2018/06/Qalculate.png -[78]:https://linuxhint.com/wp-content/uploads/2018/06/Hiri.png -[79]:https://linuxhint.com/wp-content/uploads/2018/06/Sublime-text.png -[80]:https://linuxhint.com/wp-content/uploads/2018/06/TeXstudio.png -[81]:https://www.texstudio.org/ -[82]:https://linuxhint.com/wp-content/uploads/2018/06/QtQR.png -[83]:https://linuxhint.com/wp-content/uploads/2018/06/Kontact.png -[84]:https://linuxhint.com/wp-content/uploads/2018/06/Nitro-Share.png -[85]:https://linuxhint.com/wp-content/uploads/2018/06/Konversation.png -[86]:https://linuxhint.com/wp-content/uploads/2018/06/Discord.png -[87]:https://linuxhint.com/wp-content/uploads/2018/06/QuiteRSS.png -[88]:https://linuxhint.com/wp-content/uploads/2018/06/MPU-Media-Player.png -[89]:https://linuxhint.com/wp-content/uploads/2018/06/Plume-Creator.png -[90]:https://linuxhint.com/wp-content/uploads/2018/06/Chromium.png -[91]:https://linuxhint.com/wp-content/uploads/2018/06/Simple-Weather-Indicator.png -[92]:https://linuxhint.com/wp-content/uploads/2018/06/SpeedCrunch.png -[93]:https://linuxhint.com/wp-content/uploads/2018/06/Scribus.png -[94]:https://linuxhint.com/wp-content/uploads/2018/06/Cura.png -[95]:https://linuxhint.com/wp-content/uploads/2018/06/Nomacs.png -[96]:https://linuxhint.com/wp-content/uploads/2018/06/Bit-Ticker-1.png -[97]:https://linuxhint.com/wp-content/uploads/2018/06/Organize-My-Files.png -[98]:https://linuxhint.com/wp-content/uploads/2018/06/GNU-Cash.png -[99]:https://linuxhint.com/wp-content/uploads/2018/06/Calibre.png -[100]:https://linuxhint.com/wp-content/uploads/2018/06/MATE-Dictionary.png -[101]:https://linuxhint.com/wp-content/uploads/2018/06/Converseen.png -[102]:https://linuxhint.com/wp-content/uploads/2018/06/Tiled-Map-Editor.png -[103]:https://linuxhint.com/wp-content/uploads/2018/06/Qmmp.png -[104]:https://linuxhint.com/wp-content/uploads/2018/06/Arora.png -[105]:https://linuxhint.com/wp-content/uploads/2018/06/XnSketch.png -[106]:https://linuxhint.com/wp-content/uploads/2018/06/Geany.png -[107]:https://linuxhint.com/wp-content/uploads/2018/06/Mumble.png -[108]:https://linuxhint.com/wp-content/uploads/2018/06/Deluge.png -[109]:https://twitter.com/linuxhint -[110]:https://twitter.com/SwapTirthakar diff --git a/translated/tech/20180629 100 Best Ubuntu Apps.md b/translated/tech/20180629 100 Best Ubuntu Apps.md new file mode 100644 index 0000000000..c82f5cc099 --- /dev/null +++ b/translated/tech/20180629 100 Best Ubuntu Apps.md @@ -0,0 +1,1195 @@ +warmfrog translating + +100 Best Ubuntu Apps +====== + +今年早些时候我们发布了一个 [2018 年最好的 20 个 Ubuntu 应用][1]列表,可能对很多用户来说都很有用。现在我们几乎到 2018 年下半年了,所以今天我们打算看一下 Ubuntu 上最好的 100 个应用,你可能会觉得有帮助。 + +![100 Best Ubuntu Apps][2] + +很多用户最近从 Microsoft Windows 转换到了 Ubuntu,可能面临着这样一个困境:寻找它们之前使用了数年的操作系统上的应用软件的最好替代应用。Ubuntu 拥有上千个免费使用和开源应用软件比 Windows 和其它 OS 上的付费软件运行的更好。 + +下列列表归纳了各种分类下很多应用软件的功能特点,因此,你可以找到匹配你的需求的最好的应用。 + +### **1\. Google Chrome 浏览器** + +几乎所有 Linux 发行版默认安装了 Mozilla Firefox 网络浏览器,并且它是 Google Chrome 的强力竞争对手。但是 Chrome 相对 Firefox 有它自己的优点,给了你 Google 账户的入口,你可以通过它来同步你的书签,浏览历史,扩展。例如从其它操作系统和手机的 Chrome 浏览器同步。 + +![Chrome][3] + +Google Chrome 为 Linux 集成了最新的 Flash 播放器,其它 Linux 上的浏览器像 Mozilla Firefox 和 Opera 网络浏览器则不是这样。如果你在 Windows 上经常使用 Chrome,那么在 Linux 上也用它是最好的选择。 + +### 2\. **Steam** + +现在在 Linux 上玩游戏已经不是问题了,这在很多年前还是一个遥不可及的梦。在 2013 年,Valve 发布了 Linux 上的 Steam 游戏客户端,此后一切都变了。早期用户犹豫着从 Windows 转到 Linux,只是因为它们不能在 Ubuntu 上玩它们最喜欢的游戏,但是现在已经不是这样了。 + +![Steam][4] + +一些用户可能发现在 Linux 上安装 Steam 有点棘手,但如果能在 Linux 上玩上千的 Steam 游戏时这么做就是值得的。一些流行的像 Counter Strike 这样的高端游戏:Global Offensive, Hitman, Dota 2 在 Linux 上都能获取,你只需要确保你满足玩这些游戏的最小硬件需求。 + +``` +$ sudo add-apt-repository multiverse + +$ sudo apt-get update + +$ sudo apt-get install steam +``` + +### **3\. WordPress 桌面客户端** + +是的,没错,WordPress 有它专有的 Ubuntu 平台的客户端,你可以用来管理你的 WordPress 站点。你同样可以在桌面客户端上单独写和设计桌面客户端而不用转到浏览器。 + +![][5] + +如果你有 WordPress 支持的站点,那么这个桌面客户端能够让你在单个窗口内追踪所有的 WordPress 通知。你同样可以检查站点的博客性能状态。桌面客户端可以在 Ubuntu 软件中心中获取,你可以在那里下载和安装。 + +### **4\. VLC 媒体播放器** + +VLC 是一个非常流行的跨平台的开源媒体播放器,同样在 Ubuntu 中可以获取。使得 VLC 成为一个最好的媒体播放器的原因是它能够播放地球上能够获得的任何音频视频格式,而且不会出现任何问题。 + +![][6] + +VLC 有一个平滑的用户界面,易于使用,除此之外,它提供了很多特点包括在线视频流,音频和视频自定义,等。 + +``` +$ sudo add-apt-repository ppa:videolan/master-daily +$ sudo apt update +$ sudo apt-get install vlc qtwayland5 +``` + +### **5\. Atom 文本编辑器** + +由 Github 开发,Atom 是一个免费和开源的文本编辑器,它同样能够被用做集成开发环境(IDE)来进行主流编程语言的编码和编辑。Atom 开发者声称它是 21 世纪的完全可控制的文本编辑器。 + +![][7] + +Atom 文本编辑器属于最好的用户界面之一,它是一个富文本编辑器提供了自动补全,语法高亮、扩展与插件支持。 + +``` +$ sudo add-apt-repository ppa:webupd8team/atom +$ sudo apt-get update +$ sudo apt-get install atom +``` + +### **6\. GIMP 图像编辑器** + +GIMP (GNU 图形操作程序)是 Ubuntu 上免费和开源的图像编辑器。有争议说它是 Windows 上 Adobe Photoshop 的最好替代品。如果你过去经常用 Adobe Photoshop,会觉得很难习惯 GIMP,但是你可以自定义 GIMP 使它看起来与 Photoshop 非常相似。 + +![][8] + +GIMP 是一个功能丰富的图片编辑器,你可以随时通过安装扩展和插件来使用附加的功能。 + +``` +$ sudo apt-get install gimp +``` + +### **7\. Google Play 音乐桌面播放器** + +Google Play 音乐桌面播放器是一个开源的音乐播放器,它是 Google Play Music 的一个替代品,或者说更好。Google 总是缺少桌面的音乐客户端,但第三方的应用完美的填充了空白。 + +![][9] + +就像你在截屏里看到的,它的界面在外观和感觉上都是首屈一指的。你仅仅需要登录 Google 账户,之后会导入所有你的音乐和你的最爱到桌面客户端里。你可以从它的官方 [站点][10]下载安装文件并使用软件中心安装它。 + +### **8\. Franz** + +Franz 是一个即时消息客户端,结合了聊天和信息服务到一个应用中。它是现代化的即时消息平台之一,在单个应用中支持 Facebook Messenger, WhatsApp, Telegram, 微信,Google Hangouts, Skype。 + +![][11] + +Franz 是一个完整的消息平台,你同样可以在商业中用它来管理大量的客户服务。为了安装 Franz,你需要从它的[网站][12]下载安装包,在软件中心中打开。 + +### **9\. Synaptic 包管理器** + + Synaptic 包管理器是 Ubuntu 上必有工具之一,因为它为我们通常在命令行界面安装软件的 ‘apt-get’ 命令提供了用户图形界面。它是各种 Linux 发行版中默认的应用的强力对手。 + +![][13] + +Synaptic 拥有非常简单的用户图形界面,相比其它的应用商店非常快并易于使用。左手边你可以浏览不同分类的各种应用,也可以轻松安装和卸载。 + +``` +$ sudo apt-get install synaptic +``` + +### **10\. Skype** + +Skype 是一个非常流行的跨平台视频电话应用,如今在 Linux 系统的 Snap 应用中可以获取了。Skype 是一个即时通信应用,它提供了视频和音频通话,桌面共享等特点。 + +![][14] + +Skype 有一个优秀的用户图形界面,与 Windows 上的桌面客户端非常相似,易于使用。它对于从 Windows 上转换来的用户来说非常有用。 + +``` +$ sudo snap install skype +``` + +### **13\. VirtualBox** + +VirtualBox 是由 Oracle 公司开发的跨平台的虚拟化软件应用。如果你喜欢尝试新的操作系统,那么 VirtualBox 是为你准备的必备的 Ubuntu 应用。你可以尝试 Windows 内的 Linux,Mac 或者 Linux 系统中的 Windows 和 Mac。 + +![][15] + +VB 实际做的是让你在宿机操作系统里可视化的运行顾客操作系统。它创建虚拟硬盘并在上面安装顾客操作系统。你可以在 Ubuntu 软件中心直接下载和安装。 + +### **12\. Unity Tweak 工具** + +Unity Tweak 工具(Gnome Tweak 工具)对于每个 Linux 用户都是必须有的,因为它给了用户根据需要自定义桌面的能力。你可以尝试新的 GTK 主题,设置桌面角落,自定义图标集,改变 unity 启动器,等。 + +![][16] + +Unity Tweak 工具对于用户来说可能非常有用,因为它包含了从基础到高级配置的所有内容。 + +``` +$ sudo apt-get install unity-tweak-tool +``` + +### **13\. Ubuntu Cleaner** + +Ubuntu Cleaner是一个系统管理工具,尤其被设计为移除不再使用的包,移除不必要的应用和清理浏览器缓存的。Ubuntu Cleaner 有易于使用的简易用户界面。 + +![][17] + +Ubuntu Cleaner是 BleachBit 最好的替代品之一,BleachBit 是 Linux 发行版上的相当好的清理工具。 + +``` +$ sudo add-apt-repository ppa:gerardpuig/ppa +$ sudo apt-get update +$ sudo apt-get install ubuntu-cleaner +``` + +### 14\. Visual Studio Code + +Visual Studio Code 是一个代码编辑器,你会发现它与 Atom 文本编辑器和 Sublime Text 非常相似,如果你曾用过的话。Visual Studio Code 证明是非常好的教育工具,因为它解释了所有东西,从 HTML 标签到编程中的语法。 + +![][18] + +Visual Studio 自身集成了 Git,它有优秀的用户界面,你会发现它与 Atom Text Editor 和 Sublime Text 非常相似。你可以从 Ubuntu 软件中心下载和安装它。 + +### **15\. Corebird** + +如果你在找你可以用 Twitter 的桌面客户端,那 Corebird Twitter 客户端就是你在找的。它被争议是 Linux 发行版下可获得的最好的 Twitter 客户端,它提供了与你手机上的 Twitter 应用非常相似的功能。 + +![][19] + + 当有人喜欢或者转发你的 tweet 或者给你发消息时,Corebird Twitter 客户端同样会给你通知。你同样可以在这个客户端上添加多个 Twitter 账户。 + +``` +$ sudo snap install corebird +``` + +### **16\. Pixbuf** + +Pixbuf 是来自 Pixbuf 图片社区中心的一个桌面客户端,让你上传,分享和出售你的相片。它支持图片共享到社交媒体像 Facebook,Pinterest,Instagram,Twitter,等等,也包括照相服务像 Flickr,500px and Youpic。 + +![][20] + +Pixbuf提供了分析等功能,可以让你统计点击量、转发量、照片的回复、预定的帖子、专用的iOS 扩展。它同样有移动应用,因此你可以在任何地方连接到你的 Pixbuf 账户。 Pixbuf 在 Ubuntu 软件中心以 Snap 包的形式获得。 + +### **17\. Clementine 音乐播放器** + +Clementine 是一个跨平台的音乐播放器,并且是 Ubuntu 上默认音乐播放器 Rhythmbox 的良好竞争者。多亏它的友好的界面,它很快速并易于使用。它支持所有音频文件格式的声音回放。 + +![][21] + +除了播放本地库中的音乐,你也可以在线听 Spotify, SKY.fm, Soundcloud 等的广播。它也支持其它的功能像智能动态播放列表,从像 Dropbox,Google Drive 这样的云存储中同步音乐。 + +``` +$ sudo add-apt-repository ppa:me-davidsansome/clementine +$ sudo apt-get update +$ sudo apt-get install clementine +``` + +### **18\. Blender** + +Blender 是一个免费和开源的 3D 创建应用软件,你可以用来创建 3D 打印模型,动画电影,视频游戏,等。它自身集成了游戏引擎,你可以用来开发和测试视频游戏。 + +![blender][22] + +Blender 拥有赏心悦目的用户界面,易于使用,它包括了内置的渲染引擎,数字雕刻,仿真工具,动画工具,还有很多。考虑到它免费和它的特点,你甚至会认为它可能是 Ubuntu 上最好的应用之一。 + +### **19\. Audacity** + +Audacity 是一个开源的音频编辑应用,你可以用来记录、编辑音频文件。你可以从各种输入中录入音频,包括麦克风,电子吉它,等等。根据你的需要,它提供了编辑和裁剪音频的能力。 + +![][23] + +最近 Audacity 发布了 Ubuntu 上的新版本,新特点包括主题提升、放缩命令等。除了这些,它还提供了降噪等更多特点。 + +``` +$ sudo add-apt-repository ppa:ubuntuhandbook1/audacity +$ sudo apt-get update +$ sudo apt-get install audacity +``` + +### **20\. Vim** + +Vim 是一个集成开发环境,你可以用作一个独立的应用或各种像 Python 等主流编程语言的命令行接口。 + +![][24] + +大多数程序员喜欢在 Vim 中编代码,因为它快速并且是一个可高度定制的集成开发环境。最初你可能觉得有点难用,但你会很快习惯它。 + +``` +$ sudo apt-get install vim +``` + +### **21\. Inkscape** + +Inkscape 是一个开源和跨平台的矢量图形编辑器,你会觉得它和 Corel Draw 和 Adobe Illustrator 很相似。用它可以创建和编辑矢量图形例如柱形图、logo、图表、插图等。 + +![][25] + +Inkscape 使用规模矢量图形(SVG),一个基于 XML 的 W3C 标准格式。它只是各种格式包括 JPEG、PNG、GIF、PDF、AI(Adobe Illustrator 格式)、VSD 等等。 + +``` +$ sudo add-apt-repository ppa:inkscape.dev/stable +$ sudo apt-get update +$ sudo apt-get install inkscape +``` + +### **22\. Shotcut** + +Shotcut 是一个免费、开源的跨平台的 Meltytech,LLC 在 MLT 多媒体框架下开发的视频编辑应用。你会发现它是 Linux 发行版上最强大的视频编辑器之一,因为它支持所有主要的音频,视频,图片格式。 + +![][26] + +它给了非线性编辑的各种文件格式多轨道视频的能力。它支持 4K 视频分辨率和各种音频,视频过滤,语气生成、音频混合和很多其它的。 + +``` +snap install shotcut -- classic +``` + +### **23\. SimpleScreenRecorder** + +SimpleScreenRecorder 是 Ubuntu 上的一个免费和轻量级的屏幕录制工具。屏幕录制非常有用,如果你是 YouTube 创作者或应用开发者。 + +![][27] + +它可以捕获桌面屏幕的视频/音频记录或直接录制视频游戏。在屏幕录制前你可以设置视频分辨率、帧率等。它有简单的用户界面,你会发现非常易用。 + +``` +$ sudo add-apt-repository ppa:marten-baert/simplescreenrecorder +$ sudo apt-get update +$ sudo apt-get install simplescreenrecorder +``` + +### **24\. Telegram** + +Telegram 是一个基于云的即时通信和网络电话平台,近年来非常流行。它是开源和跨平台的,用户可以用来发送消息,共享视频,图片,音频和其它文件。 + +![][28] + +Telegram 中容易发现的特点是加密聊天,语音信息,远程视频通话,在线位置和社交登录。在 Telegram 中隐私和安全拥有最高优先级,因此,所有你发送和接收的是端对端加密的。 + +``` +$ sudo snap install telegram-desktop +``` + +我们所知道的危害 Windows PC 的病毒不能危害 Ubuntu,因为在 Windows PC 中接收到的邮件的破坏性文件会破坏 Windows PC。因此,在 Linux 上有一些抗病毒应用是安全的。 + +![][29] + +ClamTk 是一个轻量级的病毒扫描器,可以扫描系统中的文件和文件夹并清理发现的有害文件。ClamTk 可以 Snap 包的形式获得,可以从 Ubuntu 软件中心下载。 + +### **26\. MailSpring** + +早期的 MailSpring 以 Nylas Mail 或 Nylas N1 而著名,是开源的邮件客户端。它保存所有的邮件在电脑本地,因此你可以在任何需要的时候访问它。它提供了高级搜索的功能,使用与或操作,因此你可以基于不同的参数搜索邮件。 + +![][30] + +MailSpring 有着和其它易于上手的邮件客户端同样优秀的用户界面。MailSpring 同样提供了私密性、安全性、规划期、通讯录管理、日历等功能特点。 + +### **27\. PyCharm** + +PyCharm 是我最喜欢的继 Vim 之后的 Python IDE 之一,因为它有优雅的用户界面,有很多扩展和插件支持。基本上,它有两个版本,一个是免费和开源的社区版,另一个是付费的专业版。 + +![][31] + +PyCharm 是高度自定义的 IDE 并且有很多功能像错误高亮、代码分析、集成单元测试和 Python 调试器等。PyCharm 对于大多数 Python 程序员和开发者来说是首选的。 + +### **28\. Caffeine** + +想象一下你在 Youtube 上看视频或阅读一篇新文章,突然你的 Ubuntu 锁屏了,我知道它很烦人。我们很多人都会遇到这种情况,所以 Caffeine 是一个阻止 Ubuntu 锁屏或屏幕保护程序的工具。 + +![][32] + +Caffeine Inhibitor 是一个轻量级的工具,它在通知栏添加图标,你可以在那里轻松的激活或禁止它。不需要额外的设置。 + +``` +$ sudo add-apt-repository ppa:eugenesan/ppa +$ sudo apt-get update +$ sudo apt-get install caffeine -y +``` + +### **29\. Etcher USB 镜像写入器** + +Etcher 是一个有 resin.io 开发的 USB 镜像写入器。它是一个跨平台的应用,帮助你将 ZIP、ISO、IMG 格式的镜像文件写入到 USB 存储中。如果你总是尝试新的操作系统,那么 Ethcher 是你必有的简单可靠的系统。 + +![][33] + +Etcher 有干净的用户界面指导你在三步内烧录镜像到 USB 驱动或 SD 卡的过程。步骤包括选择镜像文件,选择 USB 驱动 和最终的 flash(写文件到 USB 驱动)。你可以从它的[官网][34]下载和安装 Etcher。 + +### **30\. Neofetch** + +Neofetch 是一个酷炫的系统信息工具,通过在终端中运行 “neofetch” 命令,它会给你关于你的系统的所有信息。它酷是因为它给你关于桌面环境,内核版本,bash 版本和你正在运行的 GTK 主题信息。 + +![][35] + +与其它系统信息工具比较,Nefetch 是高度自定义的工具。你可以使用命令行进行各种自定义。 + +``` +$ sudo add-apt-repository ppa:dawidd0811/neofetch +$ sudo apt-get update +$ sudo apt-get update install neofetch +``` + +### 31\. Liferea + +Liferea(Linux 热点阅读器)是一个免费和开源的新闻聚集工具,用于在线新闻订阅。使用新的聚集工具非常快捷和简单,支持各种格式例如 RSS/RDF,Atom 等。 + +![][36] +Liferea 自带与 TinyTinyRSS 的同步支持,它给了你离线阅读的能力。你会发现,就可靠性和灵活性而言,它是 Linux 上最好的订阅工具之一。 + + +``` +$ sudo add-apt-repository ppa:ubuntuhandbook1/apps +$ sudo apt-get update +$ sudo apt-get install liferea +``` + +### 32\. Shutter + +在 Ubuntu 中很容易截屏,但当编辑截屏时 Shutter 是你必不可少的应用。它帮助你捕获,编辑和轻松的共享截屏。使用 Shutter 的选择工具,你可以选择屏幕的特定区域来截屏。 + +![][37] + +Shutter 是一个功能强大的截图工具,提供了添加截图效果,画线等功能。它同样给你上传截屏到各种图像保存站点的选项。你可以直接在 Ubuntu 软件中心中下载和安装。 + +### 33\. Weather + +Weather 是一个小的应用,给你关于你的城市或世界上其它位置的实时天气信息。它简单而且轻量级,给你超过 7 天的详细天气预报和今明两天的每个小时的细节信息。 + +![][38] + +它集成在 GNOME shell 中,给你关于最近搜索位置的当前天气状态。它有最小的用户界面,在最小硬件需求下运行很顺畅。 + +### 34\. Ramme + +Ramme 是一个很酷的非官方的 Instagram 桌面客户端,给你带来 Instagram 移动端的感觉。它是基于 Electron 的客户端,所以它替代了 Instagram 应用提供了主题自定义的功能。 + +![][39] + +但是由于 Instagram 的 API 限制,你不能使用 Ramme 客户端上传图像,但你总是可以通过订阅 Instagram,喜欢和评论,给好友发消息。你可以从 [Github]][40] 下载 Ramme 安装文件。 + +### **35\. Thunderbird** + +Thunderbird 是一个开源的邮件客户端,是很多 Linux 发行版的默认邮件客户端。尽管在 2017 年与 Mozilla 分离,Thunderbird 仍然是 Linux 平台非常流行的最好的邮件客户端。它自带特点像垃圾短信过滤,IMAP 和 POP 邮件同步,日历支持,通讯录集成和很多其它特定。 + +![][41] + +它是一个跨平台的邮件客户端,在所有支持的平台上完全由社区提供支持。多亏它的高度自定义特点,你总是可以改变它的外观和观感。 + +### **36\. Pidgin** + +Pidgin 是一个即时信息客户端,你能够在单个窗口下登录不同的即时网络。你可以登录到像 Google Talk,XMPP,AIM,Bonjour 等。 + +![][42] + +Pidgin 拥有所有你期待的即时通信的特点,你总是可以通过安装额外的插件来提升它的性能。 + +``` +$ sudo apt-get install pidgin +``` + +### **37\. Krita** + +Krita 是由 KDE 开发的免费和开源的数字打印,编辑和动画应用。它有优秀的用户界面,每个组件都放的很完美,因此你可以找到你需要的。 + +![][43] + +它使用 OpenGL 画布,这提升了 Krita 的性能,并且提供了很多特点相不同的绘画工具、动画工具、矢量工具、层、罩等很多。可在 Ubuntu 软件中心获取 Krita 并下载。 + +### **38\. Dropbox** + +Dropbox 是一个出色的云存储播放器,一旦安装,它在 Ubuntu 中运行得非常好。即使 Google Drive 在 Ubuntu 16.04 LTS 和以后的版本中运行得不错,就 Dropbox 提供的特点而言,Dropbox 仍然是 Linux 上的首选云存储工具。 + +![][44] +它总是在后台运行,备份你系统上的新文件到云存储,持续在你的电脑和云存储间同步。 + +``` +$ sudo apt-get install nautilus-dropbox +``` + +### 39\. Kodi + +Kodi 的前身是人们熟知的 Xbox 媒体中心(XBMC),是一个开源的媒体播放器。你可以在线或离线播放音乐、视频、播客、视频游戏等。这个软件最初是为第一代的 Xbox 游戏控制台开发的,之后慢慢地面向了个人电脑。 + +![][45] + +Kodi 有令人印象深刻的视频接口,快速而强大。它是可高度定制的媒体播放器,你可以通过安装插件,来获取在线流服务像 Pandora、 Spotify、Amazon Prime Video、Netflix and YouTube。 + +### **40\. Spotify** + +Spotify 是最好的在线媒体流站点之一。它提供免费和付费音乐、播客、视频流服务。早期的 Spotify 不支持 Linux,但现在它有全功能的 Ubuntu 客户端。 + +![][46] + + 与 Google Play 音乐播放器一样,Spotify 是必不可少的媒体播放器。你只需要登录你的 Spotify 账户,就能在任何地方获取你最爱的在线内容。 + +### 41\. Brackets + +Brackets 是一个有 Adobe 开发的开源的文本编辑器。它可被用来进行 web 开发和设计,例如 HTML,CSS 和 JavaScript。它随改变实时预览是一个很棒的特点,当你在脚本中修改时,你可以获得实时预览效果。 + +![][47] + +它是 Ubuntu 上的现代文本编辑器之一,拥有平滑的用户界面,这将 web 开发任务带到新的水平。它同样提供行内编辑器的特点,支持流行的扩展像 Emmet、Beautify、Git、File Icons 等等。 + +### 42\. Bitwarden + +现今,安全问题事件增加,用户密码被盗后,重要的数据受到连累,因此,账户安全性必须严肃对待。推荐你使用 Bitwarden,将你的所有账户和登录密码安全的存在一个地方。 + +![][48] + +Bitwarden 使用 AES-256 加密技术来存储所有的登录细节,只有用户可以访问这些数据。它同样帮你创建健壮的密码,因为弱密码容易被黑。 + +### 43\. Terminator + +Terminator 是一个开源终端模拟器,用 Java 语言开发的。它是一个跨平台的模拟器,允许你在单个窗口有多个终端,在 Linux 默认的终端模拟器中不是这样。 + +![][49] + +Terminator 其它杰出的特点包括自动日志、拖、丢、智能垂直和水平滚动等。 + +``` +$ sudo apt-get install terminator +``` + +### 44\. Yak Yak + +Yak Yak 是一个开源的非官方的 Google Hangouts 消息的桌面客户端。它可能是一个不错的 Microsort 的 Skype 的替代品,自身拥有很多让人吃惊的特点。你可以允许桌面通知,语言偏好,工作在最小内存或电源需求等。 + +![][50] + +Yak Yak 拥有你期待的所有任何即时消息应用的所有特点,例如类型指示、拖、拽媒体文件,音/视频电话。 + +### 45\. **Thonny** + +Thonny 是一个简单和轻量级的 IDE,尤其是为编程的初学者设计的。如果你是编程初学者,这是你必备的 IDE,因为当用 Python 编程的时候它会帮你学习。 + +![][51] + +Thonny 同样是一个很棒的调试工具,它支持调试过程中的活变量,除此之外,它还提供了执行函数调用是分离窗口、简易用户界面的特点。 + +``` +$ sudo apt-get install thonny +``` + +### **46\. Font Manager** + +Font Manager 是一个轻量级的工具,用于管理、添加、移除你的 Ubuntu 系统上的字体。尤其是为 Gnome 桌面环境构建的,当用户不知道如何在命令行管理字体的会发现这个工具非常有用。 + +![][52] + +Gtk+ Font Manager 不是为专业用户准备的,它有简单的用户界面,你会发现很容易导航。你只需要从网上下载字体文件,并使用 Font Manager 添加它们。 + +$ sudo add-apt-repository ppa:font-manager/staging +$ sudo apt-get update +$ sudo apt-get install font-manager + +### **47\. Atril Document Viewer** + +Atril 是一个简单的文件查看器,支持便携文件格式(PDF)、PostScript(PS)、Encapsulated PostScript(EPS)、DJVU 和 DVI。Atril 绑定在 MATE 桌面环境中,它比大多数 Linux 发行版中默认的文件查看器 Evince 更理想。 + +![][53] + +Atril 用简单和轻量级的用户界面,可高度自定义,提供了搜索、书签、UI 左侧的缩略图等特点。 + +``` +$ sudo apt-get install atril +``` + +### **48\. Notepadqq** + +如果你曾在 Windows 上用过 Notepad++,并且在 Linux 上寻找相似的程序,别担心,开发者们已经将它移植到 Linux,叫 Notepadqq。它是一个简单且强大的文本编辑器,你可以在日常生活中用它完成各种语言的任务。 + +![][54] + +尽管作为一个简单的文本编辑器,它有一些令人惊奇的特点,例如,你可以设置主题为暗黑或明亮模式、多选、正则搜索和实时高亮。 + +``` +$ sudo add-apt-repository ppa:notpadqq-team/notepadqq +$ sudo apt-get update +$ sudo apt-get install notepadqq +``` + +### **49\. Amarok** + +Amarok 是在 KDE 项目下开发的一个开源音乐播放器。它有直观的界面,让你感觉在家一样,因此你可以轻易的发现你最喜爱的音乐。除了 Clementine,当你在寻找 Ubuntu 上的完美的音乐播放器时,Amarok 是一个很棒的选择。 + +![][55] + +Amarok 上的一些顶尖的特点包括智能播放列表支持,集成在线服务像 MP3tunes、Last.fm、 Magnatune 等。 + +### **50\. Cheese** + +Cheese 是 Linux 默认的网络摄像头应用,在视频聊天或即时消息应用中非常有用。除了这些,你还可以用这个应用来照相或拍视频,附带一些迷人的特效。 + +![][56] + +它同样提供闪拍模式,让你快速拍摄多张相片,并提供你共享给你的朋友和家人的选项。Cheese 预装在大多数的 Linux 发行版中,但是你同样可以在软件中心下载它。 + +### **51\. MyPaint** + +MyPaint 是一个免费和开源的光栅图形编辑器,关注于数字绘画而不是图像操作和相片处理。它是跨平台的应用,与 Corel Painter 很相似。 + +![][57] + +MyPaint 可能是 Windows 上的 Microsoft Paint 应用的很好的替代。它有简单的用户界面,快速而强大。MyPaint 可以软件中心下载。 + +### **52\. PlayOnLinux** + +PlayOnLinux 是 WINE 模拟器的前端,允许你在 Linux 上运行 Windows 应用。你只需要在 WINE 中安装 Windows 应用,之后你就可以轻松的使用 PlayOnLinux 启动应用和游戏了。 + +![][58] + +### **53\. Akregator** + +Akregator 是在 KDE 项目下为 KDE Plasma 环境开发的默认的 RSS 阅读器。它有简单的用户界面,自带了 KDE 的 Konqueror 浏览器,所以你不需要在阅读新闻提要时切换应用。 + +Akregator 同样提供了桌面通知、自动提要等功能。你会发现在大多数 Linux 发行版中它是最好的提要阅读器。 + +### **54\. Brave** + +Brave 是一个开源的 web 浏览器,阻挡了广告和追踪,所以你可以快速和安全的浏览你的内容。它实际做的是代表你像网站和油管主播支付了费用。如果你喜欢像网站和和油管主播共享而不是看广告,这个浏览器更适合你。 + +![][60] + +对于那些想要安全浏览但有不想错过互联网上重要数据的人来说,这是一个新概念,一个不错的浏览器。 + +### **55\. Bitcoin Core** + +Bitcoin Core 是一个官方的客户端,非常安全和可靠。它持续追踪你的所有交易以保证你的所有交易都是有效的。它限制比特币矿工和银行完全掌控你的比特币钱包。 + +![][61] + +Bitcoin Core 同样提供了其它重要的特点像私钥备份、冷存储、安全通知等。 + +``` +$ sudo add-apt-repository ppa:bitcoin/bitcoin +$ sudo apt-get update +$ sudo apt-get install bitcoin-qt +``` + +### **56\. Speedy Duplicate Finder** + +Speedy Duplicate Finder 是一个跨平台的文件查找工具,用来帮助你查找你的系统上的重复文件,清理磁盘空间。它是一个智能工具,在整个硬盘上搜索重复文件,同样提供智能过滤功能,根据文件类型、扩展或大小帮你找到文件。 + +![][62] + +它有一个简单和整洁的用户界面,易于上手。从软件中心下载完后你就可以开始磁盘空间清理了。 + +### **57\. Zulip** + +Zulip 是一个免费和开源的群聊应用,被 Dropbox 获得了。它是用 Python 写的,用 PostgreSQL 数据库。它被设计和开发为其它聊天应用像 Slack 和 HipChat 的好的替代品。 + +![][63] + +Zulip 功能丰富,例如拖拽文件、群聊、私密聊天、图像预览等。它供养集成了 Github、JIRA、Sentry 和上百种其它服务。 + +### **58\. Okular** + +Okular 是 KDE 为 KDE 桌面环境开发的跨平台的文件查看器。它是一个简单的文件查看器,支持 Portable Document Format (PDF), PostScript, DjVu, Microsoft Compiled HTML help 和很多其它文件格式。 + +![][64] + +Okular 是在 Ubuntu 上你应该尝试的最好的文件查看器之一,它提供了 PDF 文件评论、画线、高亮等很多功能。你同样可以从 PDF 文件中提取文本文件。 + +### **59\. FocusWriter** + +FocusWriter 是一个集中注意力的字处理工具,隐藏了你的桌面屏幕,因此你能够专注写作。正如你看到的屏幕截图,整个 Ubuntu 屏被隐藏了,只有你和你的字处理工具。但你总是可以进入 Ubuntu 屏幕,当你需要的时候,只需要将光标移动到屏幕的边缘。 + +![][65] + +它是一个轻量级的字处理其,支持 TXT、RTF、ODT 文件格式。它同样提供可完全定制的用户界面,还有定时器、警报、每日目标、声音效果等特点,支持翻译为 20 种语言。 + +### **60\. Guake** + +Guake 是为 GNOME 桌面环境准备的酷炫的下拉式终端。当你任务完成后,你需要它消失时, Guake 会闪一下。你只需要按 F12 按钮来启动或退出,这样启动 Guake 币启动一个新的终端窗口更快。 + +![][66] + +Guake 是一个特点丰富的终端,支持多栏,只需要点击几下就能将你的终端内容保存到文件,并且有完全可定制的用户界面。 + +``` +$ sudo apt-get install guake +``` +### **61\. KDE Connect** + +KDE Connect 在 Ubuntu 上是一个很棒的应用,我很想在这篇马拉松文章中将它提早列出来,但是竞争激烈。总之 KDE Connect 可以将你的 Android 智能手机的通知直接转到 Ubuntu 桌面来。 + +![][67] + +有了 KDE Connect,你可以做很多事,例如检查手机电池水平,在电脑和 Android 手机间交换文件,剪贴板同步,发送短信,你还可以将你的手机当作无线鼠标或键盘。 + +``` +$ sudo add-apt-repository ppa:webupd8team/indicator-kedeconnect +$ sudo apt-get update +$ sudo apt-get install kdeconnect indicator-kdeconnect +``` + +### **62\. CopyQ** + +CopyQ 是一个简单但是非常有用的剪切板管理器,它保存你的系统剪切板内容,无论你做了什么改变,你都可以在你需要的时候恢复它。它是一个很棒的工具,支持文本、图像、HTML、和其它格式。 + +![][68] + +CopyQ 自身有很多功能像拖拽、复制/拷贝、编辑、移除、排序、创建等。它同样支持集成文本编辑器,像 Vim,所以如果你是程序员,这非常有用。 + +``` +$ sudo add-apt-repository ppa:hluk/copyq +$ sudo apt-get update +$ sudo apt-get install copyq +``` + +### **63\. Tilix** + +Tilix 是一个功能丰富的高级 GTX3 瓷砖终端模拟器。如果你使用 GNOME 桌面环境,那你会爱上 Tilix,因为它遵循了 GNOME 人类界面指导。Tilix 模拟器与大多数 Linux 发行版上默认终端模拟器相比,它给了你分离终端窗口为多个终端面板。 + +![][69] + +Tilix 提供了自定义链接、图片支持、多面板、拖拽、持续布局等功能。它同样支持键盘快捷方式,你可以根据你的需要在偏好设置中自定义快捷方式。 + +``` +$ sudo add-apt-repository ppa:webupd8team/terminix +$ sudo apt-get update +$ sudo apt-get install tilix +``` + +### **64\. Anbox** + +Anbox 是一个 Android 模拟器,让你在 Linux 系统中安装和运行 Android 应用。它是免费和开源的 Android 模拟器,通过使用 Linux 容器来执行 Android 运行时环境。它使用最新的 Linux 技术 和 Android 发布版,所以你可以运行任何原生的 Android 应用。 + +![][70] + +Anbox 是现代和功能丰富的模拟器之一,提供的功能包括无限制的应用使用,强大的用户界面,与宿主系统无缝集成。 + +首先你需要安装内核模块。 + +``` +$ sudo add-apt-repository ppa:morphis/anbox-support +$ sudo apt-get update +$ sudo apt install anbox-modules-dkms Now install Anbox using snap +$ snap install --devmode -- beta anbox +``` + +### **65\. OpenShot** + +你会发现 OpenShot 是 Linux 发行版中最好的开源视频编辑器。它是跨平台的视频编辑器,易于使用,不在性能方面妥协。它支持所有主流的音频、视频、图像格式。 + +![][71] + +OpenShot 有干净的用户界面,功能有拖拽、裁剪大小调整、大小调整、裁剪、快照、实时预览、音频混合和编辑等多种功能。 + +``` +$ sudo add-apt-repository ppa:openshot.developers/ppa +$ sudo apt-get update +$ sudo apt-get install openshot -qt +``` + +### **66\. Plank** + +如果你在为你的 Ubuntu 桌面寻找一个 Dock 导航栏,那 Plank 应该是一个选择。它是完美的,安装后你不需要任何的修改,除非你想这么做,它有内置的偏好面板,你可以自定义主题,Dock 大小和位置。 + +![][72] + +尽管是一个简单的导航栏,Plank 提供了通过拖拽来重新安排的功能,固定和运行应用图标,转换主题支持。 + + +``` +$ sudo add-apt-repository ppa:ricotz/docky +$ sudo apt-get update +$ sudo apt-get install plank +``` + +### **67\. Filezilla** + +Filezilla 是一个免费和跨平台的 FTP 应用,包括 Filezilla 客户端和服务器。它让你使用 FTP 和加密的 FTP 像 FTPS 和 SFTP 传输文件,支持 IPv6 网络协议。 + +![][73] + +它是一个简单的文件传输应用,支持拖拽,支持世界范围的各种语言,多任务的强大用户界面,控制和配置传输速度。 + +### **68\. Stacer** + +Stacer 是一个开源的系统诊断和优化工具,使用 Electron 开发框架开发的。它有一个优秀的用户界面,你可以清理缓存内存,启动应用,卸载不需要的应用,掌控后台系统进程。 + +![][74] + +它同样让你检查磁盘,内存和 CPU 使用情况,给你下载和上传的实时状态。它看起来像 Ubuntu clener 的强力竞争者,但是两者都有独特的特点。 + +``` +$ sudo add-apt-repository ppa:oguzhaninan/stacer +$ sudo apt-get update +$ sudo apt-get install stacer +``` + +### **69\. 4K Video Downloader** + +4K Video Downloader 是一个简单的视频下载工具,你可以用来从 Vimeo、Facebook、YouTube 和其它在线视频流站点下载视频,播放列表,频道。它支持下载 YouTuBe 播放列表和频道,以 MP4, MKV, M4A, 3GP 和很多其它 音/视频格式。 + +![][75] + +4K Video Downloader 不是你想的那么简单,除了正常的视频下载,它支持 3D 和 360 度 视频下载。它同样提供内置应用协议链接,直连 iTunes。你可以从[这里][76]下载。 + +### 70\. **Qalculate** + +Qalculate 是一个多目的、跨平台的桌面计算器,简单但是强大。它可以用来解决复杂的数学问题和等式,货币汇率转换和很多其它日常计算。 + +![][77] + +它有优秀的用户界面,提供了自定义功能,单元计算,符号计算,算数,画图,和很多你可以在科学计算器上发现的功能。 + +### **71\. Hiri** + +Hiri 是一个跨平台的邮件客户端,使用 Python 语言开发的。它有平滑的用户界面,就它的功能和服务而言,是 Micorsoft Outlook 的很好的替代品。这是很棒的邮件客户端,可以用来发送和接收邮件,管理通讯录,日历和任务。 + +![][78] + +它是一个丰富特点的邮件客户端,提供的功能有集成的任务管理器,邮件同步,邮件评分,邮件过滤等多种功能。 + + +``` +$ sudo snap install hiri +``` + +### **72\. Sublime Text** + +Sublime Text 是一个跨平台的源代码编辑器,用 C++ 和 Python 写的。它有 Python 语言编程接口(API),支持所有主流的编程语言和标记语言。它是简单轻量级的文本编辑器,可被用作 IDE,包含自动补全,语法高亮,分窗口编辑等功能。 + +![][79] + +这个文本编辑器包括一些额外特点:去任何地方、去定义、多选、命令模板和完全定制的用户界面。 + +``` +$ sudo apt-get install sublime-text +``` + +### **73\. TeXstudio** + +Texstudio 是一个创建和编辑 LaTex 文件的集成写作环境。它是开源的编辑器,提供了语法高亮、集成查看、交互式拼写检查、代码折叠、拖拽等特点。 + +![][80] + +它是跨平台的编辑器,有简单轻量级的用户界面,易于使用。它集成了 BibTex和 BibLatex 目录管理器,同样有集成的 PDF 查看器。你可以从[官网][81]和 Ubuntu 软件中心下载 Texstudio。 + +### **74\. QtQR** + +QtQR 是一个基于 Qt 的应用,让你在 Ubuntu 中创建和读取二维码。它是用 Python 和 Qt 开发的,有简单和轻量级的用户界面,你可以编码网站地址、邮件、文本、短消息等。你也可以用网络相机解码二维码。 + +![][82] + +如果你经常处理产品销售和服务,QtQR 会证明是有用的工具,但是我不认为在最小硬件要求下有和 QtQR 这样相似并顺畅运行的应用了。 + +``` +$ sudo add-apt-repository ppa: qr-tools-developers/qr-tools-stable +$ sudo apt-get update +$ sudo apt-get install qtqr +``` + +### **75\. Kontact** + +Kontact 是一个由 KDE 为 KDE 桌面环境开发的集成的个人信息管理器(PIM)。它集成了多个软件到一个集合中,集成了 KMail、KOrganizer和 KAddressBook 到一个用户界面,你可以管理所有的邮件、通讯录、日程表等。 + +![][83] + +它可能是 Microsoft Outlook 的非常好的替代,因为它快速且高度高配置的消息管理工具。它有很好的用户界面,你会发现很容易上手。 + +``` +$ sudo apt-get install kontact +``` + +### **76\. NitroShare** + +NitroShare 是一个跨平台、开源的网络文件共享应用。它让你轻松的在局域网的多个操作系统中共享文件。它简单而强大,当在局域网中运行 NitroShare 时,它会自动侦查其它设备。 + +![][84] + +文件传输速度让 NitroShare 称为一个杰出的文件共享应用,它在能够胜任的硬件中能够达到 GB 级的传输速度。没有必要额外配置,安装完成后你就可以开始文件传输。 + +``` +$ sudo apt-add-repository ppa:george-edison55/nitroshare +$ sudo apt-get update +$ sudo apt-get install nitroshare +``` + +### **77\. Konversation** + +Konversation 是一个为 KDE 桌面环境开发的开源的网络中继聊天(IRC)客户端。它给了到 Freenode 网络平岛的快速入口,你可以为大多数发行版找到支持。 + +![][85] + +它是一个简单的聊天客户端,支持 IPv6 链接, SSL 服务器支持,书签,屏幕通知,UTF-8 检测和另外的主题。它易于使用的 GUI 是高度可配置的。 + +``` +$ sudo apt-get install konversation +``` + +### **78\. Discord** + +如果你是硬核游戏玩家,经常玩在线游戏,我有一个很棒的应用推荐给你。Discord 是一个免费的网络电话应用,尤其是为在线游戏者们设计的。它是一个跨平台的应用,可用来文字或语音聊天。 + +![][86] + +Discord 是一个非常流行的语音通话应用游戏社区,因为它是完全免费的,它是 Skype,Ventrilo,Teamspeak 的很好的竞争者。它同样提供清晰的语音质量,现代的文本聊天,你可以共享图片,视频和链接。 + +### **79\. QuiteRSS** + +QuiteRSS是一个开源的 RSS 的新闻聚合和 Atom 新闻要点应用。它是跨平台的要点阅读器,用 Qt 和 C++ 写的。它有简单的用户界面,你可以改变为经典或者报纸模式。它集成了 webkit 浏览器,因此,你可以在单个窗口执行所有任务。 + +![][87] + +QuiteRSS 自带了很多功能,像内容过滤,自动规划摘要,导入/到处 OPML,系统托盘集成和很多其它你期待任何要点阅读器有的特点。 + +``` +$ sudo apt-get install quiterss +``` + +### **80\. MPV Media Player** + +MPV 是一个免费和开源的媒体播放器,基于 MPlayer 和 MPlayer 2。它有简单的用户界面,用户之需要拖拽音/视频文件来播放,因为在 GUI 上没有添加媒体文件的选项。 + +![][88] + +关于 MPV 的一件事是它可以轻松播放 4K 视频,Linux 发行版中的其它媒体播放器可能不是这样。它同样给了用户播放在线视频流站点像 YouTube 和 Dailymotion 的能力。 + +``` +$ sudo add-apt-repository ppa:mc3man/mpv-tests +$ sudo apt-get update +$ sudo apt-get install -y mpv +``` + +### **81\. Plume Creator** + +如果你是一个作家,那么 Plume Creator 是你必不可少的应用,因为你在 Ubuntu 上找不到其它应用像 Plume Creater 这样。写作和编辑故事、章节是繁重的任务,在 Plume Creator 这个令人惊奇的工具的帮助下,将大大帮你简化这个任务。 + +![][89] + +它是一个开源的应用,拥有最小的用户界面,开始你可能觉得困惑,但不久你就会习惯的。它提供的功能有:编辑笔记,摘要,导出 HTML 和 ODT 格式支持,富文本编辑。 + +``` +$ sudo apt-get install plume-creator +``` + +### **82\. Chromium Web Browser** + +Chromium 是一个由 Google 开发和发布的开源 web 浏览器。Chromium 就其外观和特点而言,很容易被误认为是 Chrome。它是轻量级和快速的网络浏览器,拥有最小用户界面。 + +### **83\. Simple Weather Indicator** + +Simple Weather Indicator 是用 Python 开发的开源天气提示应用。它自动侦查你的位置,并显示你天气信息像温度,下雨的可能性,湿度,风速和可见度。 + +![][91] + +Weather indicator 自带一些可配置项,例如位置检测,温度 SI 单元,位置可见度开关等等。它是一个酷应用,可以根据你的桌面来调整舒服。 + +### **84\. SpeedCrunch** + +SpeedCrunch 是一个快速和高精度的科学计算器。它预置了数学函数,用户定义函数,复数和单位转换支持。它有简单的用户界面并易于使用。 + +![][92] + +这个科学计算器有令人吃惊的特点像结果预览,语法高亮和自动补全。它是跨平台的,并有多语言支持。 + + +### **85\. Scribus** + +Scribus 是一个免费和开源的桌面出版应用,允许你创建宣传海报,杂志和图书。它是基于 Qt 工具器的跨平台英语,在 GNU 通用公共证书下发布。它是一个专业的应用,拥有 CMYK 和 ICC 颜色管理的功能,基于 Python 的脚本引擎,和 PDF 创建。 + +![][93] + +Scribus 有相当好的用户界面,易于使用,轻松在低配置下使用。在所有的最新的 Linux 发行版的软件中心可以下载它。 + +### **86.** **Cura** + +Cura 是一个由 David Braam 开发的开源的 3D 打印应用。Ultimaker Cura 是 3D 打印世界最流行的软件,并世界范围的百万用户使用。它遵守 3D 打印模型的 3 步:设计,准备,打印。 + +![][94] + +它是功能丰富的 3D 打印应用,为 CAD 插件和扩展提供了无缝支持。它是一款简单易于使用的工具,新手艺术家可以马上开始了。它支持主流的文件格式像 STL,3MF,和 OBJ。 + +### **87\. Nomacs** + +Nomacs 是一款开源、跨平台的图像浏览器,支持所有主流的图片格式包括 RAW 和 psd 图像。它可以浏览 zip 文件中的图像或者 Microsoft Office 文件并提取到目录。 + +![][95] + +Nomacs 拥有非常简单的用户界面,图像缩略图在顶部,它提供了一些基本的图像操作特点像修改,调整大小,旋转,颜色纠正等。 + +``` +$ sudo add-apt-repository ppa:nomacs/stable +$ sudo apt-get update +$ sudo apt-get install nomacs +``` + +### **88\. BitTicker** + +BitTicker 是一个 Ubuntu 上的在线比特币-USDT 收报。它是一个简单的工具,能够连接到 bittrex.com 市场,提取最新的 BTC-USDT 并在系统托盘显示 Ubuntu 时钟。 + +![][96] + +它是简单但有用的工具,如果你经常有规律的投资比特币并且必须了解价格波动的话。 + +### **89\. Organize My Files** + +Organize My Files 是一个跨平台的一键点击文件组织工具,它在 Ubuntu 中以 Snap 包的形式获得。它简单但是强大,帮助你找到未组织的文件,通过简单点击来掌控它们。 + +![][97] + +它有易于理解的用户界面,强大且快速。它提供了很多功能:自动组织,递归组织,智能过滤和多层文件夹组织等。 + +### **90\. GnuCash** + +GnuCash 是一个金融账户软件,在 GNU 公共证书下免费使用。它是个人和商业账户的理想软件。它有简单的用户界面允许你追踪银行账户,股票,收入和花费。 + +![][98] + +GnuCash 实现了双入口记账系统,基于专业的账户原则来确保帐薄的平衡和报告的精确。 + +v### **91\. Calibre** + +Calibre 是一个跨平台开源的面向你所有电子书需要的解决方案。它是一个简单的电子书管理器,提供显示、创建、编辑电子书、组织已存在的电子书到虚拟书库、同步和其它更多。 + +![][99] + +Calibre 同样帮你转换电子书到你需要的格式并发送到你的电子书阅读设备。Calibre 是一个很棒的工具,如果你经常阅读和管理电子书的话。 + +### **92\. MATE Dictionary** + +MATE Dictionary 是一个简单的词典,基本上是为 MATE 桌面环境开发的。你可以仅仅输入字然后这个字典会显示意思和引用。 + +![][100] + +它简单和轻量级的在线词典,有最小的用户接口。 + +### **93\. Converseen** + +Converseen 是免费的跨平台的批量图片处理应用,允许你转换、编辑、调整、旋转、裁剪大量图像,仅仅一次鼠标调集。它提供了图像批量重命名的功能,使用前缀或后缀,从一个 Windows 图标文件提取图像等。 + +![][101] + +它有很好的用户界面,易于使用,即时你是一个新手。它也能够转换整个 PDF 文件为图像集合。 + +### **94\. Tiled Map Editor** + +Tiled 是一个免费的水平映射图编辑器,允许你编辑各种形式的投影映射图,例如正交、等轴、和六角的。这个工具对于游戏开发者在游戏引擎开发周期内可能非常有用。 + +![][102] + +Tiled 是一个通用的映射图编辑器,让你创建强大的促进位置,图布局,碰撞区域和敌人位置。它保存所有的数据为 tmx 格式。 + +### **95.** **Qmmp** + +Qmmp 是一个免费和开源的音频播放器,用 C++ 和 Qt 开发的。它是跨平台的音频播放器,界面与 Winamp 很相似。 它有简单的直观的用户界面,Winamp 皮肤可替代默认的 UI。 + +![][103] + +它提供了自动唱片集封面获取,多艺术家支持,另外的插件和扩展支持和其它与 Winamp 相似的特点。 + +``` +$ sudo add-apt-repository ppa:forkotov02/ppa +$ sudo apt-get update +$ sudo apt-get install qmmp qmmp-q4 qmmp-plugin-pack-qt4 +``` + +### **96\. Arora** + +Arora 是一个免费开源的 web 浏览器,提供了专有的下载管理器,书签,私密模式,选项卡式浏览。 + +![][104] + +Arora web 浏览器由 Benjamin C. Meyer 开发,它由于它的轻量自然灵活的特点在 Linux 用户间很受欢迎。 + +### **97\. XnSketch** + +XnSketch 是一个 Ubuntu 上的酷应用,只需要几次点击,就能帮你转换你的图片为卡通或素描图。它展现了 18 个不同的效果例如:锐化、白描、铅笔画和其它的。 + +![][105] + +它有优秀的用户界面,易于使用。一些额外的特点包括容量和边缘强度调整,对比,亮度,饱和度调整。 + +### **98\. Geany** + +Geany 是一个简单轻量级的文本编辑器,像一个集成开发环境。它是跨平台的文本编辑器,支持所有主流编程语言包括Python、C++、LaTex、Pascal、 C#、 etc。 + +``` +$ sudo apt-get install geany +``` + +### **99\. Mumble** + +Mumble 是另一个 IP 上的语音应用相似与 Discord。Mumble 同样最初是为在线游戏者使用的,在端到端的聊天上用了客户端-服务器架构。声音质量在 Mumble 上非常好,它提供了端到端的加密来确保私密性。 + +![][107] + +Mumble 是一个开源应用,有简单的用户界面,易于使用。Mumble 在 Ubuntu 软件中心可以下载。 + +``` +$ sudo apt-get install mumble-server +``` + +### **100\. Deluge** + +Deluge 是一个跨平台的轻量级的 BitTorrent 客户端,能够用来在 Ubuntu 上下载文件。BitTorrent 客户端与很多 Linux 发行版一起发行,但 Deluge 是最好的 BitTorrent 客户端,界面简单,易于使用。 + +![][108] + +Deluge 拥有你发现的其它 BitTorrent 客户端有的所有功能,但是一个功能特别突出,它给了用户从其它设备进入客户端的能力,这样你可以远程下载文件了。 + +``` +$ sudo add-apt-repository ppa:deluge-team/ppa +$ sudo apt-get update +$ sudo apt-get install deluge +``` + +所以这些就是 2018 年我为大家选择的 Ubuntu 上最好的 100 个应用了。所有列出的应用都在 Ubuntu 18.04 上测试了,肯定在老版本上也能运行。请在 [@LinuxHint][109] 和 [@SwapTirthakar][110] 自由分享你的观点。 + +-------------------------------------------------------------------------------- + +via: https://linuxhint.com/100_best_ubuntu_apps/ + +作者:[Swapnil Tirthakar][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://linuxhint.com/author/swapnil/ +[1]:https://linuxhint.com/applications-2018-ubuntu/ +[2]:https://linuxhint.com/wp-content/uploads/2018/06/100-Best-Ubuntu-Apps.png +[3]:https://linuxhint.com/wp-content/uploads/2018/06/Chrome.png +[4]:https://linuxhint.com/wp-content/uploads/2018/06/Steam.png +[5]:https://linuxhint.com/wp-content/uploads/2018/06/Wordpress.png +[6]:https://linuxhint.com/wp-content/uploads/2018/06/VLC.png +[7]:https://linuxhint.com/wp-content/uploads/2018/06/Atom-Text-Editor.png +[8]:https://linuxhint.com/wp-content/uploads/2018/06/GIMP.png +[9]:https://linuxhint.com/wp-content/uploads/2018/06/Google-Play.png +[10]:https://www.googleplaymusicdesktopplayer.com/ +[11]:https://linuxhint.com/wp-content/uploads/2018/06/Franz.png +[12]:https://meetfranz.com/#download +[13]:https://linuxhint.com/wp-content/uploads/2018/06/Synaptic.png +[14]:https://linuxhint.com/wp-content/uploads/2018/06/Skype.png +[15]:https://linuxhint.com/wp-content/uploads/2018/06/VirtualBox.png +[16]:https://linuxhint.com/wp-content/uploads/2018/06/Unity-Tweak-Tool.png +[17]:https://linuxhint.com/wp-content/uploads/2018/06/Ubuntu-Cleaner.png +[18]:https://linuxhint.com/wp-content/uploads/2018/06/Visual-Studio-Code.png +[19]:https://linuxhint.com/wp-content/uploads/2018/06/Corebird.png +[20]:https://linuxhint.com/wp-content/uploads/2018/06/Pixbuf.png +[21]:https://linuxhint.com/wp-content/uploads/2018/06/Clementine.png +[22]:https://linuxhint.com/wp-content/uploads/2016/06/blender.jpg +[23]:https://linuxhint.com/wp-content/uploads/2018/06/Audacity.png +[24]:https://linuxhint.com/wp-content/uploads/2018/06/Vim.png +[25]:https://linuxhint.com/wp-content/uploads/2018/06/Inkscape-1.png +[26]:https://linuxhint.com/wp-content/uploads/2018/06/ShotCut.png +[27]:https://linuxhint.com/wp-content/uploads/2018/06/Simple-Screen-Recorder.png +[28]:https://linuxhint.com/wp-content/uploads/2018/06/Telegram.png +[29]:https://linuxhint.com/wp-content/uploads/2018/06/ClamTk.png +[30]:https://linuxhint.com/wp-content/uploads/2018/06/Mailspring.png +[31]:https://linuxhint.com/wp-content/uploads/2018/06/PyCharm.png +[32]:https://linuxhint.com/wp-content/uploads/2018/06/Caffeine.png +[33]:https://linuxhint.com/wp-content/uploads/2018/06/Etcher.png +[34]:https://etcher.io/ +[35]:https://linuxhint.com/wp-content/uploads/2018/06/Neofetch.png +[36]:https://linuxhint.com/wp-content/uploads/2018/06/Liferea.png +[37]:https://linuxhint.com/wp-content/uploads/2018/06/Shutter.png +[38]:https://linuxhint.com/wp-content/uploads/2018/06/Weather.png +[39]:https://linuxhint.com/wp-content/uploads/2018/06/Ramme.png +[40]:https://github.com/terkelg/ramme/releases +[41]:https://linuxhint.com/wp-content/uploads/2018/06/Thunderbird.png +[42]:https://linuxhint.com/wp-content/uploads/2018/06/Pidgin.png +[43]:https://linuxhint.com/wp-content/uploads/2018/06/Krita.png +[44]:https://linuxhint.com/wp-content/uploads/2018/06/Dropbox.png +[45]:https://linuxhint.com/wp-content/uploads/2018/06/kodi.png +[46]:https://linuxhint.com/wp-content/uploads/2018/06/Spotify.png +[47]:https://linuxhint.com/wp-content/uploads/2018/06/Brackets.png +[48]:https://linuxhint.com/wp-content/uploads/2018/06/Bitwarden.png +[49]:https://linuxhint.com/wp-content/uploads/2018/06/Terminator.png +[50]:https://linuxhint.com/wp-content/uploads/2018/06/Yak-Yak.png +[51]:https://linuxhint.com/wp-content/uploads/2018/06/Thonny.png +[52]:https://linuxhint.com/wp-content/uploads/2018/06/Font-Manager.png +[53]:https://linuxhint.com/wp-content/uploads/2018/06/Atril.png +[54]:https://linuxhint.com/wp-content/uploads/2018/06/Notepadqq.png +[55]:https://linuxhint.com/wp-content/uploads/2018/06/Amarok.png +[56]:https://linuxhint.com/wp-content/uploads/2018/06/Cheese.png +[57]:https://linuxhint.com/wp-content/uploads/2018/06/MyPaint.png +[58]:https://linuxhint.com/wp-content/uploads/2018/06/PlayOnLinux.png +[59]:https://linuxhint.com/wp-content/uploads/2018/06/Akregator.png +[60]:https://linuxhint.com/wp-content/uploads/2018/06/Brave.png +[61]:https://linuxhint.com/wp-content/uploads/2018/06/Bitcoin-Core.png +[62]:https://linuxhint.com/wp-content/uploads/2018/06/Speedy-Duplicate-Finder.png +[63]:https://linuxhint.com/wp-content/uploads/2018/06/Zulip.png +[64]:https://linuxhint.com/wp-content/uploads/2018/06/Okular.png +[65]:https://linuxhint.com/wp-content/uploads/2018/06/Focus-Writer.png +[66]:https://linuxhint.com/wp-content/uploads/2018/06/Guake.png +[67]:https://linuxhint.com/wp-content/uploads/2018/06/KDE-Connect.png +[68]:https://linuxhint.com/wp-content/uploads/2018/06/CopyQ.png +[69]:https://linuxhint.com/wp-content/uploads/2018/06/Tilix.png +[70]:https://linuxhint.com/wp-content/uploads/2018/06/Anbox.png +[71]:https://linuxhint.com/wp-content/uploads/2018/06/OpenShot.png +[72]:https://linuxhint.com/wp-content/uploads/2018/06/Plank.png +[73]:https://linuxhint.com/wp-content/uploads/2018/06/FileZilla.png +[74]:https://linuxhint.com/wp-content/uploads/2018/06/Stacer.png +[75]:https://linuxhint.com/wp-content/uploads/2018/06/4K-Video-Downloader.png +[76]:https://www.4kdownload.com/download +[77]:https://linuxhint.com/wp-content/uploads/2018/06/Qalculate.png +[78]:https://linuxhint.com/wp-content/uploads/2018/06/Hiri.png +[79]:https://linuxhint.com/wp-content/uploads/2018/06/Sublime-text.png +[80]:https://linuxhint.com/wp-content/uploads/2018/06/TeXstudio.png +[81]:https://www.texstudio.org/ +[82]:https://linuxhint.com/wp-content/uploads/2018/06/QtQR.png +[83]:https://linuxhint.com/wp-content/uploads/2018/06/Kontact.png +[84]:https://linuxhint.com/wp-content/uploads/2018/06/Nitro-Share.png +[85]:https://linuxhint.com/wp-content/uploads/2018/06/Konversation.png +[86]:https://linuxhint.com/wp-content/uploads/2018/06/Discord.png +[87]:https://linuxhint.com/wp-content/uploads/2018/06/QuiteRSS.png +[88]:https://linuxhint.com/wp-content/uploads/2018/06/MPU-Media-Player.png +[89]:https://linuxhint.com/wp-content/uploads/2018/06/Plume-Creator.png +[90]:https://linuxhint.com/wp-content/uploads/2018/06/Chromium.png +[91]:https://linuxhint.com/wp-content/uploads/2018/06/Simple-Weather-Indicator.png +[92]:https://linuxhint.com/wp-content/uploads/2018/06/SpeedCrunch.png +[93]:https://linuxhint.com/wp-content/uploads/2018/06/Scribus.png +[94]:https://linuxhint.com/wp-content/uploads/2018/06/Cura.png +[95]:https://linuxhint.com/wp-content/uploads/2018/06/Nomacs.png +[96]:https://linuxhint.com/wp-content/uploads/2018/06/Bit-Ticker-1.png +[97]:https://linuxhint.com/wp-content/uploads/2018/06/Organize-My-Files.png +[98]:https://linuxhint.com/wp-content/uploads/2018/06/GNU-Cash.png +[99]:https://linuxhint.com/wp-content/uploads/2018/06/Calibre.png +[100]:https://linuxhint.com/wp-content/uploads/2018/06/MATE-Dictionary.png +[101]:https://linuxhint.com/wp-content/uploads/2018/06/Converseen.png +[102]:https://linuxhint.com/wp-content/uploads/2018/06/Tiled-Map-Editor.png +[103]:https://linuxhint.com/wp-content/uploads/2018/06/Qmmp.png +[104]:https://linuxhint.com/wp-content/uploads/2018/06/Arora.png +[105]:https://linuxhint.com/wp-content/uploads/2018/06/XnSketch.png +[106]:https://linuxhint.com/wp-content/uploads/2018/06/Geany.png +[107]:https://linuxhint.com/wp-content/uploads/2018/06/Mumble.png +[108]:https://linuxhint.com/wp-content/uploads/2018/06/Deluge.png +[109]:https://twitter.com/linuxhint +[110]:https://twitter.com/SwapTirthakar + + + + + + + + + + + + + + + + + + From 9cddcdbb916a7fc752f109b1aa41b91354225181 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Jun 2019 19:33:18 +0800 Subject: [PATCH 0689/1154] PRF:20190422 4 open source apps for plant-based diets.md @geekpi --- ... open source apps for plant-based diets.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190422 4 open source apps for plant-based diets.md b/translated/tech/20190422 4 open source apps for plant-based diets.md index 96107a526a..3db4da2092 100644 --- a/translated/tech/20190422 4 open source apps for plant-based diets.md +++ b/translated/tech/20190422 4 open source apps for plant-based diets.md @@ -1,51 +1,53 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 open source apps for plant-based diets) [#]: via: (https://opensource.com/article/19/4/apps-plant-based-diets) [#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) -4 款基于植物饮食的开源应用 +4 款“吃草”的开源应用 ====== -这些应用使素食者、纯素食主义者和那些想吃得更健康的杂食者找到可以吃的食物。 -![][1] -减少对肉类、乳制品和加工食品的消费对地球来说更好,也对你的健康更有益。改变你的饮食习惯可能很困难,但是一些开源的 Android 应用可以帮助你切换成基于植物的饮食。无论你是参加[无肉星期一][2],参加 Mark Bittman 的 [6:00 前的素食][3]指南,还是完全切换到[全植物性饮食][4],这些应用能帮助你找出要吃什么,发现素食和素食友好的餐馆,并轻松地将你的饮食偏好传达给他人,来助你更好地走这条路。所有这些应用都是开源的,可从 [F-Droid 仓库][5]下载。 +> 这些应用使素食者、纯素食主义者和那些想吃得更健康的杂食者找到可以吃的食物。 + +![](https://img.linux.net.cn/data/attachment/album/201906/01/193302nompumppxnmnxirz.jpg) + +减少对肉类、乳制品和加工食品的消费对地球来说更好,也对你的健康更有益。改变你的饮食习惯可能很困难,但是一些开源的 Android 应用可以让你吃的更清淡。无论你是参加[无肉星期一][2]、践行 Mark Bittman 的 [6:00 前的素食][3]指南,还是完全切换到[植物全食饮食][4]whole-food, plant-based diet(WFPB),这些应用能帮助你找出要吃什么、发现素食和素食友好的餐馆,并轻松地将你的饮食偏好传达给他人,来助你更好地走这条路。所有这些应用都是开源的,可从 [F-Droid 仓库][5]下载。 ### Daily Dozen ![Daily Dozen app][6] -[Daily Dozen][7] 提供了医学博士、美国法律医学院院士 Michael Greger 推荐的项目清单,作为健康饮食和生活方式的一部分。Greger 博士建议食用全食,由多种食物组成的基于植物的饮食,并坚持日常锻炼。该应用可以让你跟踪你吃的每种食物的份数,你喝了多少份水(或其他获准的饮料,如茶),以及你是否每天锻炼。每类食物都提供食物分量和属于该类别的食物清单。例如,十字花科蔬菜类包括白菜、花椰菜、芽甘蓝等许多其他建议。 +[Daily Dozen][7] 提供了医学博士、美国法医学会院士(FACLM) Michael Greger 推荐的项目清单作为健康饮食和生活方式的一部分。Greger 博士建议食用由多种食物组成的基于植物的全食饮食,并坚持日常锻炼。该应用可以让你跟踪你吃的每种食物的份数,你喝了多少份水(或其他获准的饮料,如茶),以及你是否每天锻炼。每类食物都提供食物分量和属于该类别的食物清单。例如,十字花科蔬菜类包括白菜、花椰菜、抱子甘蓝等许多其他建议。 ### Food Restrictions ![Food Restrictions app][8] -[Food Restrictions][9] 是一个简单的应用,它可以帮助你将饮食限制传达给他人,即使这些人不会说你的语言。用户可以输入七种不同类别的食物限制:鸡肉、牛肉、猪肉、鱼、奶酪、牛奶和辣椒。每种类别都有“我不吃”和“我过敏”选项。“不吃”选项会显示带有红色 X 的图标。“过敏” 选项显示 X 和小骷髅图标。可以使用文本而不是图标显示相同的信息,但文本仅提供英语和葡萄牙语。还有一个选项可以显示一条文字信息,说明用户是素食主义者或纯素食主义者,它比选择更简洁、更准确地总结了这些饮食限制。纯素食主义者的文本清楚地提到不吃鸡蛋和蜂蜜,这在挑选中是没有的。但是,就像挑选方式的文字版本一样,这些句子仅提供英语和葡萄牙语。 +[Food Restrictions][9] 是一个简单的应用,它可以帮助你将你的饮食限制传达给他人,即使这些人不会说你的语言。用户可以输入七种不同类别的食物限制:鸡肉、牛肉、猪肉、鱼、奶酪、牛奶和辣椒。每种类别都有“我不吃”和“我过敏”选项。“不吃”选项会显示带有红色 X 的图标。“过敏” 选项显示 “X” 和小骷髅图标。可以使用文本而不是图标显示相同的信息,但文本仅提供英语和葡萄牙语。还有一个选项可以显示一条文字信息,说明用户是素食主义者或纯素食主义者,它比选择选项更简洁、更准确地总结了这些饮食限制。纯素食主义者的文本清楚地提到不吃鸡蛋和蜂蜜,这在选择选项中是没有的。但是,就像选择选项方式的文字版本一样,这些句子仅提供英语和葡萄牙语。 ### OpenFoodFacts ![Open Food Facts app][10] -购买杂货时避免不必要的成分可能令人沮丧,但 [OpenFoodFacts][11] 可以帮助简化流程。该应用可让你扫描产品上的条形码,以获得有关产品成分和是否健康的报告。即使产品符合纯素产品的标准,产品仍然可能非常不健康。拥有成分列表和营养成分可让你在购物时做出明智的选择。此应用的唯一缺点是数据是用户贡献的,因此并非每个产品都可有数据,但如果你想回馈项目,你可以贡献新数据。 +购买杂货时避免买入不必要的成分可能令人沮丧,但 [OpenFoodFacts][11] 可以帮助简化流程。该应用可让你扫描产品上的条形码,以获得有关产品成分和是否健康的报告。即使产品符合纯素产品的标准,产品仍然可能非常不健康。拥有成分列表和营养成分可让你在购物时做出明智的选择。此应用的唯一缺点是数据是用户贡献的,因此并非每个产品都可有数据,但如果你想回馈项目,你可以贡献新数据。 ### OpenVegeMap ![OpenVegeMap app][12] -使用 [OpenVegeMap][13] 查找你附近的纯素食或素食主义餐厅。此应用可以通过手机的当前位置或者输入地址来搜索。餐厅分类为仅限纯素食者、纯素友好,仅限素食主义者,素食友好者,非素食和未知。该应用使用来自 [OpenStreetMap][14] 的数据和用户提供的有关餐馆的信息,因此请务必仔细检查以确保所提供的信息是最新且准确的。 +使用 [OpenVegeMap][13] 查找你附近的纯素食或素食主义餐厅。此应用可以通过手机的当前位置或者输入地址来搜索。餐厅分类为仅限纯素食者、适合纯素食者,仅限素食主义者,适合素食者,非素食和未知。该应用使用来自 [OpenStreetMap][14] 的数据和用户提供的有关餐馆的信息,因此请务必仔细检查以确保所提供的信息是最新且准确的。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/4/apps-plant-based-diets -作者:[Joshua Allen Holm ][a] +作者:[Joshua Allen Holm][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/) 荣誉推出 From 0f5bab89db7d19a7b98546946d5c57eb85e67bb0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Jun 2019 19:36:18 +0800 Subject: [PATCH 0690/1154] PUB:20190422 4 open source apps for plant-based diets.md @geekpi https://linux.cn/article-10926-1.html --- .../20190422 4 open source apps for plant-based diets.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190422 4 open source apps for plant-based diets.md (98%) diff --git a/translated/tech/20190422 4 open source apps for plant-based diets.md b/published/20190422 4 open source apps for plant-based diets.md similarity index 98% rename from translated/tech/20190422 4 open source apps for plant-based diets.md rename to published/20190422 4 open source apps for plant-based diets.md index 3db4da2092..7399627ee1 100644 --- a/translated/tech/20190422 4 open source apps for plant-based diets.md +++ b/published/20190422 4 open source apps for plant-based diets.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10926-1.html) [#]: subject: (4 open source apps for plant-based diets) [#]: via: (https://opensource.com/article/19/4/apps-plant-based-diets) [#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) From 0f75c8b2b558250f5c26b14b51b8291968364489 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 2 Jun 2019 10:40:19 +0800 Subject: [PATCH 0691/1154] PRF:20190427 Monitoring CPU and GPU Temperatures on Linux.md @cycoe --- ...oring CPU and GPU Temperatures on Linux.md | 50 ++++++------------- 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md b/translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md index 50706c1fe4..0d6eea9f0d 100644 --- a/translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md +++ b/translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Monitoring CPU and GPU Temperatures on Linux) @@ -10,15 +10,15 @@ 在 Linux 上监控 CPU 和 GPU 温度 ====== -_**摘要:本篇文章讨论了在 Linux 命令行中监控 CPU 和 GPU 温度的两种简单方式。**_ +> 本篇文章讨论了在 Linux 命令行中监控 CPU 和 GPU 温度的两种简单方式。 -由于 **[Steam][1]**(包括 _[Steam Play][2]_,也就是我们所熟知的 _Proton_)和一些其他的发展,**GNU/Linux** 正在成为越来越多计算机用户的日常游戏平台的选择。也有相当一部分用户在遇到像[视频编辑][3]或图形设计等(_Kdenlive_ 和 _[Blender][4]_ 是这类应用程序中很好的例子)资源消耗型计算任务时,也会使用 **GNU/Linux**。 +由于 [Steam][1](包括 [Steam Play][2],即 Proton)和一些其他的发展,GNU/Linux 正在成为越来越多计算机用户的日常游戏平台的选择。也有相当一部分用户在遇到像[视频编辑][3]或图形设计等(Kdenlive 和 [Blender][4] 是这类应用程序中很好的例子)资源消耗型计算任务时,也会使用 GNU/Linux。 -不管你是否是这些用户中的一员或其他用户,你也一定想知道你的电脑 CPU 和 GPU 能有多热(如果你想要超频的话更会如此)。如果情况是这样,那么继续读下去。我们会介绍两个非常简单的命令来监控 CPU 和 GPU 温度。 +不管你是否是这些用户中的一员或其他用户,你也一定想知道你的电脑 CPU 和 GPU 能有多热(如果你想要超频的话更会如此)。如果是这样,那么继续读下去。我们会介绍两个非常简单的命令来监控 CPU 和 GPU 温度。 -我的装置包括一台 [Slimbook Kymera][5] 和两台显示器(一台 TV 和一台 PC 监视器),使得我可以用一台来玩游戏,另一台来留意监控温度。另外,因为我使用 [Zorin OS][6],我会将关注点放在 **Ubuntu** 和 **Ubuntu** 的衍生发行版上。 +我的装置包括一台 [Slimbook Kymera][5] 和两台显示器(一台 TV 和一台 PC 监视器),使得我可以用一台来玩游戏,另一台来留意监控温度。另外,因为我使用 [Zorin OS][6],我会将关注点放在 Ubuntu 和 Ubuntu 的衍生发行版上。 -为了监控 CPU 和 GPU 的行为,我们将利用实用的 `watch` 命令在每几秒钟之后动态地得到示数。 +为了监控 CPU 和 GPU 的行为,我们将利用实用的 `watch` 命令在每几秒钟之后动态地得到读数。 ![][7] @@ -30,7 +30,7 @@ _**摘要:本篇文章讨论了在 Linux 命令行中监控 CPU 和 GPU 温度 watch -n 2 sensors ``` -`watch` 保证了示数会在每 2 秒钟更新一次(-当然- 这个周期值能够根据你的需要去更改): +`watch` 保证了读数会在每 2 秒钟更新一次(当然,这个周期值能够根据你的需要去更改): ``` Every 2,0s: sensors @@ -57,28 +57,23 @@ Core 5: +35.0°C (high = +82.0°C, crit = +100.0°C) 除此之外,我们还能得到如下信息: - * 我们有 5 个核心正在被使用(并且当前的最高温度为 37.0ºC)。 - * 温度超过 82.0ºC 会被认为是过热。 - * 超过 100.0ºC 的温度会被认为是超过临界值。 - - - -[推荐阅读:Linux 上排行前 10 的命令行游戏][9] - + * 我们有 5 个核心正在被使用(并且当前的最高温度为 37.0℃)。 + * 温度超过 82.0℃ 会被认为是过热。 + * 超过 100.0℃ 的温度会被认为是超过临界值。 根据以上的温度值我们可以得出结论,我的电脑目前的工作负载非常小。 ### 在 Linux 中监控 GPU 温度 -现在让我们来看看显示卡。我从来没使用过 **AMD** 的显示卡,因此我会将重点放在 **Nvidia** 的显示卡上。我们需要做的第一件事是从 [Ubuntu 的附加驱动][10] 中下载合适的最新驱动。 +现在让我们来看看显卡。我从来没使用过 AMD 的显卡,因此我会将重点放在 Nvidia 的显卡上。我们需要做的第一件事是从 [Ubuntu 的附加驱动][10] 中下载合适的最新驱动。 -在 **Ubuntu**(**Zorin** 或 **Linux Mint** 也是相同的)中,进入_软件和更新_ > _附加驱动_选项,选择最新的可用驱动。另外,你可以添加或启用显示卡的官方 _ppa_(通过命令行或通过_软件和更新_ > _其他软件_来实现)。安装驱动程序后,你将可以使用 _Nvidia X Server_ 的 GUI 程序以及命令行工具 _nvidia-smi_(Nvidia 系统管理界面)。因此我们将使用 `watch` 和 `nvidia-smi`: +在 Ubuntu(Zorin 或 Linux Mint 也是相同的)中,进入“软件和更新 > 附加驱动”选项,选择最新的可用驱动。另外,你可以添加或启用显示卡的官方 ppa(通过命令行或通过“软件和更新 > 其他软件”来实现)。安装驱动程序后,你将可以使用 “Nvidia X Server” 的 GUI 程序以及命令行工具 `nvidia-smi`(Nvidia 系统管理界面)。因此我们将使用 `watch` 和 `nvidia-smi`: ``` watch -n 2 nvidia-smi ``` -与 CPU 的情况一样,我们会在每两秒得到一次更新的示数: +与 CPU 的情况一样,我们会在每两秒得到一次更新的读数: ``` Every 2,0s: nvidia-smi @@ -107,16 +102,11 @@ Fri Apr 19 20:45:30 2019 从这个表格中我们得到了关于显示卡的如下信息: * 它正在使用版本号为 418.56 的开源驱动。 - * 显示卡的当前温度为 54.0ºC,并且风扇的使用量为 0%。 + * 显示卡的当前温度为 54.0℃,并且风扇的使用量为 0%。 * 电量的消耗非常低:仅仅 10W。 * 总量为 6GB 的 vram(视频随机存取存储器),只使用了 433MB。 * vram 正在被 3 个进程使用,他们的 ID 分别为 1557、1820 和 7820。 - - -[推荐阅读:现在你可以在 Linux 终端中使用谷歌了!][11] - - 大部分这些事实或数值都清晰地表明,我们没有在玩任何消耗系统资源的游戏或处理大负载的任务。当我们开始玩游戏、处理视频或其他类似任务时,这些值就会开始上升。 #### 结论 @@ -129,22 +119,14 @@ Fri Apr 19 20:45:30 2019 玩得开心! -![化身][12] - -### Alejandro Egea-Abellán - -It's FOSS 社区贡献者 - -我对电子、语言学、爬虫学、计算机(尤其是 GNU/Linux 和 FOSS)有着浓厚兴趣。我通过了 LPIC-2 认证,目前在西班牙穆尔西亚教育部终身学习部们担任技术顾问和 Moodle(译注:Moodle 是一个开源课程管理系统)管理员。我是终身学习、知识共享和计算机用户自由的坚定信奉者。 - -------------------------------------------------------------------------------- via: https://itsfoss.com/monitor-cpu-gpu-temp-linux/ -作者:[It's FOSS Community][a] +作者:[Alejandro Egea-Abellán][a] 选题:[lujun9972][b] 译者:[cycoe](https://github.com/cycoe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d17a309ac2578492c8932df639b7cf102f86dfee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 2 Jun 2019 10:40:54 +0800 Subject: [PATCH 0692/1154] PUB:20190427 Monitoring CPU and GPU Temperatures on Linux.md @cycoe https://linux.cn/article-10929-1.html --- .../20190427 Monitoring CPU and GPU Temperatures on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190427 Monitoring CPU and GPU Temperatures on Linux.md (99%) diff --git a/translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md b/published/20190427 Monitoring CPU and GPU Temperatures on Linux.md similarity index 99% rename from translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md rename to published/20190427 Monitoring CPU and GPU Temperatures on Linux.md index 0d6eea9f0d..1ba2cb1a9b 100644 --- a/translated/tech/20190427 Monitoring CPU and GPU Temperatures on Linux.md +++ b/published/20190427 Monitoring CPU and GPU Temperatures on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10929-1.html) [#]: subject: (Monitoring CPU and GPU Temperatures on Linux) [#]: via: (https://itsfoss.com/monitor-cpu-gpu-temp-linux/) [#]: author: (It's FOSS Community https://itsfoss.com/author/itsfoss/) From d4e1ce239134c33c78c1cb270214918366ee879e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=B3=A5?= Date: Sun, 2 Jun 2019 19:22:23 +0800 Subject: [PATCH 0693/1154] mv files --- .../20190409 5 open source mobile apps.md | 131 ------------------ .../20190409 5 open source mobile apps.md | 130 +++++++++++++++++ 2 files changed, 130 insertions(+), 131 deletions(-) delete mode 100644 sources/tech/20190409 5 open source mobile apps.md create mode 100644 translated/tech/20190409 5 open source mobile apps.md diff --git a/sources/tech/20190409 5 open source mobile apps.md b/sources/tech/20190409 5 open source mobile apps.md deleted file mode 100644 index 679c1a92fc..0000000000 --- a/sources/tech/20190409 5 open source mobile apps.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (fuzheng1998 ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 open source mobile apps) -[#]: via: (https://opensource.com/article/19/4/mobile-apps) -[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen) - -5 open source mobile apps -====== -You can count on these apps to meet your needs for productivity, -communication, and entertainment. -![][1] - -Like most people in the world, I'm rarely further than an arm's reach from my smartphone. My Android device provides a seemingly limitless number of communication, productivity, and entertainment services thanks to the open source mobile apps I've installed from Google Play and F-Droid. - -​​​​​​Of the many open source apps on my phone, the following five are the ones I consistently turn to whether I want to listen to music; connect with friends, family, and colleagues; or get work done on the go. - -### MPDroid - -_An Android controller for the Music Player Daemon (MPD)_ - -![MPDroid][2] - -MPD is a great way to get music from little music server computers out to the big black stereo boxes. It talks straight to ALSA and therefore to the Digital-to-Analog Converter ([DAC][3]) via the ALSA hardware interface, and it can be controlled over my network—but by what? Well, it turns out that MPDroid is a great MPD controller. It manages my music database, displays album art, handles playlists, and supports internet radio. And it's open source, so if something doesn't work… - -MPDroid is available on [Google Play][4] and [F-Droid][5]. - -### RadioDroid - -_An Android internet radio tuner that I use standalone and with Chromecast_ - -** - -** - -** - -_![RadioDroid][6]_ - -RadioDroid is to internet radio as MPDroid is to managing my music database; essentially, RadioDroid is a frontend to [Internet-Radio.com][7]. Moreover, RadioDroid can be enjoyed by plugging headphones into the Android device, by connecting the Android device directly to the stereo via the headphone jack or USB, or by using its Chromecast capability with a compatible device. It's a fine way to check the weather in Finland, listen to the Spanish top 40, or hear the latest news from down under. - -RadioDroid is available on [Google Play][8] and [F-Droid][9]. - -### Signal - -_A secure messaging client for Android, iOS, and desktop_ - -** - -** - -** - -_![Signal][10]_ - -If you like WhatsApp but are bothered by its [getting-closer-every-day][11] relationship to Facebook, Signal should be your next thing. The only problem with Signal is convincing your contacts they're better off replacing WhatsApp with Signal. But other than that, it has a similar interface; great voice and video calling; great encryption; decent anonymity; and it's supported by a foundation that doesn't plan to monetize your use of the software. What's not to like? - -Signal is available for [Android][12], [iOS][13], and [desktop][14]. - -### ConnectBot - -_Android SSH client_ - -** - -** - -** - -_![ConnectBot][15]_ - -Sometimes I'm far away from my computer, but I need to log into the server to do something. [ConnectBot][16] is a great solution for moving SSH sessions onto my phone. - -ConnectBot is available on [Google Play][17]. - -### Termux - -_Android terminal emulator with many familiar utilities_ - -** - -** - -** - -_![Termux][18]_ - -Have you ever needed to run an **awk** script on your phone? [Termux][19] is your solution. If you need to do terminal-type stuff, and you don't want to maintain an SSH connection to a remote computer the whole time, bring the files over to your phone with ConnectBot, quit the session, do your stuff in Termux, and send the results back with ConnectBot. - -Termux is available on [Google Play][20] and [F-Droid][21]. - -* * * - -What are your favorite open source mobile apps for work or fun? Please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/mobile-apps - -作者:[Chris Hermansen (Community Moderator)][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/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_041x_0.png?itok=tfg6_I78 -[2]: https://opensource.com/sites/default/files/uploads/mpdroid.jpg (MPDroid) -[3]: https://opensource.com/article/17/4/fun-new-gadget -[4]: https://play.google.com/store/apps/details?id=com.namelessdev.mpdroid&hl=en_US -[5]: https://f-droid.org/en/packages/com.namelessdev.mpdroid/ -[6]: https://opensource.com/sites/default/files/uploads/radiodroid.png (RadioDroid) -[7]: https://www.internet-radio.com/ -[8]: https://play.google.com/store/apps/details?id=net.programmierecke.radiodroid2 -[9]: https://f-droid.org/en/packages/net.programmierecke.radiodroid2/ -[10]: https://opensource.com/sites/default/files/uploads/signal.png (Signal) -[11]: https://opensource.com/article/19/3/open-messenger-client -[12]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms -[13]: https://itunes.apple.com/us/app/signal-private-messenger/id874139669?mt=8 -[14]: https://signal.org/download/ -[15]: https://opensource.com/sites/default/files/uploads/connectbot.png (ConnectBot) -[16]: https://connectbot.org/ -[17]: https://play.google.com/store/apps/details?id=org.connectbot -[18]: https://opensource.com/sites/default/files/uploads/termux.jpg (Termux) -[19]: https://termux.com/ -[20]: https://play.google.com/store/apps/details?id=com.termux -[21]: https://f-droid.org/packages/com.termux/ diff --git a/translated/tech/20190409 5 open source mobile apps.md b/translated/tech/20190409 5 open source mobile apps.md new file mode 100644 index 0000000000..987affbcd5 --- /dev/null +++ b/translated/tech/20190409 5 open source mobile apps.md @@ -0,0 +1,130 @@ +[#]: collector: "lujun9972" +[#]: translator: "fuzheng1998 " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "5 open source mobile apps" +[#]: via: "https://opensource.com/article/19/4/mobile-apps" +[#]: author: "Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen" + +5 个开源的移动应用 +====== +您可以依靠这些应用来满足您的生产力,沟通和娱乐需求。 +![][1] + +像世界上大多数人一样,我拿手机连胳膊都懒得伸。 多亏了我从 Google Play 和 F-Droid 安装的开源移动应用程序,让我的 Android 设备好像提供了无限通信,生产力和娱乐服务一样。 + +在我的手机上的许多开源应用程序中,当想听音乐; 与朋友,家人和同事联系; 或者在旅途中完成工作时,以下五个是我一直使用的。 + +### MPDroid + +_一个 Music Player Daemon (MPD)的 Android 控制器_ + +![MPDroid][2] + +MPD 是将音乐从小型音乐服务器电脑传输到大型黑色立体声音箱的好方法。 它直接与 ALSA 对话,因此通过 ALSA 硬件接口与数模转换器( DAC )对话,它可以通过我的网络进行控制——但是用什么东西控制呢? 好吧,事实证明 MPDroid 是一个很棒的 MPD 控制器。 它管理我的音乐数据库,显示专辑封面,处理播放列表,并支持互联网广播。 而且它是开源的,所以如果某些东西不好用的话...... + +MPDroid 可在 [Google Play][4] 和 [F-Droid][5] 上找到。 + +### RadioDroid + +_一台只和 Chromecast 搭配使用的Android 网络收音机_ + +** + +** + +** + +_![RadioDroid][6]_ + +好比 MPDroid 是管理我音乐的数据库,RadioDroid 是一个互联网广播; 从本质上讲,RadioDroid 是 [Internet-Radio.com][7] 的前端产品。 此外,通过将耳机插入 Android 设备,通过耳机插孔或 USB 将Android 设备直接连接到立体声系统,或通过兼容设备使用其 Chromecast 功能,可以享受 RadioDroid。这是一个查看芬兰天气情况,听取排名前 40 的西班牙语音乐,或收到到最新新闻消息的好方法。 + +RadioDroid 可在 [Google Play][8] 和 [F-Droid][9] 上找到。 + +### Signal + +_一个支持 Android,iOS,还有桌面系统的安全即时消息客户端。_ + +** + +** + +** + +_![Signal][10]_ + +如果你喜欢 WhatsApp,但是因为它与 Facebook 日益密切的关系而感到困扰,那么 Signal 应该是你的下一个产品。Signal 的唯一问题是说服你的联系人他们最好用 Signal 取代 WhatsApp。但除此之外,它有一个与 WhatsApp 类似的界面; 很棒的语音和视频通话; 很好的加密; 恰到好处的匿名; 并且它受到了一个不打算通过使用软件来获利的基金会的支持。 为什么不喜欢它呢? + +Signal 可用于[Android][12],[iOS][13] 和 [桌面][14]。 + +### ConnectBot + +_Android SSH 客户端_ + +** + +** + +** + +_![ConnectBot][15]_ + +有时我离电脑很远,但我需要登录服务器才能办事。 [ConnectBot][16]是将 SSH 会话搬到手机上的绝佳解决方案。 + +ConnectBot 可在[Google Play][17]上找到。 + +### Termux + +_有多种实用工具的安卓终端模拟器_ + +** + +** + +** + +_![Termux][18]_ + +你是否需要在手机上运行 **awk** 脚本? [Termux][19]是个解决方案。如果您需要做终端类型的东西,而且您不想一直保持与远程计算机的 SSH 连接,请使用 ConnectBot 将文件带到手机上,然后退出会话,在 Termux 中执行您的操作,用 ConnectBot 发回结果。 + +Termux 可在 [Google Play][20] 和 [F-Droid][21] 上找到。 + +* * * + +你最喜欢用于工作或娱乐的开源移动应用是什么呢?请在评论中分享它们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/mobile-apps + +作者:[Chris Hermansen (Community Moderator)][a] +选题:[lujun9972][b] +译者:[fuzheng1998](https://github.com/fuzheng1998) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_041x_0.png?itok=tfg6_I78 +[2]: https://opensource.com/sites/default/files/uploads/mpdroid.jpg "MPDroid" +[3]: https://opensource.com/article/17/4/fun-new-gadget +[4]: https://play.google.com/store/apps/details?id=com.namelessdev.mpdroid&hl=en_US +[5]: https://f-droid.org/en/packages/com.namelessdev.mpdroid/ +[6]: https://opensource.com/sites/default/files/uploads/radiodroid.png "RadioDroid" +[7]: https://www.internet-radio.com/ +[8]: https://play.google.com/store/apps/details?id=net.programmierecke.radiodroid2 +[9]: https://f-droid.org/en/packages/net.programmierecke.radiodroid2/ +[10]: https://opensource.com/sites/default/files/uploads/signal.png "Signal" +[11]: https://opensource.com/article/19/3/open-messenger-client +[12]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms +[13]: https://itunes.apple.com/us/app/signal-private-messenger/id874139669?mt=8 +[14]: https://signal.org/download/ +[15]: https://opensource.com/sites/default/files/uploads/connectbot.png "ConnectBot" +[16]: https://connectbot.org/ +[17]: https://play.google.com/store/apps/details?id=org.connectbot +[18]: https://opensource.com/sites/default/files/uploads/termux.jpg "Termux" +[19]: https://termux.com/ +[20]: https://play.google.com/store/apps/details?id=com.termux +[21]: https://f-droid.org/packages/com.termux/ From 9e13487013ea1856120f26772b9ef6f9f84ca282 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 2 Jun 2019 23:44:53 +0800 Subject: [PATCH 0694/1154] PRF:20190417 Inter-process communication in Linux- Sockets and signals.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @FSSlc 辛苦了! --- ...unication in Linux- Sockets and signals.md | 78 ++++++++++--------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md b/translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md index 4e7a06c983..8f2b373d39 100644 --- a/translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md +++ b/translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md @@ -1,6 +1,6 @@ [#]: collector: "lujun9972" [#]: translator: "FSSlc" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "Inter-process communication in Linux: Sockets and signals" @@ -10,21 +10,21 @@ Linux 下的进程间通信:套接字和信号 ====== -学习在 Linux 中进程是如何与其他进程进行同步的。 +> 学习在 Linux 中进程是如何与其他进程进行同步的。 -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mesh_networking_dots_connected.png?itok=ovINTRR3) +![](https://img.linux.net.cn/data/attachment/album/201906/02/234437y6gig4tg4yy94356.jpg) -本篇是 Linux 下[进程间通信][1](IPC)系列的第三篇同时也是最后一篇文章。[第一篇文章][2]聚焦在通过共享存储(文件和共享内存段)来进行 IPC,[第二篇文章][3]则通过管道(无名的或者有名的)及消息队列来达到相同的目的。这篇文章将目光从高处(套接字)然后到低处(信号)来关注 IPC。代码示例将用力地充实下面的解释细节。 +本篇是 Linux 下[进程间通信][1](IPC)系列的第三篇同时也是最后一篇文章。[第一篇文章][2]聚焦在通过共享存储(文件和共享内存段)来进行 IPC,[第二篇文章][3]则通过管道(无名的或者命名的)及消息队列来达到相同的目的。这篇文章将目光从高处(套接字)然后到低处(信号)来关注 IPC。代码示例将用力地充实下面的解释细节。 ### 套接字 -正如管道有两种类型(有名和无名)一样,套接字也有两种类型。IPC 套接字(即 Unix domain socket)给予进程在相同设备(主机)上基于通道的通信能力;而网络套接字给予进程运行在不同主机的能力,因此也带来了网络通信的能力。网络套接字需要底层协议的支持,例如 TCP(传输控制协议)或 UDP(用户数据报协议)。 +正如管道有两种类型(命名和无名)一样,套接字也有两种类型。IPC 套接字(即 Unix 套接字)给予进程在相同设备(主机)上基于通道的通信能力;而网络套接字给予进程运行在不同主机的能力,因此也带来了网络通信的能力。网络套接字需要底层协议的支持,例如 TCP(传输控制协议)或 UDP(用户数据报协议)。 -与之相反,IPC 套接字依赖于本地系统内核的支持来进行通信;特别的,IPC 通信使用一个本地的文件作为套接字地址。尽管这两种套接字的实现有所不同,但在本质上,IPC 套接字和网络套接字的 API 是一致的。接下来的例子将包含网络套接字的内容,但示例服务器和客户端程序可以在相同的机器上运行,因为服务器使用了 localhost(127.0.0.1)这个网络地址,该地址表示的是本地机器上的本地机器的地址。 +与之相反,IPC 套接字依赖于本地系统内核的支持来进行通信;特别的,IPC 通信使用一个本地的文件作为套接字地址。尽管这两种套接字的实现有所不同,但在本质上,IPC 套接字和网络套接字的 API 是一致的。接下来的例子将包含网络套接字的内容,但示例服务器和客户端程序可以在相同的机器上运行,因为服务器使用了 `localhost`(127.0.0.1)这个网络地址,该地址表示的是本地机器上的本地机器地址。 套接字以流的形式(下面将会讨论到)被配置为双向的,并且其控制遵循 C/S(客户端/服务器端)模式:客户端通过尝试连接一个服务器来初始化对话,而服务器端将尝试接受该连接。假如万事顺利,来自客户端的请求和来自服务器端的响应将通过管道进行传输,直到其中任意一方关闭该通道,从而断开这个连接。 -一个`迭代服务器`(只适用于开发)将一直和连接它的客户端打交道:从最开始服务第一个客户端,然后到这个连接关闭,然后服务第二个客户端,循环往复。这种方式的一个缺点是处理一个特定的客户端可能会一直持续下去,使得其他的客户端一直在后面等待。生产级别的服务器将是并发的,通常使用了多进程或者多线程的混合。例如,我台式机上的 Nginx 网络服务器有一个 4 个 worker 的进程池,它们可以并发地处理客户端的请求。在下面的代码示例中,我们将使用迭代服务器,使得我们将要处理的问题达到一个很小的规模,只关注基本的 API,而不去关心并发的问题。 +一个迭代服务器(只适用于开发)将一直和连接它的客户端打交道:从最开始服务第一个客户端,然后到这个连接关闭,然后服务第二个客户端,循环往复。这种方式的一个缺点是处理一个特定的客户端可能会挂起,使得其他的客户端一直在后面等待。生产级别的服务器将是并发的,通常使用了多进程或者多线程的混合。例如,我台式机上的 Nginx 网络服务器有一个 4 个工人worker的进程池,它们可以并发地处理客户端的请求。在下面的代码示例中,我们将使用迭代服务器,使得我们将要处理的问题保持在一个很小的规模,只关注基本的 API,而不去关心并发的问题。 最后,随着各种 POSIX 改进的出现,套接字 API 随着时间的推移而发生了显著的变化。当前针对服务器端和客户端的示例代码特意写的比较简单,但是它着重强调了基于流的套接字中连接的双方。下面是关于流控制的一个总结,其中服务器端在一个终端中开启,而客户端在另一个不同的终端中开启: @@ -108,10 +108,10 @@ int main() { 上面的服务器端程序执行典型的 4 个步骤来准备回应客户端的请求,然后接受其他的独立请求。这里每一个步骤都以服务器端程序调用的系统函数来命名。 - 1. `socket(…)` : 为套接字连接获取一个文件描述符 - 2. `bind(…)` : 将套接字和服务器主机上的一个地址进行绑定 - 3. `listen(…)` : 监听客户端请求 - 4. `accept(…)` :接受一个特定的客户端请求 + 1. `socket(…)`:为套接字连接获取一个文件描述符 + 2. `bind(…)`:将套接字和服务器主机上的一个地址进行绑定 + 3. `listen(…)`:监听客户端请求 + 4. `accept(…)`:接受一个特定的客户端请求 上面的 `socket` 调用的完整形式为: @@ -121,7 +121,7 @@ int sockfd = socket(AF_INET,      /* versus AF_LOCAL */                     0);           /* system picks protocol (TCP) */ ``` -第一个参数特别指定了使用的是一个网络套接字,而不是 IPC 套接字。对于第二个参数有多种选项,但 `SOCK_STREAM` 和 `SOCK_DGRAM`(数据报)是最为常用的。基于流的套接字支持可信通道,在这种通道中如果发生了信息的丢失或者更改,都将会被报告。这种通道是双向的,并且从一端到另外一端的有效载荷在大小上可以是任意的。相反的,基于数据报的套接字大多是不可信的,没有方向性,并且需要固定大小的载荷。`socket` 的第三个参数特别指定了协议。对于这里展示的基于流的套接字,只有一种协议选择:TCP,在这里表示的 `0`;。因为对 `socket` 的一次成功调用将返回相似的文件描述符,一个套接字将会被读写,对应的语法和读写一个本地文件是类似的。 +第一个参数特别指定了使用的是一个网络套接字,而不是 IPC 套接字。对于第二个参数有多种选项,但 `SOCK_STREAM` 和 `SOCK_DGRAM`(数据报)是最为常用的。基于流的套接字支持可信通道,在这种通道中如果发生了信息的丢失或者更改,都将会被报告。这种通道是双向的,并且从一端到另外一端的有效载荷在大小上可以是任意的。相反的,基于数据报的套接字大多是不可信的,没有方向性,并且需要固定大小的载荷。`socket` 的第三个参数特别指定了协议。对于这里展示的基于流的套接字,只有一种协议选择:TCP,在这里表示的 `0`。因为对 `socket` 的一次成功调用将返回相似的文件描述符,套接字可以被读写,对应的语法和读写一个本地文件是类似的。 对 `bind` 的调用是最为复杂的,因为它反映出了在套接字 API 方面上的各种改进。我们感兴趣的点是这个调用将一个套接字和服务器端所在机器中的一个内存地址进行绑定。但对 `listen` 的调用就非常直接了: @@ -131,9 +131,9 @@ if (listen(fd, MaxConnects) < 0) 第一个参数是套接字的文件描述符,第二个参数则指定了在服务器端处理一个拒绝连接错误之前,有多少个客户端连接被允许连接。(在头文件 `sock.h` 中 `MaxConnects` 的值被设置为 `8`。) -`accept` 调用默认将是一个拥塞等待:服务器端将不做任何事情直到一个客户端尝试连接它,然后进行处理。`accept` 函数返回的值如果是 `-1` 则暗示有错误发生。假如这个调用是成功的,则它将返回另一个文件描述符,这个文件描述符被用来指代另一个可读可写的套接字,它与 `accept` 调用中的第一个参数对应的接收套接字有所不同。服务器端使用这个可读可写的套接字来从客户端读取请求然后写回它的回应。接收套接字只被用于接受客户端的连接。 +`accept` 调用默认将是一个阻塞等待:服务器端将不做任何事情直到一个客户端尝试连接它,然后进行处理。`accept` 函数返回的值如果是 `-1` 则暗示有错误发生。假如这个调用是成功的,则它将返回另一个文件描述符,这个文件描述符被用来指代另一个可读可写的套接字,它与 `accept` 调用中的第一个参数对应的接收套接字有所不同。服务器端使用这个可读可写的套接字来从客户端读取请求然后写回它的回应。接收套接字只被用于接受客户端的连接。 -在设计上,一个服务器端可以一直运行下去。当然服务器端可以通过在命令行中使用 `Ctrl+C` 来终止它。 +在设计上,服务器端可以一直运行下去。当然服务器端可以通过在命令行中使用 `Ctrl+C` 来终止它。 #### 示例 2. 使用套接字的客户端 @@ -207,25 +207,25 @@ int main() { if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) ``` -对 `connect` 的调用可能因为多种原因而导致失败,例如客户端拥有错误的服务器端地址或者已经有太多的客户端连接上了服务器端。假如 `connect` 操作成功,客户端将在一个 `for` 循环中,写入它的响应然后读取返回的响应。在经过会话后,服务器端和客户端都将调用 `close` 去关闭可读可写套接字,尽管其中一个关闭操作已经足以关闭他们之间的连接,但此时客户端可能就此关闭,但正如前面提到的那样,服务器端将一直保持开放以处理其他事务。 +对 `connect` 的调用可能因为多种原因而导致失败,例如客户端拥有错误的服务器端地址或者已经有太多的客户端连接上了服务器端。假如 `connect` 操作成功,客户端将在一个 `for` 循环中,写入它的请求然后读取返回的响应。在会话后,服务器端和客户端都将调用 `close` 去关闭这个可读可写套接字,尽管任何一边的关闭操作就足以关闭它们之间的连接。此后客户端可以退出了,但正如前面提到的那样,服务器端可以一直保持开放以处理其他事务。 -从上面的套接示例中,我们看到了请求信息被返回给客户端,这使得客户端和服务器端之间拥有进行丰富对话的可能性。也许这就是套接字的主要魅力。在现代系统中,客户端应用(例如一个数据库客户端)和服务器端通过套接字进行通信非常常见。正如先前提及的那样,本地 IPC 套接字和网络套接字只在某些实现细节上面有所不同,一般来说,IPC 套接字有着更低的消耗和更好的性能。它们的通信 API 基本是一样的。 +从上面的套接字示例中,我们看到了请求信息被回显给客户端,这使得客户端和服务器端之间拥有进行丰富对话的可能性。也许这就是套接字的主要魅力。在现代系统中,客户端应用(例如一个数据库客户端)和服务器端通过套接字进行通信非常常见。正如先前提及的那样,本地 IPC 套接字和网络套接字只在某些实现细节上面有所不同,一般来说,IPC 套接字有着更低的消耗和更好的性能。它们的通信 API 基本是一样的。 ### 信号 -一个信号中断了一个正在执行的程序,在这种意义下,就是用信号与这个程序进行通信。大多数的信号要么可以被忽略(阻塞)或者被处理(通过特别设计的代码)。`SIGSTOP` (暂停)和 `SIGKILL`(立即停止)是最应该提及的两种信号。符号常数拥有整数类型的值,例如 `SIGKILL` 对应的值为 `9`。 +信号会中断一个正在执行的程序,在这种意义下,就是用信号与这个程序进行通信。大多数的信号要么可以被忽略(阻塞)或者被处理(通过特别设计的代码)。`SIGSTOP` (暂停)和 `SIGKILL`(立即停止)是最应该提及的两种信号。这种符号常量有整数类型的值,例如 `SIGKILL` 对应的值为 `9`。 -信号可以在与用户交互的情况下发生。例如,一个用户从命令行中敲了 `Ctrl+C` 来从命令行中终止一个程序;`Ctrl+C` 将产生一个 `SIGTERM` 信号。针对终止,`SIGTERM` 信号可以被阻塞或者被处理,而不像 `SIGKILL` 信号那样。一个进程也可以通过信号和另一个进程通信,这样使得信号也可以作为一种 IPC 机制。 +信号可以在与用户交互的情况下发生。例如,一个用户从命令行中敲了 `Ctrl+C` 来终止一个从命令行中启动的程序;`Ctrl+C` 将产生一个 `SIGTERM` 信号。`SIGTERM` 意即终止,它可以被阻塞或者被处理,而不像 `SIGKILL` 信号那样。一个进程也可以通过信号和另一个进程通信,这样使得信号也可以作为一种 IPC 机制。 考虑一下一个多进程应用,例如 Nginx 网络服务器是如何被另一个进程优雅地关闭的。`kill` 函数: ``` int kill(pid_t pid, int signum); /* declaration */ ``` -bei -可以被一个进程用来终止另一个进程或者一组进程。假如 `kill` 函数的第一个参数是大于 `0` 的,那么这个参数将会被认为是目标进程的 pid(进程 ID),假如这个参数是 `0`,则这个参数将会被识别为信号发送者所属的那组进程。 -`kill` 的第二个参数要么是一个标准的信号数字(例如 `SIGTERM` 或 `SIGKILL`),要么是 `0` ,这将会对信号做一次询问,确认第一个参数中的 pid 是否是有效的。这样将一个多进程应用的优雅地关闭就可以通过向组成该应用的一组进程发送一个终止信号来完成,具体来说就是调用一个 `kill` 函数,使得这个调用的第二个参数是 `SIGTERM` 。(Nginx 主进程可以通过调用 `kill` 函数来终止其他 worker 进程,然后再停止自己。)就像许多库函数一样,`kill` 函数通过一个简单的可变语法拥有更多的能力和灵活性。 +可以被一个进程用来终止另一个进程或者一组进程。假如 `kill` 函数的第一个参数是大于 `0` 的,那么这个参数将会被认为是目标进程的 `pid`(进程 ID),假如这个参数是 `0`,则这个参数将会被视作信号发送者所属的那组进程。 + +`kill` 的第二个参数要么是一个标准的信号数字(例如 `SIGTERM` 或 `SIGKILL`),要么是 `0` ,这将会对信号做一次询问,确认第一个参数中的 `pid` 是否是有效的。这样优雅地关闭一个多进程应用就可以通过向组成该应用的一组进程发送一个终止信号来完成,具体来说就是调用一个 `kill` 函数,使得这个调用的第二个参数是 `SIGTERM` 。(Nginx 主进程可以通过调用 `kill` 函数来终止其他工人进程,然后再停止自己。)就像许多库函数一样,`kill` 函数通过一个简单的可变语法拥有更多的能力和灵活性。 #### 示例 3. 一个多进程系统的优雅停止 @@ -290,9 +290,9 @@ int main() { 上面的停止程序模拟了一个多进程系统的优雅退出,在这个例子中,这个系统由一个父进程和一个子进程组成。这次模拟的工作流程如下: - * 父进程尝试去 fork 一个子进程。假如这个 fork 操作成功了,每个进程就执行它自己的代码:子进程就执行函数 `child_code`,而父进程就执行函数 `parent_code`。 - * 子进程将会进入一个潜在的无限循环,在这个循环中子进程将睡眠一秒,然后打印一个信息,接着再次进入睡眠状态,以此循环往复。来自父进程的一个 `SIGTERM` 信号将引起子进程去执行一个信号处理回调函数 `graceful`。这样这个信号就使得子进程可以跳出循环,然后进行子进程和父进程之间的优雅终止。在终止之前子,进程将打印一个信息。 - * 在 fork 一个子进程后,父进程将睡眠 5 秒,使得子进程可以执行一会儿;当然在这个模拟中,子进程大多数时间都在睡眠。然后父进程调用 `SIGTERM` 作为第二个参数的 `kill` 函数,等待子进程的终止,然后自己再终止。 + * 父进程尝试去 `fork` 一个子进程。假如这个 `fork` 操作成功了,每个进程就执行它自己的代码:子进程就执行函数 `child_code`,而父进程就执行函数 `parent_code`。 + * 子进程将会进入一个潜在的无限循环,在这个循环中子进程将睡眠一秒,然后打印一个信息,接着再次进入睡眠状态,以此循环往复。来自父进程的一个 `SIGTERM` 信号将引起子进程去执行一个信号处理回调函数 `graceful`。这样这个信号就使得子进程可以跳出循环,然后进行子进程和父进程之间的优雅终止。在终止之前,进程将打印一个信息。 + * 在 `fork` 一个子进程后,父进程将睡眠 5 秒,使得子进程可以执行一会儿;当然在这个模拟中,子进程大多数时间都在睡眠。然后父进程调用 `SIGTERM` 作为第二个参数的 `kill` 函数,等待子进程的终止,然后自己再终止。 下面是一次运行的输出: @@ -309,22 +309,23 @@ Parent sleeping for a time... My child terminated, about to exit myself... ``` -对于信号的处理,上面的示例使用了 `sigaction` 库函数(POSIX 推荐的用法)而不是传统的 `signal` 函数,`signal` 函数有轻便性问题。下面是我们主要关心的代码片段: +对于信号的处理,上面的示例使用了 `sigaction` 库函数(POSIX 推荐的用法)而不是传统的 `signal` 函数,`signal` 函数有移植性问题。下面是我们主要关心的代码片段: - * 假如对 `fork` 的调用成功了,父进程将执行 `parent_code` 函数,而子进程将执行 `child_code` 函数。在给子进程发送信号之前,父进程将会等待 5 秒: +* 假如对 `fork` 的调用成功了,父进程将执行 `parent_code` 函数,而子进程将执行 `child_code` 函数。在给子进程发送信号之前,父进程将会等待 5 秒: -``` - puts("Parent sleeping for a time..."); + ``` +puts("Parent sleeping for a time..."); sleep(5); if (-1 == kill(cpid, SIGTERM)) { ...sleepkillcpidSIGTERM... ``` -假如 `kill` 调用成功了,父进程将在子进程终止时做等待,使得子进程不会变成一个僵尸进程。在等待完成后,父进程再退出。 - * `child_code` 函数首先调用 `set_handler` 然后进入它的可能永久睡眠的循环。下面是我们将要查看的 `set_handler` 函数: + 假如 `kill` 调用成功了,父进程将在子进程终止时做等待,使得子进程不会变成一个僵尸进程。在等待完成后,父进程再退出。 -``` - void set_handler() { +* `child_code` 函数首先调用 `set_handler` 然后进入它的可能永久睡眠的循环。下面是我们将要查看的 `set_handler` 函数: + + ``` +void set_handler() {   struct sigaction current;            /* current setup */   sigemptyset(¤t.sa_mask);       /* clear the signal set */   current.sa_flags = 0;                /* for setting sa_handler, not sa_action */ @@ -333,21 +334,22 @@ if (-1 == kill(cpid, SIGTERM)) { } ``` -上面代码的前三行在做相关的准备。第四个语句将为 `graceful` 设定 handler ,它将在调用 `_exit` 来停止之前打印一些信息。第 5 行和最后一行的语句将通过调用 `sigaction` 来向系统注册上面的 handler。`sigaction` 的第一个参数是 `SIGTERM` ,用作终止;第二个参数是当前的 `sigaction` 设定,而最后的参数(在这个例子中是 `NULL` )可被用来保存前面的 `sigaction` 设定,以备后面的可能使用。 + 上面代码的前三行在做相关的准备。第四个语句将为 `graceful` 设定为句柄,它将在调用 `_exit` 来停止之前打印一些信息。第 5 行和最后一行的语句将通过调用 `sigaction` 来向系统注册上面的句柄。`sigaction` 的第一个参数是 `SIGTERM` ,用作终止;第二个参数是当前的 `sigaction` 设定,而最后的参数(在这个例子中是 `NULL` )可被用来保存前面的 `sigaction` 设定,以备后面的可能使用。 使用信号来作为 IPC 的确是一个很轻量的方法,但确实值得尝试。通过信号来做 IPC 显然可以被归入 IPC 工具箱中。 ### 这个系列的总结 在这个系列中,我们通过三篇有关 IPC 的文章,用示例代码介绍了如下机制: + * 共享文件 * 共享内存(通过信号量) - * 管道(有名和无名) + * 管道(命名和无名) * 消息队列 * 套接字 * 信号 -甚至在今天,在以线程为中心的语言,例如 Java、C# 和 Go 等变得越来越流行的情况下,IPC 仍然很受欢迎,因为相比于使用多线程,通过多进程来实现并发有着一个明显的优势:默认情况下,每个进程都有它自己的地址空间,除非使用了基于共享内存的 IPC 机制(为了达到安全的并发,竞争条件在多线程和多进程的时候必须被加上锁。),在多进程中可以排除掉基于内存的竞争条件。对于任何一个写过甚至是通过共享变量来通信的基本多线程程序的人来说,TA 都会知道想要写一个清晰、高效、线程安全的代码是多么具有挑战性。使用单线程的多进程的确是很有吸引力的,这是一个切实可行的方式,使用它可以利用好今天多处理器的机器,而不需要面临基于内存的竞争条件的风险。 +甚至在今天,在以线程为中心的语言,例如 Java、C# 和 Go 等变得越来越流行的情况下,IPC 仍然很受欢迎,因为相比于使用多线程,通过多进程来实现并发有着一个明显的优势:默认情况下,每个进程都有它自己的地址空间,除非使用了基于共享内存的 IPC 机制(为了达到安全的并发,竞争条件在多线程和多进程的时候必须被加上锁),在多进程中可以排除掉基于内存的竞争条件。对于任何一个写过即使是基本的通过共享变量来通信的多线程程序的人来说,他都会知道想要写一个清晰、高效、线程安全的代码是多么具有挑战性。使用单线程的多进程的确是很有吸引力的,这是一个切实可行的方式,使用它可以利用好今天多处理器的机器,而不需要面临基于内存的竞争条件的风险。 当然,没有一个简单的答案能够回答上述 IPC 机制中的哪一个更好。在编程中每一种 IPC 机制都会涉及到一个取舍问题:是追求简洁,还是追求功能强大。以信号来举例,它是一个相对简单的 IPC 机制,但并不支持多个进程之间的丰富对话。假如确实需要这样的对话,另外的选择可能会更合适一些。带有锁的共享文件则相对直接,但是当要处理大量共享的数据流时,共享文件并不能很高效地工作。管道,甚至是套接字,有着更复杂的 API,可能是更好的选择。让具体的问题去指导我们的选择吧。 @@ -360,13 +362,13 @@ via: https://opensource.com/article/19/4/interprocess-communication-linux-networ 作者:[Marty Kalin][a] 选题:[lujun9972][b] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/mkalindepauledu [b]: https://github.com/lujun9972 [1]: https://en.wikipedia.org/wiki/Inter-process_communication -[2]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-1 -[3]: https://opensource.com/article/19/4/interprocess-communication-ipc-linux-part-2 +[2]: https://linux.cn/article-10826-1.html +[3]: https://linux.cn/article-10845-1.html [4]: http://condor.depaul.edu/mkalin From e95fad0853813a375104924a8e52d13566fe4471 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 2 Jun 2019 23:45:28 +0800 Subject: [PATCH 0695/1154] PUB:20190417 Inter-process communication in Linux- Sockets and signals.md @FSSlc https://linux.cn/article-10930-1.html --- ...ter-process communication in Linux- Sockets and signals.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190417 Inter-process communication in Linux- Sockets and signals.md (99%) diff --git a/translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md b/published/20190417 Inter-process communication in Linux- Sockets and signals.md similarity index 99% rename from translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md rename to published/20190417 Inter-process communication in Linux- Sockets and signals.md index 8f2b373d39..7a4c304246 100644 --- a/translated/tech/20190417 Inter-process communication in Linux- Sockets and signals.md +++ b/published/20190417 Inter-process communication in Linux- Sockets and signals.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "FSSlc" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10930-1.html" [#]: subject: "Inter-process communication in Linux: Sockets and signals" [#]: via: "https://opensource.com/article/19/4/interprocess-communication-linux-networking" [#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu" From 63867b894eb966d21d85a119443c6d8fe9f85da8 Mon Sep 17 00:00:00 2001 From: chen ni Date: Sun, 2 Jun 2019 23:54:48 +0800 Subject: [PATCH 0696/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...2 French IT giant Atos enters the edge-computing business.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md b/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md index def37a0025..15c40d8065 100644 --- a/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md +++ b/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chen-ni) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 09a98d00e8825034064db5c5c6eb1ac8d940fc20 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sun, 2 Jun 2019 09:02:46 -0700 Subject: [PATCH 0697/1154] Submit Translated Passage for Review Submit Translated Passage for Review --- ...ulate matter sensor with a Raspberry Pi.md | 126 ----------------- ...ulate matter sensor with a Raspberry Pi.md | 128 ++++++++++++++++++ 2 files changed, 128 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md create mode 100644 translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md diff --git a/sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md b/sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md deleted file mode 100644 index 8efc47ae76..0000000000 --- a/sources/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tomjlw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to build a mobile particulate matter sensor with a Raspberry Pi) -[#]: via: (https://opensource.com/article/19/3/mobile-particulate-matter-sensor) -[#]: author: (Stephan Tetzel https://opensource.com/users/stephan) - -How to build a mobile particulate matter sensor with a Raspberry Pi -====== - -Monitor your air quality with a Raspberry Pi, a cheap sensor, and an inexpensive display. - -![Team communication, chat][1] - -About a year ago, I wrote about [measuring air quality][2] using a Raspberry Pi and a cheap sensor. We've been using this project in our school and privately for a few years now. However, it has one disadvantage: It is not portable because it depends on a WLAN network or a wired network connection to work. You can't even access the sensor's measurements if the Raspberry Pi and the smartphone or computer are not on the same network. - -To overcome this limitation, we added a small screen to the Raspberry Pi so we can read the values directly from the device. Here's how we set up and configured a screen for our mobile fine particulate matter sensor. - -### Setting up the screen for the Raspberry Pi - -There is a wide range of Raspberry Pi displays available from [Amazon][3], AliExpress, and other sources. They range from ePaper screens to LCDs with touch function. We chose an inexpensive [3.5″ LCD][4] with touch and a resolution of 320×480 pixels that can be plugged directly into the Raspberry Pi's GPIO pins. It's also nice that a 3.5″ display is about the same size as a Raspberry Pi. - -The first time you turn on the screen and start the Raspberry Pi, the screen will remain white because the driver is missing. You have to install [the appropriate drivers][5] for the display first. Log in with SSH and execute the following commands: - -``` -$ rm -rf LCD-show -$ git clone -$ chmod -R 755 LCD-show -$ cd LCD-show/ -``` - -Execute the appropriate command for your screen to install the drivers. For example, this is the command for our model MPI3501 screen: - -``` -$ sudo ./LCD35-show -``` - -This command installs the appropriate drivers and restarts the Raspberry Pi. - -### Installing PIXEL desktop and setting up autostart - -Here is what we want our project to do: If the Raspberry Pi boots up, we want to display a small website with our air quality measurements. - -First, install the Raspberry Pi's [PIXEL desktop environment][6]: - -``` -$ sudo apt install raspberrypi-ui-mods -``` - -Then install the Chromium browser to display the website: - -``` -$ sudo apt install chromium-browser -``` - -Autologin is required for the measured values to be displayed directly after startup; otherwise, you will just see the login screen. However, autologin is not configured for the "pi" user by default. You can configure autologin with the **raspi-config** tool: - -``` -$ sudo raspi-config -``` - -In the menu, select: **3 Boot Options → B1 Desktop / CLI → B4 Desktop Autologin**. - -There is a step missing to start Chromium with our website right after boot. Create the folder **/home/pi/.config/lxsession/LXDE-pi/** : - -``` -$ mkdir -p /home/pi/config/lxsession/LXDE-pi/ -``` - -Then create the **autostart** file in this folder: - -``` -$ nano /home/pi/.config/lxsession/LXDE-pi/autostart -``` - -and paste the following code: - -``` -#@unclutter -@xset s off -@xset -dpms -@xset s noblank - -# Open Chromium in Full Screen Mode -@chromium-browser --incognito --kiosk -``` - -If you want to hide the mouse pointer, you have to install the package **unclutter** and remove the comment character at the beginning of the **autostart** file: - -``` -$ sudo apt install unclutter -``` - -![Mobile particulate matter sensor][7] - -I've made a few small changes to the code in the last year. So, if you set up the air quality project before, make sure to re-download the script and files for the AQI website using the instructions in the [original article][2]. - -By adding the touch screen, you now have a mobile particulate matter sensor! We use it at our school to check the quality of the air in the classrooms or to do comparative measurements. With this setup, you are no longer dependent on a network connection or WLAN. You can use the small measuring station everywhere—you can even use it with a power bank to be independent of the power grid. - -* * * - -_This article originally appeared on[Open School Solutions][8] and is republished with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/mobile-particulate-matter-sensor - -作者:[Stephan Tetzel][a] -选题:[lujun9972][b] -译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/stephan -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) -[2]: https://opensource.com/article/18/3/how-measure-particulate-matter-raspberry-pi -[3]: https://www.amazon.com/gp/search/ref=as_li_qf_sp_sr_tl?ie=UTF8&tag=openschoolsol-20&keywords=lcd%20raspberry&index=aps&camp=1789&creative=9325&linkCode=ur2&linkId=51d6d7676e10d6c7db203c4a8b3b529a -[4]: https://amzn.to/2CcvgpC -[5]: https://github.com/goodtft/LCD-show -[6]: https://opensource.com/article/17/1/try-raspberry-pis-pixel-os-your-pc -[7]: https://opensource.com/sites/default/files/uploads/mobile-aqi-sensor.jpg (Mobile particulate matter sensor) -[8]: https://openschoolsolutions.org/mobile-particulate-matter-sensor/ diff --git a/translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md b/translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md new file mode 100644 index 0000000000..4d3f128133 --- /dev/null +++ b/translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to build a mobile particulate matter sensor with a Raspberry Pi) +[#]: via: (https://opensource.com/article/19/3/mobile-particulate-matter-sensor) +[#]: author: (Stephan Tetzel https://opensource.com/users/stephan) + +如何用树莓派搭建一个颗粒物传感器 +====== + +用树莓派,一个廉价的传感器和一个便宜的屏幕监测空气质量 + +![小组交流,讨论][1] + +大约一年前,我写了一篇关于如何使用树莓派和廉价传感器测量[空气质量][2]的文章。我们这几年已在学校里和私下使用了这个项目。然而它有一个缺点:由于它基于无线/有线网,因此它不是便携的。如果你的树莓派,你的智能手机和电脑不在同一个网络的话,你甚至都不能访问传感器测量的数据。 + +为了弥补这一缺陷,我们给树莓派添加了一块小屏幕,这样我们就可以直接从该设备上读取数据。以下是我们如何为我们的移动细颗粒物传感器搭建并配置好屏幕。 + +### 为树莓派搭建好屏幕 + +在[亚马逊][3],阿里巴巴以及其它来源有许多可以获取的树莓派屏幕,从 ePaper 屏幕到可触控 LCD。我们选择了一个便宜的带触控功能且分辨率为320*480像素的[3.5英寸 LCD][3],可以直接插进树莓派的 GPIO 引脚。一个3.5英寸屏幕和树莓派几乎一样大,这一点不错。 + +当你第一次启动屏幕打开树莓派的时候,因为缺少驱动屏幕会保持白屏。你得首先为屏幕安装[合适的驱动][5]。通过 SSH 登入并执行以下命令: + +``` +$ rm -rf LCD-show +$ git clone +$ chmod -R 755 LCD-show +$ cd LCD-show/ +``` + +为你的屏幕执行合适的命令以安装驱动。例如这是给我们 MPI3501 型屏幕的命令: + +``` +$ sudo ./LCD35-show +``` + +这行命令会安装合适的驱动并重启树莓派。 + +### 安装 PIXEL 桌面并设置自动启动 + +以下是我们想要我们项目能够做到的事情:如果树莓派启动,我们想要展现一个有我们空气质量测量数据的网站。 + +首先,安装树莓派的[PIXEL 桌面环境][6]: + +``` +$ sudo apt install raspberrypi-ui-mods +``` + +然后安装 Chromium 浏览器以显示网站: + +``` +$ sudo apt install chromium-browser +``` + +需要自动登录以使测量数据在启动后直接显示;否则你将只会看到登录界面。然而自动登录并没有为树莓派用户默认设置好。你可以用 **raspi-config** 工具设置自动登录: + +``` +$ sudo raspi-config +``` + +在菜单中,选择:**3 Boot Options → B1 Desktop / CLI → B4 Desktop Autologin**。 + +在启动后用 Chromium 打开我们的网站这块少了一步。创建文件夹 +**/home/pi/.config/lxsession/LXDE-pi/**: + +``` +$ mkdir -p /home/pi/config/lxsession/LXDE-pi/ +``` + +然后在该文件夹里创建 **autostart** 文件: + +``` +$ nano /home/pi/.config/lxsession/LXDE-pi/autostart +``` + +并粘贴以下代码: + +``` +#@unclutter +@xset s off +@xset -dpms +@xset s noblank + +# Open Chromium in Full Screen Mode +@chromium-browser --incognito --kiosk +``` + +如果你想要隐藏鼠标指针,你得安装 **unclutter** 包并移除 **autostart** 文件开头的注释。 + +``` +$ sudo apt install unclutter +``` + +![移动颗粒物传感器][7] + +我对去年的代码做了些小修改。因此如果你之前搭建过空气质量项目,确保用[原文章][2]中的指导为 AQI 网站重新下载脚本和文件。 + +通过添加触摸屏,你现在拥有了一个移动颗粒物传感器!我们在学校用它来检查教室里的空气质量或者进行比较测量。使用这种配置,你无需再依赖网络连接或 WLAN。你可以在任何地方使用小型测量站——你甚至可以使用移动电源以摆脱电网。 + +* * * + +_这篇文章原来在[开源学校解决方案(Open Scool Solutions)][8]上发表,获得许可重新发布。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/mobile-particulate-matter-sensor + +作者:[Stephan Tetzel][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/stephan +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) +[2]: https://opensource.com/article/18/3/how-measure-particulate-matter-raspberry-pi +[3]: https://www.amazon.com/gp/search/ref=as_li_qf_sp_sr_tl?ie=UTF8&tag=openschoolsol-20&keywords=lcd%20raspberry&index=aps&camp=1789&creative=9325&linkCode=ur2&linkId=51d6d7676e10d6c7db203c4a8b3b529a +[4]: https://amzn.to/2CcvgpC +[5]: https://github.com/goodtft/LCD-show +[6]: https://opensource.com/article/17/1/try-raspberry-pis-pixel-os-your-pc +[7]: https://opensource.com/sites/default/files/uploads/mobile-aqi-sensor.jpg (Mobile particulate matter sensor) +[8]: https://openschoolsolutions.org/mobile-particulate-matter-sensor/ + From a3b964dbc917a21f6aa93a504a5740534d780f26 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 Jun 2019 00:20:20 +0800 Subject: [PATCH 0698/1154] PRF:20190409 5 open source mobile apps.md @fuzheng1998 --- .../20190409 5 open source mobile apps.md | 78 +++++++------------ 1 file changed, 28 insertions(+), 50 deletions(-) diff --git a/translated/tech/20190409 5 open source mobile apps.md b/translated/tech/20190409 5 open source mobile apps.md index 987affbcd5..9fad6cceff 100644 --- a/translated/tech/20190409 5 open source mobile apps.md +++ b/translated/tech/20190409 5 open source mobile apps.md @@ -1,92 +1,70 @@ [#]: collector: "lujun9972" -[#]: translator: "fuzheng1998 " -[#]: reviewer: " " +[#]: translator: "fuzheng1998" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "5 open source mobile apps" [#]: via: "https://opensource.com/article/19/4/mobile-apps" -[#]: author: "Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen" -5 个开源的移动应用 +5 个可以满足你的生产力、沟通和娱乐需求的开源手机应用 ====== -您可以依靠这些应用来满足您的生产力,沟通和娱乐需求。 -![][1] -像世界上大多数人一样,我拿手机连胳膊都懒得伸。 多亏了我从 Google Play 和 F-Droid 安装的开源移动应用程序,让我的 Android 设备好像提供了无限通信,生产力和娱乐服务一样。 +> 你可以依靠这些应用来满足你的生产力、沟通和娱乐需求。 -在我的手机上的许多开源应用程序中,当想听音乐; 与朋友,家人和同事联系; 或者在旅途中完成工作时,以下五个是我一直使用的。 +![](https://img.linux.net.cn/data/attachment/album/201906/03/001949brnq19j5qeqn3onv.jpg) + +像世界上大多数人一样,我的手似乎就没有离开过手机。多亏了我从 Google Play 和 F-Droid 安装的开源移动应用程序,让我的 Android 设备好像提供了无限的沟通、生产力和娱乐服务一样。 + +在我的手机上的许多开源应用程序中,当想听音乐、与朋友/家人和同事联系、或者在旅途中完成工作时,以下五个是我一直使用的。 ### MPDroid -_一个 Music Player Daemon (MPD)的 Android 控制器_ +一个音乐播放器进程 (MPD)的 Android 控制器。 ![MPDroid][2] -MPD 是将音乐从小型音乐服务器电脑传输到大型黑色立体声音箱的好方法。 它直接与 ALSA 对话,因此通过 ALSA 硬件接口与数模转换器( DAC )对话,它可以通过我的网络进行控制——但是用什么东西控制呢? 好吧,事实证明 MPDroid 是一个很棒的 MPD 控制器。 它管理我的音乐数据库,显示专辑封面,处理播放列表,并支持互联网广播。 而且它是开源的,所以如果某些东西不好用的话...... +MPD 是将音乐从小型音乐服务器电脑传输到大型的黑色立体声音箱的好方法。它直连 ALSA,因此可以通过 ALSA 硬件接口与数模转换器(DAC)对话,它可以通过我的网络进行控制——但是用什么东西控制呢?好吧,事实证明 MPDroid 是一个很棒的 MPD 控制器。它可以管理我的音乐数据库,显示专辑封面,处理播放列表,并支持互联网广播。而且它是开源的,所以如果某些东西不好用的话…… MPDroid 可在 [Google Play][4] 和 [F-Droid][5] 上找到。 ### RadioDroid -_一台只和 Chromecast 搭配使用的Android 网络收音机_ +一台能单独使用及与 Chromecast 搭配使用的 Android 网络收音机。 -** +![RadioDroid][6] -** - -** - -_![RadioDroid][6]_ - -好比 MPDroid 是管理我音乐的数据库,RadioDroid 是一个互联网广播; 从本质上讲,RadioDroid 是 [Internet-Radio.com][7] 的前端产品。 此外,通过将耳机插入 Android 设备,通过耳机插孔或 USB 将Android 设备直接连接到立体声系统,或通过兼容设备使用其 Chromecast 功能,可以享受 RadioDroid。这是一个查看芬兰天气情况,听取排名前 40 的西班牙语音乐,或收到到最新新闻消息的好方法。 +RadioDroid 是一个网络收音机,而 MPDroid 则管理我音乐的数据库;从本质上讲,RadioDroid 是 [Internet-Radio.com][7] 的一个前端。此外,通过将耳机插入 Android 设备,通过耳机插孔或 USB 将 Android 设备直接连接到立体声系统,或通过兼容设备使用其 Chromecast 功能,可以享受 RadioDroid。这是一个查看芬兰天气情况,听取排名前 40 的西班牙语音乐,或收到到最新新闻消息的好方法。 RadioDroid 可在 [Google Play][8] 和 [F-Droid][9] 上找到。 ### Signal -_一个支持 Android,iOS,还有桌面系统的安全即时消息客户端。_ +一个支持 Android、iOS,还有桌面系统的安全即时消息客户端。 -** +![Signal][10] -** +如果你喜欢 WhatsApp,但是因为它与 Facebook [日益密切][11]的关系而感到困扰,那么 Signal 应该是你的下一个产品。Signal 的唯一问题是说服你的朋友们最好用 Signal 取代 WhatsApp。但除此之外,它有一个与 WhatsApp 类似的界面;很棒的语音和视频通话;很好的加密;恰到好处的匿名;并且它受到了一个不打算通过使用软件来获利的基金会的支持。为什么不喜欢它呢? -** - -_![Signal][10]_ - -如果你喜欢 WhatsApp,但是因为它与 Facebook 日益密切的关系而感到困扰,那么 Signal 应该是你的下一个产品。Signal 的唯一问题是说服你的联系人他们最好用 Signal 取代 WhatsApp。但除此之外,它有一个与 WhatsApp 类似的界面; 很棒的语音和视频通话; 很好的加密; 恰到好处的匿名; 并且它受到了一个不打算通过使用软件来获利的基金会的支持。 为什么不喜欢它呢? - -Signal 可用于[Android][12],[iOS][13] 和 [桌面][14]。 +Signal 可用于 [Android][12]、[iOS][13] 和 [桌面][14]。 ### ConnectBot -_Android SSH 客户端_ +Android SSH 客户端。 -** +![ConnectBot][15] -** +有时我离电脑很远,但我需要登录服务器才能办事。[ConnectBot][16] 是将 SSH 会话搬到手机上的绝佳解决方案。 -** - -_![ConnectBot][15]_ - -有时我离电脑很远,但我需要登录服务器才能办事。 [ConnectBot][16]是将 SSH 会话搬到手机上的绝佳解决方案。 - -ConnectBot 可在[Google Play][17]上找到。 +ConnectBot 可在 [Google Play][17] 上找到。 ### Termux -_有多种实用工具的安卓终端模拟器_ +有多种熟悉的功能的安卓终端模拟器。 -** +![Termux][18] -** - -** - -_![Termux][18]_ - -你是否需要在手机上运行 **awk** 脚本? [Termux][19]是个解决方案。如果您需要做终端类型的东西,而且您不想一直保持与远程计算机的 SSH 连接,请使用 ConnectBot 将文件带到手机上,然后退出会话,在 Termux 中执行您的操作,用 ConnectBot 发回结果。 +你是否需要在手机上运行 `awk` 脚本?[Termux][19] 是个解决方案。如果你需要做终端类的工作,而且你不想一直保持与远程计算机的 SSH 连接,请使用 ConnectBot 将文件放到手机上,然后退出会话,在 Termux 中执行你的操作,用 ConnectBot 发回结果。 Termux 可在 [Google Play][20] 和 [F-Droid][21] 上找到。 @@ -98,10 +76,10 @@ Termux 可在 [Google Play][20] 和 [F-Droid][21] 上找到。 via: https://opensource.com/article/19/4/mobile-apps -作者:[Chris Hermansen (Community Moderator)][a] +作者:[Chris Hermansen][a] 选题:[lujun9972][b] 译者:[fuzheng1998](https://github.com/fuzheng1998) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7548326bccfe0ea888783f3cec7cc46ea8c975f1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 Jun 2019 00:20:58 +0800 Subject: [PATCH 0699/1154] PUB:20190409 5 open source mobile apps.md @fuzheng1998 https://linux.cn/article-10931-1.html --- .../tech => published}/20190409 5 open source mobile apps.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190409 5 open source mobile apps.md (98%) diff --git a/translated/tech/20190409 5 open source mobile apps.md b/published/20190409 5 open source mobile apps.md similarity index 98% rename from translated/tech/20190409 5 open source mobile apps.md rename to published/20190409 5 open source mobile apps.md index 9fad6cceff..e51f6dbc93 100644 --- a/translated/tech/20190409 5 open source mobile apps.md +++ b/published/20190409 5 open source mobile apps.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "fuzheng1998" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10931-1.html" [#]: subject: "5 open source mobile apps" [#]: via: "https://opensource.com/article/19/4/mobile-apps" [#]: author: "Chris Hermansen https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen" From ae1e0b5adc3c41a67a809668ead48adc7caa9d96 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 Jun 2019 00:28:23 +0800 Subject: [PATCH 0700/1154] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201905?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- published/{ => 201905}/20161106 Myths about -dev-urandom.md | 0 ... Build a game framework with Python using the module Pygame.md | 0 .../20171215 How to add a player to your Python game.md | 0 ... An introduction to the DomTerm terminal emulator for Linux.md | 0 ... A Command Line Tool To Search DuckDuckGo From The Terminal.md | 0 .../{ => 201905}/20180429 The Easiest PDO Tutorial (Basics).md | 0 ... hero without a villain- How to add one to your Python game.md | 0 .../20180605 How to use autofs to mount NFS shares.md | 0 .../20180611 3 open source alternatives to Adobe Lightroom.md | 0 .../20180725 Put platforms in a Python game with Pygame.md | 0 ...r Management Tool That Improve Battery Life On Linux Laptop.md | 0 .../20181218 Using Pygame to move your game character around.md | 0 published/{ => 201905}/20190107 Aliases- To Protect and Serve.md | 0 ...20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md | 0 ...al filesystems in Linux- Why we need them and how they work.md | 0 .../20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md | 0 ...190327 Why DevOps is the most important tech strategy today.md | 0 .../{ => 201905}/20190329 How to manage your Linux environment.md | 0 .../{ => 201905}/20190401 What is 5G- How is it better than 4G.md | 0 ...90405 Command line quick tips- Cutting content out of files.md | 0 ...20190408 Getting started with Python-s cryptography library.md | 0 ...How to quickly deploy, run Linux applications as unikernels.md | 0 .../20190409 Anbox - Easy Way To Run Android Apps On Linux.md | 0 .../20190409 How To Install And Configure Chrony As NTP Client.md | 0 ...To Install And Configure NTP Server And NTP Client In Linux.md | 0 .../20190411 Installing Ubuntu MATE on a Raspberry Pi.md | 0 ...0415 12 Single Board Computers- Alternative to Raspberry Pi.md | 0 ... And Disable (DOWN) A Network Interface Port (NIC) In Linux.md | 0 ...190415 Inter-process communication in Linux- Shared storage.md | 0 .../{ => 201905}/20190415 Kubernetes on Fedora IoT with k3s.md | 0 ...190416 Building a DNS-as-a-service with OpenStack Designate.md | 0 .../{ => 201905}/20190416 Detecting malaria with deep learning.md | 0 ...cess communication in Linux- Using pipes and message queues.md | 0 ...scalable social media sentiment analysis services in Python.md | 0 ...ting started with social media sentiment analysis in Python.md | 0 .../20190419 This is how System76 does open hardware.md | 0 ...0190422 2 new apps for music tweakers on Fedora Workstation.md | 0 ...environment-friendly open software projects you should know.md | 0 .../20190422 Tracking the weather with Python and Prometheus.md | 0 ... To Check The Default Gateway Or Router IP Address In Linux.md | 0 ... Disk I-O Activity Using iotop And iostat Commands In Linux.md | 0 .../20190425 Automate backups with restic and systemd.md | 0 .../{ => 201905}/20190430 Upgrading Fedora 29 to Fedora 30.md | 0 .../20190501 3 apps to manage personal finances in Fedora.md | 0 ...es critical security warning for Nexus data-center switches.md | 0 .../20190501 Write faster C extensions for Python with Cython.md | 0 .../20190502 Format Python however you like with Black.md | 0 ...et started with Libki to manage public user computer access.md | 0 published/{ => 201905}/20190503 API evolution the right way.md | 0 ...0190503 Check your spelling at the command line with Ispell.md | 0 .../20190503 Say goodbye to boilerplate in Python with attrs.md | 0 ...504 Add methods retroactively in Python with singledispatch.md | 0 .../20190504 Using the force at the Linux command line.md | 0 ...- A Collection Of Tools To Inspect And Visualize Disk Usage.md | 0 .../{ => 201905}/20190505 How To Create SSH Alias In Linux.md | 0 .../20190505 Kindd - A Graphical Frontend To dd Command.md | 0 ...nux Shell Script To Monitor Disk Space Usage And Send Email.md | 0 ...ng Multiple Servers And Show The Output In Top-like Text UI.md | 0 ...Installed Packages And Restore Those On Fresh Ubuntu System.md | 0 ...20190506 How to Add Application Shortcuts on Ubuntu Desktop.md | 0 .../20190508 How to use advanced rsync for large Linux backups.md | 0 ...1 Best Kali Linux Tools for Hacking and Penetration Testing.md | 0 ...190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md | 0 published/{ => 201905}/20190510 PHP in 2019.md | 0 .../20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md | 0 .../{ => 201905}/20190516 Building Smaller Container Images.md | 0 ...ing 10 years of GitHub data with GHTorrent and Libraries.io.md | 0 ...hange Power Modes in Ubuntu with Slimbook Battery Optimizer.md | 0 .../20190520 PiShrink - Make Raspberry Pi Images Smaller.md | 0 .../20190520 xsos - A Tool To Read SOSReport In Linux.md | 0 70 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201905}/20161106 Myths about -dev-urandom.md (100%) rename published/{ => 201905}/20171214 Build a game framework with Python using the module Pygame.md (100%) rename published/{ => 201905}/20171215 How to add a player to your Python game.md (100%) rename published/{ => 201905}/20180130 An introduction to the DomTerm terminal emulator for Linux.md (100%) rename published/{ => 201905}/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md (100%) rename published/{ => 201905}/20180429 The Easiest PDO Tutorial (Basics).md (100%) rename published/{ => 201905}/20180518 What-s a hero without a villain- How to add one to your Python game.md (100%) rename published/{ => 201905}/20180605 How to use autofs to mount NFS shares.md (100%) rename published/{ => 201905}/20180611 3 open source alternatives to Adobe Lightroom.md (100%) rename published/{ => 201905}/20180725 Put platforms in a Python game with Pygame.md (100%) rename published/{ => 201905}/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md (100%) rename published/{ => 201905}/20181218 Using Pygame to move your game character around.md (100%) rename published/{ => 201905}/20190107 Aliases- To Protect and Serve.md (100%) rename published/{ => 201905}/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md (100%) rename published/{ => 201905}/20190308 Virtual filesystems in Linux- Why we need them and how they work.md (100%) rename published/{ => 201905}/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md (100%) rename published/{ => 201905}/20190327 Why DevOps is the most important tech strategy today.md (100%) rename published/{ => 201905}/20190329 How to manage your Linux environment.md (100%) rename published/{ => 201905}/20190401 What is 5G- How is it better than 4G.md (100%) rename published/{ => 201905}/20190405 Command line quick tips- Cutting content out of files.md (100%) rename published/{ => 201905}/20190408 Getting started with Python-s cryptography library.md (100%) rename published/{ => 201905}/20190408 How to quickly deploy, run Linux applications as unikernels.md (100%) rename published/{ => 201905}/20190409 Anbox - Easy Way To Run Android Apps On Linux.md (100%) rename published/{ => 201905}/20190409 How To Install And Configure Chrony As NTP Client.md (100%) rename published/{ => 201905}/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md (100%) rename published/{ => 201905}/20190411 Installing Ubuntu MATE on a Raspberry Pi.md (100%) rename published/{ => 201905}/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md (100%) rename published/{ => 201905}/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md (100%) rename published/{ => 201905}/20190415 Inter-process communication in Linux- Shared storage.md (100%) rename published/{ => 201905}/20190415 Kubernetes on Fedora IoT with k3s.md (100%) rename published/{ => 201905}/20190416 Building a DNS-as-a-service with OpenStack Designate.md (100%) rename published/{ => 201905}/20190416 Detecting malaria with deep learning.md (100%) rename published/{ => 201905}/20190416 Inter-process communication in Linux- Using pipes and message queues.md (100%) rename published/{ => 201905}/20190419 Building scalable social media sentiment analysis services in Python.md (100%) rename published/{ => 201905}/20190419 Getting started with social media sentiment analysis in Python.md (100%) rename published/{ => 201905}/20190419 This is how System76 does open hardware.md (100%) rename published/{ => 201905}/20190422 2 new apps for music tweakers on Fedora Workstation.md (100%) rename published/{ => 201905}/20190422 8 environment-friendly open software projects you should know.md (100%) rename published/{ => 201905}/20190422 Tracking the weather with Python and Prometheus.md (100%) rename published/{ => 201905}/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md (100%) rename published/{ => 201905}/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md (100%) rename published/{ => 201905}/20190425 Automate backups with restic and systemd.md (100%) rename published/{ => 201905}/20190430 Upgrading Fedora 29 to Fedora 30.md (100%) rename published/{ => 201905}/20190501 3 apps to manage personal finances in Fedora.md (100%) rename published/{ => 201905}/20190501 Cisco issues critical security warning for Nexus data-center switches.md (100%) rename published/{ => 201905}/20190501 Write faster C extensions for Python with Cython.md (100%) rename published/{ => 201905}/20190502 Format Python however you like with Black.md (100%) rename published/{ => 201905}/20190502 Get started with Libki to manage public user computer access.md (100%) rename published/{ => 201905}/20190503 API evolution the right way.md (100%) rename published/{ => 201905}/20190503 Check your spelling at the command line with Ispell.md (100%) rename published/{ => 201905}/20190503 Say goodbye to boilerplate in Python with attrs.md (100%) rename published/{ => 201905}/20190504 Add methods retroactively in Python with singledispatch.md (100%) rename published/{ => 201905}/20190504 Using the force at the Linux command line.md (100%) rename published/{ => 201905}/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md (100%) rename published/{ => 201905}/20190505 How To Create SSH Alias In Linux.md (100%) rename published/{ => 201905}/20190505 Kindd - A Graphical Frontend To dd Command.md (100%) rename published/{ => 201905}/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md (100%) rename published/{ => 201905}/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md (100%) rename published/{ => 201905}/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md (100%) rename published/{ => 201905}/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md (100%) rename published/{ => 201905}/20190508 How to use advanced rsync for large Linux backups.md (100%) rename published/{ => 201905}/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md (100%) rename published/{ => 201905}/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md (100%) rename published/{ => 201905}/20190510 PHP in 2019.md (100%) rename published/{ => 201905}/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md (100%) rename published/{ => 201905}/20190516 Building Smaller Container Images.md (100%) rename published/{ => 201905}/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md (100%) rename published/{ => 201905}/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md (100%) rename published/{ => 201905}/20190520 PiShrink - Make Raspberry Pi Images Smaller.md (100%) rename published/{ => 201905}/20190520 xsos - A Tool To Read SOSReport In Linux.md (100%) diff --git a/published/20161106 Myths about -dev-urandom.md b/published/201905/20161106 Myths about -dev-urandom.md similarity index 100% rename from published/20161106 Myths about -dev-urandom.md rename to published/201905/20161106 Myths about -dev-urandom.md diff --git a/published/20171214 Build a game framework with Python using the module Pygame.md b/published/201905/20171214 Build a game framework with Python using the module Pygame.md similarity index 100% rename from published/20171214 Build a game framework with Python using the module Pygame.md rename to published/201905/20171214 Build a game framework with Python using the module Pygame.md diff --git a/published/20171215 How to add a player to your Python game.md b/published/201905/20171215 How to add a player to your Python game.md similarity index 100% rename from published/20171215 How to add a player to your Python game.md rename to published/201905/20171215 How to add a player to your Python game.md diff --git a/published/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/published/201905/20180130 An introduction to the DomTerm terminal emulator for Linux.md similarity index 100% rename from published/20180130 An introduction to the DomTerm terminal emulator for Linux.md rename to published/201905/20180130 An introduction to the DomTerm terminal emulator for Linux.md diff --git a/published/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md b/published/201905/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md similarity index 100% rename from published/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md rename to published/201905/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md diff --git a/published/20180429 The Easiest PDO Tutorial (Basics).md b/published/201905/20180429 The Easiest PDO Tutorial (Basics).md similarity index 100% rename from published/20180429 The Easiest PDO Tutorial (Basics).md rename to published/201905/20180429 The Easiest PDO Tutorial (Basics).md diff --git a/published/20180518 What-s a hero without a villain- How to add one to your Python game.md b/published/201905/20180518 What-s a hero without a villain- How to add one to your Python game.md similarity index 100% rename from published/20180518 What-s a hero without a villain- How to add one to your Python game.md rename to published/201905/20180518 What-s a hero without a villain- How to add one to your Python game.md diff --git a/published/20180605 How to use autofs to mount NFS shares.md b/published/201905/20180605 How to use autofs to mount NFS shares.md similarity index 100% rename from published/20180605 How to use autofs to mount NFS shares.md rename to published/201905/20180605 How to use autofs to mount NFS shares.md diff --git a/published/20180611 3 open source alternatives to Adobe Lightroom.md b/published/201905/20180611 3 open source alternatives to Adobe Lightroom.md similarity index 100% rename from published/20180611 3 open source alternatives to Adobe Lightroom.md rename to published/201905/20180611 3 open source alternatives to Adobe Lightroom.md diff --git a/published/20180725 Put platforms in a Python game with Pygame.md b/published/201905/20180725 Put platforms in a Python game with Pygame.md similarity index 100% rename from published/20180725 Put platforms in a Python game with Pygame.md rename to published/201905/20180725 Put platforms in a Python game with Pygame.md diff --git a/published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/published/201905/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md similarity index 100% rename from published/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md rename to published/201905/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md diff --git a/published/20181218 Using Pygame to move your game character around.md b/published/201905/20181218 Using Pygame to move your game character around.md similarity index 100% rename from published/20181218 Using Pygame to move your game character around.md rename to published/201905/20181218 Using Pygame to move your game character around.md diff --git a/published/20190107 Aliases- To Protect and Serve.md b/published/201905/20190107 Aliases- To Protect and Serve.md similarity index 100% rename from published/20190107 Aliases- To Protect and Serve.md rename to published/201905/20190107 Aliases- To Protect and Serve.md diff --git a/published/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/published/201905/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md similarity index 100% rename from published/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md rename to published/201905/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md diff --git a/published/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/published/201905/20190308 Virtual filesystems in Linux- Why we need them and how they work.md similarity index 100% rename from published/20190308 Virtual filesystems in Linux- Why we need them and how they work.md rename to published/201905/20190308 Virtual filesystems in Linux- Why we need them and how they work.md diff --git a/published/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/published/201905/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md similarity index 100% rename from published/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md rename to published/201905/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md diff --git a/published/20190327 Why DevOps is the most important tech strategy today.md b/published/201905/20190327 Why DevOps is the most important tech strategy today.md similarity index 100% rename from published/20190327 Why DevOps is the most important tech strategy today.md rename to published/201905/20190327 Why DevOps is the most important tech strategy today.md diff --git a/published/20190329 How to manage your Linux environment.md b/published/201905/20190329 How to manage your Linux environment.md similarity index 100% rename from published/20190329 How to manage your Linux environment.md rename to published/201905/20190329 How to manage your Linux environment.md diff --git a/published/20190401 What is 5G- How is it better than 4G.md b/published/201905/20190401 What is 5G- How is it better than 4G.md similarity index 100% rename from published/20190401 What is 5G- How is it better than 4G.md rename to published/201905/20190401 What is 5G- How is it better than 4G.md diff --git a/published/20190405 Command line quick tips- Cutting content out of files.md b/published/201905/20190405 Command line quick tips- Cutting content out of files.md similarity index 100% rename from published/20190405 Command line quick tips- Cutting content out of files.md rename to published/201905/20190405 Command line quick tips- Cutting content out of files.md diff --git a/published/20190408 Getting started with Python-s cryptography library.md b/published/201905/20190408 Getting started with Python-s cryptography library.md similarity index 100% rename from published/20190408 Getting started with Python-s cryptography library.md rename to published/201905/20190408 Getting started with Python-s cryptography library.md diff --git a/published/20190408 How to quickly deploy, run Linux applications as unikernels.md b/published/201905/20190408 How to quickly deploy, run Linux applications as unikernels.md similarity index 100% rename from published/20190408 How to quickly deploy, run Linux applications as unikernels.md rename to published/201905/20190408 How to quickly deploy, run Linux applications as unikernels.md diff --git a/published/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/published/201905/20190409 Anbox - Easy Way To Run Android Apps On Linux.md similarity index 100% rename from published/20190409 Anbox - Easy Way To Run Android Apps On Linux.md rename to published/201905/20190409 Anbox - Easy Way To Run Android Apps On Linux.md diff --git a/published/20190409 How To Install And Configure Chrony As NTP Client.md b/published/201905/20190409 How To Install And Configure Chrony As NTP Client.md similarity index 100% rename from published/20190409 How To Install And Configure Chrony As NTP Client.md rename to published/201905/20190409 How To Install And Configure Chrony As NTP Client.md diff --git a/published/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/published/201905/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md similarity index 100% rename from published/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md rename to published/201905/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md diff --git a/published/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/published/201905/20190411 Installing Ubuntu MATE on a Raspberry Pi.md similarity index 100% rename from published/20190411 Installing Ubuntu MATE on a Raspberry Pi.md rename to published/201905/20190411 Installing Ubuntu MATE on a Raspberry Pi.md diff --git a/published/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/published/201905/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md similarity index 100% rename from published/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md rename to published/201905/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md diff --git a/published/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/published/201905/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md similarity index 100% rename from published/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md rename to published/201905/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md diff --git a/published/20190415 Inter-process communication in Linux- Shared storage.md b/published/201905/20190415 Inter-process communication in Linux- Shared storage.md similarity index 100% rename from published/20190415 Inter-process communication in Linux- Shared storage.md rename to published/201905/20190415 Inter-process communication in Linux- Shared storage.md diff --git a/published/20190415 Kubernetes on Fedora IoT with k3s.md b/published/201905/20190415 Kubernetes on Fedora IoT with k3s.md similarity index 100% rename from published/20190415 Kubernetes on Fedora IoT with k3s.md rename to published/201905/20190415 Kubernetes on Fedora IoT with k3s.md diff --git a/published/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/published/201905/20190416 Building a DNS-as-a-service with OpenStack Designate.md similarity index 100% rename from published/20190416 Building a DNS-as-a-service with OpenStack Designate.md rename to published/201905/20190416 Building a DNS-as-a-service with OpenStack Designate.md diff --git a/published/20190416 Detecting malaria with deep learning.md b/published/201905/20190416 Detecting malaria with deep learning.md similarity index 100% rename from published/20190416 Detecting malaria with deep learning.md rename to published/201905/20190416 Detecting malaria with deep learning.md diff --git a/published/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/published/201905/20190416 Inter-process communication in Linux- Using pipes and message queues.md similarity index 100% rename from published/20190416 Inter-process communication in Linux- Using pipes and message queues.md rename to published/201905/20190416 Inter-process communication in Linux- Using pipes and message queues.md diff --git a/published/20190419 Building scalable social media sentiment analysis services in Python.md b/published/201905/20190419 Building scalable social media sentiment analysis services in Python.md similarity index 100% rename from published/20190419 Building scalable social media sentiment analysis services in Python.md rename to published/201905/20190419 Building scalable social media sentiment analysis services in Python.md diff --git a/published/20190419 Getting started with social media sentiment analysis in Python.md b/published/201905/20190419 Getting started with social media sentiment analysis in Python.md similarity index 100% rename from published/20190419 Getting started with social media sentiment analysis in Python.md rename to published/201905/20190419 Getting started with social media sentiment analysis in Python.md diff --git a/published/20190419 This is how System76 does open hardware.md b/published/201905/20190419 This is how System76 does open hardware.md similarity index 100% rename from published/20190419 This is how System76 does open hardware.md rename to published/201905/20190419 This is how System76 does open hardware.md diff --git a/published/20190422 2 new apps for music tweakers on Fedora Workstation.md b/published/201905/20190422 2 new apps for music tweakers on Fedora Workstation.md similarity index 100% rename from published/20190422 2 new apps for music tweakers on Fedora Workstation.md rename to published/201905/20190422 2 new apps for music tweakers on Fedora Workstation.md diff --git a/published/20190422 8 environment-friendly open software projects you should know.md b/published/201905/20190422 8 environment-friendly open software projects you should know.md similarity index 100% rename from published/20190422 8 environment-friendly open software projects you should know.md rename to published/201905/20190422 8 environment-friendly open software projects you should know.md diff --git a/published/20190422 Tracking the weather with Python and Prometheus.md b/published/201905/20190422 Tracking the weather with Python and Prometheus.md similarity index 100% rename from published/20190422 Tracking the weather with Python and Prometheus.md rename to published/201905/20190422 Tracking the weather with Python and Prometheus.md diff --git a/published/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/published/201905/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md similarity index 100% rename from published/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md rename to published/201905/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md diff --git a/published/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/published/201905/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md similarity index 100% rename from published/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md rename to published/201905/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md diff --git a/published/20190425 Automate backups with restic and systemd.md b/published/201905/20190425 Automate backups with restic and systemd.md similarity index 100% rename from published/20190425 Automate backups with restic and systemd.md rename to published/201905/20190425 Automate backups with restic and systemd.md diff --git a/published/20190430 Upgrading Fedora 29 to Fedora 30.md b/published/201905/20190430 Upgrading Fedora 29 to Fedora 30.md similarity index 100% rename from published/20190430 Upgrading Fedora 29 to Fedora 30.md rename to published/201905/20190430 Upgrading Fedora 29 to Fedora 30.md diff --git a/published/20190501 3 apps to manage personal finances in Fedora.md b/published/201905/20190501 3 apps to manage personal finances in Fedora.md similarity index 100% rename from published/20190501 3 apps to manage personal finances in Fedora.md rename to published/201905/20190501 3 apps to manage personal finances in Fedora.md diff --git a/published/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/published/201905/20190501 Cisco issues critical security warning for Nexus data-center switches.md similarity index 100% rename from published/20190501 Cisco issues critical security warning for Nexus data-center switches.md rename to published/201905/20190501 Cisco issues critical security warning for Nexus data-center switches.md diff --git a/published/20190501 Write faster C extensions for Python with Cython.md b/published/201905/20190501 Write faster C extensions for Python with Cython.md similarity index 100% rename from published/20190501 Write faster C extensions for Python with Cython.md rename to published/201905/20190501 Write faster C extensions for Python with Cython.md diff --git a/published/20190502 Format Python however you like with Black.md b/published/201905/20190502 Format Python however you like with Black.md similarity index 100% rename from published/20190502 Format Python however you like with Black.md rename to published/201905/20190502 Format Python however you like with Black.md diff --git a/published/20190502 Get started with Libki to manage public user computer access.md b/published/201905/20190502 Get started with Libki to manage public user computer access.md similarity index 100% rename from published/20190502 Get started with Libki to manage public user computer access.md rename to published/201905/20190502 Get started with Libki to manage public user computer access.md diff --git a/published/20190503 API evolution the right way.md b/published/201905/20190503 API evolution the right way.md similarity index 100% rename from published/20190503 API evolution the right way.md rename to published/201905/20190503 API evolution the right way.md diff --git a/published/20190503 Check your spelling at the command line with Ispell.md b/published/201905/20190503 Check your spelling at the command line with Ispell.md similarity index 100% rename from published/20190503 Check your spelling at the command line with Ispell.md rename to published/201905/20190503 Check your spelling at the command line with Ispell.md diff --git a/published/20190503 Say goodbye to boilerplate in Python with attrs.md b/published/201905/20190503 Say goodbye to boilerplate in Python with attrs.md similarity index 100% rename from published/20190503 Say goodbye to boilerplate in Python with attrs.md rename to published/201905/20190503 Say goodbye to boilerplate in Python with attrs.md diff --git a/published/20190504 Add methods retroactively in Python with singledispatch.md b/published/201905/20190504 Add methods retroactively in Python with singledispatch.md similarity index 100% rename from published/20190504 Add methods retroactively in Python with singledispatch.md rename to published/201905/20190504 Add methods retroactively in Python with singledispatch.md diff --git a/published/20190504 Using the force at the Linux command line.md b/published/201905/20190504 Using the force at the Linux command line.md similarity index 100% rename from published/20190504 Using the force at the Linux command line.md rename to published/201905/20190504 Using the force at the Linux command line.md diff --git a/published/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md b/published/201905/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md similarity index 100% rename from published/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md rename to published/201905/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md diff --git a/published/20190505 How To Create SSH Alias In Linux.md b/published/201905/20190505 How To Create SSH Alias In Linux.md similarity index 100% rename from published/20190505 How To Create SSH Alias In Linux.md rename to published/201905/20190505 How To Create SSH Alias In Linux.md diff --git a/published/20190505 Kindd - A Graphical Frontend To dd Command.md b/published/201905/20190505 Kindd - A Graphical Frontend To dd Command.md similarity index 100% rename from published/20190505 Kindd - A Graphical Frontend To dd Command.md rename to published/201905/20190505 Kindd - A Graphical Frontend To dd Command.md diff --git a/published/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/published/201905/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md similarity index 100% rename from published/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md rename to published/201905/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md diff --git a/published/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/published/201905/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md similarity index 100% rename from published/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md rename to published/201905/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md diff --git a/published/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/published/201905/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md similarity index 100% rename from published/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md rename to published/201905/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md diff --git a/published/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/published/201905/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md similarity index 100% rename from published/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md rename to published/201905/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md diff --git a/published/20190508 How to use advanced rsync for large Linux backups.md b/published/201905/20190508 How to use advanced rsync for large Linux backups.md similarity index 100% rename from published/20190508 How to use advanced rsync for large Linux backups.md rename to published/201905/20190508 How to use advanced rsync for large Linux backups.md diff --git a/published/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/published/201905/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md similarity index 100% rename from published/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md rename to published/201905/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md diff --git a/published/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/published/201905/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md similarity index 100% rename from published/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md rename to published/201905/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md diff --git a/published/20190510 PHP in 2019.md b/published/201905/20190510 PHP in 2019.md similarity index 100% rename from published/20190510 PHP in 2019.md rename to published/201905/20190510 PHP in 2019.md diff --git a/published/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md b/published/201905/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md similarity index 100% rename from published/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md rename to published/201905/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md diff --git a/published/20190516 Building Smaller Container Images.md b/published/201905/20190516 Building Smaller Container Images.md similarity index 100% rename from published/20190516 Building Smaller Container Images.md rename to published/201905/20190516 Building Smaller Container Images.md diff --git a/published/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md b/published/201905/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md similarity index 100% rename from published/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md rename to published/201905/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md diff --git a/published/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/published/201905/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md similarity index 100% rename from published/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md rename to published/201905/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md diff --git a/published/20190520 PiShrink - Make Raspberry Pi Images Smaller.md b/published/201905/20190520 PiShrink - Make Raspberry Pi Images Smaller.md similarity index 100% rename from published/20190520 PiShrink - Make Raspberry Pi Images Smaller.md rename to published/201905/20190520 PiShrink - Make Raspberry Pi Images Smaller.md diff --git a/published/20190520 xsos - A Tool To Read SOSReport In Linux.md b/published/201905/20190520 xsos - A Tool To Read SOSReport In Linux.md similarity index 100% rename from published/20190520 xsos - A Tool To Read SOSReport In Linux.md rename to published/201905/20190520 xsos - A Tool To Read SOSReport In Linux.md From 901cb18136ebbfd49e22a0804a1866b5a820b1f1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 Jun 2019 01:20:21 +0800 Subject: [PATCH 0701/1154] PRF:20190527 20- FFmpeg Commands For Beginners.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @robsean 再次提出批评,不够认真。 --- ...90527 20- FFmpeg Commands For Beginners.md | 233 ++++++++---------- 1 file changed, 104 insertions(+), 129 deletions(-) diff --git a/translated/tech/20190527 20- FFmpeg Commands For Beginners.md b/translated/tech/20190527 20- FFmpeg Commands For Beginners.md index 33d0d26052..bd134eb025 100644 --- a/translated/tech/20190527 20- FFmpeg Commands For Beginners.md +++ b/translated/tech/20190527 20- FFmpeg Commands For Beginners.md @@ -1,43 +1,41 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (20+ FFmpeg Commands For Beginners) [#]: via: (https://www.ostechnix.com/20-ffmpeg-commands-beginners/) [#]: author: (sk https://www.ostechnix.com/author/sk/) -针对初学者的20多个 FFmpeg 命令 +给初学者的 20 多个 FFmpeg 命令示例 ====== -![FFmpeg Commands][1] +![FFmpeg Commands](https://img.linux.net.cn/data/attachment/album/201906/03/011553xu323dzu40pb03bx.jpg) -在这个指南中,我将阐明如何使用 FFmpeg 多多媒体框架来做各种各样的音频,视频转换编码和转换操作示例。我已经为初学者编写最通常频繁使用的20多个 FFmpeg 命令,我将通过不是地添加更多的示例来保持更新这个指南。请给这个指南加书签,以后回来检查更新。让我们开始吧?如果你还没有在你的 Linux 系统中安装 FFmpeg ,参考下面的指南。 +在这个指南中,我将用示例来阐明如何使用 FFmpeg 媒体框架来做各种各样的音频、视频转码和转换的操作。我已经为初学者汇集了最常用的 20 多个 FFmpeg 命令,我将不时地添加更多的示例来保持更新这个指南。请给这个指南加书签,以后回来检查更新。让我们开始吧,如果你还没有在你的 Linux 系统中安装 FFmpeg,参考下面的指南。 - * [**在 Linux 中安装 FFmpeg**][2] +* [在 Linux 中安装 FFmpeg][2] - - -### 针对初学者的20多个 FFmpeg 命令 +### 针对初学者的 20 多个 FFmpeg 命令 FFmpeg 命令的典型语法是: ``` -ffmpeg [全局选项] {[输入文件选项] -i 输入url地址} ... - {[输出文件选项] 输出url地址} ... +ffmpeg [全局选项] {[输入文件选项] -i 输入_url_地址} ... + {[输出文件选项] 输出_url_地址} ... ``` 现在我们将查看一些重要的和有用的 FFmpeg 命令。 -##### **1\. 获取音频/视频文件信息** +#### 1、获取音频/视频文件信息 -为显示你的多媒体文件细节,运行: +为显示你的媒体文件细节,运行: ``` $ ffmpeg -i video.mp4 ``` -**样本输出:** +样本输出: ``` ffmpeg version n4.1.3 Copyright (c) 2000-2019 the FFmpeg developers @@ -67,63 +65,62 @@ handler_name : ISO Media file produced by Google Inc. Created on: 04/08/2019. At least one output file must be specified ``` -如你在上面的输出中看到的,FFmpeg 显示多媒体文件信息,以及 FFmpeg 细节,例如版本,配置细节,版权标记,构建和库选项等等。 +如你在上面的输出中看到的,FFmpeg 显示该媒体文件信息,以及 FFmpeg 细节,例如版本、配置细节、版权标记、构建参数和库选项等等。 -如果你不想看 FFmpeg 标语和其它细节,而仅仅想看多媒体文件信息,使用 **-hide_banner** 标示,像下面。 +如果你不想看 FFmpeg 标语和其它细节,而仅仅想看媒体文件信息,使用 `-hide_banner` 标志,像下面。 ``` $ ffmpeg -i video.mp4 -hide_banner ``` -**样本输出:** +样本输出: ![][3] -使用 FFMpeg 查看音频,视频文件信息。 +*使用 FFMpeg 查看音频、视频文件信息。* -看见了吗?现在,它仅显示多媒体文件细节。 +看见了吗?现在,它仅显示媒体文件细节。 -** **推荐下载** – [**免费指南:“Spotify 音乐流:非官方指南”**][4] -##### **2\. 转换视频文件到不同的格式** +#### 2、转换视频文件到不同的格式 -FFmpeg 是强有力的音频和视频转换器,因此,在不同格式之间转换多媒体文件是可能的。以示例说明,转换 **mp4 文件到 avi 文件**,运行: +FFmpeg 是强有力的音频和视频转换器,因此,它能在不同格式之间转换媒体文件。举个例子,要转换 mp4 文件到 avi 文件,运行: ``` $ ffmpeg -i video.mp4 video.avi ``` -类似地,你可以转换多媒体文件到你选择的任何格式。 +类似地,你可以转换媒体文件到你选择的任何格式。 -例如,为转换 youtube **flv** 格式视频为 **mpeg** 格式,运行: +例如,为转换 YouTube flv 格式视频为 mpeg 格式,运行: ``` $ ffmpeg -i video.flv video.mpeg ``` -如果你想维持你的源视频文件的质量,使用 “-qscale 0” 参数: +如果你想维持你的源视频文件的质量,使用 `-qscale 0` 参数: ``` $ ffmpeg -i input.webm -qscale 0 output.mp4 ``` -为检查 FFmpeg 的支持列表,运行: +为检查 FFmpeg 的支持格式的列表,运行: ``` $ ffmpeg -formats ``` -##### **3\. 转换视频文件到音频文件** +#### 3、转换视频文件到音频文件 我转换一个视频文件到音频文件,只需具体指明输出格式,像 .mp3,或 .ogg,或其它任意音频格式。 -上面的命令将转换 **input.mp4** 视频文件到 **output.mp3** 音频文件。 +上面的命令将转换 input.mp4 视频文件到 output.mp3 音频文件。 ``` $ ffmpeg -i input.mp4 -vn output.mp3 ``` -此外,你也可以使用各种各样的音频转换编码选项到输出文件,像下面演示。 +此外,你也可以对输出文件使用各种各样的音频转换编码选项,像下面演示。 ``` $ ffmpeg -i input.mp4 -vn -ar 44100 -ac 2 -ab 320 -f mp3 output.mp3 @@ -131,17 +128,15 @@ $ ffmpeg -i input.mp4 -vn -ar 44100 -ac 2 -ab 320 -f mp3 output.mp3 在这里, - * **-vn** – 表明我们已经在输出文件中禁用视频录制。 - * **-ar** – 设置输出文件的音频频率。通常使用的值是22050,44100,48000 Hz。 - * **-ac** – 设置音频通道的数目。 - * **-ab** – 表明音频比特率。 - * **-f** – 输出文件格式。在我们的实例中,它是 mp3 格式。 + * `-vn` – 表明我们已经在输出文件中禁用视频录制。 + * `-ar` – 设置输出文件的音频频率。通常使用的值是22050 Hz、44100 Hz、48000 Hz。 + * `-ac` – 设置音频通道的数目。 + * `-ab` – 表明音频比特率。 + * `-f` – 输出文件格式。在我们的实例中,它是 mp3 格式。 +#### 4、更改视频文件的分辨率 - -##### **4\. 更改视频文件的分辨率** - -如果你想设置一个具体的分辨率到一个视频文件中,你可以使用下面的命令: +如果你想设置一个视频文件为指定的分辨率,你可以使用下面的命令: ``` $ ffmpeg -i input.mp4 -filter:v scale=1280:720 -c:a copy output.mp4 @@ -153,9 +148,9 @@ $ ffmpeg -i input.mp4 -filter:v scale=1280:720 -c:a copy output.mp4 $ ffmpeg -i input.mp4 -s 1280x720 -c:a copy output.mp4 ``` -上面的命令将设置所给定视频文件的分辨率到1280×720。 +上面的命令将设置所给定视频文件的分辨率到 1280×720。 -类似地,为转换上面的文件到640×480大小,运行: +类似地,为转换上面的文件到 640×480 大小,运行: ``` $ ffmpeg -i input.mp4 -filter:v scale=640:480 -c:a copy output.mp4 @@ -167,33 +162,31 @@ $ ffmpeg -i input.mp4 -filter:v scale=640:480 -c:a copy output.mp4 $ ffmpeg -i input.mp4 -s 640x480 -c:a copy output.mp4 ``` -这个技巧将帮助你缩放你的视频文件到较小的显示设备,例如平板电脑和手机。 +这个技巧将帮助你缩放你的视频文件到较小的显示设备上,例如平板电脑和手机。 -##### **5\. 压缩视频文件** +#### 5、压缩视频文件 -减小多媒体文件的大小到较低大小来节省硬件的空间总是一个好主意. +减小媒体文件的大小到较小来节省硬件的空间总是一个好主意. -下面的命令将压缩和减少输出文件的大小。 +下面的命令将压缩并减少输出文件的大小。 ``` $ ffmpeg -i input.mp4 -vf scale=1280:-1 -c:v libx264 -preset veryslow -crf 24 output.mp4 ``` -请注意,如果你尝试减小视频文件的大小,你将丢失视频质量。如果 **24** 太有侵略性,你可以降低 **crf** 值到或更低值。 +请注意,如果你尝试减小视频文件的大小,你将损失视频质量。如果 24 太有侵略性,你可以降低 `-crf` 值到或更低值。 -你也可以转换编码音频向下一点结果是使其有立体声感,通过包含下面的选项来减小大小。 +你也可以通过下面的选项来转换编码音频降低比特率,使其有立体声感,从而减小大小。 ``` -ac 2 -c:a aac -strict -2 -b:a 128k ``` -** **推荐下载** – [**免费指南: “PLEX, 一本手册:你的多媒体,具有样式”**][5] +#### 6、压缩音频文件 -##### **6\. 压缩音频文件** +正像压缩视频文件一样,为节省一些磁盘空间,你也可以使用 `-ab` 标志压缩音频文件。 -正像压缩视频文件一样,为节省一些磁盘空间,你也可以使用 **-ab** 标示压缩音频文件。 - -例如,你有一个320 kbps 比特率的音频文件。你想通过更改比特率到任意较低的值来压缩它,像下面。 +例如,你有一个 320 kbps 比特率的音频文件。你想通过更改比特率到任意较低的值来压缩它,像下面。 ``` $ ffmpeg -i input.mp3 -ab 128 output.mp3 @@ -209,39 +202,37 @@ $ ffmpeg -i input.mp3 -ab 128 output.mp3 6. 256kbps 7. 320kbps +#### 7、从一个视频文件移除音频流 - -##### **7. 从一个视频文件移除音频流** - -如果你不想从一个视频文件中要一个音频,使用 **-an** 标示。 +如果你不想要一个视频文件中的音频,使用 `-an` 标志。 ``` $ ffmpeg -i input.mp4 -an output.mp4 ``` -在这里,‘an’ 表示没有音频录制。 +在这里,`-an` 表示没有音频录制。 -上面的命令会撤销所有音频相关的标示,因为我们没有从 input.mp4 中音频操作。 +上面的命令会撤销所有音频相关的标志,因为我们不要来自 input.mp4 的音频。 -##### **8\. 从一个多媒体文件移除视频流** +#### 8、从一个媒体文件移除视频流 -类似地,如果你不想要视频流,你可以使用 ‘vn’ 标示从多媒体文件中简单地移除它。vn 代表没有视频录制。换句话说,这个里面转换所给定多媒体文件到音频文件中。 +类似地,如果你不想要视频流,你可以使用 `-vn` 标志从媒体文件中简单地移除它。`-vn` 代表没有视频录制。换句话说,这个命令转换所给定媒体文件为音频文件。 -下面的命令将从所给定多媒体文件中移除视频。 +下面的命令将从所给定媒体文件中移除视频。 ``` $ ffmpeg -i input.mp4 -vn output.mp3 ``` -你也可以使用 ‘-ab’ 标示来提出输出文件的比特率,如下面的示例所示。 +你也可以使用 `-ab` 标志来指出输出文件的比特率,如下面的示例所示。 ``` $ ffmpeg -i input.mp4 -vn -ab 320 output.mp3 ``` -##### **9. 从视频中提取图像 ** +#### 9、从视频中提取图像 -FFmpeg 的另一个有用的特色是我们可以从一个视频文件中简单地提取图像。这可能是非常有用的,如果你想从一个视频文件中创建一个相册。 +FFmpeg 的另一个有用的特色是我们可以从一个视频文件中轻松地提取图像。如果你想从一个视频文件中创建一个相册,这可能是非常有用的。 为从一个视频文件中提取图像,使用下面的命令: @@ -251,15 +242,13 @@ $ ffmpeg -i input.mp4 -r 1 -f image2 image-%2d.png 在这里, - * **-r** – 设置帧速度。即,每秒提取帧到图像的数字。默认值是 **25**。 - * **-f** – 表示输出格式,即,在我们的实例中是图像。 - * **image-%2d.png** – 表明我们如何想命名提取的图像。在这个实例中,命名应该开端,像这样image-01.png,image-02.png,image-03.png 等等。如果你使用 %3d ,那么图像的命名将开始,像 image-001.png,image-002.png 等等。 + * `-r` – 设置帧速度。即,每秒提取帧到图像的数字。默认值是 25。 + * `-f` – 表示输出格式,即,在我们的实例中是图像。 + * `image-%2d.png` – 表明我们如何想命名提取的图像。在这个实例中,命名应该像这样image-01.png、image-02.png、image-03.png 等等开始。如果你使用 `%3d`,那么图像的命名像 image-001.png、image-002.png 等等开始。 +#### 10、裁剪视频 - -##### **10\. 裁剪视频** - -FFMpeg 允许裁剪一个给定的多媒体文件到我们选择的任何范围。 +FFMpeg 允许以我们选择的任何范围裁剪一个给定的媒体文件。 裁剪一个视频文件的语法如下给定: @@ -269,16 +258,15 @@ ffmpeg -i input.mp4 -filter:v "crop=w:h:x:y" output.mp4 在这里, - * **input.mp4** – 源视频文件。 - * **-filter:v** – 表示视频过滤器。 - * **crop** – 表示裁剪过滤器。 - * **w** – 我们想自源视频中来裁剪的矩形的 **宽度** 。 - * **h** – 矩形的高度。 - * **x** – 我们想自源视频中来裁剪的矩形的 **x 坐标** 。 - * **y** – 矩形的 y 坐标。 + * `input.mp4` – 源视频文件。 + * `-filter:v` – 表示视频过滤器。 + * `crop` – 表示裁剪过滤器。 + * `w` – 我们想自源视频中裁剪的矩形的宽度。 + * `h` – 矩形的高度。 + * `x` – 我们想自源视频中裁剪的矩形的 x 坐标 。 + * `y` – 矩形的 y 坐标。 - -让我们表达,你想要一个来自视频的**位置(200,150)**,且具有**640像素的宽度**和**480像素的高度**视频, 命令应该是: +比如说你想要一个来自视频的位置 (200,150),且具有 640 像素宽度和 480 像素高度的视频,命令应该是: ``` $ ffmpeg -i input.mp4 -filter:v "crop=640:480:200:150" output.mp4 @@ -286,25 +274,25 @@ $ ffmpeg -i input.mp4 -filter:v "crop=640:480:200:150" output.mp4 请注意,剪切视频将影响质量。除非必要,请勿剪切。 -##### **11\. 转换一个视频的具体的部分** +#### 11、转换一个视频的具体的部分 -有时,你可能想仅转换视频文件的一个具体的部分到不同的格式。以示例说明,下面的命令将转换所给定视频input.mp4 文件的**第一个50秒**到视频 .avi 格式。 +有时,你可能想仅转换视频文件的一个具体的部分到不同的格式。以示例说明,下面的命令将转换所给定视频input.mp4 文件的开始 10 秒到视频 .avi 格式。 ``` $ ffmpeg -i input.mp4 -t 10 output.avi ``` -在这里,我们以秒具体说明时间。此外,以**hh.mm.ss** 格式具体说明时间也是可接受的。 +在这里,我们以秒具体说明时间。此外,以 `hh.mm.ss` 格式具体说明时间也是可以的。 -##### **12\. 设置视频的屏幕高宽比** +#### 12、设置视频的屏幕高宽比 -你可以使用 **-aspect** 标示设置一个视频文件的屏幕高宽比,像下面。 +你可以使用 `-aspect` 标志设置一个视频文件的屏幕高宽比,像下面。 ``` $ ffmpeg -i input.mp4 -aspect 16:9 output.mp4 ``` -通常使用的 aspect 比例是: +通常使用的高宽比是: * 16:9 * 4:3 @@ -314,9 +302,7 @@ $ ffmpeg -i input.mp4 -aspect 16:9 output.mp4 * 2:35:1 * 2:39:1 - - -##### **13\. 添加海报图像到音频文件** +#### 13、添加海报图像到音频文件 你可以添加海报图像到你的文件,以便图像将在播放音频文件时显示。这对托管在视频托管主机或共享网站中的音频文件是有用的。 @@ -324,11 +310,9 @@ $ ffmpeg -i input.mp4 -aspect 16:9 output.mp4 $ ffmpeg -loop 1 -i inputimage.jpg -i inputaudio.mp3 -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest output.mp4 ``` -##### **14. 使用开始和停止时间剪下一段多媒体文件 +#### 14、使用开始和停止时间剪下一段媒体文件 -** - -为剪下一段视频到小块的剪辑,使用开始和停止时间,我们可以使用下面的命令。 +可以使用开始和停止时间来剪下一段视频为小段剪辑,我们可以使用下面的命令。 ``` $ ffmpeg -i input.mp4 -ss 00:00:50 -codec copy -t 50 output.mp4 @@ -336,12 +320,10 @@ $ ffmpeg -i input.mp4 -ss 00:00:50 -codec copy -t 50 output.mp4 在这里, - * –s – 表示视频剪辑的开始时间。在我们的示例中,开始时间是第50秒。 - * -t – 表示总的持续时间。 + * `–s` – 表示视频剪辑的开始时间。在我们的示例中,开始时间是第 50 秒。 + * `-t` – 表示总的持续时间。 - - -当你想从一个音频或视频文件剪切一部分,使用开始和结束时间是非常有帮助的 +当你想使用开始和结束时间从一个音频或视频文件剪切一部分时,它是非常有用的。 类似地,我们可以像下面剪下音频。 @@ -349,25 +331,24 @@ $ ffmpeg -i input.mp4 -ss 00:00:50 -codec copy -t 50 output.mp4 $ ffmpeg -i audio.mp3 -ss 00:01:54 -to 00:06:53 -c copy output.mp3 ``` -##### **15\. 分裂视频文件到多个部分** +#### 15、切分视频文件为多个部分 -一些网站将仅允许你上传一个具体指定大小的视频。在这样的情况下,你可以分裂大的视频文件到多个较小的部分,像下面。 +一些网站将仅允许你上传具体指定大小的视频。在这样的情况下,你可以切分大的视频文件到多个较小的部分,像下面。 ``` $ ffmpeg -i input.mp4 -t 00:00:30 -c copy part1.mp4 -ss 00:00:30 -codec copy part2.mp4 ``` 在这里, -**-t 00:00:30** 表示从视频的开始到视频的第30秒创建一部分视频。 -**-ss 00:00:30** 为视频的下一部分显示开始时间戳。它意味着第2部分将从第30秒开始,并将持续到原始视频文件的结尾。 -** **推荐下载** – [**免费指南:“如何开始你自己的成功的博客”**][6] + * `-t 00:00:30` 表示从视频的开始到视频的第 30 秒创建一部分视频。 + * `-ss 00:00:30` 为视频的下一部分显示开始时间戳。它意味着第 2 部分将从第 30 秒开始,并将持续到原始视频文件的结尾。 -##### **16\. 接合或合并多个视频部分到一个** +#### 16、接合或合并多个视频部分到一个 -FFmpeg 也将接合多个视频部分,并创建一个单个视频文件。 +FFmpeg 也可以接合多个视频部分,并创建一个单个视频文件。 -创建包含你想接合文件的准确的路径的 **join.txt** 。所有的玩家应该是相同的格式(相同格式)。所有文件的路径应该依次地提到,像下面。 +创建包含你想接合文件的准确的路径的 `join.txt`。所有的文件都应该是相同的格式(相同的编码格式)。所有文件的路径应该逐个列出,像下面。 ``` file /home/sk/myvideos/part1.mp4 @@ -389,23 +370,23 @@ $ ffmpeg -f concat -i join.txt -c copy output.mp4 join.txt: Operation not permitted ``` -添加 **“-safe 0”** : +添加 `-safe 0` : ``` $ ffmpeg -f concat -safe 0 -i join.txt -c copy output.mp4 ``` -上面的命令将接合 part1.mp4,part2.mp4,part3.mp4,和 part4.mp4 文件到一个称为“output.mp4”的单个文件中。 +上面的命令将接合 part1.mp4、part2.mp4、part3.mp4 和 part4.mp4 文件到一个称为 output.mp4 的单个文件中。 -##### **17\. 添加字幕到一个视频文件** +#### 17、添加字幕到一个视频文件 -我们可以使用 FFmpeg 来添加字幕到一个视频文件。为你的视频下载正确的字母,并如下所示添加它到你的视频。 +我们可以使用 FFmpeg 来添加字幕到视频文件。为你的视频下载正确的字幕,并如下所示添加它到你的视频。 ``` $ fmpeg -i input.mp4 -i subtitle.srt -map 0 -map 1 -c copy -c:v libx264 -crf 23 -preset veryfast output.mp4 ``` -##### **18\. 预览或测试视频或音频文件** +#### 18、预览或测试视频或音频文件 你可能希望通过预览来验证或测试输出的文件是否已经被恰当地转码编码。为完成预览,你可以从你的终端播放它,用命令: @@ -413,7 +394,7 @@ $ fmpeg -i input.mp4 -i subtitle.srt -map 0 -map 1 -c copy -c:v libx264 -crf 23 $ ffplay video.mp4 ``` -[![][1]][7] +![][7] 类似地,你可以测试音频文件,像下面所示。 @@ -421,9 +402,9 @@ $ ffplay video.mp4 $ ffplay audio.mp3 ``` -[![][1]][8] +![][8] -##### **19\. 增加/减少视频播放速度** +#### 19、增加/减少视频播放速度 FFmpeg 允许你调整视频播放速度。 @@ -435,39 +416,33 @@ $ ffmpeg -i input.mp4 -vf "setpts=0.5*PTS" output.mp4 该命令将双倍视频的速度。 -为降低你的视频速度,你需要使用一个倍数 **大于 1** 。为减少播放速度,运行: +为降低你的视频速度,你需要使用一个大于 1 的倍数。为减少播放速度,运行: ``` $ ffmpeg -i input.mp4 -vf "setpts=4.0*PTS" output.mp4 ``` -##### **20. 创建动画的 GIF +#### 20、创建动画的 GIF -** +出于各种目的,我们在几乎所有的社交和专业网络上使用 GIF 图像。使用 FFmpeg,我们可以简单地和快速地创建动画的视频文件。下面的指南阐释了如何在类 Unix 系统中使用 FFmpeg 和 ImageMagick 创建一个动画的 GIF 文件。 -我们在几乎所有的社交和专业网络上为各种各样的目的使用 GIF 图像。使用 FFmpeg,我们可以简单地和快速地创建动画的视频文件。下面的指南阐释,如何在类 Unix 系统中使用 FFmpeg 和 ImageMagick T创建一个动画的 GIF 文件。 + * [在 Linux 中如何创建动画的 GIF][9] - * [**在 Linux 中如何创建动画的 GIF**][9] +#### 21、从 PDF 文件中创建视频 +我长年累月的收集了很多 PDF 文件,大多数是 Linux 教程,保存在我的平板电脑中。有时我懒得从平板电脑中阅读它们。因此,我决定从 PDF 文件中创建一个视频,在一个大屏幕设备(像一台电视机或一台电脑)中观看它们。如果你想知道如何从一批 PDF 文件中制作一个电影,下面的指南将帮助你。 + * [在 Linux 中如何从 PDF 文件中创建一个视频][10] -##### **21.** 从 PDF 文件中创建视频 +#### 22、获取帮助 -我长年累月的收集很多 PDF 文件,大多数是 Linux 教程,保存在我的平板电脑中。有时我懒得从平板电脑中月度它们。因此,我决定从 PDF 文件中创建一个视频,在一个大屏幕设备(像一台电视机或一台电脑)中观看它们。如果你曾经想知道如何从一批 PDF 文件中制作一个电影,下面的指南将帮助你。. - - * [**在 Linux 中如何从 PDF 文件中创建一个视频**][10] - - - -##### **22\. 获取帮助** - -在这个指南中,我已经覆盖大多数常常使用的 FFmpeg 命令。 它有很多不同的选项来做各种各样的高级功能。为学习更多,参考手册页。 +在这个指南中,我已经覆盖大多数常常使用的 FFmpeg 命令。它有很多不同的选项来做各种各样的高级功能。要学习更多用法,请参考手册页。 ``` $ man ffmpeg ``` -然后,这就是全部。我希望这个指南将帮助你 FFmpeg 入门。如果你发现这个指南有用,请在你的社交和专业网络上分享它。更多好东西将要来。敬请期待! +这就是全部了。我希望这个指南将帮助你入门 FFmpeg。如果你发现这个指南有用,请在你的社交和专业网络上分享它。更多好东西将要来。敬请期待! 谢谢! @@ -478,7 +453,7 @@ via: https://www.ostechnix.com/20-ffmpeg-commands-beginners/ 作者:[sk][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/) 荣誉推出 From cdbd691cc14f39354e4b8ab53ec6d7fe5a0c278c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 Jun 2019 01:21:42 +0800 Subject: [PATCH 0702/1154] PUB:20190527 20- FFmpeg Commands For Beginners.md @robsean https://linux.cn/article-10932-1.html --- .../20190527 20- FFmpeg Commands For Beginners.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190527 20- FFmpeg Commands For Beginners.md (99%) diff --git a/translated/tech/20190527 20- FFmpeg Commands For Beginners.md b/published/20190527 20- FFmpeg Commands For Beginners.md similarity index 99% rename from translated/tech/20190527 20- FFmpeg Commands For Beginners.md rename to published/20190527 20- FFmpeg Commands For Beginners.md index bd134eb025..2a646c6d89 100644 --- a/translated/tech/20190527 20- FFmpeg Commands For Beginners.md +++ b/published/20190527 20- FFmpeg Commands For Beginners.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10932-1.html) [#]: subject: (20+ FFmpeg Commands For Beginners) [#]: via: (https://www.ostechnix.com/20-ffmpeg-commands-beginners/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 586662ea1cda842a9fca8c96308f6c93d964ffe0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 3 Jun 2019 08:59:22 +0800 Subject: [PATCH 0703/1154] translated --- ...4 Ways to Run Linux Commands in Windows.md | 129 ------------------ ...4 Ways to Run Linux Commands in Windows.md | 120 ++++++++++++++++ 2 files changed, 120 insertions(+), 129 deletions(-) delete mode 100644 sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md create mode 100644 translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md diff --git a/sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md b/sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md deleted file mode 100644 index 3d93b35034..0000000000 --- a/sources/tech/20190525 4 Ways to Run Linux Commands in Windows.md +++ /dev/null @@ -1,129 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 Ways to Run Linux Commands in Windows) -[#]: via: (https://itsfoss.com/run-linux-commands-in-windows/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -4 Ways to Run Linux Commands in Windows -====== - -_**Brief: Want to use Linux commands but don’t want to leave Windows? Here are several ways to run Linux bash commands in Windows.**_ - -If you are learning Shell scripting probably as a part of your course curriculum, you need to use Linux commands to practice the commands and scripting. - -Your school lab might have Linux installed but personally you don’t have a [Linux laptop][1] but the regular Windows computer like everyone else. Your homework needs to run Linux commands and you wonder how to run Bash commands and scripts on Windows. - -You can [install Linux alongside Windows in dual boot mode][2]. This method allows you to choose either Linux or Windows when you start your computer. But taking all the trouble to mess with partitions for the sole purpose of running Linux command may not be for everyone. - -You can also [use Linux terminals online][3] but your work won’t be saved here. - -The good news is that there are several ways you can run Linux commands inside Windows, like any regular application. Isn’t it cool? - -### Using Linux commands inside Windows - -![][4] - -As an ardent Linux user and promoter, I would like to see more and more people using ‘real’ Linux but I understand that at times, that’s not the priority. If you are just looking to practice Linux to pass your exams, you can use one of these methods for running Bash commands on Windows. - -#### 1\. Use Linux Bash Shell on Windows 10 - -Did you know that you can run a Linux distribution inside Windows 10? The [Windows Subsystem for Linux (WSL)][5] allows you to run Linux inside Windows. The upcoming version of WSL will be using the real Linux kernel inside Windows. - -This WSL, also called Bash on Windows, gives you a Linux distribution in command line mode running as a regular Windows application. Don’t be scared with the command line mode because your purpose is to run Linux commands. That’s all you need. - -![Ubuntu Linux inside Windows][6] - -You can find some popular Linux distributions like Ubuntu, Kali Linux, openSUSE etc in Windows Store. You just have to download and install it like any other Windows application. Once installed, you can run all the Linux commands you want. - -[][7] - -Suggested read 6 Non-Ubuntu Linux Distributions For Beginners - -![Linux distributions in Windows 10 Store][8] - -Please refer to this tutorial about [installing Linux bash shell on Windows][9]. - -#### 2\. Use Git Bash to run Bash commands on Windows - -You probably know what [Git][10] is. It’s a version control system developed by [Linux creator Linus Torvalds][11]. - -[Git for Windows][12] is a set of tools that allows you to use Git in both command line and graphical interfaces. One of the tools included in Git for Windows is Git Bash. - -Git Bash application provides and emulation layer for Git command line. Apart from Git commands, Git Bash also supports many Bash utilities such as ssh, scp, cat, find etc. - -![Git Bash][13] - -In other words, you can run many common Linux/Bash commands using the Git Bash application. - -You can install Git Bash in Windows by downloading and installing the Git for Windows tool for free from its website. - -[Download Git for Windows][12] - -#### 3\. Using Linux commands in Windows with Cygwin - -If you want to run Linux commands in Windows, Cygwin is a recommended tool. Cygwin was created in 1995 to provide a POSIX-compatible environment that runs natively on Windows. Cygwin is a free and open source software maintained by Red Hat employees and many other volunteers. - -For two decades, Windows users use Cygwin for running and practicing Linux/Bash commands. Even I used Cygwin to learn Linux commands more than a decade ago. - -![Cygwin | Image Credit][14] - -You can download Cygwin from its official website below. I also advise you to refer to this [Cygwin cheat sheet][15] to get started with it. - -[Download Cygwin][16] - -#### 4\. Use Linux in virtual machine - -Another way is to use a virtualization software and install Linux in it. This way, you install a Linux distribution (with graphical interface) inside Windows and run it like a regular Windows application. - -This method requires that your system has a good amount of RAM, at least 4 GB but better if you have over 8 GB of RAM. The good thing here is that you get the real feel of using a desktop Linux. If you like the interface, you may later decide to [switch to Linux][17] completely. - -![Ubuntu Running in Virtual Machine Inside Windows][18] - -There are two popular tools for creating virtual machines on Windows, Oracle VirtualBox and VMware Workstation Player. You can use either of the two. Personally, I prefer VirtualBox. - -[][19] - -Suggested read 9 Simple Ways To Free Up Space On Ubuntu and Linux Mint - -You can follow [this tutorial to learn how to install Linux in VirtualBox][20]. - -**Conclusion** - -The best way to run Linux commands is to use Linux. When installing Linux is not an option, these tools allow you to run Linux commands on Windows. Give them a try and see which method is best suited for you. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/run-linux-commands-in-windows/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/get-linux-laptops/ -[2]: https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/ -[3]: https://itsfoss.com/online-linux-terminals/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/run-linux-commands-in-windows.png?resize=800%2C450&ssl=1 -[5]: https://itsfoss.com/bash-on-windows/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/08/install-ubuntu-windows-10-linux-subsystem-10.jpeg?resize=800%2C268&ssl=1 -[7]: https://itsfoss.com/non-ubuntu-beginner-linux/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/08/install-ubuntu-windows-10-linux-subsystem-4.jpeg?resize=800%2C632&ssl=1 -[9]: https://itsfoss.com/install-bash-on-windows/ -[10]: https://itsfoss.com/basic-git-commands-cheat-sheet/ -[11]: https://itsfoss.com/linus-torvalds-facts/ -[12]: https://gitforwindows.org/ -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/git-bash.png?ssl=1 -[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/cygwin-shell.jpg?ssl=1 -[15]: http://www.voxforge.org/home/docs/cygwin-cheat-sheet -[16]: https://www.cygwin.com/ -[17]: https://itsfoss.com/reasons-switch-linux-windows-xp/ -[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/ubuntu-running-in-virtual-machine-inside-windows.jpeg?resize=800%2C450&ssl=1 -[19]: https://itsfoss.com/free-up-space-ubuntu-linux/ -[20]: https://itsfoss.com/install-linux-in-virtualbox/ diff --git a/translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md b/translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md new file mode 100644 index 0000000000..fa96f1794e --- /dev/null +++ b/translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 Ways to Run Linux Commands in Windows) +[#]: via: (https://itsfoss.com/run-linux-commands-in-windows/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 Windows 中运行 Linux 命令的 4 种方法 +====== + +_ **简介:想要使用 Linux 命令,但又不想离开 Windows ?以下是在 Windows 中运行 Linux bash 命令的几种方法。** _ + +如果你在课程中正在学习 shell 脚本,那么需要使用 Linux 命令来练习命令和脚本。 + +你的学校实验室可能安装了 Linux,但是你个人没有 [Linux 的笔记本][1],而是像其他人一样的 Windows 计算机。你的作业需要运行 Linux 命令,你也想想知道如何在 Windows 上运行 Bash 命令和脚本。 + +你可以[在双启动模式下同时安装 Windows 和 Linux][2]。此方法能让你在启动计算机时选择 Linux 或 Windows。但是,为了运行 Linux 命令而单独使用分区的麻烦可能不适合所有人。 + +你也可以[使用在线 Linux 终端][3],但你的作业无法保存。 + +好消息是,有几种方法可以在 Windows 中运行 Linux 命令,就像其他常规应用一样。不是很酷吗? + +### 在 Windows 中使用 Linux 命令 + +![][4] + +作为一个热心的 Linux 用户和推广者,我希望看到越来越多的人使用“真正的” Linux,但我知道有时候,这不是优先考虑的问题。如果你只是想练习 Linux 来通过考试,可以使用这些方法之一在 Windows 上运行 Bash 命令。 + +#### 1\. 在 Windows 10 上使用 Linux Bash Shell + +你是否知道可以在 Windows 10 中运行 Linux 发行版? [Windows 的 Linux 子系统 (WSL)][5] 能让你在 Windows 中运行 Linux。即将推出的 WSL 版本将使用 Windows 内部的真正 Linux 内核。 + +此 WSL 在 Windows 上也称为 Bash,它作为一个常规的 Windows 应用运行,并提供了一个命令行模式的 Linux 发行版。不要害怕命令行模式,因为你的目的是运行 Linux 命令。这就是你所需要的。 + +![Ubuntu Linux inside Windows][6] + +你可以在 Windows 应用商店中找到一些流行的 Linux 发行版,如 Ubuntu、Kali Linux、openSUSE 等。你只需像任何其他 Windows 应用一样下载和安装它。安装后,你可以运行所需的所有 Linux 命令。 + + +![Linux distributions in Windows 10 Store][8] + +请参考教程:[在 Windows 上安装 Linux bash shell][9]。 + +#### 2\. 使用 Git Bash 在 Windows 上运行 Bash 命令 + +、你可能知道 [Git][10] 是什么。它是由 [Linux 创建者 Linus Torvalds][11] 开发的版本控制系统。 + +[Git for Windows][12] 是一组工具,能让你在命令行和图形界面中使用 Git。Git for Windows 中包含的工具之一是 Git Bash。 + +Git Bash 为 Git 命令行提供了仿真层。除了 Git 命令,Git Bash 还支持许多 Bash 程序,如 ssh、scp、cat、find 等。 + +![Git Bash][13] + +换句话说,你可以使用 Git Bash 运行许多常见的 Linux/Bash 命令。 + +你可以从其网站免费下载和安装 Git for Windows 工具来在 Windows 中安装 Git Bash。 + +[下载 Git for Windows][12] + +#### 3\. 使用 Cygwin 在 Windows 中使用 Linux 命令 + +如果要在 Windows 中运行 Linux 命令,那么 Cygwin 是一个推荐的工具。Cygwin 创建于 1995 年,旨在提供一个原生运行于 Windows 中的 POSIX 兼容环境。Cygwin 是由 Red Hat 员工和许多其他志愿者维护的免费开源软件。 + +二十年来,Windows 用户使用 Cygwin 来运行和练习 Linux/Bash 命令。十多年前,我甚至用 Cygwin 来学习 Linux 命令。 + +![Cygwin | Image Credit][14] + +你可以从下面的官方网站下载 Cygwin。我还建议你参考这个 [Cygwin 备忘录][15]来开始使用。 + +[下载 Cygwin][16] + +#### 4\. 在虚拟机中使用 Linux + +另一种方法是使用虚拟化软件并在其中安装 Linux。这样,你可以在 Windows 中安装 Linux 发行版(带有图形界面)并像常规 Windows 应用一样运行它。 + +这种方法要求你的系统有大的内存,至少 4GB ,但如果你有超过 8GB 的内存那么更好。这里的好处是你可以真实地使用桌面 Linux。如果你喜欢这个界面,那么你可能会在以后决定[切换到 Linux][17]。 + +![Ubuntu Running in Virtual Machine Inside Windows][18] + +有两种流行的工具可在 Windows 上创建虚拟机,它们是 Oracle VirtualBox 和 VMware Workstation Player。你可以使用两者中的任何一个。就个人而言,我更喜欢 VirtualBox。 + +你可以按照[本教程学习如何在 VirtualBox 中安装 Linux][20]。 + +**总结** + +运行 Linux 命令的最佳方法是使用 Linux。当选择不安装 Linux 时,这些工具能让你在 Windows 上运行 Linux 命令。都试试看,看哪种适合你。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/run-linux-commands-in-windows/ + +作者:[Abhishek Prakash][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/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/get-linux-laptops/ +[2]: https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/ +[3]: https://itsfoss.com/online-linux-terminals/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/run-linux-commands-in-windows.png?resize=800%2C450&ssl=1 +[5]: https://itsfoss.com/bash-on-windows/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/08/install-ubuntu-windows-10-linux-subsystem-10.jpeg?resize=800%2C268&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/08/install-ubuntu-windows-10-linux-subsystem-4.jpeg?resize=800%2C632&ssl=1 +[9]: https://itsfoss.com/install-bash-on-windows/ +[10]: https://itsfoss.com/basic-git-commands-cheat-sheet/ +[11]: https://itsfoss.com/linus-torvalds-facts/ +[12]: https://gitforwindows.org/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/git-bash.png?ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/cygwin-shell.jpg?ssl=1 +[15]: http://www.voxforge.org/home/docs/cygwin-cheat-sheet +[16]: https://www.cygwin.com/ +[17]: https://itsfoss.com/reasons-switch-linux-windows-xp/ +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/ubuntu-running-in-virtual-machine-inside-windows.jpeg?resize=800%2C450&ssl=1 +[20]: https://itsfoss.com/install-linux-in-virtualbox/ From 3bda748e887cd90681f285fa097dcb2bf8965051 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 3 Jun 2019 09:08:42 +0800 Subject: [PATCH 0704/1154] translating --- .../tech/20190522 Securing telnet connections with stunnel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190522 Securing telnet connections with stunnel.md b/sources/tech/20190522 Securing telnet connections with stunnel.md index d69b6237cd..526d72109e 100644 --- a/sources/tech/20190522 Securing telnet connections with stunnel.md +++ b/sources/tech/20190522 Securing telnet connections with stunnel.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e8d561762d61fb339e86303f3ef10ead05ec9e87 Mon Sep 17 00:00:00 2001 From: chen ni Date: Mon, 3 Jun 2019 11:39:18 +0800 Subject: [PATCH 0705/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Atos enters the edge-computing business.md | 42 ++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md b/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md index 15c40d8065..8de4d2ca6c 100644 --- a/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md +++ b/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md @@ -7,42 +7,36 @@ [#]: via: (https://www.networkworld.com/article/3397139/atos-is-the-latest-to-enter-the-edge-computing-business.html) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) -French IT giant Atos enters the edge-computing business +法国 IT 巨头 Atos 进军边缘计算 ====== -Atos takes a different approach to edge computing with a device called BullSequana Edge that's the size of a suitcase. +Atos 另辟蹊径,通过一种只有行李箱大小的设备 BullSequana Edge 进军边缘计算。 ![iStock][1] -French IT giant Atos is the latest to jump into the edge computing business with a small device called BullSequana Edge. Unlike devices from its competitors that are the size of a shipping container, including those from Vapor IO and Schneider Electronics, Atos' edge device can sit in a closet. +法国 IT 巨头 Atos 是最晚一个开展边缘计算业务的,他们的产品是一个叫做 BullSequana Edge 的小型设备。和竞争对手们的集装箱大小的设备不同(比如说 Vapor IO 和 Schneider Electronics的产品),Atos 的边缘设备完全可以被放进衣柜里。 -Atos says the device uses artificial intelligence (AI) applications to offer fast response times that are needed in areas such as manufacturing 4.0, autonomous vehicles, healthcare and retail/airport security – where data needs to be processed and analyzed at the edge in real time. +Atos 表示,他们的这个设备使用人工智能应用提供快速响应,适合需要快速响应的领域比如生产 4.0、自动驾驶汽车、健康管理,以及零售业和机场的安保系统。在这些领域,数据需要在边缘进行实时处理和分析。 -**[ Also see:[What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3].]** +**[ 延伸阅读:[什么是边缘计算?][2] 以及 [边缘网络和物联网如何重新定义数据中心][3].]** -The BullSequana Edge can be purchased as standalone infrastructure or bundled with Atos’ software edge software, and that software is pretty impressive. Atos says the BullSequana Edge supports three main categories of use cases: +BullSequana Edge 可以作为独立的基础设施单独采购,也可以和Atos的边缘软件捆绑采购,并且这个软件还是非常出色的。Atos 表示 BullSequana Edge 主要支持三种使用场景: - * AI: Atos Edge Computer Vision software for surveillance cameras provide advanced extraction and analysis of features such as people, faces, emotions, and behaviors so that automatic actions can be carried out based on that analysis. - * Big data: Atos Edge Data Analytics enables organizations to improve their business models with predictive and prescriptive solutions. It utilizes data lake capabilities to make data trustworthy and useable. - * Containers: Atos Edge Data Container (EDC) is an all-in-one container solution that is ready to run at the edge and serves as a decentralized IT system that can run autonomously in non-data center environments with no need for local on-site operation. + * AI(人工智能):Atos 的边缘计算机视觉软件为监控摄像头提供先进的特征抽取和分析技术,包括人像,人脸,行为等特征。这些分析可以支持系统做出自动化响应。 + * 大数据:Atos 边缘数据分析系统通过预测性和规范性的解决方案,帮助机构优化商业模型。它使用数据湖的功能,确保数据的可信度和可用性。 + * 容器:Atos 边缘数据容器(EDC)是一种一体化容器解决方案。它可以作为一个去中心化的 IT 系统在边缘运行,并且可以在没有数据中心的环境下自动运行,而不需要现场操作。 +由于体积小,BullSequana Edge 并不具备很强的处理能力。它装载一个 16 核的 Intel Xeon 中央处理器,可以装备最多两枚英伟达 Tesla T4 图形处理器或者是FPGA(现场可编程门阵列)。Atos 表示,这就足够让复杂的 AI 模型在边缘进行低延迟的运行了。 +考虑到数据的敏感性,BullSequana Edge 同时装备了一个入侵感应器,用来在遭遇物理入侵的时候禁用机器。 -Because of its small size, the BullSequana Edge doesn’t pack a lot of processing power. It comes with a 16-core Intel Xeon CPU and can hold up to two Nvidia Tesla T4 GPUs or optional FPGAs. Atos says that is enough to handle the inference of complex AI models with low latency at the edge. +虽然大多数边缘设备都被安放在信号塔附近,但是考虑到边缘系统可能被安放在任何地方,BullSequana Edge 还支持通过无线电、全球移动通信系统(GSM),或者 Wi-Fi 来进行通信。 -Because it handles sensitive data, BullSequana Edge also comes with an intrusion sensor that will disable the machine in case of physical attacks. +Atos 在美国也许不是一个家喻户晓的名字,但是在欧洲它可以和 IBM 相提并论,并且在过去的十年里已经收购了诸如 Bull SA, Xerox IT Outsourcing, 以及 Siemens IT 的 IT 巨头们。 -Most edge devices are placed near cell towers, but since the edge system can be placed anywhere, it can communicate via radio, Global System for Mobile Communications (GSM), or Wi-Fi. +**关于边缘网络的延伸阅读:** -Atos may not be a household name in the U.S., but it’s on par with IBM in Europe, having acquired IT giants Bull SA, Xerox IT Outsourcing, and Siemens IT all in this past decade. - -**More about edge networking:** - - * [How edge networking and IoT will reshape data centers][3] - * [Edge computing best practices][4] - * [How edge computing can help secure the IoT][5] - - - -Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + * [边缘网络和物联网如何重新定义数据中心][3] + * [边缘计算的最佳实践][4] + * [边缘计算如何提升物联网安全][5] -------------------------------------------------------------------------------- @@ -50,7 +44,7 @@ via: https://www.networkworld.com/article/3397139/atos-is-the-latest-to-enter-th 作者:[Andy Patrizio][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[chen-ni](https://github.com/chen-ni) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9c68a6427cf029da2c52bcb3bcfafd15013a21f7 Mon Sep 17 00:00:00 2001 From: chen ni Date: Mon, 3 Jun 2019 11:46:33 +0800 Subject: [PATCH 0706/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91-?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...French IT giant Atos enters the edge-computing business.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md b/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md index 8de4d2ca6c..0b04f999ff 100644 --- a/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md +++ b/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md @@ -12,7 +12,7 @@ Atos 另辟蹊径,通过一种只有行李箱大小的设备 BullSequana Edge 进军边缘计算。 ![iStock][1] -法国 IT 巨头 Atos 是最晚一个开展边缘计算业务的,他们的产品是一个叫做 BullSequana Edge 的小型设备。和竞争对手们的集装箱大小的设备不同(比如说 Vapor IO 和 Schneider Electronics的产品),Atos 的边缘设备完全可以被放进衣柜里。 +法国 IT 巨头 Atos 是最晚开展边缘计算业务的,他们的产品是一个叫做 BullSequana Edge 的小型设备。和竞争对手们的集装箱大小的设备不同(比如说 Vapor IO 和 Schneider Electronics的产品),Atos 的边缘设备完全可以被放进衣柜里。 Atos 表示,他们的这个设备使用人工智能应用提供快速响应,适合需要快速响应的领域比如生产 4.0、自动驾驶汽车、健康管理,以及零售业和机场的安保系统。在这些领域,数据需要在边缘进行实时处理和分析。 @@ -37,6 +37,8 @@ Atos 在美国也许不是一个家喻户晓的名字,但是在欧洲它可以 * [边缘网络和物联网如何重新定义数据中心][3] * [边缘计算的最佳实践][4] * [边缘计算如何提升物联网安全][5] + + 加入 Network World 的[Facebook 社区][6] 和 [LinkedIn 社区][7],参与最前沿话题的讨论。 -------------------------------------------------------------------------------- From 8fce43cb54540c2076c68d3e6e55be86cc5bc57f Mon Sep 17 00:00:00 2001 From: chen ni Date: Mon, 3 Jun 2019 11:48:33 +0800 Subject: [PATCH 0707/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91-?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...French IT giant Atos enters the edge-computing business.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md b/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md index 0b04f999ff..d07751ff71 100644 --- a/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md +++ b/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md @@ -24,7 +24,7 @@ BullSequana Edge 可以作为独立的基础设施单独采购,也可以和Ato * 大数据:Atos 边缘数据分析系统通过预测性和规范性的解决方案,帮助机构优化商业模型。它使用数据湖的功能,确保数据的可信度和可用性。 * 容器:Atos 边缘数据容器(EDC)是一种一体化容器解决方案。它可以作为一个去中心化的 IT 系统在边缘运行,并且可以在没有数据中心的环境下自动运行,而不需要现场操作。 -由于体积小,BullSequana Edge 并不具备很强的处理能力。它装载一个 16 核的 Intel Xeon 中央处理器,可以装备最多两枚英伟达 Tesla T4 图形处理器或者是FPGA(现场可编程门阵列)。Atos 表示,这就足够让复杂的 AI 模型在边缘进行低延迟的运行了。 +由于体积小,BullSequana Edge 并不具备很强的处理能力。它装载一个 16 核的 Intel Xeon 中央处理器,可以装备最多两枚英伟达 Tesla T4 图形处理器或者是 FPGA(现场可编程门阵列)。Atos 表示,这就足够让复杂的 AI 模型在边缘进行低延迟的运行了。 考虑到数据的敏感性,BullSequana Edge 同时装备了一个入侵感应器,用来在遭遇物理入侵的时候禁用机器。 @@ -38,7 +38,7 @@ Atos 在美国也许不是一个家喻户晓的名字,但是在欧洲它可以 * [边缘计算的最佳实践][4] * [边缘计算如何提升物联网安全][5] - 加入 Network World 的[Facebook 社区][6] 和 [LinkedIn 社区][7],参与最前沿话题的讨论。 + 加入 Network World 的 [Facebook 社区][6] 和 [LinkedIn 社区][7],参与最前沿话题的讨论。 -------------------------------------------------------------------------------- From c0b281572aaac6b64bc2c94b5b89c79604643342 Mon Sep 17 00:00:00 2001 From: chen ni Date: Mon, 3 Jun 2019 11:50:40 +0800 Subject: [PATCH 0708/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91-?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=96=87=E4=BB=B6=E5=88=B0translated?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...522 French IT giant Atos enters the edge-computing business.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20190522 French IT giant Atos enters the edge-computing business.md (100%) diff --git a/sources/talk/20190522 French IT giant Atos enters the edge-computing business.md b/translated/talk/20190522 French IT giant Atos enters the edge-computing business.md similarity index 100% rename from sources/talk/20190522 French IT giant Atos enters the edge-computing business.md rename to translated/talk/20190522 French IT giant Atos enters the edge-computing business.md From f4390d4ba212e93f813ed263030da8682f32857f Mon Sep 17 00:00:00 2001 From: tao Zhang Date: Mon, 3 Jun 2019 15:34:28 +0800 Subject: [PATCH 0709/1154] translate complete --- .../20190520 Getting Started With Docker.md | 485 ++++++++++++++++++ 1 file changed, 485 insertions(+) create mode 100644 translated/tech/20190520 Getting Started With Docker.md diff --git a/translated/tech/20190520 Getting Started With Docker.md b/translated/tech/20190520 Getting Started With Docker.md new file mode 100644 index 0000000000..f745962bdd --- /dev/null +++ b/translated/tech/20190520 Getting Started With Docker.md @@ -0,0 +1,485 @@ +[#]: collector: "lujun9972" +[#]: translator: "zhang5788" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Getting Started With Docker" +[#]: via: "https://www.ostechnix.com/getting-started-with-docker/" +[#]: author: "sk https://www.ostechnix.com/author/sk/" + +Docker 入门指南 +====== + +![Getting Started With Docker][1] + +在我们的上一个教程中,我们已经了解[**如何在ubuntu上安装Docker**][1],和如何在[**CentOS上安装Docker**][2]。今天,我们将会了解Docker的一些基础用法。该教程包含了如何创建一个新的docker容器,如何运行该容器,如何从现有的docker容器中创建自己的Docker镜像等Docker 的一些基础知识,操作。所有步骤均在Ubuntu 18.04 LTS server 版本下测试通过。 + +### 入门指南 + +在开始指南之前,不要混淆Docker镜像和Docker容器这两个概念。在之前的教程中,我就解释过,Docker镜像是决定Docker容器行为的一个文件,Docker容器则是Docker镜像的运行态或停止态。(译者注:在`macOS`下使用docker终端时,不需要加`sudo`) + +##### 1. 搜索Docker镜像 + +我们可以从Docker的仓库中获取镜像,例如[**Docker hub**][3], 或者自己创建镜像。这里解释一下,`Docker hub`是一个云服务器,用来提供给Docker的用户们,创建,测试,和保存他们的镜像。 + +`Docker hub`拥有成千上万个Docker 的镜像文件。你可以在这里搜索任何你想要的镜像,通过`docker search`命令。 + +例如,搜索一个基于ubuntu的镜像文件,只需要运行: + +```shell +$ sudo docker search ubuntu +``` + +**Sample output:** + +![][5] + +搜索基于CentOS的镜像,运行: + +```shell +$ sudo docker search ubuntu +``` + +搜索AWS的镜像,运行: + +```shell +$ sudo docker search aws +``` + +搜索`wordpress`的镜像: + +```shell +$ sudo docker search wordpress +``` + +`Docker hub`拥有几乎所有种类的镜像,包含操作系统,程序和其他任意的类型,这些你都能在`docker hub`上找到已经构建完的镜像。如果你在搜索时,无法找到你想要的镜像文件,你也可以自己构建一个,将其发布出去,或者仅供你自己使用。 + +##### 2. 下载Docker 镜像 + +下载`ubuntu`的镜像,你需要在终端运行以下命令: + +```shell +$ sudo docker pull ubuntu +``` + +这条命令将会从**Docker hub**下载最近一个版本的ubuntu镜像文件。 + +**Sample output:** + +> ```shell +> Using default tag: latest +> latest: Pulling from library/ubuntu +> 6abc03819f3e: Pull complete +> 05731e63f211: Pull complete +> 0bd67c50d6be: Pull complete +> Digest: sha256:f08638ec7ddc90065187e7eabdfac3c96e5ff0f6b2f1762cf31a4f49b53000a5 +> Status: Downloaded newer image for ubuntu:latest +> ``` + +![下载docker 镜像][6] + +你也可以下载指定版本的ubuntu镜像。运行以下命令: + +```shell +$ docker pull ubuntu:18.04 +``` + +Dokcer允许在任意的宿主机操作系统下,下载任意的镜像文件,并运行。 + +例如,下载CentOS镜像: + +```shell +$ sudo docker pull centos +``` + +所有下载的镜像文件,都被保存在`/var/lib/docker`文件夹下。(译者注:不同操作系统存放的文件夹并不是一致的,具体存放位置请在官方查询) + +查看已经下载的镜像列表,可以使用以下命令: + +```shell +$ sudo docker images +``` + +**输出为:** + +```shell +REPOSITORY TAG IMAGE ID CREATED SIZE +ubuntu latest 7698f282e524 14 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +正如你看到的那样,我已经下载了三个镜像文件:**ubuntu**, **CentOS**和**Hello-world**. + +现在,让我们继续,来看一下如何运行我们刚刚下载的镜像。 + +##### 3. 运行Docker镜像 + +运行一个容器有两种方法。我们可以使用`TAG`或者是`镜像ID`。`TAG`指的是特定的镜像快照。`镜像ID`是指镜像的唯一标识。 + +正如上面结果中显示,`latest`是所有镜像的一个标签。**7698f282e524**是Ubuntu docker 镜像的`镜像ID`,**9f38484d220f**是CentOS镜像的`镜像ID`,**fce289e99eb9**是hello_world镜像的`镜像ID`。 + +下载完Docker镜像之后,你可以通过下面的命令来使用`TAG`的方式启动: + +```shell +$ sudo docker run -t -i ubuntu:latest /bin/bash +``` + +在这条语句中: + +* **-t**: 在该容器中启动一个新的终端 +* **-i**: 通过容器中的标准输入流建立交互式连接 +* **ubuntu:latest**:带有标签`latest`的ubuntu容器 +* **/bin/bash** : 在新的容器中启动`BASH Shell` + +或者,你可以通过`镜像ID`来启动新的容器: + +```shell +$ sudo docker run -t -i 7698f282e524 /bin/bash +``` + +在这条语句里: + +* **7698f282e524** —`镜像ID` + +在启动容器之后,将会自动进入容器的`shell`中(注意看命令行的提示符)。 + +![][7] + +Docker 容器的`Shell` + +如果想要退回到宿主机的终端(在这个例子中,对我来说,就是退回到18.04 LTS),并且不中断该容器的执行,你可以按下`CTRL+P `,再按下`CTRL+Q`。现在,你就安全的返回到了你的宿主机系统中。需要注意的是,docker 容器仍然在后台运行,我们并没有中断它。 + +可以通过下面的命令来查看正在运行的容器: + +```shell +$ sudo docker ps +``` + +**Sample output:** + +```shell +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +32fc32ad0d54 ubuntu:latest "/bin/bash" 7 minutes ago Up 7 minutes modest_jones +``` + +![][8] + +列出正在运行的容器 + +可以看到: + +* **32fc32ad0d54** – `容器 ID` +* **ubuntu:latest** – Docker 镜像 + +需要注意的是,**`容器ID`和Docker `镜像ID`是不同的** + +可以通过以下命令查看所有正在运行和停止运行的容器: + +```shell +$ sudo docker ps -a +``` + +在宿主机中断容器的执行: + +```shell +$ sudo docker stop +``` + +例如: + +```shell +$ sudo docker stop 32fc32ad0d54 +``` + +如果想要进入正在运行的容器中,你只需要运行 + +```shell +$ sudo docker attach 32fc32ad0d54 +``` + +正如你看到的,**32fc32ad0d54**是一个容器的ID。当你在容器中想要退出时,只需要在容器内的终端中输入命令: + +```shell +# exit +``` + +你可以使用这个命令查看后台正在运行的容器: + +```shell +$ sudo docker ps +``` + +##### 4. 构建自己的Docker镜像 + +Docker不仅仅可以下载运行在线的容器,你也可以创建你的自己的容器。 + +想要创建自己的Docker镜像,你需要先运行一个你已经下载完的容器: + +```shell +$ sudo docker run -t -i ubuntu:latest /bin/bash +``` + +现在,你运行了一个容器,并且进入了该容器。 + +然后,在该容器安装任意一个软件或做任何你想做的事情。 + +例如,我们在容器中安装一个**Apache web 服务器**。 + +当你完成所有的操作,安装完所有的软件之后,你可以执行以下的命令来构建你自己的Docker镜像: + +```shell +# apt update +# apt install apache2 +``` + +同样的,安装和测试所有的你想要安装的软件在容器中。 + +当你安装完毕之后,返回的宿主机的终端。记住,不要关闭容器。想要返回到宿主机的host而不中断容器。请按下CTRL+P ,再按下CTRL+Q。 + +从你的宿主机的终端中,运行以下命令如寻找容器的ID: + +```shell +$ sudo docker ps +``` + +最后,从一个正在运行的容器中创建Docker镜像: + +```shell +$ sudo docker commit 3d24b3de0bfc ostechnix/ubuntu_apache +``` + +**输出为:** + +```shell +sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 +``` + +在这里: + +* **3d24b3de0bfc** — 指ubuntu容器的ID。 +* **ostechnix** — 我们创建的的名称 +* **ubuntu_apache** — 我们创建的镜像 + +让我们检查一下我们新创建的docker镜像 + +```shell +$ sudo docker images +``` + +**输出为:** + +```shell +REPOSITORY TAG IMAGE ID CREATED SIZE +ostechnix/ubuntu_apache latest ce5aa74a48f1 About a minute ago 191MB +ubuntu latest 7698f282e524 15 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +![][9] + +列出所有的docker镜像 + +正如你看到的,这个新的镜像就是我们刚刚在本地系统上从运行的容器上创建的。 + +现在,你可以从这个镜像创建一个新的容器。 + +```shell +$ sudo docker run -t -i ostechnix/ubuntu_apache /bin/bash +``` + +##### 5. 移除容器 + +如果你在docker上的工作已经全部完成,你就可以删除哪些你不需要的容器。 + +想要删除一个容器,首先,你需要停止该容器。 + +我们先来看一下正在运行的容器有哪些 + +```shell +$ sudo docker ps +``` + +**输出为:** + +```shell +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +3d24b3de0bfc ubuntu:latest "/bin/bash" 28 minutes ago Up 28 minutes goofy_easley +``` + +使用`容器ID`来停止该容器: + +```shell +$ sudo docker stop 3d24b3de0bfc +``` + +现在,就可以删除该容器了。 + +```shell +$ sudo docker rm 3d24b3de0bfc +``` + +你就可以按照这样的方法来删除那些你不需要的容器了。 + +当需要删除的容器数量很多时,一个一个删除也是很麻烦的,我们可以直接删除所有的已经停止的容器。只需要运行: + +```shell +$ sudo docker container prune +``` + +按下"**Y**",来确认你的操作 + +```sehll +WARNING! This will remove all stopped containers. +Are you sure you want to continue? [y/N] y +Deleted Containers: +32fc32ad0d5445f2dfd0d46121251c7b5a2aea06bb22588fb2594ddbe46e6564 +5ec614e0302061469ece212f0dba303c8fe99889389749e6220fe891997f38d0 + +Total reclaimed space: 5B +``` + +这个命令仅支持最新的docker。(译者注:仅支持1.25及以上版本的Docker) + +##### 6. 删除Docker镜像 + +当你移除完不要的Docker容器后,你也可以删除你不需要的Docker镜像。 + +列出已经下载的镜像: + +```shell +$ sudo docker images +``` + +**输出为:** + +```shell +REPOSITORY TAG IMAGE ID CREATED SIZE +ostechnix/ubuntu_apache latest ce5aa74a48f1 5 minutes ago 191MB +ubuntu latest 7698f282e524 15 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +由上面的命令可以知道,在本地的系统中存在三个镜像。 + +使用`镜像ID`来删除镜像。 + +```shell +$ sudo docekr rmi ce5aa74a48f1 +``` + +**输出为:** + +```shell +Untagged: ostechnix/ubuntu_apache:latest +Deleted: sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 +Deleted: sha256:d21c926f11a64b811dc75391bbe0191b50b8fe142419f7616b3cee70229f14cd +``` + +**解决问题** + +Docker禁止我们删除一个还在被容器使用的镜像。 + +例如,当我试图删除Docker镜像**b72889fa879c**时,我只能获得一个错误提示: + +```shell +Error response from daemon: conflict: unable to delete b72889fa879c (must be forced) - image is being used by stopped container dde4dd285377 +``` + +这是因为这个Docker镜像正在被一个容器使用。 + +所以,我们来检查一个正在运行的容器: + +```shell +$ sudo docker ps +``` + +**输出为:** + +![][10] + +注意,现在并没有正在运行的容器!!! + +查看一下所有的容器(包含所有的正在运行和已经停止的容器): + +```shell +$ sudo docker pa -a +``` + +**输出为:** + +![][11] + +可以看到,仍然有一些已经停止的容器在使用这些镜像。 + +让我们把这些容器删除: + +```shell +$ sudo docker rm 12e892156219 +``` + +我们仍然使用容器ID来删除这些容器。 + +当我们删除了所有使用该镜像的容器之后,我们就可以删除Docker的镜像了。 + +例如: + +```shell +$ sudo docekr rmi b72889fa879c +``` + +我们再来检查一下本机存在的镜像: + +```shell +$ sudo docker images +``` + +想要知道更多的细节,请参阅本指南末尾给出的官方资源的链接或者在评论区进行留言。 + +或者,下载以下的关于Docker的电子书来了解更多。 + +* **Download** – [**Free eBook: “Docker Containerization Cookbook”**][12] + +* **Download** – [**Free Guide: “Understanding Docker”**][13] + +* **Download** – [**Free Guide: “What is Docker and Why is it So Popular?”**][14] + +* **Download** – [**Free Guide: “Introduction to Docker”**][15] + +* **Download** – [**Free Guide: “Docker in Production”**][16] + +这就是全部的教程了,希望你可以了解Docker的一些基础用法。 + +更多的教程马上就会到来,敬请关注。 + +--- + +via: https://www.ostechnix.com/getting-started-with-docker/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[zhang5788](https://github.com/zhang5788) +校对:[校对者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/2016/04/docker-basics-720x340.png +[2]: http://www.ostechnix.com/install-docker-ubuntu/ +[3]: https://www.ostechnix.com/install-docker-centos/ +[4]: https://hub.docker.com/ +[5]: http://www.ostechnix.com/wp-content/uploads/2016/04/Search-Docker-images.png +[6]: http://www.ostechnix.com/wp-content/uploads/2016/04/Download-docker-images.png +[7]: http://www.ostechnix.com/wp-content/uploads/2016/04/Docker-containers-shell.png +[8]: http://www.ostechnix.com/wp-content/uploads/2016/04/List-running-containers.png +[9]: http://www.ostechnix.com/wp-content/uploads/2016/04/List-docker-images.png +[10]: http://www.ostechnix.com/wp-content/uploads/2016/04/sk@sk-_005-1-1.jpg +[11]: http://www.ostechnix.com/wp-content/uploads/2016/04/sk@sk-_006-1.jpg +[12]: https://ostechnix.tradepub.com/free/w_java39/prgm.cgi?a=1 +[13]: https://ostechnix.tradepub.com/free/w_pacb32/prgm.cgi?a=1 +[14]: https://ostechnix.tradepub.com/free/w_pacb31/prgm.cgi?a=1 +[15]: https://ostechnix.tradepub.com/free/w_pacb29/prgm.cgi?a=1 +[16]: https://ostechnix.tradepub.com/free/w_pacb28/prgm.cgi?a=1 \ No newline at end of file From f563d5a48e0631a7192604861da5f79637f7e45b Mon Sep 17 00:00:00 2001 From: jdh8383 <4565726+jdh8383@users.noreply.github.com> Date: Mon, 3 Jun 2019 17:04:53 +0800 Subject: [PATCH 0710/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tes On Red Hat (RHEL) And CentOS System.md | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) rename {sources => translated}/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md (77%) diff --git a/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md b/translated/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md similarity index 77% rename from sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md rename to translated/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md index 91008ca5e3..bddf3eebaf 100644 --- a/sources/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md +++ b/translated/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md @@ -7,38 +7,38 @@ [#]: via: (https://www.2daygeek.com/check-list-view-find-available-security-updates-on-redhat-rhel-centos-system/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -How To Check Available Security Updates On Red Hat (RHEL) And CentOS System? +如何在 CentOS 或 RHEL 系统上检查可用的安全更新? ====== -As per your organization policy you may need to push only security updates due to varies reasons. +当你更新系统时,根据你所在公司的安全策略,有时候可能只需要打上与安全相关的补丁。 -In most cases, it could be an application compatibility issues. +大多数情况下,这应该是出于程序兼容性方面的考量。 -How to do that? Is it possible to limit yum to perform only security updates? +那该怎样实践呢?有没有办法让 yum 只安装安全补丁呢? -Yes, it’s possible and can be done easily through yum package manager. +答案是肯定的,可以用 yum 包管理器轻松实现。 -In this article, we are not giving only the required information. +在这篇文章中,我们不但会提供所需的信息。 -Instead, we have added lot more commands that help you to gather many information about a given security package. +而且,我们会介绍一些额外的命令,可以帮你获取指定安全更新的详实信息。 -This may give you an idea or opportunity to understand and fix the list of vulnerabilities, which you have it. +希望这样可以启发你去了解并修复你列表上的那些漏洞。 -If security vulnerabilities are discovered, the affected software must be updated in order to limit any potential security risks on system. +一旦有安全漏洞被公布,就必须更新受影响的软件,这样可以降低系统中的安全风险。 -For RHEL/CentOS 6 systems, run the following **[Yum Command][1]** to install yum security plugin. +对于 RHEL 或 CentOS 6 系统,运行下面的 **[Yum 命令][1]** 来安装 yum 安全插件。 ``` # yum -y install yum-plugin-security ``` -The plugin is already a part of yum itself so, no need to install this on RHEL 7&8/CentOS 7&8. +在 RHEL 7&8 或是 CentOS 7&8 上面,这个插件已经是 yum 的一部分了,不用单独安装。 -To list all available erratas (it includes Security, Bug Fix and Product Enhancement) without installing them. +只列出全部可用的补丁(包括安全,Bug 修复以及产品改进),但不安装它们。 ``` # yum updateinfo list available -Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, +已加载插件: changelog, package_upload, product-id, search-disabled-repos, : subscription-manager, verify, versionlock RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 @@ -54,20 +54,20 @@ RHBA-2016:1048 bugfix 389-ds-base-1.3.4.0-30.el7_2.x86_64 RHBA-2016:1298 bugfix 389-ds-base-1.3.4.0-32.el7_2.x86_64 ``` -To count the number of erratas, run the following command. +要统计补丁的大约数量,运行下面的命令。 ``` # yum updateinfo list available | wc -l 11269 ``` -To list all available security updates without installing them. +想列出全部可用的安全补丁但不安装。 -It used to display information about both installed and available advisories on your system. +以下命令用来展示你系统里已安装和待安装的推荐补丁。 ``` # yum updateinfo list security all -Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, +已加载插件: changelog, package_upload, product-id, search-disabled-repos, : subscription-manager, verify, versionlock RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 @@ -81,13 +81,13 @@ Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, RHSA-2018:1380 Important/Sec. 389-ds-base-1.3.7.5-21.el7_5.x86_64 RHSA-2018:2757 Moderate/Sec. 389-ds-base-1.3.7.5-28.el7_5.x86_64 RHSA-2018:3127 Moderate/Sec. 389-ds-base-1.3.8.4-15.el7.x86_64 - RHSA-2014:1031 Important/Sec. 389-ds-base-libs-1.3.1.6-26.el7_0.x86_64 + i RHSA-2014:1031 Important/Sec. 389-ds-base-libs-1.3.1.6-26.el7_0.x86_64 ``` -To print all available advisories security packages (It prints all kind of packages like installed and not-installed). +要显示所有待安装的安全补丁。 ``` -# yum updateinfo list security all | grep -v "i" +# yum updateinfo list security all | egrep -v "^i" RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 @@ -102,23 +102,23 @@ To print all available advisories security packages (It prints all kind of packa RHSA-2018:2757 Moderate/Sec. 389-ds-base-1.3.7.5-28.el7_5.x86_64 ``` -To count the number of available security package, run the following command. +要统计全部安全补丁的大致数量,运行下面的命令。 ``` # yum updateinfo list security all | wc -l 3522 ``` -It’s used to list all of the relevant errata notice information, from the updateinfo.xml data in yum. This includes bugzillas, CVEs, security updates and new. +下面根据已装软件列出可更新的安全补丁。这包括 bugzillas(bug修复),CVEs(知名漏洞数据库),安全更新等。 ``` # yum updateinfo list security -or +或者 # yum updateinfo list sec -Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, +已加载插件: changelog, package_upload, product-id, search-disabled-repos, : subscription-manager, verify, versionlock RHSA-2018:3665 Important/Sec. NetworkManager-1:1.12.0-8.el7_6.x86_64 @@ -134,11 +134,11 @@ RHSA-2018:3665 Important/Sec. NetworkManager-wifi-1:1.12.0-8.el7_6.x86_64 RHSA-2018:3665 Important/Sec. NetworkManager-wwan-1:1.12.0-8.el7_6.x86_64 ``` -To display all updates that are security relevant, and get a return code on whether there are security updates. +显示所有与安全相关的更新,并且返回一个结果来告诉你是否有可用的补丁。 ``` # yum --security check-update -Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +已加载插件: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock rhel-7-server-rpms | 2.0 kB 00:00:00 --> policycoreutils-devel-2.2.5-20.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo) --> smc-raghumalayalam-fonts-6.0-7.el7.noarch from rhel-7-server-rpms excluded (updateinfo) @@ -162,7 +162,7 @@ NetworkManager-libnm.x86_64 1:1.12.0-10.el7_6 rhel-7 NetworkManager-ppp.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms ``` -To list all available security updates with verbose descriptions of the issues. +列出所有可用的安全补丁,并且显示其详细信息。 ``` # yum info-sec @@ -196,12 +196,12 @@ Description : The tzdata packages contain data files with rules for various Severity : None ``` -If you would like to know more information about the given advisory, run the following command. +如果你想要知道某个更新的具体内容,可以运行下面这个命令。 ``` # yum updateinfo RHSA-2019:0163 -Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +已加载插件: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock rhel-7-server-rpms | 2.0 kB 00:00:00 =============================================================================== Important: kernel security, bug fix, and enhancement update @@ -243,12 +243,12 @@ Description : The kernel packages contain the Linux kernel, the core of any updateinfo info done ``` -Similarly, you can view CVEs which affect the system using the following command. +跟之前类似,你可以只查询那些通过 CVE 释出的系统漏洞。 ``` # yum updateinfo list cves -Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, +已加载插件: changelog, package_upload, product-id, search-disabled-repos, : subscription-manager, verify, versionlock CVE-2018-15688 Important/Sec. NetworkManager-1:1.12.0-8.el7_6.x86_64 CVE-2018-15688 Important/Sec. NetworkManager-adsl-1:1.12.0-8.el7_6.x86_64 @@ -260,12 +260,12 @@ CVE-2018-15688 Important/Sec. NetworkManager-ppp-1:1.12.0-8.el7_6.x86_64 CVE-2018-15688 Important/Sec. NetworkManager-team-1:1.12.0-8.el7_6.x86_64 ``` -Similarly, you can view the packages which is belongs to bugfixs by running the following command. +你也可以查看那些跟 bug 修复相关的更新,运行下面的命令。 ``` # yum updateinfo list bugfix | less -Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, +已加载插件: changelog, package_upload, product-id, search-disabled-repos, : subscription-manager, verify, versionlock RHBA-2018:3349 bugfix NetworkManager-1:1.12.0-7.el7_6.x86_64 RHBA-2019:0519 bugfix NetworkManager-1:1.12.0-10.el7_6.x86_64 @@ -277,11 +277,11 @@ RHBA-2018:3349 bugfix NetworkManager-config-server-1:1.12.0-7.el7_6.noarch RHBA-2019:0519 bugfix NetworkManager-config-server-1:1.12.0-10.el7_6.noarch ``` -To get a summary of advisories, which needs to be installed on your system. +要想得到待安装更新的摘要信息,运行这个。 ``` # yum updateinfo summary -Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +已加载插件: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock rhel-7-server-rpms | 2.0 kB 00:00:00 Updates Information Summary: updates 13 Security notice(s) @@ -293,7 +293,7 @@ Updates Information Summary: updates updateinfo summary done ``` -To print only specific pattern of security advisories, run the following command. Similarly, you can check Important or Moderate security advisories info alone. +如果只想打印出低级别的安全更新,运行下面这个命令。类似的,你也可以只查询重要级别和中等级别的安全更新。 ``` # yum updateinfo list sec | grep -i "Low" @@ -310,7 +310,7 @@ via: https://www.2daygeek.com/check-list-view-find-available-security-updates-on 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[jdh8383](https://github.com/jdh8383) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 51c1759317bdaa65a002ad05fa98327b3ba4366d Mon Sep 17 00:00:00 2001 From: tao Zhang Date: Mon, 3 Jun 2019 17:28:57 +0800 Subject: [PATCH 0711/1154] delete source md file --- .../20190520 Getting Started With Docker.md | 499 ------------------ 1 file changed, 499 deletions(-) delete mode 100644 sources/tech/20190520 Getting Started With Docker.md diff --git a/sources/tech/20190520 Getting Started With Docker.md b/sources/tech/20190520 Getting Started With Docker.md deleted file mode 100644 index 596fb27801..0000000000 --- a/sources/tech/20190520 Getting Started With Docker.md +++ /dev/null @@ -1,499 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (zhang5788) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting Started With Docker) -[#]: via: (https://www.ostechnix.com/getting-started-with-docker/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Getting Started With Docker -====== - -![Getting Started With Docker][1] - -In our previous tutorial, we have explained **[how to install Docker in Ubuntu][2]** , and how to [**install Docker in CentOS**][3]. Today, we will see the basic usage of Docker. This guide covers the Docker basics, such as how to create a new container, how to run the container, remove a container, how to build your own Docker image from the Container and so on. Let us get started! All steps given below are tested in Ubuntu 18.04 LTS server edition. - -### Getting Started With Docker - -Before exploring the Docker basics, don’t confuse with Docker images and Docker Containers. As I already explained in the previous tutorial, Docker Image is the file that decides how a Container should behave, and Docker Container is the running or stopped stage of a Docker image. - -##### 1\. Search Docker images - -We can get the images from either from the registry, for example [**Docker hub**][4], or create our own, For those wondering, Docker hub is cloud hosted place where all Docker users build, test, and save their Docker images. - -Docker hub has tens of thousands of Docker images. You can search for the any Docker images with **“docker search”** command. - -For instance, to search for docker images based on Ubuntu, run: - -``` -$ sudo docker search ubuntu -``` - -**Sample output:** - -![][5] - -To search images based on CentOS, run: - -``` -$ sudo docker search ubuntu -``` - -To search images for AWS, run: - -``` -$ sudo docker search aws -``` - -For wordpress: - -``` -$ sudo docker search wordpress -``` - -Docker hub has almost all kind of images. Be it an operating system, application, or anything, you will find pre-built Docker images in Docker hub. If something you’re looking for is not available, you can build it and make it available for public or keep it private for your own use. - -##### 2\. Download Docker image - -To download Docker image for Ubuntu OS, run the following command from the Terminal: - -``` -$ sudo docker pull ubuntu -``` - -The above command will download the latest Ubuntu image from the **Docker hub**. - -**Sample output:** - -``` -Using default tag: latest -latest: Pulling from library/ubuntu -6abc03819f3e: Pull complete -05731e63f211: Pull complete -0bd67c50d6be: Pull complete -Digest: sha256:f08638ec7ddc90065187e7eabdfac3c96e5ff0f6b2f1762cf31a4f49b53000a5 -Status: Downloaded newer image for ubuntu:latest -``` - -![][6] - -Download docker images - -You can also download a specific version of Ubuntu image using command: - -``` -$ docker pull ubuntu:18.04 -``` - -Docker allows us to download any images and start the container regardless of the host OS. - -For example, to download CentOS image, run: - -``` -$ sudo docker pull centos -``` - -All downloaded Docker images will be saved in **/var/lib/docker/** directory. - -To view the list of downloaded Docker images, run: - -``` -$ sudo docker images -``` - -**Sample output:** - -``` -REPOSITORY TAG IMAGE ID CREATED SIZE -ubuntu latest 7698f282e524 14 hours ago 69.9MB -centos latest 9f38484d220f 2 months ago 202MB -hello-world latest fce289e99eb9 4 months ago 1.84kB -``` - -As you see above, I have downloaded three Docker images – **Ubuntu** , **CentOS** and **hello-world**. - -Now, let us go ahead and see how to start or run the containers based on the downloaded images. - -##### 3\. Run Docker Containers - -We can start the containers in two methods. We can start a container either using its **TAG** or **IMAGE ID**. **TAG** refers to a particular snapshot of the image and the **IMAGE ID** is the corresponding unique identifier for that image. - -As you in the above results **“latest”** is the TAG for all containers, and **7698f282e524** is the IMAGE ID of **Ubuntu** Docker image, **9f38484d220f** is the image id of CentOS Docker image and **fce289e99eb9** is the image id of **hello_world** Docker image. - -Once you downloaded the Docker images of your choice, run the following command to start a Docker container by using its TAG. - -``` -$ sudo docker run -t -i ubuntu:latest /bin/bash -``` - -Here, - - * **-t** : Assigns a new Terminal inside the Ubuntu container. - * **-i** : Allows us to make an interactive connection by grabbing the standard in (STDIN) of the container. - * **ubuntu:latest** : Ubuntu container with TAG “latest”. - * **/bin/bash** : BASH shell for the new container. - - - -Or, you can start the container using IMAGE ID as shown below: - -``` -sudo docker run -t -i 7698f282e524 /bin/bash -``` - -Here, - - * **7698f282e524** – Image id - - - -After starting the container, you’ll be landed automatically into the Container’s shell (Command prompt): - -![][7] - -Docker container’s shell - -To return back to the host system’s Terminal (In my case, it is Ubuntu 18.04 LTS) without terminating the Container (guest os), press **CTRL+P** followed by **CTRL+Q**. Now, you’ll be safely return back to your original host computer’s terminal window. Please note that the container is still running in the background and we didn’t terminate it yet. - -To view the list running of containers, run the following command: - -``` -$ sudo docker ps -``` - -**Sample output:** - -``` -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -32fc32ad0d54 ubuntu:latest "/bin/bash" 7 minutes ago Up 7 minutes modest_jones -``` - -![][8] - -List running containers - -Here, - - * **32fc32ad0d54** – Container ID - * **ubuntu:latest** – Docker image - - - -Please note that **Container ID and Docker image ID are different**. - -To list all available ( either running or stopped) containers: - -``` -$ sudo docker ps -a -``` - -To stop (power off the container) from the host’s shell, run the following command: - -``` -$ sudo docker stop -``` - -**Example:** - -``` -$ sudo docker stop 32fc32ad0d54 -``` - -To login back to or attach to the running container, just run: - -``` -$ sudo docker attach 32fc32ad0d54 -``` - -As you already know, **32fc32ad0d54** is the container’s ID. - -To power off a Container from inside it’s shell by typing the following command: - -``` -# exit -``` - -You can verify the list of running containers with command: - -``` -$ sudo docker ps -``` - -##### 4\. Build your custom Docker images - -Docker is not just for downloading and using the existing containers. You can create your own custom docker image as well. - -To do so, start any one the downloaded container: - -``` -$ sudo docker run -t -i ubuntu:latest /bin/bash -``` - -Now, you will be in the container’s shell. - -Then, install any software or do what ever you want to do in the container. - -For example, let us install **Apache web server** in the container. - -Once you did all tweaks, installed all necessary software, run the following command to build your custom Docker image: - -``` -# apt update -# apt install apache2 -``` - -Similarly, install and test any software of your choice in the Container. - -Once you all set, return back to the host system’s shell. Do not stop or poweroff the Container. To switch to the host system’s shell without stopping Container, press CTRL+P followed by CTRL+Q. - -From your host computer’s shell, run the following command to find the container ID: - -``` -$ sudo docker ps -``` - -Finally, create a Docker image of the running Container using command: - -``` -$ sudo docker commit 3d24b3de0bfc ostechnix/ubuntu_apache -``` - -**Sample Output:** - -``` -sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 -``` - -Here, - - * **3d24b3de0bfc** – Ubuntu container ID. As you already, we can - * **ostechnix** – Name of the user who created the container. - * **ubuntu_apache** – Name of the docker image created by user ostechnix. - - - -Let us check whether the new Docker image is created or not with command: - -``` -$ sudo docker images -``` - -**Sample output:** - -``` -REPOSITORY TAG IMAGE ID CREATED SIZE -ostechnix/ubuntu_apache latest ce5aa74a48f1 About a minute ago 191MB -ubuntu latest 7698f282e524 15 hours ago 69.9MB -centos latest 9f38484d220f 2 months ago 202MB -hello-world latest fce289e99eb9 4 months ago 1.84kB -``` - -![][9] - -List docker images - -As you see in the above output, the new Docker image has been created in our localhost system from the running Container. - -Now, you can create a new Container from the newly created Docker image as usual suing command: - -``` -$ sudo docker run -t -i ostechnix/ubuntu_apache /bin/bash -``` - -##### 5\. Removing Containers - -Once you’re done all R&D with Docker containers, you can delete if you don’t want them anymore. - -To do so, First we have to stop (power off) the running Containers. - -Let us find out the running containers with command: - -``` -$ sudo docker ps -``` - -**Sample output:** - -``` -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -3d24b3de0bfc ubuntu:latest "/bin/bash" 28 minutes ago Up 28 minutes goofy_easley -``` - -Stop the running container by using it’s ID: - -``` -$ sudo docker stop 3d24b3de0bfc -``` - -Now, delete the container using command: - -``` -$ sudo docker rm 3d24b3de0bfc -``` - -Similarly, stop all containers and delete them if they are no longer required. - -Deleting multiple containers one by one can be a tedious task. So, we can delete all stopped containers in one go, just run: - -``` -$ sudo docker container prune -``` - -Type **“Y”** and hit ENTER key to delete the containers. - -``` -WARNING! This will remove all stopped containers. -Are you sure you want to continue? [y/N] y -Deleted Containers: -32fc32ad0d5445f2dfd0d46121251c7b5a2aea06bb22588fb2594ddbe46e6564 -5ec614e0302061469ece212f0dba303c8fe99889389749e6220fe891997f38d0 - -Total reclaimed space: 5B -``` - -This command will work only with latest Docker versions. - -##### 6\. Removing Docker images - -Once you removed containers, you can delete the Docker images that you no longer need. - -To find the list of the Downloaded Docker images: - -``` -$ sudo docker images -``` - -**Sample output:** - -``` -REPOSITORY TAG IMAGE ID CREATED SIZE -ostechnix/ubuntu_apache latest ce5aa74a48f1 5 minutes ago 191MB -ubuntu latest 7698f282e524 15 hours ago 69.9MB -centos latest 9f38484d220f 2 months ago 202MB -hello-world latest fce289e99eb9 4 months ago 1.84kB -``` - -As you see above, we have three Docker images in our host system. - -Let us delete them by using their IMAGE id: - -``` -$ sudo docker rmi ce5aa74a48f1 -``` - -**Sample output:** - -``` -Untagged: ostechnix/ubuntu_apache:latest -Deleted: sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 -Deleted: sha256:d21c926f11a64b811dc75391bbe0191b50b8fe142419f7616b3cee70229f14cd -``` - -##### Troubleshooting - -Docker won’t let you to delete the Docker images if they are used by any running or stopped containers. - -For example, when I try to delete a Docker Image with ID **b72889fa879c** , from one of my old Ubuntu server. I got the following error: - -``` -Error response from daemon: conflict: unable to delete b72889fa879c (must be forced) - image is being used by stopped container dde4dd285377 -``` - -This is because the Docker image that you want to delete is currently being used by another Container. - -So, let us check the running Container using command: - -``` -$ sudo docker ps -``` - -**Sample output:** - -![][10] - -Oops! There is no running container. - -Let us again check for all containers (Running and stopped) with command: - -``` -$ sudo docker ps -a -``` - -**Sample output:** - -![][11] - -As you see there are still some stopped containers are using one of the Docker images. So, let us delete all of the containers. - -**Example:** - -``` -$ sudo docker rm 12e892156219 -``` - -Similarly, remove all containers as shown above using their respective container’s ID. - -Once you deleted all Containers, finally remove the Docker images. - -**Example:** - -``` -$ sudo docker rmi b72889fa879c -``` - -That’s it. Let us verify is there any other Docker images in the host with command: - -``` -$ sudo docker images -``` - -For more details, refer the official resource links given at the end of this guide or drop a comment in the comment section below. - -Also, download and use the following Docker Ebooks to get to know more about it. - -** **Download** – [**Free eBook: “Docker Containerization Cookbook”**][12] - -** **Download** – [**Free Guide: “Understanding Docker”**][13] - -** **Download** – [**Free Guide: “What is Docker and Why is it So Popular?”**][14] - -** **Download** – [**Free Guide: “Introduction to Docker”**][15] - -** **Download** – [**Free Guide: “Docker in Production”**][16] - -And, that’s all for now. Hope you a got the basic idea about Docker usage. - -More good stuffs to come. Stay tuned! - -Cheers!! - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/getting-started-with-docker/ - -作者:[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/2016/04/docker-basics-720x340.png -[2]: http://www.ostechnix.com/install-docker-ubuntu/ -[3]: https://www.ostechnix.com/install-docker-centos/ -[4]: https://hub.docker.com/ -[5]: http://www.ostechnix.com/wp-content/uploads/2016/04/Search-Docker-images.png -[6]: http://www.ostechnix.com/wp-content/uploads/2016/04/Download-docker-images.png -[7]: http://www.ostechnix.com/wp-content/uploads/2016/04/Docker-containers-shell.png -[8]: http://www.ostechnix.com/wp-content/uploads/2016/04/List-running-containers.png -[9]: http://www.ostechnix.com/wp-content/uploads/2016/04/List-docker-images.png -[10]: http://www.ostechnix.com/wp-content/uploads/2016/04/sk@sk-_005-1-1.jpg -[11]: http://www.ostechnix.com/wp-content/uploads/2016/04/sk@sk-_006-1.jpg -[12]: https://ostechnix.tradepub.com/free/w_java39/prgm.cgi?a=1 -[13]: https://ostechnix.tradepub.com/free/w_pacb32/prgm.cgi?a=1 -[14]: https://ostechnix.tradepub.com/free/w_pacb31/prgm.cgi?a=1 -[15]: https://ostechnix.tradepub.com/free/w_pacb29/prgm.cgi?a=1 -[16]: https://ostechnix.tradepub.com/free/w_pacb28/prgm.cgi?a=1 From 26c040bd87c77fadeb7b082f48f39c306375d7d0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 Jun 2019 17:38:02 +0800 Subject: [PATCH 0712/1154] PRF:20190522 French IT giant Atos enters the edge-computing business.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chen-ni 恭喜你完成了第一篇翻译! --- ...Atos enters the edge-computing business.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/translated/talk/20190522 French IT giant Atos enters the edge-computing business.md b/translated/talk/20190522 French IT giant Atos enters the edge-computing business.md index d07751ff71..721dcafa30 100644 --- a/translated/talk/20190522 French IT giant Atos enters the edge-computing business.md +++ b/translated/talk/20190522 French IT giant Atos enters the edge-computing business.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (French IT giant Atos enters the edge-computing business) @@ -9,18 +9,20 @@ 法国 IT 巨头 Atos 进军边缘计算 ====== -Atos 另辟蹊径,通过一种只有行李箱大小的设备 BullSequana Edge 进军边缘计算。 + +> Atos 另辟蹊径,通过一种只有行李箱大小的设备 BullSequana Edge 进军边缘计算。 + ![iStock][1] -法国 IT 巨头 Atos 是最晚开展边缘计算业务的,他们的产品是一个叫做 BullSequana Edge 的小型设备。和竞争对手们的集装箱大小的设备不同(比如说 Vapor IO 和 Schneider Electronics的产品),Atos 的边缘设备完全可以被放进衣柜里。 +法国 IT 巨头 Atos 是最近才开展边缘计算业务的,他们的产品是一个叫做 BullSequana Edge 的小型设备。和竞争对手们的集装箱大小的设备不同(比如说 Vapor IO 和 Schneider Electronics 的产品),Atos 的边缘设备完全可以被放进衣柜里。 Atos 表示,他们的这个设备使用人工智能应用提供快速响应,适合需要快速响应的领域比如生产 4.0、自动驾驶汽车、健康管理,以及零售业和机场的安保系统。在这些领域,数据需要在边缘进行实时处理和分析。 -**[ 延伸阅读:[什么是边缘计算?][2] 以及 [边缘网络和物联网如何重新定义数据中心][3].]** +[延伸阅读:[什么是边缘计算?][2] 以及 [边缘网络和物联网如何重新定义数据中心][3]] -BullSequana Edge 可以作为独立的基础设施单独采购,也可以和Atos的边缘软件捆绑采购,并且这个软件还是非常出色的。Atos 表示 BullSequana Edge 主要支持三种使用场景: +BullSequana Edge 可以作为独立的基础设施单独采购,也可以和 Atos 的边缘软件捆绑采购,并且这个软件还是非常出色的。Atos 表示 BullSequana Edge 主要支持三种使用场景: - * AI(人工智能):Atos 的边缘计算机视觉软件为监控摄像头提供先进的特征抽取和分析技术,包括人像,人脸,行为等特征。这些分析可以支持系统做出自动化响应。 + * AI(人工智能):Atos 的边缘计算机视觉软件为监控摄像头提供先进的特征抽取和分析技术,包括人像、人脸、行为等特征。这些分析可以支持系统做出自动化响应。 * 大数据:Atos 边缘数据分析系统通过预测性和规范性的解决方案,帮助机构优化商业模型。它使用数据湖的功能,确保数据的可信度和可用性。 * 容器:Atos 边缘数据容器(EDC)是一种一体化容器解决方案。它可以作为一个去中心化的 IT 系统在边缘运行,并且可以在没有数据中心的环境下自动运行,而不需要现场操作。 @@ -30,15 +32,13 @@ BullSequana Edge 可以作为独立的基础设施单独采购,也可以和Ato 虽然大多数边缘设备都被安放在信号塔附近,但是考虑到边缘系统可能被安放在任何地方,BullSequana Edge 还支持通过无线电、全球移动通信系统(GSM),或者 Wi-Fi 来进行通信。 -Atos 在美国也许不是一个家喻户晓的名字,但是在欧洲它可以和 IBM 相提并论,并且在过去的十年里已经收购了诸如 Bull SA, Xerox IT Outsourcing, 以及 Siemens IT 的 IT 巨头们。 +Atos 在美国也许不是一个家喻户晓的名字,但是在欧洲它可以和 IBM 相提并论,并且在过去的十年里已经收购了诸如 Bull SA、施乐 IT 外包以及西门子 IT 等 IT 巨头们。 -**关于边缘网络的延伸阅读:** +关于边缘网络的延伸阅读: * [边缘网络和物联网如何重新定义数据中心][3] * [边缘计算的最佳实践][4] * [边缘计算如何提升物联网安全][5] - - 加入 Network World 的 [Facebook 社区][6] 和 [LinkedIn 社区][7],参与最前沿话题的讨论。 -------------------------------------------------------------------------------- @@ -47,7 +47,7 @@ via: https://www.networkworld.com/article/3397139/atos-is-the-latest-to-enter-th 作者:[Andy Patrizio][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/) 荣誉推出 From 8f93bd6eaa1f391f6e529a43c9ed6c257000b8b1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 Jun 2019 17:39:30 +0800 Subject: [PATCH 0713/1154] PUB:20190522 French IT giant Atos enters the edge-computing business.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chen-ni 本文首发地址: https://linux.cn/article-10934-1.html 你的 LCTT 专页: https://linux.cn/lctt/chen-ni 请注册领取 LCCN: https://lctt.linux.cn/ --- ...French IT giant Atos enters the edge-computing business.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190522 French IT giant Atos enters the edge-computing business.md (98%) diff --git a/translated/talk/20190522 French IT giant Atos enters the edge-computing business.md b/published/20190522 French IT giant Atos enters the edge-computing business.md similarity index 98% rename from translated/talk/20190522 French IT giant Atos enters the edge-computing business.md rename to published/20190522 French IT giant Atos enters the edge-computing business.md index 721dcafa30..1be6353555 100644 --- a/translated/talk/20190522 French IT giant Atos enters the edge-computing business.md +++ b/published/20190522 French IT giant Atos enters the edge-computing business.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10934-1.html) [#]: subject: (French IT giant Atos enters the edge-computing business) [#]: via: (https://www.networkworld.com/article/3397139/atos-is-the-latest-to-enter-the-edge-computing-business.html) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) From 7e8e9833d539b07066c5bab648a50378bf991497 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 Jun 2019 18:15:56 +0800 Subject: [PATCH 0714/1154] APL:20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5 --- ...in 2.0 - Explaining Smart Contracts And Its Types -Part 5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md b/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md index 072cbd63ee..253ad103b5 100644 --- a/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md +++ b/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5319e5eb833870f48d2ef345549ba5d97f0f9679 Mon Sep 17 00:00:00 2001 From: chen ni Date: Mon, 3 Jun 2019 23:17:00 +0800 Subject: [PATCH 0715/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20 When IoT systems fail- The risk of having bad IoT data.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md b/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md index 0aeaa32a36..8b4d57d9a8 100644 --- a/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md +++ b/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chen-ni) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 36a5447b1ac21dc499909f0e97f6701b1c2fd19f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 3 Jun 2019 23:49:26 +0800 Subject: [PATCH 0716/1154] TSL:20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md part --- ...g Smart Contracts And Its Types -Part 5.md | 80 +++++++++---------- 1 file changed, 36 insertions(+), 44 deletions(-) diff --git a/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md b/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md index 253ad103b5..9e232b3b9b 100644 --- a/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md +++ b/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md @@ -7,61 +7,59 @@ [#]: via: (https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/) [#]: author: (editor https://www.ostechnix.com/author/editor/) -Blockchain 2.0 – Explaining Smart Contracts And Its Types [Part 5] +区块链 2.0:智能合约及其类型(五) ====== ![Explaining Smart Contracts And Its Types][1] -This is the 5th article in **Blockchain 2.0** series. The previous article of this series explored how can we implement [**Blockchain in real estate**][2]. This post briefly explores the topic of **Smart Contracts** within the domain of Blockchains and related technology. Smart Contracts, which are basic protocols to verify and create new “blocks” of data on the blockchain, are touted to be a focal point for future developments and applications of the system. However, like all “cure-all” medications, it is not the answer to everything. We explore the concept from the basics to understand what “smart contracts” are and what they’re not. +这是 区块链 2.0 系列的第 5 篇文章。本系列的前一篇文章探讨了我们如何[在房地产行业实现区块链][2]。本文简要探讨了区块链及相关技术领域内的智能合约Smart Contract主题。智能合约是在区块链上验证和创建新“数据块”的基本协议,它被吹捧为该系统未来发展和应用的焦点。 然而,像所有“万灵药”一样,它不是一切的答案。我们将从基础知识中探索这个概念,以了解“智能合约”是什么以及它们不是什么。 -### Evolving Contracts +### 不断发展的合同 -The world is built on contracts. No individual or firm on earth can function in current society without the use and reuse of contracts. The task of creating, maintaining, and enforcing contracts have become so complicated that entire judicial and legal systems have had to be setup in the name of **“contract law”** to support it. Most of all contracts are in fact overseen by a “trusted” third party to make sure the stakeholders at the ends are taken care of as per the conditions arrived. There are contracts that even talk about a third-party beneficiary. Such contracts are intended to have an effect on a third party who is not an active (or participating) party to the contract. Settling and arguing over contractual obligations takes up the bulk of most legal battles that civil lawsuits are involved in. Surely enough a better way to take care of contracts would be a godsend for individuals and enterprises alike. Not to mention the enormous paperwork it would save the government in the name of verifications and attestations[1][2]. +这个世界建立在合同(合约)之上。没有合约的使用和再利用,地球上任何个人或公司都不能在当前社会中发挥作用。创建、维护和执行合同的任务变得如此复杂,以至于必须以“合同法”的名义建立整个司法和法律系统以支持它。事实上,大多数合同都是由“受信任的”第三方监督,以确保最终的利益相关者按照达成的条件得到妥善处理。有些合同甚至涉及到了第三方受益人。此类合同旨在对不是合同的活跃(或参与)方的第三方产生影响。解决和争论合同义务占据了民事诉讼所涉及的大部分法律纠纷。当然,更好的处理合同的方式来对于个人和企业来说都是天赐之物。更不用说它将以验证和证明的名义拯救政府的巨大[文书工作][7] [^1]。 -Most posts in this series have looked at how existing blockchain tech is being leveraged today. In contrast, this post will be more about what to expect in the coming years. A natural discussion about “smart contracts” evolve from the property discussions presented in the previous post. The current post aims to provide an overview of the capabilities of blockchain to automate and carry out “smart” executable programs. Dealing with this issue pragmatically means we’ll first have to define and explore what these “smart contracts” are and how they fit into the existing system of contracts. We look at major present-day applications and projects going on in the field in the next post titled, **“Blockchain 2.0: Ongoing Projects”**. +本系列中的大多数文章都研究了如何利用现有的区块链技术。相比之下,这篇文章将更多地讲述对未来几年的预期。关于“智能合约”的讨论是从前一篇文章中提出的财产讨论自然而然的演变而来的。当前这篇文章旨在概述区块链自动执行“智能”可执行程序的能力。务实地处理这个问题意味着我们首先必须定义和探索这些“智能合约”是什么,以及它们如何适应现有的合同系统。我们将在下一篇题为“区块链 2.0:正在进行的项目”的文章中查看当前正在进行的主要应用程序和项目。 -### Defining Smart Contracts +### 定义智能合约 -The [**first article of this series**][3] looked at blockchain from a fundamental point of view as a **“distributed ledger”** consisting of blocks of data that were: +[本系列的第一篇文章][3]从基本的角度把区块链看作由以下数据块组成的“分布式分类账本”: - * Tamper-proof - * Non-repudiable (Meaning every block of data is explicitly created by someone and that someone cannot deny any accountability of the same) - * Secure and is resilient to traditional methods of cyber attack - * Almost permanent (of course this depends on the blockchain protocol overlay) - * Highly redundant, by existing on multiple network nodes or participant systems, the failure of one of these nodes will not affect the capabilities of the system in any way, and, - * Offers faster processing depending on application. +* 防篡改 +* 不可否认(意味着每个数据块都是由某人明确创建的,并且该人不能否认相同的责任) +* 安全,且对传统的网络攻击方法具有抗性 +* 几乎是永久性的(当然这取决于区块链协议层) +* 高度冗余,通过存在于多个网络节点或参与者系统上,其中一个节点的故障不会以任何方式影响系统的功能,并且, +* 根据应用可以提供更快的处理速度。 +由于每个数据实例都是通过适当的凭证安全存储和访问的,因此区块链网络可以为精确验证事实和信息提供简便的基础,而无需第三方监督。区块链 2.0 开发也允许“分布式应用程序(DApp)”(我们将在即将发布的文章中详细介绍这个术语)。这些分布式应用程序根据要求存在并在网络上运行。当用户需要它们并通过使用已经过审查并存储在区块链中的信息来执行它们时,它们被调用。 +上面的最后一段为定义智能合约提供了基础。数字商务商会The Chamber for Digital Commerce提供了一个许多专家都同意的智能合约定义。 -Because every instance of data is securely stored and accessible by suitable credentials, a blockchain network can provide easy basis for precise verification of facts and information without the need for third party oversight. blockchain 2.0 developments also allow for **“distributed applications”** (a term which we’ll be looking at in detail in coming posts). Such distributed applications exist and run on the network as per requirements. They’re called when a user needs them and executed by making use of information that has already been vetted and stored on the blockchain. +> “(智能合约是一种)计算机代码,在发生特定条件或条件时,能够根据预先指定的功能自动运行。该代码可以在分布式分类帐上存储和处理,并将任何结果更改写入分布式分类帐” [^2]。 -The last paragraph provides a foundation for defining smart contracts. _**The Chamber for Digital Commerce**_ , provides a definition for smart contracts which many experts agree on. +智能合约如上所述是一种简单的计算机程序,就像 “if-then” 或 “if-else if” 语句一样工作。关于其“智能”的方面来自这样一个事实,即该程序的预定义输入来自区块链分类账本,如上所述,它是一个安全可靠的记录信息源。如果需要,程序可以调用外部服务或来源以获取信息从而验证操作条款,并且只有在满足所有预定义条件后才执行。 -_**“Computer code that, upon the occurrence of a specified condition or conditions, is capable of running automatically according to prespecified functions. The code can be stored and processed on a distributed ledger and would write any resulting change into the distributed ledger”[1].**_ +必须记住,与其名称所暗示的不同,智能合约通常不是自治实体,严格来说也不是合同。1996 年,Nick Szabo 于 很早就提到了智能合约,他将其与接受付款并交付用户选择产品的自动售货机进行了比较。可以在[这里][4]查看全文。此外,人们正在制定允许智能合约进入主流合同使用的法律框架,因此目前该技术的使用仅限于法律监督不那么明确和严格的领域 [^4]。 -Smart contracts are as mentioned above simple computer programs working like “if-then” or “if-else if” statements. The “smart” aspect about the same comes from the fact that the predefined inputs for the program comes from the blockchain ledger, which as proven above, is a secure and reliable source of recorded information. The program can call upon external services or sources to get information as well, if need be, to verify the terms of operation and will only execute once all the predefined conditions are met. +### 智能合约的主要类型 -It has to be kept in mind that unlike what the name implies, smart contracts are not usually autonomous entities nor are they strictly speaking contracts. A very early mention of smart contracts was made by **Nick Szabo** in 1996, where he compared the same with a vending machine accepting payment and delivering the product chosen by the user[3]. The full text can be accessed **[here][4]**. Furthermore, Legal frameworks allowing the entry of smart contracts into mainstream contract use are still being developed and as such the use of the technology currently is limited to areas where legal oversight is less explicit and stringent[4]. +假设读者对合同和计算机编程有基本的了解,并且基于我们对智能合约的定义,我们可以将智能合约和协议粗略地分类为以下主要类别。 -### Major types of smart contracts +##### 1、智能分类账本合约 -Assuming the reader has a basic understanding of contracts and computer programming, and building on from our definition of smart contracts, we can roughly classify smart contracts and protocols into the following major categories. +这些可能是最明显的类型。大多数(如果不是全部)合同都具有法律效力。在不涉及太多技术细节的情况下,智能的合法合约是涉及严格的法律追索权的合同,以防参与合同的当事人不履行其交易的目的。如前所述,不同国家和地区的现行法律框架缺乏对区块链智能和自动化合约的足够支持,其法律地位也不明确。但是,一旦制定了法律,就可以订立智能合约,以简化目前涉及严格监管的流程,如金融和房地产市场交易、政府补贴、国际贸易等。 -##### 1\. Smart legal contracts +##### 2、DAO -These are presumably the most obvious kind. Most, if not, all contracts are legally enforceable. Without going into much technicalities, a smart legal contact is one that involves strict legal recourses in case parties involved in the same were to not fulfill their end of the bargain. As previously mentioned, the current legal framework in different countries and contexts lack sufficient support for smart and automated contracts on the blockchain and their legal status is unclear. However, once the laws are made, smart contracts can be made to simplify processes which currently involve strict regulatory oversight such as transactions in the financial and real estate market, government subsidies, international trade etc. +去中心化的自治组织Decentralized Autonomous Organization,即DAO,可以松散地定义为区块链上存在的社区。社区可以通过一组规则来定义,这些规则通过智能合约来体现并放入代码中。然后,每个参与者的每一个行动都将受到这些规则的约束,其任务是在程序中断的情况下执行并获得追索权。许多智能合约构成了这些规则,它们协同监管和观察参与者。 -##### 2\. DAOs +名为 Genesis DAO 的 DAO 由以太坊参与者于 2016 年 5 月创建。该社区旨在成为众筹和风险投资平台。在极短的时间内,他们设法筹集了惊人的 1.5 亿美元。然而,黑客在系统中发现了漏洞,并设法从众筹投资者手中窃取价值约 5000 万美元的以太币。这次黑客破坏的后果导致以太坊区块链[分裂为两个][8],以太坊和以太坊经典。 -**Decentralized Autonomous Organizations** , shortly DAO, can be loosely defined as communities that exist on the blockchain. The community may be defined by a set of rules arrived at and put into code via smart contracts. Every action by every participant would then be subject to these sets of rules with the task of enforcing and reaching at recourse in case of a break being left to the program. Multitudes of smart contracts make up these rules and they work in tandem policing and watching over participants. +##### 3、应用程序逻辑合约(ALC) -A DAO called the **Genesis DAO** was created by **Ethereum** participants in may of 2016. The community was meant to be a crowdfunding and venture capital platform. In a surprisingly short period of time they managed to raise an astounding **$150 million**. However, hacker(s) found loopholes in the system and managed to steal about **$50 million** dollars’ worth of Ethers from the crowdfund investors. The hack and its fallout resulted in a fork of the Ethereum blockchain into two, **Ethereum** and **Ethereum Classic** [5]. +如果你已经听说过与区块链相关的物联网,那么很可能这个问题谈到了应用程序逻辑合约Application logic contract,即 ALC。此类智能合约包含特定于应用程序的代码,这些代码可以与区块链上的其他智能合约和程序一起使用。它们有助于与设备之间的通信并进行通信验证(在物联网领域)。ALC 是每个多功能智能合约的关键部分,并且大多数都是在管理程序下工作。它们在这里引用的大多数例子中找到[应用][9] [^6]。 -##### 3\. Application logic contracts (ALCs) - -If you’ve heard about the internet of things in conjunction with the blockchain, chances are that the matter talked about **Application logic contacts** , shortly ALC. Such smart contracts contain application specific code that work in conjunction with other smart contracts and programs on the blockchain. They aid in communicating with and validating communication between devices (while in the domain of IoT). ALCs are a pivotal piece of every multi-function smart contract and mostly always work under a managing program. They find applications everywhere in most examples cited here[6][7]. - -_Since development is ongoing in the area, any definition or standard so to speak of will be fluidic and vague at best currently._ +*由于该领域还在开发中,因此目前所说的任何定义或标准最多只能说是流畅而模糊的。* ### How smart contracts work** @@ -135,17 +133,11 @@ All of this is keeping aside the significant initial investment that might be ne Current legal frameworks don’t really support a full-on smart contract enabled society and won’t in the near future due to obvious reasons. A solution is to opt for **“hybrid” contracts** that combine traditional legal texts and documents with smart contract code running on blockchains designed for the purpose[4]. However, even hybrid contracts remain largely unexplored as innovative legislature is required to bring them into fruition. The applications briefly mentioned here and many more are explored in detail in the [**next post of the series**][6]. -**References:** - - * **[1] S. C. A. Chamber of Digital Commerce, “Smart contracts – Is the law ready,” no. September, 2018.** - * **[2] [Legal Definition of ius quaesitum tertio][7]. -** - * **[3][N. Szabo, “Nick Szabo — Smart Contracts: Building Blocks for Digital Markets,” 1996.][4]** - * **[4] Cardozo Blockchain Project, “‘Smart Contracts’ & Legal Enforceability,” vol. 2, p. 28, 2018.** - * **[5][The DAO Heist Undone: 97% of ETH Holders Vote for the Hard Fork.][8]** - * **[6] F. Idelberger, G. Governatori, R. Riveret, and G. Sartor, “Evaluation of Logic-Based Smart Contracts for Blockchain Systems,” 2016, pp. 167–183.** - * **[7][Types of Smart Contracts Based on Applications | Market InsightsTM – Everest Group.][9]** - * **[8] B. Cant et al., “Smart Contracts in Financial Services : Getting from Hype to Reality,” Capgemini Consult., pp. 1–24, 2016.** +[^1]: S. C. A. Chamber of Digital Commerce, “Smart contracts – Is the law ready,” no. September, 2018. +[^2]: S. C. A. Chamber of Digital Commerce, “Smart contracts – Is the law ready,” no. September, 2018. +[^4]: Cardozo Blockchain Project, “‘Smart Contracts’ & Legal Enforceability,” vol. 2, p. 28, 2018. +[^6]: F. Idelberger, G. Governatori, R. Riveret, and G. Sartor, “Evaluation of Logic-Based Smart Contracts for Blockchain Systems,” 2016, pp. 167–183. +[^8]: B. Cant et al., “Smart Contracts in Financial Services : Getting from Hype to Reality,” Capgemini Consult., pp. 1–24, 2016. @@ -155,7 +147,7 @@ via: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its 作者:[editor][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -163,8 +155,8 @@ via: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its [a]: https://www.ostechnix.com/author/editor/ [b]: https://github.com/lujun9972 [1]: https://www.ostechnix.com/wp-content/uploads/2019/03/smart-contracts-720x340.png -[2]: https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/ -[3]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[2]: https://linux.cn/article-10914-1.html +[3]: https://linux.cn/article-10650-1.html [4]: http://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart_contracts_2.html [5]: https://etherparty.com/ [6]: https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/ From 191253c815756f842a783dd6f24d4dc082c225eb Mon Sep 17 00:00:00 2001 From: QiaoN Date: Mon, 3 Jun 2019 21:46:42 +0300 Subject: [PATCH 0717/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190523 Run your blog on GitHub Pages with Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190523 Run your blog on GitHub Pages with Python.md b/sources/tech/20190523 Run your blog on GitHub Pages with Python.md index 1e3634a327..4763e5e215 100644 --- a/sources/tech/20190523 Run your blog on GitHub Pages with Python.md +++ b/sources/tech/20190523 Run your blog on GitHub Pages with Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (QiaoN) [#]: 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] -译者:[译者ID](https://github.com/译者ID) +译者:[QiaoN](https://github.com/QiaoN) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 78a5eaba6c64b010af47fd48c8badbd44a77dbeb Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 4 Jun 2019 08:49:49 +0800 Subject: [PATCH 0718/1154] translated --- ...ecuring telnet connections with stunnel.md | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) rename {sources => translated}/tech/20190522 Securing telnet connections with stunnel.md (51%) diff --git a/sources/tech/20190522 Securing telnet connections with stunnel.md b/translated/tech/20190522 Securing telnet connections with stunnel.md similarity index 51% rename from sources/tech/20190522 Securing telnet connections with stunnel.md rename to translated/tech/20190522 Securing telnet connections with stunnel.md index 526d72109e..cc637cc495 100644 --- a/sources/tech/20190522 Securing telnet connections with stunnel.md +++ b/translated/tech/20190522 Securing telnet connections with stunnel.md @@ -7,38 +7,38 @@ [#]: via: (https://fedoramagazine.org/securing-telnet-connections-with-stunnel/) [#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) -Securing telnet connections with stunnel +使用 stunnel 保护 telnet 连接 ====== ![][1] -Telnet is a client-server protocol that connects to a remote server through TCP over port 23. Telnet does not encrypt data and is considered insecure and passwords can be easily sniffed because data is sent in the clear. However there are still legacy systems that need to use it. This is where **stunnel** comes to the rescue. +Telnet 是一种客户端-服务端协议,通过 TCP 的 23 端口连接到远程服务器。Telnet 并不加密数据,被认为是不安全的,因为数据是以明文形式发送的,所以密码很容易被嗅探。但是,仍有老旧系统需要使用它。这就是用到 **stunnel** 的地方。 -Stunnel is designed to add SSL encryption to programs that have insecure connection protocols. This article shows you how to use it, with telnet as an example. +stunnel 旨在为使用不安全连接协议的程序增加 SSL 加密。本文将以 telnet 为例介绍如何使用它。 -### Server Installation +### 服务端安装 -Install stunnel along with the telnet server and client [using sudo][2]: +[使用 sudo][2] 安装 stunnel 以及 telnet 的服务端和客户端: ``` sudo dnf -y install stunnel telnet-server telnet ``` -Add a firewall rule, entering your password when prompted: +添加防火墙规则,在提示时输入你的密码: ``` firewall-cmd --add-service=telnet --perm firewall-cmd --reload ``` -Next, generate an RSA private key and an SSL certificate: +接下来,生成 RSA 私钥和 SSL 证书: ``` openssl genrsa 2048 > stunnel.key openssl req -new -key stunnel.key -x509 -days 90 -out stunnel.crt ``` -You will be prompted for the following information one line at a time. When asked for _Common Name_ you must enter the correct host name or IP address, but everything else you can skip through by hitting the **Enter** key. +系统将一次提示你输入以下信息。当询问 _Common Name_ 时,你必须输入正确的主机名或 IP 地址,但是你可以按**回车**键跳过其他所有内容。 ``` You are about to be asked to enter information that will be @@ -57,14 +57,14 @@ Common Name (eg, your name or your server's hostname) []: Email Address [] ``` -Merge the RSA key and SSL certificate into a single _.pem_ file, and copy that to the SSL certificate directory: +将 RSA 密钥和 SSL 证书合并到单个 _.pem_ 文件中,并将其复制到 SSL 证书目录: ``` cat stunnel.crt stunnel.key > stunnel.pem sudo cp stunnel.pem /etc/pki/tls/certs/ ``` -Now it’s time to define the service and the ports to use for encrypting your connection. Choose a port that is not already in use. This example uses port 450 for tunneling telnet. Edit or create the _/etc/stunnel/telnet.conf_ file: +现在可以定义服务和用于加密连接的端口了。选择尚未使用的端口。此例使用 450 端口进行隧道传输 telnet。编辑或创建 _/etc/stunnel/telnet.conf_ : ``` cert = /etc/pki/tls/certs/stunnel.pem @@ -80,15 +80,15 @@ accept = 450 connect = 23 ``` -The **accept** option is the port the server will listen to for incoming telnet requests. The **connect** option is the internal port the telnet server listens to. +**accept** 选项是服务器将监听传入 **accept** 请求的接口。**connect** 选项是 telnet 服务器的内部监听接口。 -Next, make a copy of the systemd unit file that allows you to override the packaged version: +接下来,创建一个 systemd 单元文件的副本来覆盖原来的版本: ``` sudo cp /usr/lib/systemd/system/stunnel.service /etc/systemd/system ``` -Edit the _/etc/systemd/system/stunnel.service_ file to add two lines. These lines create a chroot jail for the service when it starts. +编辑 _/etc/systemd/system/stunnel.service_ 来添加两行。这些行在启动时为服务创建 chroot 监狱。 ``` [Unit] @@ -106,49 +106,49 @@ ExecStartPre=/usr/bin/chown -R nobody:nobody /var/run/stunnel WantedBy=multi-user.target ``` -Next, configure SELinux to listen to telnet on the new port you just specified: +接下来,配置 SELinux 以在你刚刚指定的新端口上监听 telnet: ``` sudo semanage port -a -t telnetd_port_t -p tcp 450 ``` -Finally, add a new firewall rule: +最后,添加新的防火墙规则: ``` firewall-cmd --add-port=450/tcp --perm firewall-cmd --reload ``` -Now you can enable and start telnet and stunnel. +现在你可以启用并启动 telnet 和 stunnel。 ``` systemctl enable telnet.socket stunnel@telnet.service --now ``` -A note on the _systemctl_ command is in order. Systemd and the stunnel package provide an additional [template unit file][3] by default. The template lets you drop multiple configuration files for stunnel into _/etc/stunnel_ , and use the filename to start the service. For instance, if you had a _foobar.conf_ file, you could start that instance of stunnel with _systemctl start[stunnel@foobar.service][4]_ , without having to write any unit files yourself. +要注意 _systemctl_ 命令是有序的。systemd 和 stunnel 包默认提供额外的[模板单元文件][3]。该模板允许你将 stunnel 的多个配置文件放到 _/etc/stunnel_ 中,并使用文件名启动该服务。例如,如果你有一个 _foobar.conf_ 文件,那么可以使用 _systemctl start stunnel@foobar.service_ 启动该 stunnel 实例,而无需自己编写任何单元文件。 -If you want, you can set this stunnel template service to start on boot: +如果需要,可以将此 stunnel 模板服务设置为在启动时启动: ``` systemctl enable stunnel@telnet.service ``` -### Client Installation +### 客户端安装 -This part of the article assumes you are logged in as a normal user ([with sudo privileges][2]) on the client system. Install stunnel and the telnet client: +本文的这部分假设你在客户端系统上以普通用户([拥有 sudo 权限][2])身份登录。安装 stunnel 和 telnet 客户端: ``` dnf -y install stunnel telnet ``` -Copy the _stunnel.pem_ file from the remote server to your client _/etc/pki/tls/certs_ directory. In this example, the IP address of the remote telnet server is 192.168.1.143. +将 _stunnel.pem_ 从远程服务器复制到客户端的 _/etc/pki/tls/certs_ 目录。在此例中,远程 telnet 服务器的 IP 地址为 192.168.1.143。 ``` sudo scp myuser@192.168.1.143:/etc/pki/tls/certs/stunnel.pem /etc/pki/tls/certs/ ``` -Create the _/etc/stunnel/telnet.conf_ file: +创建 _/etc/stunnel/telnet.conf_: ``` cert = /etc/pki/tls/certs/stunnel.pem @@ -158,15 +158,15 @@ accept=450 connect=192.168.1.143:450 ``` -The **accept** option is the port that will be used for telnet sessions. The **connect** option is the IP address of your remote server and the port it’s listening on. +**accept** 选项是用于 telnet 会话的端口。**connect** 选项是你远程服务器的 IP 地址以及监听的端口。 -Next, enable and start stunnel: +接下来,启用并启动 stunnel: ``` systemctl enable stunnel@telnet.service --now ``` -Test your connection. Since you have a connection established, you will telnet to _localhost_ instead of the hostname or IP address of the remote telnet server: +测试你的连接。由于有一条已建立的连接,你会 telnet 到 _localhost_ 而不是远程 telnet 服务器的主机名或者 IP 地址。 ``` [user@client ~]$ telnet localhost 450 @@ -189,7 +189,7 @@ via: https://fedoramagazine.org/securing-telnet-connections-with-stunnel/ 作者:[Curt Warfield][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -199,4 +199,3 @@ via: https://fedoramagazine.org/securing-telnet-connections-with-stunnel/ [1]: https://fedoramagazine.org/wp-content/uploads/2019/05/stunnel-816x345.jpg [2]: https://fedoramagazine.org/howto-use-sudo/ [3]: https://fedoramagazine.org/systemd-template-unit-files/ -[4]: mailto:stunnel@foobar.service From 9b3227a5898380c1cbe4328576e4b9921ccdd43e Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 4 Jun 2019 08:58:41 +0800 Subject: [PATCH 0719/1154] translated --- ...90517 Using Testinfra with Ansible to verify server state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md b/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md index c14652a7f4..e845b15e59 100644 --- a/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md +++ b/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 52192c2a996f8ed34440c90464166657a969b1e0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 4 Jun 2019 09:38:12 +0800 Subject: [PATCH 0720/1154] PRF:20190525 4 Ways to Run Linux Commands in Windows.md @geekpi --- ...4 Ways to Run Linux Commands in Windows.md | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md b/translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md index fa96f1794e..6ee901aab9 100644 --- a/translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md +++ b/translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 Ways to Run Linux Commands in Windows) @@ -10,13 +10,13 @@ 在 Windows 中运行 Linux 命令的 4 种方法 ====== -_ **简介:想要使用 Linux 命令,但又不想离开 Windows ?以下是在 Windows 中运行 Linux bash 命令的几种方法。** _ +> 想要使用 Linux 命令,但又不想离开 Windows ?以下是在 Windows 中运行 Linux bash 命令的几种方法。 -如果你在课程中正在学习 shell 脚本,那么需要使用 Linux 命令来练习命令和脚本。 +如果你正在课程中正在学习 shell 脚本,那么需要使用 Linux 命令来练习命令和脚本。 -你的学校实验室可能安装了 Linux,但是你个人没有 [Linux 的笔记本][1],而是像其他人一样的 Windows 计算机。你的作业需要运行 Linux 命令,你也想想知道如何在 Windows 上运行 Bash 命令和脚本。 +你的学校实验室可能安装了 Linux,但是你自己没有安装了 [Linux 的笔记本电脑][1],而是像其他人一样的 Windows 计算机。你的作业需要运行 Linux 命令,你或许想知道如何在 Windows 上运行 Bash 命令和脚本。 -你可以[在双启动模式下同时安装 Windows 和 Linux][2]。此方法能让你在启动计算机时选择 Linux 或 Windows。但是,为了运行 Linux 命令而单独使用分区的麻烦可能不适合所有人。 +你可以[在双启动模式下同时安装 Windows 和 Linux][2]。此方法能让你在启动计算机时选择 Linux 或 Windows。但是,为了运行 Linux 命令而使用单独分区的麻烦可能不适合所有人。 你也可以[使用在线 Linux 终端][3],但你的作业无法保存。 @@ -24,32 +24,31 @@ _ **简介:想要使用 Linux 命令,但又不想离开 Windows ?以下是 ### 在 Windows 中使用 Linux 命令 -![][4] +![](https://img.linux.net.cn/data/attachment/album/201906/04/093809hlz2tblfzt7mbwwl.jpg) 作为一个热心的 Linux 用户和推广者,我希望看到越来越多的人使用“真正的” Linux,但我知道有时候,这不是优先考虑的问题。如果你只是想练习 Linux 来通过考试,可以使用这些方法之一在 Windows 上运行 Bash 命令。 -#### 1\. 在 Windows 10 上使用 Linux Bash Shell +#### 1、在 Windows 10 上使用 Linux Bash Shell -你是否知道可以在 Windows 10 中运行 Linux 发行版? [Windows 的 Linux 子系统 (WSL)][5] 能让你在 Windows 中运行 Linux。即将推出的 WSL 版本将使用 Windows 内部的真正 Linux 内核。 +你是否知道可以在 Windows 10 中运行 Linux 发行版? [Windows 的 Linux 子系统 (WSL)][5] 能让你在 Windows 中运行 Linux。即将推出的 WSL 版本将在 Windows 内部使用真正 Linux 内核。 -此 WSL 在 Windows 上也称为 Bash,它作为一个常规的 Windows 应用运行,并提供了一个命令行模式的 Linux 发行版。不要害怕命令行模式,因为你的目的是运行 Linux 命令。这就是你所需要的。 +此 WSL 也称为 Bash on Windows,它作为一个常规的 Windows 应用运行,并提供了一个命令行模式的 Linux 发行版。不要害怕命令行模式,因为你的目的是运行 Linux 命令。这就是你所需要的。 ![Ubuntu Linux inside Windows][6] 你可以在 Windows 应用商店中找到一些流行的 Linux 发行版,如 Ubuntu、Kali Linux、openSUSE 等。你只需像任何其他 Windows 应用一样下载和安装它。安装后,你可以运行所需的所有 Linux 命令。 - ![Linux distributions in Windows 10 Store][8] 请参考教程:[在 Windows 上安装 Linux bash shell][9]。 -#### 2\. 使用 Git Bash 在 Windows 上运行 Bash 命令 +#### 2、使用 Git Bash 在 Windows 上运行 Bash 命令 -、你可能知道 [Git][10] 是什么。它是由 [Linux 创建者 Linus Torvalds][11] 开发的版本控制系统。 +你可能知道 [Git][10] 是什么。它是由 [Linux 创建者 Linus Torvalds][11] 开发的版本控制系统。 [Git for Windows][12] 是一组工具,能让你在命令行和图形界面中使用 Git。Git for Windows 中包含的工具之一是 Git Bash。 -Git Bash 为 Git 命令行提供了仿真层。除了 Git 命令,Git Bash 还支持许多 Bash 程序,如 ssh、scp、cat、find 等。 +Git Bash 为 Git 命令行提供了仿真层。除了 Git 命令,Git Bash 还支持许多 Bash 程序,如 `ssh`、`scp`、`cat`、`find` 等。 ![Git Bash][13] @@ -57,21 +56,21 @@ Git Bash 为 Git 命令行提供了仿真层。除了 Git 命令,Git Bash 还 你可以从其网站免费下载和安装 Git for Windows 工具来在 Windows 中安装 Git Bash。 -[下载 Git for Windows][12] +- [下载 Git for Windows][12] -#### 3\. 使用 Cygwin 在 Windows 中使用 Linux 命令 +#### 3、使用 Cygwin 在 Windows 中使用 Linux 命令 -如果要在 Windows 中运行 Linux 命令,那么 Cygwin 是一个推荐的工具。Cygwin 创建于 1995 年,旨在提供一个原生运行于 Windows 中的 POSIX 兼容环境。Cygwin 是由 Red Hat 员工和许多其他志愿者维护的免费开源软件。 +如果要在 Windows 中运行 Linux 命令,那么 Cygwin 是一个推荐的工具。Cygwin 创建于 1995 年,旨在提供一个原生运行于 Windows 中的 POSIX 兼容环境。Cygwin 是由 Red Hat 员工和许多其他志愿者维护的自由开源软件。 二十年来,Windows 用户使用 Cygwin 来运行和练习 Linux/Bash 命令。十多年前,我甚至用 Cygwin 来学习 Linux 命令。 -![Cygwin | Image Credit][14] +![Cygwin][14] 你可以从下面的官方网站下载 Cygwin。我还建议你参考这个 [Cygwin 备忘录][15]来开始使用。 -[下载 Cygwin][16] +- [下载 Cygwin][16] -#### 4\. 在虚拟机中使用 Linux +#### 4、在虚拟机中使用 Linux 另一种方法是使用虚拟化软件并在其中安装 Linux。这样,你可以在 Windows 中安装 Linux 发行版(带有图形界面)并像常规 Windows 应用一样运行它。 @@ -83,7 +82,7 @@ Git Bash 为 Git 命令行提供了仿真层。除了 Git 命令,Git Bash 还 你可以按照[本教程学习如何在 VirtualBox 中安装 Linux][20]。 -**总结** +### 总结 运行 Linux 命令的最佳方法是使用 Linux。当选择不安装 Linux 时,这些工具能让你在 Windows 上运行 Linux 命令。都试试看,看哪种适合你。 @@ -94,7 +93,7 @@ via: https://itsfoss.com/run-linux-commands-in-windows/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 07942ad7abc5f97efcf7867393d367e9492237dd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 4 Jun 2019 09:39:48 +0800 Subject: [PATCH 0721/1154] PUB:20190525 4 Ways to Run Linux Commands in Windows.md @geekpi https://linux.cn/article-10935-1.html --- .../20190525 4 Ways to Run Linux Commands in Windows.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190525 4 Ways to Run Linux Commands in Windows.md (98%) diff --git a/translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md b/published/20190525 4 Ways to Run Linux Commands in Windows.md similarity index 98% rename from translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md rename to published/20190525 4 Ways to Run Linux Commands in Windows.md index 6ee901aab9..88944d79af 100644 --- a/translated/tech/20190525 4 Ways to Run Linux Commands in Windows.md +++ b/published/20190525 4 Ways to Run Linux Commands in Windows.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10935-1.html) [#]: subject: (4 Ways to Run Linux Commands in Windows) [#]: via: (https://itsfoss.com/run-linux-commands-in-windows/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From d1379be308b614e610b073d9449746ea7cea8afe Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 4 Jun 2019 13:41:34 +0800 Subject: [PATCH 0722/1154] PRF&PUB:20170414 5 projects for Raspberry Pi at home (#13912) * PRF:20170414 5 projects for Raspberry Pi at home.md @warmfrog * PUB:20170414 5 projects for Raspberry Pi at home.md @warmfrog https://linux.cn/article-10936-1.html --- ...414 5 projects for Raspberry Pi at home.md | 149 ++++++++++++++++++ ...414 5 projects for Raspberry Pi at home.md | 149 ------------------ 2 files changed, 149 insertions(+), 149 deletions(-) create mode 100644 published/20170414 5 projects for Raspberry Pi at home.md delete mode 100644 translated/tech/20170414 5 projects for Raspberry Pi at home.md diff --git a/published/20170414 5 projects for Raspberry Pi at home.md b/published/20170414 5 projects for Raspberry Pi at home.md new file mode 100644 index 0000000000..3d6f5b2382 --- /dev/null +++ b/published/20170414 5 projects for Raspberry Pi at home.md @@ -0,0 +1,149 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10936-1.html) +[#]: subject: (5 projects for Raspberry Pi at home) +[#]: via: (https://opensource.com/article/17/4/5-projects-raspberry-pi-home) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +5 个可在家中使用的树莓派项目 +====================================== + +![5 projects for Raspberry Pi at home][1] + +[树莓派][2] 电脑可被用来进行多种设置用于不同的目的。显然它在教育市场帮助学生在教室和创客空间中学习编程与创客技巧方面占有一席之地,它在工作场所和工厂中有大量行业应用。我打算介绍五个你可能想要在你的家中构建的项目。 + +### 媒体中心 + +在家中人们常用树莓派作为媒体中心来服务多媒体文件。它很容易搭建,树莓派提供了大量的 GPU(图形处理单元)运算能力来在大屏电视上渲染你的高清电视节目和电影。将 [Kodi][3](从前的 XBMC)运行在树莓派上是一个很棒的方式,它可以播放你的硬盘或网络存储上的任何媒体。你同样可以安装一个插件来播放 YouTube 视频。 + +还有几个略微不同的选择,最常见的是 [OSMC][4](开源媒体中心)和 [LibreELEC][5],都是基于 Kodi 的。它们在放映媒体内容方面表现的都非常好,但是 OSMC 有一个更酷炫的用户界面,而 LibreElec 更轻量级。你要做的只是选择一个发行版,下载镜像并安装到一个 SD 卡中(或者仅仅使用 [NOOBS][6]),启动,然后就准备好了。 + +![LibreElec ][7] + +*LibreElec;树莓派基金会, CC BY-SA* + +![OSMC][8] + +*OSMC.tv, 版权所有, 授权使用* + +在往下走之前,你需要决定[使用哪种树莓派][9]。这些发行版在任何树莓派(1、2、3 或 Zero)上都能运行,视频播放在这些树莓派中的任何一个上都能胜任。除了 Pi 3(和 Zero W)有内置 Wi-Fi,唯一可察觉的不同是用户界面的反应速度,在 Pi 3 上更快。Pi 2 也不会慢太多,所以如果你不需要 Wi-Fi 它也是可以的,但是当切换菜单时,你会注意到 Pi 3 比 Pi 1 和 Zero 表现的更好。 + +### SSH 网关 + +如果你想从外部网络访问你的家庭局域网的电脑和设备,你必须打开这些设备的端口来允许外部访问。在互联网中开放这些端口有安全风险,意味着你总是你总是处于被攻击、滥用或者其他各种未授权访问的风险中。然而,如果你在你的网络中安装一个树莓派,并且设置端口映射来仅允许通过 SSH 访问树莓派,你可以这么用来作为一个安全的网关来跳到网络中的其他树莓派和 PC。 + +大多数路由允许你配置端口映射规则。你需要给你的树莓派一个固定的内网 IP 地址来设置你的路由器端口 22 映射到你的树莓派端口 22。如果你的网络服务提供商给你提供了一个静态 IP 地址,你能够通过 SSH 和主机的 IP 地址访问(例如,`ssh pi@123.45.56.78`)。如果你有一个域名,你可以配置一个子域名指向这个 IP 地址,所以你没必要记住它(例如,`ssh pi@home.mydomain.com`)。 + +![][11] + +然而,如果你不想将树莓派暴露在互联网上,你应该非常小心,不要让你的网络处于危险之中。如果你遵循一些简单的步骤来使它更安全: + +1. 大多数人建议你更换你的登录密码(有道理,默认密码 “raspberry” 是众所周知的),但是这不能阻挡暴力攻击。你可以改变你的密码并添加一个双重验证(所以你需要你的密码*和*一个手机生成的与时间相关的密码),这么做更安全。但是,我相信最好的方法阻止入侵者访问你的树莓派是在你的 SSH 配置中[禁止密码认证][12],这样只能通过 SSH 密匙进入。这意味着任何试图猜测你的密码尝试登录的人都不会成功。只有你的私有密匙可以访问。简单来说,很多人建议将 SSH 端口从默认的 22 换成其他的,但是通过简单的 [Nmap][13] 扫描你的 IP 地址,你信任的 SSH 端口就会暴露。 +2. 最好,不要在这个树莓派上运行其他的软件,这样你不会意外暴露其他东西。如果你想要运行其他软件,你最好在网络中的其他树莓派上运行,它们没有暴露在互联网上。确保你经常升级来保证你的包是最新的,尤其是 `openssh-server` 包,这样你的安全缺陷就被打补丁了。 +3. 安装 [sshblack][14] 或 [fail2ban][15] 来将任何表露出恶意的用户加入黑名单,例如试图暴力破解你的 SSH 密码。 + +使树莓派安全后,让它在线,你将可以在世界的任何地方登录你的网络。一旦你登录到你的树莓派,你可以用 SSH 访问本地网络上的局域网地址(例如,192.168.1.31)访问其他设备。如果你在这些设备上有密码,用密码就好了。如果它们同样只允许 SSH 密匙,你需要确保你的密匙通过 SSH 转发,使用 `-A` 参数:`ssh -A pi@123.45.67.89`。 + +### CCTV / 宠物相机 + +另一个很棒的家庭项目是安装一个相机模块来拍照和录视频,录制并保存文件,在内网或者外网中进行流式传输。你想这么做有很多原因,但两个常见的情况是一个家庭安防相机或监控你的宠物。 + +[树莓派相机模块][16] 是一个优秀的配件。它提供全高清的相片和视频,包括很多高级配置,很[容易编程][17]。[红外线相机][18]用于这种目的是非常理想的,通过一个红外线 LED(树莓派可以控制的),你就能够在黑暗中看见东西。 + +如果你想通过一定频率拍摄静态图片来留意某件事,你可以仅仅写一个简短的 [Python][19] 脚本或者使用命令行工具 [raspistill][20], 在 [Cron][21] 中规划它多次运行。你可能想将它们保存到 [Dropbox][22] 或另一个网络服务,上传到一个网络服务器,你甚至可以创建一个[web 应用][23]来显示他们。 + +如果你想要在内网或外网中流式传输视频,那也相当简单。在 [picamera 文档][24]中(在 “web streaming” 章节)有一个简单的 MJPEG(Motion JPEG)例子。简单下载或者拷贝代码到文件中,运行并访问树莓派的 IP 地址的 8000 端口,你会看见你的相机的直播输出。 + +有一个更高级的流式传输项目 [pistreaming][25] 也可以,它通过在网络服务器中用 [JSMpeg][26] (一个 JavaScript 视频播放器)和一个用于相机流的单独运行的 websocket。这种方法性能更好,并且和之前的例子一样简单,但是如果要在互联网中流式传输,则需要包含更多代码,并且需要你开放两个端口。 + +一旦你的网络流建立起来,你可以将你的相机放在你想要的地方。我用一个来观察我的宠物龟: + +![Tortoise ][27] + +*Ben Nuttall, CC BY-SA* + +如果你想控制相机位置,你可以用一个舵机。一个优雅的方案是用 Pimoroni 的 [Pan-Tilt HAT][28],它可以让你简单的在二维方向上移动相机。为了与 pistreaming 集成,可以看看该项目的 [pantilthat 分支][29]. + +![Pan-tilt][30] + +*Pimoroni.com, Copyright, 授权使用* + +如果你想将你的树莓派放到户外,你将需要一个防水的外围附件,并且需要一种给树莓派供电的方式。POE(通过以太网提供电力)电缆是一个不错的实现方式。 + +### 家庭自动化或物联网 + +现在是 2017 年(LCTT 译注:此文发表时间),到处都有很多物联网设备,尤其是家中。我们的电灯有 Wi-Fi,我们的面包烤箱比过去更智能,我们的茶壶处于俄国攻击的风险中,除非你确保你的设备安全,不然别将没有必要的设备连接到互联网,之后你可以在家中充分的利用物联网设备来完成自动化任务。 + +市场上有大量你可以购买或订阅的服务,像 Nest Thermostat 或 Philips Hue 电灯泡,允许你通过你的手机控制你的温度或者你的亮度,无论你是否在家。你可以用一个树莓派来催动这些设备的电源,通过一系列规则包括时间甚至是传感器来完成自动交互。用 Philips Hue,你做不到的当你进房间时打开灯光,但是有一个树莓派和一个运动传感器,你可以用 Python API 来打开灯光。类似地,当你在家的时候你可以通过配置你的 Nest 打开加热系统,但是如果你想在房间里至少有两个人时才打开呢?写一些 Python 代码来检查网络中有哪些手机,如果至少有两个,告诉 Nest 来打开加热器。 + +不用选择集成已存在的物联网设备,你可以用简单的组件来做的更多。一个自制的窃贼警报器,一个自动化的鸡笼门开关,一个夜灯,一个音乐盒,一个定时的加热灯,一个自动化的备份服务器,一个打印服务器,或者任何你能想到的。 + +### Tor 协议和屏蔽广告 + +Adafruit 的 [Onion Pi][31] 是一个 [Tor][32] 协议来使你的网络通讯匿名,允许你使用互联网而不用担心窥探者和各种形式的监视。跟随 Adafruit 的指南来设置 Onion Pi,你会找到一个舒服的匿名的浏览体验。 + +![Onion-Pi][33] + +*Onion-pi from Adafruit, Copyright, 授权使用* + +![Pi-hole][34] + +可以在你的网络中安装一个树莓派来拦截所有的网络交通并过滤所有广告。简单下载 [Pi-hole][35] 软件到 Pi 中,你的网络中的所有设备都将没有广告(甚至屏蔽你的移动设备应用内的广告)。 + +树莓派在家中有很多用法。你在家里用树莓派来干什么?你想用它干什么? + +在下方评论让我们知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/4/5-projects-raspberry-pi-home + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_home_automation.png?itok=2TnmJpD8 (5 projects for Raspberry Pi at home) +[2]: https://www.raspberrypi.org/ +[3]: https://kodi.tv/ +[4]: https://osmc.tv/ +[5]: https://libreelec.tv/ +[6]: https://www.raspberrypi.org/downloads/noobs/ +[7]: https://opensource.com/sites/default/files/libreelec_0.png (LibreElec ) +[8]: https://opensource.com/sites/default/files/osmc.png (OSMC) +[9]: https://opensource.com/life/16/10/which-raspberry-pi-should-you-choose-your-project +[10]: mailto:pi@home.mydomain.com +[11]: https://opensource.com/sites/default/files/resize/screenshot_from_2017-04-07_15-13-01-700x380.png +[12]: http://stackoverflow.com/questions/20898384/ssh-disable-password-authentication +[13]: https://nmap.org/ +[14]: http://www.pettingers.org/code/sshblack.html +[15]: https://www.fail2ban.org/wiki/index.php/Main_Page +[16]: https://www.raspberrypi.org/products/camera-module-v2/ +[17]: https://opensource.com/life/15/6/raspberry-pi-camera-projects +[18]: https://www.raspberrypi.org/products/pi-noir-camera-v2/ +[19]: http://picamera.readthedocs.io/ +[20]: https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md +[21]: https://www.raspberrypi.org/documentation/linux/usage/cron.md +[22]: https://github.com/RZRZR/plant-cam +[23]: https://github.com/bennuttall/bett-bot +[24]: http://picamera.readthedocs.io/en/release-1.13/recipes2.html#web-streaming +[25]: https://github.com/waveform80/pistreaming +[26]: http://jsmpeg.com/ +[27]: https://opensource.com/sites/default/files/tortoise.jpg (Tortoise) +[28]: https://shop.pimoroni.com/products/pan-tilt-hat +[29]: https://github.com/waveform80/pistreaming/tree/pantilthat +[30]: https://opensource.com/sites/default/files/pan-tilt.gif (Pan-tilt) +[31]: https://learn.adafruit.com/onion-pi/overview +[32]: https://www.torproject.org/ +[33]: https://opensource.com/sites/default/files/onion-pi.jpg (Onion-Pi) +[34]: https://opensource.com/sites/default/files/resize/pi-hole-250x250.png (Pi-hole) +[35]: https://pi-hole.net/ + + + diff --git a/translated/tech/20170414 5 projects for Raspberry Pi at home.md b/translated/tech/20170414 5 projects for Raspberry Pi at home.md deleted file mode 100644 index fabc841426..0000000000 --- a/translated/tech/20170414 5 projects for Raspberry Pi at home.md +++ /dev/null @@ -1,149 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 projects for Raspberry Pi at home) -[#]: via: (https://opensource.com/article/17/4/5-projects-raspberry-pi-home) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) - -5 个可在家中使用的与 Raspberry Pi 相关的项目 -====================================== - -![5 projects for Raspberry Pi at home][1] - -[Raspberry Pi][2] 电脑可被用来进行多种设置用于不同的目的。明显它在教育市场帮助学生在教室中学习编程与创客技巧和创客空间方面占有一席之地,它在工作场所和工厂中有大量应用。我打算介绍五个你可能想要在你的家中构建的项目。 - -### 媒体中心 - -在人们家中人们常用 Raspberry Pi 作为媒体中心来服务多媒体文件。它很容易建立,Raspberry Pi 提供了大量的 GPU(图形处理单元)运算能力来渲染你的大屏电视上的高清电视节目和电影。将 [Kodi][3](从前的 XBMC)运行在 Raspberry Pi 上是一个很棒的方式来播放你的硬盘或网络存储上的任何媒体。你同样可以安装一个包来播放 YouTube 视频。 - -也有一些少量不同的选项,显然是 [OSMC][4](开源媒体中心)和 [LibreELEC][5],都是基于 Kodi 的。它们在放映媒体内容方面表现的都非常好,但是 OSMC 有一个更酷炫的用户界面,而 LibreElec 更轻量级。你要做的只是选择一个发行版,下载镜像并安装到一个 SD 卡中(或者仅仅使用 [NOOBS][6]),启动,然后你就准备好了。 - -![LibreElec ][7] - -LibreElec; Raspberry Pi 基金会, CC BY-SA - -![OSMC][8] - -OSMC.tv, Copyright, 凭权限使用 - -在往下走之前,你需要决定[使用哪种 Raspberry Pi 开发板][9]。这些发行版在任何 Pi(1, 2, 3, or Zero)上都能运行,视频播放在这些开发板中的任何一个上都能胜任。除了 Pi 3(和 Zero W)有内置 Wi-Fi,可察觉的不同是用户界面的反应速度,在 Pi 3 上更快。一个 Pi 2 不会慢太多,所以如果你不需要 Wi-Fi 是可以的,但是当切换菜单时,你会注意到 Pi 3 比 Pi 1 和 Zero 表现的更好。 - -### SSH 网关 - -如果你想从广域网访问你的家庭局域网的电脑和设备,你必须打开这些设备的端口来允许外部访问。在互联网中开放这些端口有安全风险,意味着你总是你总是处于被攻击、滥用或者其他各种未授权访问的风险中。然而,如果你在你的网络中安装一个 Raspberry Pi,并且设置端口映射到仅通过 SSH 访问 Pi 的端口,你可以这么用来作为一个安全的网关来跳到网络中的其他 Pi 和 PC。 - -大多数路由允许你配置端口映射规则。你需要给你的 Pi 一个固定的内网 IP 地址来设置你的路由器端口 22 映射到你的 Raspberry Pi 端口 22。如果你的网络服务提供商给你提供了一个静态 IP 地址,你能够通过 SSH 和主机的 IP 地址访问(例如,**ssh pi@123.45.56.78** )。如果你有一个域名,你可以配置一个子域名指向这个 IP 地址,所以你没必要记住它(例如,**ssh[pi@home.mydomain.com][10]**)。 - -![][11] - -然而,如果你不想将 Raspberry Pi 暴露在互联网上,你应该非常小心,不要让你的网络处于危险之中。如果你遵循一些简单的步骤来使它更安全: - -1\. 大多数人建议你更换你的登录密码(有道理,默认密码 “raspberry” 是众所周知的),但是这不能阻挡暴力攻击。你可以改变你的密码并添加一个双重验证(所以你需要你的密码_和_一个手机生成的与时间无关的密码),这么做更安全。但是,我相信最好的方法阻止入侵者访问你的 Raspberry Pi 是在你的 SSH 配置中[禁止][12][密码认证][12],这样只能通过 SSH 密匙进入。这意味着任何试图猜测你的密码尝试登录的人都不会成功。只有你的私有密匙可以访问。简单来说,很多人建议将 SSH 端口从默认的 22 换成其他的,但是通过简单的 [Nmap][13] 扫描你的 IP 地址,你信任的 SSH 端口就会暴露。 - -2\. 最好,不要在这个 Pi 上运行其他的软件,这样你不会意外暴露其他东西。如果你想要运行其他软件,你最好在网络中的其他 Pi 上运行,它们没有暴露在互联网上。确保你经常升级来保证你的包是最新的,尤其是 **openssh-server** 包,这样你的安全缺陷就被打补丁了。 - -3\. 安装 [sshblack][14] 或 [fail2ban][15] 来将任何表露出恶意的用户加入黑名单,例如试图暴力破解你的 SSH 密码。 - -一旦你是 Raspberry Pi 安全后,让它在线,你将在世界的任何地方登录你的网络。一旦你登录到你的树莓派,你可以用 SSH 访问本地网络上的局域网地址(例如,192.168.1.31)访问其他设备。如果你在这些设备上有密码,用密码就好了。如果它们同样只允许 SSH 密匙,你需要确保你的密匙通过 SSH 传播,使用 **-A** 参数:**ssh -A pi@123.45.67.89**。 - -### CCTV / 宠物相机 - -另一个很棒的家庭项目是建立一个相机模块来拍照和录视频,录制并保存文件,在内网或者外网中进行流式传输。你想这么做有很多原因,但两个常见的情况是一个家庭安防相机或监控你的宠物。 - -[Raspberry Pi 相机模块][16] 是一个优秀的配件。它提供全高清的相片和视频,包括很多高级配置,很[容易][17][编程][17]。[红外线相机][18]用于这种目的是非常理想的,通过一个红外线 LED(Pi 可以控制的),你就能够在黑暗中看见东西。 - -如果你想通过一定频率拍摄静态图片来留意某件事,你可以仅仅写一个短的 [Python][19] 脚本或者使用命令行工具 [raspistill][20], 在 [Cron][21] 中规划它多次运行。你可能想将它们保存到 [Dropbox][22] 或另一个网络服务,上传到一个网络服务器,你甚至可以创建一个[网络应用][23]来显示他们。 - -如果你想要在内网或外网中流式传输视频,那也相当简单。在 [picamera 文档][24]中(在 “web streaming” 章节)有一个简单的 MJPEG(运动的 JPEG)例子。简单下载或者拷贝代码到文件中,运行并访问 Pi 的 IP 地址的 8000 端口,你会看见你的相机的直播输出。 - -有一个更高级的流式传输项目 [pistreaming][25] 可获得,它通过在网络服务器中用 [JSMpeg][26] (一个 JavaScript 视频播放器)和一个用于相机流的单独运行的 websocket。这种方法性能更好,并且和之前的例子一样简单,但是如果要在互联网中流式传输,则需要包含更多代码,并且需要你开放两个端口。 - -一旦你的网络流建立起来,你可以将你的相机放在你想要的地方。我用一个来观察我的宠物龟: - -![Tortoise ][27] - -Ben Nuttall, CC BY-SA - -如果你想控制相机位置,你可以用一个舵机。一个优雅的方案是用 Pimoroni 的 [Pan-Tilt HAT][28],它可以让你简单的在二维方向上移动相机。为了与 pistreaming 集成,看项目的 [pantilthat 分支][29]. - -![Pan-tilt][30] - -Pimoroni.com, Copyright, Used with permission - -如果你想将你的 Pi 放到户外,你将需要一个防水的外围附件,并且需要一种给 Pi 供电的方式。POE(通过以太网提供电力)电缆是一个不错的实现方式。 - -### 家庭自动化或物联网 - -现在是 2017 年,到处都有很多物联网设备,尤其是家中。我们的电灯有 Wi-Fi,我们的面包烤箱比过去更智能,我们的茶壶处于俄国攻击的风险中,除非你确保你的设备安全,不然别将没有必要的设备连接到互联网,之后你可以在家中充分的利用物联网设备来完成自动化任务。 - -市场上有大量你可以购买或订阅的服务,像 Nest Thermostat 或 Philips Hue 电灯泡,允许你通过你的手机控制你的温度或者你的亮度,无论你是否在家。你可以用一个树莓派来催动这些设备的电源,通过一系列规则包括时间甚至是传感器来完成自动交互。用 Philips Hue ,有一件事你不能做的是当你进房间是打开灯光,但是有一个树莓派和一个运动传感器,你可以用 Python API 来打开灯光。类似,当你在家的时候你可以通过配置你的 Nest 打开加热系统,但是如果你想在房间里至少有两个人时才打开呢?写一些 Python 代码来检查网络中有哪些手机,如果至少有两个,告诉 Nest 来打开加热器。 - -不选择集成已存在的物联网设备,你可以用简单的组件来做的更多。一个自制的窃贼警报器,一个自动化的鸡笼门开关,一个夜灯,一个音乐盒,一个定时的加热灯,一个自动化的备份服务器,一个打印服务器,或者任何你能想到的。 - -### Tor 协议和屏蔽广告 - -Adafruit 的 [Onion Pi][31] 是一个 [Tor][32] 协议来使你的网络交通匿名,允许你使用互联网,而不用担心窥探者和各种形式的监视。跟随 Adafruit 的指南来设置 Onion Pi,你会找到一个舒服的匿名的浏览体验。 - -![Onion-Pi][33] - -Onion-pi from Adafruit, Copyright, Used with permission - -![Pi-hole][34] 你可以在你的网络中安装一个树莓派来拦截所有的网络交通并过滤所有广告。简单下载 [Pi-hole][35] 软件到 Pi 中,你的网络中的所有设备都将没有广告(甚至屏蔽你的移动设备应用内的广告)。 - -Raspberry Pi 在家中有很多用法。你在家里用树莓派来干什么?你想用它干什么? - -在下方评论让我们知道。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/4/5-projects-raspberry-pi-home - -作者:[Ben Nuttall][a] -选题:[lujun9972][b] -译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_home_automation.png?itok=2TnmJpD8 (5 projects for Raspberry Pi at home) -[2]: https://www.raspberrypi.org/ -[3]: https://kodi.tv/ -[4]: https://osmc.tv/ -[5]: https://libreelec.tv/ -[6]: https://www.raspberrypi.org/downloads/noobs/ -[7]: https://opensource.com/sites/default/files/libreelec_0.png (LibreElec ) -[8]: https://opensource.com/sites/default/files/osmc.png (OSMC) -[9]: https://opensource.com/life/16/10/which-raspberry-pi-should-you-choose-your-project -[10]: mailto:pi@home.mydomain.com -[11]: https://opensource.com/sites/default/files/resize/screenshot_from_2017-04-07_15-13-01-700x380.png -[12]: http://stackoverflow.com/questions/20898384/ssh-disable-password-authentication -[13]: https://nmap.org/ -[14]: http://www.pettingers.org/code/sshblack.html -[15]: https://www.fail2ban.org/wiki/index.php/Main_Page -[16]: https://www.raspberrypi.org/products/camera-module-v2/ -[17]: https://opensource.com/life/15/6/raspberry-pi-camera-projects -[18]: https://www.raspberrypi.org/products/pi-noir-camera-v2/ -[19]: http://picamera.readthedocs.io/ -[20]: https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md -[21]: https://www.raspberrypi.org/documentation/linux/usage/cron.md -[22]: https://github.com/RZRZR/plant-cam -[23]: https://github.com/bennuttall/bett-bot -[24]: http://picamera.readthedocs.io/en/release-1.13/recipes2.html#web-streaming -[25]: https://github.com/waveform80/pistreaming -[26]: http://jsmpeg.com/ -[27]: https://opensource.com/sites/default/files/tortoise.jpg (Tortoise) -[28]: https://shop.pimoroni.com/products/pan-tilt-hat -[29]: https://github.com/waveform80/pistreaming/tree/pantilthat -[30]: https://opensource.com/sites/default/files/pan-tilt.gif (Pan-tilt) -[31]: https://learn.adafruit.com/onion-pi/overview -[32]: https://www.torproject.org/ -[33]: https://opensource.com/sites/default/files/onion-pi.jpg (Onion-Pi) -[34]: https://opensource.com/sites/default/files/resize/pi-hole-250x250.png (Pi-hole) -[35]: https://pi-hole.net/ - - - From a2fca4fb687f15e4bd54824672ebff2ab8b37110 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 14:24:59 +0800 Subject: [PATCH 0723/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=20How?= =?UTF-8?q?=20To=20Verify=20NTP=20Setup=20(Sync)=20is=20Working=20or=20Not?= =?UTF-8?q?=20In=20Linux=3F=20sources/tech/20190604=20How=20To=20Verify=20?= =?UTF-8?q?NTP=20Setup=20(Sync)=20is=20Working=20or=20Not=20In=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Setup (Sync) is Working or Not In Linux.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md diff --git a/sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md b/sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md new file mode 100644 index 0000000000..750a6e3ac5 --- /dev/null +++ b/sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Verify NTP Setup (Sync) is Working or Not In Linux?) +[#]: via: (https://www.2daygeek.com/check-verify-ntp-sync-is-working-or-not-in-linux-using-ntpq-ntpstat-timedatectl/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Verify NTP Setup (Sync) is Working or Not In Linux? +====== + +NTP stand for Network Time Protocol, which synchronize the clock between computer systems over the network. + +NTP server keep all the servers in your organization in-sync with an accurate time to perform time based jobs. + +NTP client will synchronize its clock to the network time server. + +We had already wrote an article about NTP Server and Client installation and configuration. + +If you would like to check these article, navigate to the following links. + + * **[How To Install And Configure NTP Server And NTP Client In Linux?][1]** + * **[How To Install And Configure Chrony As NTP Client?][2]** + + + +I assume that we have already setup NTP server and NTP client using the above links. + +Now, how to verify whether the NTP setup is working correctly or not? + +There are three commands available in Linux to validate the NTP sync. The details are below. In this article, we will tell you, how to verify NTP sync using all these commands. + + * **`ntpq:`** ntpq is standard NTP query program. + * **`ntpstat:`** It shows network time synchronization status. + * **`timedatectl:`** It controls the system time and date in systemd system. + + + +### Method-1: How To Check NTP Status Using ntpq Command? + +The ntpq utility program is used to monitor NTP daemon ntpd operations and determine performance. + +The program can be run either in interactive mode or controlled using command line arguments. + +It prints a list of peers that connected by sending multiple queries to the server. + +If NTP is working properly, you will be getting the output similar to below. + +``` +# ntpq -p + + remote refid st t when poll reach delay offset jitter +============================================================================== +*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 +``` + +**Details:** + + * **-p:** Print a list of the peers known to the server as well as a summary of their state. + + + +### Method-2: How To Check NTP Status Using ntpstat Command? + +ntpstat will report the synchronisation state of the NTP daemon (ntpd) running on the local machine. + +If the local system is found to be synchronised to a reference time source, ntpstat will report the approximate time accuracy. + +The ntpstat command returns three kind of status code based on the NTP sync. The details are below. + + * **`0:`**` ` It returns 0 if clock is synchronised. + * **`1:`**` ` It returns 1 if clock is not synchronised. + * **`2:`**` ` It returns 2 if clock state is indeterminant, for example if ntpd is not contactable. + + + +``` +# ntpstat + +synchronised to NTP server (192.168.1.8) at stratum 3 + time correct to within 508 ms + polling server every 64 s +``` + +### Method-3: How To Check NTP Status Using timedatectl Command? + +**[timedatectl Command][3]** is used to query and change the system clock and its settings in systmed system. + +``` +# timedatectl +or +# timedatectl status + + Local time: Thu 2019-05-30 05:01:05 CDT + Universal time: Thu 2019-05-30 10:01:05 UTC + RTC time: Thu 2019-05-30 10:01:05 + Time zone: America/Chicago (CDT, -0500) + NTP enabled: yes +NTP synchronized: yes + RTC in local TZ: no + DST active: yes + Last DST change: DST began at + Sun 2019-03-10 01:59:59 CST + Sun 2019-03-10 03:00:00 CDT + Next DST change: DST ends (the clock jumps one hour backwards) at + Sun 2019-11-03 01:59:59 CDT + Sun 2019-11-03 01:00:00 CST +``` + +### Bonus Tips: + +Chrony is replacement of NTP client. + +It can synchronize the system clock faster with better time accuracy and it can be particularly useful for the systems which are not online all the time. + +chronyd is smaller, it uses less memory and it wakes up the CPU only when necessary, which is better for power saving. + +It can perform well even when the network is congested for longer periods of time. + +You can use any of the below commands to check Chrony status. + +To check chrony tracking status. + +``` +# chronyc tracking + +Reference ID : C0A80105 (CentOS7.2daygeek.com) +Stratum : 3 +Ref time (UTC) : Thu Mar 28 05:57:27 2019 +System time : 0.000002545 seconds slow of NTP time +Last offset : +0.001194361 seconds +RMS offset : 0.001194361 seconds +Frequency : 1.650 ppm fast +Residual freq : +184.101 ppm +Skew : 2.962 ppm +Root delay : 0.107966967 seconds +Root dispersion : 1.060455322 seconds +Update interval : 2.0 seconds +Leap status : Normal +``` + +Run the sources command to displays information about the current time sources. + +``` +# chronyc sources + +210 Number of sources = 1 +MS Name/IP address Stratum Poll Reach LastRx Last sample +=============================================================================== +^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-verify-ntp-sync-is-working-or-not-in-linux-using-ntpq-ntpstat-timedatectl/ + +作者:[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/install-configure-ntp-server-ntp-client-in-linux/ +[2]: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/ +[3]: https://www.2daygeek.com/change-set-time-date-and-timezone-on-linux/ From a81073c757bc582caa3d8224de8f6d99ae76243f Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 14:25:15 +0800 Subject: [PATCH 0724/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=20Linu?= =?UTF-8?q?x=20Shell=20Script=20To=20Monitor=20CPU=20Utilization=20And=20S?= =?UTF-8?q?end=20Email=20sources/tech/20190604=20Linux=20Shell=20Script=20?= =?UTF-8?q?To=20Monitor=20CPU=20Utilization=20And=20Send=20Email.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Monitor CPU Utilization And Send Email.md | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 sources/tech/20190604 Linux Shell Script To Monitor CPU Utilization And Send Email.md diff --git a/sources/tech/20190604 Linux Shell Script To Monitor CPU Utilization And Send Email.md b/sources/tech/20190604 Linux Shell Script To Monitor CPU Utilization And Send Email.md new file mode 100644 index 0000000000..f1cb86573b --- /dev/null +++ b/sources/tech/20190604 Linux Shell Script To Monitor CPU Utilization And Send Email.md @@ -0,0 +1,178 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Shell Script To Monitor CPU Utilization And Send Email) +[#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-cpu-utilization-usage-and-send-email/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Linux Shell Script To Monitor CPU Utilization And Send Email +====== + +There are many opensource monitoring tools are available to monitor Linux systems performance. + +It will send an email alert when the system reaches the given 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 achieve this. + +In this tutorial we have added two shell script to monitor CPU utilization on Linux system. + +When the system reaches the given threshold then it will trigger a mail to corresponding email id. + +### Method-1 : Linux Shell Script To Monitor CPU Utilization And Send an Email + +If you want to only get CPU utilization percentage through mail when the system reaches the given threshold, use the following script. + +This is very simple and straightforward and one line script. + +It will trigger an email when your system reaches `80%` CPU utilization. + +``` +*/5 * * * * /usr/bin/cat /proc/loadavg | awk '{print $1}' | awk '{ if($1 > 80) printf("Current CPU Utilization is: %.2f%\n"), $0;}' | mail -s "High CPU Alert" [email protected] +``` + +**Note:** You need to change the email id instead of ours. Also, you can change the CPU utilization threshold value as per your requirement. + +**Output:** You will be getting an email alert similar to below. + +``` +Current CPU Utilization is: 80.40% +``` + +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]** + + + +### Method-2 : Linux Shell Script To Monitor CPU Utilization And Send an Email + +If you want to get more information about the CPU utilization in the mail alert. + +Then use the following script, which includes top CPU utilization process details based on the top Command and ps Command. + +This will inconstantly gives you an idea what is going on your system. + +It will trigger an email when your system reaches `80%` CPU utilization. + +**Note:** You need to change the email id instead of ours. Also, you can change the CPU utilization threshold value as per your requirement. + +``` +# vi /opt/scripts/cpu-alert.sh + +#!/bin/bash +cpuuse=$(cat /proc/loadavg | awk '{print $1}') + +if [ "$cpuuse" > 80 ]; then + +SUBJECT="ATTENTION: CPU Load Is High on $(hostname) at $(date)" + +MESSAGE="/tmp/Mail.out" + +TO="[email protected]" + + echo "CPU Current Usage is: $cpuuse%" >> $MESSAGE + + echo "" >> $MESSAGE + + echo "+------------------------------------------------------------------+" >> $MESSAGE + + echo "Top CPU Process Using top command" >> $MESSAGE + + echo "+------------------------------------------------------------------+" >> $MESSAGE + + echo "$(top -bn1 | head -20)" >> $MESSAGE + + echo "" >> $MESSAGE + + echo "+------------------------------------------------------------------+" >> $MESSAGE + + echo "Top CPU Process Using ps command" >> $MESSAGE + + echo "+------------------------------------------------------------------+" >> $MESSAGE + + echo "$(ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10)" >> $MESSAGE + + mail -s "$SUBJECT" "$TO" < $MESSAGE + + rm /tmp/Mail.out + + fi +``` + +Finally add a **[cronjob][2]** to automate this. It will run every 5 minutes. + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/scripts/cpu-alert.sh +``` + +**Note:** You will be getting an email alert 5 mins later since the script has scheduled to run every 5 minutes (But it's not exactly 5 mins and it depends the timing). + +Say for example. If your system reaches the limit at 8.25 then you will get an email alert in another 5 mins. Hope it's clear now. + +**Output:** You will be getting an email alert similar to below. + +``` +CPU Current Usage is: 80.51% + ++------------------------------------------------------------------+ +Top CPU Process Using top command ++------------------------------------------------------------------+ +top - 13:23:01 up 1:43, 1 user, load average: 2.58, 2.58, 1.51 +Tasks: 306 total, 3 running, 303 sleeping, 0 stopped, 0 zombie +%Cpu0 : 6.2 us, 6.2 sy, 0.0 ni, 87.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu1 : 18.8 us, 0.0 sy, 0.0 ni, 81.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu2 : 50.0 us, 37.5 sy, 0.0 ni, 12.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu3 : 5.9 us, 5.9 sy, 0.0 ni, 88.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu4 : 0.0 us, 5.9 sy, 0.0 ni, 94.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu5 : 29.4 us, 23.5 sy, 0.0 ni, 47.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu6 : 0.0 us, 5.9 sy, 0.0 ni, 94.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu7 : 5.9 us, 0.0 sy, 0.0 ni, 94.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +KiB Mem : 16248588 total, 223436 free, 5816924 used, 10208228 buff/cache +KiB Swap: 17873388 total, 17871340 free, 2048 used. 7440884 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 8867 daygeek 20 2743884 440420 360952 R 100.0 2.7 1:07.25 /usr/lib/virtualbox/VirtualBoxVM --comment CentOS7 --startvm 002f47b8-2af2-48f5-be1d-67b67e03514c --no-startvm-errormsgbox + 9119 daygeek 20 36136 784 R 46.7 0.0 0:00.07 /usr/bin/CROND -n + 1057 daygeek 20 889808 487692 461692 S 13.3 3.0 4:21.12 /usr/lib/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -verbose 3 + 3098 daygeek 20 1929012 351412 120532 S 13.3 2.2 16:42.51 /usr/lib/firefox/firefox -contentproc -childID 6 -isForBrowser -prefsLen 9236 -prefMapSize 184485 -parentBuildID 20190521202118 -greomni /us+ + 1 root 20 188820 10144 7708 S 6.7 0.1 0:06.92 /sbin/init + 818 gdm 20 199836 25120 15876 S 6.7 0.2 0:01.85 /usr/lib/Xorg vt1 -displayfd 3 -auth /run/user/120/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -verbose 3 + 1170 daygeek 9 -11 2676516 16516 12520 S 6.7 0.1 1:28.30 /usr/bin/pulseaudio --daemonize=no + 8271 root 20 I 6.7 0:00.21 [kworker/u16:4-i915] + 9117 daygeek 20 13528 4036 3144 R 6.7 0.0 0:00.01 top -bn1 + ++------------------------------------------------------------------+ +Top CPU Process Using ps command ++------------------------------------------------------------------+ +%CPU PID USER COMMAND + 8.8 8522 daygeek /usr/lib/virtualbox/VirtualBox +86.2 8867 daygeek /usr/lib/virtualbox/VirtualBoxVM --comment CentOS7 --startvm 002f47b8-2af2-48f5-be1d-67b67e03514c --no-startvm-errormsgbox +76.1 8921 daygeek /usr/lib/virtualbox/VirtualBoxVM --comment Ubuntu-18.04 --startvm e8c32dbb-8b01-41b0-977a-bf28b9db1117 --no-startvm-errormsgbox + 5.5 8080 daygeek /usr/bin/nautilus --gapplication-service + 4.7 4575 daygeek /usr/lib/firefox/firefox -contentproc -childID 12 -isForBrowser -prefsLen 9375 -prefMapSize 184485 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 1525 true tab + 4.4 3511 daygeek /usr/lib/firefox/firefox -contentproc -childID 8 -isForBrowser -prefsLen 9308 -prefMapSize 184485 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 1525 true tab + 4.4 3190 daygeek /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 9237 -prefMapSize 184485 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 1525 true tab + 4.4 1612 daygeek /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 184485 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 1525 true tab + 4.2 3565 daygeek /usr/bin/../lib/notepadqq/notepadqq-bin +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-shell-script-to-monitor-cpu-utilization-usage-and-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/ +[2]: https://www.2daygeek.com/crontab-cronjob-to-schedule-jobs-in-linux/ From d7383c2b4629847b5cd3729280cbc88e7a196cad Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 14:25:29 +0800 Subject: [PATCH 0725/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=20Exam?= =?UTF-8?q?Snap=20Guide:=206=20Excellent=20Resources=20for=20Microsoft=209?= =?UTF-8?q?8-366:=20Networking=20Fundamentals=20Exam=20sources/tech/201906?= =?UTF-8?q?04=20ExamSnap=20Guide-=206=20Excellent=20Resources=20for=20Micr?= =?UTF-8?q?osoft=2098-366-=20Networking=20Fundamentals=20Exam.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ft 98-366- Networking Fundamentals Exam.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20190604 ExamSnap Guide- 6 Excellent Resources for Microsoft 98-366- Networking Fundamentals Exam.md diff --git a/sources/tech/20190604 ExamSnap Guide- 6 Excellent Resources for Microsoft 98-366- Networking Fundamentals Exam.md b/sources/tech/20190604 ExamSnap Guide- 6 Excellent Resources for Microsoft 98-366- Networking Fundamentals Exam.md new file mode 100644 index 0000000000..97414f530f --- /dev/null +++ b/sources/tech/20190604 ExamSnap Guide- 6 Excellent Resources for Microsoft 98-366- Networking Fundamentals Exam.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (ExamSnap Guide: 6 Excellent Resources for Microsoft 98-366: Networking Fundamentals Exam) +[#]: via: (https://www.2daygeek.com/examsnap-guide-6-excellent-resources-for-microsoft-98-366-networking-fundamentals-exam/) +[#]: author: (2daygeek http://www.2daygeek.com/author/2daygeek/) + +ExamSnap Guide: 6 Excellent Resources for Microsoft 98-366: Networking Fundamentals Exam +====== + +The Microsoft 98-366 exam is almost similar to the CompTIA Network+ certification test when it comes to its content. + +It is also known as Networking Fundamentals, and its purpose is to assess your knowledge of switches, routers, OSI models, wide area and local area networks, wireless networking, and IP addressing. + +Those who pass the exam earn the MTA (Microsoft Technology Associate) certificate. This certifications an ideal entry-level credential to help you begin your IT career. + +### 6 Resources for Microsoft MTA 98-366 Exam + +Using approved training materials is the best method to prepare for your certification exam. Most candidates are fond of shortcuts and often use PDFs and brain dumps to prepare for the test. + +It is important to note that these materials need additional study methods. They will not help you gain better knowledge that is meant to make you perform better at work. + +When you take your time to master the course contents of a certification exam, you are not only getting ready for the test but also developing your skills, expertise, and knowledge in the topics covered there. + + * **[ExamSnap][1]** + + + +Another important point to note is that you shouldn’t rely only on brain dumps. Microsoft can withhold or withdraw your certification if it is discovered that you have cheated. + +This may also result in the situation when a person is not allowed to earn the credentials any more. Thus, use only verified platforms such as Examsnap. + +Most people tend to believe that there is no way they can get discovered. However, you need to know that Microsoft has been offering professional certification exams for years and they know what they are doing. + +Now when we have established the importance of using legal materials to prepare for your certification exam, we need to highlight the top resources you can use to prepare for the Microsoft 98-366 test. + +### 1\. Microsoft Video Academy + +The MVA (Microsoft Video Academy) provides you with introductory lessons on the 98-366 certification exam.This is not sufficient for your study although it is a great way to begin your preparation for the test. The materials in the video do not cover everything you need to know before taking the exam. + +In fact, it is introductory series that is meant to lay down the foundation for your study. You will have to explore other materials for you to get an in-depth knowledge of the topics. + +These videos are available without payment, so you can easily access them and use whenever you want. + + * [Microsoft Certification Overview][2] + + + +### 2\. Examsnap + +If you have been looking for material that can help you prepare for the Microsoft Networking Fundamentals exam, look no further because you will know about Examsnap now. + +It is an online platform that provides you with exam dumps and video series of various certification courses. All you need to do is to register on the website and pay a fee for you to be able to access various tools that will help you prepare for the test. + +Examsnap will enable you to pass your exams with confidence by providing you with the most accurate and comprehensive preparation materials on the Internet. The platform also has training courses to help you improve your study. + +Before making any payment on the site, you can complete the trial course to establish whether the site is suitable for your exam preparation needs. + +### 3\. Exam 98-366: MTA Networking Fundamentals + +This is a study resource that is a book. It provides you with a comprehensive approach to the various topics. It is important for you to note that this study guide is critical to your success. + +It offers you more detailed material than the introductory lectures by the MVA. It is advisable that you do not focus on the sample questions in each part when using this book. + +You should not concentrate on the sample questions because they are not so informative. You can make up for this shortcoming by checking out other practice test options. Overall, this book is a top resource that will contribute greatly to your certification exam success. + +### 4\. Measure-Up + +Measure-Up is the official Microsoft practice test provider whereby you can access different materials. You can get a lab and hands-on practice with networking software tools, which are very beneficial for your preparation. The site also has study questions that you can purchase. + +### 5\. U-Certify + +The U-Certify platform is a reputable organization that offers video courses that are considered to be more understandable than those offered by the MVA. In addition to video courses, the site presents flashcards at the end of the videos. + +You can also access a series of practice tests, which contain several hundreds of study questions on the platform. There are more contents in videos and tests that you can access the moment you subscribe. Depending on what you are looking for, you can choose to buy the tests or the videos. + +### 6\. Networking Essentials – Wiki + +There are several posts that are linked to the Networking Essentials page on Wiki, and you can be sure that these articles are greatly detailed with information that will be helpful for your exam preparation. + +It is important to note that they are not meant to be studied as the only resource materials. You should only use them as additional means for the purpose of getting more information on specific topics but not as an individual study tool. + +### Conclusion + +You may not be able to access all the top resources available. However, you can access some of them. In addition to the resources mentioned, there are also some others that are very good. Visit the Microsoft official website to get the list of reliable resource platforms you can use. Study and be well-prepared for the 98-366 certification exam! + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/examsnap-guide-6-excellent-resources-for-microsoft-98-366-networking-fundamentals-exam/ + +作者:[2daygeek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.2daygeek.com/author/2daygeek/ +[b]: https://github.com/lujun9972 +[1]: https://www.examsnap.com/ +[2]: https://www.microsoft.com/en-us/learning/certification-overview.aspx From 36d0f814539da7f8209cde5af655b94d97fe005e Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 14:26:08 +0800 Subject: [PATCH 0726/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=20Two?= =?UTF-8?q?=20Methods=20To=20Check=20Or=20List=20Installed=20Security=20Up?= =?UTF-8?q?dates=20on=20Redhat=20(RHEL)=20And=20CentOS=20System=20sources/?= =?UTF-8?q?tech/20190604=20Two=20Methods=20To=20Check=20Or=20List=20Instal?= =?UTF-8?q?led=20Security=20Updates=20on=20Redhat=20(RHEL)=20And=20CentOS?= =?UTF-8?q?=20System.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ates on Redhat (RHEL) And CentOS System.md | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md diff --git a/sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md b/sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md new file mode 100644 index 0000000000..8686fe415f --- /dev/null +++ b/sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md @@ -0,0 +1,170 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System) +[#]: via: (https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-and-centos-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System +====== + +We had wrote two articles in the past about this topic and each articles were published for different requirements. + +If you would like to check those articles before getting into this topic. + +Navigate to the following links. + + * **[How To Check Available Security Updates On Red Hat (RHEL) And CentOS System?][1]** + * **[Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems?][2]** + + + +These articles are interlinked one with others so, better to read them before digging into this. + +In this article, we will show you, how to check installed security updates. + +I have add two methods to achieve this and you can choose which one is best and suitable for you. + +Also, i added a small shell script, that gives you a summary about installed security packages count. + +Run the following command to get a list of the installed security updates on your system. + +``` +# yum updateinfo list security installed + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock +RHSA-2015:2315 Moderate/Sec. ModemManager-glib-1.1.0-8.git20130913.el7.x86_64 +RHSA-2015:2315 Moderate/Sec. NetworkManager-1:1.0.6-27.el7.x86_64 +RHSA-2016:2581 Low/Sec. NetworkManager-1:1.4.0-12.el7.x86_64 +RHSA-2017:2299 Moderate/Sec. NetworkManager-1:1.8.0-9.el7.x86_64 +RHSA-2015:2315 Moderate/Sec. NetworkManager-adsl-1:1.0.6-27.el7.x86_64 +RHSA-2016:2581 Low/Sec. NetworkManager-adsl-1:1.4.0-12.el7.x86_64 +RHSA-2017:2299 Moderate/Sec. NetworkManager-adsl-1:1.8.0-9.el7.x86_64 +RHSA-2015:2315 Moderate/Sec. NetworkManager-bluetooth-1:1.0.6-27.el7.x86_64 +``` + +To count the number of installed security packages, run the following command. + +``` +# yum updateinfo list security installed | wc -l +1046 +``` + +To print only install packages list. + +``` +# yum updateinfo list security all | grep -w "i" + +i RHSA-2015:2315 Moderate/Sec. ModemManager-glib-1.1.0-8.git20130913.el7.x86_64 +i RHSA-2015:2315 Moderate/Sec. NetworkManager-1:1.0.6-27.el7.x86_64 +i RHSA-2016:2581 Low/Sec. NetworkManager-1:1.4.0-12.el7.x86_64 +i RHSA-2017:2299 Moderate/Sec. NetworkManager-1:1.8.0-9.el7.x86_64 +i RHSA-2015:2315 Moderate/Sec. NetworkManager-adsl-1:1.0.6-27.el7.x86_64 +i RHSA-2016:2581 Low/Sec. NetworkManager-adsl-1:1.4.0-12.el7.x86_64 +i RHSA-2017:2299 Moderate/Sec. NetworkManager-adsl-1:1.8.0-9.el7.x86_64 +i RHSA-2015:2315 Moderate/Sec. NetworkManager-bluetooth-1:1.0.6-27.el7.x86_64 +i RHSA-2016:2581 Low/Sec. NetworkManager-bluetooth-1:1.4.0-12.el7.x86_64 +i RHSA-2017:2299 Moderate/Sec. NetworkManager-bluetooth-1:1.8.0-9.el7.x86_64 +i RHSA-2015:2315 Moderate/Sec. NetworkManager-config-server-1:1.0.6-27.el7.x86_64 +i RHSA-2016:2581 Low/Sec. NetworkManager-config-server-1:1.4.0-12.el7.x86_64 +i RHSA-2017:2299 Moderate/Sec. NetworkManager-config-server-1:1.8.0-9.el7.noarch +``` + +To count the number of installed security packages, run the following command. + +``` +# yum updateinfo list security all | grep -w "i" | wc -l +1043 +``` + +Alternatively, you can check the list of vulnerabilities had fixed against the given package. + +In this example, we are going to check the list of vulnerabilities had fixed in the “openssh” package. + +``` +# rpm -q --changelog openssh | grep -i CVE + +- Fix for CVE-2017-15906 (#1517226) +- CVE-2015-8325: privilege escalation via user's PAM environment and UseLogin=yes (#1329191) +- CVE-2016-1908: possible fallback from untrusted to trusted X11 forwarding (#1298741) +- CVE-2016-3115: missing sanitisation of input for X11 forwarding (#1317819) +- prevents CVE-2016-0777 and CVE-2016-0778 +- Security fixes released with openssh-6.9 (CVE-2015-5352) (#1247864) +- only query each keyboard-interactive device once (CVE-2015-5600) (#1245971) +- add new option GSSAPIEnablek5users and disable using ~/.k5users by default CVE-2014-9278 +- prevent a server from skipping SSHFP lookup - CVE-2014-2653 (#1081338) +- change default value of MaxStartups - CVE-2010-5107 (#908707) +- CVE-2010-4755 +- merged cve-2007_3102 to audit patch +- fixed audit log injection problem (CVE-2007-3102) +- CVE-2006-5794 - properly detect failed key verify in monitor (#214641) +- CVE-2006-4924 - prevent DoS on deattack detector (#207957) +- CVE-2006-5051 - don't call cleanups from signal handler (#208459) +- use fork+exec instead of system in scp - CVE-2006-0225 (#168167) +``` + +Similarly, you can check whether the given vulnerability is fixed or not in the corresponding package by running the following command. + +``` +# rpm -q --changelog openssh | grep -i CVE-2016-3115 + +- CVE-2016-3115: missing sanitisation of input for X11 forwarding (#1317819) +``` + +### How To Count Installed Security Packages Using Shell Script? + +I have added a small shell script, which helps you to count the list of installed security packages. + +``` +# vi /opt/scripts/security-check.sh + +#!/bin/bash +echo "+-------------------------+" +echo "|Security Advisories Count|" +echo "+-------------------------+" +for i in Important Moderate Low +do +sec=$(yum updateinfo list security installed | grep $i | wc -l) +echo "$i: $sec" +done | column -t +echo "+-------------------------+" +``` + +Set an executable permission to `security-check.sh` file. + +``` +$ chmod +x security-check.sh +``` + +Finally run the script to achieve this. + +``` +# sh /opt/scripts/security-check.sh + ++-------------------------+ +|Security Advisories Count| ++-------------------------+ +Important: 480 +Moderate: 410 +Low: 111 ++-------------------------+ +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-and-centos-system/ + +作者:[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/check-list-view-find-available-security-updates-on-redhat-rhel-centos-system/ +[2]: https://www.2daygeek.com/install-security-updates-on-redhat-rhel-centos-system/ From c498feda107a7c0fe92ccde82bf7f4d6cfd7af3c Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 14:26:45 +0800 Subject: [PATCH 0727/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=20Four?= =?UTF-8?q?=20Ways=20To=20Install=20Security=20Updates=20On=20Red=20Hat=20?= =?UTF-8?q?(RHEL)=20And=20CentOS=20Systems=3F=20sources/tech/20190604=20Fo?= =?UTF-8?q?ur=20Ways=20To=20Install=20Security=20Updates=20On=20Red=20Hat?= =?UTF-8?q?=20(RHEL)=20And=20CentOS=20Systems.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...es On Red Hat (RHEL) And CentOS Systems.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20190604 Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems.md diff --git a/sources/tech/20190604 Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems.md b/sources/tech/20190604 Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems.md new file mode 100644 index 0000000000..ebe841dbcb --- /dev/null +++ b/sources/tech/20190604 Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems.md @@ -0,0 +1,174 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems?) +[#]: via: (https://www.2daygeek.com/install-security-updates-on-redhat-rhel-centos-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems? +====== + +Patching of the Linux server is one of important and routine task of Linux admin. + +Keeping the system with latest patch level is must. It protects your system against unnecessary attack. + +There are three kind of erratas available in the RHEL/CentOS repository, these are Security, Bug Fix and Product Enhancement. + +Now, you have two options to handle this. + +Either install only security updates or all the errata packages. + +We have already written an article in the past **[to check available security updates?][1]**. + +Also, **[check the installed security updates on your system][2]** using this link. + +You can navigate to the above link, if you would like to verify available security updates before installing them. + +In this article, we will show your, how to install security updates in multiple ways on RHEL and CentOS system. + +### 1) How To Install Entire Errata Updates In Red Hat And CentOS System? + +Run the following command to download and apply all available security updates on your system. + +Make a note, this command will install the last available version of any package with at least one security errata. + +Also, install non-security erratas if they provide a more updated version of the package. + +``` +# yum update --security + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +RHEL7-Server-DVD | 4.3 kB 00:00:00 +rhel-7-server-rpms | 2.0 kB 00:00:00 +--> 1:grub2-tools-extra-2.02-0.76.el7.1.x86_64 from rhel-7-server-rpms removed (updateinfo) +--> nss-pem-1.0.3-5.el7_6.1.x86_64 from rhel-7-server-rpms removed (updateinfo) +. +35 package(s) needed (+0 related) for security, out of 115 available +Resolving Dependencies +--> Running transaction check +---> Package NetworkManager.x86_64 1:1.12.0-6.el7 will be updated +---> Package NetworkManager.x86_64 1:1.12.0-10.el7_6 will be an update +``` + +Once you ran the above command, it will check all the available updates and its dependency satisfaction. + +``` +--> Finished Dependency Resolution +--> Running transaction check +---> Package kernel.x86_64 0:3.10.0-514.26.1.el7 will be erased +---> Package kernel-devel.x86_64 0:3.10.0-514.26.1.el7 will be erased +--> Finished Dependency Resolution + +Dependencies Resolved +===================================================================================================================================================================== +Package Arch Version Repository Size +===================================================================================================================================================================== +Installing: +kernel x86_64 3.10.0-957.10.1.el7 rhel-7-server-rpms 48 M +kernel-devel x86_64 3.10.0-957.10.1.el7 rhel-7-server-rpms 17 M +Updating: +NetworkManager x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms 1.7 M +NetworkManager-adsl x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms 157 k +. +Removing: +kernel x86_64 3.10.0-514.26.1.el7 @rhel-7-server-rpms 148 M +kernel-devel x86_64 3.10.0-514.26.1.el7 @rhel-7-server-rpms 34 M +``` + +If these dependencies were satisfied, which finally gives you a total summary about it. + +The transaction summary shows, how many packages will be getting Installed, upgraded and removed from the system. + +``` +Transaction Summary +===================================================================================================================================================================== +Install 2 Packages +Upgrade 33 Packages +Remove 2 Packages + +Total download size: 124 M +Is this ok [y/d/N]: +``` + +### How To Install Only Security Updates In Red Hat And CentOS System? + +Run the following command to install only the packages that have a security errata. + +``` +# yum update-minimal --security + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +rhel-7-server-rpms | 2.0 kB 00:00:00 +Resolving Dependencies +--> Running transaction check +---> Package NetworkManager.x86_64 1:1.12.0-6.el7 will be updated +---> Package NetworkManager.x86_64 1:1.12.0-8.el7_6 will be an update +. +--> Finished Dependency Resolution +--> Running transaction check +---> Package kernel.x86_64 0:3.10.0-514.26.1.el7 will be erased +---> Package kernel-devel.x86_64 0:3.10.0-514.26.1.el7 will be erased +--> Finished Dependency Resolution + +Dependencies Resolved +===================================================================================================================================================================== +Package Arch Version Repository Size +===================================================================================================================================================================== +Installing: +kernel x86_64 3.10.0-957.10.1.el7 rhel-7-server-rpms 48 M +kernel-devel x86_64 3.10.0-957.10.1.el7 rhel-7-server-rpms 17 M +Updating: +NetworkManager x86_64 1:1.12.0-8.el7_6 rhel-7-server-rpms 1.7 M +NetworkManager-adsl x86_64 1:1.12.0-8.el7_6 rhel-7-server-rpms 157 k +. +Removing: +kernel x86_64 3.10.0-514.26.1.el7 @rhel-7-server-rpms 148 M +kernel-devel x86_64 3.10.0-514.26.1.el7 @rhel-7-server-rpms 34 M + +Transaction Summary +===================================================================================================================================================================== +Install 2 Packages +Upgrade 33 Packages +Remove 2 Packages + +Total download size: 124 M +Is this ok [y/d/N]: +``` + +### How To Install Security Update Using CVE reference In Red Hat And CentOS System? + +If you would like to install a security update using a CVE reference, run the following command. + +``` +# yum update --cve + +# yum update --cve CVE-2008-0947 +``` + +### How To Install Security Update Using Specific Advisory In Red Hat And CentOS System? + +Run the following command, if you want to apply only a specific advisory. + +``` +# yum update --advisory= + +# yum update --advisory=RHSA-2014:0159 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/install-security-updates-on-redhat-rhel-centos-system/ + +作者:[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/check-list-view-find-available-security-updates-on-redhat-rhel-centos-system/ +[2]: https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-and-centos-system/ From fa8098461b7d8a1f171b55cb820be924ccd89f68 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Tue, 4 Jun 2019 15:59:08 +0800 Subject: [PATCH 0728/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...527 How to write a good C main function.md | 490 ------------------ ...527 How to write a good C main function.md | 479 +++++++++++++++++ 2 files changed, 479 insertions(+), 490 deletions(-) delete mode 100644 sources/tech/20190527 How to write a good C main function.md create mode 100644 translated/tech/20190527 How to write a good C main function.md diff --git a/sources/tech/20190527 How to write a good C main function.md b/sources/tech/20190527 How to write a good C main function.md deleted file mode 100644 index 6193f4a04a..0000000000 --- a/sources/tech/20190527 How to write a good C main function.md +++ /dev/null @@ -1,490 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to write a good C main function) -[#]: via: (https://opensource.com/article/19/5/how-write-good-c-main-function) -[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) - -How to write a good C main function -====== -Learn how to structure a C file and write a C main function that handles -command line arguments like a champ. -![Hand drawing out the word "code"][1] - -I know, Python and JavaScript are what the kids are writing all their crazy "apps" with these days. But don't be so quick to dismiss C—it's a capable and concise language that has a lot to offer. If you need speed, writing in C could be your answer. If you are looking for job security and the opportunity to learn how to hunt down [null pointer dereferences][2], C could also be your answer! In this article, I'll explain how to structure a C file and write a C main function that handles command line arguments like a champ. - -**Me** : a crusty Unix system programmer. -**You** : someone with an editor, a C compiler, and some time to kill. - -_Let's do this._ - -### A boring but correct C program - -![Parody O'Reilly book cover, "Hating Other People's Code"][3] - -A C program starts with a **main()** function, usually kept in a file named **main.c**. - - -``` -/* main.c */ -int main(int argc, char *argv[]) { - -} -``` - -This program _compiles_ but doesn't _do_ anything. - - -``` -$ gcc main.c -$ ./a.out -o foo -vv -$ -``` - -Correct and boring. - -### Main functions are unique - -The **main()** function is the first function in your program that is executed when it begins executing, but it's not the first function executed. The _first_ function is **_start()** , which is typically provided by the C runtime library, linked in automatically when your program is compiled. The details are highly dependent on the operating system and compiler toolchain, so I'm going to pretend I didn't mention it. - -The **main()** function has two arguments that traditionally are called **argc** and **argv** and return a signed integer. Most Unix environments expect programs to return **0** (zero) on success and **-1** (negative one) on failure. - -Argument | Name | Description ----|---|--- -argc | Argument count | Length of the argument vector -argv | Argument vector | Array of character pointers - -The argument vector, **argv** , is a tokenized representation of the command line that invoked your program. In the example above, **argv** would be a list of the following strings: - - -``` -`argv = [ "/path/to/a.out", "-o", "foo", "-vv" ];` -``` - -The argument vector is guaranteed to always have at least one string in the first index, **argv[0]** , which is the full path to the program executed. - -### Anatomy of a main.c file - -When I write a **main.c** from scratch, it's usually structured like this: - - -``` -/* main.c */ -/* 0 copyright/licensing */ -/* 1 includes */ -/* 2 defines */ -/* 3 external declarations */ -/* 4 typedefs */ -/* 5 global variable declarations */ -/* 6 function prototypes */ - -int main(int argc, char *argv[]) { -/* 7 command-line parsing */ -} - -/* 8 function declarations */ -``` - -I'll talk about each of these numbered sections, except for zero, below. If you have to put copyright or licensing text in your source, put it there. - -Another thing I won't talk about adding to your program is comments. - - -``` -"Comments lie." -\- A cynical but smart and good looking programmer. -``` - -Instead of comments, use meaningful function and variable names. - -Appealing to the inherent laziness of programmers, once you add comments, you've doubled your maintenance load. If you change or refactor the code, you need to update or expand the comments. Over time, the code mutates away from anything resembling what the comments describe. - -If you have to write comments, do not write about _what_ the code is doing. Instead, write about _why_ the code is doing what it's doing. Write comments that you would want to read five years from now when you've forgotten everything about this code. And the fate of the world is depending on you. _No pressure_. - -#### 1\. Includes - -The first things I add to a **main.c** file are includes to make a multitude of standard C library functions and variables available to my program. The standard C library does lots of things; explore header files in **/usr/include** to find out what it can do for you. - -The **#include** string is a [C preprocessor][4] (cpp) directive that causes the inclusion of the referenced file, in its entirety, in the current file. Header files in C are usually named with a **.h** extension and should not contain any executable code; only macros, defines, typedefs, and external variable and function prototypes. The string **< header.h>** tells cpp to look for a file called **header.h** in the system-defined header path, usually **/usr/include**. - - -``` -/* main.c */ -#include -#include -#include -#include -#include -#include -#include -#include -``` - -This is the minimum set of global includes that I'll include by default for the following stuff: - -#include File | Stuff It Provides ----|--- -stdio | Supplies FILE, stdin, stdout, stderr, and the fprint() family of functions -stdlib | Supplies malloc(), calloc(), and realloc() -unistd | Supplies EXIT_FAILURE, EXIT_SUCCESS -libgen | Supplies the basename() function -errno | Defines the external errno variable and all the values it can take on -string | Supplies memcpy(), memset(), and the strlen() family of functions -getopt | Supplies external optarg, opterr, optind, and getopt() function -sys/types | Typedef shortcuts like uint32_t and uint64_t - -#### 2\. Defines - - -``` -/* main.c */ -<...> - -#define OPTSTR "vi⭕f:h" -#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" -#define ERR_FOPEN_INPUT "fopen(input, r)" -#define ERR_FOPEN_OUTPUT "fopen(output, w)" -#define ERR_DO_THE_NEEDFUL "do_the_needful blew up" -#define DEFAULT_PROGNAME "george" -``` - -This doesn't make a lot of sense right now, but the **OPTSTR** define is where I will state what command line switches the program will recommend. Consult the [**getopt(3)**][5] man page to learn how **OPTSTR** will affect **getopt()** 's behavior. - -The **USAGE_FMT** define is a **printf()** -style format string that is referenced in the **usage()** function. - -I also like to gather string constants as **#defines** in this part of the file. Collecting them makes it easier to fix spelling, reuse messages, and internationalize messages, if required. - -Finally, use all capital letters when naming a **#define** to distinguish it from variable and function names. You can run the words together if you want or separate words with an underscore; just make sure they're all upper case. - -#### 3\. External declarations - - -``` -/* main.c */ -<...> - -extern int errno; -extern char *optarg; -extern int opterr, optind; -``` - -An **extern** declaration brings that name into the namespace of the current compilation unit (aka "file") and allows the program to access that variable. Here we've brought in the definitions for three integer variables and a character pointer. The **opt** prefaced variables are used by the **getopt()** function, and **errno** is used as an out-of-band communication channel by the standard C library to communicate why a function might have failed. - -#### 4\. Typedefs - - -``` -/* main.c */ -<...> - -typedef struct { -int verbose; -uint32_t flags; -FILE *input; -FILE *output; -} options_t; -``` - -After external declarations, I like to declare **typedefs** for structures, unions, and enumerations. Naming a **typedef** is a religion all to itself; I strongly prefer a **_t** suffix to indicate that the name is a type. In this example, I've declared **options_t** as a **struct** with four members. C is a whitespace-neutral programming language, so I use whitespace to line up field names in the same column. I just like the way it looks. For the pointer declarations, I prepend the asterisk to the name to make it clear that it's a pointer. - -#### 5\. Global variable declarations - - -``` -/* main.c */ -<...> - -int dumb_global_variable = -11; -``` - -Global variables are a bad idea and you should never use them. But if you have to use a global variable, declare them here and be sure to give them a default value. Seriously, _don't use global variables_. - -#### 6\. Function prototypes - - -``` -/* main.c */ -<...> - -void usage(char *progname, int opt); -int do_the_needful(options_t *options); -``` - -As you write functions, adding them after the **main()** function and not before, include the function prototypes here. Early C compilers used a single-pass strategy, which meant that every symbol (variable or function name) you used in your program had to be declared before you used it. Modern compilers are nearly all multi-pass compilers that build a complete symbol table before generating code, so using function prototypes is not strictly required. However, you sometimes don't get to choose what compiler is used on your code, so write the function prototypes and drive on. - -As a matter of course, I always include a **usage()** function that **main()** calls when it doesn't understand something you passed in from the command line. - -#### 7\. Command line parsing - - -``` -/* main.c */ -<...> - -int main(int argc, char *argv[]) { -int opt; -options_t options = { 0, 0x0, stdin, stdout }; - -opterr = 0; - -while ((opt = getopt(argc, argv, OPTSTR)) != EOF) -switch(opt) { -case 'i': -if (!(options.input = [fopen][6](optarg, "r")) ){ -[perror][7](ERR_FOPEN_INPUT); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} -break; - -case 'o': -if (!(options.output = [fopen][6](optarg, "w")) ){ -[perror][7](ERR_FOPEN_OUTPUT); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} -break; - -case 'f': -options.flags = (uint32_t )[strtoul][9](optarg, NULL, 16); -break; - -case 'v': -options.verbose += 1; -break; - -case 'h': -default: -usage(basename(argv[0]), opt); -/* NOTREACHED */ -break; -} - -if (do_the_needful(&options) != EXIT_SUCCESS) { -[perror][7](ERR_DO_THE_NEEDFUL); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} - -return EXIT_SUCCESS; -} -``` - -OK, that's a lot. The purpose of the **main()** function is to collect the arguments that the user provides, perform minimal input validation, and then pass the collected arguments to functions that will use them. This example declares an **options** variable initialized with default values and parse the command line, updating **options** as necessary. - -The guts of this **main()** function is a **while** loop that uses **getopt()** to step through **argv** looking for command line options and their arguments (if any). The **OPTSTR** **#define** earlier in the file is the template that drives **getopt()** 's behavior. The **opt** variable takes on the character value of any command line options found by **getopt()** , and the program's response to the detection of the command line option happens in the **switch** statement. - -Those of you paying attention will now be questioning why **opt** is declared as a 32-bit **int** but is expected to take on an 8-bit **char**? It turns out that **getopt()** returns an **int** that takes on a negative value when it gets to the end of **argv** , which I check against **EOF** (the _End of File_ marker). A **char** is a signed quantity, but I like matching variables to their function return values. - -When a known command line option is detected, option-specific behavior happens. Some options have an argument, specified in **OPTSTR** with a trailing colon. When an option has an argument, the next string in **argv** is available to the program via the externally defined variable **optarg**. I use **optarg** to open files for reading and writing or converting a command line argument from a string to an integer value. - -There are a couple of points for style here: - - * Initialize **opterr** to 0, which disables **getopt** from emiting a **?**. - * Use **exit(EXIT_FAILURE);** or **exit(EXIT_SUCCESS);** in the middle of **main()**. - * **/* NOTREACHED */** is a lint directive that I like. - * Use **return EXIT_SUCCESS;** at the end of functions that return **int**. - * Explicitly cast implicit type conversions. - - - -The command line signature for this program, if it were compiled, would look something like this: - - -``` -$ ./a.out -h -a.out [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h] -``` - -In fact, that's what **usage()** will emit to **stderr** once compiled. - -#### 8\. Function declarations - - -``` -/* main.c */ -<...> - -void usage(char *progname, int opt) { -[fprintf][10](stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} - -int do_the_needful(options_t *options) { - -if (!options) { -errno = EINVAL; -return EXIT_FAILURE; -} - -if (!options->input || !options->output) { -errno = ENOENT; -return EXIT_FAILURE; -} - -/* XXX do needful stuff */ - -return EXIT_SUCCESS; -} -``` - -Finally, I write functions that aren't boilerplate. In this example, function **do_the_needful()** accepts a pointer to an **options_t** structure. I validate that the **options** pointer is not **NULL** and then go on to validate the **input** and **output** structure members. **EXIT_FAILURE** returns if either test fails and, by setting the external global variable **errno** to a conventional error code, I signal to the caller a general reason. The convenience function **perror()** can be used by the caller to emit human-readable-ish error messages based on the value of **errno**. - -Functions should almost always validate their input in some way. If full validation is expensive, try to do it once and treat the validated data as immutable. The **usage()** function validates the **progname** argument using a conditional assignment in the **fprintf()** call. The **usage()** function is going to exit anyway, so I don't bother setting **errno** or making a big stink about using a correct program name. - -The big class of errors I am trying to avoid here is de-referencing a **NULL** pointer. This will cause the operating system to send a special signal to my process called **SYSSEGV** , which results in unavoidable death. The last thing users want to see is a crash due to **SYSSEGV**. It's much better to catch a **NULL** pointer in order to emit better error messages and shut down the program gracefully. - -Some people complain about having multiple **return** statements in a function body. They make arguments about "continuity of control flow" and other stuff. Honestly, if something goes wrong in the middle of a function, it's a good time to return an error condition. Writing a ton of nested **if** statements to just have one return is never a "good idea."™ - -Finally, if you write a function that takes four or more arguments, consider bundling them in a structure and passing a pointer to the structure. This makes the function signatures simpler, making them easier to remember and not screw up when they're called later. It also makes calling the function slightly faster, since fewer things need to be copied into the function's stack frame. In practice, this will only become a consideration if the function is called millions or billions of times. Don't worry about it if that doesn't make sense. - -### Wait, you said no comments!?!! - -In the **do_the_needful()** function, I wrote a specific type of comment that is designed to be a placeholder rather than documenting the code: - - -``` -`/* XXX do needful stuff */` -``` - -When you are in the zone, sometimes you don't want to stop and write some particularly gnarly bit of code. You'll come back and do it later, just not now. That's where I'll leave myself a little breadcrumb. I insert a comment with a **XXX** prefix and a short remark describing what needs to be done. Later on, when I have more time, I'll grep through source looking for **XXX**. It doesn't matter what you use, just make sure it's not likely to show up in your codebase in another context, as a function name or variable, for instance. - -### Putting it all together - -OK, this program _still_ does almost nothing when you compile and run it. But now you have a solid skeleton to build your own command line parsing C programs. - - -``` -/* main.c - the complete listing */ - -#include -#include -#include -#include -#include -#include -#include - -#define OPTSTR "vi⭕f:h" -#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" -#define ERR_FOPEN_INPUT "fopen(input, r)" -#define ERR_FOPEN_OUTPUT "fopen(output, w)" -#define ERR_DO_THE_NEEDFUL "do_the_needful blew up" -#define DEFAULT_PROGNAME "george" - -extern int errno; -extern char *optarg; -extern int opterr, optind; - -typedef struct { -int verbose; -uint32_t flags; -FILE *input; -FILE *output; -} options_t; - -int dumb_global_variable = -11; - -void usage(char *progname, int opt); -int do_the_needful(options_t *options); - -int main(int argc, char *argv[]) { -int opt; -options_t options = { 0, 0x0, stdin, stdout }; - -opterr = 0; - -while ((opt = getopt(argc, argv, OPTSTR)) != EOF) -switch(opt) { -case 'i': -if (!(options.input = [fopen][6](optarg, "r")) ){ -[perror][7](ERR_FOPEN_INPUT); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} -break; - -case 'o': -if (!(options.output = [fopen][6](optarg, "w")) ){ -[perror][7](ERR_FOPEN_OUTPUT); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} -break; - -case 'f': -options.flags = (uint32_t )[strtoul][9](optarg, NULL, 16); -break; - -case 'v': -options.verbose += 1; -break; - -case 'h': -default: -usage(basename(argv[0]), opt); -/* NOTREACHED */ -break; -} - -if (do_the_needful(&options) != EXIT_SUCCESS) { -[perror][7](ERR_DO_THE_NEEDFUL); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} - -return EXIT_SUCCESS; -} - -void usage(char *progname, int opt) { -[fprintf][10](stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} - -int do_the_needful(options_t *options) { - -if (!options) { -errno = EINVAL; -return EXIT_FAILURE; -} - -if (!options->input || !options->output) { -errno = ENOENT; -return EXIT_FAILURE; -} - -/* XXX do needful stuff */ - -return EXIT_SUCCESS; -} -``` - -Now you're ready to write C that will be easier to maintain. If you have any questions or feedback, please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/how-write-good-c-main-function - -作者:[Erik O'Shaughnessy][a] -选题:[lujun9972][b] -译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jnyjny -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") -[2]: https://www.owasp.org/index.php/Null_Dereference -[3]: https://opensource.com/sites/default/files/uploads/hatingotherpeoplescode-big.png (Parody O'Reilly book cover, "Hating Other People's Code") -[4]: https://en.wikipedia.org/wiki/C_preprocessor -[5]: https://linux.die.net/man/3/getopt -[6]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html -[9]: http://www.opengroup.org/onlinepubs/009695399/functions/strtoul.html -[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html diff --git a/translated/tech/20190527 How to write a good C main function.md b/translated/tech/20190527 How to write a good C main function.md new file mode 100644 index 0000000000..8cce949bfc --- /dev/null +++ b/translated/tech/20190527 How to write a good C main function.md @@ -0,0 +1,479 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to write a good C main function) +[#]: via: (https://opensource.com/article/19/5/how-write-good-c-main-function) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) + +如何写好 C main 函数 +====== +学习如何构造一个 C 文件并编写一个 C main 函数来处理命令行参数,像 champ 一样。 +(to 校正:champ 是一个命令行程序吗?但我并没有找到,这里按一个程序来解释了) +![Hand drawing out the word "code"][1] + +我知道,现在孩子们用 Python 和 JavaScript 编写他们疯狂的“应用程序”。但是不要这么快就否定 C 语言-- 它能够提供很多东西,并且简洁。如果你需要速度,用 C 语言编写可能就是你的答案。如果你正在寻找工作保障或者学习如何捕获[空指针解引用][2],C 语言也可能是你的答案!在本文中,我将解释如何构造一个 C 文件并编写一个 C main 函数来处理像 champ 这样的命令行参数。 + +**我**:一个顽固的 Unix 系统程序员。 +**你**:一个有编辑器,C 编译器,并有时间打发的人。 + +_让我们开工吧。_ + +### 一个无聊但正确的 C 程序 + +![Parody O'Reilly book cover, "Hating Other People's Code"][3] + +一个 C 程序以 **main()** 函数开头,通常保存在名为 **main.c** 的文件中。 + +``` +/* main.c */ +int main(int argc, char *argv[]) { + +} +``` + +这个程序会 _编译_ 但不 _执行_ 任何操作。 + +``` +$ gcc main.c +$ ./a.out -o foo -vv +$ +``` + +正确但无聊。 + +### main 函数是唯一的。 + +**main()** 函数是程序开始执行时执行的第一个函数,但不是第一个执行的函数。_第一个_ 函数是 **_start()**,它通常由 C 运行库提供,在编译程序时自动链接。此细节高度依赖于操作系统和编译器工具链,所以我假装没有提到它。 + +**main()** 函数有两个参数,通常称为 **argc** 和 **argv**,并返回一个有符号整数。大多数 Unix 环境都希望程序在成功时返回 **0**(零),失败时返回 **-1**(负一)。 + +参数 | 名称 | 描述 +---|---|--- +argc | 参数个数 | 参数向量的个数 +argv | 参数向量 | 字符指针数组 + +参数向量 **argv** 是调用程序的命令行的标记化表示形式。在上面的例子中,**argv** 将是以下字符串的列表: + + +``` +`argv = [ "/path/to/a.out", "-o", "foo", "-vv" ];` +``` + +参数向量保证在第一个索引中始终至少有一个字符串 **argv[0]**,这是执行程序的完整路径。 + +### main.c 文件的剖析 + +当我从头开始编写 **main.c** 时,它的结构通常如下: + +``` +/* main.c */ +/* 0 copyright/licensing */ +/* 1 includes */ +/* 2 defines */ +/* 3 external declarations */ +/* 4 typedefs */ +/* 5 全局变量声明 */ +/* 6 函数原型 */ + +int main(int argc, char *argv[]) { +/* 7 命令行解析 */ +} + +/* 8 函数声明 */ +``` + +下面我将讨论这些编号的各个部分,除了编号为 0 的那部分。如果你必须把版权或许可文本放在源代码中,那就放在那里。 + +另一件我不想谈论的事情是注释。 + +``` +"Comments lie." +\- A cynical but smart and good looking programmer. +``` + +使用有意义的函数名和变量名而不是注释。 + +为了迎合程序员固有的惰性,一旦添加了注释,维护负荷就会增加一倍。如果更改或重构代码,则需要更新或扩展注释。随着时间的推移,代码会发生变化,与注释所描述的内容完全不同。 + +如果你必须写注释,不要写关于代码正在做 _什么_,相反,写下 _为什么_ 代码需要这样写。写一些你想在五年后读到的注释,那时你已经将这段代码忘得一干二净。世界的命运取决于你。_不要有压力。_ + +#### 1\. Includes + +我添加到 **main.c** 文件的第一个东西是 include 文件,它们为程序提供大量标准 C 标准库函数和变量。C 标准库做了很多事情。浏览 **/usr/include** 中的头文件,了解它们可以为你做些什么。 + +**#include** 字符串是 [C 预处理程序][4](cpp)指令,它会将引用的文件完整地包含在当前文件中。C 中的头文件通常以 **.h** 扩展名命名,且不应包含任何可执行代码。它只有宏、定义、typedef、外部变量和函数原型。字符串 **** 告诉 cpp 在系统定义的头文件路径中查找名为 **header.h** 的文件,通常在 **/usr/include** 目录中。 + + +``` +/* main.c */ +#include +#include +#include +#include +#include +#include +#include +#include +``` + +以下内容是我默认会包含的最小全局 include 集合: + +#include 文件 | 提供的东西 +---|--- +stdio | 提供 FILE, stdin, stdout, stderr 和 fprint() 函数系列 +stdlib | 提供 malloc(), calloc() 和 realloc() +unistd | 提供 EXIT_FAILURE, EXIT_SUCCESS +libgen | 提供 basename() 函数 +errno | 定义外部 errno 变量及其可以接受的所有值 +string | 提供 memcpy(), memset() 和 strlen() 函数系列 +getopt | 提供 外部 optarg, opterr, optind 和 getopt() 函数 +sys/types | 类型定义快捷方式,如 uint32_t 和 uint64_t + +#### 2\. Defines + +``` +/* main.c */ +<...> + +#define OPTSTR "vi⭕f:h" +#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" +#define ERR_FOPEN_INPUT "fopen(input, r)" +#define ERR_FOPEN_OUTPUT "fopen(output, w)" +#define ERR_DO_THE_NEEDFUL "do_the_needful blew up" +#define DEFAULT_PROGNAME "george" +``` + +这在现在没有多大意义,但 **OPTSTR** 定义是我说明程序将推荐的命令行切换。参考 [**getopt(3)**][5] man 页面,了解 **OPTSTR** 将如何影响 **getopt()** 的行为。 + +**USAGE_FMT** 定义了一个 **printf()** 风格形式的格式字符串,在 **usage()** 函数中被引用。 + +我还喜欢将字符串常量放在文件的这一部分作为 **#defines**。如果需要,收集它们可以更容易地修复拼写、重用消息和国际化消息。 + +最后,在命名 **#define** 时使用全部大写字母,以区别变量和函数名。如果需要,可以将单词放在一起或使用下划线分隔,只要确保它们都是大写的就行。 + +#### 3\. 外部声明 + + +``` +/* main.c */ +<...> + +extern int errno; +extern char *optarg; +extern int opterr, optind; +``` + +**extern** 声明将该名称带入当前编译单元的命名空间(也称为 "file"),并允许程序访问该变量。这里我们引入了三个整数变量和一个字符指针的定义。**getopt()** 函数使用 **opt** 前缀变量,C 标准库使用 **errno** 作为带外通信通道来传达函数可能的失败原因。 + +#### 4\. Typedefs + + +``` +/* main.c */ +<...> + +typedef struct { +int verbose; +uint32_t flags; +FILE *input; +FILE *output; +} options_t; +``` + +在外部声明之后,我喜欢为结构、联合和枚举声明 **typedefs**。命名 **typedef** 本身就是一种传统行为。我非常喜欢 **_t** 后缀来表示该名称是一种类型。在这个例子中,我将 **options_t** 声明为一个包含 4 个成员的 **struct**。C 是一种与空格无关的编程语言,因此我使用空格将字段名排列在同一列中。我只是喜欢它的样子。对于指针声明,我在名称前面加上星号,以明确它是一个指针。 + +#### 5\. 全局变量声明 + + +``` +/* main.c */ +<...> + +int dumb_global_variable = -11; +``` + +全局变量是一个坏主意,你永远不应该使用它们。但如果你必须使用全局变量,请在这里声明并确保给它们一个默认值。说真的,_不要使用全局变量_。 + +#### 6\. 函数原型 + + +``` +/* main.c */ +<...> + +void usage(char *progname, int opt); +int do_the_needful(options_t *options); +``` + +在编写函数时,将它们添加到 **main()** 函数之后而不是之前,这里放函数原型。早期的 C 编译器使用单遍策略,这意味着你在程序中使用的每个符号(变量或函数名称)必须在使用之前声明。现代编译器几乎都是多遍编译器,它们在生成代码之前构建一个完整的符号表,因此并不严格要求使用函数原型。但是,有时你无法选择代码中使用的编译器,所以请编写函数原型并继续。 + +当然,我总是包含一个 **usage()** 函数,当 **main()** 函数不理解你从命令行传入的内容时,它会调用这个函数。 + +#### 7\. 命令行解析 + + +``` +/* main.c */ +<...> + +int main(int argc, char *argv[]) { +int opt; +options_t options = { 0, 0x0, stdin, stdout }; + +opterr = 0; + +while ((opt = getopt(argc, argv, OPTSTR)) != EOF) +switch(opt) { +case 'i': +if (!(options.input = [fopen][6](optarg, "r")) ){ +[perror][7](ERR_FOPEN_INPUT); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} +break; + +case 'o': +if (!(options.output = [fopen][6](optarg, "w")) ){ +[perror][7](ERR_FOPEN_OUTPUT); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} +break; + +case 'f': +options.flags = (uint32_t )[strtoul][9](optarg, NULL, 16); +break; + +case 'v': +options.verbose += 1; +break; + +case 'h': +default: +usage(basename(argv[0]), opt); +/* NOTREACHED */ +break; +} + +if (do_the_needful(&options) != EXIT_SUCCESS) { +[perror][7](ERR_DO_THE_NEEDFUL); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} + +return EXIT_SUCCESS; +} +``` + +好吧,代码有点多。**main()** 函数的目的是收集用户提供的参数,执行最小的输入验证,然后将收集的参数传递给使用它们的函数。这个示例声明使用默认值初始化的 **options** 变量,并解析命令行,根据需要更新 **options**。 + +**main()** 函数的核心是一个 **while** 循环,它使用 **getopt()** 来遍历 **argv**,寻找命令行选项及其参数(如果有的话)。文件前面的 **OPTSTR** **#define** 是驱动 **getopt()** 行为的模板。**opt** 变量接受 **getopt()** 找到的任何命令行选项的字符值,程序对检测命令行选项的响应发生在 **switch** 语句中。 + +现在你注意到了可能会问,为什么 **opt** 被声明为 32 位 **int**,但是预期是 8 位 **char**?事实上 **getopt()** 返回一个 **int**,当它到达 **argv** 末尾时取负值,我会使用 **EOF**(_文件末尾_ 标记)匹配。**char** 是有符号的,但我喜欢将变量匹配到它们的函数返回值。 + +当检测到一个已知的命令行选项时,会发生特定的行为。有些选项有一个参数,在 **OPTSTR** 中指定了一个以冒号结尾的参数。当一个选项有一个参数时,**argv** 中的下一个字符串可以通过外部定义的变量 **optarg** 提供给程序。我使用 **optarg** 打开文件进行读写,或者将命令行参数从字符串转换为整数值。 + +这里有几个关于风格的要点: + + * 将 **opterr** 初始化为 0,禁止 **getopt** 发出 **?**。 + * 在 **main()** 的中间使用 **exit(EXIT_FAILURE);** 或 **exit(EXIT_SUCCESS);**。 + * **/* NOTREACHED */** 是我喜欢的一个 lint 指令。 + * 在函数末尾使用 **return EXIT_SUCCESS;** 返回一个 int 类型。 + * 显示强制转换隐式类型。 + +这个程序的命令行签名经过编译如下所示: +``` +$ ./a.out -h +a.out [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h] +``` + +事实上,**usage()** 在编译后就会向 **stderr** 发出这样的命令。 + +#### 8\. 函数声明 + +``` +/* main.c */ +<...> + +void usage(char *progname, int opt) { +[fprintf][10](stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} + +int do_the_needful(options_t *options) { + +if (!options) { +errno = EINVAL; +return EXIT_FAILURE; +} + +if (!options->input || !options->output) { +errno = ENOENT; +return EXIT_FAILURE; +} + +/* XXX do needful stuff */ + +return EXIT_SUCCESS; +} +``` + +最后,我编写的函数不是样板函数。在本例中,函数 **do_the_needful()** 接受指向 **options_t** 结构的指针。我验证 **options** 指针不为 **NULL**,然后继续验证 **input** 和 **output** 结构成员。如果其中一个测试失败,返回 **EXIT_FAILURE**,并且通过将外部全局变量 **errno** 设置为常规错误代码,我向调用者发出一个原因的信号。调用者可以使用便捷函数 **perror()** 来根据 **errno** 的值发出人类可读的错误消息。 + +函数几乎总是以某种方式验证它们的输入。如果完全验证代价很大,那么尝试执行一次并将验证后的数据视为不可变。**usage()** 函数使用 **fprintf()** 调用中的条件赋值验证 **progname** 参数。**usage()** 函数无论如何都要退出,所以我不需要设置 **errno** 或为使用正确的程序名大吵一场。 + +在这里,我要避免的最大错误是取消引用 **NULL** 指针。这将导致操作系统向我的进程发送一个名为 **SYSSEGV** 的特殊信号,导致不可避免的死亡。用户希望看到的是由 **SYSSEGV** 引起的崩溃。为了发出更好的错误消息并优雅地关闭程序,捕获 **NULL** 指针要好得多。 + +有些人抱怨在函数体中有多个 **return** 语句,他们争论“控制流的连续性”和其他东西。老实说,如果函数中间出现错误,那么这个时候是返回错误条件的好时机。写一大堆嵌套的 **if** 语句只有一个 return 绝不是一个“好主意。”™ + +最后,如果您编写的函数接受四个或更多参数,请考虑将它们绑定到一个结构中,并传递一个指向该结构的指针。这使得函数签名更简单,更容易记住,并且在以后调用时不会出错。它还使调用函数速度稍微快一些,因为需要复制到函数堆栈中的东西更少。在实践中,只有在函数被调用数百万或数十亿次时,才会考虑这个问题。如果认为这没有意义,那么不要担心。 + +### 等等,你说没有注释 !?!! + +在 **do_the_needful()** 函数中,我写了一种特殊类型的注释,它被设计为占位符而不是记录代码: + + +``` +`/* XXX do needful stuff */` +``` + +当你在该区域时,有时你不想停下来编写一些特别复杂的代码,你会之后再写,而不是现在。那就是我留给自己一点面包屑的地方。我插入一个带有 **XXX** 前缀的注释和一个描述需要做什么的简短注释。之后,当我有更多时间的时候,我会在源代码中寻找 **XXX**。使用什么并不重要,只要确保它不太可能在另一个上下文中以函数名或变量形式显示在代码库中。 + +### 把它们放在一起 + +好吧,当你编译这个程序后,它 _仍_ 仍几乎没有任何作用。但是现在你有了一个坚实的骨架来构建你自己的命令行解析 C 程序。 + +``` +/* main.c - the complete listing */ + +#include +#include +#include +#include +#include +#include +#include + +#define OPTSTR "vi⭕f:h" +#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" +#define ERR_FOPEN_INPUT "fopen(input, r)" +#define ERR_FOPEN_OUTPUT "fopen(output, w)" +#define ERR_DO_THE_NEEDFUL "do_the_needful blew up" +#define DEFAULT_PROGNAME "george" + +extern int errno; +extern char *optarg; +extern int opterr, optind; + +typedef struct { +int verbose; +uint32_t flags; +FILE *input; +FILE *output; +} options_t; + +int dumb_global_variable = -11; + +void usage(char *progname, int opt); +int do_the_needful(options_t *options); + +int main(int argc, char *argv[]) { +int opt; +options_t options = { 0, 0x0, stdin, stdout }; + +opterr = 0; + +while ((opt = getopt(argc, argv, OPTSTR)) != EOF) +switch(opt) { +case 'i': +if (!(options.input = [fopen][6](optarg, "r")) ){ +[perror][7](ERR_FOPEN_INPUT); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} +break; + +case 'o': +if (!(options.output = [fopen][6](optarg, "w")) ){ +[perror][7](ERR_FOPEN_OUTPUT); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} +break; + +case 'f': +options.flags = (uint32_t )[strtoul][9](optarg, NULL, 16); +break; + +case 'v': +options.verbose += 1; +break; + +case 'h': +default: +usage(basename(argv[0]), opt); +/* NOTREACHED */ +break; +} + +if (do_the_needful(&options) != EXIT_SUCCESS) { +[perror][7](ERR_DO_THE_NEEDFUL); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} + +return EXIT_SUCCESS; +} + +void usage(char *progname, int opt) { +[fprintf][10](stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); +[exit][8](EXIT_FAILURE); +/* NOTREACHED */ +} + +int do_the_needful(options_t *options) { + +if (!options) { +errno = EINVAL; +return EXIT_FAILURE; +} + +if (!options->input || !options->output) { +errno = ENOENT; +return EXIT_FAILURE; +} + +/* XXX do needful stuff */ + +return EXIT_SUCCESS; +} +``` + +现在,你已经准备好编写更易于维护的 C 语言。如果你有任何问题或反馈,请在评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/how-write-good-c-main-function + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjny +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") +[2]: https://www.owasp.org/index.php/Null_Dereference +[3]: https://opensource.com/sites/default/files/uploads/hatingotherpeoplescode-big.png (Parody O'Reilly book cover, "Hating Other People's Code") +[4]: https://en.wikipedia.org/wiki/C_preprocessor +[5]: https://linux.die.net/man/3/getopt +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/strtoul.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html From 206a5dd3e3a04be3683a7c50ac8ce0f7bc21e562 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:21:27 +0800 Subject: [PATCH 0729/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190531=20Use?= =?UTF-8?q?=20Firefox=20Send=20with=20ffsend=20in=20Fedora=20sources/tech/?= =?UTF-8?q?20190531=20Use=20Firefox=20Send=20with=20ffsend=20in=20Fedora.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Use Firefox Send with ffsend in Fedora.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md diff --git a/sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md b/sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md new file mode 100644 index 0000000000..984fb771dc --- /dev/null +++ b/sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Firefox Send with ffsend in Fedora) +[#]: via: (https://fedoramagazine.org/use-firefox-send-with-ffsend-in-fedora/) +[#]: author: (Sylvia Sánchez https://fedoramagazine.org/author/lailah/) + +Use Firefox Send with ffsend in Fedora +====== + +![][1] + +_ffsend_ is the command line client of Firefox Send. This article will show how Firefox Send and _ffsend_ work. It’ll also detail how it can be installed and used in Fedora. + +### What are Firefox Send and ffsend ? + +Firefox Send is a file sharing tool from Mozilla that allows sending encrypted files to other users. You can install Send on your own server, or use the Mozilla-hosted link [send.firefox.com][2]. The hosted version officially supports files up to 1 GB, and links that expire after a configurable download count (default of 1) or 24 hours, and then all the files on the Send server are deleted. This tool is still _in experimental phase_ , and therefore shouldn’t be used in production or to share important or sensitive data. + +While Firefox Send is the tool itself and can be used with a web interface, _ffsend_ is a command-line utility you can use with scripts and arguments. It has a wide range of configuration options and can be left working in the background without any human intervention. + +### How does it work? + +FFSend can both upload and download files. The remote host can use either the Firefox tool or another web browser to download the file. Neither Firefox Send nor _ffsend_ require the use of Firefox. + +It’s important to highlight that _ffsend_ uses client-side encryption. This means that files are encrypted _before_ they’re uploaded. You share secrets together with the link, so be careful when sharing, because anyone with the link will be able to download the file. As an extra layer of protection, you can protect the file with a password by using the following argument: + +``` +ffsend password URL -p PASSWORD +``` + +### Other features + +There are a few other features worth mentioning. Here’s a list: + + * Configurable download limit, between 1 and 20 times, before the link expires + * Built-in extract and archiving functions + * Track history of shared files + * Inspect or delete shared files + * Folders can be shared as well, either as they are or as compressed files + * Generate a QR code, for easier download on a mobile phone + + + +### How to install in Fedora + +While Fedora Send works with Firefox without installing anything extra, you’ll need to install the CLI tool to use _ffsend_. This tool is in the official repositories, so you only need a simple _dnf_ command [with][3] _[sudo][3]_. + +``` +$ sudo dnf install ffsend +``` + +After that, you can use _ffsend_ from the terminal . + +### Upload a file + +Uploading a file is a simple as + +``` +$ ffsend upload /etc/os-release +Upload complete +Share link: https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg +``` + +The file now can be easily share using the Share link URL. + +## Downloading a file + +Downloading a file is as simple as uploading. + +``` +$ ffsend download https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg +Download complete +``` + +Before downloading a file it might be useful to check if the file exist and get information about it. _ffsend_ provides 2 handy commands for that. + +``` +$ ffsend exists https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ +Exists: true +Password: false +$ ffsend info https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ +ID: 88a6324e2a99ebb6 +Downloads: 0 of 1 +Expiry: 23h59m (86388s +``` + +## Upload history + +_ffsend_ also provides a way to check the history of the uploads made with the tools. This can be really useful if you upload a lot of files during a scripted tasks for example and you want to keep track of each files download status. + +``` +$ ffsend history +LINK EXPIRY + 1 https://send.firefox.com/download/#8TJ9QNw 23h59m + 2 https://send.firefox.com/download/KZIA-PaQ 23h54m +``` + +## Delete a file + +Another useful feature is the possibility to delete a file. + +``` +ffsend delete https://send.firefox.com/download/2d9faa7f34bb1478/#phITKvaYBjCGSRI8TJ9QNw +``` + +Firefox Send is a great service and the _ffsend_ tools makes it really convenient to use from the terminal. More examples and documentation is available on _ffsend_ ‘s [Gitlab repository][4]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-firefox-send-with-ffsend-in-fedora/ + +作者:[Sylvia Sánchez][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/lailah/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/firefox-send-816x345.png +[2]: http://send.firefox.com/ +[3]: https://fedoramagazine.org/howto-use-sudo/ +[4]: https://gitlab.com/timvisee/ffsend From 039dc401e8cb2796a8d1930bf723049dea519293 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:23:12 +0800 Subject: [PATCH 0730/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190529=20Pack?= =?UTF-8?q?it=20=E2=80=93=20packaging=20in=20Fedora=20with=20minimal=20eff?= =?UTF-8?q?ort=20sources/tech/20190529=20Packit=20-=20packaging=20in=20Fed?= =?UTF-8?q?ora=20with=20minimal=20effort.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...packaging in Fedora with minimal effort.md | 244 ++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 sources/tech/20190529 Packit - packaging in Fedora with minimal effort.md diff --git a/sources/tech/20190529 Packit - packaging in Fedora with minimal effort.md b/sources/tech/20190529 Packit - packaging in Fedora with minimal effort.md new file mode 100644 index 0000000000..ad431547da --- /dev/null +++ b/sources/tech/20190529 Packit - packaging in Fedora with minimal effort.md @@ -0,0 +1,244 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Packit – packaging in Fedora with minimal effort) +[#]: via: (https://fedoramagazine.org/packit-packaging-in-fedora-with-minimal-effort/) +[#]: author: (Petr Hracek https://fedoramagazine.org/author/phracek/) + +Packit – packaging in Fedora with minimal effort +====== + +![][1] + +### What is packit + +Packit ([https://packit.dev/)][2] is a CLI tool that helps you auto-maintain your upstream projects into the Fedora operating system. But what does it really mean? + +As a developer, you might want to update your package in Fedora. If you’ve done it in the past, you know it’s no easy task. If you haven’t let me reiterate: it’s no easy task. + +And this is exactly where packit can help: once you have your package in Fedora, you can maintain your SPEC file upstream and, with just one additional configuration file, packit will help you update your package in Fedora when you update your source code upstream. + +Furthermore, packit can synchronize downstream changes to a SPEC file back into the upstream repository. This could be useful if the SPEC file of your package is changed in Fedora repositories and you would like to synchronize it into your upstream project. + +Packit also provides a way to build an SRPM package based on an upstream repository checkout, which can be used for building RPM packages in COPR. + +Last but not least, packit provides a status command. This command provides information about upstream and downstream repositories, like pull requests, release and more others. + +Packit provides also another two commands: _build_ and _create-update_. + +The command _packit build_ performs a production build of your project in Fedora build system – koji. You can Fedora version you want to build against using an option _–dist-git-branch_. The command _packit create-updates_ creates a Bodhi update for the specific branch using the option — _dist-git-branch_. + +### Installation + +You can install packit on Fedora using dnf: + +``` +sudo dnf install -y packit +``` + +### Configuration + +For demonstration use case, I have selected the upstream repository of **colin** ([https://github.com/user-cont/colin)][3]. Colin is a tool to check generic rules and best-practices for containers, dockerfiles, and container images. + +First of all, clone **colin** git repository: + +``` +$ git clone https://github.com/user-cont/colin.git +$ cd colin +``` + +Packit expects to run in the root of your git repository. + +Packit ([https://github.com/packit-service/packit/)][4] needs information about your project, which has to be stored in the upstream repository in the _.packit.yaml_ file (). + +See colin’s packit configuration file: + +``` +$ cat .packit.yaml +specfile_path: colin.spec +synced_files: + -.packit.yaml + - colin.spec +upstream_project_name: colin +downstream_package_name: colin +``` + +What do the values mean? + + * _specfile_path_ – a relative path to a spec file within the upstream repository (mandatory) + * _synced_files_ – a list of relative paths to files in the upstream repo which are meant to be copied to dist-git during an update + * _upstream_project_name_ – name of the upstream repository (e.g. in PyPI); this is used in %prep section + * _downstream_package_name_ – name of the package in Fedora (mandatory) + + + +For more information see the packit configuration documentation () + +### What can packit do? + +Prerequisite for using packit is that you are in a working directory of a git checkout of your upstream project. + +Before running any packit command, you need to do several actions. These actions are mandatory for filing a PR into the upstream or downstream repositories and to have access into the Fedora dist-git repositories. + +Export GitHub token taken from : + +``` +$ export GITHUB_TOKEN= +``` + +Obtain your Kerberos ticket needed for Fedora Account System (FAS) : + +``` +$ kinit @FEDORAPROJECT.ORG +``` + +Export your Pagure API keys taken from : + +``` +$ export PAGURE_USER_TOKEN= +``` + +Packit also needs a fork token to create a pull request. The token is taken from + +Do it by running: + +``` +$ export PAGURE_FORK_TOKEN= +``` + +Or store these tokens in the **~/.config/packit.yaml** file: + +``` +$ cat ~/.config/packit.yaml + +github_token: +pagure_user_token: +pagure_fork_token: +``` + +#### Propose a new upstream release in Fedora + +The command for this first use case is called _**propose-update**_ (). The command creates a new pull request in Fedora dist-git repository using a selected or the latest upstream release. + +``` +$ packit propose-update + +INFO: Running 'anitya' versioneer +Version in upstream registries is '0.3.1'. +Version in spec file is '0.3.0'. +WARNING Version in spec file is outdated +Picking version of the latest release from the upstream registry. +Checking out upstream version 0.3.1 +Using 'master' dist-git branch +Copying /home/vagrant/colin/colin.spec to /tmp/tmptfwr123c/colin.spec. +Archive colin-0.3.0.tar.gz found in lookaside cache (skipping upload). +INFO: Downloading file from URL https://files.pythonhosted.org/packages/source/c/colin/colin-0.3.0.tar.gz +100%[=============================>] 3.18M eta 00:00:00 +Downloaded archive: '/tmp/tmptfwr123c/colin-0.3.0.tar.gz' +About to upload to lookaside cache +won't be doing kinit, no credentials provided +PR created: https://src.fedoraproject.org/rpms/colin/pull-request/14 +``` + +Once the command finishes, you can see a PR in the Fedora Pagure instance which is based on the latest upstream release. Once you review it, it can be merged. + +![][5] + +#### Sync downstream changes back to the upstream repository + +Another use case is to sync downstream changes into the upstream project repository. + +The command for this purpose is called _**sync-from-downstream**_ (). Files synced into the upstream repository are mentioned in the _packit.yaml_ configuration file under the _synced_files_ value. + +``` +$ packit sync-from-downstream + +upstream active branch master +using "master" dist-git branch +Copying /tmp/tmplvxqtvbb/colin.spec to /home/vagrant/colin/colin.spec. +Creating remote fork-ssh with URL git@github.com:phracek/colin.git. +Pushing to remote fork-ssh using branch master-downstream-sync. +PR created: https://github.com/user-cont/colin/pull/229 +``` + +As soon as packit finishes, you can see the latest changes taken from the Fedora dist-git repository in the upstream repository. This can be useful, e.g. when Release Engineering performs mass-rebuilds and they update your SPEC file in the Fedora dist-git repository. + +![][6] + +#### Get the status of your upstream project + +If you are a developer, you may want to get all the information about the latest releases, tags, pull requests, etc. from the upstream and the downstream repository. Packit provides the _**status**_ command for this purpose. + +``` +$ packit status +Downstream PRs: + ID Title URL +---- -------------------------------- --------------------------------------------------------- + 14 Update to upstream release 0.3.1 https://src.fedoraproject.org//rpms/colin/pull-request/14 + 12 Upstream pr: 226 https://src.fedoraproject.org//rpms/colin/pull-request/12 + 11 Upstream pr: 226 https://src.fedoraproject.org//rpms/colin/pull-request/11 + 8 Upstream pr: 226 https://src.fedoraproject.org//rpms/colin/pull-request/8 + +Dist-git versions: +f27: 0.2.0 +f28: 0.2.0 +f29: 0.2.0 +f30: 0.2.0 +master: 0.2.0 + +GitHub upstream releases: +0.3.1 +0.3.0 +0.2.1 +0.2.0 +0.1.0 + +Latest builds: +f27: colin-0.2.0-1.fc27 +f28: colin-0.3.1-1.fc28 +f29: colin-0.3.1-1.fc29 +f30: colin-0.3.1-2.fc30 + +Latest bodhi updates: +Update Karma status +------------------ ------- -------- +colin-0.3.1-1.fc29 1 stable +colin-0.3.1-1.fc28 1 stable +colin-0.3.0-2.fc28 0 obsolete +``` + +#### Create an SRPM + +The last packit use case is to generate an SRPM package based on a git checkout of your upstream project. The packit command for SRPM generation is _**srpm**_. + +``` +$ packit srpm +Version in spec file is '0.3.1.37.g00bb80e'. +SRPM: /home/phracek/work/colin/colin-0.3.1.37.g00bb80e-1.fc29.src.rpm +``` + +### Packit as a service + +In the summer, the people behind packit would like to introduce packit as a service (). In this case, the packit GitHub application will be installed into the upstream repository and packit will perform all the actions automatically, based on the events it receives from GitHub or fedmsg. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/packit-packaging-in-fedora-with-minimal-effort/ + +作者:[Petr Hracek][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/phracek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/packit3-816x345.png +[2]: https://packit.dev/ +[3]: https://github.com/user-cont/colin +[4]: https://github.com/packit-service/packit/ +[5]: https://fedoramagazine.org/wp-content/uploads/2019/05/colin_pr-1024x781.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/05/colin_upstream_pr-1-1024x677.png From 34edf760e7cb27e3dfd1c4a0ed16ab84ff6f4e09 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:23:35 +0800 Subject: [PATCH 0731/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190531=20Unit?= =?UTF-8?q?y=20Editor=20is=20Now=20Officially=20Available=20for=20Linux=20?= =?UTF-8?q?sources/tech/20190531=20Unity=20Editor=20is=20Now=20Officially?= =?UTF-8?q?=20Available=20for=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r is Now Officially Available for Linux.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md diff --git a/sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md b/sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md new file mode 100644 index 0000000000..513915bdef --- /dev/null +++ b/sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Unity Editor is Now Officially Available for Linux) +[#]: via: (https://itsfoss.com/unity-editor-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Unity Editor is Now Officially Available for Linux +====== + +If you are a designer, developer or an artist, you might have been using the experimental [Unity Editor][1] that was made available for Linux. However, the experimental version wasn’t going to cut it forever – developers need a full stable experience to work. + +So, they recently announced that you can access the full-fledged Unity Editor on Linux. + +While this is an exciting news, what Linux distro does it officially support? Let us talk about a few more details… + +Non-FOSS Alert + +Unity Editor on Linux (or any other platform for that matter) is not an open source software. We have covered it here because + +### Official Support for Ubuntu and CentOS 7 + +![][2] + +No matter whether you have a personal or a professional license, you can access the editor if you have Unity 2019.1 installed or later. + +In addition, they are prioritizing the support for Ubuntu 16.04, Ubuntu 18.04, and CentOS 7. + +In their [announcement post][3], they also mentioned the configurations supported: + + * x86-64 architecture + * Gnome desktop environment running on top of X11 windowing system + * Nvidia official proprietary graphics driver and AMD Mesa graphics driver + * Desktop form factors, running on device/hardware without emulation or compatibility layer + + + +You can always try on anything else – but it’s better to stick with the official requirements for the best experience. + +A Note on 3rd Party Tools + +If you happen to utilize any 3rd party tool on any of your projects, you will have to separately check whether they support it or not. + +### How to install Unity Editor on Linux + +Now that you know about it – how do you install it? + +To install Unity, you will have to download and install the [Unity Hub][4]. + +![Unity Hub][5] + +Let’s walk you through the steps: + + * Download Unity Hub for Linux from the [official forum page][4]. + * It will download an AppImage file. Simply, make it executable and run it. In case you are not aware of it, you should check out our guide on [how to use AppImage on Linux][6]. + * Once you launch the Unity Hub, it will ask you to sign in (or sign up) using your Unity ID to activate the licenses. For more info on how the licenses work, do refer to their [FAQ page][7]. + * After you sign in using your Unity ID, go to the “ **Installs** ” option (as shown in the image above) and add the version/components you want. + + + +[][8] + +Suggested read A Modular and Open Source Router is Being Crowdfunded + +That’s it! This is the best way to get all the latest builds and get it installed in a jiffy. + +**Wrapping Up** + +Even though it is an exciting news, the official configuration support does not seem to be an extensive list. If you use it on Linux, do share your feedback and opinion on [their Linux forum thread][9]. + +What do you think about that? Also, do you use Unity Hub to install it or did we miss a better method to get it installed? + +Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/unity-editor-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://unity3d.com/unity/editor +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/Unity-Editor-on-Linux.png?resize=800%2C450&ssl=1 +[3]: https://blogs.unity3d.com/2019/05/30/announcing-the-unity-editor-for-linux/ +[4]: https://forum.unity.com/threads/unity-hub-v-1-6-0-is-now-available.640792/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/unity-hub.jpg?fit=800%2C532&ssl=1 +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://support.unity3d.com/hc/en-us/categories/201268913-Licenses +[8]: https://itsfoss.com/turris-mox-router/ +[9]: https://forum.unity.com/forums/linux-editor.93/ From 042abd6c0c27f77886244dfda267e2b7890b2f8a Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:23:57 +0800 Subject: [PATCH 0732/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190528=20A=20?= =?UTF-8?q?Quick=20Look=20at=20Elvish=20Shell=20sources/tech/20190528=20A?= =?UTF-8?q?=20Quick=20Look=20at=20Elvish=20Shell.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190528 A Quick Look at Elvish Shell.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20190528 A Quick Look at Elvish Shell.md diff --git a/sources/tech/20190528 A Quick Look at Elvish Shell.md b/sources/tech/20190528 A Quick Look at Elvish Shell.md new file mode 100644 index 0000000000..778965d442 --- /dev/null +++ b/sources/tech/20190528 A Quick Look at Elvish Shell.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A Quick Look at Elvish Shell) +[#]: via: (https://itsfoss.com/elvish-shell/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +A Quick Look at Elvish Shell +====== + +Everyone who comes to this site has some knowledge (no matter how slight) of the Bash shell that comes default of so many systems. There have been several attempts to create shells that solve some of the shortcomings of Bash that have appeared over the years. One such shell is Elvish, which we will look at today. + +### What is Elvish Shell? + +![Pipelines In Elvish][1] + +[Elvish][2] is more than just a shell. It is [also][3] “an expressive programming language”. It has a number of interesting features including: + + * Written in Go + * Built-in file manager, inspired by the [Ranger file manager][4] (`Ctrl + N`) + * Searchable command history (`Ctrl + R`) + * History of directories visited (`Ctrl + L`) + * Powerful pipelines that support structured data, such as lists, maps, and functions + * Includes a “standard set of control structures: conditional control with `if`, loops with `for` and `while`, and exception handling with `try`“ + * Support for [third-party modules via a package manager to extend Elvish][5] + * Licensed under the BSD 2-Clause license + + + +“Why is it named Elvish?” I hear you shout. Well, according to [their website][6], they chose their current name because: + +> In roguelikes, items made by the elves have a reputation of high quality. These are usually called elven items, but “elvish” was chosen because it ends with “sh”, a long tradition of Unix shells. It also rhymes with fish, one of the shells that influenced the philosophy of Elvish. + +### How to Install Elvish Shell + +Elvish is available in several mainstream distributions. + +Note that the software is very young. The most recent version is 0.12. According to the project’s [GitHub page][3]: “Despite its pre-1.0 status, it is already suitable for most daily interactive use.” + +![Elvish Control Structures][7] + +#### Debian and Ubuntu + +Elvish packages were introduced into Debian Buster and Ubuntu 17.10. Unfortunately, those packages are out of date and you will need to use a [PPA][8] to install the latest version. You will need to use the following commands: + +``` +sudo add-apt-repository ppa:zhsj/elvish +sudo apt update +sudo apt install elvish +``` + +#### Fedora + +Elvish is not available in the main Fedora repos. You will need to add the [FZUG Repository][9] to install Evlish. To do so, you will need to use these commands: + +``` +sudo dnf config-manager --add-repo=http://repo.fdzh.org/FZUG/FZUG.repol +sudo dnf install elvish +``` + +#### Arch + +Elvish is available in the [Arch User Repository][10]. + +I believe you know [how to change shell in Linux][11] so after installing you can switch to Elvish to use it. + +### Final Thoughts on Elvish Shell + +Personally, I have no reason to install Elvish on any of my systems. I can get most of its features by installing a couple of small command line programs or using already installed programs. + +For example, the search past commands feature already exists in Bash and it works pretty well. If you want to improve your ability to search past commands, I would recommend installing [fzf][12] instead. Fzf uses fuzzy search, so you don’t need to remember the exact command you are looking for. Fzf also allows you to preview and open files. + +I do think that the fact that Elvish is also a programming language is neat, but I’ll stick with Bash shell scripting until Elvish matures a little more. + +Have you every used Elvish? Do you think it would be worthwhile to install Elvish? What is your favorite Bash replacement? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][13]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/elvish-shell/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/pipelines-in-elvish.png?fit=800%2C421&ssl=1 +[2]: https://elv.sh/ +[3]: https://github.com/elves/elvish +[4]: https://ranger.github.io/ +[5]: https://github.com/elves/awesome-elvish +[6]: https://elv.sh/ref/name.html +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Elvish-control-structures.png?fit=800%2C425&ssl=1 +[8]: https://launchpad.net/%7Ezhsj/+archive/ubuntu/elvish +[9]: https://github.com/FZUG/repo/wiki/Add-FZUG-Repository +[10]: https://aur.archlinux.org/packages/elvish/ +[11]: https://linuxhandbook.com/change-shell-linux/ +[12]: https://github.com/junegunn/fzf +[13]: http://reddit.com/r/linuxusersgroup From 3cefbfa8077786acd5ad7ba89f3ae3a08819f588 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:24:37 +0800 Subject: [PATCH 0733/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=20Agin?= =?UTF-8?q?g=20in=20the=20open:=20How=20this=20community=20changed=20us=20?= =?UTF-8?q?sources/tech/20190604=20Aging=20in=20the=20open-=20How=20this?= =?UTF-8?q?=20community=20changed=20us.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...the open- How this community changed us.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20190604 Aging in the open- How this community changed us.md diff --git a/sources/tech/20190604 Aging in the open- How this community changed us.md b/sources/tech/20190604 Aging in the open- How this community changed us.md new file mode 100644 index 0000000000..a03d49eca2 --- /dev/null +++ b/sources/tech/20190604 Aging in the open- How this community changed us.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Aging in the open: How this community changed us) +[#]: via: (https://opensource.com/open-organization/19/6/four-year-celebration) +[#]: author: (Bryan Behrenshausen https://opensource.com/users/bbehrens) + +Aging in the open: How this community changed us +====== +Our community dedicated to exploring open organizational culture and +design turns four years old this week. +![Browser window with birthday hats and a cake][1] + +A community will always surprise you. + +That's not an easy statement for someone like me to digest. I'm not one for surprises. I revel in predictability. I thrive on consistency. + +A passionate and dedicated community offers few of these comforts. Participating in something like [the open organization community at Opensource.com][2]—which [turns four years old this week][3]—means acquiescing to dynamism, to constant change. Every day brings novelty. Every correspondence is packed with possibility. Every interaction reveals undisclosed pathways. + +To [a certain type of person][4] (me again), it can be downright terrifying. + +But that unrelenting and genuine surprise is the [very source of a community's richness][5], its sheer abundance. If a community is the nucleus of all those reactions that catalyze innovations and breakthroughs, then unpredictability and serendipity are its fuel. I've learned to appreciate it—more accurately, perhaps, to stand in awe of it. Four years ago, when the Opensource.com team heeded [Jim Whitehurst's call][6] to build a space for others to "share your thoughts and opinions… on how you think we can all lead and work better in the future" (see the final page of _The Open Organization_ ), we had little more than a mandate, a platform, and a vision. We'd be an open organization [committed to studying, learning from, and propagating open organizations][7]. The rest was a surprise—or rather, a series of surprises: + + * [Hundreds of articles, reviews, guides, and tutorials][2] on infusing open principles into organizations of all sizes across industries + * [A book series][8] spanning five volumes (with [another currently in production][9]) + * A detailed, comprehensive, community-maintained [definition of the "open organization" concept][10] + * A [robust maturity model][11] for anyone seeking to understand how that definition might (or might not) support their own work + + + +All of that—everything you see there, [and more][12]—is the work of a community that never stopped conversing, never ceased creating, never failed to outsmart itself. No one could have predicted it. No one could have [planned for it][13]. We simply do our best to keep up with it. + +And after four years the work continues, more focused and impassioned than ever. Remaining involved with this bunch of writers, educators, consultants, coaches, leaders, and mentors—all united by their belief that openness is the surest source of hope for organizations struggling to address the challenges of our age—has made me appreciate the power of the utterly surprising. I'm even getting a little more comfortable with it. + +That's been its gift to me. But the gifts it has given each of its participants have been equally special. + +As we celebrate four years of challenges, collaboration, and camaraderie this week, let's recount those surprising gifts by hearing from some of the members: + +* * * + +Four years of the open organization community—congratulations to all! + +My first thought was to look at the five most-read articles over the past four years. Here they are: + + * [5 laws every aspiring DevOps engineer should know][14] + * [What value do you bring to your company?][15] + * [8 answers to management questions from an open point of view][16] + * [What to do when you're feeling underutilized][17] + * [What's the point of DevOps?][18] + + + +All great articles. And then I started to think: Of all the great content over the past four years, which articles have impacted me the most? + +I remembered reading several great articles about meetings and how to make them more effective. So I typed "opensource.com meetings" into my search engine, and these two wonderful articles were at the top of the results list: + + * [The secret to better one-on-one meetings][19] + * [Time to rethink your team's approach to meetings][20] + + + +Articles like that have inspired my favorite open organization management principle, which I've tried to apply and has made a huge difference: All meetings are optional. + +**—Jeff Mackanic, senior director, Marketing, Red Hat** + +* * * + +Being a member of the "open community" has reminded me of the power of getting things done via values and shared purpose without command and control—something that seems more important than ever in today's fragmented and often abusive management world, and at a time when truth and transparency themselves are under attack. + +Four years is a long journey for this kind of initiative—but there's still so much to learn and understand about what makes "open" work and what it will take to accelerate the embrace of its principles more widely through different domains of work and society. Congratulations on all you, your colleagues, partners, and other members of the community have done thus far! + +**—Brook Manville, Principal, Brook Manville LLC, author of _A Company of Citizens_ and co-author of _The Harvard Business Review Leader's Handbook_** + +* * * + +The Open Organization Ambassador program has, in the last four years, become an inspired community of experts. We have defined what it means to be a truly open organization. We've written books, guides, articles, and other resources for learning about, understanding, and implementing open principles. We've done this while bringing open principles to other communities, and we've done this together. + +For me, personally and professionally, the togetherness is the best part of this endeavor. I have learned so much from my colleagues. I'm absolutely ecstatic to be one of the idealists and activists in this community—committed to making our workplaces more equitable and open. + +**—Laura Hilliger, co-founder, We Are Open Co-Op, and[Open Organization Ambassador][21]** + +* * * + +Finding the open organization community opened me up to knowing that there are others out there who thought as I did. I wasn't alone. My ideas on leadership and the workplace were not crazy. This sense of belonging increased once I joined the Ambassador team. Our monthly meetings are never long enough. I don't like when we have to hang up because each session is full of laughter, sharpening each other, idea exchange, and joy. Humans seek community. We search for people who share values and ideals as we do but who also push back and help us expand. This is the gift of the open organization community—expansion, growth, and lifelong friendships. Thank you to all of those who contribute their time, intellect, content, and whole self to this awesome think tank that is changing the shape of how we organize to solve problems! + +**—Jen Kelchner, founder and Chief Change Architect, LDR21, and[Open Organization Ambassador][21]** + +* * * + +Happy fourth birthday, open organization community! Thank you for being an ever-present reminder in my life that being open is better than being closed, that listening is more fruitful than telling, and that together we can achieve more. + +**—Michael Doyle, professional coach and[Open Organization Ambassador][21]** + +* * * + +Wow, what a journey it's been exploring the world of open organizations. We're seeing more interest now than ever before. It's amazing to see what this community has done and I'm excited to see what the future holds for open organizations and open leadership. + +**—Jason Hibbets, senior community architect, Red Hat** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/6/four-year-celebration + +作者:[Bryan Behrenshausen][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/bbehrens +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/happy_birthday_anniversary_celebrate_hats_cake.jpg?itok=Zfsv6DE_ (Browser window with birthday hats and a cake) +[2]: https://opensource.com/open-organization +[3]: https://opensource.com/open-organization/15/5/introducing-open-organization +[4]: https://opensource.com/open-organization/18/11/design-communities-personality-types +[5]: https://opensource.com/open-organization/18/1/why-build-community-1 +[6]: https://www.redhat.com/en/explore/the-open-organization-book +[7]: https://opensource.com/open-organization/resources/ambassadors-program +[8]: https://opensource.com/open-organization/resources/book-series +[9]: https://opensource.com/open-organization/19/5/educators-guide-project +[10]: https://opensource.com/open-organization/resources/open-org-definition +[11]: https://opensource.com/open-organization/resources/open-org-maturity-model +[12]: https://opensource.com/open-organization/resources +[13]: https://opensource.com/open-organization/19/2/3-misconceptions-agile +[14]: https://opensource.com/open-organization/17/5/5-devops-laws +[15]: https://opensource.com/open-organization/15/7/what-value-do-you-bring-your-company +[16]: https://opensource.com/open-organization/16/5/open-questions-and-answers-about-open-management +[17]: https://opensource.com/open-organization/17/4/feeling-underutilized +[18]: https://opensource.com/open-organization/17/5/what-is-the-point-of-DevOps +[19]: https://opensource.com/open-organization/18/5/open-one-on-one-meetings-guide +[20]: https://opensource.com/open-organization/18/3/open-approaches-meetings +[21]: https://opensource.com/open-organization/resources/meet-ambassadors From 4041d3d757c48f02c08c1be40ca6fa16dead9a09 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:25:00 +0800 Subject: [PATCH 0734/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=20Crea?= =?UTF-8?q?te=20a=20CentOS=20homelab=20in=20an=20hour=20sources/tech/20190?= =?UTF-8?q?604=20Create=20a=20CentOS=20homelab=20in=20an=20hour.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0604 Create a CentOS homelab in an hour.md | 224 ++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 sources/tech/20190604 Create a CentOS homelab in an hour.md diff --git a/sources/tech/20190604 Create a CentOS homelab in an hour.md b/sources/tech/20190604 Create a CentOS homelab in an hour.md new file mode 100644 index 0000000000..039af752db --- /dev/null +++ b/sources/tech/20190604 Create a CentOS homelab in an hour.md @@ -0,0 +1,224 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create a CentOS homelab in an hour) +[#]: via: (https://opensource.com/article/19/6/create-centos-homelab-hour) +[#]: author: (Bob Murphy https://opensource.com/users/murph) + +Create a CentOS homelab in an hour +====== +Set up a self-sustained set of basic Linux servers with nothing more +than a system with virtualization software, a CentOS ISO, and about an +hour of your time. +![metrics and data shown on a computer screen][1] + +When working on new Linux skills (or, as I was, studying for a Linux certification), it is helpful to have a few virtual machines (VMs) available on your laptop so you can do some learning on the go. + +But what happens if you are working somewhere without a good internet connection and you want to work on a web server? What about using other software that you don't already have installed? If you were depending on downloading it from the distribution's repositories, you may be out of luck. With a bit of preparation, you can set up a [homelab][2] that will allow you to install anything you need wherever you are, with or without a network connection. + +The requirements are: + + * A downloaded ISO file of the Linux distribution you intend to use (for example, CentOS, Red Hat, etc.) + * A host computer with virtualization. I use [Fedora][3] with [KVM][4] and [virt-manager][5], but any Linux will work similarly. You could even use Windows or Mac with virtualization, with some difference in implementation + * About an hour of time + + + +### 1\. Create a VM for your repo host + +Use virt-manager to create a VM with modest specs; 1GB RAM, one CPU, and 16GB of disk space are plenty. + +Install [CentOS 7][6] on the VM. + +![Installing a CentOS homelab][7] + +Select your language and continue. + +Click _Installation Destination_ , select your local disk, mark the _Automatically Configure Partitioning_ checkbox, and click *Done *in the upper-left corner. + +Under _Software Selection_ , select _Infrastructure Server_ , mark the _FTP Server_ checkbox, and click _Done_. + +![Installing a CentOS homelab][8] + +Select _Network and Host Name_ , enable Ethernet in the upper-right, then click _Done_ in the upper-left corner. + +Click _Begin Installation_ to start installing the OS. + +You must create a root password, then you can create a user with a password as it installs. + +### 2\. Start the FTP service + +The next step is to start and set the FTP service to run and allow it through the firewall. + +Log in with your root password, then start the FTP server: + + +``` +`systemctl start vsftpd` +``` + +Enable it to work on every start: + + +``` +`systemctl enable vsftpd` +``` + +Set the port as allowed through the firewall: + + +``` +`firewall-cmd --add-service=ftp --perm` +``` + +Enable this change immediately: + + +``` +`firewall-cmd --reload` +``` + +Get your IP address: + + +``` +`ip a` +``` + +(it's probably **eth0** ). You'll need it in a minute. + +### 3\. Copy the files for your local repository + +Mount the CD you installed from to your VM through your virtualization software. + +Create a directory for the CD to be mounted to temporarily: + + +``` +`mkdir /root/temp` +``` + +Mount the install CD: + + +``` +`mount /dev/cdrom /root/temp` +``` + +Copy all the files to the FTP server directory: + + +``` +`rsync -avhP /root/temp/ /var/ftp/pub/` +``` + +### 4\. Point the server to the local repository + +Red Hat-based systems use files that end in **.repo** to identify where to get updates and new software. Those files can be found at + + +``` +`cd /etc/yum.repos.d` +``` + +You need to get rid of the repo files that point your server to look to the CentOS repositories on the internet. I prefer to copy them to root's home directory to get them out of the way: + + +``` +`mv * ~` +``` + +Then create a new repo file to point to your server. Use your favorite text editor to create a file named **network.repo** with the following lines (substituting the IP address you got in step 2 for _< your IP>_), then save it: + + +``` +[network] +name=network +baseurl=/pub +gpgcheck=0 +``` + +When that's done, we can test it out with the following: + + +``` +`yum clean all; yum install ftp` +``` + +If your FTP client installs as expected from the "network" repository, your local repo is set up! + +![Installing a CentOS homelab][9] + +### 5\. Install a new VM with the repository you set up + +Go back to the virtual machine manager, and create another VM—but this time, select _Network Install_ with a URL of: + + +``` +`ftp://192.168.122./pub` +``` + +If you're using a different host OS or virtualization manager, install your VM similarly as before, and skip to the next section. + +### 6\. Set the new VM to use your existing network repository + +You can copy the repo file from your existing server to use here. + +As in the first server example, enter: + + +``` +cd /etc/yum.repos.d +mv * ~ +``` + +Then: + + +``` +`scp root@192.168.122.:/etc/yum.repos.d/network.repo /etc/yum.repos.d` +``` + +Now you should be ready to work with your new VM and get all your software from your local repository. + +Test this again: + + +``` +`yum clean all; yum install screen` +``` + +This will install your software from your local repo server. + +This setup, which gives you independence from the network with the ability to install software, can create a much more dependable environment for expanding your skills on the road. + +* * * + +_Bob Murphy will present this topic as well as an introduction to[GNU Screen][10] at [Southeast Linux Fest][11], June 15-16 in Charlotte, N.C._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/create-centos-homelab-hour + +作者:[Bob Murphy][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/murph +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://opensource.com/article/19/3/home-lab +[3]: https://getfedora.org/ +[4]: https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine +[5]: https://virt-manager.org/ +[6]: https://www.centos.org/download/ +[7]: https://opensource.com/sites/default/files/uploads/homelab-3b_0.png (Installing a CentOS homelab) +[8]: https://opensource.com/sites/default/files/uploads/homelab-5b.png (Installing a CentOS homelab) +[9]: https://opensource.com/sites/default/files/uploads/homelab-14b.png (Installing a CentOS homelab) +[10]: https://opensource.com/article/17/3/introduction-gnu-screen +[11]: https://southeastlinuxfest.org/ From 597681824a53ee7a13223c13783544f06ca26d5b Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:25:19 +0800 Subject: [PATCH 0735/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190603=20How?= =?UTF-8?q?=20many=20browser=20tabs=20do=20you=20usually=20have=20open=3F?= =?UTF-8?q?=20sources/tech/20190603=20How=20many=20browser=20tabs=20do=20y?= =?UTF-8?q?ou=20usually=20have=20open.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...y browser tabs do you usually have open.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sources/tech/20190603 How many browser tabs do you usually have open.md diff --git a/sources/tech/20190603 How many browser tabs do you usually have open.md b/sources/tech/20190603 How many browser tabs do you usually have open.md new file mode 100644 index 0000000000..7777477029 --- /dev/null +++ b/sources/tech/20190603 How many browser tabs do you usually have open.md @@ -0,0 +1,44 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How many browser tabs do you usually have open?) +[#]: via: (https://opensource.com/article/19/6/how-many-browser-tabs) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett/users/sarahwall/users/ksonney/users/jwhitehurst) + +How many browser tabs do you usually have open? +====== +Plus, get a few tips for browser productivity. +![Browser of things][1] + +Here's a potentially loaded question: How many browser tabs do you usually have open at one time? Do you have multiple windows, each with multiple tabs? Or are you a minimalist, and only have a couple of tabs open at once. Another option is to move a 20-tabbed browser window to a different monitor so that it is out of the way while working on a particular task. Does your approach differ between work, personal, and mobile browsers? Is your browser strategy related to your [productivity habits][2]? + +### 4 tips for browser productivity + + 1. Know your browser shortcuts to save clicks. Whether you use Firefox or Chrome, there are plenty of keyboard shortcuts to help make switching between tabs and performing certain functions a breeze. For example, Chrome makes it easy to open up a blank Google document. Use the shortcut **"Ctrl + t"** to open a new tab, then type **"doc.new"**. The same can be done for spreadsheets, slides, and forms. + 2. Organize your most frequent tasks with bookmark folders. When it's time to start a particular task, simply open all of the bookmarks in the folder **(Ctrl + click)** to check it off your list quickly. + 3. Get the right browser extensions for you. There are thousands of browser extensions out there all claiming to improve productivity. Before you install, make sure you're not just adding more distractions to your screen. + 4. Reduce screen time by using a timer. It doesn't matter if you use an old-fashioned egg timer or a fancy browser extension. To prevent eye strain, implement the 20/20/20 rule. Every 20 minutes, take a 20-second break from your screen and look at something 20 feet away. + + + +Take our poll to share how many browser tabs you like to have open at once. Be sure to tell us about your favorite browser tricks in the comments. + +There are two components of productivity—doing the right things and doing those things efficiently... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/how-many-browser-tabs + +作者:[Lauren Pritchett][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lauren-pritchett/users/sarahwall/users/ksonney/users/jwhitehurst +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://enterprisersproject.com/article/2019/1/5-time-wasting-habits-break-new-year From 35328dcc3125d5daaf95fffd11dfabb53d91e947 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:25:36 +0800 Subject: [PATCH 0736/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190603=20How?= =?UTF-8?q?=20to=20set=20up=20virtual=20environments=20for=20Python=20on?= =?UTF-8?q?=20MacOS=20sources/tech/20190603=20How=20to=20set=20up=20virtua?= =?UTF-8?q?l=20environments=20for=20Python=20on=20MacOS.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...irtual environments for Python on MacOS.md | 214 ++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 sources/tech/20190603 How to set up virtual environments for Python on MacOS.md diff --git a/sources/tech/20190603 How to set up virtual environments for Python on MacOS.md b/sources/tech/20190603 How to set up virtual environments for Python on MacOS.md new file mode 100644 index 0000000000..8c54e5a6ac --- /dev/null +++ b/sources/tech/20190603 How to set up virtual environments for Python on MacOS.md @@ -0,0 +1,214 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up virtual environments for Python on MacOS) +[#]: via: (https://opensource.com/article/19/6/virtual-environments-python-macos) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg/users/moshez/users/mbbroberg/users/moshez) + +How to set up virtual environments for Python on MacOS +====== +Save yourself a lot of confusion by managing your virtual environments +with pyenv and virtualwrapper. +![][1] + +If you're a Python developer and a MacOS user, one of your first tasks upon getting a new computer is to set up your Python development environment. Here is the best way to do it (although we have written about [other ways to manage Python environments on MacOS][2]). + +### Preparation + +First, open a terminal and enter **xcode-select --install** at its cold, uncaring prompt. Click to confirm, and you'll be all set with a basic development environment. This step is required on MacOS to set up local development utilities, including "many commonly used tools, utilities, and compilers, including make, GCC, clang, perl, svn, git, size, strip, strings, libtool, cpp, what, and many other useful commands that are usually found in default Linux installations," according to [OS X Daily][3]. + +Next, install [Homebrew][4] by executing the following Ruby script from the internet: + + +``` +`ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"` +``` + +If you, like me, have trust issues with arbitrarily running scripts from the internet, click on the script above and take a longer look to see what it does. + +Once this is done, congratulations, you have an excellent package management tool in Homebrew. Naively, you might think that you next **brew install python** or something. No, haha. Homebrew will give you a version of Python, but the version you get will be out of your control if you let the tool manage your environment for you. You want [pyenv][5], "a tool for simple Python version management," that can be installed on [many operating systems][6]. Run: + + +``` +`$ brew install pyenv` +``` + +You want pyenv to run every time you open your prompt, so include the following in your configuration files (by default on MacOS, this is **.bash_profile** in your home directory): + + +``` +$ cd ~/ +$ echo 'eval "$(pyenv init -)"' >> .bash_profile +``` + +By adding this line, every new terminal will initiate pyenv to manage the **PATH** environment variable in your terminal and insert the version of Python you want to run (as opposed to the first one that shows up in the environment. For more information, read "[How to set your $PATH variable in Linux][7].") Open a new terminal for the updated **.bash_profile** to take effect. + +Before installing your favorite version of Python, you'll want to install a couple of helpful tools: + + +``` +`$ brew install zlib sqlite` +``` + +The [zlib][8] compression algorithm and the [SQLite][9] database are dependencies for pyenv and often [cause build problems][10] when not configured correctly. Add these exports to your current terminal window to ensure the installation completes: + + +``` +$ export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/sqlite/lib" +$ export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/sqlite/include" +``` + +Now that the preliminaries are done, it's time to install a version of Python that is fit for a modern person in the modern age: + + +``` +`$ pyenv install 3.7.3` +``` + +Go have a cup of coffee. From beans you hand-roast. After you pick them. What I'm saying here is it's going to take some time. + +### Adding virtual environments + +Once it's finished, it's time to make your virtual environments pleasant to use. Without this next step, you will effectively be sharing one Python development environment for every project you work on. Using virtual environments to isolate dependency management on a per-project basis will give us more certainty and reproducibility than Python offers out of the box. For these reasons, install **virtualenvwrapper** into the Python environment: + + +``` +$ pyenv global 3.7.3 +# Be sure to keep the $() syntax in this command so it can evaluate +$ $(pyenv which python3) -m pip install virtualenvwrapper +``` + +Open your **.bash_profile** again and add the following to be sure it works each time you open a new terminal: + + +``` +# We want to regularly go to our virtual environment directory +$ echo 'export WORKON_HOME=~/.virtualenvs' >> .bash_profile +# If in a given virtual environment, make a virtual environment directory +# If one does not already exist +$ echo 'mkdir -p $WORKON_HOME' >> .bash_profile +# Activate the new virtual environment by calling this script +# Note that $USER will substitute for your current user +$ echo '. ~/.pyenv/versions/3.7.3/bin/virtualenvwrapper.sh' >> .bash_profile +``` + +Close the terminal and open a new one (or run **exec /bin/bash -l** to refresh the current terminal session), and you'll see **virtualenvwrapper** initializing the environment: + + +``` +$ exec /bin/bash -l +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/premkproject +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postmkproject +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/initialize +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/premkvirtualenv +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postmkvirtualenv +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/prermvirtualenv +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postrmvirtualenv +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/predeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postdeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/preactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/get_env_details +``` + +From now on, all your work should be in a virtual environment, allowing you to use temporary environments to play around with development safely. With this toolchain, you can set up multiple projects and switch between them, depending upon what you're working on at that moment: + + +``` +$ mkvirtualenv test1 +Using base prefix '/Users/moshe/.pyenv/versions/3.7.3' +New python executable in /Users/moshe/.virtualenvs/test1/bin/python3 +Also creating executable in /Users/moshe/.virtualenvs/test1/bin/python +Installing setuptools, pip, wheel... +done. +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/predeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/postdeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/preactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/postactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/get_env_details +(test1)$ mkvirtualenv test2 +Using base prefix '/Users/moshe/.pyenv/versions/3.7.3' +New python executable in /Users/moshe/.virtualenvs/test2/bin/python3 +Also creating executable in /Users/moshe/.virtualenvs/test2/bin/python +Installing setuptools, pip, wheel... +done. +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/predeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/postdeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/preactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/postactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/get_env_details +(test2)$ ls $WORKON_HOME +get_env_details postmkvirtualenv premkvirtualenv +initialize postrmvirtualenv prermvirtualenv +postactivate preactivate test1 +postdeactivate predeactivate test2 +postmkproject premkproject +(test2)$ workon test1 +(test1)$ +``` + +The **deactivate** command exits you from the current environment. + +### Recommended practices + +You may already set up your long-term projects in a directory like **~/src**. When you start working on a new project, go into this directory, add a subdirectory for the project, then use the power of Bash interpretation to name the virtual environment based on your directory name. For example, for a project named "pyfun": + + +``` +$ mkdir -p ~/src/pyfun && cd ~/src/pyfun +$ mkvirtualenv $(basename $(pwd)) +# we will see the environment initialize +(pyfun)$ workon +pyfun +test1 +test2 +(pyfun)$ deactivate +$ +``` + +Whenever you want to work on this project, go back to that directory and reconnect to the virtual environment by entering: + + +``` +$ cd ~/src/pyfun +(pyfun)$ workon . +``` + +Since initializing a virtual environment means taking a point-in-time copy of your Python version and the modules that are loaded, you will occasionally want to refresh the project's virtual environment, as dependencies can change dramatically. You can do this safely by deleting the virtual environment because the source code will remain unscathed: + + +``` +$ cd ~/src/pyfun +$ rmvirtualenv $(basename $(pwd)) +$ mkvirtualenv $(basename $(pwd)) +``` + +This method of managing virtual environments with pyenv and virtualwrapper will save you from uncertainty about which version of Python you are running as you develop code locally. This is the simplest way to avoid confusion—especially when you're working with a larger team. + +If you are just beginning to configure your Python environment, read up on how to use [Python 3 on MacOS][2]. Do you have other beginner or intermediate Python questions? Leave a comment and we will consider them for the next article. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/virtual-environments-python-macos + +作者:[Matthew Broberg][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mbbroberg/users/moshez/users/mbbroberg/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_snake_file_box.jpg?itok=UuDVFLX- +[2]: https://opensource.com/article/19/5/python-3-default-macos +[3]: http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/ +[4]: https://brew.sh/ +[5]: https://github.com/pyenv/pyenv +[6]: https://github.com/pyenv/pyenv/wiki +[7]: https://opensource.com/article/17/6/set-path-linux +[8]: https://zlib.net/ +[9]: https://www.sqlite.org/index.html +[10]: https://github.com/pyenv/pyenv/wiki/common-build-problems#build-failed-error-the-python-zlib-extension-was-not-compiled-missing-the-zlib From 84d97c2fcbf6e21faa0fc041e224452a90b56429 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:25:53 +0800 Subject: [PATCH 0737/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190603=20How?= =?UTF-8?q?=20to=20stream=20music=20with=20GNOME=20Internet=20Radio=20sour?= =?UTF-8?q?ces/tech/20190603=20How=20to=20stream=20music=20with=20GNOME=20?= =?UTF-8?q?Internet=20Radio.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... stream music with GNOME Internet Radio.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/tech/20190603 How to stream music with GNOME Internet Radio.md diff --git a/sources/tech/20190603 How to stream music with GNOME Internet Radio.md b/sources/tech/20190603 How to stream music with GNOME Internet Radio.md new file mode 100644 index 0000000000..fc21d82d0b --- /dev/null +++ b/sources/tech/20190603 How to stream music with GNOME Internet Radio.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to stream music with GNOME Internet Radio) +[#]: via: (https://opensource.com/article/19/6/gnome-internet-radio) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/r3bl) + +How to stream music with GNOME Internet Radio +====== +If you're looking for a simple, straightforward interface that gets your +streams playing, try GNOME's Internet Radio plugin. +![video editing dashboard][1] + +Internet radio is a great way to listen to stations from all over the world. Like many developers, I like to turn on a station as I code. You can listen to internet radio with a media player for the terminal like [MPlayer][2] or [mpv][3], which is what I use to listen via the Linux command line. However, if you prefer using a graphical user interface (GUI), you may want to try [GNOME Internet Radio][4], a nifty plugin for the GNOME desktop. You can find it in the package manager. + +![GNOME Internet Radio plugin][5] + +Listening to internet radio with a graphical desktop operating system generally requires you to launch an application such as [Audacious][6] or [Rhythmbox][7]. They have nice interfaces, plenty of options, and cool audio visualizers. But if you want a simple, straightforward interface that gets your streams playing, GNOME Internet Radio is for you. + +After installing it, a small icon appears in your toolbar, which is where you do all your configuration and management. + +![GNOME Internet Radio icons][8] + +The first thing I did was go to the Settings menu. I enabled the following two options: show title notifications and show volume adjustment. + +![GNOME Internet Radio Settings][9] + +GNOME Internet Radio includes a few pre-configured stations, and it is really easy to add others. Just click the ( **+** ) sign. You'll need to enter a channel name, which can be anything you prefer (including the station name), and the station address. For example, I like to listen to Synthetic FM. I enter the name, e.g., "Synthetic FM," and the stream address, i.e., . + +Then click the star next to the stream to add it to your menu. + +However you listen to music and whatever genre you choose, it is obvious—coders need their music! The GNOME Internet Radio plugin makes it simple to get your favorite internet radio station queued up. + +In honor of the Gnome desktop's 18th birthday on August 15, we've rounded up 18 reasons to toast... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/gnome-internet-radio + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss/users/r3bl +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) +[2]: https://opensource.com/article/18/12/linux-toy-mplayer +[3]: https://mpv.io/ +[4]: https://extensions.gnome.org/extension/836/internet-radio/ +[5]: https://opensource.com/sites/default/files/uploads/packagemanager_s.png (GNOME Internet Radio plugin) +[6]: https://audacious-media-player.org/ +[7]: https://help.gnome.org/users/rhythmbox/stable/ +[8]: https://opensource.com/sites/default/files/uploads/titlebaricons.png (GNOME Internet Radio icons) +[9]: https://opensource.com/sites/default/files/uploads/gnomeinternetradio_settings.png (GNOME Internet Radio Settings) From 374c3f3750cad328d17c132cb3b1586c4185b9ae Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:26:05 +0800 Subject: [PATCH 0738/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190531=20Why?= =?UTF-8?q?=20translation=20platforms=20matter=20sources/tech/20190531=20W?= =?UTF-8?q?hy=20translation=20platforms=20matter.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...190531 Why translation platforms matter.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20190531 Why translation platforms matter.md diff --git a/sources/tech/20190531 Why translation platforms matter.md b/sources/tech/20190531 Why translation platforms matter.md new file mode 100644 index 0000000000..e513267640 --- /dev/null +++ b/sources/tech/20190531 Why translation platforms matter.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why translation platforms matter) +[#]: via: (https://opensource.com/article/19/5/translation-platforms) +[#]: author: (Jean-Baptiste Holcroft https://opensource.com/users/jibec/users/annegentle/users/bcotton) + +Why translation platforms matter +====== +Technical considerations are not the best way to judge a good +translation platform. +![][1] + +Language translation enables open source software to be used by people all over the world, and it's a great way for non-developers to get involved in their favorite projects. There are many [translation tools][2] available that you can evaluate according to how well they handle the main functional areas involved in translations: technical interaction capabilities, teamwork support capabilities, and translation support capabilities. + +Technical interaction considerations include: + + * Supported file formats + * Synchronization with the source repository + * Automation support tools + * Interface possibilities + + + +Support for teamwork (which could also be called "community animation") includes how a platform: + + * Monitors changes (by a translator, on a project, etc.) + * Follows up on updates pushed by projects + * Displays the state of the situation + * Enables or not review and validation steps + * Assists in discussions between translators (from the same team and inter-languages) and with project maintainers + * Supports global communication on the platform (news, etc.) + + + +Translator assistance includes: + + * A clear and ergonomic interface + * A limited number of steps to find a project and start working + * A simple way to read the flow between translation and distribution + * Access to a translation memory machine + * Glossary enrichment + + + +There are no major differences, though there are some minor ones, between source code management platforms relating to the first two functional areas. ****I suspect that the last area pertains mainly to source code. However, the data handled is quite different and users are usually much less technically sophisticated than developers, as well as more numerous. + +### My recommendation + +In my opinion, the GNOME platform offers the best translation platform for the following reasons: + + * Its site contains both the team organization and the translation platform. It's easy to see who is responsible and their roles on the team. Everything is concentrated on a few screens. + * It's easy to find what to work on, and you quickly realize you'll have to download files to your computer and send them back once you modify them. It's not very sexy, but the logic is easy to understand. + * Once you send a file back, the platform can send an alert to the mailing list so the team knows the next steps and the translation can be easily discussed at the global level (rather than commenting on specific sentences). + * It has 297 languages. + * It shows clear percentages on progress, both on basic sentences and advanced menus and documentation. + + + +Coupled with a predictable GNOME release schedule, everything is available for the community to work well because the tool promotes community work. + +If we look at the Debian translation team, which has been doing a good job for years translating an unimaginable amount of content for Fedora (especially news), we see there is a highly codified translation process based exclusively on emails with a manual push in the repositories. This team also puts everything into the process, rather than the tools, and—despite the considerable energy this seems to require—it has worked for many years while being among the leading group of languages. + +My perception is that the primary issue for a successful translation platform is not based on the ability to make the unitary (technical, translation) work, but on how it structures and supports the translation team's processes. This is what gives sustainability. + +The production processes are the most important way to structure a team; by putting them together correctly, it's easy for newcomers to understand how processes work, adopt them, and explain them to the next group of newcomers. + +To build a sustainable community, the first consideration must be on a tool that supports collaborative work, then on its usability. + +This explains my frustration with the [Zanata][3] tool, which is efficient from a technical and interface standpoint, but poor when it comes to helping to structure a community. GIven that translation is a community-driven process (possibly one of the most community-driven processes in open source software development), this is a critical problem for me. + +* * * + +_This article is adapted from "[What's a good translation platform?][4]" originally published on the Jibec Journal and is reused with permission._ + +Learn about seven tools and processes, both human and software, which are used to manage patch... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/translation-platforms + +作者:[Jean-Baptiste Holcroft][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/jibec/users/annegentle/users/bcotton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_remote_teams_world.png?itok=_9DCHEel +[2]: https://opensource.com/article/17/6/open-source-localization-tools +[3]: http://zanata.org/ +[4]: https://jibecfed.fedorapeople.org/blog-hugo/en/2016/09/whats-a-good-translation-platform/ From 4df398e47c267094d528110e1a47b99c8ce40a54 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:26:21 +0800 Subject: [PATCH 0739/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190531=20Lear?= =?UTF-8?q?n=20Python=20with=20these=20awesome=20resources=20sources/tech/?= =?UTF-8?q?20190531=20Learn=20Python=20with=20these=20awesome=20resources.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...arn Python with these awesome resources.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20190531 Learn Python with these awesome resources.md diff --git a/sources/tech/20190531 Learn Python with these awesome resources.md b/sources/tech/20190531 Learn Python with these awesome resources.md new file mode 100644 index 0000000000..8bcd1d2bbf --- /dev/null +++ b/sources/tech/20190531 Learn Python with these awesome resources.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learn Python with these awesome resources) +[#]: via: (https://opensource.com/article/19/5/resources-learning-python) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +Learn Python with these awesome resources +====== +Expand your Python knowledge by adding these resources to your personal +learning network. +![Book list, favorites][1] + +I've been using and teaching Python for a long time now, but I'm always interested in increasing my knowledge about this practical and useful programming language. That's why I've been trying to expand my Python [personal learning network][2] (PLN), a concept that describes informal and mutually beneficial networks for sharing information. + +Educators [Kelly Paredes][3] and [Sean Tibor][4] recently talked about how to build your Python PLN on their podcast, [Teaching Python][5], which I subscribed to after meeting them at [PyCon 2019][6] in Cleveland (and adding them to my Python PLN). This podcast inspired me to think more about the people in my Python PLN, including those I met recently at PyCon. + +I'll share some of the places I've met members of my PLN; maybe they can become part of your Python PLN, too. + +### Young Coders mentors + +[Betsy Waliszewski][7], the event coordinator for the Python Foundation, is a member of my Python PLN. When we ran into each other at PyCon2019, because I'm a teacher, she recommended I check out the [Young Coders][8] workshop for kids ages 12 and up. There, I met [Katie Cunningham][9], who was running the program, which taught participants how to set up and configure a Raspberry Pi and use Python. The young students also received two books: _[Python for Kids][10]_ by Jason Briggs and _[Learn to Program with Minecraft][11]_ by Craig Richardson. I'm always looking for new ways to improve my teaching, so I quickly picked up two copies of the Minecraft book at [NoStarch Press][12]' booth at the conference. Katie is a great teacher and a prolific author with a wonderful [YouTube][13] channel full of Python training videos. + +I added Katie to my PLN, along with two other people I met at the Young Coders workshop: [Nat Dunn][14] and [Sean Valentine][15]. Like Katie, they were volunteering their time to introduce young programmers to Python. Nat is the president of [Webucator][16], an IT training company that has been a sponsor of the Python Software Foundation for several years and sponsored the PyCon 2018 Education Summit. He decided to teach at Young Coders after teaching Python to his 13-year-old son and 14-year-old nephew. Sean is the director of strategic initiatives at the [Hidden Genius Project][17], a technology and leadership mentoring program for black male youth. Sean said many Hidden Genius participants "built projects using Python, so we saw [Young Coders] as a great opportunity to partner." Learning about the Hidden Genius Project has inspired me to think deeper about the implications of coding and its power to change lives. + +### Open Spaces meetups + +I found PyCon's [Open Spaces][18], self-organizing, impromptu hour-long meetups, just as useful as the official programmed events. One of my favorites was about the [Circuit Playground Express][19] device, which was part of our conference swag bags. I am fascinated by this device, and the Open Space provided an avenue to learn more. The organizers offered a worksheet and a [GitHub][20] repo with all the tools we needed to be successful, as well as an opportunity for hands-on learning and direction to explore this unique hardware. + +This meetup whetted my appetite to learn even more about programming the Circuit Playground Express, so after PyCon, I reached out on Twitter to [Nina Zakharenko][21], who [presented a keynote][22] at the conference about programming the device. Nina has been in my Python PLN since last fall when I heard her talk at [All Things Open][23], and I recently signed up for her [Python Fundamentals][24] class to add to my learning. Nina recommended I add [Kattni Rembor][25], whose [code examples][26] are helping me learn to program with CircuitPython, to my Python PLN. + +### Other resources from my PLN + +I also met fellow [Opensource.com][27] Community Moderator [Moshe Zadka][28] at PyCon2019 and talked with him at length. He shared several new Python resources, including _[How to Think Like a Computer Scientist][29]_. Community Moderator [Seth Kenlon][30] is another member of my PLN; he has published many great [Python articles][31], and I recommend you follow him, too. + +My Python personal learning network continues to grow each day. Besides the folks I have already mentioned, I recommend you follow [Al Sweigart][32], [Eric Matthes][33], and [Adafruit][34] because they share great content. I also recommend the book _[Make: Getting Started with Adafruit Circuit Playground Express][35]_ and [Podcast.__init__][36], a podcast all about the Python community, both of which I learned about from my PLN. + +Who is in your Python PLN? Please share your favorites in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/resources-learning-python + +作者:[Don Watkins][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/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/reading_book_stars_list.png?itok=Iwa1oBOl (Book list, favorites) +[2]: https://en.wikipedia.org/wiki/Personal_learning_network +[3]: https://www.teachingpython.fm/hosts/kellypared +[4]: https://twitter.com/smtibor +[5]: https://www.teachingpython.fm/20 +[6]: https://us.pycon.org/2019/ +[7]: https://www.linkedin.com/in/betsywaliszewski +[8]: https://us.pycon.org/2019/events/letslearnpython/ +[9]: https://www.linkedin.com/in/kcunning/ +[10]: https://nostarch.com/pythonforkids +[11]: https://nostarch.com/programwithminecraft +[12]: https://nostarch.com/ +[13]: https://www.youtube.com/c/KatieCunningham +[14]: https://www.linkedin.com/in/natdunn/ +[15]: https://www.linkedin.com/in/sean-valentine-b370349b/ +[16]: https://www.webucator.com/ +[17]: http://www.hiddengeniusproject.org/ +[18]: https://us.pycon.org/2019/events/open-spaces/ +[19]: https://www.adafruit.com/product/3333 +[20]: https://github.com/adafruit/PyCon2019 +[21]: https://twitter.com/nnja +[22]: https://www.youtube.com/watch?v=35mXD40SvXM +[23]: https://allthingsopen.org/ +[24]: https://frontendmasters.com/courses/python/ +[25]: https://twitter.com/kattni +[26]: https://github.com/kattni/ChiPy_2018 +[27]: http://Opensource.com +[28]: https://opensource.com/users/moshez +[29]: http://openbookproject.net/thinkcs/python/english3e/ +[30]: https://opensource.com/users/seth +[31]: https://www.google.com/search?source=hp&ei=gVToXPq-FYXGsAW-mZ_YAw&q=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&oq=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&gs_l=psy-ab.12...627.15303..15584...1.0..0.176.2802.4j21......0....1..gws-wiz.....0..35i39j0j0i131j0i67j0i20i263.r2SAW3dxlB4 +[32]: http://alsweigart.com/ +[33]: https://twitter.com/ehmatthes?lang=en +[34]: https://twitter.com/adafruit +[35]: https://www.adafruit.com/product/3944 +[36]: https://www.pythonpodcast.com/episodes/ From 00029fdd494741e04e80912aae0f398eead08f6d Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:26:37 +0800 Subject: [PATCH 0740/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190530=20Crea?= =?UTF-8?q?ting=20a=20Source-to-Image=20build=20pipeline=20in=20OKD=20sour?= =?UTF-8?q?ces/tech/20190530=20Creating=20a=20Source-to-Image=20build=20pi?= =?UTF-8?q?peline=20in=20OKD.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a Source-to-Image build pipeline in OKD.md | 484 ++++++++++++++++++ 1 file changed, 484 insertions(+) create mode 100644 sources/tech/20190530 Creating a Source-to-Image build pipeline in OKD.md diff --git a/sources/tech/20190530 Creating a Source-to-Image build pipeline in OKD.md b/sources/tech/20190530 Creating a Source-to-Image build pipeline in OKD.md new file mode 100644 index 0000000000..713d117cb3 --- /dev/null +++ b/sources/tech/20190530 Creating a Source-to-Image build pipeline in OKD.md @@ -0,0 +1,484 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Creating a Source-to-Image build pipeline in OKD) +[#]: via: (https://opensource.com/article/19/5/creating-source-image-build-pipeline-okd) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) + +Creating a Source-to-Image build pipeline in OKD +====== +S2I is an ideal way to build and compile Go applications in a repeatable +way, and it just gets better when paired with OKD BuildConfigs. +![][1] + +In the first three articles in this series, we explored the general [requirements][2] of a Source-to-Image (S2I) system and [prepared][3] and [tested][4] an environment specifically for a Go (Golang) application. This S2I build is perfect for local development or maintaining a builder image with a code pipeline, but if you have access to an [OKD][5] or OpenShift cluster (or [Minishift][6]), you can set up the entire workflow using OKD BuildConfigs, not only to build and maintain the builder image but also to use the builder image to create the application image and subsequent runtime image automatically. This way, the images can be rebuilt automatically when downstream images change and can trigger OKD deploymentConfigs to redeploy applications running from these images. + +### Step 1: Build the builder image in OKD + +As in local S2I usage, the first step is to create the builder image to build the GoHelloWorld test application that we can reuse to compile other Go-based applications. This first build step will be a Docker build, just like before, that pulls the Dockerfile and S2I scripts from a Git repository to build the image. Therefore, those files must be committed and available in a public Git repo (or you can use the companion [GitHub repo][7] for this article). + +_Note:_ OKD BuildConfigs do not require that source Git repos are public. To use a private repo, you must set up deploy keys and link the keys to a builder service account. This is not difficult, but for simplicity's sake, this exercise will use a public repository. + +#### Create an image stream for the builder image + +The BuildConfig will create a builder image for us to compile the GoHelloWorld app, but first, we need a place to store the image. In OKD, that place is an image stream. + +An [image stream][8] and its tags are like a manifest or list of related images and image tags. It serves as an abstraction layer that allows you to reference an image, even if the image changes. Think of it as a collection of aliases that reference specific images and, as images are updated, automatically points to the new image version. The image stream is nothing except these aliases—just metadata about real images stored in a registry. + +An image stream can be created with the **oc create imagestream ** command, or it can be created from a YAML file with **oc create -f **. Either way, a brand-new image stream is a small placeholder object that is empty until it is populated with image references, either manually (who wants to do things manually?) or with a BuildConfig. + +Our golang-builder image stream looks like this: + + +``` +# imageStream-golang-builder.yaml +\--- +apiVersion: image.openshift.io/v1 +kind: ImageStream +metadata: +generation: 1 +name: golang-builder +spec: +lookupPolicy: +local: false +``` + +Other than a name, and a (mostly) empty spec, there is nothing really there. + +_Note:_ The **lookupPolicy** has to do with allowing Kubernetes-native components to resolve image stream references since image streams are OKD-native and not a part of the Kubernetes core. This topic is out of scope for this article, but you can read more about how it works in OKD's documentation [Using Image Streams with Kubernetes Resources][9]. + +Create an image stream for the builder image and its progeny. + + +``` +$ oc create -f imageStream-golangBuilder.yaml + +# Check the ImageStream +$ oc get imagestream golang-builder +NAME DOCKER REPO TAGS UPDATED +imagestream.image.openshift.io/golang-builder docker-registry.default.svc:5000/golang-builder/golang-builder +``` + +Note that the newly created image stream has no tags and has never been updated. + +#### Create a BuildConfig for the builder image + +In OKD, a [BuildConfig][10] describes how to build container images from a specific source and triggers for when they build. Don't be thrown off by the language—just as you might say you build and re-build the same image from a Dockerfile, but in reality, you have built multiple images, a BuildConfig builds and rebuilds the same image, but in reality, it creates multiple images. (And suddenly the reason for image streams becomes much clearer!) + +Our builder image BuildConfig describes how to build and re-build our builder image(s). The BuildConfig's core is made up of four important parts: + + 1. Build source + 2. Build strategy + 3. Build output + 4. Build triggers + + + +The _build source_ (predictably) describes where the thing that runs the build comes from. The builds described by the golang-builder BuildConfig will use the Dockerfile and S2I scripts we created previously and, using the Git-type build source, clone a Git repository to get the files to do the builds. + + +``` +source: +type: Git +git: +ref: master +uri: +``` + +The _build strategy_ describes what the build will do with the source files from the build source. The golang-builder BuildConfig mimics the **docker build** we used previously to build our local builder image by using the Docker-type build strategy. + + +``` +strategy: +type: Docker +dockerStrategy: {} +``` + +The **dockerStrategy** build type tells OKD to build a Docker image from the Dockerfile contained in the source specified by the build source. + +The _build output_ tells the BuildConfig what to do with the resulting image. In this case, we specify the image stream we created above and a tag to give to the image. As with our local build, we're tagging it with **golang-builder:1.12** as a reference to the Go version inherited from the parent image. + + +``` +output: +to: +kind: ImageStreamTag +name: golang-builder:1.12 +``` + +Finally, the BuildConfig defines a set of _build triggers_ —events that will cause the image to be rebuilt automatically. For this BuildConfig, a change to the BuildConfig configuration or an update to the upstream image (golang:1.12) will trigger a new build. + + +``` +triggers: +\- type: ConfigChange +\- imageChange: +type: ImageChange +``` + +Using the [builder image BuildConfig][11] from the GitHub repo as a reference (or just using that file), create a BuildConfig YAML file and use it to create the BuildConfig. + + +``` +$ oc create -f buildConfig-golang-builder.yaml + +# Check the BuildConfig +$ oc get bc golang-builder +NAME TYPE FROM LATEST +golang-builder Docker Git@master 1 +``` + +Because the BuildConfig included the "ImageChange" trigger, it immediately kicks off a new build. You can check that the build was created with the **oc get builds** command. + + +``` +# Check the Builds +$ oc get builds +NAME TYPE FROM STATUS STARTED DURATION +golang-builder-1 Docker Git@8eff001 Complete About a minute ago 13s +``` + +While the build is running and after it has completed, you can view its logs with **oc logs -f ** and see the Docker build output as you would locally. + + +``` +$ oc logs -f golang-builder-1-build +Step 1/11 : FROM docker.io/golang:1.12 +\---> 7ced090ee82e +Step 2/11 : LABEL maintainer "Chris Collins <[collins.christopher@gmail.com][12]>" +\---> 7ad989b765e4 +Step 3/11 : ENV CGO_ENABLED 0 GOOS linux GOCACHE /tmp STI_SCRIPTS_PATH /usr/libexec/s2i SOURCE_DIR /go/src/app +\---> 2cee2ce6757d + +<...> +``` + +If you did not include any build triggers (or did not have them in the right place), your build may not start automatically. You can manually kick off a new build with the **oc start-build** command. + + +``` +$ oc start-build golang-builder + +# Or, if you want to automatically tail the build log +$ oc start-build golang-builder --follow +``` + +When the build completes, the resulting image is tagged and pushed to the integrated image registry and the image stream is updated with the new image's information. Check the image stream with the **oc get imagestream** command to see that the new tag exists. + + +``` +$ oc get imagestream golang-builder +NAME DOCKER REPO TAGS UPDATED +golang-builder docker-registry.default.svc:5000/golang-builder/golang-builder 1.12 33 seconds ago +``` + +### Step 2: Build the application image in OKD + +Now that we have a builder image for our Golang applications created and stored within OKD, we can use this builder image to compile all of our Go apps. First on the block is the example GoHelloWorld app from our [local build example][4]. GoHelloWorld is a simple Go app that just outputs **Hello World!** when it's run. + +Just as we did in the local example with the **s2i build** command, we can tell OKD to use our builder image and S2I to build the application image for GoHelloWorld, compiling the Go binary from the source code in the [GoHelloWorld GitHub repository][13]. This can be done with a BuildConfig with a **sourceStrategy** build. + +#### Create an image stream for the application image + +First things first, we need to create an image stream to manage the image created by the BuildConfig. The image stream is just like the golang-builder image stream, just with a different name. Create it with **oc create is** or using a YAML file from the [GitHub repo][7]. + + +``` +$ oc create -f imageStream-goHelloWorld-appimage.yaml +imagestream.image.openshift.io/go-hello-world-appimage created +``` + +#### Create a BuildConfig for the application image + +Just as we did with the builder image BuildConfig, this BuildConfig will use the Git source option to clone our source code from the GoHelloWorld repository. + + +``` +source: +type: Git +git: +uri: +``` + +Instead of using a DockerStrategy build to create an image from a Dockerfile, this BuildConfig will use the sourceStrategy definition to build the image using S2I. + + +``` +strategy: +type: Source +sourceStrategy: +from: +kind: ImageStreamTag +name: golang-builder:1.12 +``` + +Note the **from:** hash in sourceStrategy. This tells OKD to use the **golang-builder:1.12** image we created previously for the S2I build. + +The BuildConfig will output to the new **appimage** image stream we created, and we'll include config- and image-change triggers to kick off new builds automatically if anything updates. + + +``` +output: +to: +kind: ImageStreamTag +name: go-hello-world-appimage:1.0 +triggers: +\- type: ConfigChange +\- imageChange: +type: ImageChange +``` + +Once again, create a BuildConfig or use the one from the GitHub repo. + + +``` +`$ oc create -f buildConfig-goHelloWorld-appimage.yaml` +``` + +The new build shows up alongside the golang-builder build and, because image-change triggers are specified, the build starts immediately. + + +``` +$ oc get builds +NAME TYPE FROM STATUS STARTED DURATION +golang-builder-1 Docker Git@8eff001 Complete 8 minutes ago 13s +go-hello-world-appimage-1 Source Git@99699a6 Running 44 seconds ago +``` + +If you want to watch the build logs, use the **oc logs -f** command. Once the application image build completes, it is pushed to the image stream we specified, then the new image stream tag is created. + + +``` +$ oc get is go-hello-world-appimage +NAME DOCKER REPO TAGS UPDATED +go-hello-world-appimage docker-registry.default.svc:5000/golang-builder/go-hello-world-appimage 1.0 10 minutes ago +``` + +Success! The GoHelloWorld app was cloned from source into a new image and compiled and tested using our S2I scripts. We can use the image as-is but, as with our local S2I builds, we can do better and create an image with just the new Go binary in it. + +### Step 3: Build the runtime image in OKD + +Now that the application image has been created with a compiled Go binary for the GoHelloWorld app, we can use something called chain builds to mimic when we extracted the binary from our local application image and created a new runtime image with just the binary in it. + +#### Create an image stream for the runtime image + +Once again, the first step is to create an image stream image for the new runtime image. + + +``` +# Create the ImageStream +$ oc create -f imageStream-goHelloWorld.yaml +imagestream.image.openshift.io/go-hello-world created + +# Get the ImageStream +$ oc get imagestream go-hello-world +NAME DOCKER REPO TAGS UPDATED +go-hello-world docker-registry.default.svc:5000/golang-builder/go-hello-world +``` + +#### Chain builds + +Chain builds are when one or more BuildConfigs are used to compile software or assemble artifacts for an application, and those artifacts are saved and used by a subsequent BuildConfig to generate a runtime image without re-compiling the code. + +![Chain Build workflow][14] + +Chain build workflow + +#### Create a BuildConfig for the runtime image + +The runtime BuildConfig uses the DockerStrategy build to build the image from a Dockerfile—the same thing we did with the builder image BuildConfig. This time, however, the source is not a Git source, but a Dockerfile source. + +What is the Dockerfile source? It's an inline Dockerfile! Instead of cloning a repo with a Dockerfile in it and building that, we specify the Dockerfile in the BuildConfig. This is especially appropriate with our runtime Dockerfile because it's just three lines long. + + +``` +source: +type: Dockerfile +dockerfile: |- +FROM scratch +COPY app /app +ENTRYPOINT ["/app"] +images: +\- from: +kind: ImageStreamTag +name: go-hello-world-appimage:1.0 +paths: +\- sourcePath: /go/src/app/app +destinationDir: "." +``` + +Note that the Dockerfile in the Dockerfile source definition above is the same as the Dockerfile we used in the [third article][4] in this series when we built the slim GoHelloWorld image locally using the binary we extracted with the S2I **save-artifacts** script. + +Something else to note: **scratch** is a reserved word in Dockerfiles. Unlike other **FROM** statements, it does not define an _actual_ image, but rather that the first layer of this image will be nothing. It is defined with **kind: DockerImage** but does not have a registry or group/namespace/project string. Learn more about this behavior in this excellent [container best practices][15] reference. + +The **images** section of the Dockerfile source describes the source of the artifact(s) to be used in the build; in this case, from the appimage generated earlier. The **paths** subsection describes where to get the binary (i.e., in the **/go/src/app** directory of the app image, get the **app** binary) and where to save it (i.e., in the current working directory of the build itself: **"."** ). This allows the **COPY app /app** to grab the binary from the current working directory and add it to **/app** in the runtime image. + +_Note:_ **paths** is an array of source and the destination path _pairs_. Each entry in the list consists of a source and destination. In the example above, there is just one entry because there is just a single binary to copy. + +The Docker strategy is then used to build the inline Dockerfile. + + +``` +strategy: +type: Docker +dockerStrategy: {} +``` + +Once again, it is output to the image stream created earlier and includes build triggers to automatically kick off new builds. + + +``` +output: +to: +kind: ImageStreamTag +name: go-hello-world:1.0 +triggers: +\- type: ConfigChange +\- imageChange: +type: ImageChange +``` + +Create a BuildConfig YAML or use the runtime BuildConfig from the GitHub repo. + + +``` +$ oc create -f buildConfig-goHelloWorld.yaml +buildconfig.build.openshift.io/go-hello-world created +``` + +If you watch the logs, you'll notice the first step is **FROM scratch** , which confirms we're adding the compiled binary to a blank image. + + +``` +$ oc logs -f pod/go-hello-world-1-build +Step 1/5 : FROM scratch +\---> +Step 2/5 : COPY app /app +\---> 9e70e6c710f8 +Removing intermediate container 4d0bd9cef0a7 +Step 3/5 : ENTRYPOINT /app +\---> Running in 7a2dfeba28ca +\---> d697577910fc + +<...> +``` + +Once the build is completed, check the image stream tag to validate that the new image was pushed to the registry and image stream was updated. + + +``` +$ oc get imagestream go-hello-world +NAME DOCKER REPO TAGS UPDATED +go-hello-world docker-registry.default.svc:5000/golang-builder/go-hello-world 1.0 4 minutes ago +``` + +Make a note of the **DOCKER REPO** string for the image. It will be used in the next section to run the image. + +### Did we create a tiny, binary-only image? + +Finally, let's validate that we did, indeed, build a tiny image with just the binary. + +Check out the image details. First, get the image's name from the image stream. + + +``` +$ oc describe imagestream go-hello-world +Name: go-hello-world +Namespace: golang-builder +Created: 42 minutes ago +Labels: +Annotations: +Docker Pull Spec: docker-registry.default.svc:5000/golang-builder/go-hello-world +Image Lookup: local=false +Unique Images: 1 +Tags: 1 + +1.0 +no spec tag + +* docker-registry.default.svc:5000/golang-builder/go-hello-world@sha256:eb11e0147a2917312f5e0e9da71109f0cb80760e945fdc1e2db6424b91bc9053 +13 minutes ago +``` + +The image is listed at the bottom, described with the SHA hash (e.g., **sha256:eb11e0147a2917312f5e0e9da71109f0cb80760e945fdc1e2db6424b91bc9053** ; yours will be different). + +Get the details of the image using the hash. + + +``` +$ oc describe image sha256:eb11e0147a2917312f5e0e9da71109f0cb80760e945fdc1e2db6424b91bc9053 +Docker Image: docker-registry.default.svc:5000/golang-builder/go-hello-world@sha256:eb11e0147a2917312f5e0e9da71109f0cb80760e945fdc1e2db6424b91bc9053 +Name: sha256:eb11e0147a2917312f5e0e9da71109f0cb80760e945fdc1e2db6424b91bc9053 +Created: 15 minutes ago +Annotations: image.openshift.io/dockerLayersOrder=ascending +image.openshift.io/manifestBlobStored=true +openshift.io/image.managed=true +Image Size: 1.026MB +Image Created: 15 minutes ago +Author: +Arch: amd64 +Entrypoint: /app +Working Dir: +User: +Exposes Ports: +Docker Labels: io.openshift.build.name=go-hello-world-1 +io.openshift.build.namespace=golang-builder +Environment: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +OPENSHIFT_BUILD_NAME=go-hello-world-1 +OPENSHIFT_BUILD_NAMESPACE=golang-builder +``` + +Notice the image size, 1.026MB, is exactly as we want. The image is a scratch image with just the binary inside it! + +### Run a pod with the runtime image + +Using the runtime image we just created, let's create a pod on-demand and run it and validate that it still works. + +This almost never happens in Kubernetes/OKD, but we will run a pod, just a pod, by itself. + + +``` +$ oc run -it go-hello-world --image=docker-registry.default.svc:5000/golang-builder/go-hello-world:1.0 --restart=Never +Hello World! +``` + +Everything is working as expected—the image runs and outputs "Hello World!" just as it did in the previous, local S2I builds. + +By creating this workflow in OKD, we can use the golang-builder S2I image for any Go application. This builder image is in place and built for any other applications, and it will auto-update and rebuild itself anytime the upstream golang:1.12 image changes. + +New apps can be built automatically using the S2I build by creating a chain build strategy in OKD with an appimage BuildConfig to compile the source and the runtime BuildConfig to create the final image. Using the build triggers, any change to the source code in the Git repo will trigger a rebuild through the entire pipeline, rebuilding the appimage and the runtime image automatically. + +This is a great way to maintain updated images for any application. Paired with an OKD deploymentConfig with an image build trigger, long-running applications (e.g., webapps) will be automatically redeployed when new code is committed. + +Source-to-Image is an ideal way to develop builder images to build and compile Go applications in a repeatable way, and it just gets better when paired with OKD BuildConfigs. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/creating-source-image-build-pipeline-okd + +作者:[Chris Collins][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/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/blocks_building.png?itok=eMOT-ire +[2]: https://opensource.com/article/19/5/source-image-golang-part-1 +[3]: https://opensource.com/article/19/5/source-image-golang-part-2 +[4]: https://opensource.com/article/19/5/source-image-golang-part-3 +[5]: https://www.okd.io/ +[6]: https://github.com/minishift/minishift +[7]: https://github.com/clcollins/golang-s2i.git +[8]: https://docs.okd.io/latest/architecture/core_concepts/builds_and_image_streams.html#image-streams +[9]: https://docs.okd.io/latest/dev_guide/managing_images.html#using-is-with-k8s +[10]: https://docs.okd.io/latest/dev_guide/builds/index.html#defining-a-buildconfig +[11]: https://github.com/clcollins/golang-s2i/blob/master/okd/buildConfig-golang-builder.yaml +[12]: mailto:collins.christopher@gmail.com +[13]: https://github.com/clcollins/goHelloWorld.git +[14]: https://opensource.com/sites/default/files/uploads/chainingbuilds.png (Chain Build workflow) +[15]: http://docs.projectatomic.io/container-best-practices/#_from_scratch From 3ba3401410f616af6c8b301b3b8e5ca678a89a58 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:27:01 +0800 Subject: [PATCH 0741/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190530=20A=20?= =?UTF-8?q?short=20primer=20on=20assemblers,=20compilers,=20and=20interpre?= =?UTF-8?q?ters=20sources/tech/20190530=20A=20short=20primer=20on=20assemb?= =?UTF-8?q?lers,=20compilers,=20and=20interpreters.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...assemblers, compilers, and interpreters.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md diff --git a/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md b/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md new file mode 100644 index 0000000000..db6a4c5365 --- /dev/null +++ b/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md @@ -0,0 +1,145 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A short primer on assemblers, compilers, and interpreters) +[#]: via: (https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/shawnhcorey/users/jnyjny/users/jnyjny) + +A short primer on assemblers, compilers, and interpreters +====== +A gentle introduction to the historical evolution of programming +practices. +![keyboard with connected dots][1] + +In the early days of computing, hardware was expensive and programmers were cheap. In fact, programmers were so cheap they weren't even called "programmers" and were in fact usually mathematicians or electrical engineers. Early computers were used to solve complex mathematical problems quickly, so mathematicians were a natural fit for the job of "programming." + +### What is a program? + +First, a little background. Computers can't do anything by themselves, so they require programs to drive their behavior. Programs can be thought of as very detailed recipes that take an input and produce an output. The steps in the recipe are composed of instructions that operate on data. While that sounds complicated, you probably know how this statement works: + + +``` +`1 + 2 = 3` +``` + +The plus sign is the "instruction" while the numbers 1 and 2 are the data. Mathematically, the equal sign indicates that both sides of an equation are "equivalent," however most computer languages use some variant of equals to mean "assignment." If a computer were executing that statement, it would store the results of the addition (the "3") somewhere in memory. + +Computers know how to do math with numbers and move data around the machine's memory hierarchy. I won't say too much about memory except that it generally comes in two different flavors: fast/small and slow/big. CPU registers are very fast, very small and act as scratch pads. Main memory is typically very big and not nearly as fast as register memory. CPUs shuffle the data they are working with from main memory to registers and back again while a program executes. + +### Assemblers + +Computers were very expensive and people were cheap. Programmers spent endless hours translating hand-written math into computer instructions that the computer could execute. The very first computers had terrible user interfaces, some only consisting of toggle switches on the front panel. The switches represented 1s and 0s in a single "word" of memory. The programmer would configure a word, indicate where to store it, and commit the word to memory. It was time-consuming and error-prone. + +![Programmers operate the ENIAC computer][2] + +_Programmers[Betty Jean Jennings][3] (left) and [Fran Bilas][4] (right) operate [ENIAC's][5] main control panel._ + +Eventually, an [electrical engineer][6] decided his time wasn't cheap and wrote a program with input written as a "recipe" expressed in terms people could read that output a computer-readable version. This was the first "assembler" and it was very controversial. The people that owned the expensive machines didn't want to "waste" compute time on a task that people were already doing; albeit slowly and with errors. Over time, people came to appreciate the speed and accuracy of the assembler versus a hand-assembled program, and the amount of "real work" done with the computer increased. + +While assembler programs were a big step up from toggling bit patterns into the front panel of a machine, they were still pretty specialized. The addition example above might have looked something like this: + + +``` +01 MOV R0, 1 +02 MOV R1, 2 +03 ADD R0, R1, R2 +04 MOV 64, R0 +05 STO R2, R0 +``` + +Each line is a computer instruction, beginning with a shorthand name of the instruction followed by the data the instruction works on. This little program will first "move" the value 1 into a register called R0, then 2 into register R1. Line 03 adds the contents of registers R0 and R1 and stores the resulting value into register R2. Finally, lines 04 and 05 identify where the result should be stored in main memory (address 64). Managing where data is stored in memory is one of the most time-consuming and error-prone parts of writing computer programs. + +### Compilers + +Assembly was much better than writing computer instructions by hand; however, early programmers yearned to write programs like they were accustomed to writing mathematical formulae. This drove the development of higher-level compiled languages, some of which are historical footnotes and others are still in use today. [ALGO][7] is one such footnote, while real problems continue to be solved today with languages like [Fortran][8] and [C][9]. + +![Genealogy tree of ALGO and Fortran][10] + +Genealogy tree of ALGO and Fortran programming languages + +The introduction of these "high-level" languages allowed programmers to write their programs in simpler terms. In the C language, our addition assembly program would be written: + + +``` +int x; +x = 1 + 2; +``` + +The first statement describes a piece of memory the program will use. In this case, the memory should be the size of an integer and its name is **x** The second statement is the addition, although written "backward." A C programmer would read that as "X is assigned the result of one plus two." Notice the programmer doesn't need to say where to put **x** in memory, as the compiler takes care of that. + +A new type of program called a "compiler" would turn the program written in a high-level language into an assembly language version and then run it through the assembler to produce a machine-readable version of the program. This composition of programs is often called a "toolchain," in that one program's output is sent directly to another program's input. + +The huge advantage of compiled languages over assembly language programs was porting from one computer model or brand to another. In the early days of computing, there was an explosion of different types of computing hardware from companies like IBM, Digital Equipment Corporation, Texas Instruments, UNIVAC, Hewlett Packard, and others. None of these computers shared much in common besides needing to be plugged into an electrical power supply. Memory and CPU architectures differed wildly, and it often took man-years to translate programs from one computer to another. + +With high-level languages, the compiler toolchain only had to be ported to the new platform. Once the compiler was available, high-level language programs could be recompiled for a new computer with little or no modification. Compilation of high-level languages was truly revolutionary. + +![IBM PC XT][11] + +IBM PC XT released in 1983, is an early example of the decreasing cost of hardware. + +Life became very good for programmers. It was much easier to express the problems they wanted to solve using high-level languages. The cost of computer hardware was falling dramatically due to advances in semiconductors and the invention of integrated chips. Computers were getting faster and more capable, as well as much less expensive. At some point, possibly in the late '80s, there was an inversion and programmers became more expensive than the hardware they used. + +### Interpreters + +Over time, a new programming model rose where a special program called an "interpreter" would read a program and turn it into computer instructions to be executed immediately. The interpreter takes the program as input and interprets it into an intermediate form, much like a compiler. Unlike a compiler, the interpreter then executes the intermediate form of the program. This happens every time an interpreted program runs, whereas a compiled program is compiled just one time and the computer executes the machine instructions "as written." + +As a side note, when people say "interpreted programs are slow," this is the main source of the perceived lack of performance. Modern computers are so amazingly capable that most people can't tell the difference between compiled and interpreted programs. + +Interpreted programs, sometimes called "scripts," are even easier to port to different hardware platforms. Because the script doesn't contain any machine-specific instructions, a single version of a program can run on many different computers without changes. The catch, of course, is the interpreter must be ported to the new machine to make that possible. + +One example of a very popular interpreted language is [perl][12]. A complete perl expression of our addition problem would be: + + +``` +`$x = 1 + 2` +``` + +While it looks and acts much like the C version, it lacks the variable initialization statement. There are other differences (which are beyond the scope of this article), but you can see that we can write a computer program that is very close to how a mathematician would write it by hand with pencil and paper. + +### Virtual Machines + +The latest craze in programming models is the virtual machine, often abbreviated as VM. There are two flavors of virtual machine; system virtual machines and process virtual machines. Both types of VMs provide a level of abstraction from the "real" computing hardware, though they have different scopes. A system virtual machine is software that offers a substitute for the physical hardware, while a process virtual machine is designed to execute a program in a system-independent manner. So in this case, a process virtual machine (virtual machine from here on) is similar in scope to an interpreter in that a program is first compiled into an intermediated form before the virtual machine executes it. + +The main difference between an interpreter and a virtual machine is the virtual machine implements an idealized CPU accessed through its virtual instruction set. This abstraction makes it possible to write front-end language tools that compile programs written in different languages and target the virtual machine. Probably the most popular and well known virtual machine is the Java Virtual Machine (JVM). The JVM was initially only for the Java programming language back in the 1990s, but it now hosts [many][13] popular computer languages: Scala, Jython, JRuby, Clojure, and Kotlin to list just a few. There are other examples that may not be common knowledge. I only recently learned that my favorite language, [Python][14], is not an interpreted language, but a [language hosted on a virtual machine][15]! + +Virtual machines continue the historical trend of reducing the amount of platform-specific knowledge a programmer needs to express their problem in a language that supports their domain-specific needs. + +### That's a wrap + +I hope you enjoy this primer on some of the less visible parts of software. Are there other topics you want me to dive into next? Let me know in the comments. + +* * * + +_This article was originally published on[PyBites][16] and is reprinted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjny/users/shawnhcorey/users/jnyjny/users/jnyjny +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (keyboard with connected dots) +[2]: https://opensource.com/sites/default/files/uploads/two_women_operating_eniac.gif (Programmers operate the ENIAC computer) +[3]: https://en.wikipedia.org/wiki/Jean_Bartik (Jean Bartik) +[4]: https://en.wikipedia.org/wiki/Frances_Spence (Frances Spence) +[5]: https://en.wikipedia.org/wiki/ENIAC +[6]: https://en.wikipedia.org/wiki/Nathaniel_Rochester_%28computer_scientist%29 +[7]: https://en.wikipedia.org/wiki/ALGO +[8]: https://en.wikipedia.org/wiki/Fortran +[9]: https://en.wikipedia.org/wiki/C_(programming_language) +[10]: https://opensource.com/sites/default/files/uploads/algolfortran_family-by-borkowski.png (Genealogy tree of ALGO and Fortran) +[11]: https://opensource.com/sites/default/files/uploads/639px-ibm_px_xt_color.jpg (IBM PC XT) +[12]: www.perl.org +[13]: https://en.wikipedia.org/wiki/List_of_JVM_languages +[14]: /resources/python +[15]: https://opensource.com/article/18/4/introduction-python-bytecode +[16]: https://pybit.es/python-interpreters.html From 41fb7ec81e21f35b6fcf3c1064a5397c110b56fd Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:27:31 +0800 Subject: [PATCH 0742/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190603=20It?= =?UTF-8?q?=E2=80=99s=20time=20for=20the=20IoT=20to=20'optimize=20for=20tr?= =?UTF-8?q?ust'=20sources/talk/20190603=20It-s=20time=20for=20the=20IoT=20?= =?UTF-8?q?to=20-optimize=20for=20trust.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...time for the IoT to -optimize for trust.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/talk/20190603 It-s time for the IoT to -optimize for trust.md diff --git a/sources/talk/20190603 It-s time for the IoT to -optimize for trust.md b/sources/talk/20190603 It-s time for the IoT to -optimize for trust.md new file mode 100644 index 0000000000..cc5aa9db7c --- /dev/null +++ b/sources/talk/20190603 It-s time for the IoT to -optimize for trust.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (It’s time for the IoT to 'optimize for trust') +[#]: via: (https://www.networkworld.com/article/3399817/its-time-for-the-iot-to-optimize-for-trust.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +It’s time for the IoT to 'optimize for trust' +====== +If we can't trust the internet of things (IoT) to gather accurate data and use it appropriately, IoT adoption and innovation are likely to suffer. +![Bose][1] + +One of the strengths of internet of things (IoT) technology is that it can do so many things well. From smart toothbrushes to predictive maintenance on jetliners, the IoT has more use cases than you can count. The result is that various IoT uses cases require optimization for particular characteristics, from cost to speed to long life, as well as myriad others. + +But in a recent post, "[How the internet of things will change advertising][2]" (which you should definitely read), the always-insightful Stacy Higginbotham tossed in a line that I can’t stop thinking about: “It's crucial that the IoT optimizes for trust." + +**[ Read also: Network World's[corporate guide to addressing IoT security][3] ]** + +### Trust is the IoT's most important attribute + +Higginbotham was talking about optimizing for trust as opposed to clicks, but really, trust is more important than just about any other value in the IoT. It’s more important than bandwidth usage, more important than power usage, more important than cost, more important than reliability, and even more important than security and privacy (though they are obviously related). In fact, trust is the critical factor in almost every aspect of the IoT. + +Don’t believe me? Let’s take a quick look at some recent developments in the field: + +For one thing, IoT devices often don’t take good care of the data they collect from you. Over 90% of data transactions on IoT devices are not fully encrypted, according to a new [study from security company Zscaler][4]. The [problem][5], apparently, is that many companies have large numbers of consumer-grade IoT devices on their networks. In addition, many IoT devices are attached to the companies’ general networks, and if that network is breached, the IoT devices and data may also be compromised. + +In some cases, ownership of IoT data can raise surprisingly serious trust concerns. According to [Kaiser Health News][6], smartphone sleep apps, as well as smart beds and smart mattress pads, gather amazingly personal information: “It knows when you go to sleep. It knows when you toss and turn. It may even be able to tell when you’re having sex.” And while companies such as Sleep Number say they don’t share the data they gather, their written privacy policies clearly state that they _can_. + +### **Lack of trust may lead to new laws** + +In California, meanwhile, "lawmakers are pushing for new privacy rules affecting smart speakers” such as the Amazon Echo. According to the _[LA Times][7]_ , the idea is “to ensure that the devices don’t record private conversations without permission,” requiring a specific opt-in process. Why is this an issue? Because consumers—and their elected representatives—don’t trust that Amazon, or any IoT vendor, will do the right thing with the data it collects from the IoT devices it sells—perhaps because it turns out that thousands of [Amazon employees have been listening in on what Alexa users are][8] saying to their Echo devices. + +The trust issues get even trickier when you consider that Amazon reportedly considered letting Alexa listen to users even without a wake word like “Alexa” or “computer,” and is reportedly working on [wearable devices designed to read human emotions][9] from listening to your voice. + +“The trust has been breached,” said California Assemblyman Jordan Cunningham (R-Templeton) to the _LA Times_. + +As critics of the bill ([AB 1395][10]) point out, the restrictions matter because voice assistants require this data to improve their ability to correctly understand and respond to requests. + +### **Some first steps toward increasing trust** + +Perhaps recognizing that the IoT needs to be optimized for trust so that we are comfortable letting it do its job, Amazon recently introduced a new Alexa voice command: “[Delete what I said today][11].” + +Moves like that, while welcome, will likely not be enough. + +For example, a [new United Nations report][12] suggests that “voice assistants reinforce harmful gender stereotypes” when using female-sounding voices and names like Alexa and Siri. Put simply, “Siri’s ‘female’ obsequiousness—and the servility expressed by so many other digital assistants projected as young women—provides a powerful illustration of gender biases coded into technology products, pervasive in the technology sector and apparent in digital skills education.” I'm not sure IoT vendors are eager—or equipped—to tackle issues like that. + +**More on IoT:** + + * [What is the IoT? How the internet of things works][13] + * [What is edge computing and how it’s changing the network][14] + * [Most powerful Internet of Things companies][15] + * [10 Hot IoT startups to watch][16] + * [The 6 ways to make money in IoT][17] + * [What is digital twin technology? [and why it matters]][18] + * [Blockchain, service-centric networking key to IoT success][19] + * [Getting grounded in IoT networking and security][20] + * [Building IoT-ready networks must become a priority][21] + * [What is the Industrial IoT? [And why the stakes are so high]][22] + + + +Join the Network World communities on [Facebook][23] and [LinkedIn][24] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3399817/its-time-for-the-iot-to-optimize-for-trust.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/09/bose-sleepbuds-2-100771579-large.jpg +[2]: https://mailchi.mp/iotpodcast/stacey-on-iot-how-iot-changes-advertising?e=6bf9beb394 +[3]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html +[4]: https://www.zscaler.com/blogs/research/iot-traffic-enterprise-rising-so-are-threats +[5]: https://www.csoonline.com/article/3397044/over-90-of-data-transactions-on-iot-devices-are-unencrypted.html +[6]: https://khn.org/news/a-wake-up-call-on-data-collecting-smart-beds-and-sleep-apps/ +[7]: https://www.latimes.com/politics/la-pol-ca-alexa-google-home-privacy-rules-california-20190528-story.html +[8]: https://www.usatoday.com/story/tech/2019/04/11/amazon-employees-listening-alexa-customers/3434732002/ +[9]: https://www.bloomberg.com/news/articles/2019-05-23/amazon-is-working-on-a-wearable-device-that-reads-human-emotions +[10]: https://leginfo.legislature.ca.gov/faces/billTextClient.xhtml?bill_id=201920200AB1395 +[11]: https://venturebeat.com/2019/05/29/amazon-launches-alexa-delete-what-i-said-today-voice-command/ +[12]: https://unesdoc.unesco.org/ark:/48223/pf0000367416.page=1 +[13]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[14]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[15]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[16]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[17]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[18]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[19]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[20]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[21]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[22]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[23]: https://www.facebook.com/NetworkWorld/ +[24]: https://www.linkedin.com/company/network-world From bcc0ac783775f427567a0c77f762bf1eb7aaed52 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:27:51 +0800 Subject: [PATCH 0743/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190602=20IoT?= =?UTF-8?q?=20Roundup:=20New=20research=20on=20IoT=20security,=20Microsoft?= =?UTF-8?q?=20leans=20into=20IoT=20sources/talk/20190602=20IoT=20Roundup-?= =?UTF-8?q?=20New=20research=20on=20IoT=20security,=20Microsoft=20leans=20?= =?UTF-8?q?into=20IoT.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... IoT security, Microsoft leans into IoT.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md diff --git a/sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md b/sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md new file mode 100644 index 0000000000..6d955c6485 --- /dev/null +++ b/sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IoT Roundup: New research on IoT security, Microsoft leans into IoT) +[#]: via: (https://www.networkworld.com/article/3398607/iot-roundup-new-research-on-iot-security-microsoft-leans-into-iot.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +IoT Roundup: New research on IoT security, Microsoft leans into IoT +====== +Verizon sets up widely available narrow-band IoT service, while most Americans think IoT manufacturers should ensure their products protect personal information. +As with any technology whose use is expanding at such speed, it can be tough to track exactly what’s going on in the [IoT][1] world – everything from basic usage numbers to customer attitudes to more in-depth slices of the market is constantly changing. Fortunately, the month of May brought several new pieces of research to light, which should help provide at least a partial outline of what’s really happening in IoT. + +### Internet of things polls + +Not all of the news is good. An IPSOS Mori poll performed on behalf of the Internet Society and Consumers International (respectively, an umbrella organization for open development and Internet use and a broad-based consumer advocacy group) found that, despite the skyrocketing numbers of smart devices in circulation around the world, more than half of users in large parts of the western world don’t trust those devices to safeguard their privacy. + +**More on IoT:** + + * [What is the IoT? How the internet of things works][2] + * [What is edge computing and how it’s changing the network][3] + * [Most powerful Internet of Things companies][4] + * [10 Hot IoT startups to watch][5] + * [The 6 ways to make money in IoT][6] + * [What is digital twin technology? [and why it matters]][7] + * [Blockchain, service-centric networking key to IoT success][8] + * [Getting grounded in IoT networking and security][9] + * [Building IoT-ready networks must become a priority][10] + * [What is the Industrial IoT? [And why the stakes are so high]][11] + + + +While almost 70 percent of respondents owned connected devices, 55 percent said they didn’t feel their personal information was adequately protected by manufacturers. A further 28 percent said they had avoided using connected devices – smart home, fitness tracking and similar consumer gadgetry – primarily because they were concerned over privacy issues, and a whopping 85 percent of Americans agreed with the argument that manufacturers had a responsibility to produce devices that protected personal information. + +Those concerns are understandable, according to data from the Ponemon Institute, a tech-research organization. Its survey of corporate risk and security personnel, released in early May, found that there have been few concerted efforts to limit exposure to IoT-based security threats, and that those threats are sharply on the rise when compared to past years, with the percentage of organizations that had experienced a data breach related to unsecured IoT devices rising from 15 percent in fiscal 2017 to 26 percent in fiscal 2019. + +Beyond a lack of organizational wherewithal to address those threats, part of the problem in some verticals is technical. Security vendor Forescout said earlier this month that its research showed 40 percent of all healthcare IT environments had more than 20 different operating systems, and more than 30 percent had more than 100 – hardly an ideal situation for smooth patching and updating. + +To continue reading this article register now + +[Get Free Access][12] + +[Learn More][13] Existing Users [Sign In][12] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398607/iot-roundup-new-research-on-iot-security-microsoft-leans-into-iot.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[2]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[4]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[5]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[6]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[7]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[8]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[9]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[10]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[11]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[12]: javascript:// +[13]: /learn-about-insider/ From 784cfc2e2b5158a558048e67d5805edd56085f03 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:29:15 +0800 Subject: [PATCH 0744/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190529=20Sate?= =?UTF-8?q?llite-based=20internet=20possible=20by=20year-end,=20says=20Spa?= =?UTF-8?q?ceX=20sources/talk/20190529=20Satellite-based=20internet=20poss?= =?UTF-8?q?ible=20by=20year-end,=20says=20SpaceX.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ernet possible by year-end, says SpaceX.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md diff --git a/sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md b/sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md new file mode 100644 index 0000000000..383fac66ca --- /dev/null +++ b/sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Satellite-based internet possible by year-end, says SpaceX) +[#]: via: (https://www.networkworld.com/article/3398940/space-internet-maybe-end-of-year-says-spacex.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Satellite-based internet possible by year-end, says SpaceX +====== +Amazon, Tesla-associated SpaceX and OneWeb are emerging as just some of the potential suppliers of a new kind of data-friendly satellite internet service that could bring broadband IoT connectivity to most places on Earth. +![Getty Images][1] + +With SpaceX’s successful launch of an initial array of broadband-internet-carrying satellites last week, and Amazon’s surprising posting of numerous satellite engineering-related job openings on its [job board][2] this month, one might well be asking if the next-generation internet space race is finally getting going. (I first wrote about [OneWeb’s satellite internet plans][3] it was concocting with Airbus four years ago.) + +This new batch of satellite-driven internet systems, if they work and are eventually switched on, could provide broadband to most places, including previously internet-barren locations, such as rural areas. That would be good for high-bandwidth, low-latency remote-internet of things (IoT) and increasingly important edge-server connections for verticals like oil and gas and maritime. [Data could even end up getting stored in compliance-friendly outer space, too][4]. Leaky ground-based connections, also, perhaps a thing of the past. + +Of the principal new internet suppliers, SpaceX has gotten farthest along. That’s in part because it has commercial impetus. It needed to create payload for its numerous rocket projects. The Tesla electric-car-associated company (the two firms share materials science) has not only launched its first tranche of 60 satellites for its own internet constellation, called Starlink, but also successfully launched numerous batches (making up the full constellation of 75 satellites) for Iridium’s replacement, an upgraded constellation called Iridium NEXT. + +[The time of 5G is almost here][5] + +Potential competitor OneWeb launched its first six Airbus-built satellites in February. [It has plans for 900 more][6]. SpaceX has been approved for 4,365 more by the FCC, and Project Kuiper, as Amazon’s space internet project is known, wants to place 3,236 satellites in orbit, according to International Telecommunication Union filings [discovered by _GeekWire_][7] earlier this year. [Startup LeoSat, which I wrote about last year, aims to build an internet backbone constellation][8]. Facebook, too, is exploring [space-delivered internet][9]. + +### Why the move to space? + +Laser technical progress, where data is sent in open, free space, rather than via a restrictive, land-based cable or via traditional radio paths, is partly behind this space-internet rush. “Bits travel faster in free space than in glass-fiber cable,” LeoSat explained last year. Additionally, improving microprocessor tech is also part of the mix. + +One important difference from existing older-generation satellite constellations is that this new generation of internet satellites will be located in low Earth orbit (LEO). Initial Starlink satellites will be placed at about 350 miles above Earth, with later launches deployed at 710 miles. + +There’s an advantage to that. Traditional satellites in geostationary orbit, or GSO, have been deployed about 22,000 miles up. That extra distance versus LEO introduces latency and is one reason earlier generations of Internet satellites are plagued by slow round-trip times. Latency didn’t matter when GSO was introduced in 1964, and commercial satellites, traditionally, have been pitched as one-way video links, such as are used by sporting events for broadcast, and not for data. + +And when will we get to experience these new ISPs? “Starlink is targeted to offer service in the Northern U.S. and Canadian latitudes after six launches,” [SpaceX says on its website][10]. Each launch would deliver about 60 satellites. “SpaceX is targeting two to six launches by the end of this year.” + +Global penetration of the “populated world” could be obtained after 24 launches, it thinks. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398940/space-internet-maybe-end-of-year-says-spacex.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.idgesg.net/images/article/2018/10/network_iot_world-map_us_globe_nodes_global-100777483-large.jpg +[2]: https://www.amazon.jobs/en/teams/projectkuiper +[3]: https://www.itworld.com/article/2938652/space-based-internet-starts-to-get-serious.html +[4]: https://www.networkworld.com/article/3200242/data-should-be-stored-data-in-space-firm-says.html +[5]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[6]: https://www.airbus.com/space/telecommunications-satellites/oneweb-satellites-connection-for-people-all-over-the-globe.html +[7]: https://www.geekwire.com/2019/amazon-lists-scores-jobs-bellevue-project-kuiper-broadband-satellite-operation/ +[8]: https://www.networkworld.com/article/3328645/space-data-backbone-gets-us-approval.html +[9]: https://www.networkworld.com/article/3338081/light-based-computers-to-be-5000-times-faster.html +[10]: https://www.starlink.com/ +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From 09df864d49b241ab1fd9ae45797d087a8bd9280c Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:29:44 +0800 Subject: [PATCH 0745/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190529=20Cisc?= =?UTF-8?q?o=20security=20spotlights=20Microsoft=20Office=20365=20e-mail?= =?UTF-8?q?=20phishing=20increase=20sources/talk/20190529=20Cisco=20securi?= =?UTF-8?q?ty=20spotlights=20Microsoft=20Office=20365=20e-mail=20phishing?= =?UTF-8?q?=20increase.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oft Office 365 e-mail phishing increase.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/talk/20190529 Cisco security spotlights Microsoft Office 365 e-mail phishing increase.md diff --git a/sources/talk/20190529 Cisco security spotlights Microsoft Office 365 e-mail phishing increase.md b/sources/talk/20190529 Cisco security spotlights Microsoft Office 365 e-mail phishing increase.md new file mode 100644 index 0000000000..c1e0493e63 --- /dev/null +++ b/sources/talk/20190529 Cisco security spotlights Microsoft Office 365 e-mail phishing increase.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco security spotlights Microsoft Office 365 e-mail phishing increase) +[#]: via: (https://www.networkworld.com/article/3398925/cisco-security-spotlights-microsoft-office-365-e-mail-phishing-increase.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco security spotlights Microsoft Office 365 e-mail phishing increase +====== +Cisco blog follows DHS Cybersecurity and Infrastructure Security Agency (CISA) report detailing risks around Office 365 and other cloud services +![weerapatkiatdumrong / Getty Images][1] + +It’s no secret that if you have a cloud-based e-mail service, fighting off the barrage of security issues has become a maddening daily routine. + +The leading e-mail service – in [Microsoft’s Office 365][2] package – seems to be getting the most attention from those attackers hellbent on stealing enterprise data or your private information via phishing attacks. Amazon and Google see their share of phishing attempts in their cloud-based services as well. + +**[ Also see[What to consider when deploying a next generation firewall][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +But attackers are crafting and launching phishing campaigns targeting Office 365 users, [wrote][5] Ben Nahorney, a Threat Intelligence Analyst focused on covering the threat landscape for Cisco Security in a blog focusing on the Office 365 phishing issue. + +Nahorney wrote of research from security vendor [Agari Data][6], that found over the last few quarters, there has been a steady increase in the number of phishing emails impersonating Microsoft. While Microsoft has long been the most commonly impersonated brand, it now accounts for more than half of all brand impersonations seen in the last quarter. + +Recently cloud security firm Avanan wrote in its [annual phishing report][7], one in every 99 emails is a phishing attack, using malicious links and attachments as the main vector. “Of the phishing attacks we analyzed, 25 percent bypassed Office 365 security, a number that is likely to increase as attackers design new obfuscation methods that take advantage of zero-day vulnerabilities on the platform,” Avanan wrote. + +The attackers attempt to steal a user’s login credentials with the goal of taking over accounts. If successful, attackers can often log into the compromised accounts, and perform a wide variety of malicious activity: Spread malware, spam and phishing emails from within the internal network; carry out tailored attacks such as spear phishing and [business email compromise][8] [a long-standing business scam that uses spear-phishing, social engineering, identity theft, e-mail spoofing], and target partners and customers, Nahorney wrote. + +Nahorney wrote that at first glance, this may not seem very different than external email-based attacks. However, there is one critical distinction: The malicious emails sent are now coming from legitimate accounts. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][9] ]** + +“For the recipient, it’s often even someone that they know, eliciting trust in a way that would not necessarily be afforded to an unknown source. To make things more complicated, attackers often leverage ‘conversation hijacking,’ where they deliver their payload by replying to an email that’s already located in the compromised inbox,” Nahorney stated. + +The methods used by attackers to gain access to an Office 365 account are fairly straightforward, Nahorney wrote. + +“The phishing campaigns usually take the form of an email from Microsoft. The email contains a request to log in, claiming the user needs to reset their password, hasn’t logged in recently or that there’s a problem with the account that needs their attention. A URL is included, enticing the reader to click to remedy the issue,” Nahorney wrote. + +Once logged in, nefarious activities can go on unnoticed as the attacker has what look like authorized credentials. + +“This gives the attacker time for reconnaissance: a chance to observe and plan additional attacks. Nor will this type of attack set off a security alert in the same way something like a brute-force attack against a webmail client will, where the attacker guesses password after password until they get in or are detected,” Nahorney stated. + +Nahorney suggested the following steps customers can take to protect email: + + * Use multi-factor authentication. If a login attempt requires a secondary authorization before someone is allowed access to an inbox, this will stop many attackers, even with phished credentials. + * Deploy advanced anti-phishing technologies. Some machine-learning technologies can use local identity and relationship modeling alongside behavioral analytics to spot deception-based threats. + * Run regular phishing exercises. Regular, mandated phishing exercises across the entire organization will help to train employees to recognize phishing emails, so that they don’t click on malicious URLs, or enter their credentials into malicious website. + + + +### Homeland Security flags Office 365, other cloud email services + +The U.S. government, too, has been warning customers of Office 365 and other cloud-based email services that they should be on alert for security risks. The US Department of Homeland Security's Cybersecurity and Infrastructure Security Agency (CISA) this month [issued a report targeting][10] Office 365 and other cloud services saying: + +“Organizations that used a third party have had a mix of configurations that lowered their overall security posture (e.g., mailbox auditing disabled, unified audit log disabled, multi-factor authentication disabled on admin accounts). In addition, the majority of these organizations did not have a dedicated IT security team to focus on their security in the cloud. These security oversights have led to user and mailbox compromises and vulnerabilities.” + +The agency also posted remediation suggestions including: + + * Enable unified audit logging in the Security and Compliance Center. + * Enable mailbox auditing for each user. + * Ensure Azure AD password sync is planned for and configured correctly, prior to migrating users. + * Disable legacy email protocols, if not required, or limit their use to specific users. + + + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398925/cisco-security-spotlights-microsoft-office-365-e-mail-phishing-increase.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/cso_phishing_social_engineering_security_threat_by_weerapatkiatdumrong_gettyimages-489433130_3x2_2400x1600-100796450-large.jpg +[2]: https://docs.microsoft.com/en-us/office365/securitycompliance/security-roadmap +[3]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://blogs.cisco.com/security/office-365-phishing-threat-of-the-month +[6]: https://www.agari.com/ +[7]: https://www.avanan.com/hubfs/2019-Global-Phish-Report.pdf +[8]: https://www.networkworld.com/article/3195072/fbi-ic3-vile-5b-business-e-mail-scam-continues-to-breed.html +[9]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[10]: https://www.us-cert.gov/ncas/analysis-reports/AR19-133A +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From 9b89b1a6e10f7f1a58614502071589d8c7c5ad40 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:30:13 +0800 Subject: [PATCH 0746/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190529=20NVMe?= =?UTF-8?q?=20on=20Linux=20sources/tech/20190529=20NVMe=20on=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190529 NVMe on Linux.md | 70 ++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20190529 NVMe on Linux.md diff --git a/sources/tech/20190529 NVMe on Linux.md b/sources/tech/20190529 NVMe on Linux.md new file mode 100644 index 0000000000..788fe9c3fd --- /dev/null +++ b/sources/tech/20190529 NVMe on Linux.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (NVMe on Linux) +[#]: via: (https://www.networkworld.com/article/3397006/nvme-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +NVMe on Linux +====== +In case you haven't yet noticed, some incredibly fast solid-state disk technology is as available for Linux as it is for other operating systems. +![Sandra Henry-Stocker][1] + +NVMe stands for “non-volatile memory express” and is a host controller interface and storage protocol that was created to accelerate the transfer of data between enterprise and client systems and solid-state drives (SSD). It works over a computer's high-speed Peripheral Component Interconnect Express (PCIe) bus. What I see when I look at this string of letters, however, is “envy me.” And the reason for the envy is significant. + +Using NVMe, data transfer happens _much_ faster than it does with rotating drives. In fact, NVMe drives can move data seven times faster than SATA SSDs. That’s seven times faster than the SSDs that many of us are using today. This means that your systems could boot blindingly fast when an NVMe drive is serving as its boot drive. In fact, these days anyone buying a new system should probably not consider one that doesn’t come with NVMe built-in — whether a server or a PC. + +### Does NVMe work with Linux? + +Yes! NVMe has been supported in the Linux kernel since 3.3. Upgrading a system, however, generally requires that both an NVMe controller and an NVMe disk be available. Some external drives are available but need more than the typical USB port for attaching to the system. + +[MORE ON NETWORK WORLD: Linux: Best desktop distros for newbies][2] + +To check your kernel release, use a command like this: + +``` +$ uname -r +5.0.0-15-generic +``` + +If your system is NVMe-ready, you should see a device (e.g., /dev/nvme0), but only if you have an NVMe controller installed. If you don’t have an NVMe controller, you can still get some information on your NVMe-readiness using this command: + +``` +$ modinfo nvme | head -6 +filename: /lib/modules/5.0.0-15-generic/kernel/drivers/nvme/host/nvme.ko +version: 1.0 +license: GPL +author: Matthew Wilcox +srcversion: AA383008D5D5895C2E60523 +alias: pci:v0000106Bd00002003sv*sd*bc*sc*i* +``` + +### Learn more + +More details on what you need to know about the insanely fast NVMe storage option are available on _[PCWorld][3]._ + +Specs, white papers and other resources are available at [NVMexpress.org][4]. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397006/nvme-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/nvme-100797708-large.jpg +[2]: https://www.networkworld.com/slideshow/153439/linux-best-desktop-distros-for-newbies.html#tk.nww-infsb +[3]: https://www.pcworld.com/article/2899351/everything-you-need-to-know-about-nvme.html +[4]: https://nvmexpress.org/ +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From ed3d17d541ebacb4aae1ba1f5762049c1b1ab03e Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:31:24 +0800 Subject: [PATCH 0747/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190529=20Nvid?= =?UTF-8?q?ia=20launches=20edge=20computing=20platform=20for=20AI=20proces?= =?UTF-8?q?sing=20sources/talk/20190529=20Nvidia=20launches=20edge=20compu?= =?UTF-8?q?ting=20platform=20for=20AI=20processing.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ge computing platform for AI processing.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sources/talk/20190529 Nvidia launches edge computing platform for AI processing.md diff --git a/sources/talk/20190529 Nvidia launches edge computing platform for AI processing.md b/sources/talk/20190529 Nvidia launches edge computing platform for AI processing.md new file mode 100644 index 0000000000..f608db970c --- /dev/null +++ b/sources/talk/20190529 Nvidia launches edge computing platform for AI processing.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Nvidia launches edge computing platform for AI processing) +[#]: via: (https://www.networkworld.com/article/3397841/nvidia-launches-edge-computing-platform-for-ai-processing.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Nvidia launches edge computing platform for AI processing +====== +EGX platform goes to the edge to do as much processing there as possible before sending data upstream to major data centers. +![Leo Wolfert / Getty Images][1] + +Nvidia is launching a new platform called EGX Platform designed to bring real-time artificial intelligence (AI) to edge networks. The idea is to put AI computing closer to where sensors collect data before it is sent to larger data centers. + +The edge serves as a buffer to data sent to data centers. It whittles down the data collected and only sends what is relevant up to major data centers for processing. This can mean discarding more than 90% of data collected, but the trick is knowing which data to keep and which to discard. + +“AI is required in this data-driven world,” said Justin Boitano, senior director for enterprise and edge computing at Nvidia, on a press call last Friday. “We analyze data near the source, capture anomalies and report anomalies back to the mothership for analysis.” + +**[ Now read[20 hot jobs ambitious IT pros should shoot for][2]. ]** + +Boitano said we are hitting crossover where there is more compute at edge than cloud because more work needs to be done there. + +EGX comes from 14 server vendors in a range of form factors, combining AI with network, security and storage from Mellanox. Boitano said that the racks will fit in any industry-standard rack, so they will fit into edge containers from the likes of Vapor IO and Schneider Electric. + +EGX uses Nvidia’s low-power Jetson Nano processor, but also all the way up to Nvidia T4 processors that can deliver more than 10,000 trillion operations per second (TOPS) for real-time speech recognition and other real-time AI tasks. + +Nvdia is working on software stack called Nvidia Edge Stack that can be updated constantly, and the software runs in containers, so no reboots are required, just a restart of the container. EGX runs enterprise-grade Kubernetes container platforms like Red Hat Openshift. + +Edge Stack is optimized software that includes Nvidia drivers, a CUDA Kubernetes plugin, a CUDA container runtime, CUDA-X libraries and containerized AI frameworks and applications, including TensorRT, TensorRT Inference Server and DeepStream. + +The company is boasting more than 40 early adopters, including BMW Group Logistics, which uses EGX and its own Isaac robotic platforms to handle increasingly complex logistics with real-time efficiency. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397841/nvidia-launches-edge-computing-platform-for-ai-processing.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/industry_4-0_industrial_iot_smart_factory_by_leowolfert_gettyimages-689799380_2400x1600-100788464-large.jpg +[2]: https://www.networkworld.com/article/3276025/careers/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From 6e119f7ee8823565d3590b0a757c57c802ae5a27 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:31:46 +0800 Subject: [PATCH 0748/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190529=20Surv?= =?UTF-8?q?ey=20finds=20SD-WANs=20are=20hot,=20but=20satisfaction=20with?= =?UTF-8?q?=20telcos=20is=20not=20sources/talk/20190529=20Survey=20finds?= =?UTF-8?q?=20SD-WANs=20are=20hot,=20but=20satisfaction=20with=20telcos=20?= =?UTF-8?q?is=20not.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ot, but satisfaction with telcos is not.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md diff --git a/sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md b/sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md new file mode 100644 index 0000000000..9b65a6c8dd --- /dev/null +++ b/sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Survey finds SD-WANs are hot, but satisfaction with telcos is not) +[#]: via: (https://www.networkworld.com/article/3398478/survey-finds-sd-wans-are-hot-but-satisfaction-with-telcos-is-not.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +Survey finds SD-WANs are hot, but satisfaction with telcos is not +====== +A recent survey of over 400 IT executives by Cato Networks found that legacy telcos might be on the outside looking in for SD-WANs. +![istock][1] + +This week SD-WAN vendor Cato Networks announced the results of its [Telcos and the Future of the WAN in 2019 survey][2]. The study was a mix of companies of all sizes, with 42% being enterprise-class (over 2,500 employees). More than 70% had a network with more than 10 locations, and almost a quarter (24%) had over 100 sites. All of the respondents have a cloud presence, and almost 80% have at least two data centers. The survey had good geographic diversity, with 57% of respondents coming from the U.S. and 24% from Europe. + +Highlights of the survey include the following key findings: + +## **SD-WANs are hot but not a panacea to all networking challenges** + +The survey found that 44% of respondents have already deployed or will deploy an SD-WAN within the next 12 months. This number is up sharply from 25% when Cato ran the survey a year ago. Another 33% are considering SD-WAN but have no immediate plans to deploy. The primary drivers for the evolution of the WAN are improved internet access (46%), increased bandwidth (39%), improved last-mile availability (38%) and reduced WAN costs (37%). It’s good to see cost savings drop to fourth in motivation, since there is so much more to SD-WAN. + +[The time of 5G is almost here][3] + +It’s interesting that the majority of respondents believe SD-WAN alone can’t address all challenges facing the WAN. A whopping 85% stated they would be confronting issues not addressed by SD-WAN alone. This includes secure, local internet breakout, improved visibility, and control over mobile access to cloud apps. This indicates that customers are looking for SD-WAN to be the foundation of the WAN but understand that other technologies need to be deployed as well. + +## **Telco dissatisfaction is high** + +The traditional telco has been a point of frustration for network professionals for years, and the survey spelled that out loud and clear. Prior to being an analyst, I held a number of corporate IT positions and found telcos to be the single most frustrating group of companies to deal with. The problem was, there was no choice. If you need MPLS services, you need a telco. The same can’t be said for SD-WANs, though; businesses have more choices. + +Respondents to the survey ranked telco service as “average.” It’s been well documented that we are now in the customer-experience era and “good enough” service is no longer good enough. Regarding pricing, 54% gave telcos a failing grade. Although price isn’t everything, this will certainly open the door to competitive SD-WAN vendors. Respondents gave the highest marks for overall experience to SaaS providers, followed by cloud computing suppliers. Global telcos scored the lowest of all vendor types. + +A look deeper explains the frustration level. The network is now mission-critical for companies, but 48% stated they are able to reach the support personnel with the right expertise to solve a problem only on a second attempt. No retailer, airline, hotel or other type of company could survive this, but telco customers had no other options for years. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][4] ]** + +Another interesting set of data points is the speed at which telcos address customer needs. Digital businesses compete on speed, but telco process is the antithesis of fast. Moves, adds and changes take at least one business day for half of the respondents. Also, 70% indicated that opening a new location takes 15 days, and 38% stated it requires 45 days or more. + +## **Security is now part of SD-WAN** + +The use of broadband, cloud access and other trends raise the bar on security for SD-WAN, and the survey confirmed that respondents are skeptical that SD-WANs could address these issues. Seventy percent believe SD-WANs can’t address malware/ransomware, and 49% don’t think SD-WAN helps with enforcing company policies on mobile users. Because of this, network professionals are forced to buy additional security tools from other vendors, but that can drive up complexity. SD-WAN vendors that have intrinsic security capabilities can use that as a point of differentiation. + +## **Managed services are critical to the growth of SD-WANs** + +The survey found that 75% of respondents are using some kind of managed service provider, versus only 25% using an appliance vendor. This latter number was 32% last year. I’m not surprised by this shift and expect it to continue. Legacy WANs were inefficient but straightforward to deploy. D-WANs are highly agile and more cost-effective, but complexity has gone through the roof. Network engineers need to factor in cloud connectivity, distributed security, application performance, broadband connectivity and other issues. Managed services can help businesses enjoy the benefits of SD-WAN while masking the complexity. + +Despite the desire to use an MSP, respondents don’t want to give up total control. Eighty percent stated they preferred self-service or co-managed models. This further explains the shift away from telcos, since they typically work with fully managed models. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398478/survey-finds-sd-wans-are-hot-but-satisfaction-with-telcos-is-not.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/2018/02/istock-465661573-100750447-large.jpg +[2]: https://www.catonetworks.com/news/digital-transformation-survey/ +[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From dfd8e06bea6fc84abbc89e0e0f9ddab86fa00fa0 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:32:48 +0800 Subject: [PATCH 0749/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190528=20With?= =?UTF-8?q?=20Cray=20buy,=20HPE=20rules=20but=20does=20not=20own=20the=20s?= =?UTF-8?q?upercomputing=20market=20sources/talk/20190528=20With=20Cray=20?= =?UTF-8?q?buy,=20HPE=20rules=20but=20does=20not=20own=20the=20supercomput?= =?UTF-8?q?ing=20market.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... does not own the supercomputing market.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/talk/20190528 With Cray buy, HPE rules but does not own the supercomputing market.md diff --git a/sources/talk/20190528 With Cray buy, HPE rules but does not own the supercomputing market.md b/sources/talk/20190528 With Cray buy, HPE rules but does not own the supercomputing market.md new file mode 100644 index 0000000000..07f9eea10c --- /dev/null +++ b/sources/talk/20190528 With Cray buy, HPE rules but does not own the supercomputing market.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (With Cray buy, HPE rules but does not own the supercomputing market) +[#]: via: (https://www.networkworld.com/article/3397087/with-cray-buy-hpe-rules-but-does-not-own-the-supercomputing-market.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +With Cray buy, HPE rules but does not own the supercomputing market +====== +In buying supercomputer vendor Cray, HPE has strengthened its high-performance-computing technology, but serious competitors remain. +![Cray Inc.][1] + +Hewlett Packard Enterprise was already the leader in the high-performance computing (HPC) sector before its announced acquisition of supercomputer maker Cray earlier this month. Now it has a commanding lead, but there are still competitors to the giant. + +The news that HPE would shell out $1.3 billion to buy the company came just as Cray had announced plans to build three of the biggest systems yet — all exascale, and all with the same deployment time of 2021. + +Sales had been slowing for HPC systems, but our government, with its endless supply of money, came to the rescue, throwing hundreds of millions at Cray for systems to be built at Lawrence Berkeley National Laboratory, Argonne National Laboratory and Oak Ridge National Laboratory. + +**[ Read also:[How to plan a software-defined data-center network][2] ]** + +And HPE sees a big revenue opportunity in HPC, a market that was $2 billion in 1990 and now nearly $30 billion, according to Steve Conway, senior vice president with Hyperion Research, which follows the HPC market. HPE thinks the HPC market will grow to $35 billion by 2021, and it hopes to earn a big chunk of that pie. + +“They were solidly in the lead without Cray. They were already in a significant lead over the No. 2 company, Dell. This adds to their lead and gives them access to very high end of market, especially government supercomputers that sell for $300 million to $600 million each,” said Conway. + +He’s not exaggerating. Earlier this month the U.S. Department of Energy announced a contract with Cray to build Frontier, an exascale supercomputer at Oak Ridge National Laboratory, sometime in 2021, with a $600 million price tag. Frontier will be powered by AMD Epyc processors and Radeon GPUs, which must have them doing backflips at AMD. + +With Cray, HPE is sitting on a lot of technology for the supercomputing and even the high-end, non-HPC market. It had the ProLiant business, the bulk of server sales (and proof the Compaq acquisition wasn’t such a bad idea), Integrity NonStop mission-critical servers, the SGI business it acquired in in 2016, plus a variety running everything from Arm to Xeon Scalable processors. + +Conway thinks all of those technologies fit in different spaces, so he doubts HPE will try to consolidate any of it. All HPE has said so far is it will keep the supercomputer products it has now under the Cray business unit. + +But the company is still getting something it didn’t have. “It takes a certain kind of technical experience [to do HPC right] and only a few companies able to play at that level. Before this deal, HPE was not one of them,” said Conway. + +And in the process, HPE takes Cray away from its many competitors: IBM, Lenovo, Dell/EMC, Huawei (well, not so much now), Super Micro, NEC, Hitachi, Fujitsu, and Atos. + +“[The acquisition] doesn’t fundamentally change things because there’s still enough competitors that buyers can have competitive bids. But it’s gotten to be a much bigger market,” said Conway. + +Cray sells a lot to government, but Conway thinks there is a new opportunity in the ever-expanding AI race. “Because HPC is indispensable at the forefront of AI, there is a new area for expanding the market,” he said. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397087/with-cray-buy-hpe-rules-but-does-not-own-the-supercomputing-market.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/06/the_cray_xc30_piz_daint_system_at_the_swiss_national_supercomputing_centre_via_cray_inc_3x2_978x652-100762113-large.jpg +[2]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From ef5579170689590345d854e838528d28d9e53ba5 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:33:17 +0800 Subject: [PATCH 0750/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190528=20Movi?= =?UTF-8?q?ng=20to=20the=20Cloud=3F=20SD-WAN=20Matters!=20sources/talk/201?= =?UTF-8?q?90528=20Moving=20to=20the=20Cloud-=20SD-WAN=20Matters.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...528 Moving to the Cloud- SD-WAN Matters.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md diff --git a/sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md b/sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md new file mode 100644 index 0000000000..8f6f46b6f2 --- /dev/null +++ b/sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Moving to the Cloud? SD-WAN Matters!) +[#]: via: (https://www.networkworld.com/article/3397921/moving-to-the-cloud-sd-wan-matters.html) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +Moving to the Cloud? SD-WAN Matters! +====== + +![istock][1] + +This is the first in a two-part blog series that will explore how enterprises can realize the full transformation promise of the cloud by shifting to a business first networking model powered by a business-driven [SD-WAN][2]. The focus for this installment will be on automating secure IPsec connectivity and intelligently steering traffic to cloud providers. + +Over the past several years we’ve seen a major shift in data center strategies where enterprise IT organizations are shifting applications and workloads to cloud, whether private or public. More and more, enterprises are leveraging software as-a-service (SaaS) applications and infrastructure as-a-service (IaaS) cloud services from leading providers like [Amazon AWS][3], [Google Cloud][4], [Microsoft Azure][5] and [Oracle Cloud Infrastructure][6]. This represents a dramatic shift in enterprise data traffic patterns as fewer and fewer applications are hosted within the walls of the traditional corporate data center. + +There are several drivers for the shift to IaaS cloud services and SaaS apps, but business agility tops the list for most enterprises. The traditional IT model for provisioning and deprovisioning applications is rigid and inflexible and is no longer able to keep pace with changing business needs. + +According to [LogicMonitor’s Cloud Vision 2020][7] study, more than 80 percent of enterprise workloads will run in the cloud by 2020 with more than 40 percent running on public cloud platforms. This major shift in the application consumption model is having a huge [impact on organizations and infrastructure][8]. A recent article entitled “[How Amazon Web Services is luring banks to the cloud][9],” published by CNBC, reported that some companies already have completely migrated all of their applications and IT workloads to public cloud infrastructures. An interesting fact is that while many enterprises must comply with stringent regulatory compliance mandates such as PCI-DSS or HIPAA, they still have made the move to the cloud. This tells us two things – the maturity of using public cloud services and the trust these organizations have in using them is at an all-time high. Again, it is all about speed and agility – without compromising performance, security and reliability. + +### **Is there a direct correlation between moving to the cloud and adopting SD-WAN?** + +As the cloud enables businesses to move faster, an SD-WAN architecture where top-down business intent is the driver is critical to ensuring success, especially when branch offices are geographically distributed across the globe. Traditional router-centric WAN architectures were never designed to support today’s cloud consumption model for applications in the most efficient way. With a conventional router-centric WAN approach, access to applications residing in the cloud means traversing unnecessary hops, resulting in wasted bandwidth, additional cost, added latency and potentially higher packet loss. In addition, under the existing, traditional WAN model where management tends to be rigid, complex network changes can be lengthy, whether setting up new branches or troubleshooting performance issues. This leads to inefficiencies and a costly operational model. Therefore, enterprises greatly benefit from taking a business-first WAN approach toward achieving greater agility in addition to realizing substantial CAPEX and OPEX savings. + +A business-driven SD-WAN platform is purpose-built to tackle the challenges inherent to the traditional router-centric model and more aptly support today’s cloud consumption model. This means application policies are defined based on business intent, connecting users securely and directly to applications where ever they reside without unnecessary extra hops or security compromises. For example, if the application is hosted in the cloud and is trusted, a business-driven SD-WAN can automatically connect users to it without backhauling traffic to a POP or HQ data center. Now, in general this traffic is usually going across an internet link which, on its own, may not be secure. However, the right SD-WAN platform will have a unified stateful firewall built-in for local internet breakout allowing only branch-initiated sessions to enter the branch and providing the ability to service chain traffic to a cloud-based security service if necessary, before forwarding it to its final destination. If the application is moved and becomes hosted by another provider or perhaps back to a company’s own data center, traffic must be intelligently redirected, wherever the application is being hosted. Without automation and embedded machine learning, dynamic and intelligent traffic steering is impossible. + +### **A closer look at how the Silver Peak EdgeConnect™ SD-WAN edge platform addresses these challenges: ** + +**Automate traffic steering and connectivity to cloud providers** + +An [EdgeConnect][10] virtual instance is easily spun up in any of the [leading cloud providers][11] through their respective marketplaces. For an SD-WAN to intelligently steer traffic to its destination, it requires insights into both HTTP and HTTPS traffic; it must be able to identify apps on the first packet received in order to steer traffic to the right destination in accordance with business intent. This is critical capability because once a TCP connection is NAT’d with a public IP address, it cannot be switched thus it can’t be re-routed once a connection is established. So, the ability of EdgeConnect to identify, classify and automatically steer traffic based on the first packet – and not the second or tenth packet – to the correct destination will assure application SLAs, minimize wasting expensive bandwidth and deliver the highest quality of experience. + +Another critical capability is automatic performance optimization. Irrespective of which link the traffic ends up traversing based on business intent and the unique requirements of the application, EdgeConnect automatically optimizes application performance without human intervention by correcting for out of order packets using Packet Order Correction (POC) or even under high latency conditions that can be related to distance or other issues. This is done using adaptive Forward Error Correction (FEC) and tunnel bonding where a virtual tunnel is created, resulting in a single logical overlay that traffic can be dynamically moved between the different paths as conditions change with each underlay WAN service. In this [lightboard video][12], Dinesh Fernando, a technical marketing engineer at Silver Peak, explains how EdgeConnect automates tunnel creation between sites and cloud providers, how it simplifies data transfers between multi-clouds, and how it improves application performance. + +If your business is global and increasingly dependent on the cloud, the business-driven EdgeConnect SD-WAN edge platform enables seamless multi-cloud connectivity, turning the network into a business accelerant. EdgeConnect delivers: + + 1. A consistent deployment from the branch to the cloud, extending the reach of the SD-WAN into virtual private cloud environments + 2. Multi-cloud flexibility, making it easier to initiate and distribute resources across multiple cloud providers + 3. Investment protection by confidently migrating on premise IT resources to any combination of the leading public cloud platforms, knowing their cloud-hosted instances will be fully supported by EdgeConnect + + + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397921/moving-to-the-cloud-sd-wan-matters.html + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-899678028-100797709-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.silver-peak.com/company/tech-partners/cloud/aws +[4]: https://www.silver-peak.com/company/tech-partners/cloud/google-cloud +[5]: https://www.silver-peak.com/company/tech-partners/cloud/microsoft-azure +[6]: https://www.silver-peak.com/company/tech-partners/cloud/oracle-cloud +[7]: https://www.logicmonitor.com/resource/the-future-of-the-cloud-a-cloud-influencers-survey/?utm_medium=pr&utm_source=businesswire&utm_campaign=cloudsurvey +[8]: http://www.networkworld.com/article/3152024/lan-wan/in-the-age-of-digital-transformation-why-sd-wan-plays-a-key-role-in-the-transition.html +[9]: http://www.cnbc.com/2016/11/30/how-amazon-web-services-is-luring-banks-to-the-cloud.html?__source=yahoo%257cfinance%257cheadline%257cheadline%257cstory&par=yahoo&doc=104135637 +[10]: https://www.silver-peak.com/products/unity-edge-connect +[11]: https://www.silver-peak.com/company/tech-partners?strategic_partner_type=69 +[12]: https://www.silver-peak.com/resource-center/automate-connectivity-to-cloud-networking-with-sd-wan From e3ac2ea52ed27b9196fb43d0d5c47019aaa674a3 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:34:05 +0800 Subject: [PATCH 0751/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190528=20Mana?= =?UTF-8?q?ged=20WAN=20and=20the=20cloud-native=20SD-WAN=20sources/talk/20?= =?UTF-8?q?190528=20Managed=20WAN=20and=20the=20cloud-native=20SD-WAN.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Managed WAN and the cloud-native SD-WAN.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md diff --git a/sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md b/sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md new file mode 100644 index 0000000000..026b5d8e81 --- /dev/null +++ b/sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managed WAN and the cloud-native SD-WAN) +[#]: via: (https://www.networkworld.com/article/3398476/managed-wan-and-the-cloud-native-sd-wan.html) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Managed WAN and the cloud-native SD-WAN +====== +The motivation for WAN transformation is clear, today organizations require: improved internet access and last mile connectivity, additional bandwidth and a reduction in the WAN costs. +![Gerd Altmann \(CC0\)][1] + +In recent years, a significant number of organizations have transformed their wide area network (WAN). Many of these organizations have some kind of cloud-presence across on-premise data centers and remote site locations. + +The vast majority of organizations that I have consulted with have over 10 locations. And it is common to have headquarters in both the US and Europe, along with remote site locations spanning North America, Europe, and Asia. + +A WAN transformation project requires this diversity to be taken into consideration when choosing the best SD-WAN vendor to satisfy both; networking and security requirements. Fundamentally, SD-WAN is not just about physical connectivity, there are many more related aspects. + +**[ Related:[MPLS explained – What you need to know about multi-protocol label switching][2]** + +### Motivations for transforming the WAN + +The motivation for WAN transformation is clear: Today organizations prefer improved internet access and last mile connectivity, additional bandwidth along with a reduction in the WAN costs. Replacing Multiprotocol Label Switching (MPLS) with SD-WAN has of course been the main driver for the SD-WAN evolution, but it is only a single piece of the jigsaw puzzle. + +Many SD-WAN vendors are quickly brought to their knees when they try to address security and gain direct internet access from remote site locations. The problem is how to ensure optimized cloud access that is secure, has improved visibility and predictable performance without the high costs associated with MPLS? SD-WAN is not just about connecting locations. Primarily, it needs to combine many other important network and security elements into one seamless worldwide experience. + +According to a recent report from [Cato Networks][3] into enterprise IT managers, a staggering 85% will confront use cases in 2019 that are poorly addressed or outright ignored by SD-WAN. Examples includes providing secure, Internet access from any location (50%) and improving visibility into and control over mobile access to cloud applications, such as Office 365 (46%). + +### Issues with traditional SD-WAN vendors + +First and foremost, SD-WAN unable to address the security challenges that arise during the WAN transformation. Such security challenges include protection against malware, ransomware and implementing the necessary security policies. Besides, there is a lack of visibility that is required to police the mobile users and remote site locations accessing resources in the public cloud. + +To combat this, organizations have to purchase additional equipment. There has always been and will always be a high cost associated with buying such security appliances. Furthermore, the additional tools that are needed to protect the remote site locations increase the network complexity and reduce visibility. Let’s us not forget that the variety of physical appliances require talented engineers for design, deployment and maintenance. + +There will often be a single network-cowboy. This means the network and security configuration along with the design essentials are stored in the mind of the engineer, not in a central database from where the knowledge can be accessed if the engineer leaves his or her employment. + +The physical appliance approach to SD-WAN makes it hard, if not impossible, to accommodate for the future. If the current SD-WAN vendors continue to focus just on connecting the devices with the physical appliances, they will have limited ability to accommodate for example, with the future of network IoT devices. With these factors in mind what are the available options to overcome the SD-WAN shortcomings? + +One can opt for a do it yourself (DIY) solution, or a managed service, which can fall into the category of telcos, with the improvements of either co-managed or self-managed service categories. + +### Option 1: The DIY solution + +Firstly DIY, from the experience of trying to stitch together a global network, this is not only costly but also complex and is a very constrained approach to the network transformation. We started with physical appliances decades ago and it was sufficient to an extent. The reason it worked was that it suited the requirements of the time, but our environment has changed since then. Hence, we need to accommodate these changes with the current requirements. + +Even back in those days, we always had a breachable perimeter. The perimeter-approach to networking and security never really worked and it was just a matter of time before the bad actor would penetrate the guarded walls. + +Securing a global network involves more than just firewalling the devices. A solid security perimeter requires URL filtering, anti-malware and IPS to secure the internet traffic. If you try to deploy all these functions in a single device, such as, unified threat management (UTM), you will hit scaling problems. As a result, you will be left with appliance sprawl. + +Back in my early days as an engineer, I recall stitching together a global network with a mixture of security and network appliances from a variety of vendors. It was me and just two others who used to get the job done on time and for a production network, our uptime levels were superior to most. + +However, it involved too many late nights, daily flights to our PoPs and of course the major changes required a forklift. A lot of work had to be done at that time, which made me want to push some or most of the work to a 3rd party. + +### Option 2: The managed service solution + +Today, there is a growing need for the managed service approach to SD-WAN. Notably, it simplifies the network design, deployment and maintenance activities while offloading the complexity, in line with what most CIOs are talking about today. + +Managed service provides a number of benefits, such as the elimination of backhauling to centralized cloud connectors or VPN concentrators. Evidently, backhauling is never favored for a network architect. More than often it will result in increased latency, congested links, internet chokepoints, and last-mile outages. + +Managed service can also authenticate mobile users at the local communication hub and not at a centralized point which would increase the latency. So what options are available when considering a managed service? + +### Telcos: An average service level + +Let’s be honest, telcos have a mixed track record and enterprises rely on them with caution. Essentially, you are building a network with 3rd party appliances and services that put the technical expertise outside of the organization. + +Secondly, the telco must orchestrate, monitor and manage numerous technical domains which are likely to introduce further complexity. As a result, troubleshooting requires close coordination with the suppliers which will have an impact on the customer experience. + +### Time equals money + +To resolve a query could easily take two or three attempts. It’s rare that you will get to the right person straight away. This eventually increases the time to resolve problems. Even for a minor feature change, you have to open tickets. Hence, with telcos, it increases the time required to solve a problem. + +In addition, it takes time to make major network changes such as opening new locations, which could take up to 45 days. In the same report mentioned above, 71% of the respondents are frustrated with the telco customer-service-time to resolve the problems, 73% indicated that deploying new locations requires at least 15 days and 47% claimed that “high bandwidth costs” is the biggest frustration while working with telcos. + +When it comes to lead times for projects, an engineer does not care. Does a project manager care if you have an optimum network design? No, many don’t, most just care about the timeframes. During my career, now spanning 18 years, I have never seen comments from any of my contacts saying “you must adhere to your project manager’s timelines”. + +However, out of the experience, the project managers have their ways and lead times do become a big part of your daily job. So as an engineer, 45-day lead time will certainly hit your brand hard, especially if you are an external consultant. + +There is also a problem with bandwidth costs. Telcos need to charge due to their complexity. There is always going to be a series of problems when working with them. Let’s face it, they offer an average service level. + +### Co-management and self-service management + +What is needed is a service that equips with the visibility and control of DIY to managed services. This, ultimately, opens the door to co-management and self-service management. + +Co-management allows both the telco and enterprise to make changes to the WAN. Then we have the self-service management of WAN that allows the enterprises to have sole access over the aspect of their network. + +However, these are just sticking plasters covering up the flaws. We need a managed service that not only connects locations but also synthesizes the site connectivity, along with security, mobile access, and cloud access. + +### Introducing the cloud-native approach to SD-WAN + +There should be a new style of managed services that combines the best of both worlds. It should offer the uptime, predictability and reach of the best telcos along with the cost structure and versatility of cloud providers. All such requirements can be met by what is known as the cloud-native carrier. + +Therefore, we should be looking for a platform that can connect and secure all the users and resources at scale, no matter where they are positioned. Eventually, such a platform will limit the costs and increase the velocity and agility. + +This is what a cloud-native carrier can offer you. You could say it’s a new kind of managed service, which is what enterprises are now looking for. A cloud-native carrier service brings the best of cloud services to the world of networking. This new style of managed service brings to SD-WAN the global reach, self-service, and agility of the cloud with the ability to easily migrate from MPLS. + +In summary, a cloud-native carrier service will improve global connectivity to on-premises and cloud applications, enable secure branch to internet access, and both securely and optimally integrate cloud datacenters. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][4]** + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398476/managed-wan-and-the-cloud-native-sd-wan.html + +作者:[Matt Conran][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/Matt-Conran/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/03/network-wan-100713693-large.jpg +[2]: https://www.networkworld.com/article/2297171/sd-wan/network-security-mpls-explained.html +[3]: https://www.catonetworks.com/news/digital-transformation-survey +[4]: /contributor-network/signup.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From ccc2b005b414eb7800ab66cf2706933805e3ae6d Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 4 Jun 2019 17:34:49 +0800 Subject: [PATCH 0752/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190527=20A=20?= =?UTF-8?q?deeper=20dive=20into=20Linux=20permissions=20sources/tech/20190?= =?UTF-8?q?527=20A=20deeper=20dive=20into=20Linux=20permissions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...27 A deeper dive into Linux permissions.md | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 sources/tech/20190527 A deeper dive into Linux permissions.md diff --git a/sources/tech/20190527 A deeper dive into Linux permissions.md b/sources/tech/20190527 A deeper dive into Linux permissions.md new file mode 100644 index 0000000000..26a132fdf9 --- /dev/null +++ b/sources/tech/20190527 A deeper dive into Linux permissions.md @@ -0,0 +1,172 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A deeper dive into Linux permissions) +[#]: via: (https://www.networkworld.com/article/3397790/a-deeper-dive-into-linux-permissions.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +A deeper dive into Linux permissions +====== +Sometimes you see more than just the ordinary r, w, x and - designations when looking at file permissions on Linux. How can you get a clearer view of what the uncommon charactrers are trying to tell you and how do these permissions work? +![Sandra Henry-Stocker][1] + +Sometimes you see more than just the ordinary **r** , **w** , **x** and **-** designations when looking at file permissions on Linux. Instead of **rwx** for the owner, group and other fields in the permissions string, you might see an **s** or **t** , as in this example: + +``` +drwxrwsrwt +``` + +One way to get a little more clarity on this is to look at the permissions with the **stat** command. The fourth line of stat’s output displays the file permissions both in octal and string format: + +``` +$ stat /var/mail + File: /var/mail + Size: 4096 Blocks: 8 IO Block: 4096 directory +Device: 801h/2049d Inode: 1048833 Links: 2 +Access: (3777/drwxrwsrwt) Uid: ( 0/ root) Gid: ( 8/ mail) +Access: 2019-05-21 19:23:15.769746004 -0400 +Modify: 2019-05-21 19:03:48.226656344 -0400 +Change: 2019-05-21 19:03:48.226656344 -0400 + Birth: - +``` + +This output reminds us that there are more than nine bits assigned to file permissions. In fact, there are 12. And those extra three bits provide a way to assign permissions beyond the usual read, write and execute — 3777 (binary 011111111111), for example, indicates that two extra settings are in use. + +The first **1** (second bit) in this particular value represents the SGID (set group ID) and assigns temporary permission to run the file or use the directory with the permissions of the associated group. + +``` +011111111111 + ^ +``` + +**SGID** gives temporary permissions to the person using the file to act as a member of that group. + +The second **1** (third bit) is the “sticky” bit. It ensures that _only_ the owner of the file is able to delete or rename the file or directory. + +``` +011111111111 + ^ +``` + +Had the permissions been 7777 rather than 3777, we’d have known that the SUID (set UID) field had also been set. + +``` +111111111111 +^ +``` + +**SUID** gives temporary permissions to the user using the file to act as the file owner. + +As for the /var/mail directory which we looked at above, all users require some access so some special values are required to provide it. + +But now let’s take this a step further. + +One of the common uses of the special permission bits is with commands like the **passwd** command. If you look at the /usr/bin/passwd file, you’ll notice that the SUID bit is set, allowing you to change your password (and, thus, the contents of the /etc/shadow file) even when you’re running as an ordinary (not a privileged) user and have no read or write access to this file. Of course, the passwd command is clever enough not to allow you to change other people's passwords unless you are actually running as root or using sudo. + +``` +$ ls -l /usr/bin/passwd +-rwsr-xr-x 1 root root 63736 Mar 22 14:32 /usr/bin/passwd +$ ls -l /etc/shadow +-rw-r----- 1 root shadow 2195 Apr 22 10:46 /etc/shadow +``` + +Now, let’s look at what you can do with the these special permissions. + +### How to assign special file permissions + +As with many things on the Linux command line, you have some choices on how you make your requests. The **chmod** command allows you to change permissions numerically or using character expressions. + +To change file permissions numerically, you might use a command like this to set the setuid and setgid bits: + +``` +$ chmod 6775 tryme +``` + +Or you might use a command like this: + +``` +$ chmod ug+s tryme <== for SUID and SGID permissions +``` + +If the file that you are adding special permissions to is a script, you might be surprised that it doesn’t comply with your expectations. Here’s a very simple example: + +``` +$ cat tryme +#!/bin/bash + +echo I am $USER +``` + +Even with the SUID and SGID bits set and the file root-owned file, running a script like this won’t yield the “I am root” response you might expect. Why? Because Linux ignores the set-user-ID and set-group-ID bits on scripts. + +``` +$ ls -l tryme +-rwsrwsrwt 1 root root 29 May 26 12:22 tryme +$ ./tryme +I am jdoe +``` + +If you try something similar using a compiled program, on the other hand, as with this simple C program, you’ll see a different effect. In this example program, we prompt the user to enter a file and create it for them, giving the file write permission. + +``` +#include + +int main() +{ + FILE *fp; /* file pointer*/ + char fName[20]; + + printf("Enter the name of file to be created: "); + scanf("%s",fName); + + /* create the file with write permission */ + fp=fopen(fName,"w"); + /* check if file was created */ + if(fp==NULL) + { + printf("File not created"); + exit(0); + } + + printf("File created successfully\n"); + return 0; +} +``` + +Once you compile the program and run the commands for both making root the owner and setting the needed permissions, you’ll see that it runs with root authority as expected — leaving a newly created root-owned file. Of course, you must have sudo privileges to run some of the required commands. + +``` +$ cc -o mkfile mkfile.c <== compile the program +$ sudo chown root:root mkfile <== change owner and group to “root” +$ sudo chmod ug+s mkfile <== add SUID and SGID permissions +$ ./mkfile <== run the program +Enter name of file to be create: empty +File created successfully +$ ls -l empty +-rw-rw-r-- 1 root root 0 May 26 13:15 empty +``` + +Notice that the file is owned by root — something that wouldn’t have happened if the program hadn’t run with root authority. + +The positions of the uncommon settings in the permissions string (e.g., rw **s** rw **s** rw **t** ) can help remind us what each bit means. At least the first "s" (SUID) is in the owner-permissions area and the second (SGID) is in the group-permissions area. Why the sticky bit is a "t" instead of an "s" is beyond me. Maybe the founders imagined referring to it as the "tacky bit" and changed their minds due to less flattering second definition of the word. In any case, the extra permissions settings provide a lot of additional functionality to Linux and other Unix systems. + +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/3397790/a-deeper-dive-into-linux-permissions.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/05/shs_rwsr-100797564-large.jpg +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world From f5cd1789304de73a17b32463232f828128da433a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 Jun 2019 00:13:26 +0800 Subject: [PATCH 0753/1154] 20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md part 2 --- ...g Smart Contracts And Its Types -Part 5.md | 63 +++++++++---------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md b/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md index 9e232b3b9b..1f1d0f31b8 100644 --- a/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md +++ b/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md @@ -61,57 +61,56 @@ *由于该领域还在开发中,因此目前所说的任何定义或标准最多只能说是流畅而模糊的。* -### How smart contracts work** +### 智能合约是如何工作的? -To simplify things, let’s proceed by taking an example. +为简化起见,让我们用个例子来说明。 -John and Peter are two individuals debating about the scores in a football match. They have conflicting views about the outcome with both of them supporting different teams (context). Since both of them need to go elsewhere and won’t be able to finish the match then, John bets that team A will beat team B in the match and _offers_ Peter $100 in that case. Peter _considers_ and _accepts_ the bet while making it clear that they are _bound_ to the terms. However, neither of them _trusts_ each other to honour the bet and they don’t have the time nor the money to appoint a _third party_ to oversee the same. +约翰和彼得是两个争论足球比赛得分的人。他们对比赛结果持有相互矛盾的看法,他们都支持不同的团队(这是背景)。由于他们两个都需要去其他地方并且无法看完比赛,所以约翰认为如果 A 队在比赛中击败 B 队,他就*支付*给彼得 100 美元。彼得*考虑*之后*接受*了该赌注,同时明确表示他们必须接受这些条款。但是,他们都没有兑现该赌注的相互信任,也没有时间和钱来指定任命第三方来监督赌注。 -Assuming both John and Peter were to use a smart contract platform such as **[Etherparty][5]** , to automatically settle the bet at the time of the contract negotiation, they’ll both link their blockchain based identities to the contract and set the terms, making it clear that as soon as the match is over, the program will find out who the winning side is and automatically credit the amount to the winners bank account from the losers. As soon as the match ends and media outlets report the same, the program will scour the internet for the prescribed sources, identify which team won, relate it to the terms of the contract, in this case since B won Peter gets the money from John and after intimating both the parties transfers $100 from John’s to Peter’s account. After having executed, the smart contract will terminate and be inactive for all the time to come unless otherwise mentioned. +假设约翰和彼得都使用智能合约平台,例如 [Etherparty][5],它可以在合同谈判时自动结算赌注,他们都会将基于区块链的身份链接到合约,并设置条款,明确表示一旦比赛结束,程序将找出获胜方是谁,并自动将该金额从输家中归入获胜者银行账户。一旦比赛结束并且媒体报道同样的结果,该程序将在互联网上搜索规定的来源,确定哪支球队获胜,将其与合约条款联系起来,在这种情况下,如果 A 队赢了彼得将从约翰获得钱,也就是说将约翰的 100 美元转移到彼得的账户。执行完毕后,除非另有说明,否则智能合约将终止并在所有时间内处于非活动状态。 -The simplicity of the example aside, the situation involved a classic contract (paying attention to the italicized words) and the participants chose to implement the same using a smart contract. All smart contracts basically work on a similar principle, with the program being coded to execute on predefined parameters and spitting out expected outputs only. The outside sources the smart contract consults for information is may a times referred to as the _Oracle_ in the IT world. Oracles are a common part of many smart contract systems worldwide today. +除了示例的简单性,情况涉及到一个经典合同,参与者选择使用智能合约实现了相同目的。所有的智能合约基本上都遵循类似的原则,程序被编码为在预定义的参数上执行,并且只抛出预期的输出。智能合同咨询的外部来源可能有时被称为 IT 世界中的神谕Oracle。神谕是当今全球许多智能合约系统的常见部分。 -The use of a smart contract in this situation allowed the participants the following benefits: +在这种情况下使用智能合约使参与者可以获得以下好处: - * It was faster than getting together and settling the bet manually. - * Removed the issue of trust from the equation. - * Eliminated the need for a trusted third party to handle the settlement on behalf of the parties involved. - * Costed nothing to execute. - * Is secure in how it handles parameters and sensitive data. - * The associated data will remain in the blockchain platform they ran it on permanently and future bets can be placed on by calling the same function and giving it added inputs. - * Gradually over time, assuming John and Peter develop gambling addictions, the program will help them develop reliable statistics to gauge their winning streaks. +* 它比在一起手动结算更快。 +* 从等式中删除了信任问题。 +* 消除了受信任的第三方代表有关各方处理和解的需要。 +* 执行时无需任何费用。 +* 处理参数和敏感数据的方式是安全的。 +* 相关数据将永久保留在他们运行的区块链平台中,未来的投注可以通过调用相同的函数并为其添加输入来进行。 +* 随着时间的推移,假设约翰和彼得赌博成瘾,该程序将帮助他们开发可靠的统计数据来衡量他们的连胜纪录。 +   +现在我们知道**什么是智能合约**和**它们如何工作**,我们还没有解决**为什么我们需要它们**。 + +### 智能合约的需要 + +正如之前的例子我们重点提到过的,出于各种原因,我们需要智能合约。 +#### 透明度 -Now that we know **what smart contracts are** and **how they work** , we’re still yet to address **why we need them**. +所涉及的条款和条件对交易对手来说非常清楚。此外,由于程序或智能合约的执行涉及某些明确的输入,因此用户可以非常直接地验证会影响他们和合约受益人的因素。 -### The need for smart contracts +#### 时间效率高 -As the previous example we visited highlights we need smart contracts for a variety of reasons. +如上所述,智能合约一旦被控制变量或用户调用触发就立即开始工作。由于数据通过区块链和网络中的其它来源即时提供给系统,因此执行不需要任何时间来验证和处理信息并解决交易。例如,转移土地所有权契约,这是一个涉及手工核实大量文书工作并且需要数周时间的过程,可以在几分钟甚至几秒钟内通过智能合约程序来处理文件和相关各方。 -##### **Transparency** +#### 精确 -The terms and conditions involved are very clear to the counterparties. Furthermore, since the execution of the program or the smart contract involves certain explicit inputs, users have a very direct way of verifying the factors that would impact them and the contract beneficiaries. +由于平台基本上只是计算机代码和预定义的内容,因此不存在主观错误,所有结果都是精确的,完全没有人为错误。 -##### Time Efficient +#### 安全 -As mentioned, smart contracts go to work immediately once they’re triggered by a control variable or a user call. Since data is made available to the system instantaneously by the blockchain and from other sources in the network, the execution does not take any time at all to verify and process information and settle the transaction. Transferring land title deeds for instance, a process which involved manual verification of tons of paperwork and takes weeks on normal can be processed in a matter of minutes or even seconds with the help of smart contract programs working to vet the documents and the parties involved. +区块链的一个固有特征是每个数据块都是安全加密的。这意味着为了实现冗余,即使数据存储在网络上的多个节点上,**也只有数据所有者才能访问以查看和使用数据**。类似地,所有过程都将是完全安全和防篡改的,利用区块链在过程中存储重要变量和结果。同样也通过按时间顺序为审计人员提供原始的、未经更改的和不可否认的数据版本,简化了审计和法规事务。 -##### Precision +#### 信任 -Since the platform is basically just computer code and everything predefined, there can be no subjective errors and all the results will be precise and completely free of human errors. +这个文章系列开篇说到区块链为互联网及其上运行的服务增加了急需的信任层。智能合约在任何情况下都不会在执行协议时表现出偏见或主观性,这意味着所涉及的各方对结果完全有约束力,并且可以不附带任何条件地信任该系统。这也意味着此处不需要具有重要价值的传统合同中所需的“可信第三方”。当事人之间的犯规和监督将成为过去的问题。 -##### Safety +#### 成本效益 -An inherent feature of the blockchain is that every block of data is cryptographically encrypted. Meaning even though the data is stored on a multitude of nodes on the network for redundancy, **only the owner of the data has access to see and use the data**. Similarly, all process will be completely secure and tamper proof with the execution utilizing the blockchain for storing important variables and outcomes in the process. The same also simplifies auditing and regulatory affairs by providing auditors with a native, un-changed and non-repudiable version of the data chronologically. - -##### Trust - -The article series started by saying that blockchain adds a much-needed layer of trust to the internet and the services that run on it. The fact that smart contracts will under no circumstances show bias or subjectivity in executing the agreement means that parties involved are fully bound the outcomes and can trust the system with no strings attached. This also means that the **“trusted third-party”** required in conventional contracts of significant value is not required here. Foul play between the parties involved and oversight will be issues of the past. - -##### Cost effective - -As highlighted in the example, utilizing a smart contract involves minimal costs. Enterprises usually have administrative staff who work exclusively for making that transactions they undertake are legitimate and comply with regulations. If the deal involved multiple parties, duplication of the effort is unavoidable. Smart contracts essentially make the former irrelevant and duplication is eliminated since both the parties can simultaneously have their due diligence done. +如示例中所强调的,使用智能合约涉及最低成本。企业通常有专门从事使其交易是合法的并遵守法规的行政人员。如果交易涉及多方,则重复工作是不可避免的。智能合约基本上使前者无关紧要,并且消除了重复,因为双方可以同时完成尽职调查。 ### Applications of Smart Contracts From 4d03723469d782635266bac074f94d6078d55776 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 Jun 2019 00:39:50 +0800 Subject: [PATCH 0754/1154] PRF:20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md @jdh8383 --- ...tes On Red Hat (RHEL) And CentOS System.md | 72 +++++++++---------- 1 file changed, 32 insertions(+), 40 deletions(-) diff --git a/translated/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md b/translated/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md index bddf3eebaf..5c0124d970 100644 --- a/translated/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md +++ b/translated/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) -[#]: translator: ( jdh8383 ) -[#]: reviewer: ( ) +[#]: translator: (jdh8383) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Check Available Security Updates On Red Hat (RHEL) And CentOS System?) @@ -10,35 +10,29 @@ 如何在 CentOS 或 RHEL 系统上检查可用的安全更新? ====== -当你更新系统时,根据你所在公司的安全策略,有时候可能只需要打上与安全相关的补丁。 +![](https://img.linux.net.cn/data/attachment/album/201906/05/003907tljfmy4bnn4qj1tp.jpg) -大多数情况下,这应该是出于程序兼容性方面的考量。 +当你更新系统时,根据你所在公司的安全策略,有时候可能只需要打上与安全相关的补丁。大多数情况下,这应该是出于程序兼容性方面的考量。那该怎样实践呢?有没有办法让 `yum` 只安装安全补丁呢? -那该怎样实践呢?有没有办法让 yum 只安装安全补丁呢? +答案是肯定的,可以用 `yum` 包管理器轻松实现。 -答案是肯定的,可以用 yum 包管理器轻松实现。 +在这篇文章中,我们不但会提供所需的信息。而且,我们会介绍一些额外的命令,可以帮你获取指定安全更新的详实信息。 -在这篇文章中,我们不但会提供所需的信息。 +希望这样可以启发你去了解并修复你列表上的那些漏洞。一旦有安全漏洞被公布,就必须更新受影响的软件,这样可以降低系统中的安全风险。 -而且,我们会介绍一些额外的命令,可以帮你获取指定安全更新的详实信息。 - -希望这样可以启发你去了解并修复你列表上的那些漏洞。 - -一旦有安全漏洞被公布,就必须更新受影响的软件,这样可以降低系统中的安全风险。 - -对于 RHEL 或 CentOS 6 系统,运行下面的 **[Yum 命令][1]** 来安装 yum 安全插件。 +对于 RHEL 或 CentOS 6 系统,运行下面的 [Yum 命令][1] 来安装 yum 安全插件。 ``` # yum -y install yum-plugin-security ``` -在 RHEL 7&8 或是 CentOS 7&8 上面,这个插件已经是 yum 的一部分了,不用单独安装。 +在 RHEL 7&8 或是 CentOS 7&8 上面,这个插件已经是 `yum` 的一部分了,不用单独安装。 -只列出全部可用的补丁(包括安全,Bug 修复以及产品改进),但不安装它们。 +要列出全部可用的补丁(包括安全、Bug 修复以及产品改进),但不安装它们: ``` # yum updateinfo list available -已加载插件: changelog, package_upload, product-id, search-disabled-repos, +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, : subscription-manager, verify, versionlock RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 @@ -54,20 +48,18 @@ RHBA-2016:1048 bugfix 389-ds-base-1.3.4.0-30.el7_2.x86_64 RHBA-2016:1298 bugfix 389-ds-base-1.3.4.0-32.el7_2.x86_64 ``` -要统计补丁的大约数量,运行下面的命令。 +要统计补丁的大约数量,运行下面的命令: ``` # yum updateinfo list available | wc -l 11269 ``` -想列出全部可用的安全补丁但不安装。 - -以下命令用来展示你系统里已安装和待安装的推荐补丁。 +想列出全部可用的安全补丁但不安装,以下命令用来展示你系统里已安装和待安装的推荐补丁: ``` # yum updateinfo list security all -已加载插件: changelog, package_upload, product-id, search-disabled-repos, +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, : subscription-manager, verify, versionlock RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 @@ -81,13 +73,13 @@ RHBA-2016:1298 bugfix 389-ds-base-1.3.4.0-32.el7_2.x86_64 RHSA-2018:1380 Important/Sec. 389-ds-base-1.3.7.5-21.el7_5.x86_64 RHSA-2018:2757 Moderate/Sec. 389-ds-base-1.3.7.5-28.el7_5.x86_64 RHSA-2018:3127 Moderate/Sec. 389-ds-base-1.3.8.4-15.el7.x86_64 - i RHSA-2014:1031 Important/Sec. 389-ds-base-libs-1.3.1.6-26.el7_0.x86_64 + RHSA-2014:1031 Important/Sec. 389-ds-base-libs-1.3.1.6-26.el7_0.x86_64 ``` -要显示所有待安装的安全补丁。 +要显示所有待安装的安全补丁: ``` -# yum updateinfo list security all | egrep -v "^i" +# yum updateinfo list security all | grep -v "i" RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 @@ -102,14 +94,14 @@ RHBA-2016:1298 bugfix 389-ds-base-1.3.4.0-32.el7_2.x86_64 RHSA-2018:2757 Moderate/Sec. 389-ds-base-1.3.7.5-28.el7_5.x86_64 ``` -要统计全部安全补丁的大致数量,运行下面的命令。 +要统计全部安全补丁的大致数量,运行下面的命令: ``` # yum updateinfo list security all | wc -l 3522 ``` -下面根据已装软件列出可更新的安全补丁。这包括 bugzillas(bug修复),CVEs(知名漏洞数据库),安全更新等。 +下面根据已装软件列出可更新的安全补丁。这包括 bugzilla(bug 修复)、CVE(知名漏洞数据库)、安全更新等: ``` # yum updateinfo list security @@ -118,7 +110,7 @@ RHBA-2016:1298 bugfix 389-ds-base-1.3.4.0-32.el7_2.x86_64 # yum updateinfo list sec -已加载插件: changelog, package_upload, product-id, search-disabled-repos, +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, : subscription-manager, verify, versionlock RHSA-2018:3665 Important/Sec. NetworkManager-1:1.12.0-8.el7_6.x86_64 @@ -134,11 +126,11 @@ RHSA-2018:3665 Important/Sec. NetworkManager-wifi-1:1.12.0-8.el7_6.x86_64 RHSA-2018:3665 Important/Sec. NetworkManager-wwan-1:1.12.0-8.el7_6.x86_64 ``` -显示所有与安全相关的更新,并且返回一个结果来告诉你是否有可用的补丁。 +显示所有与安全相关的更新,并且返回一个结果来告诉你是否有可用的补丁: ``` # yum --security check-update -已加载插件: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock rhel-7-server-rpms | 2.0 kB 00:00:00 --> policycoreutils-devel-2.2.5-20.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo) --> smc-raghumalayalam-fonts-6.0-7.el7.noarch from rhel-7-server-rpms excluded (updateinfo) @@ -162,7 +154,7 @@ NetworkManager-libnm.x86_64 1:1.12.0-10.el7_6 rhel-7 NetworkManager-ppp.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms ``` -列出所有可用的安全补丁,并且显示其详细信息。 +列出所有可用的安全补丁,并且显示其详细信息: ``` # yum info-sec @@ -196,12 +188,12 @@ Description : The tzdata packages contain data files with rules for various Severity : None ``` -如果你想要知道某个更新的具体内容,可以运行下面这个命令。 +如果你想要知道某个更新的具体内容,可以运行下面这个命令: ``` # yum updateinfo RHSA-2019:0163 -已加载插件: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock rhel-7-server-rpms | 2.0 kB 00:00:00 =============================================================================== Important: kernel security, bug fix, and enhancement update @@ -243,12 +235,12 @@ Description : The kernel packages contain the Linux kernel, the core of any updateinfo info done ``` -跟之前类似,你可以只查询那些通过 CVE 释出的系统漏洞。 +跟之前类似,你可以只查询那些通过 CVE 释出的系统漏洞: ``` # yum updateinfo list cves -已加载插件: changelog, package_upload, product-id, search-disabled-repos, +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, : subscription-manager, verify, versionlock CVE-2018-15688 Important/Sec. NetworkManager-1:1.12.0-8.el7_6.x86_64 CVE-2018-15688 Important/Sec. NetworkManager-adsl-1:1.12.0-8.el7_6.x86_64 @@ -260,12 +252,12 @@ CVE-2018-15688 Important/Sec. NetworkManager-ppp-1:1.12.0-8.el7_6.x86_64 CVE-2018-15688 Important/Sec. NetworkManager-team-1:1.12.0-8.el7_6.x86_64 ``` -你也可以查看那些跟 bug 修复相关的更新,运行下面的命令。 +你也可以查看那些跟 bug 修复相关的更新,运行下面的命令: ``` # yum updateinfo list bugfix | less -已加载插件: changelog, package_upload, product-id, search-disabled-repos, +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, : subscription-manager, verify, versionlock RHBA-2018:3349 bugfix NetworkManager-1:1.12.0-7.el7_6.x86_64 RHBA-2019:0519 bugfix NetworkManager-1:1.12.0-10.el7_6.x86_64 @@ -277,11 +269,11 @@ RHBA-2018:3349 bugfix NetworkManager-config-server-1:1.12.0-7.el7_6.noarch RHBA-2019:0519 bugfix NetworkManager-config-server-1:1.12.0-10.el7_6.noarch ``` -要想得到待安装更新的摘要信息,运行这个。 +要想得到待安装更新的摘要信息,运行这个: ``` # yum updateinfo summary -已加载插件: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock rhel-7-server-rpms | 2.0 kB 00:00:00 Updates Information Summary: updates 13 Security notice(s) @@ -311,7 +303,7 @@ via: https://www.2daygeek.com/check-list-view-find-available-security-updates-on 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[jdh8383](https://github.com/jdh8383) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 08faf49243703b7ec18fcb146c3d0bc652f88e7e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 Jun 2019 00:40:26 +0800 Subject: [PATCH 0755/1154] PUB:20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md @jdh8383 https://linux.cn/article-10938-1.html --- ...le Security Updates On Red Hat (RHEL) And CentOS System.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md (99%) diff --git a/translated/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md b/published/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md similarity index 99% rename from translated/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md rename to published/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md index 5c0124d970..e853c92615 100644 --- a/translated/tech/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md +++ b/published/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (jdh8383) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10938-1.html) [#]: subject: (How To Check Available Security Updates On Red Hat (RHEL) And CentOS System?) [#]: via: (https://www.2daygeek.com/check-list-view-find-available-security-updates-on-redhat-rhel-centos-system/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 875a03a8aa622cf67edfa09647a60854ed8b2b98 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 Jun 2019 00:56:15 +0800 Subject: [PATCH 0756/1154] PRF:20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md @tomjlw --- ...ulate matter sensor with a Raspberry Pi.md | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md b/translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md index 4d3f128133..474e10d1f9 100644 --- a/translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md +++ b/translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to build a mobile particulate matter sensor with a Raspberry Pi) @@ -10,19 +10,19 @@ 如何用树莓派搭建一个颗粒物传感器 ====== -用树莓派,一个廉价的传感器和一个便宜的屏幕监测空气质量 +> 用树莓派、一个廉价的传感器和一个便宜的屏幕监测空气质量。 -![小组交流,讨论][1] +![](https://img.linux.net.cn/data/attachment/album/201906/05/005121bbveeavwgyc1i1gk.jpg) -大约一年前,我写了一篇关于如何使用树莓派和廉价传感器测量[空气质量][2]的文章。我们这几年已在学校里和私下使用了这个项目。然而它有一个缺点:由于它基于无线/有线网,因此它不是便携的。如果你的树莓派,你的智能手机和电脑不在同一个网络的话,你甚至都不能访问传感器测量的数据。 +大约一年前,我写了一篇关于如何使用树莓派和廉价传感器测量[空气质量][2]的文章。我们这几年已在学校里和私下使用了这个项目。然而它有一个缺点:由于它基于无线/有线网,因此它不是便携的。如果你的树莓派、你的智能手机和电脑不在同一个网络的话,你甚至都不能访问传感器测量的数据。 为了弥补这一缺陷,我们给树莓派添加了一块小屏幕,这样我们就可以直接从该设备上读取数据。以下是我们如何为我们的移动细颗粒物传感器搭建并配置好屏幕。 ### 为树莓派搭建好屏幕 -在[亚马逊][3],阿里巴巴以及其它来源有许多可以获取的树莓派屏幕,从 ePaper 屏幕到可触控 LCD。我们选择了一个便宜的带触控功能且分辨率为320*480像素的[3.5英寸 LCD][3],可以直接插进树莓派的 GPIO 引脚。一个3.5英寸屏幕和树莓派几乎一样大,这一点不错。 +在[亚马逊][3]、阿里巴巴以及其它来源有许多可以买到的树莓派屏幕,从 ePaper 屏幕到可触控 LCD。我们选择了一个便宜的带触控功能且分辨率为 320*480 像素的[3.5英寸 LCD][3],可以直接插进树莓派的 GPIO 引脚。3.5 英寸屏幕和树莓派几乎一样大,这一点不错。 -当你第一次启动屏幕打开树莓派的时候,因为缺少驱动屏幕会保持白屏。你得首先为屏幕安装[合适的驱动][5]。通过 SSH 登入并执行以下命令: +当你第一次启动屏幕打开树莓派的时候,会因为缺少驱动屏幕会保持白屏。你得首先为屏幕安装[合适的驱动][5]。通过 SSH 登入并执行以下命令: ``` $ rm -rf LCD-show @@ -55,22 +55,21 @@ $ sudo apt install raspberrypi-ui-mods $ sudo apt install chromium-browser ``` -需要自动登录以使测量数据在启动后直接显示;否则你将只会看到登录界面。然而自动登录并没有为树莓派用户默认设置好。你可以用 **raspi-config** 工具设置自动登录: +需要自动登录以使测量数据在启动后直接显示;否则你将只会看到登录界面。然而树莓派用户并没有默认设置好自动登录。你可以用 `raspi-config` 工具设置自动登录: ``` $ sudo raspi-config ``` -在菜单中,选择:**3 Boot Options → B1 Desktop / CLI → B4 Desktop Autologin**。 +在菜单中,选择:“3 Boot Options → B1 Desktop / CLI → B4 Desktop Autologin”。 -在启动后用 Chromium 打开我们的网站这块少了一步。创建文件夹 -**/home/pi/.config/lxsession/LXDE-pi/**: +在启动后用 Chromium 打开我们的网站这块少了一步。创建文件夹 `/home/pi/.config/lxsession/LXDE-pi/`: ``` $ mkdir -p /home/pi/config/lxsession/LXDE-pi/ ``` -然后在该文件夹里创建 **autostart** 文件: +然后在该文件夹里创建 `autostart` 文件: ``` $ nano /home/pi/.config/lxsession/LXDE-pi/autostart @@ -88,7 +87,7 @@ $ nano /home/pi/.config/lxsession/LXDE-pi/autostart @chromium-browser --incognito --kiosk ``` -如果你想要隐藏鼠标指针,你得安装 **unclutter** 包并移除 **autostart** 文件开头的注释。 +如果你想要隐藏鼠标指针,你得安装 `unclutter` 包并移除 `autostart` 文件开头的注释。 ``` $ sudo apt install unclutter @@ -98,11 +97,11 @@ $ sudo apt install unclutter 我对去年的代码做了些小修改。因此如果你之前搭建过空气质量项目,确保用[原文章][2]中的指导为 AQI 网站重新下载脚本和文件。 -通过添加触摸屏,你现在拥有了一个移动颗粒物传感器!我们在学校用它来检查教室里的空气质量或者进行比较测量。使用这种配置,你无需再依赖网络连接或 WLAN。你可以在任何地方使用小型测量站——你甚至可以使用移动电源以摆脱电网。 +通过添加触摸屏,你现在拥有了一个便携的颗粒物传感器!我们在学校用它来检查教室里的空气质量或者进行比较测量。使用这种配置,你无需再依赖网络连接或 WLAN。你可以在任何地方使用这个小型测量站——你甚至可以使用移动电源以摆脱电网。 * * * -_这篇文章原来在[开源学校解决方案(Open Scool Solutions)][8]上发表,获得许可重新发布。_ +这篇文章原来在[开源学校解决方案][8]Open Scool Solutions上发表,获得许可重新发布。 -------------------------------------------------------------------------------- @@ -111,18 +110,18 @@ via: https://opensource.com/article/19/3/mobile-particulate-matter-sensor 作者:[Stephan Tetzel][a] 选题:[lujun9972][b] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/stephan [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) -[2]: https://opensource.com/article/18/3/how-measure-particulate-matter-raspberry-pi +[2]: https://linux.cn/article-9620-1.html [3]: https://www.amazon.com/gp/search/ref=as_li_qf_sp_sr_tl?ie=UTF8&tag=openschoolsol-20&keywords=lcd%20raspberry&index=aps&camp=1789&creative=9325&linkCode=ur2&linkId=51d6d7676e10d6c7db203c4a8b3b529a [4]: https://amzn.to/2CcvgpC [5]: https://github.com/goodtft/LCD-show -[6]: https://opensource.com/article/17/1/try-raspberry-pis-pixel-os-your-pc +[6]: https://linux.cn/article-8459-1.html [7]: https://opensource.com/sites/default/files/uploads/mobile-aqi-sensor.jpg (Mobile particulate matter sensor) [8]: https://openschoolsolutions.org/mobile-particulate-matter-sensor/ From 06ad0f8745b2774519da6027f325c2b0e33a3409 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 Jun 2019 00:56:52 +0800 Subject: [PATCH 0757/1154] PUB:20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md @tomjlw https://linux.cn/article-10939-1.html --- ... a mobile particulate matter sensor with a Raspberry Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md (98%) diff --git a/translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md b/published/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md similarity index 98% rename from translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md rename to published/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md index 474e10d1f9..587c69b785 100644 --- a/translated/tech/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md +++ b/published/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10939-1.html) [#]: subject: (How to build a mobile particulate matter sensor with a Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/mobile-particulate-matter-sensor) [#]: author: (Stephan Tetzel https://opensource.com/users/stephan) From fe1b54c124b4ec3a7b4423f30393a8483454ca8c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 Jun 2019 01:37:15 +0800 Subject: [PATCH 0758/1154] PRF:20190520 Getting Started With Docker.md @zhang5788 --- .../20190520 Getting Started With Docker.md | 210 ++++++++---------- 1 file changed, 98 insertions(+), 112 deletions(-) diff --git a/translated/tech/20190520 Getting Started With Docker.md b/translated/tech/20190520 Getting Started With Docker.md index f745962bdd..be490ae974 100644 --- a/translated/tech/20190520 Getting Started With Docker.md +++ b/translated/tech/20190520 Getting Started With Docker.md @@ -1,98 +1,98 @@ [#]: collector: "lujun9972" [#]: translator: "zhang5788" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "Getting Started With Docker" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Getting Started With Docker" [#]: via: "https://www.ostechnix.com/getting-started-with-docker/" -[#]: author: "sk https://www.ostechnix.com/author/sk/" +[#]: author: "sk https://www.ostechnix.com/author/sk/" Docker 入门指南 ====== ![Getting Started With Docker][1] -在我们的上一个教程中,我们已经了解[**如何在ubuntu上安装Docker**][1],和如何在[**CentOS上安装Docker**][2]。今天,我们将会了解Docker的一些基础用法。该教程包含了如何创建一个新的docker容器,如何运行该容器,如何从现有的docker容器中创建自己的Docker镜像等Docker 的一些基础知识,操作。所有步骤均在Ubuntu 18.04 LTS server 版本下测试通过。 +在我们的上一个教程中,我们已经了解[如何在ubuntu上安装Docker][1],和如何在[CentOS上安装Docker][2]。今天,我们将会了解 Docker 的一些基础用法。该教程包含了如何创建一个新的 Docker 容器,如何运行该容器,如何从现有的 Docker 容器中创建自己的 Docker 镜像等 Docker 的一些基础知识、操作。所有步骤均在 Ubuntu 18.04 LTS server 版本下测试通过。 ### 入门指南 -在开始指南之前,不要混淆Docker镜像和Docker容器这两个概念。在之前的教程中,我就解释过,Docker镜像是决定Docker容器行为的一个文件,Docker容器则是Docker镜像的运行态或停止态。(译者注:在`macOS`下使用docker终端时,不需要加`sudo`) +在开始指南之前,不要混淆 Docker 镜像和 Docker 容器这两个概念。在之前的教程中,我就解释过,Docker 镜像是决定 Docker 容器行为的一个文件,Docker 容器则是 Docker 镜像的运行态或停止态。(LCTT 译注:在 macOS 下使用 Docker 终端时,不需要加 `sudo`) -##### 1. 搜索Docker镜像 +#### 1、搜索 Docker 镜像 -我们可以从Docker的仓库中获取镜像,例如[**Docker hub**][3], 或者自己创建镜像。这里解释一下,`Docker hub`是一个云服务器,用来提供给Docker的用户们,创建,测试,和保存他们的镜像。 +我们可以从 Docker 仓库中获取镜像,例如 [Docker hub][3],或者自己创建镜像。这里解释一下,Docker hub 是一个云服务器,用来提供给 Docker 的用户们创建、测试,和保存他们的镜像。 -`Docker hub`拥有成千上万个Docker 的镜像文件。你可以在这里搜索任何你想要的镜像,通过`docker search`命令。 +Docker hub 拥有成千上万个 Docker 镜像文件。你可以通过 `docker search`命令在这里搜索任何你想要的镜像。 -例如,搜索一个基于ubuntu的镜像文件,只需要运行: +例如,搜索一个基于 Ubuntu 的镜像文件,只需要运行: ```shell $ sudo docker search ubuntu ``` -**Sample output:** +示例输出: ![][5] -搜索基于CentOS的镜像,运行: +搜索基于 CentOS 的镜像,运行: ```shell -$ sudo docker search ubuntu +$ sudo docker search centos ``` -搜索AWS的镜像,运行: +搜索 AWS 的镜像,运行: ```shell $ sudo docker search aws ``` -搜索`wordpress`的镜像: +搜索 WordPress 的镜像: ```shell $ sudo docker search wordpress ``` -`Docker hub`拥有几乎所有种类的镜像,包含操作系统,程序和其他任意的类型,这些你都能在`docker hub`上找到已经构建完的镜像。如果你在搜索时,无法找到你想要的镜像文件,你也可以自己构建一个,将其发布出去,或者仅供你自己使用。 +Docker hub 拥有几乎所有种类的镜像,包含操作系统、程序和其他任意的类型,这些你都能在 Docker hub 上找到已经构建完的镜像。如果你在搜索时,无法找到你想要的镜像文件,你也可以自己构建一个,将其发布出去,或者仅供你自己使用。 -##### 2. 下载Docker 镜像 +#### 2、下载 Docker 镜像 -下载`ubuntu`的镜像,你需要在终端运行以下命令: +下载 Ubuntu 的镜像,你需要在终端运行以下命令: ```shell $ sudo docker pull ubuntu ``` -这条命令将会从**Docker hub**下载最近一个版本的ubuntu镜像文件。 +这条命令将会从 Docker hub 下载最近一个版本的 Ubuntu 镜像文件。 -**Sample output:** +示例输出: -> ```shell -> Using default tag: latest -> latest: Pulling from library/ubuntu -> 6abc03819f3e: Pull complete -> 05731e63f211: Pull complete -> 0bd67c50d6be: Pull complete -> Digest: sha256:f08638ec7ddc90065187e7eabdfac3c96e5ff0f6b2f1762cf31a4f49b53000a5 -> Status: Downloaded newer image for ubuntu:latest -> ``` +``` +Using default tag: latest +latest: Pulling from library/ubuntu +6abc03819f3e: Pull complete +05731e63f211: Pull complete +0bd67c50d6be: Pull complete +Digest: sha256:f08638ec7ddc90065187e7eabdfac3c96e5ff0f6b2f1762cf31a4f49b53000a5 +Status: Downloaded newer image for ubuntu:latest +``` -![下载docker 镜像][6] +![下载 Docker 镜像][6] -你也可以下载指定版本的ubuntu镜像。运行以下命令: +你也可以下载指定版本的 Ubuntu 镜像。运行以下命令: ```shell $ docker pull ubuntu:18.04 ``` -Dokcer允许在任意的宿主机操作系统下,下载任意的镜像文件,并运行。 +Docker 允许在任意的宿主机操作系统下,下载任意的镜像文件,并运行。 -例如,下载CentOS镜像: +例如,下载 CentOS 镜像: ```shell $ sudo docker pull centos ``` -所有下载的镜像文件,都被保存在`/var/lib/docker`文件夹下。(译者注:不同操作系统存放的文件夹并不是一致的,具体存放位置请在官方查询) +所有下载的镜像文件,都被保存在 `/var/lib/docker` 文件夹下。(LCTT 译注:不同操作系统存放的文件夹并不是一致的,具体存放位置请在官方查询) 查看已经下载的镜像列表,可以使用以下命令: @@ -100,7 +100,7 @@ $ sudo docker pull centos $ sudo docker images ``` -**输出为:** +示例输出: ```shell REPOSITORY TAG IMAGE ID CREATED SIZE @@ -109,17 +109,17 @@ centos latest 9f38484d220f 2 months ago hello-world latest fce289e99eb9 4 months ago 1.84kB ``` -正如你看到的那样,我已经下载了三个镜像文件:**ubuntu**, **CentOS**和**Hello-world**. +正如你看到的那样,我已经下载了三个镜像文件:`ubuntu`、`centos` 和 `hello-world`。 现在,让我们继续,来看一下如何运行我们刚刚下载的镜像。 -##### 3. 运行Docker镜像 +#### 3、运行 Docker 镜像 -运行一个容器有两种方法。我们可以使用`TAG`或者是`镜像ID`。`TAG`指的是特定的镜像快照。`镜像ID`是指镜像的唯一标识。 +运行一个容器有两种方法。我们可以使用标签或者是镜像 ID。标签指的是特定的镜像快照。镜像 ID 是指镜像的唯一标识。 -正如上面结果中显示,`latest`是所有镜像的一个标签。**7698f282e524**是Ubuntu docker 镜像的`镜像ID`,**9f38484d220f**是CentOS镜像的`镜像ID`,**fce289e99eb9**是hello_world镜像的`镜像ID`。 +正如上面结果中显示,`latest` 是所有镜像的一个标签。`7698f282e524` 是 Ubuntu Docker 镜像的镜像 ID,`9f38484d220f`是 CentOS 镜像的镜像 ID,`fce289e99eb9` 是 hello_world 镜像的 镜像 ID。 -下载完Docker镜像之后,你可以通过下面的命令来使用`TAG`的方式启动: +下载完 Docker 镜像之后,你可以通过下面的命令来使用其标签来启动: ```shell $ sudo docker run -t -i ubuntu:latest /bin/bash @@ -127,12 +127,12 @@ $ sudo docker run -t -i ubuntu:latest /bin/bash 在这条语句中: -* **-t**: 在该容器中启动一个新的终端 -* **-i**: 通过容器中的标准输入流建立交互式连接 -* **ubuntu:latest**:带有标签`latest`的ubuntu容器 -* **/bin/bash** : 在新的容器中启动`BASH Shell` +* `-t`:在该容器中启动一个新的终端 +* `-i`:通过容器中的标准输入流建立交互式连接 +* `ubuntu:latest`:带有标签 `latest` 的 Ubuntu 容器 +* `/bin/bash`:在新的容器中启动 BASH Shell -或者,你可以通过`镜像ID`来启动新的容器: +或者,你可以通过镜像 ID 来启动新的容器: ```shell $ sudo docker run -t -i 7698f282e524 /bin/bash @@ -140,15 +140,15 @@ $ sudo docker run -t -i 7698f282e524 /bin/bash 在这条语句里: -* **7698f282e524** —`镜像ID` +* `7698f282e524` — 镜像 ID -在启动容器之后,将会自动进入容器的`shell`中(注意看命令行的提示符)。 +在启动容器之后,将会自动进入容器的 shell 中(注意看命令行的提示符)。 ![][7] -Docker 容器的`Shell` +*Docker 容器的 Shell* -如果想要退回到宿主机的终端(在这个例子中,对我来说,就是退回到18.04 LTS),并且不中断该容器的执行,你可以按下`CTRL+P `,再按下`CTRL+Q`。现在,你就安全的返回到了你的宿主机系统中。需要注意的是,docker 容器仍然在后台运行,我们并没有中断它。 +如果想要退回到宿主机的终端(在这个例子中,对我来说,就是退回到 18.04 LTS),并且不中断该容器的执行,你可以按下 `CTRL+P`,再按下 `CTRL+Q`。现在,你就安全的返回到了你的宿主机系统中。需要注意的是,Docker 容器仍然在后台运行,我们并没有中断它。 可以通过下面的命令来查看正在运行的容器: @@ -156,7 +156,7 @@ Docker 容器的`Shell` $ sudo docker ps ``` -**Sample output:** +示例输出: ```shell CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES @@ -165,14 +165,14 @@ CONTAINER ID IMAGE COMMAND CREATED ![][8] -列出正在运行的容器 +*列出正在运行的容器* -可以看到: +可以看到: -* **32fc32ad0d54** – `容器 ID` -* **ubuntu:latest** – Docker 镜像 +* `32fc32ad0d54` – 容器 ID +* `ubuntu:latest` – Docker 镜像 -需要注意的是,**`容器ID`和Docker `镜像ID`是不同的** +需要注意的是,容器 ID 和 Docker 的镜像 ID是不同的。 可以通过以下命令查看所有正在运行和停止运行的容器: @@ -192,13 +192,13 @@ $ sudo docker stop $ sudo docker stop 32fc32ad0d54 ``` -如果想要进入正在运行的容器中,你只需要运行 +如果想要进入正在运行的容器中,你只需要运行: ```shell $ sudo docker attach 32fc32ad0d54 ``` -正如你看到的,**32fc32ad0d54**是一个容器的ID。当你在容器中想要退出时,只需要在容器内的终端中输入命令: +正如你看到的,`32fc32ad0d54` 是一个容器的 ID。当你在容器中想要退出时,只需要在容器内的终端中输入命令: ```shell # exit @@ -210,46 +210,44 @@ $ sudo docker attach 32fc32ad0d54 $ sudo docker ps ``` -##### 4. 构建自己的Docker镜像 +#### 4、构建自己的 Docker 镜像 -Docker不仅仅可以下载运行在线的容器,你也可以创建你的自己的容器。 +Docker 不仅仅可以下载运行在线的容器,你也可以创建你的自己的容器。 -想要创建自己的Docker镜像,你需要先运行一个你已经下载完的容器: +想要创建自己的 Docker 镜像,你需要先运行一个你已经下载完的容器: ```shell $ sudo docker run -t -i ubuntu:latest /bin/bash ``` -现在,你运行了一个容器,并且进入了该容器。 +现在,你运行了一个容器,并且进入了该容器。然后,在该容器安装任意一个软件或做任何你想做的事情。 -然后,在该容器安装任意一个软件或做任何你想做的事情。 +例如,我们在容器中安装一个 Apache web 服务器。 -例如,我们在容器中安装一个**Apache web 服务器**。 - -当你完成所有的操作,安装完所有的软件之后,你可以执行以下的命令来构建你自己的Docker镜像: +当你完成所有的操作,安装完所有的软件之后,你可以执行以下的命令来构建你自己的 Docker 镜像: ```shell # apt update # apt install apache2 ``` -同样的,安装和测试所有的你想要安装的软件在容器中。 +同样的,在容器中安装和测试你想要安装的所有软件。 -当你安装完毕之后,返回的宿主机的终端。记住,不要关闭容器。想要返回到宿主机的host而不中断容器。请按下CTRL+P ,再按下CTRL+Q。 +当你安装完毕之后,返回的宿主机的终端。记住,不要关闭容器。想要返回到宿主机而不中断容器。请按下`CTRL+P`,再按下 `CTRL+Q`。 -从你的宿主机的终端中,运行以下命令如寻找容器的ID: +从你的宿主机的终端中,运行以下命令如寻找容器的 ID: ```shell $ sudo docker ps ``` -最后,从一个正在运行的容器中创建Docker镜像: +最后,从一个正在运行的容器中创建 Docker 镜像: ```shell $ sudo docker commit 3d24b3de0bfc ostechnix/ubuntu_apache ``` -**输出为:** +示例输出: ```shell sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 @@ -257,17 +255,17 @@ sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 在这里: -* **3d24b3de0bfc** — 指ubuntu容器的ID。 -* **ostechnix** — 我们创建的的名称 -* **ubuntu_apache** — 我们创建的镜像 +* `3d24b3de0bfc` — 指 Ubuntu 容器的 ID。 +* `ostechnix` — 我们创建的容器的用户名称 +* `ubuntu_apache` — 我们创建的镜像 -让我们检查一下我们新创建的docker镜像 +让我们检查一下我们新创建的 Docker 镜像: ```shell $ sudo docker images ``` -**输出为:** +示例输出: ```shell REPOSITORY TAG IMAGE ID CREATED SIZE @@ -279,7 +277,7 @@ hello-world latest fce289e99eb9 4 months ago ![][9] -列出所有的docker镜像 +*列出所有的 Docker 镜像* 正如你看到的,这个新的镜像就是我们刚刚在本地系统上从运行的容器上创建的。 @@ -289,9 +287,9 @@ hello-world latest fce289e99eb9 4 months ago $ sudo docker run -t -i ostechnix/ubuntu_apache /bin/bash ``` -##### 5. 移除容器 +#### 5、删除容器 -如果你在docker上的工作已经全部完成,你就可以删除哪些你不需要的容器。 +如果你在 Docker 上的工作已经全部完成,你就可以删除那些你不需要的容器。 想要删除一个容器,首先,你需要停止该容器。 @@ -301,14 +299,14 @@ $ sudo docker run -t -i ostechnix/ubuntu_apache /bin/bash $ sudo docker ps ``` -**输出为:** +示例输出: ```shell CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3d24b3de0bfc ubuntu:latest "/bin/bash" 28 minutes ago Up 28 minutes goofy_easley ``` -使用`容器ID`来停止该容器: +使用容器 ID 来停止该容器: ```shell $ sudo docker stop 3d24b3de0bfc @@ -328,7 +326,7 @@ $ sudo docker rm 3d24b3de0bfc $ sudo docker container prune ``` -按下"**Y**",来确认你的操作 +按下 `Y`,来确认你的操作: ```sehll WARNING! This will remove all stopped containers. @@ -340,11 +338,11 @@ Deleted Containers: Total reclaimed space: 5B ``` -这个命令仅支持最新的docker。(译者注:仅支持1.25及以上版本的Docker) +这个命令仅支持最新的 Docker。(LCTT 译注:仅支持 1.25 及以上版本的 Docker) -##### 6. 删除Docker镜像 +#### 6、删除 Docker 镜像 -当你移除完不要的Docker容器后,你也可以删除你不需要的Docker镜像。 +当你删除了不要的 Docker 容器后,你也可以删除你不需要的 Docker 镜像。 列出已经下载的镜像: @@ -352,7 +350,7 @@ Total reclaimed space: 5B $ sudo docker images ``` -**输出为:** +示例输出: ```shell REPOSITORY TAG IMAGE ID CREATED SIZE @@ -364,13 +362,13 @@ hello-world latest fce289e99eb9 4 months ago 由上面的命令可以知道,在本地的系统中存在三个镜像。 -使用`镜像ID`来删除镜像。 +使用镜像 ID 来删除镜像。 ```shell $ sudo docekr rmi ce5aa74a48f1 ``` -**输出为:** +示例输出: ```shell Untagged: ostechnix/ubuntu_apache:latest @@ -378,17 +376,17 @@ Deleted: sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 Deleted: sha256:d21c926f11a64b811dc75391bbe0191b50b8fe142419f7616b3cee70229f14cd ``` -**解决问题** +#### 解决问题 -Docker禁止我们删除一个还在被容器使用的镜像。 +Docker 禁止我们删除一个还在被容器使用的镜像。 -例如,当我试图删除Docker镜像**b72889fa879c**时,我只能获得一个错误提示: +例如,当我试图删除 Docker 镜像 `b72889fa879c` 时,我只能获得一个错误提示: ```shell Error response from daemon: conflict: unable to delete b72889fa879c (must be forced) - image is being used by stopped container dde4dd285377 ``` -这是因为这个Docker镜像正在被一个容器使用。 +这是因为这个 Docker 镜像正在被一个容器使用。 所以,我们来检查一个正在运行的容器: @@ -396,19 +394,19 @@ Error response from daemon: conflict: unable to delete b72889fa879c (must be for $ sudo docker ps ``` -**输出为:** +示例输出: ![][10] 注意,现在并没有正在运行的容器!!! -查看一下所有的容器(包含所有的正在运行和已经停止的容器): +查看一下所有的容器(包含所有的正在运行和已经停止的容器): ```shell $ sudo docker pa -a ``` -**输出为:** +示例输出: ![][11] @@ -420,9 +418,9 @@ $ sudo docker pa -a $ sudo docker rm 12e892156219 ``` -我们仍然使用容器ID来删除这些容器。 +我们仍然使用容器 ID 来删除这些容器。 -当我们删除了所有使用该镜像的容器之后,我们就可以删除Docker的镜像了。 +当我们删除了所有使用该镜像的容器之后,我们就可以删除 Docker 的镜像了。 例如: @@ -438,19 +436,7 @@ $ sudo docker images 想要知道更多的细节,请参阅本指南末尾给出的官方资源的链接或者在评论区进行留言。 -或者,下载以下的关于Docker的电子书来了解更多。 - -* **Download** – [**Free eBook: “Docker Containerization Cookbook”**][12] - -* **Download** – [**Free Guide: “Understanding Docker”**][13] - -* **Download** – [**Free Guide: “What is Docker and Why is it So Popular?”**][14] - -* **Download** – [**Free Guide: “Introduction to Docker”**][15] - -* **Download** – [**Free Guide: “Docker in Production”**][16] - -这就是全部的教程了,希望你可以了解Docker的一些基础用法。 +这就是全部的教程了,希望你可以了解 Docker 的一些基础用法。 更多的教程马上就会到来,敬请关注。 @@ -461,7 +447,7 @@ via: https://www.ostechnix.com/getting-started-with-docker/ 作者:[sk][a] 选题:[lujun9972][b] 译者:[zhang5788](https://github.com/zhang5788) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -482,4 +468,4 @@ via: https://www.ostechnix.com/getting-started-with-docker/ [13]: https://ostechnix.tradepub.com/free/w_pacb32/prgm.cgi?a=1 [14]: https://ostechnix.tradepub.com/free/w_pacb31/prgm.cgi?a=1 [15]: https://ostechnix.tradepub.com/free/w_pacb29/prgm.cgi?a=1 -[16]: https://ostechnix.tradepub.com/free/w_pacb28/prgm.cgi?a=1 \ No newline at end of file +[16]: https://ostechnix.tradepub.com/free/w_pacb28/prgm.cgi?a=1 From a574fb3251246c76d515378da3fdbcf27ffa3f53 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 Jun 2019 01:39:57 +0800 Subject: [PATCH 0759/1154] PUB:20190520 Getting Started With Docker.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zhang5788 恭喜你完成了第一篇翻译,本文首发地址: https://linux.cn/article-10940-1.html 你的 LCTT 专页地址: https://linux.cn/lctt/zhang5788 请注册领取 LCCN: https://lctt.linux.cn/ --- .../20190520 Getting Started With Docker.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20190520 Getting Started With Docker.md (96%) diff --git a/translated/tech/20190520 Getting Started With Docker.md b/published/20190520 Getting Started With Docker.md similarity index 96% rename from translated/tech/20190520 Getting Started With Docker.md rename to published/20190520 Getting Started With Docker.md index be490ae974..2349664ad9 100644 --- a/translated/tech/20190520 Getting Started With Docker.md +++ b/published/20190520 Getting Started With Docker.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "zhang5788" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10940-1.html" [#]: subject: "Getting Started With Docker" [#]: via: "https://www.ostechnix.com/getting-started-with-docker/" [#]: author: "sk https://www.ostechnix.com/author/sk/" @@ -12,7 +12,7 @@ Docker 入门指南 ![Getting Started With Docker][1] -在我们的上一个教程中,我们已经了解[如何在ubuntu上安装Docker][1],和如何在[CentOS上安装Docker][2]。今天,我们将会了解 Docker 的一些基础用法。该教程包含了如何创建一个新的 Docker 容器,如何运行该容器,如何从现有的 Docker 容器中创建自己的 Docker 镜像等 Docker 的一些基础知识、操作。所有步骤均在 Ubuntu 18.04 LTS server 版本下测试通过。 +在我们的上一个教程中,我们已经了解[如何在 Ubuntu 上安装 Docker][1],和如何在 [CentOS 上安装 Docker][2]。今天,我们将会了解 Docker 的一些基础用法。该教程包含了如何创建一个新的 Docker 容器,如何运行该容器,如何从现有的 Docker 容器中创建自己的 Docker 镜像等 Docker 的一些基础知识、操作。所有步骤均在 Ubuntu 18.04 LTS server 版本下测试通过。 ### 入门指南 From f695070647a4a5a4f2f36bac2692a8377eb56b3b Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 5 Jun 2019 08:53:33 +0800 Subject: [PATCH 0760/1154] translated --- ...fra with Ansible to verify server state.md | 168 ------------------ ...fra with Ansible to verify server state.md | 158 ++++++++++++++++ 2 files changed, 158 insertions(+), 168 deletions(-) delete mode 100644 sources/tech/20190517 Using Testinfra with Ansible to verify server state.md create mode 100644 translated/tech/20190517 Using Testinfra with Ansible to verify server state.md diff --git a/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md b/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md deleted file mode 100644 index e845b15e59..0000000000 --- a/sources/tech/20190517 Using Testinfra with Ansible to verify server state.md +++ /dev/null @@ -1,168 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Testinfra with Ansible to verify server state) -[#]: via: (https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state) -[#]: author: (Clement Verna https://opensource.com/users/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert) - -Using Testinfra with Ansible to verify server state -====== -Testinfra is a powerful library for writing tests to verify an -infrastructure's state. Coupled with Ansible and Nagios, it offers a -simple solution to enforce infrastructure as code. -![Terminal command prompt on orange background][1] - -By design, [Ansible][2] expresses the desired state of a machine to ensure that the content of an Ansible playbook or role is deployed to the targeted machines. But what if you need to make sure all the infrastructure changes are in Ansible? Or verify the state of a server at any time? - -[Testinfra][3] is an infrastructure testing framework that makes it easy to write unit tests to verify the state of a server. It is a Python library and uses the powerful [pytest][4] test engine. - -### Getting started with Testinfra - -Testinfra can be easily installed using the Python package manager (pip) and a Python virtual environment. - - -``` -$ python3 -m venv venv -$ source venv/bin/activate -(venv) $ pip install testinfra -``` - -Testinfra is also available in the package repositories of Fedora and CentOS using the EPEL repository. For example, on CentOS 7 you can install it with the following commands: - - -``` -$ yum install -y epel-release -$ yum install -y python-testinfra -``` - -#### A simple test script - -Writing tests in Testinfra is easy. Using the code editor of your choice, add the following to a file named **test_simple.py** : - - -``` -import testinfra - -def test_os_release(host): -assert host.file("/etc/os-release").contains("Fedora") - -def test_sshd_inactive(host): -assert host.service("sshd").is_running is False -``` - -By default, Testinfra provides a host object to the test case; this object gives access to different helper modules. For example, the first test uses the **file** module to verify the content of the file on the host, and the second test case uses the **service** module to check the state of a systemd service. - -To run these tests on your local machine, execute the following command: - - -``` -(venv)$ pytest test_simple.py -================================ test session starts ================================ -platform linux -- Python 3.7.3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0 -rootdir: /home/cverna/Documents/Python/testinfra -plugins: testinfra-3.0.0 -collected 2 items -test_simple.py .. - -================================ 2 passed in 0.05 seconds ================================ -``` - -For a full list of Testinfra's APIs, you can consult the [documentation][5]. - -### Testinfra and Ansible - -One of Testinfra's supported backends is Ansible, which means Testinfra can directly use Ansible's inventory file and a group of machines defined in the inventory to run tests against them. - -Let's use the following inventory file as an example: - - -``` -[web] -app-frontend01 -app-frontend02 - -[database] -db-backend01 -``` - -We want to make sure that our Apache web server service is running on **app-frontend01** and **app-frontend02**. Let's write the test in a file called **test_web.py** : - - -``` -def check_httpd_service(host): -"""Check that the httpd service is running on the host""" -assert host.service("httpd").is_running -``` - -To run this test using Testinfra and Ansible, use the following command: - - -``` -(venv) $ pip install ansible -(venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible test_web.py -``` - -When invoking the tests, we use the Ansible inventory **[web]** group as the targeted machines and also specify that we want to use Ansible as the connection backend. - -#### Using the Ansible module - -Testinfra also provides a nice API to Ansible that can be used in the tests. The Ansible module enables access to run Ansible plays inside a test and makes it easy to inspect the result of the play. - - -``` -def check_ansible_play(host): -""" -Verify that a package is installed using Ansible -package module -""" -assert not host.ansible("package", "name=httpd state=present")["changed"] -``` - -By default, Ansible's [Check Mode][6] is enabled, which means that Ansible will report what would change if the play were executed on the remote host. - -### Testinfra and Nagios - -Now that we can easily run tests to validate the state of a machine, we can use those tests to trigger alerts on a monitoring system. This is a great way to catch unexpected changes. - -Testinfra offers an integration with [Nagios][7], a popular monitoring solution. By default, Nagios uses the [NRPE][8] plugin to execute checks on remote hosts, but using Testinfra allows you to run the tests directly from the Nagios master. - -To get a Testinfra output compatible with Nagios, we have to use the **\--nagios** flag when triggering the test. We also use the **-qq** pytest flag to enable pytest's **quiet** mode so all the test details will not be displayed. - - -``` -(venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible --nagios -qq line test.py -TESTINFRA OK - 1 passed, 0 failed, 0 skipped in 2.55 seconds -``` - -Testinfra is a powerful library for writing tests to verify an infrastructure's state. Coupled with Ansible and Nagios, it offers a simple solution to enforce infrastructure as code. It is also a key component of adding testing during the development of your Ansible roles using [Molecule][9]. - -* * * - -Sysadmins who think the cloud is a buzzword and a bunch of hype should check out Ansible. - -Can you really do DevOps without sharing scripts or code? DevOps manifesto proponents value cross-... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state - -作者:[Clement Verna][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/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) -[2]: https://www.ansible.com/ -[3]: https://testinfra.readthedocs.io/en/latest/ -[4]: https://pytest.org/ -[5]: https://testinfra.readthedocs.io/en/latest/modules.html#modules -[6]: https://docs.ansible.com/ansible/playbooks_checkmode.html -[7]: https://www.nagios.org/ -[8]: https://en.wikipedia.org/wiki/Nagios#NRPE -[9]: https://github.com/ansible/molecule diff --git a/translated/tech/20190517 Using Testinfra with Ansible to verify server state.md b/translated/tech/20190517 Using Testinfra with Ansible to verify server state.md new file mode 100644 index 0000000000..c0c631ccd2 --- /dev/null +++ b/translated/tech/20190517 Using Testinfra with Ansible to verify server state.md @@ -0,0 +1,158 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Testinfra with Ansible to verify server state) +[#]: via: (https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state) +[#]: author: (Clement Verna https://opensource.com/users/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert) + +使用 Testinfra 和 Ansible 验证服务器状态 +====== +Testinfra 是一个功能强大的库,可用于编写测试来验证基础设施的状态。另外与 Ansible 和 Nagios 相结合,提供了一个用于架构即代码 (IaC) 的简单解决方案。 +![Terminal command prompt on orange background][1] + +根据设计,[Ansible][2] 传递机器的期望状态,以确保 Ansible playbook 或角色的内容部署到目标机器上。但是,如果你需要确保所有基础架构更改都在 Ansible 中,该怎么办?或者随时验证服务器的状态? + +[Testinfra][3] 是一个基础架构测试框架,它可以轻松编写单元测试来验证服务器的状态。它是一个 Python 库,使用强大的 [pytest][4] 测试引擎。 + +### 开始使用 Testinfra + +可以使用 Python 包管理器 (pip) 和 Python 虚拟环境轻松安装 Testinfra。 + + +``` +$ python3 -m venv venv +$ source venv/bin/activate +(venv) $ pip install testinfra +``` + +Testinfra 也可以使用 EPEL 仓库的 Fedora 和 CentOS 中使用。例如,在 CentOS 7 上,你可以使用以下命令安装它: + + +``` +$ yum install -y epel-release +$ yum install -y python-testinfra +``` + +#### 一个简单的测试脚本 + +在 Testinfra 中编写测试很容易。使用你选择的代码编辑器,将以下内容添加到名为 **test_simple.py** 的文件中: + + +``` +import testinfra + +def test_os_release(host): + assert host.file("/etc/os-release").contains("Fedora") + +def test_sshd_inactive(host): + assert host.service("sshd").is_running is False +``` + +默认情况下,Testinfra 为测试用例提供了一个主机对象,该对象能访问不同的辅助模块。例如,第一个测试使用 **file** 模块来验证主机上文件的内容,第二个测试用例使用 **service** 模块来检查 systemd 服务的状态。 + +要在本机运行这些测试,请执行以下命令: + + +``` +(venv)$ pytest test_simple.py +================================ test session starts ================================ +platform linux -- Python 3.7.3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0 +rootdir: /home/cverna/Documents/Python/testinfra +plugins: testinfra-3.0.0 +collected 2 items +test_simple.py .. + +================================ 2 passed in 0.05 seconds ================================ +``` + +有关 Testinfra API 的完整列表,你可以参考[文档][5]。 + +### Testinfra 和 Ansible + +Testinfra 支持的后端之一是 Ansible,这意味着 Testinfra 可以直接使用 Ansible 的 inventory 文件和 inventory 中定义的一组机器来对它们进行测试。 + +我们使用以下 inventory 文件作为示例: + + +``` +[web] +app-frontend01 +app-frontend02 + +[database] +db-backend01 +``` + +我们希望确保我们的 Apache Web 服务器在 **app-frontend01** 和 **app-frontend02** 上运行。让我们在名为 **test_web.py** 的文件中编写测试: + + +``` +def check_httpd_service(host): + """Check that the httpd service is running on the host""" + assert host.service("httpd").is_running +``` + +要使用 Testinfra 和 Ansible 运行此测试,请使用以下命令: + + +``` +(venv) $ pip install ansible +(venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible test_web.py +``` + +在调用测试时,我们使用 Ansible inventory 的 **[web]** 组作为目标计算机,并指定我们要使用 Ansible 作为连接后端。 + +#### 使用 Ansible 模块 + +Testinfra 还为 Ansible 提供了一个很好的可用于测试的 API。该 Ansible 模块能够在 测试中运行 Ansible play,并且能够轻松检查 play 的状态。 + +``` +def check_ansible_play(host): + """ + Verify that a package is installed using Ansible + package module + """ + assert not host.ansible("package", "name=httpd state=present")["changed"] +``` + +B默认情况下,Ansible 的[检查模式][6]已启用,这意味着 Ansible 将报告在远程主机上执行 play 时会发生的变化。 + +### Testinfra 和 Nagios + +现在我们可以轻松地运行测试来验证机器的状态,我们可以使用这些测试来触发监控系统上的警报。这是捕获意外更改的好方法。 + +Testinfra 提供了与 [Nagios][7] 的集成,它是一种流行的监控解决方案。默认情况下,Nagios 使用 [NRPE][8] 插件对远程主机进行检查,但使用 Testinfra 可以直接从 Nagios master 上运行测试。 + +要使 Testinfra 输出与 Nagios 兼容,我们必须在触发测试时使用 **\--nagios** 标志。我们还使用 **-qq** 这个 pytest 标志来启用 pytest 的**静默**模式,这样就不会显示所有测试细节。 + +``` +(venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible --nagios -qq line test.py +TESTINFRA OK - 1 passed, 0 failed, 0 skipped in 2.55 seconds +``` + +Testinfra 是一个功能强大的库,可用于编写测试以验证基础架构的状态。 另外与 Ansible 和 Nagios 相结合,提供了一个用于架构即代码 (IaC) 的简单解决方案。 它也是使用 [Molecule][9] 开发 Ansible 角色过程中添加测试的关键组件。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state + +作者:[Clement Verna][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/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://www.ansible.com/ +[3]: https://testinfra.readthedocs.io/en/latest/ +[4]: https://pytest.org/ +[5]: https://testinfra.readthedocs.io/en/latest/modules.html#modules +[6]: https://docs.ansible.com/ansible/playbooks_checkmode.html +[7]: https://www.nagios.org/ +[8]: https://en.wikipedia.org/wiki/Nagios#NRPE +[9]: https://github.com/ansible/molecule From 50ac30207f9f5940adc1354c8aa7be3a8dad835e Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 5 Jun 2019 09:05:35 +0800 Subject: [PATCH 0761/1154] translating --- sources/tech/20190527 A deeper dive into Linux permissions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190527 A deeper dive into Linux permissions.md b/sources/tech/20190527 A deeper dive into Linux permissions.md index 26a132fdf9..79a58e97bb 100644 --- a/sources/tech/20190527 A deeper dive into Linux permissions.md +++ b/sources/tech/20190527 A deeper dive into Linux permissions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e52769d0b20eacd42a8e2ab9476dfcd92c8fe990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 5 Jun 2019 10:23:59 +0800 Subject: [PATCH 0762/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190529 NVMe on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190529 NVMe on Linux.md b/sources/tech/20190529 NVMe on Linux.md index 788fe9c3fd..8c6ba38911 100644 --- a/sources/tech/20190529 NVMe on Linux.md +++ b/sources/tech/20190529 NVMe on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0ee3c6f6b72b4647aeb85715b6526d94af73e8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=9A?= <1594914459@qq.com> Date: Wed, 5 Jun 2019 11:02:48 +0800 Subject: [PATCH 0763/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190529 NVMe on Linux.md | 70 ----------------------- translated/tech/20190529 NVMe on Linux.md | 69 ++++++++++++++++++++++ 2 files changed, 69 insertions(+), 70 deletions(-) delete mode 100644 sources/tech/20190529 NVMe on Linux.md create mode 100644 translated/tech/20190529 NVMe on Linux.md diff --git a/sources/tech/20190529 NVMe on Linux.md b/sources/tech/20190529 NVMe on Linux.md deleted file mode 100644 index 8c6ba38911..0000000000 --- a/sources/tech/20190529 NVMe on Linux.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (warmfrog) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (NVMe on Linux) -[#]: via: (https://www.networkworld.com/article/3397006/nvme-on-linux.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -NVMe on Linux -====== -In case you haven't yet noticed, some incredibly fast solid-state disk technology is as available for Linux as it is for other operating systems. -![Sandra Henry-Stocker][1] - -NVMe stands for “non-volatile memory express” and is a host controller interface and storage protocol that was created to accelerate the transfer of data between enterprise and client systems and solid-state drives (SSD). It works over a computer's high-speed Peripheral Component Interconnect Express (PCIe) bus. What I see when I look at this string of letters, however, is “envy me.” And the reason for the envy is significant. - -Using NVMe, data transfer happens _much_ faster than it does with rotating drives. In fact, NVMe drives can move data seven times faster than SATA SSDs. That’s seven times faster than the SSDs that many of us are using today. This means that your systems could boot blindingly fast when an NVMe drive is serving as its boot drive. In fact, these days anyone buying a new system should probably not consider one that doesn’t come with NVMe built-in — whether a server or a PC. - -### Does NVMe work with Linux? - -Yes! NVMe has been supported in the Linux kernel since 3.3. Upgrading a system, however, generally requires that both an NVMe controller and an NVMe disk be available. Some external drives are available but need more than the typical USB port for attaching to the system. - -[MORE ON NETWORK WORLD: Linux: Best desktop distros for newbies][2] - -To check your kernel release, use a command like this: - -``` -$ uname -r -5.0.0-15-generic -``` - -If your system is NVMe-ready, you should see a device (e.g., /dev/nvme0), but only if you have an NVMe controller installed. If you don’t have an NVMe controller, you can still get some information on your NVMe-readiness using this command: - -``` -$ modinfo nvme | head -6 -filename: /lib/modules/5.0.0-15-generic/kernel/drivers/nvme/host/nvme.ko -version: 1.0 -license: GPL -author: Matthew Wilcox -srcversion: AA383008D5D5895C2E60523 -alias: pci:v0000106Bd00002003sv*sd*bc*sc*i* -``` - -### Learn more - -More details on what you need to know about the insanely fast NVMe storage option are available on _[PCWorld][3]._ - -Specs, white papers and other resources are available at [NVMexpress.org][4]. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3397006/nvme-on-linux.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/05/nvme-100797708-large.jpg -[2]: https://www.networkworld.com/slideshow/153439/linux-best-desktop-distros-for-newbies.html#tk.nww-infsb -[3]: https://www.pcworld.com/article/2899351/everything-you-need-to-know-about-nvme.html -[4]: https://nvmexpress.org/ -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190529 NVMe on Linux.md b/translated/tech/20190529 NVMe on Linux.md new file mode 100644 index 0000000000..36ccc1a0fa --- /dev/null +++ b/translated/tech/20190529 NVMe on Linux.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (NVMe on Linux) +[#]: via: (https://www.networkworld.com/article/3397006/nvme-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Linux 上的 NVMe +=============== + +如果你还没注意到,一些极速的固态磁盘技术对于Linux和其他操作系统都是可用的。 +![Sandra Henry-Stocker][1] + +NVMe 代表“非易失性内存快车”,它是一个主机控制器接口和存储协议,用于加速企业和客户端系统以及固态驱动器(SSD)之间的数据传输。它通过电脑的高速外围组件互联快车总线(PCIe)工作。当我看到这些名词时,我感到“羡慕”。羡慕的原因很重要。 + +使用 NVMe,数据传输的速度比旋转磁盘快很多。事实上,NVMe 驱动能够比 SATA SSD 快 7 倍。这比我们今天很多人用的固态硬盘快了 7 倍多。这意味着,如果你用一个 NVMe 驱动盘作为启动盘,你的系统能够启动的非常快。事实上,如今任何人买一个新的系统可能都不会考虑那些没有自带 NVMe 的,不管是服务器或者个人电脑。 + +### NVMe 在 Linux 下能工作吗? + +是的!NVMe 自 Linux 内核 3.3 版本就支持了。更新一个系统,然而,通常同时需要一个 NVMe 控制器和一个 NVMe 磁盘。一些外置磁盘也行,但是为了添加到系统中,需要的不仅仅是通用的 USB 接口。 + +[MORE ON NETWORK WORLD: Linux: Best desktop distros for newbies][2] + +为了检查内核版本,使用下列命令: + +``` +$ uname -r +5.0.0-15-generic +``` + +如果你的系统已经用了 NVMe,你将看到一个设备(例如, /dev/nvme0),但是仅在你安装了 NVMe 控制器的情况下。如果你没有,你可以用下列命令获取使用 NVMe 的相关信息。 + +``` +$ modinfo nvme | head -6 +filename: /lib/modules/5.0.0-15-generic/kernel/drivers/nvme/host/nvme.ko +version: 1.0 +license: GPL +author: Matthew Wilcox +srcversion: AA383008D5D5895C2E60523 +alias: pci:v0000106Bd00002003sv*sd*bc*sc*i* +``` + +### 了解更多 + +如果你想了解极速的 NVMe 存储的更多细节,可在 _[PCWorld][3]_ 获取。 + +规格,白皮书和其他资源可在 [NVMexpress.org][4] 获取。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397006/nvme-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[校对者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/05/nvme-100797708-large.jpg +[2]: https://www.networkworld.com/slideshow/153439/linux-best-desktop-distros-for-newbies.html#tk.nww-infsb +[3]: https://www.pcworld.com/article/2899351/everything-you-need-to-know-about-nvme.html +[4]: https://nvmexpress.org/ +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 4cc9716bbcc0bbfc6e7f9f0205b25642d669fba9 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 5 Jun 2019 12:30:17 +0800 Subject: [PATCH 0764/1154] translating --- ...your workstation with Ansible- Configure desktop settings.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180529 Manage your workstation with Ansible- Configure desktop settings.md b/sources/tech/20180529 Manage your workstation with Ansible- Configure desktop settings.md index d04ee6d742..ed85b172af 100644 --- a/sources/tech/20180529 Manage your workstation with Ansible- Configure desktop settings.md +++ b/sources/tech/20180529 Manage your workstation with Ansible- Configure desktop settings.md @@ -1,3 +1,5 @@ +Translating by MjSeven + Manage your workstation with Ansible: Configure desktop settings ====== From f8822176e4fda3349910a685430fcb064bd309cc Mon Sep 17 00:00:00 2001 From: tao Zhang Date: Wed, 5 Jun 2019 13:57:55 +0800 Subject: [PATCH 0765/1154] translating by zhang5788 --- .../tech/20190510 Learn to change history with git rebase.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190510 Learn to change history with git rebase.md b/sources/tech/20190510 Learn to change history with git rebase.md index cf8f9351d9..be1d265d8a 100644 --- a/sources/tech/20190510 Learn to change history with git rebase.md +++ b/sources/tech/20190510 Learn to change history with git rebase.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zhang5788) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 378dc2bc1f2814258a3765596aaebc56632d2572 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 Jun 2019 23:09:40 +0800 Subject: [PATCH 0766/1154] TSL:20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md --- ...g Smart Contracts And Its Types -Part 5.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md b/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md index 1f1d0f31b8..22d879dfe2 100644 --- a/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md +++ b/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md @@ -112,25 +112,26 @@ 如示例中所强调的,使用智能合约涉及最低成本。企业通常有专门从事使其交易是合法的并遵守法规的行政人员。如果交易涉及多方,则重复工作是不可避免的。智能合约基本上使前者无关紧要,并且消除了重复,因为双方可以同时完成尽职调查。 -### Applications of Smart Contracts +### 智能合约的应用程序 -Basically, if two or more parties use a common blockchain platform and agree on a set of principles or business logic, they can come together to create a smart contract on the blockchain and it is executed with no human intervention at all. No one can tamper with the conditions set and, any changes, if the original code allows for it, is timestamped and carries the editor’s fingerprint increasing accountability. Imagine a similar situation at a much larger enterprise scale and you understand what smart contracts are capable of and in fact a **Capgemini study** from 2016 found that smart contracts could actually be commercially mainstream **“in the early years of the next decade”** [8]. Commercial applications involve uses in Insurance, Financial Markets, IoT, Loans, Identity Management systems, Escrow Accounts, Employment contracts, and Patent & Royalty contracts among others. Platforms such as Ethereum, a blockchain designed keeping smart contracts in mind, allow for individual private users to utilize smart contracts free of cost as well. +基本上,如果两个或多个参与方使用共同的区块链平台,并就一组原则或业务逻辑达成一致,他们可以一起在区块链上创建一个智能合约,并且在没有人为干预的情况下执行。没有人可以篡改所设置的条件,如果原始代码允许,任何更改都会加上时间戳并带有编辑者的指纹,从而增加了问责制。想象一下,在更大的企业级规模上出现类似的情况,你就会明白智能合约的能力是什么,实际上从 2016 年开始的 **Capgemini 研究** 发现智能合约实际上可能是商业主流**“的下一阶段的早期“** [^8]。商业应用程序涉及保险、金融市场、物联网、贷款、身份管理系统、托管账户、雇佣合同以及专利和版税合同等用途。像以太坊这样的区块链平台,是一个设计时就考虑了智能合约的系统,它也允许个人私人用户免费使用智能合约。 -A more comprehensive overview of the applications of smart contracts on current technological problems will be presented in the next article of the series by exploring the companies that deal with it. +通过对处理智能合约的公司的探讨,本系列的下一篇文章中将更全面地概述智能合约在当前技术问题上的应用。 -### So, what are the drawbacks? +### 那么,它有什么缺点呢? -This is not to say that smart contracts come with no concerns regarding their use whatsoever. Such concerns have actually slowed down development in this aspect as well. The tamper-proof nature of everything blockchain essentially makes it next to impossible to modify or add new clauses to existing clauses if the parties involved need to without major overhaul or legal recourse. +这并不是说对智能合约的使用没有任何顾虑。这种担忧实际上也减缓了这方面的发展。所有区块链的防篡改性质基本上使得,如果所涉及的各方需要在没有重大改革或法律追索的情况下,几乎不可能修改或添加现有条款的新条款。 -Secondly, even though activity on a public blockchain is open for all to see and observe. The personal identities of the parties involved in a transaction are not always known. This anonymity raises question regarding legal impunity in case either party defaults especially since current laws and lawmakers are not exactly accommodative of modern technology. +其次,即使公有链上的活动是开放的,所有人都可以看到和观察。交易中涉及的各方的个人身份并不总是已知的。这种匿名性造成在任何一方违约的情况下法律有罪不罚的问题,特别是因为现行法律和立法者并不完全适应现代技术。 -Thirdly, blockchains and smart contracts are still subject to security flaws in many ways because the technology for all the interest in it is still in a very nascent stage of development. This inexperience with the code and platform is what ultimately led to the DAO incident in 2016. +第三,区块链和智能合约在很多方面仍然存在安全缺陷,因为对其所以涉及的技术仍处于发展的初期阶段。 对代码和平台的这种缺乏经验最终导致了 2016 年的 DAO 事件。 -All of this is keeping aside the significant initial investment that might be needed in case an enterprise or firm needs to adapt a blockchain for its use. The fact that these are initial one-time investments and come with potential savings down the road however is what interests people. +所有这些都是在企业或公司需要调整区块链以供其使用时可能需要的大量的初始投资。事实上,这些是最初的一次性投资,并且随之而来的是潜在的节省,这是人们感兴趣的。 -### Conclusion -Current legal frameworks don’t really support a full-on smart contract enabled society and won’t in the near future due to obvious reasons. A solution is to opt for **“hybrid” contracts** that combine traditional legal texts and documents with smart contract code running on blockchains designed for the purpose[4]. However, even hybrid contracts remain largely unexplored as innovative legislature is required to bring them into fruition. The applications briefly mentioned here and many more are explored in detail in the [**next post of the series**][6]. +### 结论 + +目前的法律框架并不真正支持一个全面的智能合约的社会,并且由于显然的原因也不会在不久的将来支持。一个解决方案是选择**“混合”合约**,它将传统的法律文本和文件与在为此目的设计的区块链上运行的智能合约代码相结合。然而,即使是混合合约仍然很大程度上尚未得到探索,因为需要创新的立法机构才能实现这些合约。这里简要提到的应用程序以及更多内容将在[本系列的下一篇文章][6]中详细探讨。 [^1]: S. C. A. Chamber of Digital Commerce, “Smart contracts – Is the law ready,” no. September, 2018. [^2]: S. C. A. Chamber of Digital Commerce, “Smart contracts – Is the law ready,” no. September, 2018. From 61dd7413c0c38edb328f737ee9c5f7ac96a2996a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 5 Jun 2019 23:42:46 +0800 Subject: [PATCH 0767/1154] TSL:20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5 --- ...hain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md (100%) diff --git a/sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md b/translated/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md similarity index 100% rename from sources/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md rename to translated/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md From f2ebdc374ef4f4290a0f4feada2c2296002ee44b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Thu, 6 Jun 2019 06:21:11 +0800 Subject: [PATCH 0768/1154] Translated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 最终翻译完成了,但是感觉翻译的不好。根据这篇文章的英语语法和习惯和平常的很不一样 --- .../20180902 Learning BASIC Like It-s 1983.md | 185 ------------------ .../20180902 Learning BASIC Like It-s 1983.md | 184 +++++++++++++++++ 2 files changed, 184 insertions(+), 185 deletions(-) delete mode 100644 sources/tech/20180902 Learning BASIC Like It-s 1983.md create mode 100644 translated/tech/20180902 Learning BASIC Like It-s 1983.md diff --git a/sources/tech/20180902 Learning BASIC Like It-s 1983.md b/sources/tech/20180902 Learning BASIC Like It-s 1983.md deleted file mode 100644 index 83ef0ff982..0000000000 --- a/sources/tech/20180902 Learning BASIC Like It-s 1983.md +++ /dev/null @@ -1,185 +0,0 @@ -Translating by robsean -Learning BASIC Like It's 1983 -====== -I was not yet alive in 1983. This is something that I occasionally regret. I am especially sorry that I did not experience the 8-bit computer era as it was happening, because I think the people that first encountered computers when they were relatively simple and constrained have a huge advantage over the rest of us. - -Today, (almost) everyone knows how to use a computer, but very few people, even in the computing industry, grasp all of what is going on inside of any single machine. There are now [so many layers of software][1] doing so many different things that one struggles to identify the parts that are essential. In 1983, though, home computers were unsophisticated enough that a diligent person could learn how a particular computer worked through and through. That person is today probably less mystified than I am by all the abstractions that modern operating systems pile on top of the hardware. I expect that these layers of abstractions were easy to understand one by one as they were introduced; today, new programmers have to try to understand them all by working top to bottom and backward in time. - -Many famous programmers, particularly in the video game industry, started programming games in childhood on 8-bit computers like the Apple II and the Commodore 64. John Romero, Richard Garriott, and Chris Roberts are all examples. It’s easy to see how this happened. In the 8-bit computer era, many games were available only as printed BASIC listings in computer magazines and [books][2]. If you wanted to play one of those games, you had to type in the whole program by hand. Inevitably, you would get something wrong, so you would have to debug your program. By the time you got it working, you knew enough about how the program functioned to start modifying it yourself. If you were an avid gamer, you became a good programmer almost by necessity. - -I also played computer games throughout my childhood. But the games I played came on CD-ROMs. I sometimes found myself having to google how to fix a crashing installer, which would involve editing the Windows Registry or something like that. This kind of minor troubleshooting may have made me comfortable enough with computers to consider studying computer science in college. But it never taught me anything crucial about how computers worked or how to control them. - -Now, of course, I tell computers what to do for a living. All the same, I can’t help feeling that I missed out on some fundamental insight afforded only to those that grew up programming simpler computers. What would it have been like to encounter computers for the first time in the early 1980s? How would that have been different from the experience of using a computer today? - -This post is going to be a little different from the usual Two-Bit History post because I’m going to try to imagine an answer to these questions. - -### 1983 - -It was just last week that you saw [the Commodore 64 ad][3] on TV. Now that M*A*S*H was over, you were in the market for something new to do on Monday nights. This Commodore 64 thing looked even better than the Apple II that Rudy’s family had in their basement. Plus, the ad promised that the new computer would soon bring friends “knocking down” your door. You knew several people at school that would rather be hanging out at your house than Rudy’s anyway, if only they could play Zork there. - -So you persuaded your parents to buy one. Your mother said that they would consider it only if having a home computer meant that you stayed away from the arcade. You reluctantly agreed. Your father thought he would start tracking the family’s finances in MultiPlan, the spreadsheet program he had heard about, which is why the computer got put in the living room. A year later, though, you would be the only one still using it. You were finally allowed to put it on the desk in your bedroom, right under your Police poster. - -(Your sister protested this decision, but it was 1983 and computers [weren’t for her][4].) - -Dad picked it up from [ComputerLand][5] on the way home from work. The two of you laid the box down next to the TV and opened it. “WELCOME TO THE WORLD OF FRIENDLY COMPUTING,” said the packaging. Twenty minutes later, you weren’t convinced—the two of you were still trying to connect the Commodore to the TV set and wondering whether the TV’s antenna cable was the 75-ohm or 300-ohm coax type. But eventually you were able to turn your TV to channel 3 and see a grainy, purple image. - -![Commodore 64 startup screen][6] - -`READY`, the computer reported. Your father pushed the computer toward you, indicating that you should be the first to give it a try. `HELLO`, you typed, carefully hunting for each letter. The computer’s response was baffling. - -![Commodore 64 syntax error][7] - -You tried typing in a few different words, but the response was always the same. Your father said that you had better read through the rest of the manual. That would be no mean feat—[the manual that came with the Commodore 64][8] was a small book. But that didn’t bother you, because the introduction to the manual foreshadowed wonders. - -The Commodore 64, it claimed, had “the most advanced picture maker in the microcomputer industry,” which would allow you “to design your own pictures in four different colors, just like the ones you see on arcade type video games.” The Commodore 64 also had “built-in music and sound effects that rival many well known music synthesizers.” All of these tools would be put in your hands, because the manual would walk you through it all: - -> Just as important as all the available hardware is the fact that this USER’S GUIDE will help you develop your understanding of computers. It won’t tell you everything there is to know about computers, but it will refer you to a wide variety of publications for more detailed information about the topics presented. Commodore wants you to really enjoy your new COMMODORE 64. And to have fun, remember: programming is not the kind of thing you can learn in a day. Be patient with yourself as you go through the USER’S GUIDE. - -That night, in bed, you read through the entire first three chapters—”Setup,” “Getting Started,” and “Beginning BASIC Programming”—before finally succumbing to sleep with the manual splayed across your chest. - -### Commodore BASIC - -Now, it’s Saturday morning and you’re eager to try out what you’ve learned. One of the first things the manual teaches you how to do is change the colors on the display. You follow the instructions, pressing `CTRL-9` to enter reverse type mode and then holding down the space bar to create long lines. You swap between colors using `CTRL-1` through `CTRL-8`, reveling in your sudden new power over the TV screen. - -![Commodore 64 color bands][9] - -As cool as this is, you realize it doesn’t count as programming. In order to program the computer, you learned last night, you have to speak to it in a language called BASIC. To you, BASIC seems like something out of Star Wars, but BASIC is, by 1983, almost two decades old. It was invented by two Dartmouth professors, John Kemeny and Tom Kurtz, who wanted to make computing accessible to undergraduates in the social sciences and humanities. It was widely available on minicomputers and popular in college math classes. It then became standard on microcomputers after Bill Gates and Paul Allen wrote the MicroSoft BASIC interpreter for the Altair. But the manual doesn’t explain any of this and you won’t learn it for many years. - -One of the first BASIC commands the manual suggests you try is the `PRINT` command. You type in `PRINT "COMMODORE 64"`, slowly, since it takes you a while to find the quotation mark symbol above the `2` key. You hit `RETURN` and this time, instead of complaining, the computer does exactly what you told it to do and displays “COMMODORE 64” on the next line. - -Now you try using the `PRINT` command on all sorts of different things: two numbers added together, two numbers multiplied together, even several decimal numbers. You stop typing out `PRINT` and instead use `?`, since the manual has advised you that `?` is an abbreviation for `PRINT` often used by expert programmers. You feel like an expert already, but then you remember that you haven’t even made it to chapter three, “Beginning BASIC Programming.” - -You get there soon enough. The chapter begins by prompting you to write your first real BASIC program. You type in `NEW` and hit `RETURN`, which gives you a clean slate. You then type your program in: - -``` -10 ?"COMMODORE 64" -20 GOTO 10 -``` - -The 10 and the 20, the manual explains, are line numbers. They order the statements for the computer. They also allow the programmer to refer to other lines of the program in certain commands, just like you’ve done here with the `GOTO` command, which directs the program back to line 10. “It is good programming practice,” the manual opines, “to number lines in increments of 10—in case you need to insert some statements later on.” - -You type `RUN` and stare as the screen clogs with “COMMODORE 64,” repeated over and over. - -![Commodore 64 showing result of printing "Commodore 64" repeatedly][10] - -You’re not certain that this isn’t going to blow up your computer. It takes you a second to remember that you are supposed to hit the `RUN/STOP` key to break the loop. - -The next few sections of the manual teach you about variables, which the manual tells you are like “a number of boxes within the computer that can each hold a number or a string of text characters.” Variables that end in a `%` symbol are whole numbers, while variables ending in a `$` symbol are strings of characters. All other variables are something called “floating point” variables. The manual warns you to be careful with variable names because only the first two letters of the name are actually recognized by the computer, even though nothing stops you from making a name as long as you want it to be. (This doesn’t particularly bother you, but you could see how 30 years from now this might strike someone as completely insane.) - -You then learn about the `IF... THEN...` and `FOR... NEXT...` constructs. With all these new tools, you feel equipped to tackle the next big challenge the manual throws at you. “If you’re the ambitious type,” it goads, “type in the following program and see what happens.” The program is longer and more complicated than any you have seen so far, but you’re dying to know what it does: - -``` -10 REM BOUNCING BALL -20 PRINT "{CLR/HOME}" -25 FOR X = 1 TO 10 : PRINT "{CRSR/DOWN}" : NEXT -30 FOR BL = 1 TO 40 -40 PRINT " ●{CRSR LEFT}";:REM (● is a Shift-Q) -50 FOR TM = 1 TO 5 -60 NEXT TM -70 NEXT BL -75 REM MOVE BALL RIGHT TO LEFT -80 FOR BL = 40 TO 1 STEP -1 -90 PRINT " {CRSR LEFT}{CRSR LEFT}●{CRSR LEFT}"; -100 FOR TM = 1 TO 5 -110 NEXT TM -120 NEXT BL -130 GOTO 20 -``` - -The program above takes advantage of one of the Commodore 64’s coolest features. Non-printable command characters, when passed to the `PRINT` command as part of a string, just do the action they usually perform instead of printing to the screen. This allows you to replay arbitrary chains of commands by printing strings from within your programs. - -It takes you a long time to type in the above program. You make several mistakes and have to re-enter some of the lines. But eventually you are able to type `RUN` and behold a masterpiece: - -![Commodore 64 bouncing ball][11] - -You think that this is a major contender for the coolest thing you have ever seen. You forget about it almost immediately though, because once you’ve learned about BASIC’s built-in functions like `RND` (which returns a random number) and `CHR$` (which returns the character matching a given number code), the manual shows you a program that many years from now will still be famous enough to be made the title of an [essay anthology][12]: - -``` -10 PRINT "{CLR/HOME}" -20 PRINT CHR$(205.5 + RND(1)); -40 GOTO 20 -``` - -When run, the above program produces a random maze: - -![Commodore 64 maze program][13] - -This is definitely the coolest thing you have ever seen. - -### PEEK and POKE - -You’ve now made it through the first four chapters of the Commodore 64 manual, including the chapter titled “Advanced BASIC,” so you’re feeling pretty proud of yourself. You’ve learned a lot this Saturday morning. But this afternoon (after a quick lunch break), you’re going to learn something that will make this magical machine in your living room much less mysterious. - -The next chapter in the manual is titled “Advanced Color and Graphic Commands.” It starts off by revisiting the colored bars that you were able to type out first thing this morning and shows you how you can do the same thing from a program. It then teaches you how to change the background colors of the screen. - -In order to do this, you need to use the BASIC `PEEK` and `POKE` commands. Those commands allow you to, respectively, examine and write to a memory address. The Commodore 64 has a main background color and a border color. Each is controlled by a specially designated memory address. You can write any color value you would like to those addresses to make the background or border that color. - -The manual explains: - -> Just as variables can be thought of as a representation of “boxes” within the machine where you placed your information, you can also think of some specially defined “boxes” within the computer that represent specific memory locations. -> -> The Commodore 64 looks at these memory locations to see what the screen’s background and border color should be, what characters are to be displayed on the screen—and where—and a host of other tasks. - -You write a program to cycle through all the available combinations of background and border color: - -``` -10 FOR BA = 0 TO 15 -20 FOR BO = 0 TO 15 -30 POKE 53280, BA -40 POKE 53281, BO -50 FOR X = 1 TO 500 : NEXT X -60 NEXT BO : NEXT BA -``` - -While the `POKE` commands, with their big operands, looked intimidating at first, now you see that the actual value of the number doesn’t matter that much. Obviously, you have to get the number right, but all the number represents is a “box” that Commodore just happened to store at address 53280. This box has a special purpose: Commodore uses it to determine what color the screen’s background should be. - -![Commodore 64 changing background colors][14] - -You think this is pretty neat. Just by writing to a special-purpose box in memory, you can control a fundamental property of the computer. You aren’t sure how the Commodore 64’s circuitry takes the value you write in memory and changes the color of the screen, but you’re okay not knowing that. At least you understand everything up to that point. - -### Special Boxes - -You don’t get through the entire manual that Saturday, since you are now starting to run out of steam. But you do eventually read all of it. In the process, you learn about many more of the Commodore 64’s special-purpose boxes. There are boxes you can write to control what is on screen—one box, in fact, for every place a character might appear. In chapter six, “Sprite Graphics,” you learn about the special-purpose boxes that allow you to define images that can be moved around and even scaled up and down. In chapter seven, “Creating Sound,” you learn about the boxes you can write to in order to make your Commodore 64 sing “Michael Row the Boat Ashore.” The Commodore 64, it turns out, has very little in the way of what you would later learn is called an API. Controlling the Commodore 64 mostly involves writing to memory addresses that have been given special meaning by the circuitry. - -The many years you ultimately spend writing to those special boxes stick with you. Even many decades later, when you find yourself programming a machine with an extensive graphics or sound API, you know that, behind the curtain, the API is ultimately writing to those boxes or something like them. You will sometimes wonder about younger programmers that have only ever used APIs, and wonder what they must think the API is doing for them. Maybe they think that the API is calling some other, hidden API. But then what do think that hidden API is calling? You will pity those younger programmers, because they must be very confused indeed. - -If you enjoyed this post, more like it come out every two weeks! Follow [@TwoBitHistory][15] on Twitter or subscribe to the [RSS feed][16] to make sure you know when a new post is out. - -Previously on TwoBitHistory… - -> Have you ever wondered what a 19th-century computer program would look like translated into C? -> -> This week's post: A detailed look at how Ada Lovelace's famous program worked and what it was trying to do. -> -> — TwoBitHistory (@TwoBitHistory) [August 19, 2018][17] - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2018/09/02/learning-basic.html - -作者:[Two-Bit History][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://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: https://www.youtube.com/watch?v=kZRE7HIO3vk -[2]: https://en.wikipedia.org/wiki/BASIC_Computer_Games -[3]: https://www.youtube.com/watch?v=ZekAbt2o6Ms -[4]: https://www.npr.org/sections/money/2014/10/21/357629765/when-women-stopped-coding -[5]: https://www.youtube.com/watch?v=MA_XtT3VAVM -[6]: https://twobithistory.org/images/c64_startup.png -[7]: https://twobithistory.org/images/c64_error.png -[8]: ftp://www.zimmers.net/pub/cbm/c64/manuals/C64_Users_Guide.pdf -[9]: https://twobithistory.org/images/c64_colors.png -[10]: https://twobithistory.org/images/c64_print_loop.png -[11]: https://twobithistory.org/images/c64_ball.gif -[12]: http://10print.org/ -[13]: https://twobithistory.org/images/c64_maze.gif -[14]: https://twobithistory.org/images/c64_background.gif -[15]: https://twitter.com/TwoBitHistory -[16]: https://twobithistory.org/feed.xml -[17]: https://twitter.com/TwoBitHistory/status/1030974776821665793?ref_src=twsrc%5Etfw diff --git a/translated/tech/20180902 Learning BASIC Like It-s 1983.md b/translated/tech/20180902 Learning BASIC Like It-s 1983.md new file mode 100644 index 0000000000..5640ad3d95 --- /dev/null +++ b/translated/tech/20180902 Learning BASIC Like It-s 1983.md @@ -0,0 +1,184 @@ +学习 BASIC 像它的1983年 +====== +我没有生活在1983年.我偶尔有一些遗憾。我相当遗憾,我没有体验8位计算机时代的到来,因为我认为第一次遇到相对简单和过于受约束的计算机的人们,有超过我们的一些人的巨大的优势。 + +今天,(大多数)每个人知道如何使用一台计算机,但是很少有人,甚至是在计算机工业中,明白在一些单台机器内部正在发生什么的全部。现在有[如此多软件层次][1]努力来识别必不可少的部分来做如此多不同的事情。在1983年,虽然,家用电脑足够简单,一个用功的人能学到一台特定计算机是如何工作的。现在这人可能比我通过所有堆积在硬件顶部的现代操作系统的抽象概念较少迷惑。我认为像他们采用的这些抽象概念的层次是容易一个接一个理解的;今天,新的程序员不得不通过自上而下的逆流时间上的工作来尝试理解它们。 + +很多著名的程序员,尤其在计算机游戏工业,童年在8位计算机上开始编程游戏,像,苹果 II 和 Commodore 64。John Romero, Richard Garriott,和 Chris Roberts 都是例子。如何发生是容易看到的。在8位计算机时代,很多游戏仅可在计算机杂质和[书籍][2]中作为印刷的BASIC列表获得。如果你想玩这些游戏中其中一个,你不得手工不键入完整的程序。不可避免的,你可能得到一些错误,所以你可能不得不调试你的程序。等到你获得它工作, 你充分知道程序如何起作用来开始你自己修改它。如果你是一个着迷的游戏玩家,你不可避免地也成为一个好的程序员。 + +在童年我也玩电脑游戏。但是我玩的游戏在只读光盘上。我有时发现我自己不得不搜索如何修复一个崩溃的安装器,这可能涉及编辑 Windows 注册表或一些像这样的事情。这类少数的使用计算机来考虑在大学中学习计算机科学的故障诊断可能使我足够舒适。但是在大学中从不教我一些关键性的关于计算机如何工作或如何控制它们的事。 + +当然,现在我告诉计算机为了活动而做什么。尽管如此,我请不自觉地感到,我缺少一些基本的仅被给予这些成长为简单编程的计算机人的深刻见解。在20世纪80年代初,第一次偶然遇到计算机会是什么样子?与今天使用计算机的经验相比会有怎样的不同? + +这篇张贴文将与通常的二位历史贴文有一点不同,因为我将为这些问题尝试设想一个答案。 + +### 1983 + +仅仅是上周,你在电视上看到 [Commodore 64 广告][3] ,现在 M*A*S*H 结束了,在星期一晚上,你正在市场上采购没做过的一些东西。这个 Commodore 64 甚至看起来比 Apple II 更好,鲁迪(译者注:应该是拥有 Apple II 的人)的家人在他们的地下室。而且,广告承诺新的计算机将一会携带朋友们“击倒”你的门。你知道一些在学校的人们只要他们能在这里玩 Zork,他们宁愿在你的家里过把瘾,也不愿呆在鲁迪的家里。 + +所以,你说服你的父母去买一台.你的妈妈说,她们可以考虑它,如果有一台家庭电脑,意味着你离开娱乐厅。你勉强同意。你的爸爸想,他可以开始在 MultiPlan (译注:电子表格程序)中跟踪家庭的资金。 MultiPlan 是他曾听到过的电子表格程序, 这是为什么计算机放在客厅的原因。然而,一年后,你将是唯一仍然使用它的人。你最终被允许把它放到你的卧室中的桌子上,正好在你的警察海报下面。 + +(你的姐姐抗议这个决定,但是,它是在1983年,并且计算机[不是给她][4]。) + +父亲在从工作到回家的路上从 [ComputerLand][5] 处拿到它。你俩把盒子放置在电视机的旁边,并打开它。外包装上说“欢迎来到友好的计算机世界”。二十分钟以后,你不确信—你俩仍然试图来连接 Commodore 到电视机,并且想知道是否电视机的天线电缆是75欧姆或300欧姆同轴电缆。但是,你最终能够转到你的电视机到频道3,并看到一个粒状的,紫色的图像。 + +![Commodore 64 启动屏幕][6] + +计算机报告,`READY`。你的爸爸把计算机推向你,标志着你应该第一个人来给它一个尝试。你小心翼翼地敲击每个字母,键入,`HELLO`。计算机的回应是令人困惑的。 + +![Commodore 64 语法错误][7] + +你尝试输入一些很少变化的不同的单词,但是回应总是相同的。你的爸爸说,你最好通读手册的剩余部分。这可能不意味着是秘籍—[随 Commodore 64 一起提供的手册][8] 是一小本书。但是这不会困住你,因为手册的引进是奇迹的预兆。 + +Commodore 64,它声称,有“微型计算机工业中最高级的图画制作器”,能允许“设计你拥有四种不同颜色的图画,就像你在看到的街机电子游戏”。Commodore 64 也有“内置的音乐和声音效果,比得上很多著名的语言音响合成器”。所有的这些工具将被放到你的手上,因为手册将陪伴你贯穿它全部: + +> 正像与所有可用的硬件重要一样,这本用户的指南将帮助你详尽阐述你的计算机的理解。它不会在这里告诉你有必要知道的关于计算机的任何事,但是它将谈及你到一个关于涉及的主题的详细情报方面的种类繁多的出版物。Commodore 希望你来真正地享受你的新 COMMODORE 64 。并且来玩得开心,记住:编程不是你能在一天内就学会的一种东西。你自己要有耐心,因为你将翻阅用户指南。 + +那一夜,在床上,你通读整个前三个章节—“安装”,“入门”,和“开始 BASIC 编程”—在最终抵挡不住睡意前,手册被交叉放在胸前。 + +### Commodore BASIC + +现在是星期六早上,你急于尝试你已经学到的什么。手册教你如何做的第一件事是更改在显示器上的颜色。你仿效指令,按下 `CTRL-9` 来进入相反的情况的类型模式,然后拖住空格键来创建长行。你可以使用 `CTRL-1` 到 `CTRL-8` 在不同的颜色之间交换,在电视机屏幕上陶醉于你的突然的新的力量。 + +![Commodore 64 颜色带][9] + +尽管这很酷,你意识到它不算为编程。为了编程计算机,你昨晚已经学到,你必须以一种称为 BASIC 的语言与计算机交谈。对于你,BASIC 看起来像星球大战外的一些东西,但是,到1983年,BASIC 大约二十年了。它由两位达特茅斯教授,John Kemeny 和 Tom Kurtz 发明,他们想让社会科学和人文科学中的本科生可访问计算机。它在微型计算机上是普遍地可用的,并流行在大学数学课中。在比尔盖茨和保罗艾伦为 Altair 编写 MicroSoft BASIC 解释器后,在微型计算机上变成标准。但是手册没有任何解释这个,并且你很多年不会学到它。 + +手册建议你尝试中的第一个 BASIC 命令是 `PRINT` 命令。你慢慢地键入 `PRINT "COMMODORE 64"`,因为你花费一点时间来在`2`按键上面找到引号符号。你单击 `RETURN` ,这一次,并不是抱怨,计算机准确地做你告诉它去做的事,并在下一行中显示 “COMMODORE 64” 。 + +现在你尝试在各种各样不同的东西上使用 `PRINT` 命令:两个数字加在一起,两个数字乘在一起,甚至几个十进制数字。你停止输入 `PRINT` ,并使用 `?` 代替,因为手册已经正式告知你 `?` 是 `PRINT` 的一个缩写,通常被专业程序员使用。你感觉已经像一个专家,不过你想起你还没有看“开始 BASIC 编程”的三个章节。 + +你不久达到目的。该章节开始催促你来写你的第一个真正的 BASIC 程序。你输入 `NEW` 并单击 `RETURN`,这给你一个干净黑板(slate)。然后你在其中输入你的程序: + +``` +10 ?"COMMODORE 64" +20 GOTO 10 +``` + +手册解释,10和20是行号。它们为计算机排序语句。它们也允许程序员来引用在某系命令中程序的其它行,正像你已经完成的 `GOTO` 命令, 它监督程序回到行10。“它是好的编程惯例”,手册认为,“以10的增量来编号行—以备你以后需要插入一些语句”。 + +你输入 `RUN` ,并盯着用“COMMODORE 64”堵塞的屏幕 ,重复的一遍又一遍。 + +![Commodore 64 显示反复打印 "Commodore 64" 的结果][10] + +你不确定这不会引爆你的计算机。它花费一秒钟才想起你应该单击 `RUN/STOP` 按键来打断循环。 + +手册接下来的一些部分教你变量,手册告诉你变量像“在计算机中许多的暗盒,它们每个可以容纳一个数字或一个文本字符的字符串”。以一个 `%` 符号结尾的变量是一个整数,与此同时,以一个 `$` 符号结尾的变量是一个字符字符串。其余的所有变量是一些称为“浮点”变量的东西。手册警告你小心变量名称,因为计算机仅识别变量名称的前两个字母,尽管不阻止你想要的名称长度。(这并不是特别困扰你,但是你可能看到今后30年,这可能打击一些人像彻底地精神失常一样)。 + +你接着学习 `IF... THEN...` 和 `FOR... NEXT...` 结构体。有所有的这些新的工具,你感觉有能力来解决的接下来的手册扔给你的大挑战。“如果你是有野心的人”,很好,“输入下面的程序,并查看会发生什么”。该程序比你目前已经看到的程序更长、更复杂,但是,你渴望知道它将做什么: + +``` +10 REM BOUNCING BALL +20 PRINT "{CLR/HOME}" +25 FOR X = 1 TO 10 : PRINT "{CRSR/DOWN}" : NEXT +30 FOR BL = 1 TO 40 +40 PRINT " ●{CRSR LEFT}";:REM (● is a Shift-Q) +50 FOR TM = 1 TO 5 +60 NEXT TM +70 NEXT BL +75 REM MOVE BALL RIGHT TO LEFT +80 FOR BL = 40 TO 1 STEP -1 +90 PRINT " {CRSR LEFT}{CRSR LEFT}●{CRSR LEFT}"; +100 FOR TM = 1 TO 5 +110 NEXT TM +120 NEXT BL +130 GOTO 20 +``` + +上面的程序利用 Commodore 64 最酷的特色之一。不可打印的命令字符,当传递到 `PRINT` 命令时,作为字符串的一部分,仅仅做它们通常执行的动作,而不是打印到屏幕。这允许你通过打印来自你程序中的字符串来重演任意的命令链。 + +输入上面的程序花费很长时间。你犯一些错误,并不得不重新输入一些行。但是,你最终能够输入 `RUN` ,并看见一个杰作: + +![Commodore 64 反弹球][11] + +你认为这是你见过的最酷的事是一个主要的竞争者。不过你几乎立即忘记它,因为一旦你已经学习 BASIC 的内置的函数,像 `RND` (它返回一个随机数字) 和 `CHR$` (它返回匹配一个给定数字的字符),手册向你展示一个很多年的程序,到现在仍然足够著名,能够成为一个[论文选集][12]的题目 + +``` +10 PRINT "{CLR/HOME}" +20 PRINT CHR$(205.5 + RND(1)); +40 GOTO 20 +``` + +当运行时,上面的程序产生一个随机的迷宫: + +![Commodore 64 迷宫程序][13] + +这肯定是你曾经见过最酷的事。 + +### PEEK 和 POKE + +你现在看过 Commodore 64 手册的前四章节,包含标题为“高级的 BASIC” 的章节, 所以你觉得你自己十分自豪。这个星期六早上,你已经学习很多东西。但是这个下午(在一个快速午餐打断后),你继续去学习一些东西,这将使这个在你的客厅中奇妙的机器变得更不神秘。 + +在手册中的下一个章节被标题为“高级颜色和图像命令”。以通过再次讨论颜色条开始,你能够输入我们这个早上的第一件事,并向你显示你如何能够从一个程序中做相同的事。然后它教你如何更改屏幕的背景颜色。 + +为此,你需要使用最简单的 `PEEK` 和 `POKE` 命令。这些命令分别允许你来检查和写到存储器地址。Commodore 64 有一个主要背景颜色和一个边界背景颜色。每个颜色通过一个特定的内存地址控制。你可以写任何你喜欢的这些地址的颜色值到背景颜色或边界颜色。 + +手册解释: + +> 正像变量可以被认为在机器中的一种放置你的信息的表现形式,你也可以认为在计算机中代表特殊内存位置的一些特殊定义的“容器”。 +> +> Commodore 64 寻找这些内存位置来查看屏幕的背景和边界应该是什么样的颜色,什么样的字符能够被显示在屏幕上—在哪里—很多其它的任务。 + +你写一个程序来循环所有可用的背景和边界的颜色的混合体: + +``` +10 FOR BA = 0 TO 15 +20 FOR BO = 0 TO 15 +30 POKE 53280, BA +40 POKE 53281, BO +50 FOR X = 1 TO 500 : NEXT X +60 NEXT BO : NEXT BA +``` + +虽然 `POKE` 命令,带有它们的大量的运算数,开始时看起来很吓人,现在你看到数字的真实的值不是很要紧。明显地,你不得不获取正确的数字,但是所有的数字代表的是一个 Commodore 正好出现在存储在地址53280处的“容器”。这个容器有一个特殊的用途: Commodore 使用它来决定屏幕背景应该是什么颜色。 + +![Commodore 64 更改背景颜色][14] + +你认为这是非常有条理的. 仅仅通过写入内存中一个特殊目的的容器中,你可以控制一台计算机的基础属性。你不确定 Commodore 64 的电路系统如何使用你写图内存中的值,并更改屏幕的颜色,但是,你不知道这些也没事。至少你理解到这点的每一件事。 + +### 特殊容器 + +那个周六,你没有读完整本手册,因为你现在开始精疲力尽。但是你终于读完它的全部。在这个过程中,你学到更多关于 Commodore 64 的特殊目的容器。它们是你可以写的容器来控制在屏幕上是什么—一个容器,事实上,每一个位置都可能出现一个角色f。在第六章节中,“小精灵图形”,你学到特殊目的容器允许你来定义能被四周移动和甚至缩放的图像。在第七章节中,“创建声音”,你学到你能写入的容器以便使你的 Commodore 64 歌唱 “Michael Row the Boat Ashore”。Commodore 64,转到外面,你可能以后学习一个称为 API 的非常有限的方法。控制 Commodore 64 大多涉及通过电路系统给定特殊意义来写到内存地址。 + +你最终花费很多年写到这些粘住你的特殊容器。甚至几十年后,当你发现你自己用一组大量的图形或声音 API 编程一个机器时,你知道 API ,在隐蔽物的后面, API 最终是写到这些容器或一些像它们的东西。你有时会怀疑曾经使用过 API 的年轻程序员,他们一定会好奇并思考 API 正在为他们做什么。可能他们认为 API 正在调用一些其它隐藏的 API 。但是,随后思考隐藏的 API 正在调用什么?你同情这些年轻的程序员,因为他们一定非常迷惑。 + +如果你喜欢这篇张贴文, 更喜欢它每两周出来一次!在Twitter上关注 [@TwoBitHistory][15] 或订阅[ RSS 源][16]来确保你知道新的张贴文出来的时间。 + +先前关于TwoBitHistory… + +> 你曾经好奇一个19世纪计算机程序翻译到 C 语言程序的可能的样子吗? +> +> 这周帖子: 一个详细的说明查看,Ada Lovelace 的著名程序的工作,和它将尝试去做什么。 +> +> — TwoBitHistory (@TwoBitHistory) [2018年8月19日][17] + +-------------------------------------------------------------------------------- + +通过:https://twobithistory.org/2018/09/02/learning-basic.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: https://www.youtube.com/watch?v=kZRE7HIO3vk +[2]: https://en.wikipedia.org/wiki/BASIC_Computer_Games +[3]: https://www.youtube.com/watch?v=ZekAbt2o6Ms +[4]: https://www.npr.org/sections/money/2014/10/21/357629765/when-women-stopped-coding +[5]: https://www.youtube.com/watch?v=MA_XtT3VAVM +[6]: https://twobithistory.org/images/c64_startup.png +[7]: https://twobithistory.org/images/c64_error.png +[8]: ftp://www.zimmers.net/pub/cbm/c64/manuals/C64_Users_Guide.pdf +[9]: https://twobithistory.org/images/c64_colors.png +[10]: https://twobithistory.org/images/c64_print_loop.png +[11]: https://twobithistory.org/images/c64_ball.gif +[12]: http://10print.org/ +[13]: https://twobithistory.org/images/c64_maze.gif +[14]: https://twobithistory.org/images/c64_background.gif +[15]: https://twitter.com/TwoBitHistory +[16]: https://twobithistory.org/feed.xml +[17]: https://twitter.com/TwoBitHistory/status/1030974776821665793?ref_src=twsrc%5Etfw From b910835b119a8c5370ddc9f53d7e53e389afe3c4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 6 Jun 2019 08:29:15 +0800 Subject: [PATCH 0769/1154] PRF:20190517 Using Testinfra with Ansible to verify server state.md @geekpi --- ...fra with Ansible to verify server state.md | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/translated/tech/20190517 Using Testinfra with Ansible to verify server state.md b/translated/tech/20190517 Using Testinfra with Ansible to verify server state.md index c0c631ccd2..98861a65b7 100644 --- a/translated/tech/20190517 Using Testinfra with Ansible to verify server state.md +++ b/translated/tech/20190517 Using Testinfra with Ansible to verify server state.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using Testinfra with Ansible to verify server state) @@ -9,17 +9,18 @@ 使用 Testinfra 和 Ansible 验证服务器状态 ====== -Testinfra 是一个功能强大的库,可用于编写测试来验证基础设施的状态。另外与 Ansible 和 Nagios 相结合,提供了一个用于架构即代码 (IaC) 的简单解决方案。 + +> Testinfra 是一个功能强大的库,可用于编写测试来验证基础设施的状态。另外它与 Ansible 和 Nagios 相结合,提供了一个用于架构即代码 (IaC) 的简单解决方案。 + ![Terminal command prompt on orange background][1] -根据设计,[Ansible][2] 传递机器的期望状态,以确保 Ansible playbook 或角色的内容部署到目标机器上。但是,如果你需要确保所有基础架构更改都在 Ansible 中,该怎么办?或者随时验证服务器的状态? +根据设计,[Ansible][2] 传递机器的期望状态,以确保 Ansible 剧本或角色的内容部署到目标机器上。但是,如果你需要确保所有基础架构更改都在 Ansible 中,该怎么办?或者想随时验证服务器的状态? [Testinfra][3] 是一个基础架构测试框架,它可以轻松编写单元测试来验证服务器的状态。它是一个 Python 库,使用强大的 [pytest][4] 测试引擎。 ### 开始使用 Testinfra -可以使用 Python 包管理器 (pip) 和 Python 虚拟环境轻松安装 Testinfra。 - +可以使用 Python 包管理器(`pip`)和 Python 虚拟环境轻松安装 Testinfra。 ``` $ python3 -m venv venv @@ -27,8 +28,7 @@ $ source venv/bin/activate (venv) $ pip install testinfra ``` -Testinfra 也可以使用 EPEL 仓库的 Fedora 和 CentOS 中使用。例如,在 CentOS 7 上,你可以使用以下命令安装它: - +Testinfra 也可以通过 Fedora 和 CentOS 的 EPEL 仓库中使用。例如,在 CentOS 7 上,你可以使用以下命令安装它: ``` $ yum install -y epel-release @@ -37,8 +37,7 @@ $ yum install -y python-testinfra #### 一个简单的测试脚本 -在 Testinfra 中编写测试很容易。使用你选择的代码编辑器,将以下内容添加到名为 **test_simple.py** 的文件中: - +在 Testinfra 中编写测试很容易。使用你选择的代码编辑器,将以下内容添加到名为 `test_simple.py` 的文件中: ``` import testinfra @@ -50,11 +49,10 @@ def test_sshd_inactive(host): assert host.service("sshd").is_running is False ``` -默认情况下,Testinfra 为测试用例提供了一个主机对象,该对象能访问不同的辅助模块。例如,第一个测试使用 **file** 模块来验证主机上文件的内容,第二个测试用例使用 **service** 模块来检查 systemd 服务的状态。 +默认情况下,Testinfra 为测试用例提供了一个 `host` 对象,该对象能访问不同的辅助模块。例如,第一个测试使用 `file` 模块来验证主机上文件的内容,第二个测试用例使用 `service` 模块来检查 systemd 服务的状态。 要在本机运行这些测试,请执行以下命令: - ``` (venv)$ pytest test_simple.py ================================ test session starts ================================ @@ -71,10 +69,9 @@ test_simple.py .. ### Testinfra 和 Ansible -Testinfra 支持的后端之一是 Ansible,这意味着 Testinfra 可以直接使用 Ansible 的 inventory 文件和 inventory 中定义的一组机器来对它们进行测试。 - -我们使用以下 inventory 文件作为示例: +Testinfra 支持的后端之一是 Ansible,这意味着 Testinfra 可以直接使用 Ansible 的清单文件和清单中定义的一组机器来对它们进行测试。 +我们使用以下清单文件作为示例: ``` [web] @@ -85,8 +82,7 @@ app-frontend02 db-backend01 ``` -我们希望确保我们的 Apache Web 服务器在 **app-frontend01** 和 **app-frontend02** 上运行。让我们在名为 **test_web.py** 的文件中编写测试: - +我们希望确保我们的 Apache Web 服务器在 `app-frontend01` 和 `app-frontend02` 上运行。让我们在名为 `test_web.py` 的文件中编写测试: ``` def check_httpd_service(host): @@ -102,11 +98,11 @@ def check_httpd_service(host): (venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible test_web.py ``` -在调用测试时,我们使用 Ansible inventory 的 **[web]** 组作为目标计算机,并指定我们要使用 Ansible 作为连接后端。 +在调用测试时,我们使用 Ansible 清单文件的 `[web]` 组作为目标计算机,并指定我们要使用 Ansible 作为连接后端。 #### 使用 Ansible 模块 -Testinfra 还为 Ansible 提供了一个很好的可用于测试的 API。该 Ansible 模块能够在 测试中运行 Ansible play,并且能够轻松检查 play 的状态。 +Testinfra 还为 Ansible 提供了一个很好的可用于测试的 API。该 Ansible 模块能够在测试中运行 Ansible 动作,并且能够轻松检查动作的状态。 ``` def check_ansible_play(host): @@ -117,15 +113,15 @@ def check_ansible_play(host): assert not host.ansible("package", "name=httpd state=present")["changed"] ``` -B默认情况下,Ansible 的[检查模式][6]已启用,这意味着 Ansible 将报告在远程主机上执行 play 时会发生的变化。 +默认情况下,Ansible 的[检查模式][6]已启用,这意味着 Ansible 将报告在远程主机上执行动作时会发生的变化。 ### Testinfra 和 Nagios -现在我们可以轻松地运行测试来验证机器的状态,我们可以使用这些测试来触发监控系统上的警报。这是捕获意外更改的好方法。 +现在我们可以轻松地运行测试来验证机器的状态,我们可以使用这些测试来触发监控系统上的警报。这是捕获意外的更改的好方法。 -Testinfra 提供了与 [Nagios][7] 的集成,它是一种流行的监控解决方案。默认情况下,Nagios 使用 [NRPE][8] 插件对远程主机进行检查,但使用 Testinfra 可以直接从 Nagios master 上运行测试。 +Testinfra 提供了与 [Nagios][7] 的集成,它是一种流行的监控解决方案。默认情况下,Nagios 使用 [NRPE][8] 插件对远程主机进行检查,但使用 Testinfra 可以直接从 Nagios 主控节点上运行测试。 -要使 Testinfra 输出与 Nagios 兼容,我们必须在触发测试时使用 **\--nagios** 标志。我们还使用 **-qq** 这个 pytest 标志来启用 pytest 的**静默**模式,这样就不会显示所有测试细节。 +要使 Testinfra 输出与 Nagios 兼容,我们必须在触发测试时使用 `--nagios` 标志。我们还使用 `-qq` 这个 pytest 标志来启用 pytest 的静默模式,这样就不会显示所有测试细节。 ``` (venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible --nagios -qq line test.py @@ -141,7 +137,7 @@ via: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-s 作者:[Clement Verna][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/) 荣誉推出 From 11323348c00428f52f2e80e557447e1e4a33fc2a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 6 Jun 2019 08:29:43 +0800 Subject: [PATCH 0770/1154] PUB:20190517 Using Testinfra with Ansible to verify server state.md @geekpi https://linux.cn/article-10943-1.html --- ...517 Using Testinfra with Ansible to verify server state.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190517 Using Testinfra with Ansible to verify server state.md (98%) diff --git a/translated/tech/20190517 Using Testinfra with Ansible to verify server state.md b/published/20190517 Using Testinfra with Ansible to verify server state.md similarity index 98% rename from translated/tech/20190517 Using Testinfra with Ansible to verify server state.md rename to published/20190517 Using Testinfra with Ansible to verify server state.md index 98861a65b7..9b2dc01e26 100644 --- a/translated/tech/20190517 Using Testinfra with Ansible to verify server state.md +++ b/published/20190517 Using Testinfra with Ansible to verify server state.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10943-1.html) [#]: subject: (Using Testinfra with Ansible to verify server state) [#]: via: (https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state) [#]: author: (Clement Verna https://opensource.com/users/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert) From 03de7cbb6265564a9cc9fe4c4f20dac4d2074c7e Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 6 Jun 2019 08:59:57 +0800 Subject: [PATCH 0771/1154] translated --- ...27 A deeper dive into Linux permissions.md | 172 ----------------- ...27 A deeper dive into Linux permissions.md | 173 ++++++++++++++++++ 2 files changed, 173 insertions(+), 172 deletions(-) delete mode 100644 sources/tech/20190527 A deeper dive into Linux permissions.md create mode 100644 translated/tech/20190527 A deeper dive into Linux permissions.md diff --git a/sources/tech/20190527 A deeper dive into Linux permissions.md b/sources/tech/20190527 A deeper dive into Linux permissions.md deleted file mode 100644 index 79a58e97bb..0000000000 --- a/sources/tech/20190527 A deeper dive into Linux permissions.md +++ /dev/null @@ -1,172 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A deeper dive into Linux permissions) -[#]: via: (https://www.networkworld.com/article/3397790/a-deeper-dive-into-linux-permissions.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -A deeper dive into Linux permissions -====== -Sometimes you see more than just the ordinary r, w, x and - designations when looking at file permissions on Linux. How can you get a clearer view of what the uncommon charactrers are trying to tell you and how do these permissions work? -![Sandra Henry-Stocker][1] - -Sometimes you see more than just the ordinary **r** , **w** , **x** and **-** designations when looking at file permissions on Linux. Instead of **rwx** for the owner, group and other fields in the permissions string, you might see an **s** or **t** , as in this example: - -``` -drwxrwsrwt -``` - -One way to get a little more clarity on this is to look at the permissions with the **stat** command. The fourth line of stat’s output displays the file permissions both in octal and string format: - -``` -$ stat /var/mail - File: /var/mail - Size: 4096 Blocks: 8 IO Block: 4096 directory -Device: 801h/2049d Inode: 1048833 Links: 2 -Access: (3777/drwxrwsrwt) Uid: ( 0/ root) Gid: ( 8/ mail) -Access: 2019-05-21 19:23:15.769746004 -0400 -Modify: 2019-05-21 19:03:48.226656344 -0400 -Change: 2019-05-21 19:03:48.226656344 -0400 - Birth: - -``` - -This output reminds us that there are more than nine bits assigned to file permissions. In fact, there are 12. And those extra three bits provide a way to assign permissions beyond the usual read, write and execute — 3777 (binary 011111111111), for example, indicates that two extra settings are in use. - -The first **1** (second bit) in this particular value represents the SGID (set group ID) and assigns temporary permission to run the file or use the directory with the permissions of the associated group. - -``` -011111111111 - ^ -``` - -**SGID** gives temporary permissions to the person using the file to act as a member of that group. - -The second **1** (third bit) is the “sticky” bit. It ensures that _only_ the owner of the file is able to delete or rename the file or directory. - -``` -011111111111 - ^ -``` - -Had the permissions been 7777 rather than 3777, we’d have known that the SUID (set UID) field had also been set. - -``` -111111111111 -^ -``` - -**SUID** gives temporary permissions to the user using the file to act as the file owner. - -As for the /var/mail directory which we looked at above, all users require some access so some special values are required to provide it. - -But now let’s take this a step further. - -One of the common uses of the special permission bits is with commands like the **passwd** command. If you look at the /usr/bin/passwd file, you’ll notice that the SUID bit is set, allowing you to change your password (and, thus, the contents of the /etc/shadow file) even when you’re running as an ordinary (not a privileged) user and have no read or write access to this file. Of course, the passwd command is clever enough not to allow you to change other people's passwords unless you are actually running as root or using sudo. - -``` -$ ls -l /usr/bin/passwd --rwsr-xr-x 1 root root 63736 Mar 22 14:32 /usr/bin/passwd -$ ls -l /etc/shadow --rw-r----- 1 root shadow 2195 Apr 22 10:46 /etc/shadow -``` - -Now, let’s look at what you can do with the these special permissions. - -### How to assign special file permissions - -As with many things on the Linux command line, you have some choices on how you make your requests. The **chmod** command allows you to change permissions numerically or using character expressions. - -To change file permissions numerically, you might use a command like this to set the setuid and setgid bits: - -``` -$ chmod 6775 tryme -``` - -Or you might use a command like this: - -``` -$ chmod ug+s tryme <== for SUID and SGID permissions -``` - -If the file that you are adding special permissions to is a script, you might be surprised that it doesn’t comply with your expectations. Here’s a very simple example: - -``` -$ cat tryme -#!/bin/bash - -echo I am $USER -``` - -Even with the SUID and SGID bits set and the file root-owned file, running a script like this won’t yield the “I am root” response you might expect. Why? Because Linux ignores the set-user-ID and set-group-ID bits on scripts. - -``` -$ ls -l tryme --rwsrwsrwt 1 root root 29 May 26 12:22 tryme -$ ./tryme -I am jdoe -``` - -If you try something similar using a compiled program, on the other hand, as with this simple C program, you’ll see a different effect. In this example program, we prompt the user to enter a file and create it for them, giving the file write permission. - -``` -#include - -int main() -{ - FILE *fp; /* file pointer*/ - char fName[20]; - - printf("Enter the name of file to be created: "); - scanf("%s",fName); - - /* create the file with write permission */ - fp=fopen(fName,"w"); - /* check if file was created */ - if(fp==NULL) - { - printf("File not created"); - exit(0); - } - - printf("File created successfully\n"); - return 0; -} -``` - -Once you compile the program and run the commands for both making root the owner and setting the needed permissions, you’ll see that it runs with root authority as expected — leaving a newly created root-owned file. Of course, you must have sudo privileges to run some of the required commands. - -``` -$ cc -o mkfile mkfile.c <== compile the program -$ sudo chown root:root mkfile <== change owner and group to “root” -$ sudo chmod ug+s mkfile <== add SUID and SGID permissions -$ ./mkfile <== run the program -Enter name of file to be create: empty -File created successfully -$ ls -l empty --rw-rw-r-- 1 root root 0 May 26 13:15 empty -``` - -Notice that the file is owned by root — something that wouldn’t have happened if the program hadn’t run with root authority. - -The positions of the uncommon settings in the permissions string (e.g., rw **s** rw **s** rw **t** ) can help remind us what each bit means. At least the first "s" (SUID) is in the owner-permissions area and the second (SGID) is in the group-permissions area. Why the sticky bit is a "t" instead of an "s" is beyond me. Maybe the founders imagined referring to it as the "tacky bit" and changed their minds due to less flattering second definition of the word. In any case, the extra permissions settings provide a lot of additional functionality to Linux and other Unix systems. - -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/3397790/a-deeper-dive-into-linux-permissions.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/05/shs_rwsr-100797564-large.jpg -[2]: https://www.facebook.com/NetworkWorld/ -[3]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190527 A deeper dive into Linux permissions.md b/translated/tech/20190527 A deeper dive into Linux permissions.md new file mode 100644 index 0000000000..cc51b32dac --- /dev/null +++ b/translated/tech/20190527 A deeper dive into Linux permissions.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A deeper dive into Linux permissions) +[#]: via: (https://www.networkworld.com/article/3397790/a-deeper-dive-into-linux-permissions.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +更深入地了解 Linux 权限 +====== +在 Linux 上查看文件权限时,有时你会看到的不仅仅是普通的 r、w、x 和 -。如何更清晰地了解这些字符试图告诉你什么以及这些权限如何工作? +![Sandra Henry-Stocker][1] + +在 Linux 上查看文件权限时,有时你会看到的不仅仅是普通的 **r**、**w**、**x** 和 **-**。除了在所有者、组和其他中看到 **rwx** 之外,你可能会看到 **s** 或者 **t**,如下例所示: + +``` +drwxrwsrwt +``` + +要进一步明确的方法之一是使用 **stat** 命令查看权限。stat 的第四行输出以八进制和字符串格式显示文件权限: + +``` +$ stat /var/mail + File: /var/mail + Size: 4096 Blocks: 8 IO Block: 4096 directory +Device: 801h/2049d Inode: 1048833 Links: 2 +Access: (3777/drwxrwsrwt) Uid: ( 0/ root) Gid: ( 8/ mail) +Access: 2019-05-21 19:23:15.769746004 -0400 +Modify: 2019-05-21 19:03:48.226656344 -0400 +Change: 2019-05-21 19:03:48.226656344 -0400 + Birth: - +``` + +该输出提示我们,分配给文件权限的位数超过 9 位。事实上,有 12 位。这些额外的三位提供了一种分配超出通常的读、写和执行权限的方法 - 例如,3777(二进制 011111111111)表示使用了两个额外的设置。 + +该值的第一个 **1** (第二位)表示 SGID(设置组 ID)并分配运行文件的临时权限或使用有关联组权限的目录。 + +``` +011111111111 + ^ +``` + +**SGID** 将正在使用该文件的用户作为该组成员之一分配临时权限。 + +第二个 **1**(第三位)是“粘连”位。它确保_只有_文件的所有者能够删除或重命名文件或目录。 + +``` +011111111111 + ^ +``` + +如果权限是 7777 而不是 3777,我们知道 SUID(设置 UID)字段也已设置。 + +``` +111111111111 +^ +``` + +**SUID** 将正在使用该文件的用户作为文件拥有者分配临时权限。 + +至于我们上面看到的 /var/mail 目录,所有用户都需要访问,因此需要一些特殊值来提供它。 + +但现在让我们更进一步。 + +特殊权限位的一个常见用法是使用 **passwd** 之类的命令。如果查看 /usr/bin/passwd 文件,你会注意到 SUID 位已设置,它允许你更改密码(以及 /etc/shadow 文件的内容),即使你是以普通(非特权)用户身份运行,并且对此文件没有读取或写入权限。当然,passwd 命令很聪明,不允许你更改其他人的密码,除非你是以 root 身份运行或使用 sudo。 + +``` +$ ls -l /usr/bin/passwd +-rwsr-xr-x 1 root root 63736 Mar 22 14:32 /usr/bin/passwd +$ ls -l /etc/shadow +-rw-r----- 1 root shadow 2195 Apr 22 10:46 /etc/shadow +``` + +现在,让我们看一下使用这些特殊权限可以做些什么。 + +### 如何分配特殊文件权限 + +与 Linux 命令行中的许多东西一样,你可以有不同的方法设置。 **chmod** 命令允许你以数字方式或使用字符表达式更改权限。 + +要以数字方式更改文件权限,你可以使用这样的命令来设置 setuid 和 setgid 位: + +``` +$ chmod 6775 tryme +``` + +或者你可以使用这样的命令: + +``` +$ chmod ug+s tryme <== 用于 SUID 和 SGID 权限 +``` + +如果你要添加特殊权限的文件是脚本,你可能会对它不符合你的期望感到惊讶。这是一个非常简单的例子: + +``` +$ cat tryme +#!/bin/bash + +echo I am $USER +``` + +即使设置了 SUID 和 SGID 位,并且 root 是文件所有者,运行脚本也不会产生你可能期望的 “I am root”。为什么?因为 Linux 会忽略脚本的 setuid 和 setgid 位。 + +``` +$ ls -l tryme +-rwsrwsrwt 1 root root 29 May 26 12:22 tryme +$ ./tryme +I am jdoe +``` + +另一方面,如果你尝试编译程序之类,就像这个简单的 C 程序一样,你会看到不同的效果。在此示例程序中,我们提示用户输入文件名并创建它,并给文件写入权限。 + +``` +#include + +int main() +{ + FILE *fp; /* file pointer*/ + char fName[20]; + + printf("Enter the name of file to be created: "); + scanf("%s",fName); + + /* create the file with write permission */ + fp=fopen(fName,"w"); + /* check if file was created */ + if(fp==NULL) + { + printf("File not created"); + exit(0); + } + + printf("File created successfully\n"); + return 0; +} +``` + +Once you compile the program and run the commands for both making root the owner and setting the needed permissions, you’ll see that it runs with root authority as expected — leaving a newly created root-owned file. Of course, you must have sudo privileges to run some of the required commands. +编译程序并运行命令以使 root 用户成为所有者并设置所需权限后,你将看到它以预期的 root 权限运行 - 留下新创建的 root 所有者文件。当然,你必须具有 sudo 权限才能运行一些需要的命令。 + +``` +$ cc -o mkfile mkfile.c <== 编译程序 +$ sudo chown root:root mkfile <== 更改所有者和组为 “root” +$ sudo chmod ug+s mkfile <== 添加 SUID and SGID 权限 +$ ./mkfile <== 运行程序 +Enter name of file to be create: empty +File created successfully +$ ls -l empty +-rw-rw-r-- 1 root root 0 May 26 13:15 empty +``` + +请注意,文件所有者是 root - 如果程序未以 root 权限运行,则不会发生这种情况。 + +权限字符串中不常见设置的位置(例如,rw **s** rw **s** rw **t**)可以帮助提醒我们每个位的含义。至少第一个 “s”(SUID) 位于所有者权限区域中,第二个 (SGID) 位于组权限区域中。为什么粘连位是 “t” 而不是 “s” 超出了我的理解。也许创造者想把它称为 “tacky bit”,但由于这个词的不太令人喜欢的第二个定义而改变了他们的想法。无论如何,额外的权限设置为 Linux 和其他 Unix 系统提供了许多额外的功能。 + +在 [Facebook][2] 和 [LinkedIn][3] 上加入 Network World 社区来评论主题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397790/a-deeper-dive-into-linux-permissions.html + +作者:[Sandra Henry-Stocker][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.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/shs_rwsr-100797564-large.jpg +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world From edafde084974c2114ef68e941c1e641e15ff5b5e Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 6 Jun 2019 09:04:13 +0800 Subject: [PATCH 0772/1154] translating --- ...190531 Unity Editor is Now Officially Available for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md b/sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md index 513915bdef..4a217f7c94 100644 --- a/sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md +++ b/sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9642d545eedf3714d1a5c3f9cd8a3e806f5a2f88 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 6 Jun 2019 13:47:25 +0800 Subject: [PATCH 0773/1154] PRF:20190522 Securing telnet connections with stunnel.md @geekpi --- ...ecuring telnet connections with stunnel.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190522 Securing telnet connections with stunnel.md b/translated/tech/20190522 Securing telnet connections with stunnel.md index cc637cc495..1458338e8b 100644 --- a/translated/tech/20190522 Securing telnet connections with stunnel.md +++ b/translated/tech/20190522 Securing telnet connections with stunnel.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Securing telnet connections with stunnel) @@ -12,7 +12,7 @@ ![][1] -Telnet 是一种客户端-服务端协议,通过 TCP 的 23 端口连接到远程服务器。Telnet 并不加密数据,被认为是不安全的,因为数据是以明文形式发送的,所以密码很容易被嗅探。但是,仍有老旧系统需要使用它。这就是用到 **stunnel** 的地方。 +Telnet 是一种客户端-服务端协议,通过 TCP 的 23 端口连接到远程服务器。Telnet 并不加密数据,因此它被认为是不安全的,因为数据是以明文形式发送的,所以密码很容易被嗅探。但是,仍有老旧系统需要使用它。这就是用到 **stunnel** 的地方。 stunnel 旨在为使用不安全连接协议的程序增加 SSL 加密。本文将以 telnet 为例介绍如何使用它。 @@ -38,7 +38,7 @@ openssl genrsa 2048 > stunnel.key openssl req -new -key stunnel.key -x509 -days 90 -out stunnel.crt ``` -系统将一次提示你输入以下信息。当询问 _Common Name_ 时,你必须输入正确的主机名或 IP 地址,但是你可以按**回车**键跳过其他所有内容。 +系统将一次提示你输入以下信息。当询问 `Common Name` 时,你必须输入正确的主机名或 IP 地址,但是你可以按回车键跳过其他所有内容。 ``` You are about to be asked to enter information that will be @@ -57,14 +57,14 @@ Common Name (eg, your name or your server's hostname) []: Email Address [] ``` -将 RSA 密钥和 SSL 证书合并到单个 _.pem_ 文件中,并将其复制到 SSL 证书目录: +将 RSA 密钥和 SSL 证书合并到单个 `.pem` 文件中,并将其复制到 SSL 证书目录: ``` cat stunnel.crt stunnel.key > stunnel.pem sudo cp stunnel.pem /etc/pki/tls/certs/ ``` -现在可以定义服务和用于加密连接的端口了。选择尚未使用的端口。此例使用 450 端口进行隧道传输 telnet。编辑或创建 _/etc/stunnel/telnet.conf_ : +现在可以定义服务和用于加密连接的端口了。选择尚未使用的端口。此例使用 450 端口进行隧道传输 telnet。编辑或创建 `/etc/stunnel/telnet.conf`: ``` cert = /etc/pki/tls/certs/stunnel.pem @@ -80,7 +80,7 @@ accept = 450 connect = 23 ``` -**accept** 选项是服务器将监听传入 **accept** 请求的接口。**connect** 选项是 telnet 服务器的内部监听接口。 +`accept` 选项是服务器将监听传入 telnet 请求的接口。`connect` 选项是 telnet 服务器的内部监听接口。 接下来,创建一个 systemd 单元文件的副本来覆盖原来的版本: @@ -88,7 +88,7 @@ connect = 23 sudo cp /usr/lib/systemd/system/stunnel.service /etc/systemd/system ``` -编辑 _/etc/systemd/system/stunnel.service_ 来添加两行。这些行在启动时为服务创建 chroot 监狱。 +编辑 `/etc/systemd/system/stunnel.service` 来添加两行。这些行在启动时为服务创建 chroot 监狱。 ``` [Unit] @@ -125,7 +125,7 @@ firewall-cmd --reload systemctl enable telnet.socket stunnel@telnet.service --now ``` -要注意 _systemctl_ 命令是有序的。systemd 和 stunnel 包默认提供额外的[模板单元文件][3]。该模板允许你将 stunnel 的多个配置文件放到 _/etc/stunnel_ 中,并使用文件名启动该服务。例如,如果你有一个 _foobar.conf_ 文件,那么可以使用 _systemctl start stunnel@foobar.service_ 启动该 stunnel 实例,而无需自己编写任何单元文件。 +要注意 `systemctl` 命令是有顺序的。systemd 和 stunnel 包默认提供额外的[模板单元文件][3]。该模板允许你将 stunnel 的多个配置文件放到 `/etc/stunnel` 中,并使用文件名启动该服务。例如,如果你有一个 `foobar.conf` 文件,那么可以使用 `systemctl start stunnel@foobar.service` 启动该 stunnel 实例,而无需自己编写任何单元文件。 如果需要,可以将此 stunnel 模板服务设置为在启动时启动: @@ -141,14 +141,14 @@ systemctl enable stunnel@telnet.service dnf -y install stunnel telnet ``` -将 _stunnel.pem_ 从远程服务器复制到客户端的 _/etc/pki/tls/certs_ 目录。在此例中,远程 telnet 服务器的 IP 地址为 192.168.1.143。 +将 `stunnel.pem` 从远程服务器复制到客户端的 `/etc/pki/tls/certs` 目录。在此例中,远程 telnet 服务器的 IP 地址为 `192.168.1.143`。 ``` sudo scp myuser@192.168.1.143:/etc/pki/tls/certs/stunnel.pem /etc/pki/tls/certs/ ``` -创建 _/etc/stunnel/telnet.conf_: +创建 `/etc/stunnel/telnet.conf`: ``` cert = /etc/pki/tls/certs/stunnel.pem @@ -158,7 +158,7 @@ accept=450 connect=192.168.1.143:450 ``` -**accept** 选项是用于 telnet 会话的端口。**connect** 选项是你远程服务器的 IP 地址以及监听的端口。 +`accept` 选项是用于 telnet 会话的端口。`connect` 选项是你远程服务器的 IP 地址以及监听的端口。 接下来,启用并启动 stunnel: @@ -166,7 +166,7 @@ connect=192.168.1.143:450 systemctl enable stunnel@telnet.service --now ``` -测试你的连接。由于有一条已建立的连接,你会 telnet 到 _localhost_ 而不是远程 telnet 服务器的主机名或者 IP 地址。 +测试你的连接。由于有一条已建立的连接,你会 `telnet` 到 `localhost` 而不是远程 telnet 服务器的主机名或者 IP 地址。 ``` [user@client ~]$ telnet localhost 450 @@ -190,7 +190,7 @@ via: https://fedoramagazine.org/securing-telnet-connections-with-stunnel/ 作者:[Curt Warfield][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/) 荣誉推出 From 9893f5c5b53d848a037a1324f4470dba9a146758 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 6 Jun 2019 13:47:53 +0800 Subject: [PATCH 0774/1154] PUB:20190522 Securing telnet connections with stunnel.md @geekpi https://linux.cn/article-10945-1.html --- .../20190522 Securing telnet connections with stunnel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190522 Securing telnet connections with stunnel.md (98%) diff --git a/translated/tech/20190522 Securing telnet connections with stunnel.md b/published/20190522 Securing telnet connections with stunnel.md similarity index 98% rename from translated/tech/20190522 Securing telnet connections with stunnel.md rename to published/20190522 Securing telnet connections with stunnel.md index 1458338e8b..644d288c41 100644 --- a/translated/tech/20190522 Securing telnet connections with stunnel.md +++ b/published/20190522 Securing telnet connections with stunnel.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10945-1.html) [#]: subject: (Securing telnet connections with stunnel) [#]: via: (https://fedoramagazine.org/securing-telnet-connections-with-stunnel/) [#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) From 756cfb8c3ca678fa6cc51f14fc961b4908a6ef16 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 6 Jun 2019 20:33:43 +0800 Subject: [PATCH 0775/1154] PRF:20190529 NVMe on Linux.md @warmfrog --- translated/tech/20190529 NVMe on Linux.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190529 NVMe on Linux.md b/translated/tech/20190529 NVMe on Linux.md index 36ccc1a0fa..994705f28b 100644 --- a/translated/tech/20190529 NVMe on Linux.md +++ b/translated/tech/20190529 NVMe on Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (NVMe on Linux) @@ -10,27 +10,26 @@ Linux 上的 NVMe =============== -如果你还没注意到,一些极速的固态磁盘技术对于Linux和其他操作系统都是可用的。 +> 如果你还没注意到,一些极速的固态磁盘技术已经可以用在 Linux 和其他操作系统上了。 + ![Sandra Henry-Stocker][1] -NVMe 代表“非易失性内存快车”,它是一个主机控制器接口和存储协议,用于加速企业和客户端系统以及固态驱动器(SSD)之间的数据传输。它通过电脑的高速外围组件互联快车总线(PCIe)工作。当我看到这些名词时,我感到“羡慕”。羡慕的原因很重要。 +NVMe 意即非易失性内存主机控制器接口规范non-volatile memory express,它是一个主机控制器接口和存储协议,用于加速企业和客户端系统以及固态驱动器(SSD)之间的数据传输。它通过电脑的高速 PCIe 总线工作。每当我看到这些名词时,我的感受是“羡慕”。而羡慕的原因很重要。 使用 NVMe,数据传输的速度比旋转磁盘快很多。事实上,NVMe 驱动能够比 SATA SSD 快 7 倍。这比我们今天很多人用的固态硬盘快了 7 倍多。这意味着,如果你用一个 NVMe 驱动盘作为启动盘,你的系统能够启动的非常快。事实上,如今任何人买一个新的系统可能都不会考虑那些没有自带 NVMe 的,不管是服务器或者个人电脑。 ### NVMe 在 Linux 下能工作吗? -是的!NVMe 自 Linux 内核 3.3 版本就支持了。更新一个系统,然而,通常同时需要一个 NVMe 控制器和一个 NVMe 磁盘。一些外置磁盘也行,但是为了添加到系统中,需要的不仅仅是通用的 USB 接口。 +是的!NVMe 自 Linux 内核 3.3 版本就支持了。然而,要升级系统,通常同时需要一个 NVMe 控制器和一个 NVMe 磁盘。一些外置磁盘也行,但是要连接到系统上,需要的可不仅仅是通用的 USB 接口。 -[MORE ON NETWORK WORLD: Linux: Best desktop distros for newbies][2] - -为了检查内核版本,使用下列命令: +先使用下列命令检查内核版本: ``` $ uname -r 5.0.0-15-generic ``` -如果你的系统已经用了 NVMe,你将看到一个设备(例如, /dev/nvme0),但是仅在你安装了 NVMe 控制器的情况下。如果你没有,你可以用下列命令获取使用 NVMe 的相关信息。 +如果你的系统已经用了 NVMe,你将看到一个设备(例如,`/dev/nvme0`),但是只有在你安装了 NVMe 控制器的情况下才显示。如果你没有 NVMe 控制器,你可以用下列命令获取使用 NVMe 的相关信息。 ``` $ modinfo nvme | head -6 @@ -44,9 +43,9 @@ alias: pci:v0000106Bd00002003sv*sd*bc*sc*i* ### 了解更多 -如果你想了解极速的 NVMe 存储的更多细节,可在 _[PCWorld][3]_ 获取。 +如果你想了解极速的 NVMe 存储的更多细节,可在 [PCWorld][3] 获取。 -规格,白皮书和其他资源可在 [NVMexpress.org][4] 获取。 +规范、白皮书和其他资源可在 [NVMexpress.org][4] 获取。 -------------------------------------------------------------------------------- @@ -55,7 +54,7 @@ via: https://www.networkworld.com/article/3397006/nvme-on-linux.html 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[warmfrog](https://github.com/warmfrog) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 233eadefef11c488ac56d415a368c567d4f8352c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 6 Jun 2019 20:38:24 +0800 Subject: [PATCH 0776/1154] PUB:20190529 NVMe on Linux.md @warmfrog https://linux.cn/article-10946-1.html --- {translated/tech => published}/20190529 NVMe on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190529 NVMe on Linux.md (97%) diff --git a/translated/tech/20190529 NVMe on Linux.md b/published/20190529 NVMe on Linux.md similarity index 97% rename from translated/tech/20190529 NVMe on Linux.md rename to published/20190529 NVMe on Linux.md index 994705f28b..374d3ef2f2 100644 --- a/translated/tech/20190529 NVMe on Linux.md +++ b/published/20190529 NVMe on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (warmfrog) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10946-1.html) [#]: subject: (NVMe on Linux) [#]: via: (https://www.networkworld.com/article/3397006/nvme-on-linux.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 3bcd9a8158aa855984f593d7cf08e62879e29ca8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 Jun 2019 00:35:28 +0800 Subject: [PATCH 0777/1154] PRF:20170410 Writing a Time Series Database from Scratch.md PART 1 --- ...ing a Time Series Database from Scratch.md | 71 +++++++++++-------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/translated/tech/20170410 Writing a Time Series Database from Scratch.md b/translated/tech/20170410 Writing a Time Series Database from Scratch.md index 3ebf00a14f..7b471f90bd 100644 --- a/translated/tech/20170410 Writing a Time Series Database from Scratch.md +++ b/translated/tech/20170410 Writing a Time Series Database from Scratch.md @@ -1,16 +1,15 @@ 从零写一个时间序列数据库 -============================================================ - +================== 我从事监控工作。特别是在 [Prometheus][2] 上,监控系统包含一个自定义的时间序列数据库,并且集成在 [Kubernetes][3] 上。 -在许多方面上 Kubernetes 展现出了所有 Prometheus 的设计用途。它使得持续部署continuous deployments弹性伸缩auto scaling和其他高动态环境highly dynamic environments下的功能可以轻易地访问。在众多概念上的决策中,查询语句和操作模型使得 Prometheus 特别适合这种环境。但是,如果监控的工作负载动态程度显著地增加,这就会给监控系统本身带来新的压力。记住了这一点,而不是回过头来看 Prometheus 已经解决的很好的问题,我们就可以明确目标去提升它高动态或瞬态服务transient services环境下的表现。 +在许多方面上 Kubernetes 展现出了 Prometheus 所有的设计用途。它使得持续部署continuous deployments弹性伸缩auto scaling和其他高动态环境highly dynamic environments下的功能可以轻易地访问。查询语句和操作模型以及其它概念决策使得 Prometheus 特别适合这种环境。但是,如果监控的工作负载动态程度显著地增加,这就会给监控系统本身带来新的压力。考虑到这一点,我们就可以特别致力于在高动态或瞬态服务transient services环境下提升它的表现,而不是回过头来解决 Prometheus 已经解决的很好的问题。 -Prometheus 的存储层在很长一段时间里都展现出卓越的性能,单一服务器就能够以每秒数百多万个时间序列的速度摄入多达一百万个样本,同时只占用了很少的磁盘空间。尽管当前的存储做的很好,但我依旧提出一个新设计的存储子系统,它更正了现存解决方案的缺点,并具备处理更大规模数据的能力。 +Prometheus 的存储层在历史以来都展现出卓越的性能,单一服务器就能够以每秒数百万个时间序列的速度摄入多达一百万个样本,同时只占用了很少的磁盘空间。尽管当前的存储做的很好,但我依旧提出一个新设计的存储子系统,它可以修正现存解决方案的缺点,并具备处理更大规模数据的能力。 -注释:我没有数据库方面的背景。我说的东西可能是错的并让你误入歧途。你可以在 Freenode 的 #prometheus 频道上提出你的批评(fabxc) +> 备注:我没有数据库方面的背景。我说的东西可能是错的并让你误入歧途。你可以在 Freenode 的 #prometheus 频道上对我(fabxc)提出你的批评。 -### 问题,难题,问题域 +## 问题,难题,问题域 首先,快速地概览一下我们要完成的东西和它的关键难题。我们可以先看一下 Prometheus 当前的做法 ,它为什么做的这么好,以及我们打算用新设计解决哪些问题。 @@ -22,9 +21,9 @@ Prometheus 的存储层在很长一段时间里都展现出卓越的性能,单 identifier -> (t0, v0), (t1, v1), (t2, v2), (t3, v3), .... ``` -每个数据点是一个时间戳和值的元组。在监控中,时间戳是一个整数,值可以是任意数字。64 位浮点数对于计数器和测量值来说是一个好的表示方法,因此我们将会使用它。一系列严格单调递增的时间戳数据点是一个序列,它由标识符所引用。我们的标识符是一个带有标签维度label dimensions字典的度量名称。标签维度分开了单一指标的测量空间。每一个指标名称加上一个独一无二的标签集就成了它自己的时间序列,它有一个与之关联的数据流value stream。 +每个数据点是一个时间戳和值的元组。在监控中,时间戳是一个整数,值可以是任意数字。64 位浮点数对于计数器和测量值来说是一个好的表示方法,因此我们将会使用它。一系列严格单调递增的时间戳数据点是一个序列,它由标识符所引用。我们的标识符是一个带有标签维度label dimensions字典的度量名称。标签维度划分了单一指标的测量空间。每一个指标名称加上一个唯一标签集就成了它自己的时间序列,它有一个与之关联的数据流value stream。 -这是一个典型的序列标识符series identifiers 集,它是统计请求指标的一部分: +这是一个典型的序列标识符series identifier集,它是统计请求指标的一部分: ``` requests_total{path="/status", method="GET", instance=”10.0.0.1:80”} @@ -41,6 +40,7 @@ requests_total{path="/", method="GET", instance=”10.0.0.2:80”} ``` 我们想通过标签来查询时间序列数据。在最简单的情况下,使用 `{__name__="requests_total"}` 选择所有属于 `requests_total` 指标的数据。对于所有选择的序列,我们在给定的时间窗口内获取数据点。 + 在更复杂的语句中,我们或许想一次性选择满足多个标签的序列,并且表示比相等条件更复杂的情况。例如,非语句(`method!="GET"`)或正则表达式匹配(`method=~"PUT|POST"`)。 这些在很大程度上定义了存储的数据和它的获取方式。 @@ -66,24 +66,31 @@ series <-------------------- time ---------------------> ``` -Prometheus 通过定期地抓取一组时间序列的当前值来获取数据点。我们获取到的实体称为目标。因此,写入模式完全地垂直且高度并发,因为来自每个目标的样本是独立摄入的。这里提供一些测量的规模:单一 Prometheus 实例从成千上万的目标中收集数据点,每个数据点都暴露在成百上千个不同的时间序列中。 +Prometheus 通过定期地抓取一组时间序列的当前值来获取数据点。我们从中获取到的实体称为目标。因此,写入模式完全地垂直且高度并发,因为来自每个目标的样本是独立摄入的。 + +这里提供一些测量的规模:单一 Prometheus 实例从数万个目标中收集数据点,每个数据点都暴露在数百到数千个不同的时间序列中。 在每秒采集数百万数据点这种规模下,批量写入是一个不能妥协的性能要求。在磁盘上分散地写入单个数据点会相当地缓慢。因此,我们想要按顺序写入更大的数据块。 -对于旋转式磁盘,它的磁头始终得物理上地向不同的扇区上移动,这是一个不足为奇的事实。而我们都知道 SSD 具有快速随机写入的特点,但事实上它不能修改单独的字节,只能写入一页 4KiB 或更多的数据量。这就意味着写入 16 字节的样本相当于写入满满一个 4Kib 的页。这一行为部分上属于[写入放大][4],这种特性会损耗你的 SSD。因此它不仅影响速度,而且还毫不夸张地在几天或几个周内破坏掉你的硬件。 -关于此问题更深层次的资料,[“Coding for SSDs”系列][5]博客是极好的资源。让我们想想有什么收获:顺序写入和批量写入对于旋转式磁盘和 SSD 来说都是理想的写入模式。大道至简。 -查询模式比起写入模式千差万别。我们可以查询单一序列的一个数据点,也可以为 10000 个序列查询一个数据点,还可以查询一个序列几个周的数据点,甚至是 10000 个序列几个周的数据点。因此在我们的二维平面上,查询范围不是完全水平或垂直的,而是二者形成矩形似的组合。 -[记录规则][6]减轻了已知查询的问题,但对于点对点ad-hoc查询来说并不是一个通用的解决方法。 +对于旋转式磁盘,它的磁头始终得在物理上向不同的扇区上移动,这是一个不足为奇的事实。而虽然我们都知道 SSD 具有快速随机写入的特点,但事实上它不能修改单个字节,只能写入一页或更多页的 4KiB 数据量。这就意味着写入 16 字节的样本相当于写入满满一个 4Kib 的页。这一行为就是所谓的[写入放大][4],这种特性会损耗你的 SSD。因此它不仅影响速度,而且还毫不夸张地在几天或几个周内破坏掉你的硬件。 -我们知道自己想要批量地写入,但我们得到的仅仅是一系列垂直数据点的集合。当查询一段时间窗口内的数据点时,我们不仅很难弄清楚在哪才能找到这些单独的点,而且不得不从磁盘上大量随机的地方读取。也许一条查询语句会有数百万的样本,即使在最快的 SSD 上也会很慢。读入也会从磁盘上获取更多的数据而不仅仅是 16 字节的样本。SSD 会加载一整页,HDD 至少会读取整个扇区。不论哪一种,我们都在浪费宝贵的读吞吐量。 -因此在理想上,相同序列的样本将按顺序存储,这样我们就能通过尽可能少的读取来扫描它们。在上层,我们仅需要知道序列的起始位置就能访问所有的数据点。 +关于此问题更深层次的资料,[“Coding for SSDs”系列][5]博客是极好的资源。让我们想想主要的用处:顺序写入和批量写入分别对于旋转式磁盘和 SSD 来说都是理想的写入模式。大道至简。 -显然,将收集到的数据写入磁盘的理想模式与能够显著提高查询效率的布局之间存在着很强的张力。这是我们 TSDB 需要解决的一个基本问题。 +查询模式比起写入模式明显更不同。我们可以查询单一序列的一个数据点,也可以对 10000 个序列查询一个数据点,还可以查询一个序列几个周的数据点,甚至是 10000 个序列几个周的数据点。因此在我们的二维平面上,查询范围不是完全水平或垂直的,而是二者形成矩形似的组合。 -#### 当前的解法 +[记录规则][6]可以减轻已知查询的问题,但对于点对点ad-hoc查询来说并不是一个通用的解决方法。 + +我们知道我们想要批量地写入,但我们得到的仅仅是一系列垂直数据点的集合。当查询一段时间窗口内的数据点时,我们不仅很难弄清楚在哪才能找到这些单独的点,而且不得不从磁盘上大量随机的地方读取。也许一条查询语句会有数百万的样本,即使在最快的 SSD 上也会很慢。读入也会从磁盘上获取更多的数据而不仅仅是 16 字节的样本。SSD 会加载一整页,HDD 至少会读取整个扇区。不论哪一种,我们都在浪费宝贵的读取吞吐量。 + +因此在理想情况下,同一序列的样本将按顺序存储,这样我们就能通过尽可能少的读取来扫描它们。最重要的是,我们仅需要知道序列的起始位置就能访问所有的数据点。 + +显然,将收集到的数据写入磁盘的理想模式与能够显著提高查询效率的布局之间存在着明显的抵触。这是我们 TSDB 需要解决的一个基本问题。 + +#### 当前的解决方法 是时候看一下当前 Prometheus 是如何存储数据来解决这一问题的,让我们称它为“V2”。 -我们创建一个时间序列的文件,它包含所有样本并按顺序存储。因为每几秒附加一个样本数据到所有文件中非常昂贵,我们打包 1Kib 样本序列的数据块在内存中,一旦打包完成就附加这些数据块到单独的文件中。这一方法解决了大部分问题。写入目前是批量的,样本也是按顺序存储的。它还支持非常高效的压缩格式,基于给定的同一序列的样本相对之前的数据仅发生非常小的改变这一特性。Facebook 在他们 Gorilla TSDB 上的论文中描述了一个相似的基于数据块的方法,并且[引入了一种压缩格式][7],它能够减少 16 字节的样本到平均 1.37 字节。V2 存储使用了包含 Gorilla 等的各种压缩格式。 + +我们创建一个时间序列的文件,它包含所有样本并按顺序存储。因为每几秒附加一个样本数据到所有文件中非常昂贵,我们在内存中打包 1Kib 样本序列的数据块,一旦打包完成就附加这些数据块到单独的文件中。这一方法解决了大部分问题。写入目前是批量的,样本也是按顺序存储的。基于给定的同一序列的样本相对之前的数据仅发生非常小的改变这一特性,它还支持非常高效的压缩格式。Facebook 在他们 Gorilla TSDB 上的论文中描述了一个相似的基于数据块的方法,并且[引入了一种压缩格式][7],它能够减少 16 字节的样本到平均 1.37 字节。V2 存储使用了包含 Gorilla 变体等在内的各种压缩格式。 ``` ┌──────────┬─────────┬─────────┬─────────┬─────────┐ series A @@ -98,18 +105,21 @@ Prometheus 通过定期地抓取一组时间序列的当前值来获取数据点 尽管基于块存储的方法非常棒,但为每个序列保存一个独立的文件会给 V2 存储带来麻烦,因为: -* 我们实际上需要比当前收集的时间序列数目使用更多的文件。多出的部分在序列分流Series Churn上。拥有几百万个文件,迟早会使用光文件系统中的 [inodes][1]。这种情况我们只可以通过重新格式化来恢复磁盘,这种方式是最具有破坏性的。我们通常想要避免为了适应一个应用程序而格式化磁盘。 -* 即使是分块写入,每秒也会产生几千万块的数据块并且准备持久化。这依然需要每秒数千个次的磁盘写入量。尽管通过为每个序列打包好多个块来缓解,但反过来还是增加了等待持久化数据的总内存占用。 -* 要保持所有文件的打开状态进行读写是不可行的。特别是因为 99% 的数据在 24 小时之后不再会被查询到。如果它还是被查询到,我们就得打开数千个文件,找到并读取相关的数据点到内存中,然后再关掉。这样做就会引起很高的查询延迟,数据块缓存加剧会导致新的问题,这一点在“资源消耗”一节另作讲述。 -* 最终,旧的数据需要被删除并且数据需要从数百万文件的头部删除。这就意味着删除实际上是高强度的写入操作。此外,循环遍历数百万文件并且进行分析通常会导致这一过程花费数小时。当它完成时,可能又得重新来过。喔天,继续删除旧文件又会进一步导致 SSD 产生写入放大。 -* 目前所积累的数据块仅维持在内存中。如果应用崩溃,数据就会丢失。为了避免这种情况,内存状态会定期的保存在磁盘上,这比我们能接受数据丢失的时间要长的多。恢复检查点也会花费数分钟,导致很长的重启周期。 +* 实际上,我们需要的文件比当前收集数据的时间序列数量要多得多。多出的部分在序列分流Series Churn上。有几百万个文件,迟早会使用光文件系统中的 [inode][1]。这种情况我们只能通过重新格式化来恢复磁盘,这种方式是最具有破坏性的。我们通常不想为了适应一个应用程序而格式化磁盘。 +* 即使是分块写入,每秒也会产生数千块的数据块并且准备持久化。这依然需要每秒数千次的磁盘写入。尽管通过为每个序列打包好多个块来缓解,但这反过来还是增加了等待持久化数据的总内存占用。 +* 要保持所有文件打开来进行读写是不可行的。特别是因为 99% 的数据在 24 小时之后不再会被查询到。如果查询它,我们就得打开数千个文件,找到并读取相关的数据点到内存中,然后再关掉。这样做就会引起很高的查询延迟,数据块缓存加剧会导致新的问题,这一点在“资源消耗”一节另作讲述。 +* 最终,旧的数据需要被删除,并且数据需要从数百万文件的头部删除。这就意味着删除实际上是写密集型操作。此外,循环遍历数百万文件并且进行分析通常会导致这一过程花费数小时。当它完成时,可能又得重新来过。喔天,继续删除旧文件又会进一步导致 SSD 产生写入放大。 +* 目前所积累的数据块仅维持在内存中。如果应用崩溃,数据就会丢失。为了避免这种情况,内存状态会定期的保存在磁盘上,这比我们能接受数据丢失窗口要长的多。恢复检查点也会花费数分钟,导致很长的重启周期。 -我们能够从现有的设计中学到的关键部分是数据块的概念,这一点会依旧延续。最近一段时间的数据块会保持在内存中也大体上不错。毕竟,最近时间段的数据会大量的查询到。一个时间序列对应一个文件,这种概念是我们想要替换掉的。 +我们能够从现有的设计中学到的关键部分是数据块的概念,我们当然希望保留这个概念。最新的数据块会保持在内存中一般也是好的主意。毕竟,最新的数据会大量的查询到。 + +一个时间序列对应一个文件,这个概念是我们想要替换掉的。 ### 序列分流 -在 Prometheus 的上下文context中,我们使用术语序列分流series churn来描述不活越的时间序列集合,即不再接收数据点,取而代之的是出现一组新的活跃序列。 -例如,由给定微服务实例产生的所有序列都有一个相对的“instance”标签来标识它的起源。如果我们为微服务执行了滚动更新rolling update,并且为每个实例替换一个新的版本,序列分流便会发生。在更加动态的环境中,这些事情基本上每小时都会发生。像 Kubernetes 这样的集群编排Cluster orchestration系统允许应用连续性的自动伸缩和频繁的滚动更新,这样也许会创建成千上万个新的应用程序实例,并且伴随着全新的时间序列集合,每天都是如此。 +在 Prometheus 的上下文context中,我们使用术语序列分流series churn来描述一个时间序列集合变得不活跃,即不再接收数据点,取而代之的是出现一组新的活跃序列。 + +例如,由给定微服务实例产生的所有序列都有一个相应的“instance”标签来标识其来源。如果我们为微服务执行了滚动更新rolling update,并且为每个实例替换一个新的版本,序列分流便会发生。在更加动态的环境中,这些事情基本上每小时都会发生。像 Kubernetes 这样的集群编排Cluster orchestration系统允许应用连续性的自动伸缩和频繁的滚动更新,这样也许会创建成千上万个新的应用程序实例,并且伴随着全新的时间序列集合,每天都是如此。 ``` series @@ -129,14 +139,15 @@ series <-------------------- time ---------------------> ``` -所以即便整个基础设施的规模基本保持不变,过一段时间后数据库内的时间序列还是会成线性增长。尽管 Prometheus 很愿意采集 1000 万个时间序列数据,但要想在 10 亿的序列中找到数据,查询效果还是会受到严重的影响。 +所以即便整个基础设施的规模基本保持不变,过一段时间后数据库内的时间序列还是会成线性增长。尽管 Prometheus 很愿意采集 1000 万个时间序列数据,但要想在 10 亿个序列中找到数据,查询效果还是会受到严重的影响。 -#### 当前解法 +#### 当前解决方案 + +当前 Prometheus 的 V2 存储系统对所有当前保存的序列拥有基于 LevelDB 的索引。它允许查询语句含有给定的标签对label pair,但是缺乏可伸缩的方法来从不同的标签选集中组合查询结果。 -当前 Prometheus 的 V2 存储系统对所有保存的序列拥有基于 LevelDB 的索引。它允许查询语句含有给定的标签对label pair,但是缺乏可伸缩的方法来从不同的标签选集中组合查询结果。 例如,从所有的序列中选择标签 `__name__="requests_total"` 非常高效,但是选择  `instance="A" AND __name__="requests_total"` 就有了可伸缩性的问题。我们稍后会重新考虑导致这一点的原因和能够提升查找延迟的调整方法。 -事实上正是这个问题才催生出了对更好的存储系统的最初探索。Prometheus 需要为查找亿万的时间序列改进索引方法。 +事实上正是这个问题才催生出了对更好的存储系统的最初探索。Prometheus 需要为查找亿万个时间序列改进索引方法。 ### 资源消耗 From 819b532abca50bfd8b227232de4c68799858488e Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Fri, 7 Jun 2019 10:40:32 +0800 Subject: [PATCH 0778/1154] Update 20190111 Top 5 Linux Distributions for Productivity.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请翻译 --- .../tech/20190111 Top 5 Linux Distributions for Productivity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md index fbd8b9d120..725f3bcccb 100644 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qfzy1233) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c8bcfc5cb08515412b25b7aa619f6cdc773767da Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 Jun 2019 15:07:35 +0800 Subject: [PATCH 0779/1154] PRF:20190527 A deeper dive into Linux permissions.md @geekpi --- ...27 A deeper dive into Linux permissions.md | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/translated/tech/20190527 A deeper dive into Linux permissions.md b/translated/tech/20190527 A deeper dive into Linux permissions.md index cc51b32dac..39173aad39 100644 --- a/translated/tech/20190527 A deeper dive into Linux permissions.md +++ b/translated/tech/20190527 A deeper dive into Linux permissions.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (A deeper dive into Linux permissions) @@ -9,16 +9,17 @@ 更深入地了解 Linux 权限 ====== -在 Linux 上查看文件权限时,有时你会看到的不仅仅是普通的 r、w、x 和 -。如何更清晰地了解这些字符试图告诉你什么以及这些权限如何工作? -![Sandra Henry-Stocker][1] +> 在 Linux 上查看文件权限时,有时你会看到的不仅仅是普通的 r、w、x 和 -。如何更清晰地了解这些字符试图告诉你什么以及这些权限如何工作? -在 Linux 上查看文件权限时,有时你会看到的不仅仅是普通的 **r**、**w**、**x** 和 **-**。除了在所有者、组和其他中看到 **rwx** 之外,你可能会看到 **s** 或者 **t**,如下例所示: +![Sandra Henry-Stocker](https://img.linux.net.cn/data/attachment/album/201906/07/150718q09wnve6ne6v9063.jpg) + +在 Linux 上查看文件权限时,有时你会看到的不仅仅是普通的 `r`、`w`、`x` 和 `-`。除了在所有者、组和其他中看到 `rwx` 之外,你可能会看到 `s` 或者 `t`,如下例所示: ``` drwxrwsrwt ``` -要进一步明确的方法之一是使用 **stat** 命令查看权限。stat 的第四行输出以八进制和字符串格式显示文件权限: +要进一步明确的方法之一是使用 `stat` 命令查看权限。`stat` 的第四行输出以八进制和字符串格式显示文件权限: ``` $ stat /var/mail @@ -32,38 +33,38 @@ Change: 2019-05-21 19:03:48.226656344 -0400 Birth: - ``` -该输出提示我们,分配给文件权限的位数超过 9 位。事实上,有 12 位。这些额外的三位提供了一种分配超出通常的读、写和执行权限的方法 - 例如,3777(二进制 011111111111)表示使用了两个额外的设置。 +这个输出提示我们,分配给文件权限的位数超过 9 位。事实上,有 12 位。这些额外的三位提供了一种分配超出通常的读、写和执行权限的方法 - 例如,`3777`(二进制 `011111111111`)表示使用了两个额外的设置。 -该值的第一个 **1** (第二位)表示 SGID(设置组 ID)并分配运行文件的临时权限或使用有关联组权限的目录。 +该值的第一个 `1` (第二位)表示 SGID(设置 GID),为运行文件而赋予临时权限,或以该关联组的权限来使用目录。 ``` 011111111111 ^ ``` -**SGID** 将正在使用该文件的用户作为该组成员之一分配临时权限。 +SGID 将正在使用该文件的用户作为该组成员之一而分配临时权限。 -第二个 **1**(第三位)是“粘连”位。它确保_只有_文件的所有者能够删除或重命名文件或目录。 +第二个 `1`(第三位)是“粘连”位。它确保*只有*文件的所有者能够删除或重命名该文件或目录。 ``` 011111111111 ^ ``` -如果权限是 7777 而不是 3777,我们知道 SUID(设置 UID)字段也已设置。 +如果权限是 `7777` 而不是 `3777`,我们知道 SUID(设置 UID)字段也已设置。 ``` 111111111111 ^ ``` -**SUID** 将正在使用该文件的用户作为文件拥有者分配临时权限。 +SUID 将正在使用该文件的用户作为文件拥有者分配临时权限。 -至于我们上面看到的 /var/mail 目录,所有用户都需要访问,因此需要一些特殊值来提供它。 +至于我们上面看到的 `/var/mail` 目录,所有用户都需要访问,因此需要一些特殊值来提供它。 但现在让我们更进一步。 -特殊权限位的一个常见用法是使用 **passwd** 之类的命令。如果查看 /usr/bin/passwd 文件,你会注意到 SUID 位已设置,它允许你更改密码(以及 /etc/shadow 文件的内容),即使你是以普通(非特权)用户身份运行,并且对此文件没有读取或写入权限。当然,passwd 命令很聪明,不允许你更改其他人的密码,除非你是以 root 身份运行或使用 sudo。 +特殊权限位的一个常见用法是使用 `passwd` 之类的命令。如果查看 `/usr/bin/passwd` 文件,你会注意到 SUID 位已设置,它允许你更改密码(以及 `/etc/shadow` 文件的内容),即使你是以普通(非特权)用户身份运行,并且对此文件没有读取或写入权限。当然,`passwd` 命令很聪明,不允许你更改其他人的密码,除非你是以 root 身份运行或使用 `sudo`。 ``` $ ls -l /usr/bin/passwd @@ -76,9 +77,9 @@ $ ls -l /etc/shadow ### 如何分配特殊文件权限 -与 Linux 命令行中的许多东西一样,你可以有不同的方法设置。 **chmod** 命令允许你以数字方式或使用字符表达式更改权限。 +与 Linux 命令行中的许多东西一样,你可以有不同的方法设置。 `chmod` 命令允许你以数字方式或使用字符表达式更改权限。 -要以数字方式更改文件权限,你可以使用这样的命令来设置 setuid 和 setgid 位: +要以数字方式更改文件权限,你可以使用这样的命令来设置 SUID 和 SGID 位: ``` $ chmod 6775 tryme @@ -99,7 +100,7 @@ $ cat tryme echo I am $USER ``` -即使设置了 SUID 和 SGID 位,并且 root 是文件所有者,运行脚本也不会产生你可能期望的 “I am root”。为什么?因为 Linux 会忽略脚本的 setuid 和 setgid 位。 +即使设置了 SUID 和 SGID 位,并且 root 是文件所有者,运行脚本也不会产生你可能期望的 “I am root”。为什么?因为 Linux 会忽略脚本的 SUID 和 SGID 位。 ``` $ ls -l tryme @@ -108,7 +109,7 @@ $ ./tryme I am jdoe ``` -另一方面,如果你尝试编译程序之类,就像这个简单的 C 程序一样,你会看到不同的效果。在此示例程序中,我们提示用户输入文件名并创建它,并给文件写入权限。 +另一方面,如果你对一个编译的程序之类进行类似的尝试,就像下面这个简单的 C 程序一样,你会看到不同的效果。在此示例程序中,我们提示用户输入文件名并创建它,并给文件写入权限。 ``` #include @@ -135,8 +136,7 @@ int main() } ``` -Once you compile the program and run the commands for both making root the owner and setting the needed permissions, you’ll see that it runs with root authority as expected — leaving a newly created root-owned file. Of course, you must have sudo privileges to run some of the required commands. -编译程序并运行命令以使 root 用户成为所有者并设置所需权限后,你将看到它以预期的 root 权限运行 - 留下新创建的 root 所有者文件。当然,你必须具有 sudo 权限才能运行一些需要的命令。 +编译程序并运行该命令以使 root 用户成为所有者并设置所需权限后,你将看到它以预期的 root 权限运行 - 留下新创建的 root 为所有者的文件。当然,你必须具有 `sudo` 权限才能运行一些需要的命令。 ``` $ cc -o mkfile mkfile.c <== 编译程序 @@ -151,9 +151,7 @@ $ ls -l empty 请注意,文件所有者是 root - 如果程序未以 root 权限运行,则不会发生这种情况。 -权限字符串中不常见设置的位置(例如,rw **s** rw **s** rw **t**)可以帮助提醒我们每个位的含义。至少第一个 “s”(SUID) 位于所有者权限区域中,第二个 (SGID) 位于组权限区域中。为什么粘连位是 “t” 而不是 “s” 超出了我的理解。也许创造者想把它称为 “tacky bit”,但由于这个词的不太令人喜欢的第二个定义而改变了他们的想法。无论如何,额外的权限设置为 Linux 和其他 Unix 系统提供了许多额外的功能。 - -在 [Facebook][2] 和 [LinkedIn][3] 上加入 Network World 社区来评论主题。 +权限字符串中不常见设置的位置(例如,rw**s**rw**s**rw**t**)可以帮助提醒我们每个位的含义。至少第一个 “s”(SUID) 位于所有者权限区域中,第二个 (SGID) 位于组权限区域中。为什么粘连位是 “t” 而不是 “s” 超出了我的理解。也许创造者想把它称为 “tacky bit”,但由于这个词的不太令人喜欢的第二个定义而改变了他们的想法。无论如何,额外的权限设置为 Linux 和其他 Unix 系统提供了许多额外的功能。 -------------------------------------------------------------------------------- @@ -162,7 +160,7 @@ via: https://www.networkworld.com/article/3397790/a-deeper-dive-into-linux-permi 作者:[Sandra Henry-Stocker][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/) 荣誉推出 From d9ff31988c0abdeb77c2624a95d698dbd03e5eae Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 Jun 2019 15:08:24 +0800 Subject: [PATCH 0780/1154] PUB:20190527 A deeper dive into Linux permissions.md @geekpi https://linux.cn/article-10947-1.html --- .../20190527 A deeper dive into Linux permissions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190527 A deeper dive into Linux permissions.md (98%) diff --git a/translated/tech/20190527 A deeper dive into Linux permissions.md b/published/20190527 A deeper dive into Linux permissions.md similarity index 98% rename from translated/tech/20190527 A deeper dive into Linux permissions.md rename to published/20190527 A deeper dive into Linux permissions.md index 39173aad39..a4bba97507 100644 --- a/translated/tech/20190527 A deeper dive into Linux permissions.md +++ b/published/20190527 A deeper dive into Linux permissions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10947-1.html) [#]: subject: (A deeper dive into Linux permissions) [#]: via: (https://www.networkworld.com/article/3397790/a-deeper-dive-into-linux-permissions.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 3f9fe4885fb92a96a436c09b0e7764a355aa96c1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 Jun 2019 19:02:28 +0800 Subject: [PATCH 0781/1154] PRF:20170410 Writing a Time Series Database from Scratch.md PART 2 --- ...ing a Time Series Database from Scratch.md | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/translated/tech/20170410 Writing a Time Series Database from Scratch.md b/translated/tech/20170410 Writing a Time Series Database from Scratch.md index 7b471f90bd..62ebe149f0 100644 --- a/translated/tech/20170410 Writing a Time Series Database from Scratch.md +++ b/translated/tech/20170410 Writing a Time Series Database from Scratch.md @@ -151,20 +151,23 @@ series ### 资源消耗 -当试图量化 Prometheus (或其他任何事情,真的)时,资源消耗是永恒不变的话题之一。但真正困扰用户的并不是对资源的绝对渴求。事实上,由于给定的需求,Prometheus 管理着令人难以置信的吞吐量。问题更在于面对变化时的相对未知性与不稳定性。由于自身的架构设计,V2 存储系统构建样本数据块相当缓慢,这一点导致内存占用随时间递增。当数据块完成之后,它们可以写到磁盘上并从内存中清除。最终,Prometheus 的内存使用到达平衡状态。直到监测环境发生了改变——每次我们扩展应用或者进行滚动更新,序列分流都会增加内存、CPU、磁盘 IO 的使用。如果变更正在进行,那么它最终还是会到达一个稳定的状态,但比起更加静态的环境,它的资源消耗会显著地提高。过渡时间通常为数个小时,而且难以确定最大资源使用量。 +当试图扩展 Prometheus(或其他任何事情,真的)时,资源消耗是永恒不变的话题之一。但真正困扰用户的并不是对资源的绝对渴求。事实上,由于给定的需求,Prometheus 管理着令人难以置信的吞吐量。问题更在于面对变化时的相对未知性与不稳定性。通过其架构设计,V2 存储系统缓慢地构建了样本数据块,这一点导致内存占用随时间递增。当数据块完成之后,它们可以写到磁盘上并从内存中清除。最终,Prometheus 的内存使用到达稳定状态。直到监测环境发生了改变——每次我们扩展应用或者进行滚动更新,序列分流都会增加内存、CPU、磁盘 I/O 的使用。 + +如果变更正在进行,那么它最终还是会到达一个稳定的状态,但比起更加静态的环境,它的资源消耗会显著地提高。过渡时间通常为数个小时,而且难以确定最大资源使用量。 + +为每个时间序列保存一个文件这种方法也使得一个单个查询就很容易崩溃 Prometheus 进程。当查询的数据没有缓存在内存中,查询的序列文件就会被打开,然后将含有相关数据点的数据块读入内存。如果数据量超出内存可用量,Prometheus 就会因 OOM 被杀死而退出。 -为每个时间序列保存一个文件这种方法也使得单一查询很容易崩溃 Prometheus 进程。当查询的数据没有缓存在内存中,查询的序列文件就会被打开,然后将含有相关数据点的数据块读入内存。如果数据量超出内存可用量,Prometheus 就会因 OOM 被杀死而退出。 在查询语句完成之后,加载的数据便可以被再次释放掉,但通常会缓存更长的时间,以便更快地查询相同的数据。后者看起来是件不错的事情。 -最后,我们看看之前提到的 SSD 的写入放大,以及 Prometheus 是如何通过批量写入来解决这个问题的。尽管如此,在许多地方还是存在因为拥有太多小批量数据以及在页的边界上未精确对齐的数据而导致的写入放大。对于更大规模的 Prometheus 服务器,现实当中发现会缩减硬件寿命的问题。这一点对于数据库应用的高写入吞吐量来说仍然相当普遍,但我们应该放眼看看是否可以解决它。 +最后,我们看看之前提到的 SSD 的写入放大,以及 Prometheus 是如何通过批量写入来解决这个问题的。尽管如此,在许多地方还是存在因为批量太小以及数据未精确对齐页边界而导致的写入放大。对于更大规模的 Prometheus 服务器,现实当中会发现缩减硬件寿命的问题。这一点对于高写入吞吐量的数据库应用来说仍然相当普遍,但我们应该放眼看看是否可以解决它。 ### 重新开始 -到目前为止我们对于问题域,V2 存储系统是如何解决它的,以及设计上的问题有了一个清晰的认识。我们也看到了许多很棒的想法,这些或多或少都可以拿来直接使用。V2 存储系统相当数量的问题都可以通过改进和部分的重新设计来解决,但为了好玩(当然,在我仔细的验证想法之后),我决定试着写一个完整的时间序列数据库——从头开始,即向文件系统写入字节。 +到目前为止我们对于问题域、V2 存储系统是如何解决它的,以及设计上存在的问题有了一个清晰的认识。我们也看到了许多很棒的想法,这些或多或少都可以拿来直接使用。V2 存储系统相当数量的问题都可以通过改进和部分的重新设计来解决,但为了好玩(当然,在我仔细的验证想法之后),我决定试着写一个完整的时间序列数据库——从头开始,即向文件系统写入字节。 -性能与资源使用这种最关键的部分直接导致了存储格式的选取。我们需要为数据找到正确的算法和磁盘布局来实现一个高性能的存储层。 +性能与资源使用这种最关键的部分直接影响了存储格式的选取。我们需要为数据找到正确的算法和磁盘布局来实现一个高性能的存储层。 -这就是我解决问题的捷径——跳过令人头疼,失败的想法,数不尽的草图,泪水与绝望。 +这就是我解决问题的捷径——跳过令人头疼、失败的想法,数不尽的草图,泪水与绝望。 ### V3—宏观设计 @@ -198,14 +201,15 @@ $ tree ./data └── 000003 ``` -在最顶层,我们有一系列以 `b-` 为前缀编号的block。每个块中显然保存了索引文件和含有更多编号文件的 `chunk` 文件夹。`chunks` 目录只包含不同序列数据点的原始块raw chunks of data points。与 V2存储系统一样,这使得通过时间窗口读取序列数据非常高效并且允许我们使用相同的有效压缩算法。这一点被证实行之有效,我们也打算沿用。显然,这里并不存在含有单个序列的文件,而是一堆保存着许多序列的数据块。 -`index`文件的存在应不足为奇。让我们假设它拥有黑魔法,可以让我们找到标签、可能的值、整个时间序列和存放数据点的数据块。 +在最顶层,我们有一系列以 `b-` 为前缀编号的block。每个块中显然保存了索引文件和含有更多编号文件的 `chunk` 文件夹。`chunks` 目录只包含不同序列数据点的原始块raw chunks of data points。与 V2 存储系统一样,这使得通过时间窗口读取序列数据非常高效并且允许我们使用相同的有效压缩算法。这一点被证实行之有效,我们也打算沿用。显然,这里并不存在含有单个序列的文件,而是一堆保存着许多序列的数据块。 -但为什么这里有好几个文件夹都是索引和块文件的布局?并且为什么存在最后一个包含“wal”文件夹?理解这两个疑问便能解决九成的问题 。 +`index` 文件的存在应该不足为奇。让我们假设它拥有黑魔法,可以让我们找到标签、可能的值、整个时间序列和存放数据点的数据块。 + +但为什么这里有好几个文件夹都是索引和块文件的布局?并且为什么存在最后一个包含 `wal` 文件夹?理解这两个疑问便能解决九成的问题。 #### 许多小型数据库 -我们分割横轴,即将时间域分割为不重叠的块。每一块扮演者完全独立的数据库,它包含该时间窗口所有的时间序列数据。因此,它拥有自己的索引和一系列块文件。 +我们分割横轴,即将时间域分割为不重叠的块。每一块扮演着完全独立的数据库,它包含该时间窗口所有的时间序列数据。因此,它拥有自己的索引和一系列块文件。 ``` @@ -221,29 +225,31 @@ t0 t1 t2 t3 now merge ─────────────────────────────────────────────────┘ ``` -每一块的数据都是不可变的immutable。当然,当我们采集新数据时,我们必须能向最近的块中添加新的序列和样本。对于该数据块,所有新的数据都将写入内存中的数据库中,它与我们的持久化的数据块一样提供了查找属性。内存中的数据结构可以高效地更新。为了防止数据丢失,所有预传入的数据同样被写入临时的预写日志write ahead log中,这就是 `wal` 文件夹中的一些列文件,我们可以在重新启动时通过它们加载内存数据库。 -所有这些文件都带有序列化格式,有我们所期望的所有东西:许多标志,偏移量,变体和 CRC32 校验。纸上得来终觉浅,绝知此事要躬行。 +每一块的数据都是不可变的immutable。当然,当我们采集新数据时,我们必须能向最近的块中添加新的序列和样本。对于该数据块,所有新的数据都将写入内存中的数据库中,它与我们的持久化的数据块一样提供了查找属性。内存中的数据结构可以高效地更新。为了防止数据丢失,所有传入的数据同样被写入临时的预写日志write ahead log中,这就是 `wal` 文件夹中的一些列文件,我们可以在重新启动时通过它们重新填充内存数据库。 + +所有这些文件都带有序列化格式,有我们所期望的所有东西:许多标志、偏移量、变体和 CRC32 校验和。纸上得来终觉浅,绝知此事要躬行。 这种布局允许我们扩展查询范围到所有相关的块上。每个块上的部分结果最终合并成完整的结果。 这种横向分割增加了一些很棒的功能: -* 当查询一个时间范围,我们可以简单地忽略所有范围之外的数据块。通过减少需要检查的一系列数据,它可以初步解决序列分流的问题。 +* 当查询一个时间范围,我们可以简单地忽略所有范围之外的数据块。通过减少需要检查的数据集,它可以初步解决序列分流的问题。 * 当完成一个块,我们可以通过顺序的写入大文件从内存数据库中保存数据。这样可以避免任何的写入放大,并且 SSD 与 HDD 均适用。 * 我们延续了 V2 存储系统的一个好的特性,最近使用而被多次查询的数据块,总是保留在内存中。 -* 足够好了,我们也不再限定 1KiB 的数据块尺寸来使数据在磁盘上更好地对齐。我们可以挑选对单个数据点和压缩格式最合理的尺寸。 +* 很好,我们也不再受限于 1KiB 的数据块尺寸,以使数据在磁盘上更好地对齐。我们可以挑选对单个数据点和压缩格式最合理的尺寸。 * 删除旧数据变得极为简单快捷。我们仅仅只需删除一个文件夹。记住,在旧的存储系统中我们不得不花数个小时分析并重写数亿个文件。 -每个块还包含了 `meta.json` 文件。它简单地保存了关于块的存储状态和包含的数据以供人们简单的阅读。 +每个块还包含了 `meta.json` 文件。它简单地保存了关于块的存储状态和包含的数据,以便轻松了解存储状态及其包含的数据。 ##### mmap -将数百万个小文件合并为一个大文件使得我们用很小的开销就能保持所有的文件都打开。这就引出了 [`mmap(2)`][8] 的使用,一个允许我们通过文件透明地回传虚拟内存的系统调用。为了简便,你也许想到了交换空间swap space,只是我们所有的数据已经保存在了磁盘上,并且当数据换出内存后不再会发生写入。 +将数百万个小文件合并为少数几个大文件使得我们用很小的开销就能保持所有的文件都打开。这就解除了对 [mmap(2)][8] 的使用的阻碍,这是一个允许我们通过文件透明地回传虚拟内存的系统调用。简单起见,你可以将其视为交换空间swap space,只是我们所有的数据已经保存在了磁盘上,并且当数据换出内存后不再会发生写入。 + +这意味着我们可以当作所有数据库的内容都视为在内存中却不占用任何物理内存。仅当我们访问数据库文件某些字节范围时,操作系统才会从磁盘上惰性加载lazy load页数据。这使得我们将所有数据持久化相关的内存管理都交给了操作系统。通常,操作系统更有资格作出这样的决定,因为它可以全面了解整个机器和进程。查询的数据可以相当积极的缓存进内存,但内存压力会使得页被换出。如果机器拥有未使用的内存,Prometheus 目前将会高兴地缓存整个数据库,但是一旦其他进程需要,它就会立刻返回那些内存。 -这意味着我们可以当作所有数据库的内容都保留在内存中却不占用任何物理内存。仅当我们访问数据库文件确定的字节范围时,操作系统从磁盘上惰性加载lazy loads页数据。这使得我们将所有数据持久化相关的内存管理都交给了操作系统。大体上,操作系统已足够资格作出决定,因为它拥有整个机器和进程的视图。查询的数据可以相当积极的缓存进内存,但内存压力会使得页被逐出。如果机器拥有未使用的内存,Prometheus 目前将会高兴地缓存整个数据库,但是一旦其他进程需要,它就会立刻返回。 因此,查询不再轻易地使我们的进程 OOM,因为查询的是更多的持久化的数据而不是装入内存中的数据。内存缓存大小变得完全自适应,并且仅当查询真正需要时数据才会被加载。 -就个人理解,如果磁盘格式允许,这就是当今大多数数据库的理想工作方式——除非有人自信的在进程中智胜操作系统。我们做了很少的工作但确实从外面获得了很多功能。 +就个人理解,这就是当今大多数数据库的工作方式,如果磁盘格式允许,这是一种理想的方式,——除非有人自信能在这个过程中超越操作系统。我们做了很少的工作但确实从外面获得了很多功能。 #### 压缩 From c0a8a2a0371759eff35a861bd0cb8abb4190e4d0 Mon Sep 17 00:00:00 2001 From: chen ni Date: Fri, 7 Jun 2019 20:04:55 +0800 Subject: [PATCH 0782/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s fail- The risk of having bad IoT data.md | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md b/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md index 8b4d57d9a8..67ac307832 100644 --- a/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md +++ b/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md @@ -7,48 +7,51 @@ [#]: via: (https://www.networkworld.com/article/3396230/when-iot-systems-fail-the-risk-of-having-bad-iot-data.html) [#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) -When IoT systems fail: The risk of having bad IoT data +当物联网系统出现故障:使用低质量物联网数据的风险 ====== -As the use of internet of things (IoT) devices grows, the data they generate can lead to significant savings for consumers and new opportunities for businesses. But what happens when errors inevitably crop up? + +伴随着物联网设备使用量的增长,这些设备产生的数据可以让消费者节约巨大的开支,也给商家带来新的机遇。但是当故障不可避免地出现的时候,会发生什么呢? ![Oonal / Getty Images][1] -No matter what numbers you look at, it’s clear that the internet of things (IoT) continues to worm its way into more and more areas of personal and private life. That growth brings many benefits, but it also poses new risks. A big question is who takes responsibility when things go wrong. +你可以去看任何统计数字,很明显物联网正在走进个人生活和私人生活的方方面面。这种增长虽然有不少好处,但是也带来了新的风险。一个很重要的问题是,出现问题的时候谁来负责呢? -Perhaps the biggest issue surrounds the use of IoT-generated data to personalize the offering and pricing of various products and services. [Insurance companies have long struggled with how best to use IoT data][2], but last year I wrote about how IoT sensors are beginning to be used to help home insurers reduce water damage losses. And some companies are looking into the potential for insurers to bid for consumers: business based on the risks (or lack thereof) revealed by their smart-home data. +也许最大的问题出在基于物联网数据进行的个性化营销以及定价策略上。[保险公司长期以来致力于寻找利用物联网数据的最佳方式][2], +我去年写过家庭财产保险公司是如何开始利用物联网传感器减少水灾带来的损失的。一些公司正在研究保险公司向消费者竞标的可能性,这种业务基于智能家居数据所揭示的风险的高低。 -But some of the biggest progress has come in the area of automobile insurance, where many automobile insurers already let customers install tracking devices in their cars in exchange for discounts for demonstrating safe-driving habits. +但是最大的进步出现在汽车保险领域。许多汽车保险公司已经可以让客户在车辆上安装追踪设备,如果数据证明他们的驾驶习惯良好就可以获取保险折扣。 -**[ Also read:[Finally, a smart way for insurers to leverage IoT in smart homes][3] ]** +**[ 延伸阅读:[保险公司终于有了一个利用智能家居物联网的好办法][3] ]** -### **The rise of usage-based insurance** +### **UBI 车险的崛起** -Called usage-based insurance (UBI), this “pay-as-you-drive” approach tracks speed, location, and other factors to assess risk and calculate auto insurance premiums. An estimated [50 million U.S. drivers][4] will have enrolled in UBI programs by 2020. +UBI(基于使用的保险)车险是一种“按需付费”的业务,可以通过追踪速度、位置,以及其他因素来评估风险并计算车险保费。到2020年,预计有[5000万美国司机][4]会加入到 UBI 车险的项目中。 -Not surprisingly, insurers love UBI because it helps them calculate their risks more precisely. In fact, [AIG Ireland is trying to get the country to require UBI for drivers under 25][5]. And demonstrably safe drivers are also often happy save some money. There has been pushback, of course, mostly from privacy advocates and groups who might have to pay more under this model. +不出所料,保险公司对 UBI 车险青睐有加,因为 UBI 车险可以帮助他们更加精确地计算风险。事实上,[AIG 爱尔兰已经在尝试让国家向 25 岁以下的司机强制推行 UBI 车险][5]。并且被认定驾驶习惯良好的司机也很乐意节省一笔费用。当然也有反对的声音了,大多数是来自于隐私权倡导者,以及会因此支付更多费用的群体。 -### **What happens when something goes wrong?** +### **出了故障会发生什么?** -But there’s another, more worrisome, potential issue: What happens when the data provided by the IoT device is wrong or gets garbled somewhere along the way? Because despite all the automation, error-checking, and so on, occasional errors inevitably slip through the cracks. +但是还有一个更加令人担忧的潜在问题:当物联网设备提供的数据有问题,或者在传输过程中出了故障会发生什么?因为尽管有自动化程序,错误检查等等,还是偶尔会有故障不可避免地发生。 -Unfortunately, this isn’t just an academic concern that might someday accidentally cost some careful drivers a few extra bucks on their insurance. It’s already a real-world problem with serious consequences. And just like [the insurance industry still hasn’t figured out who should “own” data generated by customer-facing IoT devices][6], it’s not clear who would take responsibility for dealing with problems with that data. +不幸的是,这并不是一个理论上某天会给好司机不小心多扣几块钱保费的问题。这已经是一个会带来严重后果的现实问题。就像[保险行业仍然没有想清楚谁应该“拥有”面向客户的物联网设备产生的数据][6]一样,我们也不清楚谁将对这些数据所带来的问题负责。 -Though not strictly an IoT issue, computer “glitches” allegedly led to Hertz rental cars erroneously being reported stolen and innocent renters being arrested and detained. The result? Criminal charges, years of litigation, and finger pointing. Lots and lots of finger pointing. +计算机"故障"(虽然并不是一个严格意义上的物联网问题)据说曾导致赫兹的租车被误报为被盗,并且导致无辜的租车人被逮捕并扣留。结果呢?刑事指控,多年的诉讼官司,以及舆论的指责。非常强烈的舆论指责。 -With that in mind, it’s easy to imagine, for example, an IoT sensor getting confused and indicating that a car was speeding even while safely under the speed limit. Think of the hassles of trying to fight _that_ in court, or arguing with your insurance company over it. +考虑到这一点,我们非常容易想象,比如说一个物联网传感器出了故障,然后报告说某辆车超速了,然而事实上并没有超速。想想为这件事打官司的麻烦吧,或者想想和你的保险公司如何争执不下。 -(Of course, there’s also the flip side of this problem: Consumers may find ways to hack the data shared by their IoT devices to fraudulently qualify for lower rates or deflect blame for an incident. There’s no real plan in place to deal with _that_ , either.) +(当然,这个问题还有另外一面:消费者可能会想办法篡改他们的物联网设备上的数据,以获得更低的费率或者转移事故责任。我们同样也没有可行的办法来应对 _这个问题_ 。) -### **Studying the need for government regulation** +### **政府监管是否有必要** -Given the potential impacts of these issues, and the apparent lack of interest in dealing with them from the many companies involved, it seems legitimate to wonder if government intervention is warranted. +考虑到这些问题的潜在影响,以及所涉及公司对处理这些问题的无动于衷,我们似乎有理由猜想政府干预的必要性。 -That could be one motivation behind the [reintroduction of the SMART (State of Modern Application, Research, and Trends of) IoT Act][7] by Rep. Bob Latta (R-Ohio). [The bill][8], stemming from a bipartisan IoT working group helmed by Latta and Rep. Peter Welch (D-Vt.), passed the House last fall but failed in the Senate. It would require the Commerce Department to study the state of the IoT industry and report back to the House Energy & Commerce and Senate Commerce Committee in two years. +这可能是众议员 Bob Latta(俄亥俄州,共和党)[重新引入 SMART IOT(物联网现代应用、研究及趋势的现状)法案][7]背后的一个动机。这项由 Latta 和众议员 Peter Welch(佛蒙特州,民主党)领导的两党合作物联网工作组提出的[法案][8],于去年秋天通过众议院,但被参议院驳回了。商务部需要研究物联网行业的状况,并在两年后向众议院能源与商业部和参议院商务委员会报告。 -In a statement, Latta said, “With a projected economic impact in the trillions of dollars, we need to look at the policies, opportunities, and challenges that IoT presents. The SMART IoT Act will make it easier to understand what the government is doing on IoT policy, what it can do better, and how federal policies can impact the research and discovery of cutting-edge technologies.” +Latta 在一份声明中表示,“由于预计会有数万亿美元的经济影响,我们需要考虑物联网所带来的的政策,机遇和挑战。SMART IoT 法案会让人们更容易理解政府在物联网政策上的做法、可以改进的地方,以及联邦政策如何影响尖端技术的研究和发明。” -The research is welcome, but the bill may not even pass. Even it does, with its two-year wait time, the IoT will likely evolve too fast for the government to keep up. +这项研究受到了欢迎,但该法案甚至可能不会被通过。即便通过了,物联网在两年的等待时间里也可能会翻天覆地,让政府还是无法跟上。 + +加入 Network World 的[Facebook 社区][9] 和 [LinkedIn 社区][10],参与最前沿话题的讨论。 -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. -------------------------------------------------------------------------------- @@ -56,7 +59,7 @@ via: https://www.networkworld.com/article/3396230/when-iot-systems-fail-the-risk 作者:[Fredric Paul][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[chen-ni](https://github.com/chen-ni) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 96bd88fe9ff4c9f42c26f337d3f955df8597b953 Mon Sep 17 00:00:00 2001 From: chen ni Date: Fri, 7 Jun 2019 20:20:41 +0800 Subject: [PATCH 0783/1154] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...systems fail- The risk of having bad IoT data.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md b/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md index 67ac307832..f8d8670237 100644 --- a/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md +++ b/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md @@ -15,8 +15,7 @@ 你可以去看任何统计数字,很明显物联网正在走进个人生活和私人生活的方方面面。这种增长虽然有不少好处,但是也带来了新的风险。一个很重要的问题是,出现问题的时候谁来负责呢? -也许最大的问题出在基于物联网数据进行的个性化营销以及定价策略上。[保险公司长期以来致力于寻找利用物联网数据的最佳方式][2], -我去年写过家庭财产保险公司是如何开始利用物联网传感器减少水灾带来的损失的。一些公司正在研究保险公司向消费者竞标的可能性,这种业务基于智能家居数据所揭示的风险的高低。 +也许最大的问题出在基于物联网数据进行的个性化营销以及定价策略上。[保险公司长期以来致力于寻找利用物联网数据的最佳方式][2],我去年写过家庭财产保险公司是如何开始利用物联网传感器减少水灾带来的损失的。一些公司正在研究保险公司向消费者竞标的可能性,这种业务基于智能家居数据所揭示的风险的高低。 但是最大的进步出现在汽车保险领域。许多汽车保险公司已经可以让客户在车辆上安装追踪设备,如果数据证明他们的驾驶习惯良好就可以获取保险折扣。 @@ -26,17 +25,17 @@ UBI(基于使用的保险)车险是一种“按需付费”的业务,可以通过追踪速度、位置,以及其他因素来评估风险并计算车险保费。到2020年,预计有[5000万美国司机][4]会加入到 UBI 车险的项目中。 -不出所料,保险公司对 UBI 车险青睐有加,因为 UBI 车险可以帮助他们更加精确地计算风险。事实上,[AIG 爱尔兰已经在尝试让国家向 25 岁以下的司机强制推行 UBI 车险][5]。并且被认定驾驶习惯良好的司机也很乐意节省一笔费用。当然也有反对的声音了,大多数是来自于隐私权倡导者,以及会因此支付更多费用的群体。 +不出所料,保险公司对 UBI 车险青睐有加,因为 UBI 车险可以帮助他们更加精确地计算风险。事实上,[AIG 爱尔兰已经在尝试让国家向 25 岁以下的司机强制推行 UBI 车险][5]。并且,被认定为驾驶习惯良好的司机自然也很乐意节省一笔费用。当然也有反对的声音了,大多数是来自于隐私权倡导者,以及会因此支付更多费用的群体。 ### **出了故障会发生什么?** -但是还有一个更加令人担忧的潜在问题:当物联网设备提供的数据有问题,或者在传输过程中出了故障会发生什么?因为尽管有自动化程序,错误检查等等,还是偶尔会有故障不可避免地发生。 +但是还有一个更加令人担忧的潜在问题:当物联网设备提供的数据有错误,或者在传输过程中出了问题会发生什么?因为尽管有自动化程序,错误检查等等,还是不可避免地会偶尔发生一些故障。 -不幸的是,这并不是一个理论上某天会给好司机不小心多扣几块钱保费的问题。这已经是一个会带来严重后果的现实问题。就像[保险行业仍然没有想清楚谁应该“拥有”面向客户的物联网设备产生的数据][6]一样,我们也不清楚谁将对这些数据所带来的问题负责。 +不幸的是,这并不是一个理论上某天会给谨慎的司机不小心多扣几块钱保费的问题。这已经是一个会带来严重后果的现实问题。就像[保险行业仍然没有想清楚谁应该“拥有”面向客户的物联网设备产生的数据][6]一样,我们也不清楚谁将对这些数据所带来的问题负责。 -计算机"故障"(虽然并不是一个严格意义上的物联网问题)据说曾导致赫兹的租车被误报为被盗,并且导致无辜的租车人被逮捕并扣留。结果呢?刑事指控,多年的诉讼官司,以及舆论的指责。非常强烈的舆论指责。 +计算机"故障"据说曾导致赫兹的租车被误报为被盗(虽然在这个例子中这并不是一个严格意义上的物联网问题),并且导致无辜的租车人被逮捕并扣留。结果呢?刑事指控,多年的诉讼官司,以及舆论的指责。非常强烈的舆论指责。 -考虑到这一点,我们非常容易想象,比如说一个物联网传感器出了故障,然后报告说某辆车超速了,然而事实上并没有超速。想想为这件事打官司的麻烦吧,或者想想和你的保险公司如何争执不下。 +我们非常容易想象一些类似的情况,比如说一个物联网传感器出了故障,然后报告说某辆车超速了,然而事实上并没有超速。想想为这件事打官司的麻烦吧,或者想想和你的保险公司如何争执不下。 (当然,这个问题还有另外一面:消费者可能会想办法篡改他们的物联网设备上的数据,以获得更低的费率或者转移事故责任。我们同样也没有可行的办法来应对 _这个问题_ 。) From daab1aef650c32fddff88ff424afd79e56811140 Mon Sep 17 00:00:00 2001 From: chen ni Date: Fri, 7 Jun 2019 20:23:50 +0800 Subject: [PATCH 0784/1154] =?UTF-8?q?=E7=A7=BB=E8=87=B3translated=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0520 When IoT systems fail- The risk of having bad IoT data.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md (100%) diff --git a/sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md b/translated/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md similarity index 100% rename from sources/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md rename to translated/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md From b5c074b718c6894098ad6b1522bde0bdb729acf8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 7 Jun 2019 21:33:49 +0800 Subject: [PATCH 0785/1154] PRF:20170410 Writing a Time Series Database from Scratch.md PART 3 --- ...ing a Time Series Database from Scratch.md | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/translated/tech/20170410 Writing a Time Series Database from Scratch.md b/translated/tech/20170410 Writing a Time Series Database from Scratch.md index 62ebe149f0..85cbb478e7 100644 --- a/translated/tech/20170410 Writing a Time Series Database from Scratch.md +++ b/translated/tech/20170410 Writing a Time Series Database from Scratch.md @@ -253,10 +253,11 @@ t0 t1 t2 t3 now #### 压缩 -存储系统需要定期的“切”出新块并写入之前完成的块到磁盘中。仅在块成功的持久化之后,写之前用来恢复内存块的日志文件(wal)才会被删除。 -我们很乐意将每个块的保存时间设置的相对短一些(通常配置为 2 小时)以避免内存中积累太多的数据。当查询多个块,我们必须合并它们的结果为一个完成的结果。合并过程显然会消耗资源,一个周的查询不应该由 80 多个部分结果所合并。 +存储系统需要定期“切”出新块并将之前完成的块写入到磁盘中。仅在块成功的持久化之后,才会被删除之前用来恢复内存块的日志文件(wal)。 -为了实现两者,我们引入压缩compaction。压缩描述了一个过程:取一个或更多个数据块并将其写入一个可能更大的块中。它也可以在此过程中修改现有的数据。例如,清除已经删除的数据,或为提升查询性能重建样本块。 +我们希望将每个块的保存时间设置的相对短一些(通常配置为 2 小时),以避免内存中积累太多的数据。当查询多个块,我们必须将它们的结果合并为一个整体的结果。合并过程显然会消耗资源,一个星期的查询不应该由超过 80 个的部分结果所组成。 + +为了实现两者,我们引入压缩compaction。压缩描述了一个过程:取一个或更多个数据块并将其写入一个可能更大的块中。它也可以在此过程中修改现有的数据。例如,清除已经删除的数据,或重建样本块以提升查询性能。 ``` @@ -272,11 +273,11 @@ t0 t1 t2 t3 t4 now └──────────────────────────┘ └──────────────────────────┘ └───────────┘ ``` -在这个例子中我们有一系列块`[1,2,3,4]`。块 1,2 ,3 可以压缩在一起,新的布局将会是 `[1,4]`。或者,将它们成对压缩为 `[1,3]`。所有的时间序列数据仍然存在,但现在整体上保存在更少的块中。这极大程度地缩减了查询时间的消耗,因为需要合并的部分查询结果变得更少了。 +在这个例子中我们有顺序块 `[1,2,3,4]`。块 1、2、3 可以压缩在一起,新的布局将会是 `[1,4]`。或者,将它们成对压缩为 `[1,3]`。所有的时间序列数据仍然存在,但现在整体上保存在更少的块中。这极大程度地缩减了查询时间的消耗,因为需要合并的部分查询结果变得更少了。 #### 保留 -我们看到了删除旧的数据在 V2 存储系统中是一个缓慢的过程,并且消耗 CPU、内存和磁盘。如何才能在我们基于块的设计上清除旧的数据?相当简单,只要根据块文件夹下的配置的保留窗口里有无数据而删除该文件夹。在下面的例子中,块 1 可以被安全地删除,而块 2 则必须一直保持到界限后面。 +我们看到了删除旧的数据在 V2 存储系统中是一个缓慢的过程,并且消耗 CPU、内存和磁盘。如何才能在我们基于块的设计上清除旧的数据?相当简单,只要删除我们配置的保留时间窗口里没有数据的块文件夹即可。在下面的例子中,块 1 可以被安全地删除,而块 2 则必须一直保留,直到它落在保留窗口边界之外。 ``` | @@ -288,16 +289,19 @@ t0 t1 t2 t3 t4 now retention boundary ``` -得到越旧的数据,保存的块也就越大,因为我们会压缩之前的压缩块。因此必须为其设置一个上限,以防数据块扩展到整个数据库而损失我们设计的最初优势。 -方便的是,这一点也限制了部分存在于保留窗口内部分存在于保留窗口外的总磁盘块的消耗。例如上面例子中的块 2。当设置了最大块尺寸为总保留窗口的 10% 后,我们保留块 2 的总开销也有了 10% 的上限。 +随着我们不断压缩先前压缩的块,旧数据越大,块可能变得越大。因此必须为其设置一个上限,以防数据块扩展到整个数据库而损失我们设计的最初优势。 + +方便的是,这一点也限制了部分存在于保留窗口内部分存在于保留窗口外的块的磁盘消耗总量。例如上面例子中的块 2。当设置了最大块尺寸为总保留窗口的 10% 后,我们保留块 2 的总开销也有了 10% 的上限。 总结一下,保留与删除从非常昂贵到了几乎没有成本。 -> 如果你读到这里并有一些数据库的背景知识,现在你也许会问:这些都是最新的技术吗?——并不是。而且可能还会做的更好。 - -> 在内存中打包数据,定期的写入日志并刷新磁盘的模式在现在相当普遍。 -> 我们看到的好处无论在什么领域的数据里都是适用的。遵循这一方法最著名的开源案例是 LevelDB,Cassandra,InfluxDB 和 HBase。关键是避免重复发明劣质的轮子,采用经得起验证的方法,并正确地运用它们。 -> 这里仍有地方来添加你自己的黑魔法。 +> 如果你读到这里并有一些数据库的背景知识,现在你也许会问:这些都是最新的技术吗?——并不是;而且可能还会做的更好。 +> +> 在内存中批量处理数据,在预写日志中跟踪,并定期写入到磁盘的模式在现在相当普遍。 +> +> 我们看到的好处无论在什么领域的数据里都是适用的。遵循这一方法最著名的开源案例是 LevelDB、Cassandra、InfluxDB 和 HBase。关键是避免重复发明劣质的轮子,采用经过验证的方法,并正确地运用它们。 +> +> 脱离场景添加你自己的黑魔法是一种不太可能的情况。 ### 索引 From 68364d2aa9859a1cf8666bf07b66c72799497668 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 Jun 2019 17:25:39 +0800 Subject: [PATCH 0786/1154] PRF:20190527 How to write a good C main function.md @MjSeven --- ...527 How to write a good C main function.md | 386 +++++++++--------- 1 file changed, 190 insertions(+), 196 deletions(-) diff --git a/translated/tech/20190527 How to write a good C main function.md b/translated/tech/20190527 How to write a good C main function.md index 8cce949bfc..182a127bf2 100644 --- a/translated/tech/20190527 How to write a good C main function.md +++ b/translated/tech/20190527 How to write a good C main function.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to write a good C main function) @@ -9,22 +9,23 @@ 如何写好 C main 函数 ====== -学习如何构造一个 C 文件并编写一个 C main 函数来处理命令行参数,像 champ 一样。 -(to 校正:champ 是一个命令行程序吗?但我并没有找到,这里按一个程序来解释了) + +> 学习如何构造一个 C 文件并编写一个 C main 函数来成功地处理命令行参数。 + ![Hand drawing out the word "code"][1] -我知道,现在孩子们用 Python 和 JavaScript 编写他们疯狂的“应用程序”。但是不要这么快就否定 C 语言-- 它能够提供很多东西,并且简洁。如果你需要速度,用 C 语言编写可能就是你的答案。如果你正在寻找工作保障或者学习如何捕获[空指针解引用][2],C 语言也可能是你的答案!在本文中,我将解释如何构造一个 C 文件并编写一个 C main 函数来处理像 champ 这样的命令行参数。 +我知道,现在孩子们用 Python 和 JavaScript 编写他们疯狂的“应用程序”。但是不要这么快就否定 C 语言 —— 它能够提供很多东西,并且简洁。如果你需要速度,用 C 语言编写可能就是你的答案。如果你正在寻找稳定的职业或者想学习如何捕获[空指针解引用][2],C 语言也可能是你的答案!在本文中,我将解释如何构造一个 C 文件并编写一个 C main 函数来成功地处理命令行参数。 -**我**:一个顽固的 Unix 系统程序员。 -**你**:一个有编辑器,C 编译器,并有时间打发的人。 +我:一个顽固的 Unix 系统程序员。 +你:一个有编辑器、C 编译器,并有时间打发的人。 -_让我们开工吧。_ +让我们开工吧。 ### 一个无聊但正确的 C 程序 ![Parody O'Reilly book cover, "Hating Other People's Code"][3] -一个 C 程序以 **main()** 函数开头,通常保存在名为 **main.c** 的文件中。 +C 程序以 `main()` 函数开头,通常保存在名为 `main.c` 的文件中。 ``` /* main.c */ @@ -33,7 +34,7 @@ int main(int argc, char *argv[]) { } ``` -这个程序会 _编译_ 但不 _执行_ 任何操作。 +这个程序可以*编译*但不*执行*任何操作。 ``` $ gcc main.c @@ -45,35 +46,34 @@ $ ### main 函数是唯一的。 -**main()** 函数是程序开始执行时执行的第一个函数,但不是第一个执行的函数。_第一个_ 函数是 **_start()**,它通常由 C 运行库提供,在编译程序时自动链接。此细节高度依赖于操作系统和编译器工具链,所以我假装没有提到它。 +`main()` 函数是开始执行时所执行的程序的第一个函数,但不是第一个执行的函数。*第一个*函数是 `_start()`,它通常由 C 运行库提供,在编译程序时自动链接。此细节高度依赖于操作系统和编译器工具链,所以我假装没有提到它。 -**main()** 函数有两个参数,通常称为 **argc** 和 **argv**,并返回一个有符号整数。大多数 Unix 环境都希望程序在成功时返回 **0**(零),失败时返回 **-1**(负一)。 +`main()` 函数有两个参数,通常称为 `argc` 和 `argv`,并返回一个有符号整数。大多数 Unix 环境都希望程序在成功时返回 `0`(零),失败时返回 `-1`(负一)。 参数 | 名称 | 描述 ---|---|--- -argc | 参数个数 | 参数向量的个数 -argv | 参数向量 | 字符指针数组 - -参数向量 **argv** 是调用程序的命令行的标记化表示形式。在上面的例子中,**argv** 将是以下字符串的列表: +`argc` | 参数个数 | 参数向量的个数 +`argv` | 参数向量 | 字符指针数组 +参数向量 `argv` 是调用程序的命令行的标记化表示形式。在上面的例子中,`argv` 将是以下字符串的列表: ``` `argv = [ "/path/to/a.out", "-o", "foo", "-vv" ];` ``` -参数向量保证在第一个索引中始终至少有一个字符串 **argv[0]**,这是执行程序的完整路径。 +参数向量保证在第一个索引中始终至少有一个字符串 `argv[0]`,这是执行程序的完整路径。 ### main.c 文件的剖析 -当我从头开始编写 **main.c** 时,它的结构通常如下: +当我从头开始编写 `main.c` 时,它的结构通常如下: ``` /* main.c */ -/* 0 copyright/licensing */ -/* 1 includes */ -/* 2 defines */ -/* 3 external declarations */ -/* 4 typedefs */ +/* 0 版权/许可证 */ +/* 1 包含 */ +/* 2 定义 */ +/* 3 外部声明 */ +/* 4 类型定义 */ /* 5 全局变量声明 */ /* 6 函数原型 */ @@ -93,18 +93,17 @@ int main(int argc, char *argv[]) { \- A cynical but smart and good looking programmer. ``` -使用有意义的函数名和变量名而不是注释。 +使用有意义的函数名和变量名,而不是注释。 为了迎合程序员固有的惰性,一旦添加了注释,维护负荷就会增加一倍。如果更改或重构代码,则需要更新或扩展注释。随着时间的推移,代码会发生变化,与注释所描述的内容完全不同。 -如果你必须写注释,不要写关于代码正在做 _什么_,相反,写下 _为什么_ 代码需要这样写。写一些你想在五年后读到的注释,那时你已经将这段代码忘得一干二净。世界的命运取决于你。_不要有压力。_ +如果你必须写注释,不要写关于代码正在做*什么*,相反,写下*为什么*代码需要这样写。写一些你想在五年后读到的注释,那时你已经将这段代码忘得一干二净。世界的命运取决于你。*不要有压力。* -#### 1\. Includes +#### 1、 包含 -我添加到 **main.c** 文件的第一个东西是 include 文件,它们为程序提供大量标准 C 标准库函数和变量。C 标准库做了很多事情。浏览 **/usr/include** 中的头文件,了解它们可以为你做些什么。 - -**#include** 字符串是 [C 预处理程序][4](cpp)指令,它会将引用的文件完整地包含在当前文件中。C 中的头文件通常以 **.h** 扩展名命名,且不应包含任何可执行代码。它只有宏、定义、typedef、外部变量和函数原型。字符串 **** 告诉 cpp 在系统定义的头文件路径中查找名为 **header.h** 的文件,通常在 **/usr/include** 目录中。 +我添加到 `main.c` 文件的第一个东西是包含文件,它们为程序提供大量标准 C 标准库函数和变量。C 标准库做了很多事情。浏览 `/usr/include` 中的头文件,了解它们可以为你做些什么。 +`#include` 字符串是 [C 预处理程序][4](cpp)指令,它会将引用的文件完整地包含在当前文件中。C 中的头文件通常以 `.h` 扩展名命名,且不应包含任何可执行代码。它只有宏、定义、类型定义、外部变量和函数原型。字符串 `` 告诉 cpp 在系统定义的头文件路径中查找名为 `header.h` 的文件,通常在 `/usr/include` 目录中。 ``` /* main.c */ @@ -118,43 +117,42 @@ int main(int argc, char *argv[]) { #include ``` -以下内容是我默认会包含的最小全局 include 集合: +以上内容是我默认会包含的最小全局包含集合: -#include 文件 | 提供的东西 +\#include 文件 | 提供的东西 ---|--- -stdio | 提供 FILE, stdin, stdout, stderr 和 fprint() 函数系列 -stdlib | 提供 malloc(), calloc() 和 realloc() -unistd | 提供 EXIT_FAILURE, EXIT_SUCCESS -libgen | 提供 basename() 函数 +stdio | 提供 FILE、stdin、stdout、stderr 和 `fprint()` 函数系列 +stdlib | 提供 `malloc()`、`calloc()` 和 `realloc()` +unistd | 提供 `EXIT_FAILURE`、`EXIT_SUCCESS` +libgen | 提供 `basename()` 函数 errno | 定义外部 errno 变量及其可以接受的所有值 -string | 提供 memcpy(), memset() 和 strlen() 函数系列 -getopt | 提供 外部 optarg, opterr, optind 和 getopt() 函数 -sys/types | 类型定义快捷方式,如 uint32_t 和 uint64_t +string | 提供 `memcpy()`、`memset()` 和 `strlen()` 函数系列 +getopt | 提供外部 optarg、opterr、optind 和 `getopt()` 函数 +sys/types | 类型定义快捷方式,如 `uint32_t` 和 `uint64_t` -#### 2\. Defines +#### 2、定义 ``` /* main.c */ <...> -#define OPTSTR "vi⭕f:h" -#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" -#define ERR_FOPEN_INPUT "fopen(input, r)" +#define OPTSTR "vi:o:f:h" +#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" +#define ERR_FOPEN_INPUT "fopen(input, r)" #define ERR_FOPEN_OUTPUT "fopen(output, w)" #define ERR_DO_THE_NEEDFUL "do_the_needful blew up" #define DEFAULT_PROGNAME "george" ``` -这在现在没有多大意义,但 **OPTSTR** 定义是我说明程序将推荐的命令行切换。参考 [**getopt(3)**][5] man 页面,了解 **OPTSTR** 将如何影响 **getopt()** 的行为。 +这在现在没有多大意义,但 `OPTSTR` 定义我会说明一下,它是程序推荐的命令行开关。参考 [getopt(3)][5] man 页面,了解 `OPTSTR` 将如何影响 `getopt()` 的行为。 -**USAGE_FMT** 定义了一个 **printf()** 风格形式的格式字符串,在 **usage()** 函数中被引用。 +`USAGE_FMT` 定义了一个 `printf()` 风格形式的格式字符串,在 `usage()` 函数中被引用。 -我还喜欢将字符串常量放在文件的这一部分作为 **#defines**。如果需要,收集它们可以更容易地修复拼写、重用消息和国际化消息。 +我还喜欢将字符串常量放在文件的这一部分作为 `#defines`。如果需要,把它们收集在一起可以更容易地修复拼写、重用消息和国际化消息。 -最后,在命名 **#define** 时使用全部大写字母,以区别变量和函数名。如果需要,可以将单词放在一起或使用下划线分隔,只要确保它们都是大写的就行。 - -#### 3\. 外部声明 +最后,在命名 `#define` 时全部使用大写字母,以区别变量和函数名。如果需要,可以将单词放连在一起或使用下划线分隔,只要确保它们都是大写的就行。 +#### 3、外部声明 ``` /* main.c */ @@ -165,27 +163,25 @@ extern char *optarg; extern int opterr, optind; ``` -**extern** 声明将该名称带入当前编译单元的命名空间(也称为 "file"),并允许程序访问该变量。这里我们引入了三个整数变量和一个字符指针的定义。**getopt()** 函数使用 **opt** 前缀变量,C 标准库使用 **errno** 作为带外通信通道来传达函数可能的失败原因。 - -#### 4\. Typedefs +`extern` 声明将该名称带入当前编译单元的命名空间(也称为 “文件”),并允许程序访问该变量。这里我们引入了三个整数变量和一个字符指针的定义。`opt` 前缀的几个变量是由 `getopt()` 函数使用的,C 标准库使用 `errno` 作为带外通信通道来传达函数可能的失败原因。 +#### 4、类型定义 ``` /* main.c */ <...> typedef struct { -int verbose; -uint32_t flags; -FILE *input; -FILE *output; + int verbose; + uint32_t flags; + FILE *input; + FILE *output; } options_t; ``` -在外部声明之后,我喜欢为结构、联合和枚举声明 **typedefs**。命名 **typedef** 本身就是一种传统行为。我非常喜欢 **_t** 后缀来表示该名称是一种类型。在这个例子中,我将 **options_t** 声明为一个包含 4 个成员的 **struct**。C 是一种与空格无关的编程语言,因此我使用空格将字段名排列在同一列中。我只是喜欢它的样子。对于指针声明,我在名称前面加上星号,以明确它是一个指针。 - -#### 5\. 全局变量声明 +在外部声明之后,我喜欢为结构、联合和枚举声明 `typedef`。命名一个 `typedef` 本身就是一种传统行为。我非常喜欢使用 `_t` 后缀来表示该名称是一种类型。在这个例子中,我将 `options_t` 声明为一个包含 4 个成员的 `struct`。C 是一种空格无关的编程语言,因此我使用空格将字段名排列在同一列中。我只是喜欢它看起来的样子。对于指针声明,我在名称前面加上星号,以明确它是一个指针。 +#### 5、全局变量声明 ``` /* main.c */ @@ -194,10 +190,9 @@ FILE *output; int dumb_global_variable = -11; ``` -全局变量是一个坏主意,你永远不应该使用它们。但如果你必须使用全局变量,请在这里声明并确保给它们一个默认值。说真的,_不要使用全局变量_。 - -#### 6\. 函数原型 +全局变量是一个坏主意,你永远不应该使用它们。但如果你必须使用全局变量,请在这里声明并确保给它们一个默认值。说真的,*不要使用全局变量*。 +#### 6、函数原型 ``` /* main.c */ @@ -207,144 +202,143 @@ void usage(char *progname, int opt); int do_the_needful(options_t *options); ``` -在编写函数时,将它们添加到 **main()** 函数之后而不是之前,这里放函数原型。早期的 C 编译器使用单遍策略,这意味着你在程序中使用的每个符号(变量或函数名称)必须在使用之前声明。现代编译器几乎都是多遍编译器,它们在生成代码之前构建一个完整的符号表,因此并不严格要求使用函数原型。但是,有时你无法选择代码中使用的编译器,所以请编写函数原型并继续。 +在编写函数时,将它们添加到 `main()` 函数之后而不是之前,在这里放函数原型。早期的 C 编译器使用单遍策略,这意味着你在程序中使用的每个符号(变量或函数名称)必须在使用之前声明。现代编译器几乎都是多遍编译器,它们在生成代码之前构建一个完整的符号表,因此并不严格要求使用函数原型。但是,有时你无法选择代码要使用的编译器,所以请编写函数原型并继续。 -当然,我总是包含一个 **usage()** 函数,当 **main()** 函数不理解你从命令行传入的内容时,它会调用这个函数。 - -#### 7\. 命令行解析 +当然,我总是包含一个 `usage()` 函数,当 `main()` 函数不理解你从命令行传入的内容时,它会调用这个函数。 +#### 7、命令行解析 ``` /* main.c */ <...> int main(int argc, char *argv[]) { -int opt; -options_t options = { 0, 0x0, stdin, stdout }; + int opt; + options_t options = { 0, 0x0, stdin, stdout }; -opterr = 0; + opterr = 0; -while ((opt = getopt(argc, argv, OPTSTR)) != EOF) -switch(opt) { -case 'i': -if (!(options.input = [fopen][6](optarg, "r")) ){ -[perror][7](ERR_FOPEN_INPUT); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} -break; + while ((opt = getopt(argc, argv, OPTSTR)) != EOF) + switch(opt) { + case 'i': + if (!(options.input = fopen(optarg, "r")) ){ + perror(ERR_FOPEN_INPUT); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } + break; -case 'o': -if (!(options.output = [fopen][6](optarg, "w")) ){ -[perror][7](ERR_FOPEN_OUTPUT); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} -break; + case 'o': + if (!(options.output = fopen(optarg, "w")) ){ + perror(ERR_FOPEN_OUTPUT); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } + break; + + case 'f': + options.flags = (uint32_t )strtoul(optarg, NULL, 16); + break; -case 'f': -options.flags = (uint32_t )[strtoul][9](optarg, NULL, 16); -break; + case 'v': + options.verbose += 1; + break; -case 'v': -options.verbose += 1; -break; + case 'h': + default: + usage(basename(argv[0]), opt); + /* NOTREACHED */ + break; + } -case 'h': -default: -usage(basename(argv[0]), opt); -/* NOTREACHED */ -break; -} + if (do_the_needful(&options) != EXIT_SUCCESS) { + perror(ERR_DO_THE_NEEDFUL); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } -if (do_the_needful(&options) != EXIT_SUCCESS) { -[perror][7](ERR_DO_THE_NEEDFUL); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} - -return EXIT_SUCCESS; + return EXIT_SUCCESS; } ``` -好吧,代码有点多。**main()** 函数的目的是收集用户提供的参数,执行最小的输入验证,然后将收集的参数传递给使用它们的函数。这个示例声明使用默认值初始化的 **options** 变量,并解析命令行,根据需要更新 **options**。 +好吧,代码有点多。`main()` 函数的目的是收集用户提供的参数,执行最基本的输入验证,然后将收集到的参数传递给使用它们的函数。这个示例声明一个使用默认值初始化的 `options` 变量,并解析命令行,根据需要更新 `options`。 -**main()** 函数的核心是一个 **while** 循环,它使用 **getopt()** 来遍历 **argv**,寻找命令行选项及其参数(如果有的话)。文件前面的 **OPTSTR** **#define** 是驱动 **getopt()** 行为的模板。**opt** 变量接受 **getopt()** 找到的任何命令行选项的字符值,程序对检测命令行选项的响应发生在 **switch** 语句中。 +`main()` 函数的核心是一个 `while` 循环,它使用 `getopt()` 来遍历 `argv`,寻找命令行选项及其参数(如果有的话)。文件前面的 `OPTSTR` 定义是驱动 `getopt()` 行为的模板。`opt` 变量接受 `getopt()` 找到的任何命令行选项的字符值,程序对检测命令行选项的响应发生在 `switch` 语句中。 -现在你注意到了可能会问,为什么 **opt** 被声明为 32 位 **int**,但是预期是 8 位 **char**?事实上 **getopt()** 返回一个 **int**,当它到达 **argv** 末尾时取负值,我会使用 **EOF**(_文件末尾_ 标记)匹配。**char** 是有符号的,但我喜欢将变量匹配到它们的函数返回值。 +现在你注意到了可能会问,为什么 `opt` 被声明为 32 位 `int`,但是预期是 8 位 `char`?事实上 `getopt()` 返回一个 `int`,当它到达 `argv` 末尾时取负值,我会使用 `EOF`(*文件末尾*标记)匹配。`char` 是有符号的,但我喜欢将变量匹配到它们的函数返回值。 -当检测到一个已知的命令行选项时,会发生特定的行为。有些选项有一个参数,在 **OPTSTR** 中指定了一个以冒号结尾的参数。当一个选项有一个参数时,**argv** 中的下一个字符串可以通过外部定义的变量 **optarg** 提供给程序。我使用 **optarg** 打开文件进行读写,或者将命令行参数从字符串转换为整数值。 +当检测到一个已知的命令行选项时,会发生特定的行为。有些选项有一个参数,在 `OPTSTR` 中指定了一个以冒号结尾的参数。当一个选项有一个参数时,`argv` 中的下一个字符串可以通过外部定义的变量 `optarg` 提供给程序。我使用 `optarg` 打开文件进行读写,或者将命令行参数从字符串转换为整数值。 这里有几个关于风格的要点: - * 将 **opterr** 初始化为 0,禁止 **getopt** 发出 **?**。 - * 在 **main()** 的中间使用 **exit(EXIT_FAILURE);** 或 **exit(EXIT_SUCCESS);**。 - * **/* NOTREACHED */** 是我喜欢的一个 lint 指令。 - * 在函数末尾使用 **return EXIT_SUCCESS;** 返回一个 int 类型。 + * 将 `opterr` 初始化为 0,禁止 `getopt` 发出 `?`。 + * 在 `main()` 的中间使用 `exit(EXIT_FAILURE);` 或 `exit(EXIT_SUCCESS);`。 + * `/* NOTREACHED */` 是我喜欢的一个 lint 指令。 + * 在函数末尾使用 `return EXIT_SUCCESS;` 返回一个 int 类型。 * 显示强制转换隐式类型。 -这个程序的命令行签名经过编译如下所示: +这个程序的命令行格式,经过编译如下所示: + ``` $ ./a.out -h a.out [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h] ``` -事实上,**usage()** 在编译后就会向 **stderr** 发出这样的命令。 +事实上,在编译后 `usage()` 就会向 `stderr` 发出这样的内容。 -#### 8\. 函数声明 +#### 8、函数声明 ``` /* main.c */ <...> void usage(char *progname, int opt) { -[fprintf][10](stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ + fprintf(stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); + exit(EXIT_FAILURE); + /* NOTREACHED */ } int do_the_needful(options_t *options) { -if (!options) { -errno = EINVAL; -return EXIT_FAILURE; -} + if (!options) { + errno = EINVAL; + return EXIT_FAILURE; + } -if (!options->input || !options->output) { -errno = ENOENT; -return EXIT_FAILURE; -} + if (!options->input || !options->output) { + errno = ENOENT; + return EXIT_FAILURE; + } -/* XXX do needful stuff */ + /* XXX do needful stuff */ -return EXIT_SUCCESS; + return EXIT_SUCCESS; } ``` -最后,我编写的函数不是样板函数。在本例中,函数 **do_the_needful()** 接受指向 **options_t** 结构的指针。我验证 **options** 指针不为 **NULL**,然后继续验证 **input** 和 **output** 结构成员。如果其中一个测试失败,返回 **EXIT_FAILURE**,并且通过将外部全局变量 **errno** 设置为常规错误代码,我向调用者发出一个原因的信号。调用者可以使用便捷函数 **perror()** 来根据 **errno** 的值发出人类可读的错误消息。 +最后,我编写的函数不是样板函数。在本例中,函数 `do_the_needful()` 接受指向 `options_t` 结构的指针。我验证 `options` 指针不为 `NULL`,然后继续验证 `input` 和 `output` 结构成员。如果其中一个测试失败,返回 `EXIT_FAILURE`,并且通过将外部全局变量 `errno` 设置为常规错误代码,我向调用者发出一个原因的信号。调用者可以使用便捷函数 `perror()` 来根据 `errno` 的值发出人类可读的错误消息。 -函数几乎总是以某种方式验证它们的输入。如果完全验证代价很大,那么尝试执行一次并将验证后的数据视为不可变。**usage()** 函数使用 **fprintf()** 调用中的条件赋值验证 **progname** 参数。**usage()** 函数无论如何都要退出,所以我不需要设置 **errno** 或为使用正确的程序名大吵一场。 +函数几乎总是以某种方式验证它们的输入。如果完全验证代价很大,那么尝试执行一次并将验证后的数据视为不可变。`usage()` 函数使用 `fprintf()` 调用中的条件赋值验证 `progname` 参数。`usage()` 函数无论如何都要退出,所以我不需要设置 `errno` 或为使用正确的程序名大吵一场。 -在这里,我要避免的最大错误是取消引用 **NULL** 指针。这将导致操作系统向我的进程发送一个名为 **SYSSEGV** 的特殊信号,导致不可避免的死亡。用户希望看到的是由 **SYSSEGV** 引起的崩溃。为了发出更好的错误消息并优雅地关闭程序,捕获 **NULL** 指针要好得多。 +在这里,我要避免的最大错误是解引用 `NULL` 指针。这将导致操作系统向我的进程发送一个名为 `SYSSEGV` 的特殊信号,导致不可避免的死亡。用户希望看到的是由 `SYSSEGV` 引起的崩溃。为了发出更好的错误消息并优雅地关闭程序,捕获 `NULL` 指针要好得多。 -有些人抱怨在函数体中有多个 **return** 语句,他们争论“控制流的连续性”和其他东西。老实说,如果函数中间出现错误,那么这个时候是返回错误条件的好时机。写一大堆嵌套的 **if** 语句只有一个 return 绝不是一个“好主意。”™ +有些人抱怨在函数体中有多个 `return` 语句,他们争论“控制流的连续性”和其他东西。老实说,如果函数中间出现错误,那么这个时候是返回错误条件的好时机。写一大堆嵌套的 `if` 语句只有一个 `return` 绝不是一个“好主意”™。 -最后,如果您编写的函数接受四个或更多参数,请考虑将它们绑定到一个结构中,并传递一个指向该结构的指针。这使得函数签名更简单,更容易记住,并且在以后调用时不会出错。它还使调用函数速度稍微快一些,因为需要复制到函数堆栈中的东西更少。在实践中,只有在函数被调用数百万或数十亿次时,才会考虑这个问题。如果认为这没有意义,那么不要担心。 +最后,如果你编写的函数接受四个或更多参数,请考虑将它们绑定到一个结构中,并传递一个指向该结构的指针。这使得函数签名更简单,更容易记住,并且在以后调用时不会出错。它还使调用函数速度稍微快一些,因为需要复制到函数堆栈中的东西更少。在实践中,只有在函数被调用数百万或数十亿次时,才会考虑这个问题。如果认为这没有意义,那么不要担心。 ### 等等,你说没有注释 !?!! -在 **do_the_needful()** 函数中,我写了一种特殊类型的注释,它被设计为占位符而不是记录代码: - +在 `do_the_needful()` 函数中,我写了一种特殊类型的注释,它被设计为占位符而不是说明代码: ``` `/* XXX do needful stuff */` ``` -当你在该区域时,有时你不想停下来编写一些特别复杂的代码,你会之后再写,而不是现在。那就是我留给自己一点面包屑的地方。我插入一个带有 **XXX** 前缀的注释和一个描述需要做什么的简短注释。之后,当我有更多时间的时候,我会在源代码中寻找 **XXX**。使用什么并不重要,只要确保它不太可能在另一个上下文中以函数名或变量形式显示在代码库中。 +当你在该区域时,有时你不想停下来编写一些特别复杂的代码,你会之后再写,而不是现在。那就是我留给自己再次回来的地方。我插入一个带有 `XXX` 前缀的注释和一个描述需要做什么的简短注释。之后,当我有更多时间的时候,我会在源代码中寻找 `XXX`。使用什么并不重要,只要确保它不太可能在另一个上下文中以函数名或变量形式显示在代码库中。 -### 把它们放在一起 +### 把它们组合在一起 -好吧,当你编译这个程序后,它 _仍_ 仍几乎没有任何作用。但是现在你有了一个坚实的骨架来构建你自己的命令行解析 C 程序。 +好吧,当你编译这个程序后,它*仍然*几乎没有任何作用。但是现在你有了一个坚实的骨架来构建你自己的命令行解析 C 程序。 ``` /* main.c - the complete listing */ @@ -357,9 +351,9 @@ return EXIT_SUCCESS; #include #include -#define OPTSTR "vi⭕f:h" -#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" -#define ERR_FOPEN_INPUT "fopen(input, r)" +#define OPTSTR "vi:o:f:h" +#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" +#define ERR_FOPEN_INPUT "fopen(input, r)" #define ERR_FOPEN_OUTPUT "fopen(output, w)" #define ERR_DO_THE_NEEDFUL "do_the_needful blew up" #define DEFAULT_PROGNAME "george" @@ -369,86 +363,86 @@ extern char *optarg; extern int opterr, optind; typedef struct { -int verbose; -uint32_t flags; -FILE *input; -FILE *output; + int verbose; + uint32_t flags; + FILE *input; + FILE *output; } options_t; int dumb_global_variable = -11; void usage(char *progname, int opt); -int do_the_needful(options_t *options); +int do_the_needful(options_t *options); int main(int argc, char *argv[]) { -int opt; -options_t options = { 0, 0x0, stdin, stdout }; + int opt; + options_t options = { 0, 0x0, stdin, stdout }; -opterr = 0; + opterr = 0; -while ((opt = getopt(argc, argv, OPTSTR)) != EOF) -switch(opt) { -case 'i': -if (!(options.input = [fopen][6](optarg, "r")) ){ -[perror][7](ERR_FOPEN_INPUT); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} -break; + while ((opt = getopt(argc, argv, OPTSTR)) != EOF) + switch(opt) { + case 'i': + if (!(options.input = fopen(optarg, "r")) ){ + perror(ERR_FOPEN_INPUT); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } + break; -case 'o': -if (!(options.output = [fopen][6](optarg, "w")) ){ -[perror][7](ERR_FOPEN_OUTPUT); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} -break; + case 'o': + if (!(options.output = fopen(optarg, "w")) ){ + perror(ERR_FOPEN_OUTPUT); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } + break; + + case 'f': + options.flags = (uint32_t )strtoul(optarg, NULL, 16); + break; -case 'f': -options.flags = (uint32_t )[strtoul][9](optarg, NULL, 16); -break; + case 'v': + options.verbose += 1; + break; -case 'v': -options.verbose += 1; -break; + case 'h': + default: + usage(basename(argv[0]), opt); + /* NOTREACHED */ + break; + } -case 'h': -default: -usage(basename(argv[0]), opt); -/* NOTREACHED */ -break; -} + if (do_the_needful(&options) != EXIT_SUCCESS) { + perror(ERR_DO_THE_NEEDFUL); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } -if (do_the_needful(&options) != EXIT_SUCCESS) { -[perror][7](ERR_DO_THE_NEEDFUL); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ -} - -return EXIT_SUCCESS; + return EXIT_SUCCESS; } void usage(char *progname, int opt) { -[fprintf][10](stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); -[exit][8](EXIT_FAILURE); -/* NOTREACHED */ + fprintf(stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); + exit(EXIT_FAILURE); + /* NOTREACHED */ } int do_the_needful(options_t *options) { -if (!options) { -errno = EINVAL; -return EXIT_FAILURE; -} + if (!options) { + errno = EINVAL; + return EXIT_FAILURE; + } -if (!options->input || !options->output) { -errno = ENOENT; -return EXIT_FAILURE; -} + if (!options->input || !options->output) { + errno = ENOENT; + return EXIT_FAILURE; + } -/* XXX do needful stuff */ + /* XXX do needful stuff */ -return EXIT_SUCCESS; + return EXIT_SUCCESS; } ``` @@ -461,7 +455,7 @@ via: https://opensource.com/article/19/5/how-write-good-c-main-function 作者:[Erik O'Shaughnessy][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9a60b604ee70028efb2e276273d621ce576ae527 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 Jun 2019 21:14:21 +0800 Subject: [PATCH 0787/1154] PRF:20190527 How to write a good C main function.md @MjSeven --- ...527 How to write a good C main function.md | 87 ++++++++++--------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/translated/tech/20190527 How to write a good C main function.md b/translated/tech/20190527 How to write a good C main function.md index 182a127bf2..6dccfc369b 100644 --- a/translated/tech/20190527 How to write a good C main function.md +++ b/translated/tech/20190527 How to write a good C main function.md @@ -12,11 +12,12 @@ > 学习如何构造一个 C 文件并编写一个 C main 函数来成功地处理命令行参数。 -![Hand drawing out the word "code"][1] +![Hand drawing out the word "code"](https://img.linux.net.cn/data/attachment/album/201906/08/211422umrzznnvmapcwuc3.jpg) -我知道,现在孩子们用 Python 和 JavaScript 编写他们疯狂的“应用程序”。但是不要这么快就否定 C 语言 —— 它能够提供很多东西,并且简洁。如果你需要速度,用 C 语言编写可能就是你的答案。如果你正在寻找稳定的职业或者想学习如何捕获[空指针解引用][2],C 语言也可能是你的答案!在本文中,我将解释如何构造一个 C 文件并编写一个 C main 函数来成功地处理命令行参数。 +我知道,现在孩子们用 Python 和 JavaScript 编写他们的疯狂“应用程序”。但是不要这么快就否定 C 语言 —— 它能够提供很多东西,并且简洁。如果你需要速度,用 C 语言编写可能就是你的答案。如果你正在寻找稳定的职业或者想学习如何捕获[空指针解引用][2],C 语言也可能是你的答案!在本文中,我将解释如何构造一个 C 文件并编写一个 C main 函数来成功地处理命令行参数。 我:一个顽固的 Unix 系统程序员。 + 你:一个有编辑器、C 编译器,并有时间打发的人。 让我们开工吧。 @@ -34,7 +35,7 @@ int main(int argc, char *argv[]) { } ``` -这个程序可以*编译*但不*执行*任何操作。 +这个程序可以*编译*但不*干*任何事。 ``` $ gcc main.c @@ -46,7 +47,7 @@ $ ### main 函数是唯一的。 -`main()` 函数是开始执行时所执行的程序的第一个函数,但不是第一个执行的函数。*第一个*函数是 `_start()`,它通常由 C 运行库提供,在编译程序时自动链接。此细节高度依赖于操作系统和编译器工具链,所以我假装没有提到它。 +`main()` 函数是开始执行时所执行的程序的第一个函数,但不是第一个执行的函数。*第一个*函数是 `_start()`,它通常由 C 运行库提供,在编译程序时自动链入。此细节高度依赖于操作系统和编译器工具链,所以我假装没有提到它。 `main()` 函数有两个参数,通常称为 `argc` 和 `argv`,并返回一个有符号整数。大多数 Unix 环境都希望程序在成功时返回 `0`(零),失败时返回 `-1`(负一)。 @@ -55,13 +56,13 @@ $ `argc` | 参数个数 | 参数向量的个数 `argv` | 参数向量 | 字符指针数组 -参数向量 `argv` 是调用程序的命令行的标记化表示形式。在上面的例子中,`argv` 将是以下字符串的列表: +参数向量 `argv` 是调用你的程序的命令行的标记化表示形式。在上面的例子中,`argv` 将是以下字符串的列表: ``` -`argv = [ "/path/to/a.out", "-o", "foo", "-vv" ];` +argv = [ "/path/to/a.out", "-o", "foo", "-vv" ]; ``` -参数向量保证在第一个索引中始终至少有一个字符串 `argv[0]`,这是执行程序的完整路径。 +参数向量在其第一个索引 `argv[0]` 中确保至少会有一个字符串,这是执行程序的完整路径。 ### main.c 文件的剖析 @@ -86,24 +87,24 @@ int main(int argc, char *argv[]) { 下面我将讨论这些编号的各个部分,除了编号为 0 的那部分。如果你必须把版权或许可文本放在源代码中,那就放在那里。 -另一件我不想谈论的事情是注释。 +另一件我不想讨论的事情是注释。 ``` -"Comments lie." -\- A cynical but smart and good looking programmer. +“评论谎言。” +- 一个愤世嫉俗但聪明又好看的程序员。 ``` -使用有意义的函数名和变量名,而不是注释。 +与其使用注释,不如使用有意义的函数名和变量名。 -为了迎合程序员固有的惰性,一旦添加了注释,维护负荷就会增加一倍。如果更改或重构代码,则需要更新或扩展注释。随着时间的推移,代码会发生变化,与注释所描述的内容完全不同。 +鉴于程序员固有的惰性,一旦添加了注释,维护负担就会增加一倍。如果更改或重构代码,则需要更新或扩充注释。随着时间的推移,代码会变得面目全非,与注释所描述的内容完全不同。 -如果你必须写注释,不要写关于代码正在做*什么*,相反,写下*为什么*代码需要这样写。写一些你想在五年后读到的注释,那时你已经将这段代码忘得一干二净。世界的命运取决于你。*不要有压力。* +如果你必须写注释,不要写关于代码正在做*什么*,相反,写下代码*为什么*要这样写。写一些你将要在五年后读到的注释,那时你已经将这段代码忘得一干二净。世界的命运取决于你。*不要有压力。* -#### 1、 包含 +#### 1、包含 -我添加到 `main.c` 文件的第一个东西是包含文件,它们为程序提供大量标准 C 标准库函数和变量。C 标准库做了很多事情。浏览 `/usr/include` 中的头文件,了解它们可以为你做些什么。 +我添加到 `main.c` 文件的第一个东西是包含文件,它们为程序提供大量标准 C 标准库函数和变量。C 标准库做了很多事情。浏览 `/usr/include` 中的头文件,你可以了解到它们可以做些什么。 -`#include` 字符串是 [C 预处理程序][4](cpp)指令,它会将引用的文件完整地包含在当前文件中。C 中的头文件通常以 `.h` 扩展名命名,且不应包含任何可执行代码。它只有宏、定义、类型定义、外部变量和函数原型。字符串 `` 告诉 cpp 在系统定义的头文件路径中查找名为 `header.h` 的文件,通常在 `/usr/include` 目录中。 +`#include` 字符串是 [C 预处理程序][4](cpp)指令,它会将引用的文件完整地包含在当前文件中。C 中的头文件通常以 `.h` 扩展名命名,且不应包含任何可执行代码。它只有宏、定义、类型定义、外部变量和函数原型。字符串 `` 告诉 cpp 在系统定义的头文件路径中查找名为 `header.h` 的文件,它通常在 `/usr/include` 目录中。 ``` /* main.c */ @@ -117,17 +118,17 @@ int main(int argc, char *argv[]) { #include ``` -以上内容是我默认会包含的最小全局包含集合: +这是我默认会全局包含的最小包含集合,它将引入: \#include 文件 | 提供的东西 ---|--- -stdio | 提供 FILE、stdin、stdout、stderr 和 `fprint()` 函数系列 +stdio | 提供 `FILE`、`stdin`、`stdout`、`stderr` 和 `fprint()` 函数系列 stdlib | 提供 `malloc()`、`calloc()` 和 `realloc()` unistd | 提供 `EXIT_FAILURE`、`EXIT_SUCCESS` libgen | 提供 `basename()` 函数 -errno | 定义外部 errno 变量及其可以接受的所有值 +errno | 定义外部 `errno` 变量及其可以接受的所有值 string | 提供 `memcpy()`、`memset()` 和 `strlen()` 函数系列 -getopt | 提供外部 optarg、opterr、optind 和 `getopt()` 函数 +getopt | 提供外部 `optarg`、`opterr`、`optind` 和 `getopt()` 函数 sys/types | 类型定义快捷方式,如 `uint32_t` 和 `uint64_t` #### 2、定义 @@ -144,11 +145,11 @@ sys/types | 类型定义快捷方式,如 `uint32_t` 和 `uint64_t` #define DEFAULT_PROGNAME "george" ``` -这在现在没有多大意义,但 `OPTSTR` 定义我会说明一下,它是程序推荐的命令行开关。参考 [getopt(3)][5] man 页面,了解 `OPTSTR` 将如何影响 `getopt()` 的行为。 +这在现在没有多大意义,但 `OPTSTR` 定义我这里会说明一下,它是程序推荐的命令行开关。参考 [getopt(3)][5] man 页面,了解 `OPTSTR` 将如何影响 `getopt()` 的行为。 -`USAGE_FMT` 定义了一个 `printf()` 风格形式的格式字符串,在 `usage()` 函数中被引用。 +`USAGE_FMT` 定义了一个 `printf()` 风格的格式字符串,它用在 `usage()` 函数中。 -我还喜欢将字符串常量放在文件的这一部分作为 `#defines`。如果需要,把它们收集在一起可以更容易地修复拼写、重用消息和国际化消息。 +我还喜欢将字符串常量放在文件的 `#define` 这一部分。如果需要,把它们收集在一起可以更容易地修正拼写、重用消息和国际化消息。 最后,在命名 `#define` 时全部使用大写字母,以区别变量和函数名。如果需要,可以将单词放连在一起或使用下划线分隔,只要确保它们都是大写的就行。 @@ -163,7 +164,7 @@ extern char *optarg; extern int opterr, optind; ``` -`extern` 声明将该名称带入当前编译单元的命名空间(也称为 “文件”),并允许程序访问该变量。这里我们引入了三个整数变量和一个字符指针的定义。`opt` 前缀的几个变量是由 `getopt()` 函数使用的,C 标准库使用 `errno` 作为带外通信通道来传达函数可能的失败原因。 +`extern` 声明将该名称带入当前编译单元的命名空间(即 “文件”),并允许程序访问该变量。这里我们引入了三个整数变量和一个字符指针的定义。`opt` 前缀的几个变量是由 `getopt()` 函数使用的,C 标准库使用 `errno` 作为带外通信通道来传达函数可能的失败原因。 #### 4、类型定义 @@ -179,7 +180,7 @@ typedef struct { } options_t; ``` -在外部声明之后,我喜欢为结构、联合和枚举声明 `typedef`。命名一个 `typedef` 本身就是一种传统行为。我非常喜欢使用 `_t` 后缀来表示该名称是一种类型。在这个例子中,我将 `options_t` 声明为一个包含 4 个成员的 `struct`。C 是一种空格无关的编程语言,因此我使用空格将字段名排列在同一列中。我只是喜欢它看起来的样子。对于指针声明,我在名称前面加上星号,以明确它是一个指针。 +在外部声明之后,我喜欢为结构、联合和枚举声明 `typedef`。命名一个 `typedef` 是一种传统习惯。我非常喜欢使用 `_t` 后缀来表示该名称是一种类型。在这个例子中,我将 `options_t` 声明为一个包含 4 个成员的 `struct`。C 是一种空格无关的编程语言,因此我使用空格将字段名排列在同一列中。我只是喜欢它看起来的样子。对于指针声明,我在名称前面加上星号,以明确它是一个指针。 #### 5、全局变量声明 @@ -190,7 +191,7 @@ typedef struct { int dumb_global_variable = -11; ``` -全局变量是一个坏主意,你永远不应该使用它们。但如果你必须使用全局变量,请在这里声明并确保给它们一个默认值。说真的,*不要使用全局变量*。 +全局变量是一个坏主意,你永远不应该使用它们。但如果你必须使用全局变量,请在这里声明,并确保给它们一个默认值。说真的,*不要使用全局变量*。 #### 6、函数原型 @@ -202,7 +203,7 @@ void usage(char *progname, int opt); int do_the_needful(options_t *options); ``` -在编写函数时,将它们添加到 `main()` 函数之后而不是之前,在这里放函数原型。早期的 C 编译器使用单遍策略,这意味着你在程序中使用的每个符号(变量或函数名称)必须在使用之前声明。现代编译器几乎都是多遍编译器,它们在生成代码之前构建一个完整的符号表,因此并不严格要求使用函数原型。但是,有时你无法选择代码要使用的编译器,所以请编写函数原型并继续。 +在编写函数时,将它们添加到 `main()` 函数之后而不是之前,在这里放函数原型。早期的 C 编译器使用单遍策略,这意味着你在程序中使用的每个符号(变量或函数名称)必须在使用之前声明。现代编译器几乎都是多遍编译器,它们在生成代码之前构建一个完整的符号表,因此并不严格要求使用函数原型。但是,有时你无法选择代码要使用的编译器,所以请编写函数原型并继续这样做下去。 当然,我总是包含一个 `usage()` 函数,当 `main()` 函数不理解你从命令行传入的内容时,它会调用这个函数。 @@ -261,20 +262,20 @@ int main(int argc, char *argv[]) { } ``` -好吧,代码有点多。`main()` 函数的目的是收集用户提供的参数,执行最基本的输入验证,然后将收集到的参数传递给使用它们的函数。这个示例声明一个使用默认值初始化的 `options` 变量,并解析命令行,根据需要更新 `options`。 +好吧,代码有点多。这个 `main()` 函数的目的是收集用户提供的参数,执行最基本的输入验证,然后将收集到的参数传递给使用它们的函数。这个示例声明一个使用默认值初始化的 `options` 变量,并解析命令行,根据需要更新 `options`。 -`main()` 函数的核心是一个 `while` 循环,它使用 `getopt()` 来遍历 `argv`,寻找命令行选项及其参数(如果有的话)。文件前面的 `OPTSTR` 定义是驱动 `getopt()` 行为的模板。`opt` 变量接受 `getopt()` 找到的任何命令行选项的字符值,程序对检测命令行选项的响应发生在 `switch` 语句中。 +`main()` 函数的核心是一个 `while` 循环,它使用 `getopt()` 来遍历 `argv`,寻找命令行选项及其参数(如果有的话)。文件前面定义的 `OPTSTR` 是驱动 `getopt()` 行为的模板。`opt` 变量接受 `getopt()` 找到的任何命令行选项的字符值,程序对检测命令行选项的响应发生在 `switch` 语句中。 -现在你注意到了可能会问,为什么 `opt` 被声明为 32 位 `int`,但是预期是 8 位 `char`?事实上 `getopt()` 返回一个 `int`,当它到达 `argv` 末尾时取负值,我会使用 `EOF`(*文件末尾*标记)匹配。`char` 是有符号的,但我喜欢将变量匹配到它们的函数返回值。 +如果你注意到了可能会问,为什么 `opt` 被声明为 32 位 `int`,但是预期是 8 位 `char`?事实上 `getopt()` 返回一个 `int`,当它到达 `argv` 末尾时取负值,我会使用 `EOF`(*文件末尾*标记)匹配。`char` 是有符号的,但我喜欢将变量匹配到它们的函数返回值。 -当检测到一个已知的命令行选项时,会发生特定的行为。有些选项有一个参数,在 `OPTSTR` 中指定了一个以冒号结尾的参数。当一个选项有一个参数时,`argv` 中的下一个字符串可以通过外部定义的变量 `optarg` 提供给程序。我使用 `optarg` 打开文件进行读写,或者将命令行参数从字符串转换为整数值。 +当检测到一个已知的命令行选项时,会发生特定的行为。在 `OPTSTR` 中指定一个以冒号结尾的参数,这些选项可以有一个参数。当一个选项有一个参数时,`argv` 中的下一个字符串可以通过外部定义的变量 `optarg` 提供给程序。我使用 `optarg` 来打开文件进行读写,或者将命令行参数从字符串转换为整数值。 -这里有几个关于风格的要点: +这里有几个关于代码风格的要点: - * 将 `opterr` 初始化为 0,禁止 `getopt` 发出 `?`。 + * 将 `opterr` 初始化为 `0`,禁止 `getopt` 触发 `?`。 * 在 `main()` 的中间使用 `exit(EXIT_FAILURE);` 或 `exit(EXIT_SUCCESS);`。 * `/* NOTREACHED */` 是我喜欢的一个 lint 指令。 - * 在函数末尾使用 `return EXIT_SUCCESS;` 返回一个 int 类型。 + * 在返回 int 类型的函数末尾使用 `return EXIT_SUCCESS;`。 * 显示强制转换隐式类型。 这个程序的命令行格式,经过编译如下所示: @@ -316,25 +317,25 @@ int do_the_needful(options_t *options) { } ``` -最后,我编写的函数不是样板函数。在本例中,函数 `do_the_needful()` 接受指向 `options_t` 结构的指针。我验证 `options` 指针不为 `NULL`,然后继续验证 `input` 和 `output` 结构成员。如果其中一个测试失败,返回 `EXIT_FAILURE`,并且通过将外部全局变量 `errno` 设置为常规错误代码,我向调用者发出一个原因的信号。调用者可以使用便捷函数 `perror()` 来根据 `errno` 的值发出人类可读的错误消息。 +我最后编写的函数不是个样板函数。在本例中,函数 `do_the_needful()` 接受一个指向 `options_t` 结构的指针。我验证 `options` 指针不为 `NULL`,然后继续验证 `input` 和 `output` 结构成员。如果其中一个测试失败,返回 `EXIT_FAILURE`,并且通过将外部全局变量 `errno` 设置为常规错误代码,我可以告知调用者常规的错误原因。调用者可以使用便捷函数 `perror()` 来根据 `errno` 的值发出便于阅读的错误消息。 -函数几乎总是以某种方式验证它们的输入。如果完全验证代价很大,那么尝试执行一次并将验证后的数据视为不可变。`usage()` 函数使用 `fprintf()` 调用中的条件赋值验证 `progname` 参数。`usage()` 函数无论如何都要退出,所以我不需要设置 `errno` 或为使用正确的程序名大吵一场。 +函数几乎总是以某种方式验证它们的输入。如果完全验证代价很大,那么尝试执行一次并将验证后的数据视为不可变。`usage()` 函数使用 `fprintf()` 调用中的条件赋值验证 `progname` 参数。接下来 `usage()` 函数就退出了,所以我不会费心设置 `errno`,也不用操心是否使用正确的程序名。 -在这里,我要避免的最大错误是解引用 `NULL` 指针。这将导致操作系统向我的进程发送一个名为 `SYSSEGV` 的特殊信号,导致不可避免的死亡。用户希望看到的是由 `SYSSEGV` 引起的崩溃。为了发出更好的错误消息并优雅地关闭程序,捕获 `NULL` 指针要好得多。 +在这里,我要避免的最大错误是解引用 `NULL` 指针。这将导致操作系统向我的进程发送一个名为 `SYSSEGV` 的特殊信号,导致不可避免的死亡。用户最不希望看到的是由 `SYSSEGV` 而导致的崩溃。最好是捕获 `NULL` 指针以发出更合适的错误消息并优雅地关闭程序。 -有些人抱怨在函数体中有多个 `return` 语句,他们争论“控制流的连续性”和其他东西。老实说,如果函数中间出现错误,那么这个时候是返回错误条件的好时机。写一大堆嵌套的 `if` 语句只有一个 `return` 绝不是一个“好主意”™。 +有些人抱怨在函数体中有多个 `return` 语句,他们喋喋不休地说些“控制流的连续性”之类的东西。老实说,如果函数中间出现错误,那就应该返回这个错误条件。写一大堆嵌套的 `if` 语句只有一个 `return` 绝不是一个“好主意”™。 -最后,如果你编写的函数接受四个或更多参数,请考虑将它们绑定到一个结构中,并传递一个指向该结构的指针。这使得函数签名更简单,更容易记住,并且在以后调用时不会出错。它还使调用函数速度稍微快一些,因为需要复制到函数堆栈中的东西更少。在实践中,只有在函数被调用数百万或数十亿次时,才会考虑这个问题。如果认为这没有意义,那么不要担心。 +最后,如果你编写的函数接受四个以上的参数,请考虑将它们绑定到一个结构中,并传递一个指向该结构的指针。这使得函数签名更简单,更容易记住,并且在以后调用时不会出错。它还可以使调用函数速度稍微快一些,因为需要复制到函数堆栈中的东西更少。在实践中,只有在函数被调用数百万或数十亿次时,才会考虑这个问题。如果认为这没有意义,那也无所谓。 -### 等等,你说没有注释 !?!! +### 等等,你不是说没有注释吗!?!! -在 `do_the_needful()` 函数中,我写了一种特殊类型的注释,它被设计为占位符而不是说明代码: +在 `do_the_needful()` 函数中,我写了一种特殊类型的注释,它被是作为占位符设计的,而不是为了说明代码: ``` -`/* XXX do needful stuff */` +/* XXX do needful stuff */ ``` -当你在该区域时,有时你不想停下来编写一些特别复杂的代码,你会之后再写,而不是现在。那就是我留给自己再次回来的地方。我插入一个带有 `XXX` 前缀的注释和一个描述需要做什么的简短注释。之后,当我有更多时间的时候,我会在源代码中寻找 `XXX`。使用什么并不重要,只要确保它不太可能在另一个上下文中以函数名或变量形式显示在代码库中。 +当你写到这里时,有时你不想停下来编写一些特别复杂的代码,你会之后再写,而不是现在。那就是我留给自己再次回来的地方。我插入一个带有 `XXX` 前缀的注释和一个描述需要做什么的简短注释。之后,当我有更多时间的时候,我会在源代码中寻找 `XXX`。使用什么前缀并不重要,只要确保它不太可能在另一个上下文环境(如函数名或变量)中出现在你代码库里。 ### 把它们组合在一起 From 80c8816560ce8b49faf283cec2e2368cb1798894 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 Jun 2019 21:15:41 +0800 Subject: [PATCH 0788/1154] PUB:20190527 How to write a good C main function.md @MjSeven https://linux.cn/article-10949-1.html --- .../20190527 How to write a good C main function.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190527 How to write a good C main function.md (99%) diff --git a/translated/tech/20190527 How to write a good C main function.md b/published/20190527 How to write a good C main function.md similarity index 99% rename from translated/tech/20190527 How to write a good C main function.md rename to published/20190527 How to write a good C main function.md index 6dccfc369b..4f993ee777 100644 --- a/translated/tech/20190527 How to write a good C main function.md +++ b/published/20190527 How to write a good C main function.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10949-1.html) [#]: subject: (How to write a good C main function) [#]: via: (https://opensource.com/article/19/5/how-write-good-c-main-function) [#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) From 481914f250de805ccffbf4e3643db0528a9ed402 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 Jun 2019 21:35:42 +0800 Subject: [PATCH 0789/1154] APL:20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md --- ...How To Verify NTP Setup (Sync) is Working or Not In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md b/sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md index 750a6e3ac5..974e916428 100644 --- a/sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md +++ b/sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8ec609b0511c4e893375412aea38bb34204f38eb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 Jun 2019 21:52:22 +0800 Subject: [PATCH 0790/1154] TSL:20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md --- ...Setup (Sync) is Working or Not In Linux.md | 169 ------------------ ...Setup (Sync) is Working or Not In Linux.md | 143 +++++++++++++++ 2 files changed, 143 insertions(+), 169 deletions(-) delete mode 100644 sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md create mode 100644 translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md diff --git a/sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md b/sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md deleted file mode 100644 index 974e916428..0000000000 --- a/sources/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md +++ /dev/null @@ -1,169 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Verify NTP Setup (Sync) is Working or Not In Linux?) -[#]: via: (https://www.2daygeek.com/check-verify-ntp-sync-is-working-or-not-in-linux-using-ntpq-ntpstat-timedatectl/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Verify NTP Setup (Sync) is Working or Not In Linux? -====== - -NTP stand for Network Time Protocol, which synchronize the clock between computer systems over the network. - -NTP server keep all the servers in your organization in-sync with an accurate time to perform time based jobs. - -NTP client will synchronize its clock to the network time server. - -We had already wrote an article about NTP Server and Client installation and configuration. - -If you would like to check these article, navigate to the following links. - - * **[How To Install And Configure NTP Server And NTP Client In Linux?][1]** - * **[How To Install And Configure Chrony As NTP Client?][2]** - - - -I assume that we have already setup NTP server and NTP client using the above links. - -Now, how to verify whether the NTP setup is working correctly or not? - -There are three commands available in Linux to validate the NTP sync. The details are below. In this article, we will tell you, how to verify NTP sync using all these commands. - - * **`ntpq:`** ntpq is standard NTP query program. - * **`ntpstat:`** It shows network time synchronization status. - * **`timedatectl:`** It controls the system time and date in systemd system. - - - -### Method-1: How To Check NTP Status Using ntpq Command? - -The ntpq utility program is used to monitor NTP daemon ntpd operations and determine performance. - -The program can be run either in interactive mode or controlled using command line arguments. - -It prints a list of peers that connected by sending multiple queries to the server. - -If NTP is working properly, you will be getting the output similar to below. - -``` -# ntpq -p - - remote refid st t when poll reach delay offset jitter -============================================================================== -*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 -``` - -**Details:** - - * **-p:** Print a list of the peers known to the server as well as a summary of their state. - - - -### Method-2: How To Check NTP Status Using ntpstat Command? - -ntpstat will report the synchronisation state of the NTP daemon (ntpd) running on the local machine. - -If the local system is found to be synchronised to a reference time source, ntpstat will report the approximate time accuracy. - -The ntpstat command returns three kind of status code based on the NTP sync. The details are below. - - * **`0:`**` ` It returns 0 if clock is synchronised. - * **`1:`**` ` It returns 1 if clock is not synchronised. - * **`2:`**` ` It returns 2 if clock state is indeterminant, for example if ntpd is not contactable. - - - -``` -# ntpstat - -synchronised to NTP server (192.168.1.8) at stratum 3 - time correct to within 508 ms - polling server every 64 s -``` - -### Method-3: How To Check NTP Status Using timedatectl Command? - -**[timedatectl Command][3]** is used to query and change the system clock and its settings in systmed system. - -``` -# timedatectl -or -# timedatectl status - - Local time: Thu 2019-05-30 05:01:05 CDT - Universal time: Thu 2019-05-30 10:01:05 UTC - RTC time: Thu 2019-05-30 10:01:05 - Time zone: America/Chicago (CDT, -0500) - NTP enabled: yes -NTP synchronized: yes - RTC in local TZ: no - DST active: yes - Last DST change: DST began at - Sun 2019-03-10 01:59:59 CST - Sun 2019-03-10 03:00:00 CDT - Next DST change: DST ends (the clock jumps one hour backwards) at - Sun 2019-11-03 01:59:59 CDT - Sun 2019-11-03 01:00:00 CST -``` - -### Bonus Tips: - -Chrony is replacement of NTP client. - -It can synchronize the system clock faster with better time accuracy and it can be particularly useful for the systems which are not online all the time. - -chronyd is smaller, it uses less memory and it wakes up the CPU only when necessary, which is better for power saving. - -It can perform well even when the network is congested for longer periods of time. - -You can use any of the below commands to check Chrony status. - -To check chrony tracking status. - -``` -# chronyc tracking - -Reference ID : C0A80105 (CentOS7.2daygeek.com) -Stratum : 3 -Ref time (UTC) : Thu Mar 28 05:57:27 2019 -System time : 0.000002545 seconds slow of NTP time -Last offset : +0.001194361 seconds -RMS offset : 0.001194361 seconds -Frequency : 1.650 ppm fast -Residual freq : +184.101 ppm -Skew : 2.962 ppm -Root delay : 0.107966967 seconds -Root dispersion : 1.060455322 seconds -Update interval : 2.0 seconds -Leap status : Normal -``` - -Run the sources command to displays information about the current time sources. - -``` -# chronyc sources - -210 Number of sources = 1 -MS Name/IP address Stratum Poll Reach LastRx Last sample -=============================================================================== -^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/check-verify-ntp-sync-is-working-or-not-in-linux-using-ntpq-ntpstat-timedatectl/ - -作者:[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/install-configure-ntp-server-ntp-client-in-linux/ -[2]: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/ -[3]: https://www.2daygeek.com/change-set-time-date-and-timezone-on-linux/ diff --git a/translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md b/translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md new file mode 100644 index 0000000000..9fd9acb375 --- /dev/null +++ b/translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md @@ -0,0 +1,143 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Verify NTP Setup (Sync) is Working or Not In Linux?) +[#]: via: (https://www.2daygeek.com/check-verify-ntp-sync-is-working-or-not-in-linux-using-ntpq-ntpstat-timedatectl/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在 Linux 下确认 NTP 是否同步? +====== + +NTP 意即网络时间协议Network Time Protocol,它通过网络同步计算机系统之间的时钟。NTP 服务器可以使组织中的所有服务器保持同步,以准确时间执行基于时间的作业。NTP 客户端会将其时钟与 NTP 服务器同步。 + +我们已经写了一篇关于 NTP 服务器和客户端安装和配置的文章。如果你想查看这些文章,请导航至以下链接。 + + * [如何在 Linux 上安装、配置 NTP 服务器和客户端?][1] + * [如何安装和配置 Chrony 作为 NTP 客户端?][2] + +我假设我你经使用上述链接设置了 NTP 服务器和 NTP 客户端。现在,如何验证 NTP 设置是否正常工作? + +Linux 中有三个命令可用于验证 NTP 同步情况。详情如下。在本文中,我们将告诉您如何使用所有这些命令验证 NTP 同步。 + + * `ntpq`:ntpq 是一个标准的 NTP 查询程序。 + * `ntpstat`:显示网络世界同步状态。 + * `timedatectl`:它控制 systemd 系统中的系统时间和日期。 + +### 方法 1:如何使用 ntpq 命令检查 NTP 状态? + +`ntpq` 实用程序用于监视 NTP 守护程序 `ntpd` 的操作并确定性能。 + +该程序可以以交互模式运行,也可以使用命令行参数进行控制。它通过向服务器发送多个查询来打印出连接的对等项列表。如果 NTP 正常工作,你将获得类似于下面的输出。 + +``` +# ntpq -p + + remote refid st t when poll reach delay offset jitter +============================================================================== +*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 +``` + +细节: + +* `-p`:打印服务器已知的对等项列表以及其状态摘要。 + +### 方法 2:如何使用 ntpstat 命令检查 NTP 状态? + +`ntpstat` 将报告在本地计算机上运行的 NTP 守护程序(`ntpd`)的同步状态。如果发现本地系统与参考时间源保持同步,则 `ntpstat` 将报告大致的时间精度。 + +`ntpstat` 命令根据 NTP 同步状态返回三种状态码。详情如下。 + +* `0`:如果时钟同步则返回 0。 +* `1`:如果时钟不同步则返回 1。 +* `2`:如果时钟状态不确定,则返回 2,例如 ntpd 不可联系时。 + +``` +# ntpstat + +synchronised to NTP server (192.168.1.8) at stratum 3 + time correct to within 508 ms + polling server every 64 s +``` + +### 方法 3:如何使用 timedatectl 命令检查 NTP 状态? + +[timedatectl 命令][3]用于查询和更改系统时钟及其在 systmed 系统中的设置。 + +``` +# timedatectl +或 +# timedatectl status + + Local time: Thu 2019-05-30 05:01:05 CDT + Universal time: Thu 2019-05-30 10:01:05 UTC + RTC time: Thu 2019-05-30 10:01:05 + Time zone: America/Chicago (CDT, -0500) + NTP enabled: yes +NTP synchronized: yes + RTC in local TZ: no + DST active: yes + Last DST change: DST began at + Sun 2019-03-10 01:59:59 CST + Sun 2019-03-10 03:00:00 CDT + Next DST change: DST ends (the clock jumps one hour backwards) at + Sun 2019-11-03 01:59:59 CDT + Sun 2019-11-03 01:00:00 CST +``` + +### 更多技巧 + +Chrony 是一个 NTP 客户端的替代品。它可以更快地同步系统时钟,时间精度更高,对于一直不在线的系统尤其有用。 + +chronyd 较小,它使用较少的内存,只在必要时才唤醒 CPU,这样可以更好地节省电能。即使网络拥塞较长时间,它也能很好地运行。 + +你可以使用以下任何命令来检查 Chrony 状态。 + +检查 Chrony 跟踪状态。 + +``` +# chronyc tracking + +Reference ID : C0A80105 (CentOS7.2daygeek.com) +Stratum : 3 +Ref time (UTC) : Thu Mar 28 05:57:27 2019 +System time : 0.000002545 seconds slow of NTP time +Last offset : +0.001194361 seconds +RMS offset : 0.001194361 seconds +Frequency : 1.650 ppm fast +Residual freq : +184.101 ppm +Skew : 2.962 ppm +Root delay : 0.107966967 seconds +Root dispersion : 1.060455322 seconds +Update interval : 2.0 seconds +Leap status : Normal +``` + +运行 `sources` 命令以显示有关当前时间源的信息。 + +``` +# chronyc sources + +210 Number of sources = 1 +MS Name/IP address Stratum Poll Reach LastRx Last sample +=============================================================================== +^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-verify-ntp-sync-is-working-or-not-in-linux-using-ntpq-ntpstat-timedatectl/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10811-1.html +[2]: https://linux.cn/article-10820-1.html +[3]: https://www.2daygeek.com/change-set-time-date-and-timezone-on-linux/ From e78be9012298bf5284664accf8ad01dc4a35c513 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 Jun 2019 21:57:00 +0800 Subject: [PATCH 0791/1154] PRF:20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md @wxy --- ...To Verify NTP Setup (Sync) is Working or Not In Linux.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md b/translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md index 9fd9acb375..132eef9b0b 100644 --- a/translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md +++ b/translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Verify NTP Setup (Sync) is Working or Not In Linux?) @@ -10,6 +10,8 @@ 如何在 Linux 下确认 NTP 是否同步? ====== +![](https://img.linux.net.cn/data/attachment/album/201906/08/215622oqdhiuhocsndijlu.jpg) + NTP 意即网络时间协议Network Time Protocol,它通过网络同步计算机系统之间的时钟。NTP 服务器可以使组织中的所有服务器保持同步,以准确时间执行基于时间的作业。NTP 客户端会将其时钟与 NTP 服务器同步。 我们已经写了一篇关于 NTP 服务器和客户端安装和配置的文章。如果你想查看这些文章,请导航至以下链接。 @@ -132,7 +134,7 @@ via: https://www.2daygeek.com/check-verify-ntp-sync-is-working-or-not-in-linux-u 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 72aafb6ca0345cbf54cf0436fbce41c3e93d96d8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 Jun 2019 21:57:49 +0800 Subject: [PATCH 0792/1154] PUB:20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md @wxy https://linux.cn/article-10951-1.html --- ...w To Verify NTP Setup (Sync) is Working or Not In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md (98%) diff --git a/translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md b/published/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md similarity index 98% rename from translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md rename to published/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md index 132eef9b0b..4c28227f63 100644 --- a/translated/tech/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md +++ b/published/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10951-1.html) [#]: subject: (How To Verify NTP Setup (Sync) is Working or Not In Linux?) [#]: via: (https://www.2daygeek.com/check-verify-ntp-sync-is-working-or-not-in-linux-using-ntpq-ntpstat-timedatectl/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 9b1fe351d0e963c20b34ef3654520507a27b831d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 Jun 2019 23:07:45 +0800 Subject: [PATCH 0793/1154] APL:20190531 Why translation platforms matter --- sources/tech/20190531 Why translation platforms matter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190531 Why translation platforms matter.md b/sources/tech/20190531 Why translation platforms matter.md index e513267640..5ac526d7ce 100644 --- a/sources/tech/20190531 Why translation platforms matter.md +++ b/sources/tech/20190531 Why translation platforms matter.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From da096677dfc07833e91eb620e2cf4f093b9e31fa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 8 Jun 2019 23:53:08 +0800 Subject: [PATCH 0794/1154] TSL:20190531 Why translation platforms matter.md --- ...190531 Why translation platforms matter.md | 96 ------------------- ...190531 Why translation platforms matter.md | 87 +++++++++++++++++ 2 files changed, 87 insertions(+), 96 deletions(-) delete mode 100644 sources/tech/20190531 Why translation platforms matter.md create mode 100644 translated/talk/20190531 Why translation platforms matter.md diff --git a/sources/tech/20190531 Why translation platforms matter.md b/sources/tech/20190531 Why translation platforms matter.md deleted file mode 100644 index 5ac526d7ce..0000000000 --- a/sources/tech/20190531 Why translation platforms matter.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why translation platforms matter) -[#]: via: (https://opensource.com/article/19/5/translation-platforms) -[#]: author: (Jean-Baptiste Holcroft https://opensource.com/users/jibec/users/annegentle/users/bcotton) - -Why translation platforms matter -====== -Technical considerations are not the best way to judge a good -translation platform. -![][1] - -Language translation enables open source software to be used by people all over the world, and it's a great way for non-developers to get involved in their favorite projects. There are many [translation tools][2] available that you can evaluate according to how well they handle the main functional areas involved in translations: technical interaction capabilities, teamwork support capabilities, and translation support capabilities. - -Technical interaction considerations include: - - * Supported file formats - * Synchronization with the source repository - * Automation support tools - * Interface possibilities - - - -Support for teamwork (which could also be called "community animation") includes how a platform: - - * Monitors changes (by a translator, on a project, etc.) - * Follows up on updates pushed by projects - * Displays the state of the situation - * Enables or not review and validation steps - * Assists in discussions between translators (from the same team and inter-languages) and with project maintainers - * Supports global communication on the platform (news, etc.) - - - -Translator assistance includes: - - * A clear and ergonomic interface - * A limited number of steps to find a project and start working - * A simple way to read the flow between translation and distribution - * Access to a translation memory machine - * Glossary enrichment - - - -There are no major differences, though there are some minor ones, between source code management platforms relating to the first two functional areas. ****I suspect that the last area pertains mainly to source code. However, the data handled is quite different and users are usually much less technically sophisticated than developers, as well as more numerous. - -### My recommendation - -In my opinion, the GNOME platform offers the best translation platform for the following reasons: - - * Its site contains both the team organization and the translation platform. It's easy to see who is responsible and their roles on the team. Everything is concentrated on a few screens. - * It's easy to find what to work on, and you quickly realize you'll have to download files to your computer and send them back once you modify them. It's not very sexy, but the logic is easy to understand. - * Once you send a file back, the platform can send an alert to the mailing list so the team knows the next steps and the translation can be easily discussed at the global level (rather than commenting on specific sentences). - * It has 297 languages. - * It shows clear percentages on progress, both on basic sentences and advanced menus and documentation. - - - -Coupled with a predictable GNOME release schedule, everything is available for the community to work well because the tool promotes community work. - -If we look at the Debian translation team, which has been doing a good job for years translating an unimaginable amount of content for Fedora (especially news), we see there is a highly codified translation process based exclusively on emails with a manual push in the repositories. This team also puts everything into the process, rather than the tools, and—despite the considerable energy this seems to require—it has worked for many years while being among the leading group of languages. - -My perception is that the primary issue for a successful translation platform is not based on the ability to make the unitary (technical, translation) work, but on how it structures and supports the translation team's processes. This is what gives sustainability. - -The production processes are the most important way to structure a team; by putting them together correctly, it's easy for newcomers to understand how processes work, adopt them, and explain them to the next group of newcomers. - -To build a sustainable community, the first consideration must be on a tool that supports collaborative work, then on its usability. - -This explains my frustration with the [Zanata][3] tool, which is efficient from a technical and interface standpoint, but poor when it comes to helping to structure a community. GIven that translation is a community-driven process (possibly one of the most community-driven processes in open source software development), this is a critical problem for me. - -* * * - -_This article is adapted from "[What's a good translation platform?][4]" originally published on the Jibec Journal and is reused with permission._ - -Learn about seven tools and processes, both human and software, which are used to manage patch... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/translation-platforms - -作者:[Jean-Baptiste Holcroft][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/jibec/users/annegentle/users/bcotton -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_remote_teams_world.png?itok=_9DCHEel -[2]: https://opensource.com/article/17/6/open-source-localization-tools -[3]: http://zanata.org/ -[4]: https://jibecfed.fedorapeople.org/blog-hugo/en/2016/09/whats-a-good-translation-platform/ diff --git a/translated/talk/20190531 Why translation platforms matter.md b/translated/talk/20190531 Why translation platforms matter.md new file mode 100644 index 0000000000..1a44a4ed58 --- /dev/null +++ b/translated/talk/20190531 Why translation platforms matter.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why translation platforms matter) +[#]: via: (https://opensource.com/article/19/5/translation-platforms) +[#]: author: (Jean-Baptiste Holcroft https://opensource.com/users/jibec/users/annegentle/users/bcotton) + +为什么翻译平台很重要 +====== + +技术上的考虑并不是判断一个好的翻译平台的最佳方式。 + +![][1] + +语言翻译可以使开源软件能够被世界各地的人们使用,这是非开发人员参与他们喜欢的(开源)项目的好方法。有许多[翻译工具][2],你可以根据他们处理翻译中涉及的主要功能区域的能力来评估:技术交互能力、团队支持能力和翻译支持能力。 + +技术交互方面包括: + +* 支持的文件格式 +* 与开源存储库的同步 +* 自动化支持工具 +* 接口可能性 + +对团队合作(也可称为“社区活力”)的支持包括该平台如何: + +* 监控变更(按译者、项目等) +* 跟进由项目推动的更新 +* 显示进度状态 +* 是否启用审核和验证步骤 +* 协助(来自同一团队和跨语言的)翻译人员和项目维护人员之间的讨论 +* 平台支持的全球通信(新闻等) + +翻译协助包括: + +* 清晰、符合人体工程学的界面 +* 简单几步就可以找到项目并开始工作 +* 可以简单地阅读到翻译和分发之间流程 +* 可以使用翻译记忆机 +* 词汇表丰富 + +前两个功能区域与源代码管理平台的差别不大,只有一些小的差别。我觉得最后一个区域也主要与源代码有关。但是,它们处理的数据非常不同,它的用户通常比开发人员技术复杂得多,而且数量也更多。 + +### 我的推荐 + +在我看来,GNOME 平台提供了最好的翻译平台,原因如下: + +* 其网站包含团队组织和翻译平台。很容易看出谁在负责以及他们在团队中的角色。一切都集中在几个屏幕上。 +* 很容易找到要处理的内容,并且你会很快意识到你必须将文件下载到计算机并在修改后将其发回。这个流程不是很先进,但逻辑很容易理解。 +* 一旦你发回文件,平台就可以向邮件列表发送警报,以便团队知道后续步骤,并且可以全局轻松讨论翻译(而不是评论特定句子)。 +* 它支持 297 种语言。 +* 它显示了基本句子、高级菜单和文档的明确的进度百分比。 +   +再加上可预测的 GNOME 发布计划,社区可以使用一切可以促进社区工作的工具。 + +如果我们看看 Debian 翻译团队,他们多年来一直在为 Debian (LCTT 译注:此处原文是“Fedora”,疑为笔误)(尤其是新闻)翻译了难以想象的大量内容,我们看到他们有一个高度编码的翻译流程,完全基于电子邮件,手动推送到存储库。该团队还将所有内容都放在流程中,而不是工具中,尽管这似乎需要相当大的技术能力,但它已成为领先的语言群体之一,已经运作多年。 + +我认为,成功的翻译平台的主要问题不是基于单一的(技术、翻译)工作的能力,而是基于如何构建和支持翻译团队的流程。这就是可持续性的原因。 + +生产过程是构建团队最重要的方式;通过正确地将它们组合在一起,新手很容易理解该过程是如何工作的,采用它们,并将它们解释给下一组新人。 + +要建立一个可持续发展的社区,首先要考虑的是支持协同工作的工具,然后是可用性。 + +这解释了我为什么对 [Zanata][3] 工具沮丧,从技术和界面的角度来看,这是有效的,但在帮助构建社区方面却很差。我认为翻译是一个社区驱动的过程(可能是开源软件开发中最受社区驱动的过程之一),这对我来说是一个关键问题。 + +* * * + +本文改编自“[什么是一个好的翻译平台?][4]”,最初发表在 Jibec 期刊上,并经许可重复使用。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/translation-platforms + +作者:[Jean-Baptiste Holcroft][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jibec/users/annegentle/users/bcotton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_remote_teams_world.png?itok=_9DCHEel +[2]: https://opensource.com/article/17/6/open-source-localization-tools +[3]: http://zanata.org/ +[4]: https://jibecfed.fedorapeople.org/blog-hugo/en/2016/09/whats-a-good-translation-platform/ From a1563242373c60ccad51206b0ff41671ff642cc7 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sat, 8 Jun 2019 10:46:34 -0700 Subject: [PATCH 0795/1154] Apply for Translating Apply for Translating --- .../20190423 How to identify same-content files on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190423 How to identify same-content files on Linux.md b/sources/tech/20190423 How to identify same-content files on Linux.md index 8d9b34b30a..d1d5fb8180 100644 --- a/sources/tech/20190423 How to identify same-content files on Linux.md +++ b/sources/tech/20190423 How to identify same-content files on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tomjlw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -245,7 +245,7 @@ via: https://www.networkworld.com/article/3390204/how-to-identify-same-content-f 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tomjlw](https://github.com/tomjlw) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 31f041cd3291efda37e75a4e8c4baecde6f8f55e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 Jun 2019 09:44:55 +0800 Subject: [PATCH 0796/1154] APL:20190409 5 Linux rookie mistakes --- sources/tech/20190409 5 Linux rookie mistakes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 5 Linux rookie mistakes.md b/sources/tech/20190409 5 Linux rookie mistakes.md index 2e2c25a9cf..be08a07e45 100644 --- a/sources/tech/20190409 5 Linux rookie mistakes.md +++ b/sources/tech/20190409 5 Linux rookie mistakes.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7eab60b5002006f1fc4dc3fca82c15e6f056d685 Mon Sep 17 00:00:00 2001 From: runningwater Date: Sun, 9 Jun 2019 10:16:41 +0800 Subject: [PATCH 0797/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How to set up virtual environments for Python on MacOS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190603 How to set up virtual environments for Python on MacOS.md b/sources/tech/20190603 How to set up virtual environments for Python on MacOS.md index 8c54e5a6ac..db01ada8d4 100644 --- a/sources/tech/20190603 How to set up virtual environments for Python on MacOS.md +++ b/sources/tech/20190603 How to set up virtual environments for Python on MacOS.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (runningwater) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -195,7 +195,7 @@ via: https://opensource.com/article/19/6/virtual-environments-python-macos 作者:[Matthew Broberg][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[runningwater](https://github.com/runningwater) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f0946a707f7985871b1e7845dbd6f365927f1b8f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 Jun 2019 10:26:57 +0800 Subject: [PATCH 0798/1154] TSL:20190409 5 Linux rookie mistakes.md --- .../tech/20190409 5 Linux rookie mistakes.md | 54 ------------------ .../tech/20190409 5 Linux rookie mistakes.md | 56 +++++++++++++++++++ 2 files changed, 56 insertions(+), 54 deletions(-) delete mode 100644 sources/tech/20190409 5 Linux rookie mistakes.md create mode 100644 translated/tech/20190409 5 Linux rookie mistakes.md diff --git a/sources/tech/20190409 5 Linux rookie mistakes.md b/sources/tech/20190409 5 Linux rookie mistakes.md deleted file mode 100644 index be08a07e45..0000000000 --- a/sources/tech/20190409 5 Linux rookie mistakes.md +++ /dev/null @@ -1,54 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 Linux rookie mistakes) -[#]: via: (https://opensource.com/article/19/4/linux-rookie-mistakes) -[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p) - -5 Linux rookie mistakes -====== -Linux enthusiasts share some of the biggest mistakes they made. -![magnifying glass on computer screen, finding a bug in the code][1] - -It's smart to learn new skills throughout your life—it keeps your mind nimble and makes you more competitive in the job market. But some skills are harder to learn than others, especially those where small rookie mistakes can cost you a lot of time and trouble when you're trying to fix them. - -Take learning [Linux][2], for example. If you're used to working in a Windows or MacOS graphical interface, moving to Linux, with its unfamiliar commands typed into a terminal, can have a big learning curve. But the rewards are worth it, as the millions and millions of people who have gone before you have proven. - -That said, the journey won't be without pitfalls. We asked some of Linux enthusiasts to think back to when they first started using Linux and tell us about the biggest mistakes they made. - -"Don't go into [any sort of command line interface (CLI) work] with an expectation that commands work in rational or consistent ways, as that is likely to lead to frustration. This is not due to poor design choices—though it can feel like it when you're banging your head against the proverbial desk—but instead reflects the fact that these systems have evolved and been added onto through generations of software and OS evolution. Go with the flow, write down or memorize the commands you need, and (try not to) get frustrated when [things aren't what you'd expect][3]." _—[Gina Likins][4]_ - -"As easy as it might be to just copy and paste commands to make the thing go, read the command first and at least have a general understanding of the actions that are about to be performed. Especially if there is a pipe command. Double especially if there is more than one. There are a lot of destructive commands that look innocuous until you realize what they can do (e.g., **rm** , **dd** ), and you don't want to accidentally destroy things. (Ask me how I know.)" _—[Katie McLaughlin][5]_ - -"Early on in my Linux journey, I wasn't as aware of the importance of knowing where you are in the filesystem. I was deleting some file in what I thought was my home directory, and I entered **sudo rm -rf *** and deleted all of the boot files on my system. Now, I frequently use **pwd** to ensure that I am where I think I am before issuing such commands. Fortunately for me, I was able to boot my wounded laptop with a USB drive and recover my files." _—[Don Watkins][6]_ - -"Do not reset permissions on the entire file system to [777][7] because you think 'permissions are hard to understand' and you want an application to have access to something." _—[Matthew Helmke][8]_ - -"I was removing a package from my system, and I did not check what other packages it was dependent upon. I just let it remove whatever it wanted and ended up causing some of my important programs to crash and become unavailable." _—[Kedar Vijay Kulkarni][9]_ - -What mistakes have you made while learning to use Linux? Share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/linux-rookie-mistakes - -作者:[Jen Wike Huger (Red Hat)][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mistake_bug_fix_find_error.png?itok=PZaz3dga (magnifying glass on computer screen, finding a bug in the code) -[2]: https://opensource.com/resources/linux -[3]: https://lintqueen.com/2017/07/02/learning-while-frustrated/ -[4]: https://opensource.com/users/lintqueen -[5]: https://opensource.com/users/glasnt -[6]: https://opensource.com/users/don-watkins -[7]: https://www.maketecheasier.com/file-permissions-what-does-chmod-777-means/ -[8]: https://twitter.com/matthewhelmke -[9]: https://opensource.com/users/kkulkarn diff --git a/translated/tech/20190409 5 Linux rookie mistakes.md b/translated/tech/20190409 5 Linux rookie mistakes.md new file mode 100644 index 0000000000..3fa5311ea0 --- /dev/null +++ b/translated/tech/20190409 5 Linux rookie mistakes.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 Linux rookie mistakes) +[#]: via: (https://opensource.com/article/19/4/linux-rookie-mistakes) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p) + +5 个 Linux 新手会犯的失误 +====== + +> Linux 爱好者们分享了他们犯下的一些最大错误。 + +![magnifying glass on computer screen, finding a bug in the code][1] + +终身学习是明智的 —— 它可以让你的思维敏捷,让你在就业市场上更具竞争力。但是有些技能比其他技能更难学,尤其是那些小菜鸟错误,当你尝试修复它们时可能会花费你很多时间,给你带来很大困扰。 + +以学习 [Linux][2] 为例。如果你习惯于在 Windows 或 MacOS 图形界面中工作,那么转移到 Linux,要将不熟悉的命令输入到终端中,可能会有很大的学习曲线。但是,其回报是值得的,因为已经有数以百万计的人们已经证明了这一点。 + +也就是说,这趟学习之旅并不是一帆风顺的。我们让一些 Linux 爱好者回想了一下他们刚开始使用 Linux 的时候,并告诉我们他们犯下的最大错误。 + +“不要进入[任何类型的命令行界面(CLI)工作]时就期望命令会以合理或一致的方式工作,因为这可能会导致你感到挫折。这不是因为设计选择不当 —— 虽然当你在键盘上敲击时就像在敲在你的脑袋上一样 —— 而是反映了这些系统是历经了几代的软件和操作系统的发展而陆续添加完成的事实。顺其自然,写下或记住你需要的命令,并且(尽量不要)在[事情不是你所期望的][3]时感到沮丧。” —— [Gina Likins] [4] + +“尽可能简单地复制和粘贴命令以使事情顺利进行,首先阅读命令,至少对将要执行的操作有一个大致的了解,特别是如果有管道命令时,如果有多个管道更要特别注意。有很多破坏性的命令看起来无害 —— 直到你意识到它们能做什么(例如 `rm`、`dd`),而你不会想要意外破坏什么东西(别问我怎么知道)。” —— [Katie McLaughlin] [5] + +“在我的 Linux 之旅的早期,我并不知道我所处在文件系统中的位置的重要性。我正在删除一些我认为是我的主目录的文件,我输入了 `sudo rm -rf *`,然后就删除了我系统上的所有启动文件。现在,我经常使用 `pwd` 来确保我在发出这样的命令之前确认我在哪里。幸运的是,我能够使用 USB 驱动器启动被搞坏的笔记本电脑并恢复我的文件。” —— [Don Watkins] [6] + +“不要因为你认为‘权限很难理解’而你希望应用程序可以访问某些内容时就将整个文件系统的权限重置为 [777][7]。”—— [Matthew Helmke] [8] + +“我从我的系统中删除一个软件包,而我没有检查它依赖的其他软件包。我只是让它删除它想删除要的东西,最终导致我的一些重要程序崩溃并变得不可用。” —— [Kedar Vijay Kulkarni] [9] + +你在学习使用 Linux 时犯过什么错误?请在评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/linux-rookie-mistakes + +作者:[Jen Wike Huger (Red Hat)][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mistake_bug_fix_find_error.png?itok=PZaz3dga (magnifying glass on computer screen, finding a bug in the code) +[2]: https://opensource.com/resources/linux +[3]: https://lintqueen.com/2017/07/02/learning-while-frustrated/ +[4]: https://opensource.com/users/lintqueen +[5]: https://opensource.com/users/glasnt +[6]: https://opensource.com/users/don-watkins +[7]: https://www.maketecheasier.com/file-permissions-what-does-chmod-777-means/ +[8]: https://twitter.com/matthewhelmke +[9]: https://opensource.com/users/kkulkarn From f5eb60d587a60e01df3ff502b21bf8a00bbd0598 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 Jun 2019 10:37:37 +0800 Subject: [PATCH 0799/1154] PRF:20190409 5 Linux rookie mistakes.md @wxy --- .../tech/20190409 5 Linux rookie mistakes.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/tech/20190409 5 Linux rookie mistakes.md b/translated/tech/20190409 5 Linux rookie mistakes.md index 3fa5311ea0..dadd5807a8 100644 --- a/translated/tech/20190409 5 Linux rookie mistakes.md +++ b/translated/tech/20190409 5 Linux rookie mistakes.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10952-1.html) [#]: subject: (5 Linux rookie mistakes) [#]: via: (https://opensource.com/article/19/4/linux-rookie-mistakes) -[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p) 5 个 Linux 新手会犯的失误 ====== > Linux 爱好者们分享了他们犯下的一些最大错误。 -![magnifying glass on computer screen, finding a bug in the code][1] +![](https://img.linux.net.cn/data/attachment/album/201906/09/103635akfkghwh5mp58g68.jpg) 终身学习是明智的 —— 它可以让你的思维敏捷,让你在就业市场上更具竞争力。但是有些技能比其他技能更难学,尤其是那些小菜鸟错误,当你尝试修复它们时可能会花费你很多时间,给你带来很大困扰。 @@ -36,10 +36,10 @@ via: https://opensource.com/article/19/4/linux-rookie-mistakes -作者:[Jen Wike Huger (Red Hat)][a] +作者:[Jen Wike Huger][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4c52204853738b227f4e1f1f5ebb4b3fe0705029 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 Jun 2019 10:37:58 +0800 Subject: [PATCH 0800/1154] PUB:20190409 5 Linux rookie mistakes.md @wxy https://linux.cn/article-10952-1.html --- .../tech => published}/20190409 5 Linux rookie mistakes.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20190409 5 Linux rookie mistakes.md (100%) diff --git a/translated/tech/20190409 5 Linux rookie mistakes.md b/published/20190409 5 Linux rookie mistakes.md similarity index 100% rename from translated/tech/20190409 5 Linux rookie mistakes.md rename to published/20190409 5 Linux rookie mistakes.md From a13edbf17cfd1db5915821f9db20c4bcd9eb02f9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 Jun 2019 11:22:31 +0800 Subject: [PATCH 0801/1154] PRF:20190531 Why translation platforms matter.md @wxy --- ...190531 Why translation platforms matter.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/talk/20190531 Why translation platforms matter.md b/translated/talk/20190531 Why translation platforms matter.md index 1a44a4ed58..535289186b 100644 --- a/translated/talk/20190531 Why translation platforms matter.md +++ b/translated/talk/20190531 Why translation platforms matter.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why translation platforms matter) [#]: via: (https://opensource.com/article/19/5/translation-platforms) [#]: author: (Jean-Baptiste Holcroft https://opensource.com/users/jibec/users/annegentle/users/bcotton) -为什么翻译平台很重要 +什么是翻译平台最重要的地方? ====== -技术上的考虑并不是判断一个好的翻译平台的最佳方式。 +> 技术上的考虑并不是判断一个好的翻译平台的最佳方式。 -![][1] +![](https://img.linux.net.cn/data/attachment/album/201906/09/112224nvvkrv16qv60vwpv.jpg) 语言翻译可以使开源软件能够被世界各地的人们使用,这是非开发人员参与他们喜欢的(开源)项目的好方法。有许多[翻译工具][2],你可以根据他们处理翻译中涉及的主要功能区域的能力来评估:技术交互能力、团队支持能力和翻译支持能力。 @@ -30,31 +30,31 @@ * 显示进度状态 * 是否启用审核和验证步骤 * 协助(来自同一团队和跨语言的)翻译人员和项目维护人员之间的讨论 -* 平台支持的全球通信(新闻等) +* 平台支持的全球通讯(新闻等) 翻译协助包括: * 清晰、符合人体工程学的界面 * 简单几步就可以找到项目并开始工作 -* 可以简单地阅读到翻译和分发之间流程 +* 可以简单地了解到翻译和分发之间流程 * 可以使用翻译记忆机 * 词汇表丰富 -前两个功能区域与源代码管理平台的差别不大,只有一些小的差别。我觉得最后一个区域也主要与源代码有关。但是,它们处理的数据非常不同,它的用户通常比开发人员技术复杂得多,而且数量也更多。 +前两个功能区域与源代码管理平台的差别不大,只有一些小的差别。我觉得最后一个区域也主要与源代码有关。但是,它们处理的数据非常不同,翻译平台的用户通常也不如开发人员了解技术,而数量也更多。 ### 我的推荐 在我看来,GNOME 平台提供了最好的翻译平台,原因如下: -* 其网站包含团队组织和翻译平台。很容易看出谁在负责以及他们在团队中的角色。一切都集中在几个屏幕上。 -* 很容易找到要处理的内容,并且你会很快意识到你必须将文件下载到计算机并在修改后将其发回。这个流程不是很先进,但逻辑很容易理解。 -* 一旦你发回文件,平台就可以向邮件列表发送警报,以便团队知道后续步骤,并且可以全局轻松讨论翻译(而不是评论特定句子)。 -* 它支持 297 种语言。 +* 其网站包含了团队组织和翻译平台。很容易看出谁在负责以及他们在团队中的角色。一切都集中在几个屏幕之内。 +* 很容易找到要处理的内容,并且你会很快意识到你必须将文件下载到本地计算机并在修改后将其发回。这个流程不是很先进,但逻辑很容易理解。 +* 一旦你发回文件,平台就可以向邮件列表发送通告,以便团队知道后续步骤,并且可以全局轻松讨论翻译(而不是评论特定句子)。 +* 它支持多达 297 种语言。 * 它显示了基本句子、高级菜单和文档的明确的进度百分比。    再加上可预测的 GNOME 发布计划,社区可以使用一切可以促进社区工作的工具。 -如果我们看看 Debian 翻译团队,他们多年来一直在为 Debian (LCTT 译注:此处原文是“Fedora”,疑为笔误)(尤其是新闻)翻译了难以想象的大量内容,我们看到他们有一个高度编码的翻译流程,完全基于电子邮件,手动推送到存储库。该团队还将所有内容都放在流程中,而不是工具中,尽管这似乎需要相当大的技术能力,但它已成为领先的语言群体之一,已经运作多年。 +如果我们看看 Debian 翻译团队,他们多年来一直在为 Debian (LCTT 译注:此处原文是“Fedora”,疑为笔误)翻译了难以想象的大量内容(尤其是新闻),我们看到他们有一个高度以来于规则的翻译流程,完全基于电子邮件,手动推送到存储库。该团队还将所有内容都放在流程中,而不是工具中,尽管这似乎需要相当大的技术能力,但它已成为领先的语言群体之一,已经运作多年。 我认为,成功的翻译平台的主要问题不是基于单一的(技术、翻译)工作的能力,而是基于如何构建和支持翻译团队的流程。这就是可持续性的原因。 @@ -75,7 +75,7 @@ via: https://opensource.com/article/19/5/translation-platforms 作者:[Jean-Baptiste Holcroft][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 411f434138f24bb9798b82a9fbd47fe85a9b6dbe Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 Jun 2019 11:22:59 +0800 Subject: [PATCH 0802/1154] PUB:20190531 Why translation platforms matter.md @wxy https://linux.cn/article-10953-1.html --- .../20190531 Why translation platforms matter.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190531 Why translation platforms matter.md (98%) diff --git a/translated/talk/20190531 Why translation platforms matter.md b/published/20190531 Why translation platforms matter.md similarity index 98% rename from translated/talk/20190531 Why translation platforms matter.md rename to published/20190531 Why translation platforms matter.md index 535289186b..92cdbb20b1 100644 --- a/translated/talk/20190531 Why translation platforms matter.md +++ b/published/20190531 Why translation platforms matter.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10953-1.html) [#]: subject: (Why translation platforms matter) [#]: via: (https://opensource.com/article/19/5/translation-platforms) [#]: author: (Jean-Baptiste Holcroft https://opensource.com/users/jibec/users/annegentle/users/bcotton) From 2d5ab22c31779ee11b35968624329868f665e710 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sat, 8 Jun 2019 22:02:16 -0700 Subject: [PATCH 0803/1154] Submit Translated passage for review Submit Translated passage for review --- ...to identify same-content files on Linux.md | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) rename {sources => translated}/tech/20190423 How to identify same-content files on Linux.md (57%) diff --git a/sources/tech/20190423 How to identify same-content files on Linux.md b/translated/tech/20190423 How to identify same-content files on Linux.md similarity index 57% rename from sources/tech/20190423 How to identify same-content files on Linux.md rename to translated/tech/20190423 How to identify same-content files on Linux.md index d1d5fb8180..eb07e45d14 100644 --- a/sources/tech/20190423 How to identify same-content files on Linux.md +++ b/translated/tech/20190423 How to identify same-content files on Linux.md @@ -7,20 +7,20 @@ [#]: via: (https://www.networkworld.com/article/3390204/how-to-identify-same-content-files-on-linux.html#tk.rss_all) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -How to identify same-content files on Linux +如何在 Linux 上识别同样内容的文件 ====== -Copies of files sometimes represent a big waste of disk space and can cause confusion if you want to make updates. Here are six commands to help you identify these files. +有时文件副本代表了对硬盘空间的巨大浪费并会在你想要更新文件时造成困扰。以下是用来识别这些文件的六个命令。 ![Vinoth Chandar \(CC BY 2.0\)][1] -In a recent post, we looked at [how to identify and locate files that are hard links][2] (i.e., that point to the same disk content and share inodes). In this post, we'll check out commands for finding files that have the same _content_ , but are not otherwise connected. +在最近的帖子中,我们看了[如何识别定位硬链接的文件][2](换句话说,指向同一硬盘内容并共享索引节点)。在本篇帖子中,我们将查看能找到具有相同_内容_,却不相链接的文件的命令。 -Hard links are helpful because they allow files to exist in multiple places in the file system while not taking up any additional disk space. Copies of files, on the other hand, sometimes represent a big waste of disk space and run some risk of causing some confusion if you want to make updates. In this post, we're going to look at multiple ways to identify these files. +硬链接很有用时因为它们能够使文件存放在文件系统内的多个地方却不会占用额外的硬盘空间。另一方面,有时文件副本代表了对硬盘空间的巨大浪费,在你想要更新文件时也会有造成困扰之虞。在这篇帖子中,我们将看一下多种识别这些文件的方式。 -**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][3] ]** +**[两分钟 Linux 小贴士:[学习如何通过两分钟视频教程掌握大量 Linux 命令][3]]** -### Comparing files with the diff command +### 用 diff 命令比较文件 -Probably the easiest way to compare two files is to use the **diff** command. The output will show you the differences between the two files. The < and > signs indicate whether the extra lines are in the first (<) or second (>) file provided as arguments. In this example, the extra lines are in backup.html. +可能比较两个文件最简单的方法是使用 **diff** 命令。输出会显示你文件的不同之处。< 和 > 符号代表在当参数传过来的第一个(<)或第二个(>)文件中是否有额外的文字行。在这个例子中,在 backup.html 中有额外的文字行。 ``` $ diff index.html backup.html @@ -30,18 +30,18 @@ $ diff index.html backup.html > ``` -If diff shows no output, that means the two files are the same. +如果 diff 没有输出那代表两个文件相同。 ``` $ diff home.html index.html $ ``` -The only drawbacks to diff are that it can only compare two files at a time, and you have to identify the files to compare. Some commands we will look at in this post can find the duplicate files for you. +diff 的唯一缺点是它一次只能比较两个文件并且你必须指定用来比较的文件,这篇帖子中的一些命令可以为你找到多个重复文件。 -### Using checksums +### 使用 checksums -The **cksum** (checksum) command computes checksums for files. Checksums are a mathematical reduction of the contents to a lengthy number (like 2819078353 228029). While not absolutely unique, the chance that files that are not identical in content would result in the same checksum is extremely small. +**cksum**(checksum) 命令计算文件的校验和。校验和是一种将文字内容转化成一个长数字(例如2819078353 228029)的数学简化。虽然并不是完全独特的,但是文件内容不同校验和却相同的概率微乎其微。 ``` $ cksum *.html @@ -50,11 +50,11 @@ $ cksum *.html 4073570409 227985 index.html ``` -In the example above, you can see how the second and third files yield the same checksum and can be assumed to be identical. +在上述示例中,你可以看到产生同样校验和的第二个和第三个文件是如何可以被默认为相同的。 -### Using the find command +### 使用 find 命令 -While the find command doesn't have an option for finding duplicate files, it can be used to search files by name or type and run the cksum command. For example: +虽然 find 命令并没有寻找重复文件的选项,它依然可以被用来通过名字或类型寻找文件并运行 cksum 命令。例如: ``` $ find . -name "*.html" -exec cksum {} \; @@ -63,9 +63,9 @@ $ find . -name "*.html" -exec cksum {} \; 4073570409 227985 ./index.html ``` -### Using the fslint command +### 使用 fslint 命令 -The **fslint** command can be used to specifically find duplicate files. Note that we give it a starting location. The command can take quite some time to complete if it needs to run through a large number of files. Here's output from a very modest search. Note how it lists the duplicate files and also looks for other issues, such as empty directories and bad IDs. +**fslint** 命令可以被特地用来寻找重复文件。注意我们给了它一个起始位置。如果它需要遍历相当多的文件,这个命令需要花点时间来完成。注意它是如何列出重复文件并寻找其它问题的,比如空目录和坏ID。 ``` $ fslint . @@ -86,15 +86,15 @@ index.html -------------------------Non Stripped executables ``` -You may have to install **fslint** on your system. You will probably have to add it to your search path, as well: +你可能需要在你的系统上安装 **fslint**。 你可能也需要将它加入你的搜索路径: ``` $ export PATH=$PATH:/usr/share/fslint/fslint ``` -### Using the rdfind command +### 使用 rdfind 命令 -The **rdfind** command will also look for duplicate (same content) files. The name stands for "redundant data find," and the command is able to determine, based on file dates, which files are the originals — which is helpful if you choose to delete the duplicates, as it will remove the newer files. +**rdfind** 命令也会寻找重复(相同内容的)文件。它的名字代表“重复数据搜寻”并且它能够基于文件日期判断哪个文件是原件——这在你选择删除副本时很有用因为它会移除较新的文件。 ``` $ rdfind ~ @@ -111,7 +111,7 @@ Totally, 223 KiB can be reduced. Now making results file results.txt ``` -You can also run this command in "dryrun" (i.e., only report the changes that might otherwise be made). +你可以在“dryrun”中运行这个命令 (换句话说,仅仅汇报可能会另外被做出的改动)。 ``` $ rdfind -dryrun true ~ @@ -128,7 +128,7 @@ Removed 9 files due to unique sizes from list.2 files left. (DRYRUN MODE) Now making results file results.txt ``` -The rdfind command also provides options for things such as ignoring empty files (-ignoreempty) and following symbolic links (-followsymlinks). Check out the man page for explanations. +rdfind 命令同样提供了类似忽略空文档(-ignoreempty)和跟踪符号链接(-followsymlinks)的功能。查看 man 页面获取解释。 ``` -ignoreempty ignore empty files @@ -146,7 +146,7 @@ The rdfind command also provides options for things such as ignoring empty files -n, -dryrun display what would have been done, but don't do it ``` -Note that the rdfind command offers an option to delete duplicate files with the **-deleteduplicates true** setting. Hopefully the command's modest problem with grammar won't irritate you. ;-) +注意 rdfind 命令提供了 **-deleteduplicates true** 的设置选项以删除副本。希望这个命令语法上的小问题不会惹恼你。;-) ``` $ rdfind -deleteduplicates true . @@ -154,11 +154,11 @@ $ rdfind -deleteduplicates true . Deleted 1 files. <== ``` -You will likely have to install the rdfind command on your system. It's probably a good idea to experiment with it to get comfortable with how it works. +你将可能需要在你的系统上安装 rdfind 命令。试验它以熟悉如何使用它可能是一个好主意。 -### Using the fdupes command +### 使用 fdupes 命令 -The **fdupes** command also makes it easy to identify duplicate files and provides a large number of useful options — like **-r** for recursion. In its simplest form, it groups duplicate files together like this: +**fdupes** 命令同样使得识别重复文件变得简单。它同时提供了大量有用的选项——例如用来迭代的**-r**。在这个例子中,它像这样将重复文件分组到一起: ``` $ fdupes ~ @@ -173,7 +173,7 @@ $ fdupes ~ /home/shs/hideme.png ``` -Here's an example using recursion. Note that many of the duplicate files are important (users' .bashrc and .profile files) and should clearly not be deleted. +这是使用迭代的一个例子,注意许多重复文件是重要的(用户的 .bashrc 和 .profile 文件)并且不应被删除。 ``` # fdupes -r /home @@ -204,7 +204,7 @@ Here's an example using recursion. Note that many of the duplicate files are imp /home/shs/PNGs/Sandra_rotated.png ``` -The fdupe command's many options are listed below. Use the **fdupes -h** command, or read the man page for more details. +fdupe 命令的许多选项列在下面。使用 **fdupes -h** 命令或者阅读 man 页面获取详情。 ``` -r --recurse recurse @@ -229,15 +229,14 @@ The fdupe command's many options are listed below. Use the **fdupes -h** command -h --help displays help ``` -The fdupes command is another one that you're like to have to install and work with for a while to become familiar with its many options. +fdupes 命令是另一个你可能需要安装并使用一段时间才能熟悉其众多选项的命令。 -### Wrap-up +### 总结 -Linux systems provide a good selection of tools for locating and potentially removing duplicate files, along with options for where you want to run your search and what you want to do with duplicate files when you find them. +Linux 系统提供能够定位并(潜在地)能移除重复文件的一系列的好工具附带能让你指定搜索区域及当对你所发现的重复文件时的处理方式的选项。 +**[也可在:[解决 Linux 问题时的无价建议和技巧][4]上查看]** -**[ Also see:[Invaluable tips and tricks for troubleshooting Linux][4] ]** - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. +在 [Facebook][5] 和 [LinkedIn][6] 上加入 Network World 社区并对任何弹出的话题评论。 -------------------------------------------------------------------------------- @@ -258,3 +257,4 @@ via: https://www.networkworld.com/article/3390204/how-to-identify-same-content-f [4]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html [5]: https://www.facebook.com/NetworkWorld/ [6]: https://www.linkedin.com/company/network-world + From fa8226e11246c0624d07412cfd87c00453b8e280 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 Jun 2019 22:18:09 +0800 Subject: [PATCH 0804/1154] PRF:20170410 Writing a Time Series Database from Scratch.md PART 4 --- ...ing a Time Series Database from Scratch.md | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/translated/tech/20170410 Writing a Time Series Database from Scratch.md b/translated/tech/20170410 Writing a Time Series Database from Scratch.md index 85cbb478e7..58ae92d7ff 100644 --- a/translated/tech/20170410 Writing a Time Series Database from Scratch.md +++ b/translated/tech/20170410 Writing a Time Series Database from Scratch.md @@ -305,27 +305,31 @@ t0 t1 t2 t3 t4 now ### 索引 -研究存储改进的最初想法是解决序列分流的问题。基于块的布局减少了查询所要考虑的序列总数。因此假设我们索引查找的复杂度是 `O(n^2)`,我们就要设法减少 n 个相当数量的复杂度,之后就有了改进后 `O(n^2)` 的复杂度。——恩,等等...糟糕。 -快速地想想“算法 101”课上提醒我们的,在理论上它并未带来任何好处。如果之前就很糟糕,那么现在也一样。理论是如此的残酷。 +研究存储改进的最初想法是解决序列分流的问题。基于块的布局减少了查询所要考虑的序列总数。因此假设我们索引查找的复杂度是 `O(n^2)`,我们就要设法减少 n 个相当数量的复杂度,之后就相当于改进 `O(n^2)` 复杂度。——恩,等等……糟糕。 -实际上,我们大多数的查询已经可以相当快地被相应。但是,跨越整个时间范围的查询仍然很慢,尽管只需要找到少部分数据。追溯到所有这些工作之前,最初我用来解决这个问题的想法是:我们需要一个更大容量的[倒排索引][9]。倒排索引基于数据项内容的子集提供了一种快速的查找方式。简单地说,我可以通过标签 `app=”nginx"` 查找所有的序列而无需遍历每个文件来看它是否包含该标签。 +快速回顾一下“算法 101”课上提醒我们的,在理论上它并未带来任何好处。如果之前就很糟糕,那么现在也一样。理论是如此的残酷。 -为此,每个序列被赋上一个唯一的 ID 来在常数时间内获取,例如 O(1)。在这个例子中 ID 就是 我们的正向索引。 +实际上,我们大多数的查询已经可以相当快响应。但是,跨越整个时间范围的查询仍然很慢,尽管只需要找到少部分数据。追溯到所有这些工作之前,最初我用来解决这个问题的想法是:我们需要一个更大容量的[倒排索引][9]。 -> 示例:如果 ID 为 10,29 ,9 的序列包含标签 `app="nginx"`,那么 “nginx”的倒排索引就是简单的列表 `[10, 29, 9]`,它就能用来快速地获取所有包含标签的序列。即使有 200 多亿个数据也不会影响查找速度。 +倒排索引基于数据项内容的子集提供了一种快速的查找方式。简单地说,我可以通过标签 `app="nginx"` 查找所有的序列而无需遍历每个文件来看它是否包含该标签。 + +为此,每个序列被赋上一个唯一的 ID ,通过该 ID 可以恒定时间内检索它(`O(1)`)。在这个例子中 ID 就是我们的正向索引。 + +> 示例:如果 ID 为 10、29、9 的序列包含标签 `app="nginx"`,那么 “nginx”的倒排索引就是简单的列表 `[10, 29, 9]`,它就能用来快速地获取所有包含标签的序列。即使有 200 多亿个数据序列也不会影响查找速度。 -简而言之,如果 n 是我们序列总数,m 是给定查询结果的大小,使用索引的查询复杂度现在就是 O(m)。查询语句跟随它获取数据的数量 m 而不是被搜索的数据体 n 所扩展是一个很好的特性,因为 m 一般相当小。 -为了简单起见,我们假设可以在常数时间内查找到倒排索引对应的列表。 +简而言之,如果 `n` 是我们序列总数,`m` 是给定查询结果的大小,使用索引的查询复杂度现在就是 `O(m)`。查询语句依据它获取数据的数量 `m` 而不是被搜索的数据体 `n` 进行缩放是一个很好的特性,因为 `m` 一般相当小。 -实际上,这几乎就是 V2 存储系统已有的倒排索引,也是提供在数百万序列中查询性能的最低需求。敏锐的人会注意到,在最坏情况下,所有的序列都含有标签,因此 m 又成了 O(n)。这一点在预料之中也相当合理。如果你查询所有的数据,它自然就会花费更多时间。一旦我们牵扯上了更复杂的查询语句就会有问题出现。 +为了简单起见,我们假设可以在恒定时间内查找到倒排索引对应的列表。 + +实际上,这几乎就是 V2 存储系统具有的倒排索引,也是提供在数百万序列中查询性能的最低需求。敏锐的人会注意到,在最坏情况下,所有的序列都含有标签,因此 `m` 又成了 `O(n)`。这一点在预料之中,也相当合理。如果你查询所有的数据,它自然就会花费更多时间。一旦我们牵扯上了更复杂的查询语句就会有问题出现。 #### 标签组合 -数百万个带有标签的数据很常见。假设横向扩展着数百个实例的“foo”微服务,并且每个实例拥有数千个序列。每个序列都会带有标签`app="foo"`。当然,用户通常不会查询所有的序列而是会通过进一步的标签来限制查询。例如,我想知道服务实例接收到了多少请求,那么查询语句便是 `__name__="requests_total" AND app="foo"`。 +与数百万个序列相关的标签很常见。假设横向扩展着数百个实例的“foo”微服务,并且每个实例拥有数千个序列。每个序列都会带有标签 `app="foo"`。当然,用户通常不会查询所有的序列而是会通过进一步的标签来限制查询。例如,我想知道服务实例接收到了多少请求,那么查询语句便是 `__name__="requests_total" AND app="foo"`。 -为了找到适应所有标签选择子的序列,我们得到每一个标签的倒排索引列表并取其交集。结果集通常会比任何一个输入列表小一个数量级。因为每个输入列表最坏情况下的尺寸为 O(n),所以在嵌套地为每个列表进行暴力求解brute force solution下,运行时间为 O(n^2)。与其他的集合操作耗费相同,例如取并集 (`app="foo" OR app="bar"`)。当添加更多标签选择子在查询语句上,耗费就会指数增长到 O(n^3), O(n^4), O(n^5), ... O(n^k)。有很多手段都能通过改变执行顺序优化运行效率。越复杂,越是需要关于数据特征和标签之间相关性的知识。这引入了大量的复杂度,但是并没有减少算法的最坏运行时间。 +为了找到满足两个标签选择子的所有序列,我们得到每一个标签的倒排索引列表并取其交集。结果集通常会比任何一个输入列表小一个数量级。因为每个输入列表最坏情况下的大小为 `O(n)`,所以在嵌套地为每个列表进行暴力求解brute force solution下,运行时间为 `O(n^2)`。相同的成本也适用于其他的集合操作,例如取并集(`app="foo" OR app="bar"`)。当在查询语句上添加更多标签选择子,耗费就会指数增长到 `O(n^3)`、`O(n^4)`、`O(n^5)`……`O(n^k)`。通过改变执行顺序,可以使用很多技巧以优化运行效率。越复杂,越是需要关于数据特征和标签之间相关性的知识。这引入了大量的复杂度,但是并没有减少算法的最坏运行时间。 -这便是 V2 存储系统使用的基本方法,幸运的是,似乎稍微的改动就能获得很大的提升。如果我们假设倒排索引中的 ID 都是排序好的会怎么样? +这便是 V2 存储系统使用的基本方法,幸运的是,看似微小的改动就能获得显著的提升。如果我们假设倒排索引中的 ID 都是排序好的会怎么样? 假设这个例子的列表用于我们最初的查询: @@ -336,13 +340,17 @@ __name__="requests_total" -> [ 9999, 1000, 1001, 2000000, 2000001, 2000002, intersection => [ 1000, 1001 ] ``` -它的交集相当小。我们可以为每个列表的起始位置设置游标,每次从最小的游标处移动来找到交集。当二者的数字相等,我们就添加它到结果中并移动二者的游标。总体上,我们以锯齿形扫描两个列表,因此总耗费是 O(2n)=O(n),因为我们总是在一个列表上移动。 +它的交集相当小。我们可以为每个列表的起始位置设置游标,每次从最小的游标处移动来找到交集。当二者的数字相等,我们就添加它到结果中并移动二者的游标。总体上,我们以锯齿形扫描两个列表,因此总耗费是 `O(2n)=O(n)`,因为我们总是在一个列表上移动。 -两个以上列表的不同集合操作也类似。因此 k 个集合操作仅仅改变了因子 O(k*n) 而不是最坏查找运行时间下的指数 O(n^k)。 -我在这里所描述的是任意一个[全文搜索引擎][10]使用的标准搜索索引的简化版本。每个序列描述符都视作一个简短的“文档”,每个标签(名称 + 固定值)作为其中的“单词”。我们可以忽略搜索引擎索引中很多附加的数据,例如单词位置和和频率。 -似乎存在着无止境的研究来提升实际的运行时间,通常都是对输入数据做一些假设。不出意料的是,仍有大量技术来压缩倒排索引,其中各有利弊。因为我们的“文档”比较小,而且“单词”在所有的序列里大量重复,压缩变得几乎无关紧要。例如,一个真实的数据集约有 440 万个序列与大约 12 个标签,每个标签拥有少于 5000 个单独的标签。对于最初的存储版本,我们坚持基本的方法不使用压缩,仅做微小的调整来跳过大范围非交叉的 ID。 +两个以上列表的不同集合操作也类似。因此 `k` 个集合操作仅仅改变了因子 `O(k*n)` 而不是最坏情况下查找运行时间的指数 `O(n^k)`。 -尽管维持排序好的 ID 听起来很简单,但实践过程中不是总能完成的。例如,V2 存储系统为新的序列赋上一个哈希值来当作 ID,我们就不能轻易地排序倒排索引。另一个艰巨的任务是当磁盘上的数据被更新或删除掉后修改其索引。通常,最简单的方法是重新计算并写入,但是要保证数据库在此期间可查询且具有一致性。V3 存储系统通过每块上独立的不可变索引来解决这一问题,仅通过压缩时的重写来进行修改。只有可变块上的索引需要被更新,它完全保存在内存中。 +我在这里所描述的是几乎所有[全文搜索引擎][10]使用的标准搜索索引的简化版本。每个序列描述符都视作一个简短的“文档”,每个标签(名称 + 固定值)作为其中的“单词”。我们可以忽略搜索引擎索引中通常遇到的很多附加数据,例如单词位置和和频率。 + +关于改进实际运行时间的方法似乎存在无穷无尽的研究,它们通常都是对输入数据做一些假设。不出意料的是,还有大量技术来压缩倒排索引,其中各有利弊。因为我们的“文档”比较小,而且“单词”在所有的序列里大量重复,压缩变得几乎无关紧要。例如,一个真实的数据集约有 440 万个序列与大约 12 个标签,每个标签拥有少于 5000 个单独的标签。对于最初的存储版本,我们坚持使用基本的方法而不压缩,仅做微小的调整来跳过大范围非交叉的 ID。 + +尽管维持排序好的 ID 听起来很简单,但实践过程中不是总能完成的。例如,V2 存储系统为新的序列赋上一个哈希值来当作 ID,我们就不能轻易地排序倒排索引。 + +另一个艰巨的任务是当磁盘上的数据被更新或删除掉后修改其索引。通常,最简单的方法是重新计算并写入,但是要保证数据库在此期间可查询且具有一致性。V3 存储系统通过每块上具有的独立不可变索引来解决这一问题,该索引仅通过压缩时的重写来进行修改。只有可变块上的索引需要被更新,它完全保存在内存中。 ### 基准测试 From 825f475b5a028e15197d10519fb925a775372fdf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 Jun 2019 23:17:07 +0800 Subject: [PATCH 0805/1154] =?UTF-8?q?=E6=B8=85=E9=99=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lujun9972 部分选题已经过时 --- ...Organizations Need to Brace for in 2018.md | 116 -------- ...s for MOOCs - WebLog Pro Olivier Berger.md | 255 ------------------ ...ns Address Demand for Blockchain Skills.md | 45 ---- ...w blockchain will influence open source.md | 185 ------------- ...me Interesting Facts About Debian Linux.md | 116 -------- ...th Peter Ganten, CEO of Univention GmbH.md | 97 ------- ...28 Why CLAs aren-t good for open source.md | 76 ------ .../20190311 Discuss everything Fedora.md | 45 ---- .../20190322 How to save time with TiDB.md | 143 ---------- ... Intel, HPE and Lenovo for hybrid cloud.md | 60 ----- ...or hyperconverged private cloud systems.md | 60 ----- ...XE users to patch urgent security holes.md | 76 ------ ...upercomputer, promises to productize it.md | 58 ---- ...(again) into single-socket Xeon servers.md | 61 ----- ...oundup- VMware, Nokia beef up their IoT.md | 69 ----- ...renew converged infrastructure alliance.md | 52 ---- ...00 switches ousted by new Catalyst 9600.md | 86 ------ ...oduces hybrid cloud consulting business.md | 59 ---- ... work, issues 17 new ones for IOS flaws.md | 72 ----- ...nnouncing the release of Fedora 30 Beta.md | 90 ------- ... rebase to Fedora 30 Beta on Silverblue.md | 70 ----- ...facturing Platform might not be so open.md | 69 ----- ... 30 is Here- Check Out the New Features.md | 115 -------- 23 files changed, 2075 deletions(-) delete mode 100644 sources/talk/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md delete mode 100644 sources/talk/20180209 A review of Virtual Labs virtualization solutions for MOOCs - WebLog Pro Olivier Berger.md delete mode 100644 sources/talk/20180705 New Training Options Address Demand for Blockchain Skills.md delete mode 100644 sources/talk/20180802 How blockchain will influence open source.md delete mode 100644 sources/talk/20180816 Debian Turns 25- Here are Some Interesting Facts About Debian Linux.md delete mode 100644 sources/talk/20181004 Interview With Peter Ganten, CEO of Univention GmbH.md delete mode 100644 sources/talk/20190228 Why CLAs aren-t good for open source.md delete mode 100644 sources/talk/20190311 Discuss everything Fedora.md delete mode 100644 sources/talk/20190322 How to save time with TiDB.md delete mode 100644 sources/talk/20190410 Google partners with Intel, HPE and Lenovo for hybrid cloud.md delete mode 100644 sources/talk/20190410 HPE and Nutanix partner for hyperconverged private cloud systems.md delete mode 100644 sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md delete mode 100644 sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md delete mode 100644 sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md delete mode 100644 sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md delete mode 100644 sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md delete mode 100644 sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md delete mode 100644 sources/tech/20190327 HPE introduces hybrid cloud consulting business.md delete mode 100644 sources/tech/20190328 Cisco warns of two security patches that don-t work, issues 17 new ones for IOS flaws.md delete mode 100644 sources/tech/20190402 Announcing the release of Fedora 30 Beta.md delete mode 100644 sources/tech/20190403 How to rebase to Fedora 30 Beta on Silverblue.md delete mode 100644 sources/tech/20190409 The Microsoft-BMW IoT Open Manufacturing Platform might not be so open.md delete mode 100644 sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md diff --git a/sources/talk/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md b/sources/talk/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md deleted file mode 100644 index 09223ccb21..0000000000 --- a/sources/talk/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md +++ /dev/null @@ -1,116 +0,0 @@ -18 Cyber-Security Trends Organizations Need to Brace for in 2018 -====== - -### 18 Cyber-Security Trends Organizations Need to Brace for in 2018 - -Enterprises, end users and governments faced no shortage of security challenges in 2017. Some of those same challenges will continue into 2018, and there will be new problems to solve as well. Ransomware has been a concern for several years and will likely continue to be a big issue in 2018. The new year is also going to bring the formal introduction of the European Union's General Data Protection Regulation (GDPR), which will impact how organizations manage private information. A key trend that emerged in 2017 was an increasing use of artificial intelligence (AI) to help solve cyber-security challenges, and that's a trend that will continue to accelerate in 2018. What else will the new year bring? In this slide show, eWEEK presents 18 security predictions for the year ahead from 18 security experts. - - -### Africa Emerges as New Area for Threat Actors and Targets - -"In 2018, Africa will emerge as a new focus area for cyber-threats--both targeting organizations based there and attacks originating from the continent. With its growth in technology adoption and operations and rising economy, and its increasing number of local resident threat actors, Africa has the largest potential for net-new impactful cyber events." -Steve Stone, IBM X-Force IRIS - - -### AI vs. AI - -"2018 will see a rise in AI-based attacks as cyber-criminals begin using machine learning to spoof human behaviors. The cyber-security industry will need to tune their own AI tools to better combat the new threats. The cat and mouse game of cybercrime and security innovation will rapidly escalate to include AI-enabled tools on both sides." --Caleb Barlow, vice president of Threat Intelligence, IBM Security - - -### Cyber-Security as a Growth Driver - -"CEOs view cyber-security as one of their top risks, but many also see it as an opportunity to innovate and find new ways to generate revenue. In 2018 and beyond, effective cyber-security measures will support companies that are transforming their security, privacy and continuity controls in an effort to grow their businesses." -Greg Bell, KMPG's Global Cyber Security Practice co-leader - - -### GDPR Means Good Enough Isn't Good Enough - -"Too many professionals share a 'good enough' philosophy that they've adopted from their consumer mindset that they can simply upgrade and patch to comply with the latest security and compliance best practices or regulations. In 2018, with the upcoming enforcement of the EU GDPR 'respond fast' rules, organizations will quickly come to terms, and face fines, with why 'good enough' is not 'good' anymore." -Kris Lovejoy, CEO of BluVector - - -### Consumerization of Cyber-Security - -"2018 will mark the debut of the 'consumerization of cyber-security.' This means consumers will be offered a unified, comprehensive suite of security offerings, including, in addition to antivirus and spyware protection, credit and identify abuse monitoring and identity restoration. This is a big step forward compared to what is available in one package today. McAfee Total Protection, which safeguards consumer identities in addition to providing virus and malware protection, is an early, simplified example of this. Consumers want to feel more secure." -Don Dixon, co-founder and managing director, Trident Capital Cybersecurity - - -### Ransomware Will Continue - -"Ransomware will continue to plague organizations with 'old' attacks 'refreshed' and reused. The threat of ransomware will continue into 2018. This year we've seen ransomware wreak havoc across the globe with both WannaCry and NotPetya hitting the headlines. Threats of this type and on this scale will be a common feature of the next 12 months." -Andrew Avanessian, chief operating officer at Avecto - - -### More Encryption Will Be Needed - -"It will become increasingly clear in the industry that HTTPS does not offer the robust security and end-to-end encryption as is commonly believed, and there will be a push to encrypt data before it is sent over HTTPS." -Darren Guccione, CEO and co-founder, Keeper Security - - -### Denial of Service Will Become Financially Lucrative - -"Denial of service will become as financially lucrative as identity theft. Using stolen identities for new account fraud has been the major revenue driver behind breaches. However, in recent years ransomware attacks have caused as much if not more damage, as increased reliance on distributed applications and cloud services results in massive business damage when information, applications or systems are held hostage by attackers." -John Pescatore. SANS' director of emerging security trends - - -### Goodbye Social Security Number - -"2018 is the turning point for the retirement of the Social Security number. At this point, the vast majority of SSNs are compromised, and we can no longer rely on them--nor should we have previously." -Michael Sutton, CISO, Zscaler - - -### Post-Quantum Cyber-Security Discussion Warms Up the Boardroom - -"The uncertainty of cyber-security in a post-quantum world is percolating some circles, but 2018 is the year the discussions gain momentum in the top levels of business. As security experts grapple with preparing for a post-quantum world, top executives will begin to ask what can be done to ensure all of our connected 'things' remain secure." -Malte Pollmann, CEO of Utimaco - - -### Market Consolidation Is Coming - -"There will be accelerated consolidation of cyber niche markets flooded with too many 'me-too' companies offering extremely similar products and services. As an example, authentication, end-point security and threat intelligence now boast a total of more than 25 competitors. Ultimately, only three to six companies in each niche can survive." -Mike Janke, co-founder of DataTribe - - -### Health Care Will Be a Lucrative Target - -"Health records are highly valued on the black market because they are saturated with Personally Identifiable Information (PII). Health care institutions will continue to be a target as they have tighter allocations for security in their IT budgets. Also, medical devices are hard to update and often run on older operating system versions." -Larry Cashdollar, senior engineer, Security Intelligence Response Team, Akamai - - -### 2018: The Year of Simple Multifactor Authentication for SMBs - -"Unfortunately, effective multifactor authentication (MFA) solutions have remained largely out of reach for the average small- and medium-sized business. Though enterprise multifactor technology is quite mature, it often required complex on-premises solutions and expensive hardware tokens that most small businesses couldn't afford or manage. However, the growth of SaaS and smartphones has introduced new multifactor solutions that are inexpensive and easy for small businesses to use. Next year, many SMBs will adopt these new MFA solutions to secure their more privileged accounts and users. 2018 will be the year of MFA for SMBs." -Corey Nachreiner, CTO at WatchGuard Technologies - - -### Automation Will Improve the IT Skills Gap - -"The security skills gap is widening every year, with no signs of slowing down. To combat the skills gap and assist in the growing adoption of advanced analytics, automation will become an even higher priority for CISOs." -Haiyan Song, senior vice president of Security Markets at Splunk - - -### Industrial Security Gets Overdue Attention - -"The high-profile attacks of 2017 acted as a wake-up call, and many plant managers now worry that they could be next. Plant manufacturers themselves will offer enhanced security. Third-party companies going on their own will stay in a niche market. The industrial security manufacturers themselves will drive a cooperation with the security industry to provide security themselves. This is because there is an awareness thing going on and impending government scrutiny. This is different from what happened in the rest of IT/IoT where security vendors just go to market by themselves as a layer on top of IT (i.e.: an antivirus on top of Windows)." -Renaud Deraison, co-founder and CTO, Tenable - - -### Cryptocurrencies Become the New Playground for Identity Thieves - -"The rising value of cryptocurrencies will lead to greater attention from hackers and bad actors. Next year we'll see more fraud, hacks and money laundering take place across the top cryptocurrency marketplaces. This will lead to a greater focus on identity verification and, ultimately, will result in legislation focused on trader identity." -Stephen Maloney, executive vice president of Business Development & Strategy, Acuant - - -### GDPR Compliance Will Be a Challenge - -"In 2018, three quarters of companies or apps will be ruled out of compliance with GDPR and at least one major corporation will be fined to the highest extent in 2018 to set an example for others. Most companies are preparing internally by performing more security assessments and recruiting a mix of security professionals with privacy expertise and lawyers, but with the deadline quickly approaching, it's clear the bulk of businesses are woefully behind and may not be able to avoid these consequences." -Sanjay Beri, founder and CEO, Netskope - - -### Data Security Solidifies Its Spot in the IT Security Stack - -"Many businesses are stuck in the mindset that security of networks, servers and applications is sufficient to protect their data. However, the barrage of breaches in 2017 highlights a clear disconnect between what organizations think is working and what actually works. In 2018, we expect more businesses to implement data security solutions that complement their existing network security deployments." -Jim Varner, CEO of SecurityFirst - - -### [Eight Cyber-Security Vendors Raise New Funding in November 2017][1] - -Though the pace of funding slowed in November, multiple firms raised new venture capital to develop and improve their cyber-security products. - -Though the pace of funding slowed in November, multiple firms raised new venture capital to develop and improve their cyber-security products. - --------------------------------------------------------------------------------- - -via: http://voip.eweek.com/security/18-cyber-security-trends-organizations-need-to-brace-for-in-2018 - -作者:[Sean Michael Kerner][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://voip.eweek.com/Authors/sean-michael-kerner -[1]:http://voip.eweek.com/security/eight-cyber-security-vendors-raise-new-funding-in-november-2017 diff --git a/sources/talk/20180209 A review of Virtual Labs virtualization solutions for MOOCs - WebLog Pro Olivier Berger.md b/sources/talk/20180209 A review of Virtual Labs virtualization solutions for MOOCs - WebLog Pro Olivier Berger.md deleted file mode 100644 index 0cb3755ca1..0000000000 --- a/sources/talk/20180209 A review of Virtual Labs virtualization solutions for MOOCs - WebLog Pro Olivier Berger.md +++ /dev/null @@ -1,255 +0,0 @@ -A review of Virtual Labs virtualization solutions for MOOCs – WebLog Pro Olivier Berger -====== -### 1 Introduction - -This is a memo that tries to capture some of the experience gained in the [FLIRT project][3] on the topic of Virtual Labs for MOOCs (Massive Open Online Courses). - -In this memo, we try to draw an overview of some benefits and concerns with existing approaches at using virtualization techniques for running Virtual Labs, as distributions of tools made available for distant learners. - -We describe 3 main technical architectures: (1) running Virtual Machine images locally on a virtual machine manager, or (2) displaying the remote execution of similar virtual machines on a IaaS cloud, and (3) the potential of connecting to the remote execution of minimized containers on a remote PaaS cloud. - -We then elaborate on some perspectives for locally running ports of applications to the WebAssembly virtual machine of the modern Web browsers. - -Disclaimer: This memo doesn’t intend to point to extensive literature on the subject, so part of our analysis may be biased by our particular context. - -### 2 Context : MOOCs - -Many MOOCs (Massive Open Online Courses) include a kind of “virtual laboratory” for learners to experiment with tools, as a way to apply the knowledge, practice, and be more active in the learning process. In quite a few (technical) disciplines, this can consist in using a set of standard applications in a professional domain, which represent typical tools that would be used in real life scenarii. - -Our main perspective will be that of a MOOC editor and of MOOC production teams which want to make “virtual labs” available for MOOC participants. - -Such a “virtual lab” would typically contain installations of existing applications, pre-installed and configured, and loaded with scenario data in order to perform a lab. - -The main constraint here is that such labs would typically be fabricated with limited software development expertise and funds[1][4]. Thus we consider here only the assembly of existing “normal” applications and discard the option of developping novel “serious games” and simulator applications for such MOOCs. - -#### 2.1 The FLIRT project - -The [FLIRT project][5] groups a consortium of 19 partners in Industry, SMEs and Academia to work on a collection of MOOCs and SPOCs for professional development in Networks and Telecommunications. Lead by Institut Mines Telecom, it benefits from the funding support of the French “Investissements d’avenir” programme. - -As part of the FLIRT roadmap, we’re leading an “innovation task” focused on Virtual Labs in the context of the Cloud. This memo was produced as part of this task. - -#### 2.2 Some challenges in virtual labs design for distant learning - -Virtual Labs used in distance learning contexts require the use of software applications in autonomy, either running on a personal, or professional computer. In general, the technical skills of participants may be diverse. So much for the quality (bandwith, QoS, filtering, limitations: firewaling) of the hardware and networks they use at home or at work. It’s thus very optimistic to seek for one solution fits all strategy. - -Most of the time there’s a learning curve on getting familiar with the tools which students will have to use, which constitutes as many challenges to overcome for beginners. These tools may not be suited for beginners, but they will still be selected by the trainers as they’re representative of the professional context being taught. - -In theory, this usability challenge should be addressed by devising an adapted pedagogical approach, especially in a context of distance learning, so that learners can practice the labs on their own, without the presence of a tutor or professor. Or some particular prerequisite skills could be required (“please follow System Administration 101 before applying to this course”). - -Unfortunately there are many cases where instructors basically just translate to a distant learning scenario, previous lab resources that had previously been devised for in presence learning. This lets learner faced with many challenges to overcome. The only support resource is often a regular forum on the MOOC’s LMS (Learning Management System). - -My intuition[2][6] is that developing ad-hoc simulators for distant education would probably be more efficient and easy to use for learners. But that would require a too high investment for the designers of the courses. - -In the context of MOOCs which are mainly free to participate to, not much investment is possible in devising ad-hoc lab applications, and instructors have to rely on existing applications, tools and scenarii to deliver a cheap enough environment. Furthermore, technical or licensing constraints[3][7] may lead to selecting lab tools which may not be easy to learn, but have the great advantage or being freely redistributable[4][8]. - -### 3 Virtual Machines for Virtual Labs - -The learners who will try unattended learning in such typical virtual labs will face difficulties in making specialized applications run. They must overcome the technical details of downloading, installing and configuring programs, before even trying to perform a particular pedagogical scenario linked to the matter studied. - -To diminish these difficulties, one traditional approach for implementing labs in MOOCs has been to assemble in advance a Virtual Machine image. This already made image can then be downloaded and run with a virtual machine simulator (like [VirtualBox][9][5][10]). - -The pre-loaded VM will already have everything ready for use, so that the learners don’t have to install anything on their machines. - -An alternative is to let learners download and install the needed software tools themselves, but this leads to so many compatibility issues or technical skill prerequisites, that this is often not advised, and mentioned only as a fallback option. - -#### 3.1 Downloading and installation issues - -Experience shows[2][11] that such virtual machines also bring some issues. Even if installation of every piece of software is no longer required, learners still need to be able to run the VM simulator on a wide range of diverse hardware, OSes and configurations. Even managing to download the VMs, still causes many issues (lack admin privileges, weight vs download speed, memory or CPU load, disk space, screen configurations, firewall filtering, keayboard layout, etc.). - -These problems aren’t generally faced by the majority of learners, but the impacted minority is not marginal either, and they generally will produce a lot of support requests for the MOOC team (usually in the forums), which needs to be anticipated by the community managers. - -The use of VMs is no show stopper for most, but can be a serious problem for a minority of learners, and is then no silver bullet. - -Some general usability issues may also emerge if users aren’t used to the look and feel of the enclosed desktop. For instance, the VM may consist of a GNU/Linux desktop, whereas users would use a Windows or Mac OS system. - -#### 3.2 Fabrication issues for the VM images - -On the MOOC team’s side, the fabrication of a lightweight, fast, tested, license-free and easy to use VM image isn’t necessarily easy. - -Software configurations tend to rot as time passes, and maintenance may not be easy when the later MOOC editions evolutions lead to the need to maintain the virtual lab scenarii years later. - -Ideally, this would require adopting an “industrial” process in building (and testing) the lab VMs, but this requires quite an expertise (system administration, packaging, etc.) that may or not have been anticipated at the time of building the MOOC (unlike video editing competence, for instance). - -Our experiment with the [Vagrant][12] technology [[0][13]] and Debian packaging was interesting in this respect, as it allowed us to use a well managed “script” to precisely control the build of a minimal VM image. - -### 4 Virtual Labs as a Service - -To overcome the difficulties in downloading and running Virtual Machines on one’s local computer, we have started exploring the possibility to run these applications in a kind of Software as a Service (SaaS) context, “on the cloud”. - -But not all applications typically used in MOOC labs are already available for remote execution on the cloud (unless the course deals precisely with managing email in GMail). - -We have then studied the option to use such an approach not for a single application, but for a whole virtual “desktop” which would be available on the cloud. - -#### 4.1 IaaS deployments - -A way to achieve this goal is to deploy Virtual Machine images quite similar to the ones described above, on the cloud, in an Infrastructure as a Service (IaaS) context[6][14], to offer access to remote desktops for every learners. - -There are different technical options to achieve this goal, but a simplified description of the architecture can be seen as just running Virtual Machines on a single IaaS platform instead of on each learner’s computer. Access to the desktop and application interfaces is made possible with the use of Web pages (or other dedicated lightweight clients) which will display a “full screen” display of the remote desktop running for the user on the cloud VM. Under the hood, the remote display of a Linux desktop session is made with technologies like [VNC][15] and [RDP][16] connecting to a [Guacamole][17] server on the remote VM. - -In the context of the FLIRT project, we have made early experiments with such an architecture. We used the CloVER solution by our partner [ProCAN][18] which provides a virtual desktops broker between [OpenEdX][19] and an [OpenStack][20] IaaS public platform. - -The expected benefit is that users don’t have to install anything locally, as the only tool needed locally is a Web browser (displaying a full-screen [HTML5 canvas][21] displaying the remote desktop run by the Guacamole server running on the cloud VM. - -But there are still some issues with such an approach. First, the cost of operating such an infrastructure : Virtual Machines need to be hosted on a IaaS platform, and that cost of operation isn’t null[7][22] for the MOOC editor, compared to the cost of VirtualBox and a VM running on the learner’s side (basically zero for the MOOC editor). - -Another issue, which could be more problematic lies in the need for a reliable connection to the Internet during the whole sequences of lab execution by the learners[8][23]. Even if Guacamole is quite efficient at compressing rendering traffic, some basic connectivity is needed during the whole Lab work sessions, preventing some mobile uses for instance. - -One other potential annoyance is the potential delays for making a VM available to a learner (provisioning a VM), when huge VMs images need to be copied inside the IaaS platform when a learner connects to the Virtual Lab activity for the first time (several minutes delays). This may be worse if the VM image is too big (hence the need for optimization of the content[9][24]). - -However, the fact that all VMs are running on a platform under the control of the MOOC editor allows new kind of features for the MOOC. For instance, learners can submit results of their labs directly to the LMS without the need to upload or copy-paste results manually. This can help monitor progress or perform evaluation or grading. - -The fact that their VMs run on the same platform also allows new kinds of pedagogical scenarii, as VMs of multiple learners can be interconnected, allowing cooperative activities between learners. The VM images may then need to be instrumented and deployed in particular configurations, which may require the use of a dedicated broker like CloVER to manage such scenarii. - -For the records, we have yet to perform a rigorous benchmarking of such a solution in order to evaluate its benefits, or constraints given particular contexts. In FLIRT, our main focus will be in the context of SPOCs for professional training (a bit different a context than public MOOCs). - -Still this approach doesn’t solve the VMs fabrication issues for the MOOC staff. Installing software inside a VM, be it local inside a VirtualBox simulator of over the cloud through a remote desktop display, makes not much difference. This relies mainly on manual operations and may not be well managed in terms of quality of the process (reproducibility, optimization). - -#### 4.2 PaaS deployments using containers - -Some key issues in the IaaS context described above, are the cost of operation of running full VMs, and long provisioning delays. - -We’re experimenting with new options to address these issues, through the use of [Linux containers][25] running on a PaaS (Platform as a Service) platform, instead of full-fleshed Virtual Machines[10][26]. - -The main difference, with containers instead of Virtual Machines, lies in the reduced size of images, and much lower CPU load requirements, as the container remove the need for one layer of virtualization. Also, the deduplication techniques at the heart of some virtual file-systems used by container platforms lead to really fast provisioning, avoiding the need to wait for the labs to start. - -The traditional making of VMs, done by installing packages and taking a snapshot, was affordable for the regular teacher, but involved manual operations. In this respect, one other major benefit of containers is the potential for better industrialization of the virtual lab fabrication, as they are generally not assembled manually. Instead, one uses a “scripting” approach in describing which applications and their dependencies need to be put inside a container image. But this requires new competence from the Lab creators, like learning the [Docker][27] technology (and the [OpenShift][28] PaaS, for instance), which may be quite specialized. Whereas Docker containers tend to become quite popular in Software Development faculty (through the “[devops][29]” hype), they may be a bit new to other field instructors. - -The learning curve to mastering the automation of the whole container-based labs installation needs to be evaluated. There’s a trade-off to consider in adopting technology like Vagrant or Docker: acquiring container/PaaS expertise vs quality of industrialization and optimization. The production of a MOOC should then require careful planning if one has to hire or contract with a PaaS expert for setting up the Virtual Labs. - -We may also expect interesting pedagogical benefits. As containers are lightweight, and platforms allow to “easily” deploy multiple interlinked containers (over dedicated virtual networks), this enables the setup of more realistic scenarii, where each learner may be provided with multiple “nodes” over virtual networks (all running their individual containers). This would be particularly interesting for Computer Networks or Security teaching for instance, where each learner may have access both to client and server nodes, to study client-server protocols, for instance. This is particularly interesting for us in the context of our FLIRT project, where we produce a collection of Computer Networks courses. - -Still, this mode of operation relies on a good connectivity of the learners to the Cloud. In contexts of distance learning in poorly connected contexts, the PaaS architecture doesn’t solve that particular issue compared to the previous IaaS architecture. - -### 5 Future server-less Virtual Labs with WebAssembly - -As we have seen, the IaaS or PaaS based Virtual Labs running on the Cloud offer alternatives to installing local virtual machines on the learner’s computer. But they both require to be connected for the whole duration of the Lab, as the applications would be executed on the remote servers, on the Cloud (either inside VMs or containers). - -We have been thinking of another alternative which could allow the deployment of some Virtual Labs on the local computers of the learners without the hassles of downloading and installing a Virtual Machine manager and VM image. We envision the possibility to use the infrastructure provided by modern Web browsers to allow running the lab’s applications. - -At the time of writing, this architecture is still highly experimental. The main idea is to rebuild the applications needed for the Lab so that they can be run in the “generic” virtual machine present in the modern browsers, the [WebAssembly][30] and Javascript execution engine. - -WebAssembly is a modern language which seeks for maximum portability, and as its name hints, is a kind of assembly language for the Web platform. What is of interest for us is that WebAssembly is portable on most modern Web browsers, making it a very interesting platform for portability. - -Emerging toolchains allow recompiling applications written in languages like C or C++ so that they can be run on the WebAssembly virtual machine in the browser. This is interesting as it doesn’t require modifying the source code of these programs. Of course, there are limitations, in the kind of underlying APIs and libraries compatible with that platform, and on the sandboxing of the WebAssembly execution engine enforced by the Web browser. - -Historically, WebAssembly has been developped so as to allow running games written in C++ for a framework like Unity, in the Web browser. - -In some contexts, for instance for tools with an interactive GUI, and processing data retrieved from files, and which don’t need very specific interaction with the underlying operating system, it seems possible to port these programs to WebAssembly for running them inside the Web browser. - -We have to experiment deeper with this technology to validate its potential for running Virtual Labs in the context of a Web browser. - -We used a similar approach in the past in porting a Relational Database course lab to the Web browser, for standalone execution. A real database would run in the minimal SQLite RDBMS, recompiled to JavaScript[11][31]. Instead of having to download, install and run a VM with a RDBMS, the students would only connect to a Web page, which would load the DBMS in memory, and allow performing the lab SQL queries locally, disconnected from any third party server. - -In a similar manner, we can think for instance, of a Lab scenario where the Internet packet inspector features of the Wireshark tool would run inside the WebAssembly virtual machine, to allow dissecting provided capture files, without having to install Wireshard, directly into the Web browser. - -We expect to publish a report on that last experiment in the future with more details and results. - -### 6 Conclusion - -The most promising architecture for Virtual Lab deployments seems to be the use of containers on a PaaS platform for deploying virtual desktops or virtual application GUIs available in the Web browser. - -This would allow the controlled fabrication of Virtual Labs containing the exact bits needed for learners to practice while minimizing the delays. - -Still the need for always-on connectivity can be a problem. - -Also, the potential for inter-networked containers allowing the kind of multiple nodes and collaborative scenarii we described, would require a lot of expertise to develop, and management platforms for the MOOC operators, which aren’t yet mature. - -We hope to be able to report on our progress in the coming months and years on those aspects. - -### 7 References - - - -[0] -Olivier Berger, J Paul Gibson, Claire Lecocq and Christian Bac “Designing a virtual laboratory for a relational database MOOC”. International Conference on Computer Supported Education, SCITEPRESS, 23-25 may 2015, Lisbonne, Portugal, 2015, vol. 7, pp. 260-268, ISBN 978-989-758-107-6 – [DOI: 10.5220/0005439702600268][1] ([preprint (HTML)][2]) - -### 8 Copyright - - [![Creative Commons License](https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png)][45] - -This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][46] - -. - -### Footnotes: - -[1][32] – The FLIRT project also works on business model aspects of MOOC or SPOC production in the context of professional development, but the present memo starts from a minimalitic hypothesis where funding for course production is quite limited. - -[2][33] – research-based evidence needed - -[3][34] – In typical MOOCs which are free to participate, the VM should include only gratis tools, which typically means a GNU/Linux distribution loaded with applications available under free and open source licenses. - -[4][35] – Typically, Free and Open Source software, aka Libre Software - -[5][36] – VirtualBox is portable on many operating systems, making it a very popular solution for such a need - -[6][37] – the IaaS platform could typically be an open cloud for MOOCs or a private cloud for SPOCs (for closer monitoring of student activity or security control reasons). - -[7][38] – Depending of the expected use of the lab by learners, this cost may vary a lot. The size and configuration required for the included software may have an impact (hence the need to minimize the footprint of the VM images). With diminishing costs in general this may not be a show stopper. Refer to marketing figures of commercial IaaS offerings for accurate figures. Attention to additional licensing costs if the OS of the VM isn’t free software, or if other licenses must be provided for every learners. - -[8][39] – The needs for always-on connectivity may not be a problem for professional development SPOCs where learners connect from enterprise networks for instance. It may be detrimental when MOOCs are very popular in southern countries where high bandwidth is both unreliable and expensive. - -[9][40] – In this respect, providing a full Linux desktop inside the VM doesn’t necessarily make sense. Instead, running applications full-screen may be better, avoiding installation of whole desktop environments like Gnome or XFCE… but which has usability consequences. Careful tuning and testing is needed in any case. - -[10][41] – The availability of container based architectures is quite popular in the industry, but has not yet been deployed to a large scale in the context of large public MOOC hosting platforms, to our knowledge, at the time of writing. There are interesting technical challenges which the FLIRT project tries to tackle together with its partner ProCAN. - -[11][42] – See the corresponding paragraph [http://www-inf.it-sudparis.eu/PROSE/csedu2015/#standalone-sql-env][43] in [0][44] - - --------------------------------------------------------------------------------- - -via: https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/ - -作者:[Author;Olivier Berger;Télécom Sudparis][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www-public.tem-tsp.eu -[1]:http://dx.doi.org/10.5220/0005439702600268 -[2]:http://www-inf.it-sudparis.eu/PROSE/csedu2015/ -[3]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#org50fdc1a -[4]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.1 -[5]:http://flirtmooc.wixsite.com/flirt-mooc-telecom -[6]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.2 -[7]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.3 -[8]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.4 -[9]:http://virtualbox.org -[10]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.5 -[11]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.2 -[12]:https://www.vagrantup.com/ -[13]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#orgde5af50 -[14]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.6 -[15]:https://en.wikipedia.org/wiki/Virtual_Network_Computing -[16]:https://en.wikipedia.org/wiki/Remote_Desktop_Protocol -[17]:http://guacamole.apache.org/ -[18]:https://www.procan-group.com/ -[19]:https://open.edx.org/ -[20]:http://openstack.org/ -[21]:https://en.wikipedia.org/wiki/Canvas_element -[22]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.7 -[23]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.8 -[24]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.9 -[25]:https://www.redhat.com/en/topics/containers -[26]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.10 -[27]:https://en.wikipedia.org/wiki/Docker_(software) -[28]:https://www.openshift.com/ -[29]:https://en.wikipedia.org/wiki/DevOps -[30]:http://webassembly.org/ -[31]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.11 -[32]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.1 -[33]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.2 -[34]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.3 -[35]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.4 -[36]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.5 -[37]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.6 -[38]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.7 -[39]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.8 -[40]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.9 -[41]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.10 -[42]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.11 -[43]:http://www-inf.it-sudparis.eu/PROSE/csedu2015/#standalone-sql-env -[44]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#orgde5af50 -[45]:http://creativecommons.org/licenses/by-nc-sa/4.0/ -[46]:http://creativecommons.org/licenses/by-nc-sa/4.0/ diff --git a/sources/talk/20180705 New Training Options Address Demand for Blockchain Skills.md b/sources/talk/20180705 New Training Options Address Demand for Blockchain Skills.md deleted file mode 100644 index dedbf748d6..0000000000 --- a/sources/talk/20180705 New Training Options Address Demand for Blockchain Skills.md +++ /dev/null @@ -1,45 +0,0 @@ -New Training Options Address Demand for Blockchain Skills -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/blockchain-301.png?itok=1EA-Ob6F) - -Blockchain technology is transforming industries and bringing new levels of trust to contracts, payment processing, asset protection, and supply chain management. Blockchain-related jobs are the second-fastest growing in today’s labor market, [according to TechCrunch][1]. But, as in the rapidly expanding field of artificial intelligence, there is a pronounced blockchain skills gap and a need for expert training resources. - -### Blockchain for Business - -A new training option was recently announced from The Linux Foundation. Enrollment is now open for a free training course called[Blockchain: Understanding Its Uses and Implications][2], as well as a [Blockchain for Business][2] professional certificate program. Delivered through the edX training platform, the new course and program provide a way to learn about the impact of blockchain technologies and a means to demonstrate that knowledge. Certification, in particular, can make a difference for anyone looking to work in the blockchain arena. - -“In the span of only a year or two, blockchain has gone from something seen only as related to cryptocurrencies to a necessity for businesses across a wide variety of industries,” [said][3] Linux Foundation General Manager, Training & Certification Clyde Seepersad. “Providing a free introductory course designed not only for technical staff but business professionals will help improve understanding of this important technology, while offering a certificate program through edX will enable professionals from all over the world to clearly demonstrate their expertise.” - -TechCrunch [also reports][4] that venture capital is rapidly flowing toward blockchain-focused startups. And, this new program is designed for business professionals who need to understand the potential – or threat – of blockchain to their company and industry. - -“Professional Certificate programs on edX deliver career-relevant education in a flexible, affordable way, by focusing on the critical skills industry leaders and successful professionals are seeking today,” said Anant Agarwal, edX CEO and MIT Professor. - -### Hyperledger Fabric - -The Linux Foundation is steward to many valuable blockchain resources and includes some notable community members. In fact, a recent New York Times article — “[The People Leading the Blockchain Revolution][5]” — named Brian Behlendorf, Executive Director of The Linux Foundation’s [Hyperledger Project][6], one of the [top influential voices][7] in the blockchain world. - -Hyperledger offers proven paths for gaining credibility and skills in the blockchain space. For example, the project offers a free course titled Introduction to Hyperledger Fabric for Developers. Fabric has emerged as a key open source toolset in the blockchain world. Through the Hyperledger project, you can also take the B9-lab Certified Hyperledger Fabric Developer course. More information on both courses is available [here][8]. - -“As you can imagine, someone needs to do the actual coding when companies move to experiment and replace their legacy systems with blockchain implementations,” states the Hyperledger website. “With training, you could gain serious first-mover advantage.” - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/2018/7/new-training-options-address-demand-blockchain-skills - -作者:[SAM DEAN][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/sam-dean -[1]:https://techcrunch.com/2018/02/14/blockchain-engineers-are-in-demand/ -[2]:https://www.edx.org/course/understanding-blockchain-and-its-implications -[3]:https://www.linuxfoundation.org/press-release/as-demand-skyrockets-for-blockchain-expertise-the-linux-foundation-and-edx-offer-new-introductory-blockchain-course-and-blockchain-for-business-professional-certificate-program/ -[4]:https://techcrunch.com/2018/05/20/with-at-least-1-3-billion-invested-globally-in-2018-vc-funding-for-blockchain-blows-past-2017-totals/ -[5]:https://www.nytimes.com/2018/06/27/business/dealbook/blockchain-stars.html -[6]:https://www.hyperledger.org/ -[7]:https://www.linuxfoundation.org/blog/hyperledgers-brian-behlendorf-named-as-top-blockchain-influencer-by-new-york-times/ -[8]:https://www.hyperledger.org/resources/training diff --git a/sources/talk/20180802 How blockchain will influence open source.md b/sources/talk/20180802 How blockchain will influence open source.md deleted file mode 100644 index 707f4fe033..0000000000 --- a/sources/talk/20180802 How blockchain will influence open source.md +++ /dev/null @@ -1,185 +0,0 @@ -How blockchain will influence open source -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/block-quilt-chain.png?itok=mECoDbrc) - -What [Satoshi Nakamoto][1] started as Bitcoin a decade ago has found a lot of followers and turned into a movement for decentralization. For some, blockchain technology is a religion that will have the same impact on humanity as the Internet has had. For others, it is hype and technology suitable only for Ponzi schemes. While blockchain is still evolving and trying to find its place, one thing is for sure: It is a disruptive technology that will fundamentally transform certain industries. And I'm betting open source will be one of them. - -### The open source model - -Open source is a collaborative software development and distribution model that allows people with common interests to gather and produce something that no individual can create on their own. It allows the creation of value that is bigger than the sum of its parts. Open source is enabled by distributed collaboration tools (IRC, email, git, wiki, issue trackers, etc.), distributed and protected by an open source licensing model and often governed by software foundations such as the [Apache Software Foundation][2] (ASF), [Cloud Native Computing Foundation][3] (CNCF), etc. - -One interesting aspect of the open source model is the lack of financial incentives in its core. Some people believe open source work should remain detached from money and remain a free and voluntary activity driven only by intrinsic motivators (such as "common purpose" and "for the greater good”). Others believe open source work should be rewarded directly or indirectly through extrinsic motivators (such as financial incentive). While the idea of open source projects prospering only through voluntary contributions is romantic, in reality, the majority of open source contributions are done through paid development. Yes, we have a lot of voluntary contributions, but these are on a temporary basis from contributors who come and go, or for exceptionally popular projects while they are at their peak. Creating and sustaining open source projects that are useful for enterprises requires developing, documenting, testing, and bug-fixing for prolonged periods, even when the software is no longer shiny and exciting. It is a boring activity that is best motivated through financial incentives. - -### Commercial open source - -Software foundations such as ASF survive on donations and other income streams such as sponsorships, conference fees, etc. But those funds are primarily used to run the foundations, to provide legal protection for the projects, and to ensure there are enough servers to run builds, issue trackers, mailing lists, etc. - -Similarly, CNCF has member fees and other income streams, which are used to run the foundation and provide resources for the projects. These days, most software is not built on laptops; it is run and tested on hundreds of machines on the cloud, and that requires money. Creating marketing campaigns, brand designs, distributing stickers, etc. takes money, and some foundations can assist with that as well. At its core, foundations implement the right processes to interact with users, developers, and control mechanisms and ensure distribution of available financial resources to open source projects for the common good. - -If users of open source projects can donate money and the foundations can distribute it in a fair way, what is missing? - -What is missing is a direct, transparent, trusted, decentralized, automated bidirectional link for transfer of value between the open source producers and the open source consumer. Currently, the link is either unidirectional or indirect: - - * **Unidirectional** : A developer (think of a "developer" as any role that is involved in the production, maintenance, and distribution of software) can use their brain juice and devote time to do a contribution and share that value with all open source users. But there is no reverse link. - - * **Indirect** : If there is a bug that affects a specific user/company, the options are: - - * To have in-house developers to fix the bug and do a pull request. That is ideal, but it not always possible to hire in-house developers who are knowledgeable about hundreds of open source projects used daily. - - * To hire a freelancer specializing in that specific open source project and pay for the services. Ideally, the freelancer is also a committer for the open source project and can directly change the project code quickly. Otherwise, the fix might not ever make it to the project. - - * To approach a company providing services around the open source project. Such companies typically employ open source committers to influence and gain credibility in the community and offer products, expertise, and professional services. - - - - -The third option has been a successful [model][4] for sustaining many open source projects. Whether they provide services (training, consulting, workshops), support, packaging, open core, or SaaS, there are companies that employ hundreds of staff members who work on open source full time. There is a long [list of companies][5] that have managed to build a successful open source business model over the years, and that list is growing steadily. - -The companies that back open source projects play an important role in the ecosystem: They are the catalyst between the open source projects and the users. The ones that add real value do more than just package software nicely; they can identify user needs and technology trends, and they create a full stack and even an ecosystem of open source projects to address these needs. They can take a boring project and support it for years. If there is a missing piece in the stack, they can start an open source project from scratch and build a community around it. They can acquire a closed source software company and open source the projects (here I got a little carried away, but yes, I'm talking about my employer, [Red Hat][6]). - -To summarize, with the commercial open source model, projects are officially or unofficially managed and controlled by a very few individuals or companies that monetize them and give back to the ecosystem by ensuring the project is successful. It is a win-win-win for open source developers, managing companies, and end users. The alternative is inactive projects and expensive closed source software. - -### Self-sustaining, decentralized open source - -For a project to become part of a reputable foundation, it must conform to certain criteria. For example, ASF and CNCF require incubation and graduation processes, respectively, where apart from all the technical and formal requirements, a project must have a healthy number of active committer and users. And that is the essence of forming a sustainable open source project. Having source code on GitHub is not the same thing as having an active open source project. The latter requires committers who write the code and users who use the code, with both groups enforcing each other continuously by exchanging value and forming an ecosystem where everybody benefits. Some project ecosystems might be tiny and short-lived, and some may consist of multiple projects and competing service providers, with very complex interactions lasting for many years. But as long as there is an exchange of value and everybody benefits from it, the project is developed, maintained, and sustained. - -If you look at ASF [Attic][7], you will find projects that have reached their end of life. When a project is no longer technologically fit for its purpose, it is usually its natural end. Similarly, in the ASF [Incubator][8], you will find tons of projects that never graduated but were instead retired. Typically, these projects were not able to build a large enough community because they are too specialized or there are better alternatives available. - -But there are also cases where projects with high potential and superior technology cannot sustain themselves because they cannot form or maintain a functioning ecosystem for the exchange of value. The open source model and the foundations do not provide a framework and mechanisms for developers to get paid for their work or for users to get their requests heard. There isn’t a common value commitment framework for either party. As a result, some projects can sustain themselves only in the context of commercial open source, where a company acts as an intermediary and value adder between developers and users. That adds another constraint and requires a service provider company to sustain some open source projects. Ideally, users should be able to express their interest in a project and developers should be able to show their commitment to the project in a transparent and measurable way, which forms a community with common interest and intent for the exchange of value. - -Imagine there is a model with mechanisms and tools that enable direct interaction between open source users and developers. This includes not only code contributions through pull requests, questions over the mailing lists, GitHub stars, and stickers on laptops, but also other ways that allow users to influence projects' destinies in a richer, more self-controlled and transparent manner. - -This model could include incentives for actions such as: - - * Funding open source projects directly rather than through software foundations - - * Influencing the direction of projects through voting (by token holders) - - * Feature requests driven by user needs - - * On-time pull request merges - - * Bounties for bug hunts - - * Better test coverage incentives - - * Up-to-date documentation rewards - - * Long-term support guarantees - - * Timely security fixes - - * Expert assistance, support, and services - - * Budget for evangelism and promotion of the projects - - * Budget for regular boring activities - - * Fast email and chat assistance - - * Full visibility of the overall project findings, etc. - - - - -If you haven't guessed, I'm talking about using blockchain and [smart contracts][9] to allow such interactions between users and developers—smart contracts that will give power to the hand of token holders to influence projects. - -![blockchain_in_open_source_ecosystem.png][11] - -The usage of blockchain in the open source ecosystem - -Existing channels in the open source ecosystem provide ways for users to influence projects through financial commitments to service providers or other limited means through the foundations. But the addition of blockchain-based technology to the open source ecosystem could open new channels for interaction between users and developers. I'm not saying this will replace the commercial open source model; most companies working with open source do many things that cannot be replaced by smart contracts. But smart contracts can spark a new way of bootstrapping new open source projects, giving a second life to commodity projects that are a burden to maintain. They can motivate developers to apply boring pull requests, write documentation, get tests to pass, etc., providing a direct value exchange channel between users and open source developers. Blockchain can add new channels to help open source projects grow and become self-sustaining in the long term, even when company backing is not feasible. It can create a new complementary model for self-sustaining open source projects—a win-win. - -### Tokenizing open source - -There are already a number of initiatives aiming to tokenize open source. Some focus only on an open source model, and some are more generic but apply to open source development as well: - - * [Gitcoin][12] \- grow open source, one of the most promising ones in this area. - - * [Oscoin][13] \- cryptocurrency for open source - - * [Open collective][14] \- a platform for supporting open source projects. - - * [FundYourselfNow][15] \- Kickstarter and ICOs for projects. - - * [Kauri][16] \- support for open source project documentation. - - * [Liberapay][17] \- a recurrent donations platform. - - * [FundRequest][18] \- a decentralized marketplace for open source collaboration. - - * [CanYa][19] \- recently acquired [Bountysource][20], now the world’s largest open source P2P bounty platform. - - * [OpenGift][21] \- a new model for open source monetization. - - * [Hacken][22] \- a white hat token for hackers. - - * [Coinlancer][23] \- a decentralized job market. - - * [CodeFund][24] \- an open source ad platform. - - * [IssueHunt][25] \- a funding platform for open source maintainers and contributors. - - * [District0x 1Hive][26] \- a crowdfunding and curation platform. - - * [District0x Fixit][27] \- github bug bounties. - - - - -This list is varied and growing rapidly. Some of these projects will disappear, others will pivot, but a few will emerge as the [SourceForge][28], the ASF, the GitHub of the future. That doesn't necessarily mean they'll replace these platforms, but they'll complement them with token models and create a richer open source ecosystem. Every project can pick its distribution model (license), governing model (foundation), and incentive model (token). In all cases, this will pump fresh blood to the open source world. - -### The future is open and decentralized - - * Software is eating the world. - - * Every company is a software company. - - * Open source is where innovation happens. - - - - -Given that, it is clear that open source is too big to fail and too important to be controlled by a few or left to its own destiny. Open source is a shared-resource system that has value to all, and more importantly, it must be managed as such. It is only a matter of time until every company on earth will want to have a stake and a say in the open source world. Unfortunately, we don't have the tools and the habits to do it yet. Such tools would allow anybody to show their appreciation or ignorance of software projects. It would create a direct and faster feedback loop between producers and consumers, between developers and users. It will foster innovation—innovation driven by user needs and expressed through token metrics. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/8/open-source-tokenomics - -作者:[Bilgin lbryam][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/bibryam -[1]:https://en.wikipedia.org/wiki/Satoshi_Nakamoto -[2]:https://www.apache.org/ -[3]:https://www.cncf.io/ -[4]:https://medium.com/open-consensus/3-oss-business-model-progressions-dafd5837f2d -[5]:https://docs.google.com/spreadsheets/d/17nKMpi_Dh5slCqzLSFBoWMxNvWiwt2R-t4e_l7LPLhU/edit#gid=0 -[6]:http://jobs.redhat.com/ -[7]:https://attic.apache.org/ -[8]:http://incubator.apache.org/ -[9]:https://en.wikipedia.org/wiki/Smart_contract -[10]:/file/404421 -[11]:https://opensource.com/sites/default/files/uploads/blockchain_in_open_source_ecosystem.png (blockchain_in_open_source_ecosystem.png) -[12]:https://gitcoin.co/ -[13]:http://oscoin.io/ -[14]:https://opencollective.com/opensource -[15]:https://www.fundyourselfnow.com/page/about -[16]:https://kauri.io/ -[17]:https://liberapay.com/ -[18]:https://fundrequest.io/ -[19]:https://canya.io/ -[20]:https://www.bountysource.com/ -[21]:https://opengift.io/pub/ -[22]:https://hacken.io/ -[23]:https://www.coinlancer.com/home -[24]:https://codefund.io/ -[25]:https://issuehunt.io/ -[26]:https://blog.district0x.io/district-proposal-spotlight-1hive-283957f57967 -[27]:https://github.com/district0x/district-proposals/issues/177 -[28]:https://sourceforge.net/ diff --git a/sources/talk/20180816 Debian Turns 25- Here are Some Interesting Facts About Debian Linux.md b/sources/talk/20180816 Debian Turns 25- Here are Some Interesting Facts About Debian Linux.md deleted file mode 100644 index c90262dfee..0000000000 --- a/sources/talk/20180816 Debian Turns 25- Here are Some Interesting Facts About Debian Linux.md +++ /dev/null @@ -1,116 +0,0 @@ -Debian Turns 25! Here are Some Interesting Facts About Debian Linux -====== -One of the oldest Linux distribution still in development, Debian has just turned 25. Let’s have a look at some interesting facts about this awesome FOSS project. - -### 10 Interesting facts about Debian Linux - -![Interesting facts about Debian Linux][1] - -The facts presented here have been collected from various sources available from the internet. They are true to my knowledge, but in case of any error, please remind me to update the article. - -#### 1\. One of the oldest Linux distributions still under active development - -[Debian project][2] was announced on 16th August 1993 by Ian Murdock, Debian Founder. Like Linux creator [Linus Torvalds][3], Ian was a college student when he announced Debian project. - -![](https://farm6.staticflickr.com/5710/20006308374_7f51ae2a5c_z.jpg) - -#### 2\. Some people get tattoo while some name their project after their girlfriend’s name - -The project was named by combining the name of Ian and his then-girlfriend Debra Lynn. Ian and Debra got married and had three children. Debra and Ian got divorced in 2008. - -#### 3\. Ian Murdock: The Maverick behind the creation of Debian project - -![Debian Founder Ian Murdock][4] -Ian Murdock - -[Ian Murdock][5] led the Debian project from August 1993 until March 1996. He shaped Debian into a community project based on the principals of Free Software. The [Debian Manifesto][6] and the [Debian Social Contract][7] are still governing the project. - -He founded a commercial Linux company called [Progeny Linux Systems][8] and worked for a number of Linux related companies such as Sun Microsystems, Linux Foundation and Docker. - -Sadly, [Ian committed suicide in December 2015][9]. His contribution to Debian is certainly invaluable. - -#### 4\. Debian is a community project in the true sense - -Debian is a community based project in true sense. No one ‘owns’ Debian. Debian is being developed by volunteers from all over the world. It is not a commercial project, backed by corporates like many other Linux distributions. - -Debian Linux distribution is composed of Free Software only. It’s one of the few Linux distributions that is true to the spirit of [Free Software][10] and takes proud in being called a GNU/Linux distribution. - -Debian has its non-profit organization called [Software in Public Interest][11] (SPI). Along with Debian, SPI supports many other open source projects financially. - -#### 5\. Debian and its 3 branches - -Debian has three branches or versions: Debian Stable, Debian Unstable (Sid) and Debian Testing. - -Debian Stable, as the name suggests, is the stable branch that has all the software and packages well tested to give you a rock solid stable system. Since it takes time before a well-tested software lands in the stable branch, Debian Stable often contains older versions of programs and hence people joke that Debian Stable means stale. - -[Debian Unstable][12] codenamed Sid is the version where all the development of Debian takes place. This is where the new packages first land or developed. After that, these changes are propagated to the testing version. - -[Debian Testing][13] is the next release after the current stable release. If the current stable release is N, Debian testing would be the N+1 release. The packages from Debian Unstable are tested in this version. After all the new changes are well tested, Debian Testing is then ‘promoted’ as the new Stable version. - -There is no strict release schedule for Debian. - -#### 7\. There was no Debian 1.0 release - -Debian 1.0 was never released. The CD vendor, InfoMagic, accidentally shipped a development release of Debian and entitled it 1.0 in 1996. To prevent confusion between the CD version and the actual Debian release, the Debian Project renamed its next release to “Debian 1.1”. - -#### 8\. Debian releases are codenamed after Toy Story characters - -![Toy Story Characters][14] - -Debian releases are codenamed after the characters from Pixar’s hit animation movie series [Toy Story][15]. - -Debian 1.1 was the first release with a codename. It was named Buzz after the Toy Story character Buzz Lightyear. - -It was in 1996 and [Bruce Perens][16] had taken over leadership of the Project from Ian Murdock. Bruce was working at Pixar at the time. - -This trend continued and all the subsequent releases had codenamed after Toy Story characters. For example, the current stable release is Stretch while the upcoming release has been codenamed Buster. - -The unstable Debian version is codenamed Sid. This character in Toy Story is a kid with emotional problems and he enjoys breaking toys. This is symbolic in the sense that Debian Unstable might break your system with untested packages. - -#### 9\. Debian also has a BSD ditribution - -Debian is not limited to Linux. Debian also has a distribution based on FreeBSD kernel. It is called [Debian GNU/kFreeBSD][17]. - -#### 10\. Google uses Debian - -[Google uses Debian][18] as its in-house development platform. Earlier, Google used a customized version of Ubuntu as its development platform. Recently they opted for Debian based gLinux. - -#### Happy 25th birthday Debian - -![Happy 25th birthday Debian][19] - -I hope you liked these little facts about Debian. Stuff like these are reasons why people love Debian. - -I wish a very happy 25th birthday to Debian. Please continue to be awesome. Cheers :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/debian-facts/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[1]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/Interesting-facts-about-debian.jpeg -[2]:https://www.debian.org -[3]:https://itsfoss.com/linus-torvalds-facts/ -[4]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/ian-murdock.jpg -[5]:https://en.wikipedia.org/wiki/Ian_Murdock -[6]:https://www.debian.org/doc/manuals/project-history/ap-manifesto.en.html -[7]:https://www.debian.org/social_contract -[8]:https://en.wikipedia.org/wiki/Progeny_Linux_Systems -[9]:https://itsfoss.com/ian-murdock-dies-mysteriously/ -[10]:https://www.fsf.org/ -[11]:https://www.spi-inc.org/ -[12]:https://www.debian.org/releases/sid/ -[13]:https://www.debian.org/releases/testing/ -[14]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/toy-story-characters.jpeg -[15]:https://en.wikipedia.org/wiki/Toy_Story_(franchise) -[16]:https://perens.com/about-bruce-perens/ -[17]:https://wiki.debian.org/Debian_GNU/kFreeBSD -[18]:https://itsfoss.com/goobuntu-glinux-google/ -[19]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/happy-25th-birthday-Debian.jpeg diff --git a/sources/talk/20181004 Interview With Peter Ganten, CEO of Univention GmbH.md b/sources/talk/20181004 Interview With Peter Ganten, CEO of Univention GmbH.md deleted file mode 100644 index 5a0c1aabdd..0000000000 --- a/sources/talk/20181004 Interview With Peter Ganten, CEO of Univention GmbH.md +++ /dev/null @@ -1,97 +0,0 @@ -Interview With Peter Ganten, CEO of Univention GmbH -====== -I have been asking the Univention team to share the behind-the-scenes story of [**Univention**][1] for a couple of months. Finally, today we got the interview of **Mr. Peter H. Ganten** , CEO of Univention GmbH. Despite his busy schedule, in this interview, he shares what he thinks of the Univention project and its impact on open source ecosystem, what open source developers and companies will need to do to keep thriving and what are the biggest challenges for open source projects. - -**OSTechNix: What’s your background and why have you founded Univention?** - -**Peter Ganten:** I studied physics and psychology. In psychology I was a research assistant and coded evaluation software. I realized how important it is that results have to be disclosed in order to verify or falsify them. The same goes for the code that leads to the results. This brought me into contact with Open Source Software (OSS) and Linux. - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/peter-ganten-interview.jpg) - -I was a kind of technical lab manager and I had the opportunity to try out a lot, which led to my book about Debian. That was still in the New Economy era where the first business models emerged on how to make money with Open Source. When the bubble burst, I had the plan to make OSS a solid business model without venture capital but with Hanseatic business style – seriously, steadily, no bling bling. - -**What were the biggest challenges at the beginning?** - -When I came from the university, the biggest challenge clearly was to gain entrepreneurial and business management knowledge. I quickly learned that it’s not about Open Source software as an end to itself but always about customer value, and the benefits OSS offers its customers. We all had to learn a lot. - -In the beginning, we expected that Linux on the desktop would become established in a similar way as Linux on the server. However, this has not yet been proven true. The replacement has happened with Android and the iPhone. Our conclusion then was to change our offerings towards ID management and enterprise servers. - -**Why does UCS matter? And for whom makes it sense to use it?** - -There is cool OSS in all areas, but many organizations are not capable to combine it all together and make it manageable. For the basic infrastructure (Windows desktops, users, user rights, roles, ID management, apps) we need a central instance to which groupware, CRM etc. is connected. Without Univention this would have to be laboriously assembled and maintained manually. This is possible for very large companies, but far too complex for many other organizations. - -[**UCS**][2] can be used out of the box and is scalable. That’s why it’s becoming more and more popular – more than 10,000 organizations are using UCS already today. - -**Who are your users and most important clients? What do they love most about UCS?** - -The Core Edition is free of charge and used by organizations from all sectors and industries such as associations, micro-enterprises, universities or large organizations with thousands of users. In the enterprise environment, where Long Term Servicing (LTS) and professional support are particularly important, we have organizations ranging in size from 30-50 users to several thousand users. One of the target groups is the education system in Germany. In many large cities and within their school administrations UCS is used, for example, in Cologne, Hannover, Bremen, Kassel and in several federal states. They are looking for manageable IT and apps for schools. That’s what we offer, because we can guarantee these authorities full control over their users’ identities. - -Also, more and more cloud service providers and MSPs want to take UCS to deliver a selection of cloud-based app solutions. - -**Is UCS 100% Open Source? If so, how can you run a profitable business selling it?** - -Yes, UCS is 100% Open Source, every line, the whole code is OSS. You can download and use UCS Core Edition for **FREE!** - -We know that in large, complex organizations, vendor support and liability is needed for LTS, SLAs, and we offer that with our Enterprise subscriptions and consulting services. We don’t offer these in the Core Edition. - -**And what are you giving back to the OS community?** - -A lot. We are involved in the Debian team and co-finance the LTS maintenance for Debian. For important OS components in UCS like [**OpenLDAP**][3], Samba or KVM we co-finance the development or have co-developed them ourselves. We make it all freely available. - -We are also involved on the political level in ensuring that OSS is used. We are engaged, for example, in the [**Free Software Foundation Europe (FSFE)**][4] and the [**German Open Source Business Alliance**][5], of which I am the chairman. We are working hard to make OSS more successful. - -**How can I get started with UCS?** - -It’s easy to get started with the Core Edition, which, like the Enterprise Edition, has an App Center and can be easily installed on your own hardware or as an appliance in a virtual machine. Just [**download Univention ISO**][6] and install it as described in the below link. - -Alternatively, you can try the [**UCS Online Demo**][7] to get a first impression of Univention Corporate Server without actually installing it on your system. - -**What do you think are the biggest challenges for Open Source?** - -There is a certain attitude you can see over and over again even in bigger projects: OSS alone is viewed as an almost mandatory prerequisite for a good, sustainable, secure and trustworthy IT solution – but just having decided to use OSS is no guarantee for success. You have to carry out projects professionally and cooperate with the manufacturers. A danger is that in complex projects people think: “Oh, OSS is free, I just put it all together by myself”. But normally you do not have the know-how to successfully implement complex software solutions. You would never proceed like this with Closed Source. There people think: “Oh, the software costs 3 $ millions, so it’s okay if I have to spend another 300,000 Dollars on consultants.” - -At OSS this is different. If such projects fail and leave burnt ground behind, we have to explain again and again that the failure of such projects is not due to the nature of OSS but to its poor implementation and organization in a specific project: You have to conclude reasonable contracts and involve partners as in the proprietary world, but you’ll gain a better solution. - -Another challenge: We must stay innovative, move forward, attract new people who are enthusiastic about working on projects. That’s sometimes a challenge. For example, there are a number of proprietary cloud services that are good but lead to extremely high dependency. There are approaches to alternatives in OSS, but no suitable business models yet. So it’s hard to find and fund developers. For example, I can think of Evernote and OneNote for which there is no reasonable OSS alternative. - -**And what will the future bring for Univention?** - -I don’t have a crystal ball, but we are extremely optimistic. We see a very high growth potential in the education market. More OSS is being made in the public sector, because we have repeatedly experienced the dead ends that can be reached if we solely rely on Closed Source. - -Overall, we will continue our organic growth at double-digit rates year after year. - -UCS and its core functionalities of identity management, infrastructure management and app center will increasingly be offered and used from the cloud as a managed service. We will support our technology in this direction, e.g., through containers, so that a hypervisor or bare metal is not always necessary for operation. - -**You have been the CEO of Univention for a long time. What keeps you motivated?** - -I have been the CEO of Univention for more than 16 years now. My biggest motivation is to realize that something is moving. That we offer the better way for IT. That the people who go this way with us are excited to work with us. I go home satisfied in the evening (of course not every evening). It’s totally cool to work with the team I have. It motivates and pushes you every time I need it myself. - -I’m a techie and nerd at heart, I enjoy dealing with technology. So I’m totally happy at this place and I’m grateful to the world that I can do whatever I want every day. Not everyone can say that. - -**Who gives you inspiration?** - -My employees, the customers and the Open Source projects. The exchange with other people. - -The motivation behind everything is that we want to make sure that mankind will be able to influence and change the IT that surrounds us today and in the future just the way we want it and we thinks it’s good. We want to make a contribution to this. That is why Univention is there. That is important to us every day. - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/interview-with-peter-ganten-ceo-of-univention-gmbh/ - -作者:[SK][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.ostechnix.com/author/sk/ -[1]: https://www.ostechnix.com/introduction-univention-corporate-server/ -[2]: https://www.univention.com/products/ucs/ -[3]: https://www.ostechnix.com/redhat-and-suse-announced-to-withdraw-support-for-openldap/ -[4]: https://fsfe.org/ -[5]: https://osb-alliance.de/ -[6]: https://www.univention.com/downloads/download-ucs/ -[7]: https://www.univention.com/downloads/ucs-online-demo/ diff --git a/sources/talk/20190228 Why CLAs aren-t good for open source.md b/sources/talk/20190228 Why CLAs aren-t good for open source.md deleted file mode 100644 index ca39619762..0000000000 --- a/sources/talk/20190228 Why CLAs aren-t good for open source.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why CLAs aren't good for open source) -[#]: via: (https://opensource.com/article/19/2/cla-problems) -[#]: author: (Richard Fontana https://opensource.com/users/fontana) - -Why CLAs aren't good for open source -====== -Few legal topics in open source are as controversial as contributor license agreements. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/write-hand_0.jpg?itok=Uw5RJD03) - -Few legal topics in open source are as controversial as [contributor license agreements][1] (CLAs). Unless you count the special historical case of the [Fedora Project Contributor Agreement][2] (which I've always seen as an un-CLA), or, like [Karl Fogel][3], you classify the [DCO][4] as a [type of CLA][5], today Red Hat makes no use of CLAs for the projects it maintains. - -It wasn't always so. Red Hat's earliest projects followed the traditional practice I've called "inbound=outbound," in which contributions to a project are simply provided under the project's open source license with no execution of an external, non-FOSS contract required. But in the early 2000s, Red Hat began experimenting with the use of contributor agreements. Fedora started requiring contributors to sign a CLA based on the widely adapted [Apache ICLA][6], while a Free Software Foundation-derived copyright assignment agreement and a pair of bespoke CLAs were inherited from the Cygnus and JBoss acquisitions, respectively. We even took [a few steps][7] towards adopting an Apache-style CLA across the rapidly growing set of Red Hat-led projects. - -This came to an end, in large part because those of us on the Red Hat legal team heard and understood the concerns and objections raised by Red Hat engineers and the wider technical community. We went on to become de facto leaders of what some have called the anti-CLA movement, marked notably by our [opposition to Project Harmony][8] and our [efforts][9] to get OpenStack to replace its CLA with the DCO. (We [reluctantly][10] sign tolerable upstream project CLAs out of practical necessity.) - -### Why CLAs are problematic - -Our choice not to use CLAs is a reflection of our values as an authentic open source company with deep roots in the free software movement. Over the years, many in the open source community have explained why CLAs, and the very similar mechanism of copyright assignment, are a bad policy for open source. - -One reason is the red tape problem. Normally, open source development is characterized by frictionless contribution, which is enabled by inbound=outbound without imposition of further legal ceremony or process. This makes it relatively easy for new contributors to get involved in a project, allowing more effective growth of contributor communities and driving technical innovation upstream. Frictionless contribution is a key part of the advantage open source development holds over proprietary alternatives. But frictionless contribution is negated by CLAs. Having to sign an unusual legal agreement before a contribution can be accepted creates a bureaucratic hurdle that slows down development and discourages participation. This cost persists despite the growing use of automation by CLA-using projects. - -CLAs also give rise to an asymmetry of legal power among a project's participants, which also discourages the growth of strong contributor and user communities around a project. With Apache-style CLAs, the company or organization leading the project gets special rights that other contributors do not receive, while those other contributors must shoulder certain legal obligations (in addition to the red tape burden) from which the project leader is exempt. The problem of asymmetry is most severe in copyleft projects, but it is present even when the outbound license is permissive. - -When assessing the arguments for and against CLAs, bear in mind that today, as in the past, the vast majority of the open source code in any product originates in projects that follow the inbound=outbound practice. The use of CLAs by a relatively small number of projects causes collateral harm to all the others by signaling that, for some reason, open source licensing is insufficient to handle contributions flowing into a project. - -### The case for CLAs - -Since CLAs continue to be a minority practice and originate from outside open source community culture, I believe that CLA proponents should bear the burden of explaining why they are necessary or beneficial relative to their costs. I suspect that most companies using CLAs are merely emulating peer company behavior without critical examination. CLAs have an understandable, if superficial, appeal to risk-averse lawyers who are predisposed to favor greater formality, paper, and process regardless of the business costs. Still, some arguments in favor of CLAs are often advanced and deserve consideration. - -**Easy relicensing:** If administered appropriately, Apache-style CLAs give the project steward effectively unlimited power to sublicense contributions under terms of the steward's choice. This is sometimes seen as desirable because of the potential need to relicense a project under some other open source license. But the value of easy relicensing has been greatly exaggerated by pointing to a few historical cases involving major relicensing campaigns undertaken by projects with an unusually large number of past contributors (all of which were successful without the use of a CLA). There are benefits in relicensing being hard because it results in stable legal expectations around a project and encourages projects to consult their contributor communities before undertaking significant legal policy changes. In any case, most inbound=outbound open source projects never attempt to relicense during their lifetime, and for the small number that do, relicensing will be relatively painless because typically the number of past contributors to contact will not be large. - -**Provenance tracking:** It is sometimes claimed that CLAs enable a project to rigorously track the provenance of contributions, which purportedly has some legal benefit. It is unclear what is achieved by the use of CLAs in this regard that is not better handled through such non-CLA means as preserving Git commit history. And the DCO would seem to be much better suited to tracking contributions, given that it is normally used on a per-commit basis, while CLAs are signed once per contributor and are administratively separate from code contributions. Moreover, provenance tracking is often described as though it were a benefit for the public, yet I know of no case where a project provides transparent, ready public access to CLA acceptance records. - -**License revocation:** Some CLA advocates warn of the prospect that a contributor may someday attempt to revoke a past license grant. To the extent that the concern is about largely judgment-proof individual contributors with no corporate affiliation, it is not clear why an Apache-style CLA provides more meaningful protection against this outcome compared to the use of an open source license. And, as with so many of the legal risks raised in discussions of open source legal policy, this appears to be a phantom risk. I have heard of only a few purported attempts at license revocation over the years, all of which were resolved quickly when the contributor backed down in the face of community pressure. - -**Unauthorized employee contribution:** This is a special case of the license revocation issue and has recently become a point commonly raised by CLA advocates. When an employee contributes to an upstream project, normally the employer owns the copyrights and patents for which the project needs licenses, and only certain executives are authorized to grant such licenses. Suppose an employee contributed proprietary code to a project without approval from the employer, and the employer later discovers this and demands removal of the contribution or sues the project's users. This risk of unauthorized contributions is thought to be minimized by use of something like the [Apache CCLA][11] with its representations and signature requirement, coupled with some adequate review process to ascertain that the CCLA signer likely was authorized to sign (a step which I suspect is not meaningfully undertaken by most CLA-using companies). - -Based on common sense and common experience, I contend that in nearly all cases today, employee contributions are done with the actual or constructive knowledge and consent of the employer. If there were an atmosphere of high litigation risk surrounding open source software, perhaps this risk should be taken more seriously, but litigation arising out of open source projects remains remarkably uncommon. - -More to the point, I know of no case where an allegation of copyright or patent infringement against an inbound=outbound project, not stemming from an alleged open source license violation, would have been prevented by use of a CLA. Patent risk, in particular, is often cited by CLA proponents when pointing to the risk of unauthorized contributions, but the patent license grants in Apache-style CLAs are, by design, quite narrow in scope. Moreover, corporate contributions to an open source project will typically be few in number, small in size (and thus easily replaceable), and likely to be discarded as time goes on. - -### Alternatives - -If your company does not buy into the anti-CLA case and cannot get comfortable with the simple use of inbound=outbound, there are alternatives to resorting to an asymmetric and administratively burdensome Apache-style CLA requirement. The use of the DCO as a complement to inbound=outbound addresses at least some of the concerns of risk-averse CLA advocates. If you must use a true CLA, there is no need to use the Apache model (let alone a [monstrous derivative][10] of it). Consider the non-specification core of the [Eclipse Contributor Agreement][12]—essentially the DCO wrapped inside a CLA—or the Software Freedom Conservancy's [Selenium CLA][13], which merely ceremonializes an inbound=outbound contribution policy. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/cla-problems - -作者:[Richard Fontana][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/fontana -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/18/3/cla-vs-dco-whats-difference -[2]: https://opensource.com/law/10/6/new-contributor-agreement-fedora -[3]: https://www.red-bean.com/kfogel/ -[4]: https://developercertificate.org -[5]: https://producingoss.com/en/contributor-agreements.html#developer-certificate-of-origin -[6]: https://www.apache.org/licenses/icla.pdf -[7]: https://www.freeipa.org/page/Why_CLA%3F -[8]: https://opensource.com/law/11/7/trouble-harmony-part-1 -[9]: https://wiki.openstack.org/wiki/OpenStackAndItsCLA -[10]: https://opensource.com/article/19/1/cla-proliferation -[11]: https://www.apache.org/licenses/cla-corporate.txt -[12]: https://www.eclipse.org/legal/ECA.php -[13]: https://docs.google.com/forms/d/e/1FAIpQLSd2FsN12NzjCs450ZmJzkJNulmRC8r8l8NYwVW5KWNX7XDiUw/viewform?hl=en_US&formkey=dFFjXzBzM1VwekFlOWFWMjFFRjJMRFE6MQ#gid=0 diff --git a/sources/talk/20190311 Discuss everything Fedora.md b/sources/talk/20190311 Discuss everything Fedora.md deleted file mode 100644 index 5795fbf3f7..0000000000 --- a/sources/talk/20190311 Discuss everything Fedora.md +++ /dev/null @@ -1,45 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Discuss everything Fedora) -[#]: via: (https://fedoramagazine.org/discuss-everything-fedora/) -[#]: author: (Ryan Lerch https://fedoramagazine.org/introducing-flatpak/) - -Discuss everything Fedora -====== -![](https://fedoramagazine.org/wp-content/uploads/2019/03/fedora-discussion-816x345.jpg) - -Are you interested in how Fedora is being developed? Do you want to get involved, or see what goes into making a release? You want to check out [Fedora Discussion][1]. It is a relatively new place where members of the Fedora Community meet to discuss, ask questions, and interact. Keep reading for more information. - -Note that the Fedora Discussion system is mainly aimed at contributors. If you have questions on using Fedora, check out [Ask Fedora][2] (which is being migrated in the future). - -![][3] - -Fedora Discussion is a forum and discussion site that uses the [Discourse open source discussion platform][4]. - -There are already several categories useful for Fedora users, including [Desktop][5] (covering Fedora Workstation, Fedora Silverblue, KDE, XFCE, and more) and the [Server, Cloud, and IoT][6] category . Additionally, some of the [Fedora Special Interest Groups (SIGs) have discussions as well][7]. Finally, the [Fedora Friends][8] category helps you connect with other Fedora users and Community members by providing discussions about upcoming meetups and hackfests. - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/discuss-everything-fedora/ - -作者:[Ryan Lerch][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/introducing-flatpak/ -[b]: https://github.com/lujun9972 -[1]: https://discussion.fedoraproject.org/ -[2]: https://ask.fedoraproject.org -[3]: https://fedoramagazine.org/wp-content/uploads/2019/03/discussion-screenshot-1024x663.png -[4]: https://www.discourse.org/about -[5]: https://discussion.fedoraproject.org/c/desktop -[6]: https://discussion.fedoraproject.org/c/server -[7]: https://discussion.fedoraproject.org/c/sigs -[8]: https://discussion.fedoraproject.org/c/friends diff --git a/sources/talk/20190322 How to save time with TiDB.md b/sources/talk/20190322 How to save time with TiDB.md deleted file mode 100644 index 534c04de1f..0000000000 --- a/sources/talk/20190322 How to save time with TiDB.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to save time with TiDB) -[#]: via: (https://opensource.com/article/19/3/how-save-time-tidb) -[#]: author: (Morgan Tocker https://opensource.com/users/morgo) - -How to save time with TiDB -====== - -TiDB, an open source-compatible, cloud-based database engine, simplifies many of MySQL database administrators' common tasks. - -![Team checklist][1] - -Last November, I wrote about key [differences between MySQL and TiDB][2], an open source-compatible, cloud-based database engine, from the perspective of scaling both solutions in the cloud. In this follow-up article, I'll dive deeper into the ways [TiDB][3] streamlines and simplifies administration. - -If you come from a MySQL background, you may be used to doing a lot of manual tasks that are either not required or much simpler with TiDB. - -The inspiration for TiDB came from the founders managing sharded MySQL at scale at some of China's largest internet companies. Since requirements for operating a large system at scale are a key concern, I'll look at some typical MySQL database administrator (DBA) tasks and how they translate to TiDB. - -[![TiDB architecture][4]][5] - -In [TiDB's architecture][5]: - - * SQL processing is separated from data storage. The SQL processing (TiDB) and storage (TiKV) components independently scale horizontally. - * PD (Placement Driver) acts as the cluster manager and stores metadata. - * All components natively provide high availability, with PD and TiKV using the [Raft consensus algorithm][6]. - * You can access your data via either MySQL (TiDB) or Spark (TiSpark) protocols. - - - -### Adding/fixing replication slaves - -**tl;dr:** It doesn't happen in the same way as in MySQL. - -Replication and redundancy of data are automatically managed by TiKV. You also don't need to worry about creating initial backups to seed replicas, as _both_ the provisioning and replication are handled for you. - -Replication is also quorum-based using the Raft consensus algorithm, so you don't have to worry about the inconsistency problems surrounding failures that you do with asynchronous replication (the default in MySQL and what many users are using). - -TiDB does support its own binary log, so it can be used for asynchronous replication between clusters. - -### Optimizing slow queries - -**tl;dr:** Still happens in TiDB - -There is no real way out of optimizing slow queries that have been introduced by development teams. - -As a mitigating factor though, if you need to add breathing room to your database's capacity while you work on optimization, the TiDB's architecture allows you to horizontally scale. - -### Upgrades and maintenance - -**tl;dr:** Still required, but generally easier - -Because the TiDB server is stateless, you can roll through an upgrade and deploy new TiDB servers. Then you can remove the older TiDB servers from the load balancer pool, shutting down them once connections have drained. - -Upgrading PD is also quite straightforward since only the PD leader actively answers requests at a time. You can perform a rolling upgrade and upgrade PD's non-leader peers one at a time, and then change the leader before upgrading the final PD server. - -For TiKV, the upgrade is marginally more complex. If you want to remove a node, I recommend first setting it to be a follower on each of the regions where it is currently a leader. After that, you can bring down the node without impacting your application. If the downtime is brief, TiKV will recover with its regional peers from the Raft log. In a longer downtime, it will need to re-copy data. This can all be managed for you, though, if you choose to deploy using Ansible or Kubernetes. - -### Manual sharding - -**tl;dr:** Not required - -Manual sharding is mainly a pain on the part of the application developers, but as a DBA, you might have to get involved if the sharding is naive or has problems such as hotspots (many workloads do) that require re-balancing. - -In TiDB, re-sharding or re-balancing happens automatically in the background. The PD server observes when data regions (TiKV's term for chunks of data in key-value form) get too small, too big, or too frequently accessed. - -You can also explicitly configure PD to store regions on certain TiKV servers. This works really well when combined with MySQL partitioning. - -### Capacity planning - -**tl;dr:** Much easier - -Capacity planning on a MySQL database can be a little bit hard because you need to plan your physical infrastructure requirements two to three years from now. As data grows (and the working set changes), this can be a difficult task. I wouldn't say it completely goes away in the cloud either, since changing a master server's hardware is always hard. - -TiDB splits data into approximately 100MiB chunks that it distributes among TiKV servers. Because this increment is much smaller than a full server, it's much easier to move around and redistribute data. It's also possible to add new servers in smaller increments, which is easier on planning. - -### Scaling - -**tl;dr:** Much easier - -This is related to capacity planning and sharding. When we talk about scaling, many people think about very large _systems,_ but that is not exclusively how I think of the problem: - - * Scaling is being able to start with something very small, without having to make huge investments upfront on the chance it could become very large. - * Scaling is also a people problem. If a system requires too much internal knowledge to operate, it can become hard to grow as an engineering organization. The barrier to entry for new hires can become very high. - - - -Thus, by providing automatic sharding, TiDB can scale much easier. - -### Schema changes (DDL) - -**tl;dr:** Mostly better - -The data definition language (DDL) supported in TiDB is all online, which means it doesn't block other reads or writes to the system. It also doesn't block the replication stream. - -That's the good news, but there are a couple of limitations to be aware of: - - * TiDB does not currently support all DDL operations, such as changing the primary key or some "change data type" operations. - * TiDB does not currently allow you to chain multiple DDL changes in the same command, e.g., _ALTER TABLE t1 ADD INDEX (x), ADD INDEX (y)_. You will need to break these queries up into individual DDL queries. - - - -This is an area that we're looking to improve in [TiDB 3.0][7]. - -### Creating one-off data dumps for the reporting team - -**tl;dr:** May not be required - -DBAs loathe manual tasks that create one-off exports of data to be consumed by another team, perhaps in an analytics tool or data warehouse. - -This is often required when the types of queries that are be executed on the dataset are analytical. TiDB has hybrid transactional/analytical processing (HTAP) capabilities, so in many cases, these queries should work fine. If your analytics team is using Spark, you can also use the [TiSpark][8] connector to allow them to connect directly to TiKV. - -This is another area we are improving with [TiFlash][7], a column store accelerator. We are also working on a plugin system to support external authentication. This will make it easier to manage access by the reporting team. - -### Conclusion - -In this post, I looked at some common MySQL DBA tasks and how they translate to TiDB. If you would like to learn more, check out our [TiDB Academy course][9] designed for MySQL DBAs (it's free!). - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/how-save-time-tidb - -作者:[Morgan Tocker][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/morgo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) -[2]: https://opensource.com/article/18/11/key-differences-between-mysql-and-tidb -[3]: https://github.com/pingcap/tidb -[4]: https://opensource.com/sites/default/files/uploads/tidb_architecture.png (TiDB architecture) -[5]: https://pingcap.com/docs/architecture/ -[6]: https://raft.github.io/ -[7]: https://pingcap.com/blog/tidb-3.0-beta-stability-at-scale/ -[8]: https://github.com/pingcap/tispark -[9]: https://pingcap.com/tidb-academy/ diff --git a/sources/talk/20190410 Google partners with Intel, HPE and Lenovo for hybrid cloud.md b/sources/talk/20190410 Google partners with Intel, HPE and Lenovo for hybrid cloud.md deleted file mode 100644 index 5603086a53..0000000000 --- a/sources/talk/20190410 Google partners with Intel, HPE and Lenovo for hybrid cloud.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Google partners with Intel, HPE and Lenovo for hybrid cloud) -[#]: via: (https://www.networkworld.com/article/3388062/google-partners-with-intel-hpe-and-lenovo-for-hybrid-cloud.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Google partners with Intel, HPE and Lenovo for hybrid cloud -====== -Google boosted its on-premises and cloud connections with Kubernetes and serverless computing. -![Ilze Lucero \(CC0\)][1] - -Still struggling to get its Google Cloud business out of single-digit marketshare, Google this week introduced new partnerships with Lenovo and Intel to help bolster its hybrid cloud offerings, both built on Google’s Kubernetes container technology. - -At Google’s Next ’19 show this week, Intel and Google said they will collaborate on Google's Anthos, a new reference design based on the second-Generation Xeon Scalable processor introduced last week and an optimized Kubernetes software stack designed to deliver increased workload portability between public and private cloud environments. - -**[ Read also:[What hybrid cloud means in practice][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** - -As part the Anthos announcement, Hewlett Packard Enterprise (HPE) said it has validated Anthos on its ProLiant servers, while Lenovo has done the same for its ThinkAgile platform. This solution will enable customers to get a consistent Kubernetes experience between Google Cloud and their on-premises HPE or Lenovo servers. No official word from Dell yet, but they can’t be far behind. - -Users will be able to manage their Kubernetes clusters and enforce policy consistently across environments – either in the public cloud or on-premises. In addition, Anthos delivers a fully integrated stack of hardened components, including OS and container runtimes that are tested and validated by Google, so customers can upgrade their clusters with confidence and minimize downtime. - -### What is Google Anthos? - -Google formally introduced [Anthos][4] at this year’s show. Anthos, formerly Cloud Services Platform, is meant to allow users to run their containerized applications without spending time on building, managing, and operating Kubernetes clusters. It runs both on Google Cloud Platform (GCP) with Google Kubernetes Engine (GKE) and in your data center with GKE On-Prem. Anthos will also let you manage workloads running on third-party clouds such as Amazon Web Services (AWS) and Microsoft Azure. - -Google also announced the beta release of Anthos Migrate, which auto-migrates virtual machines (VM) from on-premises or other clouds directly into containers in GKE with minimal effort. This allows enterprises to migrate their infrastructure in one streamlined motion, without upfront modifications to the original VMs or applications. - -Intel said it will publish the production design as an Intel Select Solution, as well as a developer platform, making it available to anyone who wants it. - -### Serverless environments - -Google isn’t stopping with Kubernetes containers, it’s also pushing ahead with serverless environments. [Cloud Run][5] is Google’s implementation of serverless computing, which is something of a misnomer. You still run your apps on servers; you just aren’t using a dedicated physical server. It is stateless, so resources are not allocated until you actually run or use the application. - -Cloud Run is a fully serverless offering that takes care of all infrastructure management, including the provisioning, configuring, scaling, and managing of servers. It automatically scales up or down within seconds, even down to zero depending on traffic, ensuring you pay only for the resources you actually use. Cloud Run can be used on GKE, offering the option to run side by side with other workloads deployed in the same cluster. - -Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3388062/google-partners-with-intel-hpe-and-lenovo-for-hybrid-cloud.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/03/cubes_blocks_squares_containers_ilze_lucero_cc0_via_unsplash_1200x800-100752172-large.jpg -[2]: https://www.networkworld.com/article/3249495/what-hybrid-cloud-mean-practice -[3]: https://www.networkworld.com/newsletters/signup.html -[4]: https://cloud.google.com/blog/topics/hybrid-cloud/new-platform-for-managing-applications-in-todays-multi-cloud-world -[5]: https://cloud.google.com/blog/products/serverless/announcing-cloud-run-the-newest-member-of-our-serverless-compute-stack -[6]: https://www.facebook.com/NetworkWorld/ -[7]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190410 HPE and Nutanix partner for hyperconverged private cloud systems.md b/sources/talk/20190410 HPE and Nutanix partner for hyperconverged private cloud systems.md deleted file mode 100644 index 76f908c68b..0000000000 --- a/sources/talk/20190410 HPE and Nutanix partner for hyperconverged private cloud systems.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (HPE and Nutanix partner for hyperconverged private cloud systems) -[#]: via: (https://www.networkworld.com/article/3388297/hpe-and-nutanix-partner-for-hyperconverged-private-cloud-systems.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -HPE and Nutanix partner for hyperconverged private cloud systems -====== -Both companies will sell HP ProLiant appliances with Nutanix software but to different markets. -![Hewlett Packard Enterprise][1] - -Hewlett Packard Enterprise (HPE) has partnered with Nutanix to offer Nutanix’s hyperconverged infrastructure (HCI) software available as a managed private cloud service and on HPE-branded appliances. - -As part of the deal, the two companies will be competing against each other in hardware sales, sort of. If you want the consumption model you get through HPE’s GreenLake, where your usage is metered and you pay for only the time you use it (similar to the cloud), then you would get the ProLiant hardware from HPE. - -If you want an appliance model where you buy the hardware outright, like in the traditional sense of server sales, you would get the same ProLiant through Nutanix. - -**[ Read also:[What is hybrid cloud computing?][2] and [Multicloud mania: what to know][3] ]** - -As it is, HPE GreenLake offers multiple cloud offerings to customers, including virtualization courtesy of VMware and Microsoft. With the Nutanix partnership, HPE is adding Nutanix’s free Acropolis hypervisor to its offerings. - -“Customers get to choose an alternative to VMware with this,” said Pradeep Kumar, senior vice president and general manager of HPE’s Pointnext consultancy. “They like the Acropolis license model, since it’s license-free. Then they have choice points so pricing is competitive. Some like VMware, and I think it’s our job to offer them both and they can pick and choose.” - -Kumar added that the whole Nutanix stack is 15 to 18% less with Acropolis than a VMware-powered system, since they save on the hypervisor. - -The HPE-Nutanix partnership offers a fully managed hybrid cloud infrastructure delivered as a service and deployed in customers’ data centers or co-location facility. The managed private cloud service gives enterprises a hyperconverged environment in-house without having to manage the infrastructure themselves and, more importantly, without the burden of ownership. GreenLake operates more like a lease than ownership. - -### HPE GreenLake's private cloud services promise to significantly reduce costs - -HPE is pushing hard on GreenLake, which basically mimics cloud platform pricing models of paying for what you use rather than outright ownership. Kumar said HPE projects the consumption model will account for 30% of HPE’s business in the next few years. - -GreenLake makes some hefty promises. According to Nutanix-commissioned IDC research, customers will achieve a 60% reduction in the five-year cost of operations, while a HPE-commissioned Forrester report found customers benefit from a 30% Capex savings due to eliminated need for overprovisioning and a 90% reduction in support and professional services costs. - -By shifting to an IT as a Service model, HPE claims to provide a 40% increase in productivity by reducing the support load on IT operations staff and to shorten the time to deploy IT projects by 65%. - -The two new offerings from the partnership – HPE GreenLake’s private cloud service running Nutanix software and the HPE-branded appliances integrated with Nutanix software – are expected to be available during the 2019 third quarter, the companies said. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3388297/hpe-and-nutanix-partner-for-hyperconverged-private-cloud-systems.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2015/11/hpe_building-100625424-large.jpg -[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html -[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md b/sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md deleted file mode 100644 index 5abcb3bcba..0000000000 --- a/sources/talk/20190418 Cisco warns WLAN controller, 9000 series router and IOS-XE users to patch urgent security holes.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Cisco warns WLAN controller, 9000 series router and IOS/XE users to patch urgent security holes) -[#]: via: (https://www.networkworld.com/article/3390159/cisco-warns-wlan-controller-9000-series-router-and-iosxe-users-to-patch-urgent-security-holes.html#tk.rss_all) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Cisco warns WLAN controller, 9000 series router and IOS/XE users to patch urgent security holes -====== -Cisco says unpatched vulnerabilities could lead to DoS attacks, arbitrary code execution, take-over of devices. -![Woolzian / Getty Images][1] - -Cisco this week issued 31 security advisories but directed customer attention to “critical” patches for its IOS and IOS XE Software Cluster Management and IOS software for Cisco ASR 9000 Series routers. A number of other vulnerabilities also need attention if customers are running Cisco Wireless LAN Controllers. - -The [first critical patch][2] has to do with a vulnerability in the Cisco Cluster Management Protocol (CMP) processing code in Cisco IOS and Cisco IOS XE Software that could allow an unauthenticated, remote attacker to send malformed CMP-specific Telnet options while establishing a Telnet session with an affected Cisco device configured to accept Telnet connections. An exploit could allow an attacker to execute arbitrary code and obtain full control of the device or cause a reload of the affected device, Cisco said. - -**[ Also see[What to consider when deploying a next generation firewall][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** - -The problem has a Common Vulnerability Scoring System number of 9.8 out of 10. - -According to Cisco, the Cluster Management Protocol utilizes Telnet internally as a signaling and command protocol between cluster members. The vulnerability is due to the combination of two factors: - - * The failure to restrict the use of CMP-specific Telnet options only to internal, local communications between cluster members and instead accept and process such options over any Telnet connection to an affected device - * The incorrect processing of malformed CMP-specific Telnet options. - - - -Cisco says the vulnerability can be exploited during Telnet session negotiation over either IPv4 or IPv6. This vulnerability can only be exploited through a Telnet session established _to_ the device; sending the malformed options on Telnet sessions _through_ the device will not trigger the vulnerability. - -The company says there are no workarounds for this problem, but disabling Telnet as an allowed protocol for incoming connections would eliminate the exploit vector. Cisco recommends disabling Telnet and using SSH instead. Information on how to do both can be found on the [Cisco Guide to Harden Cisco IOS Devices][5]. For patch information [go here][6]. - -The second critical patch involves a vulnerability in the sysadmin virtual machine (VM) on Cisco’s ASR 9000 carrier class routers running Cisco IOS XR 64-bit Software could let an unauthenticated, remote attacker access internal applications running on the sysadmin VM, Cisco said in the [advisory][7]. This CVSS also has a 9.8 rating. - -**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][8] ]** - -Cisco said the vulnerability is due to incorrect isolation of the secondary management interface from internal sysadmin applications. An attacker could exploit this vulnerability by connecting to one of the listening internal applications. A successful exploit could result in unstable conditions, including both denial of service (DoS) and remote unauthenticated access to the device, Cisco stated. - -Cisco has released [free software updates][6] that address the vulnerability described in this advisory. - -Lastly, Cisco wrote that [multiple vulnerabilities][9] in the administrative GUI configuration feature of Cisco Wireless LAN Controller (WLC) Software could let an authenticated, remote attacker cause the device to reload unexpectedly during device configuration when the administrator is using this GUI, causing a DoS condition on an affected device. The attacker would need to have valid administrator credentials on the device for this exploit to work, Cisco stated. - -“These vulnerabilities are due to incomplete input validation for unexpected configuration options that the attacker could submit while accessing the GUI configuration menus. An attacker could exploit these vulnerabilities by authenticating to the device and submitting crafted user input when using the administrative GUI configuration feature,” Cisco stated. - -“These vulnerabilities have a Security Impact Rating (SIR) of High because they could be exploited when the software fix for the Cisco Wireless LAN Controller Cross-Site Request Forgery Vulnerability is not in place,” Cisco stated. “In that case, an unauthenticated attacker who first exploits the cross-site request forgery vulnerability could perform arbitrary commands with the privileges of the administrator user by exploiting the vulnerabilities described in this advisory.” - -Cisco has released [software updates][10] that address these vulnerabilities and said that there are no workarounds. - -Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3390159/cisco-warns-wlan-controller-9000-series-router-and-iosxe-users-to-patch-urgent-security-holes.html#tk.rss_all - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/compromised_data_security_breach_vulnerability_by_woolzian_gettyimages-475563052_2400x1600-100788413-large.jpg -[2]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20170317-cmp -[3]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: http://www.cisco.com/c/en/us/support/docs/ip/access-lists/13608-21.html -[6]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html -[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190417-asr9k-exr -[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr -[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190417-wlc-iapp -[10]: https://www.cisco.com/c/en/us/support/web/tsd-cisco-worldwide-contacts.html -[11]: https://www.facebook.com/NetworkWorld/ -[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md b/sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md deleted file mode 100644 index 59978d555c..0000000000 --- a/sources/talk/20190418 Fujitsu completes design of exascale supercomputer, promises to productize it.md +++ /dev/null @@ -1,58 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Fujitsu completes design of exascale supercomputer, promises to productize it) -[#]: via: (https://www.networkworld.com/article/3389748/fujitsu-completes-design-of-exascale-supercomputer-promises-to-productize-it.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Fujitsu completes design of exascale supercomputer, promises to productize it -====== -Fujitsu hopes to be the first to offer exascale supercomputing using Arm processors. -![Riken Advanced Institute for Computational Science][1] - -Fujitsu and Japanese research institute Riken announced the design for the post-K supercomputer, to be launched in 2021, is complete and that they will productize the design for sale later this year. - -The K supercomputer was a massive system, built by Fujitsu and housed at the Riken Advanced Institute for Computational Science campus in Kobe, Japan, with more than 80,000 nodes and using Sparc64 VIIIfx processors, a derivative of the Sun Microsystems Sparc processor developed under a license agreement that pre-dated Oracle buying out Sun in 2010. - -**[ Also read:[10 of the world's fastest supercomputers][2] ]** - -It was ranked as the top supercomputer when it was launched in June 2011 with a computation speed of over 8 petaflops. And in November 2011, K became the first computer to top 10 petaflops. It was eventually surpassed as the world's fastest supercomputer by the IBM’s Sequoia, but even now, eight years later, it’s still in the top 20 of supercomputers in the world. - -### What's in the Post-K supercomputer? - -The new system, dubbed “Post-K,” will feature an Arm-based processor called A64FX, a high-performance CPU developed by Fujitsu, designed for exascale systems. The chip is based off the Arm8 design, which is popular in smartphones, with 48 cores plus four “assistant” cores and the ability to access up to 32GB of memory per chip. - -A64FX is the first CPU to adopt the Scalable Vector Extension (SVE), an instruction set specifically designed for Arm-based supercomputers. Fujitsu claims A64FX will offer a peak double precision (64-bit) floating point operations performance of over 2.7 teraflops per chip. The system will have one CPU per node and 384 nodes per rack. That comes out to one petaflop per rack. - -Contrast that with Summit, the top supercomputer in the world built by IBM for the Oak Ridge National Laboratory using IBM Power9 processors and Nvidia GPUs. A Summit rack has a peak computer of 864 teraflops. - -Let me put it another way: IBM’s Power processor and Nvidia’s Tesla are about to get pwned by a derivative chip to the one in your iPhone. - -**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][3] ]** - -Fujitsu will productize the Post-K design and sell it as the successor to the Fujitsu Supercomputer PrimeHPC FX100. The company said it is also considering measures such as developing an entry-level model that will be easy to deploy, or supplying these technologies to other vendors. - -Post-K will be installed in the Riken Center for Computational Science (R-CCS), where the K computer is currently located. The system will be one of the first exascale supercomputers in the world, although the U.S. and China are certainly gunning to be first if only for bragging rights. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3389748/fujitsu-completes-design-of-exascale-supercomputer-promises-to-productize-it.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/06/riken_advanced_institute_for_computational_science_k-computer_supercomputer_1200x800-100762135-large.jpg -[2]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html -[3]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md b/sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md deleted file mode 100644 index 9685591b2c..0000000000 --- a/sources/talk/20190419 Intel follows AMD-s lead (again) into single-socket Xeon servers.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Intel follows AMD’s lead (again) into single-socket Xeon servers) -[#]: via: (https://www.networkworld.com/article/3390201/intel-follows-amds-lead-again-into-single-socket-xeon-servers.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Intel follows AMD’s lead (again) into single-socket Xeon servers -====== -Intel's new U series of processors are aimed at the low-end market where one processor is good enough. -![Intel][1] - -I’m really starting to wonder who the leader in x86 really is these days because it seems Intel is borrowing another page out of AMD’s playbook. - -Intel launched a whole lot of new Xeon Scalable processors earlier this month, but they neglected to mention a unique line: the U series of single-socket processors. The folks over at Serve The Home sniffed it out first, and Intel has confirmed the existence of the line, just that they “didn’t broadly promote them.” - -**[ Read also:[Intel makes a play for high-speed fiber networking for data centers][2] ]** - -To backtrack a bit, AMD made a major push for [single-socket servers][3] when it launched the Epyc line of server chips. Epyc comes with up to 32 cores and multithreading, and Intel (and Dell) argued that one 32-core/64-thread processor was enough to handle many loads and a lot cheaper than a two-socket system. - -The new U series isn’t available in the regular Intel [ARK database][4] listing of Xeon Scalable processors, but they do show up if you search. Intel says they are looking into that .There are two processors for now, one with 24 cores and two with 20 cores. - -The 24-core Intel [Xeon Gold 6212U][5] will be a counterpart to the Intel Xeon Platinum 8260, with a 2.4GHz base clock speed and a 3.9GHz turbo clock and the ability to access up to 1TB of memory. The Xeon Gold 6212U will have the same 165W TDP as the 8260 line, but with a single socket that’s 165 fewer watts of power. - -Also, Intel is suggesting a price of about $2,000 for the Intel Xeon Gold 6212U, a big discount over the Xeon Platinum 8260’s $4,702 list price. So, that will translate into much cheaper servers. - -The [Intel Xeon Gold 6210U][6] with 20 cores carries a suggested price of $1,500, has a base clock rate of 2.50GHz with turbo boost to 3.9GHz and a 150 watt TDP. Finally, there is the 20-core Intel [Xeon Gold 6209U][7] with a price of around $1,000 that is identical to the 6210 except its base clock speed is 2.1GHz with a turbo boost of 3.9GHz and a TDP of 125 watts due to its lower clock speed. - -**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][8] ]** - -All of the processors support up to 1TB of DDR4-2933 memory and Intel’s Optane persistent memory. - -In terms of speeds and feeds, AMD has a slight advantage over Intel in the single-socket race, and Epyc 2 is rumored to be approaching completion, which will only further advance AMD’s lead. - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3390201/intel-follows-amds-lead-again-into-single-socket-xeon-servers.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/06/intel_generic_cpu_background-100760187-large.jpg -[2]: https://www.networkworld.com/article/3307852/intel-makes-a-play-for-high-speed-fiber-networking-for-data-centers.html -[3]: https://www.networkworld.com/article/3253626/amd-lands-dell-as-its-latest-epyc-server-processor-customer.html -[4]: https://ark.intel.com/content/www/us/en/ark/products/series/192283/2nd-generation-intel-xeon-scalable-processors.html -[5]: https://ark.intel.com/content/www/us/en/ark/products/192453/intel-xeon-gold-6212u-processor-35-75m-cache-2-40-ghz.html -[6]: https://ark.intel.com/content/www/us/en/ark/products/192452/intel-xeon-gold-6210u-processor-27-5m-cache-2-50-ghz.html -[7]: https://ark.intel.com/content/www/us/en/ark/products/193971/intel-xeon-gold-6209u-processor-27-5m-cache-2-10-ghz.html -[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md b/sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md deleted file mode 100644 index 90f4ebf5f1..0000000000 --- a/sources/talk/20190424 IoT roundup- VMware, Nokia beef up their IoT.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (IoT roundup: VMware, Nokia beef up their IoT) -[#]: via: (https://www.networkworld.com/article/3390682/iot-roundup-vmware-nokia-beef-up-their-iot.html#tk.rss_all) -[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - -IoT roundup: VMware, Nokia beef up their IoT -====== -Everyone wants in on the ground floor of the internet of things, and companies including Nokia, VMware and Silicon Labs are sharpening their offerings in anticipation of further growth. -![Getty Images][1] - -When attempting to understand the world of IoT, it’s easy to get sidetracked by all the fascinating use cases: Automated oil and gas platforms! Connected pet feeders! Internet-enabled toilets! (Is “the Internet of Toilets” a thing yet?) But the most important IoT trend to follow may be the way that major tech vendors are vying to make large portions of the market their own. - -VMware’s play for a significant chunk of the IoT market is called Pulse IoT Center, and the company released version 2.0 of it this week. It follows the pattern set by other big companies getting into IoT: Leveraging their existing technological strengths and applying them to the messier, more heterodox networking environment that IoT represents. - -Unsurprisingly, given that it’s VMware we’re talking about, there’s now a SaaS option, and the company was also eager to talk up that Pulse IoT Center 2.0 has simplified device-onboarding and centralized management features. - -**More about edge networking** - - * [How edge networking and IoT will reshape data centers][2] - * [Edge computing best practices][3] - * [How edge computing can help secure the IoT][4] - - - -That might sound familiar, and for good reason – companies with any kind of a background in network management, from HPE/Aruba to Amazon, have been pushing to promote their system as the best framework for managing a complicated and often decentralized web of IoT devices from a single platform. By rolling features like software updates, onboarding and security into a single-pane-of-glass management console, those companies are hoping to be the organizational base for customers trying to implement IoT. - -Whether they’re successful or not remains to be seen. While major IT companies have been trying to capture market share by competing across multiple verticals, the operational orientation of the IoT also means that non-traditional tech vendors with expertise in particular fields (particularly industrial and automotive) are suddenly major competitors. - -**Nokia spreads the IoT network wide** - -As a giant carrier-equipment vendor, Nokia is an important company in the overall IoT landscape. While some types of enterprise-focused IoT are heavily localized, like connected factory floors or centrally managed office buildings, others are so geographically disparate that carrier networks are the only connectivity medium that makes sense. - -The Finnish company earlier this month broadened its footprint in the IoT space, announcing that it had partnered with Nordic Telecom to create a wide-area network focused on enabling IoT and emergency services. The network, which Nokia is billing as the first mission-critical communications network, operates using LTE technology in the 410-430MHz band – a relatively low frequency, which allows for better propagation and a wide effective range. - -The idea is to provide a high-throughput, low-latency network option to any user on the network, whether it’s an emergency services provider needing high-speed video communication or an energy or industrial company with a low-delay-tolerance application. - -**Silicon Labs packs more onto IoT chips** - -The heart of any IoT implementation remains the SoCs that make devices intelligent in the first place, and Silicon Labs announced that it's building more muscle into its IoT-focused product lineup. - -The Austin-based chipmaker said that version 2 of its Wireless Gecko platform will pack more than double the wireless connectivity range of previous entries, which could seriously ease design requirements for companies planning out IoT deployments. The chipsets support Zigbee, Thread and Bluetooth mesh networking, and are designed for line-powered IoT devices, using Arm Cortex-M33 processors for relatively strong computing capacity and high energy efficiency. - -Chipset advances aren’t the type of thing that will pay off immediately in terms of making IoT devices more capable, but improvements like these make designing IoT endpoints for particular uses that much easier, and new SoCs will begin to filter into line-of-business equipment over time. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3390682/iot-roundup-vmware-nokia-beef-up-their-iot.html#tk.rss_all - -作者:[Jon Gold][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Jon-Gold/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/08/nw_iot-news_internet-of-things_smart-city_smart-home5-100768494-large.jpg -[2]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html -[3]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html -[4]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md b/sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md deleted file mode 100644 index 8d3ad041db..0000000000 --- a/sources/talk/20190425 Dell EMC and Cisco renew converged infrastructure alliance.md +++ /dev/null @@ -1,52 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Dell EMC and Cisco renew converged infrastructure alliance) -[#]: via: (https://www.networkworld.com/article/3391071/dell-emc-and-cisco-renew-converged-infrastructure-alliance.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Dell EMC and Cisco renew converged infrastructure alliance -====== -Dell EMC and Cisco renewed their agreement to collaborate on converged infrastructure (CI) products for a few more years even though the momentum is elsewhere. -![Dell EMC][1] - -Dell EMC and Cisco have renewed a collaboration on converged infrastructure (CI) products that has run for more than a decade, even as the momentum shifts elsewhere. The news was announced via a [blog post][2] by Pete Manca, senior vice president for solutions engineering at Dell EMC. - -The deal is centered around Dell EMC’s VxBlock product line, which originally started out in 2009 as a joint venture between EMC and Cisco called VCE (Virtual Computing Environment). EMC bought out Cisco’s stake in the venture before Dell bought EMC. - -The devices offered UCS servers and networking from Cisco, EMC storage, and VMware virtualization software in pre-configured, integrated bundles. VCE was retired in favor of new brands, VxBlock, VxRail, and VxRack. The lineup has been pared down to one device, the VxBlock 1000. - -**[ Read also:[How to plan a software-defined data-center network][3] ]** - -“The newly inked agreement entails continued company alignment across multiple organizations: executive, product development, marketing, and sales,” Manca wrote in the blog post. “This means we’ll continue to share product roadmaps and collaborate on strategic development activities, with Cisco investing in a range of Dell EMC sales, marketing and training initiatives to support VxBlock 1000.” - -Dell EMC cites IDC research that it holds a 48% market share in converged systems, nearly 1.5 times that of any other vendor. But IDC's April edition of the Converged Systems Tracker said the CI category is on the downswing. CI sales fell 6.4% year over year, while the market for hyperconverged infrastructure (HCI) grew 57.2% year over year. - -For the unfamiliar, the primary difference between converged and hyperconverged infrastructure is that CI relies on hardware building blocks, while HCI is software-defined and considered more flexible and scalable than CI and operates more like a cloud system with resources spun up and down as needed. - -Despite this, Dell is committed to CI systems. Just last month it announced an update and expansion of the VxBlock 1000, including higher scalability, a broader choice of components, and the option to add new technologies. It featured updated VMware vRealize and vSphere support, the option to consolidate high-value, mission-critical workloads with new storage and data protection options and support for Cisco UCS fabric and servers. - -For customers who prefer to build their own infrastructure solutions, Dell EMC introduced Ready Stack, a portfolio of validated designs with sizing, design, and deployment resources that offer VMware-based IaaS, vSphere on Dell EMC PowerEdge servers and Dell EMC Unity storage, and Microsoft Hyper-V on Dell EMC PowerEdge servers and Dell EMC Unity storage. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3391071/dell-emc-and-cisco-renew-converged-infrastructure-alliance.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/04/dell-emc-vxblock-1000-100794721-large.jpg -[2]: https://blog.dellemc.com/en-us/dell-technologies-cisco-reaffirm-joint-commitment-converged-infrastructure/ -[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md b/sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md deleted file mode 100644 index 965d2a0e51..0000000000 --- a/sources/talk/20190429 Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600) -[#]: via: (https://www.networkworld.com/article/3391580/venerable-cisco-catalyst-6000-switches-ousted-by-new-catalyst-9600.html#tk.rss_all) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Venerable Cisco Catalyst 6000 switches ousted by new Catalyst 9600 -====== -Cisco introduced Catalyst 9600 switches, that let customers automate, set policy, provide security and gain assurance across wired and wireless networks. -![Martyn Williams][1] - -Few events in the tech industry are truly transformative, but Cisco’s replacement of its core Catalyst 6000 family could be one of those actions for customers and the company. - -Introduced in 1999, [iterations of the Catalyst 6000][2] have nestled into the core of scores of enterprise networks, with the model 6500 becoming the company’s largest selling box ever. - -**Learn about edge networking** - - * [How edge networking and IoT will reshape data centers][3] - * [Edge computing best practices][4] - * [How edge computing can help secure the IoT][5] - - - -It goes without question that migrating these customers alone to the new switch – the Catalyst 9600 which the company introduced today – will be of monumental importance to Cisco as it looks to revamp and continue to dominate large campus-core deployments. The first [Catalyst 9000][6], introduced in June 2017, is already the fastest ramping product line in Cisco’s history. - -“There are at least tens of thousands of Cat 6000s running in campus cores all over the world,” said [Sachin Gupta][7], senior vice president for product management at Cisco. ”It is the Swiss Army knife of switches in term of features, and we have taken great care and over two years developing feature parity and an easy migration path for those users to the Cat 9000.” - -Indeed the 9600 brings with it for Cat 6000 features such as support for MPLS, virtual switching and IPv6, while adding or bolstering support for newer items such as Intent-based networking (IBN), wireless networks and security segmentation. Strategically the 9600 helps fill out the company’s revamped lineup which includes the 9200 family of access switches, the [9500][8] aggregation switch and [9800 wireless controller.][9] - -Some of the nitty-gritty details about the 9600: - - * It is a purpose-built 40 Gigabit and 100 Gigabit Ethernet line of modular switches targeted for the enterprise campus with a wired switching capacity of up to 25.6 Tbps, with up to 6.4 Tbps of bandwidth per slot. - * The switch supports granular port densities that fit diverse campus needs, including nonblocking 40 Gigabit and 100 Gigabit Ethernet Quad Small Form-Factor Pluggable (QSFP+, QSFP28) and 1, 10, and 25 GE Small Form-Factor Pluggable Plus (SFP, SFP+, SFP28). - * It can be configured to support up to 48 nonblocking 100 Gigabit Ethernet QSPF28 ports with the Cisco Catalyst 9600 Series Supervisor Engine 1; Up to 96 nonblocking 40 Gigabit Ethernet QSFP+ ports with the Cisco Catalyst 9600 Series Supervisor Engine 1 and Up to 192 nonblocking 25 Gigabit/10 Gigabit Ethernet SFP28/SFP+ ports with the Cisco Catalyst 9600 Series Supervisor Engine 1. - * It supports advanced routing and infrastructure services (MPLS, Layer 2 and Layer 3 VPNs, Multicast VPN, and Network Address Translation. - * Cisco Software-Defined Access capabilities (such as a host-tracking database, cross-domain connectivity, and VPN Routing and Forwarding [VRF]-aware Locator/ID Separation Protocol; and network system virtualization with Cisco StackWise virtual technology. - - - -The 9600 series runs Cisco’s IOS XE software which now runs across all Catalyst 9000 family members. The software brings with it support for other key products such as Cisco’s [DNA Center][10] which controls automation capabilities, assurance setting, fabric provisioning and policy-based segmentation for enterprise networks. What that means is that with one user interface, DNA Center, customers can automate, set policy, provide security and gain assurance across the entire wired and wireless network fabric, Gupta said. - -“The 9600 is a big deal for Cisco and customers as it brings together the campus core and lets users establish standards access and usage policies across their wired and wireless environments,” said Brandon Butler, a senior research analyst with IDC. “It was important that Cisco add a powerful switch to handle the increasing amounts of traffic wireless and cloud applications are bringing to the network.” - -IOS XE brings with it automated device provisioning and a wide variety of automation features including support for the network configuration protocol NETCONF and RESTCONF using YANG data models. The software offers near-real-time monitoring of the network, leading to quick detection and rectification of failures, Cisco says. - -The software also supports hot patching which provides fixes for critical bugs and security vulnerabilities between regular maintenance releases. This support lets customers add patches without having to wait for the next maintenance release, Cisco says. - -As with the rest of the Catalyst family, the 9600 is available via subscription-based licensing. Cisco says the [base licensing package][11] includes Network Advantage licensing options that are tied to the hardware. The base licensing packages cover switching fundamentals, management automation, troubleshooting, and advanced switching features. These base licenses are perpetual. - -An add-on licensing package includes the Cisco DNA Premier and Cisco DNA Advantage options. The Cisco DNA add-on licenses are available as a subscription. - -IDC’S Butler noted that there are competitors such as Ruckus, Aruba and Extreme that offer switches capable of melding wired and wireless environments. - -The new switch is built for the next two decades of networking, Gupta said. “If any of our competitors though they could just go in and replace the Cat 6k they were misguided.” - -Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3391580/venerable-cisco-catalyst-6000-switches-ousted-by-new-catalyst-9600.html#tk.rss_all - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2017/02/170227-mwc-02759-100710709-large.jpg -[2]: https://www.networkworld.com/article/2289826/133715-The-illustrious-history-of-Cisco-s-Catalyst-LAN-switches.html -[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html -[4]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html -[5]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html -[6]: https://www.networkworld.com/article/3256264/cisco-ceo-we-are-still-only-on-the-front-end-of-a-new-version-of-the-network.html -[7]: https://blogs.cisco.com/enterprise/looking-forward-catalyst-9600-switch-and-9100-access-point-meraki -[8]: https://www.networkworld.com/article/3202105/cisco-brings-intent-based-networking-to-the-end-to-end-network.html -[9]: https://www.networkworld.com/article/3321000/cisco-links-wireless-wired-worlds-with-new-catalyst-9000-switches.html -[10]: https://www.networkworld.com/article/3280988/cisco/cisco-opens-dna-center-network-control-and-management-software-to-the-devops-masses.html -[11]: https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9600/software/release/16-11/release_notes/ol-16-11-9600.html#id_67835 -[12]: https://www.facebook.com/NetworkWorld/ -[13]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190327 HPE introduces hybrid cloud consulting business.md b/sources/tech/20190327 HPE introduces hybrid cloud consulting business.md deleted file mode 100644 index f1d9d3564f..0000000000 --- a/sources/tech/20190327 HPE introduces hybrid cloud consulting business.md +++ /dev/null @@ -1,59 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (HPE introduces hybrid cloud consulting business) -[#]: via: (https://www.networkworld.com/article/3384919/hpe-introduces-hybrid-cloud-consulting-business.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -HPE introduces hybrid cloud consulting business -====== - -### HPE's Right Mix Advisor is designed to find a balance between on-premises and cloud systems. - -![Hewlett Packard Enterprise][1] - -Hybrid cloud is pretty much the de facto way to go, with only a few firms adopting a pure cloud play to replace their data center and only suicidal firms refusing to go to the cloud. But picking the right balance between on-premises and the cloud is tricky, and a mistake can be costly. - -Enter Right Mix Advisor from Hewlett Packard Enterprise, a combination of consulting from HPE's Pointnext division and software tools. It draws on quite a bit of recent acquisitions. Another part of Right Mix Advisor is a British cloud consultancy RedPixie, Amazon Web Services (AWS) specialists Cloud Technology Partners, and automated discovery capabilities from an Irish startup iQuate. - -Right Mix Advisor gathers data points from the company’s entire enterprise, ranging from configuration management database systems (CMDBs), such as ServiceNow, to external sources, such as cloud providers. HPE says that in a recent customer engagement it scanned 9 million IP addresses across six data centers. - -**[ Read also:[What is hybrid cloud computing][2]. | Learn [what you need to know about multi-cloud][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** - -HPE Pointnext consultants then work with the client’s IT teams to analyze the data to determine the optimal configuration for workload placement. Pointnext has become HPE’s main consulting outfit following its divestiture of EDS, which it acquired in 2008 but spun off in a merger with CSC to form DXC Consulting. Pointnext now has 25,000 consultants in 88 countries. - -In a typical engagement, HPE claims it can deliver a concrete action plan within weeks, whereas previously businesses may have needed months to come to a conclusion using a manual processes. HPE has found migrating the right workloads to the right mix of hybrid cloud can typically result in 40 percent total cost of ownership savings*. * - -Although HPE has thrown its weight behind AWS, that doesn’t mean it doesn’t support competitors. Erik Vogel, vice president of hybrid IT for HPE Pointnext, notes in the blog post announcing Right Mix Advisor that target environments could be Microsoft Azure or Azure Stack, AWS, Google or Ali Cloud. - -“New service providers are popping up every day, and we see the big public cloud providers constantly producing new services and pricing models. As a result, the calculus for determining your right mix is constantly changing. If Azure, for example, offers a new service capability or a 10 percent pricing discount and it makes sense to leverage it, you want to be able to move an application seamlessly into that new environment,” he wrote. - -Key to Right Mix Advisor is app migration, and Pointnext follows the 50/30/20 rule: About 50 percent of apps are suitable for migration to the cloud, and for about 30 percent, migration is not a good choice for migration to be worth the effort. The remaining 20 percent should be retired. - -“With HPE Right Mix Advisor, you can identify that 50 percent,” he wrote. “Rather than hand you a laundry list of 10,000 apps to start migrating, HPE Right Mix Advisor hones in on what’s most impactful right now to meet your business goals – the 10 things you can do on Monday morning that you can be confident will really help your business.” - -HPE has already done some pilot projects with the Right Mix service and expects to expand it to include channel partners. - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3384919/hpe-introduces-hybrid-cloud-consulting-business.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2015/11/hpe_building-100625424-large.jpg -[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html -[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190328 Cisco warns of two security patches that don-t work, issues 17 new ones for IOS flaws.md b/sources/tech/20190328 Cisco warns of two security patches that don-t work, issues 17 new ones for IOS flaws.md deleted file mode 100644 index 27370bf294..0000000000 --- a/sources/tech/20190328 Cisco warns of two security patches that don-t work, issues 17 new ones for IOS flaws.md +++ /dev/null @@ -1,72 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Cisco warns of two security patches that don’t work, issues 17 new ones for IOS flaws) -[#]: via: (https://www.networkworld.com/article/3384742/cisco-warns-of-two-security-patches-that-dont-work-issues-17-new-ones-for-ios-flaws.html#tk.rss_all) -[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) - -Cisco warns of two security patches that don’t work, issues 17 new ones for IOS flaws -====== - -### Cisco is issuing 17 new fixes for security problems with IOS and IOS/XE software that runs most of its routers and switches, while it has no patch yet to replace flawed patches to RV320 and RV 325 routers. - -![Marisa9 / Getty][1] - -Cisco has dropped [17 Security advisories describing 19 vulnerabilities][2] in the software that runs most of its routers and switches, IOS and IOS/XE. - -The company also announced that two previously issued patches for its RV320 and RV325 Dual Gigabit WAN VPN Routers were “incomplete” and would need to be redone and reissued. - -**[ Also see[What to consider when deploying a next generation firewall][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** - -Cisco rates both those router vulnerabilities as “High” and describes the problems like this: - - * [One vulnerability][5] is due to improper validation of user-supplied input. An attacker could exploit this vulnerability by sending malicious HTTP POST requests to the web-based management interface of an affected device. A successful exploit could allow the attacker to execute arbitrary commands on the underlying Linux shell as _root_. - * The [second exposure][6] is due to improper access controls for URLs. An attacker could exploit this vulnerability by connecting to an affected device via HTTP or HTTPS and requesting specific URLs. A successful exploit could allow the attacker to download the router configuration or detailed diagnostic information. - - - -Cisco said firmware updates that address these vulnerabilities are not available and no workarounds exist, but is working on a complete fix for both. - -On the IOS front, the company said six of the vulnerabilities affect both Cisco IOS Software and Cisco IOS XE Software, one of the vulnerabilities affects just Cisco IOS software and ten of the vulnerabilities affect just Cisco IOS XE software. Some of the security bugs, which are all rated as “High”, include: - - * [A vulnerability][7] in the web UI of Cisco IOS XE Software could let an unauthenticated, remote attacker access sensitive configuration information. - * [A vulnerability][8] in Cisco IOS XE Software could let an authenticated, local attacker inject arbitrary commands that are executed with elevated privileges. The vulnerability is due to insufficient input validation of commands supplied by the user. An attacker could exploit this vulnerability by authenticating to a device and submitting crafted input to the affected commands. - * [A weakness][9] in the ingress traffic validation of Cisco IOS XE Software for Cisco Aggregation Services Router (ASR) 900 Route Switch Processor 3 could let an unauthenticated, adjacent attacker trigger a reload of an affected device, resulting in a denial of service (DoS) condition, Cisco said. The vulnerability exists because the software insufficiently validates ingress traffic on the ASIC used on the RSP3 platform. An attacker could exploit this vulnerability by sending a malformed OSPF version 2 message to an affected device. - * A problem in the [authorization subsystem][10] of Cisco IOS XE Software could allow an authenticated but unprivileged (level 1), remote attacker to run privileged Cisco IOS commands by using the web UI. The vulnerability is due to improper validation of user privileges of web UI users. An attacker could exploit this vulnerability by submitting a malicious payload to a specific endpoint in the web UI, Cisco said. - * A vulnerability in the [Cluster Management Protocol][11] (CMP) processing code in Cisco IOS Software and Cisco IOS XE Software could allow an unauthenticated, adjacent attacker to trigger a DoS condition on an affected device. The vulnerability is due to insufficient input validation when processing CMP management packets, Cisco said. - - - -Cisco has released free software updates that address the vulnerabilities described in these advisories and [directs users to their software agreements][12] to find out how they can download the fixes. - -Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3384742/cisco-warns-of-two-security-patches-that-dont-work-issues-17-new-ones-for-ios-flaws.html#tk.rss_all - -作者:[Michael Cooney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Michael-Cooney/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2019/02/woman-with-hands-over-face_mistake_oops_embarrassed_shy-by-marisa9-getty-100787990-large.jpg -[2]: https://tools.cisco.com/security/center/viewErp.x?alertId=ERP-71135 -[3]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html -[4]: https://www.networkworld.com/newsletters/signup.html -[5]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190123-rv-inject -[6]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190123-rv-info -[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190327-xeid -[8]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190327-xecmd -[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190327-rsp3-ospf -[10]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190327-iosxe-privesc -[11]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190327-cmp-dos -[12]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html -[13]: https://www.facebook.com/NetworkWorld/ -[14]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md b/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md deleted file mode 100644 index 19b5926e27..0000000000 --- a/sources/tech/20190402 Announcing the release of Fedora 30 Beta.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Announcing the release of Fedora 30 Beta) -[#]: via: (https://fedoramagazine.org/announcing-the-release-of-fedora-30-beta/) -[#]: author: (Ben Cotton https://fedoramagazine.org/author/bcotton/) - -Announcing the release of Fedora 30 Beta -====== - -![][1] - -The Fedora Project is pleased to announce the immediate availability of Fedora 30 Beta, the next big step on our journey to the exciting Fedora 30 release. - -Download the prerelease from our Get Fedora site: - - * [Get Fedora 30 Beta Workstation][2] - * [Get Fedora 30 Beta Server][3] - * [Get Fedora 30 Beta Silverblue][4] - - - -Or, check out one of our popular variants, including KDE Plasma, Xfce, and other desktop environments, as well as images for ARM devices like the Raspberry Pi 2 and 3: - - * [Get Fedora 30 Beta Spins][5] - * [Get Fedora 30 Beta Labs][6] - * [Get Fedora 30 Beta ARM][7] - - - -### Beta Release Highlights - -#### New desktop environment options - -Fedora 30 Beta includes two new options for desktop environment. [DeepinDE][8] and [Pantheon Desktop][9] join GNOME, KDE Plasma, Xfce, and others as options for users to customize their Fedora experience. - -#### DNF performance improvements - -All dnf repository metadata for Fedora 30 Beta is compressed with the zchunk format in addition to xz or gzip. zchunk is a new compression format designed to allow for highly efficient deltas. When Fedora’s metadata is compressed using zchunk, dnf will download only the differences between any earlier copies of the metadata and the current version. - -#### GNOME 3.32 - -Fedora 30 Workstation Beta includes GNOME 3.32, the latest version of the popular desktop environment. GNOME 3.32 features updated visual style, including the user interface, the icons, and the desktop itself. For a full list of GNOME 3.32 highlights, see the [release notes][10]. - -#### Other updates - -Fedora 30 Beta also includes updated versions of many popular packages like Golang, the Bash shell, the GNU C Library, Python, and Perl. For a full list, see the [Change set][11] on the Fedora Wiki. In addition, many Python 2 packages are removed in preparation for Python 2 end-of-life on 2020-01-01. - -#### Testing needed - -Since this is a Beta release, we expect that you may encounter bugs or missing features. To report issues encountered during testing, contact the Fedora QA team via the mailing list or in #fedora-qa on Freenode. As testing progresses, common issues are tracked on the [Common F30 Bugs page][12]. - -For tips on reporting a bug effectively, read [how to file a bug][13]. - -#### What is the Beta Release? - -A Beta release is code-complete and bears a very strong resemblance to the final release. If you take the time to download and try out the Beta, you can check and make sure the things that are important to you are working. Every bug you find and report doesn’t just help you, it improves the experience of millions of Fedora users worldwide! Together, we can make Fedora rock-solid. We have a culture of coordinating new features and pushing fixes upstream as much as we can. Your feedback improves not only Fedora, but Linux and free software as a whole. - -#### More information - -For more detailed information about what’s new on Fedora 30 Beta release, you can consult the [Fedora 30 Change set][11]. It contains more technical information about the new packages and improvements shipped with this release. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/announcing-the-release-of-fedora-30-beta/ - -作者:[Ben Cotton][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/bcotton/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/f30-beta-816x345.jpg -[2]: https://getfedora.org/workstation/prerelease/ -[3]: https://getfedora.org/server/prerelease/ -[4]: https://silverblue.fedoraproject.org/download -[5]: https://spins.fedoraproject.org/prerelease -[6]: https://labs.fedoraproject.org/prerelease -[7]: https://arm.fedoraproject.org/prerelease -[8]: https://www.deepin.org/en/dde/ -[9]: https://www.fosslinux.com/4652/pantheon-everything-you-need-to-know-about-the-elementary-os-desktop.htm -[10]: https://help.gnome.org/misc/release-notes/3.32/ -[11]: https://fedoraproject.org/wiki/Releases/30/ChangeSet -[12]: https://fedoraproject.org/wiki/Common_F30_bugs -[13]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ diff --git a/sources/tech/20190403 How to rebase to Fedora 30 Beta on Silverblue.md b/sources/tech/20190403 How to rebase to Fedora 30 Beta on Silverblue.md deleted file mode 100644 index 892afff5d6..0000000000 --- a/sources/tech/20190403 How to rebase to Fedora 30 Beta on Silverblue.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to rebase to Fedora 30 Beta on Silverblue) -[#]: via: (https://fedoramagazine.org/how-to-rebase-to-fedora-30-beta-on-silverblue/) -[#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/) - -How to rebase to Fedora 30 Beta on Silverblue -====== - -![][1] - -Silverblue is [an operating system for your desktop built on Fedora][2]. It’s excellent for daily use, development, and container-based workflows. It offers [numerous advantages][3] such as being able to roll back in case of any problems. If you want to test Fedora 30 on your Silverblue system, this article tells you how. It not only shows you what to do, but also how to revert back if anything unforeseen happens. - -### Switching to Fedora 30 branch - -Switching to Fedora 30 on Silverblue is easy. First, check if the _30_ branch is available, which should be true now: - -``` -ostree remote refs fedora-workstation -``` - -You should see the following in the output: - -``` -fedora-workstation:fedora/30/x86_64/silverblue -``` - -Next, import the GPG key for the Fedora 30 branch. Without this step, you won’t be able to rebase. - -``` -sudo ostree remote gpg-import fedora-workstation -k /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-30-primary -``` - -Next, rebase your system to the Fedora 30 branch. - -``` -rpm-ostree rebase fedora-workstation:fedora/30/x86_64/silverblue -``` - -Finally, the last thing to do is restart your computer and boot to Fedora 30. - -### How to revert things back - -Remember that Fedora 30’s still in beta testing phase, so there could still be some issues. If anything bad happens — for instance, if you can’t boot to Fedora 30 at all — it’s easy to go back. Just pick the previous entry in GRUB, and your system will start in its previous state before switching to Fedora 30. To make this change permanent, use the following command: - -``` -rpm-ostree rollback -``` - -That’s it. Now you know how to rebase to Fedora 30 and back. So why not test it today? 🙂 - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/how-to-rebase-to-fedora-30-beta-on-silverblue/ - -作者:[Michal Konečný][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/zlopez/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/silverblue-f30beta-816x345.jpg -[2]: https://docs.fedoraproject.org/en-US/fedora-silverblue/ -[3]: https://fedoramagazine.org/give-fedora-silverblue-a-test-drive/ diff --git a/sources/tech/20190409 The Microsoft-BMW IoT Open Manufacturing Platform might not be so open.md b/sources/tech/20190409 The Microsoft-BMW IoT Open Manufacturing Platform might not be so open.md deleted file mode 100644 index c74f61efe4..0000000000 --- a/sources/tech/20190409 The Microsoft-BMW IoT Open Manufacturing Platform might not be so open.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The Microsoft/BMW IoT Open Manufacturing Platform might not be so open) -[#]: via: (https://www.networkworld.com/article/3387642/the-microsoftbmw-iot-open-manufacturing-platform-might-not-be-so-open.html#tk.rss_all) -[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) - -The Microsoft/BMW IoT Open Manufacturing Platform might not be so open -====== -The new industrial IoT Open Manufacturing Platform from Microsoft and BMW runs only on Microsoft Azure. That could be an issue. -![Martyn Williams][1] - -Last week at [Hannover Messe][2], Microsoft and German carmaker BMW announced a partnership to build a hardware and software technology framework and reference architecture for the industrial internet of things (IoT), and foster a community to spread these smart-factory solutions across the automotive and manufacturing industries. - -The stated goal of the [Open Manufacturing Platform (OMP)][3]? According to the press release, it's “to drive open industrial IoT development and help grow a community to build future [Industry 4.0][4] solutions.” To make that a reality, the companies said that by the end of 2019, they plan to attract four to six partners — including manufacturers and suppliers from both inside and outside the automotive industry — and to have rolled out at least 15 use cases operating in actual production environments. - -**[ Read also:[An inside look at an IIoT-powered smart factory][5] | Get regularly scheduled insights: [Sign up for Network World newsletters][6] ]** - -### Complex and proprietary is bad for IoT - -It sounds like a great idea, right? As the companies rightly point out, many of today’s industrial IoT solutions rely on “complex, proprietary systems that create data silos and slow productivity.” Who wouldn’t want to “standardize data models that enable analytics and machine learning scenarios” and “accelerate future industrial IoT developments, shorten time to value, and drive production efficiencies while addressing common industrial challenges”? - -But before you get too excited, let’s talk about a key word in the effort: open. As Scott Guthrie, executive vice president of Microsoft Cloud + AI Group, said in a statement, "Our commitment to building an open community will create new opportunities for collaboration across the entire manufacturing value chain." - -### The Open Manufacturing Platform is open only to Microsoft Azure - -However, that will happen as long as all that collaboration occurs in Microsoft Azure. I’m not saying Azure isn’t up to the task, but it’s hardly the only (or even the leading) cloud platform interested in the industrial IoT. Putting everything in Azure might be an issue to those potential OMP partners. It’s an “open” question as to how many companies already invested in Amazon Web Services (AWS) or the Google Cloud Platform (GCP) will be willing to make the switch or go multi-cloud just to take advantage of the OMP. - -My guess is that Microsoft and BMW won’t have too much trouble meeting their initial goals for the OMP. It shouldn’t be that hard to get a handful of existing Azure customers to come up with 15 use cases leveraging advances in analytics, artificial intelligence (AI), and digital feedback loops. (As an example, the companies cited the autonomous transport systems in BMW’s factory in Regensburg, Germany, part of the more than 3,000 machines, robots and transport systems connected with the BMW Group’s IoT platform, which — naturally — is built on Microsoft Azure's cloud.) - -### Will non-Azure users jump on board the OMP? - -The question is whether tying all this to a single cloud provider will affect the effort to attract enough new companies — including companies not currently using Azure — to establish a truly viable open platform? - -Perhaps [Stacey Higginbotham at Stacy on IoT put it best][7]: - -> “What they really launched is a reference design for manufacturers to work from.” - -That’s not nothing, of course, but it’s a lot less ambitious than building a new industrial IoT platform. And it may not easily fulfill the vision of a community working together to create shared solutions that benefit everyone. - -**[ Now read this:[Why are IoT platforms so darn confusing?][8] ]** - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3387642/the-microsoftbmw-iot-open-manufacturing-platform-might-not-be-so-open.html#tk.rss_all - -作者:[Fredric Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Fredric-Paul/ -[b]: https://github.com/lujun9972 -[1]: https://images.techhive.com/images/article/2017/01/20170107_105344-100702818-large.jpg -[2]: https://www.hannovermesse.de/home -[3]: https://www.prnewswire.co.uk/news-releases/microsoft-and-the-bmw-group-launch-the-open-manufacturing-platform-859672858.html -[4]: https://en.wikipedia.org/wiki/Industry_4.0 -[5]: https://www.networkworld.com/article/3384378/an-inside-look-at-tempo-automations-iiot-powered-smart-factory.html -[6]: https://www.networkworld.com/newsletters/signup.html -[7]: https://mailchi.mp/iotpodcast/stacey-on-iot-industrial-iot-reminds-me-of-apples-ecosystem?e=6bf9beb394 -[8]: https://www.networkworld.com/article/3336166/why-are-iot-platforms-so-darn-confusing.html -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md b/sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md deleted file mode 100644 index 3d158c7031..0000000000 --- a/sources/tech/20190430 The Awesome Fedora 30 is Here- Check Out the New Features.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The Awesome Fedora 30 is Here! Check Out the New Features) -[#]: via: (https://itsfoss.com/fedora-30/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -The Awesome Fedora 30 is Here! Check Out the New Features -====== - -The latest and greatest release of Fedora is here. Fedora 30 brings some visual as well as performance improvements. - -Fedora releases a new version every six months and each release is supported for thirteen months. - -Before you decide to download or upgrade Fedora, let’s first see what’s new in Fedora 30. - -### New Features in Fedora 30 - -![Fedora 30 Release][1] - -Here’s what’s new in the latest release of Fedora. - -#### GNOME 3.32 gives a brand new look, features and performance improvement - -A lot of visual improvements is brought by the latest release of GNOME. - -GNOME 3.32 has refreshed new icons and UI and it almost looks like a brand new version of GNOME. - -![Gnome 3.32 icons | Image Credit][2] - -GNOME 3.32 also brings several other features like fractional scaling, permission control for each application, granular control on Night Light intensity among many other changes. - -GNOME 3.32 also brings some performance improvements. You’ll see faster file and app searches and a smoother scrolling. - -#### Improved performance for DNF - -Fedora 30 will see a faster [DNF][3] (the default package manager for Fedora) thanks to the [zchunk][4] compression algorithm. - -The zchunk algorithm splits the file into independent chunks. This helps in dealing with ‘delta’ or changes as you download only the changed chunks while downloading the new version of a file. - -With zcunk, dnf will only download the difference between the metadata of the current version and the earlier versions. - -#### Fedora 30 brings two new desktop environments into the fold - -Fedora already offers several desktop environment choices. Fedora 30 extends the offering with [elementary OS][5]‘ Pantheon desktop environment and Deepin Linux’ [DeepinDE][6]. - -So now you can enjoy the looks and feel of elementary OS and Deepin Linux in Fedora. How cool is that! - -#### Linux Kernel 5 - -Fedora 29 has Linux Kernel 5.0.9 version that has improved support for hardware and some performance improvements. You may check out the [features of Linux kernel 5.0 in this article][7]. - -[][8] - -Suggested read The Featureful Release of Nextcloud 14 Has Two New Security Features - -#### Updated software - -You’ll also get newer versions of software. Some of the major ones are: - - * GCC 9.0.1 - * [Bash Shell 5.0][9] - * GNU C Library 2.29 - * Ruby 2.6 - * Golang 1.12 - * Mesa 19.0.2 - - - * Vagrant 2.2 - * JDK12 - * PHP 7.3 - * Fish 3.0 - * Erlang 21 - * Python 3.7.3 - - - -### Getting Fedora 30 - -If you are already using Fedora 29 then you can upgrade to the latest release from your current install. You may follow this guide to learn [how to upgrade a Fedora version][10]. - -Fedora 29 users will still get the updates for seven more months so if you don’t feel like upgrading, you may skip it for now. Fedora 28 users have no choice because Fedora 28 reached end of life next month which means there will be no security or maintenance update anymore. Upgrading to a newer version is no longer a choice. - -You always has the option to download the ISO of Fedora 30 and install it afresh. You can download Fedora from its official website. It’s only available for 64-bit systems and the ISO is 1.9 GB in size. - -[Download Fedora 30 Workstation][11] - -What do you think of Fedora 30? Are you planning to upgrade or at least try it out? Do share your thoughts in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/fedora-30/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/wp-content/uploads/2019/04/fedora-30-release-800x450.png -[2]: https://itsfoss.com/wp-content/uploads/2019/04/gnome-3-32-icons.png -[3]: https://fedoraproject.org/wiki/DNF?rd=Dnf -[4]: https://github.com/zchunk/zchunk -[5]: https://itsfoss.com/elementary-os-juno-features/ -[6]: https://www.deepin.org/en/dde/ -[7]: https://itsfoss.com/linux-kernel-5/ -[8]: https://itsfoss.com/nextcloud-14-release/ -[9]: https://itsfoss.com/bash-5-release/ -[10]: https://itsfoss.com/upgrade-fedora-version/ -[11]: https://getfedora.org/en/workstation/ From 49be983acfba0943cee96e08d37721c29e4ea63e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 Jun 2019 23:45:29 +0800 Subject: [PATCH 0806/1154] PRF:20190423 How to identify same-content files on Linux.md @tomjlw --- ...to identify same-content files on Linux.md | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/translated/tech/20190423 How to identify same-content files on Linux.md b/translated/tech/20190423 How to identify same-content files on Linux.md index eb07e45d14..6be62c3868 100644 --- a/translated/tech/20190423 How to identify same-content files on Linux.md +++ b/translated/tech/20190423 How to identify same-content files on Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to identify same-content files on Linux) @@ -9,18 +9,17 @@ 如何在 Linux 上识别同样内容的文件 ====== -有时文件副本代表了对硬盘空间的巨大浪费并会在你想要更新文件时造成困扰。以下是用来识别这些文件的六个命令。 +> 有时文件副本相当于对硬盘空间的巨大浪费,并会在你想要更新文件时造成困扰。以下是用来识别这些文件的六个命令。 + ![Vinoth Chandar \(CC BY 2.0\)][1] -在最近的帖子中,我们看了[如何识别定位硬链接的文件][2](换句话说,指向同一硬盘内容并共享索引节点)。在本篇帖子中,我们将查看能找到具有相同_内容_,却不相链接的文件的命令。 +在最近的帖子中,我们看了[如何识别并定位硬链接的文件][2](即,指向同一硬盘内容并共享 inode)。在本文中,我们将查看能找到具有相同*内容*,却不相链接的文件的命令。 -硬链接很有用时因为它们能够使文件存放在文件系统内的多个地方却不会占用额外的硬盘空间。另一方面,有时文件副本代表了对硬盘空间的巨大浪费,在你想要更新文件时也会有造成困扰之虞。在这篇帖子中,我们将看一下多种识别这些文件的方式。 - -**[两分钟 Linux 小贴士:[学习如何通过两分钟视频教程掌握大量 Linux 命令][3]]** +硬链接很有用是因为它们能够使文件存放在文件系统内的多个地方却不会占用额外的硬盘空间。另一方面,有时文件副本相当于对硬盘空间的巨大浪费,在你想要更新文件时也会有造成困扰之虞。在本文中,我们将看一下多种识别这些文件的方式。 ### 用 diff 命令比较文件 -可能比较两个文件最简单的方法是使用 **diff** 命令。输出会显示你文件的不同之处。< 和 > 符号代表在当参数传过来的第一个(<)或第二个(>)文件中是否有额外的文字行。在这个例子中,在 backup.html 中有额外的文字行。 +可能比较两个文件最简单的方法是使用 `diff` 命令。输出会显示你文件的不同之处。`<` 和 `>` 符号代表在当参数传过来的第一个(`<`)或第二个(`>`)文件中是否有额外的文字行。在这个例子中,在 `backup.html` 中有额外的文字行。 ``` $ diff index.html backup.html @@ -30,18 +29,18 @@ $ diff index.html backup.html > ``` -如果 diff 没有输出那代表两个文件相同。 +如果 `diff` 没有输出那代表两个文件相同。 ``` $ diff home.html index.html $ ``` -diff 的唯一缺点是它一次只能比较两个文件并且你必须指定用来比较的文件,这篇帖子中的一些命令可以为你找到多个重复文件。 +`diff` 的唯一缺点是它一次只能比较两个文件并且你必须指定用来比较的文件,这篇帖子中的一些命令可以为你找到多个重复文件。 -### 使用 checksums +### 使用校验和 -**cksum**(checksum) 命令计算文件的校验和。校验和是一种将文字内容转化成一个长数字(例如2819078353 228029)的数学简化。虽然并不是完全独特的,但是文件内容不同校验和却相同的概率微乎其微。 +`cksum`(checksum) 命令计算文件的校验和。校验和是一种将文字内容转化成一个长数字(例如2819078353 228029)的数学简化。虽然校验和并不是完全独有的,但是文件内容不同校验和却相同的概率微乎其微。 ``` $ cksum *.html @@ -54,7 +53,7 @@ $ cksum *.html ### 使用 find 命令 -虽然 find 命令并没有寻找重复文件的选项,它依然可以被用来通过名字或类型寻找文件并运行 cksum 命令。例如: +虽然 `find` 命令并没有寻找重复文件的选项,它依然可以被用来通过名字或类型寻找文件并运行 `cksum` 命令。例如: ``` $ find . -name "*.html" -exec cksum {} \; @@ -65,7 +64,7 @@ $ find . -name "*.html" -exec cksum {} \; ### 使用 fslint 命令 -**fslint** 命令可以被特地用来寻找重复文件。注意我们给了它一个起始位置。如果它需要遍历相当多的文件,这个命令需要花点时间来完成。注意它是如何列出重复文件并寻找其它问题的,比如空目录和坏ID。 +`fslint` 命令可以被特地用来寻找重复文件。注意我们给了它一个起始位置。如果它需要遍历相当多的文件,这就需要花点时间来完成。注意它是如何列出重复文件并寻找其它问题的,比如空目录和坏 ID。 ``` $ fslint . @@ -86,7 +85,7 @@ index.html -------------------------Non Stripped executables ``` -你可能需要在你的系统上安装 **fslint**。 你可能也需要将它加入你的搜索路径: +你可能需要在你的系统上安装 `fslint`。你可能也需要将它加入你的命令搜索路径: ``` $ export PATH=$PATH:/usr/share/fslint/fslint @@ -94,7 +93,7 @@ $ export PATH=$PATH:/usr/share/fslint/fslint ### 使用 rdfind 命令 -**rdfind** 命令也会寻找重复(相同内容的)文件。它的名字代表“重复数据搜寻”并且它能够基于文件日期判断哪个文件是原件——这在你选择删除副本时很有用因为它会移除较新的文件。 +`rdfind` 命令也会寻找重复(相同内容的)文件。它的名字意即“重复数据搜寻”,并且它能够基于文件日期判断哪个文件是原件——这在你选择删除副本时很有用因为它会移除较新的文件。 ``` $ rdfind ~ @@ -111,7 +110,7 @@ Totally, 223 KiB can be reduced. Now making results file results.txt ``` -你可以在“dryrun”中运行这个命令 (换句话说,仅仅汇报可能会另外被做出的改动)。 +你可以在 `dryrun` 模式中运行这个命令 (换句话说,仅仅汇报可能会另外被做出的改动)。 ``` $ rdfind -dryrun true ~ @@ -128,7 +127,7 @@ Removed 9 files due to unique sizes from list.2 files left. (DRYRUN MODE) Now making results file results.txt ``` -rdfind 命令同样提供了类似忽略空文档(-ignoreempty)和跟踪符号链接(-followsymlinks)的功能。查看 man 页面获取解释。 +`rdfind` 命令同样提供了类似忽略空文档(`-ignoreempty`)和跟踪符号链接(`-followsymlinks`)的功能。查看 man 页面获取解释。 ``` -ignoreempty ignore empty files @@ -146,7 +145,7 @@ rdfind 命令同样提供了类似忽略空文档(-ignoreempty)和跟踪符 -n, -dryrun display what would have been done, but don't do it ``` -注意 rdfind 命令提供了 **-deleteduplicates true** 的设置选项以删除副本。希望这个命令语法上的小问题不会惹恼你。;-) +注意 `rdfind` 命令提供了 `-deleteduplicates true` 的设置选项以删除副本。希望这个命令语法上的小问题不会惹恼你。;-) ``` $ rdfind -deleteduplicates true . @@ -154,11 +153,11 @@ $ rdfind -deleteduplicates true . Deleted 1 files. <== ``` -你将可能需要在你的系统上安装 rdfind 命令。试验它以熟悉如何使用它可能是一个好主意。 +你将可能需要在你的系统上安装 `rdfind` 命令。试验它以熟悉如何使用它可能是一个好主意。 ### 使用 fdupes 命令 -**fdupes** 命令同样使得识别重复文件变得简单。它同时提供了大量有用的选项——例如用来迭代的**-r**。在这个例子中,它像这样将重复文件分组到一起: +`fdupes` 命令同样使得识别重复文件变得简单。它同时提供了大量有用的选项——例如用来迭代的 `-r`。在这个例子中,它像这样将重复文件分组到一起: ``` $ fdupes ~ @@ -173,7 +172,7 @@ $ fdupes ~ /home/shs/hideme.png ``` -这是使用迭代的一个例子,注意许多重复文件是重要的(用户的 .bashrc 和 .profile 文件)并且不应被删除。 +这是使用迭代的一个例子,注意许多重复文件是重要的(用户的 `.bashrc` 和 `.profile` 文件)并且不应被删除。 ``` # fdupes -r /home @@ -204,7 +203,7 @@ $ fdupes ~ /home/shs/PNGs/Sandra_rotated.png ``` -fdupe 命令的许多选项列在下面。使用 **fdupes -h** 命令或者阅读 man 页面获取详情。 +`fdupe` 命令的许多选项列如下。使用 `fdupes -h` 命令或者阅读 man 页面获取详情。 ``` -r --recurse recurse @@ -229,14 +228,11 @@ fdupe 命令的许多选项列在下面。使用 **fdupes -h** 命令或者阅 -h --help displays help ``` -fdupes 命令是另一个你可能需要安装并使用一段时间才能熟悉其众多选项的命令。 +`fdupes` 命令是另一个你可能需要安装并使用一段时间才能熟悉其众多选项的命令。 ### 总结 -Linux 系统提供能够定位并(潜在地)能移除重复文件的一系列的好工具附带能让你指定搜索区域及当对你所发现的重复文件时的处理方式的选项。 -**[也可在:[解决 Linux 问题时的无价建议和技巧][4]上查看]** - -在 [Facebook][5] 和 [LinkedIn][6] 上加入 Network World 社区并对任何弹出的话题评论。 +Linux 系统提供能够定位并(潜在地)能移除重复文件的一系列的好工具,以及能让你指定搜索区域及当对你所发现的重复文件时的处理方式的选项。 -------------------------------------------------------------------------------- @@ -245,7 +241,7 @@ via: https://www.networkworld.com/article/3390204/how-to-identify-same-content-f 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e1bdb068ccaea10d869a681a5fbc6e243901235e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 9 Jun 2019 23:45:55 +0800 Subject: [PATCH 0807/1154] PUB:20190423 How to identify same-content files on Linux.md @tomjlw https://linux.cn/article-10955-1.html --- .../20190423 How to identify same-content files on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190423 How to identify same-content files on Linux.md (99%) diff --git a/translated/tech/20190423 How to identify same-content files on Linux.md b/published/20190423 How to identify same-content files on Linux.md similarity index 99% rename from translated/tech/20190423 How to identify same-content files on Linux.md rename to published/20190423 How to identify same-content files on Linux.md index 6be62c3868..6353fe86b3 100644 --- a/translated/tech/20190423 How to identify same-content files on Linux.md +++ b/published/20190423 How to identify same-content files on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10955-1.html) [#]: subject: (How to identify same-content files on Linux) [#]: via: (https://www.networkworld.com/article/3390204/how-to-identify-same-content-files-on-linux.html#tk.rss_all) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From a332211b0a53c5e764633525a325b6974e3984b8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 Jun 2019 00:56:32 +0800 Subject: [PATCH 0808/1154] PRF:20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md @wxy --- ...g Smart Contracts And Its Types -Part 5.md | 88 +++++++++---------- 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/translated/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md b/translated/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md index 22d879dfe2..4695f73977 100644 --- a/translated/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md +++ b/translated/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Blockchain 2.0 – Explaining Smart Contracts And Its Types [Part 5]) @@ -16,70 +16,70 @@ ### 不断发展的合同 -这个世界建立在合同(合约)之上。没有合约的使用和再利用,地球上任何个人或公司都不能在当前社会中发挥作用。创建、维护和执行合同的任务变得如此复杂,以至于必须以“合同法”的名义建立整个司法和法律系统以支持它。事实上,大多数合同都是由“受信任的”第三方监督,以确保最终的利益相关者按照达成的条件得到妥善处理。有些合同甚至涉及到了第三方受益人。此类合同旨在对不是合同的活跃(或参与)方的第三方产生影响。解决和争论合同义务占据了民事诉讼所涉及的大部分法律纠纷。当然,更好的处理合同的方式来对于个人和企业来说都是天赐之物。更不用说它将以验证和证明的名义拯救政府的巨大[文书工作][7] [^1]。 +这个世界建立在合同(合约)之上。在当前社会,没有合约的使用和再利用,地球上任何个人或公司都无法运作。订立、维护和执行合同的任务变得如此复杂,以至于整个司法和法律系统都必须以“合同法”的名义建立起来以支持它。事实上,大多数合同都是由一个“可信的”第三方监督,以确保最终的利益攸关者按照达成的条件得到妥善处理。有些合同甚至涉及到了第三方受益人。此类合同旨在对不是合同的活跃(或参与)方的第三方产生影响。解决和争论合同义务占据了民事诉讼所涉及的大部分法律纠纷。当然,更好的处理合同的方式来对于个人和企业来说都是天赐之物。更不用说它将以核查和证明的名义节省政府的巨大的[文书工作][7] [^1]。 -本系列中的大多数文章都研究了如何利用现有的区块链技术。相比之下,这篇文章将更多地讲述对未来几年的预期。关于“智能合约”的讨论是从前一篇文章中提出的财产讨论自然而然的演变而来的。当前这篇文章旨在概述区块链自动执行“智能”可执行程序的能力。务实地处理这个问题意味着我们首先必须定义和探索这些“智能合约”是什么,以及它们如何适应现有的合同系统。我们将在下一篇题为“区块链 2.0:正在进行的项目”的文章中查看当前正在进行的主要应用程序和项目。 +本系列中的大多数文章都研究了如何利用现有的区块链技术。相比之下,这篇文章将更多地讲述对未来几年的预期。关于“智能合约”的讨论源于前一篇文章中提出的财产讨论。当前这篇文章旨在概述区块链自动执行“智能”可执行程序的能力。务实地处理这个问题意味着我们首先必须定义和探索这些“智能合约”是什么,以及它们如何适应现有的合同系统。我们将在下一篇题为“区块链 2.0:正在进行的项目”的文章中查看当前该领域正在进行的主要应用和项目。 ### 定义智能合约 -[本系列的第一篇文章][3]从基本的角度把区块链看作由以下数据块组成的“分布式分类账本”: +[本系列的第一篇文章][3]从基本的角度来看待区块链,将其看作由数据块组成的“分布式分类账本”,这些数据块是: * 防篡改 -* 不可否认(意味着每个数据块都是由某人明确创建的,并且该人不能否认相同的责任) -* 安全,且对传统的网络攻击方法具有抗性 +* 不可否认(意味着每个数据块都是由某人显式创建的,并且该人不能否认相同的责任) +* 安全,且能抵御传统的网络攻击方法 * 几乎是永久性的(当然这取决于区块链协议层) * 高度冗余,通过存在于多个网络节点或参与者系统上,其中一个节点的故障不会以任何方式影响系统的功能,并且, -* 根据应用可以提供更快的处理速度。 +* 根据应用的不同可以提供更快的处理速度。 -由于每个数据实例都是通过适当的凭证安全存储和访问的,因此区块链网络可以为精确验证事实和信息提供简便的基础,而无需第三方监督。区块链 2.0 开发也允许“分布式应用程序(DApp)”(我们将在即将发布的文章中详细介绍这个术语)。这些分布式应用程序根据要求存在并在网络上运行。当用户需要它们并通过使用已经过审查并存储在区块链中的信息来执行它们时,它们被调用。 +由于每个数据实例都是安全存储和通过适当的凭证访问的,因此区块链网络可以为精确验证事实和信息提供简便的基础,而无需第三方监督。区块链 2.0 开发也允许“分布式应用程序(DApp)”(我们将在接下来的文章中详细介绍这个术语)。这些分布式应用程序要求存在网络上并在其上运行。当用户需要它们时就会调用它们,并通过使用已经过审核并存储在区块链上的信息来执行它们。 -上面的最后一段为定义智能合约提供了基础。数字商务商会The Chamber for Digital Commerce提供了一个许多专家都同意的智能合约定义。 +上面的最后一段为智能合约的定义提供了基础。数字商会The Chamber for Digital Commerce提供了一个许多专家都同意的智能合约定义。 -> “(智能合约是一种)计算机代码,在发生特定条件或条件时,能够根据预先指定的功能自动运行。该代码可以在分布式分类帐上存储和处理,并将任何结果更改写入分布式分类帐” [^2]。 +> “(智能合约是一种)计算机代码,在发生指定条件时,能够根据预先指定的功能自动运行。该代码可以在分布式分类帐本上存储和处理,并将产生的任何更改写入分布式分类帐本” [^2]。 -智能合约如上所述是一种简单的计算机程序,就像 “if-then” 或 “if-else if” 语句一样工作。关于其“智能”的方面来自这样一个事实,即该程序的预定义输入来自区块链分类账本,如上所述,它是一个安全可靠的记录信息源。如果需要,程序可以调用外部服务或来源以获取信息从而验证操作条款,并且只有在满足所有预定义条件后才执行。 +智能合约如上所述是一种简单的计算机程序,就像 “if-then” 或 “if-else if” 语句一样工作。关于其“智能”的方面来自这样一个事实,即该程序的预定义输入来自区块链分类账本,如上所述,它是一个记录信息的安全可靠的来源。如有必要,程序可以调用外部服务或来源以获取信息,以验证操作条款,并且仅在满足所有预定义条件后才执行。 -必须记住,与其名称所暗示的不同,智能合约通常不是自治实体,严格来说也不是合同。1996 年,Nick Szabo 于 很早就提到了智能合约,他将其与接受付款并交付用户选择产品的自动售货机进行了比较。可以在[这里][4]查看全文。此外,人们正在制定允许智能合约进入主流合同使用的法律框架,因此目前该技术的使用仅限于法律监督不那么明确和严格的领域 [^4]。 +必须记住,与其名称所暗示的不同,智能合约通常不是自治实体,严格来说,也不是合同。1996 年,Nick Szabo 很早就提到了智能合约,他将其与接受付款并交付用户选择的产品的自动售货机进行了比较。可以在[这里][4]查看全文。此外,人们正在制定允许智能合约进入主流合同使用的法律框架,因此目前该技术的使用仅限于法律监督不那么明确和严格的领域 [^4]。 ### 智能合约的主要类型 假设读者对合同和计算机编程有基本的了解,并且基于我们对智能合约的定义,我们可以将智能合约和协议粗略地分类为以下主要类别。 -##### 1、智能分类账本合约 +#### 1、智能法律合约 -这些可能是最明显的类型。大多数(如果不是全部)合同都具有法律效力。在不涉及太多技术细节的情况下,智能的合法合约是涉及严格的法律追索权的合同,以防参与合同的当事人不履行其交易的目的。如前所述,不同国家和地区的现行法律框架缺乏对区块链智能和自动化合约的足够支持,其法律地位也不明确。但是,一旦制定了法律,就可以订立智能合约,以简化目前涉及严格监管的流程,如金融和房地产市场交易、政府补贴、国际贸易等。 +这大概是最明显的一种。大多数(如果不是全部)合同都具有法律效力。在不涉及太多技术问题的情况下,智能法律合约是涉及到严格的法律追索权的合同,以防参与合同的当事人不履行其交易的目的。如前所述,不同国家和地区的现行法律框架对区块链上的智能和自动化合约缺乏足够的支持,其法律地位也不明确。但是,一旦制定了法律,就可以订立智能合约,以简化目前涉及严格监管的流程,如金融和房地产市场交易、政府补贴、国际贸易等。 -##### 2、DAO +#### 2、DAO -去中心化的自治组织Decentralized Autonomous Organization,即DAO,可以松散地定义为区块链上存在的社区。社区可以通过一组规则来定义,这些规则通过智能合约来体现并放入代码中。然后,每个参与者的每一个行动都将受到这些规则的约束,其任务是在程序中断的情况下执行并获得追索权。许多智能合约构成了这些规则,它们协同监管和观察参与者。 +去中心化自治组织Decentralized Autonomous Organization,即DAO,可以粗略地定义为区块链上存在的社区。该社区可以通过一组规则来定义,这些规则通过智能合约来体现并放入代码中。然后,每个参与者的每一个行动都将受到这些规则的约束,其任务是在程序中断的情况下执行并获得追索权。许多智能合约构成了这些规则,它们协同监管和监督参与者。 -名为 Genesis DAO 的 DAO 由以太坊参与者于 2016 年 5 月创建。该社区旨在成为众筹和风险投资平台。在极短的时间内,他们设法筹集了惊人的 1.5 亿美元。然而,黑客在系统中发现了漏洞,并设法从众筹投资者手中窃取价值约 5000 万美元的以太币。这次黑客破坏的后果导致以太坊区块链[分裂为两个][8],以太坊和以太坊经典。 +名为“创世纪 DAO” 的 DAO 是由以太坊参与者于 2016 年 5 月创建。该社区旨在成为众筹和风险投资平台。在极短的时间内,他们设法筹集了惊人的 1.5 亿美元。然而,由于黑客在系统中发现了漏洞,并设法从众筹投资者手中窃取价值约 5000 万美元的以太币。这次黑客破坏的后果导致以太坊区块链[分裂为两个][8],以太坊和以太坊经典。 -##### 3、应用程序逻辑合约(ALC) +#### 3、应用逻辑合约(ALC) -如果你已经听说过与区块链相关的物联网,那么很可能这个问题谈到了应用程序逻辑合约Application logic contract,即 ALC。此类智能合约包含特定于应用程序的代码,这些代码可以与区块链上的其他智能合约和程序一起使用。它们有助于与设备之间的通信并进行通信验证(在物联网领域)。ALC 是每个多功能智能合约的关键部分,并且大多数都是在管理程序下工作。它们在这里引用的大多数例子中找到[应用][9] [^6]。 +如果你已经听说过与区块链相结合的物联网,那么很可能它涉及到了应用逻辑合约Application logic contract,即 ALC。此类智能合约包含特定于应用的代码,这些代码可以与区块链上的其他智能合约和程序一起工作。它们有助于与设备进行通信并验证设备之间的通信(在物联网领域)。ALC 是每个多功能智能合约的关键部分,并且大多数都是在一个管理程序下工作。在这里引用的大多数例子中,它们到处都能找到[应用][9] [^6]。 -*由于该领域还在开发中,因此目前所说的任何定义或标准最多只能说是流畅而模糊的。* +*由于该领域还在开发中,因此目前所说的任何定义或标准最多只能说是变化而模糊的。* ### 智能合约是如何工作的? 为简化起见,让我们用个例子来说明。 -约翰和彼得是两个争论足球比赛得分的人。他们对比赛结果持有相互矛盾的看法,他们都支持不同的团队(这是背景)。由于他们两个都需要去其他地方并且无法看完比赛,所以约翰认为如果 A 队在比赛中击败 B 队,他就*支付*给彼得 100 美元。彼得*考虑*之后*接受*了该赌注,同时明确表示他们必须接受这些条款。但是,他们都没有兑现该赌注的相互信任,也没有时间和钱来指定任命第三方来监督赌注。 +约翰和彼得是两个争论足球比赛得分的人。他们对比赛结果持有相互矛盾的看法,他们都支持不同的球队(这是背景情况)。由于他们两个都需要去其他地方并且无法看完比赛,所以约翰认为如果 A 队在比赛中击败 B 队,他就*支付*给彼得 100 美元。彼得*考虑*之后*接受*了该赌注,同时明确表示他们必须接受这些条款。但是,他们没有兑现该赌注的相互信任,也没有时间和钱来指定第三方监督赌注。 -假设约翰和彼得都使用智能合约平台,例如 [Etherparty][5],它可以在合同谈判时自动结算赌注,他们都会将基于区块链的身份链接到合约,并设置条款,明确表示一旦比赛结束,程序将找出获胜方是谁,并自动将该金额从输家中归入获胜者银行账户。一旦比赛结束并且媒体报道同样的结果,该程序将在互联网上搜索规定的来源,确定哪支球队获胜,将其与合约条款联系起来,在这种情况下,如果 A 队赢了彼得将从约翰获得钱,也就是说将约翰的 100 美元转移到彼得的账户。执行完毕后,除非另有说明,否则智能合约将终止并在所有时间内处于非活动状态。 +假设约翰和彼得都使用像 [Etherparty][5] 这样的智能合约平台,它可以在合约谈判时自动结算赌注,他们都会将基于区块链的身份链接到该合约,并设置条款,明确表示一旦比赛结束,该程序将找出获胜方是谁,并自动将该金额从输家中归入获胜者银行账户。一旦比赛结束并且媒体报道同样的结果,该程序将在互联网上搜索规定的来源,确定哪支球队获胜,将其与合约条款联系起来,在这种情况下,如果 A 队赢了彼得将从约翰哪里得到钱,也就是说将约翰的 100 美元转移到彼得的账户。执行完毕后,除非另有说明,否则智能合约将终止并在未来所有的时间内处于非活动状态。 -除了示例的简单性,情况涉及到一个经典合同,参与者选择使用智能合约实现了相同目的。所有的智能合约基本上都遵循类似的原则,程序被编码为在预定义的参数上执行,并且只抛出预期的输出。智能合同咨询的外部来源可能有时被称为 IT 世界中的神谕Oracle。神谕是当今全球许多智能合约系统的常见部分。 +抛开例子的简单不说,这种情况涉及到一个经典的合同,而参与者选择使用智能合约实现了相同目的。所有的智能合约基本上都遵循类似的原则,对程序进行编码,以便在预定义的参数上执行,并且只抛出预期的输出。智能合同咨询的外部来源可以是有时被称为 IT 世界中的神谕Oracle。神谕是当今全球许多智能合约系统的常见部分。 在这种情况下使用智能合约使参与者可以获得以下好处: -* 它比在一起手动结算更快。 -* 从等式中删除了信任问题。 -* 消除了受信任的第三方代表有关各方处理和解的需要。 +* 它比在一起并手动结算更快。 +* 从其中删除了信任问题。 +* 消除了受信任的第三方代表有关各方处理和解的必要性。 * 执行时无需任何费用。 -* 处理参数和敏感数据的方式是安全的。 -* 相关数据将永久保留在他们运行的区块链平台中,未来的投注可以通过调用相同的函数并为其添加输入来进行。 -* 随着时间的推移,假设约翰和彼得赌博成瘾,该程序将帮助他们开发可靠的统计数据来衡量他们的连胜纪录。 +* 在如何处理参数和敏感数据方面是安全的。 +* 相关数据将永久保留在他们运行的区块链平台中,未来可以通过调用相同的函数并为其提供更多输入来设置投注。 +* 随着时间的推移,假设约翰和彼得变得赌博成瘾,该程序可以帮助他们开发可靠的统计数据来衡量他们的连胜纪录。    现在我们知道**什么是智能合约**和**它们如何工作**,我们还没有解决**为什么我们需要它们**。 @@ -87,51 +87,49 @@ 正如之前的例子我们重点提到过的,出于各种原因,我们需要智能合约。 - #### 透明度 -所涉及的条款和条件对交易对手来说非常清楚。此外,由于程序或智能合约的执行涉及某些明确的输入,因此用户可以非常直接地验证会影响他们和合约受益人的因素。 +交易对手非常清楚所涉及的条款和条件。此外,由于程序或智能合约的执行涉及某些明确的输入,因此用户可以非常直接地核实会影响他们和合约受益人的因素。 -#### 时间效率高 +#### 时间效率 -如上所述,智能合约一旦被控制变量或用户调用触发就立即开始工作。由于数据通过区块链和网络中的其它来源即时提供给系统,因此执行不需要任何时间来验证和处理信息并解决交易。例如,转移土地所有权契约,这是一个涉及手工核实大量文书工作并且需要数周时间的过程,可以在几分钟甚至几秒钟内通过智能合约程序来处理文件和相关各方。 +如上所述,智能合约一旦被控制变量或用户调用所触发,就立即开始工作。由于数据是通过区块链和网络中的其它来源即时提供给系统,因此执行不需要任何时间来验证和处理信息并解决交易。例如,转移土地所有权契约,这是一个涉及手工核实大量文书工作并且需要数周时间的过程,可以在几分钟甚至几秒钟内通过智能合约程序来处理文件和相关各方。 -#### 精确 +#### 精度 由于平台基本上只是计算机代码和预定义的内容,因此不存在主观错误,所有结果都是精确的,完全没有人为错误。 #### 安全 -区块链的一个固有特征是每个数据块都是安全加密的。这意味着为了实现冗余,即使数据存储在网络上的多个节点上,**也只有数据所有者才能访问以查看和使用数据**。类似地,所有过程都将是完全安全和防篡改的,利用区块链在过程中存储重要变量和结果。同样也通过按时间顺序为审计人员提供原始的、未经更改的和不可否认的数据版本,简化了审计和法规事务。 +区块链的一个固有特征是每个数据块都是安全加密的。这意味着为了实现冗余,即使数据存储在网络上的多个节点上,**也只有数据所有者才能访问以查看和使用数据**。类似地,利用区块链在过程中存储重要变量和结果,所有过程都将是完全安全和防篡改的。同样也通过按时间顺序为审计人员提供原始的、未经更改的和不可否认的数据版本,简化了审计和法规事务。 #### 信任 -这个文章系列开篇说到区块链为互联网及其上运行的服务增加了急需的信任层。智能合约在任何情况下都不会在执行协议时表现出偏见或主观性,这意味着所涉及的各方对结果完全有约束力,并且可以不附带任何条件地信任该系统。这也意味着此处不需要具有重要价值的传统合同中所需的“可信第三方”。当事人之间的犯规和监督将成为过去的问题。 +这个文章系列开篇说到区块链为互联网及其上运行的服务增加了急需的信任层。智能合约在任何情况下都不会在执行协议时表现出偏见或主观性,这意味着所涉及的各方对结果完全有约束力,并且可以不附带任何条件地信任该系统。这也意味着,在具有重要价值的传统合同中所需的“可信第三方”,在此处不需要。当事人之间的犯规和监督将成为过去的问题。 #### 成本效益 -如示例中所强调的,使用智能合约涉及最低成本。企业通常有专门从事使其交易是合法的并遵守法规的行政人员。如果交易涉及多方,则重复工作是不可避免的。智能合约基本上使前者无关紧要,并且消除了重复,因为双方可以同时完成尽职调查。 +如示例中所强调的,使用智能合约需要最低的成本。企业通常有专门从事使其交易合法并遵守法规的行政人员。如果交易涉及多方,则重复工作是不可避免的。智能合约基本上使前者无关紧要,并且消除了重复,因为双方可以同时完成尽职调查。 -### 智能合约的应用程序 +### 智能合约的应用 -基本上,如果两个或多个参与方使用共同的区块链平台,并就一组原则或业务逻辑达成一致,他们可以一起在区块链上创建一个智能合约,并且在没有人为干预的情况下执行。没有人可以篡改所设置的条件,如果原始代码允许,任何更改都会加上时间戳并带有编辑者的指纹,从而增加了问责制。想象一下,在更大的企业级规模上出现类似的情况,你就会明白智能合约的能力是什么,实际上从 2016 年开始的 **Capgemini 研究** 发现智能合约实际上可能是商业主流**“的下一阶段的早期“** [^8]。商业应用程序涉及保险、金融市场、物联网、贷款、身份管理系统、托管账户、雇佣合同以及专利和版税合同等用途。像以太坊这样的区块链平台,是一个设计时就考虑了智能合约的系统,它也允许个人私人用户免费使用智能合约。 +基本上,如果两个或多个参与方使用共同的区块链平台,并就一组原则或业务逻辑达成一致,他们可以一起在区块链上创建一个智能合约,并且在没有人为干预的情况下执行。没有人可以篡改所设置的条件,如果原始代码允许,任何更改都会加上时间戳并带有编辑者的指纹,从而增加了问责制。想象一下,在更大的企业级规模上出现类似的情况,你就会明白智能合约的能力是什么,实际上从 2016 年开始的 **Capgemini 研究** 发现智能合约实际上可能是**“未来几年的”** [^8] 商业主流。商业的应用涉及保险、金融市场、物联网、贷款、身份管理系统、托管账户、雇佣合同以及专利和版税合同等用途。像以太坊这样的区块链平台,是一个设计时就考虑了智能合约的系统,它允许个人私人用户免费使用智能合约。 通过对处理智能合约的公司的探讨,本系列的下一篇文章中将更全面地概述智能合约在当前技术问题上的应用。 ### 那么,它有什么缺点呢? -这并不是说对智能合约的使用没有任何顾虑。这种担忧实际上也减缓了这方面的发展。所有区块链的防篡改性质基本上使得,如果所涉及的各方需要在没有重大改革或法律追索的情况下,几乎不可能修改或添加现有条款的新条款。 +这并不是说对智能合约的使用没有任何顾虑。这种担忧实际上也减缓了这方面的发展。所有区块链的防篡改性质实质上使得,如果所涉及的各方需要在没有重大改革或法律追索的情况下,几乎不可能修改或添加现有条款的新条款。 其次,即使公有链上的活动是开放的,所有人都可以看到和观察。交易中涉及的各方的个人身份并不总是已知的。这种匿名性造成在任何一方违约的情况下法律有罪不罚的问题,特别是因为现行法律和立法者并不完全适应现代技术。 第三,区块链和智能合约在很多方面仍然存在安全缺陷,因为对其所以涉及的技术仍处于发展的初期阶段。 对代码和平台的这种缺乏经验最终导致了 2016 年的 DAO 事件。 -所有这些都是在企业或公司需要调整区块链以供其使用时可能需要的大量的初始投资。事实上,这些是最初的一次性投资,并且随之而来的是潜在的节省,这是人们感兴趣的。 - +所有这些都可能导致企业或公司在需要调整区块链以供其使用时需要大量的初始投资。然而,这些是最初的一次性投资,并且随之而来的是潜在的节约,这才是人们感兴趣的。 ### 结论 -目前的法律框架并不真正支持一个全面的智能合约的社会,并且由于显然的原因也不会在不久的将来支持。一个解决方案是选择**“混合”合约**,它将传统的法律文本和文件与在为此目的设计的区块链上运行的智能合约代码相结合。然而,即使是混合合约仍然很大程度上尚未得到探索,因为需要创新的立法机构才能实现这些合约。这里简要提到的应用程序以及更多内容将在[本系列的下一篇文章][6]中详细探讨。 +目前的法律框架并没有真正支持一个全面的智能合约的社会,并且由于显然的原因,在不久的将来也不会支持。一个解决方案是选择**“混合”合约**,它将传统的法律文本和文件与在为此目的设计的区块链上运行的智能合约代码相结合。然而,即使是混合合约仍然很大程度上尚未得到探索,因为需要创新的立法机构才能实现这些合约。这里简要提到的应用以及更多内容将在[本系列的下一篇文章][6]中详细探讨。 [^1]: S. C. A. Chamber of Digital Commerce, “Smart contracts – Is the law ready,” no. September, 2018. [^2]: S. C. A. Chamber of Digital Commerce, “Smart contracts – Is the law ready,” no. September, 2018. @@ -145,10 +143,10 @@ via: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ -作者:[editor][a] +作者:[ostechnix][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5d03476ed917d93c005a76dab9c787a6715d4c9f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 Jun 2019 00:57:10 +0800 Subject: [PATCH 0809/1154] PUB:20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md @wxy https://linux.cn/article-10956-1.html --- ... 2.0 - Explaining Smart Contracts And Its Types -Part 5.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md (99%) diff --git a/translated/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md b/published/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md similarity index 99% rename from translated/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md rename to published/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md index 4695f73977..62499247c1 100644 --- a/translated/tech/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md +++ b/published/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10956-1.html) [#]: subject: (Blockchain 2.0 – Explaining Smart Contracts And Its Types [Part 5]) [#]: via: (https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/) [#]: author: (editor https://www.ostechnix.com/author/editor/) From 7dc95b175aef067c85a13b432c7f2d486800e9b3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 10 Jun 2019 08:53:15 +0800 Subject: [PATCH 0810/1154] translated --- ...r is Now Officially Available for Linux.md | 98 ------------------- ...r is Now Officially Available for Linux.md | 93 ++++++++++++++++++ 2 files changed, 93 insertions(+), 98 deletions(-) delete mode 100644 sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md create mode 100644 translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md diff --git a/sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md b/sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md deleted file mode 100644 index 4a217f7c94..0000000000 --- a/sources/tech/20190531 Unity Editor is Now Officially Available for Linux.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Unity Editor is Now Officially Available for Linux) -[#]: via: (https://itsfoss.com/unity-editor-linux/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Unity Editor is Now Officially Available for Linux -====== - -If you are a designer, developer or an artist, you might have been using the experimental [Unity Editor][1] that was made available for Linux. However, the experimental version wasn’t going to cut it forever – developers need a full stable experience to work. - -So, they recently announced that you can access the full-fledged Unity Editor on Linux. - -While this is an exciting news, what Linux distro does it officially support? Let us talk about a few more details… - -Non-FOSS Alert - -Unity Editor on Linux (or any other platform for that matter) is not an open source software. We have covered it here because - -### Official Support for Ubuntu and CentOS 7 - -![][2] - -No matter whether you have a personal or a professional license, you can access the editor if you have Unity 2019.1 installed or later. - -In addition, they are prioritizing the support for Ubuntu 16.04, Ubuntu 18.04, and CentOS 7. - -In their [announcement post][3], they also mentioned the configurations supported: - - * x86-64 architecture - * Gnome desktop environment running on top of X11 windowing system - * Nvidia official proprietary graphics driver and AMD Mesa graphics driver - * Desktop form factors, running on device/hardware without emulation or compatibility layer - - - -You can always try on anything else – but it’s better to stick with the official requirements for the best experience. - -A Note on 3rd Party Tools - -If you happen to utilize any 3rd party tool on any of your projects, you will have to separately check whether they support it or not. - -### How to install Unity Editor on Linux - -Now that you know about it – how do you install it? - -To install Unity, you will have to download and install the [Unity Hub][4]. - -![Unity Hub][5] - -Let’s walk you through the steps: - - * Download Unity Hub for Linux from the [official forum page][4]. - * It will download an AppImage file. Simply, make it executable and run it. In case you are not aware of it, you should check out our guide on [how to use AppImage on Linux][6]. - * Once you launch the Unity Hub, it will ask you to sign in (or sign up) using your Unity ID to activate the licenses. For more info on how the licenses work, do refer to their [FAQ page][7]. - * After you sign in using your Unity ID, go to the “ **Installs** ” option (as shown in the image above) and add the version/components you want. - - - -[][8] - -Suggested read A Modular and Open Source Router is Being Crowdfunded - -That’s it! This is the best way to get all the latest builds and get it installed in a jiffy. - -**Wrapping Up** - -Even though it is an exciting news, the official configuration support does not seem to be an extensive list. If you use it on Linux, do share your feedback and opinion on [their Linux forum thread][9]. - -What do you think about that? Also, do you use Unity Hub to install it or did we miss a better method to get it installed? - -Let us know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/unity-editor-linux/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://unity3d.com/unity/editor -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/Unity-Editor-on-Linux.png?resize=800%2C450&ssl=1 -[3]: https://blogs.unity3d.com/2019/05/30/announcing-the-unity-editor-for-linux/ -[4]: https://forum.unity.com/threads/unity-hub-v-1-6-0-is-now-available.640792/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/unity-hub.jpg?fit=800%2C532&ssl=1 -[6]: https://itsfoss.com/use-appimage-linux/ -[7]: https://support.unity3d.com/hc/en-us/categories/201268913-Licenses -[8]: https://itsfoss.com/turris-mox-router/ -[9]: https://forum.unity.com/forums/linux-editor.93/ diff --git a/translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md b/translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md new file mode 100644 index 0000000000..fcdd071c6b --- /dev/null +++ b/translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Unity Editor is Now Officially Available for Linux) +[#]: via: (https://itsfoss.com/unity-editor-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Unity 编辑器现已正式面向 Linux 推出 +====== + +如果你是设计师、开发者或艺术家,你可能一直在使用 Linux 上的实验性 [Unity 编辑器][1]。然而,实验性版本无法永远满足 - 开发者需要一个完整稳定的工作经验。 + +因此,他们最近宣布你可以在 Linux 上使用完整功能的 Unity 编辑器了。 + +虽然这是一个令人兴奋的消息,但它正式支持哪些 Linux 发行版?我们来谈谈更多细节...... + +非 FOSS 警告 + +Linux 上的 Unity 编辑器(或任何其他平台)不是开源软件。我们在这里介绍它是因为 + +### 官方支持 Ubuntu 和 CentOS 7 + +![][2] + +无论你拥有个人许可还是专业许可,如果你安装了 Unity 2019.1 或更高版本,都可以使用编辑器。 + +此外,他们优先支持 Ubuntu 16.04、Ubuntu 18.04 和 CentOS 7。 + +在[公告][3]中,他们还提到了支持的配置: + + * x86-64 架构 +  * 运行在 X11 窗口系统之上的 Gnome 桌面环境 +  * Nvidia 官方专有显卡驱动和 AMD Mesa 显卡驱动 +  * 桌面计算机,在没有仿真或兼容层的设备/硬件上运行 + + + +你可以尝试其他的 - 但最好坚持官方要求以获得最佳体验。 + +关于第三方工具的说明 + +如果你碰巧在任何项目中使用了任何第三方工具,那么必须单独检查它们是否支持。 + +### 如何在 Linux 上安装Unity 编辑器 + +现在你已经了解了它,那么该如何安装? + +To install Unity, you will have to download and install the [Unity Hub][4]. +要安装 Unity,你需要下载并安装 [Unity Hub][4]。 + +![Unity Hub][5] + +我们将引导你完成以下步骤: + + * 从[官方论坛页面][4]下载适用于 Linux 的 Unity Hub。 +  * 它将下载一个 AppImage 文件。简单地说,让它可执行并运行它。如果你不了解它,你应该查看关于[如何在 Linux 上使用 AppImage][6] 的指南。 +  * 启动 Unity Hub 后,它会要求你使用 Unity ID 登录(或注册)以激活许可证。有关许可证生效的更多信息,请参阅他们的 [FAQ 页面][7]。 +  * 使用 Unity ID 登录后,进入“**安装**”选项(如上图所示)并添加所需的版本/组件。 + + +就是这些了。这就是获取并快速安装的最佳方法。 + +**总结** + +即使这是一个令人兴奋的消息,但官方配置支持似乎并不广泛。如果你在 Linux 上使用它,请在[他们的 Linux 论坛帖子][9]上分享你的反馈和意见。 + +你觉得怎么样?此外,你是使用 Unity Hub 安装它,还是有更好的方法来安装? + +请在下面的评论中告诉我们你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/unity-editor-linux/ + +作者:[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://unity3d.com/unity/editor +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/Unity-Editor-on-Linux.png?resize=800%2C450&ssl=1 +[3]: https://blogs.unity3d.com/2019/05/30/announcing-the-unity-editor-for-linux/ +[4]: https://forum.unity.com/threads/unity-hub-v-1-6-0-is-now-available.640792/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/unity-hub.jpg?fit=800%2C532&ssl=1 +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://support.unity3d.com/hc/en-us/categories/201268913-Licenses +[9]: https://forum.unity.com/forums/linux-editor.93/ From 73cb4c5a334d9d33b13103e39b536332c52ac5a5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 10 Jun 2019 09:07:38 +0800 Subject: [PATCH 0811/1154] translating --- ...alled Security Updates on Redhat (RHEL) And CentOS System.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md b/sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md index 8686fe415f..f8f95e863a 100644 --- a/sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md +++ b/sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4dc4671d72250619eebfdf9d8dada14718261cf2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 Jun 2019 11:28:10 +0800 Subject: [PATCH 0812/1154] APL:20190410 How we built a Linux desktop app with Electron --- .../20190410 How we built a Linux desktop app with Electron.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190410 How we built a Linux desktop app with Electron.md b/sources/tech/20190410 How we built a Linux desktop app with Electron.md index eb11c65614..8daeb4655d 100644 --- a/sources/tech/20190410 How we built a Linux desktop app with Electron.md +++ b/sources/tech/20190410 How we built a Linux desktop app with Electron.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2a74f87f4f83789cb699f9e88a47dd1f4e1047ca Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 Jun 2019 12:22:44 +0800 Subject: [PATCH 0813/1154] TSL:20190410 How we built a Linux desktop app with Electron.md --- ...built a Linux desktop app with Electron.md | 101 ------------------ ...built a Linux desktop app with Electron.md | 98 +++++++++++++++++ 2 files changed, 98 insertions(+), 101 deletions(-) delete mode 100644 sources/tech/20190410 How we built a Linux desktop app with Electron.md create mode 100644 translated/tech/20190410 How we built a Linux desktop app with Electron.md diff --git a/sources/tech/20190410 How we built a Linux desktop app with Electron.md b/sources/tech/20190410 How we built a Linux desktop app with Electron.md deleted file mode 100644 index 8daeb4655d..0000000000 --- a/sources/tech/20190410 How we built a Linux desktop app with Electron.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How we built a Linux desktop app with Electron) -[#]: via: (https://opensource.com/article/19/4/linux-desktop-electron) -[#]: author: (Nils Ganther https://opensource.com/users/nils-ganther) - -How we built a Linux desktop app with Electron -====== -A story of building an open source email service that runs natively on -Linux desktops, thanks to the Electron framework. -![document sending][1] - -[Tutanota][2] is a secure, open source email service that's been available as an app for the browser, iOS, and Android. The client code is published under GPLv3 and the Android app is available on [F-Droid][3] to enable everyone to use a completely Google-free version. - -Because Tutanota focuses on open source and develops on Linux clients, we wanted to release a desktop app for Linux and other platforms. Being a small team, we quickly ruled out building native apps for Linux, Windows, and MacOS and decided to adapt our app using [Electron][4]. - -Electron is the go-to choice for anyone who wants to ship visually consistent, cross-platform applications, fast—especially if there's already a web app that needs to be freed from the shackles of the browser API. Tutanota is exactly such a case. - -Tutanota is based on [SystemJS][5] and [Mithril][6] and aims to offer simple, secure email communications for everybody. As such, it has to provide a lot of the standard features users expect from any email client. - -Some of these features, like basic push notifications, search for text and contacts, and support for two-factor authentication are easy to offer in the browser thanks to modern APIs and standards. Other features (such as automatic backups or IMAP support without involving our servers) need less-restricted access to system resources, which is exactly what the Electron framework provides. - -While some criticize Electron as "just a basic wrapper," it has obvious benefits: - - * Electron enables you to adapt a web app quickly for Linux, Windows, and MacOS desktops. In fact, most Linux desktop apps are built with Electron. - * Electron enables you to easily bring the desktop client to feature parity with the web app. - * Once you've published the desktop app, you can use free development capacity to add desktop-specific features that enhance usability and security. - * And last but certainly not least, it's a great way to make the app feel native and integrated into the user's system while maintaining its identity. - - - -### Meeting users' needs - -At Tutanota, we do not rely on big investor money, rather we are a community-driven project. We grow our team organically based on the increasing number of users upgrading to our freemium service's paid plans. Listening to what users want is not only important to us, it is essential to our success. - -Offering a desktop client was users' [most-wanted feature][7] in Tutanota, and we are proud that we can now offer free beta desktop clients to all of our users. (We also implemented another highly requested feature—[search on encrypted data][8]—but that's a topic for another time.) - -We liked the idea of providing users with signed versions of Tutanota and enabling functions that are impossible in the browser, such as push notifications via a background process. Now we plan to add more desktop-specific features, such as IMAP support without depending on our servers to act as a proxy, automatic backups, and offline availability. - -We chose Electron because its combination of Chromium and Node.js promised to be the best fit for our small development team, as it required only minimal changes to our web app. It was particularly helpful to use the browser APIs for everything as we got started, slowly replacing those components with more native versions as we progressed. This approach was especially handy with attachment downloads and notifications. - -### Tuning security - -We were aware that some people cite security problems with Electron, but we found Electron's options for fine-tuning access in the web app quite satisfactory. You can use resources like the Electron's [security documentation][9] and Luca Carettoni's [Electron Security Checklist][10] to help prevent catastrophic mishaps with untrusted content in your web app. - -### Achieving feature parity - -The Tutanota web client was built from the start with a solid protocol for interprocess communication. We utilize web workers to keep user interface (UI) rendering responsive while encrypting and requesting data. This came in handy when we started implementing our mobile apps, which use the same protocol to communicate between the native part and the web view. - -That's why when we started building the desktop clients, a lot of bindings for things like native push notifications, opening mailboxes, and working with the filesystem were already there, so only the native (node) side had to be implemented. - -Another convenience was our build process using the [Babel transpiler][11], which allows us to write the entire codebase in modern ES6 JavaScript and mix-and-match utility modules between the different environments. This enabled us to speedily adapt the code for the Electron-based desktop apps. However, we encountered some challenges. - -### Overcoming challenges - -While Electron allows us to integrate with the different platforms' desktop environments pretty easily, you can't underestimate the time investment to get things just right! In the end, it was these little things that took up much more time than we expected but were also crucial to finish the desktop client project. - -The places where platform-specific code was necessary caused most of the friction: - - * Window management and the tray, for example, are still handled in subtly different ways on the three platforms. - * Registering Tutanota as the default mail program and setting up autostart required diving into the Windows Registry while making sure to prompt the user for admin access in a [UAC][12]-compatible way. - * We needed to use Electron's API for shortcuts and menus to offer even standard features like copy, paste, undo, and redo. - - - -This process was complicated a bit by users' expectations of certain, sometimes not directly compatible behavior of the apps on different platforms. Making the three versions feel native required some iteration and even some modest additions to the web app to offer a text search similar to the one in the browser. - -### Wrapping up - -Our experience with Electron was largely positive, and we completed the project in less than four months. Despite some rather time-consuming features, we were surprised about the ease with which we could ship a beta version of the [Tutanota desktop client for Linux][13]. If you're interested, you can dive into the source code on [GitHub][14]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/linux-desktop-electron - -作者:[Nils Ganther][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/nils-ganther -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_paper_envelope_document.png?itok=uPj_kouJ (document sending) -[2]: https://tutanota.com/ -[3]: https://f-droid.org/en/packages/de.tutao.tutanota/ -[4]: https://electronjs.org/ -[5]: https://github.com/systemjs/systemjs -[6]: https://mithril.js.org/ -[7]: https://tutanota.uservoice.com/forums/237921-general/filters/top?status_id=1177482 -[8]: https://tutanota.com/blog/posts/first-search-encrypted-data/ -[9]: https://electronjs.org/docs/tutorial/security -[10]: https://www.blackhat.com/docs/us-17/thursday/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf -[11]: https://babeljs.io/ -[12]: https://en.wikipedia.org/wiki/User_Account_Control -[13]: https://tutanota.com/blog/posts/desktop-clients/ -[14]: https://www.github.com/tutao/tutanota diff --git a/translated/tech/20190410 How we built a Linux desktop app with Electron.md b/translated/tech/20190410 How we built a Linux desktop app with Electron.md new file mode 100644 index 0000000000..71cde8ec2f --- /dev/null +++ b/translated/tech/20190410 How we built a Linux desktop app with Electron.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How we built a Linux desktop app with Electron) +[#]: via: (https://opensource.com/article/19/4/linux-desktop-electron) +[#]: author: (Nils Ganther https://opensource.com/users/nils-ganther) + +我们是如何使用 Electron 构建 Linux 桌面应用程序的 +====== + +> 这是借助 Electron 框架,构建一个在 Linux 桌面上原生运行的开源电子邮件服务的故事。 + +![document sending][1] + +[Tutanota][2] 是一种安全的开源电子邮件服务,它可通过浏览器使用,也有 iOS 和 Android 应用。其客户端代码在 GPLv3 下发布,Android 应用程序可在 [F-Droid][3] 上找到,以便每个人都可以使用完全与 Google 无关的版本。 + +由于 Tutanota 关注开源和 Linux 客户端开发,因此我们希望为 Linux 和其他平台发布一个桌面应用程序。作为一个小团队,我们很快就排除了为 Linux、Windows 和 MacOS 构建原生应用程序的可能性,并决定使用 [Electron][4] 来构建我们的应用程序。 + +对于任何想要快速交付视觉一致的跨平台应用程序的人来说,Electron 是最适合的选择,尤其是如果你已经有一个 Web 应用程序,想要从浏览器 API 的束缚中摆脱出来时。Tutanota 就是这样一个案例。 + +Tutanota 基于 [SystemJS][5] 和 [Mithril][6],旨在为每个人提供简单、安全的电子邮件通信。 因此,它必须提供很多用户期望从电子邮件客户端获得的标准功能。 + +由于采用了现代 API 和标准,其中一些功能(如基本的推送通知、搜索文本和联系人以及支持双因素身份验证)很容易在浏览器中提供。其它功能(例如自动备份或无需我们的服务器中转的 IMAP 支持)需要对系统资源的限制性访问,而这正是 Electron 框架提供的功能。 + +虽然有人批评 Electron “只是一个基本的包装”,但它有明显的好处: + +* Electron 可以使你能够快速地为 Linux、Windows 和 MacOS 桌面构造 Web 应用。事实上,大多数 Linux 桌面应用都是使用 Electron 构建的。 +* Electron 可以轻松地将桌面客户端与 Web 应用程序达到同样的功能水准。 +* 发布桌面应用程序后,你可以自由使用开发功能添加桌面端特定的功能,从而增强可用性和安全性。 +* 最后但同样重要的是,这是让应用程序具备原生的感觉、融入用户系统,而同时保持其识别度的好方法。 +   +### 满足用户的需求 + +Tutanota 不依靠于大笔的投资资金,而是依靠社区驱动的项目。基于越来越多的用户升级到我们的免费服务的付费计划,我们有机地发展我们的团队。倾听用户的需求不仅对我们很重要,而且对我们的成功至关重要。 + +提供桌面客户端是 Tutanota 用户[最想要的功能][7],我们感到自豪的是,我们现在可以为所有用户提供免费的桌面客户端测试版。(我们还实现了另一个高度要求的功能 —— [搜索加密数据][8] —— 但这是另一个主题了。) + +我们喜欢为用户提供签名版本的 Tutanota 并支持浏览器中无法实现的功能,例如通过后台进程推送通知。 现在,我们计划添加更多特定于桌面的功能,例如 IMAP 支持(而不依赖于我们的服务器充当代理),自动备份和离线可用性。 + +我们选择 Electron 是因为它的 Chromium 和 Node.js 的组合最适合我们的小型开发团队,因为它只需要对我们的 Web 应用程序进行最小的更改。在我们开始使用时,可以将浏览器 API 用于所有功能特别有用,随着我们的进展,慢慢地用更多原生版本替换这些组件。这种方法对附件下载和通知特别方便。 + +### 调整安全性 + +我们知道有些人关注 Electron 的安全问题,但我们发现 Electron 在 Web 应用程序中微调访问的选项非常令人满意。你可以使用 Electron 的[安全文档][9]和 Luca Carettoni 的[Electron 安全清单][10]等资源,来帮助防止 Web 应用程序中不受信任的内容发生灾难性事故。 + +### 实现特定功能 + +Tutanota Web 客户端从一开始就构建了一个用于进程间通信的可靠协议。我们利用 Web 线程在加密和请求数据时保持用户界面(UI)响应性。当我们开始实现我们的移动应用时,这就派上用场,这些应用程序使用相同的协议在原生部分和 Web 视图之间进行通信。 + +这就是为什么当我们开始构建桌面客户端时,很多用于本机推送通知、打开邮箱和使用文件系统的部分等已经存在,因此只需要实现原生端(Node.js)。 + +另一个便利是我们的构建过程使用 [Babel 转译器][11],它允许我们以现代 ES6 JavaScript 编写整个代码库,并在不同环境之间混合和匹配功能模块。这使我们能够快速调整基于 Electron 的桌面应用程序的代码。但是,我们也遇到了一些挑战。 + +### 克服挑战 + +虽然 Electron 允许我们很容易地与不同平台的桌面环境集成,但你不能低估投入的时间!最后,正是这些小事情占用了比我们预期更多的时间,但对完成桌面客户端项目也至关重要。 + +特定于平台的代码导致了大部分阻碍: + +* 例如,窗口管理和托盘仍然在三个平台上以略有不同的方式处理。 +* 注册 Tutanota 作为默认邮件程序并设置自动启动需要深入 Windows 注册表,同时确保以 [UAC] [12] 兼容的方式提示用户进行管理员访问。 +* 我们需要使用 Electron 的 API 作为快捷方式和菜单,以提供复制、粘贴、撤消和重做等标准功能。 + +由于用户对不同平台上的应用程序的某些(有时不直接兼容)行为的期望,此过程有点复杂。使三个版本感觉像原生的需要一些迭代,甚至需要对 Web 应用程序进行一些适度的补充,以提供类似于浏览器中的文本搜索的功能。 + +### 总结 + +我们在 Electron 方面的经验基本上是积极的,我们在不到四个月的时间内完成了该项目。尽管有一些相当耗时的功能,但我们感到惊讶的是,我们可以轻松地为 Linux 提供一个测试版的 [Tutanota 桌面客户端][13]。如果你有兴趣,可以深入了解 [GitHub][14] 上的源代码。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/linux-desktop-electron + +作者:[Nils Ganther][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/nils-ganther +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_paper_envelope_document.png?itok=uPj_kouJ (document sending) +[2]: https://tutanota.com/ +[3]: https://f-droid.org/en/packages/de.tutao.tutanota/ +[4]: https://electronjs.org/ +[5]: https://github.com/systemjs/systemjs +[6]: https://mithril.js.org/ +[7]: https://tutanota.uservoice.com/forums/237921-general/filters/top?status_id=1177482 +[8]: https://tutanota.com/blog/posts/first-search-encrypted-data/ +[9]: https://electronjs.org/docs/tutorial/security +[10]: https://www.blackhat.com/docs/us-17/thursday/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf +[11]: https://babeljs.io/ +[12]: https://en.wikipedia.org/wiki/User_Account_Control +[13]: https://tutanota.com/blog/posts/desktop-clients/ +[14]: https://www.github.com/tutao/tutanota From f2d1196d85c0e465175ecf1fc4931e89ed8c3403 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 10 Jun 2019 12:32:29 +0800 Subject: [PATCH 0814/1154] PRF&PUB:20190410 How we built a Linux desktop app with Electron.md @wxy https://linux.cn/article-10957-1.html --- ...0 How we built a Linux desktop app with Electron.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20190410 How we built a Linux desktop app with Electron.md (97%) diff --git a/translated/tech/20190410 How we built a Linux desktop app with Electron.md b/published/20190410 How we built a Linux desktop app with Electron.md similarity index 97% rename from translated/tech/20190410 How we built a Linux desktop app with Electron.md rename to published/20190410 How we built a Linux desktop app with Electron.md index 71cde8ec2f..2afe6f57d6 100644 --- a/translated/tech/20190410 How we built a Linux desktop app with Electron.md +++ b/published/20190410 How we built a Linux desktop app with Electron.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10957-1.html) [#]: subject: (How we built a Linux desktop app with Electron) [#]: via: (https://opensource.com/article/19/4/linux-desktop-electron) [#]: author: (Nils Ganther https://opensource.com/users/nils-ganther) @@ -12,7 +12,7 @@ > 这是借助 Electron 框架,构建一个在 Linux 桌面上原生运行的开源电子邮件服务的故事。 -![document sending][1] +![document sending](https://img.linux.net.cn/data/attachment/album/201906/10/123114abz0lvbllktkulx7.jpg) [Tutanota][2] 是一种安全的开源电子邮件服务,它可通过浏览器使用,也有 iOS 和 Android 应用。其客户端代码在 GPLv3 下发布,Android 应用程序可在 [F-Droid][3] 上找到,以便每个人都可以使用完全与 Google 无关的版本。 @@ -76,7 +76,7 @@ via: https://opensource.com/article/19/4/linux-desktop-electron 作者:[Nils Ganther][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1c992a71544c11fbff7486ae0ba2bac0fdb72520 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:33:49 +0800 Subject: [PATCH 0815/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=205=20?= =?UTF-8?q?Easy=20Ways=20To=20Free=20Up=20Space=20(Remove=20Unwanted=20or?= =?UTF-8?q?=20Junk=20Files)=20on=20Ubuntu=20sources/tech/20190610=205=20Ea?= =?UTF-8?q?sy=20Ways=20To=20Free=20Up=20Space=20(Remove=20Unwanted=20or=20?= =?UTF-8?q?Junk=20Files)=20on=20Ubuntu.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...emove Unwanted or Junk Files) on Ubuntu.md | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md diff --git a/sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md b/sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md new file mode 100644 index 0000000000..9d5df1605a --- /dev/null +++ b/sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: 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 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu +====== + +Most of us may perform this action whenever we fall into out of disk space on system. + +Most of us may perform this action whenever we are running out of space on Linux system + +It should be performed frequently, to make space for installing a new application and dealing with other files. + +Housekeeping is one of the routine task of Linux administrator, which allow them to maintain the disk utilization is in under threshold. + +There are several ways we can clean up our system space. + +There is no need to clean up your system when you have TB of storage capacity. + +But if your have limited space then freeing up disk space becomes a necessity. + +In this article, I’ll show you some of the easiest or simple ways to clean up your Ubuntu system and get more space. + +### How To Check Free Space On Ubuntu Systems? + +Use **[df Command][1]** to check current disk utilization on your system. + +``` +$ df -h +Filesystem Size Used Avail Use% Mounted on +udev 975M 0 975M 0% /dev +tmpfs 200M 1.7M 198M 1% /run +/dev/sda1 30G 16G 13G 55% / +tmpfs 997M 0 997M 0% /dev/shm +tmpfs 5.0M 4.0K 5.0M 1% /run/lock +tmpfs 997M 0 997M 0% /sys/fs/cgroup +``` + +GUI users can use “Disk Usage Analyzer tool” to view current usage. +[![][2]![][2]][3] + +### 1) Remove The Packages That Are No Longer Required + +The following command removes the dependency libs and packages that are no longer required by the system. + +These packages were installed automatically to satisfy the dependencies of an installed package. + +Also, it removes old Linux kernels that were installed in the system. + +It removes orphaned packages which are not longer needed from the system, but not purges them. + +``` +$ sudo apt-get autoremove +[sudo] password for daygeek: +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages will be REMOVED: + apache2-bin apache2-data apache2-utils galera-3 libaio1 libapr1 libaprutil1 + libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig-inifiles-perl libdbd-mysql-perl + libdbi-perl libjemalloc1 liblua5.2-0 libmysqlclient20 libopts25 + libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common + mariadb-server-10.1 mariadb-server-core-10.1 mysql-common sntp socat +0 upgraded, 0 newly installed, 25 to remove and 23 not upgraded. +After this operation, 189 MB disk space will be freed. +Do you want to continue? [Y/n] +``` + +To purge them, use the `--purge` option together with the command for that. + +``` +$ sudo apt-get autoremove --purge +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages will be REMOVED: + apache2-bin* apache2-data* apache2-utils* galera-3* libaio1* libapr1* libaprutil1* + libaprutil1-dbd-sqlite3* libaprutil1-ldap* libconfig-inifiles-perl* + libdbd-mysql-perl* libdbi-perl* libjemalloc1* liblua5.2-0* libmysqlclient20* + libopts25* libterm-readkey-perl* mariadb-client-10.1* mariadb-client-core-10.1* + mariadb-common* mariadb-server-10.1* mariadb-server-core-10.1* mysql-common* sntp* + socat* +0 upgraded, 0 newly installed, 25 to remove and 23 not upgraded. +After this operation, 189 MB disk space will be freed. +Do you want to continue? [Y/n] +``` + +### 2) Empty The Trash Can + +There might a be chance, that you may have a large amount of useless data residing in your trash can. + +It takes up your system space. This is one of the best way to clear up those and get some free space on your system. + +To clean up this, simple use the file manager to empty your trash can. +[![][2]![][2]][4] + +### 3) Clean up the APT cache + +Ubuntu uses **[APT Command][5]** (Advanced Package Tool) for package management like installing, removing, searching, etc,. + +By default every Linux operating system keeps a cache of downloaded and installed packages on their respective directory. + +Ubuntu also does the same, it keeps every updates it downloads and installs in a cache on your disk. + +Ubuntu system keeps a cache of DEB packages in /var/cache/apt/archives directory. + +Over time, this cache can quickly grow and hold a lot of space on your system. + +Run the following command to check the current utilization of APT cache. + +``` +$ sudo du -sh /var/cache/apt +147M /var/cache/apt +``` + +It cleans obsolete deb-packages. I mean to say, less than clean. + +``` +$ sudo apt-get autoclean +``` + +It removes all packages kept in the apt cache. + +``` +$ sudo apt-get clean +``` + +### 4) Uninstall the unused applications + +I would request you to check the installed packages and games on your system and delete them if you are using rarely. + +This can be easily done via “Ubuntu Software Center”. +[![][2]![][2]][6] + +### 5) Clean up the thumbnail cache + +The cache folder is a place where programs stored data they may need again, it is kept for speed but is not essential to keep. It can be generated again or downloaded again. + +If it’s really filling up your hard drive then you can delete things without worrying. + +Run the following command to check the current utilization of APT cache. + +``` +$ du -sh ~/.cache/thumbnails/ +412K /home/daygeek/.cache/thumbnails/ +``` + +Run the following command to delete them permanently from your system. + +``` +$ rm -rf ~/.cache/thumbnails/* +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-remove-delete-unwanted-junk-files-free-up-space-ubuntu-mint-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/how-to-check-disk-space-usage-using-df-command/ +[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[3]: https://www.2daygeek.com/wp-content/uploads/2019/06/remove-delete-Unwanted-Junk-Files-free-up-space-ubuntu-mint-debian-1.jpg +[4]: https://www.2daygeek.com/wp-content/uploads/2019/06/remove-delete-Unwanted-Junk-Files-free-up-space-ubuntu-mint-debian-2.jpg +[5]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[6]: https://www.2daygeek.com/wp-content/uploads/2019/06/remove-delete-Unwanted-Junk-Files-free-up-space-ubuntu-mint-debian-3.jpg From 100f2077fe86cf1f58b277658a6c0d91f57e1114 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:35:20 +0800 Subject: [PATCH 0816/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190605=20Twea?= =?UTF-8?q?king=20the=20look=20of=20Fedora=20Workstation=20with=20themes?= =?UTF-8?q?=20sources/tech/20190605=20Tweaking=20the=20look=20of=20Fedora?= =?UTF-8?q?=20Workstation=20with=20themes.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... look of Fedora Workstation with themes.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20190605 Tweaking the look of Fedora Workstation with themes.md diff --git a/sources/tech/20190605 Tweaking the look of Fedora Workstation with themes.md b/sources/tech/20190605 Tweaking the look of Fedora Workstation with themes.md new file mode 100644 index 0000000000..441415925f --- /dev/null +++ b/sources/tech/20190605 Tweaking the look of Fedora Workstation with themes.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tweaking the look of Fedora Workstation with themes) +[#]: via: (https://fedoramagazine.org/tweaking-the-look-of-fedora-workstation-with-themes/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +Tweaking the look of Fedora Workstation with themes +====== + +![][1] + +Changing the theme of a desktop environment is a common way to customize your daily experience with Fedora Workstation. This article discusses the 4 different types of visual themes you can change and how to change to a new theme. Additionally, this article will cover how to install new themes from both the Fedora repositories and 3rd party theme sources. + +### Theme Types + +When changing the theme of Fedora Workstation, there are 4 different themes that can be changed independently of each other. This allows a user to mix and match the theme types to customize their desktop in a multitude of combinations. The 4 theme types are the **Application** (GTK) theme, the **shell** theme, the **icon** theme, and the **cursor** theme. + +#### Application (GTK) themes + +As the name suggests, Application themes change the styling of the applications that are displayed on a user’s desktop. Application themes control the style of the window borders and the window titlebar. Additionally, they also control the style of the widgets in the windows — like dropdowns, text inputs, and buttons. One point to note is that an application theme does not change the icons that are displayed in an application — this is achieved using the icon theme. + +![Two application windows with two different application themes. The default Adwaita theme on the left, the Adapta theme on the right.][2] + +Application themes are also known as GTK themes, as GTK ( **G** IMP **T** ool **k** it) is the underlying technology that is used to render the windows and user interface widgets in those windows on Fedora Workstation. + +#### Shell Themes + +Shell themes change the appearance of the GNOME Shell. The GNOME Shell is the technology that displays the top bar (and the associated widgets like drop downs), as well as the overview screen and the applications list it contains. + +![Comparison of two Shell themes, with the Fedora Workstation default on top, and the Adapta shell theme on the bottom.][3] + +#### Icon Themes + +As the name suggests, icon themes change the icons used in the desktop. Changing the icon theme will change the icons displayed both in the Shell, and in applications. + +![Comparison of two icon themes, with the Fedora 30 Workstation default Adwaita on the left, and the Yaru icon theme on the right][4] + +One important item to note with icon themes is that all icon themes will not have customized icons for all application icons. Consequently, changing the icon theme will not change all the icons in the applications list in the overview. + +![Comparison of two icon themes, with the Fedora 30 Workstation default Adwaita on the top, and the Yaru icon theme on the bottom][5] + +#### Cursor Theme + +The cursor theme allows a user to change how the mouse pointer is displayed. Most cursor themes change all the common cursors, including the pointer, drag handles and the loading cursor. + +![Comparison of multiple cursors of two different cursor themes. Fedora 30 default is on the left, the Breeze Snow theme on the right.][6] + +### Changing the themes + +Changing themes on Fedora Workstation is a simple process. To change all 4 types of themes, use the **Tweaks** application. Tweaks is a tool used to change a range of different options in Fedora Workstation. It is not installed by default, and is installed using the Software application: + +![][7] + +Alternatively, install Tweaks from the command line with the command: + +``` +sudo dnf install gnome-tweak-tool +``` + +In addition to Tweaks, to change the Shell theme, the **User Themes** GNOME Shell Extension needs to be installed and enabled. [Check out this post for more details on installing extensions][8]. + +Next, launch Tweaks, and switch to the Appearance pane. The Themes section in the Appearance pane allows the changing of the multiple theme types. Simply choose the theme from the dropdown, and the new theme will apply automatically. + +![][9] + +### Installing themes + +Armed with the knowledge of the types of themes, and how to change themes, it is time to install some themes. Broadly speaking, there are two ways to install new themes to your Fedora Workstation — installing theme packages from the Fedora repositories, or manually installing a theme. One point to note when installing themes, is that you may need to close and re-open the Tweaks application to make a newly installed theme appear in the dropdowns. + +#### Installing from the Fedora repositories + +The Fedora repositories contain a small selection of additional themes that once installed are available to we chosen in Tweaks. Theme packages are not available in the Software application, and have to be searched for and installed via the command line. Most theme packages have a consistent naming structure, so listing available themes is pretty easy. + +To find Application (GTK) themes use the command: + +``` +dnf search gtk | grep theme +``` + +To find Shell themes: + +``` +dnf search shell-theme +``` + +Icon themes: + +``` +dnf search icon-theme +``` + +Cursor themes: + +``` +dnf search cursor-theme +``` + +Once you have found a theme to install, install the theme using dnf. For example: + +``` +sudo dnf install numix-gtk-theme +``` + +#### Installing themes manually + +For a wider range of themes, there are a plethora of places on the internet to find new themes to use on Fedora Workstation. Two popular places to find themes are [OpenDesktop][10] and [GNOMELook][11]. + +Typically when downloading themes from these sites, the themes are encapsulated in an archive like a tar.gz or zip file. In most cases, to install these themes, simply extract the contents into the correct directory, and the theme will appear in Tweaks. Note too, that themes can be installed either globally (must be done using sudo) so all users on the system can use them, or can be installed just for the current user. + +For Application (GTK) themes, and GNOME Shell themes, extract the archive to the **.themes/** directory in your home directory. To install for all users, extract to **/usr/share/themes/** + +For Icon and Cursor themes, extract the archive to the **.icons/** directory in your home directory. To install for all users, extract to **/usr/share/icons/** + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/tweaking-the-look-of-fedora-workstation-with-themes/ + +作者:[Ryan Lerch][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/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/themes.png-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2019/06/application-theme-1024x514.jpg +[3]: https://fedoramagazine.org/wp-content/uploads/2019/06/overview-theme-1024x649.jpg +[4]: https://fedoramagazine.org/wp-content/uploads/2019/06/icon-theme-application-1024x441.jpg +[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/overview-icons-1024x637.jpg +[6]: https://fedoramagazine.org/wp-content/uploads/2019/06/cursortheme-1024x467.jpg +[7]: https://fedoramagazine.org/wp-content/uploads/2019/06/tweaks-in-software-1024x725.png +[8]: https://fedoramagazine.org/install-extensions-via-software-application/ +[9]: https://fedoramagazine.org/wp-content/uploads/2019/06/tweaks-choose-themes.png +[10]: https://www.opendesktop.org/ +[11]: https://www.gnome-look.org/ From 83c4c6d8289a8186d813db1ce9ca51ff9a397b30 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:35:39 +0800 Subject: [PATCH 0817/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=20Grav?= =?UTF-8?q?iton:=20A=20Minimalist=20Open=20Source=20Code=20Editor=20source?= =?UTF-8?q?s/tech/20190610=20Graviton-=20A=20Minimalist=20Open=20Source=20?= =?UTF-8?q?Code=20Editor.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n- A Minimalist Open Source Code Editor.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md diff --git a/sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md b/sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md new file mode 100644 index 0000000000..6da49ddcaa --- /dev/null +++ b/sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Graviton: A Minimalist Open Source Code Editor) +[#]: via: (https://itsfoss.com/graviton-code-editor/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Graviton: A Minimalist Open Source Code Editor +====== + +[Graviton][1] is a free and open source, cross-platform code editor in development. The sixteen years old developer, Marc Espin, emphasizes that it is a ‘minimalist’ code editor. I am not sure about that but it does have a clean user interface like other [modern code editors like Atom][2]. + +![Graviton Code Editor Interface][3] + +The developer also calls it a lightweight code editor despite the fact that Graviton is based on [Electron][4]. + +Graviton comes with features you expect in any standard code editors like syntax highlighting, auto-completion etc. Since Graviton is still in the beta phase of development, more features will be added to it in the future releases. + +![Graviton Code Editor with Syntax Highlighting][5] + +### Feature of Graviton code editor + +Some of the main highlights of Graviton features are: + + * Syntax highlighting for a number of programming languages using [CodeMirrorJS][6] + * Autocomplete + * Support for plugins and themes. + * Available in English, Spanish and a few other European languages. + * Available for Linux, Windows and macOS. + + + +I had a quick look at Graviton and it might not be as feature-rich as [VS Code][7] or [Brackets][8], but for some simple code editing, it’s not a bad tool. + +### Download and install Graviton + +![Graviton Code Editor][9] + +As mentioned earlier, Graviton is a cross-platform code editor available for Linux, Windows and macOS. It is still in beta stages which means that you more features will be added in future and you may encounter some bugs. + +You can find the latest version of Graviton on its release page. Debian and [Ubuntu users can install it from .deb file][10]. [AppImage][11] has been provided so that it could be used in other distributions. DMG and EXE files are also available for macOS and Windows respectively. + +[Download Graviton][12] + +If you are interested, you can find the source code of Graviton on its GitHub repository: + +[Graviton Source Code on GitHub][13] + +If you decided to use Graviton and find some issues, please open a bug report [here][14]. If you use GitHub, you may want to star the Graviton project. This boosts the morale of the developer as he would know that more users are appreciating his efforts. + +[][15] + +Suggested read Get Windows Style Sticky Notes For Ubuntu with Indicator Stickynotes + +I believe you know [how to install a software from source code][16] if you are taking that path. + +**In the end…** + +Sometimes, simplicity itself becomes a feature and the Graviton’s focus on being minimalist could help it form a niche for itself in the already crowded segment of code editors. + +At It’s FOSS, we try to highlight open source software. If you know some interesting open source software that you would like more people to know about, [do send us a note][17]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/graviton-code-editor/ + +作者:[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://graviton.ml/ +[2]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-interface.jpg?resize=800%2C571&ssl=1 +[4]: https://electronjs.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-interface-2.jpg?resize=800%2C522&ssl=1 +[6]: https://codemirror.net/ +[7]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[8]: https://itsfoss.com/install-brackets-ubuntu/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-800x473.jpg?resize=800%2C473&ssl=1 +[10]: https://itsfoss.com/install-deb-files-ubuntu/ +[11]: https://itsfoss.com/use-appimage-linux/ +[12]: https://github.com/Graviton-Code-Editor/Graviton-App/releases +[13]: https://github.com/Graviton-Code-Editor/Graviton-App +[14]: https://github.com/Graviton-Code-Editor/Graviton-App/issues +[15]: https://itsfoss.com/indicator-stickynotes-windows-like-sticky-note-app-for-ubuntu/ +[16]: https://itsfoss.com/install-software-from-source-code/ +[17]: https://itsfoss.com/contact-us/ From 8072587e7bec239d917a3557d120eee85b291b08 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:35:49 +0800 Subject: [PATCH 0818/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190607=20Free?= =?UTF-8?q?=20and=20Open=20Source=20Trello=20Alternative=20OpenProject=209?= =?UTF-8?q?=20Released=20sources/tech/20190607=20Free=20and=20Open=20Sourc?= =?UTF-8?q?e=20Trello=20Alternative=20OpenProject=209=20Released.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ello Alternative OpenProject 9 Released.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md diff --git a/sources/tech/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md b/sources/tech/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md new file mode 100644 index 0000000000..8c5c5decf9 --- /dev/null +++ b/sources/tech/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: 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/ From eea2909f9a69720edb89276408833a7c132872b5 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:36:00 +0800 Subject: [PATCH 0819/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20Zori?= =?UTF-8?q?n=20OS=20Becomes=20Even=20More=20Awesome=20With=20Zorin=2015=20?= =?UTF-8?q?Release=20sources/tech/20190606=20Zorin=20OS=20Becomes=20Even?= =?UTF-8?q?=20More=20Awesome=20With=20Zorin=2015=20Release.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Even More Awesome With Zorin 15 Release.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md diff --git a/sources/tech/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md b/sources/tech/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md new file mode 100644 index 0000000000..c7dc93c70a --- /dev/null +++ b/sources/tech/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Zorin OS Becomes Even More Awesome With Zorin 15 Release) +[#]: via: (https://itsfoss.com/zorin-os-15-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Zorin OS Becomes Even More Awesome With Zorin 15 Release +====== + +Zorin OS has always been known as one of the [beginner-focused Linux distros][1] out there. Yes, it may not be the most popular – but it sure is a good distribution specially for Windows migrants. + +A few years back, I remember, a friend of mine always insisted me to install [Zorin OS][2]. Personally, I didn’t like the UI back then. But, now that Zorin OS 15 is here – I have more reasons to get it installed as my primary OS. + +Fret not, in this article, we’ll talk about everything that you need to know. + +### New Features in Zorin 15 + +Let’s see the major changes in the latest release of Zorin. Zorin 15 is based on Ubuntu 18.04.2 and thus it brings the performance improvement under the hood. Other than that, there are several UI (User Interface) improvements. + +#### Zorin Connect + +![Zorin Connect][3] + +Zorin OS 15’s main highlight is – Zorin Connect. If you have an Android device, you are in for a treat. Similar to [PushBullet][4], [Zorin Connect][5] integrates your phone with the desktop experience. + +You get to sync your smartphone’s notifications on your desktop while also being able to reply to it. Heck, you can also reply to the SMS messages and view those conversations. + +In addition to these, you get the following abilities: + + * Share files and web links between devices + * Use your phone as a remote control for your computer + * Control media playback on your computer from your phone, and pause playback automatically when a phone call arrives + + + +As mentioned in their [official announcement post][6], the data transmission will be on your local network and no data will be transmitted to the cloud. To access Zorin Connect, navigate your way through – Zorin menu > System Tools > Zorin Connect. + +[Get ZORIN CONNECT ON PLAY STORE][5] + +#### New Desktop Theme (with dark mode!) + +![Zorin Dark Mode][7] + +I’m all in when someone mentions “Dark Mode” or “Dark Theme”. For me, this is the best thing that comes baked in with Zorin OS 15. + +[][8] + +Suggested read Necuno is a New Open Source Smartphone Running KDE + +It’s so pleasing to my eyes when I enable the dark mode on anything, you with me? + +Not just a dark theme, the UI is a lot cleaner and intuitive with subtle new animations. You can find all the settings from the Zorin Appearance app built-in. + +#### Adaptive Background & Night Light + +You get an option to let the background adapt according to the brightness of the environment every hour of the day. Also, you can find the night mode if you don’t want the blue light to stress your eyes. + +#### To do app + +![Todo][9] + +I always wanted this to happen so that I don’t have to use a separate service that offers a Linux client to add my tasks. It’s good to see a built-in app with integration support for Google Tasks and Todoist. + +#### There’s More? + +Yes! Other major changes include the support for Flatpak, a touch layout for convertible laptops, a DND mode, and some redesigned apps (Settings, Libre Office) to give you better user experience. + +If you want the detailed list of changes along with the minor improvements, you can follow the [announcement post][6]. If you are already a Zorin user, you would notice that they have refreshed their website with a new look as well. + +### Download Zorin OS 15 + +**Note** : _Direct upgrades from Zorin OS 12 to 15 – without needing to re-install the operating system – will be available later this year._ + +In case you didn’t know, there are three versions of Zorin OS – Ultimate, Core, and the Lite version. + +If you want to support the devs and the project while unlocking the full potential of Zorin OS, you should get the ultimate edition for $39. + +If you just want the essentials, the core edition will do just fine (which you can download for free). In either case, if you have an old computer, the lite version is the one to go with. + +[DOWNLOAD ZORIN OS 15][10] + +**What do you think of Zorin 15?** + +[][11] + +Suggested read Ubuntu 14.04 Codenamed Trusty Tahr + +I’m definitely going to give it a try as my primary OS – fingers crossed. What about you? What do you think about the latest release? Feel free to let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zorin-os-15-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://itsfoss.com/best-linux-beginners/ +[2]: https://zorinos.com/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/zorin-connect.jpg?fit=800%2C473&ssl=1 +[4]: https://www.pushbullet.com/ +[5]: https://play.google.com/store/apps/details?id=com.zorinos.zorin_connect&hl=en_IN +[6]: https://zoringroup.com/blog/2019/06/05/zorin-os-15-is-here-faster-easier-more-connected/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/zorin-dark-mode.jpg?fit=722%2C800&ssl=1 +[8]: https://itsfoss.com/necunos-linux-smartphone/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/Todo.jpg?fit=800%2C652&ssl=1 +[10]: https://zorinos.com/download/ +[11]: https://itsfoss.com/ubuntu-1404-codenamed-trusty-tahr/ From 91ab63492039940b8fb8b82b07ead3634e9657b8 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:36:17 +0800 Subject: [PATCH 0820/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=20Try?= =?UTF-8?q?=20a=20new=20game=20on=20Free=20RPG=20Day=20sources/tech/201906?= =?UTF-8?q?10=20Try=20a=20new=20game=20on=20Free=20RPG=20Day.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20190610 Try a new game on Free RPG Day.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20190610 Try a new game on Free RPG Day.md diff --git a/sources/tech/20190610 Try a new game on Free RPG Day.md b/sources/tech/20190610 Try a new game on Free RPG Day.md new file mode 100644 index 0000000000..81319ce84f --- /dev/null +++ b/sources/tech/20190610 Try a new game on Free RPG Day.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Try a new game on Free RPG Day) +[#]: via: (https://opensource.com/article/19/5/free-rpg-day) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/erez/users/seth) + +Try a new game on Free RPG Day +====== +Celebrate tabletop role-playing games and get free RPG materials at your +local game shop on June 15. +![plastic game pieces on a board][1] + +Have you ever thought about trying Dungeons & Dragons but didn't know how to start? Did you play Traveller in your youth and have been thinking about returning to the hobby? Are you curious about role-playing games (RPGs) but not sure whether you want to play one? Are you completely new to the concept of tabletop gaming and have never heard of RPGs until now? It doesn't matter which of these profiles suits you, because [Free RPG Day][2] is for everyone! + +The first Free RPG Day event happened in 2007 at hobby game stores all over the world. The idea was to bring new and exclusive RPG quickstart rules and adventures to both new and experienced gamers for $0. For one day, you could walk into your local game store and get a booklet containing simple, beginner-level rules for a tabletop RPG, which you could play with people there in the store or with friends back home. The booklet was yours to keep forever. + +The event was such a smash hit that the tradition has continued ever since. This year, Free RPG Day is scheduled for Saturday, June 15. + +### What's the catch? + +Obviously, the idea behind Free RPG Day is to get you addicted to tabletop RPG gaming. Before you let instinctual cynicism kick in, consider that as addictions go, it's not too bad to fall in love with a game that encourages you to read books of rules and lore so you and your family and friends have an excuse to spend time together. Tabletop RPGs are a powerful, imaginative, and fun medium, and Free RPG Day is a great introduction. + +![FreeRPG Day logo][3] + +### Open gaming + +Like so many other industries, the open source phenomenon has influenced tabletop gaming. Way back at the turn of the century, [Wizards of the Coast][4], purveyors of Magic: The Gathering and Dungeons & Dragons, decided to adopt open source methodology by developing the [Open Game License][5] (OGL). They used this license for editions 3 and 3.5 of the world's first RPG (Dungeons & Dragons). When they faltered years later for the 4th Edition, the publisher of _Dragon_ magazine forked the "code" of D &D 3.5, publishing its remix as the Pathfinder RPG, keeping innovation and a whole cottage industry of third-party game developers healthy. Recently, Wizards of the Coast returned to the OGL for D&D 5e. + +The OGL allows developers to use, at the very least, a game's mechanics in a product of their own. You may or may not be allowed to use the names of custom monsters, weapons, kingdoms, or popular characters, but you can always use the rules and maths of an OGL game. In fact, the rules of an OGL game are often published for free as a [system reference document][6] (SRD) so, whether you purchase a copy of the rule book or not, you can learn how a game is played. + +If you've never played a tabletop RPG before, it may seem strange that a game played with pen and paper can have a game engine, but computation is computation whether it's digital or analog. As a simplified example: suppose a game engine dictates that a player character has a number to represent its strength. When that player character fights a giant twice its strength, there's real tension when a player rolls dice to add to her character's strength-based attack. Without a very good roll, her strength won't match the giant's. Knowing this, a third-party or independent developer can design a monster for this game engine with an understanding of the effects that dice rolls can have on a player's ability score. This means they can base their math on the game engine's precedence. They can design a slew of monsters to slay, with meaningful abilities and skills in the context of the game engine, and they can advertise compatibility with that engine. + +Furthermore, the OGL allows a publisher to define _product identity_ for their material. Product identity can be anything from the trade dress of the publication (graphical elements and layout), logos, terminology, lore, proper names, and so on. Anything defined as product identity may _not_ be reused without publisher consent. For example, suppose a publisher releases a book of weapons including a magical machete called Sigint, granting a +2 magical bonus to all of its attacks against zombies. This trait is explained by a story about how the machete was forged by a scientist with a latent zombie gene. However, the publication lists in section 1e of the OGL that all proper names of weapons are reserved as product identity. This means you can use the numbers (durability of the weapon, the damage it deals, the +2 magical bonus, and so on) and the lore associated with the sword (it was forged by a latent zombie) in your own publication, but you cannot use the name of the weapon (Sigint). + +The OGL is an extremely flexible license, so developers must read section 1e carefully. Some publishers reserve nothing but the layout of the publication itself, while others reserve everything but the numbers and the most generic of terms. + +When the preeminent RPG franchise embraced open source, it sent waves through the industry that are still felt today. Third-party developers can create content for the 5e and Pathfinder systems. A whole website, [DungeonMastersGuild.com][7], featuring independent content for D&D 5e was created by Wizards of the Coast to promote independent publishing. Games like [Starfinder][8], [OpenD6][9], [Warrior, Rogue & Mage][10], [Swords & Wizardry][11], and many others have adopted the OGL. Other systems, like Brent Newhall's [Dungeon Delvers][12], [Fate][13], [Dungeon World][14], and many more are licensed under a [Creative Commons license][15]. + +### Get your RPG + +Free RPG Day is a day for you to go to your local gaming store, play an RPG, and get materials for future RPG games you play with friends. Like a [Linux installfest][16] or [Software Freedom Day][17], the event is loosely defined. Each retailer may do Free RPG Day a little differently, each one running whatever game they choose. However, the free content donated by game publishers is the same each year. Obviously, the free stuff is subject to availability, but when you go to a Free RPG Day event, notice how many games are offered with an open license (if it's an OGL game, the OGL is printed in the back matter of the book). Any content for Pathfinder, Starfinder, and D&D is sure to have taken some advantage of the OGL. Content for many other systems use Creative Commons licenses. Some, like the resurrected [Dead Earth][18] RPG from the '90s, use the [GNU Free Documentation License][19]. + +There are plenty of gaming resources out there that are developed with open licenses. You may or may not need to care about the license of a game; after all, the license has no bearing upon whether you can play it with friends or not. But if you enjoy supporting [free culture][20] in more ways than just the software you run, try out a few OGL or Creative Commons games. If you're new to gaming entirely, try out a tabletop RPG at your local game store on Free RPG Day! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/free-rpg-day + +作者:[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/erez/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-game-play-inclusive-diversity-collaboration.png?itok=8sUXV7W1 (plastic game pieces on a board) +[2]: https://www.freerpgday.com/ +[3]: https://opensource.com/sites/default/files/uploads/freerpgday-logoblank.jpg (FreeRPG Day logo) +[4]: https://company.wizards.com/ +[5]: http://www.opengamingfoundation.org/licenses.html +[6]: https://www.d20pfsrd.com/ +[7]: https://www.dmsguild.com/ +[8]: https://paizo.com/starfinder +[9]: https://ogc.rpglibrary.org/index.php?title=OpenD6 +[10]: http://www.stargazergames.eu/games/warrior-rogue-mage/ +[11]: https://froggodgames.com/frogs/product/swords-wizardry-complete-rulebook/ +[12]: http://brentnewhall.com/games/doku.php?id=games:dungeon_delvers +[13]: http://www.faterpg.com/licensing/licensing-fate-cc-by/ +[14]: http://dungeon-world.com/ +[15]: https://creativecommons.org/ +[16]: https://www.tldp.org/HOWTO/Installfest-HOWTO/introduction.html +[17]: https://www.softwarefreedomday.org/ +[18]: https://mixedsignals.ml/games/blog/blog_dead-earth +[19]: https://www.gnu.org/licenses/fdl-1.3.en.html +[20]: https://opensource.com/article/18/1/creative-commons-real-world From b70f24b0fe7de715466f5350d47ef4986611ad81 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:37:21 +0800 Subject: [PATCH 0821/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190608=20An?= =?UTF-8?q?=20open=20source=20bionic=20leg,=20Python=20data=20pipeline,=20?= =?UTF-8?q?data=20breach=20detection,=20and=20more=20news=20sources/tech/2?= =?UTF-8?q?0190608=20An=20open=20source=20bionic=20leg,=20Python=20data=20?= =?UTF-8?q?pipeline,=20data=20breach=20detection,=20and=20more=20news.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e, data breach detection, and more news.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md diff --git a/sources/tech/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md b/sources/tech/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md new file mode 100644 index 0000000000..6059a77fcb --- /dev/null +++ b/sources/tech/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An open source bionic leg, Python data pipeline, data breach detection, and more news) +[#]: via: (https://opensource.com/article/19/6/news-june-8) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +An open source bionic leg, Python data pipeline, data breach detection, and more news +====== +Catch up on the biggest open source headlines from the past two weeks. +![][1] + +In this edition of our open source news roundup, we take a look at an open source bionic leg, a new open source medical imaging organization, McKinsey's first open source release, and more! + +### Using open source to advance bionics + +A generation of people learned the term _bionics_ from the TV series **The Six Million Dollar Man** and **The Bionic Woman**. What was science fiction (although based on fact) is closer to becoming a reality thanks to prosthetic leg [designed by the University of Michigan and the Shirley Ryan AbilityLab][2]. + +The leg, which incorporates a simple, low-cost modular design, is "intended to improve the quality of life of patients and accelerate scientific advances by offering a unified platform to fragmented research efforts across the field of bionics." It will, according to lead designer Elliot Rouse, "enable investigators to efficiently solve challenges associated with controlling bionic legs across a range of activities in the lab and out in the community." + +You can learn more about the leg, and download designs, from the [Open Source Leg][3] website. + +### McKinsey releases a Python library for building production-ready data pipelines + +Consulting giant McKinsey and Co. recently released its [first open source tool][4]. Called Kedro, it's a Python library for creating machine learning and data pipelines. + +Kedro makes "it easier to manage large workflows and ensuring a consistent quality of code throughout a project," said product manager Yetunde Dada. While it started as a proprietary tool, McKinsey open sourced Kedro so "clients can use it after we leave a project — it is our way of giving back," said engineer Nikolaos Tsaousis. + +If you're interested in taking a peek, you can grab [Kedro's source code][5] off GitHub. + +### New consortium to advance open source medical imaging + +A group of experts and patient advocates have come together to form the [Open Source Imaging Consortium][6]. The consortium aims to "advance the diagnosis of idiopathic pulmonary fibrosis and other interstitial lung diseases with the help of digital imaging and machine learning." + +According to the consortium's executive director, Elizabeth Estes, the project aims to "collectively speed diagnosis, aid prognosis, and ultimately allow doctors to treat patients more efficiently and effectively." To do that, they're assembling and sharing "15,000 anonymous image scans and clinical data from patients, which will serve as input data for machine learning programs to develop algorithms." + +### Mozilla releases a simple-to-use way to see if you've been part of a data breach + +Explaining security to the less software-savvy has always been a challenge, and monitoring your exposure to risk is difficult regardless of your skill level. Mozilla released [Firefox Monitor][7], with data provided by [Have I Been Pwned][8], as a straightforward way to see if any of your emails have been part of a major data breach. You can enter emails to search one by one, or sign up for their service to notify you in the future. + +The site is also full of helpful tutorials on understanding how hackers work, what to do after a data breach, and how to create strong passwords. Be sure to bookmark this one for around the holidays when family members are asking for advice. + +#### In other news + + * [Want a Google-free Android? Send your phone to this guy][9] + * [CockroachDB releases with a non-OSI approved license, remains source available][10] + * [Infrastructure automation company Chef commits to Open Source][11] + * [Russia’s would-be Windows replacement gets a security upgrade][12] + * [Switch from Medium to your own blog in a few minutes with this code][13] + * [Open Source Initiative Announces New Partnership with Software Liberty Association Taiwan][14] + + + +_Thanks, as always, to Opensource.com staff members and moderators for their help this week._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/news-june-8 + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i +[2]: https://news.umich.edu/open-source-bionic-leg-first-of-its-kind-platform-aims-to-rapidly-advance-prosthetics/ +[3]: https://opensourceleg.com/ +[4]: https://www.information-age.com/kedro-mckinseys-open-source-software-tool-123482991/ +[5]: https://github.com/quantumblacklabs/kedro +[6]: https://pulmonaryfibrosisnews.com/2019/05/31/international-open-source-imaging-consortium-osic-launched-to-advance-ipf-diagnosis/ +[7]: https://monitor.firefox.com/ +[8]: https://haveibeenpwned.com/ +[9]: https://fossbytes.com/want-a-google-free-android-send-your-phone-to-this-guy/ +[10]: https://www.cockroachlabs.com/blog/oss-relicensing-cockroachdb/ +[11]: https://www.infoq.com/news/2019/05/chef-open-source/ +[12]: https://www.nextgov.com/cybersecurity/2019/05/russias-would-be-windows-replacement-gets-security-upgrade/157330/ +[13]: https://github.com/mathieudutour/medium-to-own-blog +[14]: https://opensource.org/node/994 From b808f85c85bbb9d9b7efcf72d29f13e7b1fe42d0 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:37:34 +0800 Subject: [PATCH 0822/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190607=204=20?= =?UTF-8?q?tools=20to=20help=20you=20drive=20Kubernetes=20sources/tech/201?= =?UTF-8?q?90607=204=20tools=20to=20help=20you=20drive=20Kubernetes.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...07 4 tools to help you drive Kubernetes.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20190607 4 tools to help you drive Kubernetes.md diff --git a/sources/tech/20190607 4 tools to help you drive Kubernetes.md b/sources/tech/20190607 4 tools to help you drive Kubernetes.md new file mode 100644 index 0000000000..bb45fb0bea --- /dev/null +++ b/sources/tech/20190607 4 tools to help you drive Kubernetes.md @@ -0,0 +1,219 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 tools to help you drive Kubernetes) +[#]: via: (https://opensource.com/article/19/6/tools-drive-kubernetes) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux/users/fatherlinux/users/fatherlinux/users/fatherlinux) + +4 tools to help you drive Kubernetes +====== +Learning to drive Kubernetes is more important that knowing how to build +it, and these tools will get you on the road fast. +![Tools in a workshop][1] + +In the third article in this series, _[Kubernetes basics: Learn how to drive first][2]_ , I emphasized that you should learn to drive Kubernetes, not build it. I also explained that there is a minimum set of primitives that you have to learn to model an application in Kubernetes. I want to emphasize this point: the set of primitives that you _need_ to learn are the easiest set of primitives that you _can_ learn to achieve production-quality application deployments (i.e., high-availability [HA], multiple containers, multiple applications). Stated another way, learning the set of primitives built into Kubernetes is easier than learning clustering software, clustered file systems, load balancers, crazy Apache configs, crazy Nginx configs, routers, switches, firewalls, and storage backends—all the things you would need to model a simple HA application in a traditional IT environment (for virtual machines or bare metal). + +In this fourth article, I'll share some tools that will help you learn to drive Kubernetes quickly. + +### 1\. Katacoda + +[Katacoda][3] is the easiest way to test-drive a Kubernetes cluster, hands-down. With one click and five seconds of time, you have a web-based terminal plumbed straight into a running Kubernetes cluster. It's magnificent for playing and learning. I even use it for demos and testing out new ideas. Katacoda provides a completely ephemeral environment that is recycled when you finish using it. + +![OpenShift Playground][4] + +[OpenShift playground][5] + +![Kubernetes Playground][6] + +[Kubernetes playground][7] + +Katacoda provides ephemeral playgrounds and deeper lab environments. For example, the [Linux Container Internals Lab][3], which I have run for the last three or four years, is built in Katacoda. + +Katacoda maintains a bunch of [Kubernetes and cloud tutorials][8] on its main site and collaborates with Red Hat to support a [dedicated learning portal for OpenShift][9]. Explore them both—they are excellent learning resources. + +When you first learn to drive a dump truck, it's always best to watch how other people drive first. + +### 2\. Podman generate kube + +The **podman generate kube** command is a brilliant little subcommand that helps users naturally transition from a simple container engine running simple containers to a cluster use case running many containers (as I described in the [last article][2]). [Podman][10] does this by letting you start a few containers, then exporting the working Kube YAML, and firing them up in Kubernetes. Check this out (pssst, you can run it in this [Katacoda lab][3], which already has Podman and OpenShift). + +First, notice the syntax to run a container is strikingly similar to Docker: + + +``` +`podman run -dtn two-pizza quay.io/fatherlinux/two-pizza` +``` + +But this is something other container engines don't do: + + +``` +`podman generate kube two-pizza` +``` + +The output: + + +``` +# Generation of Kubernetes YAML is still under development! +# +# Save the output of this file and use kubectl create -f to import +# it into Kubernetes. +# +# Created with podman-1.3.1 +apiVersion: v1 +kind: Pod +metadata: +creationTimestamp: "2019-06-07T08:08:12Z" +labels: +app: two-pizza +name: two-pizza +spec: +containers: +\- command: +\- /bin/sh +\- -c +\- bash -c 'while true; do /usr/bin/nc -l -p 3306 < /srv/hello.txt; done' +env: +\- name: PATH +value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +\- name: TERM +value: xterm +\- name: HOSTNAME +\- name: container +value: oci +image: quay.io/fatherlinux/two-pizza:latest +name: two-pizza +resources: {} +securityContext: +allowPrivilegeEscalation: true +capabilities: {} +privileged: false +readOnlyRootFilesystem: false +tty: true +workingDir: / +status: {} +\--- +apiVersion: v1 +kind: Service +metadata: +creationTimestamp: "2019-06-07T08:08:12Z" +labels: +app: two-pizza +name: two-pizza +spec: +selector: +app: two-pizza +type: NodePort +status: +loadBalancer: {} +``` + +You now have some working Kubernetes YAML, which you can use as a starting point for mucking around and learning, tweaking, etc. The **-s** flag created a service for you. [Brent Baude][11] is even working on new features like [adding Volumes/Persistent Volume Claims][12]. For a deeper dive, check out Brent's amazing work in his blog post "[Podman can now ease the transition to Kubernetes and CRI-O][13]." + +### 3\. oc new-app + +The **oc new-app** command is extremely powerful. It's OpenShift-specific, so it's not available in default Kubernetes, but it's really useful when you're starting to learn Kubernetes. Let's start with a quick command to create a fairly sophisticated application: + + +``` +oc new-project -n example +oc new-app -f +``` + +With **oc new-app** , you can literally steal templates from the OpenShift developers and have a known, good starting point when developing primitives to describe your own applications. After you run the above command, your Kubernetes namespace (in OpenShift) will be populated by a bunch of new, defined resources. + + +``` +`oc get all` +``` + +The output: + + +``` +NAME READY STATUS RESTARTS AGE +pod/cakephp-mysql-example-1-build 0/1 Completed 0 4m +pod/cakephp-mysql-example-1-gz65l 1/1 Running 0 1m +pod/mysql-1-nkhqn 1/1 Running 0 4m + +NAME DESIRED CURRENT READY AGE +replicationcontroller/cakephp-mysql-example-1 1 1 1 1m +replicationcontroller/mysql-1 1 1 1 4m + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/cakephp-mysql-example ClusterIP 172.30.234.135 8080/TCP 4m +service/mysql ClusterIP 172.30.13.195 3306/TCP 4m + +NAME REVISION DESIRED CURRENT TRIGGERED BY +deploymentconfig.apps.openshift.io/cakephp-mysql-example 1 1 1 config,image(cakephp-mysql-example:latest) +deploymentconfig.apps.openshift.io/mysql 1 1 1 config,image(mysql:5.7) + +NAME TYPE FROM LATEST +buildconfig.build.openshift.io/cakephp-mysql-example Source Git 1 + +NAME TYPE FROM STATUS STARTED DURATION +build.build.openshift.io/cakephp-mysql-example-1 Source Git@47a951e Complete 4 minutes ago 2m27s + +NAME DOCKER REPO TAGS UPDATED +imagestream.image.openshift.io/cakephp-mysql-example docker-registry.default.svc:5000/example/cakephp-mysql-example latest About aminute ago + +NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD +route.route.openshift.io/cakephp-mysql-example cakephp-mysql-example-example.2886795271-80-rhsummit1.environments.katacoda.com cakephp-mysql-example None +``` + +The beauty of this is that you can delete Pods, watch the replication controllers recreate them, scale Pods up, and scale them down. You can play with the template and change it for other applications (which is what I did when I first started). + +### 4\. Visual Studio Code + +I saved one of my favorites for last. I use [vi][14] for most of my work, but I have never found a good syntax highlighter and code completion plugin for Kubernetes (if you have one, let me know). Instead, I have found that Microsoft's [VS Code][15] has a killer set of plugins that complete the creation of Kubernetes resources and provide boilerplate. + +![VS Code plugins UI][16] + +First, install Kubernetes and YAML plugins shown in the image above. + +![Autocomplete in VS Code][17] + +Then, you can create a new YAML file from scratch and get auto-completion of Kubernetes resources. The example above shows a Service. + +![VS Code autocomplete filling in boilerplate for an object][18] + +When you use autocomplete and select the Service resource, it fills in some boilerplate for the object. This is magnificent when you are first learning to drive Kubernetes. You can build Pods, Services, Replication Controllers, Deployments, etc. This is a really nice feature when you are building these files from scratch or even modifying the files you create with **Podman generate kube**. + +### Conclusion + +These four tools (six if you count the two plugins) will help you learn to drive Kubernetes, instead of building or equipping it. In my final article in the series, I will talk about why Kubernetes is so exciting for running so many different workloads. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/tools-drive-kubernetes + +作者:[Scott McCarty][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/fatherlinux/users/fatherlinux/users/fatherlinux/users/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_workshop_blue_mechanic.jpg?itok=4YXkCU-J (Tools in a workshop) +[2]: https://opensource.com/article/19/6/kubernetes-basics +[3]: https://learn.openshift.com/subsystems/container-internals-lab-2-0-part-1 +[4]: https://opensource.com/sites/default/files/uploads/openshift-playground.png (OpenShift Playground) +[5]: https://learn.openshift.com/playgrounds/openshift311/ +[6]: https://opensource.com/sites/default/files/uploads/kubernetes-playground.png (Kubernetes Playground) +[7]: https://katacoda.com/courses/kubernetes/playground +[8]: https://katacoda.com/learn +[9]: http://learn.openshift.com/ +[10]: https://podman.io/ +[11]: https://developers.redhat.com/blog/author/bbaude/ +[12]: https://github.com/containers/libpod/issues/2303 +[13]: https://developers.redhat.com/blog/2019/01/29/podman-kubernetes-yaml/ +[14]: https://en.wikipedia.org/wiki/Vi +[15]: https://code.visualstudio.com/ +[16]: https://opensource.com/sites/default/files/uploads/vscode_-_kubernetes_red_hat_-_plugins.png (VS Code plugins UI) +[17]: https://opensource.com/sites/default/files/uploads/vscode_-_kubernetes_service_-_autocomplete.png (Autocomplete in VS Code) +[18]: https://opensource.com/sites/default/files/uploads/vscode_-_kubernetes_service_-_boiler_plate.png (VS Code autocomplete filling in boilerplate for an object) From 0192d1379613617e883472f1746240e17b7af136 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:37:47 +0800 Subject: [PATCH 0823/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190607=20An?= =?UTF-8?q?=20Introduction=20to=20Kubernetes=20Secrets=20and=20ConfigMaps?= =?UTF-8?q?=20sources/tech/20190607=20An=20Introduction=20to=20Kubernetes?= =?UTF-8?q?=20Secrets=20and=20ConfigMaps.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...on to Kubernetes Secrets and ConfigMaps.md | 608 ++++++++++++++++++ 1 file changed, 608 insertions(+) create mode 100644 sources/tech/20190607 An Introduction to Kubernetes Secrets and ConfigMaps.md diff --git a/sources/tech/20190607 An Introduction to Kubernetes Secrets and ConfigMaps.md b/sources/tech/20190607 An Introduction to Kubernetes Secrets and ConfigMaps.md new file mode 100644 index 0000000000..7d28e67ea4 --- /dev/null +++ b/sources/tech/20190607 An Introduction to Kubernetes Secrets and ConfigMaps.md @@ -0,0 +1,608 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An Introduction to Kubernetes Secrets and ConfigMaps) +[#]: via: (https://opensource.com/article/19/6/introduction-kubernetes-secrets-and-configmaps) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) + +An Introduction to Kubernetes Secrets and ConfigMaps +====== +Kubernetes Secrets and ConfigMaps separate the configuration of +individual container instances from the container image, reducing +overhead and adding flexibility. +![Kubernetes][1] + +Kubernetes has two types of objects that can inject configuration data into a container when it starts up: Secrets and ConfigMaps. Secrets and ConfigMaps behave similarly in [Kubernetes][2], both in how they are created and because they can be exposed inside a container as mounted files or volumes or environment variables. + +To explore Secrets and ConfigMaps, consider the following scenario: + +> You're running the [official MariaDB container image][3] in Kubernetes and must do some configuration to get the container to run. The image requires an environment variable to be set for **MYSQL_ROOT_PASSWORD** , **MYSQL_ALLOW_EMPTY_PASSWORD** , or **MYSQL_RANDOM_ROOT_PASSWORD** to initialize the database. It also allows for extensions to the MySQL configuration file **my.cnf** by placing custom config files in **/etc/mysql/conf.d**. + +You could build a custom image, setting the environment variables and copying the configuration files into it to create a bespoke container image. However, it is considered a best practice to create and use generic images and add configuration to the containers created from them, instead. This is a perfect use-case for ConfigMaps and Secrets. The **MYSQL_ROOT_PASSWORD** can be set in a Secret and added to the container as an environment variable, and the configuration files can be stored in a ConfigMap and mounted into the container as a file on startup. + +Let's try it out! + +### But first: A quick note about Kubectl + +Make sure that your version of the **kubectl** client command is the same or newer than the Kubernetes cluster version in use. + +An error along the lines of: + + +``` +`error: SchemaError(io.k8s.api.admissionregistration.v1beta1.ServiceReference): invalid object doesn't have additional properties` +``` + +may mean the client version is too old and needs to be upgraded. The [Kubernetes Documentation for Installing Kubectl][4] has instructions for installing the latest client on various platforms. + +If you're using Docker for Mac, it also installs its own version of **kubectl** , and that may be the issue. You can install a current client with **brew install** , replacing the symlink to the client shipped by Docker: + + +``` +$ rm /usr/local/bin/kubectl +$ brew link --overwrite kubernetes-cli +``` + +The newer **kubectl** client should continue to work with Docker's Kubernetes version. + +### Secrets + +Secrets are a Kubernetes object intended for storing a small amount of sensitive data. It is worth noting that Secrets are stored base64-encoded within Kubernetes, so they are not wildly secure. Make sure to have appropriate [role-based access controls][5] (RBAC) to protect access to Secrets. Even so, extremely sensitive Secrets data should probably be stored using something like [HashiCorp Vault][6]. For the root password of a MariaDB database, however, base64 encoding is just fine. + +#### Create a Secret manually + +To create the Secret containing the **MYSQL_ROOT_PASSWORD** , choose a password and convert it to base64: + + +``` +# The root password will be "KubernetesRocks!" +$ echo -n 'KubernetesRocks!' | base64 +S3ViZXJuZXRlc1JvY2tzIQ== +``` + +Make a note of the encoded string. You need it to create the YAML file for the Secret: + + +``` +apiVersion: v1 +kind: Secret +metadata: +name: mariadb-root-password +type: Opaque +data: +password: S3ViZXJuZXRlc1JvY2tzIQ== +``` + +Save that file as **mysql-secret.yaml** and create the Secret in Kubernetes with the **kubectl apply** command: + + +``` +$ kubectl apply -f mysql-secret.yaml +secret/mariadb-root-password created +``` + +#### View the newly created Secret + +Now that you've created the Secret, use **kubectl describe** to see it: + + +``` +$ kubectl describe secret mariadb-root-password +Name: mariadb-root-password +Namespace: secrets-and-configmaps +Labels: +Annotations: +Type: Opaque + +Data +==== +password: 16 bytes +``` + +Note that the **Data** field contains the key you set in the YAML: **password**. The value assigned to that key is the password you created, but it is not shown in the output. Instead, the value's size is shown in its place, in this case, 16 bytes. + +You can also use the **kubectl edit secret ** command to view and edit the Secret. If you edit the Secret, you'll see something like this: + + +``` +# Please edit the object below. Lines beginning with a '#' will be ignored, +# and an empty file will abort the edit. If an error occurs while saving this file will be +# reopened with the relevant failures. +# +apiVersion: v1 +data: +password: S3ViZXJuZXRlc1JvY2tzIQ== +kind: Secret +metadata: +annotations: +kubectl.kubernetes.io/last-applied-configuration: | +{"apiVersion":"v1","data":{"password":"S3ViZXJuZXRlc1JvY2tzIQ=="},"kind":"Secret","metadata":{"annotations":{},"name":"mariadb-root-password","namespace":"secrets-and-configmaps"},"type":"Opaque"} +creationTimestamp: 2019-05-29T12:06:09Z +name: mariadb-root-password +namespace: secrets-and-configmaps +resourceVersion: "85154772" +selfLink: /api/v1/namespaces/secrets-and-configmaps/secrets/mariadb-root-password +uid: 2542dadb-820a-11e9-ae24-005056a1db05 +type: Opaque +``` + +Again, the **data** field with the **password** key is visible, and this time you can see the base64-encoded Secret. + +#### Decode the Secret + +Let's say you need to view the Secret in plain text, for example, to verify that the Secret was created with the correct content. You can do this by decoding it. + +It is easy to decode the Secret by extracting the value and piping it to base64. In this case, you will use the output format **-o jsonpath= ** to extract only the Secret value using a JSONPath template. + + +``` +# Returns the base64 encoded secret string +$ kubectl get secret mariadb-root-password -o jsonpath='{.data.password}' +S3ViZXJuZXRlc1JvY2tzIQ== + +# Pipe it to `base64 --decode -` to decode: +$ kubectl get secret mariadb-root-password -o jsonpath='{.data.password}' | base64 --decode - +KubernetesRocks! +``` + +#### Another way to create Secrets + +You can also create Secrets directly using the **kubectl create secret** command. The MariaDB image permits setting up a regular database user with a password by setting the **MYSQL_USER** and **MYSQL_PASSWORD** environment variables. A Secret can hold more than one key/value pair, so you can create a single Secret to hold both strings. As a bonus, by using **kubectl create secret** , you can let Kubernetes mess with base64 so that you don't have to. + + +``` +$ kubectl create secret generic mariadb-user-creds \ +\--from-literal=MYSQL_USER=kubeuser\ +\--from-literal=MYSQL_PASSWORD=kube-still-rocks +secret/mariadb-user-creds created +``` + +Note the **\--from-literal** , which sets the key name and the value all in one. You can pass as many **\--from-literal** arguments as you need to create one or more key/value pairs in the Secret. + +Validate that the username and password were created and stored correctly with the **kubectl get secrets** command: + + +``` +# Get the username +$ kubectl get secret mariadb-user-creds -o jsonpath='{.data.MYSQL_USER}' | base64 --decode - +kubeuser + +# Get the password +$ kubectl get secret mariadb-user-creds -o jsonpath='{.data.MYSQL_PASSWORD}' | base64 --decode - +kube-still-rocks +``` + +### ConfigMaps + +ConfigMaps are similar to Secrets. They can be created and shared in the containers in the same ways. The only big difference between them is the base64-encoding obfuscation. ConfigMaps are intended for non-sensitive data—configuration data—like config files and environment variables and are a great way to create customized running services from generic container images. + +#### Create a ConfigMap + +ConfigMaps can be created in the same ways as Secrets. You can write a YAML representation of the ConfigMap manually and load it into Kubernetes, or you can use the **kubectl create configmap** command to create it from the command line. The following example creates a ConfigMap using the latter method but, instead of passing literal strings (as with **\--from-literal= =** in the Secret above), it creates a ConfigMap from an existing file—a MySQL config intended for **/etc/mysql/conf.d** in the container. This config file overrides the **max_allowed_packet** setting that MariaDB sets to 16M by default. + +First, create a file named **max_allowed_packet.cnf** with the following content: + + +``` +[mysqld] +max_allowed_packet = 64M +``` + +This will override the default setting in the **my.cnf** file and set **max_allowed_packet** to 64M. + +Once the file is created, you can create a ConfigMap named **mariadb-config** using the **kubectl create configmap** command that contains the file: + + +``` +$ kubectl create configmap mariadb-config --from-file=max_allowed_packet.cnf +configmap/mariadb-config created +``` + +Just like Secrets, ConfigMaps store one or more key/value pairs in their Data hash of the object. By default, using **\--from-file= ** (as above) will store the contents of the file as the value, and the name of the file will be stored as the key. This is convenient from an organization viewpoint. However, the key name can be explicitly set, too. For example, if you used **\--from-file=max-packet=max_allowed_packet.cnf** when you created the ConfigMap, the key would be **max-packet** rather than the file name. If you had multiple files to store in the ConfigMap, you could add each of them with an additional **\--from-file= ** argument. + +#### View the new ConfigMap and read the data + +As mentioned, ConfigMaps are not meant to store sensitive data, so the data is not encoded when the ConfigMap is created. This makes it easy to view and validate the data and edit it directly. + +First, validate that the ConfigMap was, indeed, created: + + +``` +$ kubectl get configmap mariadb-config +NAME DATA AGE +mariadb-config 1 9m +``` + +The contents of the ConfigMap can be viewed with the **kubectl describe** command. Note that the full contents of the file are visible and that the key name is, in fact, the file name, **max_allowed_packet.cnf**. + + +``` +$ kubectl describe cm mariadb-config +Name: mariadb-config +Namespace: secrets-and-configmaps +Labels: +Annotations: + +Data +==== +max_allowed_packet.cnf: +\---- +[mysqld] +max_allowed_packet = 64M + +Events: +``` + +A ConfigMap can be edited live within Kubernetes with the **kubectl edit** command. Doing so will open a buffer with the default editor showing the contents of the ConfigMap as YAML. When changes are saved, they will immediately be live in Kubernetes. While not really the _best_ practice, it can be handy for testing things in development. + +Say you want a **max_allowed_packet** value of 32M instead of the default 16M or the 64M in the **max_allowed_packet.cnf** file. Use **kubectl edit configmap mariadb-config** to edit the value: + + +``` +$ kubectl edit configmap mariadb-config + +# Please edit the object below. Lines beginning with a '#' will be ignored, +# and an empty file will abort the edit. If an error occurs while saving this file will be +# reopened with the relevant failures. +# +apiVersion: v1 + +data: +max_allowed_packet.cnf: | +[mysqld] +max_allowed_packet = 32M +kind: ConfigMap +metadata: +creationTimestamp: 2019-05-30T12:02:22Z +name: mariadb-config +namespace: secrets-and-configmaps +resourceVersion: "85609912" +selfLink: /api/v1/namespaces/secrets-and-configmaps/configmaps/mariadb-config +uid: c83ccfae-82d2-11e9-832f-005056a1102f +``` + +After saving the change, verify the data has been updated: + + +``` +# Note the '.' in max_allowed_packet.cnf needs to be escaped +$ kubectl get configmap mariadb-config -o "jsonpath={.data['max_allowed_packet\\.cnf']}" + +[mysqld] +max_allowed_packet = 32M +``` + +### Using Secrets and ConfigMaps + +Secrets and ConfigMaps can be mounted as environment variables or as files within a container. For the MariaDB container, you will need to mount the Secrets as environment variables and the ConfigMap as a file. First, though, you need to write a Deployment for MariaDB so that you have something to work with. Create a file named **mariadb-deployment.yaml** with the following: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +labels: +app: mariadb +name: mariadb-deployment +spec: +replicas: 1 +selector: +matchLabels: +app: mariadb +template: +metadata: +labels: +app: mariadb +spec: +containers: +\- name: mariadb +image: docker.io/mariadb:10.4 +ports: +\- containerPort: 3306 +protocol: TCP +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 +volumes: +\- emptyDir: {} +name: mariadb-volume-1 +``` + +This is a bare-bones Kubernetes Deployment of the official MariaDB 10.4 image from Docker Hub. Now, add your Secrets and ConfigMap. + +#### Add the Secrets to the Deployment as environment variables + +You have two Secrets that need to be added to the Deployment: + + 1. **mariadb-root-password** (with one key/value pair) + 2. **mariadb-user-creds** (with two key/value pairs) + + + +For the **mariadb-root-password** Secret, specify the Secret and the key you want by adding an **env** list/array to the container spec in the Deployment and setting the environment variable value to the value of the key in your Secret. In this case, the list contains only a single entry, for the variable **MYSQL_ROOT_PASSWORD**. + + +``` +env: +\- name: MYSQL_ROOT_PASSWORD +valueFrom: +secretKeyRef: +name: mariadb-root-password +key: password +``` + +Note that the name of the object is the name of the environment variable that is added to the container. The **valueFrom** field defines **secretKeyRef** as the source from which the environment variable will be set; i.e., it will use the value from the **password** key in the **mariadb-root-password** Secret you set earlier. + +Add this section to the definition for the **mariadb** container in the **mariadb-deployment.yaml** file. It should look something like this: + + +``` +spec: +containers: +\- name: mariadb +image: docker.io/mariadb:10.4 +env: +\- name: MYSQL_ROOT_PASSWORD +valueFrom: +secretKeyRef: +name: mariadb-root-password +key: password +ports: +\- containerPort: 3306 +protocol: TCP +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 +``` + +In this way, you have explicitly set the variable to the value of a specific key from your Secret. This method can also be used with ConfigMaps by using **configMapRef** instead of **secretKeyRef**. + +You can also set environment variables from _all_ key/value pairs in a Secret or ConfigMap to automatically use the key name as the environment variable name and the key's value as the environment variable's value. By using **envFrom** rather than **env** in the container spec, you can set the **MYSQL_USER** and **MYSQL_PASSWORD** from the **mariadb-user-creds** Secret you created earlier, all in one go: + + +``` +envFrom: +\- secretRef: +name: mariadb-user-creds +``` + +**envFrom** is a list of sources for Kubernetes to take environment variables. Use **secretRef** again, this time to specify **mariadb-user-creds** as the source of the environment variables. That's it! All the keys and values in the Secret will be added as environment variables in the container. + +The container spec should now look like this: + + +``` +spec: +containers: +\- name: mariadb +image: docker.io/mariadb:10.4 +env: +\- name: MYSQL_ROOT_PASSWORD +valueFrom: +secretKeyRef: +name: mariadb-root-password +key: password +envFrom: +\- secretRef: +name: mariadb-user-creds +ports: +\- containerPort: 3306 +protocol: TCP +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 +``` + +_Note:_ You could have just added the **mysql-root-password** Secret to the **envFrom** list and let it be parsed as well, as long as the **password** key was named **MYSQL_ROOT_PASSWORD** instead. There is no way to manually specify the environment variable name with **envFrom** as with **env**. + +#### Add the max_allowed_packet.cnf file to the Deployment as a volumeMount + +As mentioned, both **env** and **envFrom** can be used to share ConfigMap key/value pairs with a container as well. However, in the case of the **mariadb-config** ConfigMap, your entire file is stored as the value to your key, and the file needs to exist in the container's filesystem for MariaDB to be able to use it. Luckily, both Secrets and ConfigMaps can be the source of Kubernetes "volumes" and mounted into the containers instead of using a filesystem or block device as the volume to be mounted. + +The **mariadb-deployment.yaml** already has a volume and volumeMount specified, an **emptyDir** (effectively a temporary or ephemeral) volume mounted to **/var/lib/mysql** to store the MariaDB data: + + +``` +<...> + +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 + +<...> + +volumes: +\- emptyDir: {} +name: mariadb-volume-1 + +<...> +``` + +_Note:_ This is not a production configuration. When the Pod restarts, the data in the **emptyDir** volume is lost. This is primarily used for development or when the contents of the volume don't need to be persistent. + +You can add your ConfigMap as a source by adding it to the volume list and then adding a volumeMount for it to the container definition: + + +``` +<...> + +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 +\- mountPath: /etc/mysql/conf.d +name: mariadb-config + +<...> + +volumes: +\- emptyDir: {} +name: mariadb-volume-1 +\- configMap: +name: mariadb-config +items: +\- key: max_allowed_packet.cnf +path: max_allowed_packet.cnf +name: mariadb-config-volume + +<...> +``` + +The **volumeMount** is pretty self-explanatory—create a volume mount for the **mariadb-config-volume** (specified in the **volumes** list below it) to the path **/etc/mysql/conf.d**. + +Then, in the **volumes** list, **configMap** tells Kubernetes to use the **mariadb-config** ConfigMap, taking the contents of the key **max_allowed_packet.cnf** and mounting it to the path **max_allowed_packed.cnf**. The name of the volume is **mariadb-config-volume** , which was referenced in the **volumeMounts** above. + +_Note:_ The **path** from the **configMap** is the name of a file that will contain the contents of the key's value. In this case, your key was a file name, too, but it doesn't have to be. Note also that **items** is a list, so multiple keys can be referenced and their values mounted as files. These files will all be created in the **mountPath** of the **volumeMount** specified above: **/etc/mysql/conf.d**. + +### Create a MariaDB instance from the Deployment + +At this point, you should have enough to create a MariaDB instance. You have two Secrets, one holding the **MYSQL_ROOT_PASSWORD** and another storing the **MYSQL_USER** , and the **MYSQL_PASSWORD** environment variables to be added to the container. You also have a ConfigMap holding the contents of a MySQL config file that overrides the **max_allowed_packed** value from its default setting. + +You also have a **mariadb-deployment.yaml** file that describes a Kubernetes deployment of a Pod with a MariaDB container and adds the Secrets as environment variables and the ConfigMap as a volume-mounted file in the container. It should look like this: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +labels: +app: mariadb +name: mariadb-deployment +spec: +replicas: 1 +selector: +matchLabels: +app: mariadb +template: +metadata: +labels: +app: mariadb +spec: +containers: +\- image: docker.io/mariadb:10.4 +name: mariadb +env: +\- name: MYSQL_ROOT_PASSWORD +valueFrom: +secretKeyRef: +name: mariadb-root-password +key: password +envFrom: +\- secretRef: +name: mariadb-user-creds +ports: +\- containerPort: 3306 +protocol: TCP +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 +\- mountPath: /etc/mysql/conf.d +name: mariadb-config-volume +volumes: +\- emptyDir: {} +name: mariadb-volume-1 +\- configMap: +name: mariadb-config +items: +\- key: max_allowed_packet.cnf +path: max_allowed_packet.cnf +name: mariadb-config-volume +``` + +#### Create the MariaDB instance + +Create a new MariaDB instance from the YAML file with the **kubectl create** command: + + +``` +$ kubectl create -f mariadb-deployment.yaml +deployment.apps/mariadb-deployment created +``` + +Once the deployment has been created, use the **kubectl get** command to view the running MariaDB pod: + + +``` +$ kubectl get pods +NAME READY STATUS RESTARTS AGE +mariadb-deployment-5465c6655c-7jfqm 1/1 Running 0 3m +``` + +Make a note of the Pod name (in this example, it's **mariadb-deployment-5465c6655c-7jfqm** ). Note that the Pod name will differ from this example. + +#### Verify the instance is using the Secrets and ConfigMap + +Use the **kubectl exec** command (with your Pod name) to validate that the Secrets and ConfigMaps are in use. For example, check that the environment variables are exposed in the container: + + +``` +$ kubectl exec -it mariadb-deployment-5465c6655c-7jfqm env |grep MYSQL +MYSQL_PASSWORD=kube-still-rocks +MYSQL_USER=kubeuser +MYSQL_ROOT_PASSWORD=KubernetesRocks! +``` + +Success! All three environment variables—the one using the **env** setup to specify the Secret, and two using **envFrom** to mount all the values from the Secret—are available in the container for MariaDB to use. + +Spot check that the **max_allowed_packet.cnf** file was created in **/etc/mysql/conf.d** and that it contains the expected content: + + +``` +$ kubectl exec -it mariadb-deployment-5465c6655c-7jfqm ls /etc/mysql/conf.d +max_allowed_packet.cnf + +$ kubectl exec -it mariadb-deployment-5465c6655c-7jfqm cat /etc/mysql/conf.d/max_allowed_packet.cnf +[mysqld] +max_allowed_packet = 32M +``` + +Finally, validate that MariaDB used the environment variable to set the root user password and read the **max_allowed_packet.cnf** file to set the **max_allowed_packet** configuration variable. Use the **kubectl exec** command again, this time to get a shell inside the running container and use it to run some **mysql** commands: + + +``` +$ kubectl exec -it mariadb-deployment-5465c6655c-7jfqm / +bin/sh + +# Check that the root password was set correctly +$ mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e 'show databases;' ++--------------------+ +| Database | ++--------------------+ +| information_schema | +| mysql | +| performance_schema | ++--------------------+ + +# Check that the max_allowed_packet.cnf was parsed +$ mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e "SHOW VARIABLES LIKE 'max_allowed_packet';" ++--------------------+----------+ +| Variable_name | Value | ++--------------------+----------+ +| max_allowed_packet | 33554432 | ++--------------------+----------+ +``` + +### Advantages of Secrets and ConfigMaps + +This exercise explained how to create Kubernetes Secrets and ConfigMaps and how to use those Secrets and ConfigMaps by adding them as environment variables or files inside of a running container instance. This makes it easy to keep the configuration of individual instances of containers separate from the container image. By separating the configuration data, overhead is reduced to maintaining only a single image for a specific type of instance while retaining the flexibility to create instances with a wide variety of configurations. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/introduction-kubernetes-secrets-and-configmaps + +作者:[Chris Collins][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/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes.png?itok=PqDGb6W7 (Kubernetes) +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://hub.docker.com/_/mariadb +[4]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ +[5]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ +[6]: https://www.vaultproject.io/ From 5e8530e227cf9325575800e6a9e822d27e79c1a9 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:37:59 +0800 Subject: [PATCH 0824/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190607=205=20?= =?UTF-8?q?reasons=20to=20use=20Kubernetes=20sources/tech/20190607=205=20r?= =?UTF-8?q?easons=20to=20use=20Kubernetes.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190607 5 reasons to use Kubernetes.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20190607 5 reasons to use Kubernetes.md diff --git a/sources/tech/20190607 5 reasons to use Kubernetes.md b/sources/tech/20190607 5 reasons to use Kubernetes.md new file mode 100644 index 0000000000..d03f4c0c0e --- /dev/null +++ b/sources/tech/20190607 5 reasons to use Kubernetes.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 reasons to use Kubernetes) +[#]: via: (https://opensource.com/article/19/6/reasons-kubernetes) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) + +5 reasons to use Kubernetes +====== +Kubernetes solves some of the most common problems development and +operations teams see every day. +![][1] + +[Kubernetes][2] is the de facto open source container orchestration tool for enterprises. It provides application deployment, scaling, container management, and other capabilities, and it enables enterprises to optimize hardware resource utilization and increase production uptime through fault-tolerant functionality at speed. The project was initially developed by Google, which donated the project to the [Cloud-Native Computing Foundation][3]. In 2018, it became the first CNCF project to [graduate][4]. + +This is all well and good, but it doesn't explain why development and operations should invest their valuable time and effort in Kubernetes. The reason Kubernetes is so useful is that it helps dev and ops quickly solve the problems they struggle with every day. + +Following are five ways Kubernetes' capabilities help dev and ops professionals address their most common problems. + +### 1\. Vendor-agnostic + +Many public cloud providers not only serve managed Kubernetes services but also lots of cloud products built on top of those services for on-premises application container orchestration. Being vendor-agnostic enables operators to design, build, and manage multi-cloud and hybrid cloud platforms easily and safely without risk of vendor lock-in. Kubernetes also eliminates the ops team's worries about a complex multi/hybrid cloud strategy. + +### 2\. Service discovery + +To develop microservices applications, Java developers must control service availability (in terms of whether the application is ready to serve a function) and ensure the service continues living, without any exceptions, in response to the client's requests. Kubernetes' [service discovery feature][5] means developers don't have to manage these things on their own anymore. + +### 3\. Invocation + +How would your DevOps initiative deploy polyglot, cloud-native apps over thousands of virtual machines? Ideally, dev and ops could trigger deployments for bug fixes, function enhancements, new features, and security patches. Kubernetes' [deployment feature][6] automates this daily work. More importantly, it enables advanced deployment strategies, such as [blue-green and canary][7] deployments. + +### 4\. Elasticity + +Autoscaling is the key capability needed to handle massive workloads in cloud environments. By building a container platform, you can increase system reliability for end users. [Kubernetes Horizontal Pod Autoscaler][8] (HPA) allows a cluster to increase or decrease the number of applications (or Pods) to deal with peak traffic or performance spikes, reducing concerns about unexpected system outages. + +### 5\. Resilience + +In a modern application architecture, failure-handling codes should be considered to control unexpected errors and recover from them quickly. But it takes a lot of time and effort for developers to simulate all the occasional errors. Kubernetes' [ReplicaSet][9] helps developers solve this problem by ensuring a specified number of Pods are kept alive continuously. + +### Conclusion + +Kubernetes enables enterprises to solve common dev and ops problems easily, quickly, and safely. It also provides other benefits, such as building a seamless multi/hybrid cloud strategy, saving infrastructure costs, and speeding time to market. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/reasons-kubernetes + +作者:[Daniel Oh][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/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_wheel_gear_devops_kubernetes.png?itok=xm4a74Kv +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://www.cncf.io/projects/ +[4]: https://www.cncf.io/blog/2018/03/06/kubernetes-first-cncf-project-graduate/ +[5]: https://kubernetes.io/docs/concepts/services-networking/service/ +[6]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[7]: https://opensource.com/article/17/5/colorful-deployments +[8]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ +[9]: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ From fa6bd3ec2073dd0cf6d7c00df5080bec5045f712 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:38:10 +0800 Subject: [PATCH 0825/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20Why?= =?UTF-8?q?=20hypothesis-driven=20development=20is=20key=20to=20DevOps=20s?= =?UTF-8?q?ources/tech/20190606=20Why=20hypothesis-driven=20development=20?= =?UTF-8?q?is=20key=20to=20DevOps.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sis-driven development is key to DevOps.md | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 sources/tech/20190606 Why hypothesis-driven development is key to DevOps.md diff --git a/sources/tech/20190606 Why hypothesis-driven development is key to DevOps.md b/sources/tech/20190606 Why hypothesis-driven development is key to DevOps.md new file mode 100644 index 0000000000..766393dc3f --- /dev/null +++ b/sources/tech/20190606 Why hypothesis-driven development is key to DevOps.md @@ -0,0 +1,152 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why hypothesis-driven development is key to DevOps) +[#]: via: (https://opensource.com/article/19/6/why-hypothesis-driven-development-devops) +[#]: author: (Brent Aaron Reed https://opensource.com/users/brentaaronreed/users/wpschaub) + +Why hypothesis-driven development is key to DevOps +====== +A hypothesis-driven development mindset harvests the core value of +feature flags: experimentation in production. +![gears and lightbulb to represent innovation][1] + +The definition of DevOps, offered by [Donovan Brown][2] * _is_ "The union of **people** , **process** , and **products** to enable continuous delivery of **value** to our customers.*" It accentuates the importance of continuous delivery of value. Let's discuss how experimentation is at the heart of modern development practices. + +![][3] + +### Reflecting on the past + +Before we get into hypothesis-driven development, let's quickly review how we deliver value using waterfall, agile, deployment rings, and feature flags. + +In the days of _**waterfall**_ , we had predictable and process-driven delivery. However, we only delivered value towards the end of the development lifecycle, often failing late as the solution drifted from the original requirements, or our killer features were outdated by the time we finally shipped. + +![][4] + +Here, we have one release X and eight features, which are all deployed and exposed to the patiently waiting user. We are continuously delivering value—but with a typical release cadence of six months to two years, _the value of the features declines as the world continues to move on_. It worked well enough when there was time to plan and a lower expectation to react to more immediate needs. + +The introduction of _**agile**_ allowed us to create and respond to change so we could continuously deliver working software, sense, learn, and respond. + +![][5] + +Now, we have three releases: X.1, X.2, and X.3. After the X.1 release, we improved feature 3 based on feedback and re-deployed it in release X.3. This is a simple example of delivering features more often, focused on working software, and responding to user feedback. _We are on the path of continuous delivery, focused on our key stakeholders: our users._ + +Using _**deployment rings**_ and/or _**feature flags**_ , we can decouple release deployment and feature exposure, down to the individual user, to control the exposure—the blast radius—of features. We can conduct experiments; progressively expose, test, enable, and hide features; fine-tune releases, and continuously pivot on learnings and feedback. + +When we add feature flags to the previous workflow, we can toggle features to be ON (enabled and exposed) or OFF (hidden). + +![][6] + +Here, feature flags for features 2, 4, and 8 are OFF, which results in the user being exposed to fewer of the features. All features have been deployed but are not exposed (yet). _We can fine-tune the features (value) of each release after deploying to production._ + +_**Ring-based deployment**_ limits the impact (blast) on users while we gradually deploy and evaluate one or more features through observation. Rings allow us to deploy features progressively and have multiple releases (v1, v1.1, and v1.2) running in parallel. + +![Ring-based deployment][7] + +Exposing features in the canary and early-adopter rings enables us to evaluate features without the risk of an all-or-nothing big-bang deployment. + +_**Feature flags**_ decouple release deployment and feature exposure. You "flip the flag" to expose a new feature, perform an emergency rollback by resetting the flag, use rules to hide features, and allow users to toggle preview features. + +![Toggling feature flags on/off][8] + +When you combine deployment rings and feature flags, you can progressively deploy a release through rings and use feature flags to fine-tune the deployed release. + +> See [deploying new releases: Feature flags or rings][9], [what's the cost of feature flags][10], and [breaking down walls between people, process, and products][11] for discussions on feature flags, deployment rings, and related topics. + +### Adding hypothesis-driven development to the mix + +_**Hypothesis-driven development**_ is based on a series of experiments to validate or disprove a hypothesis in a [complex problem domain][12] where we have unknown-unknowns. We want to find viable ideas or fail fast. Instead of developing a monolithic solution and performing a big-bang release, we iterate through hypotheses, evaluating how features perform and, most importantly, how and if customers use them. + +> **Template:** _**We believe**_ {customer/business segment} _**wants**_ {product/feature/service} _**because**_ {value proposition}. +> +> **Example:** _**We believe**_ that users _**want**_ to be able to select different themes _**because**_ it will result in improved user satisfaction. We expect 50% or more users to select a non-default theme and to see a 5% increase in user engagement. + +Every experiment must be based on a hypothesis, have a measurable conclusion, and contribute to feature and overall product learning. For each experiment, consider these steps: + + * Observe your user + * Define a hypothesis and an experiment to assess the hypothesis + * Define clear success criteria (e.g., a 5% increase in user engagement) + * Run the experiment + * Evaluate the results and either accept or reject the hypothesis + * Repeat + + + +Let's have another look at our sample release with eight hypothetical features. + +![][13] + +When we deploy each feature, we can observe user behavior and feedback, and prove or disprove the hypothesis that motivated the deployment. As you can see, the experiment fails for features 2 and 6, allowing us to fail-fast and remove them from the solution. _**We do not want to carry waste that is not delivering value or delighting our users!**_ The experiment for feature 3 is inconclusive, so we adapt the feature, repeat the experiment, and perform A/B testing in Release X.2. Based on observations, we identify the variant feature 3.2 as the winner and re-deploy in release X.3. _**We only expose the features that passed the experiment and satisfy the users.**_ + +### Hypothesis-driven development lights up progressive exposure + +When we combine hypothesis-driven development with progressive exposure strategies, we can vertically slice our solution, incrementally delivering on our long-term vision. With each slice, we progressively expose experiments, enable features that delight our users and hide those that did not make the cut. + +But there is more. When we embrace hypothesis-driven development, we can learn how technology works together, or not, and what our customers need and want. We also complement the test-driven development (TDD) principle. TDD encourages us to write the test first (hypothesis), then confirm our features are correct (experiment), and succeed or fail the test (evaluate). _**It is all about quality and delighting our users** , as outlined in principles 1, 3, and 7_ of the [Agile Manifesto][14]: + + * Our highest priority is to satisfy the customers through early and continuous delivery of value. + * Deliver software often, from a couple of weeks to a couple of months, with a preference to the shorter timescale. + * Working software is the primary measure of progress. + + + +More importantly, we introduce a new mindset that breaks down the walls between development, business, and operations to view, design, develop, deliver, and observe our solution in an iterative series of experiments, adopting features based on scientific analysis, user behavior, and feedback in production. We can evolve our solutions in thin slices through observation and learning in production, a luxury that other engineering disciplines, such as aerospace or civil engineering, can only dream of. + +The good news is that hypothesis-driven development supports the empirical process theory and its three pillars: **Transparency** , **Inspection** , and **Adaption**. + +![][15] + +But there is more. Based on lean principles, we must pivot or persevere after we measure and inspect the feedback. Using feature toggles in conjunction with hypothesis-driven development, we get the best of both worlds, as well as the ability to use A|B testing to make decisions on feedback, such as likes/dislikes and value/waste. + +### Remember: + +Hypothesis-driven development: + + * Is about a series of experiments to confirm or disprove a hypothesis. Identify value! + * Delivers a measurable conclusion and enables continued learning. + * Enables continuous feedback from the key stakeholder—the user—to understand the unknown-unknowns! + * Enables us to understand the evolving landscape into which we progressively expose value. + + + +Progressive exposure: + + * Is not an excuse to hide non-production-ready code. _**Always ship quality!**_ + * Is about deploying a release of features through rings in production. _**Limit blast radius!**_ + * Is about enabling or disabling features in production. _**Fine-tune release values!**_ + * Relies on circuit breakers to protect the infrastructure from implications of progressive exposure. _**Observe, sense, act!**_ + + + +What have you learned about progressive exposure strategies and hypothesis-driven development? We look forward to your candid feedback. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/why-hypothesis-driven-development-devops + +作者:[Brent Aaron Reed][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/brentaaronreed/users/wpschaub +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation) +[2]: http://donovanbrown.com/post/what-is-devops +[3]: https://opensource.com/sites/default/files/hypo-1_copy.png +[4]: https://opensource.com/sites/default/files/uploads/hyp0-2-trans.png +[5]: https://opensource.com/sites/default/files/uploads/hypo-3-trans.png +[6]: https://opensource.com/sites/default/files/uploads/hypo-4_0.png +[7]: https://opensource.com/sites/default/files/uploads/hypo-6-trans.png +[8]: https://opensource.com/sites/default/files/uploads/hypo-7-trans.png +[9]: https://opensource.com/article/18/2/feature-flags-ring-deployment-model +[10]: https://opensource.com/article/18/7/does-progressive-exposure-really-come-cost +[11]: https://opensource.com/article/19/3/breaking-down-walls-between-people-process-and-products +[12]: https://en.wikipedia.org/wiki/Cynefin_framework +[13]: https://opensource.com/sites/default/files/uploads/hypo-5-trans.png +[14]: https://agilemanifesto.org/principles.html +[15]: https://opensource.com/sites/default/files/uploads/adapt-transparent-inspect.png From bfe3e23da2a87551929013be4987d920601d9200 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:38:20 +0800 Subject: [PATCH 0826/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20Exam?= =?UTF-8?q?ples=20of=20blameless=20culture=20outside=20of=20DevOps=20sourc?= =?UTF-8?q?es/tech/20190606=20Examples=20of=20blameless=20culture=20outsid?= =?UTF-8?q?e=20of=20DevOps.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... of blameless culture outside of DevOps.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20190606 Examples of blameless culture outside of DevOps.md diff --git a/sources/tech/20190606 Examples of blameless culture outside of DevOps.md b/sources/tech/20190606 Examples of blameless culture outside of DevOps.md new file mode 100644 index 0000000000..b78722f3ef --- /dev/null +++ b/sources/tech/20190606 Examples of blameless culture outside of DevOps.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Examples of blameless culture outside of DevOps) +[#]: via: (https://opensource.com/article/19/6/everyday-blameless) +[#]: author: (Patrick Housley https://opensource.com/users/patrickhousley) + +Examples of blameless culture outside of DevOps +====== +Is blameless culture just a matter of postmortems and top-down change? +Or are there things individuals can do to promote it? +![people in different locations who are part of the same team][1] + +A blameless culture is not a new concept in the technology industry. In fact, in 2012, [John Allspaw][2] wrote about how [Etsy uses blameless postmortems][3] to dive to the heart of problems when they arise. Other technology giants, like Google, have also worked hard to implement a blameless culture. But what is a blameless culture? Is it just a matter of postmortems? Does it take a culture change to make blameless a reality? And what about flagrant misconduct? + +### Exploring blameless culture + +In 2009, [Mike Rother][4] wrote an [award-winning book][5] on the culture of Toyota, in which he broke down how the automaker became so successful in the 20th century when most other car manufacturers were either stagnant or losing ground. Books on Toyota were nothing new, but how Mike approached Toyota's success was unique. Instead of focusing on the processes and procedures Toyota implements, he explains in exquisite detail the company's culture, including its focus on blameless failure and continuous improvement. + +Mike explains that Toyota, in the face of failure, focuses on the system where the failure occurred instead of who is at fault. Furthermore, the company treats failure as a learning opportunity, not a chance to chastise the operator. This is the very definition of a blameless culture and one that the technology field can still learn much from. + +### It's not a culture shift + +It shouldn't take an executive initiative to attain blamelessness. It's not so much the company's culture that we need to change, but our attitudes towards fault and failure. Sure, the company's culture should change, but, even in a blameless culture, some people still have the undying urge to point fingers and call others out for their shortcomings. + +I was once contracted to work with a company on developing and improving its digital footprint. This company employed its own developers, and, as you might imagine, there was tension at times. If a bug was found in production, the search began immediately for the person responsible. I think it's just human nature to want to find someone to blame. But there is a better way, and it will take practice. + +### Blamelessness at the microscale + +When I talk about implementing blamelessness, I'm not talking about doing it at the scale of companies and organizations. That's too large for most of us. Instead, focus your attention on the smallest scale: the code commit, review, and pull request. Focus on your actions and the actions of your peers and those you lead. You may find that you have the biggest impact in this area. + +How often do you or one of your peers get a bug report, dig in to find out what is wrong, and stop once you determine who made the breaking change? Do you immediately assume that a pull request or code commit needs to be reverted? Do you contact that individual and tell them what they broke and which commit it was? If this is happening within your team, you're the furthest from blamelessness you could be. But it can be remedied. + +Obviously, when you find a bug, you need to understand what broke, where, and who did it. But don't stop there. Attempt to fix the issue. The chances are high that patching the code will be a faster resolution than trying to figure out which code to back out. Too many times, I have seen people try to back out code only to find that they broke something else. + +If you're not confident that you can fix the issue, politely ask the individual who made the breaking change to assist. Yes, assist! My mom always said, "you can catch more flies with honey than vinegar." You will typically get a more positive response if you ask people for help instead of pointing out what they broke. + +Finally, once you have a fix, make sure to ask the individual who caused the bug to review your change. This isn't about rubbing it in their face. Remember that failure represents a learning opportunity, and the person who created the failure will learn if they have a chance to review the fix you created. Furthermore, that individual may have unique details and reasoning that suggests your change may fix the immediate issue but may not solve the original problem. + +### Catch flagrant misconduct and abuse sooner + +A blameless culture doesn't provide blanket protection if someone is knowingly attempting to do wrong. That also doesn't mean the system is not faulty. Remember how Toyota focuses on the system where failure occurs? If an individual can knowingly create havoc within the software they are working on, they should be held accountable—but so should the system. + +When reviewing failure, no matter how small, always ask, "How could we have caught this sooner?" Chances are you could improve some part of your software development lifecycle (SDLC) to make failures less likely to happen. Maybe you need to add more tests. Or run your tests more often. Whatever the solution, remember that fixing the bug is only part of a complete fix. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/everyday-blameless + +作者:[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 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connection_people_team_collaboration.png?itok=0_vQT8xV (people in different locations who are part of the same team) +[2]: https://twitter.com/allspaw +[3]: https://codeascraft.com/2012/05/22/blameless-postmortems/ +[4]: http://www-personal.umich.edu/~mrother/Homepage.html +[5]: https://en.wikipedia.org/wiki/Toyota_Kata From 0f8627db579e605260c60cae268966cf51108c83 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:38:30 +0800 Subject: [PATCH 0827/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20Kube?= =?UTF-8?q?rnetes=20basics:=20Learn=20how=20to=20drive=20first=20sources/t?= =?UTF-8?q?ech/20190606=20Kubernetes=20basics-=20Learn=20how=20to=20drive?= =?UTF-8?q?=20first.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rnetes basics- Learn how to drive first.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20190606 Kubernetes basics- Learn how to drive first.md diff --git a/sources/tech/20190606 Kubernetes basics- Learn how to drive first.md b/sources/tech/20190606 Kubernetes basics- Learn how to drive first.md new file mode 100644 index 0000000000..7cac6a7dd0 --- /dev/null +++ b/sources/tech/20190606 Kubernetes basics- Learn how to drive first.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kubernetes basics: Learn how to drive first) +[#]: via: (https://opensource.com/article/19/6/kubernetes-basics) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux/users/fatherlinux/users/fatherlinux) + +Kubernetes basics: Learn how to drive first +====== +Quit focusing on new projects and get focused on getting your Kubernetes +dump truck commercial driver's license. +![Truck steering wheel and dash][1] + +In the first two articles in this series, I explained how Kubernetes is [like a dump truck][2] and that there are always [learning curves][3] to understanding elegant, professional tools like [Kubernetes][4] (and dump trucks, cranes, etc.). This article is about the next step: learning how to drive. + +Recently, I saw a thread on Reddit about [essential Kubernetes projects][5]. People seem hungry to know the bare minimum they should learn to get started with Kubernetes. The "driving a dump truck analogy" helps frame the problem to stay on track. Someone in the thread mentioned that you shouldn't be running your own registry unless you have to, so people are already nibbling at this idea of driving Kubernetes instead of building it. + +The API is Kubernetes' engine and transmission. Like a dump truck's steering wheel, clutch, gas, and brake pedal, the YAML or JSON files you use to build your applications are the primary interface to the machine. When you're first learning Kubernetes, this should be your primary focus. Get to know your controls. Don't get sidetracked by all the latest and greatest projects. Don't try out an experimental dump truck when you are just learning to drive. Instead, focus on the basics. + +### Defined and actual states + +First, Kubernetes works on the principles of defined state and actual state. + +![Defined state and actual state][6] + +Humans (developers/sysadmins/operators) specify the defined state using the YAML/JSON files they submit to the Kubernetes API. Then, Kubernetes uses a controller to analyze the difference between the new state defined in the YAML/JSON and the actual state in the cluster. + +In the example above, the Replication Controller sees the difference between the three pods specified by the user, with one Pod running, and schedules two more. If you were to log into Kubernetes and manually kill one of the Pods, it would start another one to replace it—over and over and over. Kubernetes does not stop until the actual state matches the defined state. This is super powerful. + +### **Primitives** + +Next, you need to understand what primitives you can specify in Kubernetes. + +![Kubernetes primitives][7] + +It's more than just Pods; it's Deployments, Persistent Volume Claims, Services, routes, etc. With Kubernetes platform [OpenShift][8], you can add builds and BuildConfigs. It will take you a day or so to get decent with each of these primitives. Then you can dive in deeper as your use cases become more complex. + +### Mapping developer-native to traditional IT environments + +Finally, start thinking about how this maps to what you do in a traditional IT environment. + +![Mapping developer-native to traditional IT environments][9] + +The user has always been trying to solve a business problem, albeit a technical one. Historically, we have used things like playbooks to tie business logic to sets of IT systems with a single language. This has always been great for operations staff, but it gets hairier when you try to extend this to developers. + +We have never been able to truly specify how a set of IT systems should behave and interact together, in a developer-native way, until Kubernetes. If you think about it, we are extending the ability to manage storage, network, and compute resources in a very portable and declarative way with the YAML/JSON files we write in Kubernetes, but they are always mapped back to "real" resources somewhere. We just don't have to worry about it in developer mode. + +So, quit focusing on new projects in the Kubernetes ecosystem and get focused on driving it. In the next article, I will share some tools and workflows that help you drive Kubernetes. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/kubernetes-basics + +作者:[Scott McCarty][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/fatherlinux/users/fatherlinux/users/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/truck_steering_wheel_drive_car_kubernetes.jpg?itok=0TOzve80 (Truck steering wheel and dash) +[2]: https://opensource.com/article/19/6/kubernetes-dump-truck +[3]: https://opensource.com/article/19/6/kubernetes-learning-curve +[4]: https://opensource.com/resources/what-is-kubernetes +[5]: https://www.reddit.com/r/kubernetes/comments/bsoixc/what_are_the_essential_kubernetes_related/ +[6]: https://opensource.com/sites/default/files/uploads/defined_state_-_actual_state.png (Defined state and actual state) +[7]: https://opensource.com/sites/default/files/uploads/new_primitives.png (Kubernetes primatives) +[8]: https://www.openshift.com/ +[9]: https://opensource.com/sites/default/files/uploads/developer_native_experience_-_mapped_to_traditional.png (Mapping developer-native to traditional IT environments) From f073a73f7e96fdd96912ab1e327861c40e4ca44a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:40:28 +0800 Subject: [PATCH 0828/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20Juni?= =?UTF-8?q?per:=20Security=20could=20help=20drive=20interest=20in=20SDN=20?= =?UTF-8?q?sources/talk/20190606=20Juniper-=20Security=20could=20help=20dr?= =?UTF-8?q?ive=20interest=20in=20SDN.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...curity could help drive interest in SDN.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/talk/20190606 Juniper- Security could help drive interest in SDN.md diff --git a/sources/talk/20190606 Juniper- Security could help drive interest in SDN.md b/sources/talk/20190606 Juniper- Security could help drive interest in SDN.md new file mode 100644 index 0000000000..b140969eb5 --- /dev/null +++ b/sources/talk/20190606 Juniper- Security could help drive interest in SDN.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Juniper: Security could help drive interest in SDN) +[#]: via: (https://www.networkworld.com/article/3400739/juniper-sdn-snapshot-finds-security-legacy-network-tech-impacts-core-network-changes.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Juniper: Security could help drive interest in SDN +====== +Juniper finds that enterprise interest in software-defined networking (SDN) is influenced by other factors, including artificial intelligence (AI) and machine learning (ML). +![monsitj / Getty Images][1] + +Security challenges and developing artificial intelligence/maching learning (AI/ML) technologies are among the key issues driving [software-defined networking][2] (SDN) implementations, according to a new Juniper survey of 500 IT decision makers. + +And SDN interest abounds – 98% of the 500 said they were already using or considering an SDN implementation. Juniper said it had [Wakefield Research][3] poll IT decision makers of companies with 500 or more employees about their SDN strategies between May 7 and May 14, 2019. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][4] + * [How to pick an off-site data-backup method][5] + * [SD-Branch: What it is and why you’ll need it][6] + * [What are the options for security SD-WAN?][7] + + + +SDN includes technologies that separate the network control plane from the forwarding plane to enable more automated provisioning and policy-based management of network resources. + +IDC estimates that the worldwide data-center SDN market will be worth more than $12 billion in 2022, recording a CAGR of 18.5% during the 2017-2022 period. The market-generated revenue of nearly $5.15 billion in 2017 was up more than 32.2% from 2016. + +There are many ideas driving the development of SDN. For example, it promises to reduce the complexity of statically defined networks; make automating network functions much easier; and allow for simpler provisioning and management of networked resources from the data center to the campus or wide area network. + +While the evolution of SDN is ongoing, Juniper’s study pointed out an issue that was perhaps not unexpected – many users are still managing operations via the command line interface (CLI). CLI is the primary text-based user interface used for configuring, monitoring and maintaining most networked devices. + +“If SDN is as attractive as it is then why manage the network with the same legacy technology of the past?” said Michael Bushong, vice president of enterprise and cloud marketing at Juniper Networks. “If you deploy SDN and don’t adjust the operational model then it is difficult to reap all the benefits SDN can bring. It’s the difference between managing devices individually which you may have done in the past to managing fleets of devices via SDN – it simplifies and reduces operational expenses.” + +Juniper pointed to a [Gartner prediction][8] that stated “by 2020, only 30% of network operations teams will use the command line interface (CLI) as their primary interface, down from 85% at years end 2016.” Garter stated that poll results from a recent Gartner conference found some 71% still using CLI as the primary way to make network changes. + +Gartner [wrote][9] in the past that CLI has remained the primary operational tool for mainstream network operations teams for easily the past 15-20 years but that “moving away from the CLI is a good thing for the networking industry, and while it won’t disappear completely (advanced/nuanced troubleshooting for example), it will be supplanted as the main interface into networking infrastructure.” + +Juniper’s study found that 87% of businesses are still doing most or some of their network management at the device level. + +What all of this shows is that customers are obviously interested in SDN but are still grappling with the best ways to get there, Bushong said. + +The Juniper study also found users interested in SDN because of the potential for a security boost. + +SDN can empowers a variety of security benefits. A customer can split up a network connection between an end user and the data center and have different security settings for the various types of network traffic. A network could have one public-facing, low-security network that does not touch any sensitive information. Another segment could have much more fine-grained remote-access control with software-based [firewall][10] and encryption policies on it, which allow sensitive data to traverse over it. SDN users can roll out security policies across the network from the data center to the edge much more rapidly than traditional network environments. + +“Many enterprises see security—not speed—as the biggest consequence of not making this transition in the next five years, with nearly 40 percent identifying the inability to quickly address new threats as one of their main concerns,” wrote Manoj Leelanivas, chief product officer at Juniper Networks, in a blog about the survey. + +“SDN is not often associated with greater security but this makes sense when we remember this is an operational transformation. In security, the challenge lies not in identifying threats or creating solutions, but in applying these solutions to a fragmented network. Streamlining complex security operations, touching many different departments and managing multiple security solutions, is where a software-defined approach can provide the answer,” Leelanivas stated. + +Some of the other key findings from Juniper included: + + * **The future of AI** : The deployment of artificial intelligence is about changing the operational model, Bushong said. “The ability to more easily manage workflows over groups of devices and derive usable insights to help customers be more proactive rather than reactive is the direction we are moving. Everything will ultimately be AI-driven, he said. + * **Automation** : While automation is often considered a threat, Juniper said its respondents see it positively within the context of SDN, with 38% reporting it will improve security and 25% that it will enhance their jobs by streamlining manual operations. + * **Flexibility** : Agility is the #1 benefit respondents considering SDN want to gain (48%), followed by improved reliability (43%) and greater simplicity (38%). + * **SD-WAN** : The majority, 54%, have rolled out or are in the process of rolling out SD-WAN, while an additional 34% have it under current consideration. + + + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400739/juniper-sdn-snapshot-finds-security-legacy-network-tech-impacts-core-network-changes.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/sdn_software-defined-network_architecture-100791938-large.jpg +[2]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html +[3]: https://www.wakefieldresearch.com/ +[4]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[5]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[6]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[7]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[8]: https://blogs.gartner.com/andrew-lerner/2018/01/04/checking-in-on-the-death-of-the-cli/ +[9]: https://blogs.gartner.com/andrew-lerner/2016/11/22/predicting-the-death-of-the-cli/ +[10]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world From c0b18951b09cdcadd09176f960b532747d2e290c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:41:12 +0800 Subject: [PATCH 0829/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20How?= =?UTF-8?q?=20Linux=20can=20help=20with=20your=20spelling=20sources/tech/2?= =?UTF-8?q?0190606=20How=20Linux=20can=20help=20with=20your=20spelling.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...6 How Linux can help with your spelling.md | 263 ++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 sources/tech/20190606 How Linux can help with your spelling.md diff --git a/sources/tech/20190606 How Linux can help with your spelling.md b/sources/tech/20190606 How Linux can help with your spelling.md new file mode 100644 index 0000000000..4a5330741e --- /dev/null +++ b/sources/tech/20190606 How Linux can help with your spelling.md @@ -0,0 +1,263 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Linux can help with your spelling) +[#]: via: (https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-spelling.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How Linux can help with your spelling +====== +Whether you're struggling with one elusive word or checking a report before you send it off to your boss, Linux can help with your spelling. +![Sandra Henry-Stocker][1] + +Linux provides all sorts of tools for data analysis and automation, but it also helps with an issue that we all struggle with from time to time – spelling! Whether you're grappling with the spelling of a single word while you’re writing your weekly report or you want a set of computerized "eyes" to find your typos before you submit a business proposal, maybe it’s time to check out how it can help. + +### look + +One tool is **look**. If you know how a word begins, you can ask the look command for provide a list of words that start with those letters. Unless an alternate word source is provided, look uses **/usr/share/dict/words** to identify the words for you. This file with its hundreds of thousands of words will suffice for most of the English words that we routinely use, but it might not have some of the more obscure words that some of us in the computing field tend to use — such as zettabyte. + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** + +The look command's syntax is as easy as can be. Type "look word" and it will run through all the words in that words file and find matches for you. + +``` +$ look amelio +ameliorable +ameliorableness +ameliorant +ameliorate +ameliorated +ameliorates +ameliorating +amelioration +ameliorations +ameliorativ +ameliorative +amelioratively +ameliorator +amelioratory +``` + +If you happen upon a word that isn't included in the word list on the system, you'll simply get no output. + +``` +$ look zetta +$ +``` + +Don’t despair if you're not seeing what you were hoping for. You can add words to your words file or even reference an altogether different words list — either finding one online and creating one yourself. You don't even have to place an added word in the proper alphabetical location; just add it to the end of the file. You do need to do this as root, however. For example (and be careful with that **> >**!): + +``` +# echo “zettabyte” >> /usr/share/dict/words +``` + +Using a different list of words ("jargon" in this case) just requires adding the name of the file. Use a full path if the file is not the default. + +``` +$ look nybble /usr/share/dict/jargon +nybble +nybbles +``` + +The look command is also case-insensitive, so you don't have to concern yourself with whether the word you're looking for should be capitalized or not. + +``` +$ look zet +ZETA +Zeta +zeta +zetacism +Zetana +zetas +Zetes +zetetic +Zethar +Zethus +Zetland +Zetta +``` + +Of course, not all word lists are created equal. Some Linux distributions provide a _lot_ more words than others in their word files. Yours might have 100,000 words or many times that number. + +On one of my Linux systems: + +``` +$ wc -l /usr/share/dict/words +102402 /usr/share/dict/words +``` + +On another: + +``` +$ wc -l /usr/share/dict/words +479828 /usr/share/dict/words +``` + +Remember that the look command works only with the beginnings of words, but there are other options if you don't want to start there. + +### grep + +Our dearly beloved **grep** command can pluck words from a word file as well as any tool. If you’re looking for words that start or end with particular letters, grep is a natural. It can match words using beginnings, endings, or middle portions of words. Your system's word file will work with grep as easily as it does with look. The only drawback is that unlike with look, you have to specify the file. + +Using word beginnings with ^: + +``` +$ grep ^terra /usr/share/dict/words +terrace +terrace's +terraced +terraces +terracing +terrain +terrain's +terrains +terrapin +terrapin's +terrapins +terraria +terrarium +terrarium's +terrariums +``` + +Using word endings with $: + +``` +$ grep bytes$ /usr/share/dict/words +bytes +gigabytes +kilobytes +megabytes +terabytes +``` + +With grep, you do need to concern yourself with capitalization, but the command provides some options for that. + +``` +$ grep ^[Zz]et /usr/share/dict/words +Zeta +zeta +zetacism +Zetana +zetas +Zetes +zetetic +Zethar +Zethus +Zetland +Zetta +zettabyte +``` + +Setting up a symbolic link to the words file makes this kind of word search a little easier: + +``` +$ ln -s /usr/share/dict/words words +$ grep ^[Zz]et words +Zeta +zeta +zetacism +Zetana +zetas +Zetes +zetetic +Zethar +Zethus +Zetland +Zetta +zettabytye +``` + +### aspell + +The aspell command takes a different approach. It provides a way to check the spelling in whatever file or text you provide to it. You can pipe text to it and have it tell you which words appear to be misspelled. If you’re spelling all the words correctly, you’ll see no output. + +``` +$ echo Did I mispell that? | aspell list +mispell +$ echo I can hardly wait to try out aspell | aspell list +aspell +$ echo Did I misspell anything? | aspell list +$ +``` + +The "list" argument tells aspell to provide a list of misspelled words in the words that are sent through standard input. + +You can also use aspell to locate and correct words in a text file. If it finds a misspelled word, it will offer you an opportunity to replace it from a list of similar (but correctly spelled) words, to accept the words and add them to your personal words list (~/.aspell.en.pws), to ignore the misspelling, or to abort the process altogether (leaving the file as it was before you started). + +``` +$ aspell -c mytext +``` + +Once aspell finds a word that’s misspelled, it offers a list of choices like these for the incorrect "mispell": + +``` +1) mi spell 6) misplay +2) mi-spell 7) spell +3) misspell 8) misapply +4) Ispell 9) Aspell +5) misspells 0) dispel +i) Ignore I) Ignore all +r) Replace R) Replace all +a) Add l) Add Lower +b) Abort x) Exit +``` + +Note that the alternate words and spellings are numbered, while other options are represented by letter choices. You can choose one of the suggested spellings or opt to type a replacement. The "Abort" choice will leave the file intact even if you've already chosen replacements for some words. Words you elect to add will be inserted into a local file (e.g., ~/.aspell.en.pws). + +### Alternate word lists + +Tired of English? The aspell command can work with other languages if you add a word file for them. To add a dictionary for French on Debian systems, for example, you could do this: + +``` +$ sudo apt install aspell-fr +``` + +This new dictionary file would be installed as /usr/share/dict/French. To use it, you would simply need to tell aspell that you want to use the alternate word list: + +``` +$ aspell --lang=fr -c mytext +``` + +When using, you might see something like this if aspell looks at the word “one”: + +``` +1) once 6) orné +2) onde 7) ne +3) ondé 8) né +4) onze 9) on +5) orne 0) cône +i) Ignore I) Ignore all +r) Replace R) Replace all +a) Add l) Add Lower +b) Abort x) Exit +``` + +You can also get other language word lists from [GNU][3]. + +### Wrap-up + +Even if you're a national spelling bee winner, you probably need a little help with spelling every now and then — if only to spot your typos. The aspell tool, along with look and grep, are ready to come to your rescue. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-spelling.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/linux-spelling-100798596-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: ftp://ftp.gnu.org/gnu/aspell/dict/0index.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From be927acedd9da8951ac25b0ca28637ef02a0bc68 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:41:29 +0800 Subject: [PATCH 0830/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20Cisc?= =?UTF-8?q?o=20to=20buy=20IoT=20security,=20management=20firm=20Sentryo=20?= =?UTF-8?q?sources/talk/20190606=20Cisco=20to=20buy=20IoT=20security,=20ma?= =?UTF-8?q?nagement=20firm=20Sentryo.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...y IoT security, management firm Sentryo.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/talk/20190606 Cisco to buy IoT security, management firm Sentryo.md diff --git a/sources/talk/20190606 Cisco to buy IoT security, management firm Sentryo.md b/sources/talk/20190606 Cisco to buy IoT security, management firm Sentryo.md new file mode 100644 index 0000000000..f8db1bfab5 --- /dev/null +++ b/sources/talk/20190606 Cisco to buy IoT security, management firm Sentryo.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco to buy IoT security, management firm Sentryo) +[#]: via: (https://www.networkworld.com/article/3400847/cisco-to-buy-iot-security-management-firm-sentryo.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco to buy IoT security, management firm Sentryo +====== +Buying Sentryo will give Cisco support for anomaly and real-time threat detection for the industrial internet of things. +![IDG Worldwide][1] + +Looking to expand its IoT security and management offerings Cisco plans to acquire [Sentryo][2], a company based in France that offers anomaly detection and real-time threat detection for Industrial Internet of Things ([IIoT][3]) networks. + +Founded in 2014 Sentryo products include ICS CyberVision – an asset inventory, network monitoring and threat intelligence platform – and CyberVision network edge sensors, which analyze network flows. + +**More on IoT:** + + * [What is the IoT? How the internet of things works][4] + * [What is edge computing and how it’s changing the network][5] + * [Most powerful Internet of Things companies][6] + * [10 Hot IoT startups to watch][7] + * [The 6 ways to make money in IoT][8] + * [What is digital twin technology? [and why it matters]][9] + * [Blockchain, service-centric networking key to IoT success][10] + * [Getting grounded in IoT networking and security][11] + * [Building IoT-ready networks must become a priority][12] + * [What is the Industrial IoT? [And why the stakes are so high]][13] + + + +“We have incorporated Sentryo’s edge sensor and our industrial networking hardware with Cisco’s IOx application framework,” wrote Rob Salvagno, Cisco vice president of Corporate Development and Cisco Investments in a [blog][14] about the proposed buy. + +“We believe that connectivity is foundational to IoT projects and by unleashing the power of the network we can dramatically improve operational efficiencies and uncover new business opportunities. With the addition of Sentryo, Cisco can offer control systems engineers deeper visibility into assets to optimize, detect anomalies and secure their networks.” + +Gartner [wrote][15] of Sentryo’s system: “ICS CyberVision product provides visibility into its customers'' OT networks in way all OT users will understand, not just technical IT staff. With the increased focus of both hackers and regulators on industrial control systems, it is vital to have the right visibility of an organization’s OT. Many OT networks not only are geographically dispersed, but also are complex and consist of hundreds of thousands of components.” + +Sentryo's ICS CyberVision lets enterprises ensure continuity, resilience and safety of their industrial operations while preventing possible cyberattacks, said [Nandini Natarajan][16] , industry analyst at Frost & Sullivan. "It automatically profiles assets and communication flows using a unique 'universal OT language' in the form of tags, which describe in plain text what each asset is doing. ICS CyberVision gives anyone immediate insights into an asset's role and behaviors; it offers many different analytic views leveraging artificial intelligence algorithms to let users deep-dive into the vast amount of data a typical industrial control system can generate. Sentryo makes it easy to see important or relevant information." + +In addition, Sentryo's platform uses deep packet inspection (DPI) to extract information from communications among industrial assets, Natarajan said. This DPI engine is deployed through an edge-computing architecture that can run either on Sentryo sensor appliances or on network equipment that is already installed. Thus, Sentryo can embed visibility and cybersecurity features in the industrial network rather than deploying an out-of-band monitoring network, Natarajan said. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][17] ]** + +Sentryo’s technology will broaden [Cisco’s][18] overarching IoT plan. In January it [launched][19] a family of switches, software, developer tools and blueprints to meld IoT and industrial networking with [intent-based networking][20] (IBN) and classic IT security, monitoring and application-development support. + +The new platforms can be managed by Cisco’s DNA Center, and Cisco IoT Field Network Director, letting customers fuse their IoT and industrial-network control with their business IT world. + +DNA Center is Cisco’s central management tool for enterprise networks, featuring automation capabilities, assurance setting, fabric provisioning and policy-based segmentation. It is also at the center of the company’s IBN initiative offering customers the ability to automatically implement network and policy changes on the fly and ensure data delivery. The IoT Field Network Director is software that manages multiservice networks of Cisco industrial, connected grid routers and endpoints. + +Liz Centoni, senior vice president and general manager of Cisco's IoT business group said the company expects the [Sentryo technology to help][21] IoT customers in a number of ways: + +Network-enabled, passive DPI capabilities to discover IoT and OT assets, and establish communication patterns between devices and systems. Sentryo’s sensor is natively deployable on Cisco’s IOx framework and can be built into the industrial network these devices run on instead of adding additional hardware. + +As device identification and communication patterns are created, Cisco will integrate this with DNA Center and Identity Services Engine(ISE) to allow customers to easily define segmentation policy. This integration will allow OT teams to leverage IT security teams’ expertise to secure their environments without risk to the operational processes. + +With these IoT devices lacking modern embedded software and security capabilities, segmentation will be the key technology to allow communication from operational assets to the rightful systems, and reduce risk of cyber security incidents like we saw with [WannaCry][22] and [Norsk Hydro][23]. + +According to [Crunchbase][24], Sentryo has $3.5M in estimated revenue annually and it competes most closely with Cymmetria, Team8, and Indegy. The acquisition is expected to close before the end of Cisco’s Q1 Fiscal Year 2020 -- October 26, 2019. Financial details of the acquisition were not detailed. + +Sentryo is Cisco’s second acquisition this year. It bought Singularity for its network analytics technology in January. In 2018 Cisco bought six companies including Duo security software. + +** ** + +Join the Network World communities on [Facebook][25] and [LinkedIn][26] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400847/cisco-to-buy-iot-security-management-firm-sentryo.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/09/nwan_019_iiot-100771131-large.jpg +[2]: https://www.sentryo.net/ +[3]: https://www.networkworld.com/article/3243928/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[4]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[5]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[6]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[7]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[8]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[9]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[10]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[11]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[12]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[13]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[14]: https://blogs.cisco.com/news/cisco-industrial-iot-news +[15]: https://www.globenewswire.com/news-release/2018/06/28/1531119/0/en/Sentryo-Named-a-Cool-Vendor-by-Gartner.html +[16]: https://www.linkedin.com/pulse/industrial-internet-things-iiot-decoded-nandini-natarajan/ +[17]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[18]: https://www.cisco.com/c/dam/en_us/solutions/iot/ihs-report.pdf +[19]: https://www.networkworld.com/article/3336454/cisco-goes-after-industrial-iot.html +[20]: https://www.networkworld.com/article/3202699/what-is-intent-based-networking.html +[21]: https://blogs.cisco.com/news/securing-the-internet-of-things-cisco-announces-intent-to-acquire-sentryo +[22]: https://blogs.cisco.com/security/talos/wannacry +[23]: https://www.securityweek.com/norsk-hydro-may-have-lost-40m-first-week-after-cyberattack +[24]: https://www.crunchbase.com/organization/sentryo#section-web-traffic-by-similarweb +[25]: https://www.facebook.com/NetworkWorld/ +[26]: https://www.linkedin.com/company/network-world From 3e15cb19f8f18c0df2621ab1455aef0389465870 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:41:46 +0800 Subject: [PATCH 0831/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20For?= =?UTF-8?q?=20enterprise=20storage,=20persistent=20memory=20is=20here=20to?= =?UTF-8?q?=20stay=20sources/talk/20190606=20For=20enterprise=20storage,?= =?UTF-8?q?=20persistent=20memory=20is=20here=20to=20stay.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rage, persistent memory is here to stay.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md diff --git a/sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md b/sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md new file mode 100644 index 0000000000..3da91bb311 --- /dev/null +++ b/sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (For enterprise storage, persistent memory is here to stay) +[#]: via: (https://www.networkworld.com/article/3398988/for-enterprise-storage-persistent-memory-is-here-to-stay.html) +[#]: author: (John Edwards ) + +For enterprise storage, persistent memory is here to stay +====== +Persistent memory – also known as storage class memory – has tantalized data center operators for many years. A new technology promises the key to success. +![Thinkstock][1] + +It's hard to remember a time when semiconductor vendors haven't promised a fast, cost-effective and reliable persistent memory technology to anxious [data center][2] operators. Now, after many years of waiting and disappointment, technology may have finally caught up with the hype to make persistent memory a practical proposition. + +High-capacity persistent memory, also known as storage class memory ([SCM][3]), is fast and directly addressable like dynamic random-access memory (DRAM), yet is able to retain stored data even after its power has been switched off—intentionally or unintentionally. The technology can be used in data centers to replace cheaper, yet far slower traditional persistent storage components, such as [hard disk drives][4] (HDD) and [solid-state drives][5] (SSD). + +**Learn more about enterprise storage** + + * [Why NVMe over Fabric matters][6] + * [What is hyperconvergence?][7] + * [How NVMe is changing enterprise storage][8] + * [Making the right hyperconvergence choice: HCI hardware or software?][9] + + + +Persistent memory can also be used to replace DRAM itself in some situations without imposing a significant speed penalty. In this role, persistent memory can deliver crucial operational benefits, such as lightning-fast database-server restarts during maintenance, power emergencies and other expected and unanticipated reboot situations. + +Many different types of strategic operational applications and databases, particularly those that require low-latency, high durability and strong data consistency, can benefit from persistent memory. The technology also has the potential to accelerate virtual machine (VM) storage and deliver higher performance to multi-node, distributed-cloud applications. + +In a sense, persistent memory marks a rebirth of core memory. "Computers in the ‘50s to ‘70s used magnetic core memory, which was direct access, non-volatile memory," says Doug Wong, a senior member of [Toshiba Memory America's][10] technical staff. "Magnetic core memory was displaced by SRAM and DRAM, which are both volatile semiconductor memories." + +One of the first persistent memory devices to come to market is [Intel’s Optane DC][11]. Other vendors that have released persistent memory products or are planning to do so include [Samsung][12], Toshiba America Memory and [SK Hynix][13]. + +### Persistent memory: performance + reliability + +With persistent memory, data centers have a unique opportunity to gain faster performance and lower latency without enduring massive technology disruption. "It's faster than regular solid-state NAND flash-type storage, but you're also getting the benefit that it’s persistent," says Greg Schulz, a senior advisory analyst at vendor-independent storage advisory firm [StorageIO.][14] "It's the best of both worlds." + +Yet persistent memory offers adopters much more than speedy, reliable storage. In an ideal IT world, all of the data associated with an application would reside within DRAM to achieve maximum performance. "This is currently not practical due to limited DRAM and the fact that DRAM is volatile—data is lost when power fails," observes Scott Nelson, senior vice president and general manager of Toshiba Memory America's memory business unit. + +Persistent memory transports compatible applications to an "always on" status, providing continuous access to large datasets through increased system memory capacity, says Kristie Mann, [Intel's][15] director of marketing for data center memory and storage. She notes that Optane DC can supply data centers with up to three-times more system memory capacity (as much as 36TBs), system restarts in seconds versus minutes, 36% more virtual machines per node, and up to 8-times better performance on [Apache Spark][16], a widely used open-source distributed general-purpose cluster-computing framework. + +System memory currently represents 60% of total platform costs, Mann says. She observes that Optane DC persistent memory provides significant customer value by delivering 1.2x performance/dollar on key customer workloads. "This value will dramatically change memory/storage economics and accelerate the data-centric era," she predicts. + +### Where will persistent memory infiltrate enterprise storage? + +Persistent memory is likely to first enter the IT mainstream with minimal fanfare, serving as a high-performance caching layer for high performance SSDs. "This could be adopted relatively-quickly," Nelson observes. Yet this intermediary role promises to be merely a stepping-stone to increasingly crucial applications. + +Over the next few years, persistent technology will impact data centers serving enterprises across an array of sectors. "Anywhere time is money," Schulz says. "It could be financial services, but it could also be consumer-facing or sales-facing operations." + +Persistent memory supercharges anything data-related that requires extreme speed at extreme scale, observes Andrew Gooding, vice president of engineering at [Aerospike][17], which delivered the first commercially available open database optimized for use with Intel Optane DC. + +Machine learning is just one of many applications that stand to benefit from persistent memory. Gooding notes that ad tech firms, which rely on machine learning to understand consumers' reactions to online advertising campaigns, should find their work made much easier and more effective by persistent memory. "They’re collecting information as users within an ad campaign browse the web," he says. "If they can read and write all that data quickly, they can then apply machine-learning algorithms and tailor specific ads for users in real time." + +Meanwhile, as automakers become increasingly reliant on data insights, persistent memory promises to help them crunch numbers and refine sophisticated new technologies at breakneck speeds. "In the auto industry, manufacturers face massive data challenges in autonomous vehicles, where 20 exabytes of data needs to be processed in real time, and they're using self-training machine-learning algorithms to help with that," Gooding explains. "There are so many fields where huge amounts of data need to be processed quickly with machine-learning techniques—fraud detection, astronomy... the list goes on." + +Intel, like other persistent memory vendors, expects cloud service providers to be eager adopters, targeting various types of in-memory database services. Google, for example, is applying persistent memory to big data workloads on non-relational databases from vendors such as Aerospike and [Redis Labs][18], Mann says. + +High-performance computing (HPC) is yet another area where persistent memory promises to make a tremendous impact. [CERN][19], the European Organization for Nuclear Research, is using Intel's Optane DC to significantly reduce wait times for scientific computing. "The efficiency of their algorithms depends on ... persistent memory, and CERN considers it a major breakthrough that is necessary to the work they are doing," Mann observes. + +### How to prepare storage infrastructure for persistent memory + +Before jumping onto the persistent memory bandwagon, organizations need to carefully scrutinize their IT infrastructure to determine the precise locations of any existing data bottlenecks. This task will be primary application-dependent, Wong notes. "If there is significant performance degradation due to delays associated with access to data stored in non-volatile storage—SSD or HDD—then an SCM tier will improve performance," he explains. Yet some applications will probably not benefit from persistent memory, such as compute-bound applications where CPU performance is the bottleneck. + +Developers may need to reevaluate fundamental parts of their storage and application architectures, Gooding says. "They will need to know how to program with persistent memory," he notes. "How, for example, to make sure writes are flushed to the actual persistent memory device when necessary, as opposed to just sitting in the CPU cache." + +To leverage all of persistent memory's potential benefits, significant changes may also be required in how code is designed. When moving applications from DRAM and flash to persistent memory, developers will need to consider, for instance, what happens when a program crashes and restarts. "Right now, if they write code that leaks memory, that leaked memory is recovered on restart," Gooding explains. With persistent memory, that isn't necessarily the case. "Developers need to make sure the code is designed to reconstruct a consistent state when a program restarts," he notes. "You may not realize how much your designs rely on the traditional combination of fast volatile DRAM and block storage, so it can be tricky to change your code designs for something completely new like persistent memory." + +Older versions of operating systems may also need to be updated to accommodate the new technology, although newer OSes are gradually becoming persistent memory aware, Schulz says. "In other words, if they detect that persistent memory is available, then they know how to utilize that either as a cache, or some other memory." + +Hypervisors, such as [Hyper-V][20] and [VMware][21], now know how to leverage persistent memory to support productivity, performance and rapid restarts. By utilizing persistent memory along with the latest versions of VMware, a whole system can see an uplift in speed and also maximize the number of VMs to fit on a single host, says Ian McClarty, CEO and president of data center operator [PhoenixNAP Global IT Services][22]. "This is a great use case for companies who want to own less hardware or service providers who want to maximize hardware to virtual machine deployments." + +Many key enterprise applications, particularly databases, are also becoming persistent memory aware. SQL Server and [SAP’s][23] flagship [HANA][24] database management platform have both embraced persistent memory. "The SAP HANA platform is commonly used across multiple industries to process data and transactions, and then run advanced analytics ... to deliver real-time insights," Mann observes. + +In terms of timing, enterprises and IT organizations should begin persistent memory planning immediately, Schulz recommends. "You should be talking with your vendors and understanding their roadmap, their plans, for not only supporting this technology, but also in what mode: as storage, as memory." + +Join the Network World communities on [Facebook][25] and [LinkedIn][26] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398988/for-enterprise-storage-persistent-memory-is-here-to-stay.html + +作者:[John Edwards][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2017/08/file_folder_storage_sharing_thinkstock_477492571_3x2-100732889-large.jpg +[2]: https://www.networkworld.com/article/3353637/the-data-center-is-being-reimagined-not-disappearing.html +[3]: https://www.networkworld.com/article/3026720/the-next-generation-of-storage-disruption-storage-class-memory.html +[4]: https://www.networkworld.com/article/2159948/hard-disk-drives-vs--solid-state-drives--are-ssds-finally-worth-the-money-.html +[5]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html +[6]: https://www.networkworld.com/article/3273583/why-nvme-over-fabric-matters.html +[7]: https://www.networkworld.com/article/3207567/what-is-hyperconvergence +[8]: https://www.networkworld.com/article/3280991/what-is-nvme-and-how-is-it-changing-enterprise-storage.html +[9]: https://www.networkworld.com/article/3318683/making-the-right-hyperconvergence-choice-hci-hardware-or-software +[10]: https://business.toshiba-memory.com/en-us/top.html +[11]: https://www.intel.com/content/www/us/en/architecture-and-technology/optane-dc-persistent-memory.html +[12]: https://www.samsung.com/semiconductor/ +[13]: https://www.skhynix.com/eng/index.jsp +[14]: https://storageio.com/ +[15]: https://www.intel.com/content/www/us/en/homepage.html +[16]: https://spark.apache.org/ +[17]: https://www.aerospike.com/ +[18]: https://redislabs.com/ +[19]: https://home.cern/ +[20]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/ +[21]: https://www.vmware.com/ +[22]: https://phoenixnap.com/ +[23]: https://www.sap.com/index.html +[24]: https://www.sap.com/products/hana.html +[25]: https://www.facebook.com/NetworkWorld/ +[26]: https://www.linkedin.com/company/network-world From 34fb5b44707d50a25e99b035b9fe24638e131f3c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:42:01 +0800 Subject: [PATCH 0832/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20Clou?= =?UTF-8?q?d=20adoption=20drives=20the=20evolution=20of=20application=20de?= =?UTF-8?q?livery=20controllers=20sources/talk/20190606=20Cloud=20adoption?= =?UTF-8?q?=20drives=20the=20evolution=20of=20application=20delivery=20con?= =?UTF-8?q?trollers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ion of application delivery controllers.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md diff --git a/sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md b/sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md new file mode 100644 index 0000000000..d7b22353c4 --- /dev/null +++ b/sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cloud adoption drives the evolution of application delivery controllers) +[#]: via: (https://www.networkworld.com/article/3400897/cloud-adoption-drives-the-evolution-of-application-delivery-controllers.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +Cloud adoption drives the evolution of application delivery controllers +====== +Application delivery controllers (ADCs) are on the precipice of shifting from traditional hardware appliances to software form factors. +![Aramyan / Getty Images / Microsoft][1] + +Migrating to a cloud computing model will obviously have an impact on the infrastructure that’s deployed. This shift has already been seen in the areas of servers, storage, and networking, as those technologies have evolved to a “software-defined” model. And it appears that application delivery controllers (ADCs) are on the precipice of a similar shift. + +In fact, a new ZK Research [study about cloud computing adoption and the impact on ADCs][2] found that, when looking at the deployment model, hardware appliances are the most widely deployed — with 55% having fully deployed or are currently testing and only 15% currently researching hardware. (Note: I am an employee of ZK Research.) + +Juxtapose this with containerized ADCs where only 34% have deployed or are testing but 24% are currently researching and it shows that software in containers will outpace hardware for growth. Not surprisingly, software on bare metal and in virtual machines showed similar although lower, “researching” numbers that support the thesis that the market is undergoing a shift from hardware to software. + +**[ Read also:[How to make hybrid cloud work][3] ]** + +The study, conducted in collaboration with Kemp Technologies, surveyed 203 respondents from the U.K. and U.S. The demographic split was done to understand regional differences. An equal number of mid and large size enterprises were looked at, with 44% being from over 5,000 employees and the other 56% from companies that have 300 to 5,000 people. + +### Incumbency helps but isn’t a fait accompli for future ADC purchases + +The primary tenet of my research has always been that incumbents are threatened when markets transition, and this is something I wanted to investigate in the study. The survey asked whether buyers would consider an alternative as they evolve their applications from legacy (mode 1) to cloud-native (mode 2). The results offer a bit of good news and bad news for the incumbent providers. Only 8% said they would definitely select a new vendor, but 35% said they would not change. That means the other 57% will look at alternatives. This is sensible, as the requirements for cloud ADCs are different than ones that support traditional applications. + +### IT pros want better automation capabilities + +This begs the question as to what features ADC buyers want for a cloud environment versus traditional ones. The survey asked specifically what features would be most appealing in future purchases, and the top response was automation, followed by central management, application analytics, on-demand scaling (which is a form of automation), and visibility. + +The desire to automate was a positive sign for the evolution of buyer mindset. Just a few years ago, the mere mention of automation would have sent IT pros into a panic. The reality is that IT can’t operate effectively without automation, and technology professionals are starting to understand that. + +The reason automation is needed is that manual changes are holding businesses back. The survey asked how the speed of ADC changes impacts the speed at which applications are rolled out, and a whopping 60% said it creates significant or minor delays. In an era of DevOps and continuous innovation, multiple minor delays create a drag on the business and can cause it to fall behind is more agile competitors. + +![][4] + +### ADC upgrades and service provisioning benefit most from automation + +The survey also drilled down on specific ADC tasks to see where automation would have the most impact. Respondents were asked how long certain tasks took, answering in minutes, days, weeks, or months. Shockingly, there wasn’t a single task where the majority said it could be done in minutes. The closest was adding DNS entries for new virtual IP addresses (VIPs) where 46% said they could do that in minutes. + +Upgrading, provisioning new load balancers, and provisioning new VIPs took the longest. Looking ahead, this foreshadows big problems. As the data center gets more disaggregated and distributed, IT will deploy more software-based ADCs in more places. Taking days or weeks or month to perform these functions will cause the organization to fall behind. + +The study clearly shows changes are in the air for the ADC market. For IT pros, I strongly recommend that as the environment shifts to the cloud, it’s prudent to evaluate new vendors. By all means, see what your incumbent vendor has, but look at least at two others that offer software-based solutions. Also, there should be a focus on automating as much as possible, so the primary evaluation criteria for ADCs should be how easy it is to implement automation. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400897/cloud-adoption-drives-the-evolution-of-application-delivery-controllers.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/05/cw_microsoft_sharepoint_vs_onedrive_clouds_and_hands_by_aramyan_gettyimages-909772962_2400x1600-100796932-large.jpg +[2]: https://kemptechnologies.com/research-papers/adc-market-research-study-zeus-kerravala/?utm_source=zkresearch&utm_medium=referral&utm_campaign=zkresearch&utm_term=zkresearch&utm_content=zkresearch +[3]: https://www.networkworld.com/article/3119362/hybrid-cloud/how-to-make-hybrid-cloud-work.html#tk.nww-fsb +[4]: https://images.idgesg.net/images/article/2019/06/adc-survey-zk-research-100798593-large.jpg +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 00c7d02aac2b83b2dd3a701ae203eaaef90a698a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:42:14 +0800 Subject: [PATCH 0833/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20Self?= =?UTF-8?q?-learning=20sensor=20chips=20won=E2=80=99t=20need=20networks=20?= =?UTF-8?q?sources/talk/20190606=20Self-learning=20sensor=20chips=20won-t?= =?UTF-8?q?=20need=20networks.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...arning sensor chips won-t need networks.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/talk/20190606 Self-learning sensor chips won-t need networks.md diff --git a/sources/talk/20190606 Self-learning sensor chips won-t need networks.md b/sources/talk/20190606 Self-learning sensor chips won-t need networks.md new file mode 100644 index 0000000000..c5abec5426 --- /dev/null +++ b/sources/talk/20190606 Self-learning sensor chips won-t need networks.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Self-learning sensor chips won’t need networks) +[#]: via: (https://www.networkworld.com/article/3400659/self-learning-sensor-chips-wont-need-networks.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Self-learning sensor chips won’t need networks +====== +Scientists working on new, machine-learning networks aim to embed everything needed for artificial intelligence (AI) onto a processor, eliminating the need to transfer data to the cloud or computers. +![Jiraroj Praditcharoenkul / Getty Images][1] + +Tiny, intelligent microelectronics should be used to perform as much sensor processing as possible on-chip rather than wasting resources by sending often un-needed, duplicated raw data to the cloud or computers. So say scientists behind new, machine-learning networks that aim to embed everything needed for artificial intelligence (AI) onto a processor. + +“This opens the door for many new applications, starting from real-time evaluation of sensor data,” says [Fraunhofer Institute for Microelectronic Circuits and Systems][2] on its website. No delays sending unnecessary data onwards, along with speedy processing, means theoretically there is zero latency. + +Plus, on-microprocessor, self-learning means the embedded, or sensor, devices can self-calibrate. They can even be “completely reconfigured to perform a totally different task afterwards,” the institute says. “An embedded system with different tasks is possible.” + +**[ Also read:[What is edge computing?][3] and [How edge networking and IoT will reshape data centers][4] ]** + +Much internet of things (IoT) data sent through networks is redundant and wastes resources: a temperature reading taken every 10 minutes, say, when the ambient temperature hasn’t changed, is one example. In fact, one only needs to know when the temperature has changed, and maybe then only when thresholds have been met. + +### Neural network-on-sensor chip + +The commercial German research organization says it’s developing a specific RISC-V microprocessor with a special hardware accelerator designed for a [brain-copying, artificial neural network (ANN) it has developed][5]. The architecture could ultimately be suitable for the condition-monitoring or predictive sensors of the kind we will likely see more of in the industrial internet of things (IIoT). + +Key to Fraunhofer IMS’s [Artificial Intelligence for Embedded Systems (AIfES)][6] is that the self-learning takes place at chip level rather than in the cloud or on a computer, and that it is independent of “connectivity towards a cloud or a powerful and resource-hungry processing entity.” But it still offers a “full AI mechanism, like independent learning,” + +It’s “decentralized AI,” says Fraunhofer IMS. "It’s not focused towards big-data processing.” + +Indeed, with these kinds of systems, no connection is actually required for the raw data, just for the post-analytical results, if indeed needed. Swarming can even replace that. Swarming lets sensors talk to one another, sharing relevant information without even getting a host network involved. + +“It is possible to build a network from small and adaptive systems that share tasks among themselves,” Fraunhofer IMS says. + +Other benefits in decentralized neural networks include that they can be more secure than the cloud. Because all processing takes place on the microprocessor, “no sensitive data needs to be transferred,” Fraunhofer IMS explains. + +### Other edge computing research + +The Fraunhofer researchers aren’t the only academics who believe entire networks become redundant with neuristor, brain-like AI chips. Binghamton University and Georgia Tech are working together on similar edge-oriented tech. + +“The idea is we want to have these chips that can do all the functioning in the chip, rather than messages back and forth with some sort of large server,” Binghamton said on its website when [I wrote about the university's work last year][7]. + +One of the advantages of no major communications linking: Not only don't you have to worry about internet resilience, but also that energy is saved creating the link. Energy efficiency is an ambition in the sensor world — replacing batteries is time consuming, expensive, and sometimes, in the case of remote locations, extremely difficult. + +Memory or storage for swaths of raw data awaiting transfer to be processed at a data center, or similar, doesn’t have to be provided either — it’s been processed at the source, so it can be discarded. + +**More about edge networking:** + + * [How edge networking and IoT will reshape data centers][4] + * [Edge computing best practices][8] + * [How edge computing can help secure the IoT][9] + + + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400659/self-learning-sensor-chips-wont-need-networks.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.idgesg.net/images/article/2019/02/industry_4-0_industrial_iot_smart_factory_automation_by_jiraroj_praditcharoenkul_gettyimages-902668940_2400x1600-100788458-large.jpg +[2]: https://www.ims.fraunhofer.de/en.html +[3]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[4]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[5]: https://www.ims.fraunhofer.de/en/Business_Units_and_Core_Competencies/Electronic_Assistance_Systems/News/AIfES-Artificial_Intelligence_for_Embedded_Systems.html +[6]: https://www.ims.fraunhofer.de/en/Business_Units_and_Core_Competencies/Electronic_Assistance_Systems/technologies/Artificial-Intelligence-for-Embedded-Systems-AIfES.html +[7]: https://www.networkworld.com/article/3326557/edge-chips-could-render-some-networks-useless.html +[8]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[9]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world From 6b2c053e9bd236fb39f577aa88dc4f0ba9c233c9 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:42:44 +0800 Subject: [PATCH 0834/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190606=20What?= =?UTF-8?q?=20to=20do=20when=20yesterday=E2=80=99s=20technology=20won?= =?UTF-8?q?=E2=80=99t=20meet=20today=E2=80=99s=20support=20needs=20sources?= =?UTF-8?q?/talk/20190606=20What=20to=20do=20when=20yesterday-s=20technolo?= =?UTF-8?q?gy=20won-t=20meet=20today-s=20support=20needs.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nology won-t meet today-s support needs.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md diff --git a/sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md b/sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md new file mode 100644 index 0000000000..622537f2f9 --- /dev/null +++ b/sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What to do when yesterday’s technology won’t meet today’s support needs) +[#]: via: (https://www.networkworld.com/article/3399875/what-to-do-when-yesterday-s-technology-won-t-meet-today-s-support-needs.html) +[#]: author: (Anand Rajaram ) + +What to do when yesterday’s technology won’t meet today’s support needs +====== + +![iStock][1] + +You probably already know that end user technology is exploding and are feeling the effects of it in your support organization every day. Remember when IT sanctioned and standardized every hardware and software instance in the workplace? Those days are long gone. Today, it’s the driving force of productivity that dictates what will or won’t be used – and that can be hard on a support organization. + +Whatever users need to do their jobs better, faster, more efficiently is what you are seeing come into the workplace. So naturally, that’s what comes into your service desk too. Support organizations see all kinds of [devices, applications, systems, and equipment][2], and it’s adding a great deal of complexity and demand to keep up with. In fact, four of the top five factors causing support ticket volumes to rise are attributed to new and current technology. + +To keep up with the steady [rise of tickets][3] and stay out in front of this surge, support organizations need to take a good, hard look at the processes and technologies they use. Yesterday’s methods won’t cut it. The landscape is simply changing too fast. Supporting today’s users and getting them back to work fast requires an expanding set of skills and tools. + +So where do you start with a new technology project? Just because a technology is new or hyped doesn’t mean it’s right for your organization. It’s important to understand your project goals and the experience you really want to create and match your technology choices to those goals. But don’t go it alone. Talk to your teams. Get intimately familiar with how your support organization works today. Understand your customers’ needs at a deep level. And bring the right people to the table to cover: + + * Business problem analysis: What existing business issue are stakeholders unhappy with? + * The impact of that problem: How does that issue justify making a change? + * Process automation analysis: What area(s) can technology help automate? + * Other solutions: Have you considered any other options besides technology? + + + +With these questions answered, you’re ready to entertain your technology options. Put together your “must-haves” in a requirements document and reach out to potential suppliers. During the initial information-gathering stage, assess if the supplier understands your goals and how their technology helps you meet them. To narrow the field, compare solutions side by side against your goals. Select the top two or three for more in-depth product demos before moving into product evaluations. By the time you’re ready for implementation, you have empirical, practical knowledge of how the solution will perform against your business goals. + +The key takeaway is this: Technology for technology’s sake is just technology. But technology that drives business value is a solution. If you want a solution that drives results for your organization and your customers, it’s worth following a strategic selection process to match your goals with the best technology for the job. + +For more insight, check out the [LogMeIn Rescue][4] and HDI webinar “[Technology and the Service Desk: Expanding Mission, Expanding Skills”][5]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3399875/what-to-do-when-yesterday-s-technology-won-t-meet-today-s-support-needs.html + +作者:[Anand Rajaram][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/06/istock-1019006240-100798168-large.jpg +[2]: https://www.logmeinrescue.com/resources/datasheets/infographic-mobile-support-are-your-employees-getting-what-they-need?utm_source=idg%20media&utm_medium=display&utm_campaign=native&sfdc= +[3]: https://www.logmeinrescue.com/resources/analyst-reports/the-importance-of-remote-support-in-a-shift-left-world?utm_source=idg%20media&utm_medium=display&utm_campaign=native&sfdc= +[4]: https://www.logmeinrescue.com/?utm_source=idg%20media&utm_medium=display&utm_campaign=native&sfdc= +[5]: https://www.brighttalk.com/webcast/8855/312289?utm_source=LogMeIn7&utm_medium=brighttalk&utm_campaign=312289 From c34a5da5f85b35e873ef36b82ad72a6c419bcff1 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:43:30 +0800 Subject: [PATCH 0835/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190605=20Cisc?= =?UTF-8?q?o=20will=20use=20AI/ML=20to=20boost=20intent-based=20networking?= =?UTF-8?q?=20sources/talk/20190605=20Cisco=20will=20use=20AI-ML=20to=20bo?= =?UTF-8?q?ost=20intent-based=20networking.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... AI-ML to boost intent-based networking.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/talk/20190605 Cisco will use AI-ML to boost intent-based networking.md diff --git a/sources/talk/20190605 Cisco will use AI-ML to boost intent-based networking.md b/sources/talk/20190605 Cisco will use AI-ML to boost intent-based networking.md new file mode 100644 index 0000000000..29d2acd519 --- /dev/null +++ b/sources/talk/20190605 Cisco will use AI-ML to boost intent-based networking.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco will use AI/ML to boost intent-based networking) +[#]: via: (https://www.networkworld.com/article/3400382/cisco-will-use-aiml-to-boost-intent-based-networking.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco will use AI/ML to boost intent-based networking +====== +Cisco explains how artificial intelligence and machine learning fit into a feedback loop that implements and maintain desired network conditions to optimize network performance for workloads using real-time data. +![xijian / Getty Images][1] + +Artificial Intelligence and machine learning are expected to be some of the big topics at next week’s Cisco Live event and the company is already talking about how those technologies will help drive the next generation of [Intent-Based Networking][2]. + +“Artificial intelligence will change how we manage networks, and it’s a change we need,” wrote John Apostolopoulos Cisco CTO and vice president of Enterprise Networking in a [blog][3] about how Cisco says these technologies impact the network. + +**[ Now see[7 free network tools you must have][4]. ]** + +AI is the next major step for networking capabilities, and while researchers have talked in the past about how great AI would be, now the compute power and algorithms exist to make it possible, Apostolopoulos told Network World. + +To understand how AI and ML can boost IBN, Cisco says it's necessary to understand four key factors an IBN environment needs: infrastructure, translation, activation and assurance. + +Infrastructure can be virtual or physical and include wireless access points, switches, routers, compute and storage. “To make the infrastructure do what we want, we use the translation function to convert the intent, or what we are trying to make the network accomplish, from a person or computer into the correct network and security policies. These policies then must be activated on the network,” Apostolopoulos said. + +The activation step takes the network and security polices and couples them with a deep understanding of the network infrastructure that includes both real-time and historic data about its behavior. It then activates or automates the policies across all of the network infrastructure elements, ideally optimizing for performance, reliability and security, Apostolopoulos wrote. + +Finally assurance maintains a continuous validation-and-verification loop. IBN improves on translation and assurance to form a valuable feedback loop about what’s going on in the network that wasn’t available before. ** ** + +Apostolopoulos used the example of an international company that wanted to set up a world-wide video all-hands meeting. Everyone on the call had to have high-quality, low-latency video, and also needed the capability to send high-quality video into the call when it was time for Q&A. + +“By applying machine learning and related machine reasoning, assurance can also sift through the massive amount of data related to such a global event to correctly identify if there are any problems arising. We can then get solutions to these issues – and even automatically apply solutions – more quickly and more reliably than before,” Apostolopoulos said. + +In this case, assurance could identify that the use of WAN bandwidth to certain sites is increasing at a rate that will saturate the network paths and could proactively reroute some of the WAN flows through alternative paths to prevent congestion from occurring, Apostolopoulos wrote. + +“In prior systems, this problem would typically only be recognized after the bandwidth bottleneck occurred and users experienced a drop in call quality or even lost their connection to the meeting. It would be challenging or impossible to identify the issue in real time, much less to fix it before it distracted from the experience of the meeting. Accurate and fast identification through ML and MR coupled with intelligent automation through the feedback loop is key to successful outcome.” + +Apostolopoulos said AI can accelerate the path from intent into translation and activation and then examine network and behavior data in the assurance step to make sure everything is working correctly. Activation uses the insights to drive more intelligent actions for improved performance, reliability and security, creating a cycle of network optimization. + +So what might an implementation of this look like? Applications that run on Cisco’s DNA Center may be the central component in an IBN environment. Introduced on 2017 as the heart of its IBN initiative, [Cisco DNA Center][5] features automation capabilities, assurance setting, fabric provisioning and policy-based segmentation for enterprise networks. + +“DNA Center can bring together AI and ML in a unified manner,” Apostolopoulos said. “It can store data from across the network and then customers can do AI and ML on that data.” + +Central to Cisco's push is being able to gather metadata about traffic as it passes without slowing the traffic, which is accomplished through the use of ASICs in its campus and data-center switches. + +“We have designed our networking gear from the ASIC, OS and software levels to gather key data via our IBN architecture, which provides unified data collection and performs algorithmic analysis across the entire network (wired, wireless, LAN, WAN, datacenter), Apostolopoulos said. “We have a massive collection of network data, including a database of problems and associated root causes, from being the world’s top enterprise network vendor over the past 20-plus years. And we have been investing for many years to create innovative network-data analysis and ML, MR, and other AI techniques to identify and solve key problems.” + +Machine learning and AI can then be applied to all that data to help network operators handle everything from policy setting and network control to security. + +“I also want to stress that the feedback the IT user gets from the IBN system with AI is not overwhelming telemetry data,” Apostolopoulos said. Instead it is valuable and actionable insights at scale, derived from immense data and behavioral analytics using AI. + +Managing and developing new AI/ML-based applications from enormous data sets beyond what Cisco already has is a key driver behind it’s the company’s Unified Compute System (UCS) server that wasa rolled out last September. While the new server, the UCS C480 ML, is powerful – it includes eight Nvidia Tesla V100-32G GPUs with 128GB of DDR4 RAM, 24 SATA hard drives and more – it is the ecosystem of vendors – Cloudera, HortonWorks and others that will end up being more important. + +[Earlier this year Cisco forecast][6] that [AI and ML][7] will significantly boost network management this year. + +“In 2019, companies will start to adopt Artificial Intelligence, in particular Machine Learning, to analyze the telemetry coming off networks to see these patterns, in an attempt to get ahead of issues from performance optimization, to financial efficiency, to security,” said [Anand Oswal][8], senior vice president of engineering in Cisco’s Enterprise Networking Business. The pattern-matching capabilities of ML will be used to spot anomalies in network behavior that might otherwise be missed, while also de-prioritizing alerts that otherwise nag network operators but that aren’t critical, Oswal said. + +“We will also start to use these tools to categorize and cluster device and user types, which can help us create profiles for use cases as well as spot outlier activities that could indicate security incursions,” he said. + +The first application of AI in network management will be smarter alerts that simply report on activities that break normal patterns, but as the technology advances it will react to more situations autonomously. The idea is to give customers more information so they and the systems can make better network decisions. Workable tools should appear later in 2019, Oswal said. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400382/cisco-will-use-aiml-to-boost-intent-based-networking.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/ai-vendor-relationship-management_bar-code_purple_artificial-intelligence_hand-on-virtual-screen-100795252-large.jpg +[2]: http://www.networkworld.com/cms/article/3202699 +[3]: https://blogs.cisco.com/enterprise/improving-networks-with-ai +[4]: https://www.networkworld.com/article/2825879/7-free-open-source-network-monitoring-tools.html +[5]: https://www.networkworld.com/article/3280988/cisco-opens-dna-center-network-control-and-management-software-to-the-devops-masses.html +[6]: https://www.networkworld.com/article/3332027/cisco-touts-5-technologies-that-will-change-networking-in-2019.html +[7]: https://www.networkworld.com/article/3320978/data-center/network-operations-a-new-role-for-ai-and-ml.html +[8]: https://blogs.cisco.com/author/anandoswal +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From a5232b0b7c9ae149d94a08b2816fe3a2210e806f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:43:43 +0800 Subject: [PATCH 0836/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=20Data?= =?UTF-8?q?=20center=20workloads=20become=20more=20complex=20despite=20pro?= =?UTF-8?q?mises=20to=20the=20contrary=20sources/talk/20190604=20Data=20ce?= =?UTF-8?q?nter=20workloads=20become=20more=20complex=20despite=20promises?= =?UTF-8?q?=20to=20the=20contrary.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...omplex despite promises to the contrary.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md diff --git a/sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md b/sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md new file mode 100644 index 0000000000..31d127e77d --- /dev/null +++ b/sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Data center workloads become more complex despite promises to the contrary) +[#]: via: (https://www.networkworld.com/article/3400086/data-center-workloads-become-more-complex-despite-promises-to-the-contrary.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Data center workloads become more complex despite promises to the contrary +====== +The data center is shouldering a greater burden than ever, despite promises of ease and the cloud. +![gorodenkoff / Getty Images][1] + +Data centers are becoming more complex and still run the majority of workloads despite the promises of simplicity of deployment through automation and hyperconverged infrastructure (HCI), not to mention how the cloud was supposed to take over workloads. + +That’s the finding of the Uptime Institute's latest [annual global data center survey][2] (registration required). The majority of IT loads still run on enterprise data centers even in the face of cloud adoption, putting pressure on administrators to have to manage workloads across the hybrid infrastructure. + +**[ Learn[how server disaggregation can boost data center efficiency][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** + +With workloads like artificial intelligence (AI) and machine language coming to the forefront, that means facilities face greater power and cooling challenges, since AI is extremely processor-intensive. That puts strain on data center administrators and power and cooling vendors alike to keep up with the growth in demand. + +On top of it all, everyone is struggling to get enough staff with the right skills. + +### Outages, staffing problems, lack of public cloud visibility among top concerns + +Among the key findings of Uptime's report: + + * The large, privately owned enterprise data center facility still forms the bedrock of corporate IT and is expected to be running half of all workloads in 2021. + * The staffing problem affecting most of the data center sector has only worsened. Sixty-one percent of respondents said they had difficulty retaining or recruiting staff, up from 55% a year earlier. + * Outages continue to cause significant problems for operators. Just over a third (34%) of all respondents had an outage or severe IT service degradation in the past year, while half (50%) had an outage or severe IT service degradation in the past three years. + * Ten percent of all respondents said their most recent significant outage cost more than $1 million. + * A lack of visibility, transparency, and accountability of public cloud services is a major concern for enterprises that have mission-critical applications. A fifth of operators surveyed said they would be more likely to put workloads in a public cloud if there were more visibility. Half of those using public cloud for mission-critical applications also said they do not have adequate visibility. + * Improvements in data center facility energy efficiency have flattened out and even deteriorated slightly in the past two years. The average PUE for 2019 is 1.67. + * Rack power density is rising after a long period of flat or minor increases, causing many to rethink cooling strategies. + * Power loss was the single biggest cause of outages, accounting for one-third of outages. Sixty percent of respondents said their data center’s outage could have been prevented with better management/processes or configuration. + + + +Traditionally data centers are improving their reliability through "rigorous attention to power, infrastructure, connectivity and on-site IT replication," the Uptime report says. The solution, though, is pricy. Data center operators are getting distributed resiliency through active-active data centers where at least two active data centers replicate data to each other. Uptime found up to 40% of those surveyed were using this method. + +The Uptime survey was conducted in March and April of this year, surveying 1,100 end users in more than 50 countries and dividing them into two groups: the IT managers, owners, and operators of data centers and the suppliers, designers, and consultants that service the industry. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400086/data-center-workloads-become-more-complex-despite-promises-to-the-contrary.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/cso_cloud_computing_backups_it_engineer_data_center_server_racks_connections_by_gorodenkoff_gettyimages-943065400_3x2_2400x1600-100796535-large.jpg +[2]: https://uptimeinstitute.com/2019-data-center-industry-survey-results +[3]: https://www.networkworld.com/article/3266624/how-server-disaggregation-could-make-cloud-datacenters-more-efficient.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From b707b29df263105d10bb796fa6edec208c966da7 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:43:59 +0800 Subject: [PATCH 0837/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=205G?= =?UTF-8?q?=20will=20augment=20Wi-Fi,=20not=20replace=20it=20sources/talk/?= =?UTF-8?q?20190604=205G=20will=20augment=20Wi-Fi,=20not=20replace=20it.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 5G will augment Wi-Fi, not replace it.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/talk/20190604 5G will augment Wi-Fi, not replace it.md diff --git a/sources/talk/20190604 5G will augment Wi-Fi, not replace it.md b/sources/talk/20190604 5G will augment Wi-Fi, not replace it.md new file mode 100644 index 0000000000..d8d007e275 --- /dev/null +++ b/sources/talk/20190604 5G will augment Wi-Fi, not replace it.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5G will augment Wi-Fi, not replace it) +[#]: via: (https://www.networkworld.com/article/3399978/5g-will-augment-wi-fi-not-replace-it.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +5G will augment Wi-Fi, not replace it +====== +Jeff Lipton, vice president of strategy and corporate development at Aruba, adds a dose of reality to the 5G hype, discussing how it and Wi-Fi will work together and how to maximize the value of both. +![Thinkstock][1] + +There’s arguably no technology topic that’s currently hotter than [5G][2]. It was a major theme of the most recent [Mobile World Congress][3] show and has reared its head in other events such as Enterprise Connect and almost every vendor event I attend. + +Some vendors have positioned 5G as a panacea to all network problems and predict it will eradicate all other forms of networking. Views like that are obviously extreme, but I do believe that 5G will have an impact on the networking industry and is something that network engineers should be aware of. + +To help bring some realism to the 5G hype, I recently interviewed Jeff Lipton, vice president of strategy and corporate development at Aruba, a Hewlett Packard company, as I know HPE has been deeply involved in the evolution of both 5G and Wi-Fi. + +**[ Also read:[The time of 5G is almost here][3] ]** + +### Zeus Kerravala: 5G is being touted as the "next big thing." Do you see it that way? + +**Jeff Lipton:** The next big thing is connecting "things" and generating actionable insights and context from those things. 5G is one of the technologies that serve this trend. Wi-Fi 6 is another — so are edge compute, Bluetooth Low Energy (BLE), artificial intelligence (AI) and machine learning (ML). These all are important, and they each have a place. + +### Do you see 5G eclipsing Wi-Fi in the enterprise? + +![Jeff Lipton, VP of strategy and corporate development, Aruba][4] + +**Lipton:** No. 5G, like all cellular access, is appropriate if you need macro area coverage and high-speed handoffs. But it’s not ideal for most enterprise applications, where you generally don’t need these capabilities. From a performance standpoint, [Wi-Fi 6][5] and 5G are roughly equal on most metrics, including throughput, latency, reliability, and connection density. Where they aren’t close is economics, where Wi-Fi is far better. I don’t think many customers would be willing to trade Wi-Fi for 5G unless they need macro coverage or high-speed handoffs. + +### Can Wi-Fi and 5G coexist? How would an enterprise use 5G and Wi-Fi together? + +**Lipton:** Wi-Fi and 5G can and should be complementary. The 5G architecture decouples the cellular core and Radio Access Network (RAN). Consequently, Wi-Fi can be the enterprise radio front end and connect tightly with a 5G core. Since the economics of Wi-Fi — especially Wi-Fi 6 — are favorable and performance is extremely good, we envision many service providers using Wi-Fi as the radio front end for their 5G systems where it makes sense, as an alternative to Distributed Antenna (DAS) and small-cell systems. + +Wi-Fi and 5G can and should be complementary." — Jeff Lipton + +### If a business were considering moving to 5G only, how would this be done and how practical is it? + +**Lipton:** To use 5G for primary in-building access, a customer would need to upgrade their network and virtually all of their devices. 5G provides good coverage outdoors, but cellular signals can’t reliably penetrate buildings. And this problem will become worse with 5G, which partially relies on higher frequency radios. So service providers will need a way to provide indoor coverage. To provide this coverage, they propose deploying DAS or small-cell systems — paid for by the end customer. The customers would then connect their devices directly to these cellular systems and pay a service component for each device. + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** + +There are several problems with this approach. First, DAS and small-cell systems are significantly more expensive than Wi-Fi networks. And the cost doesn’t stop with the network. Every device would need to have a 5G cellular modem, which costs tens of dollars wholesale and usually over a hundred dollars to an end user. Since few, if any MacBooks, PCs, printers or AppleTVs today have 5G modems, these devices would need to be upgraded. I don’t believe many enterprises would be willing to pay this additional cost and upgrade most of their equipment for an unclear benefit. + +### Are economics a factor in the 5G versus Wi-Fi debate? + +**Lipton:** Economics is always a factor. Let’s focus the conversation on in-building enterprise applications, since this is the use case some carriers intend to target with 5G. We’ve already mentioned that upgrading to 5G would require enterprises to deploy expensive DAS or small-cell systems for in-building coverage, upgrade virtually all of their equipment to contain 5G modems, and pay service contracts for each of these devices. It’s also important to understand 5G cellular networks and DAS systems operate over licensed spectrum, which is analogous to a private highway. Service providers paid billions of dollars for this spectrum, and this expense needs to be monetized and embedded in service costs. So, from both deployment and lifecycle perspectives, Wi-Fi economics are favorable to 5G. + +### Are there any security implications of 5G versus Wi-Fi? + +**Lipton:** Cellular technologies are perceived by some to be more secure than Wi-Fi, but that’s not true. LTE is relatively secure, but it also has weak points. For example, LTE is vulnerable to a range of attacks, including data interception and device tracking, according to researchers at Purdue and the University of Iowa. 5G improves upon LTE security with multiple authentication methods and better key management. + +Wi-Fi security isn’t standing still either and continues to advance. Of course, Wi-Fi implementations that do not follow best practices, such as those without even basic password protection, are not optimal. But those configured with proper access controls and passwords are highly secure. With new standards — specifically, WPA3 and Enhanced Open — Wi-Fi network security has improved even further. + +It’s also important to keep in mind that enterprises have made enormous investments in security and compliance solutions tailored to their specific needs. With cellular networks, including 5G, enterprises lose the ability to deploy their chosen security and compliance solutions, as well as most visibility into traffic flows. While future versions of 5G will offer high-levels of customization with a feature called network slicing, enterprises would still lose the level of security and compliance customization they currently need and have. + +### Any parting thoughts to add to the discussion around 5G versus Wi-Fi? + +**Lipton:** The debate around Wi-Fi versus 5G misses the point. They each have their place, and they are in many ways complementary. The Wi-Fi and 5G markets both will grow, driven by the need to connect and analyze a growing number of things. If a customer needs macro coverage or high-speed handoffs and can pay the additional cost for these capabilities, 5G makes sense. + +5G also could be a fit for certain industrial use cases where customers require physical network segmentation. But for the vast majority of enterprise customers, Wi-Fi will continue to prove its value as a reliable, secure, and cost-effective wireless access technology, as it does today. + +**More about 802.11ax (Wi-Fi 6):** + + * [Why 802.11ax is the next big thing in wireless][7] + * [FAQ: 802.11ax Wi-Fi][8] + * [Wi-Fi 6 (802.11ax) is coming to a router near you][9] + * [Wi-Fi 6 with OFDMA opens a world of new wireless possibilities][10] + * [802.11ax preview: Access points and routers that support Wi-Fi 6 are on tap][11] + + + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3399978/5g-will-augment-wi-fi-not-replace-it.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/05/wireless_connection_speed_connectivity_bars_cell_tower_5g_by_thinkstock-100796921-large.jpg +[2]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[4]: https://images.idgesg.net/images/article/2019/06/headshot_jlipton_aruba-100798360-small.jpg +[5]: https://www.networkworld.com/article/3215907/why-80211ax-is-the-next-big-thing-in-wi-fi.html +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.networkworld.com/article/3215907/mobile-wireless/why-80211ax-is-the-next-big-thing-in-wi-fi.html +[8]: https://%20https//www.networkworld.com/article/3048196/mobile-wireless/faq-802-11ax-wi-fi.html +[9]: https://www.networkworld.com/article/3311921/mobile-wireless/wi-fi-6-is-coming-to-a-router-near-you.html +[10]: https://www.networkworld.com/article/3332018/wi-fi/wi-fi-6-with-ofdma-opens-a-world-of-new-wireless-possibilities.html +[11]: https://www.networkworld.com/article/3309439/mobile-wireless/80211ax-preview-access-points-and-routers-that-support-the-wi-fi-6-protocol-on-tap.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From 93d1600722168bd6a8cd28411a34db7ae30b5d8b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:44:32 +0800 Subject: [PATCH 0838/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=20Movi?= =?UTF-8?q?ng=20to=20the=20Cloud=3F=20SD-WAN=20Matters!=20Part=202=20sourc?= =?UTF-8?q?es/talk/20190604=20Moving=20to=20the=20Cloud-=20SD-WAN=20Matter?= =?UTF-8?q?s-=20Part=202.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng to the Cloud- SD-WAN Matters- Part 2.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md diff --git a/sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md b/sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md new file mode 100644 index 0000000000..2f68bd6f59 --- /dev/null +++ b/sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Moving to the Cloud? SD-WAN Matters! Part 2) +[#]: via: (https://www.networkworld.com/article/3398488/moving-to-the-cloud-sd-wan-matters-part-2.html) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +Moving to the Cloud? SD-WAN Matters! Part 2 +====== + +![istock][1] + +This is the second installment of the blog series exploring how enterprises can realize the full transformation promise of the cloud by shifting to a business first networking model powered by a business-driven [SD-WAN][2]. The first installment explored automating secure IPsec connectivity and intelligently steering traffic to cloud providers. We also framed the direct correlation between moving to the cloud and adopting an SD-WAN. In this blog, we will expand upon several additional challenges that can be addressed with a business-driven SD-WAN when embracing the cloud: + +### Simplifying and automating security zone-based segmentation + +Securing cloud-first branches requires a robust multi-level approach that addresses following considerations: + + * Restricting outside traffic coming into the branch to sessions exclusively initiated by internal users with a built-in stateful firewall, avoiding appliance sprawl and lowering operational costs; this is referred to as the app whitelist model + * Encrypting communications between end points within the SD-WAN fabric and between branch locations and public cloud instances + * Service chaining traffic to a cloud-hosted security service like [Zscaler][3] for Layer 7 inspection and analytics for internet-bound traffic + * Segmenting traffic spanning the branch, WAN and data center/cloud + * Centralizing policy orchestration and automation of zone-based firewall, VLAN and WAN overlays + + + +A traditional device-centric WAN approach for security segmentation requires the time-consuming manual configuration of routers and/or firewalls on a device-by-device and site-by-site basis. This is not only complex and cumbersome, but it simply can’t scale to 100s or 1000s of sites. Anusha Vaidyanathan, director of product management at Silver Peak, explains how to automate end-to-end zone-based segmentation, emphasizing the advantages of a business-driven approach in this [lightboard video][4]. + +### Delivering the Highest Quality of Experience to IT teams + +The goal for enterprise IT is enabling business agility and increasing operational efficiency. The traditional router-centric WAN approach doesn’t provide the best quality of experience for IT as management and on-going network operations are manual and time consuming, device-centric, cumbersome, error-prone and inefficient. + +A business-driven SD-WAN such as the Silver Peak [Unity EdgeConnect™][5] unified SD-WAN edge platform centralizes the orchestration of business-driven policies. EdgeConnect automation, machine learning and open APIs easily integrate with third-party management tools and real-time visibility tools to deliver the highest quality of experience for IT, enabling them to reclaim nights and weekends. Manav Mishra, vice president of product management at Silver Peak, explains the latest Silver Peak innovations in this [lightboard video][6]. + +As enterprises become increasingly dependent on the cloud and embrace a multi-cloud strategy, they must address a number of new challenges: + + * A centralized approach to securely embracing the cloud and the internet + * How to extend the on-premise data center to a public cloud and migrating workloads between private and public cloud, taking application portability into account + * Deliver consistent high application performance and availability to hosted applications whether they reside in the data center, private or public clouds or are delivered as SaaS services + * A proactive way to quickly resolve complex issues that span the data center and cloud as well as multiple WAN transport services by harnessing the power of advanced visibility and analytics tools + + + +The business-driven EdgeConnect SD-WAN edge platform enables enterprise IT organizations to easily and consistently embrace the public cloud. Unified security and performance capabilities with automation deliver the highest quality of experience for both users and IT while lowering overall WAN expenditures. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398488/moving-to-the-cloud-sd-wan-matters-part-2.html + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-909772962-100797711-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.silver-peak.com/company/tech-partners/zscaler +[4]: https://www.silver-peak.com/resource-center/how-to-create-sd-wan-security-zones-in-edgeconnect +[5]: https://www.silver-peak.com/products/unity-edge-connect +[6]: https://www.silver-peak.com/resource-center/how-to-optimize-quality-of-experience-for-it-using-sd-wan From fd2a4618339f0c8afee62e83c790ac27f8aa7b04 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:45:13 +0800 Subject: [PATCH 0839/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190601=20True?= =?UTF-8?q?=20Hyperconvergence=20at=20Scale:=20HPE=20Simplivity=20With=20C?= =?UTF-8?q?omposable=20Fabric=20sources/talk/20190601=20True=20Hyperconver?= =?UTF-8?q?gence=20at=20Scale-=20HPE=20Simplivity=20With=20Composable=20Fa?= =?UTF-8?q?bric.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...- HPE Simplivity With Composable Fabric.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md diff --git a/sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md b/sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md new file mode 100644 index 0000000000..97eb611ef8 --- /dev/null +++ b/sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md @@ -0,0 +1,28 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (True Hyperconvergence at Scale: HPE Simplivity With Composable Fabric) +[#]: via: (https://www.networkworld.com/article/3399619/true-hyperconvergence-at-scale-hpe-simplivity-with-composable-fabric.html) +[#]: author: (HPE https://www.networkworld.com/author/Michael-Cooney/) + +True Hyperconvergence at Scale: HPE Simplivity With Composable Fabric +====== + +Many hyperconverged solutions only focus on software-defined storage. However, many networking functions and technologies can be consolidated for simplicity and scale in the data center. This video describes how HPE SimpliVity with Composable Fabric gives organizations the power to run any virtual machine anywhere, anytime. Read more about HPE SimpliVity [here][1]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3399619/true-hyperconvergence-at-scale-hpe-simplivity-with-composable-fabric.html + +作者:[HPE][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://hpe.com/info/simplivity From 976c7b96ba3870f2b6a2435011c03117f129982d Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:45:26 +0800 Subject: [PATCH 0840/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190601=20HPE?= =?UTF-8?q?=20Synergy=20For=20Dummies=20sources/talk/20190601=20HPE=20Syne?= =?UTF-8?q?rgy=20For=20Dummies.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20190601 HPE Synergy For Dummies.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/talk/20190601 HPE Synergy For Dummies.md diff --git a/sources/talk/20190601 HPE Synergy For Dummies.md b/sources/talk/20190601 HPE Synergy For Dummies.md new file mode 100644 index 0000000000..1b7ddbe2e7 --- /dev/null +++ b/sources/talk/20190601 HPE Synergy For Dummies.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HPE Synergy For Dummies) +[#]: via: (https://www.networkworld.com/article/3399618/hpe-synergy-for-dummies.html) +[#]: author: (HPE https://www.networkworld.com/author/Michael-Cooney/) + +HPE Synergy For Dummies +====== + +![istock/venimo][1] + +Business must move fast today to keep up with competitive forces. That means IT must provide an agile — anytime, anywhere, any workload — infrastructure that ensures growth, boosts productivity, enhances innovation, improves the customer experience, and reduces risk. + +A composable infrastructure helps organizations achieve these important objectives that are difficult — if not impossible — to achieve via traditional means, such as the ability to do the following: + + * Deploy quickly with simple flexing, scaling, and updating + * Run workloads anywhere — on physical servers, on virtual servers, or in containers + * Operate any workload upon which the business depends, without worrying about infrastructure resources or compatibility + * Ensure the infrastructure is able to provide the right service levels so the business can stay in business + + + +In other words, IT must inherently become part of the fabric of products and services that are rapidly innovated at every company, with an anytime, anywhere, any workload infrastructure. + +**The anytime paradigm** + +For organizations that seek to embrace DevOps, collaboration is the cultural norm. Development and operations staff work side‐by‐side to support software across its entire life cycle, from initial idea to production support. + +To provide DevOps groups — as well as other stakeholders — the IT infrastructure required at the rate at which it is demanded, enterprise IT must increase its speed, agility, and flexibility to enable people anytime composition and re‐composition of resources. Composable infrastructure enables this anytime paradigm. + +**The anywhere ability** + +Bare metal and virtualized workloads are just two application foundations that need to be supported in the modern data center. Today, containers are emerging as a compelling construct, providing significant benefits for certain kinds of workloads. Unfortunately, with traditional infrastructure approaches, IT needs to build out custom, unique infrastructure to support them, at least until an infrastructure is deployed that can seamlessly handle physical, virtual, and container‐based workloads. + +Each environment would need its own hardware and software and might even need its own staff members supporting it. + +Composable infrastructure provides an environment that supports the ability to run physical, virtual, or containerized workloads. + +**Support any workload** + +Do you have a legacy on‐premises application that you have to keep running? Do you have enterprise resource planning (ERP) software that currently powers your business but that will take ten years to phase out? At the same time, do you have an emerging DevOps philosophy under which you’d like to empower developers to dynamically create computing environments as a part of their development efforts? + +All these things can be accomplished simultaneously on the right kind of infrastructure. Composable infrastructure enables any workload to operate as a part of the architecture. + +**HPE Synergy** + +HPE Synergy brings to life the architectural principles of composable infrastructure. It is a single, purpose-built platform that reduces operational complexity for workloads and increases operational velocity for applications and services. + +Download a copy of the [HPE Synergy for Dummies eBook][2] to learn how to: + + * Infuse the IT architecture with the ability to enable agility, flexibility, and speed + * Apply composable infrastructure concepts to support both traditional and cloud-native applications + * Deploy HPE Synergy infrastructure to revolutionize workload support in the data center + + + +Also, you will find more information about HPE Synergy [here][3]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3399618/hpe-synergy-for-dummies.html + +作者:[HPE][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/06/istock-1026657600-100798064-large.jpg +[2]: https://www.hpe.com/us/en/resources/integrated-systems/synergy-for-dummies.html +[3]: http://hpe.com/synergy From 5597202321d130876bdc7284602386e437cab3f6 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:53:18 +0800 Subject: [PATCH 0841/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=20Tmux?= =?UTF-8?q?=20Command=20Examples=20To=20Manage=20Multiple=20Terminal=20Ses?= =?UTF-8?q?sions=20sources/tech/20190610=20Tmux=20Command=20Examples=20To?= =?UTF-8?q?=20Manage=20Multiple=20Terminal=20Sessions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...es To Manage Multiple Terminal Sessions.md | 296 ++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md diff --git a/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md new file mode 100644 index 0000000000..d9ed871a10 --- /dev/null +++ b/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -0,0 +1,296 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tmux Command Examples To Manage Multiple Terminal Sessions) +[#]: via: (https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Tmux Command Examples To Manage Multiple Terminal Sessions +====== + +![tmux command examples][1] + +We’ve already learned to use [**GNU Screen**][2] to manage multiple Terminal sessions. Today, we will see yet another well-known command-line utility named **“Tmux”** to manage Terminal sessions. Similar to GNU Screen, Tmux is also a Terminal multiplexer that allows us to create number of terminal sessions and run more than one programs or processes at the same time inside a single Terminal window. Tmux is free, open source and cross-platform program that supports Linux, OpenBSD, FreeBSD, NetBSD and Mac OS X. In this guide, we will discuss most-commonly used Tmux commands in Linux. + +### Installing Tmux in Linux + +Tmux is available in the official repositories of most Linux distributions. + +On Arch Linux and its variants, run the following command to install it. + +``` +$ sudo pacman -S tmux +``` + +On Debian, Ubuntu, Linux Mint: + +``` +$ sudo apt-get install tmux +``` + +On Fedora: + +``` +$ sudo dnf install tmux +``` + +On RHEL and CentOS: + +``` +$ sudo yum install tmux +``` + +On SUSE/openSUSE: + +``` +$ sudo zypper install tmux +``` + +Well, we have just installed Tmux. Let us go ahead and see some examples to learn how to use Tmux. + +### Tmux Command Examples To Manage Multiple Terminal Sessions + +The default prefix shortcut to all commands in Tmux is **Ctrl+b**. Just remember this keyboard shortcut when using Tmux. + +* * * + +**Note:** The default prefix to all **Screen** commands is **Ctrl+a**. + +* * * + +##### Creating Tmux sessions + +To create a new Tmux session and attach to it, run the following command from the Terminal: + +``` +tmux +``` + +Or, + +``` +tmux new +``` + +Once you are inside the Tmux session, you will see a **green bar at the bottom** as shown in the screenshot below. + +![][3] + +New Tmux session + +It is very handy to verify whether you’re inside a Tmux session or not. + +##### Detaching from Tmux sessions + +To detach from a current Tmux session, just press **Ctrl+b** and **d**. You don’t need to press this both Keyboard shortcut at a time. First press “Ctrl+b” and then press “d”. + +Once you’re detached from a session, you will see an output something like below. + +``` +[detached (from session 0)] +``` + +##### Creating named sessions + +If you use multiple sessions, you might get confused which programs are running on which sessions. In such cases, you can just create named sessions. For example if you wanted to perform some activities related to web server in a session, just create the Tmux session with a custom name, for example **“webserver”** (or any name of your choice). + +``` +tmux new -s webserver +``` + +Here is the new named Tmux session. + +![][4] + +Tmux session with a custom name + +As you can see in the above screenshot, the name of the Tmux session is **webserver**. This way you can easily identify which program is running on which session. + +To detach, simply press **Ctrl+b** and **d**. + +##### List Tmux sessions + +To view the list of open Tmux sessions, run: + +``` +tmux ls +``` + +Sample output: + +![][5] + +List Tmux sessions + +As you can see, I have two open Tmux sessions. + +##### Creating detached sessions + +Sometimes, you might want to simply create a session and don’t want to attach to it automatically. + +To create a new detached session named **“ostechnix”** , run: + +``` +tmux new -s ostechnix -d +``` + +The above command will create a new Tmux session called “ostechnix”, but won’t attach to it. + +You can verify if the session is created using “tmux ls” command: + +![][6] + +Create detached Tmux sessions + +##### Attaching to Tmux sessions + +You can attach to the last created session by running this command: + +``` +tmux attach +``` + +Or, + +``` +tmux a +``` + +If you want to attach to any specific named session, for example “ostechnix”, run: + +``` +tmux attach -t ostechnix +``` + +Or, shortly: + +``` +tmux a -t ostechnix +``` + +##### Kill Tmux sessions + +When you’re done and no longer required a Tmux session, you can kill it at any time with command: + +``` +tmux kill-session -t ostechnix +``` + +To kill when attached, press **Ctrl+b** and **x**. Hit “y” to kill the session. + +You can verify if the session is closed with “tmux ls” command. + +To Kill Tmux server along with all Tmux sessions, run: + +``` +tmux kill-server +``` + +Be careful! This will terminate all Tmux sessions even if there are any running jobs inside the sessions without any warning. + +When there were no running Tmux sessions, you will see the following output: + +``` +$ tmux ls +no server running on /tmp/tmux-1000/default +``` + +##### Split Tmux Session Windows + +Tmux has an option to split a single Tmux session window into multiple smaller windows called **Tmux panes**. This way we can run different programs on each pane and interact with all of them simultaneously. Each pane can be resized, moved and closed without affecting the other panes. We can split a Tmux window either horizontally or vertically or both at once. + +**Split panes horizontally** + +To split a pane horizontally, press **Ctrl+b** and **”** (single quotation mark). + +![][7] + +Split Tmux pane horizontally + +Use the same key combination to split the panes further. + +**Split panes vertically** + +To split a pane vertically, press **Ctrl+b** and **%**. + +![][8] + +Split Tmux panes vertically + +**Split panes horizontally and vertically** + +We can also split a pane horizontally and vertically at the same time. Take a look at the following screenshot. + +![][9] + +Split Tmux panes + +First, I did a horizontal split by pressing **Ctrl+b “** and then split the lower pane vertically by pressing **Ctrl+b %**. + +As you see in the above screenshot, I am running three different programs on each pane. + +**Switch between panes** + +To switch between panes, press **Ctrl+b** and **Arrow keys (Left, Right, Up, Down)**. + +**Send commands to all panes** + +In the previous example, we run three different commands on each pane. However, it is also possible to run send the same commands to all panes at once. + +To do so, press **Ctrl+b** and type the following command and hit ENTER: + +``` +:setw synchronize-panes +``` + +Now type any command on any pane. You will see that the same command is reflected on all panes. + +**Swap panes** + +To swap panes, press **Ctrl+b** and **o**. + +**Show pane numbers** + +Press **Ctrl+b** and **q** to show pane numbers. + +**Kill panes** + +To kill a pane, simply type **exit** and ENTER key. Alternatively, press **Ctrl+b** and **x**. You will see a confirmation message. Just press **“y”** to close the pane. + +![][10] + +Kill Tmux panes + +At this stage, you will get a basic idea of Tmux and how to use it to manage multiple Terminal sessions. For more details, refer man pages. + +``` +$ man tmux +``` + +Both GNU Screen and Tmux utilities can be very helpful when managing servers remotely via SSH. Learn Screen and Tmux commands thoroughly to manage your remote servers like a pro. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ + +作者:[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/2019/06/Tmux-720x340.png +[2]: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ +[3]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-session.png +[4]: https://www.ostechnix.com/wp-content/uploads/2019/06/Named-Tmux-session.png +[5]: https://www.ostechnix.com/wp-content/uploads/2019/06/List-Tmux-sessions.png +[6]: https://www.ostechnix.com/wp-content/uploads/2019/06/Create-detached-sessions.png +[7]: https://www.ostechnix.com/wp-content/uploads/2019/06/Horizontal-split.png +[8]: https://www.ostechnix.com/wp-content/uploads/2019/06/Vertical-split.png +[9]: https://www.ostechnix.com/wp-content/uploads/2019/06/Split-Panes.png +[10]: https://www.ostechnix.com/wp-content/uploads/2019/06/Kill-panes.png From ddc5c807269f5b267356fe75835abbda7cf3e998 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:54:00 +0800 Subject: [PATCH 0842/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=20Scre?= =?UTF-8?q?en=20Command=20Examples=20To=20Manage=20Multiple=20Terminal=20S?= =?UTF-8?q?essions=20sources/tech/20190610=20Screen=20Command=20Examples?= =?UTF-8?q?=20To=20Manage=20Multiple=20Terminal=20Sessions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...es To Manage Multiple Terminal Sessions.md | 298 ++++++++++++++++++ 1 file changed, 298 insertions(+) create mode 100644 sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md diff --git a/sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md b/sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md new file mode 100644 index 0000000000..f55984c31e --- /dev/null +++ b/sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md @@ -0,0 +1,298 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Screen Command Examples To Manage Multiple Terminal Sessions) +[#]: via: (https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Screen Command Examples To Manage Multiple Terminal Sessions +====== + +![Screen Command Examples To Manage Multiple Terminal Sessions][1] + +**GNU Screen** is a terminal multiplexer (window manager). As the name says, Screen multiplexes the physical terminal between multiple interactive shells, so we can perform different tasks in each terminal session. All screen sessions run their programs completely independent. So, a program or process running inside a screen session will keep running even if the session is accidentally closed or disconnected. For instance, when [**upgrading Ubuntu**][2] server via SSH, Screen command will keep running the upgrade process just in case your SSH session is terminated for any reason. + +The GNU Screen allows us to easily create multiple screen sessions, switch between different sessions, copy text between sessions, attach or detach from a session at any time and so on. It is one of the important command line tool every Linux admins should learn and use wherever necessary. In this brief guide, we will see the basic usage of Screen command with examples in Linux. + +### Installing GNU Screen + +GNU Screen is available in the default repositories of most Linux operating systems. + +To install GNU Screen on Arch Linux, run: + +``` +$ sudo pacman -S screen +``` + +On Debian, Ubuntu, Linux Mint: + +``` +$ sudo apt-get install screen +``` + +On Fedora: + +``` +$ sudo dnf install screen +``` + +On RHEL, CentOS: + +``` +$ sudo yum install screen +``` + +On SUSE/openSUSE: + +``` +$ sudo zypper install screen +``` + +Let us go ahead and see some screen command examples. + +### Screen Command Examples To Manage Multiple Terminal Sessions + +The default prefix shortcut to all commands in Screen is **Ctrl+a**. You need to use this shortcut a lot when using Screen. So, just remember this keyboard shortcut. + +##### Create new Screen session + +Let us create a new Screen session and attach to it. To do so, type the following command in terminal: + +``` +screen +``` + +Now, run any program or process inside this session. The running process or program will keep running even if you’re disconnected from this session. + +##### Detach from Screen sessions + +To detach from inside a screen session, press **Ctrl+a** and **d**. You don’t have to press the both key combinations at the same time. First press **Ctrl+a** and then press **d**. After detaching from a session, you will see an output something like below. + +``` +[detached from 29149.pts-0.sk] +``` + +Here, **29149** is the **screen ID** and **pts-0.sk** is the name of the screen session. You can attach, detach and kill Screen sessions using either screen ID or name of the respective session. + +##### Create a named session + +You can also create a screen session with any custom name of your choice other than the default username like below. + +``` +screen -S ostechnix +``` + +The above command will create a new screen session with name **“xxxxx.ostechnix”** and attach to it immediately. To detach from the current session, press **Ctrl+a** followed by **d**. + +Naming screen sessions can be helpful when you want to find which processes are running on which sessions. For example, when a setup LAMP stack inside a session, you can simply name it like below. + +``` +screen -S lampstack +``` + +##### Create detached sessions + +Sometimes, you might want to create a session, but don’t want to attach it automatically. In such cases, run the following command to create detached session named **“senthil”** : + +``` +screen -S senthil -d -m +``` + +Or, shortly: + +``` +screen -dmS senthil +``` + +The above command will create a session called “senthil”, but won’t attach to it. + +##### List Screen sessions + +To list all running sessions (attached or detached), run: + +``` +screen -ls +``` + +Sample output: + +``` +There are screens on: + 29700.senthil (Detached) + 29415.ostechnix (Detached) + 29149.pts-0.sk (Detached) +3 Sockets in /run/screens/S-sk. +``` + +As you can see, I have three running sessions and all are detached. + +##### Attach to Screen sessions + +If you want to attach to a session at any time, for example **29415.ostechnix** , simply run: + +``` +screen -r 29415.ostechnix +``` + +Or, + +``` +screen -r ostechnix +``` + +Or, just use the screen ID: + +``` +screen -r 29415 +``` + +To verify if we are attached to the aforementioned session, simply list the open sessions and check. + +``` +screen -ls +``` + +Sample output: + +``` +There are screens on: + 29700.senthil (Detached) + 29415.ostechnix (Attached) + 29149.pts-0.sk (Detached) +3 Sockets in /run/screens/S-sk. +``` + +As you see in the above output, we are currently attached to **29415.ostechnix** session. To exit from the current session, press ctrl+a, d. + +##### Create nested sessions + +When we run “screen” command, it will create a single session for us. We can, however, create nested sessions (a session inside a session). + +First, create a new session or attach to an opened session. I am going to create a new session named “nested”. + +``` +screen -S nested +``` + +Now, press **Ctrl+a** and **c** inside the session to create another session. Just repeat this to create any number of nested Screen sessions. Each session will be assigned with a number. The number will start from **0**. + +You can move to the next session by pressing **Ctrl+n** and move to previous by pressing **Ctrl+p**. + +Here is the list of important Keyboard shortcuts to manage nested sessions. + + * **Ctrl+a ”** – List all sessions + * **Ctrl+a 0** – Switch to session number 0 + * **Ctrl+a n** – Switch to next session + * **Ctrl+a p** – Switch to the previous session + * **Ctrl+a S** – Split current region horizontally into two regions + * **Ctrl+a l** – Split current region vertically into two regions + * **Ctrl+a Q** – Close all sessions except the current one + * **Ctrl+a X** – Close the current session + * **Ctrl+a \** – Kill all sessions and terminate Screen + * **Ctrl+a ?** – Show keybindings. To quit this, press ENTER. + + + +##### Lock sessions + +Screen has an option to lock a screen session. To do so, press **Ctrl+a** and **x**. Enter your Linux password to lock the screen. + +``` +Screen used by sk on ubuntuserver. +Password: +``` + +##### Logging sessions + +You might want to log everything when you’re in a Screen session. To do so, just press **Ctrl+a** and **H**. + +Alternatively, you can enable the logging when starting a new session using **-L** parameter. + +``` +screen -L +``` + +From now on, all activities you’ve done inside the session will recorded and stored in a file named **screenlog.x** in your $HOME directory. Here, **x** is a number. + +You can view the contents of the log file using **cat** command or any text viewer applications. + +![][3] + +Log screen sessions + +* * * + +**Suggested read:** + + * [**How To Record Everything You Do In Terminal**][4] + + + +* * * + +##### Kill Screen sessions + +If a session is not required anymore, just kill it. To kill a detached session named “senthil”: + +``` +screen -r senthil -X quit +``` + +Or, + +``` +screen -X -S senthil quit +``` + +Or, + +``` +screen -X -S 29415 quit +``` + +If there are no open sessions, you will see the following output: + +``` +$ screen -ls +No Sockets found in /run/screens/S-sk. +``` + +For more details, refer man pages. + +``` +$ man screen +``` + +There is also a similar command line utility named “Tmux” which does the same job as GNU Screen. To know more about it, refer the following guide. + + * [**Tmux Command Examples To Manage Multiple Terminal Sessions**][5] + + + +**Resource:** + + * [**GNU Screen home page**][6] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ + +作者:[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/2019/06/Screen-Command-Examples-720x340.jpg +[2]: https://www.ostechnix.com/how-to-upgrade-to-ubuntu-18-04-lts-desktop-and-server/ +[3]: https://www.ostechnix.com/wp-content/uploads/2019/06/Log-screen-sessions.png +[4]: https://www.ostechnix.com/record-everything-terminal/ +[5]: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ +[6]: https://www.gnu.org/software/screen/ From 3551fe7002aa06b007dab673c379a382a22c0eb3 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:54:40 +0800 Subject: [PATCH 0843/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=20Welc?= =?UTF-8?q?oming=20Blockchain=203.0=20sources/tech/20190610=20Welcoming=20?= =?UTF-8?q?Blockchain=203.0.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190610 Welcoming Blockchain 3.0.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20190610 Welcoming Blockchain 3.0.md diff --git a/sources/tech/20190610 Welcoming Blockchain 3.0.md b/sources/tech/20190610 Welcoming Blockchain 3.0.md new file mode 100644 index 0000000000..cad1b03708 --- /dev/null +++ b/sources/tech/20190610 Welcoming Blockchain 3.0.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Welcoming Blockchain 3.0) +[#]: via: (https://www.ostechnix.com/welcoming-blockchain-3-0/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Welcoming Blockchain 3.0 +====== + +![Welcoming blockchain 3.0][1] + +Image credit : + +The series of posts [**“Blockchain 2.0”**][2] discussed about the evolution of blockchain technology since the advent of cryptocurrencies since the Bitcoin in 2008. This post will seek to explore the future of blockchains. Lovably called **blockchain 3.0** , this new wave of DLT evolution will answer the issues faced with blockchains currently (each of which will be summarized here). The next version of the tech standard will also bring new applications and use cases. At the end of the post we will also look at a few examples of these principles currently applied. + +Few of the shortcomings of blockchain platforms in existence are listed below with some proposed solutions to those answered afterward. + +### Problem 1: Scalability[1] + +This is seen as the first major hurdle to mainstream adoption. As previously discussed, a lot of limiting factors contribute to the blockchain’s in-capacity to process a lot of transactions at the same time. Existing networks such as [**Ethereum**][3] are capable of measly 10-15 transactions per second (TPS) whereas mainstream networks such as those employed by Visa for instance are capable of more than 2000 TPS. **Scalability** is an issue that plagues all modern database systems. Improved consensus algorithms and better blockchain architecture designs are improving it though as we see here. + +**Solving scalability** + +Implementing leaner and more efficient consensus algorithms have been proposed for solving issues of scalability without disturbing the primary structure of the blockchain. While most cryptocurrencies and blockchain platforms use resource intensive PoW algorithms (For instance, Bitcoin & Ethereum) to generate blocks, newer DPoS and PoET algorithms exist to solve this issue. DPoS and PoET algorithms (there are some more in development) require less resources to maintain the blockchain and have shown to have throughputs ranging up to 1000s of TPS rivalling that of popular non-blockchain systems. + +The second solution to scalability is altering the blockchain structure[1] and functionality altogether. We won’t get into finer details of this, but alternative architectures such as **Directed Acyclic Graph** ( **DAG** ) have been proposed to handle this issue. Essentially, the assumption for this to work is that not all network nodes need to have a copy of the entire blockchain for the blockchain to work or the participants to reap the benefits of a DLT system. The system does not require transactions to be validated by the entirety of the participants and simply requires the transactions to happen in a common frame of reference and be linked to each other. + +The DAG[2] approach is implemented in the Bitcoin system using an implementation called the **Lightning network** and Ethereum implements the same using their **Sharding** [3] protocol. At its heart a DAG implementation is not technically a blockchain. It’s more like a tangled maze, but still retains the peer to peer and distributed database properties of the blockchain. We will explore DAG and Tangle networks in a separate post later. + +### Problem 2: Interoperability[4][5] + +**Interoperability** is called cross-chain interaction is basically different blockchains being able to talk to each other to exchange metrics and information. With so many platforms that is hard to keep a count on at the moment and different companies coming up with proprietary systems for all the myriad of applications, interoperability between platforms is key. For instance, at the moment, someone who owns digital identities on one platform will not be able to exploit features presented by other platforms because the individual blockchains do not understand or know each other. Problems pertaining to lack of credible verifications, token exchange etc. still persist. A global roll out of [**smart contracts**][4] is also not viable without platforms being able to communicate with each other. + +**Solving Interoperability** + +There are protocols and platforms designed just for enabling interoperability at the moment. Such platforms implement atomic swaps protocols and provide open stages for different blockchain systems to communicate and exchange information between them. An example would be **“0x (ZRX)”** which is described later on. + +### Problem 3: Governance[6] + +Not a limitation in its own, **governance** in a public blockchain needs to act as a community moral compass where everyone’s opinion is taken into account on the operation of the blockchain. Combined and seen with scale this presents a problem where in either the protocols change far too frequently or the protocols are changed at the whims of a “central” authority who holds the most tokens. This is not an issue that most public blockchains are working to avoid right now since the scale at their operating in and the nature of their operations don’t require stricter supervision. + +**Solving Governance issues** + +The Tangled framework or the DAG mentioned above would almost eliminate the need and use for global (platform wide) governance laws. Instead a program can automatically oversee the transaction and user type and decide on the laws that need to be implemented. + +### Problem 4: Sustainability + +**Sustainability** builds on the scalability issue again. Current blockchains and cryptocurrencies are notorious for being not sustainable in the long run owing to the significant oversight that is still required and the amount of resources required to keep the systems running. If you’ve read reports of how “mining cryptocurrencies” have not been so profitable lately, this is what it was. The amount of resources required to keep up existing platforms running is simply not practical at a global scale with mainstream use. + +**Solving non-sustainability** + +From a resources or economic point of view the answer to sustainability would be similar to the one for scalability. However, for the system to be implemented on a global scale, laws and regulations need to endorse it. This however depends on the governments of the world. Favourable moves from the American and European governments have however renewed hopes in this aspect. + +### Problem 5: User adoption[7] + +Currently a hindrance to widespread consumer adoption of blockchain based applications is consumer unfamiliarity with the platform and the tech underneath it. The fact that most applications require some sort of a tech and computing background to figure out how they work does not help in this aspect either. The third wave of blockchain developments seek to lessen the gap between consumer knowledge and platform usability. + +**Solving the user adoption issue** + +The internet took a lot of time to be the way it is now. A lot of work has been done on developing a standardized internet technology stack over the years that has allowed the web to function the way it is now. Developers are working on user facing front end distributed applications that should act as a layer on top of existing web 3.0 technology while being supported by blockchains and open protocols underneath. Such [**distributed applications**][5] will make the underlying technology more familiar to users, hence increasing mainstream adoption. + +We’ve discussed about the solutions to the above issues theoretically, and now we proceed to show these being applied in the present scenario. + +**[0x][6]** – is a decentralized token exchange where users from different platforms can exchange tokens without the need of a central authority to vet the same. Their breakthrough comes in how they’ve designed the system to record and vet the blocks only after transactions are settled and not in between (to verify context, blocks preceding the transaction order is also verified normally) as is normally done. This allows for a more liquid faster exchange of digitized assets online. + +**[Cardano][7]** – founded by one of the co-founders of Ethereum, Cardano boasts of being a truly “scientific” platform with multiple reviews and strict protocols for the developed code and algorithms. Everything out of Cardano is assumed to be mathematically as optimized as possible. Their consensus algorithm called **Ouroboros** , is a modified Proof of Stake algorithm. Cardano is developed in [**Haskell**][8] and the smart contract engine uses a derivative of Haskell called **Plutus** for operating. Both are functional programming languages which guarantee secure transactions without compromising efficiency. + +**EOS** – We’ve already described EOS here in [**this post**][9]. + +**[COTI][10]** – a rather obscure architecture, COTI entails no mining, and next to zero power consumption in operating. It also stores assets in offline wallets localized on user’s devices rather than a pure peer to peer network. They also follow a DAG based architecture and claim of processing throughputs of up to 10000 TPS. Their platform allows enterprises to build their own cryptocurrency and digitized currency wallets without exploiting a blockchain. + +**References:** + + * [1] **A. P. Paper, K. Croman, C. Decker, I. Eyal, A. E. Gencer, and A. Juels, “On Scaling Decentralized Blockchains | SpringerLink,” 2018.** + * [2] [**Going Beyond Blockchain with Directed Acyclic Graphs (DAG)**][11] + * [3] [**Ethreum/wiki – On sharding blockchains**][12] + * [4] [**Why is blockchain interoperability important**][13] + * [5] [**The Importance of Blockchain Interoperability**][14] + * [6] **R. Beck, C. Müller-Bloch, and J. L. King, “Governance in the Blockchain Economy: A Framework and Research Agenda,” J. Assoc. Inf. Syst., pp. 1020–1034, 2018.** + * [7] **J. M. Woodside, F. K. A. Jr, W. Giberson, F. K. J. Augustine, and W. Giberson, “Blockchain Technology Adoption Status and Strategies,” J. Int. Technol. Inf. Manag., vol. 26, no. 2, pp. 65–93, 2017.** + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/welcoming-blockchain-3-0/ + +作者:[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/2019/06/blockchain-720x340.jpg +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[4]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[5]: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ +[6]: https://0x.org/ +[7]: https://www.cardano.org/en/home/ +[8]: https://www.ostechnix.com/getting-started-haskell-programming-language/ +[9]: https://www.ostechnix.com/blockchain-2-0-eos-io-is-building-infrastructure-for-developing-dapps/ +[10]: https://coti.io/ +[11]: https://cryptoslate.com/beyond-blockchain-directed-acylic-graphs-dag/ +[12]: https://github.com/ethereum/wiki/wiki/Sharding-FAQ#introduction +[13]: https://www.capgemini.com/2019/02/can-the-interoperability-of-blockchains-change-the-world/ +[14]: https://medium.com/wanchain-foundation/the-importance-of-blockchain-interoperability-b6a0bbd06d11 From bf748b467e0953ca7e506859fd534beea249f52a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:56:27 +0800 Subject: [PATCH 0844/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=20Bloc?= =?UTF-8?q?kchain=202.0=20=E2=80=93=20EOS.IO=20Is=20Building=20Infrastruct?= =?UTF-8?q?ure=20For=20Developing=20DApps=20[Part=2013]=20sources/tech/201?= =?UTF-8?q?90610=20Blockchain=202.0=20-=20EOS.IO=20Is=20Building=20Infrast?= =?UTF-8?q?ructure=20For=20Developing=20DApps=20-Part=2013.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...structure For Developing DApps -Part 13.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20190610 Blockchain 2.0 - EOS.IO Is Building Infrastructure For Developing DApps -Part 13.md diff --git a/sources/tech/20190610 Blockchain 2.0 - EOS.IO Is Building Infrastructure For Developing DApps -Part 13.md b/sources/tech/20190610 Blockchain 2.0 - EOS.IO Is Building Infrastructure For Developing DApps -Part 13.md new file mode 100644 index 0000000000..a44ceeb105 --- /dev/null +++ b/sources/tech/20190610 Blockchain 2.0 - EOS.IO Is Building Infrastructure For Developing DApps -Part 13.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – EOS.IO Is Building Infrastructure For Developing DApps [Part 13]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-eos-io-is-building-infrastructure-for-developing-dapps/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – EOS.IO Is Building Infrastructure For Developing DApps [Part 13] +====== + +![Building infrastructure for Developing DApps][1] + +When a blockchain startup makes over **$4 billion** through an ICO without having a product or service to show for it, that is newsworthy. It becomes clear at this point that people invested these billions on this project because it seemed to promise a lot. This post will seek to demystify this mystical and seemingly powerful platform. + +**EOS.IO** is a [**blockchain**][2] platform that aims to develop standardized infrastructure including an application protocol and operating system for developing DApps ([ **distributed applications**][3]). **Block.one** the lead developer and investor in the project envisions **EOS.IO as the world’s’ first distributed operating system** providing a developing environment for decentralized applications. The system is meant to mirror a real computer by simulating hardware such as its CPUs, GPUs, and even RAM, apart from the obvious storage solutions courtesy of the blockchain database system. + +### Who is block.one? + +Block.one is the company behind EOS.IO. They developed the platform from the ground up based on a white paper published on GitHub. Block.one also spearheaded the yearlong “continuous” ICO that eventually made them a whopping $4 billion. They have one of the best teams of backers and advisors any company in the blockchain space can hope for with partnerships from **Bitmain** , **Louis Bacon** and **Alan Howard** among others. Not to mention **Peter Thiel** being one of the lead investors in the company. The expectations from their purported platform the EOS.IO and their crypto VC fund **EOS.VC** are high indeed. + +### What is EOS.IO? + +It is difficult to arrive at a short description for EOS.IO. The platform aims to position itself as a world wide computer with virtually simulated resources, hence creating a virtual environment for distributed applications to be built and run. The team behind EOS.IO aims achieve the following by directly quoting [**Ethereum**][4] as competition. + + * Increase transaction throughput to millions per second, + + * Reduce transaction costs to insignificant sums or remove them altogether. + + + + +Though EOS.IO is not anywhere near solving any of these problems, the platform has a few capabilities that make it noteworthy as an alternative to Ethereum for DApp enthusiasts and developers. + + 1. **Scalability** : EOS.IO uses a different consensus algorithm for handling blocks called **DPoS**. We’ve described it briefly below. The DPoS system basically allows the system to handle far more requests at better speeds than Ethereum is capable of with its **PoW** algorithm. The claim is that because they’ll be able to handle such massive throughputs they’ll be able to afford transactions at insignificant or even zero charges if need be. + 2. **Governance capabilities** : The consensus algorithm allows EOS.IO to dynamically understand malicious user (or node) behaviour to penalize or deactivate the user. The elected delegate feature of the delegated proof of stake system also ensures faster amendments to the rules that govern the network and its users. + 3. **Parallel processing** : Touted to another major feature. This will basically allow programs on the EOS.IO blockchain to utilize multiple computers or processors or even computing resources such as GPUs to parallelly processes large chunks of data and blocks. This is not yet seen in a roll out ready form. (This however is not a unique feature of EOS.IO. [**Hyperledger Sawtooth**][5] and Burrow for instance support the same at the moment). + 4. **Self-sufficiency** : The system has a built-in grievance system along with well defined incentive and penal systems for providing feedback for acceptable and non-acceptable behaviour. This means that the platform has a governance system without actually having a central governing body. + + + +All or at least most of the selling points of the system is based on the consensus algorithm it follows, DPoS. We explore more about the same below. + +### What is the delegated Proof of Stake (DPoS) consensus algorithm? + +As far as blockchains are concerned consensus algorithms are what gives them the strength and the selling point they need. However, as a general rule of thumb, as the “openness” and immutability of the ledger increases so does the computational power that is required to run it. For instance, if a blockchain intends to be secure against intrusion, be safe and immutable with respect to data, while being accessible to a lot of users, it will use up a lot of computing power in creating and maintaining itself. Think of it as a number lock. A 6-digit pin code is safer than a 3-digit pin code, but the latter will be easier and faster to open, now consider a million of these locks but with limited manpower to open them, and you get the scale at which blockchains operate and how much these consensus algorithms matter. + +In fact, this is a major area where competing platforms differ from each other. Hyperledger Sawtooth uses a proof of elapsed time algorithm (PoET), while ethereum uses a slightly modified proof of work (PoW) algorithm. Each of these have their own pros and cons which we will cover in a detailed post later on. However, for now, to be noted is that EOS.IO uses a delegated proof of stake mechanism for attesting and validating blocks under it. This has the following implications for users. + +Only one node can actively change the status of data written on the blockchain. In the case of a DPoS based system, this validator node is selected as part of a delegation by all the token holders of the blockchain. Every token holder gets to vote and have a say in who should be a validator. The weight the vote carries is usually proportional to the number of tokens the user carries. This is seen as a democratic way to ensure centralized accountability in terms of running the network. Furthermore, the validator is given additional monetary incentives to keep the network running smoothly and without friction. In case a validator or delegate member who is elected appears to be malicious, the system automatically votes out the said node member. + +DPoS system is efficient as it requires fewer computing resources to cast a vote and select a leader to validate. Further, it incentivizes good behaviour and penalizes bad ones leading to self-correction and maintenance of the blockchain. **The average transaction time for PoW vs DPoS is 10 minutes vs 10 seconds**. The downside to this paradigm being centralized operations, weighted voting systems, lack of redundancy, and possible malicious behaviour from the validator. + +To understand the difference between PoW and DPoS, imagine this: Let’s say your network has 100 participants out of which 10 are capable of handling validator duties and you need to choose one to do the same. In PoW, you give each of them a tough problem to solve to know who’s the fastest and smartest. You give the validator position to the winner and reward them for the same. In the DPoS system, the rest of the members vote for the person they think should hold the position. This is a simple matter of choosing based on arithmetic performance data based on the past. The node with the most votes win, and if the winner tries to do something fishy, the same electorate votes him out for the next transaction. + +### So does Ethereum lose out? + +While EOS.IO has miles to go before it even steps into the same ballpark as Ethereum with respect to the market cap and user base, EOS.IO targets specific shortfalls with Ethereum and solves them. We conclude this post by summarising some findings based on a 2017 [**paper**][6] written and published by **Ian Grigg**. + + 1. The consensus algorithm used in the Ethereum (proof of work) platform uses far more computing resources and time to process transactions. This is true even for small block sizes. This limits its scaling potential and throughput. A meagre 15 transactions per second globally is no match for the over 2000 that payments network Visa manages. If the platform is to be adopted on a global scale based on a large scale roll out this is not acceptable. + + 2. The reliance on proprietary languages, tool kits and protocols (including **Solidity** for instance) limits developer capability. Interoperability between platforms is also severely hurt due to this fact. + + 3. This is rather subjective, however, the fact that Ethereum foundation refuses to acknowledge even the need for governance on the platform instead choosing to intervene on an ad-hoc manner when things turn sour on the network is not seen by many industry watchers as a sustainable model to be emulated in the future. + + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-eos-io-is-building-infrastructure-for-developing-dapps/ + +作者:[editor][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/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Developing-DApps-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ +[4]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[5]: https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-sawtooth/ +[6]: http://iang.org/papers/EOS_An_Introduction.pdf From 6c338d8d66bcaa04614f8d2310460ab4636d5b1a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:57:07 +0800 Subject: [PATCH 0845/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=20Expa?= =?UTF-8?q?nd=20And=20Unexpand=20Commands=20Tutorial=20With=20Examples=20s?= =?UTF-8?q?ources/tech/20190610=20Expand=20And=20Unexpand=20Commands=20Tut?= =?UTF-8?q?orial=20With=20Examples.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nexpand Commands Tutorial With Examples.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md diff --git a/sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md b/sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md new file mode 100644 index 0000000000..01def369ed --- /dev/null +++ b/sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md @@ -0,0 +1,157 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Expand And Unexpand Commands Tutorial With Examples) +[#]: via: (https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-examples/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Expand And Unexpand Commands Tutorial With Examples +====== + +![Expand And Unexpand Commands Explained][1] + +This guide explains two Linux commands namely **Expand** and **Unexpand** with practical examples. For those wondering, the Expand and Unexpand commands are used to replace TAB characters in files with SPACE characters and vice versa. There is also a command called “Expand” in MS-DOS, which is used to expand a compressed file. But the Linux Expand command simply converts the tabs to spaces. These two commands are part of **GNU coreutils** and written by **David MacKenzie**. + +For the demonstration purpose, I will be using a text file named “ostechnix.txt” throughout this guide. All commands given below are tested in Arch Linux. + +### Expand command examples + +Like I already mentioned, the Expand command replaces TAB characters in a file with SPACE characters. + +Now, let us convert tabs to spaces in the ostechnix.txt file and write the result to standard output using command: + +``` +$ expand ostechnix.txt +``` + +If you don’t want to display the result in standard output, just upload it to another file like below. + +``` +$ expand ostechnix.txt>output.txt +``` + +We can also convert tabs to spaces, reading from standard input. To do so, just run “expand” command without mentioning the source file name: + +``` +$ expand +``` + +Just type the text and hit ENTER to convert tabs to spaces. Press **CTRL+C** to quit. + +If you do not want to convert tabs after non blanks, use **-i** flag like below. + +``` +$ expand -i ostechnix.txt +``` + +We can also have tabs a certain number of characters apart, not 8 (the default value): + +``` +$ expand -t=5 ostechnix.txt +``` + +You can even mention multiple tab positions with comma separated like below. + +``` +$ expand -t 5,10,15 ostechnix.txt +``` + +Or, + +``` +$ expand -t "5 10 15" ostechnix.txt +``` + +For more details, refer man pages. + +``` +$ man expand +``` + +### Unexpand Command Examples + +As you may have already guessed, the **Unexpand** command will do the opposite of the Expand command. I.e It will convert SPACE charatcers to TAB characters. Let me show you a few examples to learn how to use Unexpand command. + +To convert blanks (spaces, of course) in a file to tabs and write the output to stdout, do: + +``` +$ unexpand ostechnix.txt +``` + +If you want to write the output in a file instead of just displaying it to stdout, use this command: + +``` +$ unexpand ostechnix.txt>output.txt +``` + +Convert blanks to tabs, reading from standard output: + +``` +$ unexpand +``` + +By default, Unexpand command will only convert the initial blanks. If you want to convert all blanks, instead of just initial blanks, use **-a** flag: + +``` +$ unexpand -a ostechnix.txt +``` + +To convert only leading sequences of blanks (Please note that it overrides **-a** ): + +``` +$ unexpand --first-only ostechnix.txt +``` + +Have tabs a certain number of characters apart, not **8** (enables **-a** ): + +``` +$ unexpand -t 5 ostechnix.txt +``` + +Similarly, we can mention multiple tab positions with comma separated like below. + +``` +$ unexpand -t 5,10,15 ostechnix.txt +``` + +Or, + +``` +$ unexpand -t "5 10 15" ostechnix.txt +``` + +For more details, refer man pages. + +``` +$ man unexpand +``` + +* * * + +**Suggested read:** + + * [**The Fold Command Tutorial With Examples For Beginners**][2] + + + +* * * + +When you working on large number of files, the Expand and Unexpand commands could be very helpful to replace unwanted TAB characters with SPACE characters and vice versa. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-examples/ + +作者:[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/2019/05/Expand-And-Unexpand-Commands-720x340.png +[2]: https://www.ostechnix.com/fold-command-tutorial-examples-beginners/ From 340847e5c138c1c4f716a0488a07a4fee89c147b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 10 Jun 2019 16:57:49 +0800 Subject: [PATCH 0846/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=20Sear?= =?UTF-8?q?ch=20Linux=20Applications=20On=20AppImage,=20Flathub=20And=20Sn?= =?UTF-8?q?apcraft=20Platforms=20sources/tech/20190610=20Search=20Linux=20?= =?UTF-8?q?Applications=20On=20AppImage,=20Flathub=20And=20Snapcraft=20Pla?= =?UTF-8?q?tforms.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pImage, Flathub And Snapcraft Platforms.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md diff --git a/sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md b/sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md new file mode 100644 index 0000000000..dd0c986e72 --- /dev/null +++ b/sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Search Linux Applications On AppImage, Flathub And Snapcraft Platforms) +[#]: via: (https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and-snapcraft-platforms/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Search Linux Applications On AppImage, Flathub And Snapcraft Platforms +====== + +![Search Linux Applications On AppImage, Flathub And Snapcraft][1] + +Linux is evolving day by day. In the past, the developers had to build applications separately for different Linux distributions. Since there are several Linux variants exists, building apps for all distributions became tedious task and quite time consuming. Then some developers invented package converters and builders such as [**Checkinstall**][2], [**Debtap**][3] and [**Fpm**][4]. But they didn’t completely solved the problem. All of these tools will simply convert one package format to another. We still need to find and install the required dependencies the app needs to run. + +Well, the time has changed. We have now universal Linux apps. Meaning – we can install these applications on most Linux distributions. Be it Arch Linux, Debian, CentOS, Redhat, Ubuntu or any popular Linux distribution, the Universal apps will work just fine out of the box. These applications are packaged with all necessary libraries and dependencies in a single bundle. All we have to do is to download and run them on any Linux distributions of our choice. The popular universal app formats are **AppImages** , [**Flatpaks**][5] and [**Snaps**][6]. + +The AppImages are created and maintained by **Simon peter**. Many popular applications, like Gimp, Firefox, Krita and a lot more, are available in these formats and available directly on their download pages.Just download them, make it executable and run it in no time. You don’t even root permissions to run AppImages. + +The developer of Flatpak is **Alexander Larsson** (a RedHat employee). The Flatpak apps are hosted in a central repository (store) called **“Flathub”**. If you’re a developer, you are encouraged to build your apps in Flatpak format and distribute them to the users via Flathub. + +The **Snaps** are created mainly for Ubuntu, by **Canonical**. However, the developers of other Linux distributions are started to contribute to Snap packing format. So, Snaps will work on other Linux distributions as well. The Snaps can be downloaded either directly from application’s download page or from **Snapcraft** store. + +Many popular Companies and developers have released their applications in AppImage, Flatpak and Snap formats. If you ever looking for an app, just head over to the respective store and grab the application of your choice and run it regardless of the Linux distribution you use. + +There is also a command line universal app search tool called **“Chob”** is available to easily search Linux Applications on AppImage, Flathub and Snapcraft platforms. This tool will only search for the given application and display official link in your default browser. It won’t install them. This guide will explain how to install Chob and use it to search AppImages, Flatpaks and Snaps on Linux. + +### Search Linux Applications On AppImage, Flathub And Snapcraft Platforms Using Chob + +Download the latest Chob binary file from the [**releases page**][7]. As of writing this guide, the latest version was **0.3.5**. + +``` +$ wget https://github.com/MuhammedKpln/chob/releases/download/0.3.5/chob-linux +``` + +Make it executable: + +``` +$ chmod +x chob-linux +``` + +Finally, search the applications you want. For example, I am going to search applications related to **Vim**. + +``` +$ ./chob-linux vim +``` + +Chob will search for the given application (and related) on AppImage, Flathub and Snapcraft platforms and display the results. + +![][8] + +Search Linux applications Using Chob + +Just choose the application you want by typing the appropriate number to open the official link of the selected app in your default web browser where you can read the details of the app. + +![][9] + +View Linux application’s Details In Browser + +For more details, have a look at the Chob official GitHub page given below. + +**Resource:** + + * [**Chob GitHub Repository**][10] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and-snapcraft-platforms/ + +作者:[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/2019/05/chob-720x340.png +[2]: https://www.ostechnix.com/build-packages-source-using-checkinstall/ +[3]: https://www.ostechnix.com/convert-deb-packages-arch-linux-packages/ +[4]: https://www.ostechnix.com/build-linux-packages-multiple-platforms-easily/ +[5]: https://www.ostechnix.com/flatpak-new-framework-desktop-applications-linux/ +[6]: https://www.ostechnix.com/introduction-ubuntus-snap-packages/ +[7]: https://github.com/MuhammedKpln/chob/releases +[8]: http://www.ostechnix.com/wp-content/uploads/2019/05/Search-Linux-applications-Using-Chob.png +[9]: http://www.ostechnix.com/wp-content/uploads/2019/05/View-Linux-applications-Details.png +[10]: https://github.com/MuhammedKpln/chob From 342e735b767e85fcdd570ef56ada00a60ff46df6 Mon Sep 17 00:00:00 2001 From: LuMing <784315443@qq.com> Date: Mon, 10 Jun 2019 17:00:06 +0800 Subject: [PATCH 0847/1154] translating --- ...ood Open Source Speech Recognition-Speech-to-Text Systems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md b/sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md index c7609f5022..a817b6ff5e 100644 --- a/sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md +++ b/sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (luuming) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7359d4473bd45c3ddc3e83ee865dae41c462830f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 10 Jun 2019 23:39:11 +0800 Subject: [PATCH 0848/1154] Rename sources/tech/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md to sources/news/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md --- ...e and Open Source Trello Alternative OpenProject 9 Released.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md (100%) diff --git a/sources/tech/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md b/sources/news/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md similarity index 100% rename from sources/tech/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md rename to sources/news/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md From d0d2823c1e6c9922948abf3ac07bb4edfad4086f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 10 Jun 2019 23:41:36 +0800 Subject: [PATCH 0849/1154] Rename sources/tech/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md to sources/news/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md --- ...06 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md (100%) diff --git a/sources/tech/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md b/sources/news/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md similarity index 100% rename from sources/tech/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md rename to sources/news/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md From 77c4737bcf3f794e64fa596e4adc53ba5ca9949e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 10 Jun 2019 23:44:12 +0800 Subject: [PATCH 0850/1154] Rename sources/tech/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md to sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md --- ... Python data pipeline, data breach detection, and more news.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md (100%) diff --git a/sources/tech/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md b/sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md similarity index 100% rename from sources/tech/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md rename to sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md From affc1f7016f5b7feb24da036bc951835c64c650f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Jun 2019 00:06:34 +0800 Subject: [PATCH 0851/1154] Rename sources/talk/20190606 Cisco to buy IoT security, management firm Sentryo.md to sources/news/20190606 Cisco to buy IoT security, management firm Sentryo.md --- ...20190606 Cisco to buy IoT security, management firm Sentryo.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{talk => news}/20190606 Cisco to buy IoT security, management firm Sentryo.md (100%) diff --git a/sources/talk/20190606 Cisco to buy IoT security, management firm Sentryo.md b/sources/news/20190606 Cisco to buy IoT security, management firm Sentryo.md similarity index 100% rename from sources/talk/20190606 Cisco to buy IoT security, management firm Sentryo.md rename to sources/news/20190606 Cisco to buy IoT security, management firm Sentryo.md From c9024394aa9863585aed4bf4d05259e06f814d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 11 Jun 2019 08:07:27 +0800 Subject: [PATCH 0852/1154] Translanting --- ...ipt To Securely Create A Bootable USB Device From ISO File.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md b/sources/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md index f716a164a5..1fea02d9b4 100644 --- a/sources/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md +++ b/sources/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md @@ -1,3 +1,4 @@ +Translanting by robsean BootISO – A Simple Bash Script To Securely Create A Bootable USB Device From ISO File ====== Most of us (including me) very often create a bootable USB device from ISO file for OS installation. From cf6030a37fd0cdb5ac37c61610945ed093865084 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 11 Jun 2019 08:55:50 +0800 Subject: [PATCH 0853/1154] translated --- ...ates on Redhat (RHEL) And CentOS System.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) rename {sources => translated}/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md (73%) diff --git a/sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md b/translated/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md similarity index 73% rename from sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md rename to translated/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md index f8f95e863a..2ce58941a6 100644 --- a/sources/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md +++ b/translated/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md @@ -7,29 +7,29 @@ [#]: via: (https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-and-centos-system/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System +在 Redhat(RHEL) 和 CentOS 上检查或列出已安装的安全更新的两种方法 ====== -We had wrote two articles in the past about this topic and each articles were published for different requirements. +我们过去曾写过两篇关于这个主题的文章,每篇文章都是根据不同的要求发表的。 -If you would like to check those articles before getting into this topic. +如果你想在开始之前浏览这些文章。 -Navigate to the following links. +请通过以下链接: - * **[How To Check Available Security Updates On Red Hat (RHEL) And CentOS System?][1]** - * **[Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems?][2]** + * **[如何检查 Red Hat(RHEL)和 CentOS 上的可用安全更新?] [1] ** +  * **[在 Red Hat(RHEL)和 CentOS 上安装安全更新的四种方法?][2] ** -These articles are interlinked one with others so, better to read them before digging into this. +这些文章与其他文章相互关联,因此,在深入研究之前,最好先阅读这些文章。 -In this article, we will show you, how to check installed security updates. +在本文中,我们将向你展示如何检查已安装的安全更新。 -I have add two methods to achieve this and you can choose which one is best and suitable for you. +我会介绍两种方法,你可以选择最适合你的。 -Also, i added a small shell script, that gives you a summary about installed security packages count. +此外,我还添加了一个小的 shell 脚本,它为你提供已安装的安全包计数。 -Run the following command to get a list of the installed security updates on your system. +运行以下命令获取系统上已安装的安全更新的列表。 ``` # yum updateinfo list security installed @@ -46,14 +46,14 @@ RHSA-2017:2299 Moderate/Sec. NetworkManager-adsl-1:1.8.0-9.el7.x86_64 RHSA-2015:2315 Moderate/Sec. NetworkManager-bluetooth-1:1.0.6-27.el7.x86_64 ``` -To count the number of installed security packages, run the following command. +要计算已安装的安全包的数量,请运行以下命令。 ``` # yum updateinfo list security installed | wc -l 1046 ``` -To print only install packages list. +仅打印安装包列表。 ``` # yum updateinfo list security all | grep -w "i" @@ -73,16 +73,16 @@ i RHSA-2016:2581 Low/Sec. NetworkManager-config-server-1:1.4.0-12.el7.x86_ i RHSA-2017:2299 Moderate/Sec. NetworkManager-config-server-1:1.8.0-9.el7.noarch ``` -To count the number of installed security packages, run the following command. +要计算已安装的安全包的数量,请运行以下命令。 ``` # yum updateinfo list security all | grep -w "i" | wc -l 1043 ``` -Alternatively, you can check the list of vulnerabilities had fixed against the given package. +或者,你可以检查指定包修复的漏洞列表。 -In this example, we are going to check the list of vulnerabilities had fixed in the “openssh” package. +在此例中,我们将检查 “openssh” 包中已修复的漏洞列表。 ``` # rpm -q --changelog openssh | grep -i CVE @@ -106,7 +106,7 @@ In this example, we are going to check the list of vulnerabilities had fixed in - use fork+exec instead of system in scp - CVE-2006-0225 (#168167) ``` -Similarly, you can check whether the given vulnerability is fixed or not in the corresponding package by running the following command. +同样,你可以通过运行以下命令来检查相应的包中是否修复了指定的漏洞。 ``` # rpm -q --changelog openssh | grep -i CVE-2016-3115 @@ -114,9 +114,9 @@ Similarly, you can check whether the given vulnerability is fixed or not in the - CVE-2016-3115: missing sanitisation of input for X11 forwarding (#1317819) ``` -### How To Count Installed Security Packages Using Shell Script? +### 如何使用 Shell 脚本计算安装的安全包? -I have added a small shell script, which helps you to count the list of installed security packages. +我添加了一个小的 shell 脚本,它可以帮助你计算已安装的安全包列表。 ``` # vi /opt/scripts/security-check.sh @@ -133,13 +133,13 @@ done | column -t echo "+-------------------------+" ``` -Set an executable permission to `security-check.sh` file. +给 `security-check.sh` 文件执行权限。 ``` $ chmod +x security-check.sh ``` -Finally run the script to achieve this. +最后执行脚本统计。 ``` # sh /opt/scripts/security-check.sh @@ -159,7 +159,7 @@ via: https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-an 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fcc9619bc2891cba2a32f8aaae7489f43de23393 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 11 Jun 2019 09:03:24 +0800 Subject: [PATCH 0854/1154] translating --- .../20190606 Kubernetes basics- Learn how to drive first.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190606 Kubernetes basics- Learn how to drive first.md b/sources/tech/20190606 Kubernetes basics- Learn how to drive first.md index 7cac6a7dd0..6218ecd6f2 100644 --- a/sources/tech/20190606 Kubernetes basics- Learn how to drive first.md +++ b/sources/tech/20190606 Kubernetes basics- Learn how to drive first.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b060fa88e6dc0eb0b82a0f71dd2cc4e578979ec1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 10:07:24 +0800 Subject: [PATCH 0855/1154] PRF:20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md @geekpi --- ...ates on Redhat (RHEL) And CentOS System.md | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/translated/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md b/translated/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md index 2ce58941a6..d6af81acab 100644 --- a/translated/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md +++ b/translated/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md @@ -1,31 +1,25 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System) [#]: via: (https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-and-centos-system/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -在 Redhat(RHEL) 和 CentOS 上检查或列出已安装的安全更新的两种方法 +在 RHEL 和 CentOS 上检查或列出已安装的安全更新的两种方法 ====== -我们过去曾写过两篇关于这个主题的文章,每篇文章都是根据不同的要求发表的。 - -如果你想在开始之前浏览这些文章。 - -请通过以下链接: - - * **[如何检查 Red Hat(RHEL)和 CentOS 上的可用安全更新?] [1] ** -  * **[在 Red Hat(RHEL)和 CentOS 上安装安全更新的四种方法?][2] ** +![](https://img.linux.net.cn/data/attachment/album/201906/11/100735bdnjzkkmjbxbttmm.jpg) +我们过去曾写过两篇关于这个主题的文章,每篇文章都是根据不同的要求发表的。如果你想在开始之前浏览这些文章。请通过以下链接: +* [如何检查 RHEL 和 CentOS 上的可用安全更新?][1] +* [在 RHEL 和 CentOS 上安装安全更新的四种方法?][2] 这些文章与其他文章相互关联,因此,在深入研究之前,最好先阅读这些文章。 -在本文中,我们将向你展示如何检查已安装的安全更新。 - -我会介绍两种方法,你可以选择最适合你的。 +在本文中,我们将向你展示如何检查已安装的安全更新。我会介绍两种方法,你可以选择最适合你的。 此外,我还添加了一个小的 shell 脚本,它为你提供已安装的安全包计数。 @@ -46,14 +40,14 @@ RHSA-2017:2299 Moderate/Sec. NetworkManager-adsl-1:1.8.0-9.el7.x86_64 RHSA-2015:2315 Moderate/Sec. NetworkManager-bluetooth-1:1.0.6-27.el7.x86_64 ``` -要计算已安装的安全包的数量,请运行以下命令。 +要计算已安装的安全包的数量,请运行以下命令: ``` # yum updateinfo list security installed | wc -l 1046 ``` -仅打印安装包列表。 +仅打印安装包列表: ``` # yum updateinfo list security all | grep -w "i" @@ -73,7 +67,7 @@ i RHSA-2016:2581 Low/Sec. NetworkManager-config-server-1:1.4.0-12.el7.x86_ i RHSA-2017:2299 Moderate/Sec. NetworkManager-config-server-1:1.8.0-9.el7.noarch ``` -要计算已安装的安全包的数量,请运行以下命令。 +要计算已安装的安全包的数量,请运行以下命令: ``` # yum updateinfo list security all | grep -w "i" | wc -l @@ -82,7 +76,7 @@ i RHSA-2017:2299 Moderate/Sec. NetworkManager-config-server-1:1.8.0-9.el7.noarc 或者,你可以检查指定包修复的漏洞列表。 -在此例中,我们将检查 “openssh” 包中已修复的漏洞列表。 +在此例中,我们将检查 “openssh” 包中已修复的漏洞列表: ``` # rpm -q --changelog openssh | grep -i CVE @@ -106,7 +100,7 @@ i RHSA-2017:2299 Moderate/Sec. NetworkManager-config-server-1:1.8.0-9.el7.noarc - use fork+exec instead of system in scp - CVE-2006-0225 (#168167) ``` -同样,你可以通过运行以下命令来检查相应的包中是否修复了指定的漏洞。 +同样,你可以通过运行以下命令来检查相应的包中是否修复了指定的漏洞: ``` # rpm -q --changelog openssh | grep -i CVE-2016-3115 @@ -160,11 +154,11 @@ via: https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-an 作者:[Magesh Maruthamuthu][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/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/check-list-view-find-available-security-updates-on-redhat-rhel-centos-system/ +[1]: https://linux.cn/article-10938-1.html [2]: https://www.2daygeek.com/install-security-updates-on-redhat-rhel-centos-system/ From 11135bbd22ba07393a755781dd85ca943bc3f5f7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 10:15:25 +0800 Subject: [PATCH 0856/1154] PUB:20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md @geekpi https://linux.cn/article-10960-1.html --- ...led Security Updates on Redhat (RHEL) And CentOS System.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md (98%) diff --git a/translated/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md b/published/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md similarity index 98% rename from translated/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md rename to published/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md index d6af81acab..97cb82380d 100644 --- a/translated/tech/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md +++ b/published/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10960-1.html) [#]: subject: (Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System) [#]: via: (https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-and-centos-system/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 333f19bde877bf85468aa1711dbab46a59aae1cc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 11:51:00 +0800 Subject: [PATCH 0857/1154] PRF:20190520 When IoT systems fail- The risk of having bad IoT data.md @chen-ni --- ...s fail- The risk of having bad IoT data.md | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/translated/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md b/translated/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md index f8d8670237..2a5f55b41f 100644 --- a/translated/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md +++ b/translated/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (When IoT systems fail: The risk of having bad IoT data) @@ -10,47 +10,45 @@ 当物联网系统出现故障:使用低质量物联网数据的风险 ====== -伴随着物联网设备使用量的增长,这些设备产生的数据可以让消费者节约巨大的开支,也给商家带来新的机遇。但是当故障不可避免地出现的时候,会发生什么呢? +> 伴随着物联网设备使用量的增长,这些设备产生的数据可以让消费者节约巨大的开支,也给商家带来新的机遇。但是当故障不可避免地出现的时候,会发生什么呢? + ![Oonal / Getty Images][1] -你可以去看任何统计数字,很明显物联网正在走进个人生活和私人生活的方方面面。这种增长虽然有不少好处,但是也带来了新的风险。一个很重要的问题是,出现问题的时候谁来负责呢? +不管你看的是什么统计数字,很明显物联网正在走进个人和私人生活的方方面面。这种增长虽然有不少好处,但是也带来了新的风险。一个很重要的问题是,出现问题的时候谁来负责呢? -也许最大的问题出在基于物联网数据进行的个性化营销以及定价策略上。[保险公司长期以来致力于寻找利用物联网数据的最佳方式][2],我去年写过家庭财产保险公司是如何开始利用物联网传感器减少水灾带来的损失的。一些公司正在研究保险公司向消费者竞标的可能性,这种业务基于智能家居数据所揭示的风险的高低。 +也许最大的问题出在基于物联网数据进行的个性化营销以及定价策略上。[保险公司长期以来致力于寻找利用物联网数据的最佳方式][2],我去年写过家庭财产保险公司是如何开始利用物联网传感器减少水灾带来的损失的。一些公司正在研究保险公司竞购消费者的可能性:这种业务基于智能家居数据所揭示的风险的高低。 但是最大的进步出现在汽车保险领域。许多汽车保险公司已经可以让客户在车辆上安装追踪设备,如果数据证明他们的驾驶习惯良好就可以获取保险折扣。 -**[ 延伸阅读:[保险公司终于有了一个利用智能家居物联网的好办法][3] ]** +- 延伸阅读:[保险公司终于有了一个利用智能家居物联网的好办法][3] -### **UBI 车险的崛起** +### UBI 车险的崛起 -UBI(基于使用的保险)车险是一种“按需付费”的业务,可以通过追踪速度、位置,以及其他因素来评估风险并计算车险保费。到2020年,预计有[5000万美国司机][4]会加入到 UBI 车险的项目中。 +UBI(基于使用的保险usage-based insurance)车险是一种“按需付费”的业务,可以通过追踪速度、位置,以及其他因素来评估风险并计算车险保费。到 2020 年,预计有 [5000 万美国司机][4]会加入到 UBI 车险的项目中。 不出所料,保险公司对 UBI 车险青睐有加,因为 UBI 车险可以帮助他们更加精确地计算风险。事实上,[AIG 爱尔兰已经在尝试让国家向 25 岁以下的司机强制推行 UBI 车险][5]。并且,被认定为驾驶习惯良好的司机自然也很乐意节省一笔费用。当然也有反对的声音了,大多数是来自于隐私权倡导者,以及会因此支付更多费用的群体。 -### **出了故障会发生什么?** +### 出了故障会发生什么? -但是还有一个更加令人担忧的潜在问题:当物联网设备提供的数据有错误,或者在传输过程中出了问题会发生什么?因为尽管有自动化程序,错误检查等等,还是不可避免地会偶尔发生一些故障。 +但是还有一个更加令人担忧的潜在问题:当物联网设备提供的数据有错误,或者在传输过程中出了问题会发生什么?因为尽管有自动化程序、错误检查等等,还是不可避免地会偶尔发生一些故障。 -不幸的是,这并不是一个理论上某天会给谨慎的司机不小心多扣几块钱保费的问题。这已经是一个会带来严重后果的现实问题。就像[保险行业仍然没有想清楚谁应该“拥有”面向客户的物联网设备产生的数据][6]一样,我们也不清楚谁将对这些数据所带来的问题负责。 +不幸的是,这并不是一个理论上某天会给细心的司机不小心多扣几块钱保费的问题。这已经是一个会带来严重后果的现实问题。就像[保险行业仍然没有想清楚谁应该“拥有”面向客户的物联网设备产生的数据][6]一样,我们也不清楚谁将对这些数据所带来的问题负责。 -计算机"故障"据说曾导致赫兹的租车被误报为被盗(虽然在这个例子中这并不是一个严格意义上的物联网问题),并且导致无辜的租车人被逮捕并扣留。结果呢?刑事指控,多年的诉讼官司,以及舆论的指责。非常强烈的舆论指责。 +计算机“故障”据说曾导致赫兹的出租车辆被误报为被盗(虽然在这个例子中这并不是一个严格意义上的物联网问题),并且导致无辜的租车人被逮捕并扣留。结果呢?刑事指控,多年的诉讼官司,以及舆论的指责。非常强烈的舆论指责。 我们非常容易想象一些类似的情况,比如说一个物联网传感器出了故障,然后报告说某辆车超速了,然而事实上并没有超速。想想为这件事打官司的麻烦吧,或者想想和你的保险公司如何争执不下。 -(当然,这个问题还有另外一面:消费者可能会想办法篡改他们的物联网设备上的数据,以获得更低的费率或者转移事故责任。我们同样也没有可行的办法来应对 _这个问题_ 。) +(当然,这个问题还有另外一面:消费者可能会想办法篡改他们的物联网设备上的数据,以获得更低的费率或者转移事故责任。我们同样也没有可行的办法来应对*这个问题*。) -### **政府监管是否有必要** +### 政府监管是否有必要 考虑到这些问题的潜在影响,以及所涉及公司对处理这些问题的无动于衷,我们似乎有理由猜想政府干预的必要性。 -这可能是众议员 Bob Latta(俄亥俄州,共和党)[重新引入 SMART IOT(物联网现代应用、研究及趋势的现状)法案][7]背后的一个动机。这项由 Latta 和众议员 Peter Welch(佛蒙特州,民主党)领导的两党合作物联网工作组提出的[法案][8],于去年秋天通过众议院,但被参议院驳回了。商务部需要研究物联网行业的状况,并在两年后向众议院能源与商业部和参议院商务委员会报告。 +这可能是美国众议员 Bob Latta(俄亥俄州,共和党)[重新引入 SMART IOT(物联网现代应用、研究及趋势的现状)法案][7]背后的一个动机。这项由 Latta 和美国众议员 Peter Welch(佛蒙特州,民主党)领导的两党合作物联网工作组提出的[法案][8],于去年秋天通过美国众议院,但被美国参议院驳回了。美国商务部需要研究物联网行业的状况,并在两年后向美国众议院能源与商业部和美国参议院商务委员会报告。 -Latta 在一份声明中表示,“由于预计会有数万亿美元的经济影响,我们需要考虑物联网所带来的的政策,机遇和挑战。SMART IoT 法案会让人们更容易理解政府在物联网政策上的做法、可以改进的地方,以及联邦政策如何影响尖端技术的研究和发明。” - -这项研究受到了欢迎,但该法案甚至可能不会被通过。即便通过了,物联网在两年的等待时间里也可能会翻天覆地,让政府还是无法跟上。 - -加入 Network World 的[Facebook 社区][9] 和 [LinkedIn 社区][10],参与最前沿话题的讨论。 +Latta 在一份声明中表示,“由于预计会有数万亿美元的经济影响,我们需要考虑物联网所带来的的政策,机遇和挑战。SMART IoT 法案会让人们更容易理解美国政府在物联网政策上的做法、可以改进的地方,以及美国联邦政策如何影响尖端技术的研究和发明。” +这项研究受到了欢迎,但该法案甚至可能不会被通过。即便通过了,物联网在两年的等待时间里也可能会翻天覆地,让美国政府还是无法跟上。 -------------------------------------------------------------------------------- @@ -59,7 +57,7 @@ via: https://www.networkworld.com/article/3396230/when-iot-systems-fail-the-risk 作者:[Fredric Paul][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/) 荣誉推出 From eaa4d0a9d66407c1ab7e69fdce5626107aee055a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 11:51:38 +0800 Subject: [PATCH 0858/1154] PUB:20190520 When IoT systems fail- The risk of having bad IoT data.md @chen-ni https://linux.cn/article-10961-1.html --- ... When IoT systems fail- The risk of having bad IoT data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190520 When IoT systems fail- The risk of having bad IoT data.md (98%) diff --git a/translated/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md b/published/20190520 When IoT systems fail- The risk of having bad IoT data.md similarity index 98% rename from translated/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md rename to published/20190520 When IoT systems fail- The risk of having bad IoT data.md index 2a5f55b41f..6d8ee2c96a 100644 --- a/translated/talk/20190520 When IoT systems fail- The risk of having bad IoT data.md +++ b/published/20190520 When IoT systems fail- The risk of having bad IoT data.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10961-1.html) [#]: subject: (When IoT systems fail: The risk of having bad IoT data) [#]: via: (https://www.networkworld.com/article/3396230/when-iot-systems-fail-the-risk-of-having-bad-iot-data.html) [#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) From 2b8e893f9279e28c7330570434dae099daabd337 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 11:57:49 +0800 Subject: [PATCH 0859/1154] APL:20190610 Screen Command Examples To Manage Multiple Terminal Sessions --- ...een Command Examples To Manage Multiple Terminal Sessions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md b/sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md index f55984c31e..96948dd4b2 100644 --- a/sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md +++ b/sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c49e003bfe545725a6cbbd790da11c9d1107aee6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 12:32:05 +0800 Subject: [PATCH 0860/1154] TSL:20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md --- ...es To Manage Multiple Terminal Sessions.md | 298 ------------------ ...es To Manage Multiple Terminal Sessions.md | 284 +++++++++++++++++ 2 files changed, 284 insertions(+), 298 deletions(-) delete mode 100644 sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md create mode 100644 translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md diff --git a/sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md b/sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md deleted file mode 100644 index 96948dd4b2..0000000000 --- a/sources/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md +++ /dev/null @@ -1,298 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Screen Command Examples To Manage Multiple Terminal Sessions) -[#]: via: (https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Screen Command Examples To Manage Multiple Terminal Sessions -====== - -![Screen Command Examples To Manage Multiple Terminal Sessions][1] - -**GNU Screen** is a terminal multiplexer (window manager). As the name says, Screen multiplexes the physical terminal between multiple interactive shells, so we can perform different tasks in each terminal session. All screen sessions run their programs completely independent. So, a program or process running inside a screen session will keep running even if the session is accidentally closed or disconnected. For instance, when [**upgrading Ubuntu**][2] server via SSH, Screen command will keep running the upgrade process just in case your SSH session is terminated for any reason. - -The GNU Screen allows us to easily create multiple screen sessions, switch between different sessions, copy text between sessions, attach or detach from a session at any time and so on. It is one of the important command line tool every Linux admins should learn and use wherever necessary. In this brief guide, we will see the basic usage of Screen command with examples in Linux. - -### Installing GNU Screen - -GNU Screen is available in the default repositories of most Linux operating systems. - -To install GNU Screen on Arch Linux, run: - -``` -$ sudo pacman -S screen -``` - -On Debian, Ubuntu, Linux Mint: - -``` -$ sudo apt-get install screen -``` - -On Fedora: - -``` -$ sudo dnf install screen -``` - -On RHEL, CentOS: - -``` -$ sudo yum install screen -``` - -On SUSE/openSUSE: - -``` -$ sudo zypper install screen -``` - -Let us go ahead and see some screen command examples. - -### Screen Command Examples To Manage Multiple Terminal Sessions - -The default prefix shortcut to all commands in Screen is **Ctrl+a**. You need to use this shortcut a lot when using Screen. So, just remember this keyboard shortcut. - -##### Create new Screen session - -Let us create a new Screen session and attach to it. To do so, type the following command in terminal: - -``` -screen -``` - -Now, run any program or process inside this session. The running process or program will keep running even if you’re disconnected from this session. - -##### Detach from Screen sessions - -To detach from inside a screen session, press **Ctrl+a** and **d**. You don’t have to press the both key combinations at the same time. First press **Ctrl+a** and then press **d**. After detaching from a session, you will see an output something like below. - -``` -[detached from 29149.pts-0.sk] -``` - -Here, **29149** is the **screen ID** and **pts-0.sk** is the name of the screen session. You can attach, detach and kill Screen sessions using either screen ID or name of the respective session. - -##### Create a named session - -You can also create a screen session with any custom name of your choice other than the default username like below. - -``` -screen -S ostechnix -``` - -The above command will create a new screen session with name **“xxxxx.ostechnix”** and attach to it immediately. To detach from the current session, press **Ctrl+a** followed by **d**. - -Naming screen sessions can be helpful when you want to find which processes are running on which sessions. For example, when a setup LAMP stack inside a session, you can simply name it like below. - -``` -screen -S lampstack -``` - -##### Create detached sessions - -Sometimes, you might want to create a session, but don’t want to attach it automatically. In such cases, run the following command to create detached session named **“senthil”** : - -``` -screen -S senthil -d -m -``` - -Or, shortly: - -``` -screen -dmS senthil -``` - -The above command will create a session called “senthil”, but won’t attach to it. - -##### List Screen sessions - -To list all running sessions (attached or detached), run: - -``` -screen -ls -``` - -Sample output: - -``` -There are screens on: - 29700.senthil (Detached) - 29415.ostechnix (Detached) - 29149.pts-0.sk (Detached) -3 Sockets in /run/screens/S-sk. -``` - -As you can see, I have three running sessions and all are detached. - -##### Attach to Screen sessions - -If you want to attach to a session at any time, for example **29415.ostechnix** , simply run: - -``` -screen -r 29415.ostechnix -``` - -Or, - -``` -screen -r ostechnix -``` - -Or, just use the screen ID: - -``` -screen -r 29415 -``` - -To verify if we are attached to the aforementioned session, simply list the open sessions and check. - -``` -screen -ls -``` - -Sample output: - -``` -There are screens on: - 29700.senthil (Detached) - 29415.ostechnix (Attached) - 29149.pts-0.sk (Detached) -3 Sockets in /run/screens/S-sk. -``` - -As you see in the above output, we are currently attached to **29415.ostechnix** session. To exit from the current session, press ctrl+a, d. - -##### Create nested sessions - -When we run “screen” command, it will create a single session for us. We can, however, create nested sessions (a session inside a session). - -First, create a new session or attach to an opened session. I am going to create a new session named “nested”. - -``` -screen -S nested -``` - -Now, press **Ctrl+a** and **c** inside the session to create another session. Just repeat this to create any number of nested Screen sessions. Each session will be assigned with a number. The number will start from **0**. - -You can move to the next session by pressing **Ctrl+n** and move to previous by pressing **Ctrl+p**. - -Here is the list of important Keyboard shortcuts to manage nested sessions. - - * **Ctrl+a ”** – List all sessions - * **Ctrl+a 0** – Switch to session number 0 - * **Ctrl+a n** – Switch to next session - * **Ctrl+a p** – Switch to the previous session - * **Ctrl+a S** – Split current region horizontally into two regions - * **Ctrl+a l** – Split current region vertically into two regions - * **Ctrl+a Q** – Close all sessions except the current one - * **Ctrl+a X** – Close the current session - * **Ctrl+a \** – Kill all sessions and terminate Screen - * **Ctrl+a ?** – Show keybindings. To quit this, press ENTER. - - - -##### Lock sessions - -Screen has an option to lock a screen session. To do so, press **Ctrl+a** and **x**. Enter your Linux password to lock the screen. - -``` -Screen used by sk on ubuntuserver. -Password: -``` - -##### Logging sessions - -You might want to log everything when you’re in a Screen session. To do so, just press **Ctrl+a** and **H**. - -Alternatively, you can enable the logging when starting a new session using **-L** parameter. - -``` -screen -L -``` - -From now on, all activities you’ve done inside the session will recorded and stored in a file named **screenlog.x** in your $HOME directory. Here, **x** is a number. - -You can view the contents of the log file using **cat** command or any text viewer applications. - -![][3] - -Log screen sessions - -* * * - -**Suggested read:** - - * [**How To Record Everything You Do In Terminal**][4] - - - -* * * - -##### Kill Screen sessions - -If a session is not required anymore, just kill it. To kill a detached session named “senthil”: - -``` -screen -r senthil -X quit -``` - -Or, - -``` -screen -X -S senthil quit -``` - -Or, - -``` -screen -X -S 29415 quit -``` - -If there are no open sessions, you will see the following output: - -``` -$ screen -ls -No Sockets found in /run/screens/S-sk. -``` - -For more details, refer man pages. - -``` -$ man screen -``` - -There is also a similar command line utility named “Tmux” which does the same job as GNU Screen. To know more about it, refer the following guide. - - * [**Tmux Command Examples To Manage Multiple Terminal Sessions**][5] - - - -**Resource:** - - * [**GNU Screen home page**][6] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ - -作者:[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/2019/06/Screen-Command-Examples-720x340.jpg -[2]: https://www.ostechnix.com/how-to-upgrade-to-ubuntu-18-04-lts-desktop-and-server/ -[3]: https://www.ostechnix.com/wp-content/uploads/2019/06/Log-screen-sessions.png -[4]: https://www.ostechnix.com/record-everything-terminal/ -[5]: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ -[6]: https://www.gnu.org/software/screen/ diff --git a/translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md b/translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md new file mode 100644 index 0000000000..f0a5cf7e51 --- /dev/null +++ b/translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md @@ -0,0 +1,284 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Screen Command Examples To Manage Multiple Terminal Sessions) +[#]: via: (https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +screen 命令示例:管理多个终端会话 +====== + +![Screen Command Examples To Manage Multiple Terminal Sessions][1] + +GNU Screen 是一个终端多路复用器(窗口管理器)。顾名思义,Screen 在多个交互式 shell 之间复用物理终端,因此我们可以在每个终端会话中执行不同的任务。所有的 Screen 会话都完全独立地运行程序。因此,即使会话意外关闭或断开连接,在屏幕会话内运行的程序或进程也将继续运行。例如,当通过 SSH [升级 Ubuntu][2] 服务器时,`screen` 命令将继续运行升级过程,以防万一 SSH 会话因任何原因而终止。 + +GNU Screen 允许我们轻松创建多个 Screen 会话,在不同会话之间切换,在会话之间复制文本,随时连上或脱离会话等等。它是每个 Linux 管理员应该在必要时学习和使用的重要命令行工具之一。在本简要指南中,我们将看到 `screen` 命令的基本用法以及 Linux 中的示例。 + +### 安装 GNU Screen + +GNU Screen 在大多数 Linux 操作系统的默认存储库中都可用。 + +要在 Arch Linux 上安装 GNU Screen,请运行: + +``` +$ sudo pacman -S screen +``` + +在 Debian、Ubuntu、Linux Mint 上: + +``` +$ sudo apt-get install screen +``` + +在 Fedora 上: + +``` +$ sudo dnf install screen +``` + +在 RHEL、CentOS 上: + +``` +$ sudo yum install screen +``` + +在 SUSE/openSUSE 上: + +``` +$ sudo zypper install screen +``` + +让我们继续看一些 `screen` 命令示例。 + + +### 管理多个终端会话的 Screen 命令示例 + +在 Screen 中所有命令的默认前缀快捷方式是 `Ctrl + a`。 使用 Screen 时,你需要经常使用此快捷方式。所以,要需记住这个键盘快捷键。 + +#### 创建新的 Screen 会话 + +让我们创建一个新的 Screen 会话并连上它。为此,请在终端中键入以下命令: + +``` +screen +``` + +现在,在此会话中运行任何程序或进程。即使你与此会话断开连接,正在运行的进程或程序也将继续运行。 + +#### 从 Screen 会话脱离 + +要从屏幕会话中脱离,请按 `Ctrl + a` 和 `d`。你无需同时按下两个组合键。首先按 `Ctrl + a` 然后按 `d`。从会话中脱离后,你将看到类似下面的输出。 + +``` +[detached from 29149.pts-0.sk] +``` + +这里,`29149` 是 Screen ID,`pts-0.sk` 是屏幕会话的名称。你可以使用 Screen ID 或相应会话的名称来连上、脱离和终止屏幕会话。 + +#### 创建命名会话 + +你还可以用你选择的任何自定义名称创建一个 Screen 会话,而不是默认用户名,如下所示。 + +``` +screen -S ostechnix +``` + +上面的命令将创建一个名为 `xxxxx.ostechnix` 的新 Screen 会话,并立即连上它。要从当前会话中脱离,请按 `Ctrl + a`,然后按 `d`。 + +当你想要查找哪些进程在哪些会话上运行时,命名会话会很有用。例如,当在会话中设置 LAMP 系统时,你可以简单地将其命名为如下所示。 + +``` +screen -S lampstack +``` + +#### 创建脱离的会话 + +有时,你可能想要创建一个会话,但不希望自动连上该会话。在这种情况下,运行以下命令来创建名为`senthil` 的脱离会话: + +``` +screen -S senthil -d -m +``` + +也可以缩短为: + +``` +screen -dmS senthil +``` + +上面的命令将创建一个名为 `senthil` 的会话,但不会连上它。 + +#### 列出屏幕会话 + +要列出所有正在运行的会话(连上的或脱离的),请运行: + +``` +screen -ls +``` + +示例输出: + +``` +There are screens on: + 29700.senthil (Detached) + 29415.ostechnix (Detached) + 29149.pts-0.sk (Detached) +3 Sockets in /run/screens/S-sk. +``` + +如你所见,我有三个正在运行的会话,并且所有会话都已脱离。 + +#### 连上 Screen 会话 + +如果你想连上会话,例如 `29415.ostechnix`,只需运行: + +``` +screen -r 29415.ostechnix +``` + +或 + +``` +screen -r ostechnix +``` + +或使用 Screen ID: + +``` +screen -r 29415 +``` + +要验证我们是否连上到上述会话,只需列出打开的会话并检查。 + +``` +screen -ls +``` + +示例输出: + +``` +There are screens on: + 29700.senthil (Detached) + 29415.ostechnix (Attached) + 29149.pts-0.sk (Detached) +3 Sockets in /run/screens/S-sk. +``` + +如你所见,在上面的输出中,我们目前已连上到 `29415.ostechnix` 会话。要退出当前会话,请按 `ctrl + a d`。 + +#### 创建嵌套会话 + +当我们运行 `screen` 命令时,它将为我们创建一个会话。但是,我们可以创建嵌套会话(会话内的会话)。 + +首先,创建一个新会话或连上已打开的会话。我将创建一个名为 `nested` 的新会话。 + +``` +screen -S nested +``` + +现在,在会话中按 `Ctrl + a` 和 `c` 创建另一个会话。只需重复此操作即可创建任意数量的嵌套 Screen 会话。每个会话都将分配一个号码。号码将从 `0` 开始。 + +你可以按 `Ctrl + n` 移动到下一个会话,然后按 `Ctrl + p` 移动到上一个会话。 + +以下是管理嵌套会话的重要键盘快捷键列表。 + +* `Ctrl + a "` - 列出所有会话 +* `Ctrl + a 0` - 切换到会话号 0 +* `Ctrl + a n` - 切换到下一个会话 +* `Ctrl + a p` - 切换到上一个会话 +* `Ctrl + a S` - 将当前区域水平分割为两个区域 +* `Ctrl + a l` - 将当前区域垂直分割为两个区域 +* `Ctrl + a Q` - 关闭除当前会话之外的所有会话 +* `Ctrl + a X` - 关闭当前会话 +* `Ctrl + a \` - 终止所有会话并终止 Screen +* `Ctrl + a ?` - 显示键绑定。要退出,请按回车 +   +#### 锁定会话 + +Screen 有一个锁定会话的选项。为此,请按 `Ctrl + a` 和 `x`。 输入你的 Linux 密码以锁定。 + +``` +Screen used by sk on ubuntuserver. +Password: +``` + +#### 记录会话 + +你可能希望记录 Screen 会话中的所有内容。为此,只需按 `Ctrl + a` 和 `H` 即可。 + +或者,你也可以使用 `-L` 参数启动新会话来启用日志记录。0 + +``` +screen -L +``` + +从现在开始,你在会话中做的所有活动都将记录并存储在 `$HOME` 目录中名为 `screenlog.x` 的文件中。这里,`x`是一个数字。 + +你可以使用 `cat` 命令或任何文本查看器查看日志文件的内容。 + + +![][3] + +*记录 Screen 会话* + +#### 终止 Screen 会话 + +如果不再需要会话,只需杀死它。 要杀死名为 `senthil` 的脱离会话: + +``` +screen -r senthil -X quit +``` + +或 + +``` +screen -X -S senthil quit +``` + +或 + +``` +screen -X -S 29415 quit +``` + +如果没有打开的会话,你将看到以下输出: + +``` +$ screen -ls +No Sockets found in /run/screens/S-sk. +``` + +更多细节请参照 man 手册页: + +``` +$ man screen +``` + +还有一个名为 Tmux 的类似命令行实用程序,它与 GNU Screen 执行相同的工作。要了解更多信息,请参阅以下指南。 + +* [Tmux 命令示例:管理多个终端会话][5] + +### 资源 + + * [GNU Screen 主页][6] + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/06/Screen-Command-Examples-720x340.jpg +[2]: https://www.ostechnix.com/how-to-upgrade-to-ubuntu-18-04-lts-desktop-and-server/ +[3]: https://www.ostechnix.com/wp-content/uploads/2019/06/Log-screen-sessions.png +[4]: https://www.ostechnix.com/record-everything-terminal/ +[5]: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ +[6]: https://www.gnu.org/software/screen/ From 55efad952a817c80b3e55b6ae9f6ba279931d06e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 12:48:03 +0800 Subject: [PATCH 0861/1154] PRF:20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md @wxy --- ...es To Manage Multiple Terminal Sessions.md | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md b/translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md index f0a5cf7e51..e5b6ca5926 100644 --- a/translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md +++ b/translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Screen Command Examples To Manage Multiple Terminal Sessions) @@ -10,11 +10,11 @@ screen 命令示例:管理多个终端会话 ====== -![Screen Command Examples To Manage Multiple Terminal Sessions][1] +![Screen Command Examples To Manage Multiple Terminal Sessions](https://img.linux.net.cn/data/attachment/album/201906/11/124801th0uy0hti3y211ha.jpg) -GNU Screen 是一个终端多路复用器(窗口管理器)。顾名思义,Screen 在多个交互式 shell 之间复用物理终端,因此我们可以在每个终端会话中执行不同的任务。所有的 Screen 会话都完全独立地运行程序。因此,即使会话意外关闭或断开连接,在屏幕会话内运行的程序或进程也将继续运行。例如,当通过 SSH [升级 Ubuntu][2] 服务器时,`screen` 命令将继续运行升级过程,以防万一 SSH 会话因任何原因而终止。 +GNU Screen 是一个终端多路复用器(窗口管理器)。顾名思义,Screen 可以在多个交互式 shell 之间复用物理终端,因此我们可以在每个终端会话中执行不同的任务。所有的 Screen 会话都完全独立地运行程序。因此,即使会话意外关闭或断开连接,在 Screen 会话内运行的程序或进程也将继续运行。例如,当通过 SSH [升级 Ubuntu][2] 服务器时,`screen` 命令将继续运行升级过程,以防万一 SSH 会话因任何原因而终止。 -GNU Screen 允许我们轻松创建多个 Screen 会话,在不同会话之间切换,在会话之间复制文本,随时连上或脱离会话等等。它是每个 Linux 管理员应该在必要时学习和使用的重要命令行工具之一。在本简要指南中,我们将看到 `screen` 命令的基本用法以及 Linux 中的示例。 +GNU Screen 允许我们轻松创建多个 Screen 会话,在不同会话之间切换,在会话之间复制文本,随时连上或脱离会话等等。它是每个 Linux 管理员应该在必要时学习和使用的重要命令行工具之一。在本简要指南中,我们将看到 `screen` 命令的基本用法以及在 Linux 中的示例。 ### 安装 GNU Screen @@ -52,10 +52,9 @@ $ sudo zypper install screen 让我们继续看一些 `screen` 命令示例。 - ### 管理多个终端会话的 Screen 命令示例 -在 Screen 中所有命令的默认前缀快捷方式是 `Ctrl + a`。 使用 Screen 时,你需要经常使用此快捷方式。所以,要需记住这个键盘快捷键。 +在 Screen 中所有命令的默认前缀快捷方式是 `Ctrl + a`。使用 Screen 时,你需要经常使用此快捷方式。所以,要记住这个键盘快捷键。 #### 创建新的 Screen 会话 @@ -65,7 +64,7 @@ $ sudo zypper install screen screen ``` -现在,在此会话中运行任何程序或进程。即使你与此会话断开连接,正在运行的进程或程序也将继续运行。 +现在,在此会话中运行任何程序或进程,即使你与此会话断开连接,正在运行的进程或程序也将继续运行。 #### 从 Screen 会话脱离 @@ -75,7 +74,7 @@ screen [detached from 29149.pts-0.sk] ``` -这里,`29149` 是 Screen ID,`pts-0.sk` 是屏幕会话的名称。你可以使用 Screen ID 或相应会话的名称来连上、脱离和终止屏幕会话。 +这里,`29149` 是 Screen ID,`pts-0.sk` 是屏幕会话的名称。你可以使用 Screen ID 或相应的会话名称来连上、脱离和终止屏幕会话。 #### 创建命名会话 @@ -95,7 +94,7 @@ screen -S lampstack #### 创建脱离的会话 -有时,你可能想要创建一个会话,但不希望自动连上该会话。在这种情况下,运行以下命令来创建名为`senthil` 的脱离会话: +有时,你可能想要创建一个会话,但不希望自动连上该会话。在这种情况下,运行以下命令来创建名为`senthil` 的已脱离会话: ``` screen -S senthil -d -m @@ -137,7 +136,7 @@ There are screens on: screen -r 29415.ostechnix ``` -或 +或: ``` screen -r ostechnix @@ -171,7 +170,7 @@ There are screens on: 当我们运行 `screen` 命令时,它将为我们创建一个会话。但是,我们可以创建嵌套会话(会话内的会话)。 -首先,创建一个新会话或连上已打开的会话。我将创建一个名为 `nested` 的新会话。 +首先,创建一个新会话或连上已打开的会话。然后我将创建一个名为 `nested` 的新会话。 ``` screen -S nested @@ -207,36 +206,35 @@ Password: 你可能希望记录 Screen 会话中的所有内容。为此,只需按 `Ctrl + a` 和 `H` 即可。 -或者,你也可以使用 `-L` 参数启动新会话来启用日志记录。0 +或者,你也可以使用 `-L` 参数启动新会话来启用日志记录。 ``` screen -L ``` -从现在开始,你在会话中做的所有活动都将记录并存储在 `$HOME` 目录中名为 `screenlog.x` 的文件中。这里,`x`是一个数字。 +从现在开始,你在会话中做的所有活动都将记录并存储在 `$HOME` 目录中名为 `screenlog.x` 的文件中。这里,`x` 是一个数字。 你可以使用 `cat` 命令或任何文本查看器查看日志文件的内容。 - ![][3] *记录 Screen 会话* #### 终止 Screen 会话 -如果不再需要会话,只需杀死它。 要杀死名为 `senthil` 的脱离会话: +如果不再需要会话,只需杀死它。要杀死名为 `senthil` 的脱离会话: ``` screen -r senthil -X quit ``` -或 +或: ``` screen -X -S senthil quit ``` -或 +或: ``` screen -X -S 29415 quit @@ -255,7 +253,7 @@ No Sockets found in /run/screens/S-sk. $ man screen ``` -还有一个名为 Tmux 的类似命令行实用程序,它与 GNU Screen 执行相同的工作。要了解更多信息,请参阅以下指南。 +还有一个名为 Tmux 的类似的命令行实用程序,它与 GNU Screen 执行相同的工作。要了解更多信息,请参阅以下指南。 * [Tmux 命令示例:管理多个终端会话][5] @@ -270,7 +268,7 @@ via: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-termin 作者:[sk][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a5159a19d7ebd53bf65eeede8b7e5b4b91cc5f7e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 12:48:55 +0800 Subject: [PATCH 0862/1154] PUB:20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md @wxy https://linux.cn/article-10962-1.html --- ...n Command Examples To Manage Multiple Terminal Sessions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md (99%) diff --git a/translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md b/published/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md similarity index 99% rename from translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md rename to published/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md index e5b6ca5926..936974a5d2 100644 --- a/translated/tech/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md +++ b/published/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10962-1.html) [#]: subject: (Screen Command Examples To Manage Multiple Terminal Sessions) [#]: via: (https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 15818281f5e634cc8b940f68ef1d794d2ea98383 Mon Sep 17 00:00:00 2001 From: GraveAccent Date: Tue, 11 Jun 2019 16:08:23 +0800 Subject: [PATCH 0863/1154] translated talk/20190604 5G will ... --- sources/talk/20190604 5G will augment Wi-Fi, not replace it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190604 5G will augment Wi-Fi, not replace it.md b/sources/talk/20190604 5G will augment Wi-Fi, not replace it.md index d8d007e275..76346907f3 100644 --- a/sources/talk/20190604 5G will augment Wi-Fi, not replace it.md +++ b/sources/talk/20190604 5G will augment Wi-Fi, not replace it.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (GraveAccent) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3c9fce50edf4c006de984817c8501d436259b33f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 17:53:41 +0800 Subject: [PATCH 0864/1154] PRF:20170410 Writing a Time Series Database from Scratch.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PART 5 @LuuMing 太辛苦了,这篇这么长,这么专业都翻译的这么好。我连校对都分了五次才逐步校对完,这还是逼着自己完成的。 --- ...ing a Time Series Database from Scratch.md | 102 ++++++++++-------- 1 file changed, 60 insertions(+), 42 deletions(-) diff --git a/translated/tech/20170410 Writing a Time Series Database from Scratch.md b/translated/tech/20170410 Writing a Time Series Database from Scratch.md index 58ae92d7ff..60d302b2de 100644 --- a/translated/tech/20170410 Writing a Time Series Database from Scratch.md +++ b/translated/tech/20170410 Writing a Time Series Database from Scratch.md @@ -354,76 +354,95 @@ __name__="requests_total" -> [ 9999, 1000, 1001, 2000000, 2000001, 2000002, ### 基准测试 -我发起了一个最初版本的基准测试,它基于现实世界数据集中提取的大约 440 万个序列描述符,并生成合成数据点对应到这些序列中。这个方法仅仅测试单独的存储系统,快速的找到高并发负载场景下的运行瓶颈和触发死锁至关重要。 +我从存储的基准测试开始了初步的开发,它基于现实世界数据集中提取的大约 440 万个序列描述符,并生成合成数据点以输入到这些序列中。这个阶段的开发仅仅测试了单独的存储系统,对于快速找到性能瓶颈和高并发负载场景下的触发死锁至关重要。 -在概念性的运用完成之后,基准测试能够在我的 Macbook Pro 上维持每秒 2000 万的吞吐量—并且所有 Chrome 的页面和 Slack 都保持着运行。因此,尽管这听起来都很棒,它这也表明推动这项测试没有的进一步价值。(或者是没有在高随机环境下运行)。毕竟,它是合成的数据,因此在除了好的第一印象外没有多大价值。比起最初的设计目标高出 20 倍,是时候将它部署到真正的 Prometheus 服务器上了,为它添加更多现实环境中的开销和场景。 +在完成概念性的开发实施之后,该基准测试能够在我的 Macbook Pro 上维持每秒 2000 万的吞吐量 —— 并且这都是在打开着十几个 Chrome 的页面和 Slack 的时候。因此,尽管这听起来都很棒,它这也表明推动这项测试没有的进一步价值(或者是没有在高随机环境下运行)。毕竟,它是合成的数据,因此在除了良好的第一印象外没有多大价值。比起最初的设计目标高出 20 倍,是时候将它部署到真正的 Prometheus 服务器上了,为它添加更多现实环境中的开销和场景。 -我们实际上没有可重复的 Prometheus 基准测试配置,特别是对于不同版本的 A/B 测试。亡羊补牢为时不晚,[现在就有一个了][11]! +我们实际上没有可重现的 Prometheus 基准测试配置,特别是没有对于不同版本的 A/B 测试。亡羊补牢为时不晚,[不过现在就有一个了][11]! -工具可以让我们声明性地定义基准测试场景,然后部署到 AWS 的 Kubernetes 集群上。尽管对于全面的基准测试来说不是最好环境,但它肯定比 64 核 128GB 内存的专用裸机服务器bare metal servers更能反映出用户基础。我们部署两个 Prometheus 1.5.2 服务器(V2 存储系统)和两个从 2.0 分支继续开发的 Prometheus (V3 存储系统) 。每个 Prometheus 运行在配备 SSD 的专用服务器上。我们将横向扩展的应用部署在了工作节点上,并且让其暴露典型的微服务量。此外,Kubernetes 集群本身和节点也被监控着。整个配置由另一个 Meta-Prometheus 所监督,它监控每个 Prometheus 的健康状况和性能。为了模拟序列分流,微服务定期的扩展和收缩来移除旧的 pods 并衍生新的 pods,生成新的序列。查询负载通过典型的查询选择来模拟,对每个 Prometheus 版本都执行一次。 +我们的工具可以让我们声明性地定义基准测试场景,然后部署到 AWS 的 Kubernetes 集群上。尽管对于全面的基准测试来说不是最好环境,但它肯定比 64 核 128GB 内存的专用裸机服务器bare metal servers更能反映出我们的用户群体。 -总体上,伸缩与查询的负载和采样频率一样极大的超出了 Prometheus 的生产部署。例如,我们每隔 15 分钟换出 60% 的微服务实例去产生序列分流。在现代的基础设施上,一天仅大约会发生 1-5 次。这就保证了我们的 V3 设计足以处理未来几年的工作量。就结果而言,Prometheus 1.5.2 和 2.0 之间的性能差异在不温和的环境下会变得更大。 -总而言之,我们每秒从 850 个暴露 50 万数据的目标里收集了大约 11 万份样本。 +我们部署了两个 Prometheus 1.5.2 服务器(V2 存储系统)和两个来自 2.0 开发分支的 Prometheus (V3 存储系统)。每个 Prometheus 运行在配备 SSD 的专用服务器上。我们将横向扩展的应用部署在了工作节点上,并且让其暴露典型的微服务度量。此外,Kubernetes 集群本身和节点也被监控着。整套系统由另一个 Meta-Prometheus 所监督,它监控每个 Prometheus 的健康状况和性能。 -在此配置运行一段时间之后,我们可以看一下数字。我们评估了两个版本在 12 个小时之后到达稳定时的几个指标。 +为了模拟序列分流,微服务定期的扩展和收缩来移除旧的 pod 并衍生新的 pod,生成新的序列。通过选择“典型”的查询来模拟查询负载,对每个 Prometheus 版本都执行一次。 + +总体上,伸缩与查询的负载以及采样频率极大的超出了 Prometheus 的生产部署。例如,我们每隔 15 分钟换出 60% 的微服务实例去产生序列分流。在现代的基础设施上,一天仅大约会发生 1-5 次。这就保证了我们的 V3 设计足以处理未来几年的工作负载。就结果而言,Prometheus 1.5.2 和 2.0 之间的性能差异在极端的环境下会变得更大。 + +总而言之,我们每秒从 850 个目标里收集大约 11 万份样本,每次暴露 50 万个序列。 + +在此系统运行一段时间之后,我们可以看一下数字。我们评估了两个版本在 12 个小时之后到达稳定时的几个指标。 > 请注意从 Prometheus 图形界面的截图中轻微截断的 Y 轴 - ![Heap usage GB](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/heap_usage.png) -> 堆内存使用(GB) +![Heap usage GB](https://fabxc.org/tsdb/assets/heap_usage.png) -内存资源使用对用户来说是最为困扰的问题,因为它相对的不可预测且能够导致进程崩溃。 -显然,被查询的服务器正在消耗内存,这极大程度上归咎于查询引擎的开销,这一点可以当作以后优化的主题。总的来说,Prometheus 2.0 的内存消耗减少了 3-4 倍。大约 6 小时之后,在 Prometheus 1.5 上有一个明显的峰值,与我们设置 6 小时的保留边界相对应。因为删除操作成本非常高,所以资源消耗急剧提升。这一点在下面几张图中均有体现。 +*堆内存使用(GB)* - ![CPU usage cores](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/cpu_usage.png) -> CPU 使用(核心/秒) +内存资源的使用对用户来说是最为困扰的问题,因为它相对的不可预测且可能导致进程崩溃。 -类似的模式展示 CPU 使用,但是查询的服务器与非查询的服务器之间的差异尤为明显。每秒获取大约 11 万个数据需要 0.5 核心/秒的 CPU 资源,比起评估查询所花费的时间,我们新的存储系统 CPU 消耗可忽略不计。 +显然,查询的服务器正在消耗内存,这很大程度上归咎于查询引擎的开销,这一点可以当作以后优化的主题。总的来说,Prometheus 2.0 的内存消耗减少了 3-4 倍。大约 6 小时之后,在 Prometheus 1.5 上有一个明显的峰值,与我们设置的 6 小时的保留边界相对应。因为删除操作成本非常高,所以资源消耗急剧提升。这一点在下面几张图中均有体现。 - ![Disk writes](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/disk_writes.png) -> 磁盘写入(MB/秒) +![CPU usage cores](https://fabxc.org/tsdb/assets/cpu_usage.png) -图片展示出的磁盘利用率取得了令人意想不到的提升。这就清楚的展示了为什么 Prometheus 1.5 很容易造成 SSD 损耗。我们看到最初的上升发生在第一个块被持久化到序列文件中的时期,然后一旦删除操作引发了重写就会带来第二个上升。令人惊讶的是,查询的服务器与非查询的服务器显示出了非常不同的利用率。 -Prometheus 2.0 on the other hand, merely writes about a single Megabyte per second to its write ahead log. Writes periodically spike when blocks are compacted to disk. Overall savings: staggering 97-99%.Prometheus 2.0 在另一方面,每秒仅仅写入大约一兆字节的日志文件。当块压缩到磁盘之时,写入定期地出现峰值。这在总体上节省了:惊人的 97-99%。 +*CPU 使用(核心/秒)* - ![Disk usage](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/disk_usage.png) -> 磁盘大小(GB) +类似的模式也体现在 CPU 使用上,但是查询的服务器与非查询的服务器之间的差异尤为明显。每秒获取大约 11 万个数据需要 0.5 核心/秒的 CPU 资源,比起评估查询所花费的 CPU 时间,我们的新存储系统 CPU 消耗可忽略不计。总的来说,新存储需要的 CPU 资源减少了 3 到 10 倍。 -与磁盘写入密切相关的是总磁盘空间占用量。由于我们对样本几乎使用了相同的压缩算法,因此磁盘占用量应当相同。在更为稳定的配置中,这样做很大程度上是正确地,但是因为我们需要处理高序列分流,所以还要考虑每个序列的开销。 -如我们所见,Prometheus 1.5 在两个版本达到稳定状态之前,使用的存储空间因保留操作而急速上升。Prometheus 2.0 似乎在每个序列上具有更少的消耗。我们可以清楚的看到写入日志线性地充满整个存储空间,然后当压缩完成后立刻掉下来。事实上对于两个 Prometheus 2.0 服务器,它们的曲线并不是完全匹配的,这一点需要进一步的调查。 +![Disk writes](https://fabxc.org/tsdb/assets/disk_writes.png) + +*磁盘写入(MB/秒)* + +迄今为止最引人注目和意想不到的改进表现在我们的磁盘写入利用率上。这就清楚的说明了为什么 Prometheus 1.5 很容易造成 SSD 损耗。我们看到最初的上升发生在第一个块被持久化到序列文件中的时期,然后一旦删除操作引发了重写就会带来第二个上升。令人惊讶的是,查询的服务器与非查询的服务器显示出了非常不同的利用率。 + +在另一方面,Prometheus 2.0 每秒仅向其预写日志写入大约一兆字节。当块被压缩到磁盘时,写入定期地出现峰值。这在总体上节省了:惊人的 97-99%。 + +![Disk usage](https://fabxc.org/tsdb/assets/disk_usage.png) + +*磁盘大小(GB)* + +与磁盘写入密切相关的是总磁盘空间占用量。由于我们对样本(这是我们的大部分数据)几乎使用了相同的压缩算法,因此磁盘占用量应当相同。在更为稳定的系统中,这样做很大程度上是正确地,但是因为我们需要处理高的序列分流,所以还要考虑每个序列的开销。 + +如我们所见,Prometheus 1.5 在这两个版本达到稳定状态之前,使用的存储空间因其保留操作而急速上升。Prometheus 2.0 似乎在每个序列上的开销显著降低。我们可以清楚的看到预写日志线性地充满整个存储空间,然后当压缩完成后瞬间下降。事实上对于两个 Prometheus 2.0 服务器,它们的曲线并不是完全匹配的,这一点需要进一步的调查。 前景大好。剩下最重要的部分是查询延迟。新的索引应当优化了查找的复杂度。没有实质上发生改变的是处理数据的过程,例如 `rate()` 函数或聚合。这些就是查询引擎要做的东西了。 - ![Query latency](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/query_latency.png) -> 第 99 个百分位查询延迟(秒) +![Query latency](https://fabxc.org/tsdb/assets/query_latency.png) -数据完全符合预期。在 Prometheus 1.5 上,查询延迟随着存储的数据而增加。只有在保留操作开始且旧的序列被删除后才会趋于稳定。作为对比,Prometheus 从一开始就保持在合适的位置。 -我们需要花一些心思在数据是如何被采集上,对服务器发出的查询请求通过估计以下方面被选中:查询范围和即时查询的组合,进行或轻或重的计算,访问或多或少的文件。它并不需要代表真实世界里查询的分布。也不能代表冷数据的查询性能,我们可以假设所有的样本数据都是保存在内存中的热数据。 -尽管如此,我们可以相当自信地说,整体查询效果对序列分流变得非常有弹性,并且提升了高压基准测试场景下 4 倍的性能。在更为静态的环境下,我们可以假设查询时间大多数花费在了查询引擎上,改善程度明显较低。 +*第 99 个百分位查询延迟(秒)* - ![Ingestion rate](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/ingestion_rate.png) -> 摄入的样本/秒 +数据完全符合预期。在 Prometheus 1.5 上,查询延迟随着存储的序列而增加。只有在保留操作开始且旧的序列被删除后才会趋于稳定。作为对比,Prometheus 2.0 从一开始就保持在合适的位置。 -最后,快速地看一下不同 Prometheus 服务器的摄入率。我们可以看到搭载 V3 存储系统的两个服务器具有相同的摄入速率。在几个小时之后变得不稳定,这是因为不同的基准测试集群节点由于高负载变得无响应,与 Prometheus 实例无关。(两点之前的曲线完全匹配这一事实希望足够具有说服力) -尽管还有更多 CPU 和内存资源,两个 Prometheus 1.5.2 服务器的摄入率大大降低。序列分流高压导致了无法采集更多的数据。 +我们需要花一些心思在数据是如何被采集上,对服务器发出的查询请求通过对以下方面的估计来选择:范围查询和即时查询的组合,进行更轻或更重的计算,访问更多或更少的文件。它并不需要代表真实世界里查询的分布。也不能代表冷数据的查询性能,我们可以假设所有的样本数据都是保存在内存中的热数据。 + +尽管如此,我们可以相当自信地说,整体查询效果对序列分流变得非常有弹性,并且在高压基准测试场景下提升了 4 倍的性能。在更为静态的环境下,我们可以假设查询时间大多数花费在了查询引擎上,改善程度明显较低。 + +![Ingestion rate](https://fabxc.org/tsdb/assets/ingestion_rate.png) + +*摄入的样本/秒* + +最后,快速地看一下不同 Prometheus 服务器的摄入率。我们可以看到搭载 V3 存储系统的两个服务器具有相同的摄入速率。在几个小时之后变得不稳定,这是因为不同的基准测试集群节点由于高负载变得无响应,与 Prometheus 实例无关。(两个 2.0 的曲线完全匹配这一事实希望足够具有说服力) + +尽管还有更多 CPU 和内存资源,两个 Prometheus 1.5.2 服务器的摄入率大大降低。序列分流的高压导致了无法采集更多的数据。 那么现在每秒可以摄入的绝对最大absolute maximum样本数是多少? -我不知道——而且故意忽略。 +但是现在你可以摄取的每秒绝对最大样本数是多少? -存在的很多因素都会影响 Prometheus 数据流量,而且没有一个单独的数字能够描述捕获质量。最大摄入率在历史上是一个导致基准出现偏差的度量量,并且忽视了更多重要的层面,例如查询性能和对序列分流的弹性。关于资源使用线性增长的大致猜想通过一些基本的测试被证实。很容易推断出其中的原因。 +我不知道 —— 虽然这是一个相当容易的优化指标,但除了稳固的基线性能之外,它并不是特别有意义。 -我们的基准测试模拟了高动态环境下 Prometheus 的压力,它比起真实世界中的更大。结果表明,虽然运行在没有优化的云服务器上,但是已经超出了预期的效果。 +有很多因素都会影响 Prometheus 数据流量,而且没有一个单独的数字能够描述捕获质量。最大摄入率在历史上是一个导致基准出现偏差的度量,并且忽视了更多重要的层面,例如查询性能和对序列分流的弹性。关于资源使用线性增长的大致猜想通过一些基本的测试被证实。很容易推断出其中的原因。 -> 注意:在撰写本文的同时,Prometheus 1.6 正在开发当中,它允许更可靠地配置最大内存使用量,并且可能会显著地减少整体的消耗,提高 CPU 使用率。我没有重复进行测试,因为整体结果变化不大,尤其是面对高序列分流的情况。 +我们的基准测试模拟了高动态环境下 Prometheus 的压力,它比起真实世界中的更大。结果表明,虽然运行在没有优化的云服务器上,但是已经超出了预期的效果。最终,成功将取决于用户反馈而不是基准数字。 + +> 注意:在撰写本文的同时,Prometheus 1.6 正在开发当中,它允许更可靠地配置最大内存使用量,并且可能会显著地减少整体的消耗,有利于稍微提高 CPU 使用率。我没有重复对此进行测试,因为整体结果变化不大,尤其是面对高序列分流的情况。 ### 总结 -Prometheus 开始应对高基数序列与单独样本的吞吐量。这仍然是一项富有挑战性的任务,但是新的存储系统似乎向我们展示了未来的一些好东西:超大规模hyper-scale高收敛度hyper-convergent,GIFEE 基础设施。好吧,它似乎运行的不错。 +Prometheus 开始应对高基数序列与单独样本的吞吐量。这仍然是一项富有挑战性的任务,但是新的存储系统似乎向我们展示了未来的一些好东西。 第一个配备 V3 存储系统的 [alpha 版本 Prometheus 2.0][12] 已经可以用来测试了。在早期阶段预计还会出现崩溃,死锁和其他 bug。 -存储系统的代码可以在[这个单独的项目中找到][13]。Prometheus 对于寻找高效本地存储时间序列数据库的应用来说可能非常有用,之一点令人非常惊讶。 +存储系统的代码可以在[这个单独的项目中找到][13]。Prometheus 对于寻找高效本地存储时间序列数据库的应用来说可能非常有用,这一点令人非常惊讶。 > 这里需要感谢很多人作出的贡献,以下排名不分先后: @@ -431,16 +450,15 @@ Prometheus 开始应对高基数序列与单独样本的吞吐量。这仍然是 > Wilhelm Bierbaum 对新设计不断的建议与见解作出了很大的贡献。Brian Brazil 不断的反馈确保了我们最终得到的是语义上合理的方法。与 Peter Bourgon 深刻的讨论验证了设计并形成了这篇文章。 -> 别忘了我们整个 CoreOS 团队与公司对于这项工作的赞助与支持。感谢所有那些听我一遍遍唠叨 SSD,浮点数,序列化格式的同学。 - +> 别忘了我们整个 CoreOS 团队与公司对于这项工作的赞助与支持。感谢所有那些听我一遍遍唠叨 SSD、浮点数、序列化格式的同学。 -------------------------------------------------------------------------------- via: https://fabxc.org/blog/2017-04-10-writing-a-tsdb/ -作者:[Fabian Reinartz ][a] -译者:[译者ID](https://github.com/LuuMing) -校对:[校对者ID](https://github.com/校对者ID) +作者:[Fabian Reinartz][a] +译者:[LuuMing](https://github.com/LuuMing) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ceb182ec1e193a11e8b5c5d2f817efc885617683 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 18:36:08 +0800 Subject: [PATCH 0865/1154] PRF:20170410 Writing a Time Series Database from Scratch.md --- ...ing a Time Series Database from Scratch.md | 152 +++++++++--------- 1 file changed, 79 insertions(+), 73 deletions(-) diff --git a/translated/tech/20170410 Writing a Time Series Database from Scratch.md b/translated/tech/20170410 Writing a Time Series Database from Scratch.md index 60d302b2de..9093e4dc2a 100644 --- a/translated/tech/20170410 Writing a Time Series Database from Scratch.md +++ b/translated/tech/20170410 Writing a Time Series Database from Scratch.md @@ -1,6 +1,12 @@ 从零写一个时间序列数据库 ================== +编者按:Prometheus 是 CNCF 旗下的开源监控告警解决方案,它已经成为 Kubernetes 生态圈中的核心监控系统。本文作者 Fabian Reinartz 是 Prometheus 的核心开发者,这篇文章是其于 2017 年写的一篇关于 Prometheus 中的时间序列数据库的设计思考,虽然写作时间有点久了,但是其中的考虑和思路非常值得参考。长文预警,请坐下来慢慢品味。 + +--- + +![](https://img.linux.net.cn/data/attachment/album/201906/11/180646l7cqbhazqs7nsqsn.jpg) + 我从事监控工作。特别是在 [Prometheus][2] 上,监控系统包含一个自定义的时间序列数据库,并且集成在 [Kubernetes][3] 上。 在许多方面上 Kubernetes 展现出了 Prometheus 所有的设计用途。它使得持续部署continuous deployments弹性伸缩auto scaling和其他高动态环境highly dynamic environments下的功能可以轻易地访问。查询语句和操作模型以及其它概念决策使得 Prometheus 特别适合这种环境。但是,如果监控的工作负载动态程度显著地增加,这就会给监控系统本身带来新的压力。考虑到这一点,我们就可以特别致力于在高动态或瞬态服务transient services环境下提升它的表现,而不是回过头来解决 Prometheus 已经解决的很好的问题。 @@ -52,16 +58,16 @@ requests_total{path="/", method="GET", instance=”10.0.0.2:80”} ``` series ^ - │ . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="GET"} - │ . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="POST"} - │ . . . . . . . - │ . . . . . . . . . . . . . . . . . . . ... - │ . . . . . . . . . . . . . . . . . . . . . - │ . . . . . . . . . . . . . . . . . . . . . {__name__="errors_total", method="POST"} - │ . . . . . . . . . . . . . . . . . {__name__="errors_total", method="GET"} - │ . . . . . . . . . . . . . . - │ . . . . . . . . . . . . . . . . . . . ... - │ . . . . . . . . . . . . . . . . . . . . + | . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="GET"} + | . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="POST"} + | . . . . . . . + | . . . . . . . . . . . . . . . . . . . ... + | . . . . . . . . . . . . . . . . . . . . . + | . . . . . . . . . . . . . . . . . . . . . {__name__="errors_total", method="POST"} + | . . . . . . . . . . . . . . . . . {__name__="errors_total", method="GET"} + | . . . . . . . . . . . . . . + | . . . . . . . . . . . . . . . . . . . ... + | . . . . . . . . . . . . . . . . . . . . v <-------------------- time ---------------------> ``` @@ -93,13 +99,13 @@ Prometheus 通过定期地抓取一组时间序列的当前值来获取数据点 我们创建一个时间序列的文件,它包含所有样本并按顺序存储。因为每几秒附加一个样本数据到所有文件中非常昂贵,我们在内存中打包 1Kib 样本序列的数据块,一旦打包完成就附加这些数据块到单独的文件中。这一方法解决了大部分问题。写入目前是批量的,样本也是按顺序存储的。基于给定的同一序列的样本相对之前的数据仅发生非常小的改变这一特性,它还支持非常高效的压缩格式。Facebook 在他们 Gorilla TSDB 上的论文中描述了一个相似的基于数据块的方法,并且[引入了一种压缩格式][7],它能够减少 16 字节的样本到平均 1.37 字节。V2 存储使用了包含 Gorilla 变体等在内的各种压缩格式。 ``` - ┌──────────┬─────────┬─────────┬─────────┬─────────┐ series A - └──────────┴─────────┴─────────┴─────────┴─────────┘ - ┌──────────┬─────────┬─────────┬─────────┬─────────┐ series B - └──────────┴─────────┴─────────┴─────────┴─────────┘ + +----------+---------+---------+---------+---------+ series A + +----------+---------+---------+---------+---------+ + +----------+---------+---------+---------+---------+ series B + +----------+---------+---------+---------+---------+ . . . - ┌──────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ series XYZ - └──────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ + +----------+---------+---------+---------+---------+---------+ series XYZ + +----------+---------+---------+---------+---------+---------+ chunk 1 chunk 2 chunk 3 ... ``` @@ -124,17 +130,17 @@ Prometheus 通过定期地抓取一组时间序列的当前值来获取数据点 ``` series ^ - │ . . . . . . - │ . . . . . . - │ . . . . . . - │ . . . . . . . - │ . . . . . . . - │ . . . . . . . - │ . . . . . . - │ . . . . . . - │ . . . . . - │ . . . . . - │ . . . . . + | . . . . . . + | . . . . . . + | . . . . . . + | . . . . . . . + | . . . . . . . + | . . . . . . . + | . . . . . . + | . . . . . . + | . . . . . + | . . . . . + | . . . . . v <-------------------- time ---------------------> ``` @@ -176,29 +182,29 @@ series ``` $ tree ./data ./data -├── b-000001 -│ ├── chunks -│ │ ├── 000001 -│ │ ├── 000002 -│ │ └── 000003 -│ ├── index -│ └── meta.json -├── b-000004 -│ ├── chunks -│ │ └── 000001 -│ ├── index -│ └── meta.json -├── b-000005 -│ ├── chunks -│ │ └── 000001 -│ ├── index -│ └── meta.json -└── b-000006 - ├── meta.json - └── wal - ├── 000001 - ├── 000002 - └── 000003 ++-- b-000001 +| +-- chunks +| | +-- 000001 +| | +-- 000002 +| | +-- 000003 +| +-- index +| +-- meta.json ++-- b-000004 +| +-- chunks +| | +-- 000001 +| +-- index +| +-- meta.json ++-- b-000005 +| +-- chunks +| | +-- 000001 +| +-- index +| +-- meta.json ++-- b-000006 + +-- meta.json + +-- wal + +-- 000001 + +-- 000002 + +-- 000003 ``` 在最顶层,我们有一系列以 `b-` 为前缀编号的block。每个块中显然保存了索引文件和含有更多编号文件的 `chunk` 文件夹。`chunks` 目录只包含不同序列数据点的原始块raw chunks of data points。与 V2 存储系统一样,这使得通过时间窗口读取序列数据非常高效并且允许我们使用相同的有效压缩算法。这一点被证实行之有效,我们也打算沿用。显然,这里并不存在含有单个序列的文件,而是一堆保存着许多序列的数据块。 @@ -214,15 +220,15 @@ $ tree ./data ``` t0 t1 t2 t3 now - ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ - │ │ │ │ │ │ │ │ ┌────────────┐ - │ │ │ │ │ │ │ mutable │ <─── write ──── ┤ Prometheus │ - │ │ │ │ │ │ │ │ └────────────┘ - └───────────┘ └───────────┘ └───────────┘ └───────────┘ ^ - └──────────────┴───────┬──────┴──────────────┘ │ - │ query - │ │ - merge ─────────────────────────────────────────────────┘ + +-----------+ +-----------+ +-----------+ +-----------+ + | | | | | | | | +------------+ + | | | | | | | mutable | <--- write ---- ┤ Prometheus | + | | | | | | | | +------------+ + +-----------+ +-----------+ +-----------+ +-----------+ ^ + +--------------+-------+------+--------------+ | + | query + | | + merge -------------------------------------------------+ ``` 每一块的数据都是不可变的immutable。当然,当我们采集新数据时,我们必须能向最近的块中添加新的序列和样本。对于该数据块,所有新的数据都将写入内存中的数据库中,它与我们的持久化的数据块一样提供了查找属性。内存中的数据结构可以高效地更新。为了防止数据丢失,所有传入的数据同样被写入临时的预写日志write ahead log中,这就是 `wal` 文件夹中的一些列文件,我们可以在重新启动时通过它们重新填充内存数据库。 @@ -262,15 +268,15 @@ t0 t1 t2 t3 now ``` t0 t1 t2 t3 t4 now - ┌────────────┐ ┌──────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ - │ 1 │ │ 2 │ │ 3 │ │ 4 │ │ 5 mutable │ before - └────────────┘ └──────────┘ └───────────┘ └───────────┘ └───────────┘ - ┌─────────────────────────────────────────┐ ┌───────────┐ ┌───────────┐ - │ 1 compacted │ │ 4 │ │ 5 mutable │ after (option A) - └─────────────────────────────────────────┘ └───────────┘ └───────────┘ - ┌──────────────────────────┐ ┌──────────────────────────┐ ┌───────────┐ - │ 1 compacted │ │ 3 compacted │ │ 5 mutable │ after (option B) - └──────────────────────────┘ └──────────────────────────┘ └───────────┘ + +------------+ +----------+ +-----------+ +-----------+ +-----------+ + | 1 | | 2 | | 3 | | 4 | | 5 mutable | before + +------------+ +----------+ +-----------+ +-----------+ +-----------+ + +-----------------------------------------+ +-----------+ +-----------+ + | 1 compacted | | 4 | | 5 mutable | after (option A) + +-----------------------------------------+ +-----------+ +-----------+ + +--------------------------+ +--------------------------+ +-----------+ + | 1 compacted | | 3 compacted | | 5 mutable | after (option B) + +--------------------------+ +--------------------------+ +-----------+ ``` 在这个例子中我们有顺序块 `[1,2,3,4]`。块 1、2、3 可以压缩在一起,新的布局将会是 `[1,4]`。或者,将它们成对压缩为 `[1,3]`。所有的时间序列数据仍然存在,但现在整体上保存在更少的块中。这极大程度地缩减了查询时间的消耗,因为需要合并的部分查询结果变得更少了。 @@ -281,9 +287,9 @@ t0 t1 t2 t3 t4 now ``` | - ┌────────────┐ ┌────┼─────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ - │ 1 │ │ 2 | │ │ 3 │ │ 4 │ │ 5 │ . . . - └────────────┘ └────┼─────┘ └───────────┘ └───────────┘ └───────────┘ + +------------+ +----+-----+ +-----------+ +-----------+ +-----------+ + | 1 | | 2 | | | 3 | | 4 | | 5 | . . . + +------------+ +----+-----+ +-----------+ +-----------+ +-----------+ | | retention boundary @@ -352,7 +358,7 @@ __name__="requests_total" -> [ 9999, 1000, 1001, 2000000, 2000001, 2000002, 另一个艰巨的任务是当磁盘上的数据被更新或删除掉后修改其索引。通常,最简单的方法是重新计算并写入,但是要保证数据库在此期间可查询且具有一致性。V3 存储系统通过每块上具有的独立不可变索引来解决这一问题,该索引仅通过压缩时的重写来进行修改。只有可变块上的索引需要被更新,它完全保存在内存中。 -### 基准测试 +## 基准测试 我从存储的基准测试开始了初步的开发,它基于现实世界数据集中提取的大约 440 万个序列描述符,并生成合成数据点以输入到这些序列中。这个阶段的开发仅仅测试了单独的存储系统,对于快速找到性能瓶颈和高并发负载场景下的触发死锁至关重要。 @@ -436,7 +442,7 @@ __name__="requests_total" -> [ 9999, 1000, 1001, 2000000, 2000001, 2000002, > 注意:在撰写本文的同时,Prometheus 1.6 正在开发当中,它允许更可靠地配置最大内存使用量,并且可能会显著地减少整体的消耗,有利于稍微提高 CPU 使用率。我没有重复对此进行测试,因为整体结果变化不大,尤其是面对高序列分流的情况。 -### 总结 +## 总结 Prometheus 开始应对高基数序列与单独样本的吞吐量。这仍然是一项富有挑战性的任务,但是新的存储系统似乎向我们展示了未来的一些好东西。 From e5540e7ed0eed985881786d1eb540e447babc5cf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 18:36:33 +0800 Subject: [PATCH 0866/1154] PUB:20170410 Writing a Time Series Database from Scratch.md @LuuMing https://linux.cn/article-10964-1.html --- .../20170410 Writing a Time Series Database from Scratch.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20170410 Writing a Time Series Database from Scratch.md (100%) diff --git a/translated/tech/20170410 Writing a Time Series Database from Scratch.md b/published/20170410 Writing a Time Series Database from Scratch.md similarity index 100% rename from translated/tech/20170410 Writing a Time Series Database from Scratch.md rename to published/20170410 Writing a Time Series Database from Scratch.md From 17157b53a3912433cb8257842413755266bb956f Mon Sep 17 00:00:00 2001 From: Lingxu Meng Date: Tue, 11 Jun 2019 21:01:59 +1000 Subject: [PATCH 0867/1154] Update and rename sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md to translated/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md --- ...Now Available on Linux Thanks to Lutris.md | 135 ----------------- ...Now Available on Linux Thanks to Lutris.md | 136 ++++++++++++++++++ 2 files changed, 136 insertions(+), 135 deletions(-) delete mode 100644 sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md create mode 100644 translated/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md diff --git a/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md b/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md deleted file mode 100644 index 37c7dc869b..0000000000 --- a/sources/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md +++ /dev/null @@ -1,135 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Modrisco) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Epic Games Store is Now Available on Linux Thanks to Lutris) -[#]: via: (https://itsfoss.com/epic-games-lutris-linux/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Epic Games Store is Now Available on Linux Thanks to Lutris -====== - -_**Brief: Open Source gaming platform Lutris now enables you to use Epic Games Store on Linux. We tried it on Ubuntu 19.04 and here’s our experience with it.**_ - -[Gaming on Linux][1] just keeps getting better. Want to [play Windows games on Linux][2], Steam’s new [in-progress feature][3] enables you to do that. - -Steam might be new in the field of Windows games on Linux but Lutris has been doing it for years. - -[Lutris][4] is an open source gaming platform for Linux where it provides installers for game clients like Origin, Steam, Blizzard.net app and so on. It utilizes Wine to run stuff that isn’t natively supported on Linux. - -Lutris has recently announced that you can now use Epic Games Store using Lutris. - -### Lutris brings Epic Games to Linux - -![Epic Games Store Lutris Linux][5] - -[Epic Games Store][6] is a digital video game distribution platform like Steam. It only supports Windows and macOS for the moment. - -The Lutris team worked hard to bring Epic Games Store to Linux via Lutris. Even though I’m not a big fan of Epic Games Store, it was good to know about the support for Linux via Lutris: - -> Good news! [@EpicGames][7] Store is now fully functional under Linux if you use Lutris to install it! No issues observed whatsoever. [@TimSweeneyEpic][8] will probably like this 😊 [pic.twitter.com/7mt9fXt7TH][9] -> -> — Lutris Gaming (@LutrisGaming) [April 17, 2019][10] - -As an avid gamer and Linux user, I immediately jumped upon this news and installed Lutris to run Epic Games on it. - -**Note:** _I used[Ubuntu 19.04][11] to test Epic Games store for Linux._ - -### Using Epic Games Store for Linux using Lutris - -To install Epic Games Store on your Linux system, make sure that you have [Lutris][4] installed with its pre-requisites Wine and Python 3. So, first [install Wine on Ubuntu][12] or whichever Linux you are using and then [download Lutris from its website][13]. - -[][14] - -Suggested read Ubuntu Mate Will Be Default OS On Entroware Laptops - -#### Installing Epic Games Store - -Once the installation of Lutris is successful, simply launch it. - -While I tried this, I encountered an error (nothing happened when I tried to launch it using the GUI). However, when I typed in “ **lutris** ” on the terminal to launch it otherwise, I noticed an error that looked like this: - -![][15] - -Thanks to Abhishek, I learned that this is a common issue (you can check that on [GitHub][16]). - -So, to fix it, all I had to do was – type in a command in the terminal: - -``` -export LC_ALL=C -``` - -Just copy it and enter it in your terminal if you face the same issue. And, then, you will be able to open Lutris. - -**Note:** _You’ll have to enter this command every time you launch Lutris. So better to add it to your .bashrc or list of environment variable._ - -Once that is done, simply launch it and search for “ **Epic Games Store** ” as shown in the image below: - -![Epic Games Store in Lutris][17] - -Here, I have it installed already, so you will get the option to “Install” it and then it will automatically ask you to install the required packages that it needs. You just have to proceed in order to successfully install it. That’s it – no rocket science involved. - -#### Playing a Game on Epic Games Store - -![Epic Games Store][18] - -Now that we have Epic Games store via Lutris on Linux, simply launch it and log in to your account to get started. - -But, does it really work? - -_Yes, the Epic Games Store does work._ **But, all the games don’t.** - -Well, I haven’t tried everything, but I grabbed a free game (Transistor – a turn-based ARPG game) to check if that works. - -![Transistor – Epic Games Store][19] - -Unfortunately, it didn’t. It says that it is “Running” when I launch it but then again, nothing happens. - -As of now, I’m not aware of any solutions to that – so I’ll try to keep you guys updated if I find a fix. - -[][20] - -Suggested read Alpha Version Of New Skype Client For Linux Is Out Now - -**Wrapping Up** - -It’s good to see the gaming scene improve on Linux thanks to the solutions like Lutris for users. However, there’s still a lot of work to be done. - -For a game to run hassle-free on Linux is still a challenge. There can be issues like this which I encountered or similar. But, it’s going in the right direction – even if it has issues. - -What do you think of Epic Games Store on Linux via Lutris? Have you tried it yet? Let us know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/epic-games-lutris-linux/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[Modrisco](https://github.com/Modrisco) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/linux-gaming-guide/ -[2]: https://itsfoss.com/steam-play/ -[3]: https://itsfoss.com/steam-play-proton/ -[4]: https://lutris.net/ -[5]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-lutris-linux-800x450.png -[6]: https://www.epicgames.com/store/en-US/ -[7]: https://twitter.com/EpicGames?ref_src=twsrc%5Etfw -[8]: https://twitter.com/TimSweeneyEpic?ref_src=twsrc%5Etfw -[9]: https://t.co/7mt9fXt7TH -[10]: https://twitter.com/LutrisGaming/status/1118552969816018948?ref_src=twsrc%5Etfw -[11]: https://itsfoss.com/ubuntu-19-04-release-features/ -[12]: https://itsfoss.com/install-latest-wine/ -[13]: https://lutris.net/downloads/ -[14]: https://itsfoss.com/ubuntu-mate-entroware/ -[15]: https://itsfoss.com/wp-content/uploads/2019/04/lutris-error.jpg -[16]: https://github.com/lutris/lutris/issues/660 -[17]: https://itsfoss.com/wp-content/uploads/2019/04/lutris-epic-games-store-800x520.jpg -[18]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-800x450.jpg -[19]: https://itsfoss.com/wp-content/uploads/2019/04/transistor-game-epic-games-store-800x410.jpg -[20]: https://itsfoss.com/skpe-alpha-linux/ diff --git a/translated/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md b/translated/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md new file mode 100644 index 0000000000..d621d759b0 --- /dev/null +++ b/translated/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: (Modrisco) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Epic Games Store is Now Available on Linux Thanks to Lutris) +[#]: via: (https://itsfoss.com/epic-games-lutris-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +有了 Lutris,Linux 现在也可以启动 Epic 游戏商城 +====== + +_**简介: 开源游戏平台 Lutris 现在使您能够在 Linux 上使用 Epic 游戏商城。我们使用 Ubuntu 19.04 版本测试,以下是我们的使用体验。**_ + + +[在 Linux 上玩游戏][1] 正变得越来越容易。Steam 的 [in-progress][3] 特性可以帮助您实现 [在 Linux 上玩 Windows 游戏][2]。 + +Steam 在 Linux 运行 Windows 游戏领域还是新玩家,而 Lutris 却已从事多年。 + +[Lutris][4] 是一款为 Linux 开发的开源游戏平台,提供诸如 Origin、Steam、战网等平台的游戏安装器。它使用 Wine 来运行 Linux 不能支持的程序。 + +Lutris 近期宣布您可以通过它来运行 Epic 游戏商店。 + +### Lutris 为 Linux 带来了 Epic 游戏 + +![Epic Games Store Lutris Linux][5] + +[Epic 游戏商城][6] 是一个类似 Steam 的电子游戏分销平台。它目前只支持 Windows 和 macOS。 + +Lutris 团队付出了大量努力使 Linux 用户可以通过 Lutris 使用 Epic 游戏商城。虽然我不是一个 Epic 商城的粉丝,但可以通过 Lutris 在 Linux 上运行 Epic 商城终归是个好消息。 + +> 好消息! 您现在可以通过 Lutris 安装获得 [@EpicGames][7] 商城在 Linux 下的全功能支持!没有发现任何问题。 [@TimSweeneyEpic][8] 可能会很喜欢 😊 [pic.twitter.com/7mt9fXt7TH][9] +> +> — Lutris Gaming (@LutrisGaming) [April 17, 2019][10] + +作为一名狂热的游戏玩家和 Linux 用户,我立即得到了这个消息,并安装了 Lutris 来运行 Epic 游戏。 + +**备注:** _我使用来 [Ubuntu 19.04][11] 来测试 Linux 环境下的游戏运行情况。_ + +### 通过 Lutris 在 Linux 下使用 Epic 游戏商城 + +为了在您的 Linux 系统中安装 Epic 游戏商城,请确保您已经安装了 Wine 和 Python 3。接下来,[在 Ubuntu 中安装 Wine][12] ,或任何您正在使用的 Linux 发行版本。然后, [从官方网站下载 Lutris][13]. + +[][14] + +Ubuntu Mate 是 Entroware 笔记本的默认系统。 + +#### 安装 Epic 游戏商城 + +Lutris 安装成功后,可以很方便地启动。 + +当我尝试时,我遇到了一个问题(当我用 GUI 启动时却没有遇到)。不过,当我尝试在命令行输入 “ **lutris** ” 来启动时,我发现了下图所示的错误: + +![][15] + +感谢 Abhishek,我了解到了这是一个常见问题 (你可以在 [GitHub][16] 上查看这个问题)。 + +总之,为了解决这个问题,我需要在命令行中输入以下命令: + +``` +export LC_ALL=C +``` + +当你遇到同样的问题时,只要你输入这个命令,就能正常启动 Lutris 了。 + +**注意**:_每次启动 Lutris 时都必须输入这个命令。因此,最好将其添加到 .bashrc 文件或环境变量列表中。_ + +上述操作完成后,只要启动并搜索 “**Epic Games Store**” 会显示以下图片中的内容: + +![Epic Games Store in Lutris][17] + +在这里,我已经安装过了,所以您将会看到“安装”选项,它会自动询问您是否需要安装需要的包。只需要继续操作就可以成功安装。就是这样,不需要任何黑科技。 + +#### 玩一款 Epic 游戏商城中的游戏 + +![Epic Games Store][18] + +现在我们已经通过 Lutris 在 Linux 上安装了 Epic 游戏商城,启动它并登陆您的账号就可以开始了。 + +但这真会奏效吗? + +_是的, Epic 游戏商城可以运行_。 **但是所有游戏都不能玩。** + +我还没有尝试过所有内容,但是我拿了一个免费的游戏(晶体管 —— 一款回合制 ARPG 游戏)来检查它是否有效。 + +![Transistor – Epic Games Store][19] + +很不幸,游戏没有启动。当我运行时界面显示了 “Running” 不过什么都没有发生。 + +到目前为止,我还不知道有什么解决方案 —— 所以如果我找到解决方案,我会尽力让你们知道最新情况。 + +[][20] + +建议参考 Linux 的新版 Skype 客户端 Alpha 版本来参考。 + +**总结** + +通过 Lutris 这样的工具使 Linux 的游戏场景得到了改善,这终归是个好消息 。不过,仍有许多工作要做。 + +对于在Linux上运行的游戏来说,无障碍运行仍然是一个挑战。其中可能就会有我遇到的这种问题,或者其他类似的。但它正朝着正确的方向发展 —— 即使还存在着一些问题。 + +你有什么看法吗?你是否也尝试用 Lutris 在 Linux 上启动 Epic 游戏商城?在下方评论让我们看看您的意见。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/epic-games-lutris-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[Modrisco](https://github.com/Modrisco) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-gaming-guide/ +[2]: https://itsfoss.com/steam-play/ +[3]: https://itsfoss.com/steam-play-proton/ +[4]: https://lutris.net/ +[5]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-lutris-linux-800x450.png +[6]: https://www.epicgames.com/store/en-US/ +[7]: https://twitter.com/EpicGames?ref_src=twsrc%5Etfw +[8]: https://twitter.com/TimSweeneyEpic?ref_src=twsrc%5Etfw +[9]: https://t.co/7mt9fXt7TH +[10]: https://twitter.com/LutrisGaming/status/1118552969816018948?ref_src=twsrc%5Etfw +[11]: https://itsfoss.com/ubuntu-19-04-release-features/ +[12]: https://itsfoss.com/install-latest-wine/ +[13]: https://lutris.net/downloads/ +[14]: https://itsfoss.com/ubuntu-mate-entroware/ +[15]: https://itsfoss.com/wp-content/uploads/2019/04/lutris-error.jpg +[16]: https://github.com/lutris/lutris/issues/660 +[17]: https://itsfoss.com/wp-content/uploads/2019/04/lutris-epic-games-store-800x520.jpg +[18]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-800x450.jpg +[19]: https://itsfoss.com/wp-content/uploads/2019/04/transistor-game-epic-games-store-800x410.jpg +[20]: https://itsfoss.com/skpe-alpha-linux/ From 3222fdf670008be70e61e8af49fb2ce563d5b037 Mon Sep 17 00:00:00 2001 From: Lingxu Meng Date: Tue, 11 Jun 2019 21:02:20 +1000 Subject: [PATCH 0868/1154] Rename translated/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md to translated/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md --- ...Epic Games Store is Now Available on Linux Thanks to Lutris.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/{ => tech}/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md (100%) diff --git a/translated/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md b/translated/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md similarity index 100% rename from translated/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md rename to translated/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md From 67dbd8c3398dc0ce4ffb1a2a98c1fcc850acb2f2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 21:47:42 +0800 Subject: [PATCH 0869/1154] APL:20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news --- ...ython data pipeline, data breach detection, and more news.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md b/sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md index 6059a77fcb..3d1e315a35 100644 --- a/sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md +++ b/sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From cb437b333573fcf88e27779e81b208c7766fa729 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 22:08:38 +0800 Subject: [PATCH 0870/1154] TSL:20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md --- ...e, data breach detection, and more news.md | 84 ------------------- ...e, data breach detection, and more news.md | 82 ++++++++++++++++++ 2 files changed, 82 insertions(+), 84 deletions(-) delete mode 100644 sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md create mode 100644 translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md diff --git a/sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md b/sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md deleted file mode 100644 index 3d1e315a35..0000000000 --- a/sources/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (An open source bionic leg, Python data pipeline, data breach detection, and more news) -[#]: via: (https://opensource.com/article/19/6/news-june-8) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -An open source bionic leg, Python data pipeline, data breach detection, and more news -====== -Catch up on the biggest open source headlines from the past two weeks. -![][1] - -In this edition of our open source news roundup, we take a look at an open source bionic leg, a new open source medical imaging organization, McKinsey's first open source release, and more! - -### Using open source to advance bionics - -A generation of people learned the term _bionics_ from the TV series **The Six Million Dollar Man** and **The Bionic Woman**. What was science fiction (although based on fact) is closer to becoming a reality thanks to prosthetic leg [designed by the University of Michigan and the Shirley Ryan AbilityLab][2]. - -The leg, which incorporates a simple, low-cost modular design, is "intended to improve the quality of life of patients and accelerate scientific advances by offering a unified platform to fragmented research efforts across the field of bionics." It will, according to lead designer Elliot Rouse, "enable investigators to efficiently solve challenges associated with controlling bionic legs across a range of activities in the lab and out in the community." - -You can learn more about the leg, and download designs, from the [Open Source Leg][3] website. - -### McKinsey releases a Python library for building production-ready data pipelines - -Consulting giant McKinsey and Co. recently released its [first open source tool][4]. Called Kedro, it's a Python library for creating machine learning and data pipelines. - -Kedro makes "it easier to manage large workflows and ensuring a consistent quality of code throughout a project," said product manager Yetunde Dada. While it started as a proprietary tool, McKinsey open sourced Kedro so "clients can use it after we leave a project — it is our way of giving back," said engineer Nikolaos Tsaousis. - -If you're interested in taking a peek, you can grab [Kedro's source code][5] off GitHub. - -### New consortium to advance open source medical imaging - -A group of experts and patient advocates have come together to form the [Open Source Imaging Consortium][6]. The consortium aims to "advance the diagnosis of idiopathic pulmonary fibrosis and other interstitial lung diseases with the help of digital imaging and machine learning." - -According to the consortium's executive director, Elizabeth Estes, the project aims to "collectively speed diagnosis, aid prognosis, and ultimately allow doctors to treat patients more efficiently and effectively." To do that, they're assembling and sharing "15,000 anonymous image scans and clinical data from patients, which will serve as input data for machine learning programs to develop algorithms." - -### Mozilla releases a simple-to-use way to see if you've been part of a data breach - -Explaining security to the less software-savvy has always been a challenge, and monitoring your exposure to risk is difficult regardless of your skill level. Mozilla released [Firefox Monitor][7], with data provided by [Have I Been Pwned][8], as a straightforward way to see if any of your emails have been part of a major data breach. You can enter emails to search one by one, or sign up for their service to notify you in the future. - -The site is also full of helpful tutorials on understanding how hackers work, what to do after a data breach, and how to create strong passwords. Be sure to bookmark this one for around the holidays when family members are asking for advice. - -#### In other news - - * [Want a Google-free Android? Send your phone to this guy][9] - * [CockroachDB releases with a non-OSI approved license, remains source available][10] - * [Infrastructure automation company Chef commits to Open Source][11] - * [Russia’s would-be Windows replacement gets a security upgrade][12] - * [Switch from Medium to your own blog in a few minutes with this code][13] - * [Open Source Initiative Announces New Partnership with Software Liberty Association Taiwan][14] - - - -_Thanks, as always, to Opensource.com staff members and moderators for their help this week._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/6/news-june-8 - -作者:[Scott Nesbitt][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i -[2]: https://news.umich.edu/open-source-bionic-leg-first-of-its-kind-platform-aims-to-rapidly-advance-prosthetics/ -[3]: https://opensourceleg.com/ -[4]: https://www.information-age.com/kedro-mckinseys-open-source-software-tool-123482991/ -[5]: https://github.com/quantumblacklabs/kedro -[6]: https://pulmonaryfibrosisnews.com/2019/05/31/international-open-source-imaging-consortium-osic-launched-to-advance-ipf-diagnosis/ -[7]: https://monitor.firefox.com/ -[8]: https://haveibeenpwned.com/ -[9]: https://fossbytes.com/want-a-google-free-android-send-your-phone-to-this-guy/ -[10]: https://www.cockroachlabs.com/blog/oss-relicensing-cockroachdb/ -[11]: https://www.infoq.com/news/2019/05/chef-open-source/ -[12]: https://www.nextgov.com/cybersecurity/2019/05/russias-would-be-windows-replacement-gets-security-upgrade/157330/ -[13]: https://github.com/mathieudutour/medium-to-own-blog -[14]: https://opensource.org/node/994 diff --git a/translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md b/translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md new file mode 100644 index 0000000000..839a1c6871 --- /dev/null +++ b/translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An open source bionic leg, Python data pipeline, data breach detection, and more news) +[#]: via: (https://opensource.com/article/19/6/news-june-8) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +开源新闻:开源仿生腿、Python 数据管道、数据泄露检测 +====== + +> 了解过去两周来最大的开源头条新闻。 + +![][1] + +在本期开源新闻综述中,我们将介绍一个开源仿生腿,一个新的开源医学影像组织,麦肯锡的首个开源发布,以及更多! + +### 使用开源推进仿生学 + +我们这一代人从电视剧《六百万美元人》和《仿生女人》中学到了仿生学一词。让科幻小说(尽管基于事实)正在成为现实的,要归功于[由密歇根大学和 Shirley Ryan AbilityLab 设计][2]的假肢。 + +该腿采用简单、低成本的模块化设计,“旨在通过为仿生学领域的零碎研究工作提供统一的平台,提高患者的生活质量并加速科学进步”。根据首席设计师 Elliot Rouse 的说法,它将“使研究人员能够有效地解决与一系列实验室和社区活动中控制仿生腿相关的挑战。” + +你可以从[开源腿][3]网站了解有关腿部的更多信息并下载该设计。 + +### 麦肯锡发布了一个用于构建产品级数据管道的 Python 库 + +咨询巨头麦肯锡公司最近发布了其[第一个开源工具][4],名为 Kedro,它是一个用于创建机器学习和数据管道的 Python 库。 + +Kedro 使得“管理大型工作流程更加容易,并确保整个项目的代码质量始终如一”,产品经理 Yetunde Dada 说。虽然它最初是作为一种专有工具,但麦肯锡开源了 Kedro,因此“客户可以在我们离开项目后使用它 —— 这是我们回馈的方式,”工程师 Nikolaos Tsaousis 说。 + +如果你有兴趣了解一下,可以从 GitHub 上获取 [Kedro 的源代码][5]。 + +### 新联盟推进开源医学成像 + +一组专家和患者倡导者聚集在一起组成了[开源成像联盟][6]。该联盟旨在“通过数字成像和机器学习帮助推进特发性肺纤维化和其他间质性肺病的诊断。” + +根据联盟执行董事 Elizabeth Estes 的说法,该项目旨在“协作加速诊断,帮助预后处置,最终让医生更有效地治疗患者”。为此,他们正在组织和分享“来自患者的 15,000 个匿名图像扫描和临床数据,这将作为机器学习程序的输入数据来开发算法。” + +### Mozilla发布了一种简单易用的方法,以确定你是否遭受过数据泄露 + +向不那么精通软件的人解释安全性始终是一项挑战,无论你的技能水平如何,都很难监控你的风险。Mozilla 发布了 [Firefox Monitor][7],其数据由 [Have I Been Pwned][8] 提供,它是一种查看你的任何电子邮件是否出现在重大数据泄露事件中的简单方式。你可以输入电子邮件逐个搜索,或注册他们的服务以便将来通知您。 + +该网站还提供了大量有用的教程,用于了解黑客如何工作,数据泄露后如何处理以及如何创建强密码。当家人要求你在假日期间提供建议时,请务必将此加入书签。 + +### 其它新闻 + +* [想要一款去谷歌化的 Android?把你的手机发送给这个人][9] +* [CockroachDB 发行版使用非 OSI 批准的许可证,但仍然保持开源][10] +* [基础设施自动化公司 Chef 承诺开源][11] +* [俄罗斯的 Windows 替代品将获得安全升级][12] +* [使用此代码在几分钟内从 Medium 切换到你自己的博客][13] +* [开源推进联盟宣布与台湾自由软件协会建立新合作伙伴关系][14] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/news-june-8 + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i +[2]: https://news.umich.edu/open-source-bionic-leg-first-of-its-kind-platform-aims-to-rapidly-advance-prosthetics/ +[3]: https://opensourceleg.com/ +[4]: https://www.information-age.com/kedro-mckinseys-open-source-software-tool-123482991/ +[5]: https://github.com/quantumblacklabs/kedro +[6]: https://pulmonaryfibrosisnews.com/2019/05/31/international-open-source-imaging-consortium-osic-launched-to-advance-ipf-diagnosis/ +[7]: https://monitor.firefox.com/ +[8]: https://haveibeenpwned.com/ +[9]: https://fossbytes.com/want-a-google-free-android-send-your-phone-to-this-guy/ +[10]: https://www.cockroachlabs.com/blog/oss-relicensing-cockroachdb/ +[11]: https://www.infoq.com/news/2019/05/chef-open-source/ +[12]: https://www.nextgov.com/cybersecurity/2019/05/russias-would-be-windows-replacement-gets-security-upgrade/157330/ +[13]: https://github.com/mathieudutour/medium-to-own-blog +[14]: https://opensource.org/node/994 From 116eb29c7c66ff4c689cce924316313153c7bdc3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Jun 2019 22:18:49 +0800 Subject: [PATCH 0871/1154] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/check/common.inc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check/common.inc.sh b/scripts/check/common.inc.sh index 2bc0334930..905699a139 100644 --- a/scripts/check/common.inc.sh +++ b/scripts/check/common.inc.sh @@ -10,7 +10,7 @@ export TSL_DIR='translated' # 已翻译 export PUB_DIR='published' # 已发布 # 定义匹配规则 -export CATE_PATTERN='(talk|tech)' # 类别 +export CATE_PATTERN='(talk|tech|news)' # 类别 export FILE_PATTERN='[0-9]{8} [a-zA-Z0-9_.,() -]*\.md' # 文件名 # 获取用于匹配操作的正则表达式 From 072d03a14a593fb7a622c87cf0372d66ee8ab58c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 22:21:24 +0800 Subject: [PATCH 0872/1154] PRF:20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md @wxy --- ...e, data breach detection, and more news.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md b/translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md index 839a1c6871..9a799b28fd 100644 --- a/translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md +++ b/translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (An open source bionic leg, Python data pipeline, data breach detection, and more news) @@ -14,21 +14,21 @@ ![][1] -在本期开源新闻综述中,我们将介绍一个开源仿生腿,一个新的开源医学影像组织,麦肯锡的首个开源发布,以及更多! +在本期开源新闻综述中,我们将介绍一个开源仿生腿、一个新的开源医学影像组织,麦肯锡发布的首个开源软件,以及更多! ### 使用开源推进仿生学 我们这一代人从电视剧《六百万美元人》和《仿生女人》中学到了仿生学一词。让科幻小说(尽管基于事实)正在成为现实的,要归功于[由密歇根大学和 Shirley Ryan AbilityLab 设计][2]的假肢。 -该腿采用简单、低成本的模块化设计,“旨在通过为仿生学领域的零碎研究工作提供统一的平台,提高患者的生活质量并加速科学进步”。根据首席设计师 Elliot Rouse 的说法,它将“使研究人员能够有效地解决与一系列实验室和社区活动中控制仿生腿相关的挑战。” +该腿采用简单、低成本的模块化设计,“旨在通过为仿生学领域的零碎研究工作提供统一的平台,提高患者的生活质量并加速科学进步”。根据首席设计师 Elliot Rouse 的说法,它将“使研究人员能够有效地解决与一系列的实验室和社区活动中控制仿生腿相关的挑战。” -你可以从[开源腿][3]网站了解有关腿部的更多信息并下载该设计。 +你可以从[开源腿][3]网站了解有该腿的更多信息并下载该设计。 ### 麦肯锡发布了一个用于构建产品级数据管道的 Python 库 咨询巨头麦肯锡公司最近发布了其[第一个开源工具][4],名为 Kedro,它是一个用于创建机器学习和数据管道的 Python 库。 -Kedro 使得“管理大型工作流程更加容易,并确保整个项目的代码质量始终如一”,产品经理 Yetunde Dada 说。虽然它最初是作为一种专有工具,但麦肯锡开源了 Kedro,因此“客户可以在我们离开项目后使用它 —— 这是我们回馈的方式,”工程师 Nikolaos Tsaousis 说。 +Kedro 使得“管理大型工作流程更加容易,并确保整个项目的代码质量始终如一”,产品经理 Yetunde Dada 说。虽然它最初是作为一种专有的工具,但麦肯锡开源了 Kedro,因此“客户可以在我们离开项目后使用它 —— 这是我们回馈的方式,”工程师 Nikolaos Tsaousis 说。 如果你有兴趣了解一下,可以从 GitHub 上获取 [Kedro 的源代码][5]。 @@ -38,16 +38,16 @@ Kedro 使得“管理大型工作流程更加容易,并确保整个项目的 根据联盟执行董事 Elizabeth Estes 的说法,该项目旨在“协作加速诊断,帮助预后处置,最终让医生更有效地治疗患者”。为此,他们正在组织和分享“来自患者的 15,000 个匿名图像扫描和临床数据,这将作为机器学习程序的输入数据来开发算法。” -### Mozilla发布了一种简单易用的方法,以确定你是否遭受过数据泄露 +### Mozilla 发布了一种简单易用的方法,以确定你是否遭受过数据泄露 -向不那么精通软件的人解释安全性始终是一项挑战,无论你的技能水平如何,都很难监控你的风险。Mozilla 发布了 [Firefox Monitor][7],其数据由 [Have I Been Pwned][8] 提供,它是一种查看你的任何电子邮件是否出现在重大数据泄露事件中的简单方式。你可以输入电子邮件逐个搜索,或注册他们的服务以便将来通知您。 +向不那么精通软件的人解释安全性始终是一项挑战,无论你的技能水平如何,都很难监控你的风险。Mozilla 发布了 [Firefox Monitor][7],其数据由 [Have I Been Pwned][8] 提供,它是一种查看你的任何电子邮件是否出现在重大数据泄露事件中的简单方式。你可以输入电子邮件逐个搜索,或注册他们的服务以便将来通知你。 -该网站还提供了大量有用的教程,用于了解黑客如何工作,数据泄露后如何处理以及如何创建强密码。当家人要求你在假日期间提供建议时,请务必将此加入书签。 +该网站还提供了大量有用的教程,用于了解黑客如何做的,数据泄露后如何处理以及如何创建强密码。请务必将网站加入书签,以防家人要求你在假日期间提供建议。 ### 其它新闻 * [想要一款去谷歌化的 Android?把你的手机发送给这个人][9] -* [CockroachDB 发行版使用非 OSI 批准的许可证,但仍然保持开源][10] +* [CockroachDB 发行版使用了非 OSI 批准的许可证,但仍然保持开源][10] * [基础设施自动化公司 Chef 承诺开源][11] * [俄罗斯的 Windows 替代品将获得安全升级][12] * [使用此代码在几分钟内从 Medium 切换到你自己的博客][13] @@ -60,7 +60,7 @@ via: https://opensource.com/article/19/6/news-june-8 作者:[Scott Nesbitt][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 275a54dde32fa2628fb876e9375d4896a44107d7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 22:22:32 +0800 Subject: [PATCH 0873/1154] PUB:20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md @wxy https://linux.cn/article-10965-1.html --- ...hon data pipeline, data breach detection, and more news.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md (98%) diff --git a/translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md b/published/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md similarity index 98% rename from translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md rename to published/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md index 9a799b28fd..4df0e7accd 100644 --- a/translated/news/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md +++ b/published/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10965-1.html) [#]: subject: (An open source bionic leg, Python data pipeline, data breach detection, and more news) [#]: via: (https://opensource.com/article/19/6/news-june-8) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) From 4848ff83c4563d8ebec94c5a991ea7570f56225a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 23:10:35 +0800 Subject: [PATCH 0874/1154] APL:20180324 Memories of writing a parser for man pages.md --- ...ories of writing a parser for man pages.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sources/tech/20180324 Memories of writing a parser for man pages.md b/sources/tech/20180324 Memories of writing a parser for man pages.md index fb53aed395..e6b4de90f3 100644 --- a/sources/tech/20180324 Memories of writing a parser for man pages.md +++ b/sources/tech/20180324 Memories of writing a parser for man pages.md @@ -1,23 +1,23 @@ -Memories of writing a parser for man pages +回忆:为 man 手册页编写解析器 ====== -I generally enjoy being bored, but sometimes enough is enough—that was the case a Sunday afternoon of 2015 when I decided to start an open source project to overcome my boredom. +我一般都很喜欢无所事事,但有时候太无聊了也不行 —— 2015 年的一个星期天下午就是这样,我决定开始一个开源项目来让我不那么无聊。 -In my quest for ideas, I stumbled upon a request to build a [“Man page viewer built with web standards”][1] by [Mathias Bynens][2] and without thinking too much, I started coding a man page parser in JavaScript, which after a lot of back and forths, ended up being [Jroff][3]. +在我寻求创意时,我偶然发现了一个请求,要求构建一个由 [Mathias Bynens][2] 提出的“[按 Web 标准构建的 Man 手册页查看器][1]”。没有考虑太多,我开始使用 JavaScript 编写一个手册页解析器,经过大量的反复思考,最终做出了一个 [Jroff][3]。 -Back then, I was familiar with manual pages as a concept and used them a fair amount of times, but that was all I knew, I had no idea how they were generated or if there was a standard in place. Two years later, here are some thoughts on the matter. +那时候,我非常熟悉手册页这个概念,而且使用过很多次,但我知道的仅止于此,我不知道它们是如何生成的,或者是否有一个标准。在经过两年后,我有了一些关于此事的想法。 -### How man pages are written +### man 手册页是如何写的 -The first thing that surprised me at the time, was the notion that manpages at their core are just plain text files stored somewhere in the system (you can check this directory using the `manpath` command). +当时令我感到惊讶的第一件事是,手册页的核心只是存储在系统某处的纯文本文件(你可以使用 `manpath` 命令检查此目录)。 -This files not only contain the documentation, but also formatting information using a typesetting system from the 1970s called `troff`. +此文件中不仅包含文档,还包含使用了 20 世纪 70 年代名为 `troff` 的排版系统的格式化信息。 -> troff, and its GNU implementation groff, are programs that process a textual description of a document to produce typeset versions suitable for printing. **It’s more ‘What you describe is what you get’ rather than WYSIWYG.** +> troff 及其 GNU 实现 groff 是处理文档的文本描述以生成适合打印的排版版本的程序。**它更像是“你所描述的即你得到的”,而不是你所见即所得的。** > -> — extracted from [troff.org][4] +> - 摘自 [troff.org][4] -If you are totally unfamiliar with typesetting formats, you can think of them as Markdown on steroids, but in exchange for the flexibility you have a more complex syntax: +如果你对排版格式毫不熟悉,可以将它们视为 steroids 期刊用的 Markdown,但其灵活性带来的就是更复杂的语法: ![groff-compressor][5] From e6c332d2f1f04bf5fbca052232b4491b272206d1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 23:41:49 +0800 Subject: [PATCH 0875/1154] TSL:20180324 Memories of writing a parser for man pages.md --- ...ories of writing a parser for man pages.md | 109 ------------------ ...ories of writing a parser for man pages.md | 102 ++++++++++++++++ 2 files changed, 102 insertions(+), 109 deletions(-) delete mode 100644 sources/tech/20180324 Memories of writing a parser for man pages.md create mode 100644 translated/tech/20180324 Memories of writing a parser for man pages.md diff --git a/sources/tech/20180324 Memories of writing a parser for man pages.md b/sources/tech/20180324 Memories of writing a parser for man pages.md deleted file mode 100644 index e6b4de90f3..0000000000 --- a/sources/tech/20180324 Memories of writing a parser for man pages.md +++ /dev/null @@ -1,109 +0,0 @@ -回忆:为 man 手册页编写解析器 -====== - -我一般都很喜欢无所事事,但有时候太无聊了也不行 —— 2015 年的一个星期天下午就是这样,我决定开始一个开源项目来让我不那么无聊。 - -在我寻求创意时,我偶然发现了一个请求,要求构建一个由 [Mathias Bynens][2] 提出的“[按 Web 标准构建的 Man 手册页查看器][1]”。没有考虑太多,我开始使用 JavaScript 编写一个手册页解析器,经过大量的反复思考,最终做出了一个 [Jroff][3]。 - -那时候,我非常熟悉手册页这个概念,而且使用过很多次,但我知道的仅止于此,我不知道它们是如何生成的,或者是否有一个标准。在经过两年后,我有了一些关于此事的想法。 - -### man 手册页是如何写的 - -当时令我感到惊讶的第一件事是,手册页的核心只是存储在系统某处的纯文本文件(你可以使用 `manpath` 命令检查此目录)。 - -此文件中不仅包含文档,还包含使用了 20 世纪 70 年代名为 `troff` 的排版系统的格式化信息。 - -> troff 及其 GNU 实现 groff 是处理文档的文本描述以生成适合打印的排版版本的程序。**它更像是“你所描述的即你得到的”,而不是你所见即所得的。** -> -> - 摘自 [troff.org][4] - -如果你对排版格式毫不熟悉,可以将它们视为 steroids 期刊用的 Markdown,但其灵活性带来的就是更复杂的语法: - -![groff-compressor][5] - -The `groff` file can be written manually, or generated from other formats such as Markdown, Latex, HTML, and so on with many different tools. - -Why `groff` and man pages are tied together has to do with history, the format has [mutated along time][6], and his lineage is composed of a chain of similarly-named programs: RUNOFF > roff > nroff > troff > groff. - -But this doesn’t necessarily mean that `groff` is strictly related to man pages, it’s a general-purpose format that has been used to [write books][7] and even for [phototypesetting][8]. - -Moreover, It’s worth noting that `groff` can also call a postprocessor to convert its intermediate output to a final format, which is not necessarily ascii for terminal display! some of the supported formats are: TeX DVI, HTML, Canon, HP LaserJet4 compatible, PostScript, utf8 and many more. - -### Macros - -Other of the cool features of the format is its extensibility, you can write macros that enhance the basic functionalities. - -With the vast history of *nix systems, there are several macro packages that group useful macros together for specific functionalities according to the output that you want to generate, examples of macro packages are `man`, `mdoc`, `mom`, `ms`, `mm`, and the list goes on. - -Manual pages are conventionally written using `man` and `mdoc`. - -You can easily distinguish native `groff` commands from macros by the way standard `groff` packages capitalize their macro names. For `man`, each macro’s name is uppercased, like .PP, .TH, .SH, etc. For `mdoc`, only the first letter is uppercased: .Pp, .Dt, .Sh. - -![groff-example][9] - -### Challenges - -Whether you are considering to write your own `groff` parser, or just curious, these are some of the problems that I have found more challenging. - -#### Context-sensitive grammar - -Formally, `groff` has a context-free grammar, unfortunately, since macros describe opaque bodies of tokens, the set of macros in a package may not itself implement a context-free grammar. - -This kept me away (for good or bad) from the parser generators that were available at the time. - -#### Nested macros - -Most of the macros in `mdoc` are callable, this roughly means that macros can be used as arguments of other macros, for example, consider this: - - * The macro `Fl` (Flag) adds a dash to its argument, so `Fl s` produces `-s` - * The macro `Ar` (Argument) provides facilities to define arguments - * The `Op` (Optional) macro wraps its argument in brackets, as this is the standard idiom to define something as optional. - * The following combination `.Op Fl s Ar file` produces `[-s file]` because `Op` macros can be nested. - - - -#### Lack of beginner-friendly resources - -Something that really confused me was the lack of a canonical, well defined and clear source to look at, there’s a lot of information in the web which assumes a lot about the reader that it takes time to grasp. - -### Interesting macros - -To wrap up, I will offer to you a very short list of macros that I found interesting while developing jroff: - -**man** - - * TH: when writing manual pages with `man` macros, your first line that is not a comment must be this macro, it accepts five parameters: title section date source manual - * BI: bold alternating with italics (especially useful for function specifications) - * BR: bold alternating with Roman (especially useful for referring to other manual pages) - - - -**mdoc** - - * .Dd, .Dt, .Os: similar to how `man` macros require the `.TH` the `mdoc` macros require these three macros, in that particular order. Their initials stand for: Document date, Document title and Operating system. - * .Bl, .It, .El: these three macros are used to create list, their names are self-explanatory: Begin list, Item and End list. - - - - --------------------------------------------------------------------------------- - -via: https://monades.roperzh.com/memories-writing-parser-man-pages/ - -作者:[Roberto Dip][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://monades.roperzh.com -[1]:https://github.com/h5bp/lazyweb-requests/issues/114 -[2]:https://mathiasbynens.be/ -[3]:jroff -[4]:https://www.troff.org/ -[5]:https://user-images.githubusercontent.com/4419992/37868021-2e74027c-2f7f-11e8-894b-80829ce39435.gif -[6]:https://manpages.bsd.lv/history.html -[7]:https://rkrishnan.org/posts/2016-03-07-how-is-gopl-typeset.html -[8]:https://en.wikipedia.org/wiki/Phototypesetting -[9]:https://user-images.githubusercontent.com/4419992/37866838-e602ad78-2f6e-11e8-97a9-2a4494c766ae.jpg diff --git a/translated/tech/20180324 Memories of writing a parser for man pages.md b/translated/tech/20180324 Memories of writing a parser for man pages.md new file mode 100644 index 0000000000..40eff69beb --- /dev/null +++ b/translated/tech/20180324 Memories of writing a parser for man pages.md @@ -0,0 +1,102 @@ +为 man 手册页编写解析器的备忘录 +====== + +我一般都很喜欢无所事事,但有时候太无聊了也不行 —— 2015 年的一个星期天下午就是这样,我决定开始一个开源项目来让我不那么无聊。 + +在我寻求创意时,我偶然发现了一个请求,要求构建一个由 [Mathias Bynens][2] 提出的“[按 Web 标准构建的 Man 手册页查看器][1]”。没有考虑太多,我开始使用 JavaScript 编写一个手册页解析器,经过大量的反复思考,最终做出了一个 [Jroff][3]。 + +那时候,我非常熟悉手册页这个概念,而且使用过很多次,但我知道的仅止于此,我不知道它们是如何生成的,或者是否有一个标准。在经过两年后,我有了一些关于此事的想法。 + +### man 手册页是如何写的 + +当时令我感到惊讶的第一件事是,手册页的核心只是存储在系统某处的纯文本文件(你可以使用 `manpath` 命令检查此目录)。 + +此文件中不仅包含文档,还包含使用了 20 世纪 70 年代名为 `troff` 的排版系统的格式化信息。 + +> troff 及其 GNU 实现 groff 是处理文档的文本描述以生成适合打印的排版版本的程序。**它更像是“你所描述的即你得到的”,而不是你所见即所得的。** +> +> - 摘自 [troff.org][4] + +如果你对排版格式毫不熟悉,可以将它们视为 steroids 期刊用的 Markdown,但其灵活性带来的就是更复杂的语法: + +![groff-compressor][5] + +`groff` 文件可以手工编写,也可以使用许多不同的工具从其他格式生成,如 Markdown、Latex、HTML 等。 + +为什么 `groff` 和 man 手册页绑在一起有历史原因,其格式[随时间有变化][6],它的血统由一系列类似命名的程序组成:RUNOFF > roff > nroff > troff > groff。 + +但这并不一定意味着 `groff` 与手册页有多紧密的关系,它是一种通用格式,已被用于[书籍][7],甚至用于[照相排版][8]。 + +此外,值得注意的是 `groff` 也可以调用后处理器将其中间输出转换为最终格式,这对于终端显示来说不一定是 ascii !一些支持的格式是:TeX DVI、HTML、Canon、HP LaserJet4 兼容格式、PostScript、utf8 等等。 + +### 宏 + +该格式的其他很酷的功能是它的可扩展性,你可以编写宏来增强其基本功能。 + +鉴于 *nix 系统的悠久历史,有几个可以根据你想要生成的输出而将特定功能组合在一起的宏包,例如 `man`、`mdoc`、`mom`、`ms`、`mm` 等等。 + +手册页通常使用 `man` 和 `mdoc` 宏包编写。 + +区分原生的 `groff` 命令和宏的方式是通过标准 `groff` 包大写其宏名称。对于 `man` 宏包,每个宏的名称都是大写的,如 `.PP`、`.TH`、`.SH` 等。对于 `mdoc` 宏包,只有第一个字母是大写的: `.Pp`、`.Dt`、`.Sh`。 + +![groff-example][9] + +### 挑战 + +无论你是考虑编写自己的 `groff` 解析器,还是只是好奇,这些都是我发现的一些更具挑战性的问题。 + +#### 上下文敏感的语法 + +形式上,`groff` 的语法是上下文无关的,遗憾的是,因为宏描述的是主体不透明的令牌,所以包中的宏集合本身可能不会实现上下文无关的语法。 + +这让我在那时就做不出来一个解析器生成器(无论好坏)。 + +#### 嵌套的宏 + +`mdoc` 宏包中的大多数宏都是可调用的,这大致意味着宏可以用作其他宏的参数,例如,你看看这个: + +* 宏 `Fl`(Flag)会在其参数中添加破折号,因此 `Fl s` 会生成 `-s` +* 宏 `Ar`(Argument)提供了定义参数的工具 +* 宏 `Op`(Optional)会将其参数括在括号中,因为这是将某些东西定义为可选的标准习惯用法 +* 以下组合 `.Op Fl s Ar file ` 将生成 `[-s file]` 因为 `Op` 宏可以嵌套。 + +#### 缺乏适合初学者的资源 + +让我感到困惑的是缺乏一个规范的、定义明确的、清晰的来源,网上有很多信息,这些信息对读者来说很重要,需要时间来掌握。 + +### 有趣的宏 + +总结一下,我会向你提供一个非常简短的宏列表,我在开发 jroff 时发现它很有趣: + +`man` 宏包: + +* `.TH`:用 `man` 宏包编写手册页时,你的第一个不是注释的行必须是这个宏,它接受五个参数:`title`、`section`、`date`、`source`、`manual`。 +* `.BI`:粗体加斜体(特别适用于函数格式) +* `.BR`:粗体加罗马体(特别适用于参考其他手册页) + +`mdoc` 宏包: + +* `.Dd`、`.Dt`、`.Os`:类似于 `man` 宏包需要 `.TH`,`mdoc` 宏也需要这三个宏,需要按特定顺序使用。它们的缩写代表:文档日期、文档标题和操作系统。 +* `.Bl`、`.It`、`.El`:这三个宏用于创建列表,它们的名称不言自明:开始列表、项目和结束列表。 + +-------------------------------------------------------------------------------- + +via: https://monades.roperzh.com/memories-writing-parser-man-pages/ + +作者:[Roberto Dip][a] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) +选题:[lujun9972](https://github.com/lujun9972) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://monades.roperzh.com +[1]:https://github.com/h5bp/lazyweb-requests/issues/114 +[2]:https://mathiasbynens.be/ +[3]:jroff +[4]:https://www.troff.org/ +[5]:https://user-images.githubusercontent.com/4419992/37868021-2e74027c-2f7f-11e8-894b-80829ce39435.gif +[6]:https://manpages.bsd.lv/history.html +[7]:https://rkrishnan.org/posts/2016-03-07-how-is-gopl-typeset.html +[8]:https://en.wikipedia.org/wiki/Phototypesetting +[9]:https://user-images.githubusercontent.com/4419992/37866838-e602ad78-2f6e-11e8-97a9-2a4494c766ae.jpg From 3686d82280406f13443e6f9a50478c8fd3dbec4c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 23:56:17 +0800 Subject: [PATCH 0876/1154] PRF:20180324 Memories of writing a parser for man pages.md @wxy --- ...ories of writing a parser for man pages.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/translated/tech/20180324 Memories of writing a parser for man pages.md b/translated/tech/20180324 Memories of writing a parser for man pages.md index 40eff69beb..ffaebad575 100644 --- a/translated/tech/20180324 Memories of writing a parser for man pages.md +++ b/translated/tech/20180324 Memories of writing a parser for man pages.md @@ -1,7 +1,8 @@ 为 man 手册页编写解析器的备忘录 ====== +![](https://img.linux.net.cn/data/attachment/album/201906/11/235607fiqfqapvpzqhh8n1.jpg) -我一般都很喜欢无所事事,但有时候太无聊了也不行 —— 2015 年的一个星期天下午就是这样,我决定开始一个开源项目来让我不那么无聊。 +我一般都很喜欢无所事事,但有时候太无聊了也不行 —— 2015 年的一个星期天下午就是这样,我决定开始写一个开源项目来让我不那么无聊。 在我寻求创意时,我偶然发现了一个请求,要求构建一个由 [Mathias Bynens][2] 提出的“[按 Web 标准构建的 Man 手册页查看器][1]”。没有考虑太多,我开始使用 JavaScript 编写一个手册页解析器,经过大量的反复思考,最终做出了一个 [Jroff][3]。 @@ -9,7 +10,7 @@ ### man 手册页是如何写的 -当时令我感到惊讶的第一件事是,手册页的核心只是存储在系统某处的纯文本文件(你可以使用 `manpath` 命令检查此目录)。 +当时令我感到惊讶的第一件事是,手册页的核心只是存储在系统某处的纯文本文件(你可以使用 `manpath` 命令检查这些目录)。 此文件中不仅包含文档,还包含使用了 20 世纪 70 年代名为 `troff` 的排版系统的格式化信息。 @@ -23,11 +24,11 @@ `groff` 文件可以手工编写,也可以使用许多不同的工具从其他格式生成,如 Markdown、Latex、HTML 等。 -为什么 `groff` 和 man 手册页绑在一起有历史原因,其格式[随时间有变化][6],它的血统由一系列类似命名的程序组成:RUNOFF > roff > nroff > troff > groff。 +为什么 `groff` 和 man 手册页绑在一起是有历史原因的,其格式[随时间有变化][6],它的血统由一系列类似命名的程序组成:RUNOFF > roff > nroff > troff > groff。 但这并不一定意味着 `groff` 与手册页有多紧密的关系,它是一种通用格式,已被用于[书籍][7],甚至用于[照相排版][8]。 -此外,值得注意的是 `groff` 也可以调用后处理器将其中间输出转换为最终格式,这对于终端显示来说不一定是 ascii !一些支持的格式是:TeX DVI、HTML、Canon、HP LaserJet4 兼容格式、PostScript、utf8 等等。 +此外,值得注意的是 `groff` 也可以调用后处理器将其中间输出结果转换为最终格式,这对于终端显示来说不一定是 ascii !一些支持的格式是:TeX DVI、HTML、Canon、HP LaserJet4 兼容格式、PostScript、utf8 等等。 ### 宏 @@ -47,18 +48,18 @@ #### 上下文敏感的语法 -形式上,`groff` 的语法是上下文无关的,遗憾的是,因为宏描述的是主体不透明的令牌,所以包中的宏集合本身可能不会实现上下文无关的语法。 +表面上,`groff` 的语法是上下文无关的,遗憾的是,因为宏描述的是主体不透明的令牌,所以包中的宏集合本身可能不会实现上下文无关的语法。 -这让我在那时就做不出来一个解析器生成器(无论好坏)。 +这导致我在那时做不出来一个解析器生成器(不管好坏)。 #### 嵌套的宏 -`mdoc` 宏包中的大多数宏都是可调用的,这大致意味着宏可以用作其他宏的参数,例如,你看看这个: +`mdoc` 宏包中的大多数宏都是可调用的,这差不多意味着宏可以用作其他宏的参数,例如,你看看这个: * 宏 `Fl`(Flag)会在其参数中添加破折号,因此 `Fl s` 会生成 `-s` * 宏 `Ar`(Argument)提供了定义参数的工具 * 宏 `Op`(Optional)会将其参数括在括号中,因为这是将某些东西定义为可选的标准习惯用法 -* 以下组合 `.Op Fl s Ar file ` 将生成 `[-s file]` 因为 `Op` 宏可以嵌套。 +* 以下组合 `.Op Fl s Ar file ` 将生成 `[-s file]`,因为 `Op` 宏可以嵌套。 #### 缺乏适合初学者的资源 @@ -72,11 +73,11 @@ * `.TH`:用 `man` 宏包编写手册页时,你的第一个不是注释的行必须是这个宏,它接受五个参数:`title`、`section`、`date`、`source`、`manual`。 * `.BI`:粗体加斜体(特别适用于函数格式) -* `.BR`:粗体加罗马体(特别适用于参考其他手册页) +* `.BR`:粗体加正体(特别适用于参考其他手册页) `mdoc` 宏包: -* `.Dd`、`.Dt`、`.Os`:类似于 `man` 宏包需要 `.TH`,`mdoc` 宏也需要这三个宏,需要按特定顺序使用。它们的缩写代表:文档日期、文档标题和操作系统。 +* `.Dd`、`.Dt`、`.Os`:类似于 `man` 宏包需要 `.TH`,`mdoc` 宏也需要这三个宏,需要按特定顺序使用。它们的缩写分别代表:文档日期、文档标题和操作系统。 * `.Bl`、`.It`、`.El`:这三个宏用于创建列表,它们的名称不言自明:开始列表、项目和结束列表。 -------------------------------------------------------------------------------- @@ -85,7 +86,7 @@ via: https://monades.roperzh.com/memories-writing-parser-man-pages/ 作者:[Roberto Dip][a] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 选题:[lujun9972](https://github.com/lujun9972) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b5a4228c4b632f952a3f77372870cbad2d86c413 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 11 Jun 2019 23:58:09 +0800 Subject: [PATCH 0877/1154] PUB:20180324 Memories of writing a parser for man pages.md @wxy https://linux.cn/article-10966-1.html --- .../20180324 Memories of writing a parser for man pages.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180324 Memories of writing a parser for man pages.md (100%) diff --git a/translated/tech/20180324 Memories of writing a parser for man pages.md b/published/20180324 Memories of writing a parser for man pages.md similarity index 100% rename from translated/tech/20180324 Memories of writing a parser for man pages.md rename to published/20180324 Memories of writing a parser for man pages.md From 49bc6415eff17401af411ef8360b03cf93116306 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Tue, 11 Jun 2019 17:00:20 +0000 Subject: [PATCH 0878/1154] =?UTF-8?q?Revert=20"=E7=94=B3=E8=AF=B7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1978a1f7cab6eec587b7b069957c3ae2d8e021ea. --- sources/tech/20190501 Looking into Linux modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190501 Looking into Linux modules.md b/sources/tech/20190501 Looking into Linux modules.md index cb431874d3..eb3125c19b 100644 --- a/sources/tech/20190501 Looking into Linux modules.md +++ b/sources/tech/20190501 Looking into Linux modules.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (bodhix) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4b25317fadf51ab6e813fc0e88865d4d3e9bcea2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 12 Jun 2019 08:45:45 +0800 Subject: [PATCH 0879/1154] translated --- ...rnetes basics- Learn how to drive first.md | 73 ------------------- ...rnetes basics- Learn how to drive first.md | 72 ++++++++++++++++++ 2 files changed, 72 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20190606 Kubernetes basics- Learn how to drive first.md create mode 100644 translated/tech/20190606 Kubernetes basics- Learn how to drive first.md diff --git a/sources/tech/20190606 Kubernetes basics- Learn how to drive first.md b/sources/tech/20190606 Kubernetes basics- Learn how to drive first.md deleted file mode 100644 index 6218ecd6f2..0000000000 --- a/sources/tech/20190606 Kubernetes basics- Learn how to drive first.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Kubernetes basics: Learn how to drive first) -[#]: via: (https://opensource.com/article/19/6/kubernetes-basics) -[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux/users/fatherlinux/users/fatherlinux) - -Kubernetes basics: Learn how to drive first -====== -Quit focusing on new projects and get focused on getting your Kubernetes -dump truck commercial driver's license. -![Truck steering wheel and dash][1] - -In the first two articles in this series, I explained how Kubernetes is [like a dump truck][2] and that there are always [learning curves][3] to understanding elegant, professional tools like [Kubernetes][4] (and dump trucks, cranes, etc.). This article is about the next step: learning how to drive. - -Recently, I saw a thread on Reddit about [essential Kubernetes projects][5]. People seem hungry to know the bare minimum they should learn to get started with Kubernetes. The "driving a dump truck analogy" helps frame the problem to stay on track. Someone in the thread mentioned that you shouldn't be running your own registry unless you have to, so people are already nibbling at this idea of driving Kubernetes instead of building it. - -The API is Kubernetes' engine and transmission. Like a dump truck's steering wheel, clutch, gas, and brake pedal, the YAML or JSON files you use to build your applications are the primary interface to the machine. When you're first learning Kubernetes, this should be your primary focus. Get to know your controls. Don't get sidetracked by all the latest and greatest projects. Don't try out an experimental dump truck when you are just learning to drive. Instead, focus on the basics. - -### Defined and actual states - -First, Kubernetes works on the principles of defined state and actual state. - -![Defined state and actual state][6] - -Humans (developers/sysadmins/operators) specify the defined state using the YAML/JSON files they submit to the Kubernetes API. Then, Kubernetes uses a controller to analyze the difference between the new state defined in the YAML/JSON and the actual state in the cluster. - -In the example above, the Replication Controller sees the difference between the three pods specified by the user, with one Pod running, and schedules two more. If you were to log into Kubernetes and manually kill one of the Pods, it would start another one to replace it—over and over and over. Kubernetes does not stop until the actual state matches the defined state. This is super powerful. - -### **Primitives** - -Next, you need to understand what primitives you can specify in Kubernetes. - -![Kubernetes primitives][7] - -It's more than just Pods; it's Deployments, Persistent Volume Claims, Services, routes, etc. With Kubernetes platform [OpenShift][8], you can add builds and BuildConfigs. It will take you a day or so to get decent with each of these primitives. Then you can dive in deeper as your use cases become more complex. - -### Mapping developer-native to traditional IT environments - -Finally, start thinking about how this maps to what you do in a traditional IT environment. - -![Mapping developer-native to traditional IT environments][9] - -The user has always been trying to solve a business problem, albeit a technical one. Historically, we have used things like playbooks to tie business logic to sets of IT systems with a single language. This has always been great for operations staff, but it gets hairier when you try to extend this to developers. - -We have never been able to truly specify how a set of IT systems should behave and interact together, in a developer-native way, until Kubernetes. If you think about it, we are extending the ability to manage storage, network, and compute resources in a very portable and declarative way with the YAML/JSON files we write in Kubernetes, but they are always mapped back to "real" resources somewhere. We just don't have to worry about it in developer mode. - -So, quit focusing on new projects in the Kubernetes ecosystem and get focused on driving it. In the next article, I will share some tools and workflows that help you drive Kubernetes. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/6/kubernetes-basics - -作者:[Scott McCarty][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/fatherlinux/users/fatherlinux/users/fatherlinux -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/truck_steering_wheel_drive_car_kubernetes.jpg?itok=0TOzve80 (Truck steering wheel and dash) -[2]: https://opensource.com/article/19/6/kubernetes-dump-truck -[3]: https://opensource.com/article/19/6/kubernetes-learning-curve -[4]: https://opensource.com/resources/what-is-kubernetes -[5]: https://www.reddit.com/r/kubernetes/comments/bsoixc/what_are_the_essential_kubernetes_related/ -[6]: https://opensource.com/sites/default/files/uploads/defined_state_-_actual_state.png (Defined state and actual state) -[7]: https://opensource.com/sites/default/files/uploads/new_primitives.png (Kubernetes primatives) -[8]: https://www.openshift.com/ -[9]: https://opensource.com/sites/default/files/uploads/developer_native_experience_-_mapped_to_traditional.png (Mapping developer-native to traditional IT environments) diff --git a/translated/tech/20190606 Kubernetes basics- Learn how to drive first.md b/translated/tech/20190606 Kubernetes basics- Learn how to drive first.md new file mode 100644 index 0000000000..6ead832f0d --- /dev/null +++ b/translated/tech/20190606 Kubernetes basics- Learn how to drive first.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kubernetes basics: Learn how to drive first) +[#]: via: (https://opensource.com/article/19/6/kubernetes-basics) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux/users/fatherlinux/users/fatherlinux) + +Kubernetes 基础:首先学习如何使用 +====== +放弃专注于新项目,专注于获取你的 Kubernetes 翻斗车商业驾驶执照。 +![Truck steering wheel and dash][1] + +在本系列的前两篇文章中,我解释了为何 Kubernetes [像翻斗车][2]并且要理解优雅、专业的工具,如 [Kubernetes][4](和翻斗车,起重机等)总是有[学习曲线][3]的。本文是下一步:学习如何驾驶。 + +最近,我在 Reddit 上看到了一个关于[重要的 Kubernetes 项目][5]的帖子。人们似乎很想知道他们应该学习如何开始使用 Kubernetes。“驾驶翻斗车的类比”有助于确保问题保持正轨。帖子中的某个人提到你不应该运行自己的镜像仓库,除非你必须这样做,所以人们开始逐渐接受驱动 Kubernetes 而不是构建它。 + +API 是 Kubernetes 的引擎和变速器。像翻斗车的方向盘、离合器、汽油和制动踏板一样,用于构建应用程序的 YAML 或 JSON 文件是机器的主要接口。当你第一次学习 Kubernetes 时,这应该是你的主要关注点。了解你的控制部件。不要被所有最新和最大的项目所左右。当你刚学会开车时,不要尝试驾驶实验性的翻斗车。相反,专注于基础知识。 + +### 定义状态和实际状态 + +首先,Kubernetes 遵循定义状态和实际状态的原则。 + +![Defined state and actual state][6] + +人类(开发人员/系统管理员/运维人员)使用他们提交给 Kubernetes API 的 YAML/JSON 文件指定定义的状态。然后,Kubernetes 使用控制器来分析 YAML/JSON 中定义的新状态与集群中的实际状态之间的差异。 + +在上面的例子中,Replication Controller 可以看到用户指定的三个 pod 之间的差异,其中一个 pod 正在运行,并调度另外两个 Pod。如果你要登录 Kubernetes 并手动杀死其中一个 Pod,它会不断启动另一个来替换它。在实际状态与定义的状态匹配之前,Kubernetes 不会停止。这是非常强大的。 + +### **原语** + +接下来,你需要了解可以在 Kubernetes 中指定的原语。 + +![Kubernetes primitives][7] + +它不仅仅有 Pods,还有部署 (Deployments)、持久化卷声明 (Persistent Volume Claims)、服务 (Services),路由 (routes) 等。使用支持 Kubernetes 的平台 [OpenShift][8],你可以添加构建和 BuildConfigs。你大概需要一天左右的时间来了解这些原语。之后,当你的情况变得更加复杂时,你可以深入了解。 + +### 将开发者映射到传统 IT 环境 + +最后,考虑这该如何映射到你在传统 IT 环境中的操作。 + +![Mapping developer-native to traditional IT environments][9] + +尽管是一个技术问题,但用户一直在尝试解决业务问题。从历史上看,我们使用诸如 playbook 之类的东西将业务逻辑与单一语言的 IT 系统绑定起来。对于运维人员来说,这很不错,但是当你尝试将其扩展到开发人员时,它会变得更加繁琐。 + +直到 Kubernete 出现之前,我们从未能够以开发者的方式真正同时指定一组 IT 系统应如何表现和交互。如果你考虑一下,我们正在使用在 Kubernetes 中编写的 YAML/JSON 文件以非常便携和声明的方式扩展了管理存储、网络和计算资源的能力,但它们总会映射到某处的“真实”资源。我们不必以开发者身份担心它。 + +因此,快放弃关注 Kubernetes 生态系统中的新项目,而是专注开始使用它。在下一篇文章中,我将分享一些可以帮助你使用 Kubernetes 的工具和工作流程。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/kubernetes-basics + +作者:[Scott McCarty][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/fatherlinux/users/fatherlinux/users/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/truck_steering_wheel_drive_car_kubernetes.jpg?itok=0TOzve80 (Truck steering wheel and dash) +[2]: https://opensource.com/article/19/6/kubernetes-dump-truck +[3]: https://opensource.com/article/19/6/kubernetes-learning-curve +[4]: https://opensource.com/resources/what-is-kubernetes +[5]: https://www.reddit.com/r/kubernetes/comments/bsoixc/what_are_the_essential_kubernetes_related/ +[6]: https://opensource.com/sites/default/files/uploads/defined_state_-_actual_state.png (Defined state and actual state) +[7]: https://opensource.com/sites/default/files/uploads/new_primitives.png (Kubernetes primatives) +[8]: https://www.openshift.com/ +[9]: https://opensource.com/sites/default/files/uploads/developer_native_experience_-_mapped_to_traditional.png (Mapping developer-native to traditional IT environments) From b5c7384766e7c293f711ba1e1a9fd3c657bd2053 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 12 Jun 2019 08:53:24 +0800 Subject: [PATCH 0880/1154] translating --- sources/tech/20190607 5 reasons to use Kubernetes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190607 5 reasons to use Kubernetes.md b/sources/tech/20190607 5 reasons to use Kubernetes.md index d03f4c0c0e..a8991c05df 100644 --- a/sources/tech/20190607 5 reasons to use Kubernetes.md +++ b/sources/tech/20190607 5 reasons to use Kubernetes.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a126dd9bbf92d77d9c1569c69c934ccb966fa0d2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 12 Jun 2019 14:48:22 +0800 Subject: [PATCH 0881/1154] PRF:20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md @Modrisco --- ...Now Available on Linux Thanks to Lutris.md | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/translated/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md b/translated/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md index d621d759b0..ba67339421 100644 --- a/translated/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md +++ b/translated/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (Modrisco) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Epic Games Store is Now Available on Linux Thanks to Lutris) @@ -10,16 +10,15 @@ 有了 Lutris,Linux 现在也可以启动 Epic 游戏商城 ====== -_**简介: 开源游戏平台 Lutris 现在使您能够在 Linux 上使用 Epic 游戏商城。我们使用 Ubuntu 19.04 版本测试,以下是我们的使用体验。**_ +> 开源游戏平台 Lutris 现在使你能够在 Linux 上使用 Epic 游戏商城。我们使用 Ubuntu 19.04 版本进行了测试,以下是我们的使用体验。 +[在 Linux 上玩游戏][1] 正变得越来越容易。Steam [正在开发中的][3] 特性可以帮助你实现 [在 Linux 上玩 Windows 游戏][2]。 -[在 Linux 上玩游戏][1] 正变得越来越容易。Steam 的 [in-progress][3] 特性可以帮助您实现 [在 Linux 上玩 Windows 游戏][2]。 - -Steam 在 Linux 运行 Windows 游戏领域还是新玩家,而 Lutris 却已从事多年。 +如果说 Steam 在 Linux 运行 Windows 游戏领域还是新玩家,而 Lutris 却已从事多年。 [Lutris][4] 是一款为 Linux 开发的开源游戏平台,提供诸如 Origin、Steam、战网等平台的游戏安装器。它使用 Wine 来运行 Linux 不能支持的程序。 -Lutris 近期宣布您可以通过它来运行 Epic 游戏商店。 +Lutris 近期宣布你可以通过它来运行 Epic 游戏商店。 ### Lutris 为 Linux 带来了 Epic 游戏 @@ -27,29 +26,27 @@ Lutris 近期宣布您可以通过它来运行 Epic 游戏商店。 [Epic 游戏商城][6] 是一个类似 Steam 的电子游戏分销平台。它目前只支持 Windows 和 macOS。 -Lutris 团队付出了大量努力使 Linux 用户可以通过 Lutris 使用 Epic 游戏商城。虽然我不是一个 Epic 商城的粉丝,但可以通过 Lutris 在 Linux 上运行 Epic 商城终归是个好消息。 +Lutris 团队付出了大量努力使 Linux 用户可以通过 Lutris 使用 Epic 游戏商城。虽然我不用 Epic 商城,但可以通过 Lutris 在 Linux 上运行 Epic 商城终归是个好消息。 -> 好消息! 您现在可以通过 Lutris 安装获得 [@EpicGames][7] 商城在 Linux 下的全功能支持!没有发现任何问题。 [@TimSweeneyEpic][8] 可能会很喜欢 😊 [pic.twitter.com/7mt9fXt7TH][9] +> 好消息! 你现在可以通过 Lutris 安装获得 [@EpicGames][7] 商城在 Linux 下的全功能支持!没有发现任何问题。 [@TimSweeneyEpic][8] 可能会很喜欢 😊 +> +> ![pic.twitter.com/7mt9fXt7TH][9] > > — Lutris Gaming (@LutrisGaming) [April 17, 2019][10] 作为一名狂热的游戏玩家和 Linux 用户,我立即得到了这个消息,并安装了 Lutris 来运行 Epic 游戏。 -**备注:** _我使用来 [Ubuntu 19.04][11] 来测试 Linux 环境下的游戏运行情况。_ +**备注:** 我使用 [Ubuntu 19.04][11] 来测试 Linux 环境下的游戏运行情况。 ### 通过 Lutris 在 Linux 下使用 Epic 游戏商城 -为了在您的 Linux 系统中安装 Epic 游戏商城,请确保您已经安装了 Wine 和 Python 3。接下来,[在 Ubuntu 中安装 Wine][12] ,或任何您正在使用的 Linux 发行版本。然后, [从官方网站下载 Lutris][13]. - -[][14] - -Ubuntu Mate 是 Entroware 笔记本的默认系统。 +为了在你的 Linux 系统中安装 Epic 游戏商城,请确保你已经安装了 Wine 和 Python 3。接下来,[在 Ubuntu 中安装 Wine][12] ,或任何你正在使用的 Linux 发行版本也都可以。然后, [从官方网站下载 Lutris][13]. #### 安装 Epic 游戏商城 -Lutris 安装成功后,可以很方便地启动。 +Lutris 安装成功后,直接启动它。 -当我尝试时,我遇到了一个问题(当我用 GUI 启动时却没有遇到)。不过,当我尝试在命令行输入 “ **lutris** ” 来启动时,我发现了下图所示的错误: +当我尝试时,我遇到了一个问题(当我用 GUI 启动时却没有遇到)。当我尝试在命令行输入 `lutris` 来启动时,我发现了下图所示的错误: ![][15] @@ -63,25 +60,25 @@ export LC_ALL=C 当你遇到同样的问题时,只要你输入这个命令,就能正常启动 Lutris 了。 -**注意**:_每次启动 Lutris 时都必须输入这个命令。因此,最好将其添加到 .bashrc 文件或环境变量列表中。_ +**注意**:每次启动 Lutris 时都必须输入这个命令。因此,最好将其添加到 `.bashrc` 文件或环境变量列表中。 -上述操作完成后,只要启动并搜索 “**Epic Games Store**” 会显示以下图片中的内容: +上述操作完成后,只要启动并搜索 “Epic Games Store” 会显示以下图片中的内容: ![Epic Games Store in Lutris][17] -在这里,我已经安装过了,所以您将会看到“安装”选项,它会自动询问您是否需要安装需要的包。只需要继续操作就可以成功安装。就是这样,不需要任何黑科技。 +在这里,我已经安装过了,所以你将会看到“安装”选项,它会自动询问你是否需要安装需要的包。只需要继续操作就可以成功安装。就是这样,不需要任何黑科技。 #### 玩一款 Epic 游戏商城中的游戏 ![Epic Games Store][18] -现在我们已经通过 Lutris 在 Linux 上安装了 Epic 游戏商城,启动它并登陆您的账号就可以开始了。 +现在我们已经通过 Lutris 在 Linux 上安装了 Epic 游戏商城,启动它并登录你的账号就可以开始了。 但这真会奏效吗? -_是的, Epic 游戏商城可以运行_。 **但是所有游戏都不能玩。** +*是的,Epic 游戏商城可以运行。* **但是所有游戏都不能玩。**(LCTT 译注:莫生气,请看文末的进一步解释!) -我还没有尝试过所有内容,但是我拿了一个免费的游戏(晶体管 —— 一款回合制 ARPG 游戏)来检查它是否有效。 +好吧,我并没有尝试过所有内容,但是我拿了一个免费的游戏(Transistor —— 一款回合制 ARPG 游戏)来检查它是否工作。 ![Transistor – Epic Games Store][19] @@ -89,17 +86,21 @@ _是的, Epic 游戏商城可以运行_。 **但是所有游戏都不能玩。 到目前为止,我还不知道有什么解决方案 —— 所以如果我找到解决方案,我会尽力让你们知道最新情况。 -[][20] - -建议参考 Linux 的新版 Skype 客户端 Alpha 版本来参考。 - -**总结** +### 总结 通过 Lutris 这样的工具使 Linux 的游戏场景得到了改善,这终归是个好消息 。不过,仍有许多工作要做。 -对于在Linux上运行的游戏来说,无障碍运行仍然是一个挑战。其中可能就会有我遇到的这种问题,或者其他类似的。但它正朝着正确的方向发展 —— 即使还存在着一些问题。 +对于在 Linux 上运行的游戏来说,无障碍运行仍然是一个挑战。其中可能就会有我遇到的这种问题,或者其它类似的。但它正朝着正确的方向发展 —— 即使还存在着一些问题。 -你有什么看法吗?你是否也尝试用 Lutris 在 Linux 上启动 Epic 游戏商城?在下方评论让我们看看您的意见。 +你有什么看法吗?你是否也尝试用 Lutris 在 Linux 上启动 Epic 游戏商城?在下方评论让我们看看你的意见。 + +### 补充 + +Transistor 实际上有一个原生的 Linux 移植版。到目前为止,我从 Epic 获得的所有游戏都是如此。所以我会试着压下我的郁闷,而因为 Epic 只让你玩你通过他们的商店/启动器购买的游戏,所以在 Linux 机器上用 Lutris 玩这个原生的 Linux 游戏是不可能的。这简直愚蠢极了。Steam 有一个原生的 Linux 启动器,虽然不是很理想,但它可以工作。GOG 允许你从网站下载购买的内容,可以在你喜欢的任何平台上玩这些游戏。他们的启动器完全是可选的。 + +我对此非常恼火,因为我在我的 Epic 库中的游戏都是可以在我的笔记本电脑上运行得很好的游戏,当我坐在桌面前时,玩起来很有趣。但是因为那台桌面机是我唯一拥有的 Windows 机器…… + +我选择使用 Linux 时已经知道会存在兼容性问题,并且我有一个专门用于游戏的 Windows 机器,而我通过 Epic 获得的游戏都是免费的,所以我在这里只是表示一下不满。但是,他们两个作为最著名的竞争对手,Epic 应该有在我的 Linux 机器上玩原生 Linux 移植版的机制。 -------------------------------------------------------------------------------- @@ -108,21 +109,21 @@ via: https://itsfoss.com/epic-games-lutris-linux/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[Modrisco](https://github.com/Modrisco) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://itsfoss.com/author/ankush/ [b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/linux-gaming-guide/ -[2]: https://itsfoss.com/steam-play/ -[3]: https://itsfoss.com/steam-play-proton/ +[1]: https://linux.cn/article-7316-1.html +[2]: https://linux.cn/article-10061-1.html +[3]: https://linux.cn/article-10054-1.html [4]: https://lutris.net/ [5]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-lutris-linux-800x450.png [6]: https://www.epicgames.com/store/en-US/ [7]: https://twitter.com/EpicGames?ref_src=twsrc%5Etfw [8]: https://twitter.com/TimSweeneyEpic?ref_src=twsrc%5Etfw -[9]: https://t.co/7mt9fXt7TH +[9]: https://pbs.twimg.com/media/D4XkXafX4AARDkW?format=jpg&name=medium [10]: https://twitter.com/LutrisGaming/status/1118552969816018948?ref_src=twsrc%5Etfw [11]: https://itsfoss.com/ubuntu-19-04-release-features/ [12]: https://itsfoss.com/install-latest-wine/ From 2282e2428fffaea125571d6e282b37cbebf4d055 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 12 Jun 2019 14:50:01 +0800 Subject: [PATCH 0882/1154] PUB:20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md @Modrisco https://linux.cn/article-10968-1.html --- ... Games Store is Now Available on Linux Thanks to Lutris.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md (99%) diff --git a/translated/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md b/published/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md similarity index 99% rename from translated/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md rename to published/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md index ba67339421..419ad7303b 100644 --- a/translated/tech/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md +++ b/published/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Modrisco) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10968-1.html) [#]: subject: (Epic Games Store is Now Available on Linux Thanks to Lutris) [#]: via: (https://itsfoss.com/epic-games-lutris-linux/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 2510dd4ed7a69dd457d0e0da0d0a3c32404bb5cd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 12 Jun 2019 16:53:02 +0800 Subject: [PATCH 0883/1154] APL:20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer --- ... Real-Time Web Server Log Analyzer And Interactive Viewer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md b/sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md index 3bad5ba969..4f0be1faa8 100644 --- a/sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md +++ b/sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 747414ae9b63fb7297119abd7eb9a7bb7227fc97 Mon Sep 17 00:00:00 2001 From: chen ni Date: Wed, 12 Jun 2019 17:00:53 +0800 Subject: [PATCH 0884/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 我的第三篇翻译,也是第一篇 tech,选了一个感兴趣的话题 :) --- .../20190517 10 Places Where You Can Buy Linux Computers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md b/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md index 36e3a0972b..7212522646 100644 --- a/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md +++ b/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chen-ni) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e1bdd1db5159592ce15f8d57d2dcb34d2263b806 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 12 Jun 2019 21:19:54 +0800 Subject: [PATCH 0885/1154] translate done: 20180831 Get desktop notifications from Emacs shell commands .md --- ...notifications from Emacs shell commands .md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) rename {sources => translated}/tech/20180831 Get desktop notifications from Emacs shell commands .md (68%) diff --git a/sources/tech/20180831 Get desktop notifications from Emacs shell commands .md b/translated/tech/20180831 Get desktop notifications from Emacs shell commands .md similarity index 68% rename from sources/tech/20180831 Get desktop notifications from Emacs shell commands .md rename to translated/tech/20180831 Get desktop notifications from Emacs shell commands .md index 7d04e6d0a7..b0ef5dd76f 100644 --- a/sources/tech/20180831 Get desktop notifications from Emacs shell commands .md +++ b/translated/tech/20180831 Get desktop notifications from Emacs shell commands .md @@ -7,15 +7,16 @@ [#]: via: (https://blog.hoetzel.info/post/eshell-notifications/) [#]: author: (Jürgen Hötzel https://blog.hoetzel.info) -Get desktop notifications from Emacs shell commands · +让 Emacs shell 命令发送桌面通知 ====== -When interacting with the operating systems I always use [Eshell][1] because it integrates seamlessly with Emacs, supports (remote) [TRAMP][2] file names and also works nice on Windows. -After starting shell commands (like long running build jobs) I often lose track the task when switching buffers. +我总是使用 [Eshell][1] 来与操作系统进行交互,因为它与 Emacs 无缝整合、支持处理 (远程) [TRAMP][2] 文件 而且在 Windows 上也能工作得很好。 -Thanks to Emacs [hooks][3] mechanism you can customize Emacs to call a elisp function when an external command finishes. +启动 shell 命令后 (比如耗时严重的构建任务) 我经常会由于切换 buffer 而忘了追踪任务的运行状态。 -I use [John Wiegleys][4] excellent [alert][5] package to send desktop notifications: +多亏了 Emacs 的 [hooks][3] 机制,你可以配置 Emacs 在某个外部命令完成后调用一个 elisp 函数。 + +我使用 [John Wiegleys][4] 所编写的超棒的 [alert][5] 包来发送桌面通知: ``` (require 'alert) @@ -32,7 +33,7 @@ I use [John Wiegleys][4] excellent [alert][5] package to send desktop notificati (add-hook 'eshell-kill-hook #'eshell-command-alert) ``` -[alert][5] rules can be setup programmatically. In my case I only want to get notified if the corresponding buffer is not visible: +[alert][5] 的规则可以用程序来设置。就我这个情况来看,我只需要当对应的 buffer 不可见时被通知: ``` (alert-add-rule :status '(buried) ;only send alert when buffer not visible @@ -40,9 +41,10 @@ I use [John Wiegleys][4] excellent [alert][5] package to send desktop notificati :style 'notifications) ``` -This even works on [TRAMP][2] buffers. Below is a screenshot showing a Gnome desktop notification of a failed `make` command. -![../../img/eshell.png][6] +这甚至对于 [TRAMP][2] 也一样生效。下面这个截屏展示了失败的 `make` 命令产生的 Gnome 桌面通知。 + +![。./。./img/eshell.png][6] -------------------------------------------------------------------------------- From 0be2771d2b6bfb7cc1287b226c4fc4f6ecd3a145 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 12 Jun 2019 21:39:34 +0800 Subject: [PATCH 0886/1154] TSL:20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md --- ...ver Log Analyzer And Interactive Viewer.md | 187 ------------------ ...ver Log Analyzer And Interactive Viewer.md | 176 +++++++++++++++++ 2 files changed, 176 insertions(+), 187 deletions(-) delete mode 100644 sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md create mode 100644 translated/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md diff --git a/sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md b/sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md deleted file mode 100644 index 4f0be1faa8..0000000000 --- a/sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md +++ /dev/null @@ -1,187 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (GoAccess – A Real-Time Web Server Log Analyzer And Interactive Viewer) -[#]: via: (https://www.2daygeek.com/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer/) -[#]: author: (Vinoth Kumar https://www.2daygeek.com/author/vinoth/) - -GoAccess – A Real-Time Web Server Log Analyzer And Interactive Viewer -====== - -Analyzing a log file is a big headache for Linux administrators as it’s capturing a lot of things. - -Most of the newbies and L1 administrators doesn’t know how to analyze this. - -If you have good knowledge to analyze a logs then you will be a legend for NIX system. - -There are many tools available in Linux to analyze the logs easily. - -GoAccess is one of the tool which allow users to analyze web server logs easily. - -We will be going to discuss in details about GoAccess tool in this article. - -### What is GoAccess? - -GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser. - -GoAccess has minimal requirements, it’s written in C and requires only ncurses. - -It will support Apache, Nginx and Lighttpd logs. It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly. - -GoAccess parses the specified web log file and outputs the data to the X terminal and browser. - -GoAccess was designed to be a fast, terminal-based log analyzer. Its core idea is to quickly analyze and view web server statistics in real time without needing to use your browser. - -Terminal output is the default output, it has the capability to generate a complete, self-contained, real-time HTML report, as well as a JSON, and CSV report. - -GoAccess allows any custom log format and the following (Combined Log Format (XLF/ELF) Apache | Nginx & Common Log Format (CLF) Apache) predefined log format options are included, but not limited to. - -### GoAccess Features - - * **`Completely Real Time:`** All the metrics are updated every 200 ms on the terminal and every second on the HTML output. - * **`Track Application Response Time:`** Track the time taken to serve the request. Extremely useful if you want to track pages that are slowing down your site. - * **`Visitors:`** Determine the amount of hits, visitors, bandwidth, and metrics for slowest running requests by the hour, or date. - * **`Metrics per Virtual Host:`** Have multiple Virtual Hosts (Server Blocks)? It features a panel that displays which virtual host is consuming most of the web server resources. - - - -### How to Install GoAccess? - -I would advise users to install GoAccess from distribution official repository with help of Package Manager. It is available in most of the distributions official repository. - -As we know, we will be getting bit outdated package for standard release distribution and rolling release distributions always include latest package. - -If you are running the OS with standard release distributions, i would suggest you to check the alternative options such as PPA or Official GoAccess maintainer repository, etc, to get a latest package. - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][1]** or **[APT Command][2]** to install GoAccess on your systems. - -``` -# apt install goaccess -``` - -To get a latest GoAccess package, use the below GoAccess official repository. - -``` -$ echo "deb https://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list -$ wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key add - -$ sudo apt-get update -$ sudo apt-get install goaccess -``` - -For **`RHEL/CentOS`** systems, use **[YUM Package Manager][3]** to install GoAccess on your systems. - -``` -# yum install goaccess -``` - -For **`Fedora`** system, use **[DNF Package Manager][4]** to install GoAccess on your system. - -``` -# dnf install goaccess -``` - -For **`ArchLinux/Manjaro`** based systems, use **[Pacman Package Manager][5]** to install GoAccess on your systems. - -``` -# pacman -S goaccess -``` - -For **`openSUSE Leap`** system, use **[Zypper Package Manager][6]** to install GoAccess on your system. - -``` -# zypper install goaccess - -# zypper ar -f obs://server:http - -# zypper ref && zypper in goaccess -``` - -### How to Use GoAccess? - -After successful installation of GoAccess. Just enter the goaccess command and followed by the web server log location to view it. - -``` -# goaccess [options] /path/to/Web Server/access.log - -# goaccess /var/log/apache/2daygeek_access.log -``` - -When you execute the above command, it will ask you to select the **Log Format Configuration**. -![][8] - -I had tested this with Apache access log. The Apache log is splitted in fifteen section. The details are below. The main section shows the summary about the fifteen section. - -The below screenshots included four sessions such as Unique Visitors, Requested files, Static Requests, Not found URLs. -![][9] - -The below screenshots included four sessions such as Visitor Hostnames and IPs, Operating Systems, Browsers, Time Distribution. -![][10] - -The below screenshots included four sessions such as Referrers URLs, Referring Sites, Google’s search engine results, HTTP status codes. -![][11] - -If you would like to generate a html report, use the following format. - -Initially i got an error when i was trying to generate the html report. - -``` -# goaccess 2daygeek_access.log -a > report.html - -GoAccess - version 1.3 - Nov 23 2018 11:28:19 -Config file: No config file used - -Fatal error has occurred -Error occurred at: src/parser.c - parse_log - 2764 -No time format was found on your conf file.Parsing... [0] [0/s] -``` - -It says “No time format was found on your conf file”. To overcome this issue, add the “COMBINED” log format option on it. - -``` -# goaccess -f 2daygeek_access.log --log-format=COMBINED -o 2daygeek.html -Parsing...[0,165] [50,165/s] -``` - -![][12] - -GoAccess allows you to access and analyze the real-time log filtering and parsing. - -``` -# tail -f /var/log/apache/2daygeek_access.log | goaccess - -``` - -For more details navigate to man or help page. - -``` -# man goaccess -or -# goaccess --help -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer/ - -作者:[Vinoth Kumar][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.2daygeek.com/author/vinoth/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[6]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ -[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[8]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-1.png -[9]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-2.png -[10]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-3.png -[11]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-4.png -[12]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-5.png diff --git a/translated/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md b/translated/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md new file mode 100644 index 0000000000..82e1851731 --- /dev/null +++ b/translated/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md @@ -0,0 +1,176 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (GoAccess – A Real-Time Web Server Log Analyzer And Interactive Viewer) +[#]: via: (https://www.2daygeek.com/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer/) +[#]: author: (Vinoth Kumar https://www.2daygeek.com/author/vinoth/) + +GoAccess:一个实时 Web 服务器日志分析器及交互式查看器 +====== + +分析日志文件对于 Linux 管理员来说是一件非常令人头疼的事情,因为它记录了很多东西。大多数新手和初级管理员都不知道如何分析。如果你在分析日志方面拥有很多知识,那么你成为了 *NIX 系统高手。 + +Linux 中有许多工具可以轻松分析日志。GoAccess 是允许用户轻松分析 Web 服务器日志的工具之一。我们将在本文中详细讨论 GoAccess 工具。 + +### GoAccess + +GoAccess 是一个实时网络日志分析器和交互式查看器,可以在 *nix 系统中的终端或通过浏览器访问。 + +GoAccess 需要的依赖很低,它是用 C 语言编写的,只需要 ncurses。 + +它支持 Apache、Nginx 和 Lighttpd 日志。它为需要动态可视化服务器报告的系统管理员即时提供了快速且有价值的 HTTP 统计信息。 + +GoAccess 可以解析指定的 Web 日志文件并将数据输出到 X 终端和浏览器。 + +GoAccess 被设计成一个基于终端的快速日志分析器。其核心思想是实时快速分析和查看 Web 服务器统计信息,而无需使用浏览器。 + +默认输出是终端输出,它能够生成完整的、自包含的实时 HTML 报告,以及 JSON 和 CSV 报告。 + +GoAccess 支持任何自定义日志格式,并包含以下预定义日志格式选项:Apache、Nginx 中的组合日志格式 XLF/ELF,Apache 中的通用日志格式 CLF,但不限于此。 + +### GoAccess 功能 + +* 完全实时:所有指标在终端上每 200 毫秒更新一次,在 HTML 输出上每秒更新一次。 +* 跟踪应用程序响应时间:跟踪服务请求所需的时间。如果你想跟踪减慢了网站速度的网页,则非常有用。 +* 访问者:按小时或日期确定最慢运行请求的点击量、访问者数、带宽数和指标数。 +* 按虚拟主机的度量标准:如果有多个虚拟主机( Server 块),它提供了一个面板,可显示哪些虚拟主机正在消耗大部分 Web 服务器资源。 + +### 如何安装 GoAccess? + +我建议用户在包管理器的帮助下从发行版官方的存储库安装 GoAccess。它在大多数发行版官方存储库中都可用。 + +我们知道,我们在标准发行方式的发行版中得到的是过时的软件包,而滚动发行的发行版总是包含最新的软件包。 + +如果你使用标准发行方式的发行版运行操作系统,我建议你检查替代选项,如 PPA 或 GoAccess 官方维护者存储库等,以获取最新的软件包。 + +对于 Debian / Ubuntu 系统,使用 [APT-GET 命令][1]或[APT 命令][2]在你的系统上安装 GoAccess。 + +``` +# apt install goaccess +``` + +要获取最新的 GoAccess 包,请使用以下 GoAccess 官方存储库。 + +``` +$ echo "deb https://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list +$ wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key add - +$ sudo apt-get update +$ sudo apt-get install goaccess +``` + +对于 RHEL / CentOS 系统,使用 [YUM 包管理器][3]在你的系统上安装 GoAccess。 + +``` +# yum install goaccess +``` + +对于 Fedora 系统,使用 [DNF 包管理器][4]在你的系统上安装 GoAccess。 + +``` +# dnf install goaccess +``` + +对于基于 ArchLinux / Manjaro 的系统,使用 [Pacman 包管理器][5]在你的系统上安装 GoAccess。 + +``` +# pacman -S goaccess +``` + +对于 openSUSE Leap 系统,使用[Zypper 包管理器][6]在你的系统上安装 GoAccess。 + +``` +# zypper install goaccess +# zypper ar -f obs://server:http +# zypper ref && zypper in goaccess +``` + +### 如何使用 GoAccess? + +成功安装 GoAccess 后。只需输入 `goaccess` 命令,然后输入 Web 服务器日志位置即可查看。 + +``` +# goaccess [options] /path/to/Web Server/access.log +# goaccess /var/log/apache/2daygeek_access.log +``` + +执行上述命令时,它会要求您选择日志格式配置。 + +![][8] + +我用 Apache 访问日志对此进行了测试。Apache 日志被分为十五部分。详情如下。主要部分显示了这十五部分的摘要。 + +以下屏幕截图包括四个会话,例如唯一身份访问者、请求的文件、静态请求、未找到的网址。 + +![][10] + +以下屏幕截图包括四个会话,例如访客主机名和 IP、操作系统、浏览器、时间分布。 + +![][10] + +以下屏幕截图包括四个会话,例如来源网址、来源网站,Google 的搜索引擎结果、HTTP状态代码。 + +![][11] + +如果要生成 html 报告,请使用以下格式。最初我在尝试生成 html 报告时遇到错误。 + +``` +# goaccess 2daygeek_access.log -a > report.html + +GoAccess - version 1.3 - Nov 23 2018 11:28:19 +Config file: No config file used + +Fatal error has occurred +Error occurred at: src/parser.c - parse_log - 2764 +No time format was found on your conf file.Parsing... [0] [0/s] +``` + +它说“你的 conf 文件没有找到时间格式”。要解决此问题,请为其添加 “COMBINED” 日志格式选项。 + +``` +# goaccess -f 2daygeek_access.log --log-format=COMBINED -o 2daygeek.html +Parsing...[0,165] [50,165/s] +``` + +![][12] + +GoAccess 允许你访问和分析实时日志并进行过滤和解析。 + +``` +# tail -f /var/log/apache/2daygeek_access.log | goaccess - +``` + +更多细节请参考其 man 手册页或帮助。 + +``` +# man goaccess +或 +# goaccess --help +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer/ + +作者:[Vinoth Kumar][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/vinoth/ +[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/ +[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[6]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[8]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-1.png +[9]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-2.png +[10]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-3.png +[11]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-4.png +[12]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-5.png From bfbb0495be4c2b7e2dec7d7fdf46dde7a475de48 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 12 Jun 2019 22:39:45 +0800 Subject: [PATCH 0887/1154] PRF&PUB:20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md @wxy https://linux.cn/article-10969-1.html --- ...ver Log Analyzer And Interactive Viewer.md | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) rename {translated/tech => published}/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md (78%) diff --git a/translated/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md b/published/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md similarity index 78% rename from translated/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md rename to published/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md index 82e1851731..48d7ca0474 100644 --- a/translated/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md +++ b/published/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md @@ -1,24 +1,26 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10969-1.html) [#]: subject: (GoAccess – A Real-Time Web Server Log Analyzer And Interactive Viewer) [#]: via: (https://www.2daygeek.com/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer/) [#]: author: (Vinoth Kumar https://www.2daygeek.com/author/vinoth/) -GoAccess:一个实时 Web 服务器日志分析器及交互式查看器 +GoAccess:一个实时的 Web 日志分析器及交互式查看器 ====== -分析日志文件对于 Linux 管理员来说是一件非常令人头疼的事情,因为它记录了很多东西。大多数新手和初级管理员都不知道如何分析。如果你在分析日志方面拥有很多知识,那么你成为了 *NIX 系统高手。 +![](https://img.linux.net.cn/data/attachment/album/201906/12/222616h80pl0k0tt811071.jpg) + +分析日志文件对于 Linux 管理员来说是一件非常令人头疼的事情,因为它记录了很多东西。大多数新手和初级管理员都不知道如何分析。如果你在分析日志方面拥有很多知识,那么你就成了 *NIX 系统高手。 Linux 中有许多工具可以轻松分析日志。GoAccess 是允许用户轻松分析 Web 服务器日志的工具之一。我们将在本文中详细讨论 GoAccess 工具。 ### GoAccess -GoAccess 是一个实时网络日志分析器和交互式查看器,可以在 *nix 系统中的终端或通过浏览器访问。 +GoAccess 是一个实时 Web 日志分析器和交互式查看器,可以在 *nix 系统中的终端运行或通过浏览器访问。 -GoAccess 需要的依赖很低,它是用 C 语言编写的,只需要 ncurses。 +GoAccess 需要的依赖极少,它是用 C 语言编写的,只需要 ncurses。 它支持 Apache、Nginx 和 Lighttpd 日志。它为需要动态可视化服务器报告的系统管理员即时提供了快速且有价值的 HTTP 统计信息。 @@ -26,26 +28,26 @@ GoAccess 可以解析指定的 Web 日志文件并将数据输出到 X 终端和 GoAccess 被设计成一个基于终端的快速日志分析器。其核心思想是实时快速分析和查看 Web 服务器统计信息,而无需使用浏览器。 -默认输出是终端输出,它能够生成完整的、自包含的实时 HTML 报告,以及 JSON 和 CSV 报告。 +默认输出是在终端输出,它也能够生成完整的、自包含的实时 HTML 报告,以及 JSON 和 CSV 报告。 -GoAccess 支持任何自定义日志格式,并包含以下预定义日志格式选项:Apache、Nginx 中的组合日志格式 XLF/ELF,Apache 中的通用日志格式 CLF,但不限于此。 +GoAccess 支持任何自定义日志格式,并包含以下预定义日志格式选项:Apache/Nginx 中的组合日志格式 XLF/ELF,Apache 中的通用日志格式 CLF,但不限于此。 ### GoAccess 功能 * 完全实时:所有指标在终端上每 200 毫秒更新一次,在 HTML 输出上每秒更新一次。 * 跟踪应用程序响应时间:跟踪服务请求所需的时间。如果你想跟踪减慢了网站速度的网页,则非常有用。 -* 访问者:按小时或日期确定最慢运行请求的点击量、访问者数、带宽数和指标数。 -* 按虚拟主机的度量标准:如果有多个虚拟主机( Server 块),它提供了一个面板,可显示哪些虚拟主机正在消耗大部分 Web 服务器资源。 +* 访问者:按小时或日期确定最慢运行的请求的点击量、访问者数、带宽数和指标。 +* 按虚拟主机的度量标准:如果有多个虚拟主机(`Server`),它提供了一个面板,可显示哪些虚拟主机正在消耗大部分 Web 服务器资源。 ### 如何安装 GoAccess? 我建议用户在包管理器的帮助下从发行版官方的存储库安装 GoAccess。它在大多数发行版官方存储库中都可用。 -我们知道,我们在标准发行方式的发行版中得到的是过时的软件包,而滚动发行的发行版总是包含最新的软件包。 +我们知道,我们在标准发行方式的发行版中得到的是过时的软件包,而滚动发行方式的发行版总是包含最新的软件包。 如果你使用标准发行方式的发行版运行操作系统,我建议你检查替代选项,如 PPA 或 GoAccess 官方维护者存储库等,以获取最新的软件包。 -对于 Debian / Ubuntu 系统,使用 [APT-GET 命令][1]或[APT 命令][2]在你的系统上安装 GoAccess。 +对于 Debian / Ubuntu 系统,使用 [APT-GET 命令][1]或 [APT 命令][2]在你的系统上安装 GoAccess。 ``` # apt install goaccess @@ -99,21 +101,21 @@ $ sudo apt-get install goaccess ![][8] -我用 Apache 访问日志对此进行了测试。Apache 日志被分为十五部分。详情如下。主要部分显示了这十五部分的摘要。 +我用 Apache 访问日志对此进行了测试。Apache 日志被分为十五个部分。详情如下。主要部分显示了这十五个部分的摘要。 -以下屏幕截图包括四个会话,例如唯一身份访问者、请求的文件、静态请求、未找到的网址。 +以下屏幕截图包括四个部分,例如唯一身份访问者、请求的文件、静态请求、未找到的网址。 ![][10] -以下屏幕截图包括四个会话,例如访客主机名和 IP、操作系统、浏览器、时间分布。 +以下屏幕截图包括四个部分,例如访客主机名和 IP、操作系统、浏览器、时间分布。 ![][10] -以下屏幕截图包括四个会话,例如来源网址、来源网站,Google 的搜索引擎结果、HTTP状态代码。 +以下屏幕截图包括四个部分,例如来源网址、来源网站,Google 的搜索引擎结果、HTTP状态代码。 ![][11] -如果要生成 html 报告,请使用以下格式。最初我在尝试生成 html 报告时遇到错误。 +如果要生成 html 报告,请使用以下命令。最初我在尝试生成 html 报告时遇到错误。 ``` # goaccess 2daygeek_access.log -a > report.html @@ -135,7 +137,7 @@ Parsing...[0,165] [50,165/s] ![][12] -GoAccess 允许你访问和分析实时日志并进行过滤和解析。 +GoAccess 也允许你访问和分析实时日志并进行过滤和解析。 ``` # tail -f /var/log/apache/2daygeek_access.log | goaccess - @@ -156,7 +158,7 @@ via: https://www.2daygeek.com/goaccess-a-real-time-web-server-log-analyzer-and-i 作者:[Vinoth Kumar][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f94339384b84e265f68e7c277ea51d10877abbee Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 13 Jun 2019 08:55:31 +0800 Subject: [PATCH 0888/1154] translated --- .../20190607 5 reasons to use Kubernetes.md | 67 ------------------- .../20190607 5 reasons to use Kubernetes.md | 66 ++++++++++++++++++ 2 files changed, 66 insertions(+), 67 deletions(-) delete mode 100644 sources/tech/20190607 5 reasons to use Kubernetes.md create mode 100644 translated/tech/20190607 5 reasons to use Kubernetes.md diff --git a/sources/tech/20190607 5 reasons to use Kubernetes.md b/sources/tech/20190607 5 reasons to use Kubernetes.md deleted file mode 100644 index a8991c05df..0000000000 --- a/sources/tech/20190607 5 reasons to use Kubernetes.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 reasons to use Kubernetes) -[#]: via: (https://opensource.com/article/19/6/reasons-kubernetes) -[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) - -5 reasons to use Kubernetes -====== -Kubernetes solves some of the most common problems development and -operations teams see every day. -![][1] - -[Kubernetes][2] is the de facto open source container orchestration tool for enterprises. It provides application deployment, scaling, container management, and other capabilities, and it enables enterprises to optimize hardware resource utilization and increase production uptime through fault-tolerant functionality at speed. The project was initially developed by Google, which donated the project to the [Cloud-Native Computing Foundation][3]. In 2018, it became the first CNCF project to [graduate][4]. - -This is all well and good, but it doesn't explain why development and operations should invest their valuable time and effort in Kubernetes. The reason Kubernetes is so useful is that it helps dev and ops quickly solve the problems they struggle with every day. - -Following are five ways Kubernetes' capabilities help dev and ops professionals address their most common problems. - -### 1\. Vendor-agnostic - -Many public cloud providers not only serve managed Kubernetes services but also lots of cloud products built on top of those services for on-premises application container orchestration. Being vendor-agnostic enables operators to design, build, and manage multi-cloud and hybrid cloud platforms easily and safely without risk of vendor lock-in. Kubernetes also eliminates the ops team's worries about a complex multi/hybrid cloud strategy. - -### 2\. Service discovery - -To develop microservices applications, Java developers must control service availability (in terms of whether the application is ready to serve a function) and ensure the service continues living, without any exceptions, in response to the client's requests. Kubernetes' [service discovery feature][5] means developers don't have to manage these things on their own anymore. - -### 3\. Invocation - -How would your DevOps initiative deploy polyglot, cloud-native apps over thousands of virtual machines? Ideally, dev and ops could trigger deployments for bug fixes, function enhancements, new features, and security patches. Kubernetes' [deployment feature][6] automates this daily work. More importantly, it enables advanced deployment strategies, such as [blue-green and canary][7] deployments. - -### 4\. Elasticity - -Autoscaling is the key capability needed to handle massive workloads in cloud environments. By building a container platform, you can increase system reliability for end users. [Kubernetes Horizontal Pod Autoscaler][8] (HPA) allows a cluster to increase or decrease the number of applications (or Pods) to deal with peak traffic or performance spikes, reducing concerns about unexpected system outages. - -### 5\. Resilience - -In a modern application architecture, failure-handling codes should be considered to control unexpected errors and recover from them quickly. But it takes a lot of time and effort for developers to simulate all the occasional errors. Kubernetes' [ReplicaSet][9] helps developers solve this problem by ensuring a specified number of Pods are kept alive continuously. - -### Conclusion - -Kubernetes enables enterprises to solve common dev and ops problems easily, quickly, and safely. It also provides other benefits, such as building a seamless multi/hybrid cloud strategy, saving infrastructure costs, and speeding time to market. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/6/reasons-kubernetes - -作者:[Daniel Oh][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/daniel-oh -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_wheel_gear_devops_kubernetes.png?itok=xm4a74Kv -[2]: https://opensource.com/resources/what-is-kubernetes -[3]: https://www.cncf.io/projects/ -[4]: https://www.cncf.io/blog/2018/03/06/kubernetes-first-cncf-project-graduate/ -[5]: https://kubernetes.io/docs/concepts/services-networking/service/ -[6]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ -[7]: https://opensource.com/article/17/5/colorful-deployments -[8]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ -[9]: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ diff --git a/translated/tech/20190607 5 reasons to use Kubernetes.md b/translated/tech/20190607 5 reasons to use Kubernetes.md new file mode 100644 index 0000000000..d34c57ce16 --- /dev/null +++ b/translated/tech/20190607 5 reasons to use Kubernetes.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 reasons to use Kubernetes) +[#]: via: (https://opensource.com/article/19/6/reasons-kubernetes) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) + +使用 Kubernetes 的 5 个理由 +====== +Kubernetes 解决了一些开发和运维团队每天关注的的常见问题。 +![][1] + +[Kubernetes][2] 是企业事实上的开源容器编排工具。它提供了应用部署、扩展、容器管理和其他功能,使企业能够通过容错能力快速优化硬件资源利用率并延长生产环境运行时间。该项目最初由谷歌开发,并将该项目捐赠给[云原生计算基金会][3]。2018年,它成为第一个从 CNCF [毕业][4]的项目。 + +这一切都很好,但它并不能解释为什么开发和运维应该在 Kubernetes 上投入宝贵的时间和精力。Kubernetes 之所以如此有用,是因为它有助于开发者和运维人员迅速解决他们每天都在努力解决的问题。 + +以下是 Kubernetes 帮助开发者和运维人员解决他们最常见问题的五种能力。 + +### 1\. 厂商无关 + +许多公有云提供商不仅提供托管 Kubernetes 服务,还提供许多基于这些服务构建的云产品,来用于本地应用容器编排。由于与供应商无关,使运营商能够轻松、安全地设计、构建和管理多云和混合云平台,而不会有供应商锁定的风险。Kubernetes 还消除了运维团队对复杂的多云/混合云战略的担忧。 + +### 2\. 服务发现 + +为了开发微服务应用,Java 开发人员必须控制服务可用性(就应用是否可以提供服务而言),并确保服务持续存在,而没有任何例外,以响应客户端的请求。Kubernetes 的[服务发现功能][5]意味着开发人员不再需要自己管理这些东西。 + +### 3\. 触发 + +你的 DevOps 会如何在上千台虚拟机上部署多语言、云原生应用?理想情况下啊,开发和运维会在 bug 修复、功能增强、新功能、安全更新时触发部署。Kubernetes 的[部署功能][6]会自动化这个每日工作。更重要的时,它支持高级部署策略,例如[蓝绿部署和金丝雀部署][7]。 + +### 4\. 可伸缩性 + +自动扩展是处理云环境中大量工作负载所需的关键功能。通过构建容器平台,你可以为终端用户提高系统可靠性。[Kubernetes Horizo​​ntal Pod Autoscaler][8](HPA)允许一个集群增加或减少应用程序(或 Pod)的数量,以应对峰值流量或性能峰值,从而减少对意外系统中断的担忧。 + +### 5\. 容错性 + +在现代应用体系结构中,应考虑故障处理代码来控制意外错误并快速从中恢复。但是开发人员需要花费大量的时间和精力来模拟偶然的错误。Kubernetes 的 [ReplicaSet][9] 通过确保指定数量的 Pod 持续保持活动来帮助开发人员解决此问题。 + +### 结论 + +Kubernetes 使企业能够轻松、快速、安全地解决常见的开发和运维问题。它还提供其他好处,例如构建无缝的多云/混合云战略,节省基础架构成本以及加快产品上市时间。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/reasons-kubernetes + +作者:[Daniel Oh][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/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_wheel_gear_devops_kubernetes.png?itok=xm4a74Kv +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://www.cncf.io/projects/ +[4]: https://www.cncf.io/blog/2018/03/06/kubernetes-first-cncf-project-graduate/ +[5]: https://kubernetes.io/docs/concepts/services-networking/service/ +[6]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[7]: https://opensource.com/article/17/5/colorful-deployments +[8]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ +[9]: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ From 6de07b1b2804291fc7693f00266ee9e844dfe54e Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 13 Jun 2019 09:00:32 +0800 Subject: [PATCH 0889/1154] tranlsating --- ...90610 Expand And Unexpand Commands Tutorial With Examples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md b/sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md index 01def369ed..2ba0e242ef 100644 --- a/sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md +++ b/sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 71619649a5a3a8871516804b19a5fdc22cdaa8c6 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 13 Jun 2019 12:10:49 +0800 Subject: [PATCH 0890/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190521=20I=20?= =?UTF-8?q?don't=20know=20how=20CPUs=20work=20so=20I=20simulated=20one=20i?= =?UTF-8?q?n=20code=20sources/tech/20190521=20I=20don-t=20know=20how=20CPU?= =?UTF-8?q?s=20work=20so=20I=20simulated=20one=20in=20code.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow CPUs work so I simulated one in code.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20190521 I don-t know how CPUs work so I simulated one in code.md diff --git a/sources/tech/20190521 I don-t know how CPUs work so I simulated one in code.md b/sources/tech/20190521 I don-t know how CPUs work so I simulated one in code.md new file mode 100644 index 0000000000..3b9be98d2f --- /dev/null +++ b/sources/tech/20190521 I don-t know how CPUs work so I simulated one in code.md @@ -0,0 +1,174 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (I don't know how CPUs work so I simulated one in code) +[#]: via: (https://djhworld.github.io/post/2019/05/21/i-dont-know-how-cpus-work-so-i-simulated-one-in-code/) +[#]: author: (daniel harper https://djhworld.github.io) + +I don't know how CPUs work so I simulated one in code +====== + +![][1] + +A few months ago it dawned on me that I didn’t really understand how computers work under the hood. I still don’t understand how modern computers work. + +However, after making my way through [But How Do It Know?][2] by J. Clark Scott, a book which describes the bits of a simple 8-bit computer from the NAND gates, through to the registers, RAM, bits of the CPU, ALU and I/O, I got a hankering to implement it in code. + +While I’m not that interested in the physics of the circuitry, the book just about skims the surface of those waters and gives a neat overview of the wiring and how bits move around the system without the requisite electrical engineering knowledge. For me though I can’t get comfortable with book descriptions, I have to see things in action and learn from my inevitable mistakes, which led me to chart a course on the rough seas of writing a circuit in code and getting a bit weepy about it. + +The fruits of my voyage can be seen in [simple-computer][3]; a simple computer that’s simple and computes things. + +[![][4]][5] [![][6]][7] [![][8]][9] +Example programs + +It is quite a neat little thing, the CPU code is implemented [as a horrific splurge of gates turning on and off][10] but it works, I’ve [unit tested it][11], and we all know unit tests are irrefutable proof that something works. + +It handles [keyboard inputs][12], and renders text [to a display][13] using a painstakingly crafted set of glyphs for a professional font I’ve named “Daniel Code Pro”. The only cheat bit is to get the keyboard input and display output working I had to hook up go channels to speak to the outside world via [GLFW][14], but the rest of it is a simulated circuit. + +I even wrote a [crude assembler][15] which was eye opening to say the least. It’s not perfect. Actually it’s a bit crap, but it highlighted to me the problems that other people have already solved many, many years ago and I think I’m a better person for it. Or worse, depending who you ask. + +### But why you do that? + +> “I’ve seen thirteen year old children do this in Minecraft, come back to me when you’ve built a REAL CPU out of telegraph relays” + +My mental model of computing is stuck in beginner computer science textbooks, and the CPU that powers the [gameboy emulator I wrote back in 2013][16] is really nothing like the CPUs that are running today. Even saying that, the emulator is just a state machine, it doesn’t describe the stuff at the logic gate level. You can implement most of it using just a `switch` statement and storing the state of the registers. + +So I’m trying to get a better understanding of this stuff because I don’t know what L1/L2 caches are, I don’t know what pipelining means, I’m not entirely sure I understand the Meltdown and Spectre vulnerability papers. Someone told me they were optimising their code to make use of CPU caches, I don’t know how to verify that other than taking their word for it. I’m not really sure what all the x86 instructions mean. I don’t understand how people off-load work to a GPU or TPU. I don’t know what a TPU is. I don’t know how to make use of SIMD instructions. + +But all that is built on a foundation of knowledge you need to earn your stripes for, so I ain’t gonna get there without reading the map first. Which means getting back to basics and getting my hands dirty with something simple. The “Scott Computer” described in the book is simple. That’s the reason. + +### Great Scott! It’s alive! + +The Scott computer is an 8-bit processor attached to 256 bytes of RAM, all connected via an 8-bit system bus. It has 4 general purpose registers and can execute [17 machine instructions][17]. Someone built a visual simulator [for the web here][18], which is really cool, I dread to think how long it took to track all the wiring states! + +[![][19]][20] +A diagram outlining all the components that make up the Scott CPU +Copyright © 2009 - 2016 by Siegbert Filbinger and John Clark Scott. + +The book takes you on a journey from the humble NAND gate, onto a Bit of memory, onto a register and then keeps layering on components until you end up with something resembling the above. I really recommend reading it, even if you are already familiar with the concepts because it’s quite a good overview. I don’t recommend the Kindle version though because the diagrams are sometimes hard to zoom in and decipher on a screen. A perennial problem for the Kindle in my experience. + +The only thing that’s different about my computer is I upgraded it to 16-bit to have more memory to play with, as storing even just the glyphs for the [ASCII table][21] would have dwarfed most of the 8-bit machine described in the book, with not much room left for useful code. + +### My development journey + +During development it really was just a case of reading the text, scouring the diagrams and then attempting to translate that using a general purpose programming language code and definitely not using something that’s designed for integrated circuit development. The reason why I wrote it in Go, is well, I know a bit of Go. Naysayers might chime in and say, you blithering idiot! I can’t believe you didn’t spend all your time learning [VHDL][22] or [Verilog][23] or [LogSim][24] or whatever but I’d already written my bits and bytes and NANDs by that point, I was in too deep. Maybe I’ll learn them next and weep about my time wasted, but that’s my cross to bear. + +In the grand scheme of things most of the computer is just passing around a bunch of booleans, so any boolean friendly language will do the job. + +Applying a schema to those booleans is what helps you (the programmer) derive its meaning, and the biggest decision anyone needs to make is decide what [endianness][25] your system is going to use and make sure all the components transfer things to and from the bus in the right order. + +This was an absolute pain in the backside to implement. From the offset I opted for little endian but when testing the ALU my hair took a beating trying to work out why the numbers were coming out wrong. Many, many print statements took place on this one. + +Development did take a while, maybe about a month or two during some of my free time, but once the CPU was done and successfully able to execute 2 + 2 = 5, I was happy. + +Well, until the book discussed the I/O features, with designs for a simple keyboard and display interface so you can get things in and out of the machine. Well I’ve already gotten this far, no point in leaving it in a half finished state. I set myself a goal of being able to type something on a keyboard and render the letters on a display. + +### Peripherals + +The peripherals use the [adapter pattern][26] to act as a hardware interface between the CPU and the outside world. It’s probably not a huge leap to guess this was what the software design pattern took inspiration from. + +![][27] +How the I/O adapters connect to a GLFW window + +With this separation of concerns it was actually pretty simple to hook the other end of the keyboard and display to a window managed by GLFW. In fact I just pulled most of the code from my [emulator][28] and reshaped it a bit, using go channels to act as the signals in and out of the machine. + +### Bringing it to life + +![][29] + +This was probably the most tricky part, or at least the most cumbersome. Writing assembly with such a limited instruction set sucks. Writing assembly using a crude assembler I wrote sucks even more because you can’t shake your fist at someone other than yourself. + +The biggest problem was juggling the 4 registers and keeping track of them, pulling and putting stuff in memory as a temporary store. Whilst doing this I remembered the Gameboy CPU having a stack pointer register so you could push and pop state. Unfortunately this computer doesn’t have such a luxury, so I was mostly moving stuff in and out of memory on a bespoke basis. + +The only pseudo instruction I took the time to implement was `CALL` to help calling functions, this allows you to run a function and then return to the point after the function was called. Without that stack though you can only call one level deep. + +Also as the machine does not support interrupts, you have to implement awful polling code for functions like getting keyboard state. The book does discuss the steps needed to implement interrupts, but it would involve a lot more wiring. + +But anyway enough of the moaning, I ended up writing [four programs][30] and most of them make use of some shared code for drawing fonts, getting keyboard input etc. Not exactly operating system material but it did make me appreciate some of the services a simple operating system might provide. + +It wasn’t easy though, the trickiest part of the text-writer program was getting the maths right to work out when to go to a newline, or what happens when you hit the enter key. + +``` +main-getInput: + CALL ROUTINE-io-pollKeyboard + CALL ROUTINE-io-drawFontCharacter + JMP main-getInput +``` + +The main loop for the text-writer program + +I didn’t get round to implementing the backspace key either, or any of the modifier keys. Made me appreciate how much work must go in to making text editors and how tedious that probably is. + +### On reflection + +This was a fun and very rewarding project for me. In the midst of programming in the assembly language I’d largely forgotten about the NAND, AND and OR gates firing underneath. I’d ascended into the layers of abstraction above. + +While the CPU in the is very simple and a long way from what’s sitting in my laptop, I think this project has taught me a lot, namely: + + * How bits move around between all components using a bus + * How a simple ALU works + * What a simple Fetch-Decode-Execute cycle looks like + * That a machine without a stack pointer register + concept of a stack sucks + * That a machine without interrupts sucks + * What an assembler is and does + * How a peripherals communicate with a simple CPU + * How simple fonts work and an approach to rendering them on a display + * What a simple operating system might start to look like + + + +So what’s next? The book said that no-one has built a computer like this since 1952, meaning I’ve got 67 years of material to brush up on, so that should keep me occupied for a while. I see the [x86 manual is 4800 pages long][31], enough for some fun, light reading at bedtime. + +Maybe I’ll have a brief dalliance with operating system stuff, a flirtation with the C language, a regrettable evening attempting to [solder up a PiDP-11 kit][32] then probably call it quits. I dunno, we’ll see. + +With all seriousness though I think I’m going to start looking into RISC based stuff next, maybe RISC-V, but probably start with early RISC processors to get an understanding of the lineage. Modern CPUs have a lot more features like caches and stuff so I want to understand them as well. A lot of stuff out there to learn. + +Do I need to know any of this stuff in my day job? Probably helps, but not really, but I’m enjoying it, so whatever, thanks for reading xxxx + +-------------------------------------------------------------------------------- + +via: https://djhworld.github.io/post/2019/05/21/i-dont-know-how-cpus-work-so-i-simulated-one-in-code/ + +作者:[daniel harper][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://djhworld.github.io +[b]: https://github.com/lujun9972 +[1]: https://djhworld.github.io/img/simple-computer/text-writer.gif (Hello World) +[2]: http://buthowdoitknow.com/ +[3]: https://github.com/djhworld/simple-computer +[4]: https://djhworld.github.io/img/simple-computer/ascii1.png (ASCII) +[5]: https://djhworld.github.io/img/simple-computer/ascii.png +[6]: https://djhworld.github.io/img/simple-computer/brush1.png (brush) +[7]: https://djhworld.github.io/img/simple-computer/brush.png +[8]: https://djhworld.github.io/img/simple-computer/text-writer1.png (doing the typesin') +[9]: https://djhworld.github.io/img/simple-computer/text-writer.png +[10]: https://github.com/djhworld/simple-computer/blob/master/cpu/cpu.go#L763 +[11]: https://github.com/djhworld/simple-computer/blob/master/cpu/cpu_test.go +[12]: https://github.com/djhworld/simple-computer/blob/master/io/keyboard.go#L20 +[13]: https://github.com/djhworld/simple-computer/blob/master/io/display.go#L13 +[14]: https://github.com/djhworld/simple-computer/blob/master/cmd/simulator/glfw_io.go +[15]: https://github.com/djhworld/simple-computer/blob/master/asm/assembler.go +[16]: https://github.com/djhworld/gomeboycolor +[17]: https://github.com/djhworld/simple-computer#instructions +[18]: http://www.buthowdoitknow.com/but_how_do_it_know_cpu_model.html +[19]: https://djhworld.github.io/img/simple-computer/scott-cpu.png (The Scott CPU) +[20]: https://djhworld.github.io/img/simple-computer/scott-cpu.png +[21]: https://github.com/djhworld/simple-computer/blob/master/_programs/ascii.asm#L27 +[22]: https://en.wikipedia.org/wiki/VHDL +[23]: https://en.wikipedia.org/wiki/Verilog +[24]: http://www.cburch.com/logisim/ +[25]: https://en.wikipedia.org/wiki/Endianness +[26]: https://en.wikipedia.org/wiki/Adapter_pattern +[27]: https://djhworld.github.io/img/simple-computer/io.png (i couldn't be bothered to do the corners around the CPU for the system bus) +[28]: https://github.com/djhworld/gomeboycolor-glfw +[29]: https://djhworld.github.io/img/simple-computer/brush.gif (brush.bin) +[30]: https://github.com/djhworld/simple-computer/blob/master/_programs/README.md +[31]: https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf +[32]: https://obsolescence.wixsite.com/obsolescence/pidp-11 From c881a95a3f73cc150a717d9298acc3df3e57ba12 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 13 Jun 2019 15:40:23 +0800 Subject: [PATCH 0891/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=20Appl?= =?UTF-8?q?ications=20for=20writing=20Markdown=20sources/tech/20190610=20A?= =?UTF-8?q?pplications=20for=20writing=20Markdown.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...90610 Applications for writing Markdown.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20190610 Applications for writing Markdown.md diff --git a/sources/tech/20190610 Applications for writing Markdown.md b/sources/tech/20190610 Applications for writing Markdown.md new file mode 100644 index 0000000000..f083e93785 --- /dev/null +++ b/sources/tech/20190610 Applications for writing Markdown.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Applications for writing Markdown) +[#]: via: (https://fedoramagazine.org/applications-for-writing-markdown/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +Applications for writing Markdown +====== + +![][1] + +Markdown is a lightweight markup language that is useful for adding formatting while still maintaining readability when viewing as plain text. Markdown (and Markdown derivatives) are used extensively as the priumary form of markup of documents on services like GitHub and pagure. By design, Markdown is easily created and edited in a text editor, however, there are a multitude of editors available that provide a formatted preview of Markdown markup, and / or provide a text editor that highlights the markdown syntax. + +This article covers 3 desktop applications for Fedora Workstation that help out when editing Markdown. + +### UberWriter + +[UberWriter][2] is a minimal Markdown editor and previewer that allows you to edit in text, and preview the rendered document. + +![][3] + +The editor itself has inline previews built in, so text marked up as bold is displayed bold. The editor also provides inline previews for images, formulas, footnotes, and more. Ctrl-clicking one of these items in the markup provides an instant preview of that element to appear. + +In addition to the editor features, UberWriter also features a full screen mode and a focus mode to help minimise distractions. Focus mode greys out all but the current paragraph to help you focus on that element in your document + +Install UberWriter on Fedora from the 3rd-party Flathub repositories. It can be installed directly from the Software application after [setting up your system to install from Flathub][4] + +### Marker + +Marker is a Markdown editor that provides a simple text editor to write Markdown in, and provides a live preview of the rendered document. The interface is designed with a split screen layout with the editor on the left, and the live preview on the right. + +![][5] + +Additionally, Marker allows you to export you document in a range of different formats, including HTML, PDF, and the Open Document Format (ODF). + +Install Marker on Fedora from the 3rd-party Flathub repositories. It can be installed directly from the Software application after [setting up your system to install from Flathub][4] + +### Ghostwriter + +Where the previous editors are more focussed on a minimal user experice, Ghostwriter provides many more features and options to play with. Ghostwriter provides a text editor that is partially styled as you write in Markdown format. Bold text is bold, and headings are in a larger font to assist in writing the markup. + +![][6] + +It also provides a split screen with a live updating preview of the rendered document. + +![][7] + +Ghostwriter also includes a range of other features, including the ability to choose the Markdown flavour that the preview is rendered in, as well as the stylesheet used to render the preview too. + +Additionally, it provides a format menu (and keyboard shortcuts) to insert some of the frequent markdown ‘tags’ like bold, bullets, and italics. + +Install Ghostwriter on Fedora from the 3rd-party Flathub repositories. It can be installed directly from the Software application after [setting up your system to install from Flathub][4] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/applications-for-writing-markdown/ + +作者:[Ryan Lerch][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/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/markdownapps.png-816x345.jpg +[2]: https://uberwriter.github.io/uberwriter/#1 +[3]: https://fedoramagazine.org/wp-content/uploads/2019/06/uberwriter-editor-1.png +[4]: https://fedoramagazine.org/install-flathub-apps-fedora/ +[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/marker-screenshot-1024x500.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/06/ghostwriter-1024x732.png +[7]: https://fedoramagazine.org/wp-content/uploads/2019/06/ghostwriter2-1024x566.png From 3fdb4455d4e646d9c0ce064327ec7b0935377393 Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Thu, 13 Jun 2019 17:36:57 +0800 Subject: [PATCH 0892/1154] =?UTF-8?q?=E3=80=90=E7=94=B3=E8=AF=B7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E3=80=9120190610=20Welcoming=20Blockchain=203.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- sources/tech/20190610 Welcoming Blockchain 3.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 Welcoming Blockchain 3.0.md b/sources/tech/20190610 Welcoming Blockchain 3.0.md index cad1b03708..7c8579cd92 100644 --- a/sources/tech/20190610 Welcoming Blockchain 3.0.md +++ b/sources/tech/20190610 Welcoming Blockchain 3.0.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (murphyzhao) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3be835f4afbb4b9b175a2827de4e26ee25806cfe Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Thu, 13 Jun 2019 17:44:10 +0800 Subject: [PATCH 0893/1154] =?UTF-8?q?=E3=80=90=E7=94=B3=E8=AF=B7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E3=80=9120190610=20Applications=20for=20writing=20Mar?= =?UTF-8?q?kdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- sources/tech/20190610 Applications for writing Markdown.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 Applications for writing Markdown.md b/sources/tech/20190610 Applications for writing Markdown.md index f083e93785..782ee8a0ee 100644 --- a/sources/tech/20190610 Applications for writing Markdown.md +++ b/sources/tech/20190610 Applications for writing Markdown.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (murphyzhao) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c0c225440ff0f7b4dbe79e5f9355c6ff83323c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Thu, 13 Jun 2019 18:41:34 +0800 Subject: [PATCH 0894/1154] Translated --- ...ate A Bootable USB Device From ISO File.md | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) rename {sources => translated}/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md (54%) diff --git a/sources/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md b/translated/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md similarity index 54% rename from sources/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md rename to translated/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md index 1fea02d9b4..94bc351f7f 100644 --- a/sources/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md +++ b/translated/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md @@ -1,46 +1,46 @@ -Translanting by robsean -BootISO – A Simple Bash Script To Securely Create A Bootable USB Device From ISO File +BootISO – 一个简单的 Bash 脚本来安全地从 ISO 文件中创建一个可启动的 USB 设备 ====== -Most of us (including me) very often create a bootable USB device from ISO file for OS installation. +为操作系统安装,我们中的大多数人(包括我)非常经常地从 ISO 文件中创建一个可启动的 USB 设备。 -There are many applications freely available in Linux for this purpose. Even we wrote few of the utility in the past. +为达到这个目的,在 Linux 中有很多自由可用的应用程序。甚至在过去我们写了几个实用程序。 -Every one uses different application and each application has their own features and functionality. +每个人使用不同的应用程序,每个应用程序有它们自己的特色和功能。 -In that few of applications are belongs to CLI and few of them associated with GUI. +在这些应用程序中,一些应用程序属于 CLI ,一些应用程序与 GUI 关联。 -Today we are going to discuss about similar kind of utility called BootISO. It’s a simple bash script, which allow users to create a USB device from ISO file. +今天,我们将讨论相同类型的称为 BootISO 的实用程序。它是一个简单的 bash 脚本,允许用户来从 ISO 文件中创建一个可启动的 USB 设备。 -Many of the Linux admin uses dd command to create bootable ISO, which is one of the native and famous method but the same time, it’s one of the very dangerous command. So, be careful, when you performing any action with dd command. +很多 Linux 管理员使用 dd 命令开创建可启动的 ISO ,它是一个本地的且著名的方法,但是与此同时,它也是一个非常危险的命令。因此,小心,当你执行一些带有 dd 命令的动作。 -**Suggested Read :** -**(#)** [Etcher – Easy way to Create a bootable USB drive & SD card from an ISO image][1] -**(#)** [Create a bootable USB drive from an ISO image using dd command on Linux][2] +**建议阅读:** +**(#)** [Etcher – 简单的方法来从一个 ISO 镜像中创建一个可启动的 USB 驱动器 & SD 卡][1] -### What IS BootISO +**(#)** [在 Linux 上使用 dd 命令来从一个 ISO 镜像中创建一个可启动的 USB 驱动器][2] -[BootIOS][3] is a simple bash script, which allow users to securely create a bootable USB device from one ISO file. It’s written in bash. +### BootISO 是什么 -It doesn’t offer any GUI but in the same time it has vast of options, which allow newbies to create a bootable USB device in Linux without any issues. Since it’s a intelligent tool that automatically choose if any USB device is connected on the system. +[BootIOS][3] 是一个简单的 bash 脚本,允许用户来安全的从一个 ISO 文件中创建一个可启动的 USB 设备,它是用 bash 编写的。 -It will print the list when the system has more than one USB device connected. When you choose manually another hard disk manually instead of USB, this will safely exit without writing anything on it. +它不提供任何图形用户界面,但是与此同时,它有大量的选项,允许初学者在 Linux 上来创建一个可启动的 USB 设备,而没有任何问题。因为它是一个智能工具,自动地选择是否一些 USB 设备被连接到系统上。 -This script will also check for dependencies and prompt user for installation, it works with all package managers such as apt-get, yum, dnf, pacman and zypper. +当系统有多个 USB 设备连接,它将打印列表。当你手动选择另一个硬盘而不是 USB ,在这种情况下,它将安全地退出,而不在硬盘上写任何东西。 -### BootISO Features +这个脚本也将检查依赖关系,并提示用户安装,它与所有的软件包管理器一起工作,例如 apt-get,yum,dnf,pacman 和 zypper。 - * It checks whether the selected ISO has the correct mime-type or not. If no then it exit. - * BootISO will exit automatically, if you selected any other disks (local hard drive) except USB drives. - * BootISO allow users to select the desired USB drives when you have more than one. - * BootISO prompts the user for confirmation before erasing and paritioning USB device. - * BootISO will handle any failure from a command properly and exit. - * BootISO will call a cleanup routine on exit with trap. +### BootISO 特色 + + * 它检查选择的 ISO 是否是正确的 mime 类型。如果不是,那么退出。. + * 如果你选择除 USB 设备以外的任何其它的磁盘(本地硬盘),BootISO 将自动地退出。 + * 当你有多个驱动器时,BootISO 允许用户选择想要的 USB 驱动器。 + * 在擦除和分区 USB 设备前,BootISO 提示用户确认。 + * BootISO 将正确地处理来自一个命令的任何失灵,并退出。 + * BootISO 在退出陷阱时将调用一个清理例行程序。 -### How To Install BootISO In Linux +### 如果在 Linux 中安装 BootISO -There are few ways are available to install BootISO in Linux but i would advise users to install using the following method. +在 Linux 中安装 BootISO 有几个可用的方法,但是,我建议用户使用下面的方法安装。 ``` $ curl -L https://git.io/bootiso -O $ chmod +x bootiso @@ -48,7 +48,7 @@ $ sudo mv bootiso /usr/local/bin/ ``` -Once BootISO installed, run the following command to list the available USB devices. +一旦 BootISO 已经安装,运行下面的命令来列出可用的 USB 设备。 ``` $ bootiso -l @@ -58,7 +58,7 @@ sdd 1 32G running disk ``` -If you have only one USB device, then simple run the following command to create a bootable USB device from ISO file. +如果你仅有一个 USB 设备,那么简单地运行下面的命令来从一个 ISO 文件中创建一个可启动的 USB 设备。 ``` $ bootiso /path/to/iso file @@ -85,37 +85,37 @@ You can safely remove it ! ``` -Mention your device name, when you have more than one USB device using `--device` option. +提到你的设备名称,当你有多个 USB 设备时,使用 `--device` 选项。 ``` $ bootiso -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso ``` -By default bootios uses `rsync` command to perform all the action and if you want to use `dd` command instead of, use the following format. +默认情况下,BootISO 使用 `rsync` 命令来执行所有的动作,如果你想使用 `dd` 命令代替它,使用下面的格式。 ``` $ bootiso --dd -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso ``` -If you want to skip `mime-type` check, include the following option with bootios utility. +如果你想跳过 `mime-type` 检查,BootISO 实用程序带有下面的选项。 ``` $ bootiso --no-mime-check -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso ``` -Add the below option with bootios to skip user for confirmation before erasing and partitioning USB device. +为 BootISO 添加下面的选项来跳过在擦除和分区 USB 设备前的用户确认。 ``` $ bootiso -y -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso ``` -Enable autoselecting USB devices in conjunction with -y option. +连同 -y 选项一起,启用自动选择 USB 设备。 ``` $ bootiso -y -a /opt/iso_images/archlinux-2018.05.01-x86_64.iso ``` -To know more all the available option for bootiso, run the following command. +为知道更多全部可用的 BootISO 选项,运行下面的命令。 ``` $ bootiso -h Create a bootable USB from any ISO securely. @@ -162,7 +162,7 @@ via: https://www.2daygeek.com/bootiso-a-simple-bash-script-to-securely-create-a- 作者:[Prakash Subramanian][a] 选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) +译者:[robsean](https://github.com/robsean) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From acb67e16de042d3c70c8706b3aed00a9494190c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 14 Jun 2019 08:10:10 +0800 Subject: [PATCH 0895/1154] Translating --- ...Resize Active-Primary root Partition Using GParted Utility.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md b/sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md index f75baf6166..e51a216a5d 100644 --- a/sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md +++ b/sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md @@ -1,3 +1,4 @@ +Translating by Robsean How To Resize Active/Primary root Partition Using GParted Utility ====== Today we are going to discuss about disk partition. It’s one of the best topics in Linux. This allow users to resize the active root partition in Linux. From 53aecfc1133775a32c7ab0c649ba820118bf91be Mon Sep 17 00:00:00 2001 From: chen ni Date: Fri, 14 Jun 2019 08:35:20 +0800 Subject: [PATCH 0896/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...laces Where You Can Buy Linux Computers.md | 170 +++++++++--------- 1 file changed, 82 insertions(+), 88 deletions(-) diff --git a/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md b/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md index 7212522646..2e7be15f75 100644 --- a/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md +++ b/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md @@ -7,214 +7,209 @@ [#]: via: (https://itsfoss.com/get-linux-laptops/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -10 Places Where You Can Buy Linux Computers +可以买到 Linux 电脑的 10 个地方 ====== -_**Looking for Linux laptops? Here I list some online shops that either sell Linux computers or specialize only in Linux systems.**_ +_**你在找 Linux 笔记本吗? 这里列出一些出售 Linux 电脑或者是专注于 Linux 系统的电商。**_ -Almost all the computers (except Apple) sold these days come with Windows preinstalled on it. The standard procedure for Linux users is to buy such a computer and then either remove Windows and install Linux or [dual boot Linux with Windows][1]. +如今市面上几乎所有的电脑(苹果除外)都预装了 Windows 系统。Linux 使用者的惯常做法就是买一台这样的电脑,然后要么删除 Windows 系统并安装 Linux,要么[安装 Linux 和 Windows 的双系统][1]。 -But you don’t always have to go through Windows. You can buy Linux computers as well. +但 Windows 系统并非无法避免。你其实也可以买到 Linux 电脑。 -But why buy a computer preinstalled with Linux when you can easily install Linux on any computer? Here are some reasons: +不过,既然可以轻松地在任何一台电脑上安装 Linux,为什么还要买一台预装了 Linux 的电脑呢?下面列举几个原因: - * A computer with Windows always has an extra cost for the Windows license. You can avoid that. - * Computers preinstalled with Linux are well-tested for hardware compatibility. You can be sure that your system will have WiFi and Bluetooth working instead of figuring these things on your own. - * Buying Linux laptops and desktops supports Linux indirectly. More sale indicates that there is a demand for Linux products and thus more vendors may incline to provide Linux as a choice of operating system. + * 预装 Windows 系统意味着你额外支付了 Windows 许可证的费用。你可以节省这笔开销。 + * 预装 Linux 的电脑都经过了硬件适配测试。你不需要担心系统无法正常运行 WiFi 或者蓝牙,也不再需要亲自去搞定这些事情了。 + * 购买 Linux 电脑相当于间接地支持了 Linux。更多的销售额可以反应出对 Linux 产品的需求,也就可能会有更多商家提供 Linux 作为一种可以选择的操作系统。 - - -If you are looking to get a new Linux laptop, let me suggest you a few manufacturers and vendors that provide ready-to-use Linux systems. +如果你正想买一台 Linux 的笔记本,不妨考虑一下我的建议。下面这些制造商或者商家都提供开箱即用的 Linux 系统。 ![][2] -### 10 places to buy Linux laptops and computers +### 可以买到 Linux 笔记本或者台式机的 10 个地方 -A couple of disclaimer/information before you see the list of shops offering computers with Linux preloaded. +在揭晓这个提供预装 Linux 电脑的商家的清单之前,需要先声明一下。 -Please make a purchase on your own decision. I am simply listing the Linux computer sellers here, I cannot vouch for their product quality, after sale service or other such things. +请根据你的独立决策购买。我在这里只是简单地列出一些售卖 Linux 电脑的商家,并不保证他们的产品质量,售后服务等等这些事情。 -This is not a ranking list. The items listed here are in no particular order. The numbers are used for the purpose of counting the items, not ranking them. +这也并不是一个排行榜。清单并不是按照某个特定次序排列的,每一项前面的数字只是为了方便计数,而并不代表名次。 -Let’s see from where you can get desktops and laptops with Linux preinstalled. +让我们看看你可以在哪儿买到预装 Linux 的台式机或者笔记本吧。 -#### 1\. Dell +#### 1\. 戴尔 -![Dell XPS Ubuntu | Image Credit: Lifehacker][3] +![戴尔 XPS Ubuntu | 图片所有权: Lifehacker][3] -Dell has been offering Ubuntu laptops for several years now. Their flagship product XPS features a Developer Edition series that comes with Ubuntu preinstalled. +戴尔提供 Ubuntu 笔记本已经有好几年了。他们的旗舰产品 XPS 系列的亮点之一就是预装了 Ubuntu 的开发者版本系列产品。 -If you read my [review of Dell XPS Ubuntu edition][4], you know that I loved this laptop. It’s been more than two years and this laptop is still in great condition and performance has not deteriorated. +如果你读过我的 [戴尔 XPS Ubuntu 版本评测][4]就知道我是很喜欢这款笔记本的。两年多过去了,这个笔记本依然状况良好,没有性能恶化的迹象。 -Dell XPS is an expensive device with a price tag of over $1000. If that’s out of your budget, Dell also has inexpensive offering in its Inspiron laptop range. +戴尔 XPS 是售价超过 1000 美元的昂贵设备。如果你的预算没有这么多,可以考虑戴尔更加亲民的 Inspiron 系列笔记本。 -Do note that Dell doesn’t display the Ubuntu/Linux laptops on its website. Unless you already know that Linux laptops are offered by Dell, you wouldn’t be able to find them. +值得一提的是,戴尔并没有在它的官网上展示 Ubuntu 或者 Linux 笔记本产品。除非你知道戴尔提供 Linux 笔记本,你是不会找到它们的。 -So, go to Dell’s website and enter Ubuntu in its search box to see the products that ship with Ubuntu Linux preinstalled. +所以,去戴尔的官网上搜索关键字 “Ubuntu” 来获取预装 Ubuntu 的产品的信息吧。 -**Availability** : Most part of the world. +**支持范围** : 世界上大部分地区。 -[Dell][5] +[戴尔][5] #### 2\. System76 -[System76][6] is a prominent name in the Linux computers world. This US-based company specializes in high-end computing devices that run Linux. Their targeted user-base is software developers. +[System76][6] 是 Linux 计算机世界里的一个响亮的名字。这家总部设在美国的企业专注于运行 Linux 的高端技术设备。他们的目标用户群体是软件开发者。 -Initially, System76 used to offer Ubuntu on their machines. In 2017, they released their own Linux distribution [Pop!_OS][7] based on Ubuntu. Since then, Pop!_OS is the default OS on their machine with Ubuntu still available as a choice. +最初,System76 在自己的机器上提供的是 Ubuntu 系统。2017 年,他们发布了属于自己的 Linux 发行版,基于 Ubuntu 的 [Pop!_OS][7]。从此以后,Pop!_OS 就是他们机器上的默认操作系统了,但是仍然保留了 Ubuntu 这个选择。 -Apart from performance, System76 has put a great emphasis on the design of its computer. Their [Thelio desktop series][8] has a handcrafted wooden design. +除了性能之外,System76 还格外重视设计。他们的 [Thelio 系列台式机][8] 采用纯手工木制设计。 -![System76 Thelio Desktop][9] +![System76 Thelio 台式机][9] -You may check their Linux laptops offering [here][10]. They also offer [Linux-based mini PCs][11] and [servers][12]. +你可以在 [这里][10] 查看他们提供的 Linux 笔记本。他们同时也提供 [基于 Linux 的迷你电脑][11] 和 [服务器][12]。 -Did I mention that System76 manufactures its computers in America instead of the obvious choice of China and Taiwan? The products are on the expensive side, perhaps for this reason. +值得一提的是,System76 在美国制造他们的电脑,而没有使用中国大陆或者台湾这种常规的选择。也许是出于这个原因,他们产品的售价较为高昂。 -**Availability** : USA and 60 other countries. Extra custom duty may be applicable outside the US. More info [here][13]. +**支持范围** : 美国以及其它 60 个国家。在美国境外可能会有额外的关税。更多信息见[这里][13]. [System76][6] #### 3\. Purism -Purism is a US-based company that takes pride in creating products and services that help you secure your data and privacy. That’s the reason why Purism calls itself a ‘Social Purpose Corporation’. +Purism 是一个总部设在美国的企业,以提供确保数据安全和隐私的产品和服务为荣。这就是为什么 Purism 称自己为 “效力社会的公司”。 [][14] -Suggested read How To Use Google Drive In Linux - -Purism started with a crowdfunding campaign for creating a high-end open source laptop with (almost) no proprietary software. The [successful $250,000 crowdfunding campaign][15] gave birth to [Librem 15][16] laptop in 2015. +Purism 是从一个众筹项目开始的,该项目旨在创造一个几乎没有任何专有软件的高端开源笔记本。2015年,从这个 [成功的 25 万美元的众筹项目][15] 中诞生了 [Librem 15][16] 笔记本。 ![Purism Librem 13][17] -Later Purism released a 13″ version called [Librem 13][18]. Purism also created a Linux distribution [Pure OS][19] keeping privacy and security in mind. +后来 Purism 发布了一个 13 英寸的版本 [Librem 13][18]。Purism 还开发了一个自己的 Linux 发行版 [Pure OS][19],该发行版非常注重隐私和安全问题。 -[Pure OS can run on both desktop and mobile devices][20] and it is the default choice of operating system on its Librem laptops and [Librem 5 Linux phone][21]. +[Pure OS 在台式设备和移动设备上都可以运行][20],并且是 Librem 笔记本和[Librem 5 Linux 手机] 的默认操纵系统。 -Purism gets its components from China, Taiwan, Japan, and the United States and builds/assemble them in the US. All their devices have hardware kill switches to turn off the microphone/camera and wireless/bluetooth. +Purism 的零部件来自中国大陆、台湾、日本以及美国,并在美国完成组装。他们的所有设备都有可以用来关闭麦克风、摄像头、无线连接或者是蓝牙的硬件开关。 -**Availability** : Worldwide with free international shipping. Custom duty may cost extra. +**支持范围** : 全世界范围国际免邮。可能需要支付额外的关税。 [Purism][22] #### 4\. Slimbook -Slimbook is a Linux computer vendor based in Spain. Slimbook came to limelight after launching the [first KDE branded laptop][23]. +Slimbook 是一个总部设在西班牙的 Linux 电脑销售商. Slimbook 在发行了 [第一款 KDE 品牌笔记本][23]之后成为了人们关注的焦点。 -Their offering is not limited to just KDE Neon. They offer Ubuntu, Kubuntu, Ubuntu MATE, Linux Mint and Spanish distributions like [Lliurex][24] and [Max][25]. You can also choose Windows at an additional cost or opt for no operating system at all. +他们的产品不仅限于KDE Neon。他们还提供 Ubuntu,Kubuntu,Ubuntu MATE,Linux Mint 以及包括 [Lliurex][24] 和 [Max][25]在内的西班牙发行版。您也可以选择 Windows(需要额外付费)或者不预装任何操作系统。 -Slimbook has a wide variety of Linux laptops, desktops and mini PCs available. An iMac like 24″ [curved monitor that has in-built CPU][26] is an awesome addition to their collection. +Slimbook 有众多 Linux 笔记本,台式机和迷你电脑可供选择。他们另外一个非常不错的产品是一个类似于 iMac 的 24 英寸 [拥有内置 CPU 的曲面显示屏][26]。 -![Slimbook Kymera Aqua Liquid Cool Linux Computer][27] +![Slimbook Kymera Aqua 水冷 Linux 电脑][27] -Want a liquid cooled Linux computer? Slimbook’s [Kymera Aqua][28] is for you. +想要一台水冷 Linux 电脑吗?Slimbook 的 [Kymera Aqua][28] 是合适之选。 -**Availability** : Worldwide but may cost extra in shipping and custom duty +**支持范围** : 全世界范围,不过在邮费和关税上都可能产生额外费用。 [Slimbook][29] -#### 5\. TUXEDO Computers +#### 5\. TUXEDO -Another European candidate in this list of Linux computer vendors. [TUXEDO Computers][30] is based out of Germany and mainly focuses on German users and then European users. +作为这个 Linux 电脑销售商清单里的另一个欧洲成员,[TUXEDO][30] 总部设在德国,主要服务德国用户,其次是欧洲用户。 -TUXEDO Computers only uses Linux and the computers are ‘manufactured in Germany’ and come with 5 years of guarantee and lifetime support. +TUXEDO 只使用 Linux 系统,产品都是“德国制造”,并且提供 5 年保修和终身售后支持。 -TUXEDO Computers has put up some real good effort in customizing its hardware to run on Linux. And if you ever run into trouble or want to start afresh, you have the system recovery option to restore factory settings automatically. +TUXEDO 在 Linux 系统的硬件适配上下了很大功夫。并且如果你遇到了麻烦或者是想从头开始,可以通过系统恢复选项,自动恢复出厂设置。 -![Tuxedo Computers supports a wide variety of distributions][31] +![Tuxedo 电脑支持众多发行版][31] -TUXEDO Computers has a number of Linux laptops, desktops, mini-PCs available. They have both Intel and AMD processors. Apart from the computers, TUXEDO Computers also has a range of Linux supported accessories like docking stations, DVD/Blue-Ray burners, power bank and other peripheral devices. +TUXEDO 有许多 Linux 笔记本、台式机和迷你电脑产品可供选择。他们还同时拥有 Intel 和 AMD 的处理器。 除了电脑,TUXEDO 还提供一系列 Linux 支持的附件,比如扩展坞、DVD和蓝光刻录机、移动电源以及其它外围设备。 -**Availability** : Free shipping in Germany and Europe (for orders above 150 Euro). Extra shipping charges and custom duty for non-EU countries. More info [here][32]. +**支持范围** : 150 欧元以上的订单在德国和欧洲范围内免邮。欧洲外国家会有额外的运费和关税。更多信息见 [这里][32]. -[TUXEDO Computers][33] +[TUXEDO][33] #### 6\. Vikings -[Vikings][34] is based in Germany (instead of Scandinavia :D). Certified by [Free Software Foundation][35], Vikings focuses exclusively on Libre-friendly hardware. +[Vikings][34] 的总部设在德国(而不是斯堪的纳维亚半岛,哈哈)。Vikings 拥有[自由软件基金会][35]的认证,专注于自由友好的硬件。 -![Vikings’s products are certified by Free Software Foundation][36] +![Vikings 的产品经过了自由软件基金会认证][36] -The Linux laptops and desktops by Vikings come with [coreboot][37] or [Libreboot][38] instead of proprietary boot systems like BIOS and UEFI. You can also buy [server hardware][39] running no proprietary software. +Vikings 的 Linux 笔记本和台式机使用的是 [coreboot][37] 或者 [Libreboot][38],而不是像 BIOS 和 UEFI 这样的专有启动系统。你还可以购买 [服务器硬件][39],这款产品不运行任何专有软件。 -Vikings also has other accessories like router, docking station etc. The products are assembled in Germany. +Vikings 还有包括路由器、扩展坞等在内的其它配件。他们的产品都是在德国组装完成的。 -**Availability** : Worldwide (except North Korea). Non-EU countries may charge custom duty. More information [here][40]. +**支持范围** : 全世界(除了朝鲜)。非欧洲国家可能会有额外关税费用。更多信息见[这里][40]. [Vikings][41] #### 7\. Ubuntushop.be -No! It’s not the official Ubuntu Shop even though it has Ubuntu in its name. Ubuntushop is based in Belgium and originally started selling computers installed with Ubuntu. +不!尽管名字里有Ubuntu,但这不是官方的 Ubuntu 商店。Ubuntushop 总部位于比利时,最初是销售安装了 Ubuntu 的电脑。 -Today, you can get laptops preloaded with Linux distributions like Mint, Manjaro, elementrayOS. You can also request a distribution of your choice to be installed on the system you buy. +如今,你可以买到预装了包括 Mint、Manjaro、 elementrayOS 在内的 Linux 发行版的笔记本电脑。你还可以要求所购买的设备上安装你所选择的发行版。 ![][42] -One unique thing about Ubuntushop is that all of its computers come with default Tails OS live option. So even if it has a Linux distribution installed for regular use, you can always choose to boot into the Tails OS (without live USB). [Tails OS][43] is a Debian based distribution that deletes all traces of its use after logging out and it uses Tor network by default. +Ubuntushop 的一个独特之处在于,它的所有电脑都带有默认的 Tails OS live 选项。即使你安装了某个其它的 Linux 发行版作为日常使用的系统,也随时可以选择启动到 Tails OS(不需要使用 live USB)。[Tails OS][43] 是一个基于 Debian 的发行版,它在用户注销后会删除所有使用痕迹,并且在默认情况下使用 Tor 网络。 [][44] -Suggested read Things to do After Installing Ubuntu 18.04 and 18.10 +和此列表中的许多其他重要玩家不同,我觉得 Ubuntushop 所提供的更像是一种“家庭工艺”。商家手动组装一个电脑,安装 Linux 然后卖给你。不过他们也在一些可选项上下了功夫,比如说轻松的重装系统,拥有自己的云服务器等等。 -Unlike many other big players on this list, I feel that Ubuntushop is more of a ‘domestic operation’ where someone manually assembles your computer and installs Linux on it. But they have done quite some job on providing options like easy re-install, own cloud server etc. +你可以找一台旧电脑快递给他们,同时在他们的网站上买一台新的 Linux 电脑,他们就会在你的旧电脑上安装 [轻量级 Linux][45] 系统然后快递回来,这样你这台旧电脑就可以重新投入使用了。 -Got an old PC, send it to them while buying a new Linux computer and they will send it back to you after installing [lightweight Linux][45] on it so that the old computer is recycled and can still be put to some use. - -**Availability** : Belgium and rest of Europe. +**支持范围** : 比利时以及欧洲的其它地区。 [Ubuntushop.be][46] #### 8\. Minifree -[Minifree][47], short for Ministry of Freedom, is a company registered in England. +[Minifree][47],自由部门的缩写,是一家注册在英格兰的公司。 -You can guess that Minifree focuses on the freedom. It provides secure and privacy-respcting computers that come with [Libreboot][38] instead of BIOS or UEFI. +你可以猜到 Minifree 非常注重自由。他们提供安全以及注重隐私的电脑,预装 [Libreboot][38] 而不是 BIOS 或者 UEFI。 -Minifree devices are certified by [Free Software Foundation][48] which means that you can be sure that your computer adhere to guidelines and principals of Free and Open Source Software. +Minifree 的设备经过了 [自由软件基金会][48] 的认证,所以你可以放心买到的电脑都遵循了自由开源软件的指导规则。 ![][49] -Unlike many other Linux laptops vendors on this list, computers from Minifree are not super-expensive. You can get a Libreboot Linux laptop running [Trisquel GNU/Linux][50] from 200 euro. +和这个清单中许多其它 Linux 笔记本销售商不同,Minifree 的电脑并不是特别贵。花 200 欧元就可以买到一台预装了 Libreboot 和 [Trisquel GNU/Linux][50] 的 Linux 电脑。 -Apart from laptops, Minifree also has a range of accessories like a Libre Router, tablet, docking station, batteries, keyboard, mouse etc. +除了笔记本以外,Minifree 还有一系列的配件,比如 Libre 路由器、平板电、扩展坞、电池、键盘、鼠标等等。 -If you care to run only 100% free software like [Richard Stallman][51], Minifree is for you. +如果你和 [Richard Stallman][51] 一样,希望只运行 100% 自由的软件的话,Minifree 就再适合不过了。 -**Availability** : Worldwide. Shipping information is available [here][52]. +**支持范围** : 全世界。运费信息见 [这里][52]。 [Minifree][47] #### 9\. Entroware -[Entroware][53] is another UK-based vendor that specializes in Linux-based laptops, desktop and servers. +[Entroware][53] 是另一个总部设在英国的销售商,专注基于 Linux 系统的笔记本、台式机和服务器。 -Like many others on the list, Entroware also has Ubuntu as its choice of Linux distribution. [Ubuntu MATE is also available as a choice on Entroware Linux laptops][54]. +和这个清单里的很多其它商家一样,Entroware 也选择 Ubuntu 作为 Linux 发行版。[Ubuntu MATE 也是 Entroware Linux 笔记本的一种可选系统][54]. ![][55] -Apart from laptops, desktop and servers, Entroware also has their [mini-PC Aura][56] and the iMac style [monitor with built-in CPU Ares][57]. +除了笔记本、台式机和服务器之外,Entroware 还拥有自己的 [迷你电脑 Aura][56],以及一个 iMac 风格的[内置 CPU 的显示器 Ares][57]. -Availability: UK, Ireland France, Germany, Italy, Spain +支持范围: 英国、爱尔兰、法国、德国、意大利、西班牙。 [Entroware][58] -#### 10\. Juno Computers +#### 10\. Juno -This is a new Linux laptop vendor on our list. Juno Computers is also based in UK and offers computers preinstalled with Linux. elementary OS, Ubuntu and Solus OS are the choices of Linux distributions here. +这是我们清单上的一个新的 Linux 笔记本销售商。Juno 的总部同样设在英国,提供预装 Linux 的电脑。可选择的 Linux 发行版包括 elementary OS、Ubuntu 和 Solus OS。 -Juno offers a range of laptops and a mini-PC called Olympia. Like almost all the mini-PCs offered by other vendors here, Olympia is also basically [Intel NUC][59]. +Juno 提供一系列的笔记本,以及一款叫做 Olympia 迷你电脑。和列表里其它商家提供的大多数迷你电脑一样,Olympia 也基本上相当于一个 [Intel NUC][59]。 -The main highlight from Juno Computers is a low-cost Chromebook alternative, Juve that costs £299. It runs a dual-booted system with Solus/elementray with an Android-based desktop operating system, [Prime OS][60]. +Juno 的主要特色是 Juve,一款售价 299 美元的 Chromebook 的低成本替代品。它运行一个双系统,包括 Solus 或者 elementray,以及一个基于安卓的电脑操作系统 [Prime OS][60]。 ![Juve With Android-based Prime Os][61] -Availability: UK, USA, Canada, Mexico, Most part of South America and Europe, Australia, New Zealand, some part of Asia and Africa. More information [here][62]. +支持范围:英国、美国、加拿大、墨西哥、南美和欧洲的大部分地区、新西兰、亚洲和非洲的某些地区。更多信息见 [这里][62]。 [Juno Computers][63] #### Honorable mentions +荣誉奖 -I have listed 10 places to get Linux computers but there are several other such shops available. I cannot include all of them in the main list and a couple of them seem to be out of stock for most products. However, I am going to mention them here so that you may check them on your own: +我列举了 10 个可以买到 Linux 电脑的地方,但其实还有一些其它类似的商店。清单里放不下这么多,并且它们其中的几个似乎大多数商品都缺货。不过我还是要在这里稍微提一下它们,方便你自己查找相关信息: * [ZaReason][64] * [Libiquity][65] @@ -223,10 +218,9 @@ I have listed 10 places to get Linux computers but there are several other such * [Think Penguin][68] +包括宏碁和联想在内的其它主流电脑生产商可能也有基于 Linux 系统的产品,所以你不妨也查看一下他们的产品目录吧。 -Other mainstream computer manufacturers like Acer, Lenovo etc may also have some Linux systems in their catalog so you may check their products as well. - -Have you ever bought a Linux computer? Where did you buy it? How’s your experience with it? Is it worth buying a Linux laptop? Do share your thoughts. +你有没有买过一台 Linux 电脑?在哪儿买的?使用体验怎么样?Linux 笔记本值不值得买?分享一下你的想法吧。 -------------------------------------------------------------------------------- @@ -234,7 +228,7 @@ via: https://itsfoss.com/get-linux-laptops/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/chen-ni) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0df0a4c5b81367e29312d5ab90d9e41db68e87c7 Mon Sep 17 00:00:00 2001 From: chen ni Date: Fri, 14 Jun 2019 08:36:47 +0800 Subject: [PATCH 0897/1154] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190517 10 Places Where You Can Buy Linux Computers.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md b/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md index 2e7be15f75..2a2e102967 100644 --- a/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md +++ b/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md @@ -206,8 +206,7 @@ Juno 的主要特色是 Juve,一款售价 299 美元的 Chromebook 的低成 [Juno Computers][63] -#### Honorable mentions -荣誉奖 +#### 荣誉奖 我列举了 10 个可以买到 Linux 电脑的地方,但其实还有一些其它类似的商店。清单里放不下这么多,并且它们其中的几个似乎大多数商品都缺货。不过我还是要在这里稍微提一下它们,方便你自己查找相关信息: From 584ffd856263afa2fd13f70dc6649d721f2f80d1 Mon Sep 17 00:00:00 2001 From: chen ni Date: Fri, 14 Jun 2019 08:37:32 +0800 Subject: [PATCH 0898/1154] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0=20transla?= =?UTF-8?q?ted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190517 10 Places Where You Can Buy Linux Computers.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190517 10 Places Where You Can Buy Linux Computers.md (100%) diff --git a/sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md b/translated/tech/20190517 10 Places Where You Can Buy Linux Computers.md similarity index 100% rename from sources/tech/20190517 10 Places Where You Can Buy Linux Computers.md rename to translated/tech/20190517 10 Places Where You Can Buy Linux Computers.md From fc5b9f963aa873289f3fd0238f068cc016bbf493 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 14 Jun 2019 08:53:13 +0800 Subject: [PATCH 0899/1154] translated --- ...nexpand Commands Tutorial With Examples.md | 157 ------------------ ...nexpand Commands Tutorial With Examples.md | 148 +++++++++++++++++ 2 files changed, 148 insertions(+), 157 deletions(-) delete mode 100644 sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md create mode 100644 translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md diff --git a/sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md b/sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md deleted file mode 100644 index 2ba0e242ef..0000000000 --- a/sources/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md +++ /dev/null @@ -1,157 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Expand And Unexpand Commands Tutorial With Examples) -[#]: via: (https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-examples/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Expand And Unexpand Commands Tutorial With Examples -====== - -![Expand And Unexpand Commands Explained][1] - -This guide explains two Linux commands namely **Expand** and **Unexpand** with practical examples. For those wondering, the Expand and Unexpand commands are used to replace TAB characters in files with SPACE characters and vice versa. There is also a command called “Expand” in MS-DOS, which is used to expand a compressed file. But the Linux Expand command simply converts the tabs to spaces. These two commands are part of **GNU coreutils** and written by **David MacKenzie**. - -For the demonstration purpose, I will be using a text file named “ostechnix.txt” throughout this guide. All commands given below are tested in Arch Linux. - -### Expand command examples - -Like I already mentioned, the Expand command replaces TAB characters in a file with SPACE characters. - -Now, let us convert tabs to spaces in the ostechnix.txt file and write the result to standard output using command: - -``` -$ expand ostechnix.txt -``` - -If you don’t want to display the result in standard output, just upload it to another file like below. - -``` -$ expand ostechnix.txt>output.txt -``` - -We can also convert tabs to spaces, reading from standard input. To do so, just run “expand” command without mentioning the source file name: - -``` -$ expand -``` - -Just type the text and hit ENTER to convert tabs to spaces. Press **CTRL+C** to quit. - -If you do not want to convert tabs after non blanks, use **-i** flag like below. - -``` -$ expand -i ostechnix.txt -``` - -We can also have tabs a certain number of characters apart, not 8 (the default value): - -``` -$ expand -t=5 ostechnix.txt -``` - -You can even mention multiple tab positions with comma separated like below. - -``` -$ expand -t 5,10,15 ostechnix.txt -``` - -Or, - -``` -$ expand -t "5 10 15" ostechnix.txt -``` - -For more details, refer man pages. - -``` -$ man expand -``` - -### Unexpand Command Examples - -As you may have already guessed, the **Unexpand** command will do the opposite of the Expand command. I.e It will convert SPACE charatcers to TAB characters. Let me show you a few examples to learn how to use Unexpand command. - -To convert blanks (spaces, of course) in a file to tabs and write the output to stdout, do: - -``` -$ unexpand ostechnix.txt -``` - -If you want to write the output in a file instead of just displaying it to stdout, use this command: - -``` -$ unexpand ostechnix.txt>output.txt -``` - -Convert blanks to tabs, reading from standard output: - -``` -$ unexpand -``` - -By default, Unexpand command will only convert the initial blanks. If you want to convert all blanks, instead of just initial blanks, use **-a** flag: - -``` -$ unexpand -a ostechnix.txt -``` - -To convert only leading sequences of blanks (Please note that it overrides **-a** ): - -``` -$ unexpand --first-only ostechnix.txt -``` - -Have tabs a certain number of characters apart, not **8** (enables **-a** ): - -``` -$ unexpand -t 5 ostechnix.txt -``` - -Similarly, we can mention multiple tab positions with comma separated like below. - -``` -$ unexpand -t 5,10,15 ostechnix.txt -``` - -Or, - -``` -$ unexpand -t "5 10 15" ostechnix.txt -``` - -For more details, refer man pages. - -``` -$ man unexpand -``` - -* * * - -**Suggested read:** - - * [**The Fold Command Tutorial With Examples For Beginners**][2] - - - -* * * - -When you working on large number of files, the Expand and Unexpand commands could be very helpful to replace unwanted TAB characters with SPACE characters and vice versa. - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-examples/ - -作者:[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/2019/05/Expand-And-Unexpand-Commands-720x340.png -[2]: https://www.ostechnix.com/fold-command-tutorial-examples-beginners/ diff --git a/translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md b/translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md new file mode 100644 index 0000000000..3c4f3418c0 --- /dev/null +++ b/translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md @@ -0,0 +1,148 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Expand And Unexpand Commands Tutorial With Examples) +[#]: via: (https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-examples/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +expand 与 unexpand 命令教程与示例 +====== + +![Expand And Unexpand Commands Explained][1] + +本指南通过实际的例子解释两个 Linux 命令,即 **expand** 和 **unexpand**。对于好奇的人,expand 和 unexpand 命令用于将文件中的 TAB 字符替换为空格,反之亦然。在 MS-DOS 中也有一个名为 “expand” 的命令,它用于解压压缩文件。但 Linux expand 命令只是将 tab 转换为空格。这两个命令是 **GNU coreutils** 的一部分,由 **David MacKenzie** 编写。 + +为了演示,我将在本文使用名为 “ostechnix.txt” 的文本文件。下面给出的所有命令都在 Arch Linux 中进行测试。 + +### expand 命令示例 + +与我之前提到的一样,expand 命令使用空格替换文件中的 TAB 字符。 + +现在,让我们将ostechnix.txt 中的 tab 转换为空格,并将结果写入标准输出: + +``` +$ expand ostechnix.txt +``` + +如果你不想在标准输出中显示结果,只需将其写入另一个文件,如下所示。 + +``` +$ expand ostechnix.txt>output.txt +``` + +我们还可以将标准输入中的 tab 转换为空格。为此,只需运行 “expand” 命令而不带文件名: + +``` +$ expand +``` + +只需输入文本并按回车键就能将 tab 转换为空格。按 **CTRL+C** 退出。 + + +如果你不想在非空白符后转换 tab,请使用 **-i** 标记,如下所示。 + +``` +$ expand -i ostechnix.txt +``` + +我们还可以设置每个 tab 为指定数字的宽度,而不是 8(默认值)。 + +``` +$ expand -t=5 ostechnix.txt +``` + +我们甚至可以使用逗号分隔指定多个 tab 位置,如下所示 + +``` +$ expand -t 5,10,15 ostechnix.txt +``` + +或者, + +``` +$ expand -t "5 10 15" ostechnix.txt +``` + +有关更多详细信息,请参阅手册页。 + +``` +$ man expand +``` + +### unexpand 命令示例 + +正如你可能已经猜到的那样,**unexpand** 命令将执行与 expand 命令相反的操作。即它会将空格转换为 TAB。让我向你展示一些例子,以了解如何使用 unexpand 命令。 + +要将文件中的空白(当然是空格)转换为 tab 并将输出写入标准输出,请执行以下操作: + +``` +$ unexpand ostechnix.txt +``` + +如果要将输出写入文件而不是仅将其显示到标准输出,请使用以下命令: + +``` +$ unexpand ostechnix.txt>output.txt +``` + +从标准输出读取内容,将空格转换为制表符: + +``` +$ unexpand +``` + +默认情况下,unexpand 命令仅转换初始的空格。如果你想转换所有空格而不是只是初始空格,请使用 **-a** 标志: + +``` +$ unexpand -a ostechnix.txt +``` + +仅转换开头的空白(请注意它会覆盖 **-a**): + +``` +$ unexpand --first-only ostechnix.txt +``` + +使多少个空格替换成一个 tab,而不是 **8**(启用 **-a** ): + +``` +$ unexpand -t 5 ostechnix.txt +``` + +相似地,我们可以使用逗号分隔指定多个tab的位置。 + +``` +$ unexpand -t 5,10,15 ostechnix.txt +``` + +或者, + +``` +$ unexpand -t "5 10 15" ostechnix.txt +``` + +有关更多详细信息,请参阅手册页。 + +``` +$ man unexpand +``` + + +在处理大量文件时,expand 和 unexpand 命令对于用空格替换不需要的 TAB 时非常有用,反之亦然。 + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-examples/ + +作者:[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/2019/05/Expand-And-Unexpand-Commands-720x340.png \ No newline at end of file From e6099e4eb85bb91b40927ffd69602c8acbe03b14 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 14 Jun 2019 09:02:49 +0800 Subject: [PATCH 0900/1154] translating --- .../20190610 Graviton- A Minimalist Open Source Code Editor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md b/sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md index 6da49ddcaa..2349f8b1c7 100644 --- a/sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md +++ b/sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 696f2278e3a5835647929e9ca05345b03ac5deab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 14 Jun 2019 11:06:54 +0800 Subject: [PATCH 0901/1154] PRF:20190607 5 reasons to use Kubernetes.md @geekpi --- .../20190607 5 reasons to use Kubernetes.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190607 5 reasons to use Kubernetes.md b/translated/tech/20190607 5 reasons to use Kubernetes.md index d34c57ce16..6be5f6e242 100644 --- a/translated/tech/20190607 5 reasons to use Kubernetes.md +++ b/translated/tech/20190607 5 reasons to use Kubernetes.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 reasons to use Kubernetes) @@ -9,32 +9,34 @@ 使用 Kubernetes 的 5 个理由 ====== -Kubernetes 解决了一些开发和运维团队每天关注的的常见问题。 -![][1] -[Kubernetes][2] 是企业事实上的开源容器编排工具。它提供了应用部署、扩展、容器管理和其他功能,使企业能够通过容错能力快速优化硬件资源利用率并延长生产环境运行时间。该项目最初由谷歌开发,并将该项目捐赠给[云原生计算基金会][3]。2018年,它成为第一个从 CNCF [毕业][4]的项目。 +> Kubernetes 解决了一些开发和运维团队每天关注的的常见问题。 -这一切都很好,但它并不能解释为什么开发和运维应该在 Kubernetes 上投入宝贵的时间和精力。Kubernetes 之所以如此有用,是因为它有助于开发者和运维人员迅速解决他们每天都在努力解决的问题。 +![](https://img.linux.net.cn/data/attachment/album/201906/14/110657gk2jz6f6kqff2kk4.jpg) + +[Kubernetes][2](K8S)是面向企业的开源容器编排工具的事实标准。它提供了应用部署、扩展、容器管理和其他功能,使企业能够通过容错能力快速优化硬件资源利用率并延长生产环境运行时间。该项目最初由谷歌开发,并将该项目捐赠给[云原生计算基金会][3](CNCF)。2018 年,它成为第一个从 CNCF [毕业][4]的项目。 + +这一切都很好,但它并不能解释为什么开发者和运维人员应该在 Kubernetes 上投入宝贵的时间和精力。Kubernetes 之所以如此有用,是因为它有助于开发者和运维人员迅速解决他们每天都在努力解决的问题。 以下是 Kubernetes 帮助开发者和运维人员解决他们最常见问题的五种能力。 -### 1\. 厂商无关 +### 1、厂商无关 许多公有云提供商不仅提供托管 Kubernetes 服务,还提供许多基于这些服务构建的云产品,来用于本地应用容器编排。由于与供应商无关,使运营商能够轻松、安全地设计、构建和管理多云和混合云平台,而不会有供应商锁定的风险。Kubernetes 还消除了运维团队对复杂的多云/混合云战略的担忧。 -### 2\. 服务发现 +### 2、服务发现 -为了开发微服务应用,Java 开发人员必须控制服务可用性(就应用是否可以提供服务而言),并确保服务持续存在,而没有任何例外,以响应客户端的请求。Kubernetes 的[服务发现功能][5]意味着开发人员不再需要自己管理这些东西。 +为了开发微服务应用,Java 开发人员必须控制服务可用性(就应用是否可以提供服务而言),并确保服务持续存在,以响应客户端的请求,而没有任何例外。Kubernetes 的[服务发现功能][5]意味着开发人员不再需要自己管理这些东西。 -### 3\. 触发 +### 3、触发 -你的 DevOps 会如何在上千台虚拟机上部署多语言、云原生应用?理想情况下啊,开发和运维会在 bug 修复、功能增强、新功能、安全更新时触发部署。Kubernetes 的[部署功能][6]会自动化这个每日工作。更重要的时,它支持高级部署策略,例如[蓝绿部署和金丝雀部署][7]。 +你的 DevOps 会如何在上千台虚拟机上部署多语言、云原生应用?理想情况下,开发和运维会在 bug 修复、功能增强、新功能、安全更新时触发部署。Kubernetes 的[部署功能][6]会自动化这个日常工作。更重要的时,它支持高级部署策略,例如[蓝绿部署和金丝雀部署][7]。 -### 4\. 可伸缩性 +### 4、可伸缩性 自动扩展是处理云环境中大量工作负载所需的关键功能。通过构建容器平台,你可以为终端用户提高系统可靠性。[Kubernetes Horizo​​ntal Pod Autoscaler][8](HPA)允许一个集群增加或减少应用程序(或 Pod)的数量,以应对峰值流量或性能峰值,从而减少对意外系统中断的担忧。 -### 5\. 容错性 +### 5、容错性 在现代应用体系结构中,应考虑故障处理代码来控制意外错误并快速从中恢复。但是开发人员需要花费大量的时间和精力来模拟偶然的错误。Kubernetes 的 [ReplicaSet][9] 通过确保指定数量的 Pod 持续保持活动来帮助开发人员解决此问题。 @@ -49,7 +51,7 @@ via: https://opensource.com/article/19/6/reasons-kubernetes 作者:[Daniel Oh][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/) 荣誉推出 From 53219b345e125653453d091d13c2b5654c9261b8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 14 Jun 2019 11:08:05 +0800 Subject: [PATCH 0902/1154] PUB:20190607 5 reasons to use Kubernetes.md @geekpi https://linux.cn/article-10973-1.html --- .../20190607 5 reasons to use Kubernetes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190607 5 reasons to use Kubernetes.md (98%) diff --git a/translated/tech/20190607 5 reasons to use Kubernetes.md b/published/20190607 5 reasons to use Kubernetes.md similarity index 98% rename from translated/tech/20190607 5 reasons to use Kubernetes.md rename to published/20190607 5 reasons to use Kubernetes.md index 6be5f6e242..8de8d3ad4a 100644 --- a/translated/tech/20190607 5 reasons to use Kubernetes.md +++ b/published/20190607 5 reasons to use Kubernetes.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10973-1.html) [#]: subject: (5 reasons to use Kubernetes) [#]: via: (https://opensource.com/article/19/6/reasons-kubernetes) [#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) From b96758228d788d73193f352b13c21ca807dab0ce Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 14 Jun 2019 11:22:14 +0800 Subject: [PATCH 0903/1154] PRF:20190531 Unity Editor is Now Officially Available for Linux.md @geekpi --- ...r is Now Officially Available for Linux.md | 48 +++++++++---------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md b/translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md index fcdd071c6b..241a5d039c 100644 --- a/translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md +++ b/translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Unity Editor is Now Officially Available for Linux) @@ -10,59 +10,55 @@ Unity 编辑器现已正式面向 Linux 推出 ====== -如果你是设计师、开发者或艺术家,你可能一直在使用 Linux 上的实验性 [Unity 编辑器][1]。然而,实验性版本无法永远满足 - 开发者需要一个完整稳定的工作经验。 +如果你是设计师、开发者或艺术家,你可能一直在使用 Linux 上的实验性 [Unity 编辑器][1]。然而,不能一直用实验性版本 —— 开发者需要一个完整稳定的工作经验。 因此,他们最近宣布你可以在 Linux 上使用完整功能的 Unity 编辑器了。 -虽然这是一个令人兴奋的消息,但它正式支持哪些 Linux 发行版?我们来谈谈更多细节...... +虽然这是一个令人兴奋的消息,但它正式支持哪些 Linux 发行版?我们来谈谈更多细节…… -非 FOSS 警告 +> 非 FOSS 警告 -Linux 上的 Unity 编辑器(或任何其他平台)不是开源软件。我们在这里介绍它是因为 +> Linux (或任何其他平台)上的 Unity 编辑器不是开源软件。我们在这里介绍它是因为: ### 官方支持 Ubuntu 和 CentOS 7 ![][2] -无论你拥有个人许可还是专业许可,如果你安装了 Unity 2019.1 或更高版本,都可以使用编辑器。 +无论你拥有个人许可还是专业许可,如果你安装了 Unity 2019.1 或更高版本,都可以使用该编辑器。 此外,他们优先支持 Ubuntu 16.04、Ubuntu 18.04 和 CentOS 7。 在[公告][3]中,他们还提到了支持的配置: - * x86-64 架构 -  * 运行在 X11 窗口系统之上的 Gnome 桌面环境 -  * Nvidia 官方专有显卡驱动和 AMD Mesa 显卡驱动 -  * 桌面计算机,在没有仿真或兼容层的设备/硬件上运行 +* x86-64 架构 +* 运行在 X11 窗口系统之上的 Gnome 桌面环境 +* Nvidia 官方专有显卡驱动和 AMD Mesa 显卡驱动 +* 桌面计算机,在没有仿真或兼容层的设备/硬件上运行 +你可以尝试其他的 —— 但最好坚持官方要求以获得最佳体验。 +> 关于第三方工具的说明 -你可以尝试其他的 - 但最好坚持官方要求以获得最佳体验。 +> 如果你碰巧在某个项目中使用了任何第三方工具,那么必须单独检查它们是否支持。 -关于第三方工具的说明 +### 如何在 Linux 上安装 Unity 编辑器 -如果你碰巧在任何项目中使用了任何第三方工具,那么必须单独检查它们是否支持。 +现在你已经了解了,那么该如何安装? -### 如何在 Linux 上安装Unity 编辑器 - -现在你已经了解了它,那么该如何安装? - -To install Unity, you will have to download and install the [Unity Hub][4]. 要安装 Unity,你需要下载并安装 [Unity Hub][4]。 ![Unity Hub][5] -我们将引导你完成以下步骤: - - * 从[官方论坛页面][4]下载适用于 Linux 的 Unity Hub。 -  * 它将下载一个 AppImage 文件。简单地说,让它可执行并运行它。如果你不了解它,你应该查看关于[如何在 Linux 上使用 AppImage][6] 的指南。 -  * 启动 Unity Hub 后,它会要求你使用 Unity ID 登录(或注册)以激活许可证。有关许可证生效的更多信息,请参阅他们的 [FAQ 页面][7]。 -  * 使用 Unity ID 登录后,进入“**安装**”选项(如上图所示)并添加所需的版本/组件。 +你需要完成以下步骤: +* 从[官方论坛页面][4]下载适用于 Linux 的 Unity Hub。 +* 它将下载一个 AppImage 文件。简单地说,让它可执行并运行它。如果你不了解,你应该查看关于[如何在 Linux 上使用 AppImage][6] 的指南。 +* 启动 Unity Hub 后,它会要求你使用 Unity ID 登录(或注册)以激活许可证。有关许可证生效的更多信息,请参阅他们的 [FAQ 页面][7]。 +* 使用 Unity ID 登录后,进入 “Installs” 选项(如上图所示)并添加所需的版本/组件。 就是这些了。这就是获取并快速安装的最佳方法。 -**总结** +### 总结 即使这是一个令人兴奋的消息,但官方配置支持似乎并不广泛。如果你在 Linux 上使用它,请在[他们的 Linux 论坛帖子][9]上分享你的反馈和意见。 @@ -77,7 +73,7 @@ via: https://itsfoss.com/unity-editor-linux/ 作者:[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/) 荣誉推出 From c9a44d86ecbf4bff0a06a4b18650a96381d0b45f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 14 Jun 2019 11:22:52 +0800 Subject: [PATCH 0904/1154] PUB:20190531 Unity Editor is Now Officially Available for Linux.md @geekpi https://linux.cn/article-10974-1.html --- ...0531 Unity Editor is Now Officially Available for Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190531 Unity Editor is Now Officially Available for Linux.md (98%) diff --git a/translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md b/published/20190531 Unity Editor is Now Officially Available for Linux.md similarity index 98% rename from translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md rename to published/20190531 Unity Editor is Now Officially Available for Linux.md index 241a5d039c..7b579caf06 100644 --- a/translated/tech/20190531 Unity Editor is Now Officially Available for Linux.md +++ b/published/20190531 Unity Editor is Now Officially Available for Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10974-1.html) [#]: subject: (Unity Editor is Now Officially Available for Linux) [#]: via: (https://itsfoss.com/unity-editor-linux/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From a01a7e92e98df485c64d4830bb2573d11bd22f06 Mon Sep 17 00:00:00 2001 From: chen ni Date: Fri, 14 Jun 2019 11:34:31 +0800 Subject: [PATCH 0905/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...A short primer on assemblers, compilers, and interpreters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md b/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md index db6a4c5365..cb242f5e1f 100644 --- a/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md +++ b/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chen-ni) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3d1781c0e8e3b2d3d0db4409649e03e31a1d4b8d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 14 Jun 2019 16:21:35 +0800 Subject: [PATCH 0906/1154] APL:20190610 Try a new game on Free RPG Day --- sources/tech/20190610 Try a new game on Free RPG Day.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 Try a new game on Free RPG Day.md b/sources/tech/20190610 Try a new game on Free RPG Day.md index 81319ce84f..f77071c6d7 100644 --- a/sources/tech/20190610 Try a new game on Free RPG Day.md +++ b/sources/tech/20190610 Try a new game on Free RPG Day.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 17d9ed28751c39b4427636e05d28e6a89568c3ce Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Fri, 14 Jun 2019 17:06:34 +0800 Subject: [PATCH 0907/1154] Update 20190111 Top 5 Linux Distributions for Productivity.md --- ... 5 Linux Distributions for Productivity.md | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md index 725f3bcccb..06dbc19f3e 100644 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md @@ -1,19 +1,23 @@ -[#]: collector: (lujun9972) -[#]: translator: (qfzy1233) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top 5 Linux Distributions for Productivity) -[#]: via: (https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity) -[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) +[#]: collector: "lujun9972" +[#]: translator: "qfzy1233" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Top 5 Linux Distributions for Productivity" +[#]: via: "https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity" +[#]: author: "Jack Wallen https://www.linux.com/users/jlwallen" -Top 5 Linux Distributions for Productivity +五个最具生产力的 Linux 发行版 ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_main.jpg?itok=2IKyg_7_) +必须承认的是,这样一个热门的话题其实很难被总结出来。为什么呢?首先,Linux 在设计层面就是一种有生产力的操作系统。由于她极强的可靠性和稳定的平台,使得工作的开展变得简易化。其次为了衡量工作的效率,你需要考虑到哪项工作需要得到生产力方面的助推。是普通办公?开发类工作?学校事务?数据挖掘?或者是人力资源?你可以看到这一问题变得复杂起来了。 + I have to confess, this particular topic is a tough one to address. Why? First off, Linux is a productive operating system by design. Thanks to an incredibly reliable and stable platform, getting work done is easy. Second, to gauge effectiveness, you have to consider what type of work you need a productivity boost for. General office work? Development? School? Data mining? Human resources? You see how this question can get somewhat complicated. +然而,这并不意味着 + That doesn’t mean, however, that some distributions aren’t able to do a better job of configuring and presenting that underlying operating system into an efficient platform for getting work done. Quite the contrary. Some distributions do a much better job of “getting out of the way,” so you don’t find yourself in a work-related hole, having to dig yourself out and catch up before the end of day. These distributions help strip away the complexity that can be found in Linux, thereby making your workflow painless. Let’s take a look at the distros I consider to be your best bet for productivity. To help make sense of this, I’ve divided them into categories of productivity. That task itself was challenging, because everyone’s productivity varies. For the purposes of this list, however, I’ll look at: @@ -149,22 +153,22 @@ via: https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productiv [b]: https://github.com/lujun9972 [1]: https://www.ubuntu.com/ [2]: /files/images/productivity1jpg -[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w (GNOME Clipboard) +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w "GNOME Clipboard" [4]: /licenses/category/used-permission [5]: https://labs.fedoraproject.org/en/design-suite/ [6]: https://fedoraproject.org/wiki/Design_Suite/Tutorials [7]: /files/images/productivity2jpg -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH (Fedora Design Suite Favorites) +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH "Fedora Design Suite Favorites" [9]: https://system76.com/ [10]: https://system76.com/pop [11]: /files/images/productivity3jpg-0 -[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD (Pop!_OS) +[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD "Pop!_OS" [13]: https://www.debian.org/ [14]: /files/images/productivity4jpg -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 (Debian) +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 "Debian" [16]: https://en.opensuse.org/openSUSE:Education-Li-f-e [17]: /files/images/productivity5jpg -[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT (Education) +[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT "Education" [19]: https://en.opensuse.org/Portal:KIWI-LTSP [20]: https://en.opensuse.org/SDB:KIWI-LTSP_quick_start [21]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 265bb0d87458b2275669dafe87f2b1a2a8c91739 Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Fri, 14 Jun 2019 17:07:21 +0800 Subject: [PATCH 0908/1154] Revert "Update 20190111 Top 5 Linux Distributions for Productivity.md" This reverts commit 17d9ed28751c39b4427636e05d28e6a89568c3ce. --- ... 5 Linux Distributions for Productivity.md | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md index 06dbc19f3e..725f3bcccb 100644 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md @@ -1,23 +1,19 @@ -[#]: collector: "lujun9972" -[#]: translator: "qfzy1233" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "Top 5 Linux Distributions for Productivity" -[#]: via: "https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity" -[#]: author: "Jack Wallen https://www.linux.com/users/jlwallen" +[#]: collector: (lujun9972) +[#]: translator: (qfzy1233) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top 5 Linux Distributions for Productivity) +[#]: via: (https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) -五个最具生产力的 Linux 发行版 +Top 5 Linux Distributions for Productivity ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_main.jpg?itok=2IKyg_7_) -必须承认的是,这样一个热门的话题其实很难被总结出来。为什么呢?首先,Linux 在设计层面就是一种有生产力的操作系统。由于她极强的可靠性和稳定的平台,使得工作的开展变得简易化。其次为了衡量工作的效率,你需要考虑到哪项工作需要得到生产力方面的助推。是普通办公?开发类工作?学校事务?数据挖掘?或者是人力资源?你可以看到这一问题变得复杂起来了。 - I have to confess, this particular topic is a tough one to address. Why? First off, Linux is a productive operating system by design. Thanks to an incredibly reliable and stable platform, getting work done is easy. Second, to gauge effectiveness, you have to consider what type of work you need a productivity boost for. General office work? Development? School? Data mining? Human resources? You see how this question can get somewhat complicated. -然而,这并不意味着 - That doesn’t mean, however, that some distributions aren’t able to do a better job of configuring and presenting that underlying operating system into an efficient platform for getting work done. Quite the contrary. Some distributions do a much better job of “getting out of the way,” so you don’t find yourself in a work-related hole, having to dig yourself out and catch up before the end of day. These distributions help strip away the complexity that can be found in Linux, thereby making your workflow painless. Let’s take a look at the distros I consider to be your best bet for productivity. To help make sense of this, I’ve divided them into categories of productivity. That task itself was challenging, because everyone’s productivity varies. For the purposes of this list, however, I’ll look at: @@ -153,22 +149,22 @@ via: https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productiv [b]: https://github.com/lujun9972 [1]: https://www.ubuntu.com/ [2]: /files/images/productivity1jpg -[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w "GNOME Clipboard" +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w (GNOME Clipboard) [4]: /licenses/category/used-permission [5]: https://labs.fedoraproject.org/en/design-suite/ [6]: https://fedoraproject.org/wiki/Design_Suite/Tutorials [7]: /files/images/productivity2jpg -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH "Fedora Design Suite Favorites" +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH (Fedora Design Suite Favorites) [9]: https://system76.com/ [10]: https://system76.com/pop [11]: /files/images/productivity3jpg-0 -[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD "Pop!_OS" +[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD (Pop!_OS) [13]: https://www.debian.org/ [14]: /files/images/productivity4jpg -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 "Debian" +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 (Debian) [16]: https://en.opensuse.org/openSUSE:Education-Li-f-e [17]: /files/images/productivity5jpg -[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT "Education" +[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT (Education) [19]: https://en.opensuse.org/Portal:KIWI-LTSP [20]: https://en.opensuse.org/SDB:KIWI-LTSP_quick_start [21]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From d764f0297e544a4b9c550e116bca8fb223bb7ee5 Mon Sep 17 00:00:00 2001 From: Lingxu Meng Date: Fri, 14 Jun 2019 22:09:03 +1000 Subject: [PATCH 0909/1154] Apply to translate --- .../tech/20190606 How Linux can help with your spelling.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190606 How Linux can help with your spelling.md b/sources/tech/20190606 How Linux can help with your spelling.md index 4a5330741e..345821ccea 100644 --- a/sources/tech/20190606 How Linux can help with your spelling.md +++ b/sources/tech/20190606 How Linux can help with your spelling.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Modrisco) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -249,7 +249,7 @@ via: https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-s 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Modrisco](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 29f123fdaf5f0f7084b8eee677870259c2a7886b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Jun 2019 01:49:33 +0800 Subject: [PATCH 0910/1154] TSL:20190610 Try a new game on Free RPG Day.md --- ...20190610 Try a new game on Free RPG Day.md | 80 ------------------ ...20190610 Try a new game on Free RPG Day.md | 84 +++++++++++++++++++ 2 files changed, 84 insertions(+), 80 deletions(-) delete mode 100644 sources/tech/20190610 Try a new game on Free RPG Day.md create mode 100644 translated/talk/20190610 Try a new game on Free RPG Day.md diff --git a/sources/tech/20190610 Try a new game on Free RPG Day.md b/sources/tech/20190610 Try a new game on Free RPG Day.md deleted file mode 100644 index f77071c6d7..0000000000 --- a/sources/tech/20190610 Try a new game on Free RPG Day.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Try a new game on Free RPG Day) -[#]: via: (https://opensource.com/article/19/5/free-rpg-day) -[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/erez/users/seth) - -Try a new game on Free RPG Day -====== -Celebrate tabletop role-playing games and get free RPG materials at your -local game shop on June 15. -![plastic game pieces on a board][1] - -Have you ever thought about trying Dungeons & Dragons but didn't know how to start? Did you play Traveller in your youth and have been thinking about returning to the hobby? Are you curious about role-playing games (RPGs) but not sure whether you want to play one? Are you completely new to the concept of tabletop gaming and have never heard of RPGs until now? It doesn't matter which of these profiles suits you, because [Free RPG Day][2] is for everyone! - -The first Free RPG Day event happened in 2007 at hobby game stores all over the world. The idea was to bring new and exclusive RPG quickstart rules and adventures to both new and experienced gamers for $0. For one day, you could walk into your local game store and get a booklet containing simple, beginner-level rules for a tabletop RPG, which you could play with people there in the store or with friends back home. The booklet was yours to keep forever. - -The event was such a smash hit that the tradition has continued ever since. This year, Free RPG Day is scheduled for Saturday, June 15. - -### What's the catch? - -Obviously, the idea behind Free RPG Day is to get you addicted to tabletop RPG gaming. Before you let instinctual cynicism kick in, consider that as addictions go, it's not too bad to fall in love with a game that encourages you to read books of rules and lore so you and your family and friends have an excuse to spend time together. Tabletop RPGs are a powerful, imaginative, and fun medium, and Free RPG Day is a great introduction. - -![FreeRPG Day logo][3] - -### Open gaming - -Like so many other industries, the open source phenomenon has influenced tabletop gaming. Way back at the turn of the century, [Wizards of the Coast][4], purveyors of Magic: The Gathering and Dungeons & Dragons, decided to adopt open source methodology by developing the [Open Game License][5] (OGL). They used this license for editions 3 and 3.5 of the world's first RPG (Dungeons & Dragons). When they faltered years later for the 4th Edition, the publisher of _Dragon_ magazine forked the "code" of D &D 3.5, publishing its remix as the Pathfinder RPG, keeping innovation and a whole cottage industry of third-party game developers healthy. Recently, Wizards of the Coast returned to the OGL for D&D 5e. - -The OGL allows developers to use, at the very least, a game's mechanics in a product of their own. You may or may not be allowed to use the names of custom monsters, weapons, kingdoms, or popular characters, but you can always use the rules and maths of an OGL game. In fact, the rules of an OGL game are often published for free as a [system reference document][6] (SRD) so, whether you purchase a copy of the rule book or not, you can learn how a game is played. - -If you've never played a tabletop RPG before, it may seem strange that a game played with pen and paper can have a game engine, but computation is computation whether it's digital or analog. As a simplified example: suppose a game engine dictates that a player character has a number to represent its strength. When that player character fights a giant twice its strength, there's real tension when a player rolls dice to add to her character's strength-based attack. Without a very good roll, her strength won't match the giant's. Knowing this, a third-party or independent developer can design a monster for this game engine with an understanding of the effects that dice rolls can have on a player's ability score. This means they can base their math on the game engine's precedence. They can design a slew of monsters to slay, with meaningful abilities and skills in the context of the game engine, and they can advertise compatibility with that engine. - -Furthermore, the OGL allows a publisher to define _product identity_ for their material. Product identity can be anything from the trade dress of the publication (graphical elements and layout), logos, terminology, lore, proper names, and so on. Anything defined as product identity may _not_ be reused without publisher consent. For example, suppose a publisher releases a book of weapons including a magical machete called Sigint, granting a +2 magical bonus to all of its attacks against zombies. This trait is explained by a story about how the machete was forged by a scientist with a latent zombie gene. However, the publication lists in section 1e of the OGL that all proper names of weapons are reserved as product identity. This means you can use the numbers (durability of the weapon, the damage it deals, the +2 magical bonus, and so on) and the lore associated with the sword (it was forged by a latent zombie) in your own publication, but you cannot use the name of the weapon (Sigint). - -The OGL is an extremely flexible license, so developers must read section 1e carefully. Some publishers reserve nothing but the layout of the publication itself, while others reserve everything but the numbers and the most generic of terms. - -When the preeminent RPG franchise embraced open source, it sent waves through the industry that are still felt today. Third-party developers can create content for the 5e and Pathfinder systems. A whole website, [DungeonMastersGuild.com][7], featuring independent content for D&D 5e was created by Wizards of the Coast to promote independent publishing. Games like [Starfinder][8], [OpenD6][9], [Warrior, Rogue & Mage][10], [Swords & Wizardry][11], and many others have adopted the OGL. Other systems, like Brent Newhall's [Dungeon Delvers][12], [Fate][13], [Dungeon World][14], and many more are licensed under a [Creative Commons license][15]. - -### Get your RPG - -Free RPG Day is a day for you to go to your local gaming store, play an RPG, and get materials for future RPG games you play with friends. Like a [Linux installfest][16] or [Software Freedom Day][17], the event is loosely defined. Each retailer may do Free RPG Day a little differently, each one running whatever game they choose. However, the free content donated by game publishers is the same each year. Obviously, the free stuff is subject to availability, but when you go to a Free RPG Day event, notice how many games are offered with an open license (if it's an OGL game, the OGL is printed in the back matter of the book). Any content for Pathfinder, Starfinder, and D&D is sure to have taken some advantage of the OGL. Content for many other systems use Creative Commons licenses. Some, like the resurrected [Dead Earth][18] RPG from the '90s, use the [GNU Free Documentation License][19]. - -There are plenty of gaming resources out there that are developed with open licenses. You may or may not need to care about the license of a game; after all, the license has no bearing upon whether you can play it with friends or not. But if you enjoy supporting [free culture][20] in more ways than just the software you run, try out a few OGL or Creative Commons games. If you're new to gaming entirely, try out a tabletop RPG at your local game store on Free RPG Day! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/free-rpg-day - -作者:[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/erez/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-game-play-inclusive-diversity-collaboration.png?itok=8sUXV7W1 (plastic game pieces on a board) -[2]: https://www.freerpgday.com/ -[3]: https://opensource.com/sites/default/files/uploads/freerpgday-logoblank.jpg (FreeRPG Day logo) -[4]: https://company.wizards.com/ -[5]: http://www.opengamingfoundation.org/licenses.html -[6]: https://www.d20pfsrd.com/ -[7]: https://www.dmsguild.com/ -[8]: https://paizo.com/starfinder -[9]: https://ogc.rpglibrary.org/index.php?title=OpenD6 -[10]: http://www.stargazergames.eu/games/warrior-rogue-mage/ -[11]: https://froggodgames.com/frogs/product/swords-wizardry-complete-rulebook/ -[12]: http://brentnewhall.com/games/doku.php?id=games:dungeon_delvers -[13]: http://www.faterpg.com/licensing/licensing-fate-cc-by/ -[14]: http://dungeon-world.com/ -[15]: https://creativecommons.org/ -[16]: https://www.tldp.org/HOWTO/Installfest-HOWTO/introduction.html -[17]: https://www.softwarefreedomday.org/ -[18]: https://mixedsignals.ml/games/blog/blog_dead-earth -[19]: https://www.gnu.org/licenses/fdl-1.3.en.html -[20]: https://opensource.com/article/18/1/creative-commons-real-world diff --git a/translated/talk/20190610 Try a new game on Free RPG Day.md b/translated/talk/20190610 Try a new game on Free RPG Day.md new file mode 100644 index 0000000000..c72f2b71f3 --- /dev/null +++ b/translated/talk/20190610 Try a new game on Free RPG Day.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Try a new game on Free RPG Day) +[#]: via: (https://opensource.com/article/19/5/free-rpg-day) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/erez/users/seth) + +在免费 RPG 日试玩一下新游戏 +====== + +> 6 月 15 日,你可以在当地的游戏商店庆祝桌面角色扮演游戏并获得免费的 RPG 资料。 + +![plastic game pieces on a board][1] + +(LCTT 译注:“免费 RPG 日Free RPG Day”是受“免费漫画书日Free Comic Book Day”启发而发起的庆祝活动,从 2007 年开始已经举办多次。这里的 RPG 游戏并非我们通常所指的电脑 RPG 游戏,而是指使用纸和笔的桌面游戏,是一种西方传统游戏形式。) + +你有没有想过尝试一下《龙与地下城》,但不知道如何开始?你是否在年轻时玩过《旅行者》并一直在考虑重返快乐时光?你是否对角色扮演游戏(RPG)感到好奇,但不确定你是否想玩一个?你是否对桌面游戏的概念完全陌生,直到现在才听说过这种 RPG 游戏?这些哪一个适合你并不重要,因为[免费 RPG 日] [2]适合所有人! + +第一个免费 RPG 日活动发生在 2007 年世界各地的桌面游戏商家。这个想法是以 0 美元的价格为新手和有经验的游戏玩家带来新的、独家的 RPG 快速入门规则和冒险体验。这样的一天里,你可以走进当地的桌面游戏商家,得到一本小册子,其中包含桌面 RPG 的简单的初学者规则,你可以在商家里与那里的人或者回家与朋友一起玩。这本小册子是给你的,应该一直留着的。 + +这一活动如此的受欢迎,此后该传统一直延续至今。今年,免费 RPG 日定于 6 月 15 日星期六举行。 + +### 有什么收获? + +显然,免费 RPG 日背后的想法是让你沉迷于桌面 RPG 游戏。在你让本能的犬儒主义开始之前,考虑到它会慢慢上瘾,爱上一个鼓励你阅读规则和知识的游戏并不太糟,这样你和你的家人、朋友就有了共度时光的借口了。桌面 RPG 是一个功能强大、富有想象力和有趣的媒介,而免费 RPG 日则是一个很好的介绍。 + +![FreeRPG Day logo][3] + +### 开源游戏 + +像许多其他行业一样,开源现象影响了桌面游戏。回到世纪之交,《Magic:The Gathering and Dungeons&Dragons》 的提供者[威世智公司][4]Wizards of the Coast,决定通过开发[开源游戏许可证][5]Open Game License(OGL)来采用开源方法。他们将此许可证用于世界上第一个 RPG(《龙与地下城Dungeons & Dragons》,D&D)的版本 3 和 3.5。几年后,当他们在第四版上产生了动摇时,《Dragon》杂志的出版商复刻了 D&D 3.5 的“代码”,将其混制版本发布为《开拓者Pathfinder》 RPG,保持了创新和保持了整个第三方游戏开发者产业的健康发展。最近,威世智公司在 D&D 5e 版本中才又重回了 OGL。 + +OGL 允许开发人员至少可以在他们自己产品中使用该游戏的机制。不管你允许不允许使用自定义怪物、武器、王国或流行角色的名称,但你可以随时使用 OGL 游戏的规则和数学计算。事实上,OGL 游戏的规则通常作为[系统参考文档][6](SRD)免费发布的,因此,无论你是否购买了规则书的副本,你都可以了解游戏的玩法。 + +如果你之前从未玩过桌面 RPG,那么使用笔和纸玩的游戏也可以拥有游戏引擎似乎很奇怪,但计算就是计算,不管是数字的还是模拟的。作为一个简单的例子:假设游戏引擎规定玩家角色有一个代表其力量的数字。当那个玩家角色与一个有其两倍力量的巨人战斗时,当玩家掷骰子以增加她的角色的力量攻击时,真的会感到紧张。如果没有掷出一个很好的点数的话,她的力量将无法与巨人相匹敌。知道了这一点,第三方或独立开发者就可以为这个游戏引擎设计一个怪物,同时了解骰子滚动可能对玩家的能力得分产生的影响。这意味着他们可以根据游戏引擎的优先级进行数学计算。他们可以设计一系列用来杀死的怪物,在游戏引擎的环境中它们具有有意义的能力和技能,并且他们可以宣称与该引擎的兼容性。 + +此外,OGL 允许出版商为其材料定义产品标识。产品标识可以是出版物的商业外观(图形元素和布局)、徽标、术语、传说、专有名称等。未经出版商同意,任何定义为产品标识的内容都可能**无法**重复使用。例如,假设一个出版商发行了一本武器手册,其中包括一个名为 Sigint 的魔法砍刀,它对所有针对僵尸的攻击都给予 +2 魔法附加攻击值。这个特性来自一个故事,该砍刀是一个具有潜伏的僵尸基因的科学家锻造的。但是,该出版物在 OGL 第 1e 节中列出的所有武器的正确名称都被保留为产品标识。这意味着你可以在自己的出版物中使用该数字(武器的持久性、它所造成的伤害,+2 魔法奖励等等)以及与该武器相关的传说(它由一个潜伏的僵尸锻造),但是你不能使用该武器的名称(Sigint)。 + +OGL 是一个非常灵活的许可证,因此开发人员必须仔细阅读其第 1e 节。 一些出版商只保留出版物本身的布局,而其他出版商保留除数字和最通用术语之外的所有内容。 + +当卓越的 RPG 特许经营权拥抱开源时,至今仍能感受到的它给整个行业掀起的波澜。第三方开发人员可以为 5e 和《开拓者》系统创建内容。由威世智公司创建的整个 [DungeonMastersGuild.com][7] 网站为 D&D 5e 制作了独立内容,旨在促进独立出版。[Starfinder][8]、[OpenD6][9]、[战士,盗贼和法师][10]、[剑与巫师][11] 等及很多其它游戏都采用了 OGL。其他系统,如 Brent Newhall 的 《[Dungeon Delvers][12]》、《[Fate][13]》、《[Dungeon World][14]》 等等,都是根据[知识共享许可][15]授权的的。 + +### 获取你的 RPG + +在免费 RPG 日,你可以前往当地游戏商铺,玩 RPG 以及获取与朋友将来一起玩的 RPG 游戏材料。就像[Linux 安装节][16]Linux installfest[软件自由日][17]Software Freedom Day一样,该活动的定义很松散。每个商家做的自由 RPG 日都有所不同,每个商家都可以玩他们选择的任何游戏。但是,游戏发行商捐赠的免费内容每年都是相同的。显然,免费的东西视情况而定,但是当你参加免费 RPG 日活动时,请注意有多少游戏采用了开源许可证(如果是 OGL 游戏,OGL 会打印在书背面)。《开拓者》、《Starfinder》 和 D&D 的任何内容肯定都会带有 OGL 的一些优势。许多其他系统的内容使用知识共享许可。有些则像 90 年代复活的 [Dead Earth][18] RPG 一样,使用 [GNU 自由文档许可证] [19]。 + +有大量的游戏资源是通过开源许可证开发的。你可能需要也可能不需要关心游戏的许可证;毕竟,许可证与你是否可以与朋友一起玩无关。但是如果你喜欢支持[自由文化][20]而不仅仅是你运行的软件,那么试试一些 OGL 或知识共享游戏吧。如果你不熟悉游戏,请在免费 RPG 日在当地游戏商家试用桌面 RPG 游戏! + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/free-rpg-day + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth/users/erez/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-game-play-inclusive-diversity-collaboration.png?itok=8sUXV7W1 (plastic game pieces on a board) +[2]: https://www.freerpgday.com/ +[3]: https://opensource.com/sites/default/files/uploads/freerpgday-logoblank.jpg (FreeRPG Day logo) +[4]: https://company.wizards.com/ +[5]: http://www.opengamingfoundation.org/licenses.html +[6]: https://www.d20pfsrd.com/ +[7]: https://www.dmsguild.com/ +[8]: https://paizo.com/starfinder +[9]: https://ogc.rpglibrary.org/index.php?title=OpenD6 +[10]: http://www.stargazergames.eu/games/warrior-rogue-mage/ +[11]: https://froggodgames.com/frogs/product/swords-wizardry-complete-rulebook/ +[12]: http://brentnewhall.com/games/doku.php?id=games:dungeon_delvers +[13]: http://www.faterpg.com/licensing/licensing-fate-cc-by/ +[14]: http://dungeon-world.com/ +[15]: https://creativecommons.org/ +[16]: https://www.tldp.org/HOWTO/Installfest-HOWTO/introduction.html +[17]: https://www.softwarefreedomday.org/ +[18]: https://mixedsignals.ml/games/blog/blog_dead-earth +[19]: https://www.gnu.org/licenses/fdl-1.3.en.html +[20]: https://opensource.com/article/18/1/creative-commons-real-world From e11516d82a09141ef3e58ecd2c4b08cc63d0c77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sat, 15 Jun 2019 07:11:07 +0800 Subject: [PATCH 0911/1154] Translated --- ...ry root Partition Using GParted Utility.md | 182 ------------------ ...ry root Partition Using GParted Utility.md | 181 +++++++++++++++++ 2 files changed, 181 insertions(+), 182 deletions(-) delete mode 100644 sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md create mode 100644 translated/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md diff --git a/sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md b/sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md deleted file mode 100644 index e51a216a5d..0000000000 --- a/sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md +++ /dev/null @@ -1,182 +0,0 @@ -Translating by Robsean -How To Resize Active/Primary root Partition Using GParted Utility -====== -Today we are going to discuss about disk partition. It’s one of the best topics in Linux. This allow users to resize the active root partition in Linux. - -In this article we will teach you how to resize the active root partition on Linux using Gparted utility. - -Just imagine, our system has 30GB disk and we didn’t configure properly while installation the Ubuntu operating system. - -We need to install another OS in that so we want to make secondary partition on that. - -Its not advisable to resize active partition. However, we are going to perform this as there is no way to free up the system. - -Make sure you should take backup of important data before performing this action because if something goes wrong (For example, if power got failure or your system got rebooted), you can retain your data. - -### What Is Gparted - -[GParted][1] is a free partition manager that enables you to resize, copy, and move partitions without data loss. We can use all of the features of the GParted application is by using the GParted Live bootable image. GParted Live enables you to use GParted on GNU/Linux as well as other operating systems, such as Windows or Mac OS X. - -### 1) Check Disk Space Usage Using df Command - -I just want to show you about my partition using df command. The df command output clearly showing that i only have one partition. -``` -$ df -h -Filesystem Size Used Avail Use% Mounted on -/dev/sda1 30G 3.4G 26.2G 16% / -none 4.0K 0 4.0K 0% /sys/fs/cgroup -udev 487M 4.0K 487M 1% /dev -tmpfs 100M 844K 99M 1% /run -none 5.0M 0 5.0M 0% /run/lock -none 498M 152K 497M 1% /run/shm -none 100M 52K 100M 1% /run/user - -``` - -### 2) Check Disk Partition Using fdisk Command - -I’m going to verify this using fdisk command. -``` -$ sudo fdisk -l -[sudo] password for daygeek: - -Disk /dev/sda: 33.1 GB, 33129218048 bytes -255 heads, 63 sectors/track, 4027 cylinders, total 64705504 sectors -Units = sectors of 1 * 512 = 512 bytes -Sector size (logical/physical): 512 bytes / 512 bytes -I/O size (minimum/optimal): 512 bytes / 512 bytes -Disk identifier: 0x000473a3 - - Device Boot Start End Blocks Id System -/dev/sda1 * 2048 62609407 31303680 83 Linux -/dev/sda2 62611454 64704511 1046529 5 Extended -/dev/sda5 62611456 64704511 1046528 82 Linux swap / Solaris - -``` - -### 3) Download GParted live ISO Image - -Use the below command to download GParted live ISO to perform this action. -``` -$ wget https://downloads.sourceforge.net/gparted/gparted-live-0.31.0-1-amd64.iso - -``` - -### 4) Boot Your System With GParted Live Installation Media - -Boot your system with GParted live installation media (like Burned CD/DVD or USB or ISO image). You will get the output similar to below screen. Here choose **GParted Live (Default settings)** and hit **Enter**. -![][3] - -### 5) Keyboard Selection - -By default it chooses the second option, just hit **Enter**. -![][4] - -### 6) Language Selection - -By default it chooses **33** for US English, just hit **Enter**. -![][5] - -### 7) Mode Selection (GUI or Command-Line) - -By default it chooses **0** for GUI mode, just hit **Enter**. -![][6] - -### 8) Loaded GParted Live Screen - -Now, GParted live screen is loaded. It is showing the list of partition which was created by me earlier. -![][7] - -### 9) How To Resize The root Partition - -Choose the root partition you want to resize, only one partition is available here so i’m going to edit that partition to install another OS. -![][8] - -To do so, press **Resize/Move** button to resize the partition. -![][9] - -Here, enter the size which you want take out from this partition in first box. I’m going to claim **10GB** so, i added **10240MB** and leave rest of boxes as default, then hit **Resize/Move** button -![][10] - -It will ask you once again to confirm to resize the partition because you are editing the live system partition, then hit **Ok**. -![][11] - -It has been successfully shrink the partition from 30GB to 20GB. Also shows Unallocated disk space of 10GB. -![][12] - -Finally click `Apply` button to perform remaining below operations. -![][13] - - * **`e2fsck`** e2fsck is a file system check utility that automatically repair the file system for bad sectors, I/O errors related to HDD. - * **`resize2fs`** The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. - * **`e2image`** The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file specified by image-file. - - - -**`e2fsck`** e2fsck is a file system check utility that automatically repair the file system for bad sectors, I/O errors related to HDD. -![][14] - -**`resize2fs`** The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. -![][15] - -**`e2image`** The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file specified by image-file. -![][16] - -All the operation got completed and close the dialog box. -![][17] - -Now, i could able to see **10GB** of Unallocated disk partition. -![][18] - -Reboot the system to check this. -![][19] - -### 10) Check Free Space - -Login to the system back and use fdisk command to see the available space in the partition. Yes i could see **10GB** of Unallocated disk space on this partition. -``` -$ sudo parted /dev/sda print free -[sudo] password for daygeek: -Model: ATA VBOX HARDDISK (scsi) -Disk /dev/sda: 32.2GB -Sector size (logical/physical): 512B/512B -Partition Table: msdos -Disk Flags: - -Number Start End Size Type File system Flags - 32.3kB 10.7GB 10.7GB Free Space - 1 10.7GB 32.2GB 21.5GB primary ext4 boot - -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility/ - -作者:[Magesh Maruthamuthu][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.2daygeek.com/author/magesh/ -[1]:https://gparted.org/ -[2]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[3]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-1.png -[4]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-2.png -[5]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-3.png -[6]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-4.png -[7]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-5.png -[8]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-6.png -[9]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-7.png -[10]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-8.png -[11]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-9.png -[12]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-10.png -[13]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-11.png -[14]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-12.png -[15]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-13.png -[16]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-14.png -[17]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-15.png -[18]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-16.png -[19]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-17.png diff --git a/translated/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md b/translated/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md new file mode 100644 index 0000000000..75da8117bb --- /dev/null +++ b/translated/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md @@ -0,0 +1,181 @@ +如何使用 GParted 实用工具重新调整活动/主要的 root 分区 +====== +今天,我们将讨论磁盘分区。这是在 Linux 中一个最好的主题。这允许用户来重新调整在 Linux 中的活动 root 分区。 + +在这篇文章中,我们将教你如何使用 Gparted 使用工具重新调整在 Linux 上的活动 root 分区。 + +想象,我们的系统仅有30 GB 磁盘,当我们安装 Ubuntu 操作系统时,并没有恰当地配置。 + +我们需要在其中安装另一个操作系统,因此我们想在其中制作第二个分区。 + +不建议重新调整活动分区。然而,我们将执行这个操作,因为没有其它方法来释放系统。 + +在执行这个动作前,确保你备份重要的数据,因为如果一些东西出错(例如,电源故障或你的系统重启),你可以继续保留你的数据。 + +### Gparted 是什么 + +[GParted][1] 是一个自由的分区管理器,它使你能够重新调整大小,复制,和移动分区,而不丢失数据。通过使用 GParted Live 可启动镜像,我们可以使用 GParted 应用程序的所有特色。 GParted Live 使你能够在 GNU/Linux 以及其它的操作系统上使用 GParted ,例如,Windows 或 Mac OS X 。 + +### 1) 使用 df 命令检查磁盘空间利用率 + +我只是想使用 df 命令向你显示我的分区。 df 命令输出清楚地表明我仅有一个分区。 +``` +$ df -h +Filesystem Size Used Avail Use% Mounted on +/dev/sda1 30G 3.4G 26.2G 16% / +none 4.0K 0 4.0K 0% /sys/fs/cgroup +udev 487M 4.0K 487M 1% /dev +tmpfs 100M 844K 99M 1% /run +none 5.0M 0 5.0M 0% /run/lock +none 498M 152K 497M 1% /run/shm +none 100M 52K 100M 1% /run/user + +``` + +### 2) 使用 fdisk 命令检查磁盘分区 + +我将使用 fdisk 命令验证这一点。 +``` +$ sudo fdisk -l +[sudo] password for daygeek: + +Disk /dev/sda: 33.1 GB, 33129218048 bytes +255 heads, 63 sectors/track, 4027 cylinders, total 64705504 sectors +Units = sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +I/O size (minimum/optimal): 512 bytes / 512 bytes +Disk identifier: 0x000473a3 + + Device Boot Start End Blocks Id System +/dev/sda1 * 2048 62609407 31303680 83 Linux +/dev/sda2 62611454 64704511 1046529 5 Extended +/dev/sda5 62611456 64704511 1046528 82 Linux swap / Solaris + +``` + +### 3) 下载 GParted live ISO 镜像 + +使用下面的命令来执行下载 GParted live ISO 。 +``` +$ wget https://downloads.sourceforge.net/gparted/gparted-live-0.31.0-1-amd64.iso + +``` + +### 4) 使用 GParted Live 安装介质启动你的系统 + +使用 GParted Live 安装介质(像烧录的 CD/DVD 或 USB 或 ISO 镜像)启动你的系统。你将获得类似于下面屏幕的输出。在这里选择 **GParted Live (Default settings)** ,并敲击 **Enter** 按键。 +![][3] + +### 5) 键盘选择 + +默认情况下,它选择第二个选项,仅敲击 **Enter** 按键。 +![][4] + +### 6) 语言选择 + +默认情况下,它选择 **33** 美国英语,仅敲击 **Enter** 按键。 +![][5] + +### 7) 模式选择(图形用户界面或命令行) + +默认情况下,它选择 **0** 图形用户界面模式,仅敲击 **Enter** 按键。 +![][6] + +### 8) 加载 GParted Live 屏幕 + +现在,GParted live 屏幕已经加载,它显示我以前创建的分区列表。 +![][7] + +### 9) 如何重新调整 root 分区大小 + +选择你想重新调整大小的 root 分区,在这里仅一个分区,所以我将编辑这个分区以便于安装另一个操作系统。 +![][8] + +为做到这一点,按下 **Resize/Move** 按钮来重新调整分区大小。 +![][9] + +现在,在第一个框中输入你想从这个分区中取出的大小。我将索要**10GB**,所以,我添加**10240MB**,并保留框的剩余部分为默认值,然后点击 **Resize/Move** 按钮。 +![][10] + +它将再次要求你确认重新调整分区的大小,因为你正在编辑活动的系统分区,然后点击 **Ok**。 +![][11] + +分区从 30GB 缩小到 20GB 已经成功。也显示 10GB 未分配的磁盘空间。 +![][12] + +最后点击 `Apply` 按钮来执行下面剩余的操作。 +![][13] + + * **`e2fsck`** e2fsck 是一个文件系统检查实用程序,自动修复文件系统中与 HDD 相关的坏扇道,I/O 错误。 + * **`resize2fs`** resize2fs 程序将重新调整 ext2 ,ext3,或 ext4 文件系统的大小。它可以被用于扩大或缩小一个位于设备上的未挂载的文件系统。 + * **`e2image`** e2image 程序将保存位于设备上的关键的 ext2 ,ext3 ,或 ext4 文件系统元数据到一个由镜像文件规定是文件中。 + + + +**`e2fsck`** 是一个文件系统检查实用程序,自动修复文件系统中与 HDD 相关的坏扇道,I/O 错误。 +![][14] + +**`resize2fs`** resize2fs 程序将重新调整 ext2 ,ext3,或 ext4 文件系统的大小。它可以被用于扩大或缩小一个位于设备上的未挂载的文件系统。 +![][15] + +**`e2image`** e2image 程序将保存位于设备上的关键的 ext2 ,ext3 ,或 ext4 文件系统元数据到一个由镜像文件规定是文件中。 +![][16] + +所有的操作完成,关闭对话框。 +![][17] + +现在,我们可以看到未分配的 **10GB** 磁盘分区。 +![][18] + +重启系统来检查这一结果。 +![][19] + +### 10) 检查剩余空间 + +重新登陆系统,并使用 fdisk 命令来查看在分区中可用的空间。是的,我可以看到这个分区上未分配的 **10GB** 磁盘空间。 +``` +$ sudo parted /dev/sda print free +[sudo] password for daygeek: +Model: ATA VBOX HARDDISK (scsi) +Disk /dev/sda: 32.2GB +Sector size (logical/physical): 512B/512B +Partition Table: msdos +Disk Flags: + +Number Start End Size Type File system Flags + 32.3kB 10.7GB 10.7GB Free Space + 1 10.7GB 32.2GB 21.5GB primary ext4 boot + +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility/ + +作者:[Magesh Maruthamuthu][a] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) +选题:[lujun9972](https://github.com/lujun9972) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.2daygeek.com/author/magesh/ +[1]:https://gparted.org/ +[2]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[3]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-1.png +[4]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-2.png +[5]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-3.png +[6]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-4.png +[7]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-5.png +[8]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-6.png +[9]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-7.png +[10]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-8.png +[11]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-9.png +[12]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-10.png +[13]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-11.png +[14]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-12.png +[15]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-13.png +[16]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-14.png +[17]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-15.png +[18]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-16.png +[19]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-17.png From 831913c3d91927bde9cd7b4408f1ee5eb1b72406 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Jun 2019 10:39:26 +0800 Subject: [PATCH 0912/1154] PRF:20190610 Try a new game on Free RPG Day.md @wxy --- ...20190610 Try a new game on Free RPG Day.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/talk/20190610 Try a new game on Free RPG Day.md b/translated/talk/20190610 Try a new game on Free RPG Day.md index c72f2b71f3..83d6b919d6 100644 --- a/translated/talk/20190610 Try a new game on Free RPG Day.md +++ b/translated/talk/20190610 Try a new game on Free RPG Day.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Try a new game on Free RPG Day) @@ -10,31 +10,31 @@ 在免费 RPG 日试玩一下新游戏 ====== -> 6 月 15 日,你可以在当地的游戏商店庆祝桌面角色扮演游戏并获得免费的 RPG 资料。 +> 6 月 15 日,你可以在当地的游戏商家庆祝桌面角色扮演游戏并获得免费的 RPG 资料。 -![plastic game pieces on a board][1] +![plastic game pieces on a board](https://img.linux.net.cn/data/attachment/album/201906/15/103929zqshc08df49dv0c2.jpg) (LCTT 译注:“免费 RPG 日Free RPG Day”是受“免费漫画书日Free Comic Book Day”启发而发起的庆祝活动,从 2007 年开始已经举办多次。这里的 RPG 游戏并非我们通常所指的电脑 RPG 游戏,而是指使用纸和笔的桌面游戏,是一种西方传统游戏形式。) -你有没有想过尝试一下《龙与地下城》,但不知道如何开始?你是否在年轻时玩过《旅行者》并一直在考虑重返快乐时光?你是否对角色扮演游戏(RPG)感到好奇,但不确定你是否想玩一个?你是否对桌面游戏的概念完全陌生,直到现在才听说过这种 RPG 游戏?这些哪一个适合你并不重要,因为[免费 RPG 日] [2]适合所有人! +你有没有想过尝试一下《龙与地下城Dungeons & Dragons》,但不知道如何开始?你是否在年轻时玩过《开拓者Pathfinder》并一直在考虑重返快乐时光?你是否对角色扮演游戏(RPG)感到好奇,但不确定你是否想玩一个?你是否对桌面游戏的概念完全陌生,直到现在才听说过这种 RPG 游戏?无论是哪一个并不重要,因为[免费 RPG 日] [2]适合所有人! -第一个免费 RPG 日活动发生在 2007 年世界各地的桌面游戏商家。这个想法是以 0 美元的价格为新手和有经验的游戏玩家带来新的、独家的 RPG 快速入门规则和冒险体验。这样的一天里,你可以走进当地的桌面游戏商家,得到一本小册子,其中包含桌面 RPG 的简单的初学者规则,你可以在商家里与那里的人或者回家与朋友一起玩。这本小册子是给你的,应该一直留着的。 +第一个免费 RPG 日活动发生在 2007 年,是由世界各地的桌面游戏商家举办的。这个想法是以 0 美元的价格为新手和有经验的游戏玩家带来新的、独家的 RPG 快速入门规则和冒险体验。在这样的一天里,你可以走进当地的桌面游戏商家,得到一本小册子,其中包含桌面 RPG 的简单的初学者规则,你可以在商家里与那里的人或者回家与朋友一起玩。这本小册子是给你的,应该一直留着的。 这一活动如此的受欢迎,此后该传统一直延续至今。今年,免费 RPG 日定于 6 月 15 日星期六举行。 ### 有什么收获? -显然,免费 RPG 日背后的想法是让你沉迷于桌面 RPG 游戏。在你让本能的犬儒主义开始之前,考虑到它会慢慢上瘾,爱上一个鼓励你阅读规则和知识的游戏并不太糟,这样你和你的家人、朋友就有了共度时光的借口了。桌面 RPG 是一个功能强大、富有想象力和有趣的媒介,而免费 RPG 日则是一个很好的介绍。 +显然,免费 RPG 日背后的想法是让你沉迷于桌面 RPG 游戏。但在你本能的犬儒主义开始之前,考虑到它会慢慢上瘾,爱上一个鼓励你阅读规则和知识的游戏并不太糟,这样你和你的家人、朋友就有了共度时光的借口了。桌面 RPG 是一个功能强大、富有想象力和有趣的媒介,而免费 RPG 日则是对这种游戏很好的介绍。 ![FreeRPG Day logo][3] ### 开源游戏 -像许多其他行业一样,开源现象影响了桌面游戏。回到世纪之交,《Magic:The Gathering and Dungeons&Dragons》 的提供者[威世智公司][4]Wizards of the Coast,决定通过开发[开源游戏许可证][5]Open Game License(OGL)来采用开源方法。他们将此许可证用于世界上第一个 RPG(《龙与地下城Dungeons & Dragons》,D&D)的版本 3 和 3.5。几年后,当他们在第四版上产生了动摇时,《Dragon》杂志的出版商复刻了 D&D 3.5 的“代码”,将其混制版本发布为《开拓者Pathfinder》 RPG,保持了创新和保持了整个第三方游戏开发者产业的健康发展。最近,威世智公司在 D&D 5e 版本中才又重回了 OGL。 +像许多其他行业一样,开源现象影响了桌面游戏。回到世纪之交,《Magic:The Gathering and Dungeons&Dragons》 的提供者[威世智公司][4]Wizards of the Coast决定通过开发[开源游戏许可证][5]Open Game License(OGL)来采用开源方法。他们将此许可证用于世界上第一个 RPG(《龙与地下城Dungeons & Dragons》,D&D)的版本 3 和 3.5。几年后,当他们在第四版上(对开源)产生了动摇时,《Dragon》杂志的出版商复刻了 D&D 3.5 的“代码”,将其混制版本发布为《开拓者Pathfinder》 RPG,从而保持了创新和整个第三方游戏开发者产业的健康发展。最近,威世智公司在 D&D 5e 版本中才又重回了 OGL。 -OGL 允许开发人员至少可以在他们自己产品中使用该游戏的机制。不管你允许不允许使用自定义怪物、武器、王国或流行角色的名称,但你可以随时使用 OGL 游戏的规则和数学计算。事实上,OGL 游戏的规则通常作为[系统参考文档][6](SRD)免费发布的,因此,无论你是否购买了规则书的副本,你都可以了解游戏的玩法。 +OGL 允许开发人员至少可以在他们自己产品中使用该游戏的机制。不管你可以不可以使用自定义怪物、武器、王国或流行角色的名称,但你可以随时使用 OGL 游戏的规则和数学计算。事实上,OGL 游戏的规则通常作为[系统参考文档][6](SRD)免费发布的,因此,无论你是否购买了规则书的副本,你都可以了解游戏的玩法。 -如果你之前从未玩过桌面 RPG,那么使用笔和纸玩的游戏也可以拥有游戏引擎似乎很奇怪,但计算就是计算,不管是数字的还是模拟的。作为一个简单的例子:假设游戏引擎规定玩家角色有一个代表其力量的数字。当那个玩家角色与一个有其两倍力量的巨人战斗时,当玩家掷骰子以增加她的角色的力量攻击时,真的会感到紧张。如果没有掷出一个很好的点数的话,她的力量将无法与巨人相匹敌。知道了这一点,第三方或独立开发者就可以为这个游戏引擎设计一个怪物,同时了解骰子滚动可能对玩家的能力得分产生的影响。这意味着他们可以根据游戏引擎的优先级进行数学计算。他们可以设计一系列用来杀死的怪物,在游戏引擎的环境中它们具有有意义的能力和技能,并且他们可以宣称与该引擎的兼容性。 +如果你之前从未玩过桌面 RPG,那么使用笔和纸玩的游戏也可以拥有游戏引擎似乎很奇怪,但计算就是计算,不管是数字的还是模拟的。作为一个简单的例子:假设游戏引擎规定玩家角色有一个代表其力量的数字。当那个玩家角色与一个有其两倍力量的巨人战斗时,在玩家掷骰子以增加她的角色的力量攻击时,真的会感到紧张。如果没有掷出一个很好的点数的话,她的力量将无法与巨人相匹敌。知道了这一点,第三方或独立开发者就可以为这个游戏引擎设计一个怪物,同时了解骰子滚动可能对玩家的能力得分产生的影响。这意味着他们可以根据游戏引擎的优先级进行数学计算。他们可以设计一系列用来杀死的怪物,在游戏引擎的环境中它们具有有意义的能力和技能,并且他们可以宣称与该引擎的兼容性。 此外,OGL 允许出版商为其材料定义产品标识。产品标识可以是出版物的商业外观(图形元素和布局)、徽标、术语、传说、专有名称等。未经出版商同意,任何定义为产品标识的内容都可能**无法**重复使用。例如,假设一个出版商发行了一本武器手册,其中包括一个名为 Sigint 的魔法砍刀,它对所有针对僵尸的攻击都给予 +2 魔法附加攻击值。这个特性来自一个故事,该砍刀是一个具有潜伏的僵尸基因的科学家锻造的。但是,该出版物在 OGL 第 1e 节中列出的所有武器的正确名称都被保留为产品标识。这意味着你可以在自己的出版物中使用该数字(武器的持久性、它所造成的伤害,+2 魔法奖励等等)以及与该武器相关的传说(它由一个潜伏的僵尸锻造),但是你不能使用该武器的名称(Sigint)。 @@ -44,9 +44,9 @@ OGL 是一个非常灵活的许可证,因此开发人员必须仔细阅读其 ### 获取你的 RPG -在免费 RPG 日,你可以前往当地游戏商铺,玩 RPG 以及获取与朋友将来一起玩的 RPG 游戏材料。就像[Linux 安装节][16]Linux installfest[软件自由日][17]Software Freedom Day一样,该活动的定义很松散。每个商家做的自由 RPG 日都有所不同,每个商家都可以玩他们选择的任何游戏。但是,游戏发行商捐赠的免费内容每年都是相同的。显然,免费的东西视情况而定,但是当你参加免费 RPG 日活动时,请注意有多少游戏采用了开源许可证(如果是 OGL 游戏,OGL 会打印在书背面)。《开拓者》、《Starfinder》 和 D&D 的任何内容肯定都会带有 OGL 的一些优势。许多其他系统的内容使用知识共享许可。有些则像 90 年代复活的 [Dead Earth][18] RPG 一样,使用 [GNU 自由文档许可证] [19]。 +在免费 RPG 日,你可以前往当地游戏商铺,玩 RPG 以及获取与朋友将来一起玩的 RPG 游戏材料。就像[Linux 安装节][16]Linux installfest[软件自由日][17]Software Freedom Day一样,该活动的定义很松散。每个商家举办的自由 RPG 日都有所不同,每个商家都可以玩他们选择的任何游戏。但是,游戏发行商捐赠的免费内容每年都是相同的。显然,免费的东西视情况而定,但是当你参加免费 RPG 日活动时,请注意有多少游戏采用了开源许可证(如果是 OGL 游戏,OGL 会打印在书背面)。《开拓者》、《Starfinder》 和 D&D 的任何内容肯定都会带有 OGL 的一些优势。许多其他系统的内容使用知识共享许可。有些则像 90 年代复活的 [Dead Earth][18] RPG 一样,使用 [GNU 自由文档许可证] [19]。 -有大量的游戏资源是通过开源许可证开发的。你可能需要也可能不需要关心游戏的许可证;毕竟,许可证与你是否可以与朋友一起玩无关。但是如果你喜欢支持[自由文化][20]而不仅仅是你运行的软件,那么试试一些 OGL 或知识共享游戏吧。如果你不熟悉游戏,请在免费 RPG 日在当地游戏商家试用桌面 RPG 游戏! +有大量的游戏资源是通过开源许可证开发的。你可能需要也可能不需要关心游戏的许可证;毕竟,许可证与你是否可以与朋友一起玩无关。但是如果你喜欢支持[自由文化][20]而不仅仅是你运行的软件,那么试试一些 OGL 或知识共享游戏吧。如果你不熟悉游戏,请在免费 RPG 日在当地游戏商家试玩桌面 RPG 游戏! -------------------------------------------------------------------------------- @@ -56,7 +56,7 @@ via: https://opensource.com/article/19/5/free-rpg-day 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 341f7a953953cabd8b4d3ed84583d9163ea76150 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Jun 2019 10:40:03 +0800 Subject: [PATCH 0913/1154] PUB:20190610 Try a new game on Free RPG Day.md @wxy https://linux.cn/article-10976-1.html --- .../20190610 Try a new game on Free RPG Day.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190610 Try a new game on Free RPG Day.md (99%) diff --git a/translated/talk/20190610 Try a new game on Free RPG Day.md b/published/20190610 Try a new game on Free RPG Day.md similarity index 99% rename from translated/talk/20190610 Try a new game on Free RPG Day.md rename to published/20190610 Try a new game on Free RPG Day.md index 83d6b919d6..64e95e2ac3 100644 --- a/translated/talk/20190610 Try a new game on Free RPG Day.md +++ b/published/20190610 Try a new game on Free RPG Day.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10976-1.html) [#]: subject: (Try a new game on Free RPG Day) [#]: via: (https://opensource.com/article/19/5/free-rpg-day) [#]: author: (Seth Kenlon https://opensource.com/users/seth/users/erez/users/seth) From 2e6d02704ffd1746050872c0836ddd8f915d0904 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Jun 2019 14:18:22 +0800 Subject: [PATCH 0914/1154] PRF:20180831 Get desktop notifications from Emacs shell commands .md @lujun9972 --- ...p notifications from Emacs shell commands .md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/tech/20180831 Get desktop notifications from Emacs shell commands .md b/translated/tech/20180831 Get desktop notifications from Emacs shell commands .md index b0ef5dd76f..04c59ad191 100644 --- a/translated/tech/20180831 Get desktop notifications from Emacs shell commands .md +++ b/translated/tech/20180831 Get desktop notifications from Emacs shell commands .md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Get desktop notifications from Emacs shell commands ·) @@ -10,11 +10,11 @@ 让 Emacs shell 命令发送桌面通知 ====== -我总是使用 [Eshell][1] 来与操作系统进行交互,因为它与 Emacs 无缝整合、支持处理 (远程) [TRAMP][2] 文件 而且在 Windows 上也能工作得很好。 +我总是使用 [Eshell][1] 来与操作系统进行交互,因为它与 Emacs 无缝整合、支持处理 (远程) [TRAMP][2] 文件,而且在 Windows 上也能工作得很好。 -启动 shell 命令后 (比如耗时严重的构建任务) 我经常会由于切换 buffer 而忘了追踪任务的运行状态。 +启动 shell 命令后 (比如耗时严重的构建任务) 我经常会由于切换缓冲区而忘了追踪任务的运行状态。 -多亏了 Emacs 的 [hooks][3] 机制,你可以配置 Emacs 在某个外部命令完成后调用一个 elisp 函数。 +多亏了 Emacs 的 [钩子][3] 机制,你可以配置 Emacs 在某个外部命令完成后调用一个 elisp 函数。 我使用 [John Wiegleys][4] 所编写的超棒的 [alert][5] 包来发送桌面通知: @@ -33,7 +33,7 @@ (add-hook 'eshell-kill-hook #'eshell-command-alert) ``` -[alert][5] 的规则可以用程序来设置。就我这个情况来看,我只需要当对应的 buffer 不可见时被通知: +[alert][5] 的规则可以用程序来设置。就我这个情况来看,我只需要当对应的缓冲区不可见时得到通知: ``` (alert-add-rule :status '(buried) ;only send alert when buffer not visible @@ -44,7 +44,7 @@ 这甚至对于 [TRAMP][2] 也一样生效。下面这个截屏展示了失败的 `make` 命令产生的 Gnome 桌面通知。 -![。./。./img/eshell.png][6] +![../../img/eshell.png][6] -------------------------------------------------------------------------------- @@ -53,7 +53,7 @@ via: https://blog.hoetzel.info/post/eshell-notifications/ 作者:[Jürgen Hötzel][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -64,4 +64,4 @@ via: https://blog.hoetzel.info/post/eshell-notifications/ [3]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html (hooks) [4]: https://github.com/jwiegley (John Wiegleys) [5]: https://github.com/jwiegley/alert (alert) -[6]: https://blog.hoetzel.info/img/eshell.png (../../img/eshell.png) +[6]: https://blog.hoetzel.info/img/eshell.png From 6a47bd1e7cb29fc52ac6ba1bd9ace0bcb6e2a394 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Jun 2019 14:19:03 +0800 Subject: [PATCH 0915/1154] PUB:20180831 Get desktop notifications from Emacs shell commands .md @lujun9972 https://linux.cn/article-10977-1.html --- ...31 Get desktop notifications from Emacs shell commands .md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20180831 Get desktop notifications from Emacs shell commands .md (97%) diff --git a/translated/tech/20180831 Get desktop notifications from Emacs shell commands .md b/published/20180831 Get desktop notifications from Emacs shell commands .md similarity index 97% rename from translated/tech/20180831 Get desktop notifications from Emacs shell commands .md rename to published/20180831 Get desktop notifications from Emacs shell commands .md index 04c59ad191..773e650420 100644 --- a/translated/tech/20180831 Get desktop notifications from Emacs shell commands .md +++ b/published/20180831 Get desktop notifications from Emacs shell commands .md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10977-1.html) [#]: subject: (Get desktop notifications from Emacs shell commands ·) [#]: via: (https://blog.hoetzel.info/post/eshell-notifications/) [#]: author: (Jürgen Hötzel https://blog.hoetzel.info) From 2f94e3bfeb31c23168e6f0d195ea61560056cee1 Mon Sep 17 00:00:00 2001 From: Lingxu Meng Date: Sat, 15 Jun 2019 16:49:20 +1000 Subject: [PATCH 0916/1154] Finish translating --- ...6 How Linux can help with your spelling.md | 263 ----------------- ...6 How Linux can help with your spelling.md | 264 ++++++++++++++++++ 2 files changed, 264 insertions(+), 263 deletions(-) delete mode 100644 sources/tech/20190606 How Linux can help with your spelling.md create mode 100644 translated/tech/20190606 How Linux can help with your spelling.md diff --git a/sources/tech/20190606 How Linux can help with your spelling.md b/sources/tech/20190606 How Linux can help with your spelling.md deleted file mode 100644 index 345821ccea..0000000000 --- a/sources/tech/20190606 How Linux can help with your spelling.md +++ /dev/null @@ -1,263 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Modrisco) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How Linux can help with your spelling) -[#]: via: (https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-spelling.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How Linux can help with your spelling -====== -Whether you're struggling with one elusive word or checking a report before you send it off to your boss, Linux can help with your spelling. -![Sandra Henry-Stocker][1] - -Linux provides all sorts of tools for data analysis and automation, but it also helps with an issue that we all struggle with from time to time – spelling! Whether you're grappling with the spelling of a single word while you’re writing your weekly report or you want a set of computerized "eyes" to find your typos before you submit a business proposal, maybe it’s time to check out how it can help. - -### look - -One tool is **look**. If you know how a word begins, you can ask the look command for provide a list of words that start with those letters. Unless an alternate word source is provided, look uses **/usr/share/dict/words** to identify the words for you. This file with its hundreds of thousands of words will suffice for most of the English words that we routinely use, but it might not have some of the more obscure words that some of us in the computing field tend to use — such as zettabyte. - -**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** - -The look command's syntax is as easy as can be. Type "look word" and it will run through all the words in that words file and find matches for you. - -``` -$ look amelio -ameliorable -ameliorableness -ameliorant -ameliorate -ameliorated -ameliorates -ameliorating -amelioration -ameliorations -ameliorativ -ameliorative -amelioratively -ameliorator -amelioratory -``` - -If you happen upon a word that isn't included in the word list on the system, you'll simply get no output. - -``` -$ look zetta -$ -``` - -Don’t despair if you're not seeing what you were hoping for. You can add words to your words file or even reference an altogether different words list — either finding one online and creating one yourself. You don't even have to place an added word in the proper alphabetical location; just add it to the end of the file. You do need to do this as root, however. For example (and be careful with that **> >**!): - -``` -# echo “zettabyte” >> /usr/share/dict/words -``` - -Using a different list of words ("jargon" in this case) just requires adding the name of the file. Use a full path if the file is not the default. - -``` -$ look nybble /usr/share/dict/jargon -nybble -nybbles -``` - -The look command is also case-insensitive, so you don't have to concern yourself with whether the word you're looking for should be capitalized or not. - -``` -$ look zet -ZETA -Zeta -zeta -zetacism -Zetana -zetas -Zetes -zetetic -Zethar -Zethus -Zetland -Zetta -``` - -Of course, not all word lists are created equal. Some Linux distributions provide a _lot_ more words than others in their word files. Yours might have 100,000 words or many times that number. - -On one of my Linux systems: - -``` -$ wc -l /usr/share/dict/words -102402 /usr/share/dict/words -``` - -On another: - -``` -$ wc -l /usr/share/dict/words -479828 /usr/share/dict/words -``` - -Remember that the look command works only with the beginnings of words, but there are other options if you don't want to start there. - -### grep - -Our dearly beloved **grep** command can pluck words from a word file as well as any tool. If you’re looking for words that start or end with particular letters, grep is a natural. It can match words using beginnings, endings, or middle portions of words. Your system's word file will work with grep as easily as it does with look. The only drawback is that unlike with look, you have to specify the file. - -Using word beginnings with ^: - -``` -$ grep ^terra /usr/share/dict/words -terrace -terrace's -terraced -terraces -terracing -terrain -terrain's -terrains -terrapin -terrapin's -terrapins -terraria -terrarium -terrarium's -terrariums -``` - -Using word endings with $: - -``` -$ grep bytes$ /usr/share/dict/words -bytes -gigabytes -kilobytes -megabytes -terabytes -``` - -With grep, you do need to concern yourself with capitalization, but the command provides some options for that. - -``` -$ grep ^[Zz]et /usr/share/dict/words -Zeta -zeta -zetacism -Zetana -zetas -Zetes -zetetic -Zethar -Zethus -Zetland -Zetta -zettabyte -``` - -Setting up a symbolic link to the words file makes this kind of word search a little easier: - -``` -$ ln -s /usr/share/dict/words words -$ grep ^[Zz]et words -Zeta -zeta -zetacism -Zetana -zetas -Zetes -zetetic -Zethar -Zethus -Zetland -Zetta -zettabytye -``` - -### aspell - -The aspell command takes a different approach. It provides a way to check the spelling in whatever file or text you provide to it. You can pipe text to it and have it tell you which words appear to be misspelled. If you’re spelling all the words correctly, you’ll see no output. - -``` -$ echo Did I mispell that? | aspell list -mispell -$ echo I can hardly wait to try out aspell | aspell list -aspell -$ echo Did I misspell anything? | aspell list -$ -``` - -The "list" argument tells aspell to provide a list of misspelled words in the words that are sent through standard input. - -You can also use aspell to locate and correct words in a text file. If it finds a misspelled word, it will offer you an opportunity to replace it from a list of similar (but correctly spelled) words, to accept the words and add them to your personal words list (~/.aspell.en.pws), to ignore the misspelling, or to abort the process altogether (leaving the file as it was before you started). - -``` -$ aspell -c mytext -``` - -Once aspell finds a word that’s misspelled, it offers a list of choices like these for the incorrect "mispell": - -``` -1) mi spell 6) misplay -2) mi-spell 7) spell -3) misspell 8) misapply -4) Ispell 9) Aspell -5) misspells 0) dispel -i) Ignore I) Ignore all -r) Replace R) Replace all -a) Add l) Add Lower -b) Abort x) Exit -``` - -Note that the alternate words and spellings are numbered, while other options are represented by letter choices. You can choose one of the suggested spellings or opt to type a replacement. The "Abort" choice will leave the file intact even if you've already chosen replacements for some words. Words you elect to add will be inserted into a local file (e.g., ~/.aspell.en.pws). - -### Alternate word lists - -Tired of English? The aspell command can work with other languages if you add a word file for them. To add a dictionary for French on Debian systems, for example, you could do this: - -``` -$ sudo apt install aspell-fr -``` - -This new dictionary file would be installed as /usr/share/dict/French. To use it, you would simply need to tell aspell that you want to use the alternate word list: - -``` -$ aspell --lang=fr -c mytext -``` - -When using, you might see something like this if aspell looks at the word “one”: - -``` -1) once 6) orné -2) onde 7) ne -3) ondé 8) né -4) onze 9) on -5) orne 0) cône -i) Ignore I) Ignore all -r) Replace R) Replace all -a) Add l) Add Lower -b) Abort x) Exit -``` - -You can also get other language word lists from [GNU][3]. - -### Wrap-up - -Even if you're a national spelling bee winner, you probably need a little help with spelling every now and then — if only to spot your typos. The aspell tool, along with look and grep, are ready to come to your rescue. - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-spelling.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[Modrisco](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/linux-spelling-100798596-large.jpg -[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua -[3]: ftp://ftp.gnu.org/gnu/aspell/dict/0index.html -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190606 How Linux can help with your spelling.md b/translated/tech/20190606 How Linux can help with your spelling.md new file mode 100644 index 0000000000..8c842a797e --- /dev/null +++ b/translated/tech/20190606 How Linux can help with your spelling.md @@ -0,0 +1,264 @@ +[#]: collector: (lujun9972) +[#]: translator: (Modrisco) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Linux can help with your spelling) +[#]: via: (https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-spelling.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何用 Linux 帮助你拼写 +====== +无论你在处理一个难以理解的单词,还是在将报告发给老板之前再检查一遍,Linux 都可以帮助你解决拼写问题。 +![Sandra Henry-Stocker][1] + +Linux 为数据分析和自动化提供了各种工具,它也帮助我们解决了一个一直都在纠结的问题 —— 拼写!无论在写每周报告时努力拼出一个单词,还是在提交商业计划书之前想要借助计算机的“眼睛”来找出你的拼写错误。现在我们来看一下它是如何帮助你的。 + +### look + +**look** 是其中一款工具。如果你知道一个单词是怎么开始拼的,你就可以用这个命令来获取以这些字母开头的单词列表。除非提供了替代词源,否则 look 将使用 **/usr/share/dict/words** 中的内容来为你标识单词。这个文件有数十万个单词,可以满足我们日常使用的大多数英语单词的需要,但是它可能不包含我们计算机领域中的一些人倾向于使用的更加生僻的单词,如 zettabyte。 + +**[ 两分钟的Linux技巧:[在这些两分钟的视频教程中学习如何掌握一系列 Linux 命令][2] ]**(Youtube 源) + +look 命令的语法非常简单。输入 `look word` ,它将遍历单词文件中的所有单词并找到匹配项。 + +``` +$ look amelio +ameliorable +ameliorableness +ameliorant +ameliorate +ameliorated +ameliorates +ameliorating +amelioration +ameliorations +ameliorativ +ameliorative +amelioratively +ameliorator +amelioratory +``` + +如果你遇到系统中单词列表中未包含的单词,将无法获得任何输出。 + +``` +$ look zetta +$ +``` + +如果你没有看到你所希望出现的单词,不要绝望。你可以在你的单词文件中添加单词,甚至引用一个完全不同的单词列表,在网上找一个或者干脆自己创建一个。你甚至不必将添加的单词放在按字母顺序排列的正确位置;只需将其添加到文件的末尾即可。但是,你必须以 root 用户身份执行此操作。例如(要注意 **> >**!): + +``` +# echo “zettabyte” >> /usr/share/dict/words +``` + +当使用不同的单词列表时,例如这个例子中的 “jargon” ,你只需要添加文件的名称。如果文件不是默认值,请使用完整路径。 + +``` +$ look nybble /usr/share/dict/jargon +nybble +nybbles +``` + +look 命令大小写不敏感,因此你不必关心要查找的单词是否应该大写。 + +``` +$ look zet +ZETA +Zeta +zeta +zetacism +Zetana +zetas +Zetes +zetetic +Zethar +Zethus +Zetland +Zetta +``` + +当然,不是所有的单词列表都是一样的。一些 Linux 发行版在单词文件中提供了 _多得多_ 的内容。你的文件中可能有十万或者更多倍的单词。 + +在我的一个 Linux 系统中: + +``` +$ wc -l /usr/share/dict/words +102402 /usr/share/dict/words +``` + +在另一个系统中: + +``` +$ wc -l /usr/share/dict/words +479828 /usr/share/dict/words +``` + +请记住,look 命令只适用于单词的开头,但如果你不想从单词的开头开始,还可以使用其他选项。 + +### grep + +我们深爱的 **grep** 命令像其他工具一样可以从一个单词文件中选出单词。如果你正在找以某些字母开头或结尾的单词,使用 grep 命令是自然而然的事情。它可以通过单词的开头,结尾或中间部分来匹配单词。系统中的单词文件可以像使用 look 命令时在 grep 命令中轻松使用。不过唯一的缺点是你需要指定文件,这一点与 look 不尽相同。 + + +在单词的开头前加上 ^: + +``` +$ grep ^terra /usr/share/dict/words +terrace +terrace's +terraced +terraces +terracing +terrain +terrain's +terrains +terrapin +terrapin's +terrapins +terraria +terrarium +terrarium's +terrariums +``` + +在单词的结尾后加上 $: + +``` +$ grep bytes$ /usr/share/dict/words +bytes +gigabytes +kilobytes +megabytes +terabytes +``` + +使用 grep 时,你需要考虑大小写,不过 grep 命令也提供了一些选项。 + +``` +$ grep ^[Zz]et /usr/share/dict/words +Zeta +zeta +zetacism +Zetana +zetas +Zetes +zetetic +Zethar +Zethus +Zetland +Zetta +zettabyte +``` + +为单词文件添加软连接能使这种搜索方式更加便捷: + +``` +$ ln -s /usr/share/dict/words words +$ grep ^[Zz]et words +Zeta +zeta +zetacism +Zetana +zetas +Zetes +zetetic +Zethar +Zethus +Zetland +Zetta +zettabytye +``` + +### aspell + +aspell 命令提供了一种不同的方式。它提供了一种方法来检查你提供给它的任何文件或文本的拼写。你可以通过管道将文本传递给它,然后它会告诉你哪些单词看起来有拼写错误。如果所有单词都拼写正确,则不会有任何输出。 + +``` +$ echo Did I mispell that? | aspell list +mispell +$ echo I can hardly wait to try out aspell | aspell list +aspell +$ echo Did I misspell anything? | aspell list +$ +``` + +“list” 参数告诉 aspell 为标准输入单词提供拼写错误的单词列表。 + +你还可以使用 aspell 来定位和更正文本文件中的单词。如果它发现一个拼写错误的单词,它将为你提供一个相似(但拼写正确的)单词列表来替换这个单词。你也可以将单词加入个人词库(~/.aspell.en.pws)来接收并忽略拼写错误。或者完全中止进程(使文件保持启动前的状态)。 + +``` +$ aspell -c mytext +``` + +一旦 aspell 发现一个单词出现了拼写错误,它将会为不正确的 “mispell” 提供一个选项列表: + +``` +1) mi spell 6) misplay +2) mi-spell 7) spell +3) misspell 8) misapply +4) Ispell 9) Aspell +5) misspells 0) dispel +i) Ignore I) Ignore all +r) Replace R) Replace all +a) Add l) Add Lower +b) Abort x) Exit +``` + +请注意,备选单词和拼写是数字编号的,而其他选项是由字母选项表示的。你可以选择备选拼写中的一项或者自己输入替换项。“Abort” 选项将使文件保持不变,即使你已经为某些单词选择了替换。你选择添加的单词将被插入到本地文件中(例如 ~/.aspell.en.pws)。 + +### 其他单词列表 + +厌倦了英语? aspell 命令可以在其他语言中使用,只要你添加了相关语言的单词列表。例如,在 Debian 系统中添加法语的词库,你可以这样做: + +``` +$ sudo apt install aspell-fr +``` + +这个新的词库文件会被安装为 /usr/share/dict/French。为了使用它,你只需要简单地告诉 aspell 你想要使用替换的单词列表: + +``` +$ aspell --lang=fr -c mytext +``` + +这种情况下,当 aspell 读到单词 “one” 时,你可能会看到下面的情况: + +``` +1) once 6) orné +2) onde 7) ne +3) ondé 8) né +4) onze 9) on +5) orne 0) cône +i) Ignore I) Ignore all +r) Replace R) Replace all +a) Add l) Add Lower +b) Abort x) Exit +``` + +你也可以通过 [GNU][3] 来获取其他语言的词库。 + +### 总结 + +即使你是全国拼字比赛的冠军,你可能偶尔也会需要一点拼写方面的帮助,哪怕只是为了找出你手滑打错的单词。aspell 工具,加上 look 和 grep 命令已经准备来助你一臂之力了。 + +加入[Facebook][4] 和 [LinkedIn][5] 的 Network World 社区,评论热点话题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-spelling.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[Modrisco](https://github.com/Modrisco) +校对:[校对者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/linux-spelling-100798596-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: ftp://ftp.gnu.org/gnu/aspell/dict/0index.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 461dbd4bac37a812b5112b8677fc7763858962c2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Jun 2019 14:50:35 +0800 Subject: [PATCH 0917/1154] PRF:20180416 How To Resize Active-Primary root Partition Using GParted Utility.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @robsean 虽然这篇文章简单,要是仔细用心,可以做的更好,请参照我的校对以了解~ --- ...ry root Partition Using GParted Utility.md | 136 ++++++++++-------- 1 file changed, 73 insertions(+), 63 deletions(-) diff --git a/translated/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md b/translated/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md index 75da8117bb..4afa58fffa 100644 --- a/translated/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md +++ b/translated/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md @@ -1,40 +1,40 @@ -如何使用 GParted 实用工具重新调整活动/主要的 root 分区 +如何使用 GParted 实用工具缩放根分区 ====== -今天,我们将讨论磁盘分区。这是在 Linux 中一个最好的主题。这允许用户来重新调整在 Linux 中的活动 root 分区。 -在这篇文章中,我们将教你如何使用 Gparted 使用工具重新调整在 Linux 上的活动 root 分区。 +今天,我们将讨论磁盘分区。这是 Linux 中的一个好话题。这允许用户来重新调整在 Linux 中的活动 root 分区。 -想象,我们的系统仅有30 GB 磁盘,当我们安装 Ubuntu 操作系统时,并没有恰当地配置。 +在这篇文章中,我们将教你如何使用 GParted 缩放在 Linux 上的活动根分区。 -我们需要在其中安装另一个操作系统,因此我们想在其中制作第二个分区。 +比如说,当我们安装 Ubuntu 操作系统时,并没有恰当地配置,我们的系统仅有 30 GB 磁盘。我们需要安装另一个操作系统,因此我们想在其中制作第二个分区。 -不建议重新调整活动分区。然而,我们将执行这个操作,因为没有其它方法来释放系统。 +虽然不建议重新调整活动分区。然而,我们要执行这个操作,因为没有其它方法来释放系统分区。 -在执行这个动作前,确保你备份重要的数据,因为如果一些东西出错(例如,电源故障或你的系统重启),你可以继续保留你的数据。 +> 注意:在执行这个动作前,确保你备份了重要的数据,因为如果一些东西出错(例如,电源故障或你的系统重启),你可以得以保留你的数据。 ### Gparted 是什么 -[GParted][1] 是一个自由的分区管理器,它使你能够重新调整大小,复制,和移动分区,而不丢失数据。通过使用 GParted Live 可启动镜像,我们可以使用 GParted 应用程序的所有特色。 GParted Live 使你能够在 GNU/Linux 以及其它的操作系统上使用 GParted ,例如,Windows 或 Mac OS X 。 +[GParted][1] 是一个自由的分区管理器,它使你能够缩放、复制和移动分区,而不丢失数据。通过使用 GParted 的 Live 可启动镜像,我们可以使用 GParted 应用程序的所有功能。GParted Live 可以使你能够在 GNU/Linux 以及其它的操作系统上使用 GParted,例如,Windows 或 Mac OS X 。 -### 1) 使用 df 命令检查磁盘空间利用率 +#### 1) 使用 df 命令检查磁盘空间利用率 + +我只是想使用 `df` 命令向你显示我的分区。`df` 命令输出清楚地表明我仅有一个分区。 -我只是想使用 df 命令向你显示我的分区。 df 命令输出清楚地表明我仅有一个分区。 ``` $ df -h -Filesystem Size Used Avail Use% Mounted on -/dev/sda1 30G 3.4G 26.2G 16% / -none 4.0K 0 4.0K 0% /sys/fs/cgroup -udev 487M 4.0K 487M 1% /dev -tmpfs 100M 844K 99M 1% /run -none 5.0M 0 5.0M 0% /run/lock -none 498M 152K 497M 1% /run/shm -none 100M 52K 100M 1% /run/user - +Filesystem Size Used Avail Use% Mounted on +/dev/sda1 30G 3.4G 26.2G 16% / +none 4.0K 0 4.0K 0% /sys/fs/cgroup +udev 487M 4.0K 487M 1% /dev +tmpfs 100M 844K 99M 1% /run +none 5.0M 0 5.0M 0% /run/lock +none 498M 152K 497M 1% /run/shm +none 100M 52K 100M 1% /run/user ``` -### 2) 使用 fdisk 命令检查磁盘分区 +#### 2) 使用 fdisk 命令检查磁盘分区 + +我将使用 `fdisk` 命令验证这一点。 -我将使用 fdisk 命令验证这一点。 ``` $ sudo fdisk -l [sudo] password for daygeek: @@ -46,106 +46,116 @@ Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000473a3 - Device Boot Start End Blocks Id System -/dev/sda1 * 2048 62609407 31303680 83 Linux -/dev/sda2 62611454 64704511 1046529 5 Extended -/dev/sda5 62611456 64704511 1046528 82 Linux swap / Solaris - + Device Boot Start End Blocks Id System +/dev/sda1 * 2048 62609407 31303680 83 Linux +/dev/sda2 62611454 64704511 1046529 5 Extended +/dev/sda5 62611456 64704511 1046528 82 Linux swap / Solaris ``` -### 3) 下载 GParted live ISO 镜像 +#### 3) 下载 GParted live ISO 镜像 + +使用下面的命令来执行下载 GParted live ISO。 -使用下面的命令来执行下载 GParted live ISO 。 ``` $ wget https://downloads.sourceforge.net/gparted/gparted-live-0.31.0-1-amd64.iso - ``` -### 4) 使用 GParted Live 安装介质启动你的系统 +#### 4) 使用 GParted Live 安装介质启动你的系统 + +使用 GParted Live 安装介质(如烧录的 CD/DVD 或 USB 或 ISO 镜像)启动你的系统。你将获得类似于下面屏幕的输出。在这里选择 “GParted Live (Default settings)” ,并敲击回车按键。 -使用 GParted Live 安装介质(像烧录的 CD/DVD 或 USB 或 ISO 镜像)启动你的系统。你将获得类似于下面屏幕的输出。在这里选择 **GParted Live (Default settings)** ,并敲击 **Enter** 按键。 ![][3] -### 5) 键盘选择 +#### 5) 键盘选择 + +默认情况下,它选择第二个选项,按下回车即可。 -默认情况下,它选择第二个选项,仅敲击 **Enter** 按键。 ![][4] -### 6) 语言选择 +#### 6) 语言选择 + +默认情况下,它选择 “33” 美国英语,按下回车即可。 -默认情况下,它选择 **33** 美国英语,仅敲击 **Enter** 按键。 ![][5] -### 7) 模式选择(图形用户界面或命令行) +#### 7) 模式选择(图形用户界面或命令行) + +默认情况下,它选择 “0” 图形用户界面模式,按下回车即可。 -默认情况下,它选择 **0** 图形用户界面模式,仅敲击 **Enter** 按键。 ![][6] -### 8) 加载 GParted Live 屏幕 +#### 8) 加载 GParted Live 屏幕 + +现在,GParted Live 屏幕已经加载,它显示我以前创建的分区列表。 -现在,GParted live 屏幕已经加载,它显示我以前创建的分区列表。 ![][7] -### 9) 如何重新调整 root 分区大小 +#### 9) 如何重新调整根分区大小 + +选择你想重新调整大小的根分区,在这里仅有一个分区,所以我将编辑这个分区以便于安装另一个操作系统。 -选择你想重新调整大小的 root 分区,在这里仅一个分区,所以我将编辑这个分区以便于安装另一个操作系统。 ![][8] -为做到这一点,按下 **Resize/Move** 按钮来重新调整分区大小。 +为做到这一点,按下 “Resize/Move” 按钮来重新调整分区大小。 + ![][9] -现在,在第一个框中输入你想从这个分区中取出的大小。我将索要**10GB**,所以,我添加**10240MB**,并保留框的剩余部分为默认值,然后点击 **Resize/Move** 按钮。 +现在,在第一个框中输入你想从这个分区中取出的大小。我将索要 “10GB”,所以,我添加 “10240MB”,并让该对话框的其余部分为默认值,然后点击 “Resize/Move” 按钮。 + ![][10] -它将再次要求你确认重新调整分区的大小,因为你正在编辑活动的系统分区,然后点击 **Ok**。 +它将再次要求你确认重新调整分区的大小,因为你正在编辑活动的系统分区,然后点击 “Ok”。 + ![][11] 分区从 30GB 缩小到 20GB 已经成功。也显示 10GB 未分配的磁盘空间。 + ![][12] -最后点击 `Apply` 按钮来执行下面剩余的操作。 +最后点击 “Apply” 按钮来执行下面剩余的操作。 + ![][13] - * **`e2fsck`** e2fsck 是一个文件系统检查实用程序,自动修复文件系统中与 HDD 相关的坏扇道,I/O 错误。 - * **`resize2fs`** resize2fs 程序将重新调整 ext2 ,ext3,或 ext4 文件系统的大小。它可以被用于扩大或缩小一个位于设备上的未挂载的文件系统。 - * **`e2image`** e2image 程序将保存位于设备上的关键的 ext2 ,ext3 ,或 ext4 文件系统元数据到一个由镜像文件规定是文件中。 +`e2fsck` 是一个文件系统检查实用程序,自动修复文件系统中与 HDD 相关的坏扇道、I/O 错误。 - - -**`e2fsck`** 是一个文件系统检查实用程序,自动修复文件系统中与 HDD 相关的坏扇道,I/O 错误。 ![][14] -**`resize2fs`** resize2fs 程序将重新调整 ext2 ,ext3,或 ext4 文件系统的大小。它可以被用于扩大或缩小一个位于设备上的未挂载的文件系统。 +`resize2fs` 程序将重新调整 ext2、ext3 或 ext4 文件系统的大小。它可以被用于扩大或缩小一个位于设备上的未挂载的文件系统。 + ![][15] -**`e2image`** e2image 程序将保存位于设备上的关键的 ext2 ,ext3 ,或 ext4 文件系统元数据到一个由镜像文件规定是文件中。 +`e2image` 程序将保存位于设备上的关键的 ext2、ext3 或 ext4 文件系统的元数据到一个指定文件中。 + ![][16] 所有的操作完成,关闭对话框。 + ![][17] -现在,我们可以看到未分配的 **10GB** 磁盘分区。 +现在,我们可以看到未分配的 “10GB” 磁盘分区。 + ![][18] 重启系统来检查这一结果。 + ![][19] -### 10) 检查剩余空间 +#### 10) 检查剩余空间 + +重新登录系统,并使用 `fdisk` 命令来查看在分区中可用的空间。是的,我可以看到这个分区上未分配的 “10GB” 磁盘空间。 -重新登陆系统,并使用 fdisk 命令来查看在分区中可用的空间。是的,我可以看到这个分区上未分配的 **10GB** 磁盘空间。 ``` $ sudo parted /dev/sda print free -[sudo] password for daygeek: +[sudo] password for daygeek: Model: ATA VBOX HARDDISK (scsi) Disk /dev/sda: 32.2GB Sector size (logical/physical): 512B/512B Partition Table: msdos -Disk Flags: - -Number Start End Size Type File system Flags - 32.3kB 10.7GB 10.7GB Free Space - 1 10.7GB 32.2GB 21.5GB primary ext4 boot +Disk Flags: +Number Start End Size Type File system Flags + 32.3kB 10.7GB 10.7GB Free Space + 1 10.7GB 32.2GB 21.5GB primary ext4 boot ``` -------------------------------------------------------------------------------- @@ -154,7 +164,7 @@ via: https://www.2daygeek.com/how-to-resize-active-primary-root-partition-in-lin 作者:[Magesh Maruthamuthu][a] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 选题:[lujun9972](https://github.com/lujun9972) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d7550e3e17ec4e96ccaab862aabd060a2f834b18 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Jun 2019 15:17:10 +0800 Subject: [PATCH 0918/1154] PUB:20180416 How To Resize Active-Primary root Partition Using GParted Utility.md @robsean https://linux.cn/article-10978-1.html --- ... Resize Active-Primary root Partition Using GParted Utility.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md (100%) diff --git a/translated/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md b/published/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md similarity index 100% rename from translated/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md rename to published/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md From 3a0d8d52b205a00057aa7deac48f6f198618bf92 Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Sat, 15 Jun 2019 16:27:39 +0800 Subject: [PATCH 0919/1154] Revert "Revert "Update 20190111 Top 5 Linux Distributions for Productivity.md"" This reverts commit 265bb0d87458b2275669dafe87f2b1a2a8c91739. --- ... 5 Linux Distributions for Productivity.md | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md index 725f3bcccb..06dbc19f3e 100644 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md @@ -1,19 +1,23 @@ -[#]: collector: (lujun9972) -[#]: translator: (qfzy1233) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top 5 Linux Distributions for Productivity) -[#]: via: (https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity) -[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) +[#]: collector: "lujun9972" +[#]: translator: "qfzy1233" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Top 5 Linux Distributions for Productivity" +[#]: via: "https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity" +[#]: author: "Jack Wallen https://www.linux.com/users/jlwallen" -Top 5 Linux Distributions for Productivity +五个最具生产力的 Linux 发行版 ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_main.jpg?itok=2IKyg_7_) +必须承认的是,这样一个热门的话题其实很难被总结出来。为什么呢?首先,Linux 在设计层面就是一种有生产力的操作系统。由于她极强的可靠性和稳定的平台,使得工作的开展变得简易化。其次为了衡量工作的效率,你需要考虑到哪项工作需要得到生产力方面的助推。是普通办公?开发类工作?学校事务?数据挖掘?或者是人力资源?你可以看到这一问题变得复杂起来了。 + I have to confess, this particular topic is a tough one to address. Why? First off, Linux is a productive operating system by design. Thanks to an incredibly reliable and stable platform, getting work done is easy. Second, to gauge effectiveness, you have to consider what type of work you need a productivity boost for. General office work? Development? School? Data mining? Human resources? You see how this question can get somewhat complicated. +然而,这并不意味着 + That doesn’t mean, however, that some distributions aren’t able to do a better job of configuring and presenting that underlying operating system into an efficient platform for getting work done. Quite the contrary. Some distributions do a much better job of “getting out of the way,” so you don’t find yourself in a work-related hole, having to dig yourself out and catch up before the end of day. These distributions help strip away the complexity that can be found in Linux, thereby making your workflow painless. Let’s take a look at the distros I consider to be your best bet for productivity. To help make sense of this, I’ve divided them into categories of productivity. That task itself was challenging, because everyone’s productivity varies. For the purposes of this list, however, I’ll look at: @@ -149,22 +153,22 @@ via: https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productiv [b]: https://github.com/lujun9972 [1]: https://www.ubuntu.com/ [2]: /files/images/productivity1jpg -[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w (GNOME Clipboard) +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w "GNOME Clipboard" [4]: /licenses/category/used-permission [5]: https://labs.fedoraproject.org/en/design-suite/ [6]: https://fedoraproject.org/wiki/Design_Suite/Tutorials [7]: /files/images/productivity2jpg -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH (Fedora Design Suite Favorites) +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH "Fedora Design Suite Favorites" [9]: https://system76.com/ [10]: https://system76.com/pop [11]: /files/images/productivity3jpg-0 -[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD (Pop!_OS) +[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD "Pop!_OS" [13]: https://www.debian.org/ [14]: /files/images/productivity4jpg -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 (Debian) +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 "Debian" [16]: https://en.opensuse.org/openSUSE:Education-Li-f-e [17]: /files/images/productivity5jpg -[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT (Education) +[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT "Education" [19]: https://en.opensuse.org/Portal:KIWI-LTSP [20]: https://en.opensuse.org/SDB:KIWI-LTSP_quick_start [21]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 609c1babb4845e21eddc42ff29d9e17f5590477d Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Sat, 15 Jun 2019 16:27:42 +0800 Subject: [PATCH 0920/1154] Revert "Update 20190111 Top 5 Linux Distributions for Productivity.md" This reverts commit 17d9ed28751c39b4427636e05d28e6a89568c3ce. --- ... 5 Linux Distributions for Productivity.md | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md index 06dbc19f3e..725f3bcccb 100644 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md @@ -1,23 +1,19 @@ -[#]: collector: "lujun9972" -[#]: translator: "qfzy1233" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "Top 5 Linux Distributions for Productivity" -[#]: via: "https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity" -[#]: author: "Jack Wallen https://www.linux.com/users/jlwallen" +[#]: collector: (lujun9972) +[#]: translator: (qfzy1233) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top 5 Linux Distributions for Productivity) +[#]: via: (https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) -五个最具生产力的 Linux 发行版 +Top 5 Linux Distributions for Productivity ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_main.jpg?itok=2IKyg_7_) -必须承认的是,这样一个热门的话题其实很难被总结出来。为什么呢?首先,Linux 在设计层面就是一种有生产力的操作系统。由于她极强的可靠性和稳定的平台,使得工作的开展变得简易化。其次为了衡量工作的效率,你需要考虑到哪项工作需要得到生产力方面的助推。是普通办公?开发类工作?学校事务?数据挖掘?或者是人力资源?你可以看到这一问题变得复杂起来了。 - I have to confess, this particular topic is a tough one to address. Why? First off, Linux is a productive operating system by design. Thanks to an incredibly reliable and stable platform, getting work done is easy. Second, to gauge effectiveness, you have to consider what type of work you need a productivity boost for. General office work? Development? School? Data mining? Human resources? You see how this question can get somewhat complicated. -然而,这并不意味着 - That doesn’t mean, however, that some distributions aren’t able to do a better job of configuring and presenting that underlying operating system into an efficient platform for getting work done. Quite the contrary. Some distributions do a much better job of “getting out of the way,” so you don’t find yourself in a work-related hole, having to dig yourself out and catch up before the end of day. These distributions help strip away the complexity that can be found in Linux, thereby making your workflow painless. Let’s take a look at the distros I consider to be your best bet for productivity. To help make sense of this, I’ve divided them into categories of productivity. That task itself was challenging, because everyone’s productivity varies. For the purposes of this list, however, I’ll look at: @@ -153,22 +149,22 @@ via: https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productiv [b]: https://github.com/lujun9972 [1]: https://www.ubuntu.com/ [2]: /files/images/productivity1jpg -[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w "GNOME Clipboard" +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w (GNOME Clipboard) [4]: /licenses/category/used-permission [5]: https://labs.fedoraproject.org/en/design-suite/ [6]: https://fedoraproject.org/wiki/Design_Suite/Tutorials [7]: /files/images/productivity2jpg -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH "Fedora Design Suite Favorites" +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH (Fedora Design Suite Favorites) [9]: https://system76.com/ [10]: https://system76.com/pop [11]: /files/images/productivity3jpg-0 -[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD "Pop!_OS" +[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD (Pop!_OS) [13]: https://www.debian.org/ [14]: /files/images/productivity4jpg -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 "Debian" +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 (Debian) [16]: https://en.opensuse.org/openSUSE:Education-Li-f-e [17]: /files/images/productivity5jpg -[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT "Education" +[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT (Education) [19]: https://en.opensuse.org/Portal:KIWI-LTSP [20]: https://en.opensuse.org/SDB:KIWI-LTSP_quick_start [21]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 2e80b1f9164e2f6d43af8123c0ea0aa3d85ae85a Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Sat, 15 Jun 2019 16:33:53 +0800 Subject: [PATCH 0921/1154] Revert "Revert "Update 20190111 Top 5 Linux Distributions for Productivity.md"" This reverts commit 265bb0d87458b2275669dafe87f2b1a2a8c91739. --- ... 5 Linux Distributions for Productivity.md | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md index 725f3bcccb..06dbc19f3e 100644 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md @@ -1,19 +1,23 @@ -[#]: collector: (lujun9972) -[#]: translator: (qfzy1233) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top 5 Linux Distributions for Productivity) -[#]: via: (https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity) -[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) +[#]: collector: "lujun9972" +[#]: translator: "qfzy1233" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Top 5 Linux Distributions for Productivity" +[#]: via: "https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity" +[#]: author: "Jack Wallen https://www.linux.com/users/jlwallen" -Top 5 Linux Distributions for Productivity +五个最具生产力的 Linux 发行版 ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_main.jpg?itok=2IKyg_7_) +必须承认的是,这样一个热门的话题其实很难被总结出来。为什么呢?首先,Linux 在设计层面就是一种有生产力的操作系统。由于她极强的可靠性和稳定的平台,使得工作的开展变得简易化。其次为了衡量工作的效率,你需要考虑到哪项工作需要得到生产力方面的助推。是普通办公?开发类工作?学校事务?数据挖掘?或者是人力资源?你可以看到这一问题变得复杂起来了。 + I have to confess, this particular topic is a tough one to address. Why? First off, Linux is a productive operating system by design. Thanks to an incredibly reliable and stable platform, getting work done is easy. Second, to gauge effectiveness, you have to consider what type of work you need a productivity boost for. General office work? Development? School? Data mining? Human resources? You see how this question can get somewhat complicated. +然而,这并不意味着 + That doesn’t mean, however, that some distributions aren’t able to do a better job of configuring and presenting that underlying operating system into an efficient platform for getting work done. Quite the contrary. Some distributions do a much better job of “getting out of the way,” so you don’t find yourself in a work-related hole, having to dig yourself out and catch up before the end of day. These distributions help strip away the complexity that can be found in Linux, thereby making your workflow painless. Let’s take a look at the distros I consider to be your best bet for productivity. To help make sense of this, I’ve divided them into categories of productivity. That task itself was challenging, because everyone’s productivity varies. For the purposes of this list, however, I’ll look at: @@ -149,22 +153,22 @@ via: https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productiv [b]: https://github.com/lujun9972 [1]: https://www.ubuntu.com/ [2]: /files/images/productivity1jpg -[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w (GNOME Clipboard) +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w "GNOME Clipboard" [4]: /licenses/category/used-permission [5]: https://labs.fedoraproject.org/en/design-suite/ [6]: https://fedoraproject.org/wiki/Design_Suite/Tutorials [7]: /files/images/productivity2jpg -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH (Fedora Design Suite Favorites) +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH "Fedora Design Suite Favorites" [9]: https://system76.com/ [10]: https://system76.com/pop [11]: /files/images/productivity3jpg-0 -[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD (Pop!_OS) +[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD "Pop!_OS" [13]: https://www.debian.org/ [14]: /files/images/productivity4jpg -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 (Debian) +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 "Debian" [16]: https://en.opensuse.org/openSUSE:Education-Li-f-e [17]: /files/images/productivity5jpg -[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT (Education) +[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT "Education" [19]: https://en.opensuse.org/Portal:KIWI-LTSP [20]: https://en.opensuse.org/SDB:KIWI-LTSP_quick_start [21]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 39c126158fd5244da7b453bfa214253d7f39d013 Mon Sep 17 00:00:00 2001 From: LuMing <784315443@qq.com> Date: Sat, 15 Jun 2019 17:12:18 +0800 Subject: [PATCH 0922/1154] translated --- ...eech Recognition-Speech-to-Text Systems.md | 131 ------------------ ...eech Recognition-Speech-to-Text Systems.md | 127 +++++++++++++++++ 2 files changed, 127 insertions(+), 131 deletions(-) delete mode 100644 sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md create mode 100644 translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md diff --git a/sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md b/sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md deleted file mode 100644 index a817b6ff5e..0000000000 --- a/sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (luuming) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 Good Open Source Speech Recognition/Speech-to-Text Systems) -[#]: via: (https://fosspost.org/lists/open-source-speech-recognition-speech-to-text) -[#]: author: (Simon James https://fosspost.org/author/simonjames) - -5 Good Open Source Speech Recognition/Speech-to-Text Systems -====== - -![](https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/open-source-speech-recognition-speech-to-text.png?resize=1237%2C527&ssl=1) - -A speech-to-text (STT) system is as its name implies; A way of transforming the spoken words via sound into textual files that can be used later for any purpose. - -Speech-to-text technology is extremely useful. It can be used for a lot of applications such as a automation of transcription, writing books/texts using your own sound only, enabling complicated analyses on information using the generated textual files and a lot of other things. - -In the past, the speech-to-text technology was dominated by proprietary software and libraries; Open source alternatives didn’t exist or existed with extreme limitations and no community around. This is changing, today there are a lot of open source speech-to-text tools and libraries that you can use right now. - -Here we list 5 of them. - -### Open Source Speech Recognition Libraries - -#### Project DeepSpeech - -![5 Good Open Source Speech Recognition/Speech-to-Text Systems 15 open source speech recognition][1] - -This project is made by Mozilla; The organization behind the Firefox browser. It’s a 100% free and open source speech-to-text library that also implies the machine learning technology using TensorFlow framework to fulfill its mission. - -In other words, you can use it to build training models yourself to enhance the underlying speech-to-text technology and get better results, or even to bring it to other languages if you want. You can also easily integrate it to your other machine learning projects that you are having on TensorFlow. Sadly it sounds like the project is currently only supporting English by default. - -It’s also available in many languages such as Python (3.6); Which allows you to have it working in seconds: - -``` -pip3 install deepspeech -deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio my_audio_file.wav -``` - -You can also install it using npm: - -``` -npm install deepspeech -``` - -For more information, refer to the [project’s homepage][2]. - -#### Kaldi - -![5 Good Open Source Speech Recognition/Speech-to-Text Systems 17 open source speech recognition][3] - -Kaldi is an open source speech recognition software written in C++, and is released under the Apache public license. It works on Windows, macOS and Linux. Its development started back in 2009. - -Kaldi’s main features over some other speech recognition software is that it’s extendable and modular; The community is providing tons of 3rd-party modules that you can use for your tasks. Kaldi also supports deep neural networks, and offers an [excellent documentation on its website][4]. - -While the code is mainly written in C++, it’s “wrapped” by Bash and Python scripts. So if you are looking just for the basic usage of converting speech to text, then you’ll find it easy to accomplish that via either Python or Bash. - -[Project’s homepage][5]. - -#### Julius - -![5 Good Open Source Speech Recognition/Speech-to-Text Systems 19 open source speech recognition][6] - -Probably one of the oldest speech recognition software ever; It’s development started in 1991 at the University of Kyoto, and then its ownership was transferred to an independent project team in 2005. - -Julius main features include its ability to perform real-time STT processes, low memory usage (Less than 64MB for 20000 words), ability to produce N-best/Word-graph output, ability to work as a server unit and a lot more. This software was mainly built for academic and research purposes. It is written in C, and works on Linux, Windows, macOS and even Android (on smartphones). - -Currently it supports both English and Japanese languages only. The software is probably availbale to install easily in your Linux distribution’s repository; Just search for julius package in your package manager. The latest version was [released][7] around one and half months ago. - -[Project’s homepage][8]. - -#### Wav2Letter++ - -![5 Good Open Source Speech Recognition/Speech-to-Text Systems 21 open source speech recognition][9] - -If you are looking for something modern, then this one is for you. Wav2Letter++ is an open source speech recognition software that was released by Facebook’s AI Research Team just 2 months ago. The code is released under the BSD license. - -Facebook is [describing][10] its library as “the fastest state-of-the-art speech recognition system available”. The concepts on which this tool is built makes it optimized for performance by default; Facebook’s also-new machine learning library [FlashLight][11] is used as the underlying core of Wav2Letter++. - -Wav2Letter++ needs you first to build a training model for the language you desire by yourself in order to train the algorithms on it. No pre-built support of any language (including English) is available; It’s just a machine-learning-driven tool to convert speech to text. It was written in C++, hence the name (Wav2Letter++). - -[Project’s homepage][12]. - -#### DeepSpeech2 - -![5 Good Open Source Speech Recognition/Speech-to-Text Systems 23 open source speech recognition][13] - -Researchers at the Chinese giant Baidu are also working on their own speech-to-text engine, called DeepSpeech2. It’s an end-to-end open source engine that uses the “PaddlePaddle” deep learning framework for converting both English & Mandarin Chinese languages speeches into text. The code is released under BSD license. - -The engine can be trained on any model and for any language you desire. The models are not released with the code; You’ll have to build them yourself, just like the other software. DeepSpeech2’s source code is written in Python; So it should be easy for you to get familiar with it if that’s the language you use. - -[Project’s homepage][14]. - -### Conclusion - -The speech recognition category is still mainly dominated by proprietary software giants like Google and IBM (which do provide their own closed-source commercial services for this), but the open source alternatives are promising. Those 5 open source speech recognition engines should get you going in building your application, all of them are still under heavy development by time. In few years, we expect open source to become the norm for those technologies just like in the other industries. - -If you have any other recommendations for this list, or comments in general, we’d love to hear them below! - -** - -Shares - - --------------------------------------------------------------------------------- - -via: https://fosspost.org/lists/open-source-speech-recognition-speech-to-text - -作者:[Simon James][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://fosspost.org/author/simonjames -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/hero_speech-machine-learning2.png?resize=820%2C280&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 16 open source speech recognition) -[2]: https://github.com/mozilla/DeepSpeech -[3]: https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/Screenshot-at-2019-02-19-1134.png?resize=591%2C138&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 18 open source speech recognition) -[4]: http://kaldi-asr.org/doc/index.html -[5]: http://kaldi-asr.org -[6]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/mic_web.png?resize=385%2C100&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 20 open source speech recognition) -[7]: https://github.com/julius-speech/julius/releases -[8]: https://github.com/julius-speech/julius -[9]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/fully_convolutional_ASR.png?resize=850%2C177&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 22 open source speech recognition) -[10]: https://code.fb.com/ai-research/wav2letter/ -[11]: https://github.com/facebookresearch/flashlight -[12]: https://github.com/facebookresearch/wav2letter -[13]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/ds2.png?resize=850%2C313&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 24 open source speech recognition) -[14]: https://github.com/PaddlePaddle/DeepSpeech diff --git a/translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md b/translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md new file mode 100644 index 0000000000..0067324e41 --- /dev/null +++ b/translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: (luuming) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 Good Open Source Speech Recognition/Speech-to-Text Systems) +[#]: via: (https://fosspost.org/lists/open-source-speech-recognition-speech-to-text) +[#]: author: (Simon James https://fosspost.org/author/simonjames) + +5 款不错的开源语音识别/语音文字转换系统 + +====== + +![](https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/open-source-speech-recognition-speech-to-text.png?resize=1237%2C527&ssl=1) + +语音文字转换speech-to-text(STT)系统就像它名字所蕴含的那样,是一种将说出的单词转换为文本文件以供后续用途的方式。 + +语音文字转换技术非常有用。它可以用到许多应用中,例如自动转录,使用自己的声音写书籍或文本,用生成的文本文件和其他工具做复杂的分析等。 + +在过去,语音文字转换技术以专有软件和库为主导,开源替代品并不存在或是有严格的限制并且没有社区。这一点正在发生改变,当今有许多开源语音文字转换工具和库可以让你立即使用。 + +这里我列出了 5 个。 + +### 开源语音识别库 + +#### DeepSpeech 项目 + +![5 Good Open Source Speech Recognition/Speech-to-Text Systems 15 open source speech recognition][1] + +该项目由 Firefox 浏览器背后的组织 Mozilla 团队开发。它 100% 自由并且使用 TensorFlow 机器学习框架实现。 + +换句话说,你可以用它训练自己的模型获得更好的效果,甚至可以用它转换其它的语言。你也可以轻松的将它集成到自己的 Tensorflow 机器学习项目中。可惜的是项目当前默认仅支持英语。 + +它也支持许多编程语言,例如 Python(3.6)。可以让你在数秒之内获取: + +``` +pip3 install deepspeech +deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio my_audio_file.wav +``` + +你也可以通过 npm 安装它: + +``` +npm install deepspeech +``` + +想要获得更多信息,请参考[项目主页][2]。 + +#### Kaldi + +![5 Good Open Source Speech Recognition/Speech-to-Text Systems 17 open source speech recognition][3] + +Kaldi 是一个用 C++ 写的开源语音识别软件,并且在 Apache 公共许可下发布。它可以运行在 Windows,macOS 和 Linux 上。它的开发始于 2009。 + +Kaldi 超过其他语音识别软件的主要特点是可扩展和模块化。社区提供了大量的三方模块可以用来完成你的任务。Kaldi 也支持深度神经网络,并且在它的网站上提供了[出色的文档][4]。 + +虽然代码主要由 C++ 完成,但它通过 Bash 和 Python 脚本进行了封装。因此,如果你仅仅想使用基本的语音到文字转换功能,你就会发现通过 Python 或 Bash 能够轻易的完成。 + +[Project’s homepage][5]. + +#### Julius + +![5 Good Open Source Speech Recognition/Speech-to-Text Systems 19 open source speech recognition][6] + +可能是有史以来最古老的语音识别软件之一。它的发展始于 1991 年的京都大学,之后在 2005 年将所有权转移到了一个独立的项目组。 + +Julius 的主要特点包括了执行实时 STT 的能力,低内存占用(20000 单词少于 64 MB),输出最优词N-best word/词图Word-graph的能力,当作服务器单元运行的能力和很多东西。这款软件主要为学术和研究所设计。由 C 语言写成,并且可以运行在 Linux,Windows,macOS 甚至 Android(在智能手机上)。 + +它当前仅支持英语和日语。软件或许易于从 Linux 发行版的仓库中安装。只要在软件包管理器中搜索 julius 即可。最新的版本[发布][7]于大约一个半月之前。 + +[Project’s homepage][8]. + +#### Wav2Letter++ + +![5 Good Open Source Speech Recognition/Speech-to-Text Systems 21 open source speech recognition][9] + +如果你在寻找一个更加时髦的,那么这款一定适合。Wav2Letter++ 是一款由 Facebook 的 AI 研究团队于 2 个月之前发布的开源语言识别软件。代码在 BSD 许可下发布。 + +Facebook 描述它的库是“最快最先进state-of-the-art的语音识别系统”。构建它时的想法使其能在默认情况下对性能进行优化。Facebook 最新的机器学习库 [FlashLight][11] 也被用作 Wav2Letter++ 的底层核心。 + +Wav2Letter++ 需要你先为所描述的语言建立一个模型来训练算法。没有任何一种语言(包括英语)的预训练模型,它仅仅是个机器学习驱动的文本语音转换工具,它用 C++ 写成,因此命名为 Wav2Letter++。 + +[Project’s homepage][12]. + +#### DeepSpeech2 + +![5 Good Open Source Speech Recognition/Speech-to-Text Systems 23 open source speech recognition][13] + +中国巨头百度的研究人员也在开发他们自己的语音文字转换引擎,叫做“DeepSpeech2”。它是一个端对端的开源引擎,使用“PaddlePaddle”深度学习框架进行英语或汉语的文字转换。代码在 BSD 许可下发布。 + +引擎可以训练在任何模型之上,并且可以用于任何想要的语言。模型并未随代码一同发布。你要像其他软件那样自己建立模型。DeepSpeech2 的源代码由 Python 写成,如果你使用过就会非常容易上手。 + +[Project’s homepage][14]. + +### 总结 + +语音识别领域仍然主要地由专有软件巨头所占据,比如 Google 和 IBM(它们为此提供了闭源商业服务),但是开源同类软件很有前途。这 5 款开源语音识别引擎应当能够帮助你构建应用,随着时间推移,它们会不断地发展。在几年之后,我们希望开源成为这些技术中的常态,就像其他行业那样。 + +如果你对清单有其他的建议或评论,我们很乐意在下面听到。 + +-------------------------------------------------------------------------------- + +via: https://fosspost.org/lists/open-source-speech-recognition-speech-to-text + +作者:[Simon James][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/LuuMing) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fosspost.org/author/simonjames +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/hero_speech-machine-learning2.png?resize=820%2C280&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 16 open source speech recognition) +[2]: https://github.com/mozilla/DeepSpeech +[3]: https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/Screenshot-at-2019-02-19-1134.png?resize=591%2C138&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 18 open source speech recognition) +[4]: http://kaldi-asr.org/doc/index.html +[5]: http://kaldi-asr.org +[6]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/mic_web.png?resize=385%2C100&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 20 open source speech recognition) +[7]: https://github.com/julius-speech/julius/releases +[8]: https://github.com/julius-speech/julius +[9]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/fully_convolutional_ASR.png?resize=850%2C177&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 22 open source speech recognition) +[10]: https://code.fb.com/ai-research/wav2letter/ +[11]: https://github.com/facebookresearch/flashlight +[12]: https://github.com/facebookresearch/wav2letter +[13]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/ds2.png?resize=850%2C313&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 24 open source speech recognition) +[14]: https://github.com/PaddlePaddle/DeepSpeech From 2e0a2191cf78f0b747475e537fb7958ced0ecddb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Jun 2019 17:35:38 +0800 Subject: [PATCH 0923/1154] APL:20180914 A day in the life of a log message.md --- sources/tech/20180914 A day in the life of a log message.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180914 A day in the life of a log message.md b/sources/tech/20180914 A day in the life of a log message.md index 8d60ec9fe6..2564ece628 100644 --- a/sources/tech/20180914 A day in the life of a log message.md +++ b/sources/tech/20180914 A day in the life of a log message.md @@ -42,7 +42,7 @@ via: https://opensource.com/article/18/9/life-log-message 作者:[Josef Karásek][a] 选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 47a8f6c5c884945fa8b327f8df8765286744fe58 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 15 Jun 2019 19:13:38 +0800 Subject: [PATCH 0924/1154] TSL:20180914 A day in the life of a log message.md (#14084) --- ...0914 A day in the life of a log message.md | 57 ------------------- ...0914 A day in the life of a log message.md | 56 ++++++++++++++++++ 2 files changed, 56 insertions(+), 57 deletions(-) delete mode 100644 sources/tech/20180914 A day in the life of a log message.md create mode 100644 translated/tech/20180914 A day in the life of a log message.md diff --git a/sources/tech/20180914 A day in the life of a log message.md b/sources/tech/20180914 A day in the life of a log message.md deleted file mode 100644 index 2564ece628..0000000000 --- a/sources/tech/20180914 A day in the life of a log message.md +++ /dev/null @@ -1,57 +0,0 @@ -A day in the life of a log message -====== - -Navigating a modern distributed system from the perspective of a log message. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plane_travel_world_international.png?itok=jG3sYPty) - -Chaotic systems tend to be unpredictable. This is especially evident when architecting something as complex as a distributed system. Left unchecked, this unpredictability can waste boundless amounts of time. This is why every single component of a distributed system, no matter how small, must be designed to fit together in a streamlined way. - -[Kubernetes][1] provides a promising model for abstracting compute resources—but even it must be reconciled with other distributed platforms such as [Apache Kafka][2] to ensure reliable data delivery. If someone were to integrate these two platforms, how would it work? Furthermore, if you were to trace something as simple as a log message through such a system, what would it look like? This article will focus on how a log message from an application running inside [OKD][3], the Origin Community Distribution of Kubernetes that powers Red Hat OpenShift, gets to a data warehouse through Kafka. - -### OKD-defined environment - -Such a journey begins in OKD, since the container platform completely overlays the hardware it abstracts. This means that the log message waits to be written to **stdout** or **stderr** streams by an application residing in a container. From there, the log message is redirected onto the node's filesystem by a container engine such as [CRI-O][4]. - -![](https://opensource.com/sites/default/files/uploads/logmessagepathway.png) - -ithin OpenShift, one or more containers are encapsulated within virtual compute nodes known as pods. In fact, all applications running within OKD are abstracted as pods. This allows the applications to be manipulated in a uniform way. This also greatly simplifies communication between distributed components, since pods are systematically addressable through IP addresses and [load-balanced services][5] . So when the log message is taken from the node's filesystem by a log-collector application, it can easily be delivered to another pod running within OpenShift. - -### Two peas in a pod - -To ensure ubiquitous dispersal of the log message throughout the distributed system, the log collector needs to deliver the log message into a Kafka cluster data hub running within OpenShift. Through Kafka, the log message can be delivered to the consuming applications in a reliable and fault-tolerant way with low latency. However, in order to reap the benefits of Kafka within an OKD-defined environment, Kafka needs to be fully integrated into OKD. - -Running a [Strimzi operator][6] will instantiate all Kafka components as pods and integrate them to run within an OKD environment. This includes Kafka brokers for queuing log messages, Kafka connectors for reading and writing from Kafka brokers, and Zookeeper nodes for managing the Kafka cluster state. Strimzi can also instantiate the log collector to double as a Kafka connector, allowing the log collector to feed the log messages directly into a Kafka broker pod running within OKD. - -### Kafka inside OKD - -When the log-collector pod delivers the log message to a Kafka broker, the collector writes to a single broker partition, appending the message to the end of the partition. One of the advantages of using Kafka is that it decouples the log collector from the log's final destination. Thanks to the decoupling, the log collector doesn't care whether the logs end up in [Elasticsearch][7], Hadoop, Amazon S3, or all of them at the same time. Kafka is well-connected to all infrastructure, so the Kafka connectors can take the log message wherever it needs to go. - -Once written to a Kafka broker's partition, the log message is replicated across the broker partitions within the Kafka cluster. This is a very powerful concept on its own; combined with the self-healing features of the platform, it creates a very resilient distributed system. For example, when a node becomes unavailable, the applications running on the node are almost instantaneously spawned on healthy node(s). So even if a node with the Kafka broker is lost or damaged, the log message is guaranteed to survive as many deaths as it was replicated and a new Kafka broker will quickly take the original's place. - -### Off to storage - -After it is committed to a Kafka topic, the log message waits to be consumed by a Kafka connector sink, which relays the log message to either an analytics engine or logging warehouse. Upon delivery to its final destination, the log message could be studied for anomaly detection, queried for immediate root-cause analysis, or used for other purposes. Either way, the log message is delivered by Kafka to its destination in a safe and reliable manner. - -OKD and Kafka are powerful distributed platforms that are evolving rapidly. It is vital to create systems that can abstract the complicated nature of distributed computing without compromising performance. After all, how can we boast of systemwide efficiency if we cannot simplify the journey of a single log message? - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/9/life-log-message - -作者:[Josef Karásek][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jkarasek -[1]: https://kubernetes.io/ -[2]: https://kafka.apache.org/ -[3]: https://www.okd.io/ -[4]: http://cri-o.io/ -[5]: https://kubernetes.io/docs/concepts/services-networking/service/ -[6]: http://strimzi.io/ -[7]: https://www.elastic.co/ diff --git a/translated/tech/20180914 A day in the life of a log message.md b/translated/tech/20180914 A day in the life of a log message.md new file mode 100644 index 0000000000..07b1c3b1fa --- /dev/null +++ b/translated/tech/20180914 A day in the life of a log message.md @@ -0,0 +1,56 @@ +日志消息的一日之旅 +====== + +> 从一条日志消息的角度来巡览现代分布式系统。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plane_travel_world_international.png?itok=jG3sYPty) + +混沌系统往往是不可预测的。在构建像分布式系统这样复杂的东西时,这一点尤其明显。如果不加以控制,这种不可预测性会无止境的浪费时间。这就是为什么分布式系统的每个组件,无论多小,都必须设计成以简化的方式组合在一起。 + +[Kubernetes][1] 为抽象计算资源提供了一个很有前景的模型 —— 但即使是它也必须与 [Apache Kafka][2] 等其他分布式平台协调一致,以确保可靠的数据传输。如果有人要整合这两个平台,它会如何运作?此外,如果你通过这样的系统跟踪像日志消息这么简单的东西,它会是什么样子?本文将重点介绍来自[OKD][3] 内运行的应用程序的日志消息如何通过 Kafka 进入数据仓库(OKD 是为 Red Hat OpenShift 提供支持的 Kubernetes 的原初社区发行版)。 + +### OKD 定义的环境 + +这样的旅程始于 OKD,因为该容器平台完全覆盖了它抽象的硬件。这意味着日志消息等待由驻留在容器中的应用程序写入 stdout 或 stderr 流。从那里,日志消息被容器引擎(例如 [CRI-O][4])重定向到节点的文件系统。 + +![](https://opensource.com/sites/default/files/uploads/logmessagepathway.png) + +在 OpenShift 中,一个或多个容器封装在称为 pod 的虚拟计算节点中。实际上,在 OKD 中运行的所有应用程序都被抽象为 pod(豆荚)。这允许应用程序以统一的方式操纵。这也大大简化了分布式组件之间的通信,因为 pod 可以通过 IP 地址和[负载均衡服务][5]系统地寻址。因此,当日志消息由日志收集器应用程序从节点的文件系统获取时,它可以很容易地传递到在 OpenShift 中运行的另一个 pod。 + +### 在豆荚里的两个豌豆 + +为了确保可以在整个分布式系统中无处不在地传播日志消息,日志收集器需要将日志消息传递到在 OpenShift 中运行的 Kafka 集群数据中心。通过 Kafka,日志消息可以以可靠且容错的方式低延迟传递给消费应用程序。但是,为了在 OKD 定义的环境中获得 Kafka 的好处,Kafka 需要完全集成到 OKD 中。 + +运行 [Strimzi 操作子][6]将实例化所有 Kafka 组件为 pod,并将它们集成在 OKD 环境中运行。 这包括用于排队日志消息的 Kafka 代理,用于从 Kafka 代理读取和写入的 Kafka 连接器,以及用于管理 Kafka 集群状态的 Zookeeper 节点。Strimzi 还可以将日志收集器双实例化作为 Kafka 连接器,允许日志收集器将日志消息直接提供给在 OKD 中运行的 Kafka 代理 pod。 + +### 在 OKD 内的 Kafka + +当日志收集器 pod 将日志消息传递给 Kafka 代理时,收集器会写到单个代理分区,并将日志消息附加到该分区的末尾。使用 Kafka 的一个优点是它将日志收集器与日志的最终目标分离。由于解耦,日志收集器不关心日志最后是放在 [Elasticsearch][7]、Hadoop、Amazon S3 中的某个还是全都。Kafka 与所有基础设施连接良好,因此 Kafka 连接器可以在任何需要的地方获取日志消息。 + +一旦写入 Kafka 代理的分区,该日志消息就会在 Kafka 集群内的代理分区中复制。这是它的一个非常强大的概念;结合平台的自愈功能,它创建了一个非常灵活的分布式系统。例如,当节点变得不可用时,节点上运行的应用程序几乎立即在健康节点上生成。因此,即使带有 Kafka 代理的节点丢失或损坏,日志消息也能保证存活在必要多的节点上,并且新的 Kafka 代理将快速原位取代。 + +### 存储起来 + +在日志消息被提交到 Kafka 主题后,它将等待 Kafka 连接器接收器使用它,该接收器将日志消息中继到分析引擎或日志记录仓库。在传递到其最终目的地时,可以分析日志消息以进行异常检测,可以查询日志以立即进行根本原因分析,或用于其他目的。无论哪种方式,日志消息都由 Kafka 以安全可靠的方式传送到目的地。 + +OKD 和 Kafka 是正在迅速发展的功能强大的分布式平台。创建能够在不影响性能的情况下抽象出分布式计算的复杂特性的系统至关重要。毕竟,如果我们不能简化单条日志消息的旅程,我们怎么能夸耀全系统的效率呢? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/9/life-log-message + +作者:[Josef Karásek][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jkarasek +[1]: https://kubernetes.io/ +[2]: https://kafka.apache.org/ +[3]: https://www.okd.io/ +[4]: http://cri-o.io/ +[5]: https://kubernetes.io/docs/concepts/services-networking/service/ +[6]: http://strimzi.io/ +[7]: https://www.elastic.co/ From cd6c7ee1f38ba08b3680c6604e34e63faf9a5770 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Jun 2019 20:36:26 +0800 Subject: [PATCH 0925/1154] APL:20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6 --- ...going Projects (The State Of Smart Contracts Now) -Part 6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md b/sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md index 3674b73954..7deb28c67c 100644 --- a/sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md +++ b/sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8ae6c84d339869252ad640dd477e3c2c2870b46c Mon Sep 17 00:00:00 2001 From: LuMing <784315443@qq.com> Date: Sat, 15 Jun 2019 22:51:09 +0800 Subject: [PATCH 0926/1154] translating --- ...0190513 When to be concerned about memory levels on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190513 When to be concerned about memory levels on Linux.md b/sources/tech/20190513 When to be concerned about memory levels on Linux.md index 3306793c9f..c42d417e9e 100644 --- a/sources/tech/20190513 When to be concerned about memory levels on Linux.md +++ b/sources/tech/20190513 When to be concerned about memory levels on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (luuming) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6a7c8e2ae174a64f8c04cf2f4db18f3005d8d7ed Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Jun 2019 22:56:33 +0800 Subject: [PATCH 0927/1154] TSL:20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md --- ...e State Of Smart Contracts Now) -Part 6.md | 120 ------------------ ...e State Of Smart Contracts Now) -Part 6.md | 100 +++++++++++++++ 2 files changed, 100 insertions(+), 120 deletions(-) delete mode 100644 sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md create mode 100644 translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md diff --git a/sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md b/sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md deleted file mode 100644 index 7deb28c67c..0000000000 --- a/sources/tech/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md +++ /dev/null @@ -1,120 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Blockchain 2.0 – Ongoing Projects (The State Of Smart Contracts Now) [Part 6]) -[#]: via: (https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/) -[#]: author: (editor https://www.ostechnix.com/author/editor/) - -Blockchain 2.0 – Ongoing Projects (The State Of Smart Contracts Now) [Part 6] -====== - -![The State Of Smart Contracts Now][1] - -Continuing from our [**earlier post on smart contracts**][2], this post aims to discuss the state of Smart contracts, highlight some current projects and companies currently undertaking developments in the area. Smart contracts as discussed in the previous article of the series are programs that exist and execute themselves on a blockchain network. We explored how smart contracts work and why they are superior to traditional digital platforms. Companies described here operate in a wide variety of industries however most of them deal with identity management systems, financial services, crowd funding systems etc., as these are the areas thought to be most suitable for switching to blockchain based data base systems. - -### Open platforms - -Platforms such as **Counterparty** [1] and **Solidity(Ethereum)** are fully public building blocks for developers to create their own smart contracts. Wide spread developer participation in such projects have allowed these to become de facto standards for developing smart contracts, designing your own cryptocurrency token systems, and creating protocols for the blockchains to function. Many commendable projects have derived from them. **Quorum** , by JP Morgan, derived from Ethereum, is an example. **Ripple** is another example for the same. - -### Managing financial transactions - -Transferring cryptocurrencies over the internet is touted to be the norm in the coming years. The shortfalls with the same are: - - * Identities and wallet addresses are anonymous. The payer doesn’t have any first recourse if the receiver does not honor the transaction. - * Erroneous transactions if any will cannot be traced. - * Cryptographically generated hash keys are difficult to work with for humans and human errors are a prime concern. - - - -Having someone else take in the transaction momentarily and settle it with the receiver after due diligence is preferred in this case. - -**EscrowMyEther** [3] and **PAYFAIR** [4] are two such escrow platforms. Basically, the escrow company takes the agreed upon amount and sends a token to the receiver. Once the receiver delivers what the payer wants via the same escrow platform, both confirm and the final payment is released. These are used extensively by freelancers and hobbyist collectors online. - -### Financial services - -Developments in micro-financing and micro-insurance projects will improve the banking infrastructure for much of the world’s poor and unbanked. Involving the poorer “unbanked” sections of the society is estimated to increase revenues for banks and institutions involved by **$380 billion** [5]. This amount supersedes the savings in operational expenses that can be expected by switching to blockchain DLT for banks. - -**BankQu Inc.** based in Midwest United States goes by the slogan “Dignity through identity”. Their platform allows for individuals to setup their own digital identity record where all their transactions will be vetted and processed real time on the blockchain. Overtime the underlying code records and builds a unique online identity for its users allowing for ultra-quick transactions and settlements. The BankQu case studies exploring more about how they’re helping individuals and companies this way is available [here][3]. - -**Stratumn** is helping insurance companies offer better insurance services by automating tasks which were earlier micromanaged by humans. By automation, end to end traceability, and efficient data privacy methods they’ve radically changed how insurance claims are settled. Improved customer experience along with significant cost reductions present a win-win situation for clients as well as firms involved[6]. - -A similar endeavor is being run on a trial basis currently by the French Insurance firm, **AXA**. The product _**“fizzy”**_ allows users to subscribe to its service for a small fee and enter their flight details. In case, the flight gets delayed or comes across some other issue, the program automatically scours online databases, checks with the insurance terms and credits the insurance amount to the user’s account. This eliminates the need for the user or the customer to file a claim after checking with the terms manually and in the long-run once such systems become mainstream, increase accountability from airlines[7][8]. - -### Keeping track of ownership rights - -It is theoretically possible to track media from creation to end user consumption utilizing timestamped blocks of data in a DLT. Companies **Peertracks** and **Mycelia** are currently helping musicians publish content without worrying about their content being stolen or misused. They help artists sell directly to fans and clients while getting paid for their work without having to go through rights and record labels[9]. - -### Identity management platforms - -Blockchain based identity management platforms store your identity on a distributed ledger. Once an account is setup, it is securely encrypted and sent to all the participating nodes after. However, as the owner of the data block only the user has access to the data. Once your identity is established on the network and you begin transactions, an automated program within the network will verify all previous transactions associated with your account, send it for regulatory filings after checking requirements and execute the settlement automatically provided the program deems the transaction legitimate. The upside here being that since the data on the blockchain is tamper-proof and the smart contract checks the input with zero bias (or subjectivity), the transaction doesn’t, as previously mentioned, require oversight or approval from anyone and is taken care of instantaneously. - -Start-ups like **ShoCard** , **Credits** , and **OneName** are currently rolling out similar services and are currently in talks with government and social institutions for integrating them into mainstream use. - -Other independent projects by developers like **Chris Ellis** and **David Duccini** have respectively developed or proposed alternative identity management systems such as **“[World Citizenship][4]”** , and **[IDCoin][5]** , respectively. Mr Ellis even demonstrated the capabilities of his work by creating passports on the a blockchain network[10][11] [12][5]. - -### Resource sharing - -**Share & Charge (Slock.It)** is a European blockchain start-up. Their mobile app allows homeowners and other individuals who’ve invested their money in setting up a charging station share their resource with other individuals who’re looking for a quick. This not only allows owners to get back some of their investment, but also allows EV drivers to access significantly more charging points in their near-by geographical area allowing for suppliers to meet demands in a convenient manner. Once a “customer” is done charging their vehicle, the hardware associated creates a secure time stamped block consisting of the data and a smart contract working on the platform automatically credits the corresponding amount of money into the owners account. A track of all such transactions is recorded and proper security verifications kept in place. Interested readers can take a look [here][6], to know the technical angle behind their product[13][14]. The company’s platforms will gradually enable users to share other products and services with individuals in need and earn a passive income from the same. - -The companies we’ve looked at here, comprise a very short list of ongoing projects that make use of smart contracts and blockchain database systems. Platform such as these help in building a secure “box” full of information to be accessed only by the users themselves and the overlying code or the smart contract. The information is vetted in real time based on a trigger, examined, and the algorithm is executed by the system. Such platforms with minimal human oversight, a much-needed step in the right direction with respect to secure digital automation, something which has never been thought of at this scale previously. - -The next post will shed some light on the **different types of blockchains**. Click the following link to know more about this topic. - - * [**Blockchain 2.0 – Public Vs Private Blockchain Comparison**][7] - - - -**References:** - - * **[1][About | Counterparty][8]** - * **[2] [Quorum | J.P. Morgan][9] -** - * **[3][Escrow My Ether][10]** - * **[4][PayFair][11]** - * **[5] B. Pani, “Blockchain Powered Financial Inclusion,” 2016.** - * **[6][STRATUMN | Insurance Claim Automation Across Europe][12]** - * **[7][fizzy][13]** - * **[8][AXA goes blockchain with fizzy | AXA][14]** - * **[9] M. Gates, “Blockchain. Ultimate guide to understanding blockchain bitcoin cryptocurrencies smart-contracts and the future of money.pdf.” 2017.** - * **[10][ShoCard Is A Digital Identity Card On The Blockchain | TechCrunch][15]** - * **[11][J. Biggs, “Your Next Passport Could Be On The Blockchain | TechCrunch][16]** - * **[12][OneName – Namecoin Wiki][17]** - * **[13][Share&Charge launches its app, on-boards over 1,000 charging stations on the blockchain][18]** - * **[14][slock.it – Landing][19]** - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/ - -作者:[editor][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/editor/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/State-Of-Smart-Contracts-720x340.png -[2]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ -[3]: https://banqu.co/case-study/ -[4]: https://github.com/MrChrisJ/World-Citizenship -[5]: https://github.com/IDCoin/IDCoin -[6]: https://blog.slock.it/share-charge-smart-contracts-the-technical-angle-58b93ce80f15 -[7]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ -[8]: https://counterparty.io/platform/ -[9]: https://www.jpmorgan.com/global/Quorum -[10]: http://escrowmyether.com/ -[11]: https://payfair.io/ -[12]: https://stratumn.com/business-case/insurance-claim-automation-across-europe/ -[13]: https://fizzy.axa/en-gb/ -[14]: https://group.axa.com/en/newsroom/news/axa-goes-blockchain-with-fizzy -[15]: https://techcrunch.com/2015/05/05/shocard-is-a-digital-identity-card-on-the-blockchain/ -[16]: https://techcrunch.com/2014/10/31/your-next-passport-could-be-on-the-blockchain/ -[17]: https://wiki.namecoin.org/index.php?title=OneName -[18]: https://blog.slock.it/share-charge-launches-its-app-on-boards-over-1-000-charging-stations-on-the-blockchain-ba8275390309 -[19]: https://slock.it/ diff --git a/translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md b/translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md new file mode 100644 index 0000000000..3748d28dd8 --- /dev/null +++ b/translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Ongoing Projects (The State Of Smart Contracts Now) [Part 6]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +区块链 2.0:智能合约如今的发展(六) +====== + +![The State Of Smart Contracts Now][1] + +继续我们的[前面的关于智能合约的文章][2],这篇文章旨在讨论智能合约的形势,重点介绍目前正在该领域进行开发的一些项目和公司。如本系列前一篇文章中讨论的,智能合约是在区块链网络上存在并执行的程序。我们探讨了智能合约的工作原理以及它们优于传统数字平台的原因。这里描述的公司分布于各种各样的行业中,但是大多涉及到身份管理系统、金融服务、众筹系统等,因为这些是被认为最适合切换到基于区块链的数据库系统的领域。 + +### 开放平台 + +诸如 [Counterparty][8] 和 Solidity(以太坊)等平台是完全公用的构建模块,开发者可以以之创建自己的智能合约。大量的开发人员参与此类项目使这些项目成为开发智能合约、设计自己的加密货币令牌系统以及为区块链创建协议以实现功能的事实标准。许多值得称赞的项目都来源于它们。摩根大通派生自以太坊的 [Quorum][9],就是一个例子。而瑞波是另一个例子。 + +### 管理金融交易 + +通过互联网转账加密货币被吹捧为在未来几年的常态。与此相关的不足之处是: + +* 身份和钱包地址是匿名的。如果接收方不履行交易,则付款人没有任何第一追索权。 +* 错误交易(如果无法追踪任何交易)。 +* 密码生成的哈希密钥很难用于人类,人为错误是主要关注点。 + +在这种情况下,可以让其他人暂时接受该交易并在接受尽职调查后与接收方结算。 + +[EscrowMyEther][10] 和 [PAYFAIR][11] 是两个这样的托管平台。基本上,托管公司采用商定的金额并向接收方发送令牌。一旦接收方通过相同的托管平台提供付款人想要的内容,两者都会确认并最终付款。 这些得到了自由职业者和业余爱好者收藏家广泛在线使用。 + +### 金融服务 + +小额融资和小额保险项目的发展将改善世界上大多数贫穷或没有银行账户的人的银行金融服务。据估计,社会中较贫穷的“无银行账户”人群可以为银行和机构的增加 3800 亿美元收入 [^5]。这一金额取代了通过银行切换到区块链 DLT 预期可以节省的运营费用。 + +位于美国中西部的 BankQu Inc. 的口号是“通过身份而尊严”。他们的平台允许个人设置他们自己的数字身份记录,其中所有交易将在区块链上实时审查和处理。在底层代码上记录并为其用户构建唯一的在线标识,从而实现超快速的交易和结算。BankQu 案例研究探讨了他们如何以这种方式帮助个人和公司,可以在[这里][3]看到。 + +[Stratumn][12] 正在帮助保险公司通过自动执行早期由人类微观管理的任务来提供更好的保险服务。通过自动化、端到端可追溯性和高效的数据隐私方法,他们彻底改变了保险索赔的结算方式。改善客户体验以及显著降低成本,为客户和相关公司带来双赢局面。 + +法国保险公司 [AXA][14] 目前正在试行类似的努力。其产品 [fizzy][13] 允许用户以少量费用订阅其服务并输入他们的航班详细信息。如果航班延误或遇到其他问题,该程序会自动搜索在线数据库,检查保险条款并将保险金额记入用户的帐户。这样就消除了用户或客户在手动检查条款后提出索赔的要求,并且一旦这样的系统成为主流,就不需要长期提出索赔,增加了航空公司的责任。 + +### 跟踪所有权 + +理论上可以利用 DLT 中的带时间戳的数据块来跟踪从创建到最终用户消费的媒体。Peertracks 公司 和 Mycelia 公司目前正在帮助音乐家发布内容,而不必担心其内容被盗或被滥用。他们帮助艺术家直接向粉丝和客户销售,同时获得工作报酬,而无需通过权利和唱片公司 [^9]。 + +### 身份管理平台 + +基于区块链的身份管理平台可以将你的身份存储在分布式分类帐本中。设置帐户后,会对其进行安全加密,然后将其发送给所有参与节点。但是,作为数据块的所有者,只有该用户才能访问该数据。一旦你在网络上建立身份并开始交易,网络中的自动程序将验证与你的帐户关联的先前所有的交易,在检查要求后将其发送给监管备案,并在程序认为交易合法时自动执行结算。这里的好处是,由于区块链上的数据是防篡改的,而智能合约以零偏差(或主观性)检查输入,如前所述,交易不需要任何人的监督或批准,并且需要小心是即刻生效的。 + +像 [ShoCard][15] 、[Credits][16] 和 [OneName][17] 这样的初创公司目前正在推出类似的服务,目前正在与政府和社会机构进行谈判,以便将它们整合到主流用途中。 + +开发商的其他独立项目如 Chris Ellis 和 David Duccini 分别开发或提出了替代的身份管理系统,分别是 “[世界公民][4]”和 [IDCoin][5]。Ellis 先生甚至通过在区块链网络上创建护照来证明他的工作能力。 + +### 资源共享 + +[Share & Charge][18] ([Slock.It][19]) 是一家欧洲的区块链初创公司。他们的移动应用程序允许房主和其他个人投入资金建立充电站与其他正在寻找快速充电的人分享他们的资源。这不仅使业主能够收回他们的一些投资,而且还允许 EV 司机在其近地域获得更多的充电点,从而允许供应商以方便的方式满足需求。一旦“客户”完成对其车辆的充电,相关的硬件就会创建一个由数据组成的安全时间戳块,并且在该平台上工作的智能合约会自动将相应的金额记入所有者账户。记录所有此类交易的跟踪并保持适当的安全验证。有兴趣的读者可以看一下[这里][6],了解他们产品背后的技术角度。该公司的平台将逐步使用户能够与有需要的个人分享其他产品和服务,并从中获得被动收入。 + +我们在这里看到的公司,以及一个很短的正在进行中的项目的清单,这些项目利用智能合约和区块链数据库系统。诸如此类的平台有助于构建一个安全的“盒子”,其中包含仅由用户自己和上面的代码或智能合约访问的信息。基于触发器对信息进行实时审查、检查,并且算法由系统执行。这样的平台具有最小化的人为监督,这是在安全数字自动化方面朝着正确方向迈出的急需的一步,这在以前从未被考虑过如此规模。 + +下一篇文章将阐述不同类型的区块链。单击以下链接以了解有关此主题的更多信息。 + +* [区块链 2.0:公有链与私有链的比较][7] + + +[^5]: B. Pani, “Blockchain Powered Financial Inclusion,” 2016. +[^9]: M. Gates, “Blockchain. Ultimate guide to understanding blockchain bitcoin cryptocurrencies smart-contracts and the future of money.pdf.” 2017. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/ + +作者:[editor][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/State-Of-Smart-Contracts-720x340.png +[2]: https://linux.cn/article-10956-1.html +[3]: https://banqu.co/case-study/ +[4]: https://github.com/MrChrisJ/World-Citizenship +[5]: https://github.com/IDCoin/IDCoin +[6]: https://blog.slock.it/share-charge-smart-contracts-the-technical-angle-58b93ce80f15 +[7]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ +[8]: https://counterparty.io/platform/ +[9]: https://www.jpmorgan.com/global/Quorum +[10]: http://escrowmyether.com/ +[11]: https://payfair.io/ +[12]: https://stratumn.com/business-case/insurance-claim-automation-across-europe/ +[13]: https://fizzy.axa/en-gb/ +[14]: https://group.axa.com/en/newsroom/news/axa-goes-blockchain-with-fizzy +[15]: https://techcrunch.com/2015/05/05/shocard-is-a-digital-identity-card-on-the-blockchain/ +[16]: https://techcrunch.com/2014/10/31/your-next-passport-could-be-on-the-blockchain/ +[17]: https://wiki.namecoin.org/index.php?title=OneName +[18]: https://blog.slock.it/share-charge-launches-its-app-on-boards-over-1-000-charging-stations-on-the-blockchain-ba8275390309 +[19]: https://slock.it/ From 73ad7ac9de722ac0fba5f5e9190b4d8e9e57ce3e Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Sat, 15 Jun 2019 17:00:45 +0000 Subject: [PATCH 0928/1154] =?UTF-8?q?Revert=20"=E7=94=B3=E9=A2=86=E7=BF=BB?= =?UTF-8?q?=E8=AF=91"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d22a18c30bfff4517a6b6f894f670c75569fe4a3. --- ...0190411 How do you contribute to open source without code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190411 How do you contribute to open source without code.md b/sources/tech/20190411 How do you contribute to open source without code.md index 40c2a89842..659fd9064e 100644 --- a/sources/tech/20190411 How do you contribute to open source without code.md +++ b/sources/tech/20190411 How do you contribute to open source without code.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (warmfrog) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From dd9dc4b389bc44902fb7ed2eaa74cabbb6a31681 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Jun 2019 11:00:52 +0800 Subject: [PATCH 0929/1154] PRF:20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md @robsean --- ...ate A Bootable USB Device From ISO File.md | 143 +++++++++--------- 1 file changed, 71 insertions(+), 72 deletions(-) diff --git a/translated/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md b/translated/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md index 94bc351f7f..c16f90cfad 100644 --- a/translated/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md +++ b/translated/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md @@ -1,72 +1,72 @@ -BootISO – 一个简单的 Bash 脚本来安全地从 ISO 文件中创建一个可启动的 USB 设备 +BootISO:从 ISO 文件中创建一个可启动的 USB 设备 ====== -为操作系统安装,我们中的大多数人(包括我)非常经常地从 ISO 文件中创建一个可启动的 USB 设备。 -为达到这个目的,在 Linux 中有很多自由可用的应用程序。甚至在过去我们写了几个实用程序。 +![](https://img.linux.net.cn/data/attachment/album/201906/16/110109qq0b7atyaped3ij2.jpg) -每个人使用不同的应用程序,每个应用程序有它们自己的特色和功能。 +为了安装操作系统,我们中的大多数人(包括我)经常从 ISO 文件中创建一个可启动的 USB 设备。为达到这个目的,在 Linux 中有很多自由可用的应用程序。甚至在过去我们写了几篇介绍这种实用程序的文章。 -在这些应用程序中,一些应用程序属于 CLI ,一些应用程序与 GUI 关联。 +每个人使用不同的应用程序,每个应用程序有它们自己的特色和功能。在这些应用程序中,一些应用程序属于 CLI 程序,一些应用程序则是 GUI 的。 -今天,我们将讨论相同类型的称为 BootISO 的实用程序。它是一个简单的 bash 脚本,允许用户来从 ISO 文件中创建一个可启动的 USB 设备。 +今天,我们将讨论名为 BootISO 的实用程序类似工具。它是一个简单的 bash 脚本,允许用户来从 ISO 文件中创建一个可启动的 USB 设备。 -很多 Linux 管理员使用 dd 命令开创建可启动的 ISO ,它是一个本地的且著名的方法,但是与此同时,它也是一个非常危险的命令。因此,小心,当你执行一些带有 dd 命令的动作。 +很多 Linux 管理员使用 `dd` 命令开创建可启动的 ISO ,它是一个著名的原生方法,但是与此同时,它也是一个非常危险的命令。因此,小心,当你用 `dd` 命令执行一些动作时。 -**建议阅读:** -**(#)** [Etcher – 简单的方法来从一个 ISO 镜像中创建一个可启动的 USB 驱动器 & SD 卡][1] +建议阅读: -**(#)** [在 Linux 上使用 dd 命令来从一个 ISO 镜像中创建一个可启动的 USB 驱动器][2] +- [Etcher:从一个 ISO 镜像中创建一个可启动的 USB 驱动器 & SD 卡的简单方法][1] +- [在 Linux 上使用 dd 命令来从一个 ISO 镜像中创建一个可启动的 USB 驱动器][2] ### BootISO 是什么 -[BootIOS][3] 是一个简单的 bash 脚本,允许用户来安全的从一个 ISO 文件中创建一个可启动的 USB 设备,它是用 bash 编写的。 +[BootISO][3] 是一个简单的 bash 脚本,允许用户来安全的从一个 ISO 文件中创建一个可启动的 USB 设备,它是用 bash 编写的。 -它不提供任何图形用户界面,但是与此同时,它有大量的选项,允许初学者在 Linux 上来创建一个可启动的 USB 设备,而没有任何问题。因为它是一个智能工具,自动地选择是否一些 USB 设备被连接到系统上。 +它不提供任何图形用户界面而是提供了大量的选项,可以让初学者顺利地在 Linux 上来创建一个可启动的 USB 设备。因为它是一个智能工具,能自动地选择连接到系统上的 USB 设备。 -当系统有多个 USB 设备连接,它将打印列表。当你手动选择另一个硬盘而不是 USB ,在这种情况下,它将安全地退出,而不在硬盘上写任何东西。 +当系统有多个 USB 设备连接,它将打印出列表。当你手动选择了另一个硬盘而不是 USB 时,在这种情况下,它将安全地退出,而不会在硬盘上写入任何东西。 -这个脚本也将检查依赖关系,并提示用户安装,它与所有的软件包管理器一起工作,例如 apt-get,yum,dnf,pacman 和 zypper。 +这个脚本也将检查依赖关系,并提示用户安装,它可以与所有的软件包管理器一起工作,例如 apt-get、yum、dnf、pacman 和 zypper。 -### BootISO 特色 +### BootISO 的功能 - * 它检查选择的 ISO 是否是正确的 mime 类型。如果不是,那么退出。. - * 如果你选择除 USB 设备以外的任何其它的磁盘(本地硬盘),BootISO 将自动地退出。 - * 当你有多个驱动器时,BootISO 允许用户选择想要的 USB 驱动器。 - * 在擦除和分区 USB 设备前,BootISO 提示用户确认。 - * BootISO 将正确地处理来自一个命令的任何失灵,并退出。 - * BootISO 在退出陷阱时将调用一个清理例行程序。 + * 它检查选择的 ISO 是否是正确的 mime 类型。如果不是,那么退出。 + * 如果你选择除 USB 设备以外的任何其它的磁盘(本地硬盘),BootISO 将自动地退出。 + * 当你有多个驱动器时,BootISO 允许用户选择想要使用的 USB 驱动器。 + * 在擦除和分区 USB 设备前,BootISO 会提示用户确认。 + * BootISO 将正确地处理来自一个命令的任何错误,并退出。 + * BootISO 在遇到问题退出时将调用一个清理例行程序。 - - -### 如果在 Linux 中安装 BootISO +### 如何在 Linux 中安装 BootISO 在 Linux 中安装 BootISO 有几个可用的方法,但是,我建议用户使用下面的方法安装。 + ``` $ curl -L https://git.io/bootiso -O $ chmod +x bootiso $ sudo mv bootiso /usr/local/bin/ - ``` 一旦 BootISO 已经安装,运行下面的命令来列出可用的 USB 设备。 + ``` $ bootiso -l Listing USB drives available in your system: -NAME HOTPLUG SIZE STATE TYPE -sdd 1 32G running disk - +NAME HOTPLUG SIZE STATE TYPE +sdd 1 32G running disk ``` 如果你仅有一个 USB 设备,那么简单地运行下面的命令来从一个 ISO 文件中创建一个可启动的 USB 设备。 + ``` $ bootiso /path/to/iso file +``` +``` $ bootiso /opt/iso_images/archlinux-2018.05.01-x86_64.iso Granting root privileges for bootiso. Listing USB drives available in your system: -NAME HOTPLUG SIZE STATE TYPE -sdd 1 32G running disk +NAME HOTPLUG SIZE STATE TYPE +sdd 1 32G running disk Autoselecting `sdd' (only USB device candidate) The selected device `/dev/sdd' is connected through USB. Created ISO mount point at `/tmp/iso.vXo' @@ -75,85 +75,84 @@ Are you sure you want to proceed? (y/n)>y Erasing contents of /dev/sdd... Creating FAT32 partition on `/dev/sdd1'... Created USB device mount point at `/tmp/usb.0j5' -Copying files from ISO to USB device with `rsync' -Synchronizing writes on device `/dev/sdd' +Copying files from ISO to USB device with `rsync' +Synchronizing writes on device `/dev/sdd' `bootiso' took 250 seconds to write ISO to USB device with `rsync' method. ISO succesfully unmounted. USB device succesfully unmounted. USB device succesfully ejected. You can safely remove it ! - ``` -提到你的设备名称,当你有多个 USB 设备时,使用 `--device` 选项。 +当你有多个 USB 设备时,可以使用 `--device` 选项指明你的设备名称。 + ``` $ bootiso -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso - ``` 默认情况下,BootISO 使用 `rsync` 命令来执行所有的动作,如果你想使用 `dd` 命令代替它,使用下面的格式。 + ``` $ bootiso --dd -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso - ``` -如果你想跳过 `mime-type` 检查,BootISO 实用程序带有下面的选项。 +如果你想跳过 mime 类型检查,BootISO 实用程序带有下面的选项。 + ``` $ bootiso --no-mime-check -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso - ``` 为 BootISO 添加下面的选项来跳过在擦除和分区 USB 设备前的用户确认。 + ``` $ bootiso -y -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso - ``` -连同 -y 选项一起,启用自动选择 USB 设备。 +连同 `-y` 选项一起,启用自动选择 USB 设备。 + ``` $ bootiso -y -a /opt/iso_images/archlinux-2018.05.01-x86_64.iso - ``` -为知道更多全部可用的 BootISO 选项,运行下面的命令。 +为知道更多的 BootISO 选项,运行下面的命令。 + ``` $ bootiso -h Create a bootable USB from any ISO securely. -Usage: bootiso [...] +Usage: bootiso [...] Options --h, --help, help Display this help message and exit. --v, --version Display version and exit. --d, --device Select block file as USB device. - If is not connected through USB, `bootiso' will fail and exit. - Device block files are usually situated in /dev/sXX or /dev/hXX. - You will be prompted to select a device if you don't use this option. --b, --bootloader Install a bootloader with syslinux (safe mode) for non-hybrid ISOs. Does not work with `--dd' option. --y, --assume-yes `bootiso' won't prompt the user for confirmation before erasing and partitioning USB device. - Use at your own risks. --a, --autoselect Enable autoselecting USB devices in conjunction with -y option. - Autoselect will automatically select a USB drive device if there is exactly one connected to the system. - Enabled by default when neither -d nor --no-usb-check options are given. --J, --no-eject Do not eject device after unmounting. --l, --list-usb-drives List available USB drives. --M, --no-mime-check `bootiso' won't assert that selected ISO file has the right mime-type. --s, --strict-mime-check Disallow loose application/octet-stream mime type in ISO file. --- POSIX end of options. ---dd Use `dd' utility instead of mounting + `rsync'. - Does not allow bootloader installation with syslinux. ---no-usb-check `bootiso' won't assert that selected device is a USB (connected through USB bus). - Use at your own risks. +-h, --help, help Display this help message and exit. +-v, --version Display version and exit. +-d, --device Select block file as USB device. + If is not connected through USB, `bootiso' will fail and exit. + Device block files are usually situated in /dev/sXX or /dev/hXX. + You will be prompted to select a device if you don't use this option. +-b, --bootloader Install a bootloader with syslinux (safe mode) for non-hybrid ISOs. Does not work with `--dd' option. +-y, --assume-yes `bootiso' won't prompt the user for confirmation before erasing and partitioning USB device. + Use at your own risks. +-a, --autoselect Enable autoselecting USB devices in conjunction with -y option. + Autoselect will automatically select a USB drive device if there is exactly one connected to the system. + Enabled by default when neither -d nor --no-usb-check options are given. +-J, --no-eject Do not eject device after unmounting. +-l, --list-usb-drives List available USB drives. +-M, --no-mime-check `bootiso' won't assert that selected ISO file has the right mime-type. +-s, --strict-mime-check Disallow loose application/octet-stream mime type in ISO file. +-- POSIX end of options. +--dd Use `dd' utility instead of mounting + `rsync'. + Does not allow bootloader installation with syslinux. +--no-usb-check `bootiso' won't assert that selected device is a USB (connected through USB bus). + Use at your own risks. Readme - Bootiso v2.5.2. - Author: Jules Samuel Randolph - Bugs and new features: https://github.com/jsamr/bootiso/issues - If you like bootiso, please help the community by making it visible: - * star the project at https://github.com/jsamr/bootiso - * upvote those SE post: https://goo.gl/BNRmvm https://goo.gl/YDBvFe - + Bootiso v2.5.2. + Author: Jules Samuel Randolph + Bugs and new features: https://github.com/jsamr/bootiso/issues + If you like bootiso, please help the community by making it visible: + * star the project at https://github.com/jsamr/bootiso + * upvote those SE post: https://goo.gl/BNRmvm https://goo.gl/YDBvFe ``` -------------------------------------------------------------------------------- @@ -163,7 +162,7 @@ via: https://www.2daygeek.com/bootiso-a-simple-bash-script-to-securely-create-a- 作者:[Prakash Subramanian][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[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/) 荣誉推出 From a7a1da6495cc93ea2e5ac7fbe727493e2de0679f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Jun 2019 11:01:48 +0800 Subject: [PATCH 0930/1154] PUB:20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md @robsean https://linux.cn/article-10980-1.html --- ...ript To Securely Create A Bootable USB Device From ISO File.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md (100%) diff --git a/translated/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md b/published/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md similarity index 100% rename from translated/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md rename to published/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md From f3f608ef030ef5a63a8defc2c75e8859ab2de09f Mon Sep 17 00:00:00 2001 From: hopefully2333 <787016457@qq.com> Date: Sun, 16 Jun 2019 11:09:24 +0800 Subject: [PATCH 0931/1154] translating by hopefully2333 translating by hopefully2333 --- ...190606 Cisco to buy IoT security, management firm Sentryo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20190606 Cisco to buy IoT security, management firm Sentryo.md b/sources/news/20190606 Cisco to buy IoT security, management firm Sentryo.md index f8db1bfab5..cc90793305 100644 --- a/sources/news/20190606 Cisco to buy IoT security, management firm Sentryo.md +++ b/sources/news/20190606 Cisco to buy IoT security, management firm Sentryo.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hopefully2333) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 406b3929331a2b7663194b21a76acce6beb9ee7f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Jun 2019 11:56:58 +0800 Subject: [PATCH 0932/1154] PRF:20190517 10 Places Where You Can Buy Linux Computers.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chen-ni 翻译的很好~ --- ...laces Where You Can Buy Linux Computers.md | 97 +++++++++---------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/translated/tech/20190517 10 Places Where You Can Buy Linux Computers.md b/translated/tech/20190517 10 Places Where You Can Buy Linux Computers.md index 2a2e102967..527e68d0aa 100644 --- a/translated/tech/20190517 10 Places Where You Can Buy Linux Computers.md +++ b/translated/tech/20190517 10 Places Where You Can Buy Linux Computers.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (10 Places Where You Can Buy Linux Computers) @@ -10,7 +10,7 @@ 可以买到 Linux 电脑的 10 个地方 ====== -_**你在找 Linux 笔记本吗? 这里列出一些出售 Linux 电脑或者是专注于 Linux 系统的电商。**_ +> 你在找 Linux 笔记本吗? 这里列出一些出售 Linux 电脑或者是专注于 Linux 系统的电商。 如今市面上几乎所有的电脑(苹果除外)都预装了 Windows 系统。Linux 使用者的惯常做法就是买一台这样的电脑,然后要么删除 Windows 系统并安装 Linux,要么[安装 Linux 和 Windows 的双系统][1]。 @@ -30,13 +30,13 @@ _**你在找 Linux 笔记本吗? 这里列出一些出售 Linux 电脑或者是 在揭晓这个提供预装 Linux 电脑的商家的清单之前,需要先声明一下。 -请根据你的独立决策购买。我在这里只是简单地列出一些售卖 Linux 电脑的商家,并不保证他们的产品质量,售后服务等等这些事情。 +请根据你的独立决策购买。我在这里只是简单地列出一些售卖 Linux 电脑的商家,并不保证他们的产品质量、售后服务等等这些事情。 这也并不是一个排行榜。清单并不是按照某个特定次序排列的,每一项前面的数字只是为了方便计数,而并不代表名次。 让我们看看你可以在哪儿买到预装 Linux 的台式机或者笔记本吧。 -#### 1\. 戴尔 +#### 1、戴尔 ![戴尔 XPS Ubuntu | 图片所有权: Lifehacker][3] @@ -50,15 +50,15 @@ _**你在找 Linux 笔记本吗? 这里列出一些出售 Linux 电脑或者是 所以,去戴尔的官网上搜索关键字 “Ubuntu” 来获取预装 Ubuntu 的产品的信息吧。 -**支持范围** : 世界上大部分地区。 +**支持范围**:世界上大部分地区。 -[戴尔][5] +- [戴尔][5] -#### 2\. System76 +#### 2、System76 [System76][6] 是 Linux 计算机世界里的一个响亮的名字。这家总部设在美国的企业专注于运行 Linux 的高端技术设备。他们的目标用户群体是软件开发者。 -最初,System76 在自己的机器上提供的是 Ubuntu 系统。2017 年,他们发布了属于自己的 Linux 发行版,基于 Ubuntu 的 [Pop!_OS][7]。从此以后,Pop!_OS 就是他们机器上的默认操作系统了,但是仍然保留了 Ubuntu 这个选择。 +最初,System76 在自己的机器上提供的是 Ubuntu 系统。2017 年,他们发布了属于自己的 Linux 发行版,基于 Ubuntu 的 [Pop!\_OS][7]。从此以后,Pop!\_OS 就是他们机器上的默认操作系统了,但是仍然保留了 Ubuntu 这个选择。 除了性能之外,System76 还格外重视设计。他们的 [Thelio 系列台式机][8] 采用纯手工木制设计。 @@ -68,11 +68,11 @@ _**你在找 Linux 笔记本吗? 这里列出一些出售 Linux 电脑或者是 值得一提的是,System76 在美国制造他们的电脑,而没有使用中国大陆或者台湾这种常规的选择。也许是出于这个原因,他们产品的售价较为高昂。 -**支持范围** : 美国以及其它 60 个国家。在美国境外可能会有额外的关税。更多信息见[这里][13]. +**支持范围**:美国以及其它 60 个国家。在美国境外可能会有额外的关税。更多信息见[这里][13]. -[System76][6] +- [System76][6] -#### 3\. Purism +#### 3、Purism Purism 是一个总部设在美国的企业,以提供确保数据安全和隐私的产品和服务为荣。这就是为什么 Purism 称自己为 “效力社会的公司”。 @@ -84,65 +84,65 @@ Purism 是从一个众筹项目开始的,该项目旨在创造一个几乎没 后来 Purism 发布了一个 13 英寸的版本 [Librem 13][18]。Purism 还开发了一个自己的 Linux 发行版 [Pure OS][19],该发行版非常注重隐私和安全问题。 -[Pure OS 在台式设备和移动设备上都可以运行][20],并且是 Librem 笔记本和[Librem 5 Linux 手机] 的默认操纵系统。 +[Pure OS 在台式设备和移动设备上都可以运行][20],并且是 Librem 笔记本和[Librem 5 Linux 手机][21] 的默认操纵系统。 -Purism 的零部件来自中国大陆、台湾、日本以及美国,并在美国完成组装。他们的所有设备都有可以用来关闭麦克风、摄像头、无线连接或者是蓝牙的硬件开关。 +Purism 的零部件来自中国大陆、台湾、日本以及美国,并在美国完成组装。他们的所有设备都有可以直接关闭的硬件开关,用来关闭麦克风、摄像头、无线连接或者是蓝牙。 -**支持范围** : 全世界范围国际免邮。可能需要支付额外的关税。 +**支持范围**:全世界范围国际免邮。可能需要支付额外的关税。 -[Purism][22] +- [Purism][22] -#### 4\. Slimbook +#### 4、Slimbook -Slimbook 是一个总部设在西班牙的 Linux 电脑销售商. Slimbook 在发行了 [第一款 KDE 品牌笔记本][23]之后成为了人们关注的焦点。 +Slimbook 是一个总部设在西班牙的 Linux 电脑销售商。Slimbook 在发行了 [第一款 KDE 品牌笔记本][23]之后成为了人们关注的焦点。 -他们的产品不仅限于KDE Neon。他们还提供 Ubuntu,Kubuntu,Ubuntu MATE,Linux Mint 以及包括 [Lliurex][24] 和 [Max][25]在内的西班牙发行版。您也可以选择 Windows(需要额外付费)或者不预装任何操作系统。 +他们的产品不仅限于 KDE Neon。他们还提供 Ubuntu、Kubuntu、Ubuntu MATE、Linux Mint 以及包括 [Lliurex][24] 和 [Max][25] 这样的西班牙发行版。你也可以选择 Windows(需要额外付费)或者不预装任何操作系统。 -Slimbook 有众多 Linux 笔记本,台式机和迷你电脑可供选择。他们另外一个非常不错的产品是一个类似于 iMac 的 24 英寸 [拥有内置 CPU 的曲面显示屏][26]。 +Slimbook 有众多 Linux 笔记本、台式机和迷你电脑可供选择。他们另外一个非常不错的产品是一个类似于 iMac 的 24 英寸 [拥有内置 CPU 的曲面显示屏][26]。 ![Slimbook Kymera Aqua 水冷 Linux 电脑][27] 想要一台水冷 Linux 电脑吗?Slimbook 的 [Kymera Aqua][28] 是合适之选。 -**支持范围** : 全世界范围,不过在邮费和关税上都可能产生额外费用。 +**支持范围**:全世界范围,不过在邮费和关税上都可能产生额外费用。 -[Slimbook][29] +- [Slimbook][29] -#### 5\. TUXEDO +#### 5、TUXEDO 作为这个 Linux 电脑销售商清单里的另一个欧洲成员,[TUXEDO][30] 总部设在德国,主要服务德国用户,其次是欧洲用户。 -TUXEDO 只使用 Linux 系统,产品都是“德国制造”,并且提供 5 年保修和终身售后支持。 +TUXEDO 只使用 Linux 系统,产品都是“德国制造”,并且提供 5 年保修和终生售后支持。 TUXEDO 在 Linux 系统的硬件适配上下了很大功夫。并且如果你遇到了麻烦或者是想从头开始,可以通过系统恢复选项,自动恢复出厂设置。 ![Tuxedo 电脑支持众多发行版][31] -TUXEDO 有许多 Linux 笔记本、台式机和迷你电脑产品可供选择。他们还同时拥有 Intel 和 AMD 的处理器。 除了电脑,TUXEDO 还提供一系列 Linux 支持的附件,比如扩展坞、DVD和蓝光刻录机、移动电源以及其它外围设备。 +TUXEDO 有许多 Linux 笔记本、台式机和迷你电脑产品可供选择。他们还同时支持 Intel 和 AMD 的处理器。除了电脑,TUXEDO 还提供一系列 Linux 支持的附件,比如扩展坞、DVD 和蓝光刻录机、移动电源以及其它外围设备。 -**支持范围** : 150 欧元以上的订单在德国和欧洲范围内免邮。欧洲外国家会有额外的运费和关税。更多信息见 [这里][32]. +**支持范围**:150 欧元以上的订单在德国和欧洲范围内免邮。欧洲外国家会有额外的运费和关税。更多信息见 [这里][32]. -[TUXEDO][33] +- [TUXEDO][33] -#### 6\. Vikings +#### 6、Vikings [Vikings][34] 的总部设在德国(而不是斯堪的纳维亚半岛,哈哈)。Vikings 拥有[自由软件基金会][35]的认证,专注于自由友好的硬件。 ![Vikings 的产品经过了自由软件基金会认证][36] -Vikings 的 Linux 笔记本和台式机使用的是 [coreboot][37] 或者 [Libreboot][38],而不是像 BIOS 和 UEFI 这样的专有启动系统。你还可以购买 [服务器硬件][39],这款产品不运行任何专有软件。 +Vikings 的 Linux 笔记本和台式机使用的是 [coreboot][37] 或者 [Libreboot][38],而不是像 BIOS 和 UEFI 这样的专有启动系统。你还可以购买不运行任何专有软件的 [硬件服务器][39]。 Vikings 还有包括路由器、扩展坞等在内的其它配件。他们的产品都是在德国组装完成的。 -**支持范围** : 全世界(除了朝鲜)。非欧洲国家可能会有额外关税费用。更多信息见[这里][40]. +**支持范围**:全世界(除了朝鲜)。非欧洲国家可能会有额外关税费用。更多信息见[这里][40]。 -[Vikings][41] +- [Vikings][41] -#### 7\. Ubuntushop.be +#### 7、Ubuntushop.be -不!尽管名字里有Ubuntu,但这不是官方的 Ubuntu 商店。Ubuntushop 总部位于比利时,最初是销售安装了 Ubuntu 的电脑。 +不不!尽管名字里有 Ubuntu,但这不是官方的 Ubuntu 商店。Ubuntushop 总部位于比利时,最初是销售安装了 Ubuntu 的电脑。 -如今,你可以买到预装了包括 Mint、Manjaro、 elementrayOS 在内的 Linux 发行版的笔记本电脑。你还可以要求所购买的设备上安装你所选择的发行版。 +如今,你可以买到预装了包括 Mint、Manjaro、elementrayOS 在内的 Linux 发行版的笔记本电脑。你还可以要求所购买的设备上安装你所选择的发行版。 ![][42] @@ -152,15 +152,15 @@ Ubuntushop 的一个独特之处在于,它的所有电脑都带有默认的 Ta 和此列表中的许多其他重要玩家不同,我觉得 Ubuntushop 所提供的更像是一种“家庭工艺”。商家手动组装一个电脑,安装 Linux 然后卖给你。不过他们也在一些可选项上下了功夫,比如说轻松的重装系统,拥有自己的云服务器等等。 -你可以找一台旧电脑快递给他们,同时在他们的网站上买一台新的 Linux 电脑,他们就会在你的旧电脑上安装 [轻量级 Linux][45] 系统然后快递回来,这样你这台旧电脑就可以重新投入使用了。 +你可以找一台旧电脑快递给他们,就可以变成一台新安装 Linux 的电脑,他们就会在你的旧电脑上安装 [轻量级 Linux][45] 系统然后快递回来,这样你这台旧电脑就可以重新投入使用了。 -**支持范围** : 比利时以及欧洲的其它地区。 +**支持范围**:比利时以及欧洲的其它地区。 -[Ubuntushop.be][46] +- [Ubuntushop.be][46] -#### 8\. Minifree +#### 8、Minifree -[Minifree][47],自由部门的缩写,是一家注册在英格兰的公司。 +[Minifree][47],是自由部门Ministry of Freedom的缩写,他们是一家注册在英格兰的公司。 你可以猜到 Minifree 非常注重自由。他们提供安全以及注重隐私的电脑,预装 [Libreboot][38] 而不是 BIOS 或者 UEFI。 @@ -170,15 +170,15 @@ Minifree 的设备经过了 [自由软件基金会][48] 的认证,所以你可 和这个清单中许多其它 Linux 笔记本销售商不同,Minifree 的电脑并不是特别贵。花 200 欧元就可以买到一台预装了 Libreboot 和 [Trisquel GNU/Linux][50] 的 Linux 电脑。 -除了笔记本以外,Minifree 还有一系列的配件,比如 Libre 路由器、平板电、扩展坞、电池、键盘、鼠标等等。 +除了笔记本以外,Minifree 还有一系列的配件,比如 Libre 路由器、平板电脑、扩展坞、电池、键盘、鼠标等等。 如果你和 [Richard Stallman][51] 一样,希望只运行 100% 自由的软件的话,Minifree 就再适合不过了。 -**支持范围** : 全世界。运费信息见 [这里][52]。 +**支持范围**:全世界。运费信息见 [这里][52]。 -[Minifree][47] +- [Minifree][47] -#### 9\. Entroware +#### 9、Entroware [Entroware][53] 是另一个总部设在英国的销售商,专注基于 Linux 系统的笔记本、台式机和服务器。 @@ -190,9 +190,9 @@ Minifree 的设备经过了 [自由软件基金会][48] 的认证,所以你可 支持范围: 英国、爱尔兰、法国、德国、意大利、西班牙。 -[Entroware][58] +- [Entroware][58] -#### 10\. Juno +#### 10、Juno 这是我们清单上的一个新的 Linux 笔记本销售商。Juno 的总部同样设在英国,提供预装 Linux 的电脑。可选择的 Linux 发行版包括 elementary OS、Ubuntu 和 Solus OS。 @@ -204,7 +204,7 @@ Juno 的主要特色是 Juve,一款售价 299 美元的 Chromebook 的低成 支持范围:英国、美国、加拿大、墨西哥、南美和欧洲的大部分地区、新西兰、亚洲和非洲的某些地区。更多信息见 [这里][62]。 -[Juno Computers][63] +- [Juno Computers][63] #### 荣誉奖 @@ -216,10 +216,9 @@ Juno 的主要特色是 Juve,一款售价 299 美元的 Chromebook 的低成 * [Linux Certified][67] * [Think Penguin][68] - 包括宏碁和联想在内的其它主流电脑生产商可能也有基于 Linux 系统的产品,所以你不妨也查看一下他们的产品目录吧。 -你有没有买过一台 Linux 电脑?在哪儿买的?使用体验怎么样?Linux 笔记本值不值得买?分享一下你的想法吧。 +你有没有买过 Linux 电脑?在哪儿买的?使用体验怎么样?Linux 笔记本值不值得买?分享一下你的想法吧。 -------------------------------------------------------------------------------- @@ -227,8 +226,8 @@ via: https://itsfoss.com/get-linux-laptops/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/chen-ni) -校对:[校对者ID](https://github.com/校对者ID) +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 78da13b5b076220cf7605c81fcbf4501731b97d8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Jun 2019 11:57:42 +0800 Subject: [PATCH 0933/1154] PUB:20190517 10 Places Where You Can Buy Linux Computers.md @chen-ni https://linux.cn/article-10982-1.html --- .../20190517 10 Places Where You Can Buy Linux Computers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190517 10 Places Where You Can Buy Linux Computers.md (99%) diff --git a/translated/tech/20190517 10 Places Where You Can Buy Linux Computers.md b/published/20190517 10 Places Where You Can Buy Linux Computers.md similarity index 99% rename from translated/tech/20190517 10 Places Where You Can Buy Linux Computers.md rename to published/20190517 10 Places Where You Can Buy Linux Computers.md index 527e68d0aa..8897eaa7a4 100644 --- a/translated/tech/20190517 10 Places Where You Can Buy Linux Computers.md +++ b/published/20190517 10 Places Where You Can Buy Linux Computers.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10982-1.html) [#]: subject: (10 Places Where You Can Buy Linux Computers) [#]: via: (https://itsfoss.com/get-linux-laptops/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From d7ec51cd947e46ea4f9dd782b8f69af8fe7b8090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=A6=E9=94=8B?= <289716347@qq.com> Date: Sun, 16 Jun 2019 12:21:29 +0800 Subject: [PATCH 0934/1154] translated --- ...essential values for the DevOps mindset.md | 85 ------------------- ...essential values for the DevOps mindset.md | 83 ++++++++++++++++++ 2 files changed, 83 insertions(+), 85 deletions(-) delete mode 100644 sources/tech/20190509 5 essential values for the DevOps mindset.md create mode 100644 translated/tech/20190509 5 essential values for the DevOps mindset.md diff --git a/sources/tech/20190509 5 essential values for the DevOps mindset.md b/sources/tech/20190509 5 essential values for the DevOps mindset.md deleted file mode 100644 index e9dafbd673..0000000000 --- a/sources/tech/20190509 5 essential values for the DevOps mindset.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (arrowfeng) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 essential values for the DevOps mindset) -[#]: via: (https://opensource.com/article/19/5/values-devops-mindset) -[#]: author: (Brent Aaron Reed https://opensource.com/users/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed) - -5 essential values for the DevOps mindset -====== -People and process take more time but are more important than any -technology "silver bullet" in solving business problems. -![human head, brain outlined with computer hardware background][1] - -Many IT professionals today struggle with adapting to change and disruption. Are you struggling with just trying to keep the lights on, so to speak? Do you feel overwhelmed? This is not uncommon. Today, the status quo is not enough, so IT constantly tries to re-invent itself. - -With over 30 years of combined IT experience, we have witnessed how important people and relationships are to IT's ability to be effective and help the business thrive. However, most of the time, our conversations about IT solutions start with technology rather than people and process. The propensity to look for a "silver bullet" to address business and IT challenges is far too common. But you can't just buy innovation, DevOps, or effective teams and ways of working; they need to be nurtured, supported, and guided. - -With disruption so prevalent and there being such a critical demand for speed of change, we need both discipline and guardrails. The five essential values for the DevOps mindset, described below, will support the practices that will get us there. These values are not new ideas; they are refactored as we've learned from our experience. Some of the values may be interchangeable, they are flexible, and they guide overall principles that support (like a pillar) these five values. - -![5 essential values for the DevOps mindset][2] - -### 1\. Feedback from stakeholders is essential - -How do we know if we are creating more value for us than for our stakeholders? We need persistent quality data to analyze, inform, and drive better decisions. Relevant information from trusted sources is vital for any business to thrive. We need to listen to and understand what our stakeholders are saying—and not saying—and we need to implement changes in a way that enables us to adjust our thinking—and our processes and technologies—and adapt them as needed to delight our stakeholders. Too often, we see little change, or lots of change for the wrong reasons, because of incorrect information (data). Therefore, aligning change to our stakeholders' feedback is an essential value and helps us focus on what is most important to making our company successful. - -> Focus on our stakeholders and their feedback rather than simply changing for the sake of change. - -### 2\. Improve beyond the limits of today's processes - -We want our products and services to continuously delight our customers—our most important stakeholders—therefore, we need to improve continually. This is not only about quality; it could also mean costs, availability, relevance, and many other goals and factors. Creating repeatable processes or utilizing a common framework is great—they can improve governance and a host of other issues—however, that should not be our end goal. As we look for ways to improve, we must adjust our processes, complemented by the right tech and tools. There may be reasons to throw out a "so-called" framework because not doing so could add waste—or worse, simply "cargo culting" (doing something with of no value or purpose). - -> Strive to always innovate and improve beyond repeatable processes and frameworks. - -### 3\. No new silos to break down silos - -Silos and DevOps are incompatible. We see this all the time: an IT director brings in so-called "experts" to implement agile and DevOps, and what do they do? These "experts" create a new problem on top of the existing problem, which is another silo added to an IT department and a business riddled with silos. Creating "DevOps" titles goes against the very principles of agile and DevOps, which are based on the concept of breaking down silos. In both agile and DevOps, teamwork is essential, and if you don't work in a self-organizing team, you're doing neither of them. - -> Inspire and share collaboratively instead of becoming a hero or creating a silo. - -### 4\. Knowing your customer means cross-organization collaboration - -No part of the business is an independent entity because they all have stakeholders, and the primary stakeholder is always the customer. "The customer is always right" (or the king, as I like to say). The point is, without the customer, there really is no business, and to stay in business today, we need to "differentiate" from our competitors. We also need to know how our customers feel about us and what they want from us. Knowing what the customer wants is imperative and requires timely feedback to ensure the business addresses these primary stakeholders' needs and concerns quickly and responsibly. - -![Minimize time spent with build-measure-learn process][3] - -Whether it comes from an idea, a concept, an assumption, or direct stakeholder feedback, we need to identify and measure the feature or service our product delivers by using the explore, build, test, deliver lifecycle. Fundamentally, this means that we need to be "plugged into" our organization across the organization. There are no borders in continuous innovation, learning, and DevOps. Thus when we measure across the enterprise, we can understand the whole and take actionable, meaningful steps to improve. - -> Measure performance across the organization, not just in a line of business. - -### 5\. Inspire adoption through enthusiasm - -Not everyone is driven to learn, adapt, and change; however, just like smiles can be infectious, so can learning and wanting to be part of a culture of change. Adapting and evolving within a culture of learning provides a natural mechanism for a group of people to learn and pass on information (i.e., cultural transmission). Learning styles, attitudes, methods, and processes continually evolve so we can improve upon them. The next step is to apply what was learned and improved and share the information with colleagues. Learning does not happen automatically; it takes effort, evaluation, discipline, awareness, and especially communication; unfortunately these are things that tools and automation alone will not provide. Review your processes, automation, tool strategies, and implementation work, make it transparent, and collaborate with your colleagues on reuse and improvement. - -> Promote a culture of learning through lean quality deliverables, not just tools and automation. - -### Summary - -![Continuous goals of DevOps mindset][4] - -As our companies adopt DevOps, we continue to champion these five values over any book, website, or automation software. It takes time to adopt this mindset, and this is very different than what we used to do as sysadmins. It's a wholly new way of working that will take many years to mature. Do these principles align with your own? Share them in the comments or on our website, [Agents of chaos][5]. - -* * * - -Can you really do DevOps without sharing scripts or code? DevOps manifesto proponents value cross-... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/values-devops-mindset - -作者:[Brent Aaron Reed][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/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_data.png?itok=RH6NA32X (human head, brain outlined with computer hardware background) -[2]: https://opensource.com/sites/default/files/uploads/devops_mindset_values.png (5 essential values for the DevOps mindset) -[3]: https://opensource.com/sites/default/files/uploads/devops_mindset_minimze-time.jpg (Minimize time spent with build-measure-learn process) -[4]: https://opensource.com/sites/default/files/uploads/devops_mindset_continuous.png (Continuous goals of DevOps mindset) -[5]: http://agents-of-chaos.org diff --git a/translated/tech/20190509 5 essential values for the DevOps mindset.md b/translated/tech/20190509 5 essential values for the DevOps mindset.md new file mode 100644 index 0000000000..70bb11278d --- /dev/null +++ b/translated/tech/20190509 5 essential values for the DevOps mindset.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 essential values for the DevOps mindset) +[#]: via: (https://opensource.com/article/19/5/values-devops-mindset) +[#]: author: (Brent Aaron Reed https://opensource.com/users/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed) + +关于 DevOps 思维模式所需具备的5个基本价值观 +====== +人和流程比在解决的业务问题的任何技术“银弹”更重要,且需要花更多的时间。 +![human head, brain outlined with computer hardware background][1] + +今天的许多 IT 专业人士都在努力适应变化和扰动。您是否正在努力适应变化,可以这么说? 你觉得不堪重负吗?这并不罕见。今天,IT 的现状还不够好,所以需要不断尝试重新自我演进。 + +凭借30多年的IT综合经验,我们见证了人们和人际关系的重要性,它有让 IT有效和帮助业务蓬勃发展的能力。但是,在大多数情况下,我们关于IT解决方案的对话始于技术而非人员和流程。寻找“银弹”来解决业务和IT挑战的倾向非常普遍。但你不能只关心创新,DevOps或有效的团队和工作方式;他们需要得到培养,支持和引导。 + +由于扰动如此普遍,并且对变革速度存在如此迫切的需求,我们需要纪律和围栏。下面描述的 DevOps 思维模式的五个基本价值观将支持将我们带到那里的实践。这些价值观不是新观念;我们从经验中学到了它们并重构它们。一些值可以互换,它们是灵活的,并且它们指导支持(如支柱)这五个价值观的整体原则。 + +![5 essential values for the DevOps mindset][2] + +### 1\. 利益相关方的反馈至关重要 + +我们如何知道我们是否为我们创造了比利益相关者更多的价值? 我们需要持久的质量数据来分析,通知并推动更好的决策。 来自可靠来源的相关信息对于任何业务的蓬勃发展至关重要。 我们需要倾听并理解我们的利益相关者所说的,而不是说我们需要以一种方式实施变革,使我们能够调整我们的思维、我们的流程和技术,并根据需要对其进行调整以使我们的利益相关者满意。由于信息(数据)不正确,我们常常看到很少的变化,或者由于错误的原因而发生的很多变化。因此,将变更与利益相关方的反馈结合起来是一项重要的价值,并有助我们专注于使公司成功最重要的事情。 + + +> 关注我们的利益相关者及其反馈,而不仅仅是为了改变而改变。 + +### 2\. 超越当今流程的极限 + +我们希望我们的产品和服务能够不断让客户满意——我们最重要的利益相关者。因此,我们需要不断改进。这不仅仅是关于质量;它还可能意味着成本,可用性,相关性以及许多其他目标和因素。创建可重复的流程或使用通用框架是非常棒的,它们可以改善治理和许多其他问题。但是,这不应该是我们的最终目标。在寻找改进方法时,我们必须调整我们的流程,并辅以正确的技术和工具。可能有理由抛弃“所谓的”框架,因为不这样做可能会增加浪费,更糟糕的是只是“货物结果”(做一些没有价值或目的的东西)。 + +> 力争始终创新并改进可重复的流程和框架。 + +### 3\. 无需新的筒仓来打破旧的筒仓 + +筒仓和DevOps是不兼容的。我们始终看到这一点:IT 主管带来了所谓的“专家”来实施敏捷和DevOps,他们做了什么?这些“专家”在现有问题的基础上创建了一个新问题,这是另一个加入 IT 部门的筒仓和一个充满筒仓的企业。创建“DevOps”标题违背了敏捷和DevOps的原则,这些原则基于打破筒仓的概念。在敏捷和DevOps中,团队合作是必不可少的,如果你不在自组织团队中工作,那么你就不会做任何事情。 + +> 相互激励和共享,而不是成为英雄或创建一个筒仓。 + +### 4\. 了解您的客户意味着跨组织协作 + +业务的任何部分都不是一个独立的实体,因为它们都有利益相关者,主要利益相关者始终是客户。“客户永远是对的”(正如我想说的那样,或者是国王)。关键是,没有客户,真的没有业务,而且为了保持业务,如今我们需要与竞争对手“区别对待”。我们还需要了解客户对我们的看法以及他们对我们的期望。了解客户的需求势在必行,需要及时反馈,以确保业务能够快速,负责地满足这些主要利益相关者的需求和关注。 + +![Minimize time spent with build-measure-learn process][3] + +无论是想法,概念,假设还是直接的利益相关者反馈,我们都需要通过使用探索,构建,测试和交付生命周期来识别和衡量我们的产品提供的功能或服务。从根本上说,这意味着我们需要在整个组织中“插入”我们的组织。在持续创新,学习和DevOps方面没有任何边界。因此,当我们在整个企业中进行衡量时,我们可以理解整体并采取可行的,有意义的步骤来改进。 + +> 衡量整个组织的绩效,而不仅仅是在业务范围内。 + +### 5\. 热情鼓舞采纳 + +不是每个人都被驱使去学习,适应和改变;然而,就像微笑可能具有传染性一样,学习和意愿成为变革文化的一部分也是如此。在学习文化中适应和演化为一群人提供了学习和传递信息(即文化传播)的自然机制。学习风格,态度,方法和过程不断演化,因此我们可以改进它们。下一步是应用所学和改进的内容并与同事分享信息。学习不会自动发生;它需要努力,评估,纪律,意识,特别是沟通;遗憾的是,这些都是工具和自动化无法提供的。检查您的流程,自动化,工具策略和实施工作,使其透明化,并与您的同事协作重复使用和改进。 + +> 通过精益质量的可交付成果促进学习文化,而不仅仅是工具和自动化。 + +### 总结 + +![Continuous goals of DevOps mindset][4] + +随着我们的公司采用DevOps,我们继续在任何书籍,网站或自动化软件上支持这五个价值观。采用这种思维方式需要时间,这与我们以前作为系统管理员所做的完全不同。这是一种全新的工作方式,需要很多年才能成熟。这些原则是否与您自己的原则一致?在评论或我们的网站上分享。[混乱特工] + +* * * + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/values-devops-mindset + +作者:[Brent Aaron Reed][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/arrowfeng) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_data.png?itok=RH6NA32X (human head, brain outlined with computer hardware background) +[2]: https://opensource.com/sites/default/files/uploads/devops_mindset_values.png (5 essential values for the DevOps mindset) +[3]: https://opensource.com/sites/default/files/uploads/devops_mindset_minimze-time.jpg (Minimize time spent with build-measure-learn process) +[4]: https://opensource.com/sites/default/files/uploads/devops_mindset_continuous.png (Continuous goals of DevOps mindset) +[5]: http://agents-of-chaos.org From 8fc09bf59ab33c8bd51645cee179ad65a0fbcffa Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Sun, 16 Jun 2019 16:30:35 +0800 Subject: [PATCH 0935/1154] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91?= =?UTF-8?q?=E8=AF=91=E6=96=87=2020190610=20Welcoming=20Blockchain=203.0.md?= =?UTF-8?q?=20=E3=80=90=E7=A7=BB=E9=99=A4=E3=80=91=E5=8E=9F=E6=96=87=20201?= =?UTF-8?q?90610=20Welcoming=20Blockchain=203.0.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- .../tech/20190610 Welcoming Blockchain 3.0.md | 113 ------------------ .../tech/20190610 Welcoming Blockchain 3.0.md | 105 ++++++++++++++++ 2 files changed, 105 insertions(+), 113 deletions(-) delete mode 100644 sources/tech/20190610 Welcoming Blockchain 3.0.md create mode 100644 translated/tech/20190610 Welcoming Blockchain 3.0.md diff --git a/sources/tech/20190610 Welcoming Blockchain 3.0.md b/sources/tech/20190610 Welcoming Blockchain 3.0.md deleted file mode 100644 index 7c8579cd92..0000000000 --- a/sources/tech/20190610 Welcoming Blockchain 3.0.md +++ /dev/null @@ -1,113 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (murphyzhao) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Welcoming Blockchain 3.0) -[#]: via: (https://www.ostechnix.com/welcoming-blockchain-3-0/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Welcoming Blockchain 3.0 -====== - -![Welcoming blockchain 3.0][1] - -Image credit : - -The series of posts [**“Blockchain 2.0”**][2] discussed about the evolution of blockchain technology since the advent of cryptocurrencies since the Bitcoin in 2008. This post will seek to explore the future of blockchains. Lovably called **blockchain 3.0** , this new wave of DLT evolution will answer the issues faced with blockchains currently (each of which will be summarized here). The next version of the tech standard will also bring new applications and use cases. At the end of the post we will also look at a few examples of these principles currently applied. - -Few of the shortcomings of blockchain platforms in existence are listed below with some proposed solutions to those answered afterward. - -### Problem 1: Scalability[1] - -This is seen as the first major hurdle to mainstream adoption. As previously discussed, a lot of limiting factors contribute to the blockchain’s in-capacity to process a lot of transactions at the same time. Existing networks such as [**Ethereum**][3] are capable of measly 10-15 transactions per second (TPS) whereas mainstream networks such as those employed by Visa for instance are capable of more than 2000 TPS. **Scalability** is an issue that plagues all modern database systems. Improved consensus algorithms and better blockchain architecture designs are improving it though as we see here. - -**Solving scalability** - -Implementing leaner and more efficient consensus algorithms have been proposed for solving issues of scalability without disturbing the primary structure of the blockchain. While most cryptocurrencies and blockchain platforms use resource intensive PoW algorithms (For instance, Bitcoin & Ethereum) to generate blocks, newer DPoS and PoET algorithms exist to solve this issue. DPoS and PoET algorithms (there are some more in development) require less resources to maintain the blockchain and have shown to have throughputs ranging up to 1000s of TPS rivalling that of popular non-blockchain systems. - -The second solution to scalability is altering the blockchain structure[1] and functionality altogether. We won’t get into finer details of this, but alternative architectures such as **Directed Acyclic Graph** ( **DAG** ) have been proposed to handle this issue. Essentially, the assumption for this to work is that not all network nodes need to have a copy of the entire blockchain for the blockchain to work or the participants to reap the benefits of a DLT system. The system does not require transactions to be validated by the entirety of the participants and simply requires the transactions to happen in a common frame of reference and be linked to each other. - -The DAG[2] approach is implemented in the Bitcoin system using an implementation called the **Lightning network** and Ethereum implements the same using their **Sharding** [3] protocol. At its heart a DAG implementation is not technically a blockchain. It’s more like a tangled maze, but still retains the peer to peer and distributed database properties of the blockchain. We will explore DAG and Tangle networks in a separate post later. - -### Problem 2: Interoperability[4][5] - -**Interoperability** is called cross-chain interaction is basically different blockchains being able to talk to each other to exchange metrics and information. With so many platforms that is hard to keep a count on at the moment and different companies coming up with proprietary systems for all the myriad of applications, interoperability between platforms is key. For instance, at the moment, someone who owns digital identities on one platform will not be able to exploit features presented by other platforms because the individual blockchains do not understand or know each other. Problems pertaining to lack of credible verifications, token exchange etc. still persist. A global roll out of [**smart contracts**][4] is also not viable without platforms being able to communicate with each other. - -**Solving Interoperability** - -There are protocols and platforms designed just for enabling interoperability at the moment. Such platforms implement atomic swaps protocols and provide open stages for different blockchain systems to communicate and exchange information between them. An example would be **“0x (ZRX)”** which is described later on. - -### Problem 3: Governance[6] - -Not a limitation in its own, **governance** in a public blockchain needs to act as a community moral compass where everyone’s opinion is taken into account on the operation of the blockchain. Combined and seen with scale this presents a problem where in either the protocols change far too frequently or the protocols are changed at the whims of a “central” authority who holds the most tokens. This is not an issue that most public blockchains are working to avoid right now since the scale at their operating in and the nature of their operations don’t require stricter supervision. - -**Solving Governance issues** - -The Tangled framework or the DAG mentioned above would almost eliminate the need and use for global (platform wide) governance laws. Instead a program can automatically oversee the transaction and user type and decide on the laws that need to be implemented. - -### Problem 4: Sustainability - -**Sustainability** builds on the scalability issue again. Current blockchains and cryptocurrencies are notorious for being not sustainable in the long run owing to the significant oversight that is still required and the amount of resources required to keep the systems running. If you’ve read reports of how “mining cryptocurrencies” have not been so profitable lately, this is what it was. The amount of resources required to keep up existing platforms running is simply not practical at a global scale with mainstream use. - -**Solving non-sustainability** - -From a resources or economic point of view the answer to sustainability would be similar to the one for scalability. However, for the system to be implemented on a global scale, laws and regulations need to endorse it. This however depends on the governments of the world. Favourable moves from the American and European governments have however renewed hopes in this aspect. - -### Problem 5: User adoption[7] - -Currently a hindrance to widespread consumer adoption of blockchain based applications is consumer unfamiliarity with the platform and the tech underneath it. The fact that most applications require some sort of a tech and computing background to figure out how they work does not help in this aspect either. The third wave of blockchain developments seek to lessen the gap between consumer knowledge and platform usability. - -**Solving the user adoption issue** - -The internet took a lot of time to be the way it is now. A lot of work has been done on developing a standardized internet technology stack over the years that has allowed the web to function the way it is now. Developers are working on user facing front end distributed applications that should act as a layer on top of existing web 3.0 technology while being supported by blockchains and open protocols underneath. Such [**distributed applications**][5] will make the underlying technology more familiar to users, hence increasing mainstream adoption. - -We’ve discussed about the solutions to the above issues theoretically, and now we proceed to show these being applied in the present scenario. - -**[0x][6]** – is a decentralized token exchange where users from different platforms can exchange tokens without the need of a central authority to vet the same. Their breakthrough comes in how they’ve designed the system to record and vet the blocks only after transactions are settled and not in between (to verify context, blocks preceding the transaction order is also verified normally) as is normally done. This allows for a more liquid faster exchange of digitized assets online. - -**[Cardano][7]** – founded by one of the co-founders of Ethereum, Cardano boasts of being a truly “scientific” platform with multiple reviews and strict protocols for the developed code and algorithms. Everything out of Cardano is assumed to be mathematically as optimized as possible. Their consensus algorithm called **Ouroboros** , is a modified Proof of Stake algorithm. Cardano is developed in [**Haskell**][8] and the smart contract engine uses a derivative of Haskell called **Plutus** for operating. Both are functional programming languages which guarantee secure transactions without compromising efficiency. - -**EOS** – We’ve already described EOS here in [**this post**][9]. - -**[COTI][10]** – a rather obscure architecture, COTI entails no mining, and next to zero power consumption in operating. It also stores assets in offline wallets localized on user’s devices rather than a pure peer to peer network. They also follow a DAG based architecture and claim of processing throughputs of up to 10000 TPS. Their platform allows enterprises to build their own cryptocurrency and digitized currency wallets without exploiting a blockchain. - -**References:** - - * [1] **A. P. Paper, K. Croman, C. Decker, I. Eyal, A. E. Gencer, and A. Juels, “On Scaling Decentralized Blockchains | SpringerLink,” 2018.** - * [2] [**Going Beyond Blockchain with Directed Acyclic Graphs (DAG)**][11] - * [3] [**Ethreum/wiki – On sharding blockchains**][12] - * [4] [**Why is blockchain interoperability important**][13] - * [5] [**The Importance of Blockchain Interoperability**][14] - * [6] **R. Beck, C. Müller-Bloch, and J. L. King, “Governance in the Blockchain Economy: A Framework and Research Agenda,” J. Assoc. Inf. Syst., pp. 1020–1034, 2018.** - * [7] **J. M. Woodside, F. K. A. Jr, W. Giberson, F. K. J. Augustine, and W. Giberson, “Blockchain Technology Adoption Status and Strategies,” J. Int. Technol. Inf. Manag., vol. 26, no. 2, pp. 65–93, 2017.** - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/welcoming-blockchain-3-0/ - -作者:[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/2019/06/blockchain-720x340.jpg -[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ -[3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ -[4]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ -[5]: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ -[6]: https://0x.org/ -[7]: https://www.cardano.org/en/home/ -[8]: https://www.ostechnix.com/getting-started-haskell-programming-language/ -[9]: https://www.ostechnix.com/blockchain-2-0-eos-io-is-building-infrastructure-for-developing-dapps/ -[10]: https://coti.io/ -[11]: https://cryptoslate.com/beyond-blockchain-directed-acylic-graphs-dag/ -[12]: https://github.com/ethereum/wiki/wiki/Sharding-FAQ#introduction -[13]: https://www.capgemini.com/2019/02/can-the-interoperability-of-blockchains-change-the-world/ -[14]: https://medium.com/wanchain-foundation/the-importance-of-blockchain-interoperability-b6a0bbd06d11 diff --git a/translated/tech/20190610 Welcoming Blockchain 3.0.md b/translated/tech/20190610 Welcoming Blockchain 3.0.md new file mode 100644 index 0000000000..cdd7060a10 --- /dev/null +++ b/translated/tech/20190610 Welcoming Blockchain 3.0.md @@ -0,0 +1,105 @@ + +欢迎区块链 3.0 +====== + +![欢迎区块链 3.0][1] + +图片来源: + +“Blockchain 2.0” 系列文章讨论了自 2008 年比特币等加密货币问世以来区块链技术的发展。本文将探讨区块链的未来发展。本文将未来的区块链形态亲切地称作 **区块链 3.0**,这一新的 DLT(Distributed Ledger Technology:分布式分类帐技术)技术演进浪潮将回答当前区块链所面临的问题(每一个问题都会在这里总结)。下一版本的技术标准也将带来全新的应用和使用案例。在本文的最后,我们也会看一些当前使用这些原则的案例。 + +以下是现有区块链平台的几个缺点,并针对这些缺点给出了建议的解决方案。 + +### 问题 1:可扩展性[1] + +这个问题是被普遍认为的第一个主要障碍。正如之前所讨论的,很多因素限制了区块链同时处理大量交易的能力。诸如 [**以太坊**][3] 之类的现有网络每秒能够进行 10-15 次交易(TPS),而像 Visa 所使用的主流网络每秒能够进行超过 2000 次交易。**可伸缩性**是困扰所有现代数据库系统的问题。正如我们在这里看到的那样,改进的共识算法和更好的区块链架构设计正在改进它。 + +**解决可扩展性** + +已经提出了更精简、更有效的一致性算法来解决可伸缩性问题,并且不会影响区块链的主要结构。虽然大多数加密货币和区块链平台使用资源密集型的 PoW 算法(例如,比特币和以太坊)来生成区块,但是存在更新的 DPoS 和 PoET 算法来解决这个问题。DPoS 和 PoET 算法(还有一些正在开发中)需要更少的资源来维持区块链,并且已显示具有高达 1000 TPS 的吞吐量,可与流行的非区块链系统相媲美。 + +可伸缩性问题的第二个解决方案是完全改变区块链结构[1]和功能。我们不会详细介绍这一点,但已经提出了诸如**有向无环图**(**DAG**)之类的替代架构来处理这个问题。从本质上讲,这项工作假设并非所有网络节点都需要整个区块链的副本才能使区块链正常工作,或者并非所有的参与者需要从 DLT 系统获得好处。系统不要求整个参与者验证交易,只需要交易发生在共同的参考框架中并相互链接。系统不要求通过所有的参与者验证交易,只需要交易发生在共同的参考框架中并相互链接。 + +在比特币系统中使用 **Lightning network** 来实现 DAG[2],而以太坊使用他们的 **Sharding** [3] 协议来实现 DAG。本质上,从技术上来看 DAG 实现并不是区块链。它更像是一个错综复杂的迷宫,只是仍然保留了区块链的点对点和分布式数据库属性。稍后我们将在另一篇文章中探讨 DAG 和 Tangle 网络。 + +### 问题 2:互通性[4][5] + +**互通性**被称为跨链访问,是不同区块链之间能够彼此相互通信以交换指标和信息的基础。由于目前很难平衡众多的平台,不同公司为所有无数应用提供专有系统,平台之间的互操作性就至关重要。例如,目前,在一个平台上拥有数字身份的人无法利用其他平台提供的功能,因为各个区块链不理解或了解彼此。这是由于缺乏可靠的验证、令牌交换等有关的问题仍然存在。如果平台之间不能够相互通信,全球推出 [**智能合约**][4] 也是不可行的。 + +**解决互通性** + +有一些协议和平台专为实现互操作性而设计。这些平台实现了原子交换协议,并向不同的区块链系统提供开放,以便在它们之间进行通信和交换信息。**“0x (ZRX)”** 就是其中的一个例子,稍后将对进行描述。 + +### 问题 3:治理[6] + +公共区块链中的治理不是自身的限制,而是需要像社区道德指罗盘一样,在区块链的运作中考虑每个人的意见。结合规模,能预见这样一个问题,即要么协议更改太频繁,要么协议被拥有最多代币的“中央”权威一时冲动下修改。不过这不是大多数公共区块链目前正在努力避免的问题,因为其运营规模和运营性质不需要更严格的监管。 + +**解决治理问题** + +上面提到的复杂的框架或 DAG 几乎可以消除对全球(平台范围)治理法的需要和使用。相反,程序可以自动监督事务和用户类型,并决定需要执行的法律。 + +### 问题 4:可持续发展 + +可持续性再次建立在可扩展性问题的基础上。当前的区块链和加密货币因长期不可持续而臭名昭著,这是由于仍然需要大量的监督和保持系统运行所需的资源。如果你读过 `最近“挖掘加密货币”已经没有这么大利润` 的相关报道,你就知道“挖矿”图利就是它的本来面目。在主流使用的全球范围内,保持现有平台运行所需的资源量是不现实。 + +**解决非可持续性问题** + +从资源或经济角度来看,可持续性的答案与可扩展性的答案类似。但是,要在全球范围内实施这一制度,法律和法规必须予以认可。然而,这取决于世界各国政府。来自美国和欧洲政府的有利举措重新燃起了对这方面的希望。 + +### 问题 5:用户采用[7] + +目前,阻止消费者广泛采用基于区块链的应用程序的一个障碍是消费者对平台及其下的技术不熟悉。事实上,大多数应用程序都需要某种技术和计算背景来弄清楚它们是如何工作的,这在这方面也没有帮助。第三波区块链开发旨在缩小消费者知识与平台可用性之间的差距。 + +**解决用户采用问题** + +互联网花了很长的时间才发展成现在的样子。多年来,人们在开发标准化互联网技术栈方面做了大量的工作,使网络能够像现在这样运作。开发人员正在开发面向用户的前端分布式应用程序,这些应用程序应作为现有 Web 3.0 技术之上的一层,同时受到下面的区块链和开放协议的支持。这样的 [**分布式应用**][5] 将使用户更熟悉底层技术,从而增加主流采用。 + +我们已经从理论上讨论了上述问题的解决方法,现在我们将继续展示这些方法在当前场景中的应用。 + +**[0x][6]** – 是一种去中心化的令牌交换,不同平台的用户可以在不需要中央权威机构审查的情况下交换令牌。他们的突破在于,他们如何设计系统使得仅在交易结算后才记录和审查数据块而不是之间(为了验证上下文,通常也会验证交易之前的数据块)。这使在线数字资产交换更快速。 + +**[Cardano][7]** – 由以太坊的联合创始人之一创建,Cardano 自诩为一个真正的“科学”平台,拥有大量的审查和严格的协议,用于他们开发的代码和算法。假设 Cardano 的所有内容都在数学上尽可能优化。他们的共识算法叫做 **Ouroboros**,是一种改进的权益证明算法(PoS:Proof of Stake)。Cardano 是在 [**haskell**][8] 开发的,智能合约引擎使用 haskell 的衍生工具 **plutus** 进行操作。这两者都是函数式编程语言,可以保证安全交易而不会影响效率。 + +**EOS** – 我们已经在 [**这篇文章**][9] 中描述了 EOS。 + +**[COTI][10]** – 一个鲜为人知的架构,COTI 不需要挖矿,而且在运行过程中趋近于零功耗。它还将资产存储在本地用户设备上的离线钱包中,而不是纯粹的对等网络。它们也遵循基于 DAG 的架构,并声称处理吞吐量高达 10000 TPS。他们的平台允许企业在不利用区块链的情况下建立自己的加密货币和数字化货币钱包。 + +**参考:** + + * [1] **A. P. Paper, K. Croman, C. Decker, I. Eyal, A. E. Gencer, and A. Juels, “On Scaling Decentralized Blockchains | SpringerLink,” 2018.** + * [2] [**Going Beyond Blockchain with Directed Acyclic Graphs (DAG)**][11] + * [3] [**Ethreum/wiki – On sharding blockchains**][12] + * [4] [**Why is blockchain interoperability important**][13] + * [5] [**The Importance of Blockchain Interoperability**][14] + * [6] **R. Beck, C. Müller-Bloch, and J. L. King, “Governance in the Blockchain Economy: A Framework and Research Agenda,” J. Assoc. Inf. Syst., pp. 1020–1034, 2018.** + * [7] **J. M. Woodside, F. K. A. Jr, W. Giberson, F. K. J. Augustine, and W. Giberson, “Blockchain Technology Adoption Status and Strategies,” J. Int. Technol. Inf. Manag., vol. 26, no. 2, pp. 65–93, 2017.** + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/welcoming-blockchain-3-0/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[murphyzhao](https://github.com/murphyzhao) +校对:[校对者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/2019/06/blockchain-720x340.jpg +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[4]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[5]: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ +[6]: https://0x.org/ +[7]: https://www.cardano.org/en/home/ +[8]: https://www.ostechnix.com/getting-started-haskell-programming-language/ +[9]: https://www.ostechnix.com/blockchain-2-0-eos-io-is-building-infrastructure-for-developing-dapps/ +[10]: https://coti.io/ +[11]: https://cryptoslate.com/beyond-blockchain-directed-acylic-graphs-dag/ +[12]: https://github.com/ethereum/wiki/wiki/Sharding-FAQ#introduction +[13]: https://www.capgemini.com/2019/02/can-the-interoperability-of-blockchains-change-the-world/ +[14]: https://medium.com/wanchain-foundation/the-importance-of-blockchain-interoperability-b6a0bbd06d11 From ce79af0e6e071f36244749bf056f800151884ba5 Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Sun, 16 Jun 2019 16:52:50 +0800 Subject: [PATCH 0936/1154] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Lovably called **blockchain 3.0** , this new wave of DLT evolution will answer the issues faced with blockchains currently (each of which will be summarized here).` 的翻译不是特别拿得准,请注意审查,谢谢。 Signed-off-by: MurphyZhao --- translated/tech/20190610 Welcoming Blockchain 3.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190610 Welcoming Blockchain 3.0.md b/translated/tech/20190610 Welcoming Blockchain 3.0.md index cdd7060a10..9130f0c073 100644 --- a/translated/tech/20190610 Welcoming Blockchain 3.0.md +++ b/translated/tech/20190610 Welcoming Blockchain 3.0.md @@ -6,7 +6,7 @@ 图片来源: -“Blockchain 2.0” 系列文章讨论了自 2008 年比特币等加密货币问世以来区块链技术的发展。本文将探讨区块链的未来发展。本文将未来的区块链形态亲切地称作 **区块链 3.0**,这一新的 DLT(Distributed Ledger Technology:分布式分类帐技术)技术演进浪潮将回答当前区块链所面临的问题(每一个问题都会在这里总结)。下一版本的技术标准也将带来全新的应用和使用案例。在本文的最后,我们也会看一些当前使用这些原则的案例。 +“Blockchain 2.0” 系列文章讨论了自 2008 年比特币等加密货币问世以来区块链技术的发展。本文将探讨区块链的未来发展。**区块链 3.0** 这一新的 DLT(Distributed Ledger Technology:分布式分类帐技术)技术演进浪潮将回答当前区块链所面临的问题(每一个问题都会在这里总结)。下一版本的技术标准也将带来全新的应用和使用案例。在本文的最后,我们也会看一些当前使用这些原则的案例。 以下是现有区块链平台的几个缺点,并针对这些缺点给出了建议的解决方案。 From e01845f137c5580aa78d777ade0acbbd9f70c4d3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Jun 2019 23:24:55 +0800 Subject: [PATCH 0937/1154] PRF:20190517 10 Places Where You Can Buy Linux Computers.md @geekpi --- ...nexpand Commands Tutorial With Examples.md | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md b/translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md index 3c4f3418c0..9cf35e2e46 100644 --- a/translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md +++ b/translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md @@ -1,26 +1,26 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Expand And Unexpand Commands Tutorial With Examples) [#]: via: (https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-examples/) [#]: author: (sk https://www.ostechnix.com/author/sk/) -expand 与 unexpand 命令教程与示例 +expand 与 unexpand 命令实例教程 ====== ![Expand And Unexpand Commands Explained][1] -本指南通过实际的例子解释两个 Linux 命令,即 **expand** 和 **unexpand**。对于好奇的人,expand 和 unexpand 命令用于将文件中的 TAB 字符替换为空格,反之亦然。在 MS-DOS 中也有一个名为 “expand” 的命令,它用于解压压缩文件。但 Linux expand 命令只是将 tab 转换为空格。这两个命令是 **GNU coreutils** 的一部分,由 **David MacKenzie** 编写。 +本指南通过实际的例子解释两个 Linux 命令,即 `expand` 和 `unexpand`。对于好奇的人,`expand` 和 `unexpand` 命令用于将文件中的 `TAB` 字符替换为空格,反之亦然。在 MS-DOS 中也有一个名为 `expand` 的命令,它用于解压压缩文件。但 Linux 的 `expand` 命令只是将 `TAB` 转换为空格。这两个命令是 GNU coreutils 包的一部分,由 David MacKenzie 编写。 -为了演示,我将在本文使用名为 “ostechnix.txt” 的文本文件。下面给出的所有命令都在 Arch Linux 中进行测试。 +为了演示,我将在本文使用名为 `ostechnix.txt` 的文本文件。下面给出的所有命令都在 Arch Linux 中进行测试。 ### expand 命令示例 -与我之前提到的一样,expand 命令使用空格替换文件中的 TAB 字符。 +与我之前提到的一样,`expand` 命令使用空格替换文件中的 `TAB` 字符。 -现在,让我们将ostechnix.txt 中的 tab 转换为空格,并将结果写入标准输出: +现在,让我们将 `ostechnix.txt` 中的 `TAB` 转换为空格,并将结果写入标准输出: ``` $ expand ostechnix.txt @@ -32,28 +32,27 @@ $ expand ostechnix.txt $ expand ostechnix.txt>output.txt ``` -我们还可以将标准输入中的 tab 转换为空格。为此,只需运行 “expand” 命令而不带文件名: +我们还可以将标准输入中的 `TAB` 转换为空格。为此,只需运行 `expand` 命令而不带文件名: ``` $ expand ``` -只需输入文本并按回车键就能将 tab 转换为空格。按 **CTRL+C** 退出。 +只需输入文本并按回车键就能将 `TAB` 转换为空格。按 `CTRL+C` 退出。 - -如果你不想在非空白符后转换 tab,请使用 **-i** 标记,如下所示。 +如果你不想转换非空白字符后的 `TAB`,请使用 `-i` 标记,如下所示。 ``` $ expand -i ostechnix.txt ``` -我们还可以设置每个 tab 为指定数字的宽度,而不是 8(默认值)。 +我们还可以设置每个 `TAB` 为指定数字的宽度,而不是 `8`(默认值)。 ``` $ expand -t=5 ostechnix.txt ``` -我们甚至可以使用逗号分隔指定多个 tab 位置,如下所示 +我们甚至可以使用逗号分隔指定多个 `TAB` 位置,如下所示。 ``` $ expand -t 5,10,15 ostechnix.txt @@ -73,9 +72,9 @@ $ man expand ### unexpand 命令示例 -正如你可能已经猜到的那样,**unexpand** 命令将执行与 expand 命令相反的操作。即它会将空格转换为 TAB。让我向你展示一些例子,以了解如何使用 unexpand 命令。 +正如你可能已经猜到的那样,`unexpand` 命令将执行与 `expand` 命令相反的操作。即它会将空格转换为 `TAB`。让我向你展示一些例子,以了解如何使用 `unexpand` 命令。 -要将文件中的空白(当然是空格)转换为 tab 并将输出写入标准输出,请执行以下操作: +要将文件中的空白(当然是空格)转换为 `TAB` 并将输出写入标准输出,请执行以下操作: ``` $ unexpand ostechnix.txt @@ -93,25 +92,25 @@ $ unexpand ostechnix.txt>output.txt $ unexpand ``` -默认情况下,unexpand 命令仅转换初始的空格。如果你想转换所有空格而不是只是初始空格,请使用 **-a** 标志: +默认情况下,`unexpand` 命令仅转换初始的空格。如果你想转换所有空格而不是只是一行开头的空格,请使用 `-a` 标志: ``` $ unexpand -a ostechnix.txt ``` -仅转换开头的空白(请注意它会覆盖 **-a**): +仅转换一行开头的空格(请注意它会覆盖 `-a`): ``` $ unexpand --first-only ostechnix.txt ``` -使多少个空格替换成一个 tab,而不是 **8**(启用 **-a** ): +使多少个空格替换成一个 `TAB`,而不是 `8`(会启用 `-a`): ``` $ unexpand -t 5 ostechnix.txt ``` -相似地,我们可以使用逗号分隔指定多个tab的位置。 +相似地,我们可以使用逗号分隔指定多个 `TAB` 的位置。 ``` $ unexpand -t 5,10,15 ostechnix.txt @@ -129,8 +128,7 @@ $ unexpand -t "5 10 15" ostechnix.txt $ man unexpand ``` - -在处理大量文件时,expand 和 unexpand 命令对于用空格替换不需要的 TAB 时非常有用,反之亦然。 +在处理大量文件时,`expand` 和 `unexpand` 命令对于用空格替换不需要的 `TAB` 时非常有用,反之亦然。 -------------------------------------------------------------------------------- @@ -139,10 +137,10 @@ via: https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-exampl 作者:[sk][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/) 荣誉推出 [a]: https://www.ostechnix.com/author/sk/ [b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Expand-And-Unexpand-Commands-720x340.png \ No newline at end of file +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Expand-And-Unexpand-Commands-720x340.png From 95ec464746140e4ebb344374858cc5c54bc3fc73 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Jun 2019 23:25:45 +0800 Subject: [PATCH 0938/1154] PUB:20190517 10 Places Where You Can Buy Linux Computers.md @geekpi https://linux.cn/article-10983-1.html --- ...610 Expand And Unexpand Commands Tutorial With Examples.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190610 Expand And Unexpand Commands Tutorial With Examples.md (98%) diff --git a/translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md b/published/20190610 Expand And Unexpand Commands Tutorial With Examples.md similarity index 98% rename from translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md rename to published/20190610 Expand And Unexpand Commands Tutorial With Examples.md index 9cf35e2e46..38d9c91ba4 100644 --- a/translated/tech/20190610 Expand And Unexpand Commands Tutorial With Examples.md +++ b/published/20190610 Expand And Unexpand Commands Tutorial With Examples.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10983-1.html) [#]: subject: (Expand And Unexpand Commands Tutorial With Examples) [#]: via: (https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-examples/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 3c5e3bdc17a07eae48381039fc6a73c590a0b346 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Jun 2019 23:31:12 +0800 Subject: [PATCH 0939/1154] PRF:20190517 10 Places Where You Can Buy Linux Computers.md --- .../20190517 10 Places Where You Can Buy Linux Computers.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/published/20190517 10 Places Where You Can Buy Linux Computers.md b/published/20190517 10 Places Where You Can Buy Linux Computers.md index 8897eaa7a4..92a334f37d 100644 --- a/published/20190517 10 Places Where You Can Buy Linux Computers.md +++ b/published/20190517 10 Places Where You Can Buy Linux Computers.md @@ -76,8 +76,6 @@ Purism 是一个总部设在美国的企业,以提供确保数据安全和隐私的产品和服务为荣。这就是为什么 Purism 称自己为 “效力社会的公司”。 -[][14] - Purism 是从一个众筹项目开始的,该项目旨在创造一个几乎没有任何专有软件的高端开源笔记本。2015年,从这个 [成功的 25 万美元的众筹项目][15] 中诞生了 [Librem 15][16] 笔记本。 ![Purism Librem 13][17] @@ -148,8 +146,6 @@ Vikings 还有包括路由器、扩展坞等在内的其它配件。他们的产 Ubuntushop 的一个独特之处在于,它的所有电脑都带有默认的 Tails OS live 选项。即使你安装了某个其它的 Linux 发行版作为日常使用的系统,也随时可以选择启动到 Tails OS(不需要使用 live USB)。[Tails OS][43] 是一个基于 Debian 的发行版,它在用户注销后会删除所有使用痕迹,并且在默认情况下使用 Tor 网络。 -[][44] - 和此列表中的许多其他重要玩家不同,我觉得 Ubuntushop 所提供的更像是一种“家庭工艺”。商家手动组装一个电脑,安装 Linux 然后卖给你。不过他们也在一些可选项上下了功夫,比如说轻松的重装系统,拥有自己的云服务器等等。 你可以找一台旧电脑快递给他们,就可以变成一台新安装 Linux 的电脑,他们就会在你的旧电脑上安装 [轻量级 Linux][45] 系统然后快递回来,这样你这台旧电脑就可以重新投入使用了。 From 021f9df90b3b87c66760d919673927658fe9601f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Jun 2019 23:52:24 +0800 Subject: [PATCH 0940/1154] APL:Running LEDs in reverse could cool computers --- .../20190404 Running LEDs in reverse could cool computers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190404 Running LEDs in reverse could cool computers.md b/sources/tech/20190404 Running LEDs in reverse could cool computers.md index 2eb3c66c6b..1eee546eae 100644 --- a/sources/tech/20190404 Running LEDs in reverse could cool computers.md +++ b/sources/tech/20190404 Running LEDs in reverse could cool computers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0ae2e22e38a0a58f009b1159e5e125bb14d40323 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 Jun 2019 00:37:24 +0800 Subject: [PATCH 0941/1154] TSL:20190404 Running LEDs in reverse could cool computers.md --- ...ng LEDs in reverse could cool computers.md | 68 ------------------- ...ng LEDs in reverse could cool computers.md | 64 +++++++++++++++++ 2 files changed, 64 insertions(+), 68 deletions(-) delete mode 100644 sources/tech/20190404 Running LEDs in reverse could cool computers.md create mode 100644 translated/news/20190404 Running LEDs in reverse could cool computers.md diff --git a/sources/tech/20190404 Running LEDs in reverse could cool computers.md b/sources/tech/20190404 Running LEDs in reverse could cool computers.md deleted file mode 100644 index 1eee546eae..0000000000 --- a/sources/tech/20190404 Running LEDs in reverse could cool computers.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Running LEDs in reverse could cool computers) -[#]: via: (https://www.networkworld.com/article/3386876/running-leds-in-reverse-could-cool-computers.html#tk.rss_all) -[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) - -Running LEDs in reverse could cool computers -====== - -### The miniaturization of electronics is reaching its limits in part because of heat management. Many are now aggressively trying to solve the problem. A kind of reverse-running LED is one avenue being explored. - -![monsitj / Getty Images][1] - -The quest to find more efficient methods for cooling computers is almost as high on scientists’ agendas as the desire to discover better battery chemistries. - -More cooling is crucial for reducing costs. It would also allow for more powerful processing to take place in smaller spaces, where limited processing should be crunching numbers instead of making wasteful heat. It would stop heat-caused breakdowns, thereby creating longevity in components, and it would promote eco-friendly data centers — less heat means less impact on the environment. - -Removing heat from microprocessors is one angle scientists have been exploring, and they think they have come up with a simple, but unusual and counter-intuitive solution. They say that running a variant of a Light Emitting Diode (LED) with its electrodes reversed forces the component to act as if it were at an unusually low temperature. Placing it next to warmer electronics, then, with a nanoscale gap introduced, causes the LED to suck out the heat. - -**[ Read also:[IDC’s top 10 data center predictions][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** - -“Once the LED is reverse biased, it began acting as a very low temperature object, absorbing photons,” says Edgar Meyhofer, professor of mechanical engineering at University of Michigan, in a [press release][4] announcing the breakthrough. “At the same time, the gap prevents heat from traveling back, resulting in a cooling effect.” - -The researchers say the LED and the adjacent electrical device (in this case a calorimeter, usually used for measuring heat energy) have to be extremely close. They say they’ve been able to demonstrate cooling of six watts per meter-squared. That’s about the power of sunshine on the earth’s surface, they explain. - -Internet of things (IoT) devices and smartphones could be among those electronics that would ultimately benefit from the LED modification. Both kinds of devices require increasing computing power to be squashed into smaller spaces. - -“Removing the heat from the microprocessor is beginning to limit how much power can be squeezed into a given space,” the University of Michigan announcement says. - -### Materials Science and cooling computers - -[I’ve written before about new forms of computer cooling][5]. Exotic materials, derived from Materials Science, are among ideas being explored. Sodium bismuthide (Na3Bi) could be used in transistor design, the U.S. Department of Energy’s Lawrence Berkeley National Laboratory says. The new substance carries a charge and is importantly tunable; however, it doesn’t need to be chilled as superconductors currently do. - -In fact, that’s a problem with superconductors. They unfortunately need more cooling than most electronics — electrical resistance with the technology is expelled through extreme cooling. - -Separately, [researchers in Germany at the University of Konstanz][6] say they soon will have superconductor-driven computers without waste heat. They plan to use electron spin — a new physical dimension in electrons that could create efficiency gains. The method “significantly reduces the energy consumption of computing centers,” the university said in a press release last year. - -Another way to reduce heat could be [to replace traditional heatsinks with spirals and mazes][7] embedded on microprocessors. Miniscule channels printed on the chip itself could provide paths for coolant to travel, again separately, scientists from Binghamton University say. - -“The miniaturization of the semiconductor technology is approaching its physical limits,” the University of Konstanz says. Heat management is very much on scientists’ agenda now. It’s “one of the big challenges in miniaturization." - -Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3386876/running-leds-in-reverse-could-cool-computers.html#tk.rss_all - -作者:[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.idgesg.net/images/article/2019/02/big_data_center_server_racks_storage_binary_analytics_by_monsitj_gettyimages-944444446_3x2-100787357-large.jpg -[2]: https://www.networkworld.com/article/3242807/data-center/top-10-data-center-predictions-idc.html#nww-fsb -[3]: https://www.networkworld.com/newsletters/signup.html#nww-fsb -[4]: https://news.umich.edu/running-an-led-in-reverse-could-cool-future-computers/ -[5]: https://www.networkworld.com/article/3326831/computers-could-soon-run-cold-no-heat-generated.html -[6]: https://www.uni-konstanz.de/en/university/news-and-media/current-announcements/news/news-in-detail/Supercomputer-ohne-Abwaerme/ -[7]: https://www.networkworld.com/article/3322956/chip-cooling-breakthrough-will-reduce-data-center-power-costs.html -[8]: https://www.facebook.com/NetworkWorld/ -[9]: https://www.linkedin.com/company/network-world diff --git a/translated/news/20190404 Running LEDs in reverse could cool computers.md b/translated/news/20190404 Running LEDs in reverse could cool computers.md new file mode 100644 index 0000000000..5cfa95b4fd --- /dev/null +++ b/translated/news/20190404 Running LEDs in reverse could cool computers.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Running LEDs in reverse could cool computers) +[#]: via: (https://www.networkworld.com/article/3386876/running-leds-in-reverse-could-cool-computers.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +反向运行 LED 能够冷却计算机 +====== + +> 电子产品的小型化正在触及其极限,部分原因在于热量管理。许多人现在都在积极地尝试解决这个问题。其中一种正在探索的途径是反向运行的 LED。 + +![monsitj / Getty Images][1] + +寻找更有效的冷却计算机的方法,几乎与渴望发现更好的电池化学成分一样,在科学家的研究日程中也处于重要位置。 + +更多的冷却手段对于降低成本至关重要。冷却技术也使得在较小的空间中可以进行更强大的处理,其有限的处理能力应该是进行计算而不是浪费热量。冷却技术可以阻止热量引起的故障,从而延长部件的使用寿命,并且可以促进环保的数据中心 —— 更少的热量意味着对环境的影响更小。 + +如何从微处理器中消除热量是科学家们一直在探索的一个方向,他们认为他们已经提出了一个简单而不寻常、且反直觉的解决方案。他们说可以运行一个发光二极管(LED)的变体,其电极反转可以迫使该元件表现得像处于异常低温下工作一样。如果将其置于较热的电子设备旁边,然后引入纳米级间隙,可以使 LED 吸收热量。 + +“一旦 LED 反向偏置,它就会像一个非常低温的物体一样,吸收光子,”密歇根大学机械工程教授埃德加·梅霍夫在宣布了这一突破的[新闻稿][4]中说。 “与此同时,该间隙可防止热量返回,从而产生冷却效果。” + +研究人员表示,LED 和相邻的电子设备(在这种情况下是热量计,通常用于测量热能)必须非常接近。他们说他们已经能够证明达到了每平方米 6 瓦的冷却功率。他们解释说,这是差不多是地球表面所接受到的阳光的能量。 + +物联网(IoT)设备和智能手机可能是最终将受益于这种 LED 改造的电子产品。这两种设备都需要在更小的空间中容纳更多的计算功率。 + +“从微处理器中可以移除的热量开始限制在给定空间内容纳的功率,”密歇根大学的公告说。 + +### 材料科学和冷却计算机 + +[我之前写过关于新形式的计算机冷却的文章][5]。源自材料科学的外来材料是正在探索的想法之一。美国能源部劳伦斯伯克利国家实验室表示,钠铋(Na3Bi)可用于晶体管设计。这种新物质带电荷,重要的是具有可调节性;但是,它不需要像超导体那样进行冷却。 + +事实上,这是超导体的一个问题。不幸的是,它们比大多数电子设备需要更多的冷却 —— 通过极端冷却消除电阻。 + +另外,[康斯坦茨大学的德国研究人员][6]表示他们很快将拥有超导体驱动的计算机,没有废热。他们计划使用电子自旋 —— 一种新的电子物理维度,可以提高效率。该大学去年在一份新闻稿中表示,这种方法“显著降低了计算中心的能耗”。 + +另一种减少热量的方法可能是用嵌入在微处理器上的[螺旋和回路来取代传统的散热器][7]。宾汉姆顿大学的科学家们表示,印在芯片上的微小通道可以为冷却剂提供单独的通道。 + +康斯坦茨大学说:“半导体技术的小型化正在接近其物理极限。”热管理现在被科学家提上了议事日程。这是“小型化的一大挑战”。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386876/running-leds-in-reverse-could-cool-computers.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/big_data_center_server_racks_storage_binary_analytics_by_monsitj_gettyimages-944444446_3x2-100787357-large.jpg +[2]: https://www.networkworld.com/article/3242807/data-center/top-10-data-center-predictions-idc.html#nww-fsb +[3]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[4]: https://news.umich.edu/running-an-led-in-reverse-could-cool-future-computers/ +[5]: https://www.networkworld.com/article/3326831/computers-could-soon-run-cold-no-heat-generated.html +[6]: https://www.uni-konstanz.de/en/university/news-and-media/current-announcements/news/news-in-detail/Supercomputer-ohne-Abwaerme/ +[7]: https://www.networkworld.com/article/3322956/chip-cooling-breakthrough-will-reduce-data-center-power-costs.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From b41bbbae887f9da57b10266c50fe4ccaf93e2d98 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 Jun 2019 00:46:56 +0800 Subject: [PATCH 0942/1154] PRF:20190404 Running LEDs in reverse could cool computers.md @wxy --- .../20190404 Running LEDs in reverse could cool computers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/news/20190404 Running LEDs in reverse could cool computers.md b/translated/news/20190404 Running LEDs in reverse could cool computers.md index 5cfa95b4fd..a3c11e9cbe 100644 --- a/translated/news/20190404 Running LEDs in reverse could cool computers.md +++ b/translated/news/20190404 Running LEDs in reverse could cool computers.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Running LEDs in reverse could cool computers) @@ -47,7 +47,7 @@ via: https://www.networkworld.com/article/3386876/running-leds-in-reverse-could- 作者:[Patrick Nelson][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 407373063cb7a5ebce570e7bb102a4cd9a1df4ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 Jun 2019 00:47:38 +0800 Subject: [PATCH 0943/1154] PUB:20190404 Running LEDs in reverse could cool computers.md @wxy https://linux.cn/article-10984-1.html --- .../20190404 Running LEDs in reverse could cool computers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20190404 Running LEDs in reverse could cool computers.md (98%) diff --git a/translated/news/20190404 Running LEDs in reverse could cool computers.md b/published/20190404 Running LEDs in reverse could cool computers.md similarity index 98% rename from translated/news/20190404 Running LEDs in reverse could cool computers.md rename to published/20190404 Running LEDs in reverse could cool computers.md index a3c11e9cbe..b3ebbed273 100644 --- a/translated/news/20190404 Running LEDs in reverse could cool computers.md +++ b/published/20190404 Running LEDs in reverse could cool computers.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10984-1.html) [#]: subject: (Running LEDs in reverse could cool computers) [#]: via: (https://www.networkworld.com/article/3386876/running-leds-in-reverse-could-cool-computers.html#tk.rss_all) [#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) From bb5aa72f7808c59ac85d432f9b8b0e44a52fdb70 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Sun, 16 Jun 2019 17:00:48 +0000 Subject: [PATCH 0944/1154] Revert "Update 20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md" This reverts commit fd7c2ff6434e3b0e895c19751b30497fec42b8e9. --- ...Introduction to Clojure - Modern dialect of Lisp (Part 1).md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md b/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md index 0fb3c6469d..5e5f4df763 100644 --- a/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md +++ b/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (ninifly) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fbf1e45cfd83b126b0998d044e923608fbac5880 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 17 Jun 2019 08:50:05 +0800 Subject: [PATCH 0945/1154] translated --- ...n- A Minimalist Open Source Code Editor.md | 94 ------------------- ...n- A Minimalist Open Source Code Editor.md | 89 ++++++++++++++++++ 2 files changed, 89 insertions(+), 94 deletions(-) delete mode 100644 sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md create mode 100644 translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md diff --git a/sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md b/sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md deleted file mode 100644 index 2349f8b1c7..0000000000 --- a/sources/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Graviton: A Minimalist Open Source Code Editor) -[#]: via: (https://itsfoss.com/graviton-code-editor/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Graviton: A Minimalist Open Source Code Editor -====== - -[Graviton][1] is a free and open source, cross-platform code editor in development. The sixteen years old developer, Marc Espin, emphasizes that it is a ‘minimalist’ code editor. I am not sure about that but it does have a clean user interface like other [modern code editors like Atom][2]. - -![Graviton Code Editor Interface][3] - -The developer also calls it a lightweight code editor despite the fact that Graviton is based on [Electron][4]. - -Graviton comes with features you expect in any standard code editors like syntax highlighting, auto-completion etc. Since Graviton is still in the beta phase of development, more features will be added to it in the future releases. - -![Graviton Code Editor with Syntax Highlighting][5] - -### Feature of Graviton code editor - -Some of the main highlights of Graviton features are: - - * Syntax highlighting for a number of programming languages using [CodeMirrorJS][6] - * Autocomplete - * Support for plugins and themes. - * Available in English, Spanish and a few other European languages. - * Available for Linux, Windows and macOS. - - - -I had a quick look at Graviton and it might not be as feature-rich as [VS Code][7] or [Brackets][8], but for some simple code editing, it’s not a bad tool. - -### Download and install Graviton - -![Graviton Code Editor][9] - -As mentioned earlier, Graviton is a cross-platform code editor available for Linux, Windows and macOS. It is still in beta stages which means that you more features will be added in future and you may encounter some bugs. - -You can find the latest version of Graviton on its release page. Debian and [Ubuntu users can install it from .deb file][10]. [AppImage][11] has been provided so that it could be used in other distributions. DMG and EXE files are also available for macOS and Windows respectively. - -[Download Graviton][12] - -If you are interested, you can find the source code of Graviton on its GitHub repository: - -[Graviton Source Code on GitHub][13] - -If you decided to use Graviton and find some issues, please open a bug report [here][14]. If you use GitHub, you may want to star the Graviton project. This boosts the morale of the developer as he would know that more users are appreciating his efforts. - -[][15] - -Suggested read Get Windows Style Sticky Notes For Ubuntu with Indicator Stickynotes - -I believe you know [how to install a software from source code][16] if you are taking that path. - -**In the end…** - -Sometimes, simplicity itself becomes a feature and the Graviton’s focus on being minimalist could help it form a niche for itself in the already crowded segment of code editors. - -At It’s FOSS, we try to highlight open source software. If you know some interesting open source software that you would like more people to know about, [do send us a note][17]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/graviton-code-editor/ - -作者:[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://graviton.ml/ -[2]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-interface.jpg?resize=800%2C571&ssl=1 -[4]: https://electronjs.org/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-interface-2.jpg?resize=800%2C522&ssl=1 -[6]: https://codemirror.net/ -[7]: https://itsfoss.com/install-visual-studio-code-ubuntu/ -[8]: https://itsfoss.com/install-brackets-ubuntu/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-800x473.jpg?resize=800%2C473&ssl=1 -[10]: https://itsfoss.com/install-deb-files-ubuntu/ -[11]: https://itsfoss.com/use-appimage-linux/ -[12]: https://github.com/Graviton-Code-Editor/Graviton-App/releases -[13]: https://github.com/Graviton-Code-Editor/Graviton-App -[14]: https://github.com/Graviton-Code-Editor/Graviton-App/issues -[15]: https://itsfoss.com/indicator-stickynotes-windows-like-sticky-note-app-for-ubuntu/ -[16]: https://itsfoss.com/install-software-from-source-code/ -[17]: https://itsfoss.com/contact-us/ diff --git a/translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md b/translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md new file mode 100644 index 0000000000..698606489d --- /dev/null +++ b/translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Graviton: A Minimalist Open Source Code Editor) +[#]: via: (https://itsfoss.com/graviton-code-editor/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Graviton:极简的开源代码编辑器 +====== + +[Graviton][1]是一款开发中的免费开源跨平台代码编辑器。这位 16 岁的开发人员 Marc Espin 强调说,它是一个“极简”的代码编辑器。我不确定这点,但它确实有一个干净的用户界面,就像其他的[现代代码编辑器,如 Atom][2]。 + +![Graviton Code Editor Interface][3] + +开发者还将其称为轻量级代码编辑器,尽管 Graviton 基于 [Electron][4]。 + +Graviton 拥有你在任何标准代码编辑器中所期望的功能,如语法高亮、自动补全等。由于 Graviton 仍处于测试阶段,因此未来版本中将添加更多功能。 + +![Graviton Code Editor with Syntax Highlighting][5] + +### Graviton 代码编辑器的特性 + +Graviton 一些值得一说的特性有: + + * 使用 [CodeMirrorJS][6] 为多种编程语言提供语法高亮 +  * 自动补全 +  * 支持插件和主题。 +  * 提供英语、西班牙语和一些其他欧洲语言。 +  * 适用于 Linux、Windows 和 macOS。 + + + +我快速看来一下 Graviton,它可能不像 [VS Code][7] 或 [Brackets][8] 那样功能丰富,但对于一些简单的代码编辑来说,它并不是一个糟糕的工具。 + +### 下载并安装 Graviton + +![Graviton Code Editor][9] + +如上所述,Graviton 是一个可用于 Linux、Windows 和 macOS 的跨平台代码编辑器。它仍处于测试阶段,这意味着将来会添加更多功能,并且你可能会遇到一些 bug。 + +你可以在其发布页面上找到最新版本的 Graviton。Debian 和 [Ubuntu 用户可以使用 .deb 安装][10]。它已提供 [AppImage][11],以便可以在其他发行版中使用它。DMG 和 EXE 文件也分别可用于 macOS 和 Windows。 + +[下载 Graviton][12] + +如果你有兴趣,你可以在 GitHub 仓库中找到 Graviton 的源代码: + +[GitHub 中 Graviton 的源码][13] + +如果你决定使用 Graviton 并发现了一些问题,请在[此处][14]写一份错误报告。如果你使用 GitHub,你可能想为 Graviton 项目加星。这可以提高开发者的士气,因为他知道有更多的用户欣赏他的努力。 + +如果你看到现在,我相信你了解[如何从源码安装软件][16] + +**写在最后** + +有时,简单本身就成了一个特性,而 Graviton 专注于极简可以帮助它在已经拥挤的代码编辑器世界中获取一席之地。 + +并且它是 FOSS 软件,我们尝试突出开源软件。如果你知道一些有趣的开源软件,并且想要更多的人知道,[请给我们留言][17] + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/graviton-code-editor/ + +作者:[Abhishek Prakash][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/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://graviton.ml/ +[2]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-interface.jpg?resize=800%2C571&ssl=1 +[4]: https://electronjs.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-interface-2.jpg?resize=800%2C522&ssl=1 +[6]: https://codemirror.net/ +[7]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[8]: https://itsfoss.com/install-brackets-ubuntu/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-800x473.jpg?resize=800%2C473&ssl=1 +[10]: https://itsfoss.com/install-deb-files-ubuntu/ +[11]: https://itsfoss.com/use-appimage-linux/ +[12]: https://github.com/Graviton-Code-Editor/Graviton-App/releases +[13]: https://github.com/Graviton-Code-Editor/Graviton-App +[14]: https://github.com/Graviton-Code-Editor/Graviton-App/issues +[16]: https://itsfoss.com/install-software-from-source-code/ +[17]: https://itsfoss.com/contact-us/ From 4ce064b9640d72916a1a3692bd7ffe978ee1fbb9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 17 Jun 2019 08:54:51 +0800 Subject: [PATCH 0946/1154] translated --- ...Applications On AppImage, Flathub And Snapcraft Platforms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md b/sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md index dd0c986e72..f640f2a2d5 100644 --- a/sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md +++ b/sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9c6970a26e9ed32a3f39dc1a6c6b667b75e314ce Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Mon, 17 Jun 2019 11:19:34 +0800 Subject: [PATCH 0947/1154] Translating --- sources/tech/20190501 Looking into Linux modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190501 Looking into Linux modules.md b/sources/tech/20190501 Looking into Linux modules.md index eb3125c19b..b49618fc2b 100644 --- a/sources/tech/20190501 Looking into Linux modules.md +++ b/sources/tech/20190501 Looking into Linux modules.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (LazyWolfLin) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1cd742bca3095150effdb706ffe0b6d42e8a44d3 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:03:12 +0800 Subject: [PATCH 0948/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190613=20Ubun?= =?UTF-8?q?tu=20Kylin:=20The=20Official=20Chinese=20Version=20of=20Ubuntu?= =?UTF-8?q?=20sources/tech/20190613=20Ubuntu=20Kylin-=20The=20Official=20C?= =?UTF-8?q?hinese=20Version=20of=20Ubuntu.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... The Official Chinese Version of Ubuntu.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md diff --git a/sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md b/sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md new file mode 100644 index 0000000000..4c89208db6 --- /dev/null +++ b/sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu Kylin: The Official Chinese Version of Ubuntu) +[#]: via: (https://itsfoss.com/ubuntu-kylin/) +[#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) + +Ubuntu Kylin: The Official Chinese Version of Ubuntu +====== + +[_**Ubuntu has several official flavors**_][1] _**and Kylin is one of them. In this article, you’ll learn about Ubuntu Kylin, what it is, why it was created and what features it offers.**_ + +Kylin was originally developed in 2001 by academicians at the [National University of Defense Technology][2] in the People’s Republic of China. The name is derived from [Qilin][3], a beast from Chinese mythology. + +The first versions of Kylin were based on [FreeBSD][4] and were intended for use by the Chinese military and other government organizations. Kylin 3.0 was purely based on the Linux kernel, and a version called [NeoKylin][5] which was announced in December 2010. + +In 2013, [Canonical][6] (parent company of Ubuntu) reached an agreement with the [Ministry of Industry and Information Technology][7] of the People’s Republic of China to co-create and release an Ubuntu-based OS with features targeted at the Chinese market. + +![Ubuntu Kylin][8] + +### What is Ubuntu Kylin? + +Following the 2013 agreement mentioned above, Ubuntu Kylin is now the official Chinese version of Ubuntu. It is much more than just language localisation. In fact, it is determined to serve the Chinese market the same way as Ubuntu serves the global market. + +The first version of [Ubuntu Kylin][9] came with Ubuntu 13.04. Like Ubuntu, Kylin too has LTS (long term support) and non-LTS versions. + +Currently, Ubuntu Kylin 19.04 LTS implements the [UKUI][10] desktop environment with revised boot up animation, log-in/screen-lock program and OS theme. To offer a more friendly experience for users, it has fixed bugs, has a file preview function, timer log out, the latest [WPS office suite][11] and [Sogou][12] put-in methods integrated within. + +Kylin 4.0.2 is a community edition based on Ubuntu Kylin 16.04 LTS. It includes several third-party applications with long term and stable support. It’s perfect for both server and desktop usage for daily office work and welcomed by the developers to [download][13]. The Kylin forums are actively available to provide feedback and also troubleshooting to find solutions. + +[][14] + +Suggested read Solve Ubuntu Error: Failed to download repository information Check your Internet connection. + +#### UKUI: The desktop environment by Ubuntu Kylin + +![Ubuntu Kylin 19.04 with UKUI Desktop][15] + +[UKUI][16] is designed and developed by the Ubuntu Kylin team and has some great features and provisions: + + * Windows-like interactive functions to bring more friendly user experiences. The Setup Wizard is user-friendly so that users can get started with Ubuntu Kylin quickly. + * Control Center has new settings for theme and window. Updated components such as Start Menu, taskbar, notification bar, file manager, window manager and others. + * Available separately on both Ubuntu and Debian repositories to provide a new desktop environment for users of Debian/Ubuntu distributions and derivatives worldwide. + * New login and lock programs, which is more stable and with many functions. + * Includes a feedback program convenient for feedback and questions. + + + +#### Kylin Software Center + +![Kylin Software Center][17] + +Kylin has a software center similar to Ubuntu software center and is called Ubuntu Kylin Software Center. It’s part of the Ubuntu Kylin Software Store that also includes Ubuntu Kylin Developer Platform and Ubuntu Kylin Repository with a simple interface and powerful function. It supports both Ubuntu and Ubuntu Kylin Repositories and is especially convenient for quick installation of Chinese characteristic software developed by Ubuntu Kylin team! + +#### Youker: A series of tools + +Ubuntu Kylin has also a series of tools named as Youker. Typing in “Youker” in the Kylin start menu will bring up the Kylin assistant. If you press the “Windows” key on the keyboard, you’d get a response exactly like you would on Windows. It will fire-up the Kylin start menu. + +![Kylin Assistant][18] + +Other Kylin branded applications include Kylin Video (player), Kylin Burner, Youker Weather and Youker Fcitx which supports better office work and personal entertainment. + +![Kylin Video][19] + +#### Special focus on Chinese characters + +In cooperation with Kingsoft, Ubuntu Kylin developers also work on Sogou Pinyin for Linux, Kuaipan for Linux and Kingsoft WPS for Ubuntu Kylin, and also address issues with smart pinyin, cloud storage service and office applications. [Pinyin][20] is romanization system for Chinese characters. With this, user inputs with English keyboard but Chinese characters are displayed on the screen. + +[][21] + +Suggested read How to Remove Older Linux Kernel Versions in Ubuntu + +#### Fun Fact: Ubuntu Kylin runs on Chinese supercomputers + +![Tianhe-2 Supercomputer. Photo by O01326 – Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=45399546][22] + +It’s already in public knowledge that the [world’s top 500 fastest supercomputers run Linux][23]. Chinese supercomputers [Tianhe-1][24] and [Tianhe-2][25] both use the 64-bit version of Kylin Linux, dedicated to high-performance [parallel computing][26] optimization, power management and high-performance [virtual computing][27]. + +#### Summary + +I hope you liked this introduction in the world of Ubuntu Kylin. You can get either of Ubuntu Kylin 19.04 or the community edition based on Ubuntu 16.04 from its [official website][28]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-kylin/ + +作者:[Avimanyu Bandyopadhyay][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/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/which-ubuntu-install/ +[2]: https://english.nudt.edu.cn +[3]: https://www.thoughtco.com/what-is-a-qilin-195005 +[4]: https://itsfoss.com/freebsd-12-release/ +[5]: https://thehackernews.com/2015/09/neokylin-china-linux-os.html +[6]: https://www.canonical.com/ +[7]: http://english.gov.cn/state_council/2014/08/23/content_281474983035940.htm +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/Ubuntu-Kylin.jpeg?resize=800%2C450&ssl=1 +[9]: http://www.ubuntukylin.com/ +[10]: http://ukui.org +[11]: https://www.wps.com/ +[12]: https://en.wikipedia.org/wiki/Sogou_Pinyin +[13]: http://www.ubuntukylin.com/downloads/show.php?lang=en&id=122 +[14]: https://itsfoss.com/solve-ubuntu-error-failed-to-download-repository-information-check-your-internet-connection/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/ubuntu-Kylin-19-04-desktop.jpg?resize=800%2C450&ssl=1 +[16]: http://www.ukui.org/ +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-software-center.jpg?resize=800%2C496&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-assistant.jpg?resize=800%2C535&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-video.jpg?resize=800%2C533&ssl=1 +[20]: https://en.wikipedia.org/wiki/Pinyin +[21]: https://itsfoss.com/remove-old-kernels-ubuntu/ +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/tianhe-2.jpg?resize=800%2C600&ssl=1 +[23]: https://itsfoss.com/linux-runs-top-supercomputers/ +[24]: https://en.wikipedia.org/wiki/Tianhe-1 +[25]: https://en.wikipedia.org/wiki/Tianhe-2 +[26]: https://en.wikipedia.org/wiki/Parallel_computing +[27]: https://computer.howstuffworks.com/how-virtual-computing-works.htm +[28]: http://www.ubuntukylin.com From 8099d9f02e274054c77fa2bf2dd5f061ef5af28d Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:03:46 +0800 Subject: [PATCH 0949/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190614=20What?= =?UTF-8?q?=20is=20a=20Java=20constructor=3F=20sources/tech/20190614=20Wha?= =?UTF-8?q?t=20is=20a=20Java=20constructor.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190614 What is a Java constructor.md | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 sources/tech/20190614 What is a Java constructor.md diff --git a/sources/tech/20190614 What is a Java constructor.md b/sources/tech/20190614 What is a Java constructor.md new file mode 100644 index 0000000000..66cd30110d --- /dev/null +++ b/sources/tech/20190614 What is a Java constructor.md @@ -0,0 +1,158 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is a Java constructor?) +[#]: via: (https://opensource.com/article/19/6/what-java-constructor) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/ashleykoree) + +What is a Java constructor? +====== +Constructors are powerful components of programming. Use them to unlock +the full potential of Java. +![][1] + +Java is (disputably) the undisputed heavyweight in open source, cross-platform programming. While there are many [great][2] [cross-platform][2] [frameworks][3], few are as unified and direct as [Java][4]. + +Of course, Java is also a pretty complex language with subtleties and conventions all its own. One of the most common questions about Java relates to **constructors** : What are they and what are they used for? + +Put succinctly: a constructor is an action performed upon the creation of a new **object** in Java. When your Java application creates an instance of a class you have written, it checks for a constructor. If a constructor exists, Java runs the code in the constructor while creating the instance. That's a lot of technical terms crammed into a few sentences, but it becomes clearer when you see it in action, so make sure you have [Java installed][5] and get ready for a demo. + +### Life without constructors + +If you're writing Java code, you're already using constructors, even though you may not know it. All classes in Java have a constructor because even if you haven't created one, Java does it for you when the code is compiled. For the sake of demonstration, though, ignore the hidden constructor that Java provides (because a default constructor adds no extra features), and take a look at life without an explicit constructor. + +Suppose you're writing a simple Java dice-roller application because you want to produce a pseudo-random number for a game. + +First, you might create your dice class to represent a physical die. Knowing that you play a lot of [Dungeons and Dragons][6], you decide to create a 20-sided die. In this sample code, the variable **dice** is the integer 20, representing the maximum possible die roll (a 20-sided die cannot roll more than 20). The variable **roll** is a placeholder for what will eventually be a random number, and **rand** serves as the random seed. + + +``` +import java.util.Random; + +public class DiceRoller { +private int dice = 20; +private int roll; +private [Random][7] rand = new [Random][7](); +``` + +Next, create a function in the **DiceRoller** class to execute the steps the computer must take to emulate a die roll: Take an integer from **rand** and assign it to the **roll** variable, add 1 to account for the fact that Java starts counting at 0 but a 20-sided die has no 0 value, then print the results. + + +``` +public void Roller() { +roll = rand.nextInt(dice); +roll += 1; +[System][8].out.println (roll); +} +``` + +Finally, spawn an instance of the **DiceRoller** class and invoke its primary function, **Roller** : + + +``` +// main loop +public static void main ([String][9][] args) { +[System][8].out.printf("You rolled a "); + +DiceRoller App = new DiceRoller(); +App.Roller(); +} +} +``` + +As long as you have a Java development environment installed (such as [OpenJDK][10]), you can run your application from a terminal: + + +``` +$ java dice.java +You rolled a 12 +``` + +In this example, there is no explicit constructor. It's a perfectly valid and legal Java application, but it's a little limited. For instance, if you set your game of Dungeons and Dragons aside for the evening to play some Yahtzee, you would need 6-sided dice. In this simple example, it wouldn't be that much trouble to change the code, but that's not a realistic option in complex code. One way you could solve this problem is with a constructor. + +### Constructors in action + +The **DiceRoller** class in this example project represents a virtual dice factory: When it's called, it creates a virtual die that is then "rolled." However, by writing a custom constructor, you can make your Dice Roller application ask what kind of die you'd like to emulate. + +Most of the code is the same, with the exception of a constructor accepting some number of sides. This number doesn't exist yet, but it will be created later. + + +``` +import java.util.Random; + +public class DiceRoller { +private int dice; +private int roll; +private [Random][7] rand = new [Random][7](); + +// constructor +public DiceRoller(int sides) { +dice = sides; +} +``` + +The function emulating a roll remains unchanged: + + +``` +public void Roller() { +roll = rand.nextInt(dice); +roll += 1; +[System][8].out.println (roll); +} +``` + +The main block of code feeds whatever arguments you provide when running the application. Were this a complex application, you would parse the arguments carefully and check for unexpected results, but for this sample, the only precaution taken is converting the argument string to an integer type: + + +``` +public static void main ([String][9][] args) { +[System][8].out.printf("You rolled a "); +DiceRoller App = new DiceRoller( [Integer][11].parseInt(args[0]) ); +App.Roller(); +} +} +``` + +Launch the application and provide the number of sides you want your die to have: + + +``` +$ java dice.java 20 +You rolled a 10 +$ java dice.java 6 +You rolled a 2 +$ java dice.java 100 +You rolled a 44 +``` + +The constructor has accepted your input, so when the class instance is created, it is created with the **sides** variable set to whatever number the user dictates. + +Constructors are powerful components of programming. Practice using them to unlock the full potential of Java. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/what-java-constructor + +作者:[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/ashleykoree +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag +[2]: https://opensource.com/resources/python +[3]: https://opensource.com/article/17/4/pyqt-versus-wxpython +[4]: https://opensource.com/resources/java +[5]: https://openjdk.java.net/install/index.html +[6]: https://opensource.com/article/19/5/free-rpg-day +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+random +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[10]: https://openjdk.java.net/ +[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+integer From 2ba6625e0abadf41cb6098e43f7753fc2dfbe6ed Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:04:00 +0800 Subject: [PATCH 0950/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190614=20Lear?= =?UTF-8?q?ning=20by=20teaching,=20and=20speaking,=20in=20open=20source=20?= =?UTF-8?q?sources/tech/20190614=20Learning=20by=20teaching,=20and=20speak?= =?UTF-8?q?ing,=20in=20open=20source.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... teaching, and speaking, in open source.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20190614 Learning by teaching, and speaking, in open source.md diff --git a/sources/tech/20190614 Learning by teaching, and speaking, in open source.md b/sources/tech/20190614 Learning by teaching, and speaking, in open source.md new file mode 100644 index 0000000000..b2bd11f7b4 --- /dev/null +++ b/sources/tech/20190614 Learning by teaching, and speaking, in open source.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learning by teaching, and speaking, in open source) +[#]: via: (https://opensource.com/article/19/6/conference-proposal-tips) +[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo) + +Learning by teaching, and speaking, in open source +====== +Want to speak at an open source conference? Here are a few tips to get +started. +![photo of microphone][1] + +_"Everything good, everything magical happens between the months of June and August."_ + +When Jenny Han wrote these words, I doubt she had the open source community in mind. Yet, for our group of dispersed nomads, the summer brings a wave of conferences that allow us to connect in person. + +From [OSCON][2] in Portland to [Drupal GovCon][3] in Bethesda, and [Open Source Summit North America][4] in San Diego, there’s no shortage of ways to match faces with Twitter avatars. After months of working on open source projects via Slack and Google Hangouts, the face time that these summer conferences offer is invaluable. + +The knowledge attendees gain at open source conferences serves as the spark for new contributions. And speaking from experience, the best way to gain value from these conferences is for you to _speak_ at them. + +But, does the thought of speaking give you chills? Hear me out before closing your browser. + +Last August, I arrived at the Vancouver Convention Centre to give a lightning talk and speak on a panel at [Open Source Summit North America 2018][5]. It’s no exaggeration to say that this conference—and applying to speak at it—transformed my career. Nine months later, I’ve: + + * Become a Community Moderator for Opensource.com + * Spoken at two additional open source conferences ([All Things Open][6] and [DrupalCon North America][7]) + * Made my first GitHub pull request + * Taken "Intro to Python" and written my first lines of code in [React][8] + * Taken the first steps towards writing a book proposal + + + +I don’t discount how much time, effort, and money are [involved in conference speaking][9]. Regardless, I can say with certainty that nothing else has grown my career so drastically. In the process, I met strangers who quickly became friends and unofficial mentors. Their feedback, advice, and connections have helped me grow in ways that I hadn’t envisioned this time last year. + +Had I not boarded that flight to Canada, I would not be where I am today. + +So, have I convinced you to take the first step? It’s easier than you think. If you want to [apply to speak at an open source conference][10] but are stuck on what to discuss, ask yourself this question: **What do I want to learn?** + +You don’t have to be an expert on the topics that you pitch. You don’t have to know everything about JavaScript, [ML][11], or Linux to [write conference proposals][12] on these topics. + +Here’s what you _do_ need: A willingness to do the work of teaching yourself these topics. And like any self-directed task, you’ll be most willing to do this work if you're invested in the subject. + +As summer conference season draws closer, soak up all the knowledge you can. Then, ask yourself what you want to learn more about, and apply to speak about those subjects at fall/winter open source events. + +After all, one of the most effective ways to learn is by [teaching a topic to someone else][13]. So, what will the open source community learn from you? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/conference-proposal-tips + +作者:[Lauren Maffeo][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/lmaffeo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/microphone_speak.png?itok=wW6elbl5 (photo of microphone) +[2]: https://conferences.oreilly.com/oscon/oscon-or +[3]: https://www.drupalgovcon.org +[4]: https://events.linuxfoundation.org/events/open-source-summit-north-america-2019/ +[5]: https://events.linuxfoundation.org/events/open-source-summit-north-america-2018/ +[6]: https://allthingsopen.org +[7]: https://lab.getapp.com/bias-in-ai-drupalcon-debrief/ +[8]: https://reactjs.org +[9]: https://twitter.com/venikunche/status/1130868572098572291 +[10]: https://opensource.com/article/19/1/public-speaking-resolutions +[11]: https://en.wikipedia.org/wiki/ML_(programming_language) +[12]: https://dev.to/aspittel/public-speaking-as-a-developer-2ihj +[13]: https://opensource.com/article/19/5/learn-python-teaching From 55e9af7cfd0c29cc3095f9d10e2f91df675a53e8 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:04:18 +0800 Subject: [PATCH 0951/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190614=20A=20?= =?UTF-8?q?data-centric=20approach=20to=20patching=20systems=20with=20Ansi?= =?UTF-8?q?ble=20sources/tech/20190614=20A=20data-centric=20approach=20to?= =?UTF-8?q?=20patching=20systems=20with=20Ansible.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...proach to patching systems with Ansible.md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 sources/tech/20190614 A data-centric approach to patching systems with Ansible.md diff --git a/sources/tech/20190614 A data-centric approach to patching systems with Ansible.md b/sources/tech/20190614 A data-centric approach to patching systems with Ansible.md new file mode 100644 index 0000000000..ade27106f3 --- /dev/null +++ b/sources/tech/20190614 A data-centric approach to patching systems with Ansible.md @@ -0,0 +1,141 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A data-centric approach to patching systems with Ansible) +[#]: via: (https://opensource.com/article/19/6/patching-systems-ansible) +[#]: author: (Mark Phillips https://opensource.com/users/markp/users/markp) + +A data-centric approach to patching systems with Ansible +====== +Use data and variables in Ansible to control selective patching. +![metrics and data shown on a computer screen][1] + +When you're patching Linux machines these days, I could forgive you for asking, "How hard can it be?" Sure, a **yum update -y** will sort it for you in a flash. + +![Animation of updating Linux][2] + +But for those of us working with more than a handful of machines, it's not that simple. Sometimes an update can create unintended consequences across many machines, and you're left wondering how to put things back the way they were. Or you might think, "Should I have applied the critical patch on its own and saved myself a lot of pain?" + +Faced with these sorts of challenges in the past led me to build a way to cherry-pick the updates needed and automate their application. + +### A flexible idea + +Here's an overview of the process: + +![Overview of the Ansible patch process][3] + +This system doesn't permit machines to have direct access to vendor patches. Instead, they're selectively subscribed to repositories. Repositories contain only the patches that are required––although I'd encourage you to give this careful consideration so you don't end up with a proliferation (another management overhead you'll not thank yourself for creating). + +Now patching a machine comes down to 1) The repositories it's subscribed to and 2) Getting the "thumbs up" to patch. By using variables to control both subscription and permission to patch, we don't need to tamper with the logic (the plays); we only need to alter the data. + +Here is an [example Ansible role][4] that fulfills both requirements. It manages repository subscriptions and has a simple variable that controls running the patch command. + + +``` +\--- +# tasks file for patching + +\- name: Include OS version specific differences +include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + +\- name: Ensure Yum repositories are configured +template: +src: template.repo.j2 +dest: "/etc/yum.repos.d/{{ item.label }}.repo" +owner: root +group: root +mode: 0644 +when: patching_repos is defined +loop: "{{ patching_repos }}" +notify: patching-clean-metadata + +\- meta: flush_handlers + +\- name: Ensure OS shipped yum repo configs are absent +file: +path: "/etc/yum.repos.d/{{ patching_default_repo_def }}" +state: absent + +# add flexibility of repos here +\- name: Patch this host +shell: 'yum update -y' +args: +warn: false +when: patchme|bool +register: result +changed_when: "'No packages marked for update' not in result.stdout" +``` + +### Scenarios + +In our fictitious, large, globally dispersed environment (of four hosts), we have: + + * Two web servers + * Two database servers + * An application comprising one of each server type + + + +OK, so this number of machines isn't "enterprise-scale," but remove the counts and imagine the environment as multiple, tiered, geographically dispersed applications. We want to patch elements of the stack across server types, application stacks, geographies, or the whole estate. + +![Example patch groups][5] + +Using only changes to variables, can we achieve that flexibility? Sort of. Ansible's [default behavior][6] for hashes is to overwrite. In our example, the **patching_repos** variable for the **db1** and **web1** hosts are overwritten because of their later occurrence in our inventory. Hmm, a bit of a pickle. There are two ways to manage this: + + 1. Multiple inventory files + 2. [Change the variable behavior][7] + + + +I chose number one because it maintains clarity. Once you start merging variables, it's hard to find where a hash appears and how it's put together. Using the default behavior maintains clarity, and it's the method I'd encourage you to stick with for your own sanity. + +### Get on with it then + +Let's run the play, focusing only on the database servers. + +Did you notice the final step— **Patch this host** —says **skipping**? That's because we didn't set [the controlling variable][8] to do the patching. What we have done is set up the repository subscriptions to be ready. + +So let's run the play again, limiting it to the web servers and tell it to do the patching. I ran this example with verbose output so you can see the yum updates happening. + +Patching an application stack requires another inventory file, as mentioned above. Let's rerun the play. + +Patching hosts in the European geography is the same scenario as the application stack, so another inventory file is required. + +Now that all the repository subscriptions are configured, let's just patch the whole estate. Note the **app1** and **emea** groups don't need the inventory here––they were only being used to separate the repository definition and setup. Now, **yum update -y** patches everything. If you didn't want to capture those repositories, they could be configured as **enabled=0**. + +### Conclusion + +The flexibility comes from how we group our hosts. Because of default hash behavior, we need to think about overlaps—the easiest way, to my mind at least, is with separate inventories. + +With regard to repository setup, I'm sure you've already said to yourself, "Ah, but the cherry-picking isn't that simple!" There is additional overhead in this model to download patches, test that they work together, and bundle them with dependencies in a repository. With complementary tools, you could automate the process, and in a large-scale environment, you'd have to. + +Part of me is drawn to just applying full patch sets as a simpler and easier way to go; skip the cherry-picking part and apply a full set of patches to a "standard build." I've seen this approach applied to both Unix and Windows estates with enforced quarterly updates. + +I’d be interested in hearing your experiences of patching regimes, and the approach proposed here, in the comments below or [via Twitter][9]. + +Many companies still have massive data centres full of hardware. Here's how Ansible can help. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/patching-systems-ansible + +作者:[Mark Phillips][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/markp/users/markp +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://opensource.com/sites/default/files/uploads/quick_update.gif (Animation of updating Linux) +[3]: https://opensource.com/sites/default/files/uploads/patch_process.png (Overview of the Ansible patch process) +[4]: https://github.com/phips/ansible-patching/blob/master/roles/patching/tasks/main.yml +[5]: https://opensource.com/sites/default/files/uploads/patch_groups.png (Example patch groups) +[6]: https://docs.ansible.com/ansible/2.3/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable +[7]: https://docs.ansible.com/ansible/2.3/intro_configuration.html#sts=hash_behaviour +[8]: https://github.com/phips/ansible-patching/blob/master/roles/patching/defaults/main.yml#L4 +[9]: https://twitter.com/thismarkp From 76bd1dd35a8bf149ae22b6542e7bb157689951e9 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:04:32 +0800 Subject: [PATCH 0952/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190613=20Open?= =?UTF-8?q?=20hardware=20for=20musicians=20and=20music=20lovers:=20Headpho?= =?UTF-8?q?ne,=20amps,=20and=20more=20sources/tech/20190613=20Open=20hardw?= =?UTF-8?q?are=20for=20musicians=20and=20music=20lovers-=20Headphone,=20am?= =?UTF-8?q?ps,=20and=20more.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...music lovers- Headphone, amps, and more.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md diff --git a/sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md b/sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md new file mode 100644 index 0000000000..96b5a06100 --- /dev/null +++ b/sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open hardware for musicians and music lovers: Headphone, amps, and more) +[#]: via: (https://opensource.com/article/19/6/hardware-music) +[#]: author: (Michael Weinberg https://opensource.com/users/mweinberg) + +Open hardware for musicians and music lovers: Headphone, amps, and more +====== +From 3D-printed instruments to devices that pull sound out of the air, +there are plenty of ways to create music with open hardware projects. +![][1] + +The world is full of great [open source music players][2], but why stop at using open source just to _play_ music? You can also use open source hardware to make music. All of the instruments described in this article are [certified by the Open Source Hardware Association][3] (OSHWA). That means you are free to build upon them, remix them, or do anything else with them. + +### Open source instruments + +Instruments are always a good place to start when you want to make music. If your instrument choices lean towards the more traditional, the [F-F-Fiddle][4] may be the one for you. + +![F-f-fiddle][5] + +The F-F-Fiddle is a full-sized electric violin that you can make with a standard desktop 3D printer ([fused filament fabrication][6]—get it?). If you need to see it to believe it, here is a video of the F-F-Fiddle in action: + +Mastered the fiddle and interested in something a bit more exotic? How about the [Open Theremin][7]? + +![Open Theremin][8] + +Like all theremins, Open Theremin lets you play music without touching the instrument. It is, of course, especially good at making [creepy space sounds][9] for your next sci-fi video or space-themed party. + +The [Waft][10] operates similarly by allowing you to control sounds remotely. It uses [Lidar][11] to measure the distance of your hand from the sensor. Check it out: + +Is the Waft a theremin? I'm not sure—theremin pedants should weigh in below in the comments. + +If theremins are too well-known for you, [SIGNUM][12] may be just what you are looking for. In the words of its developers, SIGNUM "uncovers the encrypted codes of information and the language of man/machine communication" by turning invisible wireless communications into audible signals. + +![SIGNUM][13] + +Here is in action: + +### Inputs + +Regardless of what instrument you use, you will need to plug it into something. If you want that something to be a Raspberry Pi, try the [AudioSense-Pi][14], which allows you to connect multiple inputs and outputs to your Pi at once. + +![AudioSense-Pi][15] + +### Synths + +What about synthesizers? SparkFun's [SparkPunk Sound Kit][16] is a simple synth that gives you lots of room to play. + +![SparkFun SparkPunk Sound Kit][17] + +### Headphones + +Making all this music is great, but you also need to think about how you will listen to it. Fortunately, [EQ-1 headphones][18] are open source and 3D-printable. + +![EQ-1 headphones][19] + +Are you making music with open source hardware? Let us know in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/hardware-music + +作者:[Michael Weinberg][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/mweinberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_musicinfinity.png?itok=7LkfjcS9 +[2]: https://opensource.com/article/19/2/audio-players-linux +[3]: https://certification.oshwa.org/ +[4]: https://certification.oshwa.org/us000010.html +[5]: https://opensource.com/sites/default/files/uploads/f-f-fiddle.png (F-f-fiddle) +[6]: https://en.wikipedia.org/wiki/Fused_filament_fabrication +[7]: https://certification.oshwa.org/ch000001.html +[8]: https://opensource.com/sites/default/files/uploads/open-theremin.png (Open Theremin) +[9]: https://youtu.be/p05ZSHRYXVA?t=771 +[10]: https://certification.oshwa.org/uk000005.html +[11]: https://en.wikipedia.org/wiki/Lidar +[12]: https://certification.oshwa.org/es000003.html +[13]: https://opensource.com/sites/default/files/uploads/signum.png (SIGNUM) +[14]: https://certification.oshwa.org/in000007.html +[15]: https://opensource.com/sites/default/files/uploads/audiosense-pi.png (AudioSense-Pi) +[16]: https://certification.oshwa.org/us000016.html +[17]: https://opensource.com/sites/default/files/uploads/sparkpunksoundkit.png (SparkFun SparkPunk Sound Kit) +[18]: https://certification.oshwa.org/us000038.html +[19]: https://opensource.com/sites/default/files/uploads/eq-1-headphones.png (EQ-1 headphones) From 5f1d40c6ee6ed4ac85a2b3a8dc520137d5dc7e07 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:04:50 +0800 Subject: [PATCH 0953/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190613=20IPyt?= =?UTF-8?q?hon=20is=20still=20the=20heart=20of=20Jupyter=20Notebooks=20for?= =?UTF-8?q?=20Python=20developers=20sources/tech/20190613=20IPython=20is?= =?UTF-8?q?=20still=20the=20heart=20of=20Jupyter=20Notebooks=20for=20Pytho?= =?UTF-8?q?n=20developers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Jupyter Notebooks for Python developers.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20190613 IPython is still the heart of Jupyter Notebooks for Python developers.md diff --git a/sources/tech/20190613 IPython is still the heart of Jupyter Notebooks for Python developers.md b/sources/tech/20190613 IPython is still the heart of Jupyter Notebooks for Python developers.md new file mode 100644 index 0000000000..be6a013f5a --- /dev/null +++ b/sources/tech/20190613 IPython is still the heart of Jupyter Notebooks for Python developers.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IPython is still the heart of Jupyter Notebooks for Python developers) +[#]: via: (https://opensource.com/article/19/6/ipython-still-heart-jupyterlab) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg/users/marcobravo) + +IPython is still the heart of Jupyter Notebooks for Python developers +====== +Project Jupyter's origin in IPython remains significant for the magical +development experience it provides. +![I love Free Software FSFE celebration][1] + +I recently wrote about how I find Jupyter projects, especially JupyterLab, to be a [magical Python development experience][2]. In researching how the various projects are related to each other, I recapped how Jupyter began as a fork from IPython. As Project Jupyter's [The Big Split™ announcement][3] explained: + +> "If anyone has been confused by what Jupyter is[1], it's the exact same code that lived in IPython, developed by the same people, just in a new home under a new name." + +That [1] links to a footnote that further clarifies: + +> "I saw 'Jupyter is like IPython, but language agnostic' immediately after the announcement, which is a great illustration of why the project needs to not have Python in the name anymore, since it was already language agnostic at the time." + +The fact that Jupyter Notebook and IPython forked from the same source code made sense to me, but I got lost in the current state of the IPython project. Was it no longer needed after The Big Split™ or is it living on in a different way? + +I was surprised to learn that IPython's significance continues to add value to Pythonistas, and that it is an essential part of the Jupyter experience. Here's a portion of the Jupyter FAQ: + +> **Are any languages pre-installed?** +> +> Yes, installing the Jupyter Notebook will also install the IPython kernel. This allows working on notebooks using the Python programming language. + +I now understand that writing Python in JupyterLab (and Jupyter Notebook) relies on the continued development of IPython as its kernel. Not only that, IPython is the powerhouse default kernel, and it can act as a communication bus for other language kernels according to [the documentation][4], saving a lot of time and development effort. + +The question remains, what can I do with just IPython? + +### What IPython does today + +IPython provides both a powerful, interactive Python shell and a Jupyter kernel. After installing it, I can run **ipython** from any command line on its own and use it as a (much prettier than the default) Python shell: + + +``` +$ ipython +Python 3.7.3 (default, Mar 27 2019, 09:23:15) +Type 'copyright', 'credits' or 'license' for more information +IPython 7.4.0 -- An enhanced Interactive Python. Type '?' for help. + +In [1]: import numpy as np +In [2]: example = np.array([5, 20, 3, 4, 0, 2, 12]) +In [3]: average = np.average(example) +In [4]: print(average) +6.571428571428571 +``` + +That brings us to the more significant issue: IPython's functionality gives JupyterLab the ability to execute the code in every project, and it also provides support for a whole bunch of functionality that's playfully called _magic_ (thank you, Nicholas Reith, for mentioning this in a comment on my previous article). + +### Getting magical, thanks to IPython + +JupyterLab and other frontends using the IPython kernel can feel like your favorite IDE or terminal emulator environment. I'm a huge fan of how [dotfiles][5] give me the power to use shortcuts, and magic has some dotfile-like behavior as well. For example, check out **[%bookmark][6]**. I've mapped my default development folder, **~/Develop** , to a shortcut I can run at any time and hop right into it. + +![Screenshot of commands from JupyterLab][7] + +The use of **%bookmark** and **%cd** , alongside the **!** operator (which I introduced in the previous article), are powered by IPython. As the [documentation][8] states: + +> To Jupyter users: Magics are specific to and provided by the IPython kernel. Whether Magics are available on a kernel is a decision that is made by the kernel developer on a per-kernel basis. + +### Wrapping up + +I, as a curious novice, was not quite sure if IPython remained relevant to the Jupyter ecosystem. I now have a new appreciation for the continuing development of IPython now that I realize it's the source of JupyterLab's powerful user experience. It's also a collection of talented contributors who are part of cutting edge research, so be sure to site them if you use Jupyter projects in your academic papers. They make it easy with this [ready-made citation entry][9]. + +Be sure to keep it in mind when you're thinking about open source projects to contribute to, and check out the [latest release notes][10] for a full list of magical features. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/ipython-still-heart-jupyterlab + +作者:[Matthew Broberg][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mbbroberg/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ilovefs_free_sticker_fsfe_heart.jpg?itok=gLJtaieq (I love Free Software FSFE celebration) +[2]: https://opensource.com/article/19/5/jupyterlab-python-developers-magic +[3]: https://blog.jupyter.org/the-big-split-9d7b88a031a7 +[4]: https://jupyter-client.readthedocs.io/en/latest/kernels.html +[5]: https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory#Unix_and_Unix-like_environments +[6]: https://ipython.readthedocs.io/en/stable/interactive/magics.html?highlight=magic#magic-bookmark +[7]: https://opensource.com/sites/default/files/uploads/jupyterlab-commands-ipython.png (Screenshot of commands from JupyterLab) +[8]: https://ipython.readthedocs.io/en/stable/interactive/magics.html +[9]: https://ipython.org/citing.html +[10]: https://ipython.readthedocs.io/en/stable/whatsnew/index.html From 76e1c21fa7d2d02ecf12feb847af35805693fd77 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:05:02 +0800 Subject: [PATCH 0954/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190613=20Cont?= =?UTF-8?q?inuous=20integration=20testing=20for=20the=20Linux=20kernel=20s?= =?UTF-8?q?ources/tech/20190613=20Continuous=20integration=20testing=20for?= =?UTF-8?q?=20the=20Linux=20kernel.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntegration testing for the Linux kernel.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20190613 Continuous integration testing for the Linux kernel.md diff --git a/sources/tech/20190613 Continuous integration testing for the Linux kernel.md b/sources/tech/20190613 Continuous integration testing for the Linux kernel.md new file mode 100644 index 0000000000..baf8f9f51b --- /dev/null +++ b/sources/tech/20190613 Continuous integration testing for the Linux kernel.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Continuous integration testing for the Linux kernel) +[#]: via: (https://opensource.com/article/19/6/continuous-kernel-integration-linux) +[#]: author: (Major Hayden https://opensource.com/users/mhayden) + +Continuous integration testing for the Linux kernel +====== +How this team works to prevent bugs from being merged into the Linux +kernel. +![Linux kernel source code \(C\) in Visual Studio Code][1] + +With 14,000 changesets per release from over 1,700 different developers, it's clear that the Linux kernel moves quickly, and brings plenty of complexity. Kernel bugs range from small annoyances to larger problems, such as system crashes and data loss. + +As the call for continuous integration (CI) grows for more and more projects, the [Continuous Kernel Integration (CKI)][2] team forges ahead with a single mission: prevent bugs from being merged into the kernel. + +### Linux testing problems + +Many Linux distributions test the Linux kernel when needed. This testing often occurs around release time, or when users find a bug. + +Unrelated issues sometimes appear, and maintainers scramble to find which patch in a changeset full of tens of thousands of patches caused the new, unrelated bug. Diagnosing the bug may require specialized hardware, a series of triggers, and specialized knowledge of that portion of the kernel. + +#### CI and Linux + +Most modern software repositories have some sort of automated CI testing that tests commits before they find their way into the repository. This automated testing allows the maintainers to find software quality issues, along with most bugs, by reviewing the CI report. Simpler projects, such as a Python library, come with tons of tools to make this process easier. + +Linux must be configured and compiled prior to any testing. Doing so takes time and compute resources. In addition, that kernel must boot in a virtual machine or on a bare metal machine for testing. Getting access to certain system architectures requires additional expense or very slow emulation. From there, someone must identify a set of tests which trigger the bug or verify the fix. + +#### How the CKI team works + +The CKI team at Red Hat currently follows changes from several internal kernels, as well as upstream kernels such as the [stable kernel tree][3]. We watch for two critical events in each repository: + + 1. When maintainers merge pull requests or patches, and the resulting commits in the repository change. + + 2. When developers propose changes for merging via patchwork or the stable patch queue. + + + + +As these events occur, automation springs into action and [GitLab CI pipelines][4] begin the testing process. Once the pipeline runs [linting][5] scripts, merges any patches, and compiles the kernel for multiple architectures, the real testing begins. We compile kernels in under six minutes for four architectures and submit feedback to the stable mailing list usually in two hours or less. Over 100,000 kernel tests run each month and over 11,000 GitLab pipelines have completed (since January 2019). + +Each kernel is booted on its native architecture, which includes: + +● [aarch64][6]: 64-bit [ARM][7], such as the [Cavium (now Marvell) ThunderX][8]. + +● [ppc64/ppc64le][9]: Big and little endian [IBM POWER][10] systems. + +● [s390x][11]: [IBM Zseries][12] mainframes. + +● [x86_64][13]: [Intel][14] and [AMD][15] workstations, laptops, and servers. + +Multiple tests run on these kernels, including the [Linux Test Project (LTP)][16], which contains a myriad of tests using a common test harness. My CKI team open-sourced over 44 tests with more on the way. + +### Get involved + +The upstream kernel testing effort grows day-by-day. Many companies provide test output for various kernels, including [Google][17], Intel, [Linaro][18], and [Sony][19]. Each effort is focused on bringing value to the upstream kernel as well as each company’s customer base. + +If you or your company want to join the effort, please come to the [Linux Plumbers Conference 2019][20] in Lisbon, Portugal. Join us at the Kernel CI hackfest during the two days after the conference, and drive the future of rapid kernel testing. + +For more details, [review the slides][21] from my Texas Linux Fest 2019 talk. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/continuous-kernel-integration-linux + +作者:[Major Hayden][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/mhayden +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_kernel_clang_vscode.jpg?itok=fozZ4zrr (Linux kernel source code (C) in Visual Studio Code) +[2]: https://cki-project.org/ +[3]: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html +[4]: https://docs.gitlab.com/ee/ci/pipelines.html +[5]: https://en.wikipedia.org/wiki/Lint_(software) +[6]: https://en.wikipedia.org/wiki/ARM_architecture +[7]: https://www.arm.com/ +[8]: https://www.marvell.com/server-processors/thunderx-arm-processors/ +[9]: https://en.wikipedia.org/wiki/Ppc64 +[10]: https://www.ibm.com/it-infrastructure/power +[11]: https://en.wikipedia.org/wiki/Linux_on_z_Systems +[12]: https://www.ibm.com/it-infrastructure/z +[13]: https://en.wikipedia.org/wiki/X86-64 +[14]: https://www.intel.com/ +[15]: https://www.amd.com/ +[16]: https://github.com/linux-test-project/ltp +[17]: https://www.google.com/ +[18]: https://www.linaro.org/ +[19]: https://www.sony.com/ +[20]: https://www.linuxplumbersconf.org/ +[21]: https://docs.google.com/presentation/d/1T0JaRA0wtDU0aTWTyASwwy_ugtzjUcw_ZDmC5KFzw-A/edit?usp=sharing From e1d92ad1669940ea33fc37ba1b52b52fef84b7e6 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:05:20 +0800 Subject: [PATCH 0955/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190612=20Why?= =?UTF-8?q?=20use=20GraphQL=3F=20sources/tech/20190612=20Why=20use=20Graph?= =?UTF-8?q?QL.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190612 Why use GraphQL.md | 97 ++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20190612 Why use GraphQL.md diff --git a/sources/tech/20190612 Why use GraphQL.md b/sources/tech/20190612 Why use GraphQL.md new file mode 100644 index 0000000000..ad0d3a0056 --- /dev/null +++ b/sources/tech/20190612 Why use GraphQL.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why use GraphQL?) +[#]: via: (https://opensource.com/article/19/6/why-use-graphql) +[#]: author: (Zach Lendon https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley) + +Why use GraphQL? +====== +Here's why GraphQL is gaining ground on standard REST API technology. +![][1] + +[GraphQL][2], as I wrote [previously][3], is a next-generation API technology that is transforming both how client applications communicate with backend systems and how backend systems are designed. + +As a result of the support that began with the organization that founded it, Facebook, and continues with the backing of other technology giants such as Github, Twitter, and AirBnB, GraphQL's place as a linchpin technology for application systems seems secure; both now and long into the future. + +### GraphQL's ascent + +The rise in importance of mobile application performance and organizational agility has provided booster rockets for GraphQL's ascent to the top of modern enterprise architectures. + +Given that [REST][4] is a wildly popular architectural style that already allows mechanisms for data interaction, what advantages does this new technology provide over [REST][4]? The ‘QL’ in GraphQL stands for query language, and that is a great place to start. + +The ease at which different client applications within an organization can query only the data they need with GraphQL usurps alternative REST approaches and delivers real-world application performance boosts. With traditional [REST][4] API endpoints, client applications interrogate a server resource, and receive a response containing all the data that matches the request. If a successful response from a [REST][4] API endpoint returns 35 fields, the client application receives 35 fields + +### Fetching problems + +[REST][4] APIs traditionally provide no clean way for client applications to retrieve or update only the data they care about. This is often described as the “over-fetching” problem. With the prevalence of mobile applications in people’s day to day lives, the over-fetching problem has real world consequences. Every request a mobile application needs to make, every byte it has to send and receive, has an increasingly negative performance impact for end users. Users with slower data connections are particularly affected by suboptimal API design choices. Customers who experience poor performance using mobile applications are more likely to not purchase products and use services. Inefficient API designs cost companies money. + +“Over-fetching” isn’t alone - it has a partner in crime - “under-fetching”. Endpoints that, by default, return only a portion of the data a client actually needs require clients to make additional calls to satisfy their data needs - which requires additional HTTP requests. Because of the over and under fetching problems and their impact on client application performance, an API technology that facilitates efficient fetching has a chance to catch fire in the marketplace - and GraphQL has boldly jumped in and filled that void. + +### REST's response + +[REST][4] API designers, not willing to go down without a fight, have attempted to counter the mobile application performance problem through a mix of: + + * “include” and “exclude” query parameters, allowing client applications to specify which fields they want through a potentially long query format. + * “Composite” services, which combine multiple endpoints in a way that allow client applications to be more efficient in the number of requests they make and the data they receive. + + + +While these patterns are a valiant attempt by the [REST][4] API community to address challenges mobile clients face, they fall short in a few key regards, namely: + + * Include and exclude query key/value pairs quickly get messy, in particular for deeper object graphs that require a nested dot notation syntax (or similar) to target data to include and exclude. Additionally, debugging issues with the query string in this model often requires manually breaking up a URL. + * Server implementations for include and exclude queries are often custom, as there is no standard way for server-based applications to handle the use of include and exclude queries, just as there is no standard way for include and exclude queries to be defined. + * The rise of composite services creates more tightly coupled back-end and front-end systems, requiring increasing coordination to deliver projects and turning once agile projects back to waterfall. This coordination and coupling has the painful side effect of slowing organizational agility. Additionally, composite services are by definition, not RESTful. + + + +### GraphQL's genesis + +For Facebook, GraphQL’s genesis was a response to pain felt and experiences learned from an HTML5-based version of their flagship mobile application back in 2011-2012. Understanding that improved performance was paramount, Facebook engineers realized that they needed a new API design to ensure peak performance. Likely taking the above [REST][4] limitations into consideration, and with needing to support different needs of a number of API clients, one can begin to understand the early seeds of what led co-creators Lee Byron and Dan Schaeffer, Facebook employees at the time, to create what has become known as GraphQL. + +With what is often a single GraphQL endpoint, through the GraphQL query language, client applications are able to reduce, often significantly, the number of network calls they need to make, and ensure that they only are retrieving the data they need. In many ways, this harkens back to earlier models of web programming, where client application code would directly query back-end systems - some might remember writing SQL queries with JSTL on JSPs 10-15 years ago for example! + +The biggest difference now is with GraphQL, we have a specification that is implemented across a variety of client and server languages and libraries. And with GraphQL being an API technology, we have decoupled the back-end and front-end application systems by introducing an intermediary GraphQL application layer that provides a mechanism to access organizational data in a manner that aligns with an organization’s business domain(s). + +Beyond solving technical challenges experienced by software engineering teams, GraphQL has also been a boost to organizational agility, in particular in the enterprise. GraphQL-enabled organizational agility increases are commonly attributable to the following: + + * Rather than creating new endpoints when 1 or more new fields are needed by clients, GraphQL API designers and developers are able to include those fields in existing graph implementations, exposing new capabilities in a fashion that requires less development effort and less change across application systems. + * By encouraging API design teams to focus more on defining their object graph and be less focused on what client applications are delivering, the speed at which front-end and back-end software teams deliver solutions for customers has increasingly decoupled. + + + +### Considerations before adoption + +Despite GraphQL’s compelling benefits, GraphQL is not without its implementation challenges. A few examples include: + + * Caching mechanisms around [REST][4] APIs are much more mature. + * The patterns used to build APIs using [REST][4] are much more well established. + * While engineers may be more attracted to newer technologies like GraphQL, the talent pool in the marketplace is much broader for building [REST][4]-based solutions vs. GraphQL. + + + +### Conclusion + +By providing both a boost to performance and organizational agility, GraphQL's adoption by companies has skyrocketed in the past few years. It does, however, have some maturing to do in comparison to the RESTful ecosystem of API design. + +One of the great benefits of GraphQL is that it’s not designed as a wholesale replacement for alternative API solutions. Instead, GraphQL can be implemented to complement or enhance existing APIs. As a result, companies are encouraged to explore incrementally adopting GraphQL where it makes the most sense for them - where they find it has the greatest positive impact on application performance and organizational agility. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/why-use-graphql + +作者:[Zach Lendon][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/zachlendon/users/goncasousa/users/patrickhousley +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_graph_stats_blue.png?itok=OKCc_60D +[2]: https://graphql.org/ +[3]: https://opensource.com/article/19/6/what-is-graphql +[4]: https://en.wikipedia.org/wiki/Representational_state_transfer From 939570ee12d5c7046b1cbc11add28b51b95d9b8a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:05:33 +0800 Subject: [PATCH 0956/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190612=20The?= =?UTF-8?q?=20bits=20and=20bytes=20of=20PKI=20sources/tech/20190612=20The?= =?UTF-8?q?=20bits=20and=20bytes=20of=20PKI.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190612 The bits and bytes of PKI.md | 284 ++++++++++++++++++ 1 file changed, 284 insertions(+) create mode 100644 sources/tech/20190612 The bits and bytes of PKI.md diff --git a/sources/tech/20190612 The bits and bytes of PKI.md b/sources/tech/20190612 The bits and bytes of PKI.md new file mode 100644 index 0000000000..3cf9bd9c41 --- /dev/null +++ b/sources/tech/20190612 The bits and bytes of PKI.md @@ -0,0 +1,284 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The bits and bytes of PKI) +[#]: via: (https://opensource.com/article/19/6/bits-and-bytes-pki) +[#]: author: (Alex Wood https://opensource.com/users/awood) + +The bits and bytes of PKI +====== +Take a look under the public key infrastructure's hood to get a better +understanding of its format. +![Computer keyboard typing][1] + +In two previous articles— _[An introduction to cryptography and public key infrastructure][2]_ and _[How do private keys work in PKI and cryptography?][3]_ —I discussed cryptography and public key infrastructure (PKI) in a general way. I talked about how digital bundles called _certificates_ store public keys and identifying information. These bundles contain a lot of complexity, and it's useful to have a basic understanding of the format for when you need to look under the hood. + +### Abstract art + +Keys, certificate signing requests, certificates, and other PKI artifacts define themselves in a data description language called [Abstract Syntax Notation One][4] (ASN.1). ASN.1 defines a series of simple data types (integers, strings, dates, etc.) along with some structured types (sequences, sets). By using those types as building blocks, we can create surprisingly complex data formats. + +ASN.1 contains plenty of pitfalls for the unwary, however. For example, it has two different ways of representing dates: GeneralizedTime ([ISO 8601][5] format) and UTCTime (which uses a two-digit year). Strings introduce even more confusion. We have IA5String for ASCII strings and UTF8String for Unicode strings. ASN.1 also defines several other string types, from the exotic [T61String][6] and [TeletexString][7] to the more innocuous sounding—but probably not what you wanted—PrintableString (only a small subset of ASCII) and UniversalString (encoded in [UTF-32][8]). If you're writing or reading ASN.1 data, I recommend referencing the [specification][9]. + +ASN.1 has another data type worth special mention: the object identifier (OID). OIDs are a series of integers. Commonly they are shown with periods delimiting them. Each integer represents a node in what is basically a "tree of things." For example, [1.3.6.1.4.1.2312][10] is the OID for my employer, Red Hat, where "1" is the node for the International Organization for Standardization (ISO), "3" is for ISO-identified organizations, "6" is for the US Department of Defense (which, for historical reasons, is the parent to the next node), "1" is for the internet, "4" is for private organizations, "1" is for enterprises, and finally "2312," which is Red Hat's own. + +More commonly, OIDs are regularly used to identify specific algorithms in PKI objects. If you have a digital signature, it's not much use if you don't know what type of signature it is. The signature algorithm "sha256WithRSAEncryption" has the OID "1.2.840.113549.1.1.11," for example. + +### ASN.1 at work + +Suppose we own a factory that produces flying brooms, and we need to store some data about every broom. Our brooms have a model name, a serial number, and a series of inspections that have been made to ensure flight-worthiness. We could store this information using ASN.1 like so: + + +``` +BroomInfo ::= SEQUENCE { +model UTF8String, +serialNumber INTEGER, +inspections SEQUENCE OF InspectionInfo +} + +InspectionInfo ::= SEQUENCE { +inspectorName UTF8String, +inspectionDate GeneralizedTime +} +``` + +The example above defines the model name as a UTF8-encoded string, the serial number as an integer, and our inspections as a series of InspectionInfo items. Then we see that each InspectionInfo item comprises two pieces of data: the inspector's name and the time of the inspection. + +An actual instance of BroomInfo data would look something like this in ASN.1's value assignment syntax: + + +``` +broom BroomInfo ::= { +model "Nimbus 2000", +serialNumber 1066, +inspections { +{ +inspectorName "Harry", +inspectionDate "201901011200Z" +} +{ +inspectorName "Hagrid", +inspectionDate "201902011200Z" +} +} +} +``` + +Don't worry too much about the particulars of the syntax; for the average developer, having a basic grasp of how the pieces fit together is sufficient. + +Now let's look at a real example from [RFC 8017][11] that I have abbreviated somewhat for clarity: + + +``` +RSAPrivateKey ::= SEQUENCE { +version Version, +modulus INTEGER, -- n +publicExponent INTEGER, -- e +privateExponent INTEGER, -- d +prime1 INTEGER, -- p +prime2 INTEGER, -- q +exponent1 INTEGER, -- d mod (p-1) +exponent2 INTEGER, -- d mod (q-1) +coefficient INTEGER, -- (inverse of q) mod p +otherPrimeInfos OtherPrimeInfos OPTIONAL +} + +Version ::= INTEGER { two-prime(0), multi(1) } +(CONSTRAINED BY +{-- version must be multi if otherPrimeInfos present --}) + +OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo + +OtherPrimeInfo ::= SEQUENCE { +prime INTEGER, -- ri +exponent INTEGER, -- di +coefficient INTEGER -- ti +} +``` + +The ASN.1 above defines the PKCS #1 format used to store RSA keys. Looking at this, we can see the RSAPrivateKey sequence starts with a version type (either 0 or 1) followed by a bunch of integers and then an optional type called OtherPrimeInfos. The OtherPrimeInfos sequence contains one or more pieces of OtherPrimeInfo. And each OtherPrimeInfo is just a sequence of integers. + +Let's look at an actual instance by asking OpenSSL to generate an RSA key and then pipe it into [asn1parse][12], which will print it out in a more human-friendly format. (By the way, the **genrsa** command I'm using here has been superseded by **genpkey** ; we'll see why a little later.) + + +``` +% openssl genrsa 4096 2> /dev/null | openssl asn1parse +0:d=0 hl=4 l=2344 cons: SEQUENCE +4:d=1 hl=2 l= 1 prim: INTEGER :00 +7:d=1 hl=4 l= 513 prim: INTEGER :B80B0C2443... +524:d=1 hl=2 l= 3 prim: INTEGER :010001 +529:d=1 hl=4 l= 512 prim: INTEGER :59C609C626... +1045:d=1 hl=4 l= 257 prim: INTEGER :E8FC43002D... +1306:d=1 hl=4 l= 257 prim: INTEGER :CA39222DD2... +1567:d=1 hl=4 l= 256 prim: INTEGER :25F6CD181F... +1827:d=1 hl=4 l= 256 prim: INTEGER :38CCE374CB... +2087:d=1 hl=4 l= 257 prim: INTEGER :C80430E810... +``` + +Recall that RSA uses a modulus, _n_ ; a public exponent, _e_ ; and a private exponent, _d_. Now let's look at the sequence. First, we see the version set to 0 for a two-prime RSA key (what **genrsa** generates), an integer for the modulus, _n_ , and then 0x010001 for the public exponent, _e_. If we convert to decimal, we'll see our public exponent is 65537, a number [commonly][13] used as an RSA public exponent. Following the public exponent, we see the integer for the private exponent, _e_ , and then some other integers that are used to speed up decryption and signing. Explaining how this optimization works is beyond the scope of this article, but if you like math, there's a [good video on the subject][14]. + +What about that other stuff on the left side of the output? What does "h=4" and "l=513" mean? We'll cover that shortly. + +### DERangement + +We've seen the "abstract" part of Abstract Syntax Notation One, but how does this data get encoded and stored? For that, we turn to a binary format called Distinguished Encoding Rules (DER) defined in the [X.690][15] specification. DER is a stricter version of its parent, Basic Encoding Rules (BER), in that for any given data, there is only one way to encode it. If we're going to be digitally signing data, it makes things a lot easier if there is only one possible encoding that needs to be signed instead of dozens of functionally equivalent representations. + +DER uses a [tag-length-value][16] (TLV) structure. The encoding of a piece of data begins with an identifier octet defining the data's type. ("Octet" is used rather than "byte" since the standard is very old and some early architectures didn't use 8 bits for a byte.) Next are the octets that encode the length of the data, and finally, there is the data. The data can be another TLV series. The left side of the **asn1parse** output makes a little more sense now. The first number indicates the absolute offset from the beginning. The "d=" tells us the depth of that item in the structure. The first line is a sequence, which we descend into on the next line (the depth _d_ goes from 0 to 1) whereupon **asn1parse** begins enumerating all the elements in that sequence. The "hl=" is the header length (the sum of the identifier and length octets), and the "l=" tells us the length of that particular piece of data. + +How is header length determined? It's the sum of the identifier byte and the bytes encoding the length. In our example, the top sequence is 2344 octets long. If it were less than 128 octets, the length would be encoded in a single octet in the "short form": bit 8 would be a zero and bits 7 to 1 would hold the length value ( **2 7-1=127**). A value of 2344 needs more space, so the "long" form is used. The first octet has bit 8 set to one, and bits 7 to 1 contain the length of the length. In our case, a value of 2344 can be encoded in two octets (0x0928). Combined with the first "length of the length" octet, we have three octets total. Add the one identifier octet, and that gives us our total header length of four. + +As a side exercise, let's consider the largest value we could possibly encode. We've seen that we have up to 127 octets to encode a length. At 8 bits per octet, we have a total of 1008 bits to use, so we can hold a number equal to **2 1008-1**. That would equate to a content length of **2.743062*10 279** yottabytes, staggeringly more than the estimated **10 80** atoms in the observable universe. If you're interested in all the details, I recommend reading "[A Layman's Guide to a Subset of ASN.1, BER, and DER][17]." + +What about "cons" and "prim"? Those indicate whether the value is encoded with "constructed" or "primitive" encoding. Primitive encoding is used for simple types like "INTEGER" or "BOOLEAN," while constructed encoding is used for structured types like "SEQUENCE" or "SET." The actual difference between the two encoding methods is whether bit 6 in the identifier octet is a zero or one. If it's a one, the parser knows that the content octets are also DER-encoded and it can descend. + +### PEM pals + +While useful in a lot of cases, a binary format won't pass muster if we need to display the data as text. Before the [MIME][18] standard existed, attachment support was spotty. Commonly, if you wanted to attach data, you put it in the body of the email, and since SMTP only supported ASCII, that meant converting your binary data (like the DER of your public key, for example) into ASCII characters. + +Thus, the PEM format emerged. PEM stands for "Privacy-Enhanced Email" and was an early standard for transmitting and storing PKI data. The standard never caught on, but the format it defined for storage did. PEM-encoded objects are just DER objects that are [base64][19]-encoded and wrapped at 64 characters per line. To describe the type of object, a header and footer surround the base64 string. You'll see **\-----BEGIN CERTIFICATE-----** or **\-----BEGIN PRIVATE KEY-----** , for example. + +Often you'll see files with the ".pem" extension. I don't find this suffix useful. The file could contain a certificate, a key, a certificate signing request, or several other possibilities. Imagine going to a sushi restaurant and seeing a menu that described every item as "fish and rice"! Instead, I prefer more informative extensions like ".crt", ".key", and ".csr". + +### The PKCS zoo + +Earlier, I showed an example of a PKCS #1-formatted RSA key. As you might expect, formats for storing certificates and signing requests also exist in various IETF RFCs. For example, PKCS #8 can be used to store private keys for many different algorithms (including RSA!). Here's some of the ASN.1 from [RFC 5208][20] for PKCS #8. (RFC 5208 has been obsoleted by RFC 5958, but I feel that the ASN.1 in RFC 5208 is easier to understand.) + + +``` +PrivateKeyInfo ::= SEQUENCE { +version Version, +privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, +privateKey PrivateKey, +attributes [0] IMPLICIT Attributes OPTIONAL } + +Version ::= INTEGER + +PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier + +PrivateKey ::= OCTET STRING + +Attributes ::= SET OF Attribute +``` + +If you store your RSA private key in a PKCS #8, the PrivateKey element will actually be a DER-encoded PKCS #1! Let's prove it. Remember earlier when I used **genrsa** to generate a PKCS #1? OpenSSL can generate a PKCS #8 with the **genpkey** command, and you can specify RSA as the algorithm to use. + + +``` +% openssl genpkey -algorithm RSA | openssl asn1parse +0:d=0 hl=4 l= 629 cons: SEQUENCE +4:d=1 hl=2 l= 1 prim: INTEGER :00 +7:d=1 hl=2 l= 13 cons: SEQUENCE +9:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption +20:d=2 hl=2 l= 0 prim: NULL +22:d=1 hl=4 l= 607 prim: OCTET STRING [HEX DUMP]:3082025B... +``` + +You may have spotted the "OBJECT" in the output and guessed that was related to OIDs. You'd be correct. The OID "1.2.840.113549.1.1.1" is assigned to RSA encryption. OpenSSL has a built-in list of common OIDs and translates them into a human-readable form for you. + + +``` +% openssl genpkey -algorithm RSA | openssl asn1parse -strparse 22 +0:d=0 hl=4 l= 604 cons: SEQUENCE +4:d=1 hl=2 l= 1 prim: INTEGER :00 +7:d=1 hl=3 l= 129 prim: INTEGER :CA6720E706... +139:d=1 hl=2 l= 3 prim: INTEGER :010001 +144:d=1 hl=3 l= 128 prim: INTEGER :05D0BEBE44... +275:d=1 hl=2 l= 65 prim: INTEGER :F215DC6B77... +342:d=1 hl=2 l= 65 prim: INTEGER :D6095CED7E... +409:d=1 hl=2 l= 64 prim: INTEGER :402C7562F3... +475:d=1 hl=2 l= 64 prim: INTEGER :06D0097B2D... +541:d=1 hl=2 l= 65 prim: INTEGER :AB266E8E51... +``` + +In the second command, I've told **asn1parse** via the **-strparse** argument to move to octet 22 and begin parsing the content's octets there as an ASN.1 object. We can clearly see that the PKCS #8's PrivateKey looks just like the PKCS #1 that we examined earlier. + +You should favor using the **genpkey** command. PKCS #8 has some features that PKCS #1 does not: PKCS #8 can store private keys for multiple different algorithms (PKCS #1 is RSA-specific), and it provides a mechanism to encrypt the private key using a passphrase and a symmetric cipher. + +Encrypted PKCS #8 objects use a different ASN.1 syntax that I'm not going to dive into, but let's take a look at an actual example and see if anything stands out. Encrypting a private key with **genpkey** requires that you specify the symmetric encryption algorithm to use. I'll use AES-256-CBC for this example and a password of "hello" (the "pass:" prefix is the way of telling OpenSSL that the password is coming in from the command line). + + +``` +% openssl genpkey -algorithm RSA -aes-256-cbc -pass pass:hello | openssl asn1parse +0:d=0 hl=4 l= 733 cons: SEQUENCE +4:d=1 hl=2 l= 87 cons: SEQUENCE +6:d=2 hl=2 l= 9 prim: OBJECT :PBES2 +17:d=2 hl=2 l= 74 cons: SEQUENCE +19:d=3 hl=2 l= 41 cons: SEQUENCE +21:d=4 hl=2 l= 9 prim: OBJECT :PBKDF2 +32:d=4 hl=2 l= 28 cons: SEQUENCE +34:d=5 hl=2 l= 8 prim: OCTET STRING [HEX DUMP]:17E6FE554E85810A +44:d=5 hl=2 l= 2 prim: INTEGER :0800 +48:d=5 hl=2 l= 12 cons: SEQUENCE +50:d=6 hl=2 l= 8 prim: OBJECT :hmacWithSHA256 +60:d=6 hl=2 l= 0 prim: NULL +62:d=3 hl=2 l= 29 cons: SEQUENCE +64:d=4 hl=2 l= 9 prim: OBJECT :aes-256-cbc +75:d=4 hl=2 l= 16 prim: OCTET STRING [HEX DUMP]:91E9536C39... +93:d=1 hl=4 l= 640 prim: OCTET STRING [HEX DUMP]:98007B264F... + +% openssl genpkey -algorithm RSA -aes-256-cbc -pass pass:hello | head -n 1 +\-----BEGIN ENCRYPTED PRIVATE KEY----- +``` + +There are a couple of interesting items here. We see our encryption algorithm is recorded with an OID starting at octet 64. There's an OID for "PBES2" (Password-Based Encryption Scheme 2), which defines a standard process for encryption and decryption, and an OID for "PBKDF2" (Password-Based Key Derivation Function 2), which defines a standard process for creating encryption keys from passwords. Helpfully, OpenSSL uses the header "ENCRYPTED PRIVATE KEY" in the PEM output. + +OpenSSL will let you encrypt a PKCS #1, but it's done in a non-standard way via a series of headers inserted into the PEM: + + +``` +% openssl genrsa -aes256 -passout pass:hello 4096 +\-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-256-CBC,5B2C64DC05B7C0471A278C76562FD776 +... +``` + +### In conclusion + +There's a final PKCS format you need to know about: [PKCS #12][21]. The PKCS #12 format allows for storing multiple objects all in one file. If you have a certificate and its corresponding key or a chain of certificates, you can store them together in one PKCS #12 file. Individual entries in the file can be protected with password-based encryption. + +Beyond the PKCS formats, there are other storage methods such as the Java-specific JKS format and the NSS library from Mozilla, which uses file-based databases (SQLite or Berkeley DB, depending on the version). Luckily, the PKCS formats are a lingua franca that can serve as a start or reference if you need to deal with other formats. + +If this all seems confusing, that's because it is. Unfortunately, the PKI ecosystem has a lot of sharp edges between tools that generate enigmatic error messages (looking at you, OpenSSL) and standards that have grown and evolved over the past 35 years. Having a basic understanding of how PKI objects are stored is critical if you're doing any application development that will be accessed over SSL/TLS. + +I hope this article has shed a little light on the subject and might save you from spending fruitless hours in the PKI wilderness. + +* * * + +_The author would like to thank Hubert Kario for providing a technical review._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/bits-and-bytes-pki + +作者:[Alex Wood][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/awood +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing) +[2]: https://opensource.com/article/18/5/cryptography-pki +[3]: https://opensource.com/article/18/7/private-keys +[4]: https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One +[5]: https://en.wikipedia.org/wiki/ISO_8601 +[6]: https://en.wikipedia.org/wiki/ITU_T.61 +[7]: https://en.wikipedia.org/wiki/Teletex +[8]: https://en.wikipedia.org/wiki/UTF-32 +[9]: https://www.itu.int/itu-t/recommendations/rec.aspx?rec=X.680 +[10]: https://www.alvestrand.no/objectid/1.3.6.1.4.1.2312.html +[11]: https://tools.ietf.org/html/rfc8017 +[12]: https://linux.die.net/man/1/asn1parse +[13]: https://www.johndcook.com/blog/2018/12/12/rsa-exponent/ +[14]: https://www.youtube.com/watch?v=NcPdiPrY_g8 +[15]: https://en.wikipedia.org/wiki/X.690 +[16]: https://en.wikipedia.org/wiki/Type-length-value +[17]: http://luca.ntop.org/Teaching/Appunti/asn1.html +[18]: https://www.theguardian.com/technology/2012/mar/26/ather-of-the-email-attachment +[19]: https://en.wikipedia.org/wiki/Base64 +[20]: https://tools.ietf.org/html/rfc5208 +[21]: https://tools.ietf.org/html/rfc7292 From aca0b0e80509b5f17b35b3e77ea34be0f98c065a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:05:48 +0800 Subject: [PATCH 0957/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190612=20How?= =?UTF-8?q?=20to=20write=20a=20loop=20in=20Bash=20sources/tech/20190612=20?= =?UTF-8?q?How=20to=20write=20a=20loop=20in=20Bash.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190612 How to write a loop in Bash.md | 282 ++++++++++++++++++ 1 file changed, 282 insertions(+) create mode 100644 sources/tech/20190612 How to write a loop in Bash.md diff --git a/sources/tech/20190612 How to write a loop in Bash.md b/sources/tech/20190612 How to write a loop in Bash.md new file mode 100644 index 0000000000..f63bff9cd3 --- /dev/null +++ b/sources/tech/20190612 How to write a loop in Bash.md @@ -0,0 +1,282 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to write a loop in Bash) +[#]: via: (https://opensource.com/article/19/6/how-write-loop-bash) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth) + +How to write a loop in Bash +====== +Automatically perform a set of actions on multiple files with for loops +and find commands. +![bash logo on green background][1] + +A common reason people want to learn the Unix shell is to unlock the power of batch processing. If you want to perform some set of actions on many files, one of the ways to do that is by constructing a command that iterates over those files. In programming terminology, this is called _execution control,_ and one of the most common examples of it is the **for** loop. + +A **for** loop is a recipe detailing what actions you want your computer to take _for_ each data object (such as a file) you specify. + +### The classic for loop + +An easy loop to try is one that analyzes a collection of files. This probably isn't a useful loop on its own, but it's a safe way to prove to yourself that you have the ability to handle each file in a directory individually. First, create a simple test environment by creating a directory and placing some copies of some files into it. Any file will do initially, but later examples require graphic files (such as JPEG, PNG, or similar). You can create the folder and copy files into it using a file manager or in the terminal: + + +``` +$ mkdir example +$ cp ~/Pictures/vacation/*.{png,jpg} example +``` + +Change directory to your new folder, then list the files in it to confirm that your test environment is what you expect: + + +``` +$ cd example +$ ls -1 +cat.jpg +design_maori.png +otago.jpg +waterfall.png +``` + +The syntax to loop through each file individually in a loop is: create a variable ( **f** for file, for example). Then define the data set you want the variable to cycle through. In this case, cycle through all files in the current directory using the ***** wildcard character (the ***** wildcard matches _everything_ ). Then terminate this introductory clause with a semicolon ( **;** ). + + +``` +`$ for f in * ;` +``` + +Depending on your preference, you can choose to press **Return** here. The shell won't try to execute the loop until it is syntactically complete. + +Next, define what you want to happen with each iteration of the loop. For simplicity, use the **file** command to get a little bit of data about each file, represented by the **f** variable (but prepended with a **$** to tell the shell to swap out the value of the variable for whatever the variable currently contains): + + +``` +`do file $f ;` +``` + +Terminate the clause with another semi-colon and close the loop: + + +``` +`done` +``` + +Press **Return** to start the shell cycling through _everything_ in the current directory. The **for** loop assigns each file, one by one, to the variable **f** and runs your command: + + +``` +$ for f in * ; do +> file $f ; +> done +cat.jpg: JPEG image data, EXIF standard 2.2 +design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +otago.jpg: JPEG image data, EXIF standard 2.2 +waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +``` + +You can also write it this way: + + +``` +$ for f in *; do file $f; done +cat.jpg: JPEG image data, EXIF standard 2.2 +design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +otago.jpg: JPEG image data, EXIF standard 2.2 +waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +``` + +Both the multi-line and single-line formats are the same to your shell and produce the exact same results. + +### A practical example + +Here's a practical example of how a loop can be useful for everyday computing. Assume you have a collection of vacation photos you want to send to friends. Your photo files are huge, making them too large to email and inconvenient to upload to your [photo-sharing service][2]. You want to create smaller web-versions of your photos, but you have 100 photos and don't want to spend the time reducing each photo, one by one. + +First, install the **ImageMagick** command using your package manager on Linux, BSD, or Mac. For instance, on Fedora and RHEL: + + +``` +`$ sudo dnf install ImageMagick` +``` + +On Ubuntu or Debian: + + +``` +`$ sudo apt install ImageMagick` +``` + +On BSD, use **ports** or [pkgsrc][3]. On Mac, use [Homebrew][4] or [MacPorts][5]. + +Once you install ImageMagick, you have a set of new commands to operate on photos. + +Create a destination directory for the files you're about to create: + + +``` +`$ mkdir tmp` +``` + +To reduce each photo to 33% of its original size, try this loop: + + +``` +`$ for f in * ; do convert $f -scale 33% tmp/$f ; done` +``` + +Then look in the **tmp** folder to see your scaled photos. + +You can use any number of commands within a loop, so if you need to perform complex actions on a batch of files, you can place your whole workflow between the **do** and **done** statements of a **for** loop. For example, suppose you want to copy each processed photo straight to a shared photo directory on your web host and remove the photo file from your local system: + + +``` +$ for f in * ; do +convert $f -scale 33% tmp/$f +scp -i seth_web tmp/$f [seth@example.com][6]:~/public_html +trash tmp/$f ; +done +``` + +For each file processed by the **for** loop, your computer automatically runs three commands. This means if you process just 10 photos this way, you save yourself 30 commands and probably at least as many minutes. + +### Limiting your loop + +A loop doesn't always have to look at every file. You might want to process only the JPEG files in your example directory: + + +``` +$ for f in *.jpg ; do convert $f -scale 33% tmp/$f ; done +$ ls -m tmp +cat.jpg, otago.jpg +``` + +Or, instead of processing files, you may need to repeat an action a specific number of times. A **for** loop's variable is defined by whatever data you provide it, so you can create a loop that iterates over numbers instead of files: + + +``` +$ for n in {0..4}; do echo $n ; done +0 +1 +2 +3 +4 +``` + +### More looping + +You now know enough to create your own loops. Until you're comfortable with looping, use them on _copies_ of the files you want to process and, as often as possible, use commands with built-in safeguards to prevent you from clobbering your data and making irreparable mistakes, like accidentally renaming an entire directory of files to the same name, each overwriting the other. + +For advanced **for** loop topics, read on. + +### Not all shells are Bash + +The **for** keyword is built into the Bash shell. Many similar shells use the same keyword and syntax, but some shells, like [tcsh][7], use a different keyword, like **foreach** , instead. + +In tcsh, the syntax is similar in spirit but more strict than Bash. In the following code sample, do not type the string **foreach?** in lines 2 and 3. It is a secondary prompt alerting you that you are still in the process of building your loop. + + +``` +$ foreach f (*) +foreach? file $f +foreach? end +cat.jpg: JPEG image data, EXIF standard 2.2 +design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +otago.jpg: JPEG image data, EXIF standard 2.2 +waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +``` + +In tcsh, both **foreach** and **end** must appear alone on separate lines, so you cannot create a **for** loop on one line as you can with Bash and similar shells. + +### For loops with the find command + +In theory, you could find a shell that doesn't provide a **for** loop function, or you may just prefer to use a different command with added features. + +The **find** command is another way to implement the functionality of a **for** loop, as it offers several ways to define the scope of which files to include in your loop as well as options for [Parallel][8] processing. + +The **find** command is meant to help you find files on your hard drives. Its syntax is simple: you provide the path of the location you want to search, and **find** finds all files and directories: + + +``` +$ find . +. +./cat.jpg +./design_maori.png +./otago.jpg +./waterfall.png +``` + +You can filter the search results by adding some portion of the name: + + +``` +$ find . -name "*jpg" +./cat.jpg +./otago.jpg +``` + +The great thing about **find** is that each file it finds can be fed into a loop using the **-exec** flag. For instance, to scale down only the PNG photos in your example directory: + + +``` +$ find . -name "*png" -exec convert {} -scale 33% tmp/{} \; +$ ls -m tmp +design_maori.png, waterfall.png +``` + +In the **-exec** clause, the bracket characters **{}** stand in for whatever item **find** is processing (in other words, any file ending in PNG that has been located, one at a time). The **-exec** clause must be terminated with a semicolon, but Bash usually tries to use the semicolon for itself. You "escape" the semicolon with a backslash ( **\;** ) so that **find** knows to treat that semicolon as its terminating character. + +The **find** command is very good at what it does, and it can be too good sometimes. For instance, if you reuse it to find PNG files for another photo process, you will get a few errors: + + +``` +$ find . -name "*png" -exec convert {} -flip -flop tmp/{} \; +convert: unable to open image `tmp/./tmp/design_maori.png': +No such file or directory @ error/blob.c/OpenBlob/2643. +... +``` + +It seems that **find** has located all the PNG files—not only the ones in your current directory ( **.** ) but also those that you processed before and placed in your **tmp** subdirectory. In some cases, you may want **find** to search the current directory plus all other directories within it (and all directories in _those_ ). It can be a powerful recursive processing tool, especially in complex file structures (like directories of music artists containing directories of albums filled with music files), but you can limit this with the **-maxdepth** option. + +To find only PNG files in the current directory (excluding subdirectories): + + +``` +`$ find . -maxdepth 1 -name "*png"` +``` + +To find and process files in the current directory plus an additional level of subdirectories, increment the maximum depth by 1: + + +``` +`$ find . -maxdepth 2 -name "*png"` +``` + +Its default is to descend into all subdirectories. + +### Looping for fun and profit + +The more you use loops, the more time and effort you save, and the bigger the tasks you can tackle. You're just one user, but with a well-thought-out loop, you can make your computer do the hard work. + +You can and should treat looping like any other command, keeping it close at hand for when you need to repeat a single action or two on several files. However, it's also a legitimate gateway to serious programming, so if you have to accomplish a complex task on any number of files, take a moment out of your day to plan out your workflow. If you can achieve your goal on one file, then wrapping that repeatable process in a **for** loop is relatively simple, and the only "programming" required is an understanding of how variables work and enough organization to separate unprocessed from processed files. With a little practice, you can move from a Linux user to a Linux user who knows how to write a loop, so get out there and make your computer work for you! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/how-write-loop-bash + +作者:[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/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: http://nextcloud.com +[3]: http://pkgsrc.org +[4]: http://brew.sh +[5]: https://www.macports.org +[6]: mailto:seth@example.com +[7]: https://en.wikipedia.org/wiki/Tcsh +[8]: https://opensource.com/article/18/5/gnu-parallel From b015a4eac68f7bfc740940e9270ac1c39e7b46eb Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:06:03 +0800 Subject: [PATCH 0958/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190611=20What?= =?UTF-8?q?=20is=20a=20Linux=20user=3F=20sources/tech/20190611=20What=20is?= =?UTF-8?q?=20a=20Linux=20user.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190611 What is a Linux user.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/tech/20190611 What is a Linux user.md diff --git a/sources/tech/20190611 What is a Linux user.md b/sources/tech/20190611 What is a Linux user.md new file mode 100644 index 0000000000..f5f71758fa --- /dev/null +++ b/sources/tech/20190611 What is a Linux user.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is a Linux user?) +[#]: via: (https://opensource.com/article/19/6/what-linux-user) +[#]: author: (Anderson Silva https://opensource.com/users/ansilva/users/petercheer/users/ansilva/users/greg-p/users/ansilva/users/ansilva/users/bcotton/users/ansilva/users/seth/users/ansilva/users/don-watkins/users/ansilva/users/seth) + +What is a Linux user? +====== +The definition of who is a "Linux user" has grown to be a bigger tent, +and it's a great change. +![][1] + +> _Editor's note: this article was updated on Jun 11, 2019, at 1:15:19 PM to more accurately reflect the author's perspective on an open and inclusive community of practice in the Linux community._ + +In only two years, the Linux kernel will be 30 years old. Think about that! Where were you in 1991? Were you even born? I was 13! Between 1991 and 1993 a few Linux distributions were created, and at least three of them—Slackware, Debian, and Red Hat–provided the [backbone][2] the Linux movement was built on. + +Getting a copy of a Linux distribution and installing and configuring it on a desktop or server was very different back then than today. It was hard! It was frustrating! It was an accomplishment if you got it running! We had to fight with incompatible hardware, configuration jumpers on devices, BIOS issues, and many other things. Even if the hardware was compatible, many times, you still had to compile the kernel, modules, and drivers to get them to work on your system. + +If you were around during those days, you are probably nodding your head. Some readers might even call them the "good old days," because choosing to use Linux meant you had to learn about operating systems, computer architecture, system administration, networking, and even programming, just to keep the OS functioning. I am not one of them though: Linux being a regular part of everyone's technology experience is one of the most amazing changes in our industry! + +Almost 30 years later, Linux has gone far beyond the desktop and server. You will find Linux in automobiles, airplanes, appliances, smartphones… virtually everywhere! You can even purchase laptops, desktops, and servers with Linux preinstalled. If you consider cloud computing, where corporations and even individuals can deploy Linux virtual machines with the click of a button, it's clear how widespread the availability of Linux has become. + +With all that in mind, my question for you is: **How do you define a "Linux user" today?** + +If you buy your parent or grandparent a Linux laptop from System76 or Dell, log them into their social media and email, and tell them to click "update system" every so often, they are now a Linux user. If you did the same with a Windows or MacOS machine, they would be Windows or MacOS users. It's incredible to me that, unlike the '90s, Linux is now a place for anyone and everyone to compute. + +In many ways, this is due to the web browser becoming the "killer app" on the desktop computer. Now, many users don't care what operating system they are using as long as they can get to their app or service. + +How many people do you know who use their phone, desktop, or laptop regularly but can't manage files, directories, and drivers on their systems? How many can't install a binary that isn't attached to an "app store" of some sort? How about compiling an application from scratch?! For me, it's almost no one. That's the beauty of open source software maturing along with an ecosystem that cares about accessibility. + +Today's Linux user is not required to know, study, or even look up information as the Linux user of the '90s or early 2000s did, and that's not a bad thing. The old imagery of Linux being exclusively for bearded men is long gone, and I say good riddance. + +There will always be room for a Linux user who is interested, curious, _fascinated_ about computers, operating systems, and the idea of creating, using, and collaborating on free software. There is just as much room for creative open source contributors on Windows and MacOS these days as well. Today, being a Linux user is being anyone with a Linux system. And that's a wonderful thing. + +### The change to what it means to be a Linux user + +When I started with Linux, being a user meant knowing how to the operating system functioned in every way, shape, and form. Linux has matured in a way that allows the definition of "Linux users" to encompass a much broader world of possibility and the people who inhabit it. It may be obvious to say, but it is important to say clearly: anyone who uses Linux is an equal Linux user. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/what-linux-user + +作者:[Anderson Silva][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/ansilva/users/petercheer/users/ansilva/users/greg-p/users/ansilva/users/ansilva/users/bcotton/users/ansilva/users/seth/users/ansilva/users/don-watkins/users/ansilva/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 +[2]: https://en.wikipedia.org/wiki/Linux_distribution#/media/File:Linux_Distribution_Timeline.svg From 0e2674f98c86332e2a25122c5609ca3b9ad8402f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:07:05 +0800 Subject: [PATCH 0959/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190614=20Repo?= =?UTF-8?q?rt:=20Mirai=20tries=20to=20hook=20its=20tentacles=20into=20SD-W?= =?UTF-8?q?AN=20sources/talk/20190614=20Report-=20Mirai=20tries=20to=20hoo?= =?UTF-8?q?k=20its=20tentacles=20into=20SD-WAN.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tries to hook its tentacles into SD-WAN.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/talk/20190614 Report- Mirai tries to hook its tentacles into SD-WAN.md diff --git a/sources/talk/20190614 Report- Mirai tries to hook its tentacles into SD-WAN.md b/sources/talk/20190614 Report- Mirai tries to hook its tentacles into SD-WAN.md new file mode 100644 index 0000000000..d4a3a9a927 --- /dev/null +++ b/sources/talk/20190614 Report- Mirai tries to hook its tentacles into SD-WAN.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Report: Mirai tries to hook its tentacles into SD-WAN) +[#]: via: (https://www.networkworld.com/article/3403016/report-mirai-tries-to-hook-its-tentacles-into-sd-wan.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Report: Mirai tries to hook its tentacles into SD-WAN +====== + +Mirai – the software that has hijacked hundreds of thousands of internet-connected devices to launch massive DDoS attacks – now goes beyond recruiting just IoT products; it also includes code that seeks to exploit a vulnerability in corporate SD-WAN gear. + +That specific equipment – VMware’s SDX line of SD-WAN appliances – now has an updated software version that fixes the vulnerability, but by targeting it Mirai’s authors show that they now look beyond enlisting security cameras and set-top boxes and seek out any vulnerable connected devices, including enterprise networking gear. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][1] + * [How to pick an off-site data-backup method][2] + * [SD-Branch: What it is and why you’ll need it][3] + * [What are the options for security SD-WAN?][4] + + + +“I assume we’re going to see Mirai just collecting as many devices as it can,” said Jen Miller-Osborn, deputy director of threat research at Palo Alto Networks’ Unit 42, which recently issued [a report][5] about Mirai. + +### Exploiting SD-WAN gear is new + +While the exploit against the SD-WAN appliances was a departure for Mirai, it doesn’t represent a sea-change in the way its authors are approaching their work, according Miller-Osborn. + +The idea, she said, is simply to add any devices to the botnet, regardless of what they are. The fact that SD-WAN devices were targeted is more about those particular devices having a vulnerability than anything to do with their SD-WAN capabilities. + +### Responsible disclosure headed off execution of exploits + +[The vulnerability][6] itself was discovered last year by independent researchers who responsibly disclosed it to VMware, which then fixed it in a later software version. But the means to exploit the weakness nevertheless is included in a recently discovered new variant of Mirai, according to the Unit 42 report. + +The authors behind Mirai periodically update the software to add new targets to the list, according to Unit 42, and the botherders’ original tactic of simply targeting devices running default credentials has given way to a strategy that also exploits vulnerabilities in a wide range of different devices. The updated variant of the malicious software includes a total of eight new-to-Mirai exploits. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][7] ]** + +The remediated version of the VMware SD-WAN is SD-WAN Edge 3.1.2. The vulnerability still affects SD-WAN Edge 3.1.1 and earlier, [according to a VMware security advisory][8]. After the Unit 42 report came out VMware posted [a blog][9] that says it is conducting its own investigation into the matter. + +Detecting whether a given SD-WAN implementation has been compromised depends heavily on the degree of monitoring in place on the network. Any products that give IT staff the ability to notice unusual traffic to or from an affected appliance could flag that activity. Otherwise, it could be difficult to tell if anything’s wrong, Miller-Osborne said. “You honestly might not notice it unless you start seeing a hit in performance or an outside actor notifies you about it.” + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403016/report-mirai-tries-to-hook-its-tentacles-into-sd-wan.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[2]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[3]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[4]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[5]: https://unit42.paloaltonetworks.com/new-mirai-variant-adds-8-new-exploits-targets-additional-iot-devices/ +[6]: https://www.exploit-db.com/exploits/44959 +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[8]: https://www.vmware.com/security/advisories/VMSA-2018-0011.html +[9]: https://blogs.vmware.com/security/2019/06/vmsa-2018-0011-revisited.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world From a76ce9151297d782558809911c3748130ddd1f49 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:07:21 +0800 Subject: [PATCH 0960/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190614=20West?= =?UTF-8?q?ern=20Digital=20launches=20open-source=20zettabyte=20storage=20?= =?UTF-8?q?initiative=20sources/talk/20190614=20Western=20Digital=20launch?= =?UTF-8?q?es=20open-source=20zettabyte=20storage=20initiative.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pen-source zettabyte storage initiative.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/talk/20190614 Western Digital launches open-source zettabyte storage initiative.md diff --git a/sources/talk/20190614 Western Digital launches open-source zettabyte storage initiative.md b/sources/talk/20190614 Western Digital launches open-source zettabyte storage initiative.md new file mode 100644 index 0000000000..9c31358d47 --- /dev/null +++ b/sources/talk/20190614 Western Digital launches open-source zettabyte storage initiative.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Western Digital launches open-source zettabyte storage initiative) +[#]: via: (https://www.networkworld.com/article/3402318/western-digital-launches-open-source-zettabyte-storage-initiative.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Western Digital launches open-source zettabyte storage initiative +====== +Western Digital's Zoned Storage initiative leverages new technology to create more efficient zettabyte-scale data storage for data centers by improving how data is organized when it is stored. +![monsitj / Getty Images][1] + +Western Digital has announced a project called the Zoned Storage initiative that leverages new technology to create more efficient zettabyte-scale data storage for data centers by improving how data is organized when it is stored. + +As part of this, the company also launched a [developer site][2] that will host open-source, standards-based tools and other resources. + +The Zoned Storage architecture is designed for Western Digital hardware and its shingled magnetic recording (SMR) HDDs, which hold up to 15TB of data, as well as the emerging zoned namespaces (ZNS) standard for NVMe SSDs, designed to deliver better endurance and predictability. + +**[ Now read:[What is quantum computing (and why enterprises should care)][3] ]** + +This initiative is not being retrofitted for non-SMR drives or non-NVMe SSDs. Western Digital estimates that by 2023, half of all its HDD shipments are expected to be SMR. And that will be needed because IDC predicts data will be generated at a rate of 103 zettabytes a year by 2023. + +With this project Western Digital is targeting cloud and hyperscale providers and anyone building a large data center who has to manage a large amount of data, according to Eddie Ramirez, senior director of product marketing for Western Digital. + +Western Digital is changing how data is written and stored from the traditional random 4K block writes to large blocks of sequential data, like Big Data workloads and video streams, which are rapidly growing in size and use in the digital age. + +“We are now looking at a one-size-fits-all architecture that leaves a lot of TCO [total cost of ownership] benefits on the table if you design for a single architecture,” Ramirez said. “We are looking at workloads that don’t rely on small block randomization of data but large block sequential write in nature.” + +Because drives use 4k write blocks, that leads to overprovisioning of storage, especially around SSDs. This is true of consumer and enterprise SSDs alike. My 1TB SSD drive has only 930GB available. And that loss scales. An 8TB SSD has only 6.4TB available, according to Ramirez. SSDs also have to be built with DRAM for caching of small block random writes. You need about 1GB of DRAM per 1TB of NAND to act as a buffer, according to Ramirez. + +### The benefits of Zoned Storage + +Zoned Storage allows for 15-20% more storage on a HDD the than traditional storage mechanism. It eliminates the overprovisioning of SSDs, so you get all the NAND flash the drive has and you need far fewer DRAM chips on an SSD. Additionally, Western Digital promises you will need up to one-eighth as much DRAM to act as a cache in future SSD drives, lowering the cost. + +Ramirez also said quality of service will improve, not necessarily that peak performance is better, but it will manage latency from outliers better. + +Western Digital has not disclosed what if any pricing is associated with the project. It plans to work with the open-source community, customers, and industry players to help accelerate application development around Zoned Storage through its website. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402318/western-digital-launches-open-source-zettabyte-storage-initiative.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/big_data_center_server_racks_storage_binary_analytics_by_monsitj_gettyimages-951389152_3x2-100787358-large.jpg +[2]: http://ZonedStorage.io +[3]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 459e6706de8c3baa8795e1bba297407f3034f88d Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:07:36 +0800 Subject: [PATCH 0961/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190614=20How?= =?UTF-8?q?=20to=20send=20email=20from=20the=20Linux=20command=20line=20so?= =?UTF-8?q?urces/tech/20190614=20How=20to=20send=20email=20from=20the=20Li?= =?UTF-8?q?nux=20command=20line.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... send email from the Linux command line.md | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 sources/tech/20190614 How to send email from the Linux command line.md diff --git a/sources/tech/20190614 How to send email from the Linux command line.md b/sources/tech/20190614 How to send email from the Linux command line.md new file mode 100644 index 0000000000..b164436bba --- /dev/null +++ b/sources/tech/20190614 How to send email from the Linux command line.md @@ -0,0 +1,171 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to send email from the Linux command line) +[#]: via: (https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to send email from the Linux command line +====== +Linux offers several commands that allow you to send email from the command line. Here's look at some that offer interesting options. +![Molnia/iStock][1] + +There are several ways to send email from the Linux command line. Some are very simple and others more complicated, but offer some very useful features. The choice depends on what you want to do -– whether you want to get a quick message off to a co-worker or send a more complicated message with an attachment to a large group of people. Here's a look at some of the options: + +### mail + +The easiest way to send a simple message from the Linux command line is to use the **mail** command. Maybe you need to remind your boss that you're leaving a little early that day. You could use a command like this one: + +``` +$ echo "Reminder: Leaving at 4 PM today" | mail -s "early departure" myboss +``` + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** + +Another option is to grab your message text from a file that contains the content you want to send: + +``` +$ mail -s "Reminder:Leaving early" myboss < reason4leaving +``` + +In both cases, the -s options allows you to provide a subject line for your message. + +### sendmail + +Using **sendmail** , you can send a quick message (with no subject) using a command like this (replacing "recip" with your intended recipient: + +``` +$ echo "leaving now" | sendmail recip +``` + +You can send just a subject line (with no message content) with a command like this: + +``` +$ echo "Subject: leaving now" | sendmail recip +``` + +You can also use sendmail on the command line to send a message complete with a subject line. However, when using this approach, you would add your subject line to the file you intend to send as in this example file: + +``` +Subject: Requested lyrics +I would just like to say that, in my opinion, longer hair and other flamboyant +affectations of appearance are nothing more ... +``` + +Then you would send the file like this (where the lyrics file contains your subject line and text): + +``` +$ sendmail recip < lyrics +``` + +Sendmail can be quite verbose in its output. If you're desperately curious and want to see the interchange between the sending and receiving systems, add the -v (verbose) option: + +``` +$ sendmail -v recip@emailsite.com < lyrics +``` + +### mutt + +An especially nice tool for command line emailing is the **mutt** command, though you will likely have to install it first. Mutt has a convenient advantage in that it can allow you to include attachments. + +To use mutt to send a quick messsage: + +``` +$ echo "Please check last night's backups" | mutt -s "backup check" recip +``` + +To get content from a file: + +``` +$ mutt -s "Agenda" recip < agenda +``` + +To add an attachment with mutt, use the -a option. You can even add more than one – as shown in this command: + +``` +$ mutt -s "Agenda" recip -a agenda -a speakers < msg +``` + +In the command above, the "msg" file includes content for the email. If you don't have any additional content to provide, you can do this instead: + +``` +$ echo "" | mutt -s "Agenda" recip -a agenda -a speakers +``` + +The other useful option that you have with mutt is that it provides a way to send carbon copies (using the -c option) and blind carbon copies (using the -b option). + +``` +$ mutt -s "Minutes from last meeting" recip@somesite.com -c myboss < mins +``` + +### telnet + +If you want to get deep into the details of sending email, you can use **telnet** to carry on the email exchange operation, but you'll need to, as they say, "learn the lingo." Mail servers expect a sequence of commands that include things like introducing yourself ( **EHLO** command), providing the email sender ( **MAIL FROM** command), specifying the email recipient ( **RCPT TO** command), and then adding the message ( **DATA** ) and ending the message with a "." as the only character on the line. Not every email server will respond to these requests. This approach is generally used only for troubleshooting. + +``` +$ telnet emailsite.org 25 +Trying 192.168.0.12... +Connected to emailsite. +Escape character is '^]'. +220 localhost ESMTP Sendmail 8.15.2/8.15.2/Debian-12; Wed, 12 Jun 2019 16:32:13 -0400; (No UCE/UBE) logging access from: mysite(OK)-mysite [192.168.0.12] +EHLO mysite.org <== introduce yourself +250-localhost Hello mysite [127.0.0.1], pleased to meet you +250-ENHANCEDSTATUSCODES +250-PIPELINING +250-EXPN +250-VERB +250-8BITMIME +250-SIZE +250-DSN +250-ETRN +250-AUTH DIGEST-MD5 CRAM-MD5 +250-DELIVERBY +250 HELP +MAIL FROM: me@mysite.org <== specify sender +250 2.1.0 shs@mysite.org... Sender ok +RCPT TO: recip <== specify recipient +250 2.1.5 recip... Recipient ok +DATA <== start message +354 Enter mail, end with "." on a line by itself +This is a test message. Please deliver it for me. +. <== end message +250 2.0.0 x5CKWDds029287 Message accepted for delivery +quit <== end exchange +``` + +### Sending email to multiple recipients + +If you want to send email from the Linux command line to a large group of recipients, you can always use a loop to make the job easier as in this example using mutt. + +``` +$ for recip in `cat recips` +do + mutt -s "Minutes from May meeting" $recip < May_minutes +done +``` + +### Wrap-up + +There are quite a few ways to send email from the Linux command line. Some tools provide quite a few options. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2017/08/email_image_blue-100732096-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From 013a05486ee5558a547ed82599e5c52b6a180479 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:08:05 +0800 Subject: [PATCH 0962/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190613=20Orac?= =?UTF-8?q?le=20updates=20Exadata=20at=20long=20last=20with=20AI=20and=20m?= =?UTF-8?q?achine=20learning=20abilities=20sources/talk/20190613=20Oracle?= =?UTF-8?q?=20updates=20Exadata=20at=20long=20last=20with=20AI=20and=20mac?= =?UTF-8?q?hine=20learning=20abilities.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... with AI and machine learning abilities.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/talk/20190613 Oracle updates Exadata at long last with AI and machine learning abilities.md diff --git a/sources/talk/20190613 Oracle updates Exadata at long last with AI and machine learning abilities.md b/sources/talk/20190613 Oracle updates Exadata at long last with AI and machine learning abilities.md new file mode 100644 index 0000000000..280cfd1a4a --- /dev/null +++ b/sources/talk/20190613 Oracle updates Exadata at long last with AI and machine learning abilities.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Oracle updates Exadata at long last with AI and machine learning abilities) +[#]: via: (https://www.networkworld.com/article/3402559/oracle-updates-exadata-at-long-last-with-ai-and-machine-learning-abilities.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Oracle updates Exadata at long last with AI and machine learning abilities +====== +Oracle to update the Oracle Exadata Database Machine X8 server line to include artificial intelligence (AI) and machine learning capabilities, plus support for hybrid cloud. +![Magdalena Petrova][1] + +After a rather [long period of silence][2], Oracle announced an update to its server line, the Oracle Exadata Database Machine X8, which features hardware and software enhancements that include artificial intelligence (AI) and machine learning capabilities, as well as support for hybrid cloud. + +Oracle acquired a hardware business nine years ago with the purchase of Sun Microsystems. It steadily whittled down the offerings, getting out of the commodity hardware business in favor of high-end mission-critical hardware. Whereas the Exalogic line is more of a general-purpose appliance running Oracle’s own version of Linux, Exadata is a purpose-built database server, and they really made some upgrades. + +The Exadata X8 comes with the latest Intel Xeon Scalable processors and PCIe NVME flash technology to drive performance improvements, which Oracle promises a 60% increase in I/O throughput for all-Flash storage and a 25% increase in IOPS per storage server compared to Exadata X7. The X8 offers a 60% performance improvement over the previous generation for analytics with up to 560GB per second throughput. It can scan a 1TB table in under two seconds. + +**[ Also read:[What is quantum computing (and why enterprises should care)][3] ]** + +The company also enhanced the storage server to offload Oracle Database processing, and the X8 features 60% more cores and 40% higher capacity disk drives over the X7. + +But the real enhancements come on the software side. With Exadata X8, Oracle introduces new machine-learning capabilities, such as Automatic Indexing, which continuously learns and tunes the database as usage patterns change. The Indexing technology originated with the Oracle Autonomous Database, the cloud-based software designed to automate management of Oracle databases. + +And no, MySQL is not included in the stack. This is for Oracle databases only. + +“We’re taking code from Autonomous Database and making it available on prem for our customers,” said Steve Zivanic, vice president for converged infrastructure at Oracle’s Cloud Business Group. “That enables companies rather than doing manual indexing for various Oracle databases to automate it with machine learning.” + +In one test, it took a 15-year-old Netsuite database with over 9,000 indexes built up over the lifespan of the database, and in 24 hours, its AI indexer rebuilt the indexes with just 6,000, reducing storage space and greatly increasing performance of the database, since the number of indexes to search were smaller. + +### Performance improvements with Exadata + +Zivanic cited several examples of server consolidation done with Exadata but would not identify companies by name. He told of a large healthcare company that achieved a 10-fold performance improvement over IBM Power servers and consolidated 600 Power servers with 50 Exadata systems. + +A financial services company replaced 4,000 Dell servers running Red Hat Linux and VMware with 100 Exadata systems running 6,000 production Oracle databases. Not only did it reduce its power footprint, but patching was down 99%. An unnamed retailer with 28 racks of hardware from five vendors went from installing 1,400 patches per year to 16 patches on four Exadata racks. + +Because Oracle owns the entire stack, from hardware to OS to middleware and database, Exadata can roll all of its patch components – 640 in all – into a single bundle. + +“The trend we’ve noticed is you see these [IT hardware] companies who try to maintain an erector set mentality,” said Zivanic. “And you have people saying why are we trying to build pods? Why don’t we buy finished goods and focus on our core competency rather than build erector sets?” + +### Oracle Zero Data Loss Recovery Appliance X8 now available + +Oracle also announced the availability of the Oracle Zero Data Loss Recovery Appliance X8, its database backup appliance, which offers up to 10 times faster data recovery of an Oracle Database than conventional data deduplication appliances while providing sub-second recoverability of all transactions. + +The new Oracle Recovery Appliance X8 now features 30% larger capacity, nearly a petabyte in a single rack, for the same price, Oracle says. + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402559/oracle-updates-exadata-at-long-last-with-ai-and-machine-learning-abilities.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/03/vid-still-79-of-82-100714308-large.jpg +[2]: https://www.networkworld.com/article/3317564/is-oracles-silence-on-its-on-premises-servers-cause-for-concern.html +[3]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 9cfedac17d1252de689582f2edc14bc87fcabcad Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:08:21 +0800 Subject: [PATCH 0963/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190613=20Data?= =?UTF-8?q?=20centers=20should=20sell=20spare=20UPS=20capacity=20to=20the?= =?UTF-8?q?=20grid=20sources/talk/20190613=20Data=20centers=20should=20sel?= =?UTF-8?q?l=20spare=20UPS=20capacity=20to=20the=20grid.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...uld sell spare UPS capacity to the grid.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md diff --git a/sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md b/sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md new file mode 100644 index 0000000000..69b4356661 --- /dev/null +++ b/sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Data centers should sell spare UPS capacity to the grid) +[#]: via: (https://www.networkworld.com/article/3402039/data-centers-should-sell-spare-ups-capacity-to-the-grid.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Data centers should sell spare UPS capacity to the grid +====== +Distributed Energy is gaining traction, providing an opportunity for data centers to sell excess power in data center UPS batteries to the grid. +![Getty Images][1] + +The energy storage capacity in uninterruptable power supply (UPS) batteries, languishing often dormant in data centers, could provide new revenue streams for those data centers, says Eaton, a major electrical power management company. + +Excess, grid-generated power, created during times of low demand, should be stored on the now-proliferating lithium-backup power systems strewn worldwide in data centers, Eaton says. Then, using an algorithm tied to grid-demand, electricity should be withdrawn as necessary for grid use. It would then be slid back onto the backup batteries when not needed. + +**[ Read also:[How server disaggregation can boost data center efficiency][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** + +The concept is called Distributed Energy and has been gaining traction in part because electrical generation is changing—emerging green power, such as wind and solar, being used now at the grid-level have considerations that differ from the now-retiring, fossil-fuel power generation. You can generate solar only in daylight, yet much demand takes place on dark evenings, for example. + +Coal, gas, and oil deliveries have always been, to a great extent, pre-planned, just-in-time, and used for electrical generation in real time. Nowadays, though, fluctuations between supply, storage, and demand are kicking in. Electricity storage on the grid is required. + +Eaton says that by piggy-backing on existing power banks, electricity distribution could be evened out better. The utilities would deliver power more efficiently, despite the peaks and troughs in demand—with the data center UPS, in effect, acting like a quasi-grid-power storage battery bank, or virtual power plant. + +The objective of this UPS use case, called EnergyAware, is to regulate frequency in the grid. That’s related to the tolerances needed to make the grid work—the cycles per second, or hertz, inherent in electrical current can’t deviate too much. Abnormalities happen if there’s a suddent spike in demand but no power on hand to supply the surge. + +### How the Distributed Energy concept works + +The distributed energy resource (DER), which can be added to any existing lithium-ion battery bank, in any building, allows for the consumption of energy, or the distribution of it, based on a Frequency Regulation grid-demand algorithm. It charges or discharges the backup battery, connected to the grid, thus balancing the grid frequency. + +Often, not much power will need to be removed, just “micro-bursts of energy,” explains Sean James, director of Energy Research at Microsoft, in an Eaton-published promotional video. Microsoft Innovation Center in Virginia has been working with Eaton on the project. Those bursts are enough to get the frequency tolerances back on track, but the UPS still functions as designed. + +Eaton says data centers should start participating in energy markets. That could mean bidding, as a producer of power, to those who need to buy it—the electricity market, also known as the grid. Data centers could conceivably even switch on generators to operate the data halls if the price for its battery-stored power was particularly lucrative at certain times. + +“A data center in the future wouldn’t just be a huge load on the grid,” James says. “In the future, you don’t have a data center or a power plant. It’s something in the middle. A data plant,” he says on the Eaton [website][4]. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402039/data-centers-should-sell-spare-ups-capacity-to-the-grid.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.idgesg.net/images/article/2018/10/business_continuity_server-100777720-large.jpg +[2]: https://www.networkworld.com/article/3266624/how-server-disaggregation-could-make-cloud-datacenters-more-efficient.html +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.eaton.com/us/en-us/products/backup-power-ups-surge-it-power-distribution/backup-power-ups/dual-purpose-ups-technology.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 691fe3a7ccb4016bde14fad086b32499241dbbc3 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:08:35 +0800 Subject: [PATCH 0964/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190612=20When?= =?UTF-8?q?=20to=20use=205G,=20when=20to=20use=20Wi-Fi=206=20sources/talk/?= =?UTF-8?q?20190612=20When=20to=20use=205G,=20when=20to=20use=20Wi-Fi=206.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...612 When to use 5G, when to use Wi-Fi 6.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/talk/20190612 When to use 5G, when to use Wi-Fi 6.md diff --git a/sources/talk/20190612 When to use 5G, when to use Wi-Fi 6.md b/sources/talk/20190612 When to use 5G, when to use Wi-Fi 6.md new file mode 100644 index 0000000000..a2271052c9 --- /dev/null +++ b/sources/talk/20190612 When to use 5G, when to use Wi-Fi 6.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When to use 5G, when to use Wi-Fi 6) +[#]: via: (https://www.networkworld.com/article/3402316/when-to-use-5g-when-to-use-wi-fi-6.html) +[#]: author: (Lee Doyle ) + +When to use 5G, when to use Wi-Fi 6 +====== +5G is a cellular service, and Wi-Fi 6 is a short-range wireless access technology, and each has attributes that make them useful in specific enterprise roles. +![Thinkstock][1] + +We have seen hype about whether [5G][2] cellular or [Wi-Fi 6][3] will win in the enterprise, but the reality is that the two are largely complementary with an overlap for some use cases, which will make for an interesting competitive environment through the early 2020s. + +### The potential for 5G in enterprises + +The promise of 5G for enterprise users is higher speed connectivity with lower latency. Cellular technology uses licensed spectrum which largely eliminates potential interference that may occur with unlicensed Wi-Fi spectrum. Like current 4G LTE technologies, 5G can be supplied by cellular wireless carriers or built as a private network . + +The architecture for 5G requires many more radio access points and can suffer from poor or no connectivity indoors. So, the typical organization needs to assess its [current 4G and potential 5G service][4] for its PCs, routers and other devices. Deploying indoor microcells, repeaters and distributed antennas can help solve indoor 5G service issues. As with 4G, the best enterprise 5G use case is for truly mobile connectivity such as public safety vehicles and in non-carpeted environments like mining, oil and gas extraction, transportation, farming and some manufacturing. + +In addition to broad mobility, 5G offers advantages in terms of authentication while roaming and speed of deployment as might be needed to provide WAN connectivity to a pop-up office or retail site. 5G will have the capacity to offload traffic in cases of data congestion such as live video. As 5G standards mature, the technology will improve its options for low-power IoT connectivity. + +5G will gradually roll out over the next four to five years starting in large cities and specific geographies; 4G technology will remain prevalent for a number of years. Enterprise users will need new devices, dongles and routers to connect to 5G services. For example, Apple iPhones are not expected to support 5G until 2020, and IoT devices will need specific cellular compatibility to connect to 5G. + +Doyle Research expects the 1Gbps and higher bandwidth promised by 5G will have a significant impact on the SD-WAN market. 4G LTE already enables cellular services to become a primary WAN link. 5G is likely to be cost competitive or cheaper than many wired WAN options such as MPLS or the internet. 5G gives enterprise WAN managers more options to provide increased bandwidth to their branch sites and remote users – potentially displacing MPLS over time. + +### The potential for Wi-Fi 6 in enterprises + +Wi-Fi is nearly ubiquitous for connecting mobile laptops, tablets and other devices to enterprise networks. Wi-Fi 6 (802.11ax) is the latest version of Wi-Fi and brings the promise of increased speed, low latency, improved aggregate bandwidth and advanced traffic management. While it has some similarities with 5G (both are based on orthogonal frequency division multiple access), Wi-Fi 6 is less prone to interference, requires less power (which prolongs device battery life) and has improved spectral efficiency. + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][5] ]** + +As is typical for Wi-Fi, early [vendor-specific versions of Wi-Fi 6][6] are currently available from many manufacturers. The Wi-Fi alliance plans for certification of Wi-Fi 6-standard gear in 2020. Most enterprises will upgrade to Wi-Fi 6 along standard access-point life cycles of three years or so unless they have specific performance/latency requirements that prompt an upgrade sooner. + +Wi-Fi access points continue to be subject to interference, and it can be challenging to design and site APs to provide appropriate coverage. Enterprise LAN managers will continue to need vendor-supplied tools and partners to configure optimal Wi-Fi coverage for their organizations. Wi-Fi 6 solutions must be integrated with wired campus infrastructure. Wi-Fi suppliers need to do a better job at providing unified network management across wireless and wired solutions in the enterprise. + +### Need for wired backhaul + +For both technologies, wireless is combined with wired-network infrastructure to deliver high-speed communications end-to-end. In the enterprise, Wi-Fi is typically paired with wired Ethernet switches for campus and larger branches. Some devices are connected via cable to the switch, others via Wi-Fi – and laptops may use both methods. Wi-Fi access points are connected via Ethernet inside the enterprise and to the WAN or internet by fiber connections. + +The architecture for 5G makes extensive use of fiber optics to connect the distributed radio access network back to the core of the 5G network. Fiber is typically required to provide the high bandwidth needed to connect 5G endpoints to SaaS-based applications, and to provide live video and high-speed internet access. Private 5G networks will also have to meet high-speed wired-connectivity requirements. + +### Handoff issues + +Enterprise IT managers need to be concerned with handoff challenges as phones switch between 5G and Wi-Fi 6. These issues can affect performance and user satisfaction. Several groups are working towards standards to promote better interoperability between Wi-Fi 6 and 5G. As the architectures of Wi-Fi 6 align with 5G, the experience of moving between cellular and Wi-Fi networks should become more seamless. + +### 5G vs Wi-Fi 6 depends on locations, applications and devices + +Wi-Fi 6 and 5G are competitive with each other for specific situations in the enterprise environment that depend on location, application and device type. IT managers should carefully evaluate their current and emerging connectivity requirements. Wi-Fi will continue to dominate indoor environments and cellular wins for broad outdoor coverage. + +Some of the overlap cases occur in stadiums, hospitality and other large event spaces with many users competing for bandwidth. Government applications, including aspect of smart cities, can be applicable to both Wi-Fi and cellular. Health care facilities have many distributed medical devices and users that need connectivity. Large distributed manufacturing environments share similar characteristics. The emerging IoT deployments are perhaps the most interesting “competitive” environment with many overlapping use cases. + +### Recommendations for IT Leaders + +While the wireless technologies enabling them are converging, Wi-Fi 6 and 5G are fundamentally distinct networks – both of which have their role in enterprise connectivity. Enterprise IT leaders should focus on how Wi-Fi and cellular can complement each other, with Wi-Fi continuing as the in-building technology to connect PCs and laptops, offload phone and tablet data, and for some IoT connectivity. + +4G LTE moving to 5G will remain the truly mobile technology for phone and tablet connectivity, an option (via dongle) for PC connections, and increasingly popular for connecting some IoT devices. 5G WAN links will increasingly become standard as a backup for improved SD-WAN reliability and as primary links for remote offices. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402316/when-to-use-5g-when-to-use-wi-fi-6.html + +作者:[Lee Doyle][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2017/07/wi-fi_wireless_communication_network_abstract_thinkstock_610127984_1200x800-100730107-large.jpg +[2]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[3]: https://www.networkworld.com/article/3215907/why-80211ax-is-the-next-big-thing-in-wi-fi.html +[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[6]: https://www.networkworld.com/article/3309439/80211ax-preview-access-points-and-routers-that-support-the-wi-fi-6-protocol-on-tap.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 795f452b5688b320fe63183e338344190d09740f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:08:48 +0800 Subject: [PATCH 0965/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190612=20Dell?= =?UTF-8?q?=20and=20Cisco=20extend=20VxBlock=20integration=20with=20new=20?= =?UTF-8?q?features=20sources/talk/20190612=20Dell=20and=20Cisco=20extend?= =?UTF-8?q?=20VxBlock=20integration=20with=20new=20features.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d VxBlock integration with new features.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/talk/20190612 Dell and Cisco extend VxBlock integration with new features.md diff --git a/sources/talk/20190612 Dell and Cisco extend VxBlock integration with new features.md b/sources/talk/20190612 Dell and Cisco extend VxBlock integration with new features.md new file mode 100644 index 0000000000..30e225de98 --- /dev/null +++ b/sources/talk/20190612 Dell and Cisco extend VxBlock integration with new features.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Dell and Cisco extend VxBlock integration with new features) +[#]: via: (https://www.networkworld.com/article/3402036/dell-and-cisco-extend-vxblock-integration-with-new-features.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Dell and Cisco extend VxBlock integration with new features +====== +Dell EMC and Cisco took another step in their alliance, announcing plans to expand VxBlock 1000 integration across servers, networking, storage, and data protection. +![Dell EMC][1] + +Just two months ago [Dell EMC and Cisco renewed their converged infrastructure][2] vows, and now the two have taken another step in the alliance. At this year’s at [Cisco Live][3] event taking place in San Diego, the two announced plans to expand VxBlock 1000 integration across servers, networking, storage, and data protection. + +This is done through support of NVMe over Fabrics (NVMe-oF), which allows enterprise SSDs to talk to each other directly through a high-speed fabric. NVMe is an important advance because SATA and PCI Express SSDs could never talk directly to other drives before until NVMe came along. + +To leverage NVMe-oF to its fullest extent, Dell EMC has unveiled a new integrated Cisco compute (UCS) and storage (MDS) 32G options, extending PowerMax capabilities to deliver NVMe performance across the VxBlock stack. + +**More news from Cisco Live 2019:** + + * [Cisco offers cloud-based security for SD-WAN resources][4] + * [Cisco software to make networks smarter, safer, more manageable][5] + * [Cisco launches a developer-community cert program][6] + + + +Dell EMC said this will enhance the architecture, high-performance consistency, availability, and scalability of VxBlock and provide its customers with high-performance, end-to-end mission-critical workloads that can deliver microsecond responses. + +These new compute and storage options will be available to order sometime later this month. + +### Other VxBlock news from Dell EMC + +Dell EMC also announced it is extending its factory-integrated on-premise integrated protection solutions for VxBlock to hybrid and multi-cloud environments, such as Amazon Web Services (AWS). This update will offer to help protect VMware workloads and data via the company’s Data Domain Virtual Edition and Cloud Disaster Recovery software options. This will be available in July. + +The company also plans to release VxBlock Central 2.0 software next month. VxBlock Central is designed to help customers simplify CI administration through converged awareness, automation, and analytics. + +New to version 2.0 is modular licensing that matches workflow automation, advanced analytics, and life-cycle management/upgrade options to your needs. + +VxBlock Central 2.0 has a variety of license features, including the following: + +**Base** – Free with purchase of a VxBlock, the base license allows you to manage your system and improve compliance with inventory reporting and alerting. **Workflow Automation** – Provision infrastructure on-demand using engineered workflows through vRealize Orchestrator. New workflows available with this package include Cisco UCS server expansion with Unity and XtremIO storage arrays. **Advanced Analytics** – View capacity and KPIs to discover deeper actionable insights through vRealize Operations. **Lifecycle Management** (new, available later in 2019) – Apply “guided path” software upgrades to optimize system performance. + + * Lifecycle Management includes a new multi-tenant, cloud-based database based on Cloud IQ that will collect and store the CI component inventory structured by the customer, extending the value and ease of use of the cloud-based analytics monitoring. + * This feature extends the value and ease of use of the cloud-based analytics monitoring Cloud IQ already provides for individual Dell EMC storage arrays. + + + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402036/dell-and-cisco-extend-vxblock-integration-with-new-features.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/dell-emc-vxblock-1000-100794721-large.jpg +[2]: https://www.networkworld.com/article/3391071/dell-emc-and-cisco-renew-converged-infrastructure-alliance.html +[3]: https://www.ciscolive.com/global/ +[4]: https://www.networkworld.com/article/3402079/cisco-offers-cloud-based-security-for-sd-wan-resources.html +[5]: https://www.networkworld.com/article/3401523/cisco-software-to-make-networks-smarter-safer-more-manageable.html +[6]: https://www.networkworld.com/article/3401524/cisco-launches-a-developer-community-cert-program.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From b08aaa7b3ed8a7a8816dfd0972f368ed34b9d8d9 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:09:04 +0800 Subject: [PATCH 0966/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190612=20Soft?= =?UTF-8?q?ware=20Defined=20Perimeter=20(SDP):=20Creating=20a=20new=20netw?= =?UTF-8?q?ork=20perimeter=20sources/talk/20190612=20Software=20Defined=20?= =?UTF-8?q?Perimeter=20(SDP)-=20Creating=20a=20new=20network=20perimeter.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...(SDP)- Creating a new network perimeter.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md diff --git a/sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md b/sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md new file mode 100644 index 0000000000..88a540e875 --- /dev/null +++ b/sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Software Defined Perimeter (SDP): Creating a new network perimeter) +[#]: via: (https://www.networkworld.com/article/3402258/software-defined-perimeter-sdp-creating-a-new-network-perimeter.html) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Software Defined Perimeter (SDP): Creating a new network perimeter +====== +Considering the way networks work today and the change in traffic patterns; both internal and to the cloud, this limits the effect of the fixed perimeter. +![monsitj / Getty Images][1] + +Networks were initially designed to create internal segments that were separated from the external world by using a fixed perimeter. The internal network was deemed trustworthy, whereas the external was considered hostile. However, this is still the foundation for most networking professionals even though a lot has changed since the inception of the design. + +More often than not the fixed perimeter consists of a number of network and security appliances, thereby creating a service chained stack, resulting in appliance sprawl. Typically, the appliances that a user may need to pass to get to the internal LAN may vary. But generally, the stack would consist of global load balancers, external firewall, DDoS appliance, VPN concentrator, internal firewall and eventually LAN segments. + +The perimeter approach based its design on visibility and accessibility. If an entity external to the network can’t see an internal resource, then access cannot be gained. As a result, external entities were blocked from coming in, yet internal entities were permitted to passage out. However, it worked only to a certain degree. Realistically, the fixed network perimeter will always be breachable; it's just a matter of time. Someone with enough skill will eventually get through. + +**[ Related:[MPLS explained – What you need to know about multi-protocol label switching][2]** + +### Environmental changes – the cloud and mobile workforce + +Considering the way networks work today and the change in traffic patterns; both internal and to the cloud, this limits the effect of the fixed perimeter. Nowadays, we have a very fluid network perimeter with many points of entry. + +Imagine a castle with a portcullis that was used to gain access. To gain entry into the portcullis was easy as we just needed to pass one guard. There was only one way in and one way out. But today, in this digital world, we have so many small doors and ways to enter, all of which need to be individually protected. + +This boils down to the introduction of cloud-based application services and changing the location of the perimeter. Therefore, the existing networking equipment used for the perimeter is topologically ill-located. Nowadays, everything that is important is outside the perimeter, such as, remote access workers, SaaS, IaaS and PaaS-based applications. + +Users require access to the resources in various cloud services regardless of where the resources are located, resulting in complex-to-control multi-cloud environments. Objectively, the users do not and should not care where the applications are located. They just require access to the application. Also, the increased use of mobile workforce that demands anytime and anywhere access from a variety of devices has challenged the enterprises to support this dynamic workforce. + +There is also an increasing number of devices, such as, BYOD, on-site contractors, and partners that will continue to grow internal to the network. This ultimately leads to a world of over-connected networks. + +### Over-connected networks + +Over-connected networks result in complex configurations of network appliances. This results in large and complex policies without any context. + +They provide a level of coarse-grained access to a variety of services where the IP address does not correspond to the actual user. Traditional appliances that use static configurations to limit the incoming and outgoing traffic are commonly based on information in the IP packet and the port number. + +Essentially, there is no notion of policy and explanation of why a given source IP address is on the list. This approach fails to take into consideration any notion of trust and dynamically adjust access in relation to the device, users and application request events. + +### Problems with IP addresses + +Back in the early 1990s, RFC 1597 declared three IP ranges reserved for private use: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. If an end host was configured with one of these addresses, it was considered more secure. However, this assumption of trust was shattered with the passage of time and it still haunts us today. + +Network Address Translation (NAT) also changed things to a great extent. NAT allowed internal trusted hosts to communicate directly with the external untrusted hosts. However, since Transmission Control Protocol (TCP) is bidirectional, it allows the data to be injected by the external hosts while connecting back to the internal hosts. + +Also, there is no contextual information regarding the IP addresses as the sole purpose revolved around connectivity. If you have the IP address of someone, you can connect to them. The authentication was handled higher up in the stack. + +Not only do user’s IP addresses change regularly, but there’s also not a one-to-one correspondence between the users and IP addresses. Anyone can communicate from any IP address they please and also insert themselves between you and the trusted resource. + +Have you ever heard of the 20-year old computer that responds to an internet control message protocol (ICMP) request, yet no one knows where it is? But this would not exist on a zero trust network as the network is dark until the administrator turns the lights on with a whitelist policy rule set. This is contrary to the legacy black policy rule set. You can find more information on zero trust in my course: [Zero Trust Networking: The Big Picture][3]. + +Therefore, we can’t just rely on the IP addresses and expect them to do much more other than connect. As a result, we have to move away from the IP addresses and network location as the proxy for access trust. The network location can longer be the driver of network access levels. It is not fully equipped to decide the trust of a device, user or application. + +### Visibility – a major gap + +When we analyze networking and its flaws, visibility is a major gap in today’s hybrid environments. By and large, enterprise networks are complex beasts. More than often networking pros do not have accurate data or insights into who or what is accessing the network resource. + +I.T does not have the visibility in place to detect, for example, insecure devices, unauthorized users and potentially harmful connections that could propagate malware or perform data exfiltration. + +Also, once you know how network elements connect, how do you ensure that they don’t reconnect through a broader definition of connectivity? For this, you need contextual visibility. You need full visibility into the network to see who, what, when, and how they are connecting with the device. + +### What’s the workaround? + +A new approach is needed that enables the application owners to protect the infrastructure located in a public or private cloud and on-premise data center. This new network architecture is known as [software-defined perimeter][4] (SDP). Back in 2013, Cloud Security Alliance (CSA) launched the SDP initiative, a project designed to develop the architecture for creating more robust networks. + +The principles behind SDPs are not entirely new. Organizations within the DoD and Intelligence Communities (IC) have implemented a similar network architecture that is based on authentication and authorization prior to network access. + +Typically, every internal resource is hidden behind an appliance. And a user must authenticate before visibility of the authorized services is made available and access is granted. + +### Applying the zero trust framework + +SDP is an extension to [zero trust][5] which removes the implicit trust from the network. The concept of SDP started with Google’s BeyondCorp, which is the general direction that the industry is heading to right now. + +Google’s BeyondCorp puts forward the idea that the corporate network does not have any meaning. The trust regarding accessing an application is set by a static network perimeter containing a central appliance. This appliance permits the inbound and outbound access based on a very coarse policy. + +However, access to the application should be based on other parameters such as who the user is, the judgment of the security stance of the device, followed by some continuous assessment of the session. Rationally, only then should access be permitted. + +Let’s face it, the assumption that internal traffic can be trusted is flawed and zero trust assumes that all hosts internal to the network are internet facing, thereby hostile. + +### What is software-defined perimeter (SDP)? + +The SDP aims to deploy perimeter functionality for dynamically provisioned perimeters meant for clouds, hybrid environments, and on-premise data center infrastructures. There is often a dynamic tunnel that automatically gets created during the session. That is a one-to-one mapping between the requesting entity and the trusted resource. The important point to note here is that perimeters are formed not solely to obey a fixed location already design by the network team. + +SDP relies on two major pillars and these are the authentication and authorization stages. SDPs require endpoints to authenticate and be authorized first before obtaining network access to the protected entities. Then, encrypted connections are created in real-time between the requesting systems and application infrastructure. + +Authenticating and authorizing the users and their devices before even allowing a single packet to reach the target service, enforces what's known as least privilege at the network layer. Essentially, the concept of least privilege is for an entity to be granted only the minimum privileges that it needs to get its work done. Within a zero trust network, privilege is more dynamic than it would be in traditional networks since it uses many different attributes of activity to determine the trust score. + +### The dark network + +Connectivity is based on a need-to-know model. Under this model, no DNS information, internal IP addresses or visible ports of internal network infrastructure are transmitted. This is the reason why SDP assets are considered as “dark”. As a result, SDP isolates any concerns about the network and application. The applications and users are considered abstract, be it on-premise or in the cloud, which becomes irrelevant to the assigned policy. + +Access is granted directly between the users and their devices to the application and resource, regardless of the underlying network infrastructure. There simply is no concept of inside and outside of the network. This ultimately removes the network location point as a position of advantage and also eliminates the excessive implicit trust that IP addresses offer. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][6]** + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402258/software-defined-perimeter-sdp-creating-a-new-network-perimeter.html + +作者:[Matt Conran][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/Matt-Conran/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/sdn_software-defined-network_architecture-100791938-large.jpg +[2]: https://www.networkworld.com/article/2297171/sd-wan/network-security-mpls-explained.html +[3]: http://pluralsight.com/courses/zero-trust-networking-big-picture +[4]: https://network-insight.net/2018/09/software-defined-perimeter-zero-trust/ +[5]: https://network-insight.net/2018/10/zero-trust-networking-ztn-want-ghosted/ +[6]: /contributor-network/signup.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From bd7a94ed4b9bbe4c234020de53af8f1728bcaceb Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:09:22 +0800 Subject: [PATCH 0967/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190612=20Cisc?= =?UTF-8?q?o=20offers=20cloud-based=20security=20for=20SD-WAN=20resources?= =?UTF-8?q?=20sources/talk/20190612=20Cisco=20offers=20cloud-based=20secur?= =?UTF-8?q?ity=20for=20SD-WAN=20resources.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oud-based security for SD-WAN resources.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/talk/20190612 Cisco offers cloud-based security for SD-WAN resources.md diff --git a/sources/talk/20190612 Cisco offers cloud-based security for SD-WAN resources.md b/sources/talk/20190612 Cisco offers cloud-based security for SD-WAN resources.md new file mode 100644 index 0000000000..a6cd0c73b4 --- /dev/null +++ b/sources/talk/20190612 Cisco offers cloud-based security for SD-WAN resources.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco offers cloud-based security for SD-WAN resources) +[#]: via: (https://www.networkworld.com/article/3402079/cisco-offers-cloud-based-security-for-sd-wan-resources.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco offers cloud-based security for SD-WAN resources +====== +Cisco adds support for its cloud-based security gateway Umbrella to SD-WAN software +![Thinkstock][1] + +SAN DIEGO— As many companies look to [SD-WAN][2] technology to reduce costs, improve connectivity and streamline branch office access, one of the key requirements will be solid security technologies to protect corporate resources. + +At its Cisco Live customer event here this week, the company took aim at that need by telling customers it added support for the its cloud-based security gateway – known as Umbrella – to its SD-WAN software offerings. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][3] + * [How to pick an off-site data-backup method][4] + * [SD-Branch: What it is and why you’ll need it][5] + * [What are the options for security SD-WAN?][6] + + + +At its most basic, SD-WAN lets companies aggregate a variety of network connections – including MPLS, 4G LTE and DSL – into a branch or network-edge location and provides a management software that can turn up new sites, prioritize traffic and set security policies. SD-WAN's driving principle is to simplify the way big companies turn up new links to branch offices, better manage the way those links are utilized – for data, voice or video – and potentially save money in the process. + +According to Cisco, Umbrella can provide the first line of defense against threats on the internet. By analyzing and learning from internet activity patterns, Umbrella automatically uncovers attacker infrastructure and proactively blocks requests to malicious destinations before a connection is even established — without adding latency for users. With Umbrella, customers can stop phishing and malware infections earlier, identify already infected devices faster and prevent data exfiltration, Cisco says. + +Branch offices and roaming users are more vulnerable to attacks, and attackers are looking to exploit them, said Gee Rittenhouse, senior vice president and general manager of Cisco's Security Business Group. He pointed to Enterprise Strategy Group research that says 68 percent of branch offices and roaming users were the source of compromise in recent attacks. And as organizations move to more direct internet access, this becomes an even greater risk, Rittenhouse said. + +“Scaling security at every location often means more appliances to ship and manage, more policies to separately maintain, which translates into more money and resources needed – but Umbrella offers an alternative to all that," he said. "Umbrella provides simple deployment and management, and in a single cloud platform, it unifies multiple layers of security, ncluding DNS, secure web gateway, firewall and cloud-access security,” Rittenhouse said. + +“It also acts as your secure onramp to the internet by offering secure internet access and controlled SaaS usage across all locations and roaming users.” + +Basically users can set up Umbrella support via the SD-WAN dashboard vManage, and the system automatically creates a secure tunnel to the cloud.** ** Once the SD-WAN traffic is pointed at the cloud, firewall and other security policies can be set. Customers can then see traffic and collect information about patterns or set policies and respond to anomalies, Rittenhouse said. + +Analysts said the Umbrella offering is another important security option offered by Cisco for SD-WAN customers. + +“Since it is cloud-based, using Umbrella is a great option for customers with lots of branch or SD-WAN locations who don’t want or need to have a security gateway on premises,” said Rohit Mehra, vice president of Network Infrastructure at IDC. “One of the largest requirements for large customers going forward will be the need for all manner of security technologies for the SD-WAN environment, and Cisco has a big menu of offerings that can address those requirements.” + +IDC says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40 percent yearly clip between now and then. + +The Umbrella announcement is on top of other recent SD-WAN security enhancements the company has made. In May [Cisco added support for Advanced Malware Protection (AMP) to its million-plus ISR/ASR edge routers][7] in an effort to reinforce branch- and core-network malware protection across the SD-WAN. + +“Together with Cisco Talos [Cisco’s security-intelligence arm], AMP imbues your SD-WAN branch, core and campuses locations with threat intelligence from millions of worldwide users, honeypots, sandboxes and extensive industry partnerships,” Cisco said. + +In total, AMP identifies more than 1.1 million unique malware samples a day and when AMP in Cisco SD-WAN platform spots malicious behavior it automatically blocks it, Cisco said. + +Last year Cisco added its [Viptela SD-WAN technology to the IOS XE][8] version 16.9.1 software that runs its core ISR/ASR routers such as the ISR models 1000, 4000 and ASR 1000, in use by organizations worldwide. Cisco bought Viptela in 2017. + +The release of Cisco IOS XE offered an instant upgrade path for creating cloud-controlled SD-WAN fabrics to connect distributed offices, people, devices and applications operating on the installed base, Cisco said. At the time Cisco said that Cisco SD-WAN on edge routers builds a secure virtual IP fabric by combining routing, segmentation, security, policy and orchestration. + +With the recent release of IOS-XE SD-WAN 16.11, Cisco has brought AMP and other enhancements to its SD-WAN. + +AMP support is added to a menu of security features already included in Cisco's SD-WAN software including support for URL filtering, Snort Intrusion Prevention, the ability to segment users across the WAN and embedded platform security, including the Cisco Trust Anchor module. + +The software also supports SD-WAN Cloud onRamp for CoLocation, which lets customers tie distributed multicloud applications back to a local branch office or local private data center. That way a cloud-to-branch link would be shorter, faster and possibly more secure that tying cloud-based applications directly to the data center. + +Also in May [Cisco and Teridion][9] said they would team to deliver faster enterprise software-defined WAN services. The integration links Cisco Meraki MX Security/SD-WAN appliances and its Auto VPN technology which lets users quickly bring up and configure secure sessions between branches and data centers with Teridion’s cloud-based WAN service. Teridion’s service promises customers better performance and control over traffic running from remote offices over the public internet to the data center. + +Teridion said the Meraki integration creates an IPSec connection from the Cisco Meraki MX to the Teridion edge. Customers create locations in the Teridion portal and apply the preconfigured Meraki template to them, or just upload a csv file if they have a lot of locations. Then, from each Meraki MX, they can create a third-party IPSec tunnel to the Teridion edge IP addresses that are generated as part of the Teridion configuration, the company stated. + +The combined Cisco Meraki and Teridion offering brings SD-WAN and security capabilities at the WAN edge that are tightly integrated with a WAN service delivered over cost-effective broadband or dedicated Internet access. Meraki’s MX family supports everything from SD-WAN and [Wi-Fi][10] features to next-generation [firewall][11] and intrusion prevention in a single package. + +Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402079/cisco-offers-cloud-based-security-for-sd-wan-resources.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2015/10/cloud-security-ts-100622309-large.jpg +[2]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html +[3]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[4]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[5]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[6]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[7]: https://www.networkworld.com/article/3394597/cisco-adds-amp-to-sd-wan-for-israsr-routers.html +[8]: https://www.networkworld.com/article/3296007/cisco-upgrade-enables-sd-wan-in-1m-israsr-routers.html +[9]: https://www.networkworld.com/article/3396628/cisco-ties-its-securitysd-wan-gear-with-teridions-cloud-wan-service.html +[10]: https://www.networkworld.com/article/3318119/what-to-expect-from-wi-fi-6-in-2019.html +[11]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From e70314837e606421a17abc9c9ed7d11104c82fc1 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:09:40 +0800 Subject: [PATCH 0968/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190612=20IoT?= =?UTF-8?q?=20security=20vs.=20privacy:=20Which=20is=20a=20bigger=20issue?= =?UTF-8?q?=3F=20sources/talk/20190612=20IoT=20security=20vs.=20privacy-?= =?UTF-8?q?=20Which=20is=20a=20bigger=20issue.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ty vs. privacy- Which is a bigger issue.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md diff --git a/sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md b/sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md new file mode 100644 index 0000000000..2f06f6afc1 --- /dev/null +++ b/sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IoT security vs. privacy: Which is a bigger issue?) +[#]: via: (https://www.networkworld.com/article/3401522/iot-security-vs-privacy-which-is-a-bigger-issue.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +IoT security vs. privacy: Which is a bigger issue? +====== +When it comes to the internet of things (IoT), security has long been a key concern. But privacy issues could be an even bigger threat. +![Ring][1] + +If you follow the news surrounding the internet of things (IoT), you know that security issues have long been a key concern for IoT consumers, enterprises, and vendors. Those issues are very real, but I’m becoming increasingly convinced that related but fundamentally different _privacy_ vulnerabilities may well be an even bigger threat to the success of the IoT. + +In June alone, we’ve seen a flood of IoT privacy issues inundate the news cycle, and observers are increasingly sounding the alarm that IoT users should be paying attention to what happens to the data collected by IoT devices. + +**[ Also read:[It’s time for the IoT to 'optimize for trust'][2] and [A corporate guide to addressing IoT security][2] ]** + +Predictably, most of the teeth-gnashing has come on the consumer side, but that doesn’t mean enterprises users are immune to the issue. One the one hand, just like consumers, companies are vulnerable to their proprietary information being improperly shared and misused. More immediately, companies may face backlash from their own customers if they are seen as not properly guarding the data they collect via the IoT. Too often, in fact, enterprises shoot themselves in the foot on privacy issues, with practices that range from tone-deaf to exploitative to downright illegal—leading almost [two-thirds (63%) of consumers to describe IoT data collection as “creepy,”][3] while more than half (53%) “distrust connected devices to protect their privacy and handle information in a responsible manner.” + +### Ring becoming the poster child for IoT privacy issues + +As a case in point, let’s look at the case of [Ring, the IoT doorbell company now owned by Amazon][4]. Ring is [reportedly working with police departments to build a video surveillance network in residential neighborhoods][5]. Police in more than 50 cities and towns across the country are apparently offering free or discounted Ring doorbells, and sometimes requiring the recipients to share footage for use in investigations. (While [Ring touts the security benefits][6] of working with law enforcement, it has asked police departments to end the practice of _requiring_ users to hand over footage, as it appears to violate the devices’ terms of service.) + +Many privacy advocates are troubled by this degree of cooperation between police and Ring, but that’s only part of the problem. Last year, for example, [Ring workers in Ukraine reportedly watched customer feeds][7]. Amazingly, though, even that only scratches the surface of the privacy flaps surrounding Ring. + +### Guilty by video? + +According to [Motherboard][8], “Ring is using video captured by its doorbell cameras in Facebook advertisements that ask users to identify and call the cops on a woman whom local police say is a suspected thief.” While the police are apparently appreciative of the “additional eyes that may see this woman and recognize her,” the ad calls the woman a thief even though she has not been charged with a crime, much less convicted! + +Ring may be today’s poster child for IoT privacy issues, but IoT privacy complaints are widespread. In many cases, it comes down to what IoT users—or others nearby—are getting in return for giving up their privacy. According to the [Guardian][9], for example, Google’s Sidewalk Labs smart city project is little more than “surveillance capitalism.” And while car owners may get a discount on auto insurance in return for sharing their driving data, that relationship is hardly set in stone. It may not be long before drivers have to give up their data just to get insurance at all. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][10] ]** + +And as the recent [data breach at the U.S. Customs and Border Protection][11] once again demonstrates, private data is “[a genie without a bottle][12].” No matter what legal or technical protections are put in place, the data may always be revealed or used in unforeseen ways. Heck, when you put it all together, it’s enough to make you wonder [whether doorbells really need to be smart][13] at all? + +**Read more about IoT:** + + * [Google’s biggest, craziest ‘moonshot’ yet][14] + * [What is the IoT? How the internet of things works][15] + * [What is edge computing and how it’s changing the network][16] + * [Most powerful internet of things companies][17] + * [10 Hot IoT startups to watch][18] + * [The 6 ways to make money in IoT][19] + * [What is digital twin technology? [and why it matters]][20] + * [Blockchain, service-centric networking key to IoT success][21] + * [Getting grounded in IoT networking and security][22] + * [Building IoT-ready networks must become a priority][23] + * [What is the Industrial IoT? [And why the stakes are so high]][24] + + + +Join the Network World communities on [Facebook][25] and [LinkedIn][26] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3401522/iot-security-vs-privacy-which-is-a-bigger-issue.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/ringvideodoorbellpro-100794084-large.jpg +[2]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html +[3]: https://www.cpomagazine.com/data-privacy/consumers-still-concerned-about-iot-security-and-privacy-issues/ +[4]: https://www.cnbc.com/2018/02/27/amazon-buys-ring-a-former-shark-tank-reject.html +[5]: https://www.cnet.com/features/amazons-helping-police-build-a-surveillance-network-with-ring-doorbells/ +[6]: https://blog.ring.com/2019/02/14/how-rings-neighbors-creates-safer-more-connected-communities/ +[7]: https://www.theinformation.com/go/b7668a689a +[8]: https://www.vice.com/en_us/article/pajm5z/amazon-home-surveillance-company-ring-law-enforcement-advertisements +[9]: https://www.theguardian.com/cities/2019/jun/06/toronto-smart-city-google-project-privacy-concerns +[10]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[11]: https://www.washingtonpost.com/technology/2019/06/10/us-customs-border-protection-says-photos-travelers-into-out-country-were-recently-taken-data-breach/?utm_term=.0f3a38aa40ca +[12]: https://smartbear.com/blog/test-and-monitor/data-scientists-are-sexy-and-7-more-surprises-from/ +[13]: https://slate.com/tag/should-this-thing-be-smart +[14]: https://www.networkworld.com/article/3058036/google-s-biggest-craziest-moonshot-yet.html +[15]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[16]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[17]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[18]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[19]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[20]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[21]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[22]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[23]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[24]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[25]: https://www.facebook.com/NetworkWorld/ +[26]: https://www.linkedin.com/company/network-world From 8acf7424a7551915f9b6905e1964eda911248718 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:12:13 +0800 Subject: [PATCH 0969/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190611=20The?= =?UTF-8?q?=20carbon=20footprints=20of=20IT=20shops=20that=20train=20AI=20?= =?UTF-8?q?models=20are=20huge=20sources/talk/20190611=20The=20carbon=20fo?= =?UTF-8?q?otprints=20of=20IT=20shops=20that=20train=20AI=20models=20are?= =?UTF-8?q?=20huge.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... IT shops that train AI models are huge.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md diff --git a/sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md b/sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md new file mode 100644 index 0000000000..b440b8d65b --- /dev/null +++ b/sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The carbon footprints of IT shops that train AI models are huge) +[#]: via: (https://www.networkworld.com/article/3401919/the-carbon-footprints-of-it-shops-that-train-ai-models-are-huge.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +The carbon footprints of IT shops that train AI models are huge +====== +Artificial intelligence (AI) model training can generate five times more carbon dioxide than a car does in a lifetime, researchers at the University of Massachusetts, Amherst find. +![ipopba / Getty Images][1] + +A new research paper from the University of Massachusetts, Amherst looked at the carbon dioxide (CO2) generated over the course of training several common large artificial intelligence (AI) models and found that the process can generate nearly five times the amount as an average American car over its lifetime plus the process of making the car itself. + +The [paper][2] specifically examined the model training process for natural-language processing (NLP), which is how AI handles natural language interactions. The study found that during the training process, more than 626,000 pounds of carbon dioxide is generated. + +This is significant, since AI training is one IT process that has remained firmly on-premises and not moved to the cloud. Very expensive equipment is needed, as is large volumes of data, so the cloud isn’t right work for most AI training, and the report notes this. Plus, IT shops want to keep that kind of IP in house. So, if you are experimenting with AI, that power bill is going to go up. + +**[ Read also:[How to plan a software-defined data-center network][3] ]** + +While the report used carbon dioxide as a measure, that’s still the product of electricity generation. Training involves the use of the most powerful processors, typically Nvidia GPUs, and they are not known for being low-power draws. And as the paper notes, “model training also incurs a substantial cost to the environment due to the energy required to power this hardware for weeks or months at a time.” + +Training is the most processor-intensive portion of AI. It can take days, weeks, or even months to “learn” what the model needs to know. That means power-hungry Nvidia GPUs running at full utilization for the entire time. In this case, how to handle and process natural language questions rather than broken sentences of keywords like your typical Google search. + +The report said training one model with a neural architecture generated 626,155 pounds of CO2. By contrast, one passenger flying round trip between New York and San Francisco would generate 1,984 pounds of CO2, an average American would generate 11,023 pounds in one year, and a car would generate 126,000 pounds over the course of its lifetime. + +### How the researchers calculated the CO2 amounts + +The researchers used four models in the NLP field that have been responsible for the biggest leaps in performance. They are Transformer, ELMo, BERT, and GPT-2. They trained all of the models on a single Nvidia Titan X GPU, with the exception of ELMo which was trained on three Nvidia GTX 1080 Ti GPUs. Each model was trained for a maximum of one day. + +**[[Learn Java from beginning concepts to advanced design patterns in this comprehensive 12-part course!][4] ]** + +They then used the number of training hours listed in the model’s original papers to calculate the total energy consumed over the complete training process. That number was converted into pounds of carbon dioxide equivalent based on the average energy mix in the U.S. + +The big takeaway is that computational costs start out relatively inexpensive, but they mushroom when additional tuning steps were used to increase the model’s final accuracy. A tuning process known as neural architecture search ([NAS][5]) is the worst offender because it does so much processing. NAS is an algorithm that searches for the best neural network architecture. It is seriously advanced AI and requires the most processing time and power. + +The researchers suggest it would be beneficial to directly compare different models to perform a cost-benefit (accuracy) analysis. + +“To address this, when proposing a model that is meant to be re-trained for downstream use, such as re-training on a new domain or fine-tuning on a new task, authors should report training time and computational resources required, as well as model sensitivity to hyperparameters. This will enable direct comparison across models, allowing subsequent consumers of these models to accurately assess whether the required computational resources,” the authors wrote. + +They also say researchers who are cost-constrained should pool resources and avoid the cloud, as cloud compute time is more expensive. In an example, it said a GPU server with eight Nvidia 1080 Ti GPUs and supporting hardware is available for approximately $20,000. To develop the sample models used in their study, that hardware would cost $145,000, plus electricity to run the models, about half the estimated cost to use on-demand cloud GPUs. + +“Unlike money spent on cloud compute, however, that invested in centralized resources would continue to pay off as resources are shared across many projects. A government-funded academic compute cloud would provide equitable access to all researchers,” they wrote. + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3401919/the-carbon-footprints-of-it-shops-that-train-ai-models-are-huge.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/ai-vendor-relationship-management_artificial-intelligence_hand-on-virtual-screen-100795246-large.jpg +[2]: https://arxiv.org/abs/1906.02243 +[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fjava +[5]: https://www.oreilly.com/ideas/what-is-neural-architecture-search +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From f702a613daf6269ac70b02478b64ce29e3745c93 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:13:22 +0800 Subject: [PATCH 0970/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190611=20Cisc?= =?UTF-8?q?o=20launches=20a=20developer-community=20cert=20program=20sourc?= =?UTF-8?q?es/talk/20190611=20Cisco=20launches=20a=20developer-community?= =?UTF-8?q?=20cert=20program.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ches a developer-community cert program.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/talk/20190611 Cisco launches a developer-community cert program.md diff --git a/sources/talk/20190611 Cisco launches a developer-community cert program.md b/sources/talk/20190611 Cisco launches a developer-community cert program.md new file mode 100644 index 0000000000..92ce486e6d --- /dev/null +++ b/sources/talk/20190611 Cisco launches a developer-community cert program.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco launches a developer-community cert program) +[#]: via: (https://www.networkworld.com/article/3401524/cisco-launches-a-developer-community-cert-program.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco launches a developer-community cert program +====== +Cisco has revamped some of its most critical certification and career-development programs in an effort to address the emerging software-oriented-network environment. +![Getty Images][1] + +SAN DIEGO – Cisco revamped some of its most critical certification and career-development tools in an effort to address the emerging software-oriented network environment. + +Perhaps one of the biggest additions – rolled out here at the company’s Cisco Live customer event – is the new set of professional certifications for developers utilizing Cisco’s growing DevNet developer community. + +**[ Also see[4 job skills that can boost networking salaries][2] and [20 hot jobs ambitious IT pros should shoot for][3].]** + +The Cisco Certified DevNet Associate, Specialist and Professional certifications will cover software development for applications, automation, DevOps, cloud and IoT. They will also target software developers and network engineers who develop software proficiency to develop applications and automated workflows for operational networks and infrastructure. + +“This certification evolution is the next step to reflect the critical skills network engineers must have to be at the leading edge of networked-enabled business disruption and delivering customer excellence,” said Mike Adams, vice president and general manager of Learning@Cisco. “To perform effectively in this new world, every IT professional needs skills that are broader, deeper and more agile than ever before. And they have to be comfortable working as a multidisciplinary team including infrastructure network engineers, DevOps and automation specialists, and software professionals.” + +Other Cisco Certifications changes include: + + * Streamlined certifications to validate engineering professionals with Cisco Certified Network Associate (CCNA) and Cisco Specialist certifications as well as Cisco Certified Network Professional (CCNP) and Cisco Certified Internetwork Expert (CCIE) certifications in enterprise, data center, service provider, security and collaboration. + * For more senior professionals, the CCNP will give learners a choice of five tracks, covering enterprise technologies including infrastructure and wireless, service provider, data center, security and collaboration. Candidates will be able to further specialize in a particular focus area within those technologies. + * Cisco says it will eliminate pre-requisites for certifications, meaning engineers can change career options without having to take a defined path. + * Expansion of Cisco Networking Academy offerings to train entry level network professionals and software developers. Courses prepare students to earn CCNA and Certified DevNet Associate certifications, equipping them for high-demand jobs in IT. + + + +New network technologies such as intent-based networking, multi-domain networking, and programmability fundamentally change the capabilities of the network, giving network engineers the opportunity to architect solutions that utilize the programmable network in new and exciting ways, wrote Susie Wee senior vice president and chief technology officer of DevNet. + +“DevOps practices can be applied to the network, making the network more agile and enabling automation at scale. The new network provides more than just connectivity, it can now use policy and intent to securely connect applications, users, devices and data across multiple environments – from the data center and cloud, to the campus and branch, to the edge, and to the device,” Wee wrote. + +**[[Looking to upgrade your career in tech? This comprehensive online course teaches you how.][4] ]** + +She also announced the DevNet Automation Exchange, a community that will offer shared code, best practices and technology tools for users, developers or channel partners interested in developing automation apps. + +Wee said Cisco seeded the Automation Exchange with over 50 shared code repositories. + +“It is becoming increasingly clear that network ops can be handled much more efficiently with automation, and offering the tools to develop better applications is crucial going forward,” said Zeus Kerravala, founder and principal analyst with ZK Research. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3401524/cisco-launches-a-developer-community-cert-program.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/01/run_digital-vanguard_business-executive-with-briefcase_career-growth-100786736-large.jpg +[2]: https://www.networkworld.com/article/3227832/lan-wan/4-job-skills-that-can-boost-networking-salaries.html +[3]: https://www.networkworld.com/article/3276025/careers/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fupgrading-your-technology-career +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 2d8b573841772d9fdf3296abfd723040fd396fb4 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:13:46 +0800 Subject: [PATCH 0971/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190611=20Cisc?= =?UTF-8?q?o=20software=20to=20make=20networks=20smarter,=20safer,=20more?= =?UTF-8?q?=20manageable=20sources/tech/20190611=20Cisco=20software=20to?= =?UTF-8?q?=20make=20networks=20smarter,=20safer,=20more=20manageable.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...etworks smarter, safer, more manageable.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20190611 Cisco software to make networks smarter, safer, more manageable.md diff --git a/sources/tech/20190611 Cisco software to make networks smarter, safer, more manageable.md b/sources/tech/20190611 Cisco software to make networks smarter, safer, more manageable.md new file mode 100644 index 0000000000..7bdf5361ab --- /dev/null +++ b/sources/tech/20190611 Cisco software to make networks smarter, safer, more manageable.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco software to make networks smarter, safer, more manageable) +[#]: via: (https://www.networkworld.com/article/3401523/cisco-software-to-make-networks-smarter-safer-more-manageable.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco software to make networks smarter, safer, more manageable +====== +Cisco software announced at Cisco Live embraces AI to help customers set consistent network and security policies across their domains and improve intent-based networking. +![bigstock][1] + +SAN DIEGO—Cisco injected a number of new technologies into its key networking control-point software that makes it easier to stretch networking from the data center to the cloud while making the whole environment smarter and easier to manage. + +At the company’s annual Cisco Live customer event here it rolled out software that lets customers more easily meld typically siloed domains across the enterprise and cloud to the wide area network. The software enables what Cisco calls multidomain integration that lets customers set policies to apply uniform access controls to users, devices and applications regardless of where they connect to the network, the company said. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][2] + * [How to pick an off-site data-backup method][3] + * [SD-Branch: What it is and why you’ll need it][4] + * [What are the options for security SD-WAN?][5] + + + +The company also unveiled Cisco AI Network Analytics, a software package that uses [AI and machine learning techniques][6] to learn network traffic and security patterns that can help customers spot and fix problems proactively across the enterprise. + +All of the new software runs on Cisco’s DNA Center platform which is rapidly becoming an ever-more crucial component to the company’s intent-based networking plans. DNA Center has always been important since its introduction two years ago as it features automation capabilities, assurance setting, fabric provisioning and policy-based segmentation for enterprise networks. + +Beyond device management and configuration, Cisco DNA Center gives IT teams the ability to control access through policies using Software-Defined Access (SD-Access), automatically provision through Cisco DNA Automation, virtualize devices through Cisco Network Functions Virtualization (NFV), and lower security risks through segmentation and Encrypted Traffic Analysis. But experts say these software enhancements take it to a new level. + +“You can call it the rise of DNA Center and it’s important because it lets customers manage and control their entire network from one place – similar to what VMware does with its vCenter,” said Zeus Kerravala, founder and principal analyst with ZK Research. vCenter is VMware’s centralized platform for controlling its vSphere virtualized environments. + +“Cisco will likely roll more and more functionality into DNA Center in the future making it stronger,” Kerravala said. + +**[[Become a Microsoft Office 365 administrator in record time with this quick start course from PluralSight.][7] ]** + +Together the new software and DNA Center will help customers set consistent policies across their domains and collaborate with others for the benefit of the entire network. Customers can define a policy once, apply it everywhere, and monitor it systematically to ensure it is realizing its business intent, said Prashanth Shenoy, Cisco vice president of marketing for Enterprise Network and Mobility. It will help customers segment their networks to reduce congestion, improve security and compliance and contain network problems, he said. + +“In the campus, Cisco’s SD-Access solution uses this technology to group users and devices within the segments it creates according to their access privileges. Similarly, Cisco ACI creates groups of similar applications in the data center,” Shenoy said. “When integrated, SD-Access and ACI exchange their groupings and provide each other an awareness into their access policies. With this knowledge, each of the domains can map user groups with applications, jointly enforce policies, and block unauthorized access to applications.” + +In the Cisco world it basically means there now can be a unification of its central domain network controllers and they can work together and let customers drive policies across domains. + +Cisco also said that security capabilities can be spread across domains. + +Cisco Advanced Malware Protection (AMP) prevents breaches, monitors malicious behavior and detects and removes malware. Security constructs built into Cisco SD-WAN, and the recently announced SD-WAN onRamp for CoLocation, provide a full security stack that applies protection consistently from user to branch to clouds. Cisco Stealthwatch and Stealthwatch Cloud detect threats across the private network, public clouds, and in encrypted traffic. + +Analysts said Cisco’s latest efforts are an attempt to simplify what are fast becoming complex networks with tons of new devices and applications to support. + +Cisco’s initial efforts were product specific, but its latest announcements cross products and domains, said Lee Doyle principal analyst with Doyle Research. “Cisco is making a strong push to make its networks easier to use, manage and program.” + +That same strategy is behind the new AI Analytics program. + +“Trying to manually analyze and troubleshoot the traffic flowing through thousands of APs, switches and routers is a near impossible task, even for the most sophisticated NetOps team. In a wireless environment, onboarding and interference errors can crop up randomly and intermittently, making it even more difficult to determine probable causes,” said Anand Oswal, senior vice president, engineering for Cisco’s Enterprise Networking Business. + +Cisco has been integrating AI/ML into many operational and security components, with Cisco DNA Center the focal point for insights and actions, Oswal wrote in a [blog][8] about the AI announcement. AI Network Analytics collects massive amounts of network data from Cisco DNA Centers at participating customer sites, encrypts and anonymizes the data to ensure privacy, and collates all of it into the Cisco Worldwide Data Platform. In this cloud, the aggregated data is analyzed with deep machine learning to reveal patterns and anomalies such as: + + * Highly personalized network baselines with multiple levels of granularity that define “normal” for a given network, site, building and SSID. + + * Sudden changes in onboarding times for Wi-Fi devices, by individual APs, floor, building, campus +``` + +``` + and branch. + + * Simultaneous connectivity failures with numerous clients at a specific location + + * Changes in SaaS and Cloud application performance via SD-WAN direct internet connections or [Cloud OnRamps][9]. + + * Pattern-matching capabilities of ML will be used to spot anomalies in network behavior that might otherwise be missed. + + + + +“The intelligence of its large base of customers can help Cisco to derive important insights about how users can better manage their networks and solve problems and the power of MI/AI technology will continue to improve over time,” Doyle said. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3401523/cisco-software-to-make-networks-smarter-safer-more-manageable.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/11/intelligentnetwork-100780636-large.jpg +[2]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[3]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[4]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[5]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[6]: https://www.networkworld.com/article/3400382/cisco-will-use-aiml-to-boost-intent-based-networking.html +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fadministering-office-365-quick-start +[8]: https://blogs.cisco.com/analytics-automation/cisco-ai-network-analytics-making-networks-smarter-simpler-and-more-secure +[9]: https://www.networkworld.com/article/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world From 6fc5aa2c6e6f475e4eb6ffd3199f43abf6f6deff Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 13:14:15 +0800 Subject: [PATCH 0972/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190611=206=20?= =?UTF-8?q?ways=20to=20make=20enterprise=20IoT=20cost=20effective=20source?= =?UTF-8?q?s/talk/20190611=206=20ways=20to=20make=20enterprise=20IoT=20cos?= =?UTF-8?q?t=20effective.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s to make enterprise IoT cost effective.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/talk/20190611 6 ways to make enterprise IoT cost effective.md diff --git a/sources/talk/20190611 6 ways to make enterprise IoT cost effective.md b/sources/talk/20190611 6 ways to make enterprise IoT cost effective.md new file mode 100644 index 0000000000..492262c617 --- /dev/null +++ b/sources/talk/20190611 6 ways to make enterprise IoT cost effective.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 ways to make enterprise IoT cost effective) +[#]: via: (https://www.networkworld.com/article/3401082/6-ways-to-make-enterprise-iot-cost-effective.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +6 ways to make enterprise IoT cost effective +====== +Rob Mesirow, a principal at PwC’s Connected Solutions unit, offers tips for successfully implementing internet of things (IoT) projects without breaking the bank. +![DavidLeshem / Getty][1] + +There’s little question that the internet of things (IoT) holds enormous potential for the enterprise, in everything from asset tracking to compliance. + +But enterprise uses of IoT technology are still evolving, and it’s not yet entirely clear which use cases and practices currently make economic and business sense. So, I was thrilled to trade emails recently with [Rob Mesirow][2], a principal at [PwC’s Connected Solutions][3] unit, about how to make enterprise IoT implementations as cost effective as possible. + +“The IoT isn’t just about technology (hardware, sensors, software, networks, communications, the cloud, analytics, APIs),” Mesirow said, “though tech is obviously essential. It also includes ensuring cybersecurity, managing data governance, upskilling the workforce and creating a receptive workplace culture, building trust in the IoT, developing interoperability, and creating business partnerships and ecosystems—all part of a foundation that’s vital to a successful IoT implementation.” + +**[ Also read:[Enterprise IoT: Companies want solutions in these 4 areas][4] ]** + +Yes, that sounds complicated—and a lot of work for a still-hard-to-quantify return. Fortunately, though, Mesirow offered up some tips on how companies can make their IoT implementations as cost effective as possible. + +### 1\. Don’t wait for better technology + +Mesirow advised against waiting to implement IoT projects until you can deploy emerging technology such as [5G networks][5]. That makes sense, as long as your implementation doesn’t specifically require capabilities available only in the new technology. + +### 2\. Start with the basics, and scale up as needed + +“Companies need to start with the basics—building one app/task at a time—instead of jumping ahead with enterprise-wide implementations and ecosystems,” Mesirow said. + +“There’s no need to start an IoT initiative by tackling a huge, expensive ecosystem. Instead, begin with one manageable use case, and build up and out from there. The IoT can inexpensively automate many everyday tasks to increase effectiveness, employee productivity, and revenue.” + +After you pick the low-hanging fruit, it’s time to become more ambitious. + +“After getting a few successful pilots established, businesses can then scale up as needed, building on the established foundation of business processes, people experience, and technology," Mesirow said, + +### 3\. Make dumb things smart + +Of course, identifying the ripest low-hanging fruit isn’t always easy. + +“Companies need to focus on making dumb things smart, deploying infrastructure that’s not going to break the bank, and providing enterprise customers the opportunity to experience what data intelligence can do for their business,” Mesirow said. “Once they do that, things will take off.” + +### 4\. Leverage lower-cost networks + +“One key to building an IoT inexpensively is to use low-power, low-cost networks (Low-Power Wide-Area Networks (LPWAN)) to provide IoT services, which reduces costs significantly,” Mesirow said. + +Naturally, he mentioned that PwC has three separate platforms with some 80 products that hang off those platforms, which he said cost “a fraction of traditional IoT offerings, with security and privacy built in.” + +Despite the product pitch, though, Mesirow is right to call out the efficiencies involved in using low-cost, low-power networks instead of more expensive existing cellular. + +### 5\. Balance security vs. cost + +Companies need to plan their IoT network with costs vs. security in mind, Mesirow said. “Open-source networks will be less expensive, but there may be security concerns,” he said. + +That’s true, of course, but there may be security concerns in _any_ network, not just open-source solutions. Still, Mesirow’s overall point remains valid: Enterprises need to carefully consider all the trade-offs they’re making in their IoT efforts. + +### 6\. Account for _all_ the value IoT provides + +Finally, Mesirow pointed out that “much of the cost-effectiveness comes from the _value_ the IoT provides,” and its important to consider the return, not just the investment. + +“For example,” Mesirow said, the IoT “increases productivity by enabling the remote monitoring and control of business operations. It saves on energy costs by automatically turning off lights and HVAC when spaces are vacant, and predictive maintenance alerts lead to fewer machine repairs. And geolocation can lead to personalized marketing to customer smartphones, which can increase sales to nearby stores.” + +**[ Now read this:[5 reasons the IoT needs its own networks][6] ]** + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3401082/6-ways-to-make-enterprise-iot-cost-effective.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/money_financial_salary_growth_currency_by-davidleshem-100787975-large.jpg +[2]: https://twitter.com/robmesirow +[3]: https://digital.pwc.com/content/pwc-digital/en/products/connected-solutions.html +[4]: https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html +[5]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[6]: https://www.networkworld.com/article/3284506/5-reasons-the-iot-needs-its-own-networks.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 3992f874393954d19fbda3c8f4459a0576ada42c Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 18:35:25 +0800 Subject: [PATCH 0973/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190617=20How?= =?UTF-8?q?=20To=20Check=20Linux=20Package=20Version=20Before=20Installing?= =?UTF-8?q?=20It=20sources/tech/20190617=20How=20To=20Check=20Linux=20Pack?= =?UTF-8?q?age=20Version=20Before=20Installing=20It.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ux Package Version Before Installing It.md | 281 ++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 sources/tech/20190617 How To Check Linux Package Version Before Installing It.md diff --git a/sources/tech/20190617 How To Check Linux Package Version Before Installing It.md b/sources/tech/20190617 How To Check Linux Package Version Before Installing It.md new file mode 100644 index 0000000000..0ce1a510ac --- /dev/null +++ b/sources/tech/20190617 How To Check Linux Package Version Before Installing It.md @@ -0,0 +1,281 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Check Linux Package Version Before Installing It) +[#]: via: (https://www.ostechnix.com/how-to-check-linux-package-version-before-installing-it/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +How To Check Linux Package Version Before Installing It +====== + +![Check Linux Package Version][1] + +Most of you will know how to [**find the version of an installed package**][2] in Linux. But, what would you do to find the packages’ version which are not installed in the first place? No problem! This guide describes how to check Linux package version before installing it in Debian and its derivatives like Ubuntu. This small tip might be helpful for those wondering what version they would get before installing a package. + +### Check Linux Package Version Before Installing It + +There are many ways to find a package’s version even if it is not installed already in DEB-based systems. Here I have given a few methods. + +##### Method 1 – Using Apt + +The quick and dirty way to check a package version, simply run: + +``` +$ apt show +``` + +**Example:** + +``` +$ apt show vim +``` + +**Sample output:** + +``` +Package: vim +Version: 2:8.0.1453-1ubuntu1.1 +Priority: optional +Section: editors +Origin: Ubuntu +Maintainer: Ubuntu Developers <[email protected]> +Original-Maintainer: Debian Vim Maintainers <[email protected]> +Bugs: https://bugs.launchpad.net/ubuntu/+filebug +Installed-Size: 2,852 kB +Provides: editor +Depends: vim-common (= 2:8.0.1453-1ubuntu1.1), vim-runtime (= 2:8.0.1453-1ubuntu1.1), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libgpm2 (>= 1.20.7), libpython3.6 (>= 3.6.5), libselinux1 (>= 1.32), libtinfo5 (>= 6) +Suggests: ctags, vim-doc, vim-scripts +Homepage: https://vim.sourceforge.io/ +Task: cloud-image, server +Supported: 5y +Download-Size: 1,152 kB +APT-Sources: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages +Description: Vi IMproved - enhanced vi editor + Vim is an almost compatible version of the UNIX editor Vi. + . + Many new features have been added: multi level undo, syntax + highlighting, command line history, on-line help, filename + completion, block operations, folding, Unicode support, etc. + . + This package contains a version of vim compiled with a rather + standard set of features. This package does not provide a GUI + version of Vim. See the other vim-* packages if you need more + (or less). + +N: There is 1 additional record. Please use the '-a' switch to see it +``` + +As you can see in the above output, “apt show” command displays, many important details of the package such as, + + 1. package name, + 2. version, + 3. origin (from where the vim comes from), + 4. maintainer, + 5. home page of the package, + 6. dependencies, + 7. download size, + 8. description, + 9. and many. + + + +So, the available version of Vim package in the Ubuntu repositories is **8.0.1453**. This is the version I get if I install it on my Ubuntu system. + +Alternatively, use **“apt policy”** command if you prefer short output: + +``` +$ apt policy vim +vim: + Installed: (none) + Candidate: 2:8.0.1453-1ubuntu1.1 + Version table: + 2:8.0.1453-1ubuntu1.1 500 + 500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages + 500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages + 2:8.0.1453-1ubuntu1 500 + 500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages +``` + +Or even shorter: + +``` +$ apt list vim +Listing... Done +vim/bionic-updates,bionic-security 2:8.0.1453-1ubuntu1.1 amd64 +N: There is 1 additional version. Please use the '-a' switch to see it +``` + +**Apt** is the default package manager in recent Ubuntu versions. So, this command is just enough to find the detailed information of a package. It doesn’t matter whether given package is installed or not. This command will simply list the given package’s version along with all other details. + +##### Method 2 – Using Apt-get + +To find a package version without installing it, we can use **apt-get** command with **-s** option. + +``` +$ apt-get -s install vim +``` + +**Sample output:** + +``` +NOTE: This is only a simulation! + apt-get needs root privileges for real execution. + Keep also in mind that locking is deactivated, + so don't depend on the relevance to the real current situation! +Reading package lists... Done +Building dependency tree +Reading state information... Done +Suggested packages: + ctags vim-doc vim-scripts +The following NEW packages will be installed: + vim +0 upgraded, 1 newly installed, 0 to remove and 45 not upgraded. +Inst vim (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) +Conf vim (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) +``` + +Here, -s option indicates **simulation**. As you can see in the output, It performs no action. Instead, It simply performs a simulation to let you know what is going to happen when you install the Vim package. + +You can substitute “install” option with “upgrade” option to see what will happen when you upgrade a package. + +``` +$ apt-get -s upgrade vim +``` + +##### Method 3 – Using Aptitude + +**Aptitude** is an ncurses and commandline-based front-end to APT package manger in Debian and its derivatives. + +To find the package version with Aptitude, simply run: + +``` +$ aptitude versions vim +p 2:8.0.1453-1ubuntu1 bionic 500 +p 2:8.0.1453-1ubuntu1.1 bionic-security,bionic-updates 500 +``` + +You can also use simulation option ( **-s** ) to see what would happen if you install or upgrade package. + +``` +$ aptitude -V -s install vim +The following NEW packages will be installed: + vim [2:8.0.1453-1ubuntu1.1] +0 packages upgraded, 1 newly installed, 0 to remove and 45 not upgraded. +Need to get 1,152 kB of archives. After unpacking 2,852 kB will be used. +Would download/install/remove packages. +``` + +Here, **-V** flag is used to display detailed information of the package version. + +Similarly, just substitute “install” with “upgrade” option to see what would happen if you upgrade a package. + +``` +$ aptitude -V -s upgrade vim +``` + +Another way to find the non-installed package’s version using Aptitude command is: + +``` +$ aptitude search vim -F "%c %p %d %V" +``` + +Here, + + * **-F** is used to specify which format should be used to display the output, + * **%c** – status of the given package (installed or not installed), + * **%p** – name of the package, + * **%d** – description of the package, + * **%V** – version of the package. + + + +This is helpful when you don’t know the full package name. This command will list all packages that contains the given string (i.e vim). + +Here is the sample output of the above command: + +``` +[...] +p vim Vi IMproved - enhanced vi editor 2:8.0.1453-1ub +p vim-tlib Some vim utility functions 1.23-1 +p vim-ultisnips snippet solution for Vim 3.1-3 +p vim-vimerl Erlang plugin for Vim 1.4.1+git20120 +p vim-vimerl-syntax Erlang syntax for Vim 1.4.1+git20120 +p vim-vimoutliner script for building an outline editor on top of Vim 0.3.4+pristine +p vim-voom Vim two-pane outliner 5.2-1 +p vim-youcompleteme fast, as-you-type, fuzzy-search code completion engine for Vim 0+20161219+git +``` + +##### Method 4 – Using Apt-cache + +**Apt-cache** command is used to query APT cache in Debian-based systems. It is useful for performing many operations on APT’s package cache. One fine example is we can [**list installed applications from a certain repository/ppa**][3]. + +Not just installed applications, we can also find the version of a package even if it is not installed. For instance, the following command will find the version of Vim package: + +``` +$ apt-cache policy vim +``` + +Sample output: + +``` +vim: + Installed: (none) + Candidate: 2:8.0.1453-1ubuntu1.1 + Version table: + 2:8.0.1453-1ubuntu1.1 500 + 500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages + 500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages + 2:8.0.1453-1ubuntu1 500 + 500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages +``` + +As you can see in the above output, Vim is not installed. If you wanted to install it, you would get version **8.0.1453**. It also displays from which repository the vim package is coming from. + +##### Method 5 – Using Apt-show-versions + +**Apt-show-versions** command is used to list installed and available package versions in Debian and Debian-based systems. It also displays the list of all upgradeable packages. It is quite handy if you have a mixed stable/testing environment. For instance, if you have enabled both stable and testing repositories, you can easily find the list of applications from testing and also you can upgrade all packages in testing. + +Apt-show-versions is not installed by default. You need to install it using command: + +``` +$ sudo apt-get install apt-show-versions +``` + +Once installed, run the following command to find the version of a package,for example Vim: + +``` +$ apt-show-versions -a vim +vim:amd64 2:8.0.1453-1ubuntu1 bionic archive.ubuntu.com +vim:amd64 2:8.0.1453-1ubuntu1.1 bionic-security security.ubuntu.com +vim:amd64 2:8.0.1453-1ubuntu1.1 bionic-updates archive.ubuntu.com +vim:amd64 not installed +``` + +Here, **-a** switch prints all available versions of the given package. + +If the given package is already installed, you need not to use **-a** option. In that case, simply run: + +``` +$ apt-show-versions vim +``` + +And, that’s all. If you know any other methods, please share them in the comment section below. I will check and update this guide. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-check-linux-package-version-before-installing-it/ + +作者:[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/2019/06/Check-Linux-Package-Version-720x340.png +[2]: https://www.ostechnix.com/find-package-version-linux/ +[3]: https://www.ostechnix.com/list-installed-packages-certain-repository-linux/ From 571d6cd1e0161c68914648b53f20a85f217d42f3 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 18:37:21 +0800 Subject: [PATCH 0974/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190617=20How?= =?UTF-8?q?=20To=20Find=20Linux=20System=20Details=20Using=20inxi=20source?= =?UTF-8?q?s/tech/20190617=20How=20To=20Find=20Linux=20System=20Details=20?= =?UTF-8?q?Using=20inxi.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...To Find Linux System Details Using inxi.md | 608 ++++++++++++++++++ 1 file changed, 608 insertions(+) create mode 100644 sources/tech/20190617 How To Find Linux System Details Using inxi.md diff --git a/sources/tech/20190617 How To Find Linux System Details Using inxi.md b/sources/tech/20190617 How To Find Linux System Details Using inxi.md new file mode 100644 index 0000000000..0acb049b91 --- /dev/null +++ b/sources/tech/20190617 How To Find Linux System Details Using inxi.md @@ -0,0 +1,608 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Find Linux System Details Using inxi) +[#]: via: (https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +How To Find Linux System Details Using inxi +====== + +![find Linux system details using inxi][1] + +**Inxi** is a free, open source, and full featured command line system information tool. It shows system hardware, CPU, drivers, Xorg, Desktop, Kernel, GCC version(s), Processes, RAM usage, and a wide variety of other useful information. Be it a hard disk or CPU, mother board or the complete detail of the entire system, inxi will display it more accurately in seconds. Since it is CLI tool, you can use it in Desktop or server edition. Inxi is available in the default repositories of most Linux distributions and some BSD systems. + +### Install inxi + +**On Arch Linux and derivatives:** + +To install inxi in Arch Linux or its derivatives like Antergos, and Manajaro Linux, run: + +``` +$ sudo pacman -S inxi +``` + +Just in case if Inxi is not available in the default repositories, try to install it from AUR (It varies year to year) using any AUR helper programs. + +Using [**Yay**][2]: + +``` +$ yay -S inxi +``` + +**On Debian / Ubuntu and derivatives:** + +``` +$ sudo apt-get install inxi +``` + +**On Fedora / RHEL / CentOS / Scientific Linux:** + +inxi is available in the Fedora default repositories. So, just run the following command to install it straight away. + +``` +$ sudo dnf install inxi +``` + +In RHEL and its clones like CentOS and Scientific Linux, you need to add the EPEL repository and then install inxi. + +To install EPEL repository, just run: + +``` +$ sudo yum install epel-release +``` + +After installing EPEL repository, install inxi using command: + +``` +$ sudo yum install inxi +``` + +**On SUSE/openSUSE:** + +``` +$ sudo zypper install inxi +``` + +### Find Linux System Details Using inxi + +inxi will require some additional programs to operate properly. They will be installed along with inxi. However, in case if they are not installed automatically, you need to find and install them. + +To list all required programs, run: + +``` +$ inxi --recommends +``` + +If you see any missing programs, then install them before start using inxi. + +Now, let us see how to use it to reveal the Linux system details. inxi usage is pretty simple and straight forward. + +Open up your Terminal and run the following command to print a short summary of CPU, memory, hard drive and kernel information: + +``` +$ inxi +``` + +**Sample output:** + +``` +CPU: Dual Core Intel Core i3-2350M (-MT MCP-) speed/min/max: 798/800/2300 MHz +Kernel: 5.1.2-arch1-1-ARCH x86_64 Up: 1h 31m Mem: 2800.5/7884.2 MiB (35.5%) +Storage: 465.76 GiB (80.8% used) Procs: 163 Shell: bash 5.0.7 inxi: 3.0.34 +``` + +[![Find Linux System Details Using inxi][1]][3] + +Find Linux System Details Using inxi + +As you can see, Inxi displays the following details of my Arch Linux desktop: + + 1. CPU type, + 2. CPU speed, + 3. Kernel details, + 4. Uptime, + 5. Memory details (Total and used memory), + 6. Hard disk size along with current usage, + 7. Procs, + 8. Default shell details, + 9. Inxi version. + + + +To display full summary, use **“-F”** switch as shown below. + +``` +$ inxi -F +``` + +**Sample output:** + +``` +System: Host: sk Kernel: 5.1.2-arch1-1-ARCH x86_64 bits: 64 Desktop: Deepin 15.10.1 Distro: Arch Linux +Machine: Type: Portable System: Dell product: Inspiron N5050 v: N/A serial: + Mobo: Dell model: 01HXXJ v: A05 serial: BIOS: Dell v: A05 date: 08/03/2012 +Battery: ID-1: BAT0 charge: 39.0 Wh condition: 39.0/48.8 Wh (80%) +CPU: Topology: Dual Core model: Intel Core i3-2350M bits: 64 type: MT MCP L2 cache: 3072 KiB + Speed: 798 MHz min/max: 800/2300 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798 +Graphics: Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel + Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: vesa resolution: 1366x768~60Hz + Message: Unable to show advanced data. Required tool glxinfo missing. +Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel + Sound Server: ALSA v: k5.1.2-arch1-1-ARCH +Network: Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 + IF: enp5s0 state: down mac: 45:c8:gh:89:b6:45 + Device-2: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k + IF: wlp9s0 state: up mac: c3:11:96:22:87:3g + Device-3: Qualcomm Atheros AR3011 Bluetooth type: USB driver: btusb +Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) + ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB +Partition: ID-1: / size: 456.26 GiB used: 376.25 GiB (82.5%) fs: ext4 dev: /dev/sda2 + ID-2: /boot size: 92.8 MiB used: 62.9 MiB (67.7%) fs: ext4 dev: /dev/sda1 + ID-3: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 +Sensors: System Temperatures: cpu: 58.0 C mobo: N/A + Fan Speeds (RPM): cpu: 3445 +Info: Processes: 169 Uptime: 1h 38m Memory: 7.70 GiB used: 2.94 GiB (38.2%) Shell: bash inxi: 3.0.34 +``` + +Inxi used on IRC automatically filters out your network device MAC address, WAN and LAN IP, your /home username directory in partitions, and a few other items in order to maintain basic privacy and security. You can also trigger this filtering with the **-z** option like below. + +``` +$ inxi -Fz +``` + +To override the IRC filter, use the **-Z** option. + +``` +$ inxi -FZ +``` + +This can be useful in debugging network connection issues online in a private chat, for example. Please be very careful while using -Z option. It will display your MAC addresses. You shouldn’t share the results got with -Z option in public forums. + +##### Displaying device-specific details + +When running inxi without any options, you will get basic details of your system, such as CPU, Memory, Kernel, Uptime, harddisk etc. + +You can, of course, narrow down the result to show specific device details using various options. Inxi has numerous options (both uppercase and lowercase). + +First, we will see example commands for all uppercase options in alphabetical order. Some commands may require root/sudo privileges to get actual data. + +####### **Uppercase options** + +**1\. Display Audio/Sound card details** + +To show your audio and sound card(s) information with sound card driver, use **-A** option. + +``` +$ inxi -A +Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel + Sound Server: ALSA v: k5.1.2-arch1-1-ARCH +``` + +**2\. Display Battery details** + +To show battery details of your system with current charge and condition, use **-B** option. + +``` +$ inxi -B +Battery: ID-1: BAT0 charge: 39.0 Wh condition: 39.0/48.8 Wh (80%) +``` + +**3\. Display CPU details** + +To show complete CPU details including no of cores, CPU model, CPU cache, CPU clock speed, CPU min/max speed etc., use **-C** option. + +``` +$ inxi -C +CPU: Topology: Dual Core model: Intel Core i3-2350M bits: 64 type: MT MCP L2 cache: 3072 KiB + Speed: 798 MHz min/max: 800/2300 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798 +``` + +**4\. Display hard disk details** + +To show information about your hard drive, such as Disk type, vendor, device ID, model, disk size, total disk space, used percentage etc., use **-D** option. + +``` +$ inxi -D +Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) + ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB +``` + +**5\. Disply Graphics details** + +To show details about the graphics card, including details of grahics card, driver, vendor, display server, resolution etc., use **-G** option. + +``` +$ inxi -G +Graphics: Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel + Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: vesa resolution: 1366x768~60Hz + Message: Unable to show advanced data. Required tool glxinfo missing. +``` + +**6\. Display details about processes, uptime, memory, inxi version** + +To show information about no of processes, total uptime, total memory with used memory, Shell details and inxi version etc., use **-I** option. + +``` +$ inxi -I +Info: Processes: 170 Uptime: 5h 47m Memory: 7.70 GiB used: 3.27 GiB (42.4%) Shell: bash inxi: 3.0.34 +``` + +**7\. Display Motherboard details** + +To show information about your machine details, manufacturer, motherboard, BIOS, use **-M** option. + +``` +$ inxi -M +Machine: Type: Portable System: Dell product: Inspiron N5050 v: N/A serial: + Mobo: Dell model: 034ygt v: A018 serial: BIOS: Dell v: A001 date: 09/04/2015 +``` + +**8\. Display network card details** + +To show information about your network card, including vendor, card driver and no of network interfaces etc., use **-N** option. + +``` +$ inxi -N +Network: Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 + Device-2: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k + Device-3: Qualcomm Atheros AR3011 Bluetooth type: USB driver: btusb +``` + +If you want to show the advanced details of the network cards, such as MAC address, speed and state of nic, use **-n** option. + +``` +$ inxi -n +``` + +Please careful sharing this details on public forum. + +**9\. Display Partition details** + +To display basic partition information, use **-P** option. + +``` +$ inxi -P +Partition: ID-1: / size: 456.26 GiB used: 376.25 GiB (82.5%) fs: ext4 dev: /dev/sda2 + ID-2: /boot size: 92.8 MiB used: 62.9 MiB (67.7%) fs: ext4 dev: /dev/sda1 + ID-3: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 +``` + +To show full partition information including mount points, use **-p** option. + +``` +$ inxi -p +``` + +**10\. Display RAID details** + +To show RAID info, use **-R** option. + +``` +$ inxi -R +``` + +**11\. Display system details** + +To show Linux system information such as hostname, kernel, DE, OS version etc., use **-S** option. + +``` +$ inxi -S +System: Host: sk Kernel: 5.1.2-arch1-1-ARCH x86_64 bits: 64 Desktop: Deepin 15.10.1 Distro: Arch Linux +``` + +**12\. Displaying weather details** + +Inixi is not just for finding hardware details. It is useful for getting other stuffs too. + +For example, you can display the weather details of a given location. To do so, run inxi with **-W** option like below. + +``` +$ inxi -W 95623,us +Weather: Temperature: 21.1 C (70 F) Conditions: Scattered clouds Current Time: Tue 11 Jun 2019 04:34:35 AM PDT + Source: WeatherBit.io +``` + +Please note that you should use only ASCII letters in city/state/country names to get valid results. + +####### Lowercase options + +**1\. Display basic system details** + +To show only the basic summary of your system details, use **-b** option. + +``` +$ inxi -b +``` + +Alternatively, you can use this command: + +Both servers the same purpose. + +``` +$ inxi -v 2 +``` + +**2\. Set color scheme** + +We can set different color schemes for inxi output using **-c** option. Yu can set color scheme number from **0** to **42**. If no scheme number is supplied, **0** is assumed. + +Here is inxi output with and without **-c** option. + +[![inxi output without color scheme][1]][4] + +inxi output without color scheme + +As you can see, when we run inxi with -c option, the color scheme is disabled. The -c option is useful to turnoff colored output when redirecting clean output without escape codes to a text file. + +Similarly, we can use other color scheme values. + +``` +$ inxi -c10 + +$ inxi -c42 +``` + +**3\. Display optical drive details** + +We can show the optical drive data details along with local hard drive details using **-d** option. + +``` +$ inxi -d +Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) + ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB + Optical-1: /dev/sr0 vendor: PLDS model: DVD+-RW DS-8A8SH dev-links: cdrom + Features: speed: 24 multisession: yes audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram +``` + +**4\. Display all CPU flags** + +To show all CPU flags used, run: + +``` +$ inxi -f +``` + +**5\. Display IP details** + +To show WAN and local ip address along network card details such as device vendor, driver, mac, state etc., use **-i** option. + +``` +$ inxi -i +``` + +**6\. Display partition labels** + +If you have set labels for the partitions, you can view them using **-l** option. + +``` +$ inxi -l +``` + +You can also view the labels of all partitions along with mountpoints using command: + +``` +$ inxi -pl +``` + +**7\. Display Memory details** + +We can display memory details such as total size of installed RAM, how much memory is used, no of available DIMM slots, total size of supported RAM, how much RAM is currently installed in each slots etc., using **-m** option. + +``` +$ sudo inxi -m +[sudo] password for sk: +Memory: RAM: total: 7.70 GiB used: 2.26 GiB (29.3%) + Array-1: capacity: 16 GiB slots: 2 EC: None + Device-1: DIMM_A size: 4 GiB speed: 1067 MT/s + Device-2: DIMM_B size: 4 GiB speed: 1067 MT/s +``` + +**8\. Display unmounted partition details** + +To show unmounted partition details, use **-o** option. + +``` +$ inxi -o +``` + +If there were no unmounted partitions in your system, you will see an output something like below. + +``` +Unmounted: Message: No unmounted partitions found. +``` + +**9\. Display list of repositories** + +To display the the list of repositories in your system, use **-r** option. + +``` +$ inxi -r +``` + +**Sample output:** + +``` +Repos: Active apt sources in file: /etc/apt/sources.list +deb http://in.archive.ubuntu.com/ubuntu/ xenial main restricted +deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted +deb http://in.archive.ubuntu.com/ubuntu/ xenial universe +deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe +deb http://in.archive.ubuntu.com/ubuntu/ xenial multiverse +deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse +deb http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse +deb http://security.ubuntu.com/ubuntu xenial-security main restricted +deb http://security.ubuntu.com/ubuntu xenial-security universe +deb http://security.ubuntu.com/ubuntu xenial-security multiverse +``` + +* * * + +**Suggested read:** + + * [**How To Find The List Of Installed Repositories From Commandline In Linux**][5] + + + +* * * + +**10\. Show system temperature, fan speed details** + +Inxi is capable to find motherboard/CPU/GPU temperatures and fan speed. + +``` +$ inxi -s +Sensors: System Temperatures: cpu: 60.0 C mobo: N/A + Fan Speeds (RPM): cpu: 3456 +``` + +Please note that Inxi requires sensors to find the system temperature. Make sure **lm_sensors** is installed and correctly configured in your system. For more details about lm_sensors, check the following guide. + + * [**How To View CPU Temperature On Linux**][6] + + + +**11\. Display details about processes** + +To show the list processes top 5 processes which are consuming most CPU and Memory, simply run: + +``` +$ inxi -t +Processes: CPU top: 5 + 1: cpu: 14.3% command: firefox pid: 15989 + 2: cpu: 10.5% command: firefox pid: 13487 + 3: cpu: 7.1% command: firefox pid: 15062 + 4: cpu: 3.1% command: xorg pid: 13493 + 5: cpu: 3.0% command: firefox pid: 14954 + System RAM: total: 7.70 GiB used: 2.99 GiB (38.8%) + Memory top: 5 + 1: mem: 1115.8 MiB (14.1%) command: firefox pid: 15989 + 2: mem: 606.6 MiB (7.6%) command: firefox pid: 13487 + 3: mem: 339.3 MiB (4.3%) command: firefox pid: 13630 + 4: mem: 303.1 MiB (3.8%) command: firefox pid: 18617 + 5: mem: 260.1 MiB (3.2%) command: firefox pid: 15062 +``` + +We can also sort this output by either CPU usage or Memory usage. + +For instance, to find the which top 5 processes are consuming most memory, use the following command: + +``` +$ inxi -t m +Processes: System RAM: total: 7.70 GiB used: 2.73 GiB (35.4%) + Memory top: 5 + 1: mem: 966.1 MiB (12.2%) command: firefox pid: 15989 + 2: mem: 468.2 MiB (5.9%) command: firefox pid: 13487 + 3: mem: 347.9 MiB (4.4%) command: firefox pid: 13708 + 4: mem: 306.7 MiB (3.8%) command: firefox pid: 13630 + 5: mem: 247.2 MiB (3.1%) command: firefox pid: 15062 +``` + +To sort the top 5 processes based on CPU usage, run: + +``` +$ inxi -t c +Processes: CPU top: 5 + 1: cpu: 14.9% command: firefox pid: 15989 + 2: cpu: 10.6% command: firefox pid: 13487 + 3: cpu: 7.0% command: firefox pid: 15062 + 4: cpu: 3.1% command: xorg pid: 13493 + 5: cpu: 2.9% command: firefox pid: 14954 +``` + +Bydefault, Inxi will display the top 5 processes. You can change the number of processes, for example 10, like below. + +``` +$ inxi -t cm10 +Processes: CPU top: 10 + 1: cpu: 14.9% command: firefox pid: 15989 + 2: cpu: 10.6% command: firefox pid: 13487 + 3: cpu: 7.0% command: firefox pid: 15062 + 4: cpu: 3.1% command: xorg pid: 13493 + 5: cpu: 2.9% command: firefox pid: 14954 + 6: cpu: 2.8% command: firefox pid: 13630 + 7: cpu: 1.8% command: firefox pid: 18325 + 8: cpu: 1.4% command: firefox pid: 18617 + 9: cpu: 1.3% command: firefox pid: 13708 + 10: cpu: 0.8% command: firefox pid: 14427 + System RAM: total: 7.70 GiB used: 2.92 GiB (37.9%) + Memory top: 10 + 1: mem: 1160.9 MiB (14.7%) command: firefox pid: 15989 + 2: mem: 475.1 MiB (6.0%) command: firefox pid: 13487 + 3: mem: 353.4 MiB (4.4%) command: firefox pid: 13708 + 4: mem: 308.0 MiB (3.9%) command: firefox pid: 13630 + 5: mem: 269.6 MiB (3.4%) command: firefox pid: 15062 + 6: mem: 249.3 MiB (3.1%) command: firefox pid: 14427 + 7: mem: 238.5 MiB (3.0%) command: firefox pid: 14954 + 8: mem: 208.2 MiB (2.6%) command: firefox pid: 18325 + 9: mem: 194.0 MiB (2.4%) command: firefox pid: 18617 + 10: mem: 143.6 MiB (1.8%) command: firefox pid: 23960 +``` + +The above command will display the top 10 processes that consumes the most CPU and Memory. + +To display only top10 based on memory usage, run: + +``` +$ inxi -t m10 +``` + +**12\. Display partition UUID details** + +To show partition UUIDs ( **U** niversally **U** nique **Id** entifier), use **-u** option. + +``` +$ inxi -u +``` + +There are much more options are yet to be covered. But, these are just enough to get almost all details of your Linux box. + +For more details and options, refer the man page. + +``` +$ man inxi +``` + +* * * + +**Related read:** + + * **[Neofetch – Display your Linux system’s information][7]** + + + +* * * + +The primary purpose of Inxi tool is to use in IRC or forum support. If you are looking for any help via a forum or website where someone is asking the specification of your system, just run this command, and copy/paste the output. + +**Resources:** + + * [**Inxi GitHub Repository**][8] + * [**Inxi home page**][9] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/ + +作者:[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]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[3]: http://www.ostechnix.com/wp-content/uploads/2016/08/Find-Linux-System-Details-Using-inxi.png +[4]: http://www.ostechnix.com/wp-content/uploads/2016/08/inxi-output-without-color-scheme.png +[5]: https://www.ostechnix.com/find-list-installed-repositories-commandline-linux/ +[6]: https://www.ostechnix.com/view-cpu-temperature-linux/ +[7]: http://www.ostechnix.com/neofetch-display-linux-systems-information/ +[8]: https://github.com/smxi/inxi +[9]: http://smxi.org/docs/inxi.htm From 0b51c7a72336e12021afbad0e01dff5a788c7bd6 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 18:43:00 +0800 Subject: [PATCH 0975/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190611=20How?= =?UTF-8?q?=20To=20Find=20Linux=20System=20Details=20Using=20inxi=20source?= =?UTF-8?q?s/tech/20190611=20How=20To=20Find=20Linux=20System=20Details=20?= =?UTF-8?q?Using=20inxi.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...To Find Linux System Details Using inxi.md | 608 ++++++++++++++++++ 1 file changed, 608 insertions(+) create mode 100644 sources/tech/20190611 How To Find Linux System Details Using inxi.md diff --git a/sources/tech/20190611 How To Find Linux System Details Using inxi.md b/sources/tech/20190611 How To Find Linux System Details Using inxi.md new file mode 100644 index 0000000000..4fc24fd137 --- /dev/null +++ b/sources/tech/20190611 How To Find Linux System Details Using inxi.md @@ -0,0 +1,608 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Find Linux System Details Using inxi) +[#]: via: (https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +How To Find Linux System Details Using inxi +====== + +![find Linux system details using inxi][1] + +**Inxi** is a free, open source, and full featured command line system information tool. It shows system hardware, CPU, drivers, Xorg, Desktop, Kernel, GCC version(s), Processes, RAM usage, and a wide variety of other useful information. Be it a hard disk or CPU, mother board or the complete detail of the entire system, inxi will display it more accurately in seconds. Since it is CLI tool, you can use it in Desktop or server edition. Inxi is available in the default repositories of most Linux distributions and some BSD systems. + +### Install inxi + +**On Arch Linux and derivatives:** + +To install inxi in Arch Linux or its derivatives like Antergos, and Manajaro Linux, run: + +``` +$ sudo pacman -S inxi +``` + +Just in case if Inxi is not available in the default repositories, try to install it from AUR (It varies year to year) using any AUR helper programs. + +Using [**Yay**][2]: + +``` +$ yay -S inxi +``` + +**On Debian / Ubuntu and derivatives:** + +``` +$ sudo apt-get install inxi +``` + +**On Fedora / RHEL / CentOS / Scientific Linux:** + +inxi is available in the Fedora default repositories. So, just run the following command to install it straight away. + +``` +$ sudo dnf install inxi +``` + +In RHEL and its clones like CentOS and Scientific Linux, you need to add the EPEL repository and then install inxi. + +To install EPEL repository, just run: + +``` +$ sudo yum install epel-release +``` + +After installing EPEL repository, install inxi using command: + +``` +$ sudo yum install inxi +``` + +**On SUSE/openSUSE:** + +``` +$ sudo zypper install inxi +``` + +### Find Linux System Details Using inxi + +inxi will require some additional programs to operate properly. They will be installed along with inxi. However, in case if they are not installed automatically, you need to find and install them. + +To list all required programs, run: + +``` +$ inxi --recommends +``` + +If you see any missing programs, then install them before start using inxi. + +Now, let us see how to use it to reveal the Linux system details. inxi usage is pretty simple and straight forward. + +Open up your Terminal and run the following command to print a short summary of CPU, memory, hard drive and kernel information: + +``` +$ inxi +``` + +**Sample output:** + +``` +CPU: Dual Core Intel Core i3-2350M (-MT MCP-) speed/min/max: 798/800/2300 MHz +Kernel: 5.1.2-arch1-1-ARCH x86_64 Up: 1h 31m Mem: 2800.5/7884.2 MiB (35.5%) +Storage: 465.76 GiB (80.8% used) Procs: 163 Shell: bash 5.0.7 inxi: 3.0.34 +``` + +![][3] + +Find Linux System Details Using inxi + +As you can see, Inxi displays the following details of my Arch Linux desktop: + + 1. CPU type, + 2. CPU speed, + 3. Kernel details, + 4. Uptime, + 5. Memory details (Total and used memory), + 6. Hard disk size along with current usage, + 7. Procs, + 8. Default shell details, + 9. Inxi version. + + + +To display full summary, use **“-F”** switch as shown below. + +``` +$ inxi -F +``` + +**Sample output:** + +``` +System: Host: sk Kernel: 5.1.2-arch1-1-ARCH x86_64 bits: 64 Desktop: Deepin 15.10.1 Distro: Arch Linux +Machine: Type: Portable System: Dell product: Inspiron N5050 v: N/A serial: + Mobo: Dell model: 01HXXJ v: A05 serial: BIOS: Dell v: A05 date: 08/03/2012 +Battery: ID-1: BAT0 charge: 39.0 Wh condition: 39.0/48.8 Wh (80%) +CPU: Topology: Dual Core model: Intel Core i3-2350M bits: 64 type: MT MCP L2 cache: 3072 KiB + Speed: 798 MHz min/max: 800/2300 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798 +Graphics: Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel + Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: vesa resolution: 1366x768~60Hz + Message: Unable to show advanced data. Required tool glxinfo missing. +Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel + Sound Server: ALSA v: k5.1.2-arch1-1-ARCH +Network: Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 + IF: enp5s0 state: down mac: 45:c8:gh:89:b6:45 + Device-2: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k + IF: wlp9s0 state: up mac: c3:11:96:22:87:3g + Device-3: Qualcomm Atheros AR3011 Bluetooth type: USB driver: btusb +Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) + ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB +Partition: ID-1: / size: 456.26 GiB used: 376.25 GiB (82.5%) fs: ext4 dev: /dev/sda2 + ID-2: /boot size: 92.8 MiB used: 62.9 MiB (67.7%) fs: ext4 dev: /dev/sda1 + ID-3: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 +Sensors: System Temperatures: cpu: 58.0 C mobo: N/A + Fan Speeds (RPM): cpu: 3445 +Info: Processes: 169 Uptime: 1h 38m Memory: 7.70 GiB used: 2.94 GiB (38.2%) Shell: bash inxi: 3.0.34 +``` + +Inxi used on IRC automatically filters out your network device MAC address, WAN and LAN IP, your /home username directory in partitions, and a few other items in order to maintain basic privacy and security. You can also trigger this filtering with the **-z** option like below. + +``` +$ inxi -Fz +``` + +To override the IRC filter, use the **-Z** option. + +``` +$ inxi -FZ +``` + +This can be useful in debugging network connection issues online in a private chat, for example. Please be very careful while using -Z option. It will display your MAC addresses. You shouldn’t share the results got with -Z option in public forums. + +##### Displaying device-specific details + +When running inxi without any options, you will get basic details of your system, such as CPU, Memory, Kernel, Uptime, harddisk etc. + +You can, of course, narrow down the result to show specific device details using various options. Inxi has numerous options (both uppercase and lowercase). + +First, we will see example commands for all uppercase options in alphabetical order. Some commands may require root/sudo privileges to get actual data. + +####### **Uppercase options** + +**1\. Display Audio/Sound card details** + +To show your audio and sound card(s) information with sound card driver, use **-A** option. + +``` +$ inxi -A +Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel + Sound Server: ALSA v: k5.1.2-arch1-1-ARCH +``` + +**2\. Display Battery details** + +To show battery details of your system with current charge and condition, use **-B** option. + +``` +$ inxi -B +Battery: ID-1: BAT0 charge: 39.0 Wh condition: 39.0/48.8 Wh (80%) +``` + +**3\. Display CPU details** + +To show complete CPU details including no of cores, CPU model, CPU cache, CPU clock speed, CPU min/max speed etc., use **-C** option. + +``` +$ inxi -C +CPU: Topology: Dual Core model: Intel Core i3-2350M bits: 64 type: MT MCP L2 cache: 3072 KiB + Speed: 798 MHz min/max: 800/2300 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798 +``` + +**4\. Display hard disk details** + +To show information about your hard drive, such as Disk type, vendor, device ID, model, disk size, total disk space, used percentage etc., use **-D** option. + +``` +$ inxi -D +Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) + ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB +``` + +**5\. Disply Graphics details** + +To show details about the graphics card, including details of grahics card, driver, vendor, display server, resolution etc., use **-G** option. + +``` +$ inxi -G +Graphics: Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel + Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: vesa resolution: 1366x768~60Hz + Message: Unable to show advanced data. Required tool glxinfo missing. +``` + +**6\. Display details about processes, uptime, memory, inxi version** + +To show information about no of processes, total uptime, total memory with used memory, Shell details and inxi version etc., use **-I** option. + +``` +$ inxi -I +Info: Processes: 170 Uptime: 5h 47m Memory: 7.70 GiB used: 3.27 GiB (42.4%) Shell: bash inxi: 3.0.34 +``` + +**7\. Display Motherboard details** + +To show information about your machine details, manufacturer, motherboard, BIOS, use **-M** option. + +``` +$ inxi -M +Machine: Type: Portable System: Dell product: Inspiron N5050 v: N/A serial: + Mobo: Dell model: 034ygt v: A018 serial: BIOS: Dell v: A001 date: 09/04/2015 +``` + +**8\. Display network card details** + +To show information about your network card, including vendor, card driver and no of network interfaces etc., use **-N** option. + +``` +$ inxi -N +Network: Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 + Device-2: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k + Device-3: Qualcomm Atheros AR3011 Bluetooth type: USB driver: btusb +``` + +If you want to show the advanced details of the network cards, such as MAC address, speed and state of nic, use **-n** option. + +``` +$ inxi -n +``` + +Please careful sharing this details on public forum. + +**9\. Display Partition details** + +To display basic partition information, use **-P** option. + +``` +$ inxi -P +Partition: ID-1: / size: 456.26 GiB used: 376.25 GiB (82.5%) fs: ext4 dev: /dev/sda2 + ID-2: /boot size: 92.8 MiB used: 62.9 MiB (67.7%) fs: ext4 dev: /dev/sda1 + ID-3: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 +``` + +To show full partition information including mount points, use **-p** option. + +``` +$ inxi -p +``` + +**10\. Display RAID details** + +To show RAID info, use **-R** option. + +``` +$ inxi -R +``` + +**11\. Display system details** + +To show Linux system information such as hostname, kernel, DE, OS version etc., use **-S** option. + +``` +$ inxi -S +System: Host: sk Kernel: 5.1.2-arch1-1-ARCH x86_64 bits: 64 Desktop: Deepin 15.10.1 Distro: Arch Linux +``` + +**12\. Displaying weather details** + +Inixi is not just for finding hardware details. It is useful for getting other stuffs too. + +For example, you can display the weather details of a given location. To do so, run inxi with **-W** option like below. + +``` +$ inxi -W 95623,us +Weather: Temperature: 21.1 C (70 F) Conditions: Scattered clouds Current Time: Tue 11 Jun 2019 04:34:35 AM PDT + Source: WeatherBit.io +``` + +Please note that you should use only ASCII letters in city/state/country names to get valid results. + +####### Lowercase options + +**1\. Display basic system details** + +To show only the basic summary of your system details, use **-b** option. + +``` +$ inxi -b +``` + +Alternatively, you can use this command: + +Both servers the same purpose. + +``` +$ inxi -v 2 +``` + +**2\. Set color scheme** + +We can set different color schemes for inxi output using **-c** option. Yu can set color scheme number from **0** to **42**. If no scheme number is supplied, **0** is assumed. + +Here is inxi output with and without **-c** option. + +![][4] + +inxi output without color scheme + +As you can see, when we run inxi with -c option, the color scheme is disabled. The -c option is useful to turnoff colored output when redirecting clean output without escape codes to a text file. + +Similarly, we can use other color scheme values. + +``` +$ inxi -c10 + +$ inxi -c42 +``` + +**3\. Display optical drive details** + +We can show the optical drive data details along with local hard drive details using **-d** option. + +``` +$ inxi -d +Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) + ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB + Optical-1: /dev/sr0 vendor: PLDS model: DVD+-RW DS-8A8SH dev-links: cdrom + Features: speed: 24 multisession: yes audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram +``` + +**4\. Display all CPU flags** + +To show all CPU flags used, run: + +``` +$ inxi -f +``` + +**5\. Display IP details** + +To show WAN and local ip address along network card details such as device vendor, driver, mac, state etc., use **-i** option. + +``` +$ inxi -i +``` + +**6\. Display partition labels** + +If you have set labels for the partitions, you can view them using **-l** option. + +``` +$ inxi -l +``` + +You can also view the labels of all partitions along with mountpoints using command: + +``` +$ inxi -pl +``` + +**7\. Display Memory details** + +We can display memory details such as total size of installed RAM, how much memory is used, no of available DIMM slots, total size of supported RAM, how much RAM is currently installed in each slots etc., using **-m** option. + +``` +$ sudo inxi -m +[sudo] password for sk: +Memory: RAM: total: 7.70 GiB used: 2.26 GiB (29.3%) + Array-1: capacity: 16 GiB slots: 2 EC: None + Device-1: DIMM_A size: 4 GiB speed: 1067 MT/s + Device-2: DIMM_B size: 4 GiB speed: 1067 MT/s +``` + +**8\. Display unmounted partition details** + +To show unmounted partition details, use **-o** option. + +``` +$ inxi -o +``` + +If there were no unmounted partitions in your system, you will see an output something like below. + +``` +Unmounted: Message: No unmounted partitions found. +``` + +**9\. Display list of repositories** + +To display the the list of repositories in your system, use **-r** option. + +``` +$ inxi -r +``` + +**Sample output:** + +``` +Repos: Active apt sources in file: /etc/apt/sources.list +deb http://in.archive.ubuntu.com/ubuntu/ xenial main restricted +deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted +deb http://in.archive.ubuntu.com/ubuntu/ xenial universe +deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe +deb http://in.archive.ubuntu.com/ubuntu/ xenial multiverse +deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse +deb http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse +deb http://security.ubuntu.com/ubuntu xenial-security main restricted +deb http://security.ubuntu.com/ubuntu xenial-security universe +deb http://security.ubuntu.com/ubuntu xenial-security multiverse +``` + +* * * + +**Suggested read:** + + * [**How To Find The List Of Installed Repositories From Commandline In Linux**][5] + + + +* * * + +**10\. Show system temperature, fan speed details** + +Inxi is capable to find motherboard/CPU/GPU temperatures and fan speed. + +``` +$ inxi -s +Sensors: System Temperatures: cpu: 60.0 C mobo: N/A + Fan Speeds (RPM): cpu: 3456 +``` + +Please note that Inxi requires sensors to find the system temperature. Make sure **lm_sensors** is installed and correctly configured in your system. For more details about lm_sensors, check the following guide. + + * [**How To View CPU Temperature On Linux**][6] + + + +**11\. Display details about processes** + +To show the list processes top 5 processes which are consuming most CPU and Memory, simply run: + +``` +$ inxi -t +Processes: CPU top: 5 + 1: cpu: 14.3% command: firefox pid: 15989 + 2: cpu: 10.5% command: firefox pid: 13487 + 3: cpu: 7.1% command: firefox pid: 15062 + 4: cpu: 3.1% command: xorg pid: 13493 + 5: cpu: 3.0% command: firefox pid: 14954 + System RAM: total: 7.70 GiB used: 2.99 GiB (38.8%) + Memory top: 5 + 1: mem: 1115.8 MiB (14.1%) command: firefox pid: 15989 + 2: mem: 606.6 MiB (7.6%) command: firefox pid: 13487 + 3: mem: 339.3 MiB (4.3%) command: firefox pid: 13630 + 4: mem: 303.1 MiB (3.8%) command: firefox pid: 18617 + 5: mem: 260.1 MiB (3.2%) command: firefox pid: 15062 +``` + +We can also sort this output by either CPU usage or Memory usage. + +For instance, to find the which top 5 processes are consuming most memory, use the following command: + +``` +$ inxi -t m +Processes: System RAM: total: 7.70 GiB used: 2.73 GiB (35.4%) + Memory top: 5 + 1: mem: 966.1 MiB (12.2%) command: firefox pid: 15989 + 2: mem: 468.2 MiB (5.9%) command: firefox pid: 13487 + 3: mem: 347.9 MiB (4.4%) command: firefox pid: 13708 + 4: mem: 306.7 MiB (3.8%) command: firefox pid: 13630 + 5: mem: 247.2 MiB (3.1%) command: firefox pid: 15062 +``` + +To sort the top 5 processes based on CPU usage, run: + +``` +$ inxi -t c +Processes: CPU top: 5 + 1: cpu: 14.9% command: firefox pid: 15989 + 2: cpu: 10.6% command: firefox pid: 13487 + 3: cpu: 7.0% command: firefox pid: 15062 + 4: cpu: 3.1% command: xorg pid: 13493 + 5: cpu: 2.9% command: firefox pid: 14954 +``` + +Bydefault, Inxi will display the top 5 processes. You can change the number of processes, for example 10, like below. + +``` +$ inxi -t cm10 +Processes: CPU top: 10 + 1: cpu: 14.9% command: firefox pid: 15989 + 2: cpu: 10.6% command: firefox pid: 13487 + 3: cpu: 7.0% command: firefox pid: 15062 + 4: cpu: 3.1% command: xorg pid: 13493 + 5: cpu: 2.9% command: firefox pid: 14954 + 6: cpu: 2.8% command: firefox pid: 13630 + 7: cpu: 1.8% command: firefox pid: 18325 + 8: cpu: 1.4% command: firefox pid: 18617 + 9: cpu: 1.3% command: firefox pid: 13708 + 10: cpu: 0.8% command: firefox pid: 14427 + System RAM: total: 7.70 GiB used: 2.92 GiB (37.9%) + Memory top: 10 + 1: mem: 1160.9 MiB (14.7%) command: firefox pid: 15989 + 2: mem: 475.1 MiB (6.0%) command: firefox pid: 13487 + 3: mem: 353.4 MiB (4.4%) command: firefox pid: 13708 + 4: mem: 308.0 MiB (3.9%) command: firefox pid: 13630 + 5: mem: 269.6 MiB (3.4%) command: firefox pid: 15062 + 6: mem: 249.3 MiB (3.1%) command: firefox pid: 14427 + 7: mem: 238.5 MiB (3.0%) command: firefox pid: 14954 + 8: mem: 208.2 MiB (2.6%) command: firefox pid: 18325 + 9: mem: 194.0 MiB (2.4%) command: firefox pid: 18617 + 10: mem: 143.6 MiB (1.8%) command: firefox pid: 23960 +``` + +The above command will display the top 10 processes that consumes the most CPU and Memory. + +To display only top10 based on memory usage, run: + +``` +$ inxi -t m10 +``` + +**12\. Display partition UUID details** + +To show partition UUIDs ( **U** niversally **U** nique **Id** entifier), use **-u** option. + +``` +$ inxi -u +``` + +There are much more options are yet to be covered. But, these are just enough to get almost all details of your Linux box. + +For more details and options, refer the man page. + +``` +$ man inxi +``` + +* * * + +**Related read:** + + * **[Neofetch – Display your Linux system’s information][7]** + + + +* * * + +The primary purpose of Inxi tool is to use in IRC or forum support. If you are looking for any help via a forum or website where someone is asking the specification of your system, just run this command, and copy/paste the output. + +**Resources:** + + * [**Inxi GitHub Repository**][8] + * [**Inxi home page**][9] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/ + +作者:[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/2016/08/inxi-520x245-1-720x340.png +[2]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[3]: http://www.ostechnix.com/wp-content/uploads/2016/08/Find-Linux-System-Details-Using-inxi.png +[4]: http://www.ostechnix.com/wp-content/uploads/2016/08/inxi-output-without-color-scheme.png +[5]: https://www.ostechnix.com/find-list-installed-repositories-commandline-linux/ +[6]: https://www.ostechnix.com/view-cpu-temperature-linux/ +[7]: http://www.ostechnix.com/neofetch-display-linux-systems-information/ +[8]: https://github.com/smxi/inxi +[9]: http://smxi.org/docs/inxi.htm From 43c90fb5cb89f6ec58376b423876d53fcfa0bdee Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Jun 2019 18:44:16 +0800 Subject: [PATCH 0976/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190610=20Neof?= =?UTF-8?q?etch=20=E2=80=93=20Display=20Linux=20system=20Information=20In?= =?UTF-8?q?=20Terminal=20sources/tech/20190610=20Neofetch=20-=20Display=20?= =?UTF-8?q?Linux=20system=20Information=20In=20Terminal.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ay Linux system Information In Terminal.md | 229 ++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md diff --git a/sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md b/sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md new file mode 100644 index 0000000000..28b349492e --- /dev/null +++ b/sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md @@ -0,0 +1,229 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Neofetch – Display Linux system Information In Terminal) +[#]: via: (https://www.ostechnix.com/neofetch-display-linux-systems-information/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Neofetch – Display Linux system Information In Terminal +====== + +![Display Linux system information using Neofetch][1] + +**Neofetch** is a simple, yet useful command line system information utility written in **Bash**. It gathers information about your system’s software and hardware and displays the result in the Terminal. By default, the system information will be displayed alongside your operating system’s logo. However, you can further customize it to use an **ascii image** or any image of your choice instead of the OS logo. You can also configure Neofetch to display which information, where and when that information should be displayed. Neofetch is mainly developed to be used in screenshots of your system information. It supports Linux, BSD, Mac OS X, iOS, and Windows operating systems. In this brief tutorial, let us see how to display Linux system information using Neofetch. + +### Install Neofetch + +Neofetch is available in the default repositories of most Linux distributions. + +On Arch Linux and its variants, install it using command: + +``` +$ sudo pacman -S netofetch +``` + +On Debian (Stretch / Sid): + +``` +$ sudo apt-get install neofetch +``` + +On Fedora 27: + +``` +$ sudo dnf install neofetch +``` + +On RHEL, CentOS: + +Enable EPEL Repository: + +``` +# yum install epel-relase +``` + +Fetch the neofetch repository: + +``` +# curl -o /etc/yum.repos.d/konimex-neofetch-epel-7.repo +https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-7/konimex-neofetch-epel-7.repo +``` + +Then, install Neofetch: + +``` +# yum install neofetch +``` + +On Ubuntu 17.10 and newer versions: + +``` +$ sudo apt-get install neofetch +``` + +On Ubuntu 16.10 and lower versions: + +``` +$ sudo add-apt-repository ppa:dawidd0811/neofetch + +$ sudo apt update + +$ sudo apt install neofetch +``` + +On NixOS: + +``` +$ nix-env -i neofetch +``` + +### Display Linux system Information Using Neofetch + +Neofetch is pretty easy and straightforward. Let us see some examples. + +Open up your Terminal, and run the following command: + +``` +$ neofetch +``` + +**Sample output:** + +![][2] + +Display Linux system Information Using Neofetch + +As you can see in the above output, Neofetch is displaying the following details of my Arch Linux system: + + * Name of the installed operating system, + * Laptop model, + * Kernel details, + * System uptime, + * Number of installed packages by default and other package managers, + * Default Shell, + * Screen resolution, + * Desktop environment, + * Window manager, + * Window manager’s theme, + * System theme, + * System Icons, + * Default Terminal, + * CPU type, + * GPU type, + * Installed memory. + + + +Neofetch has plenty of other options too. We will see some of them. + +##### How to use custom imagess in Neofetch output? + +By default, Neofetch will display your OS logo along with the system information. You can, of course, change the image as you wish. + +In order to display images, your Linux system should have the following dependencies installed: + + 1. **w3m-img** (It is required to display images. w3m-img is sometimes bundled together with **w3m** package), + 2. **Imagemagick** (required for thumbnail creation), + 3. A terminal that supports **\033[14t** or **xdotool** or **xwininfo + xprop** or **xwininfo + xdpyinfo**. + + + +W3m-img and ImageMagick packages are available in the default repositories of most Linux distributions. So you can install them using your distribution’s default package manager. + +For instance, run the following command to install w3m-img and ImageMagick on Debian, Ubuntu, Linux Mint: + +``` +$ sudo apt install w3m-img imagemagick +``` + +Here is the list of Terminal Emulators with **w3m-img** support: + + 1. Gnome-terminal, + 2. Konsole, + 3. st, + 4. Terminator, + 5. Termite, + 6. URxvt, + 7. Xfce4-Terminal, + 8. Xterm + + + +If you have **kitty** , **Terminology** and **iTerm** terminal emulators on your system, you don’t need to install w3m-img. + +Now, run the following command to display your system’s information with a custom image: + +``` +$ neofetch --w3m /home/sk/Pictures/image.png +``` + +Or, + +``` +$ neofetch --w3m --source /home/sk/Pictures/image.png +``` + +Sample output: + +![][3] + +Neofetch output with custom logo + +Replace the image path in the above command with your own. + +Alternatively, you can point a directory that contains the images like below. + +``` +$ neofetch --w3m +``` + +##### Configure Neofetch + +When we run the Neofetch for the first time, It will create a per-user configuration file at **$HOME/.config/neofetch/config.conf** by default. It also creates a system-wide neofetch config file at **$HOME/.config/neofetch/config**. You can tweak this file to tell Neofetch which details should be displayed, removed and/or modified. + +You can also keep this configuration file between versions. Meaning – just customize it once as per your liking and use the same settings after upgrading to newer version. You can even share this file to your friends and colleagues to have the same settings as yours. + +To view Neofetch help section, run: + +``` +$ neofetch --help +``` + +As far as I tested Neofetch, It worked perfectly in my Arch Linux system as expected. It is a nice handy tool to easily and quickly print the details of your system in the Terminal. + +* * * + +**Related read:** + + * [**How to find Linux System details using inxi**][4] + + + +* * * + +**Resource:** + + * [**Neofetch on GitHub**][5] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/neofetch-display-linux-systems-information/ + +作者:[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/2016/06/neofetch-1-720x340.png +[2]: http://www.ostechnix.com/wp-content/uploads/2016/06/Neofetch-1.png +[3]: http://www.ostechnix.com/wp-content/uploads/2016/06/Neofetch-with-custom-logo.png +[4]: https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/ +[5]: https://github.com/dylanaraps/neofetch From 16654872271a2bdfc7780eddd2649ede9ae3b177 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 Jun 2019 21:47:14 +0800 Subject: [PATCH 0977/1154] PRF:20190606 How Linux can help with your spelling.md @Modrisco --- ...6 How Linux can help with your spelling.md | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/translated/tech/20190606 How Linux can help with your spelling.md b/translated/tech/20190606 How Linux can help with your spelling.md index 8c842a797e..a6ed812326 100644 --- a/translated/tech/20190606 How Linux can help with your spelling.md +++ b/translated/tech/20190606 How Linux can help with your spelling.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (Modrisco) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How Linux can help with your spelling) @@ -9,18 +9,18 @@ 如何用 Linux 帮助你拼写 ====== -无论你在处理一个难以理解的单词,还是在将报告发给老板之前再检查一遍,Linux 都可以帮助你解决拼写问题。 -![Sandra Henry-Stocker][1] + +> 无论你是纠结一个难以理解的单词,还是在将报告发给老板之前再检查一遍,Linux 都可以帮助你解决拼写问题。 + +![Sandra Henry-Stocker](https://img.linux.net.cn/data/attachment/album/201906/17/214715jayk1k1kbiatkido.jpg) Linux 为数据分析和自动化提供了各种工具,它也帮助我们解决了一个一直都在纠结的问题 —— 拼写!无论在写每周报告时努力拼出一个单词,还是在提交商业计划书之前想要借助计算机的“眼睛”来找出你的拼写错误。现在我们来看一下它是如何帮助你的。 ### look -**look** 是其中一款工具。如果你知道一个单词是怎么开始拼的,你就可以用这个命令来获取以这些字母开头的单词列表。除非提供了替代词源,否则 look 将使用 **/usr/share/dict/words** 中的内容来为你标识单词。这个文件有数十万个单词,可以满足我们日常使用的大多数英语单词的需要,但是它可能不包含我们计算机领域中的一些人倾向于使用的更加生僻的单词,如 zettabyte。 +`look` 是其中一款工具。如果你知道一个单词的开头,你就可以用这个命令来获取以这些字母开头的单词列表。除非提供了替代词源,否则 `look` 将使用 `/usr/share/dict/words` 中的内容来为你标识单词。这个文件有数十万个单词,可以满足我们日常使用的大多数英语单词的需要,但是它可能不包含我们计算机领域中的一些人倾向于使用的更加生僻的单词,如 zettabyte。 -**[ 两分钟的Linux技巧:[在这些两分钟的视频教程中学习如何掌握一系列 Linux 命令][2] ]**(Youtube 源) - -look 命令的语法非常简单。输入 `look word` ,它将遍历单词文件中的所有单词并找到匹配项。 +`look` 命令的语法非常简单。输入 `look word` ,它将遍历单词文件中的所有单词并找到匹配项。 ``` $ look amelio @@ -47,13 +47,13 @@ $ look zetta $ ``` -如果你没有看到你所希望出现的单词,不要绝望。你可以在你的单词文件中添加单词,甚至引用一个完全不同的单词列表,在网上找一个或者干脆自己创建一个。你甚至不必将添加的单词放在按字母顺序排列的正确位置;只需将其添加到文件的末尾即可。但是,你必须以 root 用户身份执行此操作。例如(要注意 **> >**!): +如果你没有看到你所希望出现的单词,也不要绝望。你可以在你的单词文件中添加单词,甚至引用一个完全不同的单词列表,在网上找一个或者干脆自己创建一个。你甚至不必将添加的单词放在按字母顺序排列的正确位置;只需将其添加到文件的末尾即可。但是,你必须以 root 用户身份执行此操作。例如(要注意 `>>`!): ``` # echo “zettabyte” >> /usr/share/dict/words ``` -当使用不同的单词列表时,例如这个例子中的 “jargon” ,你只需要添加文件的名称。如果文件不是默认值,请使用完整路径。 +当使用不同的单词列表时,例如这个例子中的 “jargon” ,你只需要添加文件的名称。如果不采用默认文件时,请使用完整路径。 ``` $ look nybble /usr/share/dict/jargon @@ -61,7 +61,7 @@ nybble nybbles ``` -look 命令大小写不敏感,因此你不必关心要查找的单词是否应该大写。 +`look` 命令大小写不敏感,因此你不必关心要查找的单词是否应该大写。 ``` $ look zet @@ -79,7 +79,7 @@ Zetland Zetta ``` -当然,不是所有的单词列表都是一样的。一些 Linux 发行版在单词文件中提供了 _多得多_ 的内容。你的文件中可能有十万或者更多倍的单词。 +当然,不是所有的单词列表都是一样的。一些 Linux 发行版在单词文件中提供了*多得多*的内容。你的文件中可能有十万或者更多倍的单词。 在我的一个 Linux 系统中: @@ -95,14 +95,13 @@ $ wc -l /usr/share/dict/words 479828 /usr/share/dict/words ``` -请记住,look 命令只适用于单词的开头,但如果你不想从单词的开头开始,还可以使用其他选项。 +请记住,`look` 命令只适用于通过单词开头查找,但如果你不想从单词的开头查找,还可以使用其他选项。 ### grep -我们深爱的 **grep** 命令像其他工具一样可以从一个单词文件中选出单词。如果你正在找以某些字母开头或结尾的单词,使用 grep 命令是自然而然的事情。它可以通过单词的开头,结尾或中间部分来匹配单词。系统中的单词文件可以像使用 look 命令时在 grep 命令中轻松使用。不过唯一的缺点是你需要指定文件,这一点与 look 不尽相同。 +我们深爱的 `grep` 命令像其他工具一样可以从一个单词文件中选出单词。如果你正在找以某些字母开头或结尾的单词,使用 `grep` 命令是自然而然的事情。它可以通过单词的开头、结尾或中间部分来匹配单词。系统中的单词文件可以像使用 `look` 命令时在 `grep` 命令中轻松使用。不过唯一的缺点是你需要指定文件,这一点与 `look` 不尽相同。 - -在单词的开头前加上 ^: +在单词的开头前加上 `^`: ``` $ grep ^terra /usr/share/dict/words @@ -123,7 +122,7 @@ terrarium's terrariums ``` -在单词的结尾后加上 $: +在单词的结尾后加上 `$`: ``` $ grep bytes$ /usr/share/dict/words @@ -134,7 +133,7 @@ megabytes terabytes ``` -使用 grep 时,你需要考虑大小写,不过 grep 命令也提供了一些选项。 +使用 `grep` 时,你需要考虑大小写,不过 `grep` 命令也提供了一些选项。 ``` $ grep ^[Zz]et /usr/share/dict/words @@ -173,7 +172,7 @@ zettabytye ### aspell -aspell 命令提供了一种不同的方式。它提供了一种方法来检查你提供给它的任何文件或文本的拼写。你可以通过管道将文本传递给它,然后它会告诉你哪些单词看起来有拼写错误。如果所有单词都拼写正确,则不会有任何输出。 +`aspell` 命令提供了一种不同的方式。它提供了一种方法来检查你提供给它的任何文件或文本的拼写。你可以通过管道将文本传递给它,然后它会告诉你哪些单词看起来有拼写错误。如果所有单词都拼写正确,则不会有任何输出。 ``` $ echo Did I mispell that? | aspell list @@ -184,15 +183,15 @@ $ echo Did I misspell anything? | aspell list $ ``` -“list” 参数告诉 aspell 为标准输入单词提供拼写错误的单词列表。 +`list` 参数告诉 `aspell` 为标准输入单词提供拼写错误的单词列表。 -你还可以使用 aspell 来定位和更正文本文件中的单词。如果它发现一个拼写错误的单词,它将为你提供一个相似(但拼写正确的)单词列表来替换这个单词。你也可以将单词加入个人词库(~/.aspell.en.pws)来接收并忽略拼写错误。或者完全中止进程(使文件保持启动前的状态)。 +你还可以使用 `aspell` 来定位和更正文本文件中的单词。如果它发现一个拼写错误的单词,它将为你提供一个相似(但拼写正确的)单词列表来替换这个单词,你也可以将该单词加入个人词库(`~/.aspell.en.pws`)并忽略拼写错误,或者完全中止进程(使文件保持处理前的状态)。 ``` $ aspell -c mytext ``` -一旦 aspell 发现一个单词出现了拼写错误,它将会为不正确的 “mispell” 提供一个选项列表: +一旦 `aspell` 发现一个单词出现了拼写错误,它将会为不正确的 “mispell” 提供一个选项列表: ``` 1) mi spell 6) misplay @@ -206,23 +205,23 @@ a) Add l) Add Lower b) Abort x) Exit ``` -请注意,备选单词和拼写是数字编号的,而其他选项是由字母选项表示的。你可以选择备选拼写中的一项或者自己输入替换项。“Abort” 选项将使文件保持不变,即使你已经为某些单词选择了替换。你选择添加的单词将被插入到本地文件中(例如 ~/.aspell.en.pws)。 +请注意,备选单词和拼写是数字编号的,而其他选项是由字母选项表示的。你可以选择备选拼写中的一项或者自己输入替换项。“Abort” 选项将使文件保持不变,即使你已经为某些单词选择了替换。你选择添加的单词将被插入到本地单词文件中(例如 `~/.aspell.en.pws`)。 -### 其他单词列表 +#### 其他单词列表 -厌倦了英语? aspell 命令可以在其他语言中使用,只要你添加了相关语言的单词列表。例如,在 Debian 系统中添加法语的词库,你可以这样做: +厌倦了英语? `aspell` 命令可以在其他语言中使用,只要你添加了相关语言的单词列表。例如,在 Debian 系统中添加法语的词库,你可以这样做: ``` $ sudo apt install aspell-fr ``` -这个新的词库文件会被安装为 /usr/share/dict/French。为了使用它,你只需要简单地告诉 aspell 你想要使用替换的单词列表: +这个新的词库文件会被安装为 `/usr/share/dict/French`。为了使用它,你只需要简单地告诉 `aspell` 你想要使用替换的单词列表: ``` $ aspell --lang=fr -c mytext ``` -这种情况下,当 aspell 读到单词 “one” 时,你可能会看到下面的情况: +这种情况下,当 `aspell` 读到单词 “one” 时,你可能会看到下面的情况: ``` 1) once 6) orné @@ -236,13 +235,12 @@ a) Add l) Add Lower b) Abort x) Exit ``` -你也可以通过 [GNU][3] 来获取其他语言的词库。 +你也可以从 [GNU 官网][3]获取其他语言的词库。 ### 总结 -即使你是全国拼字比赛的冠军,你可能偶尔也会需要一点拼写方面的帮助,哪怕只是为了找出你手滑打错的单词。aspell 工具,加上 look 和 grep 命令已经准备来助你一臂之力了。 +即使你是全国拼字比赛的冠军,你可能偶尔也会需要一点拼写方面的帮助,哪怕只是为了找出你手滑打错的单词。`aspell` 工具,加上 `look` 和 `grep` 命令已经准备来助你一臂之力了。 -加入[Facebook][4] 和 [LinkedIn][5] 的 Network World 社区,评论热点话题。 -------------------------------------------------------------------------------- @@ -251,7 +249,7 @@ via: https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-s 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[Modrisco](https://github.com/Modrisco) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8144cfc0781460c73ffcedb5a2aad11d05df084c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 Jun 2019 21:47:55 +0800 Subject: [PATCH 0978/1154] PUB:20190606 How Linux can help with your spelling.md @Modrisco https://linux.cn/article-10986-1.html --- .../20190606 How Linux can help with your spelling.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190606 How Linux can help with your spelling.md (99%) diff --git a/translated/tech/20190606 How Linux can help with your spelling.md b/published/20190606 How Linux can help with your spelling.md similarity index 99% rename from translated/tech/20190606 How Linux can help with your spelling.md rename to published/20190606 How Linux can help with your spelling.md index a6ed812326..abb26b7f91 100644 --- a/translated/tech/20190606 How Linux can help with your spelling.md +++ b/published/20190606 How Linux can help with your spelling.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Modrisco) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10986-1.html) [#]: subject: (How Linux can help with your spelling) [#]: via: (https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-spelling.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 8013e3cf5894259408b5da0333590a59d3e86f3e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 Jun 2019 23:04:00 +0800 Subject: [PATCH 0979/1154] PRF:20190610 Welcoming Blockchain 3.0.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @murphyzhao 恭喜你完成了第一篇翻译! --- .../tech/20190610 Welcoming Blockchain 3.0.md | 80 +++++++++---------- 1 file changed, 36 insertions(+), 44 deletions(-) diff --git a/translated/tech/20190610 Welcoming Blockchain 3.0.md b/translated/tech/20190610 Welcoming Blockchain 3.0.md index 9130f0c073..ef15287eeb 100644 --- a/translated/tech/20190610 Welcoming Blockchain 3.0.md +++ b/translated/tech/20190610 Welcoming Blockchain 3.0.md @@ -1,79 +1,71 @@ -欢迎区块链 3.0 +迎接区块链 3.0 ====== ![欢迎区块链 3.0][1] -图片来源: - -“Blockchain 2.0” 系列文章讨论了自 2008 年比特币等加密货币问世以来区块链技术的发展。本文将探讨区块链的未来发展。**区块链 3.0** 这一新的 DLT(Distributed Ledger Technology:分布式分类帐技术)技术演进浪潮将回答当前区块链所面临的问题(每一个问题都会在这里总结)。下一版本的技术标准也将带来全新的应用和使用案例。在本文的最后,我们也会看一些当前使用这些原则的案例。 +“[区块链 2.0][2]” 系列文章讨论了自 2008 年比特币等加密货币问世以来区块链技术的发展。本文将探讨区块链的未来发展。**区块链 3.0** 这一新的 DLT(分布式分类帐本技术Distributed Ledger Technology)演进浪潮将回答当前区块链所面临的问题(每一个问题都会在这里总结)。下一版本的技术标准也将带来全新的应用和使用案例。在本文的最后,我们也会看一些当前使用这些原则的案例。 以下是现有区块链平台的几个缺点,并针对这些缺点给出了建议的解决方案。 -### 问题 1:可扩展性[1] +### 问题 1:可扩展性 -这个问题是被普遍认为的第一个主要障碍。正如之前所讨论的,很多因素限制了区块链同时处理大量交易的能力。诸如 [**以太坊**][3] 之类的现有网络每秒能够进行 10-15 次交易(TPS),而像 Visa 所使用的主流网络每秒能够进行超过 2000 次交易。**可伸缩性**是困扰所有现代数据库系统的问题。正如我们在这里看到的那样,改进的共识算法和更好的区块链架构设计正在改进它。 +这个问题 [^1]被视为普遍采用该技术的第一个主要障碍。正如之前所讨论的,很多因素限制了区块链同时处理大量交易的能力。诸如 [以太坊][3] 之类的现有网络每秒能够进行 10-15 次交易(TPS),而像 Visa 所使用的主流网络每秒能够进行超过 2000 次交易。**可扩展性**是困扰所有现代数据库系统的问题。正如我们在这里看到的那样,改进的共识算法和更好的区块链架构设计正在改进它。 -**解决可扩展性** +#### 解决可扩展性 -已经提出了更精简、更有效的一致性算法来解决可伸缩性问题,并且不会影响区块链的主要结构。虽然大多数加密货币和区块链平台使用资源密集型的 PoW 算法(例如,比特币和以太坊)来生成区块,但是存在更新的 DPoS 和 PoET 算法来解决这个问题。DPoS 和 PoET 算法(还有一些正在开发中)需要更少的资源来维持区块链,并且已显示具有高达 1000 TPS 的吞吐量,可与流行的非区块链系统相媲美。 +已经提出了更精简、更有效的一致性算法来解决可扩展性问题,并且不会影响区块链的主要结构。虽然大多数加密货币和区块链平台使用资源密集型的 PoW 算法(例如,比特币和以太坊)来生成区块,但是存在更新的 DPoS 和 PoET 算法来解决这个问题。DPoS 和 PoET 算法(还有一些正在开发中)需要更少的资源来维持区块链,并且已显示具有高达 1000 TPS 的吞吐量,可与流行的非区块链系统相媲美。 -可伸缩性问题的第二个解决方案是完全改变区块链结构[1]和功能。我们不会详细介绍这一点,但已经提出了诸如**有向无环图**(**DAG**)之类的替代架构来处理这个问题。从本质上讲,这项工作假设并非所有网络节点都需要整个区块链的副本才能使区块链正常工作,或者并非所有的参与者需要从 DLT 系统获得好处。系统不要求整个参与者验证交易,只需要交易发生在共同的参考框架中并相互链接。系统不要求通过所有的参与者验证交易,只需要交易发生在共同的参考框架中并相互链接。 +可扩展性问题的第二个解决方案是完全改变区块链结构和功能。我们不会详细介绍这一点,但已经提出了诸如有向无环图Directed Acyclic Graph(DAG)之类的替代架构来处理这个问题。从本质上讲,这项工作假设并非所有网络节点都需要整个区块链的副本才能使区块链正常工作,或者并非所有的参与者需要从 DLT 系统获得好处。系统不要求所有参与者验证交易,只需要交易发生在共同的参考框架中并相互链接。 -在比特币系统中使用 **Lightning network** 来实现 DAG[2],而以太坊使用他们的 **Sharding** [3] 协议来实现 DAG。本质上,从技术上来看 DAG 实现并不是区块链。它更像是一个错综复杂的迷宫,只是仍然保留了区块链的点对点和分布式数据库属性。稍后我们将在另一篇文章中探讨 DAG 和 Tangle 网络。 +在比特币系统中使用[闪电网络][11]Lightning network来实现 DAG,而以太坊使用他们的[切片][12]Sharding 协议来实现 DAG。本质上,从技术上来看 DAG 实现并不是区块链。它更像是一个错综复杂的迷宫,只是仍然保留了区块链的点对点和分布式数据库属性。稍后我们将在另一篇文章中探讨 DAG 和 Tangle 网络。 -### 问题 2:互通性[4][5] +### 问题 2:互通性 -**互通性**被称为跨链访问,是不同区块链之间能够彼此相互通信以交换指标和信息的基础。由于目前很难平衡众多的平台,不同公司为所有无数应用提供专有系统,平台之间的互操作性就至关重要。例如,目前,在一个平台上拥有数字身份的人无法利用其他平台提供的功能,因为各个区块链不理解或了解彼此。这是由于缺乏可靠的验证、令牌交换等有关的问题仍然存在。如果平台之间不能够相互通信,全球推出 [**智能合约**][4] 也是不可行的。 +**互通性**[^4] [^5] 被称为跨链访问,基本上就是指不同区块链之间彼此相互通信以交换指标和信息。由于目前有数不清的众多平台,不同公司为各种应用提供了各种专有系统,平台之间的互操作性就至关重要。例如,目前在一个平台上拥有数字身份的人无法利用其他平台提供的功能,因为各个区块链彼此之间互不了解、不能沟通。这是由于缺乏可靠的验证、令牌交换等有关的问题仍然存在。如果平台之间不能够相互通信,面向全球推出[智能合约][4]也是不可行的。 -**解决互通性** +#### 解决互通性 -有一些协议和平台专为实现互操作性而设计。这些平台实现了原子交换协议,并向不同的区块链系统提供开放,以便在它们之间进行通信和交换信息。**“0x (ZRX)”** 就是其中的一个例子,稍后将对进行描述。 +有一些协议和平台专为实现互操作性而设计。这些平台实现了原子交换协议,并向不同的区块链系统提供开放场景,以便在它们之间进行通信和交换信息。**“0x (ZRX)”** 就是其中的一个例子,稍后将对进行描述。 -### 问题 3:治理[6] +### 问题 3:治理 -公共区块链中的治理不是自身的限制,而是需要像社区道德指罗盘一样,在区块链的运作中考虑每个人的意见。结合规模,能预见这样一个问题,即要么协议更改太频繁,要么协议被拥有最多代币的“中央”权威一时冲动下修改。不过这不是大多数公共区块链目前正在努力避免的问题,因为其运营规模和运营性质不需要更严格的监管。 +公有链中的治理 [^6] 本身不是限制,而是需要像社区道德指南针一样,在区块链的运作中考虑每个人的意见。结合起来并规模性地看,能预见这样一个问题,即要么协议更改太频繁,要么协议被拥有最多令牌的“中央”权威一时冲动下修改。不过这不是大多数公共区块链目前正在努力避免的问题,因为其运营规模和运营性质不需要更严格的监管。 -**解决治理问题** +#### 解决治理问题 -上面提到的复杂的框架或 DAG 几乎可以消除对全球(平台范围)治理法的需要和使用。相反,程序可以自动监督事务和用户类型,并决定需要执行的法律。 +上面提到的复杂的框架或 DAG 几乎可以消除对全球(平台范围)治理法规的需要和使用。相反,程序可以自动监督事务和用户类型,并决定需要执行的法律。 -### 问题 4:可持续发展 +### 问题 4:可持续性 -可持续性再次建立在可扩展性问题的基础上。当前的区块链和加密货币因长期不可持续而臭名昭著,这是由于仍然需要大量的监督和保持系统运行所需的资源。如果你读过 `最近“挖掘加密货币”已经没有这么大利润` 的相关报道,你就知道“挖矿”图利就是它的本来面目。在主流使用的全球范围内,保持现有平台运行所需的资源量是不现实。 +可持续性再次建立在可扩展性问题的基础上。当前的区块链和加密货币因不可长期持续而倍遭批评,这是由于仍然需要大量的监督,并且需要大量资源保持系统运行。如果你读过最近“挖掘加密货币”已经没有这么大利润的相关报道,你就知道“挖矿”图利就是它的本来面目。保持现有平台运行所需的资源量在全球范围和主流使用方面根本不实用。 -**解决非可持续性问题** +#### 解决不可持续性问题 从资源或经济角度来看,可持续性的答案与可扩展性的答案类似。但是,要在全球范围内实施这一制度,法律和法规必须予以认可。然而,这取决于世界各国政府。来自美国和欧洲政府的有利举措重新燃起了对这方面的希望。 -### 问题 5:用户采用[7] +### 问题 5:用户采用 -目前,阻止消费者广泛采用基于区块链的应用程序的一个障碍是消费者对平台及其下的技术不熟悉。事实上,大多数应用程序都需要某种技术和计算背景来弄清楚它们是如何工作的,这在这方面也没有帮助。第三波区块链开发旨在缩小消费者知识与平台可用性之间的差距。 +目前,阻止消费者广泛采用 [^7] 基于区块链的应用程序的一个障碍是消费者对平台及其底层的技术不熟悉。事实上,大多数应用程序都需要某种技术和计算背景来弄清楚它们是如何工作的,这在这方面也没有帮助。区块链开发的第三次浪潮旨在缩小消费者知识与平台可用性之间的差距。 -**解决用户采用问题** +#### 解决用户采用问题 -互联网花了很长的时间才发展成现在的样子。多年来,人们在开发标准化互联网技术栈方面做了大量的工作,使网络能够像现在这样运作。开发人员正在开发面向用户的前端分布式应用程序,这些应用程序应作为现有 Web 3.0 技术之上的一层,同时受到下面的区块链和开放协议的支持。这样的 [**分布式应用**][5] 将使用户更熟悉底层技术,从而增加主流采用。 +互联网花了很长的时间才发展成现在的样子。多年来,人们在开发标准化互联网技术栈方面做了大量的工作,使 Web 能够像现在这样运作。开发人员正在开发面向用户的前端分布式应用程序,这些应用程序应作为现有 Web 3.0 技术之上的一层,同时由下面的区块链和开放协议的支持。这样的[分布式应用][5]将使用户更熟悉底层技术,从而增加主流采用。 + +### 在当前场景中的应用 我们已经从理论上讨论了上述问题的解决方法,现在我们将继续展示这些方法在当前场景中的应用。 -**[0x][6]** – 是一种去中心化的令牌交换,不同平台的用户可以在不需要中央权威机构审查的情况下交换令牌。他们的突破在于,他们如何设计系统使得仅在交易结算后才记录和审查数据块而不是之间(为了验证上下文,通常也会验证交易之前的数据块)。这使在线数字资产交换更快速。 - -**[Cardano][7]** – 由以太坊的联合创始人之一创建,Cardano 自诩为一个真正的“科学”平台,拥有大量的审查和严格的协议,用于他们开发的代码和算法。假设 Cardano 的所有内容都在数学上尽可能优化。他们的共识算法叫做 **Ouroboros**,是一种改进的权益证明算法(PoS:Proof of Stake)。Cardano 是在 [**haskell**][8] 开发的,智能合约引擎使用 haskell 的衍生工具 **plutus** 进行操作。这两者都是函数式编程语言,可以保证安全交易而不会影响效率。 - -**EOS** – 我们已经在 [**这篇文章**][9] 中描述了 EOS。 - -**[COTI][10]** – 一个鲜为人知的架构,COTI 不需要挖矿,而且在运行过程中趋近于零功耗。它还将资产存储在本地用户设备上的离线钱包中,而不是纯粹的对等网络。它们也遵循基于 DAG 的架构,并声称处理吞吐量高达 10000 TPS。他们的平台允许企业在不利用区块链的情况下建立自己的加密货币和数字化货币钱包。 - -**参考:** - - * [1] **A. P. Paper, K. Croman, C. Decker, I. Eyal, A. E. Gencer, and A. Juels, “On Scaling Decentralized Blockchains | SpringerLink,” 2018.** - * [2] [**Going Beyond Blockchain with Directed Acyclic Graphs (DAG)**][11] - * [3] [**Ethreum/wiki – On sharding blockchains**][12] - * [4] [**Why is blockchain interoperability important**][13] - * [5] [**The Importance of Blockchain Interoperability**][14] - * [6] **R. Beck, C. Müller-Bloch, and J. L. King, “Governance in the Blockchain Economy: A Framework and Research Agenda,” J. Assoc. Inf. Syst., pp. 1020–1034, 2018.** - * [7] **J. M. Woodside, F. K. A. Jr, W. Giberson, F. K. J. Augustine, and W. Giberson, “Blockchain Technology Adoption Status and Strategies,” J. Int. Technol. Inf. Manag., vol. 26, no. 2, pp. 65–93, 2017.** +- [0x][6] – 是一种去中心化的令牌交换,不同平台的用户可以在不需要中央权威机构审查的情况下交换令牌。他们的突破在于,他们如何设计系统使得仅在交易结算后才记录和审查数据块,而不是通常的在交易之间进行(为了验证上下文,通常也会验证交易之前的数据块)。这使在线数字资产交换更快速。 +- [Cardano][7] – 由以太坊的联合创始人之一创建,Cardano 自诩为一个真正“科学”的平台,和采用了严格的协议,对开发的代码和算法进行了多次审查。Cardano 的所有内容都在数学上尽可能的进行了优化。他们的共识算法叫做 **Ouroboros**,是一种改进的权益证明Proof of Stake(PoS)算法。Cardano 是用 [**haskell**][8] 开发的,智能合约引擎使用 haskell 的衍生工具 **plutus** 进行操作。这两者都是函数式编程语言,可以保证安全交易而不会影响效率。 +- EOS – 我们已经在 [这篇文章][9] 中描述了 EOS。 +- [COTI][10] – 一个鲜为人知的架构,COTI 不需要挖矿,而且在运行过程中趋近于零功耗。它还将资产存储在本地用户设备上的离线钱包中,而不是存储在纯粹的对等网络上。它们也遵循基于 DAG 的架构,并声称处理吞吐量高达 10000 TPS。他们的平台允许企业在不利用区块链的情况下建立自己的加密货币和数字化货币钱包。 +[^1]: A. P. Paper, K. Croman, C. Decker, I. Eyal, A. E. Gencer, and A. Juels, “On Scaling Decentralized Blockchains | SpringerLink,” 2018. +[^4]: [Why is blockchain interoperability important][13] +[^5]: [The Importance of Blockchain Interoperability][14] +[^6]: R. Beck, C. Müller-Bloch, and J. L. King, “Governance in the Blockchain Economy: A Framework and Research Agenda,” J. Assoc. Inf. Syst., pp. 1020–1034, 2018. +[^7]: J. M. Woodside, F. K. A. Jr, W. Giberson, F. K. J. Augustine, and W. Giberson, “Blockchain Technology Adoption Status and Strategies,” J. Int. Technol. Inf. Manag., vol. 26, no. 2, pp. 65–93, 2017. -------------------------------------------------------------------------------- @@ -83,14 +75,14 @@ via: https://www.ostechnix.com/welcoming-blockchain-3-0/ 作者:[sk][a] 选题:[lujun9972][b] 译者:[murphyzhao](https://github.com/murphyzhao) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [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/2019/06/blockchain-720x340.jpg -[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[2]: https://linux.cn/article-10650-1.html [3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ [4]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ [5]: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ From d7ea4f0eeab956972261eafa2a4078c584bb3cfc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 Jun 2019 23:06:10 +0800 Subject: [PATCH 0980/1154] PRF:20190610 Welcoming Blockchain 3.0.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @murphyzhao 但是切记不要删除头部的这些元信息。 --- translated/tech/20190610 Welcoming Blockchain 3.0.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/translated/tech/20190610 Welcoming Blockchain 3.0.md b/translated/tech/20190610 Welcoming Blockchain 3.0.md index ef15287eeb..3b5d3479bf 100644 --- a/translated/tech/20190610 Welcoming Blockchain 3.0.md +++ b/translated/tech/20190610 Welcoming Blockchain 3.0.md @@ -1,3 +1,11 @@ +[#]: collector: (lujun9972) +[#]: translator: (murphyzhao) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Welcoming Blockchain 3.0) +[#]: via: (https://www.ostechnix.com/welcoming-blockchain-3-0/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) 迎接区块链 3.0 ====== From 2aede18d0305ca4b0d53c958424c51779831aaad Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 Jun 2019 23:07:31 +0800 Subject: [PATCH 0981/1154] PUB:20190610 Welcoming Blockchain 3.0.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @murphyzhao 本文首发地址: https://linux.cn/article-10987-1.html 你的 LCTT 专页地址: https://linux.cn/lctt/murphyzhao 请注册以领取 LCCN:https://lctt.linux.cn/ --- .../tech => published}/20190610 Welcoming Blockchain 3.0.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190610 Welcoming Blockchain 3.0.md (99%) diff --git a/translated/tech/20190610 Welcoming Blockchain 3.0.md b/published/20190610 Welcoming Blockchain 3.0.md similarity index 99% rename from translated/tech/20190610 Welcoming Blockchain 3.0.md rename to published/20190610 Welcoming Blockchain 3.0.md index 3b5d3479bf..0bd9086504 100644 --- a/translated/tech/20190610 Welcoming Blockchain 3.0.md +++ b/published/20190610 Welcoming Blockchain 3.0.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (murphyzhao) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10987-1.html) [#]: subject: (Welcoming Blockchain 3.0) [#]: via: (https://www.ostechnix.com/welcoming-blockchain-3-0/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 9ab9667d5d22d0123ad03acce30b74f35691556b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 Jun 2019 23:38:42 +0800 Subject: [PATCH 0982/1154] PRF:20190610 Graviton- A Minimalist Open Source Code Editor.md @geekpi --- ...on- A Minimalist Open Source Code Editor.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md b/translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md index 698606489d..f08d9c384b 100644 --- a/translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md +++ b/translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Graviton: A Minimalist Open Source Code Editor) @@ -10,7 +10,7 @@ Graviton:极简的开源代码编辑器 ====== -[Graviton][1]是一款开发中的免费开源跨平台代码编辑器。这位 16 岁的开发人员 Marc Espin 强调说,它是一个“极简”的代码编辑器。我不确定这点,但它确实有一个干净的用户界面,就像其他的[现代代码编辑器,如 Atom][2]。 +[Graviton][1]是一款开发中的自由开源的跨平台代码编辑器。他的开发者 16 岁的 Marc Espin 强调说,它是一个“极简”的代码编辑器。我不确定这点,但它确实有一个清爽的用户界面,就像其他的[现代代码编辑器,如 Atom][2]。 ![Graviton Code Editor Interface][3] @@ -30,9 +30,7 @@ Graviton 一些值得一说的特性有:   * 提供英语、西班牙语和一些其他欧洲语言。   * 适用于 Linux、Windows 和 macOS。 - - -我快速看来一下 Graviton,它可能不像 [VS Code][7] 或 [Brackets][8] 那样功能丰富,但对于一些简单的代码编辑来说,它并不是一个糟糕的工具。 +我快速看来一下 Graviton,它可能不像 [VS Code][7] 或 [Brackets][8] 那样功能丰富,但对于一些简单的代码编辑来说,它还算不错的工具。 ### 下载并安装 Graviton @@ -42,22 +40,20 @@ Graviton 一些值得一说的特性有: 你可以在其发布页面上找到最新版本的 Graviton。Debian 和 [Ubuntu 用户可以使用 .deb 安装][10]。它已提供 [AppImage][11],以便可以在其他发行版中使用它。DMG 和 EXE 文件也分别可用于 macOS 和 Windows。 -[下载 Graviton][12] +- [下载 Graviton][12] 如果你有兴趣,你可以在 GitHub 仓库中找到 Graviton 的源代码: -[GitHub 中 Graviton 的源码][13] +- [GitHub 中 Graviton 的源码][13] 如果你决定使用 Graviton 并发现了一些问题,请在[此处][14]写一份错误报告。如果你使用 GitHub,你可能想为 Graviton 项目加星。这可以提高开发者的士气,因为他知道有更多的用户欣赏他的努力。 如果你看到现在,我相信你了解[如何从源码安装软件][16] -**写在最后** +### 写在最后 有时,简单本身就成了一个特性,而 Graviton 专注于极简可以帮助它在已经拥挤的代码编辑器世界中获取一席之地。 -并且它是 FOSS 软件,我们尝试突出开源软件。如果你知道一些有趣的开源软件,并且想要更多的人知道,[请给我们留言][17] - -------------------------------------------------------------------------------- via: https://itsfoss.com/graviton-code-editor/ @@ -65,7 +61,7 @@ via: https://itsfoss.com/graviton-code-editor/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 68cbc1f67e091f20533b3e5307f2064741480e32 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 17 Jun 2019 23:39:12 +0800 Subject: [PATCH 0983/1154] PUB:20190610 Graviton- A Minimalist Open Source Code Editor.md @geekpi https://linux.cn/article-10988-1.html --- ...20190610 Graviton- A Minimalist Open Source Code Editor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190610 Graviton- A Minimalist Open Source Code Editor.md (98%) diff --git a/translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md b/published/20190610 Graviton- A Minimalist Open Source Code Editor.md similarity index 98% rename from translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md rename to published/20190610 Graviton- A Minimalist Open Source Code Editor.md index f08d9c384b..395f0f5687 100644 --- a/translated/tech/20190610 Graviton- A Minimalist Open Source Code Editor.md +++ b/published/20190610 Graviton- A Minimalist Open Source Code Editor.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10988-1.html) [#]: subject: (Graviton: A Minimalist Open Source Code Editor) [#]: via: (https://itsfoss.com/graviton-code-editor/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From acdac5fae132fd77c2623f493b759f305afe6abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 18 Jun 2019 07:16:43 +0800 Subject: [PATCH 0984/1154] Translating --- ...0613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md b/sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md index 4c89208db6..146ee056e2 100644 --- a/sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md +++ b/sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7b828b6fb48d7e23a60820544de141d30b1872d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 18 Jun 2019 07:18:57 +0800 Subject: [PATCH 0985/1154] Translating --- ...o Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md b/sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md index 9d5df1605a..12d8fe588b 100644 --- a/sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md +++ b/sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d634b4e0b6d64d3a2a5b4b93da0134ce748451a7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 18 Jun 2019 08:52:30 +0800 Subject: [PATCH 0986/1154] translated --- ...pImage, Flathub And Snapcraft Platforms.md | 91 ------------------- ...pImage, Flathub And Snapcraft Platforms.md | 91 +++++++++++++++++++ 2 files changed, 91 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md create mode 100644 translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md diff --git a/sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md b/sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md deleted file mode 100644 index f640f2a2d5..0000000000 --- a/sources/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Search Linux Applications On AppImage, Flathub And Snapcraft Platforms) -[#]: via: (https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and-snapcraft-platforms/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Search Linux Applications On AppImage, Flathub And Snapcraft Platforms -====== - -![Search Linux Applications On AppImage, Flathub And Snapcraft][1] - -Linux is evolving day by day. In the past, the developers had to build applications separately for different Linux distributions. Since there are several Linux variants exists, building apps for all distributions became tedious task and quite time consuming. Then some developers invented package converters and builders such as [**Checkinstall**][2], [**Debtap**][3] and [**Fpm**][4]. But they didn’t completely solved the problem. All of these tools will simply convert one package format to another. We still need to find and install the required dependencies the app needs to run. - -Well, the time has changed. We have now universal Linux apps. Meaning – we can install these applications on most Linux distributions. Be it Arch Linux, Debian, CentOS, Redhat, Ubuntu or any popular Linux distribution, the Universal apps will work just fine out of the box. These applications are packaged with all necessary libraries and dependencies in a single bundle. All we have to do is to download and run them on any Linux distributions of our choice. The popular universal app formats are **AppImages** , [**Flatpaks**][5] and [**Snaps**][6]. - -The AppImages are created and maintained by **Simon peter**. Many popular applications, like Gimp, Firefox, Krita and a lot more, are available in these formats and available directly on their download pages.Just download them, make it executable and run it in no time. You don’t even root permissions to run AppImages. - -The developer of Flatpak is **Alexander Larsson** (a RedHat employee). The Flatpak apps are hosted in a central repository (store) called **“Flathub”**. If you’re a developer, you are encouraged to build your apps in Flatpak format and distribute them to the users via Flathub. - -The **Snaps** are created mainly for Ubuntu, by **Canonical**. However, the developers of other Linux distributions are started to contribute to Snap packing format. So, Snaps will work on other Linux distributions as well. The Snaps can be downloaded either directly from application’s download page or from **Snapcraft** store. - -Many popular Companies and developers have released their applications in AppImage, Flatpak and Snap formats. If you ever looking for an app, just head over to the respective store and grab the application of your choice and run it regardless of the Linux distribution you use. - -There is also a command line universal app search tool called **“Chob”** is available to easily search Linux Applications on AppImage, Flathub and Snapcraft platforms. This tool will only search for the given application and display official link in your default browser. It won’t install them. This guide will explain how to install Chob and use it to search AppImages, Flatpaks and Snaps on Linux. - -### Search Linux Applications On AppImage, Flathub And Snapcraft Platforms Using Chob - -Download the latest Chob binary file from the [**releases page**][7]. As of writing this guide, the latest version was **0.3.5**. - -``` -$ wget https://github.com/MuhammedKpln/chob/releases/download/0.3.5/chob-linux -``` - -Make it executable: - -``` -$ chmod +x chob-linux -``` - -Finally, search the applications you want. For example, I am going to search applications related to **Vim**. - -``` -$ ./chob-linux vim -``` - -Chob will search for the given application (and related) on AppImage, Flathub and Snapcraft platforms and display the results. - -![][8] - -Search Linux applications Using Chob - -Just choose the application you want by typing the appropriate number to open the official link of the selected app in your default web browser where you can read the details of the app. - -![][9] - -View Linux application’s Details In Browser - -For more details, have a look at the Chob official GitHub page given below. - -**Resource:** - - * [**Chob GitHub Repository**][10] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and-snapcraft-platforms/ - -作者:[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/2019/05/chob-720x340.png -[2]: https://www.ostechnix.com/build-packages-source-using-checkinstall/ -[3]: https://www.ostechnix.com/convert-deb-packages-arch-linux-packages/ -[4]: https://www.ostechnix.com/build-linux-packages-multiple-platforms-easily/ -[5]: https://www.ostechnix.com/flatpak-new-framework-desktop-applications-linux/ -[6]: https://www.ostechnix.com/introduction-ubuntus-snap-packages/ -[7]: https://github.com/MuhammedKpln/chob/releases -[8]: http://www.ostechnix.com/wp-content/uploads/2019/05/Search-Linux-applications-Using-Chob.png -[9]: http://www.ostechnix.com/wp-content/uploads/2019/05/View-Linux-applications-Details.png -[10]: https://github.com/MuhammedKpln/chob diff --git a/translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md b/translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md new file mode 100644 index 0000000000..bc75f37b4b --- /dev/null +++ b/translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Search Linux Applications On AppImage, Flathub And Snapcraft Platforms) +[#]: via: (https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and-snapcraft-platforms/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +在 AppImage、Flathub 和 Snapcraft 平台上搜索 Linux 应用 +====== + +![Search Linux Applications On AppImage, Flathub And Snapcraft][1] + +Linux 一直在发展。过去,开发人员必须分别为不同的 Linux 发行版构建应用。由于存在多种 Linux 变体,因此为所有发行版构建应用变得很繁琐,而且非常耗时。接着一些开发人员发明了包转换器和构建器,如 [**Checkinstall**][2]、[**Debtap**][3] 和 [**Fpm**][4]。但他们没有完全解决问题。所有这些工具都只是将一种包格式转换为另一种包格式。我们仍然需要找到并安装应用运行所需的依赖项。 + +好吧,时代已经变了。我们现在有了通用的 Linux 应用。这意味着我们可以在大多数 Linux 发行版上安装这些应用。无论是 Arch Linux、Debian、CentOS、Redhat、Ubuntu 还是任何流行的 Linux 发行版,通用应用都可以正常使用。这些应用与所有必需的库和依赖项打包在一个包中。我们所要做的就是在我们使用的任何 Linux 发行版上下载并运行它们。流行的通用应用格式有 **AppImages**、[**Flatpaks**][5] 和 [**Snaps**][6]。 + +AppImages 由 **Simon peter** 创建和维护。许多流行的应用,如 Gimp、Firefox、Krita 等等,都有这些格式,并可直接在下载页面下载。只需下载它们,使其可执行并立即运行它。你甚至无需 root 权限来运行 AppImages。 + +Flatpak 的开发人员是 **Alexander Larsson**(RedHat 员工)。 Flatpak 应用托管在名为 **“Flathub”** 的中央仓库(商店)中。如果你是开发人员,建议你使用 Flatpak 格式构建应用,并通过 Flathub 将其分发给用户。 + +**Snaps** 由 **Canonical** 而建,主要用于 Ubuntu。但是,其他 Linux 发行版的开发人员开始为 Snap 打包格式做出贡献。因此,Snaps 也开始适用于其他 Linux 发行版。Snaps 可以直接从应用的下载页面下载,也可以从 **Snapcraft** 商店下载。 + +许多受欢迎的公司和开发人员已经发布了 AppImage、Flatpak 和 Snap 格式的应用。如果你在寻找一款应用,只需进入相应的商店并获取你选择的应用并运行它,而不用管你使用何种 Linux 发行版。 + +还有一个名为 **“Chob”** 的命令行通用应用搜索工具可在 AppImage、Flathub 和 Snapcraft 平台上轻松搜索 Linux 应用。此工具仅搜索给定的应用并在默认浏览器中显示官方链接。它不会安装它们。本指南将解释如何安装 Chob 并使用它来搜索 Linux 上的 AppImages、Flatpaks 和 Snaps。 + +### 使用 Chob 在 AppImage、Flathub 和 Snapcraft 平台上搜索 Linux 应用 + +从[**发布页面**][7]下载最新的 Chob 二进制文件。在编写本指南时,最新版本为 **0.3.5**。 + +``` +$ wget https://github.com/MuhammedKpln/chob/releases/download/0.3.5/chob-linux +``` + +使其可执行: + +``` +$ chmod +x chob-linux +``` + +最后,搜索你想要的应用。例如,我将搜索与 **Vim** 相关的应用。 + +``` +$ ./chob-linux vim +``` + +Chob 将在 AppImage、Flathub 和 Snapcraft 平台上搜索给定的应用(和相关应用)并显示结果。 + +![][8] + +使用 Chob 搜索 Linux 应用 + +只需要输入你想要应用前面的数字就可在默认浏览器中打开它的官方链接,并可在其中阅读应用的详细信息。 + +![][9] + +在浏览器中查看 Linux 应用的详细信息 + +有关更多详细信息,请查看下面的 Chob 官方 GitHub 页面。 + +**资源:** + + * [**Chob 的 GitHub 仓库**][10] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and-snapcraft-platforms/ + +作者:[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/2019/05/chob-720x340.png +[2]: https://www.ostechnix.com/build-packages-source-using-checkinstall/ +[3]: https://www.ostechnix.com/convert-deb-packages-arch-linux-packages/ +[4]: https://www.ostechnix.com/build-linux-packages-multiple-platforms-easily/ +[5]: https://www.ostechnix.com/flatpak-new-framework-desktop-applications-linux/ +[6]: https://www.ostechnix.com/introduction-ubuntus-snap-packages/ +[7]: https://github.com/MuhammedKpln/chob/releases +[8]: http://www.ostechnix.com/wp-content/uploads/2019/05/Search-Linux-applications-Using-Chob.png +[9]: http://www.ostechnix.com/wp-content/uploads/2019/05/View-Linux-applications-Details.png +[10]: https://github.com/MuhammedKpln/chob From 58efc6282d185075a98e9042cdc373f876b3facc Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 18 Jun 2019 08:56:43 +0800 Subject: [PATCH 0987/1154] translated --- ...0 Neofetch - Display Linux system Information In Terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md b/sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md index 28b349492e..b09442ed83 100644 --- a/sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md +++ b/sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 76f96618b432bb230be2cb76b071482a4c08cab0 Mon Sep 17 00:00:00 2001 From: chen ni Date: Tue, 18 Jun 2019 09:25:38 +0800 Subject: [PATCH 0988/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...assemblers, compilers, and interpreters.md | 78 +++++++++---------- 1 file changed, 36 insertions(+), 42 deletions(-) diff --git a/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md b/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md index cb242f5e1f..757c0631cb 100644 --- a/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md +++ b/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md @@ -7,39 +7,36 @@ [#]: via: (https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters) [#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/shawnhcorey/users/jnyjny/users/jnyjny) -A short primer on assemblers, compilers, and interpreters +浅谈汇编器,编译器和解释器 ====== -A gentle introduction to the historical evolution of programming -practices. +简单介绍一下编程方式的历史演变 ![keyboard with connected dots][1] -In the early days of computing, hardware was expensive and programmers were cheap. In fact, programmers were so cheap they weren't even called "programmers" and were in fact usually mathematicians or electrical engineers. Early computers were used to solve complex mathematical problems quickly, so mathematicians were a natural fit for the job of "programming." +在计算机诞生不久的早期年代,硬件非常昂贵,而程序员比较廉价。这些廉价程序员甚至都没有“程序员”这个头衔,并且常常是由数学家或者电气工程师来充当这个角色的。早期的计算机被用来在短时间内解决复杂的数学问题,所以数学家天然就适合“编程”工作。 -### What is a program? - -First, a little background. Computers can't do anything by themselves, so they require programs to drive their behavior. Programs can be thought of as very detailed recipes that take an input and produce an output. The steps in the recipe are composed of instructions that operate on data. While that sounds complicated, you probably know how this statement works: +### 什么是程序? +首先来看一点背景知识。计算机自己是做不了任何事情的,它们的任何行为都需要程序来引导。你可以把程序看成是非常精确的菜谱,这种菜谱读取一个输入,然后生成对应的输出。菜谱里的各个步骤由操作数据的指令构成。听上去有点儿复杂,不过你或许知道下面这个语句是什么意思: ``` `1 + 2 = 3` ``` -The plus sign is the "instruction" while the numbers 1 and 2 are the data. Mathematically, the equal sign indicates that both sides of an equation are "equivalent," however most computer languages use some variant of equals to mean "assignment." If a computer were executing that statement, it would store the results of the addition (the "3") somewhere in memory. +其中的加号是“指令”,而数字 1 和 2 是数据。数学上的等号意味着等式两边的部分是“等价”的,不过在大部分编程语言中等号(或者它的变形)都是“赋值”的意思。如果计算机执行上面这个语句,它会把这个加法的结果(也就是“3”)储存在内存中的某个地方。 -Computers know how to do math with numbers and move data around the machine's memory hierarchy. I won't say too much about memory except that it generally comes in two different flavors: fast/small and slow/big. CPU registers are very fast, very small and act as scratch pads. Main memory is typically very big and not nearly as fast as register memory. CPUs shuffle the data they are working with from main memory to registers and back again while a program executes. +计算机知道如何使用数字进行数学运算,以及如何在内存结构中移动数据。在这里就不对内存进行展开了,你只需要知道内存一般分为两大类:“速度快/空间小”和“速度慢/空间大”。CPU 寄存器的读写速度非常快,但是空间非常小,相当于一个速记便签。主存储器通常有很大的空间,但是读写速度就比寄存器差远了。在程序运行的时候,CPU 不断将它所需要用到的数据从主存储器挪动到寄存器,然后再把结果放回到主存储器。 -### Assemblers +### 汇编器 -Computers were very expensive and people were cheap. Programmers spent endless hours translating hand-written math into computer instructions that the computer could execute. The very first computers had terrible user interfaces, some only consisting of toggle switches on the front panel. The switches represented 1s and 0s in a single "word" of memory. The programmer would configure a word, indicate where to store it, and commit the word to memory. It was time-consuming and error-prone. +当时的计算机很贵,而人力比较便宜。程序员需要耗费很多时间把手写的数学表达式翻译成计算机可以执行的指令。最初的计算机只有非常糟糕的用户界面,有些甚至只有前面板上的拨动开关。这些开关就代表一个内存“单元”里的一个个 “0” 和 “1”。程序员需要配置一个内存单元,选择好储存位置,然后把这个单元提交到内存里。这是一个既耗时又容易出错的过程。 ![Programmers operate the ENIAC computer][2] -_Programmers[Betty Jean Jennings][3] (left) and [Fran Bilas][4] (right) operate [ENIAC's][5] main control panel._ +_程序员[Betty Jean Jennings][3] (左) 和 [Fran Bilas][4] (右) 在操作 [ENIAC][5] 的主控制面板._ -Eventually, an [electrical engineer][6] decided his time wasn't cheap and wrote a program with input written as a "recipe" expressed in terms people could read that output a computer-readable version. This was the first "assembler" and it was very controversial. The people that owned the expensive machines didn't want to "waste" compute time on a task that people were already doing; albeit slowly and with errors. Over time, people came to appreciate the speed and accuracy of the assembler versus a hand-assembled program, and the amount of "real work" done with the computer increased. - -While assembler programs were a big step up from toggling bit patterns into the front panel of a machine, they were still pretty specialized. The addition example above might have looked something like this: +后来有一名 [电气工程师][6] 认为自己的时间很宝贵,就写了一个能够把人们可以读懂的“菜谱”一样的程序转换成计算机可以读懂的版本的程序。这就是最初的“汇编器”,在当时引起了不小的争议。这些昂贵机器的主人不希望把计算资源浪费在人们已经在做的任务上(虽然又慢又容易出错)。不过随着时间的推移,人们逐渐发现使用汇编器在速度和准确性上都胜于人工编写机器语言,并且计算机完成的“实际工作量”增加了。 +尽管汇编器相比在机器面板上切换比特的状态已经是很大的进步了,这种编程方式仍然非常专业。上面加法的例子在汇编语言中看起来差不多是这样的: ``` 01 MOV R0, 1 @@ -49,66 +46,63 @@ While assembler programs were a big step up from toggling bit patterns into the 05 STO R2, R0 ``` -Each line is a computer instruction, beginning with a shorthand name of the instruction followed by the data the instruction works on. This little program will first "move" the value 1 into a register called R0, then 2 into register R1. Line 03 adds the contents of registers R0 and R1 and stores the resulting value into register R2. Finally, lines 04 and 05 identify where the result should be stored in main memory (address 64). Managing where data is stored in memory is one of the most time-consuming and error-prone parts of writing computer programs. +每一行都是一个计算机指令,前面是一个指令的简写,后面是指令所操作的数据。这个小小的程序会将数值 1 “移动”到寄存器 R0,然后把 2 移动到寄存器 R1。03 行把 R0 和 R1 两个寄存器里的数值相加,然后将结果储存在 R2 寄存器里。最后,04 行和 05 行决定结果应该被放在主存储器里的什么位置(在这里是地址 64)。管理内存中存储数据的位置是编程过程中最耗时也最容易出错的部分之一。 -### Compilers +### 编译器 -Assembly was much better than writing computer instructions by hand; however, early programmers yearned to write programs like they were accustomed to writing mathematical formulae. This drove the development of higher-level compiled languages, some of which are historical footnotes and others are still in use today. [ALGO][7] is one such footnote, while real problems continue to be solved today with languages like [Fortran][8] and [C][9]. +汇编器已经比手写计算机指令要好太多了,不过早期的程序员还是渴望能够按照他们所习惯的方式,像书写数学公式一样地去写程序。这种需求驱动了更高级别编译语言的发展,其中有一些已经成为历史,另一些如今还在使用。比如[ALGO][7] 就已经成为历史了,但是像 [Fortran][8] 和 [C][9] 这样的语言仍然在不断解决实际问题。 ![Genealogy tree of ALGO and Fortran][10] -Genealogy tree of ALGO and Fortran programming languages - -The introduction of these "high-level" languages allowed programmers to write their programs in simpler terms. In the C language, our addition assembly program would be written: +ALGO 和 Fortran 编程语言的谱系树 +这些“高级”语言使得程序员可以用更简单的方式编写程序。在 C 语言中,我们的加法程序就变成了这样: ``` int x; x = 1 + 2; ``` -The first statement describes a piece of memory the program will use. In this case, the memory should be the size of an integer and its name is **x** The second statement is the addition, although written "backward." A C programmer would read that as "X is assigned the result of one plus two." Notice the programmer doesn't need to say where to put **x** in memory, as the compiler takes care of that. +第一个语句描述了该程序将要使用的一块内存。在这个例子中,这块内存应该占一个整数的大小,名字是 **x**。第二个语句是加法,虽然是倒着写的。一个 C 语言的程序员会说这是 "X 被赋值为 1 加 2 的结果"。需要注意的是,程序员并不需要决定在内存的什么位置储存 **x**,这个任务交给编译器了。 -A new type of program called a "compiler" would turn the program written in a high-level language into an assembly language version and then run it through the assembler to produce a machine-readable version of the program. This composition of programs is often called a "toolchain," in that one program's output is sent directly to another program's input. +这种被称为“编译器”的新程序可以把用高级语言写的程序转换成汇编语言,再使用汇编器把汇编语言转换成机器可读的程序。这种程序的组合常常被称为“工具链”,因为一个程序的输出就直接成为另一个程序的输入。 -The huge advantage of compiled languages over assembly language programs was porting from one computer model or brand to another. In the early days of computing, there was an explosion of different types of computing hardware from companies like IBM, Digital Equipment Corporation, Texas Instruments, UNIVAC, Hewlett Packard, and others. None of these computers shared much in common besides needing to be plugged into an electrical power supply. Memory and CPU architectures differed wildly, and it often took man-years to translate programs from one computer to another. +编译语言相比汇编语言的优势体现在从一台计算机迁移到不同型号或者品牌的另一台计算机上的时候。在计算机的早期岁月里,包括 IBM,Digital Equipment Corporation,德州仪器,UNIVAC 以及惠普在内的很多公司都在尝试不同类型的计算机硬件。这些计算机除了都需要连接电源之外就没有太多共同点了。它们在内存和 CPU 架构上的差异相当大,当时经常需要人们花费数年来将一台计算机的程序翻译成另一台计算机的程序。 -With high-level languages, the compiler toolchain only had to be ported to the new platform. Once the compiler was available, high-level language programs could be recompiled for a new computer with little or no modification. Compilation of high-level languages was truly revolutionary. +有了高级语言,我们只需要把编译器工具链迁移到新的平台就行了。只要有可用的编译器,高级语言写的程序最多只需要经过小幅修改就可以在新的计算机上被重新编译。高级语言的编译是一个真正的革命性成果。 ![IBM PC XT][11] +1983 发布的 IBM PC XT 是硬件价格下降的早期例子。 -IBM PC XT released in 1983, is an early example of the decreasing cost of hardware. +程序员们的生活得到了很好的改善。相比之下,通过高级语言表达他们想要解决的问题让事情变得轻松很多。由于半导体技术的进步以及集成芯片的发明,计算机硬件的价格急剧下降。计算机的速度越来越快,能力也越来越强,并且还便宜了很多。从某个时点往后(也许是 80 年代末期吧),事情发生了转变,程序员变得比他们所使用的硬件更值钱了。 -Life became very good for programmers. It was much easier to express the problems they wanted to solve using high-level languages. The cost of computer hardware was falling dramatically due to advances in semiconductors and the invention of integrated chips. Computers were getting faster and more capable, as well as much less expensive. At some point, possibly in the late '80s, there was an inversion and programmers became more expensive than the hardware they used. +### 解释器 -### Interpreters +随着时间的推移,一种新的编程方式兴起了。一种被称为“解释器”的特殊程序可以将程序直接转换成可以立即执行的计算机指令。和编译器差不多,解释器读取程序并将它转换成一个中间形态。但和编译器不同的是,解释器直接执行程序的这个中间形态。解释型语言在每一次执行的时候都要经历这个过程;而编译程序只需要编译一次,之后计算机每次只需要执行编译好的机器指令就可以了。 -Over time, a new programming model rose where a special program called an "interpreter" would read a program and turn it into computer instructions to be executed immediately. The interpreter takes the program as input and interprets it into an intermediate form, much like a compiler. Unlike a compiler, the interpreter then executes the intermediate form of the program. This happens every time an interpreted program runs, whereas a compiled program is compiled just one time and the computer executes the machine instructions "as written." +顺便说一句,这个特性就是导致人们感觉解释型程序运行得比较慢的原因。不过现代计算机的性能出奇地强大,以至于大多数人无法区分编译型程序和解释型程序。 -As a side note, when people say "interpreted programs are slow," this is the main source of the perceived lack of performance. Modern computers are so amazingly capable that most people can't tell the difference between compiled and interpreted programs. - -Interpreted programs, sometimes called "scripts," are even easier to port to different hardware platforms. Because the script doesn't contain any machine-specific instructions, a single version of a program can run on many different computers without changes. The catch, of course, is the interpreter must be ported to the new machine to make that possible. - -One example of a very popular interpreted language is [perl][12]. A complete perl expression of our addition problem would be: +解释型程序(有时也被成为“脚本”)甚至更容易被迁移到不同的硬件平台上。因为脚本并不包含任何机器特有的指令,同一个版本的程序可以不经过任何修改就直接在很多不同的计算机上运行。不过当然了,解释器必须得先迁移到新的机器上才行。 +一个很流行的解释型语言是 [perl][12]。用 perl 完整地表达我们的加法问题会是这样的: ``` `$x = 1 + 2` ``` -While it looks and acts much like the C version, it lacks the variable initialization statement. There are other differences (which are beyond the scope of this article), but you can see that we can write a computer program that is very close to how a mathematician would write it by hand with pencil and paper. +虽然这个程序看起来和 C 语言的版本差不多,运行上也没有太大区别,但却缺少了初始化变量的语句。其实还有一些其它的区别(超出这篇文章的范围了),但你应该已经注意到,我们写计算机程序的方式已经和数学家用纸笔手写数学表达式非常接近了。 -### Virtual Machines +### 虚拟机 -The latest craze in programming models is the virtual machine, often abbreviated as VM. There are two flavors of virtual machine; system virtual machines and process virtual machines. Both types of VMs provide a level of abstraction from the "real" computing hardware, though they have different scopes. A system virtual machine is software that offers a substitute for the physical hardware, while a process virtual machine is designed to execute a program in a system-independent manner. So in this case, a process virtual machine (virtual machine from here on) is similar in scope to an interpreter in that a program is first compiled into an intermediated form before the virtual machine executes it. +最新潮的编程方式要数虚拟机(经常简称 VM)了。虚拟机分为两大类:系统虚拟机和进程虚拟机。这两种虚拟机都提供一种对“真实的”计算硬件的不同级别的抽象,不过他们的作用域不同。系统虚拟机是一个提供物理硬件的替代的软件,而进程虚拟机则被设计用来以一种“系统独立”的方式执行程序。所以在这个例子里,进程虚拟机(往后我所说的虚拟机都是指这个类型)的作用域和解释器的比较类似,因为也是先将程序编译成一个中间形态,然后虚拟机再执行这个中间形态。 -The main difference between an interpreter and a virtual machine is the virtual machine implements an idealized CPU accessed through its virtual instruction set. This abstraction makes it possible to write front-end language tools that compile programs written in different languages and target the virtual machine. Probably the most popular and well known virtual machine is the Java Virtual Machine (JVM). The JVM was initially only for the Java programming language back in the 1990s, but it now hosts [many][13] popular computer languages: Scala, Jython, JRuby, Clojure, and Kotlin to list just a few. There are other examples that may not be common knowledge. I only recently learned that my favorite language, [Python][14], is not an interpreted language, but a [language hosted on a virtual machine][15]! +虚拟机和解释器的主要区别在于,虚拟机创造了一个虚拟的 CPU,以及一套虚拟的指令集。有了这层抽象,我们就可以编写前端工具来把不同语言的程序编译成虚拟机可以接受的程序了。也许最流行也最知名的虚拟机就是 Java 虚拟机(JVM)了。JVM 最初在 1990 年代只支持 Java 语言,但是如今却可以运行 [许多][13] 流行的编程语言,包括 Scala,Jython,JRuby,Clojure,以及 Kotlin 等等。还有其它一些不太常见的例子,在这里就不说了。我也是最近才知道,我最喜欢的语言 Python 并不是一个解释型语言,而是一个 [运行在虚拟机上的语言][15]! -Virtual machines continue the historical trend of reducing the amount of platform-specific knowledge a programmer needs to express their problem in a language that supports their domain-specific needs. +虚拟机仍然在延续这样一个历史趋势:让程序员在使用特定领域的编程语言解决问题的时候,所需要的对特定计算平台的了解变得越来越少了。 -### That's a wrap +### 就是这样了 -I hope you enjoy this primer on some of the less visible parts of software. Are there other topics you want me to dive into next? Let me know in the comments. +希望你喜欢这篇简单介绍软件背后运行原理的短文。有什么其它话题是你想让我接下来讨论的吗?在评论里告诉我吧。 * * * @@ -120,7 +114,7 @@ via: https://opensource.com/article/19/5/primer-assemblers-compilers-interpreter 作者:[Erik O'Shaughnessy][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/chen-ni) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From dab9d01598e248c55f023bf50f4f664acb7194e3 Mon Sep 17 00:00:00 2001 From: chen ni Date: Tue, 18 Jun 2019 09:27:39 +0800 Subject: [PATCH 0989/1154] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0=20transla?= =?UTF-8?q?ted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0 A short primer on assemblers, compilers, and interpreters.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190530 A short primer on assemblers, compilers, and interpreters.md (100%) diff --git a/sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md b/translated/tech/20190530 A short primer on assemblers, compilers, and interpreters.md similarity index 100% rename from sources/tech/20190530 A short primer on assemblers, compilers, and interpreters.md rename to translated/tech/20190530 A short primer on assemblers, compilers, and interpreters.md From 8fe9291c9f3a17011cf4af9265446eafaa8b2ed1 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 18 Jun 2019 11:55:57 +0800 Subject: [PATCH 0990/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190614=20Pers?= =?UTF-8?q?onal=20assistant=20with=20Mycroft=20and=20Fedora=20sources/tech?= =?UTF-8?q?/20190614=20Personal=20assistant=20with=20Mycroft=20and=20Fedor?= =?UTF-8?q?a.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sonal assistant with Mycroft and Fedora.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20190614 Personal assistant with Mycroft and Fedora.md diff --git a/sources/tech/20190614 Personal assistant with Mycroft and Fedora.md b/sources/tech/20190614 Personal assistant with Mycroft and Fedora.md new file mode 100644 index 0000000000..f7f0edebfc --- /dev/null +++ b/sources/tech/20190614 Personal assistant with Mycroft and Fedora.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Personal assistant with Mycroft and Fedora) +[#]: via: (https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) + +Personal assistant with Mycroft and Fedora +====== + +![][1] + +Looking for an open source personal assistant ? [Mycroft][2] is allowing you to run an open source service which gives you better control of your data. + +### Install Mycroft on Fedora + +Mycroft is currently not available in the official package collection, but it can be easily installed from the project source. The first step is to download the source from Mycroft’s GitHub repository. + +``` +$ git clone https://github.com/MycroftAI/mycroft-core.git +``` + +Mycroft is a Python application and the project provides a script that takes care of creating a virtual environment before installing Mycroft and its dependencies. + +``` +$ cd mycroft-core +$ ./dev_setup.sh +``` + +The installation script prompts the user to help him with the installation process. It is recommended to run the stable version and get automatic updates. + +When prompted to install locally the Mimic text-to-speech engine, answer No. Since as described in the installation process this can take a long time and Mimic is available as an rpm package in Fedora so it can be installed using dnf. + +``` +$ sudo dnf install mimic +``` + +### Starting Mycroft + +After the installation is complete, the Mycroft services can be started using the following script. + +``` +$ ./start-mycroft.sh all +``` + +In order to start using Mycroft the device running the service needs to be registered. To do that an account is needed and can be created at . + +Once the account created, it is possible to add a new device at the following address [https://account.mycroft.ai/devices.][3] Adding a new device requires a pairing code that will be spoken to you by your device after starting all the services. + +![][4] + +The device is now ready to be used. + +### Using Mycroft + +Mycroft provides a set of [skills][5] that are enabled by default or can be downloaded from the [Marketplace][5]. To start you can simply ask Mycroft how is doing, or what the weather is. + +``` +Hey Mycroft, how are you ? + +Hey Mycroft, what's the weather like ? +``` + +If you are interested in how things works, the _start-mycroft.sh_ script provides a _cli_ option that lets you interact with the services using the command line. It is also displaying logs which is really useful for debugging. + +Mycroft is always trying to learn new skills, and there are many way to help by [contributing][6] the Mycroft community. + +* * * + +Photo by [Przemyslaw Marczynski][7] on [Unsplash][8] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/ + +作者:[Clément Verna][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/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/mycroft-816x345.jpg +[2]: https://mycroft.ai/ +[3]: https://account.mycroft.ai/devices +[4]: https://fedoramagazine.org/wp-content/uploads/2019/06/Screenshot_2019-06-14-Account.png +[5]: https://market.mycroft.ai/skills +[6]: https://mycroft.ai/contribute/ +[7]: https://unsplash.com/@pemmax?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/ai?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 8cb6bdf7ca7b3f1eb88cdcd3a83ef4e3c9b34f64 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 18 Jun 2019 11:56:12 +0800 Subject: [PATCH 0991/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190612=20Inst?= =?UTF-8?q?alling=20alternative=20versions=20of=20RPMs=20in=20Fedora=20sou?= =?UTF-8?q?rces/tech/20190612=20Installing=20alternative=20versions=20of?= =?UTF-8?q?=20RPMs=20in=20Fedora.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... alternative versions of RPMs in Fedora.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md diff --git a/sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md b/sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md new file mode 100644 index 0000000000..3e43304488 --- /dev/null +++ b/sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing alternative versions of RPMs in Fedora) +[#]: via: (https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/) +[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) + +Installing alternative versions of RPMs in Fedora +====== + +![][1] + +[Modularity][2] enables Fedora to provide alternative versions of RPM packages in the repositories. Several different applications, language runtimes, and tools are available in multiple versions, build natively for each Fedora release. + +The Fedora Magazine has already covered [Modularity in Fedora 28 Server Edition][3] about a year ago. Back then, it was just an optional repository with additional content, and as the title hints, only available to the Server Edition. A lot has changed since then, and now **Modularity is a core part of the Fedora distribution**. And some packages have moved to modules completely. At the time of writing — out of the 49,464 binary RPM packages in Fedora 30 — 1,119 (2.26%) come from a module ([more about the numbers][4]). + +### Modularity basics + +Because having too many packages in multiple versions could feel overwhelming (and hard to manage), packages are grouped into **modules** that represent an application, a language runtime, or any other sensible group. + +Modules often come in multiple **streams** — usually representing a major version of the software. Available in parallel, but only one stream of each module can be installed on a given system. + +And not to overwhelm users with too many choices, each Fedora release comes with a set of **defaults** — so decisions only need to be made when desired. + +Finally, to simplify installation, modules can be optionally installed using pre-defined **profiles** based on a use case. A database module, for example, could be installed as a client, a server, or both. + +### Modularity in practice + +When you install an RPM package on your Fedora system, chances are it comes from a module stream. The reason why you might not have noticed is one of the core principles of Modularity — remaining invisible until there is a reason to know about it. + +Let’s compare the following two situations. First, installing the popular _i3_ tiling window manager, and second, installing the minimalist _dwm_ window manager: + +``` +$ sudo dnf install i3 +... +Done! +``` + +As expected, the above command installs the _i3_ package and its dependencies on the system. Nothing else happened here. But what about the other one? + +``` +$ sudo dnf install dwm +... +Enabling module streams: + dwm 6.1 +... +Done! +``` + +It feels the same, but something happened in the background — the default _dwm_ module stream ( _6.1_ ) got enabled, and the _dwm_ package from the module got installed. + +To be transparent, there is a message about the module auto-enablement in the output. But other than that, the user doesn’t need to know anything about Modularity in order to use their system the way they always did. + +But what if they do? Let’s see how a different version of _dwm_ could have been installed instead. + +Use the following command to see what module streams are available: + +``` +$ sudo dnf module list +... +dwm latest ... +dwm 6.0 ... +dwm 6.1 [d] ... +dwm 6.2 ... +... +Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled +``` + +The output shows there are four streams of the _dwm_ module, _6.1_ being the default. + +To install the _dwm_ package in a different version — from the _6.2_ stream for example — enable the stream and then install the package by using the two following commands: + +``` +$ sudo dnf module enable dwm:6.2 +... +Enabling module streams: + dwm 6.2 +... +Done! +$ sudo dnf install dwm +... +Done! +``` + +Finally, let’s have a look at profiles, with PostgreSQL as an example. + +``` +$ sudo dnf module list +... +postgresql 9.6 client, server ... +postgresql 10 client, server ... +postgresql 11 client, server ... +... +``` + +To install PostgreSQL 11 as a server, use the following command: + +``` +$ sudo dnf module install postgresql:11/server +``` + +Note that — apart from enabling — modules can be installed with a single command when a profile is specified. + +It is possible to install multiple profiles at once. To add the client tools, use the following command: + +``` +$ sudo dnf module install postgresql:11/client +``` + +There are many other modules with multiple streams available to choose from. At the time of writing, there were 83 module streams in Fedora 30. That includes two versions of MariaDB, three versions of Node.js, two versions of Ruby, and many more. + +Please refer to the [official user documentation for Modularity][5] for a complete set of commands including switching from one stream to another. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/ + +作者:[Adam Šamalík][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/asamalik/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/modularity-f30-816x345.jpg +[2]: https://docs.pagure.org/modularity +[3]: https://fedoramagazine.org/modularity-fedora-28-server-edition/ +[4]: https://blog.samalik.com/2019/06/12/counting-modularity-packages.html +[5]: https://docs.fedoraproject.org/en-US/modularity/using-modules/ From 4a2245ea5768045cfdae8ad6abcecf78c8fab994 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 18 Jun 2019 11:56:30 +0800 Subject: [PATCH 0992/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190617=20KIT?= =?UTF-8?q?=20Scenarist=20is=20a=20Powerful=20Tool=20for=20Creating=20Scre?= =?UTF-8?q?enplays=20sources/tech/20190617=20KIT=20Scenarist=20is=20a=20Po?= =?UTF-8?q?werful=20Tool=20for=20Creating=20Screenplays.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Powerful Tool for Creating Screenplays.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20190617 KIT Scenarist is a Powerful Tool for Creating Screenplays.md diff --git a/sources/tech/20190617 KIT Scenarist is a Powerful Tool for Creating Screenplays.md b/sources/tech/20190617 KIT Scenarist is a Powerful Tool for Creating Screenplays.md new file mode 100644 index 0000000000..65f492420d --- /dev/null +++ b/sources/tech/20190617 KIT Scenarist is a Powerful Tool for Creating Screenplays.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (KIT Scenarist is a Powerful Tool for Creating Screenplays) +[#]: via: (https://itsfoss.com/kit-scenarist/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +KIT Scenarist is a Powerful Tool for Creating Screenplays +====== + +Did you ever wish that there was an open source tool for all your screenplay writing needs? Well, you are in luck. Today, we will be looking at an application that will do just that. Today, we will be looking at KIT Scenarist. + +### KIT Scenarist: An Open Source tool for writing screenplays + +[KIT Scenarist][1] is a program designed to be your one-stop-shop to create the next great screenplay. KIT Scenarist’s tools are split up into four modules: Research, Cards, Script, and Statistics. When you load KIT Scenarist for the first time after installing it, you will be asked if you want to enable each of these modules. You can also disable any of the modules from the setting menu. + +![Scenarist][2] + +The Research module gives you a place to store your story ideas, as well as, ideas and information for both characters and locations. You can also add images for a character or location to give you inspiration. + +The Cards module shows you the scenes that you have written or sketched out like cards on a cord board. You can drag these scenes around on the board to rearrange them. You can also jump to a certain scene or mark a scene as done. + +The Script module is where the actual writing takes place. It has a widget that tells you approximately how long your screenplay will take to perform. Like a word processor, you can tell KIT Scenarist what parts of the script are the actions, character, dialogue, etc and it will format it correctly. + +![Scenarist Research module][3] + +The Statistics module gives you all kinds of reports and graphs about your screenplay. The scene report shows how long each act is and what characters are in it. The location report shows how much time is spent at each location and in which acts. The cast report shows how many scenes each character is in and how much dialogue they have. There is even a report that lists all of the dialogue for each character. + +[][4] + +Suggested read Tilix: Advanced Tiling Terminal Emulator for Power Users + +Like all well-designed apps, KIT Scenarist has both a light and dark theme. The dark theme is the default. + +![Scenarist Statistics module][5] + +KIT Scenarist stores your projects in `.kitsp` files. These files are essentially SQLite database files with a different extension. This means that if you ever run into issues with KIT Scenarist, you can retrieve your information with an SQLite viewer. + +This application also allows you to import scripts from a wide range of script writing applications. You can import the following file formats: Final Draft Screenplay (.fdx), Final Draft Template (.fdxt), Trelby Screenplay (.trelby), [Fountain Text][6] (.foundation), Celtx Project (.celtx), .odt, . doc and .docx. You can export your outline and script to .docx, .pdf, .fdx. or .Fountain. + +The desktop version of KIT Scenarist is free, but they also have a couple of [Pro options][7]. They have a cloud service to collaborate with others or sync your work to other devices. The cloud service costs $4.99 for a month or $52.90 for a year. They have other subscription lengths. KIT Scenarist is available in the iOS app store or the Google Play store, but cost money there. Finally, if you are an organization who wants to use KIT Scenarist but it is missing a feature you want, they will add it if you finance the work. + +![Scenarist Cards module][8] + +### How to Install Scenarist + +Currently, the only repo that Scenarist is available for downloading is the [Arch User Repository][9]. (Arch rulez :D) + +Otherwise, you have to [download][10] a package installer from the website. They have packages available for Linux (both .deb and .rpm), Windows, and macOS. As I stated above, there are also versions available for both Android and iOS, but they are not free. You can find the source code of KIT Scenarist on GitHub. + +[KIT Scenarist on GitHub][11] + +If KIT Scenarist won’t start on your Linux system, try installing the `libxcb-xinerama0` package. + +![Scenarist Script][12] + +### Final Thoughts on KIT Scenarist + +KIT Scenarist offers the full script writing experience. All your information is stored in one place, so you don’t need to look everywhere for your information. It does everything. Now, the creator just needs to add a feature to submit your script directly to the person who will make you the next famous playwright. + +[][13] + +Suggested read Bookworm: A Simple yet Magnificent eBook Reader for Linux + +If KIT Scenarist looks too overwhelming and you want to try something simpler, I would recommend trying [Trelby][14]. If you are into writing, you may read my list of [useful open source tools for writers][15]. + +Have you every used KIT Scenarist? What is your favorite open source screenwriting tool? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][16]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kit-scenarist/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://kitscenarist.ru/en/index.html +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/scenarist-about.png?fit=800%2C469&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/scenarist-research.png?fit=800%2C371&ssl=1 +[4]: https://itsfoss.com/tilix-terminal-emulator/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/scenarist-statistics.png?fit=800%2C467&ssl=1 +[6]: https://www.fountain.io/ +[7]: https://kitscenarist.ru/en/pricing.html +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/scenarist-cards.png?fit=800%2C470&ssl=1 +[9]: https://aur.archlinux.org/packages/scenarist +[10]: https://kitscenarist.ru/en/download.html +[11]: https://github.com/dimkanovikov/kitscenarist +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/scenarist-script.png?fit=800%2C468&ssl=1 +[13]: https://itsfoss.com/bookworm-ebook-reader-linux/ +[14]: https://www.trelby.org/ +[15]: https://itsfoss.com/open-source-tools-writers/ +[16]: http://reddit.com/r/linuxusersgroup From 8de8fd0d5ac16f79a430c87dcf8f3426f1264f15 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 18 Jun 2019 11:58:04 +0800 Subject: [PATCH 0993/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190617=20Expl?= =?UTF-8?q?oring=20/run=20on=20Linux=20sources/tech/20190617=20Exploring?= =?UTF-8?q?=20-run=20on=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190617 Exploring -run on Linux.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20190617 Exploring -run on Linux.md diff --git a/sources/tech/20190617 Exploring -run on Linux.md b/sources/tech/20190617 Exploring -run on Linux.md new file mode 100644 index 0000000000..e2b497930c --- /dev/null +++ b/sources/tech/20190617 Exploring -run on Linux.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Exploring /run on Linux) +[#]: via: (https://www.networkworld.com/article/3403023/exploring-run-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Exploring /run on Linux +====== +There's been a small but significant change in how Linux systems work with respect to runtime data. +![Sandra Henry-Stocker][1] + +If you haven’t been paying close attention, you might not have noticed a small but significant change in how Linux systems work with respect to runtime data. A re-arrangement of how and where it’s accessible in the file system started taking hold about eight years ago. And while this change might not have been big enough of a splash to wet your socks, it provides some additional consistency in the Linux file system and is worthy of some exploration. + +To get started, cd your way over to /run. If you use df to check it out, you’ll see something like this: + +``` +$ df -k . +Filesystem 1K-blocks Used Available Use% Mounted on +tmpfs 609984 2604 607380 1% /run +``` + +Identified as a “tmpfs” (temporary file system), we know that the files and directories in /run are not stored on disk but only in volatile memory. They represent data kept in memory (or disk-based swap) that takes on the appearance of a mounted file system to allow it to be more accessible and easier to manage. + +**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** + +/run is home to a wide assortment of data. For example, if you take a look at /run/user, you will notice a group of directories with numeric names. + +``` +$ ls /run/user +1000 1002 121 +``` + +A long file listing will clarify the significance of these numbers. + +``` +$ ls -l +total 0 +drwx------ 5 shs shs 120 Jun 16 12:44 1000 +drwx------ 5 dory dory 120 Jun 16 16:14 1002 +drwx------ 8 gdm gdm 220 Jun 14 12:18 121 +``` + +This allows us to see that each directory is related to a user who is currently logged in or to the display manager, gdm. The numbers represent their UIDs. The content of each of these directories are files that are used by running processes. + +The /run/user files represent only a very small portion of what you’ll find in /run. There are lots of other files, as well. A handful contain the process IDs for various system processes. + +``` +$ ls *.pid +acpid.pid atopacctd.pid crond.pid rsyslogd.pid +atd.pid atop.pid gdm3.pid sshd.pid +``` + +As shown below, that sshd.pid file listed above contains the process ID for the ssh daemon (sshd). + +``` +$ cat sshd.pid +1148 +$ ps -ef | grep sshd +root 1148 1 0 Jun14 ? 00:00:00 /usr/sbin/sshd -D <== +root 10784 1148 0 12:44 ? 00:00:00 sshd: shs [priv] +shs 10922 10784 0 12:44 ? 00:00:00 sshd: shs@pts/0 +root 18109 1148 0 16:13 ? 00:00:00 sshd: dory [priv] +dory 18232 18109 0 16:14 ? 00:00:00 sshd: dory@pts/1 +shs 19276 10923 0 16:50 pts/0 00:00:00 grep --color=auto sshd +``` + +Some of the subdirectories within /run can only be accessed with root authority such as /run/sudo. Running as root, for example, we can see some files related to real or attempted sudo usage: + +``` +/run/sudo/ts# ls -l +total 8 +-rw------- 1 root dory 112 Jun 16 16:37 dory +-rw------- 1 root shs 168 Jun 17 08:33 shs +``` + +In keeping with the shift to using /run, some of the old locations for runtime data are now symbolic links. /var/run is now a pointer to /run and /var/lock a pointer to /run/lock, allowing old references to work as expected. + +``` +$ ls -l /var +total 52 +drwxr-xr-x 2 root root 4096 Jun 17 07:36 backups +drwxr-xr-x 19 root root 4096 Apr 18 13:46 cache +drwxrwsrwt 2 root whoopsie 4096 Jun 13 07:39 crash +drwxr-xr-x 75 root root 4096 Jun 9 15:14 lib +drwxrwsr-x 2 root staff 4096 Oct 16 2017 local +lrwxrwxrwx 1 root root 9 May 14 2018 lock -> /run/lock +drwxrwxr-x 17 root syslog 4096 Jun 17 00:00 log +drwxrwsrwt 2 root mail 4096 Jun 13 12:10 mail +drwxrwsrwt 2 root whoopsie 4096 Jan 5 2018 metrics +drwxr-xr-x 2 root root 4096 Jan 5 2018 opt +lrwxrwxrwx 1 root root 4 May 14 2018 run -> /run +drwxr-xr-x 9 root root 4096 Jun 16 2018 snap +drwxr-xr-x 9 root root 4096 Jun 9 15:14 spool +drwxrwxrwt 8 root root 4096 Jun 17 00:00 tmp +drwxr-xr-x 3 root root 4096 Jan 19 12:14 www +``` + +While minor as far as technical changes go, the transition to using /run simply allows for a better organization of runtime data in the Linux file system. + +**[ Now read this:[Invaluable tips and tricks for troubleshooting Linux][3] ]** + +Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403023/exploring-run-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/06/exploring_run-100799398-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From c9d8fc727dce9f476b2c6c96508a76171496d1bb Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 18 Jun 2019 12:02:27 +0800 Subject: [PATCH 0994/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190617=205=20?= =?UTF-8?q?transferable=20higher-education=20skills=20sources/talk/2019061?= =?UTF-8?q?7=205=20transferable=20higher-education=20skills.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 5 transferable higher-education skills.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20190617 5 transferable higher-education skills.md diff --git a/sources/talk/20190617 5 transferable higher-education skills.md b/sources/talk/20190617 5 transferable higher-education skills.md new file mode 100644 index 0000000000..db0f584aaf --- /dev/null +++ b/sources/talk/20190617 5 transferable higher-education skills.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 transferable higher-education skills) +[#]: via: (https://opensource.com/article/19/6/5-transferable-higher-education-skills) +[#]: author: (Stephon Brown https://opensource.com/users/stephb) + +5 transferable higher-education skills +====== +If you're moving from the Ivory Tower to the Matrix, you already have +the foundation for success in the developer role. +![Two hands holding a resume with computer, clock, and desk chair ][1] + +My transition from a higher-education professional into the tech realm was comparable to moving from a pond into an ocean. There was so much to learn, and after learning, there was still so much more to learn! + +Rather than going down the rabbit hole and being overwhelmed by what I did not know, in the last two to three months, I have been able to take comfort in the realization that I was not entirely out of my element as a developer. The skills I acquired during my six years as a university professional gave me the foundation to be successful in the developer role. + +These skills are transferable in any direction you plan to go within or outside tech, and it's valuable to reflect on how they apply to your new position. + +### 1\. Composition and documentation + +Higher education is replete with opportunities to develop skills related to composition and communication. In most cases, clear writing and communication are mandatory requirements for university administrative and teaching positions. Although you may not yet be well-versed in deep technical concepts, learning documentation and writing your progress may be two of the strongest skills you bring as a former higher education administrator. All of those "In response to…" emails will finally come in handy when describing the inner workings of a class or leaving succinct comments for other developers to follow what you have implemented. + +### 2\. Problem-solving and critical thinking + +Whether you've been an adviser who sits with students and painstakingly develops class schedules for graduation or a finance buff who balances government funds, you will not leave critical thinking behind as you transition into a developer role. Although your critical thinking may have seemed specialized for your work, the skill of turning problems into opportunities is not lost when contributing to code. The experience gained while spending long days and nights revising recruitment strategies will be necessary when composing algorithms and creative ways of delivering data. Continue to foster a passion for solving problems, and you will not have any trouble becoming an efficient and skillful developer. + +### 3\. Communication + +Though it may seem to overlap with writing (above), communication spans verbal and written disciplines. When you're interacting with clients and leadership, you may have a leg up over your peers because of your higher-education experience. Being approachable and understanding how to manage interactions are skills that some software practitioners may not have fostered to an impactful level. Although you will experience days of staring at a screen and banging your head against the keyboard, you can rest well in knowing you can describe technical concepts and interact with a wide range of audiences, from clients to peers. + +### 4\. Leadership + +Sitting on that panel; planning that event; leading that workshop. All of those experiences provide you with the grounding to plan and lead smaller projects as a new developer. Leadership is not limited to heading up large and small teams; its essence lies in taking initiative. This can be volunteering to do research on a new feature or do more extensive unit tests for your code. However you use it, your foundation as an educator will allow you to go further in technology development and maintenance. + +### 5\. Research + +You can Google with the best of them. Being able to clearly truncate your query into the idea you are searching for is characteristic of a higher-education professional. Most administrator or educator jobs focus on solving problems in a defined process for qualitative, quantitative, or mixed results; therefore, cultivating your scientific mind is valuable when providing software solutions. Your research skills also open opportunities for branching into data science and machine learning. + +### Bonus: Collaboration + +Being able to reach across various offices and fields for event planning and program implementation fit well within team collaboration—both within your new team and across development teams. This may leak into the project management realm, but being able to plan and divide work between teams and establish accountability will allow you as a new developer to understand the software development lifecycle process a little more intimately because of your past related experience. + +### Summary + +As a developer jumping head-first into technology after years of walking students through the process of navigating higher education, [imposter syndrome][2] has been a constant fear since moving into technology. However, I have been able to take heart in knowing my experience as an educator and an administrator has not gone in vain. If you are like me, be encouraged in knowing that these transferable skills, some of which fall into the soft-skills and other categories, will continue to benefit you as a developer and a professional. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/5-transferable-higher-education-skills + +作者:[Stephon Brown][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/stephb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) +[2]: https://en.wikipedia.org/wiki/Impostor_syndrome From 234fe8fe1808648d7debf209bdba73e60955c7f6 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 18 Jun 2019 12:02:57 +0800 Subject: [PATCH 0995/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190617=20Use?= =?UTF-8?q?=20ImageGlass=20to=20quickly=20view=20JPG=20images=20as=20a=20s?= =?UTF-8?q?lideshow=20sources/talk/20190617=20Use=20ImageGlass=20to=20quic?= =?UTF-8?q?kly=20view=20JPG=20images=20as=20a=20slideshow.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... quickly view JPG images as a slideshow.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sources/talk/20190617 Use ImageGlass to quickly view JPG images as a slideshow.md diff --git a/sources/talk/20190617 Use ImageGlass to quickly view JPG images as a slideshow.md b/sources/talk/20190617 Use ImageGlass to quickly view JPG images as a slideshow.md new file mode 100644 index 0000000000..31820a380b --- /dev/null +++ b/sources/talk/20190617 Use ImageGlass to quickly view JPG images as a slideshow.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use ImageGlass to quickly view JPG images as a slideshow) +[#]: via: (https://opensource.com/article/19/6/use-imageglass-view-jpg-images-slideshow-windows-10) +[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) + +Use ImageGlass to quickly view JPG images as a slideshow +====== +Want to view images from a folder one-by-one in a slideshow on Windows +10? Open source to the rescue. +![Looking back with binoculars][1] + +Welcome to today’s episode of "How Can I Make This Work?" In my case, I was trying to view a folder of JPG images as a slideshow on Windows 10. As often happens, I turned to open source to solve the issue. + +On a Mac, viewing a folder of JPG images as a slideshow is a simple matter of selecting all the images in a folder ( **Command-A** ), and then pressing **Option-Command-Y**. From there, you can advance the images with the arrow key. Of course, you can do a similar thing on Windows by selecting the first image, then clicking on the window frame's yellow **Manage** bar, then selecting **Slide Show**. There, you can control the speed, but only to a point: slow, medium, and fast. + +I wanted to advance the images in Windows the same way I do it on a Mac. Naturally, I fired up the Googler and searched for a solution. There, I found the [ImageGlass][2] open source app, [licensed GPL 3.0][3], and it did the trick perfectly. Here's what it looks like: + +![Viewing an image in ImageGlass.][4] + +### About ImageGlass + +ImageGlass was developed by Dương Diệu Pháp, a Vietnamese developer who works on the front end for Chainstack, according to his website. He collaborates with US-based [Kevin Routley][5], who "develops new features for ImageGlass." The source code is available on [GitHub][6]. + +ImageGlass supports most common image formats, including JPG, GIF, PNG, WEBP, SVG, and RAW. Users can customize this extension list easily. + +My specific problem was needing to find an image for a catalog cover. Unfortunately, it was in a folder containing dozens of photos. Navigating through the slideshow in ImageGlass, stopping on the image I wanted, and downloading it into my project folder turned out to be easy. Open source to the rescue yet again, and the app took only seconds to download and use. + +ImageGlass was featured as a Picasa alternative in Jason Baker’s article [9 open source alternatives to][7] [Picasa][7] from March 10, 2016. There are some other interesting image-related open source tools in there as well if you are in need. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/use-imageglass-view-jpg-images-slideshow-windows-10 + +作者:[Jeff Macharyas][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/jeffmacharyas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/look-binoculars-sight-see-review.png?itok=NOw2cm39 (Looking back with binoculars) +[2]: https://imageglass.org/ +[3]: https://github.com/d2phap/ImageGlass/blob/master/LICENSE +[4]: https://opensource.com/sites/default/files/uploads/imageglass-screenshot.png (Viewing an image in ImageGlass.) +[5]: https://github.com/fire-eggs +[6]: https://github.com/d2phap/ImageGlass +[7]: https://opensource.com/alternatives/picasa From 1b90541d351b3889671b4a19552ee0c1e1ec3f19 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 18 Jun 2019 12:04:51 +0800 Subject: [PATCH 0996/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190618=20Cylo?= =?UTF-8?q?n=20=E2=80=93=20The=20Arch=20Linux=20Maintenance=20Program=20Fo?= =?UTF-8?q?r=20Newbies=20sources/tech/20190618=20Cylon=20-=20The=20Arch=20?= =?UTF-8?q?Linux=20Maintenance=20Program=20For=20Newbies.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...h Linux Maintenance Program For Newbies.md | 257 ++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 sources/tech/20190618 Cylon - The Arch Linux Maintenance Program For Newbies.md diff --git a/sources/tech/20190618 Cylon - The Arch Linux Maintenance Program For Newbies.md b/sources/tech/20190618 Cylon - The Arch Linux Maintenance Program For Newbies.md new file mode 100644 index 0000000000..6843910f91 --- /dev/null +++ b/sources/tech/20190618 Cylon - The Arch Linux Maintenance Program For Newbies.md @@ -0,0 +1,257 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cylon – The Arch Linux Maintenance Program For Newbies) +[#]: via: (https://www.ostechnix.com/cylon-arch-linux-maintenance-program/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Cylon – The Arch Linux Maintenance Program For Newbies +====== + +![Cylon is an Arch Linux Maintenance Program][1] + +Recently switched to Arch Linux as your daily driver? Great! I’ve got a good news for you. Meet **Cylon** , a maintenance program for Arch Linux and derivatives. It is a menu-driven **Bash** script which provides updates, maintenance, backups and system checks for Arch Linux and its derivatives such as Manjaro Linux etc. Cylon is mainly a CLI program, and also has a basic dialog GUI. In this guide, we will see how to install and use Cylon in Arch Linux. + +### Cylon – The Arch Linux Maintenance Program + +##### Install Cylon + +Cylon is available in the [**AUR**][2]. You can install it using any AUR helpers, for example [**Yay**][3]. + +``` +$ yay -S cylon +``` + +##### Usage + +Please note that Cylon _**will not install all tools**_ by default. Some functions require various dependencies packages to be installed. There are three dependencies and the rest are optional dependencies. The optional dependencies are left to user discretion. When you perform a function, it will display the missing packages if there are any. All missing packages will be shown as **n/a** (not available) in menus. You need to install the missing packages by yourself before using such functions. + +To launch Cylon, type _**cylon**_ in the Terminal: + +``` +$ cylon +``` + +Sample output from my Arch linux system: + +![][4] + +Default interface of Cylon, the Arch Linux maintenance program + +You can also launch Cylon from the Menu. It usually found under **Applications > System Tools**. + +As you see in the above screenshot, there are **14** menu entries in Cylon main menu to perform different functions. To go to each entry, type the respective number. Also, as you see in the screenshot, there is **n/a** besides the 2 and 3 menu entries which means **auracle** and [**Trizen**][5] are not installed. You need to install them first before performing those functions. + +Let us see what each menu entry does. + +**1\. Pacman** + +Under [**Pacman**][6] section, you can do various package management operations such as install, update, upgrade, verify, remove packages, display package information, view Arch Linux news feed and many. Just type a number to perform the respective action. + +![][7] + +You can go back to main menu by typing the number **21**. + +**2. auracle +** + +The **auracle** is an AUR helper program that can be used to perform various AUR actions such as install, update, download, search, remove AUR packages in your Arch linux box. + +**3\. trizen** + +It is same as above section. + +**4\. System Update** + +As the name says, this section is dedicated to perform Arch Linux update. Here you can update both the official and AUR packages. Cylon gives you the following four options in this section. + + 1. Update Arch Main Repos only, + 2. Update AUR only, + 3. Update All repos, + 4. No Update and exit. + + + +![][8] + +**5\. System Maintenance** + +In this section, you can do the following maintenance tasks. + + 1. Failed Systemd Services and status, + 2. Check Journalctl log for Errors, + 3. Check Journalctl for fstrim SSD trim, + 4. Analyze system boot-up performance, + 5. Check for Broken Symlinks, + 6. Find files where no group or User corresponds to file’s numeric ID, + 7. lostfiles, + 8. Diskspace usage, + 9. Find 200 of the biggest files, + 10. Find inodes usage, + 11. Old configuration files scan, + 12. Print sensors information, + 13. Clean journal files, + 14. Delete core dumps /var/lib/systemd/coredump/, + 15. Delete files, + 16. bleachbit n/a, + 17. rmlint n/a, + 18. List All Open Files, + 19. DMI table decoder, + 20. Return. + + + +The non-installed packages will be shown with letters n/a besides that applications. You need to install them first before choosing that particular action. + +** **Recommended Download** – [**Free Video: “Penetration Testing Methodologies Training Course (a $99 value!) FREE”**][9] + +**6\. System backup** + +This section provides backup utilities such as **rsync** to backup your Arch Linux system. Also, there is a custom backup options which allows you to manually backup files/folders to a user-specified location. + +![][10] + +**7\. System Security** + +Cylon provides various security tools including the following: + + 1. ccrypt – Encrypt/decrypt files, + 2. clamav – Antivirus, + 3. rkhunter – RootKit hunter scan, + 4. lynis – System audit tool, + 5. Password generator, + 6. List the password aging info of a user, + 7. Audit SUID/SGID Files. + + + +Remember you need to install them yourself in order to use them. Cylon will not help you to install the missing packages. + +**8\. Network Maintenance** + +This section is for network related functions. Here, you can: + + 1. See wifi link quality continuously on screen, + 2. Use speedtest-cli -testing internet bandwidth, + 3. Check if website up with netcat and ping, + 4. Display all interfaces which are currently available, + 5. Display kernal routing table, + 6. Check the status of UFW, Uncomplicated Firewall, + 7. Network Time Synchronization status check, + 8. traceroute print route packets trace to network host, + 9. tracepath traces path to a network host, + 10. View all open ports + + + +**9\. xterm terminal** + +Here, you can launch xterm terminal at output folder path in new window. + +**10\. View/Edit config file** + +View and edit the configuration files if necessary. + +**11\. System information** + +This is most useful feature of Cylon utlity. This section provides your Arch Linux system’s information such as, + + * Uptime, + * Kernel details, + * OS architecture, + * Username, + * Default Shell, + * Screen resolution, + * CPU, + * RAM (used/total), + * Editor variable, + * Location of pacman cache folder, + * Hold packages, + * Number of orphan packages, + * Total number of installed packages, + * Number of all explicitly installed packages, + * All foreign installed packages, + * All foreign explicitly installed packages, + * All packages installed as dependencies, + * Top 5 largest packages, + * 5 newest updated packages, + * Packages Installed size by repositories. + + + +![][11] + +**12\. Cylon information** + +It will display the information about Cylon program. It also performs the dependencies installation check and display the list of installed non-installed dependencies. + +![][12] + +**13\. Weather** + +It displays the 3 day weather forecast by **wttr.in** utility. + +* * * + +**Related Read:** + + * **[How To Check Weather Details From Command Line In Linux][13]** + + + +* * * + +**14\. Exit** + +Type **14** to exit Cylon. + +For more details, type **cylon -h** in the Terminal to print cylon information. + +* * * + +**Recommended read:** + + * [**Cylon-deb : The Debian Linux Maintenance Program**][14] + + + +* * * + +Cylon script offers a lot of tools and features to maintain your Arch Linux system. If you’re new to Arch Linux, give it a try and see if it helps. + +**Resource:** + + * [**Cylon GitHub page**][15] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/cylon-arch-linux-maintenance-program/ + +作者:[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/2017/06/Cylon-The-Arch-Linux-Maintenance-Program-720x340.png +[2]: https://aur.archlinux.org/packages/cylon/ +[3]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[4]: http://www.ostechnix.com/wp-content/uploads/2017/06/cylon-interface.png +[5]: https://www.ostechnix.com/trizen-lightweight-aur-package-manager-arch-based-systems/ +[6]: https://www.ostechnix.com/getting-started-pacman/ +[7]: http://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-pacman.png +[8]: http://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-system-update.png +[9]: https://ostechnix.tradepub.com/free/w_cybf03/prgm.cgi +[10]: http://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-system-backup.png +[11]: http://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-system-information.png +[12]: http://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-information.png +[13]: https://www.ostechnix.com/check-weather-details-command-line-linux/ +[14]: https://www.ostechnix.com/cylon-deb-debian-linux-maintenance-program/ +[15]: https://github.com/gavinlyonsrepo/cylon From 429290251d78637ccb1ccc61baacf079b2e7e200 Mon Sep 17 00:00:00 2001 From: chen ni Date: Tue, 18 Jun 2019 13:55:20 +0800 Subject: [PATCH 0997/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...508 Why startups should release their code as open source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190508 Why startups should release their code as open source.md b/sources/tech/20190508 Why startups should release their code as open source.md index f877964b5f..c62664da90 100644 --- a/sources/tech/20190508 Why startups should release their code as open source.md +++ b/sources/tech/20190508 Why startups should release their code as open source.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chen-ni) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 282bd926b8026b3eb809ce5a604ab58770ee171e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 18 Jun 2019 14:50:58 +0800 Subject: [PATCH 0998/1154] =?UTF-8?q?Revert=20"=E9=80=89=E9=A2=98:=2020190?= =?UTF-8?q?617=20How=20To=20Find=20Linux=20System=20Details=20Using=20inxi?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...To Find Linux System Details Using inxi.md | 608 ------------------ 1 file changed, 608 deletions(-) delete mode 100644 sources/tech/20190617 How To Find Linux System Details Using inxi.md diff --git a/sources/tech/20190617 How To Find Linux System Details Using inxi.md b/sources/tech/20190617 How To Find Linux System Details Using inxi.md deleted file mode 100644 index 0acb049b91..0000000000 --- a/sources/tech/20190617 How To Find Linux System Details Using inxi.md +++ /dev/null @@ -1,608 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Find Linux System Details Using inxi) -[#]: via: (https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -How To Find Linux System Details Using inxi -====== - -![find Linux system details using inxi][1] - -**Inxi** is a free, open source, and full featured command line system information tool. It shows system hardware, CPU, drivers, Xorg, Desktop, Kernel, GCC version(s), Processes, RAM usage, and a wide variety of other useful information. Be it a hard disk or CPU, mother board or the complete detail of the entire system, inxi will display it more accurately in seconds. Since it is CLI tool, you can use it in Desktop or server edition. Inxi is available in the default repositories of most Linux distributions and some BSD systems. - -### Install inxi - -**On Arch Linux and derivatives:** - -To install inxi in Arch Linux or its derivatives like Antergos, and Manajaro Linux, run: - -``` -$ sudo pacman -S inxi -``` - -Just in case if Inxi is not available in the default repositories, try to install it from AUR (It varies year to year) using any AUR helper programs. - -Using [**Yay**][2]: - -``` -$ yay -S inxi -``` - -**On Debian / Ubuntu and derivatives:** - -``` -$ sudo apt-get install inxi -``` - -**On Fedora / RHEL / CentOS / Scientific Linux:** - -inxi is available in the Fedora default repositories. So, just run the following command to install it straight away. - -``` -$ sudo dnf install inxi -``` - -In RHEL and its clones like CentOS and Scientific Linux, you need to add the EPEL repository and then install inxi. - -To install EPEL repository, just run: - -``` -$ sudo yum install epel-release -``` - -After installing EPEL repository, install inxi using command: - -``` -$ sudo yum install inxi -``` - -**On SUSE/openSUSE:** - -``` -$ sudo zypper install inxi -``` - -### Find Linux System Details Using inxi - -inxi will require some additional programs to operate properly. They will be installed along with inxi. However, in case if they are not installed automatically, you need to find and install them. - -To list all required programs, run: - -``` -$ inxi --recommends -``` - -If you see any missing programs, then install them before start using inxi. - -Now, let us see how to use it to reveal the Linux system details. inxi usage is pretty simple and straight forward. - -Open up your Terminal and run the following command to print a short summary of CPU, memory, hard drive and kernel information: - -``` -$ inxi -``` - -**Sample output:** - -``` -CPU: Dual Core Intel Core i3-2350M (-MT MCP-) speed/min/max: 798/800/2300 MHz -Kernel: 5.1.2-arch1-1-ARCH x86_64 Up: 1h 31m Mem: 2800.5/7884.2 MiB (35.5%) -Storage: 465.76 GiB (80.8% used) Procs: 163 Shell: bash 5.0.7 inxi: 3.0.34 -``` - -[![Find Linux System Details Using inxi][1]][3] - -Find Linux System Details Using inxi - -As you can see, Inxi displays the following details of my Arch Linux desktop: - - 1. CPU type, - 2. CPU speed, - 3. Kernel details, - 4. Uptime, - 5. Memory details (Total and used memory), - 6. Hard disk size along with current usage, - 7. Procs, - 8. Default shell details, - 9. Inxi version. - - - -To display full summary, use **“-F”** switch as shown below. - -``` -$ inxi -F -``` - -**Sample output:** - -``` -System: Host: sk Kernel: 5.1.2-arch1-1-ARCH x86_64 bits: 64 Desktop: Deepin 15.10.1 Distro: Arch Linux -Machine: Type: Portable System: Dell product: Inspiron N5050 v: N/A serial: - Mobo: Dell model: 01HXXJ v: A05 serial: BIOS: Dell v: A05 date: 08/03/2012 -Battery: ID-1: BAT0 charge: 39.0 Wh condition: 39.0/48.8 Wh (80%) -CPU: Topology: Dual Core model: Intel Core i3-2350M bits: 64 type: MT MCP L2 cache: 3072 KiB - Speed: 798 MHz min/max: 800/2300 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798 -Graphics: Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel - Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: vesa resolution: 1366x768~60Hz - Message: Unable to show advanced data. Required tool glxinfo missing. -Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel - Sound Server: ALSA v: k5.1.2-arch1-1-ARCH -Network: Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 - IF: enp5s0 state: down mac: 45:c8:gh:89:b6:45 - Device-2: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k - IF: wlp9s0 state: up mac: c3:11:96:22:87:3g - Device-3: Qualcomm Atheros AR3011 Bluetooth type: USB driver: btusb -Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) - ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB -Partition: ID-1: / size: 456.26 GiB used: 376.25 GiB (82.5%) fs: ext4 dev: /dev/sda2 - ID-2: /boot size: 92.8 MiB used: 62.9 MiB (67.7%) fs: ext4 dev: /dev/sda1 - ID-3: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 -Sensors: System Temperatures: cpu: 58.0 C mobo: N/A - Fan Speeds (RPM): cpu: 3445 -Info: Processes: 169 Uptime: 1h 38m Memory: 7.70 GiB used: 2.94 GiB (38.2%) Shell: bash inxi: 3.0.34 -``` - -Inxi used on IRC automatically filters out your network device MAC address, WAN and LAN IP, your /home username directory in partitions, and a few other items in order to maintain basic privacy and security. You can also trigger this filtering with the **-z** option like below. - -``` -$ inxi -Fz -``` - -To override the IRC filter, use the **-Z** option. - -``` -$ inxi -FZ -``` - -This can be useful in debugging network connection issues online in a private chat, for example. Please be very careful while using -Z option. It will display your MAC addresses. You shouldn’t share the results got with -Z option in public forums. - -##### Displaying device-specific details - -When running inxi without any options, you will get basic details of your system, such as CPU, Memory, Kernel, Uptime, harddisk etc. - -You can, of course, narrow down the result to show specific device details using various options. Inxi has numerous options (both uppercase and lowercase). - -First, we will see example commands for all uppercase options in alphabetical order. Some commands may require root/sudo privileges to get actual data. - -####### **Uppercase options** - -**1\. Display Audio/Sound card details** - -To show your audio and sound card(s) information with sound card driver, use **-A** option. - -``` -$ inxi -A -Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel - Sound Server: ALSA v: k5.1.2-arch1-1-ARCH -``` - -**2\. Display Battery details** - -To show battery details of your system with current charge and condition, use **-B** option. - -``` -$ inxi -B -Battery: ID-1: BAT0 charge: 39.0 Wh condition: 39.0/48.8 Wh (80%) -``` - -**3\. Display CPU details** - -To show complete CPU details including no of cores, CPU model, CPU cache, CPU clock speed, CPU min/max speed etc., use **-C** option. - -``` -$ inxi -C -CPU: Topology: Dual Core model: Intel Core i3-2350M bits: 64 type: MT MCP L2 cache: 3072 KiB - Speed: 798 MHz min/max: 800/2300 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798 -``` - -**4\. Display hard disk details** - -To show information about your hard drive, such as Disk type, vendor, device ID, model, disk size, total disk space, used percentage etc., use **-D** option. - -``` -$ inxi -D -Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) - ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB -``` - -**5\. Disply Graphics details** - -To show details about the graphics card, including details of grahics card, driver, vendor, display server, resolution etc., use **-G** option. - -``` -$ inxi -G -Graphics: Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel - Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: vesa resolution: 1366x768~60Hz - Message: Unable to show advanced data. Required tool glxinfo missing. -``` - -**6\. Display details about processes, uptime, memory, inxi version** - -To show information about no of processes, total uptime, total memory with used memory, Shell details and inxi version etc., use **-I** option. - -``` -$ inxi -I -Info: Processes: 170 Uptime: 5h 47m Memory: 7.70 GiB used: 3.27 GiB (42.4%) Shell: bash inxi: 3.0.34 -``` - -**7\. Display Motherboard details** - -To show information about your machine details, manufacturer, motherboard, BIOS, use **-M** option. - -``` -$ inxi -M -Machine: Type: Portable System: Dell product: Inspiron N5050 v: N/A serial: - Mobo: Dell model: 034ygt v: A018 serial: BIOS: Dell v: A001 date: 09/04/2015 -``` - -**8\. Display network card details** - -To show information about your network card, including vendor, card driver and no of network interfaces etc., use **-N** option. - -``` -$ inxi -N -Network: Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 - Device-2: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k - Device-3: Qualcomm Atheros AR3011 Bluetooth type: USB driver: btusb -``` - -If you want to show the advanced details of the network cards, such as MAC address, speed and state of nic, use **-n** option. - -``` -$ inxi -n -``` - -Please careful sharing this details on public forum. - -**9\. Display Partition details** - -To display basic partition information, use **-P** option. - -``` -$ inxi -P -Partition: ID-1: / size: 456.26 GiB used: 376.25 GiB (82.5%) fs: ext4 dev: /dev/sda2 - ID-2: /boot size: 92.8 MiB used: 62.9 MiB (67.7%) fs: ext4 dev: /dev/sda1 - ID-3: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 -``` - -To show full partition information including mount points, use **-p** option. - -``` -$ inxi -p -``` - -**10\. Display RAID details** - -To show RAID info, use **-R** option. - -``` -$ inxi -R -``` - -**11\. Display system details** - -To show Linux system information such as hostname, kernel, DE, OS version etc., use **-S** option. - -``` -$ inxi -S -System: Host: sk Kernel: 5.1.2-arch1-1-ARCH x86_64 bits: 64 Desktop: Deepin 15.10.1 Distro: Arch Linux -``` - -**12\. Displaying weather details** - -Inixi is not just for finding hardware details. It is useful for getting other stuffs too. - -For example, you can display the weather details of a given location. To do so, run inxi with **-W** option like below. - -``` -$ inxi -W 95623,us -Weather: Temperature: 21.1 C (70 F) Conditions: Scattered clouds Current Time: Tue 11 Jun 2019 04:34:35 AM PDT - Source: WeatherBit.io -``` - -Please note that you should use only ASCII letters in city/state/country names to get valid results. - -####### Lowercase options - -**1\. Display basic system details** - -To show only the basic summary of your system details, use **-b** option. - -``` -$ inxi -b -``` - -Alternatively, you can use this command: - -Both servers the same purpose. - -``` -$ inxi -v 2 -``` - -**2\. Set color scheme** - -We can set different color schemes for inxi output using **-c** option. Yu can set color scheme number from **0** to **42**. If no scheme number is supplied, **0** is assumed. - -Here is inxi output with and without **-c** option. - -[![inxi output without color scheme][1]][4] - -inxi output without color scheme - -As you can see, when we run inxi with -c option, the color scheme is disabled. The -c option is useful to turnoff colored output when redirecting clean output without escape codes to a text file. - -Similarly, we can use other color scheme values. - -``` -$ inxi -c10 - -$ inxi -c42 -``` - -**3\. Display optical drive details** - -We can show the optical drive data details along with local hard drive details using **-d** option. - -``` -$ inxi -d -Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) - ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB - Optical-1: /dev/sr0 vendor: PLDS model: DVD+-RW DS-8A8SH dev-links: cdrom - Features: speed: 24 multisession: yes audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram -``` - -**4\. Display all CPU flags** - -To show all CPU flags used, run: - -``` -$ inxi -f -``` - -**5\. Display IP details** - -To show WAN and local ip address along network card details such as device vendor, driver, mac, state etc., use **-i** option. - -``` -$ inxi -i -``` - -**6\. Display partition labels** - -If you have set labels for the partitions, you can view them using **-l** option. - -``` -$ inxi -l -``` - -You can also view the labels of all partitions along with mountpoints using command: - -``` -$ inxi -pl -``` - -**7\. Display Memory details** - -We can display memory details such as total size of installed RAM, how much memory is used, no of available DIMM slots, total size of supported RAM, how much RAM is currently installed in each slots etc., using **-m** option. - -``` -$ sudo inxi -m -[sudo] password for sk: -Memory: RAM: total: 7.70 GiB used: 2.26 GiB (29.3%) - Array-1: capacity: 16 GiB slots: 2 EC: None - Device-1: DIMM_A size: 4 GiB speed: 1067 MT/s - Device-2: DIMM_B size: 4 GiB speed: 1067 MT/s -``` - -**8\. Display unmounted partition details** - -To show unmounted partition details, use **-o** option. - -``` -$ inxi -o -``` - -If there were no unmounted partitions in your system, you will see an output something like below. - -``` -Unmounted: Message: No unmounted partitions found. -``` - -**9\. Display list of repositories** - -To display the the list of repositories in your system, use **-r** option. - -``` -$ inxi -r -``` - -**Sample output:** - -``` -Repos: Active apt sources in file: /etc/apt/sources.list -deb http://in.archive.ubuntu.com/ubuntu/ xenial main restricted -deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted -deb http://in.archive.ubuntu.com/ubuntu/ xenial universe -deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe -deb http://in.archive.ubuntu.com/ubuntu/ xenial multiverse -deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse -deb http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse -deb http://security.ubuntu.com/ubuntu xenial-security main restricted -deb http://security.ubuntu.com/ubuntu xenial-security universe -deb http://security.ubuntu.com/ubuntu xenial-security multiverse -``` - -* * * - -**Suggested read:** - - * [**How To Find The List Of Installed Repositories From Commandline In Linux**][5] - - - -* * * - -**10\. Show system temperature, fan speed details** - -Inxi is capable to find motherboard/CPU/GPU temperatures and fan speed. - -``` -$ inxi -s -Sensors: System Temperatures: cpu: 60.0 C mobo: N/A - Fan Speeds (RPM): cpu: 3456 -``` - -Please note that Inxi requires sensors to find the system temperature. Make sure **lm_sensors** is installed and correctly configured in your system. For more details about lm_sensors, check the following guide. - - * [**How To View CPU Temperature On Linux**][6] - - - -**11\. Display details about processes** - -To show the list processes top 5 processes which are consuming most CPU and Memory, simply run: - -``` -$ inxi -t -Processes: CPU top: 5 - 1: cpu: 14.3% command: firefox pid: 15989 - 2: cpu: 10.5% command: firefox pid: 13487 - 3: cpu: 7.1% command: firefox pid: 15062 - 4: cpu: 3.1% command: xorg pid: 13493 - 5: cpu: 3.0% command: firefox pid: 14954 - System RAM: total: 7.70 GiB used: 2.99 GiB (38.8%) - Memory top: 5 - 1: mem: 1115.8 MiB (14.1%) command: firefox pid: 15989 - 2: mem: 606.6 MiB (7.6%) command: firefox pid: 13487 - 3: mem: 339.3 MiB (4.3%) command: firefox pid: 13630 - 4: mem: 303.1 MiB (3.8%) command: firefox pid: 18617 - 5: mem: 260.1 MiB (3.2%) command: firefox pid: 15062 -``` - -We can also sort this output by either CPU usage or Memory usage. - -For instance, to find the which top 5 processes are consuming most memory, use the following command: - -``` -$ inxi -t m -Processes: System RAM: total: 7.70 GiB used: 2.73 GiB (35.4%) - Memory top: 5 - 1: mem: 966.1 MiB (12.2%) command: firefox pid: 15989 - 2: mem: 468.2 MiB (5.9%) command: firefox pid: 13487 - 3: mem: 347.9 MiB (4.4%) command: firefox pid: 13708 - 4: mem: 306.7 MiB (3.8%) command: firefox pid: 13630 - 5: mem: 247.2 MiB (3.1%) command: firefox pid: 15062 -``` - -To sort the top 5 processes based on CPU usage, run: - -``` -$ inxi -t c -Processes: CPU top: 5 - 1: cpu: 14.9% command: firefox pid: 15989 - 2: cpu: 10.6% command: firefox pid: 13487 - 3: cpu: 7.0% command: firefox pid: 15062 - 4: cpu: 3.1% command: xorg pid: 13493 - 5: cpu: 2.9% command: firefox pid: 14954 -``` - -Bydefault, Inxi will display the top 5 processes. You can change the number of processes, for example 10, like below. - -``` -$ inxi -t cm10 -Processes: CPU top: 10 - 1: cpu: 14.9% command: firefox pid: 15989 - 2: cpu: 10.6% command: firefox pid: 13487 - 3: cpu: 7.0% command: firefox pid: 15062 - 4: cpu: 3.1% command: xorg pid: 13493 - 5: cpu: 2.9% command: firefox pid: 14954 - 6: cpu: 2.8% command: firefox pid: 13630 - 7: cpu: 1.8% command: firefox pid: 18325 - 8: cpu: 1.4% command: firefox pid: 18617 - 9: cpu: 1.3% command: firefox pid: 13708 - 10: cpu: 0.8% command: firefox pid: 14427 - System RAM: total: 7.70 GiB used: 2.92 GiB (37.9%) - Memory top: 10 - 1: mem: 1160.9 MiB (14.7%) command: firefox pid: 15989 - 2: mem: 475.1 MiB (6.0%) command: firefox pid: 13487 - 3: mem: 353.4 MiB (4.4%) command: firefox pid: 13708 - 4: mem: 308.0 MiB (3.9%) command: firefox pid: 13630 - 5: mem: 269.6 MiB (3.4%) command: firefox pid: 15062 - 6: mem: 249.3 MiB (3.1%) command: firefox pid: 14427 - 7: mem: 238.5 MiB (3.0%) command: firefox pid: 14954 - 8: mem: 208.2 MiB (2.6%) command: firefox pid: 18325 - 9: mem: 194.0 MiB (2.4%) command: firefox pid: 18617 - 10: mem: 143.6 MiB (1.8%) command: firefox pid: 23960 -``` - -The above command will display the top 10 processes that consumes the most CPU and Memory. - -To display only top10 based on memory usage, run: - -``` -$ inxi -t m10 -``` - -**12\. Display partition UUID details** - -To show partition UUIDs ( **U** niversally **U** nique **Id** entifier), use **-u** option. - -``` -$ inxi -u -``` - -There are much more options are yet to be covered. But, these are just enough to get almost all details of your Linux box. - -For more details and options, refer the man page. - -``` -$ man inxi -``` - -* * * - -**Related read:** - - * **[Neofetch – Display your Linux system’s information][7]** - - - -* * * - -The primary purpose of Inxi tool is to use in IRC or forum support. If you are looking for any help via a forum or website where someone is asking the specification of your system, just run this command, and copy/paste the output. - -**Resources:** - - * [**Inxi GitHub Repository**][8] - * [**Inxi home page**][9] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/ - -作者:[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]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[2]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ -[3]: http://www.ostechnix.com/wp-content/uploads/2016/08/Find-Linux-System-Details-Using-inxi.png -[4]: http://www.ostechnix.com/wp-content/uploads/2016/08/inxi-output-without-color-scheme.png -[5]: https://www.ostechnix.com/find-list-installed-repositories-commandline-linux/ -[6]: https://www.ostechnix.com/view-cpu-temperature-linux/ -[7]: http://www.ostechnix.com/neofetch-display-linux-systems-information/ -[8]: https://github.com/smxi/inxi -[9]: http://smxi.org/docs/inxi.htm From 4fe42163ddd83d181b6a2263651dbcdea2674790 Mon Sep 17 00:00:00 2001 From: Lingxu Meng Date: Tue, 18 Jun 2019 20:26:08 +1000 Subject: [PATCH 0999/1154] Update 20190614 How to send email from the Linux command line.md --- .../20190614 How to send email from the Linux command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190614 How to send email from the Linux command line.md b/sources/tech/20190614 How to send email from the Linux command line.md index b164436bba..7bdb9448f8 100644 --- a/sources/tech/20190614 How to send email from the Linux command line.md +++ b/sources/tech/20190614 How to send email from the Linux command line.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Modrisco) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -158,7 +158,7 @@ via: https://www.networkworld.com/article/3402027/how-to-send-email-from-the-lin 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/Modrisco) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1d33df0dfc31872dd6614f162d3e061d6c8ac722 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 Jun 2019 19:30:22 +0800 Subject: [PATCH 1000/1154] PRF:20180914 A day in the life of a log message.md @wxy --- ...0914 A day in the life of a log message.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/translated/tech/20180914 A day in the life of a log message.md b/translated/tech/20180914 A day in the life of a log message.md index 07b1c3b1fa..3c86e1e815 100644 --- a/translated/tech/20180914 A day in the life of a log message.md +++ b/translated/tech/20180914 A day in the life of a log message.md @@ -1,13 +1,13 @@ -日志消息的一日之旅 +一条日志消息的现代生活 ====== > 从一条日志消息的角度来巡览现代分布式系统。 -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plane_travel_world_international.png?itok=jG3sYPty) +![](https://img.linux.net.cn/data/attachment/album/201906/18/193030frxkcoccjhorz42o.jpg) -混沌系统往往是不可预测的。在构建像分布式系统这样复杂的东西时,这一点尤其明显。如果不加以控制,这种不可预测性会无止境的浪费时间。这就是为什么分布式系统的每个组件,无论多小,都必须设计成以简化的方式组合在一起。 +混沌系统往往是不可预测的。在构建像分布式系统这样复杂的东西时,这一点尤其明显。如果不加以控制,这种不可预测性会无止境的浪费时间。因此,分布式系统的每个组件,无论多小,都必须设计成以简化的方式组合在一起。 -[Kubernetes][1] 为抽象计算资源提供了一个很有前景的模型 —— 但即使是它也必须与 [Apache Kafka][2] 等其他分布式平台协调一致,以确保可靠的数据传输。如果有人要整合这两个平台,它会如何运作?此外,如果你通过这样的系统跟踪像日志消息这么简单的东西,它会是什么样子?本文将重点介绍来自[OKD][3] 内运行的应用程序的日志消息如何通过 Kafka 进入数据仓库(OKD 是为 Red Hat OpenShift 提供支持的 Kubernetes 的原初社区发行版)。 +[Kubernetes][1] 为抽象计算资源提供了一个很有前景的模型 —— 但即使是它也必须与其他分布式平台(如 [Apache Kafka][2])协调一致,以确保可靠的数据传输。如果有人要整合这两个平台,它会如何运作?此外,如果你通过这样的系统跟踪像日志消息这么简单的东西,它会是什么样子?本文将重点介绍来自在 [OKD][3] 内运行的应用程序的日志消息如何通过 Kafka 进入数据仓库(OKD 是为 Red Hat OpenShift 提供支持的 Kubernetes 的原初社区发行版)。 ### OKD 定义的环境 @@ -15,25 +15,25 @@ ![](https://opensource.com/sites/default/files/uploads/logmessagepathway.png) -在 OpenShift 中,一个或多个容器封装在称为 pod 的虚拟计算节点中。实际上,在 OKD 中运行的所有应用程序都被抽象为 pod(豆荚)。这允许应用程序以统一的方式操纵。这也大大简化了分布式组件之间的通信,因为 pod 可以通过 IP 地址和[负载均衡服务][5]系统地寻址。因此,当日志消息由日志收集器应用程序从节点的文件系统获取时,它可以很容易地传递到在 OpenShift 中运行的另一个 pod。 +在 OpenShift 中,一个或多个容器封装在称为 pod(豆荚)的虚拟计算节点中。实际上,在 OKD 中运行的所有应用程序都被抽象为 pod。这允许应用程序以统一的方式操纵。这也大大简化了分布式组件之间的通信,因为 pod 可以通过 IP 地址和[负载均衡服务][5]进行系统寻址。因此,当日志消息由日志收集器应用程序从节点的文件系统获取时,它可以很容易地传递到在 OpenShift 中运行的另一个 pod 中。 ### 在豆荚里的两个豌豆 -为了确保可以在整个分布式系统中无处不在地传播日志消息,日志收集器需要将日志消息传递到在 OpenShift 中运行的 Kafka 集群数据中心。通过 Kafka,日志消息可以以可靠且容错的方式低延迟传递给消费应用程序。但是,为了在 OKD 定义的环境中获得 Kafka 的好处,Kafka 需要完全集成到 OKD 中。 +为了确保可以在整个分布式系统中四处传播日志消息,日志收集器需要将日志消息传递到在 OpenShift 中运行的 Kafka 集群数据中心。通过 Kafka,日志消息可以以可靠且容错的方式低延迟传递给消费应用程序。但是,为了在 OKD 定义的环境中获得 Kafka 的好处,Kafka 需要完全集成到 OKD 中。 -运行 [Strimzi 操作子][6]将实例化所有 Kafka 组件为 pod,并将它们集成在 OKD 环境中运行。 这包括用于排队日志消息的 Kafka 代理,用于从 Kafka 代理读取和写入的 Kafka 连接器,以及用于管理 Kafka 集群状态的 Zookeeper 节点。Strimzi 还可以将日志收集器双实例化作为 Kafka 连接器,允许日志收集器将日志消息直接提供给在 OKD 中运行的 Kafka 代理 pod。 +运行 [Strimzi 操作子][6]将所有 Kafka 组件实例化为 pod,并将它们集成在 OKD 环境中运行。 这包括用于排队日志消息的 Kafka 代理,用于从 Kafka 代理读取和写入的 Kafka 连接器,以及用于管理 Kafka 集群状态的 Zookeeper 节点。Strimzi 还可以将日志收集器实例化兼做 Kafka 连接器,允许日志收集器将日志消息直接提供给在 OKD 中运行的 Kafka 代理 pod。 ### 在 OKD 内的 Kafka 当日志收集器 pod 将日志消息传递给 Kafka 代理时,收集器会写到单个代理分区,并将日志消息附加到该分区的末尾。使用 Kafka 的一个优点是它将日志收集器与日志的最终目标分离。由于解耦,日志收集器不关心日志最后是放在 [Elasticsearch][7]、Hadoop、Amazon S3 中的某个还是全都。Kafka 与所有基础设施连接良好,因此 Kafka 连接器可以在任何需要的地方获取日志消息。 -一旦写入 Kafka 代理的分区,该日志消息就会在 Kafka 集群内的代理分区中复制。这是它的一个非常强大的概念;结合平台的自愈功能,它创建了一个非常灵活的分布式系统。例如,当节点变得不可用时,节点上运行的应用程序几乎立即在健康节点上生成。因此,即使带有 Kafka 代理的节点丢失或损坏,日志消息也能保证存活在必要多的节点上,并且新的 Kafka 代理将快速原位取代。 +一旦写入 Kafka 代理的分区,该日志消息就会在 Kafka 集群内的跨代理分区复制。这是它的一个非常强大的概念;结合平台的自愈功能,它创建了一个非常有弹性的分布式系统。例如,当节点变得不可用时,(故障)节点上运行的应用程序几乎立即在健康节点上生成。因此,即使带有 Kafka 代理的节点丢失或损坏,日志消息也能保证存活在尽可能多的节点上,并且新的 Kafka 代理将快速原位取代。 ### 存储起来 -在日志消息被提交到 Kafka 主题后,它将等待 Kafka 连接器接收器使用它,该接收器将日志消息中继到分析引擎或日志记录仓库。在传递到其最终目的地时,可以分析日志消息以进行异常检测,可以查询日志以立即进行根本原因分析,或用于其他目的。无论哪种方式,日志消息都由 Kafka 以安全可靠的方式传送到目的地。 +在日志消息被提交到 Kafka 主题后,它将等待 Kafka 连接器使用它,该连接器将日志消息中继到分析引擎或日志记录仓库。在传递到其最终目的地时,可以分析日志消息以进行异常检测,也可以查询日志以立即进行根本原因分析,或用于其他目的。无论哪种方式,日志消息都由 Kafka 以安全可靠的方式传送到目的地。 -OKD 和 Kafka 是正在迅速发展的功能强大的分布式平台。创建能够在不影响性能的情况下抽象出分布式计算的复杂特性的系统至关重要。毕竟,如果我们不能简化单条日志消息的旅程,我们怎么能夸耀全系统的效率呢? +OKD 和 Kafka 是正在迅速发展的功能强大的分布式平台。创建能够在不影响性能的情况下抽象出分布式计算的复杂特性的系统至关重要。毕竟,如果我们不能简化单一日志消息的旅程,我们怎么能夸耀全系统的效率呢? -------------------------------------------------------------------------------- @@ -42,7 +42,7 @@ via: https://opensource.com/article/18/9/life-log-message 作者:[Josef Karásek][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4a322155237deea2251575ed17547e70d536248b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 Jun 2019 19:30:55 +0800 Subject: [PATCH 1001/1154] PUB:20180914 A day in the life of a log message.md @wxy https://linux.cn/article-10990-1.html --- .../20180914 A day in the life of a log message.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180914 A day in the life of a log message.md (100%) diff --git a/translated/tech/20180914 A day in the life of a log message.md b/published/20180914 A day in the life of a log message.md similarity index 100% rename from translated/tech/20180914 A day in the life of a log message.md rename to published/20180914 A day in the life of a log message.md From 8be2e3258a80941f7caeea9f6c26d3f05d107cf0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 00:13:29 +0800 Subject: [PATCH 1002/1154] APL:20190613 Open hardware for musicians and music lovers- Headphone, amps, and more --- ...for musicians and music lovers- Headphone, amps, and more.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md b/sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md index 96b5a06100..4bfb5f37f1 100644 --- a/sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md +++ b/sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2f34c6f576ddf9bff3af6aa3b8456581e8ad8ddf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 00:40:21 +0800 Subject: [PATCH 1003/1154] TSL:20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md --- ...music lovers- Headphone, amps, and more.md | 93 ------------------ ...music lovers- Headphone, amps, and more.md | 95 +++++++++++++++++++ 2 files changed, 95 insertions(+), 93 deletions(-) delete mode 100644 sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md create mode 100644 translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md diff --git a/sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md b/sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md deleted file mode 100644 index 4bfb5f37f1..0000000000 --- a/sources/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open hardware for musicians and music lovers: Headphone, amps, and more) -[#]: via: (https://opensource.com/article/19/6/hardware-music) -[#]: author: (Michael Weinberg https://opensource.com/users/mweinberg) - -Open hardware for musicians and music lovers: Headphone, amps, and more -====== -From 3D-printed instruments to devices that pull sound out of the air, -there are plenty of ways to create music with open hardware projects. -![][1] - -The world is full of great [open source music players][2], but why stop at using open source just to _play_ music? You can also use open source hardware to make music. All of the instruments described in this article are [certified by the Open Source Hardware Association][3] (OSHWA). That means you are free to build upon them, remix them, or do anything else with them. - -### Open source instruments - -Instruments are always a good place to start when you want to make music. If your instrument choices lean towards the more traditional, the [F-F-Fiddle][4] may be the one for you. - -![F-f-fiddle][5] - -The F-F-Fiddle is a full-sized electric violin that you can make with a standard desktop 3D printer ([fused filament fabrication][6]—get it?). If you need to see it to believe it, here is a video of the F-F-Fiddle in action: - -Mastered the fiddle and interested in something a bit more exotic? How about the [Open Theremin][7]? - -![Open Theremin][8] - -Like all theremins, Open Theremin lets you play music without touching the instrument. It is, of course, especially good at making [creepy space sounds][9] for your next sci-fi video or space-themed party. - -The [Waft][10] operates similarly by allowing you to control sounds remotely. It uses [Lidar][11] to measure the distance of your hand from the sensor. Check it out: - -Is the Waft a theremin? I'm not sure—theremin pedants should weigh in below in the comments. - -If theremins are too well-known for you, [SIGNUM][12] may be just what you are looking for. In the words of its developers, SIGNUM "uncovers the encrypted codes of information and the language of man/machine communication" by turning invisible wireless communications into audible signals. - -![SIGNUM][13] - -Here is in action: - -### Inputs - -Regardless of what instrument you use, you will need to plug it into something. If you want that something to be a Raspberry Pi, try the [AudioSense-Pi][14], which allows you to connect multiple inputs and outputs to your Pi at once. - -![AudioSense-Pi][15] - -### Synths - -What about synthesizers? SparkFun's [SparkPunk Sound Kit][16] is a simple synth that gives you lots of room to play. - -![SparkFun SparkPunk Sound Kit][17] - -### Headphones - -Making all this music is great, but you also need to think about how you will listen to it. Fortunately, [EQ-1 headphones][18] are open source and 3D-printable. - -![EQ-1 headphones][19] - -Are you making music with open source hardware? Let us know in the comments! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/6/hardware-music - -作者:[Michael Weinberg][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/mweinberg -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_musicinfinity.png?itok=7LkfjcS9 -[2]: https://opensource.com/article/19/2/audio-players-linux -[3]: https://certification.oshwa.org/ -[4]: https://certification.oshwa.org/us000010.html -[5]: https://opensource.com/sites/default/files/uploads/f-f-fiddle.png (F-f-fiddle) -[6]: https://en.wikipedia.org/wiki/Fused_filament_fabrication -[7]: https://certification.oshwa.org/ch000001.html -[8]: https://opensource.com/sites/default/files/uploads/open-theremin.png (Open Theremin) -[9]: https://youtu.be/p05ZSHRYXVA?t=771 -[10]: https://certification.oshwa.org/uk000005.html -[11]: https://en.wikipedia.org/wiki/Lidar -[12]: https://certification.oshwa.org/es000003.html -[13]: https://opensource.com/sites/default/files/uploads/signum.png (SIGNUM) -[14]: https://certification.oshwa.org/in000007.html -[15]: https://opensource.com/sites/default/files/uploads/audiosense-pi.png (AudioSense-Pi) -[16]: https://certification.oshwa.org/us000016.html -[17]: https://opensource.com/sites/default/files/uploads/sparkpunksoundkit.png (SparkFun SparkPunk Sound Kit) -[18]: https://certification.oshwa.org/us000038.html -[19]: https://opensource.com/sites/default/files/uploads/eq-1-headphones.png (EQ-1 headphones) diff --git a/translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md b/translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md new file mode 100644 index 0000000000..d81d9e27d4 --- /dev/null +++ b/translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open hardware for musicians and music lovers: Headphone, amps, and more) +[#]: via: (https://opensource.com/article/19/6/hardware-music) +[#]: author: (Michael Weinberg https://opensource.com/users/mweinberg) + +音乐家和音乐爱好者的开放硬件:耳机、放大器等 +====== + +从 3D 打印乐器到将隔空播放声音的设备,有很多可以通过开放硬件项目来制造音乐的方法。 + +![][1] + +这个世界到处都是很棒的[开源音乐播放器][2],但为什么只是将开源用在播放音乐上呢?你还可以使用开源硬件制造音乐。本文中描述的所有工具都是经过了[开源硬件协会][3](OSHWA)认证的。这意味着你可以自由地构建它们,重新组合它们,或者用它们做任何其他事情。 + +### 开源乐器 + +当你想制作音乐时,乐器始终是一个好的起点。如果你更倾向于传统的的乐器,那么[F-F-Fiddle][4]可能适合你。 + +![F-f-fiddle][5] + +F-F-Fiddle 是一款全尺寸电子小提琴,你可以使用标准桌面 3D 打印机制作([熔丝制造][6])。如果你觉得眼见为真,那么这里有一个 F-F-Fiddle 的视频: https://youtu.be/8NDWVcJJS2Y + +精通小提琴,但还对一些更具异国情调的东西感兴趣?[开源特雷门琴][7]Open Theremin怎么样? + +![Open Theremin][8] + +与所有特雷门琴一样,开源特雷门琴可让你在不触碰乐器的情况下播放音乐。当然,它特别擅长为你的下一个科幻视频或空间主题派对制作[令人毛骨悚然的空间声音][9]。 + +[Waft][10] 的操作类似,也可以远程控制声音。它使用[激光雷达][11]来测量手与传感器的距离。看看这个: https://vimeo.com/203705197 + +Waft 是特雷门琴吗?我不确定算不算,特雷门琴高手可以在下面的评论里发表一下看法。 + +如果特雷门琴对你来说太熟悉了,[SIGNUM][12]可能就是你想要的。用其开发人员的话说,SIGNUM 通过将不可见的无线通信转换为可听信号来“揭示加密的信息代码和人/机通信的语言”。 + +![SIGNUM][13] + +这是演示: https://vimeo.com/142831757 + + +### 输入 + +无论你使用什么乐器,都需要将其插入某些东西。如果你想要连接到树莓派,请尝试 [AudioSense-Pi][14],它允许你一次将多个输入和输出连接到你的树莓派。 + +![AudioSense-Pi][15] + +### 合成器 + +合成器怎么样?SparkFun 的 [SparkPunk Sound Kit][16] 是一个简单的合成器,为你提供了很多音色。 + +![SparkFun SparkPunk Sound Kit][17] + +### 耳机 + +制作所有这些音乐很棒,但你还需要考虑如何听它。幸运的是,[EQ-1耳机][18]是开源和可以 3D 打印的。 + +![EQ-1 headphones][19] + +你用开源硬件制作音乐吗?让我们在评论中知道! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/hardware-music + +作者:[Michael Weinberg][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mweinberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_musicinfinity.png?itok=7LkfjcS9 +[2]: https://opensource.com/article/19/2/audio-players-linux +[3]: https://certification.oshwa.org/ +[4]: https://certification.oshwa.org/us000010.html +[5]: https://opensource.com/sites/default/files/uploads/f-f-fiddle.png (F-f-fiddle) +[6]: https://en.wikipedia.org/wiki/Fused_filament_fabrication +[7]: https://certification.oshwa.org/ch000001.html +[8]: https://opensource.com/sites/default/files/uploads/open-theremin.png (Open Theremin) +[9]: https://youtu.be/p05ZSHRYXVA?t=771 +[10]: https://certification.oshwa.org/uk000005.html +[11]: https://en.wikipedia.org/wiki/Lidar +[12]: https://certification.oshwa.org/es000003.html +[13]: https://opensource.com/sites/default/files/uploads/signum.png (SIGNUM) +[14]: https://certification.oshwa.org/in000007.html +[15]: https://opensource.com/sites/default/files/uploads/audiosense-pi.png (AudioSense-Pi) +[16]: https://certification.oshwa.org/us000016.html +[17]: https://opensource.com/sites/default/files/uploads/sparkpunksoundkit.png (SparkFun SparkPunk Sound Kit) +[18]: https://certification.oshwa.org/us000038.html +[19]: https://opensource.com/sites/default/files/uploads/eq-1-headphones.png (EQ-1 headphones) From 378d4bd251b3b7c9777c300dc2df5b546e63a22c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 19 Jun 2019 08:40:14 +0800 Subject: [PATCH 1004/1154] translated --- ...ay Linux system Information In Terminal.md | 229 ----------------- ...ay Linux system Information In Terminal.md | 230 ++++++++++++++++++ 2 files changed, 230 insertions(+), 229 deletions(-) delete mode 100644 sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md create mode 100644 translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md diff --git a/sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md b/sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md deleted file mode 100644 index b09442ed83..0000000000 --- a/sources/tech/20190610 Neofetch - Display Linux system Information In Terminal.md +++ /dev/null @@ -1,229 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Neofetch – Display Linux system Information In Terminal) -[#]: via: (https://www.ostechnix.com/neofetch-display-linux-systems-information/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Neofetch – Display Linux system Information In Terminal -====== - -![Display Linux system information using Neofetch][1] - -**Neofetch** is a simple, yet useful command line system information utility written in **Bash**. It gathers information about your system’s software and hardware and displays the result in the Terminal. By default, the system information will be displayed alongside your operating system’s logo. However, you can further customize it to use an **ascii image** or any image of your choice instead of the OS logo. You can also configure Neofetch to display which information, where and when that information should be displayed. Neofetch is mainly developed to be used in screenshots of your system information. It supports Linux, BSD, Mac OS X, iOS, and Windows operating systems. In this brief tutorial, let us see how to display Linux system information using Neofetch. - -### Install Neofetch - -Neofetch is available in the default repositories of most Linux distributions. - -On Arch Linux and its variants, install it using command: - -``` -$ sudo pacman -S netofetch -``` - -On Debian (Stretch / Sid): - -``` -$ sudo apt-get install neofetch -``` - -On Fedora 27: - -``` -$ sudo dnf install neofetch -``` - -On RHEL, CentOS: - -Enable EPEL Repository: - -``` -# yum install epel-relase -``` - -Fetch the neofetch repository: - -``` -# curl -o /etc/yum.repos.d/konimex-neofetch-epel-7.repo -https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-7/konimex-neofetch-epel-7.repo -``` - -Then, install Neofetch: - -``` -# yum install neofetch -``` - -On Ubuntu 17.10 and newer versions: - -``` -$ sudo apt-get install neofetch -``` - -On Ubuntu 16.10 and lower versions: - -``` -$ sudo add-apt-repository ppa:dawidd0811/neofetch - -$ sudo apt update - -$ sudo apt install neofetch -``` - -On NixOS: - -``` -$ nix-env -i neofetch -``` - -### Display Linux system Information Using Neofetch - -Neofetch is pretty easy and straightforward. Let us see some examples. - -Open up your Terminal, and run the following command: - -``` -$ neofetch -``` - -**Sample output:** - -![][2] - -Display Linux system Information Using Neofetch - -As you can see in the above output, Neofetch is displaying the following details of my Arch Linux system: - - * Name of the installed operating system, - * Laptop model, - * Kernel details, - * System uptime, - * Number of installed packages by default and other package managers, - * Default Shell, - * Screen resolution, - * Desktop environment, - * Window manager, - * Window manager’s theme, - * System theme, - * System Icons, - * Default Terminal, - * CPU type, - * GPU type, - * Installed memory. - - - -Neofetch has plenty of other options too. We will see some of them. - -##### How to use custom imagess in Neofetch output? - -By default, Neofetch will display your OS logo along with the system information. You can, of course, change the image as you wish. - -In order to display images, your Linux system should have the following dependencies installed: - - 1. **w3m-img** (It is required to display images. w3m-img is sometimes bundled together with **w3m** package), - 2. **Imagemagick** (required for thumbnail creation), - 3. A terminal that supports **\033[14t** or **xdotool** or **xwininfo + xprop** or **xwininfo + xdpyinfo**. - - - -W3m-img and ImageMagick packages are available in the default repositories of most Linux distributions. So you can install them using your distribution’s default package manager. - -For instance, run the following command to install w3m-img and ImageMagick on Debian, Ubuntu, Linux Mint: - -``` -$ sudo apt install w3m-img imagemagick -``` - -Here is the list of Terminal Emulators with **w3m-img** support: - - 1. Gnome-terminal, - 2. Konsole, - 3. st, - 4. Terminator, - 5. Termite, - 6. URxvt, - 7. Xfce4-Terminal, - 8. Xterm - - - -If you have **kitty** , **Terminology** and **iTerm** terminal emulators on your system, you don’t need to install w3m-img. - -Now, run the following command to display your system’s information with a custom image: - -``` -$ neofetch --w3m /home/sk/Pictures/image.png -``` - -Or, - -``` -$ neofetch --w3m --source /home/sk/Pictures/image.png -``` - -Sample output: - -![][3] - -Neofetch output with custom logo - -Replace the image path in the above command with your own. - -Alternatively, you can point a directory that contains the images like below. - -``` -$ neofetch --w3m -``` - -##### Configure Neofetch - -When we run the Neofetch for the first time, It will create a per-user configuration file at **$HOME/.config/neofetch/config.conf** by default. It also creates a system-wide neofetch config file at **$HOME/.config/neofetch/config**. You can tweak this file to tell Neofetch which details should be displayed, removed and/or modified. - -You can also keep this configuration file between versions. Meaning – just customize it once as per your liking and use the same settings after upgrading to newer version. You can even share this file to your friends and colleagues to have the same settings as yours. - -To view Neofetch help section, run: - -``` -$ neofetch --help -``` - -As far as I tested Neofetch, It worked perfectly in my Arch Linux system as expected. It is a nice handy tool to easily and quickly print the details of your system in the Terminal. - -* * * - -**Related read:** - - * [**How to find Linux System details using inxi**][4] - - - -* * * - -**Resource:** - - * [**Neofetch on GitHub**][5] - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/neofetch-display-linux-systems-information/ - -作者:[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/2016/06/neofetch-1-720x340.png -[2]: http://www.ostechnix.com/wp-content/uploads/2016/06/Neofetch-1.png -[3]: http://www.ostechnix.com/wp-content/uploads/2016/06/Neofetch-with-custom-logo.png -[4]: https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/ -[5]: https://github.com/dylanaraps/neofetch diff --git a/translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md b/translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md new file mode 100644 index 0000000000..13185e0794 --- /dev/null +++ b/translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md @@ -0,0 +1,230 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Neofetch – Display Linux system Information In Terminal) +[#]: via: (https://www.ostechnix.com/neofetch-display-linux-systems-information/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Neofetch - 在终端中显示 Linux 系统信息 +====== + +![Display Linux system information using Neofetch][1] + +**Neofetch** 是一个简单但有用的命令行系统信息工具,它用 **Bash** 编写。它会收集有关系统软件和硬件的信息,并在终端中显示结果。默认情况下,系统信息将与操作系统的 logo 一起显示。但是,你可以进一步地使用 **ascii 图像**或其他任何图片来自定义。你还可以配置 Neofetch 显示的信息,信息的显示位置和时间。Neofetch 主要用于系统信息的截图。它支持 Linux、BSD、Mac OS X、iOS 和 Windows 操作系统。在这个简短的教程中,让我们看看如何使用 Neofetch 显示 Linux 系统信息。 + +### 安装 Neofetch + +Neofetch 可在大多数 Linux 发行版的默认仓库中找到。 + +在 Arch Linux 及其衍生版上,使用这个命令安装它: + +``` +$ sudo pacman -S netofetch +``` + +在 Debian(Stretch / Sid)上: + +``` +$ sudo apt-get install neofetch +``` + +在 Fedora 27 上: + +``` +$ sudo dnf install neofetch +``` + +在 RHEL、CentOS 上: + +启用 EPEL 仓库: + +``` +# yum install epel-relase +``` + +获取 neofetch 仓库: + +``` +# curl -o /etc/yum.repos.d/konimex-neofetch-epel-7.repo +https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-7/konimex-neofetch-epel-7.repo +``` + +然后,安装 Neofetch: + +``` +# yum install neofetch +``` + +在 Ubuntu 17.10 和更新版本上: + +``` +$ sudo apt-get install neofetch +``` + +在 Ubuntu 16.10 和更低版本上: + +``` +$ sudo add-apt-repository ppa:dawidd0811/neofetch + +$ sudo apt update + +$ sudo apt install neofetch +``` + +在 NixOS 上: + +``` +$ nix-env -i neofetch +``` + +### 使用 Neofetch 显示 Linux 系统信息 + +Neofetch 非常简单直接。让我们看一些例子。 + +打开终端,然后运行以下命令: + +``` +$ neofetch +``` + +**示例输出:** + +![][2] + +使用 Neofetch 显示 Linux 系统信息 + +正如你在上面的输出中所看到的,Neofetch 显示了我的 Arch Linux 系统的以下详细信息: + + * 已安装操作系统的名称, +  * 笔记本型号, +  * 内核详细信息, +  * 系统运行时间, +  * 默认和其他软件包管理器安装的软件数量 +  * 默认 shell, +  * 屏幕分辨率, +  * 桌面环境, +  * 窗口管理器, +  * 窗口管理器的主题, +  * 系统主题, +  * 系统图标, +  * 默认终端, +  * CPU 类型, +  * GPU 类型, +  * 已安装的内存。 + + + +Neofetch 还有很多其他选择。我们会看到其中一些。 + +##### 如何在 Neofetch 输出中使用自定义图像? + +默认情况下,Neofetch 将显示你的操作系统 logo 以及系统信息。当然,你可以根据需要更改图像。 + +要显示图像,Linux 系统应该安装以下依赖项: + +1. **w3m-img**(用于显示图像。w3m-img 有时与 **w3m** 包捆绑在一起), +  2. **Imagemagick**(用于创建缩略图), +  3. 支持 **\033[14t** 或者 **xdotool** 或者 **xwininfo + xprop** 或者 **xwininfo + xdpyinfo** 的终端。 + + + +大多数 Linux 发行版的默认仓库中都提供了 W3m-img 和 ImageMagick 包。因此,你可以使用你的发行版的默认包管理器来安装它们。 + +例如,运行以下命令在 Debian、Ubuntu、Linux Mint 上安装 w3m-img 和 ImageMagick: + +``` +$ sudo apt install w3m-img imagemagick +``` + +以下是带 **w3m-img** 支持的终端列表: + + 1. Gnome-terminal, + 2. Konsole, + 3. st, + 4. Terminator, + 5. Termite, + 6. URxvt, + 7. Xfce4-Terminal, + 8. Xterm + + + +如果你的系统上已经有了 **kitty**、**Terminology** 和 **iTerm**,那么就无需安装 w3m-img。 + +现在,运行以下命令以使用自定义图像显示系统信息: + +``` +$ neofetch --w3m /home/sk/Pictures/image.png +``` + +或者 + +``` +$ neofetch --w3m --source /home/sk/Pictures/image.png +``` + +示例输出: + +![][3] + +使用自定义 logo 的 Neofetch 输出 + +使用你自己的图片替换上面图片的路径。 + +或者,你可以指向包含以下图像的目录。 + + +``` +$ neofetch --w3m +``` + +##### 配置 Neofetch + +当我们第一次运行 Neofetch 时,它默认会为每个用户在 **$HOME/.config/neofetch/config.conf** 中创建一个配置文件。它还会在 **$HOME/.config/neofetch/config** 中创建一个全局的 neofetch 配置文件。你可以调整此文件来告诉 neofetch 该显示、删除和/或修改哪些详细信息。 + +还可以在不同版本中保留此配置文件。这意味着你只需根据自己的喜好自定义一次,并在升级到更新版本后使用相同的设置。你甚至可以将此文件共享给你的朋友和同事,使他拥有与你相同的设置。 + +要查看Neofetch帮助部分,请运行: + +``` +$ neofetch --help +``` + +就我测试的 Neofetch 而言,它在我的 Arch Linux 系统中完美地工作。它是一个非常方便的工具,可以在终端中轻松快速地打印系统的详细信息。 + +* * * + +**相关阅读:** + + * [**如何使用 inxi 查看 Linux 系统详细信息**][4] + + + +* * * + +**资源:** + + * [**Neofetch 的 GitHub 页面**][5] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/neofetch-display-linux-systems-information/ + +作者:[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/2016/06/neofetch-1-720x340.png +[2]: http://www.ostechnix.com/wp-content/uploads/2016/06/Neofetch-1.png +[3]: http://www.ostechnix.com/wp-content/uploads/2016/06/Neofetch-with-custom-logo.png +[4]: https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/ +[5]: https://github.com/dylanaraps/neofetch From 3f404f2d3f53d1ffc750e6382b048cd0b962c349 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 19 Jun 2019 08:43:27 +0800 Subject: [PATCH 1005/1154] translating --- ...0190612 Installing alternative versions of RPMs in Fedora.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md b/sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md index 3e43304488..29b306d7e6 100644 --- a/sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md +++ b/sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7c7f581395a4fbdd492ce0bbb7acbc30eb291cc8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 10:33:04 +0800 Subject: [PATCH 1006/1154] PRF:20190610 Neofetch - Display Linux system Information In Terminal.md @geekpi --- ...ay Linux system Information In Terminal.md | 90 ++++++++----------- 1 file changed, 38 insertions(+), 52 deletions(-) diff --git a/translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md b/translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md index 13185e0794..fa7324d964 100644 --- a/translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md +++ b/translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Neofetch – Display Linux system Information In Terminal) [#]: via: (https://www.ostechnix.com/neofetch-display-linux-systems-information/) [#]: author: (sk https://www.ostechnix.com/author/sk/) -Neofetch - 在终端中显示 Linux 系统信息 +Neofetch:在终端中显示 Linux 系统信息 ====== ![Display Linux system information using Neofetch][1] -**Neofetch** 是一个简单但有用的命令行系统信息工具,它用 **Bash** 编写。它会收集有关系统软件和硬件的信息,并在终端中显示结果。默认情况下,系统信息将与操作系统的 logo 一起显示。但是,你可以进一步地使用 **ascii 图像**或其他任何图片来自定义。你还可以配置 Neofetch 显示的信息,信息的显示位置和时间。Neofetch 主要用于系统信息的截图。它支持 Linux、BSD、Mac OS X、iOS 和 Windows 操作系统。在这个简短的教程中,让我们看看如何使用 Neofetch 显示 Linux 系统信息。 +Neofetch 是一个简单但有用的命令行系统信息工具,它用 Bash 编写。它会收集有关系统软硬件的信息,并在终端中显示结果。默认情况下,系统信息将与操作系统的 logo 一起显示。但是,你可以进一步地自定义使用 ascii 图像或其他任何图片。你还可以配置 Neofetch 显示的信息、信息的显示位置和时间。Neofetch 主要用于系统信息的截图。它支持 Linux、BSD、Mac OS X、iOS 和 Windows 操作系统。在这个简短的教程中,让我们看看如何使用 Neofetch 显示 Linux 系统信息。 ### 安装 Neofetch @@ -89,46 +89,42 @@ Neofetch 非常简单直接。让我们看一些例子。 $ neofetch ``` -**示例输出:** +示例输出: ![][2] -使用 Neofetch 显示 Linux 系统信息 +*使用 Neofetch 显示 Linux 系统信息* 正如你在上面的输出中所看到的,Neofetch 显示了我的 Arch Linux 系统的以下详细信息: - * 已安装操作系统的名称, -  * 笔记本型号, -  * 内核详细信息, -  * 系统运行时间, -  * 默认和其他软件包管理器安装的软件数量 -  * 默认 shell, -  * 屏幕分辨率, -  * 桌面环境, -  * 窗口管理器, -  * 窗口管理器的主题, -  * 系统主题, -  * 系统图标, -  * 默认终端, -  * CPU 类型, -  * GPU 类型, -  * 已安装的内存。 +* 已安装操作系统的名称, +* 笔记本型号, +* 内核详细信息, +* 系统运行时间, +* 默认和其他软件包管理器安装的软件数量 +* 默认 shell, +* 屏幕分辨率, +* 桌面环境, +* 窗口管理器, +* 窗口管理器的主题, +* 系统主题, +* 系统图标, +* 默认终端, +* CPU 类型, +* GPU 类型, +* 已安装的内存。 +Neofetch 还有很多其他选项。我们会看到其中一些。 - -Neofetch 还有很多其他选择。我们会看到其中一些。 - -##### 如何在 Neofetch 输出中使用自定义图像? +### 如何在 Neofetch 输出中使用自定义图像? 默认情况下,Neofetch 将显示你的操作系统 logo 以及系统信息。当然,你可以根据需要更改图像。 要显示图像,Linux 系统应该安装以下依赖项: -1. **w3m-img**(用于显示图像。w3m-img 有时与 **w3m** 包捆绑在一起), -  2. **Imagemagick**(用于创建缩略图), -  3. 支持 **\033[14t** 或者 **xdotool** 或者 **xwininfo + xprop** 或者 **xwininfo + xdpyinfo** 的终端。 - - +1. w3m-img(用于显示图像。w3m-img 有时与 w3m 包捆绑在一起), +2. Imagemagick(用于创建缩略图), +3. 支持 `\033[14t` 或者 xdotool 或者 xwininfo + xprop 或者 xwininfo + xdpyinfo 的终端。 大多数 Linux 发行版的默认仓库中都提供了 W3m-img 和 ImageMagick 包。因此,你可以使用你的发行版的默认包管理器来安装它们。 @@ -138,7 +134,7 @@ Neofetch 还有很多其他选择。我们会看到其中一些。 $ sudo apt install w3m-img imagemagick ``` -以下是带 **w3m-img** 支持的终端列表: +以下是带 w3m-img 支持的终端列表: 1. Gnome-terminal, 2. Konsole, @@ -149,9 +145,7 @@ $ sudo apt install w3m-img imagemagick 7. Xfce4-Terminal, 8. Xterm - - -如果你的系统上已经有了 **kitty**、**Terminology** 和 **iTerm**,那么就无需安装 w3m-img。 +如果你的系统上已经有了 kitty、Terminology 和 iTerm,那么就无需安装 w3m-img。 现在,运行以下命令以使用自定义图像显示系统信息: @@ -159,7 +153,7 @@ $ sudo apt install w3m-img imagemagick $ neofetch --w3m /home/sk/Pictures/image.png ``` -或者 +或者, ``` $ neofetch --w3m --source /home/sk/Pictures/image.png @@ -169,24 +163,23 @@ $ neofetch --w3m --source /home/sk/Pictures/image.png ![][3] -使用自定义 logo 的 Neofetch 输出 +*使用自定义 logo 的 Neofetch 输出* 使用你自己的图片替换上面图片的路径。 或者,你可以指向包含以下图像的目录。 - ``` $ neofetch --w3m ``` -##### 配置 Neofetch +### 配置 Neofetch -当我们第一次运行 Neofetch 时,它默认会为每个用户在 **$HOME/.config/neofetch/config.conf** 中创建一个配置文件。它还会在 **$HOME/.config/neofetch/config** 中创建一个全局的 neofetch 配置文件。你可以调整此文件来告诉 neofetch 该显示、删除和/或修改哪些详细信息。 +当我们第一次运行 Neofetch 时,它默认会为每个用户在 `$HOME/.config/neofetch/config.conf` 中创建一个配置文件。它还会在 `$HOME/.config/neofetch/config` 中创建一个全局的 neofetch 配置文件。你可以调整此文件来告诉 neofetch 该显示、删除和/或修改哪些详细信息。 还可以在不同版本中保留此配置文件。这意味着你只需根据自己的喜好自定义一次,并在升级到更新版本后使用相同的设置。你甚至可以将此文件共享给你的朋友和同事,使他拥有与你相同的设置。 -要查看Neofetch帮助部分,请运行: +要查看 Neofetch 帮助部分,请运行: ``` $ neofetch --help @@ -194,20 +187,13 @@ $ neofetch --help 就我测试的 Neofetch 而言,它在我的 Arch Linux 系统中完美地工作。它是一个非常方便的工具,可以在终端中轻松快速地打印系统的详细信息。 -* * * +相关阅读: -**相关阅读:** + * [如何使用 inxi 查看 Linux 系统详细信息][4] - * [**如何使用 inxi 查看 Linux 系统详细信息**][4] - - - -* * * - -**资源:** - - * [**Neofetch 的 GitHub 页面**][5] +资源: + * [Neofetch 的 GitHub 页面][5] -------------------------------------------------------------------------------- @@ -217,7 +203,7 @@ via: https://www.ostechnix.com/neofetch-display-linux-systems-information/ 作者:[sk][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/) 荣誉推出 From ce88af0a97491a6404e961b3be238fc6ad4322ce Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 10:33:50 +0800 Subject: [PATCH 1007/1154] PUB:20190610 Neofetch - Display Linux system Information In Terminal.md @geekpi https://linux.cn/article-10991-1.html --- ...Neofetch - Display Linux system Information In Terminal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190610 Neofetch - Display Linux system Information In Terminal.md (98%) diff --git a/translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md b/published/20190610 Neofetch - Display Linux system Information In Terminal.md similarity index 98% rename from translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md rename to published/20190610 Neofetch - Display Linux system Information In Terminal.md index fa7324d964..006ca80113 100644 --- a/translated/tech/20190610 Neofetch - Display Linux system Information In Terminal.md +++ b/published/20190610 Neofetch - Display Linux system Information In Terminal.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10991-1.html) [#]: subject: (Neofetch – Display Linux system Information In Terminal) [#]: via: (https://www.ostechnix.com/neofetch-display-linux-systems-information/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From e7d165b839d053852e60e1f453dd5a0a1d1c6aca Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 11:15:17 +0800 Subject: [PATCH 1008/1154] PRF:20190509 5 essential values for the DevOps mindset.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @arrowfeng 工具痕迹有点重。 --- ...essential values for the DevOps mindset.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/translated/tech/20190509 5 essential values for the DevOps mindset.md b/translated/tech/20190509 5 essential values for the DevOps mindset.md index 70bb11278d..3a86bf7114 100644 --- a/translated/tech/20190509 5 essential values for the DevOps mindset.md +++ b/translated/tech/20190509 5 essential values for the DevOps mindset.md @@ -1,67 +1,67 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 essential values for the DevOps mindset) [#]: via: (https://opensource.com/article/19/5/values-devops-mindset) [#]: author: (Brent Aaron Reed https://opensource.com/users/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed) -关于 DevOps 思维模式所需具备的5个基本价值观 +DevOps 思维模式的 5 个基本价值观 ====== -人和流程比在解决的业务问题的任何技术“银弹”更重要,且需要花更多的时间。 + +> 人和流程比在解决的业务问题的任何技术“银弹”更重要,且需要花更多的时间。 + ![human head, brain outlined with computer hardware background][1] -今天的许多 IT 专业人士都在努力适应变化和扰动。您是否正在努力适应变化,可以这么说? 你觉得不堪重负吗?这并不罕见。今天,IT 的现状还不够好,所以需要不断尝试重新自我演进。 +今天的许多 IT 专业人士都在努力适应变化和扰动。这么说吧,你是否正在努力适应变化?你觉得不堪重负吗?这并不罕见。今天,IT 的现状还不够好,所以需要不断尝试重新自我演进。 -凭借30多年的IT综合经验,我们见证了人们和人际关系的重要性,它有让 IT有效和帮助业务蓬勃发展的能力。但是,在大多数情况下,我们关于IT解决方案的对话始于技术而非人员和流程。寻找“银弹”来解决业务和IT挑战的倾向非常普遍。但你不能只关心创新,DevOps或有效的团队和工作方式;他们需要得到培养,支持和引导。 +凭借 30 多年的IT综合经验,我们见证了人员与关系对于 IT 企业提高效率和帮助企业蓬勃发展的重要性。但是,在大多数情况下,我们关于 IT 解决方案的对话始于技术,而不是从人员和流程开始。寻找“银弹”来解决业务和 IT 挑战的倾向过于普遍。但你不能想着可以买到创新、DevOps 或有效的团队和工作方式;他们需要得到培养,支持和引导。 -由于扰动如此普遍,并且对变革速度存在如此迫切的需求,我们需要纪律和围栏。下面描述的 DevOps 思维模式的五个基本价值观将支持将我们带到那里的实践。这些价值观不是新观念;我们从经验中学到了它们并重构它们。一些值可以互换,它们是灵活的,并且它们指导支持(如支柱)这五个价值观的整体原则。 +由于扰动如此普遍,并且对变革速度存在如此迫切的需求,我们需要纪律和围栏。下面描述的 DevOps 思维模式的五个基本价值观将支持将我们的实践。这些价值观不是新观念;正如我们从经验中学到的那样,它们被重构了。一些价值观可以互换的,它们是灵活的,并且它们如支柱一样导向了支持这五个价值观的整体原则。 ![5 essential values for the DevOps mindset][2] -### 1\. 利益相关方的反馈至关重要 +### 1、利益相关方的反馈至关重要 -我们如何知道我们是否为我们创造了比利益相关者更多的价值? 我们需要持久的质量数据来分析,通知并推动更好的决策。 来自可靠来源的相关信息对于任何业务的蓬勃发展至关重要。 我们需要倾听并理解我们的利益相关者所说的,而不是说我们需要以一种方式实施变革,使我们能够调整我们的思维、我们的流程和技术,并根据需要对其进行调整以使我们的利益相关者满意。由于信息(数据)不正确,我们常常看到很少的变化,或者由于错误的原因而发生的很多变化。因此,将变更与利益相关方的反馈结合起来是一项重要的价值,并有助我们专注于使公司成功最重要的事情。 +我们如何知道我们是否为我们创造了比利益相关方更多的价值?我们需要持久的质量数据来分析、通知并推动更好的决策。来自可靠来源的相关信息对于任何业务的蓬勃发展至关重要。我们需要倾听并理解我们的利益相关方所说的,而不是说我们需要以一种方式实施变革,使我们能够调整我们的思维、流程和技术,并根据需要对其进行调整以使我们的利益相关者满意。由于信息(数据)不正确,我们常常看到的变化过少,或者由于错误的原因而发生了很多变化。因此,将变更与利益相关方的反馈结合起来是一项基本价值观,并有助我们专注于使公司成功最重要的事情。 +> 关注我们的利益相关方及其反馈,而不仅仅是为了改变而改变。 -> 关注我们的利益相关者及其反馈,而不仅仅是为了改变而改变。 +### 2、超越当今流程的极限进行改进 -### 2\. 超越当今流程的极限 - -我们希望我们的产品和服务能够不断让客户满意——我们最重要的利益相关者。因此,我们需要不断改进。这不仅仅是关于质量;它还可能意味着成本,可用性,相关性以及许多其他目标和因素。创建可重复的流程或使用通用框架是非常棒的,它们可以改善治理和许多其他问题。但是,这不应该是我们的最终目标。在寻找改进方法时,我们必须调整我们的流程,并辅以正确的技术和工具。可能有理由抛弃“所谓的”框架,因为不这样做可能会增加浪费,更糟糕的是只是“货物结果”(做一些没有价值或目的的东西)。 +我们希望我们的产品和服务能够不断让客户满意,他们是我们最重要的利益相关方。因此,我们需要不断改进。这不仅仅是关系到质量;它还可能意味着成本、可用性、相关性以及许多其他目标和因素。创建可重复的流程或使用通用框架是非常棒的,它们可以改善治理和许多其他问题。但是,这不应该是我们的最终目标。在寻找改进方法时,我们必须调整我们的流程,并辅以正确的技术和工具。可能有理由抛出一个“所谓的”框架,因为不这样做可能会增加浪费,更糟糕的是只是“货物结果”(做一些没有价值或目的的东西)。 > 力争始终创新并改进可重复的流程和框架。 -### 3\. 无需新的筒仓来打破旧的筒仓 +### 3、不要用新的孤岛来打破旧的孤岛 -筒仓和DevOps是不兼容的。我们始终看到这一点:IT 主管带来了所谓的“专家”来实施敏捷和DevOps,他们做了什么?这些“专家”在现有问题的基础上创建了一个新问题,这是另一个加入 IT 部门的筒仓和一个充满筒仓的企业。创建“DevOps”标题违背了敏捷和DevOps的原则,这些原则基于打破筒仓的概念。在敏捷和DevOps中,团队合作是必不可少的,如果你不在自组织团队中工作,那么你就不会做任何事情。 +孤岛和 DevOps 是不兼容的。我们经常能看到:IT 主管带来了所谓的“专家”来实施敏捷和 DevOps,他们做了什么?这些“专家”在现有问题的基础上创建了一个新问题,这是 IT 部门和业务中又增加了一个孤岛。创造“DevOps”职位违背了敏捷和 DevOps 基于打破孤岛的原则。在敏捷和 DevOps 中,团队合作是必不可少的,如果你不在自组织团队中工作,那么你就不会做任何事情。 -> 相互激励和共享,而不是成为英雄或创建一个筒仓。 +> 相互激励和共享,而不是成为英雄或创建一个孤岛。 -### 4\. 了解您的客户意味着跨组织协作 +### 4、了解你的客户意味着跨组织协作 -业务的任何部分都不是一个独立的实体,因为它们都有利益相关者,主要利益相关者始终是客户。“客户永远是对的”(正如我想说的那样,或者是国王)。关键是,没有客户,真的没有业务,而且为了保持业务,如今我们需要与竞争对手“区别对待”。我们还需要了解客户对我们的看法以及他们对我们的期望。了解客户的需求势在必行,需要及时反馈,以确保业务能够快速,负责地满足这些主要利益相关者的需求和关注。 +企业的任何一个部分都不是一个独立的实体,因为它们都有利益相关方,主要利益相关方始终是客户。“客户永远是对的”(或国王,我喜欢这样说)。关键是,没有客户就真的没有业务,而且为了保持业务,如今我们需要与竞争对手“区别对待”。我们还需要了解客户对我们的看法以及他们对我们的期望。了解客户的需求势在必行,需要及时反馈,以确保业务能够快速、负责地满足这些主要利益相关者的需求和关注。 ![Minimize time spent with build-measure-learn process][3] -无论是想法,概念,假设还是直接的利益相关者反馈,我们都需要通过使用探索,构建,测试和交付生命周期来识别和衡量我们的产品提供的功能或服务。从根本上说,这意味着我们需要在整个组织中“插入”我们的组织。在持续创新,学习和DevOps方面没有任何边界。因此,当我们在整个企业中进行衡量时,我们可以理解整体并采取可行的,有意义的步骤来改进。 +无论是想法、概念、假设还是直接利益相关方的反馈,我们都需要通过使用探索、构建、测试和交付生命周期来识别和衡量我们的产品提供的功能或服务。从根本上说,这意味着我们需要在整个组织中“插入”我们的组织。在持续创新、学习和 DevOps 方面没有任何边界。因此,当我们在整个企业中进行衡量时,我们可以理解整体并采取可行的、有意义的步骤来改进。 > 衡量整个组织的绩效,而不仅仅是在业务范围内。 -### 5\. 热情鼓舞采纳 +### 5、通过热情鼓励采纳 -不是每个人都被驱使去学习,适应和改变;然而,就像微笑可能具有传染性一样,学习和意愿成为变革文化的一部分也是如此。在学习文化中适应和演化为一群人提供了学习和传递信息(即文化传播)的自然机制。学习风格,态度,方法和过程不断演化,因此我们可以改进它们。下一步是应用所学和改进的内容并与同事分享信息。学习不会自动发生;它需要努力,评估,纪律,意识,特别是沟通;遗憾的是,这些都是工具和自动化无法提供的。检查您的流程,自动化,工具策略和实施工作,使其透明化,并与您的同事协作重复使用和改进。 +不是每个人都要被驱使去学习、适应和改变;然而,就像微笑可能具有传染性一样,学习和意愿成为变革文化的一部分也是如此。在学习文化中适应和演化为一群人提供了学习和传递信息(即文化传播)的自然机制。学习风格、态度、方法和过程不断演化,因此我们可以改进它们。下一步是应用所学和改进的内容并与同事分享信息。学习不会自动发生;它需要努力、评估、纪律、意识,特别是沟通;遗憾的是,这些都是工具和自动化无法提供的。检查你的流程、自动化、工具策略和实施工作,使其透明化,并与你的同事协作重复使用和改进。 -> 通过精益质量的可交付成果促进学习文化,而不仅仅是工具和自动化。 +> 通过精益交付促进学习文化,而不仅仅是工具和自动化。 ### 总结 ![Continuous goals of DevOps mindset][4] -随着我们的公司采用DevOps,我们继续在任何书籍,网站或自动化软件上支持这五个价值观。采用这种思维方式需要时间,这与我们以前作为系统管理员所做的完全不同。这是一种全新的工作方式,需要很多年才能成熟。这些原则是否与您自己的原则一致?在评论或我们的网站上分享。[混乱特工] +随着我们的公司采用 DevOps,我们继续在各种书籍、网站或自动化软件上倡导这五个价值观。采用这种思维方式需要时间,这与我们以前作为系统管理员所做的完全不同。这是一种全新的工作方式,需要很多年才能成熟。这些原则是否与你自己的原则一致?在评论或我们的网站 [Agents of chaos][5] 上分享。 -* * * -------------------------------------------------------------------------------- @@ -69,8 +69,8 @@ via: https://opensource.com/article/19/5/values-devops-mindset 作者:[Brent Aaron Reed][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/arrowfeng) -校对:[校对者ID](https://github.com/校对者ID) +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 75bac7ed920d3b50ec42d11a8264fea581bfd0bf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 11:15:52 +0800 Subject: [PATCH 1009/1154] PUB:20190509 5 essential values for the DevOps mindset.md @arrowfeng https://linux.cn/article-10992-1.html --- .../20190509 5 essential values for the DevOps mindset.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190509 5 essential values for the DevOps mindset.md (99%) diff --git a/translated/tech/20190509 5 essential values for the DevOps mindset.md b/published/20190509 5 essential values for the DevOps mindset.md similarity index 99% rename from translated/tech/20190509 5 essential values for the DevOps mindset.md rename to published/20190509 5 essential values for the DevOps mindset.md index 3a86bf7114..f3193a3d95 100644 --- a/translated/tech/20190509 5 essential values for the DevOps mindset.md +++ b/published/20190509 5 essential values for the DevOps mindset.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (arrowfeng) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10992-1.html) [#]: subject: (5 essential values for the DevOps mindset) [#]: via: (https://opensource.com/article/19/5/values-devops-mindset) [#]: author: (Brent Aaron Reed https://opensource.com/users/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed) From ad26063622e862d91147a75f3f207fffe267fb05 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 14:45:30 +0800 Subject: [PATCH 1010/1154] PRF:20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md @geekpi --- ...pImage, Flathub And Snapcraft Platforms.md | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md b/translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md index bc75f37b4b..981cb0b231 100644 --- a/translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md +++ b/translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Search Linux Applications On AppImage, Flathub And Snapcraft Platforms) @@ -12,23 +12,23 @@ ![Search Linux Applications On AppImage, Flathub And Snapcraft][1] -Linux 一直在发展。过去,开发人员必须分别为不同的 Linux 发行版构建应用。由于存在多种 Linux 变体,因此为所有发行版构建应用变得很繁琐,而且非常耗时。接着一些开发人员发明了包转换器和构建器,如 [**Checkinstall**][2]、[**Debtap**][3] 和 [**Fpm**][4]。但他们没有完全解决问题。所有这些工具都只是将一种包格式转换为另一种包格式。我们仍然需要找到并安装应用运行所需的依赖项。 +Linux 一直在发展。过去,开发人员必须分别为不同的 Linux 发行版构建应用。由于存在多种 Linux 变体,因此为所有发行版构建应用变得很繁琐,而且非常耗时。后来一些开发人员发明了包转换器和构建器,如 [Checkinstall][2]、[Debtap][3] 和 [Fpm][4]。但他们也没有完全解决问题。所有这些工具都只是将一种包格式转换为另一种包格式。我们仍然需要找到应用并安装运行所需的依赖项。 -好吧,时代已经变了。我们现在有了通用的 Linux 应用。这意味着我们可以在大多数 Linux 发行版上安装这些应用。无论是 Arch Linux、Debian、CentOS、Redhat、Ubuntu 还是任何流行的 Linux 发行版,通用应用都可以正常使用。这些应用与所有必需的库和依赖项打包在一个包中。我们所要做的就是在我们使用的任何 Linux 发行版上下载并运行它们。流行的通用应用格式有 **AppImages**、[**Flatpaks**][5] 和 [**Snaps**][6]。 +好吧,时代已经变了。我们现在有了通用的 Linux 应用。这意味着我们可以在大多数 Linux 发行版上安装这些应用。无论是 Arch Linux、Debian、CentOS、Redhat、Ubuntu 还是任何流行的 Linux 发行版,通用应用都可以正常使用。这些应用与所有必需的库和依赖项打包在一个包中。我们所要做的就是在我们使用的任何 Linux 发行版上下载并运行它们。流行的通用应用格式有 AppImage、[Flatpak][5] 和 [Snap][6]。 -AppImages 由 **Simon peter** 创建和维护。许多流行的应用,如 Gimp、Firefox、Krita 等等,都有这些格式,并可直接在下载页面下载。只需下载它们,使其可执行并立即运行它。你甚至无需 root 权限来运行 AppImages。 +AppImage 由 Simon peter 创建和维护。许多流行的应用,如 Gimp、Firefox、Krita 等等,都有这些格式,并可直接在下载页面下载。只需下载它们,使其可执行并立即运行它。你甚至无需 root 权限来运行 AppImage。 -Flatpak 的开发人员是 **Alexander Larsson**(RedHat 员工)。 Flatpak 应用托管在名为 **“Flathub”** 的中央仓库(商店)中。如果你是开发人员,建议你使用 Flatpak 格式构建应用,并通过 Flathub 将其分发给用户。 +Flatpak 的开发人员是 Alexander Larsson(RedHat 员工)。Flatpak 应用托管在名为 “Flathub” 的中央仓库(商店)中。如果你是开发人员,建议你使用 Flatpak 格式构建应用,并通过 Flathub 将其分发给用户。 -**Snaps** 由 **Canonical** 而建,主要用于 Ubuntu。但是,其他 Linux 发行版的开发人员开始为 Snap 打包格式做出贡献。因此,Snaps 也开始适用于其他 Linux 发行版。Snaps 可以直接从应用的下载页面下载,也可以从 **Snapcraft** 商店下载。 +Snap 由 Canonical 而建,主要用于 Ubuntu。但是,其他 Linux 发行版的开发人员开始为 Snap 打包格式做出贡献。因此,Snap 也开始适用于其他 Linux 发行版。Snap 可以直接从应用的下载页面下载,也可以从 Snapcraft 商店下载。 许多受欢迎的公司和开发人员已经发布了 AppImage、Flatpak 和 Snap 格式的应用。如果你在寻找一款应用,只需进入相应的商店并获取你选择的应用并运行它,而不用管你使用何种 Linux 发行版。 -还有一个名为 **“Chob”** 的命令行通用应用搜索工具可在 AppImage、Flathub 和 Snapcraft 平台上轻松搜索 Linux 应用。此工具仅搜索给定的应用并在默认浏览器中显示官方链接。它不会安装它们。本指南将解释如何安装 Chob 并使用它来搜索 Linux 上的 AppImages、Flatpaks 和 Snaps。 +还有一个名为 “Chob” 的命令行通用应用搜索工具可在 AppImage、Flathub 和 Snapcraft 平台上轻松搜索 Linux 应用。此工具仅搜索给定的应用并在默认浏览器中显示官方链接。它不会安装它们。本指南将解释如何安装 Chob 并使用它来搜索 Linux 上的 AppImage、Flatpak 和 Snap。 ### 使用 Chob 在 AppImage、Flathub 和 Snapcraft 平台上搜索 Linux 应用 -从[**发布页面**][7]下载最新的 Chob 二进制文件。在编写本指南时,最新版本为 **0.3.5**。 +从[发布页面][7]下载最新的 Chob 二进制文件。在编写本指南时,最新版本为 0.3.5。 ``` $ wget https://github.com/MuhammedKpln/chob/releases/download/0.3.5/chob-linux @@ -40,7 +40,7 @@ $ wget https://github.com/MuhammedKpln/chob/releases/download/0.3.5/chob-linux $ chmod +x chob-linux ``` -最后,搜索你想要的应用。例如,我将搜索与 **Vim** 相关的应用。 +最后,搜索你想要的应用。例如,我将搜索与 Vim 相关的应用。 ``` $ ./chob-linux vim @@ -50,7 +50,7 @@ Chob 将在 AppImage、Flathub 和 Snapcraft 平台上搜索给定的应用( ![][8] -使用 Chob 搜索 Linux 应用 +*使用 Chob 搜索 Linux 应用* 只需要输入你想要应用前面的数字就可在默认浏览器中打开它的官方链接,并可在其中阅读应用的详细信息。 @@ -60,10 +60,9 @@ Chob 将在 AppImage、Flathub 和 Snapcraft 平台上搜索给定的应用( 有关更多详细信息,请查看下面的 Chob 官方 GitHub 页面。 -**资源:** - - * [**Chob 的 GitHub 仓库**][10] +资源: + * [Chob 的 GitHub 仓库][10] -------------------------------------------------------------------------------- @@ -73,7 +72,7 @@ via: https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and 作者:[sk][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/) 荣誉推出 From 56cf986505e510db75d968784a9d18a665d61dfa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 14:46:19 +0800 Subject: [PATCH 1011/1154] PUB:20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md @geekpi https://linux.cn/article-10994-1.html --- ...plications On AppImage, Flathub And Snapcraft Platforms.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md (98%) diff --git a/translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md b/published/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md similarity index 98% rename from translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md rename to published/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md index 981cb0b231..0ba4d3469b 100644 --- a/translated/tech/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md +++ b/published/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10994-1.html) [#]: subject: (Search Linux Applications On AppImage, Flathub And Snapcraft Platforms) [#]: via: (https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and-snapcraft-platforms/) [#]: author: (sk https://www.ostechnix.com/author/sk/) From 9c8009e416ceb603282d1b9de6b8b8accb048dd2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 14:51:57 +0800 Subject: [PATCH 1012/1154] APL:20190527 5 GNOME keyboard shortcuts to be more productive --- ...20190527 5 GNOME keyboard shortcuts to be more productive.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md b/sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md index 989d69e524..26de589b3f 100644 --- a/sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md +++ b/sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5bbc933c60bac93663d365d167b93ff615b338ab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 15:27:27 +0800 Subject: [PATCH 1013/1154] TSL:20190527 5 GNOME keyboard shortcuts to be more productive.md --- ...eyboard shortcuts to be more productive.md | 86 ------------------- ...eyboard shortcuts to be more productive.md | 84 ++++++++++++++++++ 2 files changed, 84 insertions(+), 86 deletions(-) delete mode 100644 sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md create mode 100644 translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md diff --git a/sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md b/sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md deleted file mode 100644 index 26de589b3f..0000000000 --- a/sources/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 GNOME keyboard shortcuts to be more productive) -[#]: via: (https://fedoramagazine.org/5-gnome-keyboard-shortcuts-to-be-more-productive/) -[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) - -5 GNOME keyboard shortcuts to be more productive -====== - -![][1] - -For some people, using GNOME Shell as a traditional desktop manager may be frustrating since it often requires more action of the mouse. In fact, GNOME Shell is also a [desktop manager][2] designed for and meant to be driven by the keyboard. Learn how to be more efficient with GNOME Shell with these 5 ways to use the keyboard instead of the mouse. - -### GNOME activities overview - -The activities overview can be easily opened using the **Super** key from the keyboard. (The **Super** key usually has a logo on it.) This is really useful when it comes to start an application. For example, it’s easy to start the Firefox web browser with the following key sequence **Super + f i r + Enter.** - -![][3] - -### Message tray - -In GNOME, notifications are available in the message tray. This is also the place where the calendar and world clocks are available. To open the message tray using the keyboard use the **Super+m** shortcut. To close the message tray simply use the same shortcut again. - - * ![][4] - - - -### Managing workspaces in GNOME - -Gnome Shell uses dynamic workspaces, meaning it creates additional workspaces as they are needed. A great way to be more productive using Gnome is to use one workspace per application or per dedicated activity, and then use the keyboard to navigate between these workspaces. - -Let’s look at a practical example. To open a Terminal in the current workspace press the following keys: **Super + t e r + Enter.** Then, to open a new workspace press **Super + PgDn**. Open Firefox ( **Super + f i r + Enter)**. To come back to the terminal, use **Super + PgUp**. - -![][5] - -### Managing an application window - -Using the keyboard it is also easy to manage the size of an application window. Minimizing, maximizing and moving the application to the left or the right of the screen can be done with only a few key strokes. Use **Super+**🠝 to maximize, **Super+**🠟 to minimize, **Super+**🠜 and **Super+**🠞 to move the window left and right. - -![][6] - -### Multiple windows from the same application - -Using the activities overview to start an application is very efficient. But trying to open a new window from an application already running only results in focusing on the open window. To create a new window, instead of simply hitting **Enter** to start the application, use **Ctrl+Enter**. - -So for example, to start a second instance of the terminal using the application overview, **Super + t e r + (Ctrl+Enter)**. - -![][7] - -Then you can use **Super+`** to switch between windows of the same application. - -![][8] - -As shown, GNOME Shell is a really powerful desktop environment when controlled from the keyboard. Learning to use these shortcuts and train your muscle memory to not use the mouse will give you a better user experience, and make you more productive when using GNOME. For other useful shortcuts, check out [this page on the GNOME wiki][9]. - -* * * - -_Photo by _[ _1AmFcS_][10]_ on _[_Unsplash_][11]_._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/5-gnome-keyboard-shortcuts-to-be-more-productive/ - -作者:[Clément Verna][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/cverna/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/5-gnome-keycombos-816x345.jpg -[2]: https://fedoramagazine.org/gnome-3-32-released-coming-to-fedora-30/ -[3]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-10-50.gif -[4]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-11-01.gif -[5]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-12-57.gif -[6]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-06.gif -[7]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-19.gif -[8]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-22.gif -[9]: https://wiki.gnome.org/Design/OS/KeyboardShortcuts -[10]: https://unsplash.com/photos/MuTWth_RnEs?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[11]: https://unsplash.com/search/photos/keyboard?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md b/translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md new file mode 100644 index 0000000000..6c15546636 --- /dev/null +++ b/translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 GNOME keyboard shortcuts to be more productive) +[#]: via: (https://fedoramagazine.org/5-gnome-keyboard-shortcuts-to-be-more-productive/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) + +5 个提高效率的 GNOME 快捷键 +====== + +![][1] + +对于某些人来说,使用 GNOME Shell 作为传统的桌面管理器可能会感觉沮丧,因为它通常需要更多的鼠标操作。事实上,GNOME Shell 也是一个专为键盘操作而设计的[桌面管理器][2]。通过这五种使用键盘而不是鼠标的方法,了解如何使用 GNOME Shell 提高效率。 + +### GNOME 活动概述 + +可以使用键盘上的 `Super` 键轻松打开活动概述。(`Super` 键通常有一个标识——比如 Windows 徽标……。)这在启动应用程序时非常有用。例如,使用以下键序列 `Super + f i r + Enter` 可以轻松启动 Firefox Web 浏览器 + +![][3] + +### 消息托盘 + +在 GNOME 中,消息托盘中提供了通知。这也是日历和世界时钟出现的地方。要使用键盘打开信息托盘,请使用 `Super + m` 快捷键。要关闭消息托盘,只需再次使用相同的快捷方式。 + + * ![][4] + +### 在 GNOME 中管理工作空间 + +GNOME Shell 使用动态工作空间,这意味着它可以根据需要创建更多工作空间。使用 GNOME 提高工作效率的一个好方法是为每个应用程序或每个专用活动使用一个工作区,然后使用键盘在这些工作区之间导航。 + +让我们看一个实际的例子。要在当前工作区中打开终端,请按以下键:`Super + t e r + Enter`。然后,要打开新工作区,请按 `Super + PgDn`。 打开 Firefox( `Super + f i r + Enter`)。 要返回终端(所在的工作空间),请使用 `Super + PgUp`。 + +![][5] + +### 管理应用窗口 + +使用键盘也可以轻松管理应用程序窗口的大小。最小化、最大化和将应用程序移动到屏幕的左侧或右侧只需几个击键即可完成。使用 `Super + ↑` 最大化、`Super + ↓` 最小化、`Super + ←` 和 `Super + →` 左右移动窗口。 + +![][6] + +### 同一个应用的多个窗口 + +使用活动概述启动应用程序非常有效。但是,尝试从已经运行的应用程序打开一个新窗口只能将焦点转移到已经打开的窗口。要创建一个新窗口,而不是简单地按 `Enter` 启动应用程序,请使用 `Ctrl + Enter`。 + +因此,例如,使用应用程序概述启动终端的第二个实例,`Super + t e r + (Ctrl + Enter)`。 + +![][7] + +然后你可以使用 `Super` + `在同一个应用程序的窗口之间切换。 + +![][8] + +如图所示,当用键盘控制时,GNOME Shell 是一个非常强大的桌面环境。学习使用这些快捷方式并训练你的肌肉记忆以不使用鼠标将为你提供更好的用户体验,并在使用 GNOME 时提高你的工作效率。有关其他有用的快捷方式,请查看 [GNOME wiki 上的此页面][9]。 + +* * * + +*图片来自 [1AmFcS][10],[Unsplash][11]* + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/5-gnome-keyboard-shortcuts-to-be-more-productive/ + +作者:[Clément Verna][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/5-gnome-keycombos-816x345.jpg +[2]: https://fedoramagazine.org/gnome-3-32-released-coming-to-fedora-30/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-10-50.gif +[4]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-11-01.gif +[5]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-12-57.gif +[6]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-06.gif +[7]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-19.gif +[8]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-22.gif +[9]: https://wiki.gnome.org/Design/OS/KeyboardShortcuts +[10]: https://unsplash.com/photos/MuTWth_RnEs?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[11]: https://unsplash.com/search/photos/keyboard?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 4917370ca299d7f4c2f0adac9f86f1968398a5ca Mon Sep 17 00:00:00 2001 From: chen ni Date: Wed, 19 Jun 2019 16:43:10 +0800 Subject: [PATCH 1014/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hould release their code as open source.md | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/sources/tech/20190508 Why startups should release their code as open source.md b/sources/tech/20190508 Why startups should release their code as open source.md index c62664da90..7c15465336 100644 --- a/sources/tech/20190508 Why startups should release their code as open source.md +++ b/sources/tech/20190508 Why startups should release their code as open source.md @@ -7,46 +7,44 @@ [#]: via: (https://opensource.com/article/19/5/startups-release-code) [#]: author: (Clément Flipo https://opensource.com/users/cl%C3%A9ment-flipo) -Why startups should release their code as open source +为什么初创公司应该将代码开源 ====== -Dokit wondered whether giving away its knowledge as open source was a -bad business decision, but that choice has been the foundation of its -success. +Dokit 曾经怀疑将自己的知识开源可能是一个失败的商业决策,然而正是这个选择奠定了它的成功。 ![open source button on keyboard][1] -It's always hard to recall exactly how a project started, but sometimes that can help you understand that project more clearly. When I think about it, our platform for creating user guides and documentation, [Dokit][2], came straight out of my childhood. Growing up in a house where my toys were Meccano and model airplane kits, the idea of making things, taking individual pieces and putting them together to create a new whole, was always a fundamental part of what it meant to play. My father worked for a DIY company, so there were always signs of building, repair, and instruction manuals around the house. When I was young, my parents sent me to join the Boy Scouts, where we made tables, tents and mud ovens, which helped foster my enjoyment of shared learning that I later found in the open source movement. +回想一个项目开展最初期的细节并不是一件容易的事情,但有时候可以帮助你更清晰地理解这个项目。如果让我来说,关于 [Dokit][2] 这个用来创建用户手册和文档的平台的最早的想法来自我的童年。小时候我家里都是 Meccano(译注:一种类似乐高的拼装玩具)和飞机模型之类的玩具,对于我来说,游戏中很重要的一部分就是动手制作,把独立的零件组装在一起来创造一个新的东西。我父亲在一家 DIY 公司工作,所以家里的很多东西也都和建筑、修理,以及使用说明书有关。小的时候父母还让我参加了童子军,在那里我们制作桌子和帐篷,还有泥巴做的烧烤炉,这些事情都培养了我在共同学习中感受到的乐趣,就像我在开源活动中感受到的一样。 -The art of repairing things and recycling products that I learned in childhood became part of what I did for a job. Then it became my ambition to take the reassuring feel of learning how to make and do and repair at home or in a group—but put it online. That inspired Dokit's creation. +在童年学到的修理东西和回收产品的艺术后来成为了我工作的一部分。后来我决心要用线上的方式,还原这种在家里或者小组里学习如何制作和修理东西时的那种非常棒的感觉。Dokit 就从这个想法中诞生了。 -### The first months +### 创业初期 -It hasn't always been easy, but since founding our company in 2017, I've realized that the biggest and most worthwhile goals are generally always difficult. If we were to achieve our plan to revolutionize the way [old-fashioned manuals and user guides are created and published][3], and maximize our impact in what we knew all along would be a niche market, we knew that a guiding mission was crucial to how we organized everything else. It was from there that we reached our first big decision: to [quickly launch a proof of concept using an existing open source framework][4], MediaWiki, and from there to release all of our code as open source. +事情并非一帆风顺,在我们的公司于 2017 年成立之后,我很快就意识到那些最庞大、最值得奋斗的目标一般来说也总是最困难的。如果想要实现我们的计划 —— 彻底改变 [人们旧有的编写和发行说明书和用户手册的方式][3],并且在这个细分市场(我们非常清楚这一点)里取得最大的影响力 —— 那么确立一个主导任务就十分关键,它关乎项目的组织方式。我们据此做出了第一个重要决策:首先 [在短时间内使用一个已有的开源框架 MediaWiki 制作产品原型来验证我们的想法][4],然后将我们的全部代码都作为开源项目发布。 -In retrospect, this decision was made easier by the fact that [MediaWiki][5] was already up and running. With 15,000 developers already active around the world and on a platform that included 90% of the features we needed to meet our minimum viable product (MVP), things would have no doubt been harder without support from the engine that made its name by powering Wikipedia. Confluence, a documentation platform in use by many enterprises, offers some good features, but in the end, it was an easy choice between the two. +当时 [MediaWiki][5] 已经在正常运作了,事后看来,这一点让我们的决策变得容易了许多。这个平台已经拥有我们设想的最小可用产品(MVP)所需要的 90% 的功能,并且在全世界范围内有 15000 名活跃的开发者。MediaWiki 因为是维基百科的驱动引擎而小有名气,如果没有来自它的支持,事情对我们来说无疑会困难很多。还有一个许多公司都在使用的文档平台 Confluence 也有一些不错的功能,但是最终还是不难在这两者之间做出选择。 -Placing our faith in the community, we put the first version of our platform straight onto GitHub. The excitement of watching the world's makers start using our platform, even before we'd done any real advertising, felt like an early indication that we were on the right track. Although the [maker and Fablab movements][6] encourage users to share instructions, and even sets out this expectation in the [Fablab charter][7] (as stated by MIT), in reality, there is a lack of real documentation. +出于对 Github 的信赖,我们把自己平台的初始版本完全放在了这个社区上。我们甚至还没有真正开始进行推广,就已经可以看到世界各地的制造者开始使用我们的平台,这种令人激动的感觉似乎说明我们的选择是正确的。尽管 [制造商以及 Fablab 运动][6](译注: Fablab 是一种向个人提供包括 3D 打印在内的电子化制造服务的小型工坊)都在鼓励用户积极分享说明材料,并且在 [Fablab 契约][7] 中也写明了这一点,现实中像模像样的文档还是不太多见。 -The first and most significant reason people like using our platform is that it responds to the very real problem of poor documentation inside an otherwise great movement—one that we knew could be even better. To us, it felt a bit like we were repairing a gap in the community of makers and DIY. Within a year of our launch, Fablabs, [Wikifab][8], [Open Source Ecology][9], [Les Petits Debrouillards][10], [Ademe][11], and [Low-Tech Lab][12] had installed our tool on their servers for creating step-by-step tutorials. +人们喜欢使用我们这个平台的首要原因是它可以解决一个非常实在的问题:一个本来还不错的项目,却使用了非常糟糕的文档 —— 其实这个项目本来可以变得更好的。对我们来说,这有点儿像是在修复 DIY 以及动手爱好者社区里的一个裂缝。在我们的平台发布后的一年之内,Fablabs、[Wikifab][8]、[Open Source Ecology][9]、[Les Petits Debrouillards][10]、[Ademe][11] 以及 [Low-Tech Lab][12] 都在他们的服务器上安装了我们的工具,用来制作逐步引导的教程。 -Before even putting out a press release, one of our users, Wikifab, began to get praise in national media as "[the Wikipedia of DIY][13]." In just two years, we've seen hundreds of communities launched on their own Dokits, ranging from the fun to the funny to the more formal product guides. Again, the power of the community is the force we want to harness, and it's constantly amazing to see projects—ranging from wind turbines to pet feeders—develop engaging product manuals using the platform we started. +甚至在我们还没有发新闻稿之前,我们的其中一个用户 Wikifab 就开始在全国性媒体上收到“DIY 界的维基百科”这样的称赞了。仅仅两年之内,我们看到有数百的社区都在他们自己的 Dokits 上开展了项目,从有意思的、搞笑的,到那种很正式的产品手册都有。这种社区的力量正是我们想要驾驭的,并且有这么多的项目 —— 从风力涡轮机到宠物喂食器 —— 都在使用我们创建的平台编写非常有吸引力的产品手册,这件事情真的令我们赞叹不已。 -### Opening up open source +### 项目开源 -Looking back at such a successful first two years, it's clear to us that our choice to use open source was fundamental to how we got where we are as fast as we did. The ability to gather feedback in open source is second-to-none. If a piece of code didn't work, [someone could tell us right away][14]. Why wait on appointments with consultants if you can learn along with those who are already using the service you created? +回头看看前两年的成功,很明显选择开源是我们能迅速取得成果的关键因素。最有价值的事情就是在开源项目中获得反馈的能力了。如果一段代码无法正常运行,[会有人立刻告诉我们][14]。如果可以从这些已经在使用你提供的服务的人那里学到这么多东西,为什么还要需要等着和顾问们开会呢? -The level of engagement from the community also revealed the potential (including the potential interest) in our market. [Paris has a good and growing community of developers][15], but open source took us from a pool of a few thousand locally, and brought us to millions of developers all around the world who could become a part of what we were trying to make happen. The open availability of our code also proved reassuring to our users and customers who felt safe that, even if our company went away, the code wouldn't. +Github 社区对我们这个项目的关注程度也反映出了这个市场的潜力(包括利润上的潜力)。[巴黎有非常好的、成长迅速的开发者社区][15](译注:Dokit 是一家设立在巴黎的公司),但是开源将我们从一个只有数千当地人的小池子里带到了全世界数百万的开发者身边,他们都将成为我们的创作中的一部分。与此同时,代码的开放性也让我们的用户和客户更加放心,因为即使我们这个公司不在了,代码仍然会存续下去。 -If that was most of what we thought might happen as a result of using open source, there were also surprises along the way. By adopting an open method, we found ourselves gaining customers, reputation, and perfectly targeted advertising that we didn't have to pay for out of our limited startup budget. We found that the availability of our code helped improve our recruitment process because we were able to test candidates using our code before we made hires, and this also helped simplify the onboarding journey for those we did hire. +如果说上面这些都是在我们之前对开源的预期之中的话,其实这一路上也有不少惊喜。因为开源,我们获得了更多的客户、声望以及精准推广,这种推广本来以我们有限的预算是负担不起的,现在却不需要我们支付费用。开放代码还优化了我们的招聘流程,因为在雇佣之前就可以通过我们的代码来测试候选人,并且被雇佣之后的入职过程也会更加顺利。 -In what we see as a mixture of embarrassment and solidarity, the totally public nature of developers creating code in an open setting also helped drive up quality. People can share feedback with one another, but the public nature of the work also seems to encourage people to do their best. In the spirit of constant improvement and of continually building and rebuilding how Dokit works, supporting the community is something that we know we'd like to do more of and get better at in future. +开发者在完全公开的情况下写代码,既有一点尴尬,同时也很团结,这对我们提升产品质量很有帮助。人们可以互相发表意见和反馈,并且因为工作都是完全公开的,人们似乎会尽可能地想做到最好。为了不断优化、不断重构 Dokit 的运行方式,我们明白未来应该在对社区的支持上做得更好。 -### Where to next? +### 下一步是什么? -Even with the faith we've always had in what we were doing, and seeing the great product manuals that have been developed using our software, it never stops being exciting to see our project grow, and we're certain that the future has good things in store. +尽管我们对正在做的事情一直都很有信念,并且看到很多出色的产品说明书都是用我们的软件制作出来的,我们还是会对这个项目的成长不断地感到兴奋,并且非常确信未来一定会很好。 -In the early days, we found ourselves living a lot under the fear of distributing our knowledge for free. In reality, it was the opposite—open source gave us the ability to very rapidly build a startup that was sustainable from the beginning. Dokit is a platform designed to give its users the confidence to build, assemble, repair, and create entirely new inventions with the support of a community. In hindsight, we found we were doing the same thing by using open source to build a platform. +在创业初期,我们对将自己的知识免费分发出去这件事还是非常担心的。事实证明正好相反 —— 正是开源让我们能够迅速构建起一个可持续的初创企业。Dokit 平台的设计初衷是通过社区的支持,让它的用户有信心去构建、组装、修理和创造全新的发明。事后看来,我们用开源的方式去构建了 Dokit 这个平台,这和 Dokit 本身想做的其实正好是同一件事情。 -Just like when doing a repair or assembling a physical product, it's only when you have confidence in your methods that things truly begin to feel right. Now, at the beginning of our third year, we're starting to see growing global interest as the industry responds to [new generations of customers who want to use, reuse, and assemble products][16] that respond to changing homes and lifestyles. By providing the support of an online community, we think we're helping to create circumstances in which people feel more confident in doing things for themselves. +如同修理或者组装一件实体产品一样,只有当你对自己的方法有信心的时候,事情才会越来越顺利。现在,在我们创业的第三个年头,我们开始注意到全世界对这个领域的兴趣在增加,因为它迎合了出于不断变化的居家和生活方式的需求而 [想要使用、重复利用以及组装产品的新一代客户][16]。我们正是在通过线上社区的支持,创造一个让大家能够在自己动手做东西的时候感到更加有信心的平台。 -------------------------------------------------------------------------------- From 4c0faea7eb44ad9f7d302936998bf2dcb350b7ce Mon Sep 17 00:00:00 2001 From: chen ni Date: Wed, 19 Jun 2019 16:45:00 +0800 Subject: [PATCH 1015/1154] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=91=E8=80=85?= =?UTF-8?q?=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...508 Why startups should release their code as open source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190508 Why startups should release their code as open source.md b/sources/tech/20190508 Why startups should release their code as open source.md index 7c15465336..f5da2b2148 100644 --- a/sources/tech/20190508 Why startups should release their code as open source.md +++ b/sources/tech/20190508 Why startups should release their code as open source.md @@ -52,7 +52,7 @@ via: https://opensource.com/article/19/5/startups-release-code 作者:[Clément Flipo][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[chen-ni](https://github.com/chen-ni) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 64991fa3cb7ad518f2a228ed8d0e4b902549ca90 Mon Sep 17 00:00:00 2001 From: chen ni Date: Wed, 19 Jun 2019 16:45:48 +0800 Subject: [PATCH 1016/1154] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0=20transla?= =?UTF-8?q?ted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...90508 Why startups should release their code as open source.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190508 Why startups should release their code as open source.md (100%) diff --git a/sources/tech/20190508 Why startups should release their code as open source.md b/translated/tech/20190508 Why startups should release their code as open source.md similarity index 100% rename from sources/tech/20190508 Why startups should release their code as open source.md rename to translated/tech/20190508 Why startups should release their code as open source.md From 23d7bdb3acc118b2b6f24891dfcfd4bdbcbc368c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Wed, 19 Jun 2019 19:55:28 +0800 Subject: [PATCH 1017/1154] Translated --- ... The Official Chinese Version of Ubuntu.md | 125 ------------------ ... The Official Chinese Version of Ubuntu.md | 125 ++++++++++++++++++ 2 files changed, 125 insertions(+), 125 deletions(-) delete mode 100644 sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md create mode 100644 translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md diff --git a/sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md b/sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md deleted file mode 100644 index 146ee056e2..0000000000 --- a/sources/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md +++ /dev/null @@ -1,125 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ubuntu Kylin: The Official Chinese Version of Ubuntu) -[#]: via: (https://itsfoss.com/ubuntu-kylin/) -[#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) - -Ubuntu Kylin: The Official Chinese Version of Ubuntu -====== - -[_**Ubuntu has several official flavors**_][1] _**and Kylin is one of them. In this article, you’ll learn about Ubuntu Kylin, what it is, why it was created and what features it offers.**_ - -Kylin was originally developed in 2001 by academicians at the [National University of Defense Technology][2] in the People’s Republic of China. The name is derived from [Qilin][3], a beast from Chinese mythology. - -The first versions of Kylin were based on [FreeBSD][4] and were intended for use by the Chinese military and other government organizations. Kylin 3.0 was purely based on the Linux kernel, and a version called [NeoKylin][5] which was announced in December 2010. - -In 2013, [Canonical][6] (parent company of Ubuntu) reached an agreement with the [Ministry of Industry and Information Technology][7] of the People’s Republic of China to co-create and release an Ubuntu-based OS with features targeted at the Chinese market. - -![Ubuntu Kylin][8] - -### What is Ubuntu Kylin? - -Following the 2013 agreement mentioned above, Ubuntu Kylin is now the official Chinese version of Ubuntu. It is much more than just language localisation. In fact, it is determined to serve the Chinese market the same way as Ubuntu serves the global market. - -The first version of [Ubuntu Kylin][9] came with Ubuntu 13.04. Like Ubuntu, Kylin too has LTS (long term support) and non-LTS versions. - -Currently, Ubuntu Kylin 19.04 LTS implements the [UKUI][10] desktop environment with revised boot up animation, log-in/screen-lock program and OS theme. To offer a more friendly experience for users, it has fixed bugs, has a file preview function, timer log out, the latest [WPS office suite][11] and [Sogou][12] put-in methods integrated within. - -Kylin 4.0.2 is a community edition based on Ubuntu Kylin 16.04 LTS. It includes several third-party applications with long term and stable support. It’s perfect for both server and desktop usage for daily office work and welcomed by the developers to [download][13]. The Kylin forums are actively available to provide feedback and also troubleshooting to find solutions. - -[][14] - -Suggested read Solve Ubuntu Error: Failed to download repository information Check your Internet connection. - -#### UKUI: The desktop environment by Ubuntu Kylin - -![Ubuntu Kylin 19.04 with UKUI Desktop][15] - -[UKUI][16] is designed and developed by the Ubuntu Kylin team and has some great features and provisions: - - * Windows-like interactive functions to bring more friendly user experiences. The Setup Wizard is user-friendly so that users can get started with Ubuntu Kylin quickly. - * Control Center has new settings for theme and window. Updated components such as Start Menu, taskbar, notification bar, file manager, window manager and others. - * Available separately on both Ubuntu and Debian repositories to provide a new desktop environment for users of Debian/Ubuntu distributions and derivatives worldwide. - * New login and lock programs, which is more stable and with many functions. - * Includes a feedback program convenient for feedback and questions. - - - -#### Kylin Software Center - -![Kylin Software Center][17] - -Kylin has a software center similar to Ubuntu software center and is called Ubuntu Kylin Software Center. It’s part of the Ubuntu Kylin Software Store that also includes Ubuntu Kylin Developer Platform and Ubuntu Kylin Repository with a simple interface and powerful function. It supports both Ubuntu and Ubuntu Kylin Repositories and is especially convenient for quick installation of Chinese characteristic software developed by Ubuntu Kylin team! - -#### Youker: A series of tools - -Ubuntu Kylin has also a series of tools named as Youker. Typing in “Youker” in the Kylin start menu will bring up the Kylin assistant. If you press the “Windows” key on the keyboard, you’d get a response exactly like you would on Windows. It will fire-up the Kylin start menu. - -![Kylin Assistant][18] - -Other Kylin branded applications include Kylin Video (player), Kylin Burner, Youker Weather and Youker Fcitx which supports better office work and personal entertainment. - -![Kylin Video][19] - -#### Special focus on Chinese characters - -In cooperation with Kingsoft, Ubuntu Kylin developers also work on Sogou Pinyin for Linux, Kuaipan for Linux and Kingsoft WPS for Ubuntu Kylin, and also address issues with smart pinyin, cloud storage service and office applications. [Pinyin][20] is romanization system for Chinese characters. With this, user inputs with English keyboard but Chinese characters are displayed on the screen. - -[][21] - -Suggested read How to Remove Older Linux Kernel Versions in Ubuntu - -#### Fun Fact: Ubuntu Kylin runs on Chinese supercomputers - -![Tianhe-2 Supercomputer. Photo by O01326 – Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=45399546][22] - -It’s already in public knowledge that the [world’s top 500 fastest supercomputers run Linux][23]. Chinese supercomputers [Tianhe-1][24] and [Tianhe-2][25] both use the 64-bit version of Kylin Linux, dedicated to high-performance [parallel computing][26] optimization, power management and high-performance [virtual computing][27]. - -#### Summary - -I hope you liked this introduction in the world of Ubuntu Kylin. You can get either of Ubuntu Kylin 19.04 or the community edition based on Ubuntu 16.04 from its [official website][28]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-kylin/ - -作者:[Avimanyu Bandyopadhyay][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/avimanyu/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/which-ubuntu-install/ -[2]: https://english.nudt.edu.cn -[3]: https://www.thoughtco.com/what-is-a-qilin-195005 -[4]: https://itsfoss.com/freebsd-12-release/ -[5]: https://thehackernews.com/2015/09/neokylin-china-linux-os.html -[6]: https://www.canonical.com/ -[7]: http://english.gov.cn/state_council/2014/08/23/content_281474983035940.htm -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/Ubuntu-Kylin.jpeg?resize=800%2C450&ssl=1 -[9]: http://www.ubuntukylin.com/ -[10]: http://ukui.org -[11]: https://www.wps.com/ -[12]: https://en.wikipedia.org/wiki/Sogou_Pinyin -[13]: http://www.ubuntukylin.com/downloads/show.php?lang=en&id=122 -[14]: https://itsfoss.com/solve-ubuntu-error-failed-to-download-repository-information-check-your-internet-connection/ -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/ubuntu-Kylin-19-04-desktop.jpg?resize=800%2C450&ssl=1 -[16]: http://www.ukui.org/ -[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-software-center.jpg?resize=800%2C496&ssl=1 -[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-assistant.jpg?resize=800%2C535&ssl=1 -[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-video.jpg?resize=800%2C533&ssl=1 -[20]: https://en.wikipedia.org/wiki/Pinyin -[21]: https://itsfoss.com/remove-old-kernels-ubuntu/ -[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/tianhe-2.jpg?resize=800%2C600&ssl=1 -[23]: https://itsfoss.com/linux-runs-top-supercomputers/ -[24]: https://en.wikipedia.org/wiki/Tianhe-1 -[25]: https://en.wikipedia.org/wiki/Tianhe-2 -[26]: https://en.wikipedia.org/wiki/Parallel_computing -[27]: https://computer.howstuffworks.com/how-virtual-computing-works.htm -[28]: http://www.ubuntukylin.com diff --git a/translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md b/translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md new file mode 100644 index 0000000000..9fe02540d0 --- /dev/null +++ b/translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Ubuntu Kylin: The Official Chinese Version of Ubuntu) +[#]: via: (https://itsfoss.com/ubuntu-kylin/) +[#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) + +Ubuntu Kylin: Ubuntu 的官方中文版本 +====== + +[_**Ubuntu 有几个官方特色版本**_][1] _**并且 Kylin 是它们中的一个。在这篇文章中,你将学习 Ubuntu Kylin,它是什么,它为什么被创建,它提供的特色是什么。**_ + +Kylin 最初由中华人民共和国的[国防科技大学][2]的院士在2001年开发。名字来源于 [Qilin][3],一种来自中国神话的神兽。 + +Kylin 的第一个版本基于 [FreeBSD][4],计划用于中国军方和其它政府组织。Kylin 3.0 完全基于 Linux 内核,并且在2010年12月发布一个称为 [NeoKylin][5] 的版本。 + +在2013年,[Canonical][6] (Ubuntu 的母公司) reached an agreement with the 与中华人民共和国的[工业和信息化部][7] 达成共识,共同创建和发布一个针对中国市场特色的基于 Ubuntu 的操作系统。 + +![Ubuntu Kylin][8] + +### Ubuntu Kylin 是什么? + +根据上述2013年的共识,Ubuntu Kylin 现在是 Ubuntu 的官方中国版本。它不仅仅是语言本地化。事实上,它决心服务中国市场,像 Ubuntu 服务全球市场一样。 + +[Ubuntu Kylin][9] 的第一个版本与 Ubuntu 13.04 一起到来。像 Ubuntu 一样,Kylin 也有 LTS (长期支持)和非 LTS 版本。 + +当前,Ubuntu Kylin 19.04 LTS 实施带有修改启动动画,登录/锁屏程序和操作系统主题的 [UKUI][10] 桌面环境。为给用户提供更友好的体验,它修复错误,它有文件预览功能,有定时注销,最新的 [WPS 办公组件][11]和 [Sogou][12] 输入法集成在其中。 + +Kylin 4.0.2 是一个基于 Ubuntu Kylin 16.04 LTS 的社区版本。它包含一些带有长期稳定支持的第三方应用程序。它非常适合服务器和日常桌面办公使用,欢迎开发者[下载][13]。Kylin 论坛积极地获取来自提供的反馈以及解决问题来找到解决方案。 + +[][14] + +建议阅读解决 Ubuntu 错误:下载存储库信息失败,检查你的网络链接。 + +#### UKUI:Ubuntu Kylin 的桌面环境 + +![Ubuntu Kylin 19.04 with UKUI Desktop][15] + +[UKUI][16] 由 Ubuntu Kylin 开发小组设计和开发,有一些非常好的特色和预装软件: + + * 类似 Windows 的交互功能,带来更友好的用户体验。安装导向是用户友好的,所以,用户可以快速使用 Ubuntu Kylin 。 + * 控制中心有新的主题和窗口设置。更新像开始菜单,任务栏,文件管理器,窗口管理器和其它的组件。 + * 在 Ubuntu 和 Debian 存储库上都单独可用,为 Debian/Ubuntu 发行版和其全球衍生版的的用户提供一个新单独桌面环境。 + * 新的登录和锁定程序,它更稳定和具有很多功能。 + * 包括一个反馈问题的实用的反馈程序。 + + + +#### Kylin 软件中心 + +![Kylin Software Center][17] + +Kylin 有一个软件中心,类似于 Ubuntu 软件中,并被称为 Ubuntu Kylin 软件中心。它是 Ubuntu Kylin 软件商店的一部分,它也包含 Ubuntu Kylin 开发者平台和 Ubuntu Kylin 存储库,具有一个简单的用户界面,并功能强大。它同时支持 Ubuntu 和 Ubuntu Kylin 存储库,并特别适用于由 Ubuntu Kylin 小组开发的中文特有的软件的快速安装! + +#### Youker: 一系列的工具 + +Ubuntu Kylin 也有一系列被命名为 Youker 的工具。在 Kylin 开始菜单中输入 “Youker” 将带来 Kylin 助手。如果你在键盘上按 “Windows” 按键,像你在 Windows 上一样,你将获得一个精确地响应。它将启动 Kylin 开始菜单。 + +![Kylin Assistant][18] + +其它 Kylin 品牌的应用程序包括 Kylin 影音(播放器),Kylin 刻录,Youker 天气,Youker 企鹅,它们更好地支持办公工作和个人娱乐。 + +![Kylin Video][19] + +#### 特别专注于中文 + +与 Kingsoft 合作,Ubuntu Kylin 开发者也致力于 Linux 版本的搜狗拼音输入法,快盘,和 Ubuntu Kylin 版本的 Kingsoft WPS ,也解决智能拼音,云存储和办公应用程序。[Pinyin][20] 是中文字符的拉丁化系统。使用这个系统,用户用英文键盘输出,但在屏幕上将显示中文字符。 + +[][21] + +建议阅读如何在 Ubuntu 中移除旧的 Linux 内核版本 + +#### 有趣的事实:Ubuntu Kylin 运行在中国超级计算机上 + +![Tianhe-2 Supercomputer. Photo by O01326 – Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=45399546][22] + +它已经在公知的[世界500强最快的运行 Linux 的超级计算机][23]中。中国超级计算机[天河-1][24]和[天河-2][25]都使用 Kylin Linux 的64位版本,致力于高性能的[并行计算][26]最优化,电源管理和高性能的[虚拟化计算][27]。 + +#### 总结 + +我希望你喜欢这篇 Ubuntu Kylin 世界的介绍。你可以从它的[官方网站][28]获得 Ubuntu Kylin 19.04 或基于 Ubuntu 16.04 的社区版本。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-kylin/ + +作者:[Avimanyu Bandyopadhyay][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/which-ubuntu-install/ +[2]: https://english.nudt.edu.cn +[3]: https://www.thoughtco.com/what-is-a-qilin-195005 +[4]: https://itsfoss.com/freebsd-12-release/ +[5]: https://thehackernews.com/2015/09/neokylin-china-linux-os.html +[6]: https://www.canonical.com/ +[7]: http://english.gov.cn/state_council/2014/08/23/content_281474983035940.htm +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/Ubuntu-Kylin.jpeg?resize=800%2C450&ssl=1 +[9]: http://www.ubuntukylin.com/ +[10]: http://ukui.org +[11]: https://www.wps.com/ +[12]: https://en.wikipedia.org/wiki/Sogou_Pinyin +[13]: http://www.ubuntukylin.com/downloads/show.php?lang=en&id=122 +[14]: https://itsfoss.com/solve-ubuntu-error-failed-to-download-repository-information-check-your-internet-connection/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/ubuntu-Kylin-19-04-desktop.jpg?resize=800%2C450&ssl=1 +[16]: http://www.ukui.org/ +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-software-center.jpg?resize=800%2C496&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-assistant.jpg?resize=800%2C535&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-video.jpg?resize=800%2C533&ssl=1 +[20]: https://en.wikipedia.org/wiki/Pinyin +[21]: https://itsfoss.com/remove-old-kernels-ubuntu/ +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/tianhe-2.jpg?resize=800%2C600&ssl=1 +[23]: https://itsfoss.com/linux-runs-top-supercomputers/ +[24]: https://en.wikipedia.org/wiki/Tianhe-1 +[25]: https://en.wikipedia.org/wiki/Tianhe-2 +[26]: https://en.wikipedia.org/wiki/Parallel_computing +[27]: https://computer.howstuffworks.com/how-virtual-computing-works.htm +[28]: http://www.ubuntukylin.com From e7849823eae0756313176200c69019c82f0f6d64 Mon Sep 17 00:00:00 2001 From: chen ni Date: Wed, 19 Jun 2019 21:20:11 +0800 Subject: [PATCH 1018/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190416 Can schools be agile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190416 Can schools be agile.md b/sources/tech/20190416 Can schools be agile.md index 065b313c05..ca9db0c33f 100644 --- a/sources/tech/20190416 Can schools be agile.md +++ b/sources/tech/20190416 Can schools be agile.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chen-ni) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 24365e60ff67abc48fdd76fc3224f0adf44fdec1 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 19 Jun 2019 21:23:32 +0800 Subject: [PATCH 1019/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190619=20Get?= =?UTF-8?q?=20the=20latest=20Ansible=202.8=20in=20Fedora=20sources/tech/20?= =?UTF-8?q?190619=20Get=20the=20latest=20Ansible=202.8=20in=20Fedora.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...19 Get the latest Ansible 2.8 in Fedora.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md diff --git a/sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md b/sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md new file mode 100644 index 0000000000..486ea44a30 --- /dev/null +++ b/sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get the latest Ansible 2.8 in Fedora) +[#]: via: (https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +Get the latest Ansible 2.8 in Fedora +====== + +![][1] + +Ansible is one of the most popular automation engines in the world. It lets you automate virtually anything, from setup of a local system to huge groups of platforms and apps. It’s cross platform, so you can use it with all sorts of operating systems. Read on for more information on how to get the latest Ansible in Fedora, some of its changes and improvements, and how to put it to use. + +### Releases and features + +Ansible 2.8 was recently released with many fixes, features, and enhancements. It was available in Fedora mere days afterward as an official update in Fedora 29 and 30, as well as EPEL. The follow-on version 2.8.1 released two weeks ago. Again, the new release was available within a few days in Fedora. + +Installation is, of course, easy to do from the official Fedora repositories [using sudo][2]: + +``` +$ sudo dnf -y install ansible +``` + +The 2.8 release has a long list of changes, and you can read them in the [Porting Guide for 2.8][3]. But they include some goodies, such as _Python interpreter discovery._ Ansible 2.8 now tries to figure out which Python is preferred by the platform it runs on. In cases where that fails, Ansible uses a fallback list. However, you can still use a variable _ansible_python_interpreter_ to set the Python interpreter. + +Another change makes Ansible more consistent across platforms. Since _sudo_ is more exclusive to UNIX/Linux, and other platforms don’t have it, _become_ is now used in more places. This includes command line switches. For example, _–ask-sudo-pass_ has become _–ask-become-pass_ , and the prompt is now _BECOME password:_ instead. + +There are many more features in the 2.8 and 2.8.1 releases. Do check out the [official changelog on GitHub][4] for all the details. + +### Using Ansible + +Maybe you’re not sure if Ansible is something you could really use. Don’t worry, you might not be alone in thinking that, because it’s so powerful. But it turns out that it’s not hard to use it even for simple or individual setups like a home with a couple computers (or even just one!). + +We covered this topic earlier in the Fedora magazine as well: + +> [Using Ansible to set up a workstation][5] + +Give Ansible a try and see what you think. The great part about it is that Fedora stays quite up to date with the latest releases. Happy automating! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/ + +作者:[Paul W. Frields][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/pfrields/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/ansible28-816x345.jpg +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html +[4]: https://github.com/ansible/ansible/blob/stable-2.8/changelogs/CHANGELOG-v2.8.rst +[5]: https://fedoramagazine.org/using-ansible-setup-workstation/ From 2fe208d120bcac5a1a1fbcfc6cb503a6bb1a2ffc Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 19 Jun 2019 21:23:58 +0800 Subject: [PATCH 1020/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190619=2011?= =?UTF-8?q?=20Free=20and=20Open=20Source=20Video=20Editing=20Software=20so?= =?UTF-8?q?urces/tech/20190619=2011=20Free=20and=20Open=20Source=20Video?= =?UTF-8?q?=20Editing=20Software.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... and Open Source Video Editing Software.md | 327 ++++++++++++++++++ 1 file changed, 327 insertions(+) create mode 100644 sources/tech/20190619 11 Free and Open Source Video Editing Software.md diff --git a/sources/tech/20190619 11 Free and Open Source Video Editing Software.md b/sources/tech/20190619 11 Free and Open Source Video Editing Software.md new file mode 100644 index 0000000000..57ad8a5358 --- /dev/null +++ b/sources/tech/20190619 11 Free and Open Source Video Editing Software.md @@ -0,0 +1,327 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (11 Free and Open Source Video Editing Software) +[#]: via: (https://itsfoss.com/open-source-video-editors/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +11 Free and Open Source Video Editing Software +====== + +We’ve already covered the [top video editors for Linux][1]. That list contained some non-open source software as well. This made us write this article to feature only open source video editors. We’ve also mentioned what platforms are supported by these software so that this list is helpful even if you are not using Linux. + +### Top Free and Open Source Video Editors + +![Best Open Source Video Editors][2] + +Just for your information, this list is not a ranking and the editors listed here are not in any specific order. I have not mentioned the installation procedure but you can find that information on the website of each project. + +#### 1\. Kdenlive + +![][3] + +**Key Features** : + + * Multi-track Video Editing + * All kinds of audio/video format supported with the help of FFmpeg libraries + * 2D Title maker + * Customizable Interface and shortcuts + * Proxy editing to make things faster + * Automatic backup + * Timeline preview + * Keyframeable effects + * Audiometer, Histogram, Waveform, etc. + + + +**Platforms available on:** Linux, macOS and Windows. + +Kdenlive is an open source video editor (and free) available for Windows, Mac OSX, and Linux distros. + +If you are on a Mac, you will have to manually compile and install it. However, if you are on Windows, you can download the EXE file and should have no issues installing it. + +[Kdenlive][4] + +#### 2\. LiVES + +![][5] + +**Key Features:** + + * Frame and sample accurate editing + * Edit video in real-time + * Can be controlled using MIDI, keyboard, Joystic + * Multi-track support + * VJ keyboard control during playback + * Plugins supported + * Compatible with various effects frameworks: projectM, LADSPA audio, and so on. + + + +**Platforms available on:** Linux and macOS. Support for Windows will be added soon. + +LiVES is an interesting open source video editor. You can find the code on [GitHub][6]. It is currently available for **Linux and macOS Leopard**. It will soon be available for Windows (hopefully by the end of 2019). + +[LiVES][7] + +#### 3\. OpenShot + +![][8] + +**Key Features:** + + * Almost all video/audio formats supported + * Key frame animation framework + * Multi-track support + * Desktop integration (drag and drop support) + * Video transition with real-time previews + * 3D animated titles and effects + * Advanced timeline with drag/drop support, panning, scrolling, zooming, and snapping. + + + +**Platforms available on:** Linux, macOS and Windows. + +OpenShot is a quite popular video editor and it is open source as well. Unlike others, OpenShot offers a DMG installer for Mac OSX. So, you don’t have to compile and install it manually. + +If you are a fan of open source solutions and you own a Mac, OpenShot seems like a very good option. + +[OpenShot][9] + +#### 4\. VidCutter + +![][10] + +**Key Features:** + + * Keyframes viewer + * Cut, Split, and add different clips + * Major audio/video formats supported + + + +[][11] + +Suggested read Install Windows Like Desktop Widgets In Ubuntu Linux With Screenlets + +**Platforms available on:** Linux, macOS and Windows. + +VidCutter is an open source video editor for basic tasks. It does not offer a plethora of features – but it works for all the common tasks like clipping or cutting. It’s under active development as well. + +For Linux, it is available on Flathub as well. And, for Windows and Mac OS, you do get EXE and DMG file packages in the latest releases. + +[VidCutter][12] + +#### 5\. Shotcut + +![][13] + +**Key Features:** + + * Supports almost all major audio/video formats with the help of FFmpeg libraries. + * Multiple dockable/undockable panels + * Intuitive UI + * JACK transport sync + * Stereo, mono, and 5.1 surround support + * Waveform, Histogram, etc. + * Easy to use with dual monitors + * Portable version available + + + +**Platforms available on:** Linux, macOS and Windows. + +Shotcut is yet another popular open source video editor available across multiple platforms. It features a nice interface to work on. + +When considering the features, it offers almost everything that you would ever need (from color correction to adding transitions). Also, it provides a portable version for Windows – which is an impressive thing. + +[Shotcut][14] + +#### 6\. Flowblade + +![][15] + +**Key Features:** + + * Advanced timeline control + * Multi-track editing + * [G’mic][16] tool + * All major audio/video formats supported with the help of FFMpeg libraries + + + +**Platforms available on:** Linux + +Flowblade is an intuitive open source video editor available only for Linux. Yes, it is a bummer that we do not have cross-platform support for this. + +However, if you are using a Linux distro, you can either download the .deb file and get it installed or use the source code on GitHub. + +[Flowblade][17] + +#### 7\. Avidemux + +![][18] + +**Key Features:** + + * Trim + * Cut + * Filter support + * Major video format supported + + + +**Platforms available on:** Linux, BSD, macOS and Windows. + +If you are looking for a basic cross-platform open source video editor – this will be one of our recommendations. You just get the ability to cut, save, add a filter, and perform some other basic editing tasks. Their official [SourceForge page][19] might look like it has been abandoned, but it is in active development. + +[Avidemux][19] + +#### 8\. Pitivi + +![][20] + +**Key Features:** + + * All major video formats supported using [GStreamer Multimedia Framework][21] + * Advanced timeline independent of frame rate + * Animated effects and transitions + * Audio waveforms + * Real-time trimming previews + + + +**Platforms available on:** Linux + +Yet another open source video editor that is available only for Linux. The UI is user-friendly and the features offered will help you perform some advanced edits as well. + +You can install it using Flatpak or look for the source code on their official website. It should be available in the repositories of most distributions as well. + +[Pitivi][22] + +#### 9\. Blender + +![][23] + +**Key Features:** + + * VFX + * Modeling tools + * Animation and Rigging tools + * Draw in 2D or 3D + + + +[][24] + +Suggested read 4 Best Modern Open Source Text Editors For Coding in Linux + +**Platforms available on:** Linux, macOS and Windows. + +Blender is an advanced 3D creation suite. And, it is surprising that you get all those powerful abilities for free (and while being open source). + +Of course, Blender is not a solution for every user – however, it is definitely one of the best open source tool available for Windows, macOS, and Linux. You can also find it on [Steam][25] to install it. + +[Blender][26] + +#### 10\. Cinelerra + +![][27] + +**Key Features:** + + * Advanced timeline + * Motion tracking support + * Video stabilization + * Audio mastering + * Color correction + + + +**Platforms available on:** Linux + +Cinelerra is a quite popular open source video editor. However, it has several branches to it (in other words – different versions). I am not sure if that is a good thing – but you get different features (and ability) on each of them. + +Cinelerra GG, CV, CVE, and HV are those variants catering to users with different preferences. Personally, I would recommend to check out [Cinelerra GG][28]. + +[Cinelerra][29] + +#### 11\. NATRON + +![][30] + +**Key Features:** + + * VFX + * Powerful Tracker + * Keying tools for production needs + * Shadertoy and G’mic tools + * OpenFX plugin support + + + +**Platforms available on** : Linux, macOS and Windows. + +If you are into VFX and motion graphics, NATRON is a good alternative to Blender. Of course, in order to compare them for your usage, you will have to give it a try yourself. + +You do have the installer available for Windows and the dmg package for Mac. So, it is quite easy to get it installed. You can always head to its [GitHub page][31] for more information. + +[Natron][32] + +**Wrapping Up** + +So, now that you know about some of the most popular open source video editors available out there – what do you think about them? + +Are they good enough for professional requirements? Or, did we miss any of your favorite open source video editor that deserved the mention? + +I am not an expert video editor and have only experience with simple editing tasks to create YouTube videos. If you are an experienced and professional video editor, I would like to hear your opinion on how good are these open source video editors for the experts. + +Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/open-source-video-editors/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-video-editing-software-linux/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/best-open-source-video-editors-800x450.png?resize=800%2C450&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/06/kdenlive-free-video-editor-on-ubuntu.jpg?ssl=1 +[4]: https://kdenlive.org/en/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/lives-video-editor.jpg?fit=800%2C600&ssl=1 +[6]: https://github.com/salsaman/LiVES +[7]: http://lives-video.com/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/06/openshot-free-video-editor-on-ubuntu.jpg?ssl=1 +[9]: https://www.openshot.org/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/vidcutter.jpg?fit=800%2C585&ssl=1 +[11]: https://itsfoss.com/install-windows-desktop-widgets-linux/ +[12]: https://github.com/ozmartian/vidcutter +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/06/shotcut-video-editor-linux.jpg?resize=800%2C503&ssl=1 +[14]: https://shotcut.org/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/06/flowblade-movie-editor-on-ubuntu.jpg?ssl=1 +[16]: https://gmic.eu/ +[17]: https://jliljebl.github.io/flowblade/index.html +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/avidemux.jpg?resize=800%2C697&ssl=1 +[19]: http://avidemux.sourceforge.net/ +[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/pitvi.jpg?resize=800%2C464&ssl=1 +[21]: https://en.wikipedia.org/wiki/GStreamer +[22]: http://www.pitivi.org/ +[23]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/06/blender-running-on-ubuntu-16.04.jpg?ssl=1 +[24]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[25]: https://store.steampowered.com/app/365670/Blender/ +[26]: https://www.blender.org/ +[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/06/cinelerra-screenshot.jpeg?ssl=1 +[28]: https://www.cinelerra-gg.org/ +[29]: http://cinelerra.org/ +[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/natron.jpg?fit=800%2C481&ssl=1 +[31]: https://github.com/NatronGitHub/Natron +[32]: https://natrongithub.github.io/ From 8246995d26a477d95b7dd1f81221a413d9942dad Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 21:48:06 +0800 Subject: [PATCH 1021/1154] PRF:20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md @robsean --- ... The Official Chinese Version of Ubuntu.md | 66 +++++++++---------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md b/translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md index 9fe02540d0..d640c0e770 100644 --- a/translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md +++ b/translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md @@ -1,86 +1,80 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Ubuntu Kylin: The Official Chinese Version of Ubuntu) [#]: via: (https://itsfoss.com/ubuntu-kylin/) [#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) -Ubuntu Kylin: Ubuntu 的官方中文版本 +优麒麟:Ubuntu 的官方中文版本 ====== -[_**Ubuntu 有几个官方特色版本**_][1] _**并且 Kylin 是它们中的一个。在这篇文章中,你将学习 Ubuntu Kylin,它是什么,它为什么被创建,它提供的特色是什么。**_ +> 让我们来看看国外是如何看优麒麟的。 -Kylin 最初由中华人民共和国的[国防科技大学][2]的院士在2001年开发。名字来源于 [Qilin][3],一种来自中国神话的神兽。 +[Ubuntu 有几个官方特色版本][1],优麒麟(Ubuntu Kylin)是它们中的一个。在这篇文章中,你将了解到优麒麟,它是什么,它为什么被创建,它的特色是什么。 -Kylin 的第一个版本基于 [FreeBSD][4],计划用于中国军方和其它政府组织。Kylin 3.0 完全基于 Linux 内核,并且在2010年12月发布一个称为 [NeoKylin][5] 的版本。 +麒麟操作系统最初由中华人民共和国的[国防科技大学][2]的院士在 2001 年开发。名字来源于[麒麟][3],这是一种来自中国神话的神兽。 -在2013年,[Canonical][6] (Ubuntu 的母公司) reached an agreement with the 与中华人民共和国的[工业和信息化部][7] 达成共识,共同创建和发布一个针对中国市场特色的基于 Ubuntu 的操作系统。 +麒麟操作系统的第一个版本基于 [FreeBSD][4],计划用于中国军方和其它政府组织。麒麟 3.0 完全基于 Linux 内核,并且在 2010 年 12 月发布一个称为 [NeoKylin][5] 的版本。 + +在 2013 年,[Canonical][6] (Ubuntu 的母公司) 与中华人民共和国的[工业和信息化部][7] 达成共识,共同创建和发布一个针对中国市场特色的基于 Ubuntu 的操作系统。 ![Ubuntu Kylin][8] -### Ubuntu Kylin 是什么? +### 优麒麟是什么? -根据上述2013年的共识,Ubuntu Kylin 现在是 Ubuntu 的官方中国版本。它不仅仅是语言本地化。事实上,它决心服务中国市场,像 Ubuntu 服务全球市场一样。 +根据上述 2013 年的共识,优麒麟现在是 Ubuntu 的官方中国版本。它不仅仅是语言本地化。事实上,它决心服务中国市场,就像 Ubuntu 服务全球市场一样。 -[Ubuntu Kylin][9] 的第一个版本与 Ubuntu 13.04 一起到来。像 Ubuntu 一样,Kylin 也有 LTS (长期支持)和非 LTS 版本。 +[优麒麟][9]的第一个版本与 Ubuntu 13.04 一起到来。像 Ubuntu 一样,优麒麟也有 LTS (长期支持)和非 LTS 版本。 -当前,Ubuntu Kylin 19.04 LTS 实施带有修改启动动画,登录/锁屏程序和操作系统主题的 [UKUI][10] 桌面环境。为给用户提供更友好的体验,它修复错误,它有文件预览功能,有定时注销,最新的 [WPS 办公组件][11]和 [Sogou][12] 输入法集成在其中。 +当前,优麒麟 19.04 LTS 采用了 [UKUI][10] 桌面环境,修改了启动动画、登录/锁屏程序和操作系统主题。为给用户提供更友好的体验,它修复了一些错误,带有文件预览、定时注销等功能,最新的 [WPS 办公组件][11]和 [搜狗][12] 输入法集成于其中。 -Kylin 4.0.2 是一个基于 Ubuntu Kylin 16.04 LTS 的社区版本。它包含一些带有长期稳定支持的第三方应用程序。它非常适合服务器和日常桌面办公使用,欢迎开发者[下载][13]。Kylin 论坛积极地获取来自提供的反馈以及解决问题来找到解决方案。 +- [https://youtu.be/kZPtFMWsyv4](https://youtu.be/kZPtFMWsyv4) -[][14] +银河麒麟 4.0.2 是一个基于优麒麟 16.04 LTS 的社区版本。它包含一些带有长期稳定支持的第三方应用程序。它非常适合服务器和日常桌面办公使用,欢迎开发者[下载][13]。麒麟论坛积极地获取来自提供的反馈以及解决问题来找到解决方案。 -建议阅读解决 Ubuntu 错误:下载存储库信息失败,检查你的网络链接。 - -#### UKUI:Ubuntu Kylin 的桌面环境 +#### UKUI:优麒麟的桌面环境 ![Ubuntu Kylin 19.04 with UKUI Desktop][15] -[UKUI][16] 由 Ubuntu Kylin 开发小组设计和开发,有一些非常好的特色和预装软件: +[UKUI][16] 由优麒麟开发小组设计和开发,有一些非常好的特色和预装软件: - * 类似 Windows 的交互功能,带来更友好的用户体验。安装导向是用户友好的,所以,用户可以快速使用 Ubuntu Kylin 。 - * 控制中心有新的主题和窗口设置。更新像开始菜单,任务栏,文件管理器,窗口管理器和其它的组件。 - * 在 Ubuntu 和 Debian 存储库上都单独可用,为 Debian/Ubuntu 发行版和其全球衍生版的的用户提供一个新单独桌面环境。 + * 类似 Windows 的交互功能,带来更友好的用户体验。安装导向易于使用,用户可以快速使用优麒麟。 + * 控制中心对主题和窗口采用了新的设置。如开始菜单、任务栏、文件管理器、窗口管理器和其它的组件进行了更新。 + * 在 Ubuntu 和 Debian 存储库上都可用,为 Debian/Ubuntu 发行版和其全球衍生版的的用户提供一个新单独桌面环境。 * 新的登录和锁定程序,它更稳定和具有很多功能。 * 包括一个反馈问题的实用的反馈程序。 - - -#### Kylin 软件中心 +#### 麒麟软件中心 ![Kylin Software Center][17] -Kylin 有一个软件中心,类似于 Ubuntu 软件中,并被称为 Ubuntu Kylin 软件中心。它是 Ubuntu Kylin 软件商店的一部分,它也包含 Ubuntu Kylin 开发者平台和 Ubuntu Kylin 存储库,具有一个简单的用户界面,并功能强大。它同时支持 Ubuntu 和 Ubuntu Kylin 存储库,并特别适用于由 Ubuntu Kylin 小组开发的中文特有的软件的快速安装! +麒麟有一个软件中心,类似于 Ubuntu 软件中心,并被称为优麒麟软件中心。它是优麒麟软件商店的一部分,该商店也包含优麒麟开发者平台和优麒麟存储库,具有一个简单的用户界面,并功能强大。它同时支持 Ubuntu 和优麒麟存储库,并特别适用于由优麒麟小组开发的中文特有的软件的快速安装! -#### Youker: 一系列的工具 +#### 优客:一系列的工具 -Ubuntu Kylin 也有一系列被命名为 Youker 的工具。在 Kylin 开始菜单中输入 “Youker” 将带来 Kylin 助手。如果你在键盘上按 “Windows” 按键,像你在 Windows 上一样,你将获得一个精确地响应。它将启动 Kylin 开始菜单。 +优麒麟也有一系列被命名为优客的工具。在麒麟开始菜单中输入 “Youker” 将带来麒麟助手。如果你在键盘上按 “Windows” 按键,像你在 Windows 上一样,它将打开麒麟开始菜单。 ![Kylin Assistant][18] -其它 Kylin 品牌的应用程序包括 Kylin 影音(播放器),Kylin 刻录,Youker 天气,Youker 企鹅,它们更好地支持办公工作和个人娱乐。 +其它麒麟品牌的应用程序包括麒麟影音(播放器)、麒麟刻录,优客天气、优客 Fcitx 输入法,它们更好地支持办公工作和个人娱乐。 ![Kylin Video][19] #### 特别专注于中文 -与 Kingsoft 合作,Ubuntu Kylin 开发者也致力于 Linux 版本的搜狗拼音输入法,快盘,和 Ubuntu Kylin 版本的 Kingsoft WPS ,也解决智能拼音,云存储和办公应用程序。[Pinyin][20] 是中文字符的拉丁化系统。使用这个系统,用户用英文键盘输出,但在屏幕上将显示中文字符。 +通过与金山软件合作,优麒麟开发者也致力于 Linux 版本的搜狗拼音输入法、快盘和优麒麟版本的金山 WPS,并解决了智能拼音、云存储和办公应用程序方面的问题。[拼音][20] 是中文字符的拉丁化系统。使用这个系统,用户用英文键盘输入,但在屏幕上将显示中文字符。 -[][21] - -建议阅读如何在 Ubuntu 中移除旧的 Linux 内核版本 - -#### 有趣的事实:Ubuntu Kylin 运行在中国超级计算机上 +#### 有趣的事实:优麒麟运行在中国超级计算机上 ![Tianhe-2 Supercomputer. Photo by O01326 – Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=45399546][22] -它已经在公知的[世界500强最快的运行 Linux 的超级计算机][23]中。中国超级计算机[天河-1][24]和[天河-2][25]都使用 Kylin Linux 的64位版本,致力于高性能的[并行计算][26]最优化,电源管理和高性能的[虚拟化计算][27]。 +众所周知[世界上最快的超级计算机 500 强都在运行 Linux][23]。中国超级计算机[天河-1][24]和[天河-2][25]都使用优麒麟的 64 位版本,致力于高性能的[并行计算][26]优化、电源管理和高性能的[虚拟化计算][27]。 -#### 总结 +### 总结 -我希望你喜欢这篇 Ubuntu Kylin 世界的介绍。你可以从它的[官方网站][28]获得 Ubuntu Kylin 19.04 或基于 Ubuntu 16.04 的社区版本。 +我希望你喜欢这篇优麒麟世界的介绍。你可以从它的[官方网站][28]获得优麒麟 19.04 或基于 Ubuntu 16.04 的社区版本(银河麒麟)。 -------------------------------------------------------------------------------- @@ -89,7 +83,7 @@ via: https://itsfoss.com/ubuntu-kylin/ 作者:[Avimanyu Bandyopadhyay][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/) 荣誉推出 From e9f8967d4e2824784032987456901404af2cb54d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 21:49:24 +0800 Subject: [PATCH 1022/1154] PUB:20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md @robsean https://linux.cn/article-10995-1.html --- ...13 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md (99%) diff --git a/translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md b/published/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md similarity index 99% rename from translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md rename to published/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md index d640c0e770..fe9c2a13a6 100644 --- a/translated/tech/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md +++ b/published/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10995-1.html) [#]: subject: (Ubuntu Kylin: The Official Chinese Version of Ubuntu) [#]: via: (https://itsfoss.com/ubuntu-kylin/) [#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) From fe4dd753e3bf4b2672e376366d862e054705e0bd Mon Sep 17 00:00:00 2001 From: yuqi Date: Wed, 19 Jun 2019 23:09:14 +0800 Subject: [PATCH 1023/1154] translating 20190301 Emacs for (even more of) the win --- sources/tech/20190301 Emacs for (even more of) the win.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190301 Emacs for (even more of) the win.md b/sources/tech/20190301 Emacs for (even more of) the win.md index c1697f3cae..995d678073 100644 --- a/sources/tech/20190301 Emacs for (even more of) the win.md +++ b/sources/tech/20190301 Emacs for (even more of) the win.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (oneforalone) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e7917bbdff82447bf8d66817699d6d741df7ecc5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 23:19:08 +0800 Subject: [PATCH 1024/1154] PRF:20190527 5 GNOME keyboard shortcuts to be more productive.md @wxy --- ...OME keyboard shortcuts to be more productive.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md b/translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md index 6c15546636..08bba53038 100644 --- a/translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md +++ b/translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 GNOME keyboard shortcuts to be more productive) @@ -16,7 +16,7 @@ ### GNOME 活动概述 -可以使用键盘上的 `Super` 键轻松打开活动概述。(`Super` 键通常有一个标识——比如 Windows 徽标……。)这在启动应用程序时非常有用。例如,使用以下键序列 `Super + f i r + Enter` 可以轻松启动 Firefox Web 浏览器 +可以使用键盘上的 `Super` 键轻松打开活动概述。(`Super` 键通常有一个标识——比如 Windows 徽标……)这在启动应用程序时非常有用。例如,使用以下键序列 `Super + f i r + Enter` 可以轻松启动 Firefox Web 浏览器 ![][3] @@ -24,7 +24,7 @@ 在 GNOME 中,消息托盘中提供了通知。这也是日历和世界时钟出现的地方。要使用键盘打开信息托盘,请使用 `Super + m` 快捷键。要关闭消息托盘,只需再次使用相同的快捷方式。 - * ![][4] +![][4] ### 在 GNOME 中管理工作空间 @@ -42,20 +42,18 @@ GNOME Shell 使用动态工作空间,这意味着它可以根据需要创建 ### 同一个应用的多个窗口 -使用活动概述启动应用程序非常有效。但是,尝试从已经运行的应用程序打开一个新窗口只能将焦点转移到已经打开的窗口。要创建一个新窗口,而不是简单地按 `Enter` 启动应用程序,请使用 `Ctrl + Enter`。 +使用活动概述启动应用程序非常有效。但是,尝试从已经运行的应用程序打开一个新窗口只能将焦点转移到已经打开的窗口。要创建一个新窗口,就不是简单地按 `Enter` 启动应用程序,请使用 `Ctrl + Enter`。 因此,例如,使用应用程序概述启动终端的第二个实例,`Super + t e r + (Ctrl + Enter)`。 ![][7] -然后你可以使用 `Super` + `在同一个应用程序的窗口之间切换。 +然后你可以使用 `Super` + ` 在同一个应用程序的窗口之间切换。 ![][8] 如图所示,当用键盘控制时,GNOME Shell 是一个非常强大的桌面环境。学习使用这些快捷方式并训练你的肌肉记忆以不使用鼠标将为你提供更好的用户体验,并在使用 GNOME 时提高你的工作效率。有关其他有用的快捷方式,请查看 [GNOME wiki 上的此页面][9]。 -* * * - *图片来自 [1AmFcS][10],[Unsplash][11]* -------------------------------------------------------------------------------- @@ -65,7 +63,7 @@ via: https://fedoramagazine.org/5-gnome-keyboard-shortcuts-to-be-more-productive 作者:[Clément Verna][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5148aa34c9db352cb88321bf28b33ee03b0e5c8b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Jun 2019 23:19:42 +0800 Subject: [PATCH 1025/1154] PUB:20190527 5 GNOME keyboard shortcuts to be more productive.md @wxy https://linux.cn/article-10997-1.html --- ...190527 5 GNOME keyboard shortcuts to be more productive.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190527 5 GNOME keyboard shortcuts to be more productive.md (98%) diff --git a/translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md b/published/20190527 5 GNOME keyboard shortcuts to be more productive.md similarity index 98% rename from translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md rename to published/20190527 5 GNOME keyboard shortcuts to be more productive.md index 08bba53038..9ba4bc2d57 100644 --- a/translated/tech/20190527 5 GNOME keyboard shortcuts to be more productive.md +++ b/published/20190527 5 GNOME keyboard shortcuts to be more productive.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10997-1.html) [#]: subject: (5 GNOME keyboard shortcuts to be more productive) [#]: via: (https://fedoramagazine.org/5-gnome-keyboard-shortcuts-to-be-more-productive/) [#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) From 7df2d4fd13e082938c641a8ba8dbbf2506d3c8f7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 20 Jun 2019 08:57:13 +0800 Subject: [PATCH 1026/1154] translated --- ... alternative versions of RPMs in Fedora.md | 133 ------------------ ... alternative versions of RPMs in Fedora.md | 133 ++++++++++++++++++ 2 files changed, 133 insertions(+), 133 deletions(-) delete mode 100644 sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md create mode 100644 translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md diff --git a/sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md b/sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md deleted file mode 100644 index 29b306d7e6..0000000000 --- a/sources/tech/20190612 Installing alternative versions of RPMs in Fedora.md +++ /dev/null @@ -1,133 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Installing alternative versions of RPMs in Fedora) -[#]: via: (https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/) -[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) - -Installing alternative versions of RPMs in Fedora -====== - -![][1] - -[Modularity][2] enables Fedora to provide alternative versions of RPM packages in the repositories. Several different applications, language runtimes, and tools are available in multiple versions, build natively for each Fedora release. - -The Fedora Magazine has already covered [Modularity in Fedora 28 Server Edition][3] about a year ago. Back then, it was just an optional repository with additional content, and as the title hints, only available to the Server Edition. A lot has changed since then, and now **Modularity is a core part of the Fedora distribution**. And some packages have moved to modules completely. At the time of writing — out of the 49,464 binary RPM packages in Fedora 30 — 1,119 (2.26%) come from a module ([more about the numbers][4]). - -### Modularity basics - -Because having too many packages in multiple versions could feel overwhelming (and hard to manage), packages are grouped into **modules** that represent an application, a language runtime, or any other sensible group. - -Modules often come in multiple **streams** — usually representing a major version of the software. Available in parallel, but only one stream of each module can be installed on a given system. - -And not to overwhelm users with too many choices, each Fedora release comes with a set of **defaults** — so decisions only need to be made when desired. - -Finally, to simplify installation, modules can be optionally installed using pre-defined **profiles** based on a use case. A database module, for example, could be installed as a client, a server, or both. - -### Modularity in practice - -When you install an RPM package on your Fedora system, chances are it comes from a module stream. The reason why you might not have noticed is one of the core principles of Modularity — remaining invisible until there is a reason to know about it. - -Let’s compare the following two situations. First, installing the popular _i3_ tiling window manager, and second, installing the minimalist _dwm_ window manager: - -``` -$ sudo dnf install i3 -... -Done! -``` - -As expected, the above command installs the _i3_ package and its dependencies on the system. Nothing else happened here. But what about the other one? - -``` -$ sudo dnf install dwm -... -Enabling module streams: - dwm 6.1 -... -Done! -``` - -It feels the same, but something happened in the background — the default _dwm_ module stream ( _6.1_ ) got enabled, and the _dwm_ package from the module got installed. - -To be transparent, there is a message about the module auto-enablement in the output. But other than that, the user doesn’t need to know anything about Modularity in order to use their system the way they always did. - -But what if they do? Let’s see how a different version of _dwm_ could have been installed instead. - -Use the following command to see what module streams are available: - -``` -$ sudo dnf module list -... -dwm latest ... -dwm 6.0 ... -dwm 6.1 [d] ... -dwm 6.2 ... -... -Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled -``` - -The output shows there are four streams of the _dwm_ module, _6.1_ being the default. - -To install the _dwm_ package in a different version — from the _6.2_ stream for example — enable the stream and then install the package by using the two following commands: - -``` -$ sudo dnf module enable dwm:6.2 -... -Enabling module streams: - dwm 6.2 -... -Done! -$ sudo dnf install dwm -... -Done! -``` - -Finally, let’s have a look at profiles, with PostgreSQL as an example. - -``` -$ sudo dnf module list -... -postgresql 9.6 client, server ... -postgresql 10 client, server ... -postgresql 11 client, server ... -... -``` - -To install PostgreSQL 11 as a server, use the following command: - -``` -$ sudo dnf module install postgresql:11/server -``` - -Note that — apart from enabling — modules can be installed with a single command when a profile is specified. - -It is possible to install multiple profiles at once. To add the client tools, use the following command: - -``` -$ sudo dnf module install postgresql:11/client -``` - -There are many other modules with multiple streams available to choose from. At the time of writing, there were 83 module streams in Fedora 30. That includes two versions of MariaDB, three versions of Node.js, two versions of Ruby, and many more. - -Please refer to the [official user documentation for Modularity][5] for a complete set of commands including switching from one stream to another. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/ - -作者:[Adam Šamalík][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/asamalik/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/modularity-f30-816x345.jpg -[2]: https://docs.pagure.org/modularity -[3]: https://fedoramagazine.org/modularity-fedora-28-server-edition/ -[4]: https://blog.samalik.com/2019/06/12/counting-modularity-packages.html -[5]: https://docs.fedoraproject.org/en-US/modularity/using-modules/ diff --git a/translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md b/translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md new file mode 100644 index 0000000000..23f95600d7 --- /dev/null +++ b/translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing alternative versions of RPMs in Fedora) +[#]: via: (https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/) +[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) + +在 Fedora 中安装替代版本的 RPM +====== + +![][1] + +[模块化][2](Modularity)使 Fedora 能够在仓库中提供替代版本的 RPM 软件包。为每个 Fedroa 版本原生构建了多个不同的应用、语言运行时和工具版本。 + +Fedora Magazine 大约一年前就写了 [Fedora 28 服务器版的模块化][3]。那时,它只是一个有附加内容的可选仓库,并且明确只支持服务器版。到目前为止,它已经发生了很多变化,现在**模块化是 Fedora 发行版的核心部分**。一些软件包已完全变成模块。在编写本文时,Fedora 30 的 49,464 个二进制 RPM 软件包中的 1,119(2.26%)来自一个模块([关于这个数字的更多信息][4])。 + +### 模块化基础知识 + +由于许多软件包有不同的版本会让人难以承受(并且难以管理),所以包被分组为**模块**,这代表一个应用程序、一个语言运行时或任何其他合理的组。 + +模块通常有多个**流**,这通常代表软件的主要版本。它可以并行使用,但在给定系统上只能安装每个模块的一个流。 + +为了不让用户因为太多选择而难以承受,每个 Fedora 版本都有一组**默认**,因此只需要在需要时做出决定。 + +最后,为了简化安装,可以根据用例使用预定义的 **profile** 选择性地安装模块。例如,数据库模块可以作为客户端,服务端或同时安装。 + +### 实际使用模块化 + +当你在 Fedora 系统上安装 RPM 软件包时,它很可能它来自模块流。你可能没有注意到的原因之一是模块化的核心原则之一是在你要了解之前保持不可见。 + +让我们比较以下两种情况。首先,安装流行的 _i3_ 平铺窗口管理器,然后安装极简化的 _dwm_ 窗口管理器: + +``` +$ sudo dnf install i3 +... +Done! +``` + +正如所料,上面的命令会在系统上安装 _i3_ 包及其依赖项。这里没有其他事情发生。但另一个会怎么样? + +``` +$ sudo dnf install dwm +... +Enabling module streams: + dwm 6.1 +... +Done! +``` + +感觉是一样的,但后台发生了一些事情 。它启用了默认的 _dwm_ 模块流 (_6.1_),并且安装了模块中的 _dwm_ 包。 + +为了保持透明,输出中有一条关于模块自动启用的消息。但除此之外,用户不需要了解模块化的任何信息,以便按照他们一贯的方式使用他们的系统。 + +但如果他们使用模块化方式呢?让我们看看如何安装不同版本的 _dwm_。 + +使用以下命令查看可用的模块流: + +``` +$ sudo dnf module list +... +dwm latest ... +dwm 6.0 ... +dwm 6.1 [d] ... +dwm 6.2 ... +... +Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled +``` + +输出显示 _dwm_ 模块有四个流,_6.1_ 是默认值。 + +要安装不同版本的 _dwm_ 包,例如,安装 _6.2_ 的流。启用他,然后使用以下两个命令安装软件包: + +``` +$ sudo dnf module enable dwm:6.2 +... +Enabling module streams: + dwm 6.2 +... +Done! +$ sudo dnf install dwm +... +Done! +``` + +最后,让我们看下配置,以 PostgreSQL 为例。 + +``` +$ sudo dnf module list +... +postgresql 9.6 client, server ... +postgresql 10 client, server ... +postgresql 11 client, server ... +... +``` + +要安装 PostgreSQL 11 服务端,使用以下命令: + +``` +$ sudo dnf module install postgresql:11/server +``` + +请注意,除了启用流之外,我们可以指定配置从而使用一条命令安装模块。 + +可以立即安装多个版本。要添加客户端工具,使用下面的命令: + +``` +$ sudo dnf module install postgresql:11/client +``` + +还有许多其他带有多个流的模块可供选择。在编写本文时,Fedora 30 中有 83 个模块流。包括两个版本的 MariaDB、三个版本的 Node.js、两个版本的 Ruby 等等。 + +有关完整的命令集(包括从一个流切换到另一个流),请参阅[模块化的官方用户文档][5]。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/ + +作者:[Adam Šamalík][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/asamalik/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/modularity-f30-816x345.jpg +[2]: https://docs.pagure.org/modularity +[3]: https://fedoramagazine.org/modularity-fedora-28-server-edition/ +[4]: https://blog.samalik.com/2019/06/12/counting-modularity-packages.html +[5]: https://docs.fedoraproject.org/en-US/modularity/using-modules/ From 7b6e2724cb773ab86d498feb0b9439059528a44f Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 20 Jun 2019 08:59:51 +0800 Subject: [PATCH 1027/1154] translating --- sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md b/sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md index 486ea44a30..7feffbf41b 100644 --- a/sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md +++ b/sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 720ea19b7f8275515acb30668047564c0d228bc2 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 11:06:42 +0800 Subject: [PATCH 1028/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020170320=20An?= =?UTF-8?q?=20Ubuntu=20User=E2=80=99s=20Review=20Of=20Dell=20XPS=2013=20Ub?= =?UTF-8?q?untu=20Edition=20sources/talk/20170320=20An=20Ubuntu=20User-s?= =?UTF-8?q?=20Review=20Of=20Dell=20XPS=2013=20Ubuntu=20Edition.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-s Review Of Dell XPS 13 Ubuntu Edition.md | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 sources/talk/20170320 An Ubuntu User-s Review Of Dell XPS 13 Ubuntu Edition.md diff --git a/sources/talk/20170320 An Ubuntu User-s Review Of Dell XPS 13 Ubuntu Edition.md b/sources/talk/20170320 An Ubuntu User-s Review Of Dell XPS 13 Ubuntu Edition.md new file mode 100644 index 0000000000..61a4c4993c --- /dev/null +++ b/sources/talk/20170320 An Ubuntu User-s Review Of Dell XPS 13 Ubuntu Edition.md @@ -0,0 +1,199 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An Ubuntu User’s Review Of Dell XPS 13 Ubuntu Edition) +[#]: via: (https://itsfoss.com/dell-xps-13-ubuntu-review) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +An Ubuntu User’s Review Of Dell XPS 13 Ubuntu Edition +====== + +_**Brief: Sharing my feel and experience about Dell XPS 13 Kaby Lake Ubuntu edition after using it for over three months.**_ + +During Black Friday sale last year, I took the bullet and ordered myself a [Dell XPS 13][1] with the new [Intel Kaby Lake processor][2]. It got delivered in the second week of December and if you [follow It’s FOSS on Facebook][3], you might have seen the [live unboxing][4]. + +Though I was tempted to do the review of Dell XPS 13 Ubuntu edition almost at the same time, I knew it won’t be fair. A brand new system will, of course, feel good and work smooth. + +But that’s not the real experience. The real experience of any system comes after weeks, if not months, of use. That’s the reason I hold myself back and waited three months to review Dell XPS Kobylake Ubuntu edition. + +### Dell XPS 13 Ubuntu Edition Review + +Before we saw what’s hot and what’s not in the latest version of Dell XPS 13, I should tell you that I was using an Acer R13 ultrabook book before this. So I may compare the new Dell system with the older Acer one. + +![Dell XPS 13 Ubuntu Edition System Settings][5]![Dell XPS 13 Ubuntu Edition System Settings][5] + +Dell XPS 13 has several versions based on processor. The one I am reviewing is Dell XPS13 MLK (9360). It has i5-7200U 7th generation processor. Since I hardly used the touch screen in Acer Aspire R13, I chose to go with the non-touch version of XPS. This decision also saved me a couple of hundreds of Euro. + +It has 8 GB of LPDDR3 1866MHz RAM and 256 GB SSD PCIe. Graphics is Intel HD. On connectivity side, it’s got Killer 1535 Wi-Fi 802.11ac 2×2 and Bluetooth 4.1. Screen is InfinityEdge Full HD (1 920 x 1080). + +Now, you know what kind of hardware we’ve got here, let’s see what works and what sucks. + +#### Look and feel + +![Dell XPS 13 Kaby Lake Ubuntu Edition][6]![Dell XPS 13 Kaby Lake Ubuntu Edition][6] + +At 13.3″, Dell XPS 13 looks even smaller than a regular 13.3″ laptop, thanks to its non-existent bezel which is the specialty of the infinite display. It is light as a feather with weight just under 1.23 Kg. + +The outer surface is metallic, not very shiny but a decent aluminum look. On the interior, the palm rest is made of carbon fiber which is very comfortable at the rest. Unlike the MacBook Air that uses metallic palm rests, the carbon fiber ones are more friendly, especially in winters. + +It is almost centimeter and a half high at it’s thickest part (around hinges). This also adds a plus point to the elegance of XPS 13. + +Overall, Dell XPS 13 has a compact body and an elegant body. + +#### Keyboard and touchpad + +The keyboard and touchpad mix well with the carbon fiber interiors. The keys are smooth with springs in the back (perhaps) and give a rich feel while typing. All of the important keys are present and are not tiny in size, something you might be worried of, considering the overall tiny size of XPS13. + +Oh! the keyboards have backlit support. Which adds to the rich feel of this expensive laptop. + +While the keyboard is a great experience, the same cannot be said about the touchpad. In fact, the touchpad is the weakest part which mars the overall good experience of XPS 13. + +The touchpad has a cheap feeling because it makes an irritating sound while tapping on the right side as if it’s hollow underneath. This is [something that has been noticed in the earlier versions of XPS 13][7] but hasn’t been given enough consideration to fix it. This is something you do not expect from a product at such a price. + +Also, the touchpad scroll on websites is hideous. It is also not suitable for pixel works because of difficulty in moving little adjustments. + +#### Ports + +Dell XPS 13 has two USB 3.0 ports, one of them with PowerShare. If you did not know, [USB 3.0 PowerShare][8] ports allow you to charge external devices even when your system is turned off. + +![Dell XPS 13 Kaby Lake Ubuntu edition ports][9]![Dell XPS 13 Kaby Lake Ubuntu edition ports][9] + +It also has a [Thunderbolt][10] (doubles up as [USB Type-C port][11]). It doesn’t have HDMI port, Ethernet port or VGA port. However, all of these three can be used via the Thunderbolt port and external adapters (sold separately). + +![Dell XPS 13 Kaby Lake Ubuntu edition ports][12]![Dell XPS 13 Kaby Lake Ubuntu edition ports][12] + +It also has an SD card reader and a headphone jack. In addition to all these, there is an [anti-theft slot][13] (a common security practice in enterprises). + +#### Display + +The model I have packs 1920x1080px. It’s full HD and display quality is at par. It perfectly displays the high definition pictures and 1080p video files. + +I cannot compare it with the [qHD model][14] as I never used it. But considering that there are not enough 4K contents for now, full HD display should be sufficient for next few years. + +#### Sound + +Compared to Acer R13, XPS 13 has better audio quality. Even the max volume is louder than that of Acer R13. The dual speakers give a nice stereo effect. + +#### Webcam + +The weirdest part of Dell XPS 13 review comes now. We all have been accustomed of seeing the webcam at the top-middle position on any laptop. But this is not the case here. + +XPS 13 puts the webcam on the bottom left corner of the laptop. This is done to keep the bezel as thin as possible. But this creates a problem. + +![Image captured with laptop screen at 90 degree][15] + +When you video chat with someone, it is natural to look straight up. With the top-middle webcam, your face is in direct line with the camera. But with the bottom left position of web cam, it looks like those weird accidental selfies you take with the front camera of your smartphone. Heck, people on the other side might see inside of your nostrils. + +#### Battery + +Battery life is the strongest point of Dell XPS 13. While Dell claims an astounding 21-hour battery life, but in my experience, it smoothly gives a battery life of 8-10 hours. This is when I watch movies, browse the internet and other regular stuff. + +There is one strange thing that I noticed, though. It charges pretty quick until 90% but the charging slows down afterward. And it almost never goes beyond 98%. + +The battery indicator turns red when the battery status falls below 30% and it starts displaying notifications if the battery goes below 10%. There is small light indicator under the touchpad that turns yellow when the battery is low and it turns white when the charger is plugged in. + +#### Overheating + +I have previously written about ways to [reduce laptop overheating in Linux][16]. Thankfully, so far, I didn’t need to employ those tricks. + +Dell XPS 13 remains surprisingly cool when you are using it on battery, even in long runs. The bottom does get heated a little when you use it while charging. + +Overall, XPS 13 manages overheating very well. + +#### The Ubuntu experience with Dell XPS 13 + +So far we have seen pretty generic things about the Dell XPS 13. Let’s talk about how good a Linux laptop it is. + +Until now, I used to manually [install Linux on Windows laptop][17]. This is the first Linux laptop I ever bought. I would also like to mention the awesome first boot animation of Dell’s Ubuntu laptop. Here’s a YouTube video of the same: + +One thing I would like to mention here is that Dell never displays Ubuntu laptops on its website. You’ll have to search the website with Ubuntu then you’ll see the Ubuntu editions. Also, Ubuntu edition is cheaper just by 50 Euro in comparison to its Windows counterpart whereas I was expecting it to be at least 100 Euro less than that of Windows. + +Despite being an Ubuntu preloaded laptop, the super key still comes with Windows logo on it. It’s trivial but I would have loved to see the Ubuntu logo on it. + +Now talking about Ubuntu experience, the first thing I noticed was that there was no hardware issue. Even the function and media keys work perfectly in Ubuntu, which is a pleasant surprise. + +Dell has also added its own repository in the software sources to provide for some Dell specific tools. You can see the footprints of Dell in the entire system. + +You might be interested to see how Dell partitioned the 256Gb of disk space. Let me show that to you. + +![Default disk partition by Dell][18] + +As you can see, there is 524MB reserved for [EFI][19]. Then there is 3.2 GB of factory restore image perhaps. + +Dell is using 17Gb of Swap partition, which is more than double of the RAM size. It seems Dell didn’t put enough thought here because this is simply waste of disk space, in my opinion. I would have used not [more than 11 GB of Swap partition][20] here. + +As I mentioned before, Dell adds a “restore to factory settings” option in the Grub menu. This is a nice little feature to have. + +One thing which I don’t like in the XPS 13 Ubuntu edition is the long boot time. It takes entire 23 seconds to reach the login screen after pressing the power button. I would expect it to be faster considering that it uses SSD PCIe. + +If it interests you, the XPS 13 had Chromium and Google Chrome browsers installed by default instead of Firefox. + +As far my experience goes, I am fairly impressed with Dell XPS 13 Ubuntu edition. It gives a smooth Ubuntu experience. The laptop seems to be a part of Ubuntu. Though it is an expensive laptop, I would say it is definitely worth the money. + +To summarize, let’s see the good, the bad and the ugly of Dell XPS 13 Ubuntu edition. + +#### The Good + + * Ultralight weight + * Compact + * Keyboard + * Carbon fiber palm rest + * Full hardware support for Ubuntu + * Factory restore option for Ubuntu + * Nice display and sound quality + * Good battery life + + + +#### The bad + + * Poor touchpad + * A little pricey + * Long boot time for SSD powered laptop + * Windows key still present :P + + + +#### The ugly + + * Weird webcam placement + + + +How did you like the **Dell XPS 13 Ubuntu edition review** from an Ubuntu user’s point of view? Do you find it good enough to spend over a thousand bucks? Do share your views in the comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dell-xps-13-ubuntu-review + +作者:[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://amzn.to/2ImVkCV +[2]: http://www.techradar.com/news/computing-components/processors/kaby-lake-intel-core-processor-7th-gen-cpu-news-rumors-and-release-date-1325782 +[3]: https://www.facebook.com/itsfoss/ +[4]: https://www.facebook.com/itsfoss/videos/810293905778045/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/02/Dell-XPS-13-Ubuntu-Edition-spec.jpg?resize=540%2C337&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/03/Dell-XPS-13-Ubuntu-review.jpeg?resize=800%2C600&ssl=1 +[7]: https://www.youtube.com/watch?v=Yt5SkI0c3lM +[8]: http://www.dell.com/support/article/fr/fr/frbsdt1/SLN155147/usb-powershare-feature?lang=EN +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/03/Dell-Ubuntu-XPS-13-Kaby-Lake-ports-1.jpg?resize=800%2C435&ssl=1 +[10]: https://en.wikipedia.org/wiki/Thunderbolt_(interface) +[11]: https://en.wikipedia.org/wiki/USB-C +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/03/Dell-Ubuntu-XPS-13-Kaby-Lake-ports-2.jpg?resize=800%2C325&ssl=1 +[13]: http://accessories.euro.dell.com/sna/productdetail.aspx?c=ie&l=en&s=dhs&cs=iedhs1&sku=461-10169 +[14]: https://recombu.com/mobile/article/quad-hd-vs-qhd-vs-4k-ultra-hd-what-does-it-all-mean_M20472.html +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/03/Dell-XPS-13-webcam-issue.jpg?resize=800%2C450&ssl=1 +[16]: https://itsfoss.com/reduce-overheating-laptops-linux/ +[17]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/03/Dell-XPS-13-Ubuntu-Edition-disk-partition.jpeg?resize=800%2C448&ssl=1 +[19]: https://en.wikipedia.org/wiki/EFI_system_partition +[20]: https://itsfoss.com/swap-size/ From 47ab8854cc64e0ddb076b3b4c21b4c8d1424f95f Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 11:22:11 +0800 Subject: [PATCH 1029/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190619=20Code?= =?UTF-8?q?think=20open=20sources=20part=20of=20onboarding=20process=20sou?= =?UTF-8?q?rces/tech/20190619=20Codethink=20open=20sources=20part=20of=20o?= =?UTF-8?q?nboarding=20process.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...open sources part of onboarding process.md | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 sources/tech/20190619 Codethink open sources part of onboarding process.md diff --git a/sources/tech/20190619 Codethink open sources part of onboarding process.md b/sources/tech/20190619 Codethink open sources part of onboarding process.md new file mode 100644 index 0000000000..537ded948b --- /dev/null +++ b/sources/tech/20190619 Codethink open sources part of onboarding process.md @@ -0,0 +1,42 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Codethink open sources part of onboarding process) +[#]: via: (https://opensource.com/article/19/6/codethink-onboarding-process) +[#]: author: (Laurence Urhegyi https://opensource.com/users/laurence-urhegyi) + +Codethink open sources part of onboarding process +====== +In other words, how to Git going in FOSS. +![Teacher or learner?][1] + +Here at [Codethink][2], we’ve recently focused our energy into enhancing the onboarding process we use for all new starters at the company. As we grow steadily in size, it’s important that we have a well-defined approach to both welcoming new employees into the company, and introducing them to the organization’s culture. + +As part of this overall onboarding effort, we’ve created [_How to Git going in FOSS_][3]: an introductory guide to the world of free and open source software (FOSS), and some of the common technologies, practices, and principles associated with free and open source software. + +This guide was initially aimed at work experience students and summer interns. However, the document is in fact equally applicable to anyone who is new to free and open source software, no matter their prior experience in software or IT in general. _How to Git going in FOSS_ is hosted on GitLab and consists of several repositories, each designed to be a self-guided walk through. + +Our guide begins with a general introduction to FOSS, including explanations of the history of GNU/Linux, how to use [Git][4] (as well as Git hosting services such as GitLab), and how to use a text editor. The document then moves on to exercises that show the reader how to implement some of the things they’ve just learned. + +_How to Git going in FOSS_ is fully public and available for anyone to try. If you’re new to FOSS or know someone who is, then please have a read-through, and see what you think. If you have any feedback, feel free to raise an issue on GitLab. And, of course, we also welcome contributions. We’re keen to keep improving the guide however possible. One future improvement we plan to make is an additional exercise that is more complex than the existing two, such as potentially introducing the reader to [Continuous Integration][5]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/codethink-onboarding-process + +作者:[Laurence Urhegyi][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/laurence-urhegyi +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-teacher-learner.png?itok=rMJqBN5G (Teacher or learner?) +[2]: https://www.codethink.co.uk/about.html +[3]: https://gitlab.com/ct-starter-guide +[4]: https://git-scm.com +[5]: https://en.wikipedia.org/wiki/Continuous_integration From 4b3fe220de1dfe261584c203a127a55da79a2cf2 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 11:22:36 +0800 Subject: [PATCH 1030/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190619=20Lead?= =?UTF-8?q?ing=20in=20the=20Python=20community=20sources/tech/20190619=20L?= =?UTF-8?q?eading=20in=20the=20Python=20community.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190619 Leading in the Python community.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20190619 Leading in the Python community.md diff --git a/sources/tech/20190619 Leading in the Python community.md b/sources/tech/20190619 Leading in the Python community.md new file mode 100644 index 0000000000..98fa8c5dba --- /dev/null +++ b/sources/tech/20190619 Leading in the Python community.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: 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) + +Leading in the Python community +====== +A chat with Naomi Ceder, current Python Software Foundation board chair. +![Hands together around the word trust][1] + +Like many other leaders in the open source software world, [Naomi Ceder][2], board chair of the [Python Software Foundation][3] (PSF), took a non-traditional path into the Python world. As the title of her 2017 [keynote][4] at PyCon España explains, she came for the language and stayed for the community. In a recent conversation with her, she shared how she became a Python community leader and offered some insight into what makes Python special. + +### From teaching to coding + +Naomi began her career in the Classics; she earned a PhD in Latin and Ancient Greek with a minor in Indo-European Linguistics, as she says, "several decades ago." While teaching Latin at a private school, she began tinkering with computers, learning to code and to take machines apart to do upgrades and repairs. She started working with open source software in 1995 with [Yggdrasil Linux][5] and helped launch the Fort Wayne, Indiana, [Linux User Group][6]. + +A teacher at heart, Naomi believes teaching coding in middle and high school is essential because, by the time most people get to college, they are already convinced that coding and technology careers are not for them. Starting earlier can help increase the supply of technical talent and the diversity and breadth of experience in our talent pools to meet the industry's needs, she says. + +Somewhere around 2001, she decided to switch from studying human languages to researching computer languages, as well as teaching computer classes and managing the school's IT. Her interest in Python was sparked at Linux World 2001 when she attended PSF president Guido Van Rossum's day-long tutorial on Python. Back then, it was an obscure language, but she liked it so well that she began teaching Python and using it to track student records and do sysadmin duties at her school. + +### Leading the Python community + +Naomi says, "community is the key factor behind Python's success. The whole idea behind open source software is sharing. Few people really want to just sit alone, writing code, and staring at their screens. The real satisfaction comes in trading ideas and building something with others." + +She started giving talks at the first [PyCon][7] in 2003 has been a consistent attendee and leader since then. She has organized birds-of-a-feather sessions and founded the PyCon and PyCon UK poster sessions, the education summit, and the Spanish language track, [Charlas][8]. + +She is also the author of _[The Quick Python Book][9]_ and co-founded [Trans*Code][10], "the UK's only hack event series focused solely on drawing attention to transgender issues and opportunities." Naomi says, "as technology offers growing opportunities, being sure these opportunities are equally accessible to traditionally marginalized groups grows ever more important." + +### Contributing through the PSF + +As board chair of the PSF, Naomi contributes actively to the organization's work to support the Python language and the people working with it. In addition to sponsoring PyCon, the PSF funds grants for meetups, conferences, and workshops around the world. In 2018, the organization gave almost $335,000 in grants, most of them in the $500 to $5,000 range. + +The PSF's short-term goals are to become a sustainable, stable, and mature non-profit organization with professional staff. Its long-term goals include developing resources that offer meaningful support to development efforts for Python and expanding the organization's support for educational efforts in Python around the world. + +This work depends on having financial support from the community. Naomi says the PSF's "largest current source of funding is PyCon. To ensure the PSF's sustainability, we are also focusing on [sponsorships][11] from companies using Python, which is our fastest-growing segment." Supporting memberships are $99 per year, and [donations and fundraisers][12] also help sustain the organization's work. + +You can learn much more about the PSF's work in its [Annual Report][13]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/naomi-ceder-python-software-foundation + +作者:[Don Watkins][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/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_HighTrust_1110_A.png?itok=EF5Tmcdk (Hands together around the word trust) +[2]: https://www.naomiceder.tech/pages/about/ +[3]: https://www.python.org/psf/ +[4]: https://www.youtube.com/watch?v=ayQK6app_wA +[5]: https://en.wikipedia.org/wiki/Yggdrasil_Linux/GNU/X +[6]: http://fortwaynelinux.org/about +[7]: http://pycon.org/ +[8]: https://twitter.com/pyconcharlas?lang=en +[9]: https://www.manning.com/books/the-quick-python-book-third-edition +[10]: https://www.trans.tech/ +[11]: https://www.python.org/psf/sponsorship/ +[12]: https://www.python.org/psf/donations/ +[13]: https://www.python.org/psf/annual-report/2019/ From cef7af871e2e2dc5e98ea26cfc1a7473238a33a0 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 11:22:47 +0800 Subject: [PATCH 1031/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190618=20How?= =?UTF-8?q?=20to=20use=20MapTool=20to=20build=20an=20interactive=20dungeon?= =?UTF-8?q?=20RPG=20sources/tech/20190618=20How=20to=20use=20MapTool=20to?= =?UTF-8?q?=20build=20an=20interactive=20dungeon=20RPG.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ool to build an interactive dungeon RPG.md | 231 ++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 sources/tech/20190618 How to use MapTool to build an interactive dungeon RPG.md diff --git a/sources/tech/20190618 How to use MapTool to build an interactive dungeon RPG.md b/sources/tech/20190618 How to use MapTool to build an interactive dungeon RPG.md new file mode 100644 index 0000000000..94aaf47de2 --- /dev/null +++ b/sources/tech/20190618 How to use MapTool to build an interactive dungeon RPG.md @@ -0,0 +1,231 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use MapTool to build an interactive dungeon RPG) +[#]: via: (https://opensource.com/article/19/6/how-use-maptools) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +How to use MapTool to build an interactive dungeon RPG +====== +By using MapTool, most of a game master's work is done well before a +role-playing game begins. +![][1] + +In my previous article on MapTool, I explained how to download, install, and configure your own private, [open source virtual tabletop][2] so you and your friends can play a role-playing game (RPG) together. [MapTool][3] is a complex application with lots of features, and this article demonstrates how a game master (GM) can make the most of it. + +### Update JavaFX + +MapTool requires JavaFX, but Java maintainers recently stopped bundling it in Java downloads. This means that, even if you have Java installed, you might not have JavaFX installed. + +Some Linux distributions have a JavaFX package available, so if you try to run MapTool and get an error about JavaFX, download the latest self-contained version: + + * For [Ubuntu and other Debian-based systems][4] + * For [Fedora and Red Hat-based systems][5] + + + +### Build a campaign + +The top-level file in MapTool is a campaign (.cmpgn) file. A campaign can contain all of the maps required by the game you're running. As your players progress through the campaign, everyone changes to the appropriate map and plays. + +For that to go smoothly, you must do a little prep work. + +First, you need the digital equivalents of miniatures: _tokens_ in MapTool terminology. Tokens are available from various sites, but the most prolific is [immortalnights.com/tokensite][6]. If you're still just trying out virtual tabletops and aren't ready to invest in digital art yet, you can get a stunning collection of starter tokens from immortalnights.com for $0. + +You can add starter content to MapTool quickly and easily using its built-in resource importer. Go to the **File** menu and select **Add Resource to Library**. + +In the **Add Resource to Library** dialogue box, select the RPTools tab, located at the bottom-left. This lists all the free art packs available from the RPTools server, tokens and maps alike. Click to download and import. + +![Add Resource to Library dialogue][7] + +You can import assets you already have on your computer by selecting files from the file system, using the same dialogue box. + +MapTool resources appear in the Library panel. If your MapTool window has no Library panel, select **Library** in the **Window** menu to add one. + +### Gather your maps + +The next step in preparing for your game is to gather maps. Depending on what you're playing, that might mean you need to draw your maps, purchase a map pack, or just open a map bundled with a game module. If all you need is a generic dungeon, you can also download free maps from within MapTool's **Add Resource to Library**. + +If you have a set of maps you intend to use often, you can import them as resources. If you are building a campaign you intend to use just once, you can quickly add any PNG or JPEG file as a **New Map** in the **Map** menu. + +![Creating a new map][8] + +Set the **Background** to a texture that roughly matches your map or to a neutral color. + +Set the **Map** to your map graphics file. + +Give your new map a unique **Name**. The map name is visible to your players, so keep it free of spoilers. + +To switch between maps, click the **Select Map** button in the top-right corner of the MapTool window, and choose the map name in the drop-down menu that appears. + +![Select a map][9] + +Before you let your players loose on your map, you still have some important prep work to do. + +### Adjust the grid size + +Since most RPGs govern how far players can move during their turn, especially during combat, game maps are designed to a specific scale. The most common scale is one map square for every five feet. Most maps you download already have a grid drawn on them; if you're designing a map, you should draw on graph paper to keep your scale consistent. Whether your map graphic has a grid or not, MapTool doesn't know about it, but you can adjust the digital grid overlay so that your player tokens are constrained into squares along the grid. + +MapTool doesn't show the grid by default, so go to the **Map** menu and select **Adjust grid**. This displays MapTool's grid lines, and your goal is to make MapTool's grid line up with the grid drawn onto your map graphic. If your map graphic doesn't have a grid, it may indicate its scale; a common scale is one inch per five feet, and you can usually assume 72 pixels is one inch (on a 72 DPI screen). While adjusting the grid, you can change the color of the grid lines for your own reference. Set the cell size in pixels. Click and drag to align MapTool's grid to your map's grid. + +![Adjusting the grid][10] + +If your map has no grid and you want the grid to remain visible after you adjust it, go to the **View** menu and select **Show Grid**. + +### Add players and NPCs + +To add a player character (PC), non-player character (NPC), or monster to your map, find an appropriate token in your **Library** panel, then drag and drop one onto your map. In the **New Token** dialogue box that appears, give the token a name and set it as an NPC or a PC, then click the OK button. + +![Adding a player character to the map][11] + +Once a token is on the map, try moving it to see how its movements are constrained to the grid you've designated. Make sure **Interaction Tools** , located in the toolbar just under the **File** menu, is selected. + +![A token moving within the grid][12] + +Each token added to a map has its own set of properties, including the direction it's facing, a light source, player ownership, conditions (such as incapacitated, prone, dead, and so on), and even class attributes. You can set as many or as few of these as you want, but at the very least you should right-click on each token and assign it ownership. Your players must be logged into your MapTool server for tokens to be assigned to them, but you can assign yourself NPCs and monsters in advance. + +The right-click menu provides access to all important token-related functions, including setting which direction it's facing, setting a health bar and health value, a copy and paste function (enabling you and your players to move tokens from map to map), and much more. + +![The token menu unlocks great, arcane power][13] + +### Activate fog-of-war effects + +If you're using maps exclusively to coordinate combat, you may not need a fog-of-war effect. But if you're using maps to help your players visualize a dungeon they're exploring, you probably don't want them to see the whole map before they've made significant moves, like opening locked doors or braving a decaying bridge over a pit of hot lava. + +The fog-of-war effect is an invaluable tool for the GM, and it's essential to set it up early so that your players don't accidentally get a sneak peek at all the horrors your dungeon holds for them. + +To activate fog-of-war on a map, go to the **Map** and select **Fog-of-War**. This blackens the entire screen for your players, so your next step is to reveal some portion of the map so that your players aren't faced with total darkness when they switch to the map. Fog-of-war is a subtractive process; it starts 100% dark, and as the players progress, you reveal new portions of the map using fog-of-war drawing tools available in the **FOG** toolbar, just under the **View** menu. + +You can reveal sections of the map in rectangle blocks, ovals, polygons, diamonds, and freehand shapes. Once you've selected the shape, click and release on the map, drag to define an area to reveal, and then click again. + +![Fog-of-war as experienced by a playe][14] + +If you're accidentally overzealous with what you reveal, you have two ways to reverse what you've done: You can manually draw new fog, or you can reset all fog. The quicker method is to reset all fog with **Ctrl+Shift+A**. The more elegant solution is to press **Shift** , then click and release, draw an area of fog, and then click again. Instead of exposing an area of the map, it restores fog. + +### Add lighting effects + +Fog-of-war mimics the natural phenomenon of not being able to see areas of the world other than where you are, but lighting effects mimic the visibility player characters might experience in light and dark. For games like Pathfinder and Dungeons and Dragons 5e, visibility is governed by light sources matched against light conditions. + +First, activate lighting by clicking on the **Map** menu, selecting **Vision** , and then choosing either Daylight or Night. Now lighting effects are active, but none of your players have light sources, so they have no visibility. + +To assign light sources to players, right-click on the appropriate token and choose **Light Source**. Definitions exist for the D20 system (candle, lantern, torch, and so on) and in generic measurements. + +With lighting effects active, players can expose portions of fog-of-war as their light sources get closer to unexposed fog. That's a great effect, but it doesn't make much sense when players can illuminate the next room right through a solid wall. To prevent that, you have to help MapTool differentiate between empty space and solid objects. + +#### Define solid objects + +Defining walls and other solid objects through which light should not pass is easier than it sounds. MapTool's **Vision Blocking Layer** (VBL) tools are basic and built to minimize prep time. There are several basic shapes available, including a basic rectangle and an oval. Draw these shapes over all the solid walls, doors, pillars, and other obstructions, and you have instant rudimentary physics. + +![Setting up obstructions][15] + +Now your players can move around the map with light sources without seeing what lurks in the shadows of a nearby pillar or behind an innocent-looking door… until it's too late! + +![Lighting effects][16] + +### Track initiative + +Eventually, your players are going to stumble on something that wants to kill them, and that means combat. In most RPG systems, combat is played in rounds, with the order of turns decided by an _initiative_ roll. During combat, each player (in order of their initiative roll, from greatest to lowest) tries to defeat their foe, ideally dealing enough damage until their foe is left with no health points (HP). It's usually the most paperwork a GM has to do during a game because it involves tracking whose turn it is, how much damage each monster has taken, what amount of damage each monster's attack deals, what special abilities each monster has, and more. Luckily, MapTool can help with that—and better yet, you can extend it with a custom macro to do even more. + +MapTool's basic initiative panel helps you keep track of whose turn it is and how many rounds have transpired so far. To view the initiative panel, go to the **Window** menu and select **Initiative**. + +To add characters to the initiative order, right-click a token and select **Add To Initiative**. As you add each, the token and its label appear in the initiative panel in the order that you add them. If you make a mistake or someone holds their action and changes the initiative order, click and drag the tokens in the initiative panel to reorder them. + +During combat, click the **Next** button in the top-left of the initiative panel to progress to the next character. As long as you use the **Next** button, the **Round** counter increments, helping you track how many rounds the combat has lasted (which is helpful when you have spells or effects that last only for a specific number of rounds). + +Tracking combat order is helpful, but it's even better to track health points. Your players should be tracking their own health, but since everyone's staring at the same screen, it doesn't hurt to track it publicly in one place. An HP property and a graphical health bar (which you can activate) are assigned to each token, so that's all the infrastructure you need to track HP in MapTool, but doing it manually takes a lot of clicking around. Since MapTool can be extended with macros, it's trivial to bring all these components together for a smooth GM experience. + +The first step is to activate graphical health bars for your tokens. To do this, right-click on each token and select **Edit**. In the **Edit Token** dialog box, click on the **State** tab and deselect the radio button next to **Hide**. + +![Don't hide the health bar][17] + +Do this for each token whose health you want to expose. + +#### Write a macro + +Macros have access to all token properties, so each token's HP can be tracked by reading and writing whatever value exists in the token's HP property. The graphical health bar, however, bases its state on a percentage, so for the health bars to be meaningful, your tokens also must have some value that represents 100% of its HP. + +Go to the **Edit** menu and select **Campaign Properties** to globally add properties to tokens. In the **Campaign Properties** window, select the **Token Properties** tab and then click the **Basic** category in the left column. Under ***@HP** , add ***@MaxHP** and click the **Update** button. Click the **OK** button to close the window. + +![Adding a property to all tokens][18] + +Now right-click a token and select **Edit**. In the **Edit Token** window, select the **State** tab and enter a value for the token's maximum HP (from the player's character sheet). + +To create a new macro, reveal the **Campaign** panel in the **Window** menu. + +In the **Campaign** panel, right-click and select **Add New Macro**. A button labeled **New** appears in the panel. Right-click on the **New** button and select **Edit**. + +Enter this code in the macro editor window: + + +``` +[h:status = input( +"hpAmount|0|Points", +"hpType|Damage,Healing|Damage or heal?|RADIO|SELECT=0")] +[h:abort(status)] + +[if(hpType == 0),CODE: { +[h:HP = HP - hpAmount] +[h:bar.Health = HP / MaxHP] +[r:token.name] takes [r:hpAmount] damage.}; +{ +[h:diff = MaxHP - HP] +[h:HP = min(HP+hpAmount, MaxHP)] +[h:bar.Health = HP / MaxHP] +[r:token.name] gains [r:min(diff,hpAmount)] HP. };] +``` + +You can find full documentation of functions available in MapTool macros and their syntax from the [RPTools wiki][19]. + +In the **Details** tab, enable **Include Label** and **Apply to Selected Tokens** , and leave all other values at their default. Give your macro a better name than **New** , such as **HPTracker** , then click **Apply** and **OK**. + +![Macro editing][20] + +Your campaign now has a new ability! + +Select a token and click your **HPTracker** button. Enter the number of points to deduct from the token, click **OK** , and watch the health bar change to reflect the token's new state. + +It may seem like a simple change, but in the heat of battle, this is a GM's greatest weapon. + +### During the game + +There's obviously a lot you can do with MapTool, but with a little prep work, most of your work is done well before you start playing. You can even create a template campaign by creating an empty campaign with only the macros and settings you want, so all you have to do is import maps and stat out tokens. + +During the game, your workflow is mostly about revealing areas from fog-of-war and managing combat. The players can manage their own tokens, and your prep work takes care of everything else. + +MapTool makes digital gaming easy and fun, and most importantly, it keeps it open source and self-contained. Level-up today by learning MapTool and using it for your games. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/how-use-maptools + +作者:[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/dice-keys_0.jpg?itok=PGEs3ZXa +[2]: https://opensource.com/article/18/5/maptool +[3]: https://github.com/RPTools/maptool +[4]: https://github.com/RPTools/maptool/releases +[5]: https://klaatu.fedorapeople.org/RPTools/maptool/ +[6]: https://immortalnights.com/tokensite/ +[7]: https://opensource.com/sites/default/files/uploads/maptool-resources.png (Add Resource to Library dialogue) +[8]: https://opensource.com/sites/default/files/uploads/map-properties.png (Creating a new map) +[9]: https://opensource.com/sites/default/files/uploads/map-select.jpg (Select a map) +[10]: https://opensource.com/sites/default/files/uploads/grid-adjust.jpg (Adjusting the grid) +[11]: https://opensource.com/sites/default/files/uploads/token-new.png (Adding a player character to the map) +[12]: https://opensource.com/sites/default/files/uploads/token-move.jpg (A token moving within the grid) +[13]: https://opensource.com/sites/default/files/uploads/token-menu.jpg (The token menu unlocks great, arcane power) +[14]: https://opensource.com/sites/default/files/uploads/fog-of-war.jpg (Fog-of-war as experienced by a playe) +[15]: https://opensource.com/sites/default/files/uploads/vbl.jpg (Setting up obstructions) +[16]: https://opensource.com/sites/default/files/uploads/map-light.jpg (Lighting effects) +[17]: https://opensource.com/sites/default/files/uploads/token-edit.jpg (Don't hide the health bar) +[18]: https://opensource.com/sites/default/files/uploads/campaign-properties.jpg (Adding a property to all tokens) +[19]: https://lmwcs.com/rptools/wiki/Main_Page +[20]: https://opensource.com/sites/default/files/uploads/macro-detail.jpg (Macro editing) From 4ef28a17d95a30ea0ead82ceb3d3273e7ddc5b44 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 11:22:59 +0800 Subject: [PATCH 1032/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190618=20A=20?= =?UTF-8?q?beginner's=20guide=20to=20Linux=20permissions=20sources/tech/20?= =?UTF-8?q?190618=20A=20beginner-s=20guide=20to=20Linux=20permissions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...A beginner-s guide to Linux permissions.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/tech/20190618 A beginner-s guide to Linux permissions.md diff --git a/sources/tech/20190618 A beginner-s guide to Linux permissions.md b/sources/tech/20190618 A beginner-s guide to Linux permissions.md new file mode 100644 index 0000000000..470545c291 --- /dev/null +++ b/sources/tech/20190618 A beginner-s guide to Linux permissions.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: 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) + +A beginner's guide to Linux permissions +====== +Linux security permissions designate who can do what with a file or +directory. +![Hand putting a Linux file folder into a drawer][1] + +One of the main benefits of Linux systems is that they are known to be less prone to security vulnerabilities and exploits than other systems. Linux definitely gives users more flexibility and granular controls over its file systems' security permissions. This may imply that it's critical for Linux users to understand security permissions. That isn't necessarily true, but it's still wise for beginning users to understand the basics of Linux permissions. + +### View Linux security permissions + +To start learning about Linux permissions, imagine we have a newly created directory called **PermissionDemo**. Run **cd** inside the directory and use the **ls -l** command to view the Linux security permissions. If you want to sort them by time modified, add the **-t** option. + + +``` +`ls -lt` +``` + +Since there are no files inside this new directory, this command returns nothing. + +![No output from ls -l command][2] + +To learn more about the **ls** option, access its man page by entering **man ls** on the command line. + +![ls man page][3] + +Now, let's create two files: **cat.txt** and **dog.txt** with empty content; this is easy to do using the **touch** command. Let's also create an empty directory called **Pets** with the **mkdir** command. We can use the **ls -l** command again to see the permissions for these new files. + +![Creating new files and directory][4] + +We need to pay attention to two sections of output from this command. + +### Who has permission? + +The first thing to examine indicates _who_ has permission to access the file/directory. Note the section highlighted in the red box below. The first column refers to the _user_ who has access, while the second column refers to the _group_ that has access. + +![Output from -ls command][5] + +There are three main types of users: **user** , **group** ; and **other** (essentially neither a user nor a group). There is one more: **all** , which means practically everyone. + +![User types][6] + +Because we are using **root** as the user, we can access any file or directory because **root** is the superuser. However, this is generally not the case, and you will probably be restricted to your username. A list of all users is stored in the **/etc/passwd** file. + +![/etc/passwd file][7] + +Groups are maintained in the **/etc/group** file. + +![/etc/passwd file][8] + +### What permissions do they have? + +The other section of the output from **ls -l** that we need to pay attention to relates to enforcing permissions. Above, we confirmed that the owner and group permissions for the files dog.txt and cat.txt and the directory Pets we created belong to the **root** account. We can use that information about who owns what to enforce permissions for the different user ownership types, as highlighted in the red box below. + +![Enforcing permissions for different user ownership types][9] + +We can dissect each line into five bits of information. The first part indicates whether it is a file or a directory; files are labeled with a **-** (hyphen), and directories are labeled with **d**. The next three parts refer to permissions for **user** , **group** , and **other** , respectively. The last part is a flag for the [**access-control list**][10] (ACL), a list of permissions for an object. + +![Different Linux permissions][11] + +Linux permission levels can be identified with letters or numbers. There are three privilege types: + + * **read** : r or 4 + * **write:** w or 2 + * **executable:** e or 1 + + + +![Privilege types][12] + +The presence of each letter symbol ( **r** , **w** , or **x** ) means that the permission exists, while **-** indicates it does not. In the example below, the file is readable and writeable by the owner, only readable if the user belongs to the group, and readable and executable by anyone else. Converted to numeric notation, this would be 645 (see the image below for an explanation of how this is calculated). + +![Permission type example][13] + +Here are a few more examples: + +![Permission type examples][14] + +Test your knowledge by going through the following exercises. + +![Permission type examples][15] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/understanding-linux-permissions + +作者:[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/greg-p/users/tj +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://opensource.com/sites/default/files/uploads/1_3.jpg (No output from ls -l command) +[3]: https://opensource.com/sites/default/files/uploads/1_man.jpg (ls man page) +[4]: https://opensource.com/sites/default/files/uploads/2_6.jpg (Creating new files and directory) +[5]: https://opensource.com/sites/default/files/uploads/3_2.jpg (Output from -ls command) +[6]: https://opensource.com/sites/default/files/uploads/4_0.jpg (User types) +[7]: https://opensource.com/sites/default/files/uploads/linuxpermissions_4_passwd.jpg (/etc/passwd file) +[8]: https://opensource.com/sites/default/files/uploads/linuxpermissions_4_group.jpg (/etc/passwd file) +[9]: https://opensource.com/sites/default/files/uploads/linuxpermissions_5.jpg (Enforcing permissions for different user ownership types) +[10]: https://en.wikipedia.org/wiki/Access-control_list +[11]: https://opensource.com/sites/default/files/uploads/linuxpermissions_6.jpg (Different Linux permissions) +[12]: https://opensource.com/sites/default/files/uploads/linuxpermissions_7.jpg (Privilege types) +[13]: https://opensource.com/sites/default/files/uploads/linuxpermissions_8.jpg (Permission type example) +[14]: https://opensource.com/sites/default/files/uploads/linuxpermissions_9.jpg (Permission type examples) +[15]: https://opensource.com/sites/default/files/uploads/linuxpermissions_10.jpg (Permission type examples) From c8f0dcd1ac2779a020f33185f0e34de102a6589b Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 11:23:10 +0800 Subject: [PATCH 1033/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190618=20Why?= =?UTF-8?q?=20your=20workplace=20arguments=20aren't=20as=20effective=20as?= =?UTF-8?q?=20you'd=20like=20sources/tech/20190618=20Why=20your=20workplac?= =?UTF-8?q?e=20arguments=20aren-t=20as=20effective=20as=20you-d=20like.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ments aren-t as effective as you-d like.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20190618 Why your workplace arguments aren-t as effective as you-d like.md diff --git a/sources/tech/20190618 Why your workplace arguments aren-t as effective as you-d like.md b/sources/tech/20190618 Why your workplace arguments aren-t as effective as you-d like.md new file mode 100644 index 0000000000..54a0cca26f --- /dev/null +++ b/sources/tech/20190618 Why your workplace arguments aren-t as effective as you-d like.md @@ -0,0 +1,144 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why your workplace arguments aren't as effective as you'd like) +[#]: via: (https://opensource.com/open-organization/19/6/barriers-productive-arguments) +[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland/users/ron-mcfarland) + +Why your workplace arguments aren't as effective as you'd like +====== +Open organizations rely on open conversations. These common barriers to +productive argument often get in the way. +![Arrows pointing different directions][1] + +Transparent, frank, and often contentious arguments are part of life in an open organization. But how can we be sure those conversations are _productive_ —not _destructive_? + +This is the second installment of a two-part series on how to argue and actually achieve something. In the [first article][2], I mentioned what arguments are (and are not), according to author Sinnott-Armstrong in his book _Think Again: How to Reason and Argue._ I also offered some suggestions for making arguments as productive as possible. + +In this article, I'll examine three barriers to productive arguments that Sinnott-Armstrong elaborates in his book: incivility, polarization, and language issues. Finally, I'll explain his suggestions for addressing those barriers. + +### Incivility + +"Incivility" has become a social concern in recent years. Consider this: As a tactic in arguments, incivility _can_ have an effect in certain situations—and that's why it's a common strategy. Sinnott-Armstrong notes that incivility: + + * **Attracts attention:** Incivility draws people's attention in one direction, sometimes to misdirect attention from or outright obscure other issues. It redirects people's attention to shocking statements. Incivility, exaggeration, and extremism can increase the size of an audience. + + * **Energizes:** Sinnott-Armstrong writes that seeing someone being uncivil on a topic of interest can generate energy from a state of powerlessness. + + * **Stimulates memory:** Forgetting shocking statements is difficult; they stick in our memory more easily than statements that are less surprising to us. + + * **Excites the powerless:** The groups most likely to believe and invest in someone being uncivil are those that feel they're powerless and being treated unfairly. + + + + +Unfortunately, incivility as a tactic in arguments has its costs. One such cost is polarization. + +### Polarization + +Sinnott-Armstrong writes about five forms of polarization: + + * **Distance:** If two people's or groups' views are far apart according to some relevant scale, have significant disagreements and little common ground, then they're polarized. + + * **Differences:** If two people or groups have fewer values and beliefs _in common_ than they _don't have in common_ , then they're polarized. + + * **Antagonism:** Groups are more polarized the more they feel hatred, disdain, fear, or other negative emotions toward other people or groups. + + * **Incivility:** Groups tend to be more polarized when they talk more negatively about people of the other groups. + + * **Rigidity:** Groups tend to be more polarized when they treat their values as indisputable and will not compromise. + + * **Gridlock:** Groups tend to be more polarized when they're unable to cooperate and work together toward common goals. + + + + +And I'll add one more form of polarization to Sinnott-Armstrong's list: + + * **Non-disclosure:** Groups tend to be more polarized when one or both of the groups refuses to share valid, verifiable information—or when they distract each other with useless or irrelevant information. One of the ways people polarize is by not talking to each other and withhold information. Similarly, they talk on subjects that distract us from the issue at hand. Some issues are difficult to talk about, but by doing so solutions can be explored. + + + +### Language issues + +Identifying discussion-stoppers like these can help you avoid shutting down a discussion that would otherwise achieve beneficial outcomes. + +Language issues can be argument-stoppers Sinnott-Armstrong says. In particular, he outlines some of the following language-related barriers to productive argument. + + * **Guarding:** Using words like "all" can make a statement unbelievable; words like "sometimes" can make a statement too vague. + + * **Assuring:** Simply stating "trust me, I know what I'm talking about," without offering evidence that this is the case, can impede arguments. + + * **Evaluating:** Offering an evaluation of something—like saying "It is good"―without any supporting reasoning. + + * **Discounting:** This involves anticipating what the another person will say and attempting to weaken it as much as possible by framing an argument in a negative way. (Contrast these two sentences, for example: "Ramona is smart but boring" and "Ramona is boring but smart." The difference is subtle, but you'd probably want to spend less time with Ramona if you heard the first statement about her than if you heard the second.) + + + + +Identifying discussion-stoppers like these can help you avoid shutting down a discussion that would otherwise achieve beneficial outcomes. In addition, Sinnott-Armstrong specifically draws readers' attention to two other language problems that can kill productive debates: vagueness and ambiguity. + + * **Vagueness:** This occurs when a word or sentence is not precise enough and having many ways to interpret its true meaning and intent, which leads to confusion. Consider the sentence "It is big." "It" must be defined if it's not already obvious to everyone in the conversation. And a word like "big" must be clarified through comparison to something that everyone has agreed upon. + + * **Ambiguity:** This occurs when a sentence could have two distinct meanings. For example: "Police killed man with axe." Who was holding the axe, the man or the police? "My neighbor had a friend for dinner." Did your neighbor invite a friend to share a meal—or did she eat her friend? + + + + +### Overcoming barriers + +To help readers avoid these common roadblocks to productive arguments, Sinnott-Armstrong recommends a simple, four-step process for evaluating another person's argument. + + 1. **Observation:** First, observe a stated opinion and its related evidence to determine the precise nature of the claim. This might require you to ask some questions for clarification (you'll remember I employed this technique when arguing with my belligerent uncle, which I described [in the first article of this series][2]). + + 2. **Hypothesis:** Develop some hypothesis about the argument. In this case, the hypothesis should be an inference based on generally acceptable standards (for more on the structure of arguments themselves, also see [the first part of this series][2]). + + 3. **Comparison:** Compare that hypothesis with others and evaluate which is more accurate. More important issues will require you to conduct more comparisons. In other cases, premises are so obvious that no further explanation is required. + + 4. **Conclusion:** From the comparison analysis, reach a conclusion about whether your hypothesis about a competing argument is correct. + + + + +In many cases, the question is not whether a particular claim is _correct_ or _incorrect_ , but whether it is _believable._ So Sinnott-Armstrong also offers a four-step "believability test" for evaluating claims of this type. + + 1. **Expertise:** Does the person presenting the argument have authority in an appropriate field? Being a specialist is one field doesn't necessarily make that person an expert in another. + + 2. **Motive:** Would self-interest or other personal motives compel a person to withhold information or make false statements? To confirm one's statements, it might be wise to seek a totally separate, independent authority for confirmation. + + 3. **Sources:** Are the sources the person offers as evidence of a claim recognized experts? Do those sources have the expertise on the specific issue addressed? + + 4. **Agreement:** Is there agreement among many experts within the same specialty? + + + + +### Let's argue + +If you really want to strengthen your ability to argue, find someone that totally disagrees with you but wants to learn and understand your beliefs. + +When I was a university student, I would usually sit toward the front of the classroom. When I didn't understand something, I would start asking questions for clarification. Everyone else in the class would just sit silently, saying nothing. After class, however, other students would come up to me and thank me for asking those questions—because everyone else in the room was confused, too. + +Clarification is a powerful act—not just in the classroom, but during arguments anywhere. Building an organizational culture in which people feel empowered to ask for clarification is critical for productive arguments (I've [given presentations on this topic][3] before). If members have the courage to clarify premises, and they can do so in an environment where others don't think they're being belligerent, then this might be the key to a successful and productive argument. + +If you really want to strengthen your ability to argue, find someone that totally disagrees with you but wants to learn and understand your beliefs. Then, practice some of Sinnott-Armstrong's suggestions. Arguing productively will enhance [transparency, inclusivity, and collaboration][4] in your organization—leading to a more open culture. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/6/barriers-productive-arguments + +作者:[Ron McFarland][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/ron-mcfarland/users/ron-mcfarland +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/directions-arrows.png?itok=EE3lFewZ (Arrows pointing different directions) +[2]: https://opensource.com/open-organization/19/5/productive-arguments +[3]: https://www.slideshare.net/RonMcFarland1/argue-successfully-achieve-something +[4]: https://opensource.com/open-organization/resources/open-org-definition From cd6a9ebf78b95a7d12a56af22e9ddb34a7492d8e Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 11:28:33 +0800 Subject: [PATCH 1034/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190619=20Cisc?= =?UTF-8?q?o=20connects=20with=20IBM=20in=20to=20simplify=20hybrid=20cloud?= =?UTF-8?q?=20deployment=20sources/talk/20190619=20Cisco=20connects=20with?= =?UTF-8?q?=20IBM=20in=20to=20simplify=20hybrid=20cloud=20deployment.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... in to simplify hybrid cloud deployment.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/talk/20190619 Cisco connects with IBM in to simplify hybrid cloud deployment.md diff --git a/sources/talk/20190619 Cisco connects with IBM in to simplify hybrid cloud deployment.md b/sources/talk/20190619 Cisco connects with IBM in to simplify hybrid cloud deployment.md new file mode 100644 index 0000000000..b3344c5eb2 --- /dev/null +++ b/sources/talk/20190619 Cisco connects with IBM in to simplify hybrid cloud deployment.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco connects with IBM in to simplify hybrid cloud deployment) +[#]: via: (https://www.networkworld.com/article/3403363/cisco-connects-with-ibm-in-to-simplify-hybrid-cloud-deployment.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco connects with IBM in to simplify hybrid cloud deployment +====== +Cisco and IBM are working todevelop a hybrid-cloud architecture that meld Cisco’s data-center, networking and analytics platforms with IBM’s cloud offerings. +![Ilze Lucero \(CC0\)][1] + +Cisco and IBM said the companies would meld their [data-center][2] and cloud technologies to help customers more easily and securely build and support on-premises and [hybrid-cloud][3] applications. + +Cisco, IBM Cloud and IBM Global Technology Services (the professional services business of IBM) said they will work to develop a hybrid-cloud architecture that melds Cisco’s data-center, networking and analytics platforms with IBM’s cloud offerings. IBM's contribution includea a heavy emphasis on Kubernetes-based offerings such as Cloud Foundry and Cloud Private as well as a catalog of [IBM enterprise software][4] such as Websphere and open source software such as Open Whisk, KNative, Istio and Prometheus. + +**[ Read also:[How to plan a software-defined data-center network][5] ]** + +Cisco said customers deploying its Virtual Application Centric Infrastructure (ACI) technologies can now extend that network fabric from on-premises to the IBM Cloud. ACI is Cisco’s [software-defined networking (SDN)][6] data-center package, but it also delivers the company’s Intent-Based Networking technology, which brings customers the ability to automatically implement network and policy changes on the fly and ensure data delivery. + +[IBM said Cisco ACI Virtual Pod][7] (vPOD) software can now run on IBM Cloud bare-metal servers. “vPOD consists of virtual spines and leafs and supports up to eight instances of ACI Virtual Edge. These elements are often deployed on VMware services on the IBM Cloud to support hybrid deployments from on-premises environments to the IBM Cloud," the company stated. + +“Through a new relationship with IBM’s Global Technology Services team, customers can implement Virtual ACI on their IBM Cloud,” Cisco’s Kaustubh Das, vice president of strategy and product development wrote in a [blog][8] about the agreement. “Virtual ACI is a software-only solution that you can deploy wherever you have at least two servers on which you can run the VMware ESXi hypervisor. In the future, the ability to deploy IBM Cloud Pak for Applications in a Cisco ACI environment will also be supported,” he stated. + +IBM’s prepackaged Cloud Paks include a secured Kubernetes container and containerized IBM middleware designed to let customers quickly spin-up enterprise-ready containers, Big Blue said. + +Additionally IBM said it would add support for its IBM Cloud Private, which manages Kubernetes and other containers, on Cisco HyperFlex and HyperFlex Edge hyperconverged infrastructure (HCI) systems. HyperFlex is Cisco's HCI that offers computing, networking and storage resources in a single system. The package can be managed via Cisco’s Intersight software-as-a-service cloud management platform that offers a central dashboard of HyperFlex operations. + +IBM said it was adding Hyperflex support to its IBM Cloud Pak for Applications as well. + +The paks include IBM Multicloud Manager which is a Kubernetes-based platform that runs on the company’s [IBM Cloud Private][9] platform and lets customers manage and integrate workloads on clouds from other providers such as Amazon, Red Hat and Microsoft. + +At the heart of the Multi-cloud Manager is a dashboard interface for managing thousands of Kubernetes applications and huge volumes of data regardless of where in the organization they are located. + +The idea is that Multi-cloud Manager lets operations and development teams get visibility of Kubernetes applications and components across the different clouds and clusters via a single control pane. + +“With IBM Multicloud Manager, enterprises can have a single place to manage multiple clusters running across multiple on-premises, public and private cloud environments, providing consistent visibility, governance and automation from on-premises to the edge, wrote IBM’s Evaristus Mainsah, general manager of IBM Cloud Private Ecosystem in a [blog][7] about the relationship. + +Distributed workloads can be pushed out and managed directly at the device at a much larger scale across multiple public clouds and on-premises locations. Visibility, compliance and governance are provided with extended MCM capabilities that will be available at the lightweight device layer, with a connection back to the central server/gateway, Mainsah stated. + +In addition, Cisco’s AppDynamics\can be tied in to monitor infrastructure and business performance, Cisco stated. Cisco recently added [AppDynamics for Kubernetes][10], which Cisco said will reduce the time it takes to identify and troubleshoot performance issues across Kubernetes clusters. + +The companies said the hybrid-cloud architecture they envision will help reduce the complexity of setting up and managing hybrid-cloud environments. + +Cisco and IBM are both aggressively pursuing cloud customers. Cisco[ ramped up][11] its own cloud presence in 2018 with all manner of support stemming from an [agreement with Amazon Web Services][12] (AWS) that will offer enterprise customers an integrated platform to help them more simply build, secure and connect [Kubernetes][13] clusters across private [data centers][14] and the AWS cloud. + +Cisco and Google in [April expanded their joint cloud-development][15] activities to help customers more easily build secure multicloud and hybrid applications everywhere from on-premises data centers to public clouds. + +IBM is waiting to close [its $34 billion Red Hat deal][16] that it expects will give it a huge presence in the hotly contested hybrid-cloud arena and increase its inroads to competitors – Google, Amazon and Microsoft among others. Gartner says that market will be worth $240 billion by next year. + +Join the Network World communities on [Facebook][17] and [LinkedIn][18] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403363/cisco-connects-with-ibm-in-to-simplify-hybrid-cloud-deployment.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/03/cubes_blocks_squares_containers_ilze_lucero_cc0_via_unsplash_1200x800-100752172-large.jpg +[2]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[3]: https://www.networkworld.com/article/3233132/what-is-hybrid-cloud-computing.html +[4]: https://www.networkworld.com/article/3340043/ibm-marries-on-premises-private-and-public-cloud-data.html +[5]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[6]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html +[7]: https://www.ibm.com/blogs/cloud-computing/2019/06/18/ibm-cisco-collaborating-hybrid-cloud-modern-enterprise/ +[8]: https://blogs.cisco.com/datacenter/cisco-and-ibm-cloud-announce-hybrid-cloud-partnership +[9]: https://www.ibm.com/cloud/private +[10]: https://blog.appdynamics.com/product/kubernetes-monitoring-with-appdynamics/ +[11]: https://www.networkworld.com/article/3322937/lan-wan/what-will-be-hot-for-cisco-in-2019.html?nsdr=true +[12]: https://www.networkworld.com/article/3319782/cloud-computing/cisco-aws-marriage-simplifies-hybrid-cloud-app-development.html?nsdr=true +[13]: https://www.networkworld.com/article/3269848/cloud-computing/cisco-embraces-kubernetes-pushing-container-software-into-mainstream.html +[14]: https://www.networkworld.com/article/3223692/data-center/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[15]: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html +[16]: https://www.networkworld.com/article/3316960/ibm-says-buying-red-hat-makes-it-the-biggest-in-hybrid-cloud.html +[17]: https://www.facebook.com/NetworkWorld/ +[18]: https://www.linkedin.com/company/network-world From 3aacaf9d455789509fe65c4c362e7b9e21a6864e Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 11:28:47 +0800 Subject: [PATCH 1035/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190619=20Cisc?= =?UTF-8?q?o=20issues=20critical=20security=20warnings=20on=20SD-WAN,=20DN?= =?UTF-8?q?A=20Center=20sources/talk/20190619=20Cisco=20issues=20critical?= =?UTF-8?q?=20security=20warnings=20on=20SD-WAN,=20DNA=20Center.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...security warnings on SD-WAN, DNA Center.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/talk/20190619 Cisco issues critical security warnings on SD-WAN, DNA Center.md diff --git a/sources/talk/20190619 Cisco issues critical security warnings on SD-WAN, DNA Center.md b/sources/talk/20190619 Cisco issues critical security warnings on SD-WAN, DNA Center.md new file mode 100644 index 0000000000..187e883706 --- /dev/null +++ b/sources/talk/20190619 Cisco issues critical security warnings on SD-WAN, DNA Center.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco issues critical security warnings on SD-WAN, DNA Center) +[#]: via: (https://www.networkworld.com/article/3403349/cisco-issues-critical-security-warnings-on-sd-wan-dna-center.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco issues critical security warnings on SD-WAN, DNA Center +====== +Vulnerabilities to Cisco's SD-WAN and DNA Center software top a list of nearly 30 security advisories issued by the company. +![zajcsik \(CC0\)][1] + +Cisco has released two critical warnings about security issues with its SD-WAN and DNA Center software packages. + +The worse, with a Common Vulnerability Scoring System rating of 9.3 out of 10, is a vulnerability in its [Digital Network Architecture][2] (DNA) Center software that could let an unauthenticated attacker connect an unauthorized network device to the subnet designated for cluster services. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][3] + * [How to pick an off-site data-backup method][4] + * [SD-Branch: What it is and why you’ll need it][5] + * [What are the options for security SD-WAN?][6] + + + +A successful exploit could let an attacker reach internal services that are not hardened for external access, Cisco [stated][7]. The vulnerability is due to insufficient access restriction on ports necessary for system operation, and the company discovered the issue during internal security testing, Cisco stated. + +Cisco DNA Center gives IT teams the ability to control access through policies using Software-Defined Access, automatically provision through Cisco DNA Automation, virtualize devices through Cisco Network Functions Virtualization (NFV), and lower security risks through segmentation and Encrypted Traffic Analysis. + +This vulnerability affects Cisco DNA Center Software releases prior to 1.3, and it is fixed in version 1.3 and releases after that. + +Cisco wrote that system updates are available from the Cisco cloud but not from the [Software Center][8] on Cisco.com. To upgrade to a fixed release of Cisco DNA Center Software, administrators can use the “System Updates” feature of the software. + +A second critical warning – with a CVVS score of 7.8 – is a weakness in the command-line interface of the Cisco SD-WAN Solution that could let an authenticated local attacker elevate lower-level privileges to the root user on an affected device. + +Cisco [wrote][9] that the vulnerability is due to insufficient authorization enforcement. An attacker could exploit this vulnerability by authenticating to the targeted device and executing commands that could lead to elevated privileges. A successful exploit could let the attacker make configuration changes to the system as the root user, the company stated. + +This vulnerability affects a range of Cisco products running a release of the Cisco SD-WAN Solution prior to Releases 18.3.6, 18.4.1, and 19.1.0 including: + + * vBond Orchestrator Software + * vEdge 100 Series Routers + * vEdge 1000 Series Routers + * vEdge 2000 Series Routers + * vEdge 5000 Series Routers + * vEdge Cloud Router Platform + * vManage Network Management Software + * vSmart Controller Software + + + +Cisco said it has released free [software updates][10] that address the vulnerability described in this advisory. Cisco wrote that it fixed this vulnerability in Release 18.4.1 of the Cisco SD-WAN Solution. + +The two critical warnings were included in a dump of [nearly 30 security advisories][11]. + +There were two other “High” impact rated warnings involving the SD-WAN software. + +One, a vulnerability in the vManage web-based UI (Web UI) of the Cisco SD-WAN Solution could let an authenticated, remote attacker gain elevated privileges on an affected vManage device, Cisco [wrote][12]. + +The vulnerability is due to a failure to properly authorize certain user actions in the device configuration. An attacker could exploit this vulnerability by logging in to the vManage Web UI and sending crafted HTTP requests to vManage. A successful exploit could let attackers gain elevated privileges and make changes to the configuration that they would not normally be authorized to make, Cisco stated. + +Another vulnerability in the vManage web-based UI could let an authenticated, remote attacker inject arbitrary commands that are executed with root privileges. + +This exposure is due to insufficient input validation, Cisco [wrote][13]. An attacker could exploit this vulnerability by authenticating to the device and submitting crafted input to the vManage Web UI. + +Both vulnerabilities affect Cisco vManage Network Management Software that is running a release of the Cisco SD-WAN Solution prior to Release 18.4.0 and Cisco has released free [software updates][10] to correct them. + +Other high-rated vulnerabilities Cisco disclosed included: + + * A [vulnerability][14] in the Cisco Discovery Protocol (CDP) implementation for the Cisco TelePresence Codec (TC) and Collaboration Endpoint (CE) Software could allow an unauthenticated, adjacent attacker to inject arbitrary shell commands that are executed by the device. + * A [weakness][15] in the internal packet-processing functionality of the Cisco StarOS operating system running on virtual platforms could allow an unauthenticated, remote attacker to cause an affected device to stop processing traffic, resulting in a denial of service (DoS) condition. + * A [vulnerability][16] in the web-based management interface of the Cisco RV110W Wireless-N VPN Firewall, Cisco RV130W Wireless-N Multifunction VPN Router, and Cisco RV215W Wireless-N VPN Router could allow an unauthenticated, remote attacker to cause a reload of an affected device, resulting in a denial of service (DoS) condition. + + + +Cisco has [released software][10] fixes for those advisories as well. + +Join the Network World communities on [Facebook][17] and [LinkedIn][18] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403349/cisco-issues-critical-security-warnings-on-sd-wan-dna-center.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/04/lightning_storm_night_gyorgy_karoly_toth_aka_zajcsik_cc0_via_pixabay_1200x800-100754504-large.jpg +[2]: https://www.networkworld.com/article/3401523/cisco-software-to-make-networks-smarter-safer-more-manageable.html +[3]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[4]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[5]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[6]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-dnac-bypass +[8]: https://software.cisco.com/download/home +[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-sdwan-privesca +[10]: https://tools.cisco.com/security/center/resources/security_vulnerability_policy.html#fixes +[11]: https://tools.cisco.com/security/center/publicationListing.x?product=Cisco&sort=-day_sir&limit=50#~Vulnerabilities +[12]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-sdwan-privilescal +[13]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-sdwan-cmdinj +[14]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-tele-shell-inj +[15]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-staros-asr-dos +[16]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-rvrouters-dos +[17]: https://www.facebook.com/NetworkWorld/ +[18]: https://www.linkedin.com/company/network-world From 12d2e4474fc6cead6164973c49b6be21489c2a08 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 11:28:59 +0800 Subject: [PATCH 1036/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190619=20With?= =?UTF-8?q?=20Tableau,=20SaaS=20king=20Salesforce=20becomes=20a=20hybrid?= =?UTF-8?q?=20cloud=20company=20sources/talk/20190619=20With=20Tableau,=20?= =?UTF-8?q?SaaS=20king=20Salesforce=20becomes=20a=20hybrid=20cloud=20compa?= =?UTF-8?q?ny.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lesforce becomes a hybrid cloud company.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md diff --git a/sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md b/sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md new file mode 100644 index 0000000000..d0d1d24cb6 --- /dev/null +++ b/sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (With Tableau, SaaS king Salesforce becomes a hybrid cloud company) +[#]: via: (https://www.networkworld.com/article/3403442/with-tableau-saas-king-salesforce-becomes-a-hybrid-cloud-company.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +With Tableau, SaaS king Salesforce becomes a hybrid cloud company +====== +Once dismissive of software, Salesforce acknowledges the inevitability of the hybrid cloud. +![Martyn Williams/IDGNS][1] + +I remember a time when people at Salesforce events would hand out pins that read “Software” inside a red circle with a slash through it. The High Priest of SaaS (a.k.a. CEO Marc Benioff) was so adamant against installed, on-premises software that his keynotes were always comical. + +Now, Salesforce is prepared to [spend $15.7 billion to acquire Tableau Software][2], the leader in on-premises data analytics. + +On the hell-freezes-over scale, this is up there with Microsoft embracing Linux or Apple PR people returning a phone call. Well, we know at least one of those has happened. + +**[ Also read:[Hybrid Cloud: The time for adoption is upon us][3] | Stay in the know: [Subscribe and get daily newsletter updates][4] ]** + +So, why would a company that is so steeped in the cloud, so anti-on-premises software, make such a massive purchase? + +Partly it is because Benioff and company are finally coming to the same conclusion as most everyone else: The hybrid cloud, a mix of on-premises systems and public cloud, is the wave of the future, and pure cloud plays are in the minority. + +The reality is that data is hybrid and does not sit in a single location, and Salesforce is finally acknowledging this, said Tim Crawford, president of Avoa, a strategic CIO advisory firm. + +“I see the acquisition of Tableau by Salesforce as less about getting into the on-prem game as it is a reality of the world we live in. Salesforce needed a solid analytics tool that went well beyond their existing capability. Tableau was that tool,” he said. + +**[[Become a Microsoft Office 365 administrator in record time with this quick start course from PluralSight.][5] ]** + +Salesforce also understands that they need a better understanding of customers and those data insights that drive customer decisions. That data is both on-prem and in the cloud, Crawford noted. It is in Salesforce, other solutions, and the myriad of Excel spreadsheets spread across employee systems. Tableau crosses the hybrid boundaries and brings a straightforward way to visualize data. + +Salesforce had analytics features as part of its SaaS platform, but it was geared around their own platform, whereas everyone uses Tableau and Tableau supports all manner of analytics. + +“There’s a huge overlap between Tableau customers and Salesforce customers,” Crawford said. “The data is everywhere in the enterprise, not just in Salesforce. Salesforce does a great job with its own data, but Tableau does great with data in a lot of places because it’s not tied to one platform. So, it opens up where the data comes from and the insights you get from the data.” + +Crawford said that once the deal is done and Tableau is under some deeper pockets, the organization may be able to innovate faster or do things they were unable to do prior. That hardly indicates Tableau was struggling, though. It pulled in [$1.16 billion in revenue][6] in 2018. + +Crawford also expects Salesforce to push Tableau to open up new possibilities for customer insights by unlocking customer data inside and outside of Salesforce. One challenge for the two companies is to maintain that neutrality so that they don’t lose the ability to use Tableau for non-customer centric activities. + +“It’s a beautiful way to visualize large sets of data that have nothing to do with customer centricity,” he said. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403442/with-tableau-saas-king-salesforce-becomes-a-hybrid-cloud-company.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2015/09/150914-salesforce-dreamforce-2-100614575-large.jpg +[2]: https://www.cio.com/article/3402026/how-salesforces-tableau-acquisition-will-impact-it.html +[3]: http://www.networkworld.com/article/2172875/cloud-computing/hybrid-cloud--the-year-of-adoption-is-upon-us.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fadministering-office-365-quick-start +[6]: https://www.geekwire.com/2019/tableau-hits-841m-annual-recurring-revenue-41-transition-subscription-model-continues/ +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From f5c0608cde5e3ea07ec22545520dff74e2a107f5 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 11:29:16 +0800 Subject: [PATCH 1037/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190618=2017?= =?UTF-8?q?=20predictions=20about=205G=20networks=20and=20devices=20source?= =?UTF-8?q?s/talk/20190618=2017=20predictions=20about=205G=20networks=20an?= =?UTF-8?q?d=20devices.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...edictions about 5G networks and devices.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/talk/20190618 17 predictions about 5G networks and devices.md diff --git a/sources/talk/20190618 17 predictions about 5G networks and devices.md b/sources/talk/20190618 17 predictions about 5G networks and devices.md new file mode 100644 index 0000000000..d8833f9887 --- /dev/null +++ b/sources/talk/20190618 17 predictions about 5G networks and devices.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (17 predictions about 5G networks and devices) +[#]: via: (https://www.networkworld.com/article/3403358/17-predictions-about-5g-networks-and-devices.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +17 predictions about 5G networks and devices +====== +Not surprisingly, the new Ericsson Mobility Report is bullish on the potential of 5G technology. Here’s a quick look at the most important numbers. +![Vertigo3D / Getty Images][1] + +_“As market after market switches on 5G, we are at a truly momentous point in time. No previous generation of mobile technology has had the potential to drive economic growth to the extent that 5G promises. It goes beyond connecting people to fully realizing the Internet of Things (IoT) and the Fourth Industrial Revolution.”_ —The opening paragraph of the [June 2019 Ericsson Mobility Report][2] + +Almost every significant technology advancement now goes through what [Gartner calls the “hype cycle.”][3] These days, Everyone expects new technologies to be met with gushing optimism and dreamy visions of how it’s going to change the world in the blink of an eye. After a while, we all come to expect the vendors and the press to go overboard with excitement, at least until reality and disappointment set in when things don’t pan out exactly as expected. + +**[ Also read:[The time of 5G is almost here][4] ]** + +Even with all that in mind, though, Ericsson’s whole-hearted embrace of 5G in its Internet Mobility Report is impressive. The optimism is backed up by lots of numbers, but they can be hard to tease out of the 36-document. So, let’s recap some of the most important top-line predictions (with my comments at the end). + +### Worldwide 5G growth projections + + 1. “More than 10 million 5G subscriptions are projected worldwide by the end of 2019.” + 2. “[We] now expect there to be 1.9 billion 5G subscriptions for enhanced mobile broadband by the end of 2024. This will account for over 20 percent of all mobile subscriptions at that time. The peak of LTE subscriptions is projected for 2022, at around 5.3 billion subscriptions, with the number declining slowly thereafter.” + 3. “In 2024, 5G networks will carry 35 percent of mobile data traffic globally.” + 4. “5G can cover up to 65 percent of the world’s population in 2024.” + 5. ”NB-IoT and Cat-M technologies will account for close to 45 percent of cellular IoT connections in 2024.” + 6. “By the end of 2024, nearly 35 percent of cellular IoT connections will be Broadband IoT, with 4G connecting the majority.” But 5G connections will support more advanced use cases. + 7. “Despite challenging 5G timelines, device suppliers are expected to be ready with different band and architecture support in a range of devices during 2019.” + 8. “Spectrum sharing … chipsets are currently in development and are anticipated to be in 5G commercial devices in late 2019." + 9. “[VoLTE][5] is the foundation for enabling voice and communication services on 5G devices. Subscriptions are expected to reach 2.1 billion by the end of 2019. … The number of VoLTE subscriptions is projected to reach 5.9 billion by the end of 2024, accounting for more than 85 percent of combined LTE and 5G subscriptions.” + + + +![][6] + +### Regional 5G projections + + 1. “In North America, … service providers have already launched commercial 5G services, both for fixed wireless access and mobile. … By the end of 2024, we anticipate close to 270 million 5G subscriptions in the region, accounting for more than 60 percent of mobile subscriptions.” + 2. “In Western Europe … The momentum for 5G in the region was highlighted by the first commercial launch in April. By the end of 2024, 5G is expected to account for around 40 percent of mobile subscriptions. + 3. In Central and Eastern Europe, … The first 5G subscriptions are expected in 2019, and will make up 15 percent of subscriptions in 2024.” + 4. “In North East Asia, … the region’s 5G subscription penetration is projected to reach 47 percent [by the end of 2024]. + 5. “[In India,] 5G subscriptions are expected to become available in 2022 and will represent 6 percent of mobile subscriptions at the end of 2024.” + 6. “In the Middle East and North Africa, we anticipate commercial 5G deployments with leading communications service providers during 2019, and significant volumes in 2021. … Around 60 million 5G subscriptions are forecast for the end of 2024, representing 3 percent of total mobile subscriptions.” + 7. “Initial 5G commercial devices are expected in the [South East Asia and Oceania] region during the first half of 2019. By the end of 2024, it is anticipated that almost 12 percent of subscriptions in the region will be for 5G.]” + 8. “In Latin America … the first 5G deployments will be possible in the 3.5GHz band during 2019. Argentina, Brazil, Chile, Colombia, and Mexico are anticipated to be the first countries in the region to deploy 5G, with increased subscription uptake forecast from 2020. By the end of 2024, 5G is set to make up 7 percent of mobile subscriptions.” + + + +### Is 5G really so inevitable? + +Considered individually, these predictions all seem perfectly reasonable. Heck, 10 million 5G subscriptions is only a drop in the global bucket. And rumors are already flying that Apple’s next round of iPhones will include 5G capability. Also, 2024 is still five years in the future, so why wouldn’t the faster connections drive impressive traffic stats? Similarly, North America and North East Asia will experience the fastest 5G penetration. + +But when you look at them all together, these numbers project a sense of 5G inevitability that could well be premature. It will take a _lot_ of spending, by a lot of different parties—carriers, chip makers, equipment vendors, phone manufacturers, and consumers—to make this kind of growth a reality. + +I’m not saying 5G won’t take over the world. I’m just saying that when so many things have to happen in a relatively short time, there are a lot of opportunities for the train to jump the tracks. Don’t be surprised if it takes longer than expected for 5G to turn into the worldwide default standard Ericsson—and everyone else—seems to think it will inevitably become. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403358/17-predictions-about-5g-networks-and-devices.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/5g_wireless_technology_network_connections_by_credit-vertigo3d_gettyimages-1043302218_3x2-100787550-large.jpg +[2]: https://www.ericsson.com/assets/local/mobility-report/documents/2019/ericsson-mobility-report-june-2019.pdf +[3]: https://www.gartner.com/en/research/methodologies/gartner-hype-cycle +[4]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[5]: https://www.gsma.com/futurenetworks/technology/volte/ +[6]: https://images.idgesg.net/images/article/2019/06/ericsson-mobility-report-june-2019-graph-100799481-large.jpg +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From fa50cc6f7147cd41e42744160b6859296738d067 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 12:21:23 +0800 Subject: [PATCH 1038/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190617=20How?= =?UTF-8?q?=20to=20Use=20VLAN=20tagged=20NIC=20(Ethernet=20Card)=20on=20Ce?= =?UTF-8?q?ntOS=20and=20RHEL=20Servers=20sources/tech/20190617=20How=20to?= =?UTF-8?q?=20Use=20VLAN=20tagged=20NIC=20(Ethernet=20Card)=20on=20CentOS?= =?UTF-8?q?=20and=20RHEL=20Servers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hernet Card) on CentOS and RHEL Servers.md | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 sources/tech/20190617 How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers.md diff --git a/sources/tech/20190617 How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers.md b/sources/tech/20190617 How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers.md new file mode 100644 index 0000000000..1a6f5988e9 --- /dev/null +++ b/sources/tech/20190617 How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers) +[#]: via: (https://www.linuxtechi.com/vlan-tagged-nic-ethernet-card-centos-rhel-servers/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers +====== + +There are some scenarios where we want to assign multiple IPs from different **VLAN** on the same Ethernet card (nic) on Linux servers ( **CentOS** / **RHEL** ). This can be done by enabling VLAN tagged interface. But for this to happen first we must make sure multiple VLANs are attached to port on switch or in other words we can say we should configure trunk port by adding multiple VLANs on switch. + + + +Let’s assume we have a Linux Server, there we have two Ethernet cards (enp0s3 & enp0s8), first NIC ( **enp0s3** ) will be used for data traffic and second NIC ( **enp0s8** ) will be used for control / management traffic. For Data traffic I will using multiple VLANs (or will assign multiple IPs from different VLANs on data traffic ethernet card). + +I am assuming the port from switch which is connected to my server data NIC is configured as trunk port by mapping the multiple VLANs to it. + +Following are the VLANs which is mapped to data traffic Ethernet Card (NIC): + + * VLAN ID (200), VLAN N/W = 172.168.10.0/24 + * VLAN ID (300), VLAN N/W = 172.168.20.0/24 + + + +To use VLAN tagged interface on CentOS 7 / RHEL 7 / CentOS 8 /RHEL 8 systems, [kernel module][1] **8021q** must be loaded. + +Use the following command to load the kernel module “8021q” + +``` +[root@linuxtechi ~]# lsmod | grep -i 8021q +[root@linuxtechi ~]# modprobe --first-time 8021q +[root@linuxtechi ~]# lsmod | grep -i 8021q +8021q 29022 0 +garp 14384 1 8021q +mrp 18542 1 8021q +[root@linuxtechi ~]# +``` + +Use below modinfo command to display information about kernel module “8021q” + +``` +[root@linuxtechi ~]# modinfo 8021q +filename: /lib/modules/3.10.0-327.el7.x86_64/kernel/net/8021q/8021q.ko +version: 1.8 +license: GPL +alias: rtnl-link-vlan +rhelversion: 7.2 +srcversion: 2E63BD725D9DC11C7DA6190 +depends: mrp,garp +intree: Y +vermagic: 3.10.0-327.el7.x86_64 SMP mod_unload modversions +signer: CentOS Linux kernel signing key +sig_key: 79:AD:88:6A:11:3C:A0:22:35:26:33:6C:0F:82:5B:8A:94:29:6A:B3 +sig_hashalgo: sha256 +[root@linuxtechi ~]# +``` + +Now tagged (or mapped) the VLANs 200 and 300 to NIC enp0s3 using the [ip command][2] + +``` +[root@linuxtechi ~]# ip link add link enp0s3 name enp0s3.200 type vlan id 200 +``` + +Bring up the interface using below ip command: + +``` +[root@linuxtechi ~]# ip link set dev enp0s3.200 up +``` + +Similarly mapped the VLAN 300 to NIC enp0s3 + +``` +[root@linuxtechi ~]# ip link add link enp0s3 name enp0s3.300 type vlan id 300 +[root@linuxtechi ~]# ip link set dev enp0s3.300 up +[root@linuxtechi ~]# +``` + +Now view the tagged interface status using ip command: + +[![tagged-interface-ip-command][3]][4] + +Now we can assign the IP address to tagged interface from their respective VLANs using beneath ip command, + +``` +[root@linuxtechi ~]# ip addr add 172.168.10.51/24 dev enp0s3.200 +[root@linuxtechi ~]# ip addr add 172.168.20.51/24 dev enp0s3.300 +``` + +Use below ip command to see whether IP is assigned to tagged interface or not. + +![ip-address-tagged-nic][5] + +All the above changes via ip commands will not be persistent across the reboot. These tagged interfaces will not be available after reboot and after network service restart + +So, to make tagged interfaces persistent across the reboot then use interface **ifcfg files** + +Edit interface (enp0s3) file “ **/etc/sysconfig/network-scripts/ifcfg-enp0s3** ” and add the following content, + +Note: Replace the interface name that suits to your env, + +``` +[root@linuxtechi ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 +TYPE=Ethernet +DEVICE=enp0s3 +BOOTPROTO=none +ONBOOT=yes +``` + +Save & exit the file + +Create tagged interface file for VLAN id 200 as “ **/etc/sysconfig/network-scripts/ifcfg-enp0s3.200** ” and add the following contents to it. + +``` +[root@linuxtechi ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3.200 +DEVICE=enp0s3.200 +BOOTPROTO=none +ONBOOT=yes +IPADDR=172.168.10.51 +PREFIX=24 +NETWORK=172.168.10.0 +VLAN=yes +``` + +Save & exit the file + +Similarly create interface file for VLAN id 300 as “/etc/sysconfig/network-scripts/ifcfg-enp0s3.300” and add the following contents to it + +``` +[root@linuxtechi ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3.300 +DEVICE=enp0s3.300 +BOOTPROTO=none +ONBOOT=yes +IPADDR=172.168.20.51 +PREFIX=24 +NETWORK=172.168.20.0 +VLAN=yes +``` + +Save and exit file and then restart network services using the beneath command, + +``` +[root@linuxtechi ~]# systemctl restart network +[root@linuxtechi ~]# +``` + +Now verify whether tagged interface are configured and up & running using the ip command, + +![tagged-interface-status-ip-command-linux-server][6] + +That’s all from this article, I hope you got an idea how to configure and enable VLAN tagged interface on CentOS 7 / 8 and RHEL 7 /8 Severs. Please do share your feedback and comments. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/vlan-tagged-nic-ethernet-card-centos-rhel-servers/ + +作者:[Pradeep Kumar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/how-to-manage-kernel-modules-in-linux/ +[2]: https://www.linuxtechi.com/ip-command-examples-for-linux-users/ +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/06/tagged-interface-ip-command-1024x444.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/06/tagged-interface-ip-command.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/06/ip-address-tagged-nic-1024x343.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/06/tagged-interface-status-ip-command-linux-server-1024x656.jpg From e6666ef71f092d22be16f8214eb720e5fa2499a3 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 12:21:35 +0800 Subject: [PATCH 1039/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190611=20Step?= =?UTF-8?q?=20by=20Step=20Zorin=20OS=2015=20Installation=20Guide=20with=20?= =?UTF-8?q?Screenshots=20sources/tech/20190611=20Step=20by=20Step=20Zorin?= =?UTF-8?q?=20OS=2015=20Installation=20Guide=20with=20Screenshots.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 15 Installation Guide with Screenshots.md | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 sources/tech/20190611 Step by Step Zorin OS 15 Installation Guide with Screenshots.md diff --git a/sources/tech/20190611 Step by Step Zorin OS 15 Installation Guide with Screenshots.md b/sources/tech/20190611 Step by Step Zorin OS 15 Installation Guide with Screenshots.md new file mode 100644 index 0000000000..79d0b9e1a5 --- /dev/null +++ b/sources/tech/20190611 Step by Step Zorin OS 15 Installation Guide with Screenshots.md @@ -0,0 +1,204 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Step by Step Zorin OS 15 Installation Guide with Screenshots) +[#]: via: (https://www.linuxtechi.com/zorin-os-15-installation-guide-screenshots/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +Step by Step Zorin OS 15 Installation Guide with Screenshots +====== + +Good News for all the Zorin users out there! Zorin has launched its latest version (Zorin OS 15) of its Ubuntu based Linux distro. This version is based on Ubuntu 18.04.2, since its launch in July 2009, it is estimated that this popular distribution has reached more than 17 million downloads. Zorin is renowned for creating a distribution for beginner level users and the all new Zorin OS 15 comes packed with a lot of goodies that surely will make Zorin OS lovers happy. Let’s see some of the major enhancements made in the latest version. + +### New Features of Zorin OS 15 + +Zorin OS has always amazed users with different set of features when every version is released Zorin OS 15 is no exception as it comes with a lot of new features as outlined below: + +**Enhanced User Experience** + +The moment you look at the Zorin OS 15, you will ask whether it is a Linux distro because it looks more like a Windows OS. According to Zorin, it wanted Windows users to get ported to Linux in a more user-friendly manner. And it features a Windows like Start menu, quick app launchers, a traditional task bar section, system tray etc. + +**Zorin Connect** + +Another major highlight of Zorin OS 15 is the ability to integrate your Android Smartphones seamlessly with your desktop using the Zorin Connect application. With your phone connected, you can share music, videos and other files between your phone and desktop. You can even use your phone as a mouse to control the desktop. You can also easily control the media playback in your desktop from your phone itself. Quickly reply to all your messages and notifications sent to your phone from your desktop. + +**New GTK Theme** + +Zorin OS 15 ships with an all new GTK Theme that has been exclusively built for this distro and the theme is available in 6 different colors along with the hugely popular dark theme. Another highlight is that the OS automatically detects the time of the day and changes the desktop theme accordingly. Say for example, during sunset it switches to a dark theme whereas in the morning it switches to bright theme automatically. + +**Other New Features:** + +Zorin OS 15 comes packed with a lot of new features including: + + * Compatible with Thunderbolt 3.0 devices + * Supports color emojis + * Comes with an upgraded Linux Kernel 4.18 + * Customized settings available for application menu and task bar + * System font changed to Inter + * Supports renaming bulk files + + + +### Minimum system requirements for Zorin OS 15 (Core): + + * Dual Core 64-bit (1GHZ) + * 2 GB RAM + * 10 GB free disk space + * Internet Connection Optional + * Display (800×600) + + + +### Step by Step Guide to Install Zorin OS 15 (Core) + +Before you start installing Zorin OS 15, ensure you have a copy of the Zorin OS 15 downloaded in your system. If not download then refer official website of [Zorin OS 15][1]. Remember this Linux distribution is available in 4 versions including: + + * Ultimate (Paid Version) + * Core (Free Version) + * Lite (Free Version) + * Education (Free Version) + + + +Note: In this article I will demonstrate Zorin OS 15 Core Installation Steps + +### Step 1) Create Zorin OS 15 Bootable USB Disk + +Once you have downloaded Zorin OS 15, copy the ISO into an USB disk and create a bootable disk. Change our system settings to boot using an USB disk and restart your system. Once you restart your system, you will see the screen as shown below. Click “ **Install or Try Zorin OS** ” + + + +### Step 2) Choose Install Zorin OS + +In the next screen, you will be shown option to whether install Zorin OS 15 or to try Zorin OS. Click “ **Install Zorin OS** ” to continue the installation process. + + + +### Step 3) Choose Keyboard Layout + +Next step is to choose your keyboard layout. By default, English (US) is selected and if you want to choose a different language, then choose it and click “ **Continue** ” + + + +### Step 4) Download Updates and Other Software + +In the next screen, you will be asked whether you need to download updates while you are installing Zorin OS and install other 3rd party applications. In case your system is connected to internet then you can select both of these options, but by doing so your installation time increases considerably, or if you don’t want to install updates and third party software during the installation then untick both these options and click “Continue” + + + +### Step 5) Choose Zorin OS 15 Installation Method + +If you are new to Linux and want fresh installation and don’t want to customize partitions, then better choose option “ **Erase disk and install Zorin OS** ” + +If you want to create customize partitions for Zorin OS then choose “ **Something else** “, In this tutorial I will demonstrate how to create customize partition scheme for Zorin OS 15 installation, + +So, choose “ **Something else** ” option and then click on Continue + + + + + +As we can see we have around 42 GB disk available for Zorin OS, We will be creating following partitions, + + * /boot = 2 GB (ext4 file system) + * /home = 20 GB (ext4 file system) + * / = 10 GB (ext4 file system) + * /var = 7 GB (ext4 file system) + * Swap = 2 GB (ext4 file system) + + + +To start creating partitions, first click on “ **New Partition Table** ” and it will show it is going to create empty partition table, click on continue + + + +In the next screen we will see that we have now 42 GB free space on disk (/dev/sda), so let’s create our first partition as /boot, + +Select the free space, then click on + symbol and then specify the partition size as 2048 MB, file system type as ext4 and mount point as /boot, + + + +Click on OK + +Now create our next partition /home of size 20 GB (20480 MB), + + + +Similarly create our next two partition / and /var of size 10 and 7 GB respectively, + + + + + +Let’s create our last partition as swap of size 2 GB + + + +Click on OK + +Choose “ **Install Now** ” option in next window, + + + +In next window, choose “Continue” to write changes to disk and to proceed with installation + + + +### Step 6) Choose Your Preferred Location + +In the next screen, you will be asked to choose your location and click “Continue” + + + +### Step 7) Provide User Credentials + +In the next screen, you’ll be asked to enter the user credentials including your name, computer name, + +Username and password. Once you are done, click “Continue” to proceed with the installation process. + + + +### Step 8) Installing Zorin OS 15 + +Once you click continue, you can see that the Zorin OS 15 starts installing and it may take some time to complete the installation process. + + + +### Step 9) Restart your system after Successful Installation + +Once the installation process is completed, it will ask to restart your computer. Hit “ **Restart Now** ” + + + +### Step 10) Login to Zorin OS 15 + +Once the system restarts, you will be asked to login into the system using the login credentials provided earlier. + +Note: Don’t forget to change the boot medium from bios so that system boots up with disk. + + + +### Step 11) Zorin OS 15 Welcome Screen + +Once your login is successful, you can see the Zorin OS 15 welcome screen. Now you can start exploring all the incredible features of Zorin OS 15. + + + +That’s all from this tutorial, please do share feedback and comments. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/zorin-os-15-installation-guide-screenshots/ + +作者:[Pradeep Kumar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lujun9972 +[1]: https://zorinos.com/download/ From f039f8cef34f4b49acc2a81f5c9a77686a45decd Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 12:21:47 +0800 Subject: [PATCH 1040/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190609=20How?= =?UTF-8?q?=20to=20set=20ulimit=20and=20file=20descriptors=20limit=20on=20?= =?UTF-8?q?Linux=20Servers=20sources/tech/20190609=20How=20to=20set=20ulim?= =?UTF-8?q?it=20and=20file=20descriptors=20limit=20on=20Linux=20Servers.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...file descriptors limit on Linux Servers.md | 227 ++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 sources/tech/20190609 How to set ulimit and file descriptors limit on Linux Servers.md diff --git a/sources/tech/20190609 How to set ulimit and file descriptors limit on Linux Servers.md b/sources/tech/20190609 How to set ulimit and file descriptors limit on Linux Servers.md new file mode 100644 index 0000000000..1b732b566d --- /dev/null +++ b/sources/tech/20190609 How to set ulimit and file descriptors limit on Linux Servers.md @@ -0,0 +1,227 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set ulimit and file descriptors limit on Linux Servers) +[#]: via: (https://www.linuxtechi.com/set-ulimit-file-descriptors-limit-linux-servers/) +[#]: author: (Shashidhar Soppin https://www.linuxtechi.com/author/shashidhar/) + +How to set ulimit and file descriptors limit on Linux Servers +====== + +**Introduction: ** Challenges like number of open files in any of the production environment has become common now a day. Since many applications which are Java based and Apache based, are getting installed and configured, which may lead to too many open files, file descriptors etc. If this exceeds the default limit that is set, then one may face access control problems and file opening challenges. Many production environments come to standstill kind of situations because of this. + + + +Luckily, we have “ **ulimit** ” command in any of the Linux based server, by which one can see/set/get number of files open status/configuration details. This command is equipped with many options and with this combination one can set number of open files. Following are step-by-step commands with examples explained in detail. + +### To see what is the present open file limit in any Linux System + +To get open file limit on any Linux server, execute the following command, + +``` +[root@linuxtechi ~]# cat /proc/sys/fs/file-max +146013 +``` + +The above number shows that user can open ‘146013’ file per user login session. + +``` +[root@linuxtechi ~]# cat /proc/sys/fs/file-max +149219 +[root@linuxtechi ~]# cat /proc/sys/fs/file-max +73906 +``` + +This clearly indicates that individual Linux operating systems have different number of open files. This is based on dependencies and applications which are running in respective systems. + +### ulimit command : + +As the name suggests, ulimit (user limit) is used to display and set resources limit for logged in user.When we run ulimit command with -a option then it will print all resources’ limit for the logged in user. Now let’s run “ **ulimit -a** ” on Ubuntu / Debian and CentOS systems, + +**Ubuntu / Debian System** , + +``` +root@linuxtechi ~}$ ulimit -a +core file size (blocks, -c) 0 +data seg size (kbytes, -d) unlimited +scheduling priority (-e) 0 +file size (blocks, -f) unlimited +pending signals (-i) 5731 +max locked memory (kbytes, -l) 64 +max memory size (kbytes, -m) unlimited +open files (-n) 1024 +pipe size (512 bytes, -p) 8 +POSIX message queues (bytes, -q) 819200 +real-time priority (-r) 0 +stack size (kbytes, -s) 8192 +cpu time (seconds, -t) unlimited +max user processes (-u) 5731 +virtual memory (kbytes, -v) unlimited +file locks (-x) unlimited +``` + +**CentOS System** + +``` +root@linuxtechi ~}$ ulimit -a +core file size (blocks, -c) 0 +data seg size (kbytes, -d) unlimited +scheduling priority (-e) 0 +file size (blocks, -f) unlimited +pending signals (-i) 5901 +max locked memory (kbytes, -l) 64 +max memory size (kbytes, -m) unlimited +open files (-n) 1024 +pipe size (512 bytes, -p) 8 +POSIX message queues (bytes, -q) 819200 +real-time priority (-r) 0 +stack size (kbytes, -s) 8192 +cpu time (seconds, -t) unlimited +max user processes (-u) 5901 +virtual memory (kbytes, -v) unlimited +file locks (-x) unlimited +``` + +As we can be seen here different OS have different limits set. All these limits can be configured/changed using “ulimit” command. + +To display the individual resource limit then pass the individual parameter in ulimit command, some of parameters are listed below: + + * ulimit -n –> It will display number of open files limit + * ulimit -c –> It display the size of core file + * umilit -u –> It will display the maximum user process limit for the logged in user. + * ulimit -f –> It will display the maximum file size that the user can have. + * umilit -m –> It will display the maximum memory size for logged in user. + * ulimit -v –> It will display the maximum memory size limit + + + +Use below commands check hard and soft limits for number of open file for the logged in user + +``` +root@linuxtechi ~}$ ulimit -Hn +1048576 +root@linuxtechi ~}$ ulimit -Sn +1024 +``` + +### How to fix the problem when limit on number of Maximum Files was reached ? + +Let’s assume our Linux server has reached the limit of maximum number of open files and want to extend that limit system wide, for example we want to set 100000 as limit of number of open files. + +Use sysctl command to pass fs.file-max parameter to kernel on the fly, execute beneath command as root user, + +``` +root@linuxtechi~]# sysctl -w fs.file-max=100000 +fs.file-max = 100000 +``` + +Above changes will be active until the next reboot, so to make these changes persistent across the reboot, edit the file **/etc/sysctl.conf** and add same parameter, + +``` +root@linuxtechi~]# vi /etc/sysctl.conf +fs.file-max = 100000 +``` + +save and exit file, + +Run the beneath command to make above changes into effect immediately without logout and reboot. + +``` +root@linuxtechi~]# sysctl -p +``` + +Now verify whether new changes are in effect or not. + +``` +root@linuxtechi~]# cat /proc/sys/fs/file-max +100000 +``` + +Use below command to find out how many file descriptors are currently being utilized: + +``` +[root@linuxtechi ~]# more /proc/sys/fs/file-nr +1216 0 100000 +``` + +Note:- Command “ **sysctl -p** ” is used to commit the changes without reboot and logout. + +### Set User level resource limit via limit.conf file + +“ **/etc/sysctl.conf** ” file is used to set resource limit system wide but if you want to set resource limit for specific user like Oracle, MariaDB and Apache then this can be achieved via “ **/etc/security/limits.conf** ” file. + +Sample Limit.conf is shown below, + +``` +root@linuxtechi~]# cat /proc/sys/fs/file-max +``` + +![Limits-conf-linux-part1][1] + +![Limits-conf-linux-part2][2] + +Let’s assume we want to set hard and soft limit on number of open files for linuxtechi user and for oracle user set hard and soft limit on number of open process, edit the file “/etc/security/limits.conf” and add the following lines + +``` +# hard limit for max opened files for linuxtechi user +linuxtechi hard nofile 4096 +# soft limit for max opened files for linuxtechi user +linuxtechi soft nofile 1024 + +# hard limit for max number of process for oracle user +oracle hard nproc 8096 +# soft limit for max number of process for oracle user +oracle soft nproc 4096 +``` + +Save & exit the file. + +**Note:** In case you want to put resource limit on a group instead of users, then it can also be possible via limit.conf file, in place of user name , type **@ ** and rest of the items will be same, example is shown below, + +``` +# hard limit for max opened files for sysadmin group +@sysadmin hard nofile 4096 +# soft limit for max opened files for sysadmin group +@sysadmin soft nofile 1024 +``` + +Verify whether new changes are in effect or not, + +``` +~]# su - linuxtechi +~]$ ulimit -n -H +4096 +~]$ ulimit -n -S +1024 + +~]# su - oracle +~]$ ulimit -H -u +8096 +~]$ ulimit -S -u +4096 +``` + +Note: Other majorly used command is “[ **lsof**][3]” which is used for finding out “how many files are opened currently”. This command is very helpful for admins. + +**Conclusion:** + +As mentioned in the introduction section “ulimit” command is very powerful and helps one to configure and make sure application installations are smoother without any bottlenecks. This command helps in fixing many of the number of file limitations in Linux based servers. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/set-ulimit-file-descriptors-limit-linux-servers/ + +作者:[Shashidhar Soppin][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.linuxtechi.com/author/shashidhar/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Limits-conf-linux-part1-1024x677.jpg +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Limits-conf-linux-part2-1024x443.jpg +[3]: https://www.linuxtechi.com/lsof-command-examples-linux-geeks/ From bd1bad075805e6549b4ff0b495f74d394685ea98 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 12:21:58 +0800 Subject: [PATCH 1041/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190602=20How?= =?UTF-8?q?=20to=20Install=20LEMP=20(Linux,=20Nginx,=20MariaDB,=20PHP)=20o?= =?UTF-8?q?n=20Fedora=2030=20Server=20sources/tech/20190602=20How=20to=20I?= =?UTF-8?q?nstall=20LEMP=20(Linux,=20Nginx,=20MariaDB,=20PHP)=20on=20Fedor?= =?UTF-8?q?a=2030=20Server.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ginx, MariaDB, PHP) on Fedora 30 Server.md | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 sources/tech/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md diff --git a/sources/tech/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md b/sources/tech/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md new file mode 100644 index 0000000000..e3a533b3b2 --- /dev/null +++ b/sources/tech/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md @@ -0,0 +1,200 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server) +[#]: via: (https://www.linuxtechi.com/install-lemp-stack-fedora-30-server/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server +====== + +In this article, we’ll be looking at how to install **LEMP** stack on Fedora 30 Server. LEMP Stands for: + + * L -> Linux + * E -> Nginx + * M -> Maria DB + * P -> PHP + + + +I am assuming **[Fedora 30][1]** is already installed on your system. + +![LEMP-Stack-Fedora30][2] + +LEMP is a collection of powerful software setup that is installed on a Linux server to help in developing popular development platforms to build websites, LEMP is a variation of LAMP wherein instead of **Apache** , **EngineX (Nginx)** is used as well as **MariaDB** used in place of **MySQL**. This how-to guide is a collection of separate guides to install Nginx, Maria DB and PHP. + +### Install Nginx, PHP 7.3 and PHP-FPM on Fedora 30 Server + +Let’s take a look at how to install Nginx and PHP along with PHP FPM on Fedora 30 Server. + +### Step 1) Switch to root user + +First step in installing Nginx in your system is to switch to root user. Use the following command : + +``` +root@linuxtechi ~]$ sudo -i +[sudo] password for pkumar: +[root@linuxtechi ~]# +``` + +### Step 2) Install Nginx, PHP 7.3 and PHP FPM using dnf command + +Install Nginx using the following dnf command: + +``` +[root@linuxtechi ~]# dnf install nginx php php-fpm php-common -y +``` + +### Step 3) Install Additional PHP modules + +The default installation of PHP only comes with the basic and the most needed modules installed. If you need additional modules like GD, XML support for PHP, command line interface Zend OPCache features etc, you can always choose your packages and install everything in one go. See the sample command below: + +``` +[root@linuxtechi ~]# sudo dnf install php-opcache php-pecl-apcu php-cli php-pear php-pdo php-pecl-mongodb php-pecl-redis php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml -y +``` + +### Step 4) Start & Enable Nginx and PHP-fpm Service + +Start and enable Nginx service using the following command + +``` +[root@linuxtechi ~]# systemctl start nginx && systemctl enable nginx +Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service. +[root@linuxtechi ~]# +``` + +Use the following command to start and enable PHP-FPM service + +``` +[root@linuxtechi ~]# systemctl start php-fpm && systemctl enable php-fpm +Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service. +[root@linuxtechi ~]# +``` + +**Verify Nginx (Web Server) and PHP installation,** + +**Note:** In case OS firewall is enabled and running on your Fedora 30 system, then allow 80 and 443 ports using beneath commands, + +``` +[root@linuxtechi ~]# firewall-cmd --permanent --add-service=http +success +[root@linuxtechi ~]# +[root@linuxtechi ~]# firewall-cmd --permanent --add-service=https +success +[root@linuxtechi ~]# firewall-cmd --reload +success +[root@linuxtechi ~]# +``` + +Open the web browser, type the following URL: http:// + +[![Test-Page-HTTP-Server-Fedora-30][3]][4] + +Above screen confirms that NGINX is installed successfully. + +Now let’s verify PHP installation, create a test php page(info.php) using the beneath command, + +``` +[root@linuxtechi ~]# echo "" > /usr/share/nginx/html/info.php +[root@linuxtechi ~]# +``` + +Type the following URL in the web browser, + +http:///info.php + +[![Php-info-page-fedora30][5]][6] + +Above page confirms that PHP 7.3.5 has been installed successfully. Now let’s install MariaDB database server. + +### Install MariaDB on Fedora 30 + +MariaDB is a great replacement for MySQL DB as it is works much similar to MySQL and also compatible with MySQL steps too. Let’s look at the steps to install MariaDB on Fedora 30 Server + +### Step 1) Switch to Root User + +First step in installing MariaDB in your system is to switch to root user or you can use a local user who has root privilege. Use the following command below: + +``` +[root@linuxtechi ~]# sudo -i +[root@linuxtechi ~]# +``` + +### Step 2) Install latest version of MariaDB (10.3) using dnf command + +Use the following command to install MariaDB on Fedora 30 Server + +``` +[root@linuxtechi ~]# dnf install mariadb-server -y +``` + +### Step 3) Start and enable MariaDB Service + +Once the mariadb is installed successfully in step 2), next step is to start the MariaDB service. Use the following command: + +``` +[root@linuxtechi ~]# systemctl start mariadb.service ; systemctl enable mariadb.service +``` + +### Step 4) Secure MariaDB Installation + +When we install MariaDB server, so by default there is no root password, also anonymous users are created in database. So, to secure MariaDB installation, run the beneath “mysql_secure_installation” command + +``` +[root@linuxtechi ~]# mysql_secure_installation +``` + +Next you will be prompted with some question, just answer the questions as shown below: + +![Secure-MariaDB-Installation-Part1][7] + +![Secure-MariaDB-Installation-Part2][8] + +### Step 5) Test MariaDB Installation + +Once you have installed, you can always test if MariaDB is successfully installed on the server. Use the following command: + +``` +[root@linuxtechi ~]# mysql -u root -p +Enter password: +``` + +Next you will be prompted for a password. Enter the password same password that you have set during MariaDB secure installation, then you can see the MariaDB welcome screen. + +``` +Welcome to the MariaDB monitor. Commands end with ; or \g. +Your MariaDB connection id is 17 +Server version: 10.3.12-MariaDB MariaDB Server + +Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. + +Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + +MariaDB [(none)]> +``` + +And finally, we’ve completed everything to install LEMP (Linux, Nginx, MariaDB and PHP) on your server successfully. Please post all your comments and suggestions in the feedback section below and we’ll respond back at the earliest. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/install-lemp-stack-fedora-30-server/ + +作者:[Pradeep Kumar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/fedora-30-workstation-installation-guide/ +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/06/LEMP-Stack-Fedora30.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Test-Page-HTTP-Server-Fedora-30-1024x732.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Test-Page-HTTP-Server-Fedora-30.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Php-info-page-fedora30-1024x732.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Php-info-page-fedora30.jpg +[7]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Secure-MariaDB-Installation-Part1.jpg +[8]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Secure-MariaDB-Installation-Part2.jpg From 4c3ede985d2da95f349fccadcebebeb0c90b8d8b Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 12:22:14 +0800 Subject: [PATCH 1042/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190522=20How?= =?UTF-8?q?=20to=20Download=20and=20Use=20Ansible=20Galaxy=20Roles=20in=20?= =?UTF-8?q?Ansible=20Playbook=20sources/tech/20190522=20How=20to=20Downloa?= =?UTF-8?q?d=20and=20Use=20Ansible=20Galaxy=20Roles=20in=20Ansible=20Playb?= =?UTF-8?q?ook.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nsible Galaxy Roles in Ansible Playbook.md | 193 ++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 sources/tech/20190522 How to Download and Use Ansible Galaxy Roles in Ansible Playbook.md diff --git a/sources/tech/20190522 How to Download and Use Ansible Galaxy Roles in Ansible Playbook.md b/sources/tech/20190522 How to Download and Use Ansible Galaxy Roles in Ansible Playbook.md new file mode 100644 index 0000000000..3bb9e39184 --- /dev/null +++ b/sources/tech/20190522 How to Download and Use Ansible Galaxy Roles in Ansible Playbook.md @@ -0,0 +1,193 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Download and Use Ansible Galaxy Roles in Ansible Playbook) +[#]: via: (https://www.linuxtechi.com/use-ansible-galaxy-roles-ansible-playbook/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +How to Download and Use Ansible Galaxy Roles in Ansible Playbook +====== + +**Ansible** is tool of choice these days if you must manage multiple devices, be it Linux, Windows, Mac, Network Devices, VMware and lot more. What makes Ansible popular is its agent less feature and granular control. If you have worked with python or have experience with **yaml** , you will feel at home with Ansible. To see how you can install [Ansible][1] click here. + + + +Ansible core modules will let you manage almost anything should you wish to write playbooks, however often there is someone who has already written a role for a problem you are trying to solve. Let’s take an example, you wish to manage NTP clients on the Linux machines, you have 2 choices either write a role which can be applied to the nodes or use **ansible-galaxy** to download an existing role someone has already written/tested for you. Ansible galaxy has roles for almost all the domains and these caters different problems. You can visit to get an idea on domains and popular roles it has. Each role published on galaxy repository is thoroughly tested and has been rated by the users, so you get an idea on how other people who have used it liked it. + +To keep moving with the NTP idea, here is how you can search and install an NTP role from galaxy. + +Firstly, lets run ansible-galaxy with the help flag to check what options does it give us + +``` +[root@linuxtechi ~]# ansible-galaxy --help +``` + +![ansible-galaxy-help][2] + +As you can see from the output above there are some interesting options been shown, since we are looking for a role to manage ntp clients lets try the search option to see how good it is finding what we are looking for. + +``` +[root@linuxtechi ~]# ansible-galaxy search ntp +``` + +Here is the truncated output of the command above. + +![ansible-galaxy-search][3] + +It found 341 matches based on our search, as you can see from the output above many of these roles are not even related to NTP which means our search needs some refinement however, it has managed to pull some NTP roles, lets dig deeper to see what these roles are. But before that let me tell you the naming convention being followed here. The name of a role is always preceded by the author name so that it is easy to segregate roles with the same name. So, if you have written an NTP role and have published it to galaxy repo, it does not get mixed up with someone else repo with the same name. + +With that out of the way, lets continue with our job of installing a NTP role for our Linux machines. Let’s try **bennojoy.ntp** for this example, but before using this we need to figure out couple of things, is this role compatible with the version of ansible I am running. Also, what is the license status of this role. To figure out these, let’s run below ansible-galaxy command, + +``` +[root@linuxtechi ~]# ansible-galaxy info bennojoy.ntp +``` + +![ansible-galaxy-info][4] + +ok so this says the minimum version is 1.4 and the license is BSD, lets download it + +``` +[root@linuxtechi ~]# ansible-galaxy install bennojoy.ntp +- downloading role 'ntp', owned by bennojoy +- downloading role from https://github.com/bennojoy/ntp/archive/master.tar.gz +- extracting bennojoy.ntp to /etc/ansible/roles/bennojoy.ntp +- bennojoy.ntp (master) was installed successfully +[root@linuxtechi ~]# ansible-galaxy list +- bennojoy.ntp, master +[root@linuxtechi ~]# +``` + +Let’s find the newly installed role. + +``` +[root@linuxtechi ~]# cd /etc/ansible/roles/bennojoy.ntp/ +[root@linuxtechi bennojoy.ntp]# ls -l +total 4 +drwxr-xr-x. 2 root root 21 May 21 22:38 defaults +drwxr-xr-x. 2 root root 21 May 21 22:38 handlers +drwxr-xr-x. 2 root root 48 May 21 22:38 meta +-rw-rw-r--. 1 root root 1328 Apr 20 2016 README.md +drwxr-xr-x. 2 root root 21 May 21 22:38 tasks +drwxr-xr-x. 2 root root 24 May 21 22:38 templates +drwxr-xr-x. 2 root root 55 May 21 22:38 vars +[root@linuxtechi bennojoy.ntp]# +``` + +I am going to run this newly downloaded role on my Elasticsearch CentOS node. Here is my hosts file + +``` +[root@linuxtechi ~]# cat hosts +[CentOS] +elastic7-01 ansible_host=192.168.1.15 ansibel_port=22 ansible_user=linuxtechi +[root@linuxtechi ~]# +``` + +Let’s try to ping the node using below ansible ping module, + +``` +[root@linuxtechi ~]# ansible -m ping -i hosts elastic7-01 +elastic7-01 | SUCCESS => { + "changed": false, + "ping": "pong" +} +[root@linuxtechi ~]# +``` + +Here is what the current ntp.conf looks like on elastic node. + +``` +[root@linuxtechi ~]# head -30 /etc/ntp.conf +``` + +![Current-ntp-conf][5] + +Since I am in India, lets add server **in.pool.ntp.org** to ntp.conf. I would have to edit the variables in default directory of the role. + +``` +[root@linuxtechi ~]# vi /etc/ansible/roles/bennojoy.ntp/defaults/main.yml +``` + +Change NTP server address in “ntp_server” parameter, after updating it should look like below. + +![Update-ansible-ntp-role][6] + +The last thing now is to create my playbook which would call this role. + +``` +[root@linuxtechi ~]# vi ntpsite.yaml +--- + - name: Configure NTP on CentOS/RHEL/Debian System + become: true + hosts: all + roles: + - {role: bennojoy.ntp} +``` + +save and exit the file + +We are ready to run this role now, use below command to run ntp playbook, + +``` +[root@linuxtechi ~]# ansible-playbook -i hosts ntpsite.yaml +``` + +Output of above ntp ansible playbook should be something like below, + +![ansible-playbook-output][7] + +Let’s check updated file now. go to elastic node and view the contents of ntp.conf file + +``` +[root@linuxtechi ~]# cat /etc/ntp.conf +#Ansible managed + +driftfile /var/lib/ntp/drift +server in.pool.ntp.org + +restrict -4 default kod notrap nomodify nopeer noquery +restrict -6 default kod notrap nomodify nopeer noquery +restrict 127.0.0.1 +[root@linuxtechi ~]# +``` + +Just in case you do not find a role fulfilling your requirement ansible-galaxy can help you create a directory structure for your custom roles. This helps your playbooks along with the variables, handlers, templates etc assembled in a standardized file structure. Let’s create our own role, its always a good practice to let ansible-galaxy create the structure for you. + +``` +[root@linuxtechi ~]# ansible-galaxy init pk.backup +- pk.backup was created successfully +[root@linuxtechi ~]# +``` + +Verify the structure of your role using the tree command, + +![createing-roles-ansible-galaxy][8] + +Let me quickly explain what each of these directories and files are for, each of these serves a purpose. + +The very first one is the **defaults** directory which contains the files containing variables with takes the lowest precedence, if the same variables are assigned in var directory it will be take precedence over default. The **handlers** directory hosts the handlers. The **file** and **templates** keep any files your role may need to copy and **jinja templates** to be used in playbooks respectively. The **tasks** directory is where your playbooks containing the tasks are kept. The var directory consists of all the files that hosts the variables used in role. The test directory consists of a sample inventory and test playbooks which can be used to test the role. The **meta directory** consists of any dependencies on other roles along with the authorship information. + +Finally, **README.md** file simply consists of some general information like description and minimum version of ansible this role is compatible with. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/use-ansible-galaxy-roles-ansible-playbook/ + +作者:[Pradeep Kumar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/install-and-use-ansible-in-centos-7/ +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/05/ansible-galaxy-help-1024x294.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/05/ansible-galaxy-search-1024x552.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/05/ansible-galaxy-info-1024x557.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Current-ntp-conf.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Update-ansible-ntp-role.jpg +[7]: https://www.linuxtechi.com/wp-content/uploads/2019/05/ansible-playbook-output-1024x376.jpg +[8]: https://www.linuxtechi.com/wp-content/uploads/2019/05/createing-roles-ansible-galaxy.jpg From 9e68157669c3cb10ccae4786187da2dc17a0bd83 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 12:22:26 +0800 Subject: [PATCH 1043/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190516=20Moni?= =?UTF-8?q?tor=20and=20Manage=20Docker=20Containers=20with=20Portainer.io?= =?UTF-8?q?=20(GUI=20tool)=20=E2=80=93=20Part-2=20sources/tech/20190516=20?= =?UTF-8?q?Monitor=20and=20Manage=20Docker=20Containers=20with=20Portainer?= =?UTF-8?q?.io=20(GUI=20tool)=20-=20Part-2.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s with Portainer.io (GUI tool) - Part-2.md | 244 ++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 sources/tech/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md diff --git a/sources/tech/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md b/sources/tech/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md new file mode 100644 index 0000000000..58a9459a41 --- /dev/null +++ b/sources/tech/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md @@ -0,0 +1,244 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Monitor and Manage Docker Containers with Portainer.io (GUI tool) – Part-2) +[#]: via: (https://www.linuxtechi.com/monitor-manage-docker-containers-portainer-io-part-2/) +[#]: author: (Shashidhar Soppin https://www.linuxtechi.com/author/shashidhar/) + +Monitor and Manage Docker Containers with Portainer.io (GUI tool) – Part-2 +====== + +As a continuation of Part-1, this part-2 has remaining features of Portainer covered and as explained below. + +### Monitoring docker container images + +``` +root@linuxtechi ~}$ docker ps -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +9ab9aa72f015 ubuntu "/bin/bash" 14 seconds ago Exited (0) 12 seconds ago suspicious_shannon +305369d3b2bb centos "/bin/bash" 24 seconds ago Exited (0) 22 seconds ago admiring_mestorf +9a669f3dc4f6 portainer/portainer "/portainer" 7 minutes ago Up 7 minutes 0.0.0.0:9000->9000/tcp trusting_keller +``` + +Including the portainer(which is a docker container image), all the exited and present running docker images are displayed. Below screenshot from Portainer GUI displays the same. + +[![Docker_status][1]][2] + +### Monitoring events + +Click on the “Events” option from the portainer webpage as shown below. + +Various events that are generated and created based on docker-container activity, are captured and displayed in this page + +[![Container-Events-Poratiner-GUI][3]][4] + +Now to check and validate how the “ **Events** ” section works. Create a new docker-container image redis as explained below, check the docker ps –a status at docker command-line. + +``` +root@linuxtechi ~}$ docker ps -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +cdbfbef59c31 redis "docker-entrypoint.s…" About a minute ago Up About a minute 6379/tcp angry_varahamihira +9ab9aa72f015 ubuntu "/bin/bash" 10 minutes ago Exited (0) 10 minutes ago suspicious_shannon +305369d3b2bb centos "/bin/bash" 11 minutes ago Exited (0) 11 minutes ago admiring_mestorf +9a669f3dc4f6 portainer/portainer "/portainer" 17 minutes ago Up 17 minutes 0.0.0.0:9000->9000/tcp trusting_keller +``` + +Click the “Event List” on the top to refresh the events list, + +[![events_updated][5]][6] + +Now the event’s page also updated with this change, + +### Host status + +Below is the screenshot of the portainer displaying the host status. This is a simple window showing-up. This shows the basic info like “CPU”, “hostname”, “OS info” etc of the host linux machine. Instead of logging- into the host command-line, this page provides very useful info on for quick glance. + +[![Host-names-Portainer][7]][8] + +### Dashboard in Portainer + +Until now we have seen various features of portainer based under “ **Local”** section. Now jump on to the “ **Dashboard** ” section of the selected Docker Container image. + +When “ **EndPoint** ” option is clicked in the GUI of Portainer, the following window appears, + +[![End_Point_Settings][9]][10] + +This Dashboard has many statuses and options, for a host container image. + +**1) Stacks:** Clicking on this option, provides status of any stacks if any. Since there are no stacks, this displays zero. + +**2) Images:** Clicking on this option provides host of container images that are available. This option will display all the live and exited container images + +[![Docker-Container-Images-Portainer][11]][12] + +For example create one more “ **Nginx”** container and refresh this list to see the updates. + +``` +root@linuxtechi ~}$ sudo docker run nginx +Unable to find image 'nginx:latest' locally +latest: Pulling from library/nginx +27833a3ba0a5: Pull complete +ea005e36e544: Pull complete +d172c7f0578d: Pull complete +Digest: sha256:e71b1bf4281f25533cf15e6e5f9be4dac74d2328152edf7ecde23abc54e16c1c +Status: Downloaded newer image for nginx:latest +``` + +The following is the image after refresh, + +[![Nginx_Image_creation][13]][14] + +Once the Nginx image is stopped/killed and docker container image will be moved to unused status. + +**Note** :-One can see all the image details here are very clear with memory usage, creation date and time. As compared to command-line option, maintaining and monitoring containers from here it will be very easy. + +**3) Networks:** this option is used for network operations. Like assigning IP address, creating subnets, providing IP address range, access control (admin and normal user) . The following window provides the details of various options possible. Based on your need these options can be explored further. + +[![Conatiner-Network-Portainer][15]][16] + +Once all the various networking parameters are entered, “ **create network** ” button is clicked for creating the network. + +**4) Container:** (click on container) This option will provide the container status. This list will provide details on live and not running container statuses. This output is similar to docker ps command option. + +[![Containers-Status-Portainer][17]][18] + +From this window only the containers can be stopped and started as need arises by checking the check box and selecting the above buttons. One example is provided as below, + +Example, Both “CentOS” and “Ubuntu” containers which are in stopped state, they are started now by selecting check boxes and hitting “Start” button. + +[![start_containers1][19]][20] + +[![start_containers2][21]][22] + +**Note:** Since both are Linux container images, they will not be started. Portainer tries to start and stops later. Try “Nginx” instead and you can see it coming to “running”status. + +[![start_containers3][23]][24] + +**5) Volume:** Described in Part-I of Portainer Article + +### Setting option in Portainer + +Until now we have seen various features of portainer based under “ **Local”** section. Now jump on to the “ **Setting”** section of the selected Docker Container image. + +When “Settings” option is clicked in the GUI of Portainer, the following further configuration options are available, + +**1) Extensions** : This is a simple Portainer CE subscription process. The details and uses can be seen from the attached window. This is mainly used for maintaining the license and subscription of the respective version. + +[![Extensions][25]][26] + +**2) Users:** This option is used for adding “users” with or without administrative privileges. Following example provides the same. + +Enter the selected user name “shashi” in this case and your choice of password and hit “ **Create User** ” button below. + +[![create_user_portainer][27]][28] + +[![create_user2_portainer][29]][30] + +[![Internal-user-Portainer][31]][32] + +Similarly the just now created user “shashi” can be removed by selecting the check box and hitting remove button. + +[![user_remove_portainer][33]][34] + +**3) Endpoints:** this option is used for Endpoint management. Endpoints can be added and removed as shown in the attached windows. + +[![Endpoint-Portainer-GUI][35]][36] + +The new endpoint “shashi” is created using the various default parameters as shown below, + +[![Endpoint2-Portainer-GUI][37]][38] + +Similarly this endpoint can be removed by clicking the check box and hitting remove button. + +**4) Registries:** this option is used for registry management. As docker hub has registry of various images, this feature can be used for similar purposes. + +[![Registry-Portainer-GUI][39]][40] + +With the default options the “shashi-registry” can be created. + +[![Registry2-Portainer-GUI][41]][42] + +Similarly this can be removed if not required. + +**5) Settings:** This option is used for the following various options, + + * Setting-up snapshot interval + * For using custom logo + * To create external templates + * Security features like- Disable and enable bin mounts for non-admins, Disable/enable privileges for non-admins, Enabling host management features + + + +Following screenshot shows some options enabled and disabled for demonstration purposes. Once all done hit on “Save Settings” button to save all these options. + +[![Portainer-GUI-Settings][43]][44] + +Now one more option pops-up on “Authentication settings” for LDAP, Internal or OAuth extension as shown below” + +[![Authentication-Portainer-GUI-Settings][45]][46] + +Based on what level of security features we want for our environment, respective option is chosen. + +That’s all from this article, I hope these Portainer GUI articles helps you to manage and monitor containers more efficiently. Please do share your feedback and comments. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/monitor-manage-docker-containers-portainer-io-part-2/ + +作者:[Shashidhar Soppin][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.linuxtechi.com/author/shashidhar/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Docker_status-1024x423.jpg +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Docker_status.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Events-1024x404.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Events.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/05/events_updated-1024x414.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/05/events_updated.jpg +[7]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Host_names-1024x408.jpg +[8]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Host_names.jpg +[9]: https://www.linuxtechi.com/wp-content/uploads/2019/05/End_Point_Settings-1024x471.jpg +[10]: https://www.linuxtechi.com/wp-content/uploads/2019/05/End_Point_Settings.jpg +[11]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Images-1024x398.jpg +[12]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Images.jpg +[13]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Nginx_Image_creation-1024x439.jpg +[14]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Nginx_Image_creation.jpg +[15]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Network-1024x463.jpg +[16]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Network.jpg +[17]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Containers-1024x364.jpg +[18]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Containers.jpg +[19]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers1-1024x432.jpg +[20]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers1.jpg +[21]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers2-1024x307.jpg +[22]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers2.jpg +[23]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers3-1024x435.jpg +[24]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers3.jpg +[25]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Extensions-1024x421.jpg +[26]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Extensions.jpg +[27]: https://www.linuxtechi.com/wp-content/uploads/2019/05/create_user-1024x350.jpg +[28]: https://www.linuxtechi.com/wp-content/uploads/2019/05/create_user.jpg +[29]: https://www.linuxtechi.com/wp-content/uploads/2019/05/create_user2-1024x372.jpg +[30]: https://www.linuxtechi.com/wp-content/uploads/2019/05/create_user2.jpg +[31]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Internal-user-Portainer-1024x257.jpg +[32]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Internal-user-Portainer.jpg +[33]: https://www.linuxtechi.com/wp-content/uploads/2019/05/user_remove-1024x318.jpg +[34]: https://www.linuxtechi.com/wp-content/uploads/2019/05/user_remove.jpg +[35]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Endpoint-1024x349.jpg +[36]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Endpoint.jpg +[37]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Endpoint2-1024x379.jpg +[38]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Endpoint2.jpg +[39]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Registry-1024x420.jpg +[40]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Registry.jpg +[41]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Registry2-1024x409.jpg +[42]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Registry2.jpg +[43]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-GUI-Settings-1024x418.jpg +[44]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-GUI-Settings.jpg +[45]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Authentication-Portainer-GUI-Settings-1024x344.jpg +[46]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Authentication-Portainer-GUI-Settings.jpg From 890a24c9bf3434a9cbe735599249cb7532dbfa8c Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 12:22:44 +0800 Subject: [PATCH 1044/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190512=20How?= =?UTF-8?q?=20to=20Setup=20Local=20Yum/DNF=20Repository=20on=20RHEL=208=20?= =?UTF-8?q?Server=20Using=20DVD=20or=20ISO=20File=20sources/tech/20190512?= =?UTF-8?q?=20How=20to=20Setup=20Local=20Yum-DNF=20Repository=20on=20RHEL?= =?UTF-8?q?=208=20Server=20Using=20DVD=20or=20ISO=20File.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... on RHEL 8 Server Using DVD or ISO File.md | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sources/tech/20190512 How to Setup Local Yum-DNF Repository on RHEL 8 Server Using DVD or ISO File.md diff --git a/sources/tech/20190512 How to Setup Local Yum-DNF Repository on RHEL 8 Server Using DVD or ISO File.md b/sources/tech/20190512 How to Setup Local Yum-DNF Repository on RHEL 8 Server Using DVD or ISO File.md new file mode 100644 index 0000000000..c136a83deb --- /dev/null +++ b/sources/tech/20190512 How to Setup Local Yum-DNF Repository on RHEL 8 Server Using DVD or ISO File.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Setup Local Yum/DNF Repository on RHEL 8 Server Using DVD or ISO File) +[#]: via: (https://www.linuxtechi.com/setup-local-yum-dnf-repository-rhel-8/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +How to Setup Local Yum/DNF Repository on RHEL 8 Server Using DVD or ISO File +====== + +Recently Red Hat has released its most awaited operating system “ **RHEL 8** “, in case you have installed RHEL 8 Server on your system and wondering how to setup local yum or dnf repository using installation DVD or ISO file then refer below steps and procedure. + + + +In RHEL 8, we have two package repositories: + + * BaseOS + * Application Stream + + + +BaseOS repository have all underlying OS packages where as Application Stream repository have all application related packages, developer tools and databases etc. Using Application stream repository, we can have multiple of versions of same application and Database. + +### Step:1) Mount RHEL 8 ISO file / Installation DVD + +To mount RHEL 8 ISO file inside your RHEL 8 server use the beneath mount command, + +``` +[root@linuxtechi ~]# mount -o loop rhel-8.0-x86_64-dvd.iso /opt/ +``` + +**Note:** I am assuming you have already copied RHEL 8 ISO file inside your system, + +In case you have RHEL 8 installation DVD, then use below mount command to mount it, + +``` +[root@linuxtechi ~]# mount /dev/sr0 /opt +``` + +### Step:2) Copy media.repo file from mounted directory to /etc/yum.repos.d/ + +In our case RHEL 8 Installation DVD or ISO file is mounted under /opt folder, use cp command to copy media.repo file to /etc/yum.repos.d/ directory, + +``` +[root@linuxtechi ~]# cp -v /opt/media.repo /etc/yum.repos.d/rhel8.repo +'/opt/media.repo' -> '/etc/yum.repos.d/rhel8.repo' +[root@linuxtechi ~]# +``` + +Set “644” permission on “ **/etc/yum.repos.d/rhel8.repo** ” + +``` +[root@linuxtechi ~]# chmod 644 /etc/yum.repos.d/rhel8.repo +[root@linuxtechi ~]# +``` + +### Step:3) Add repository entries in “/etc/yum.repos.d/rhel8.repo” file + +By default, **rhel8.repo** file will have following content, + + + +Edit rhel8.repo file and add the following contents, + +``` +[root@linuxtechi ~]# vi /etc/yum.repos.d/rhel8.repo +[InstallMedia-BaseOS] +name=Red Hat Enterprise Linux 8 - BaseOS +metadata_expire=-1 +gpgcheck=1 +enabled=1 +baseurl=file:///opt/BaseOS/ +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release + +[InstallMedia-AppStream] +name=Red Hat Enterprise Linux 8 - AppStream +metadata_expire=-1 +gpgcheck=1 +enabled=1 +baseurl=file:///opt/AppStream/ +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +``` + +rhel8.repo should look like above once we add the content, In case you have mounted the Installation DVD or ISO on different folder then change the location and folder name in base url line for both repositories and rest of parameter leave as it is. + +### Step:4) Clean Yum / DNF and Subscription Manager Cache + +Use the following command to clear yum or dnf and subscription manager cache, + +``` +root@linuxtechi ~]# dnf clean all +[root@linuxtechi ~]# subscription-manager clean +All local data removed +[root@linuxtechi ~]# +``` + +### Step:5) Verify whether Yum / DNF is getting packages from Local Repo + +Use dnf or yum repolist command to verify whether these commands are getting packages from Local repositories or not. + +``` +[root@linuxtechi ~]# dnf repolist +Updating Subscription Management repositories. +Unable to read consumer identity +This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. +Last metadata expiration check: 1:32:44 ago on Sat 11 May 2019 08:48:24 AM BST. +repo id repo name status +InstallMedia-AppStream Red Hat Enterprise Linux 8 - AppStream 4,672 +InstallMedia-BaseOS Red Hat Enterprise Linux 8 - BaseOS 1,658 +[root@linuxtechi ~]# +``` + +**Note :** You can use either dnf or yum command, if you use yum command then its request is redirecting to DNF itself because in RHEL 8 yum is based on DNF command. + +If you have noticed the above command output carefully, we are getting warning message “ **This system is not registered to Red Hat Subscription Management**. **You can use subscription-manager to register”** , if you want to suppress or prevent this message while running dnf / yum command then edit the file “/etc/yum/pluginconf.d/subscription-manager.conf”, changed the parameter “enabled=1” to “enabled=0” + +``` +[root@linuxtechi ~]# vi /etc/yum/pluginconf.d/subscription-manager.conf +[main] +enabled=0 +``` + +save and exit the file. + +### Step:6) Installing packages using DNF / Yum + +Let’s assume we want to install nginx web server then run below dnf command, + +``` +[root@linuxtechi ~]# dnf install nginx +``` + +![][1] + +Similarly if you want to install **LEMP** stack on your RHEL 8 system use the following dnf command, + +``` +[root@linuxtechi ~]# dnf install nginx mariadb php -y +``` + +[![][2]][3] + +This confirms that we have successfully configured Local yum / dnf repository on our RHEL 8 server using Installation DVD or ISO file. + +In case these steps help you technically, please do share your feedback and comments. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/setup-local-yum-dnf-repository-rhel-8/ + +作者:[Pradeep Kumar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/wp-content/uploads/2019/05/dnf-install-nginx-rhel8-1024x376.jpg +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/05/LEMP-Stack-Install-RHEL8-1024x540.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/05/LEMP-Stack-Install-RHEL8.jpg From 0c4e96c20ea52a495b78cfc16caea15387039640 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 12:22:58 +0800 Subject: [PATCH 1045/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190509=20Red?= =?UTF-8?q?=20Hat=20Enterprise=20Linux=20(RHEL)=208=20Installation=20Steps?= =?UTF-8?q?=20with=20Screenshots=20sources/tech/20190509=20Red=20Hat=20Ent?= =?UTF-8?q?erprise=20Linux=20(RHEL)=208=20Installation=20Steps=20with=20Sc?= =?UTF-8?q?reenshots.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...) 8 Installation Steps with Screenshots.md | 256 ++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 sources/tech/20190509 Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots.md diff --git a/sources/tech/20190509 Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots.md b/sources/tech/20190509 Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots.md new file mode 100644 index 0000000000..0b2d9e55c6 --- /dev/null +++ b/sources/tech/20190509 Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots.md @@ -0,0 +1,256 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots) +[#]: via: (https://www.linuxtechi.com/rhel-8-installation-steps-screenshots/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots +====== + +Red Hat has released its most awaited OS **RHEL 8** on 7th May 2019. RHEL 8 is based on **Fedora 28** distribution and Linux **kernel version 4.18**. One of the important key features in RHEL 8 is that it has introduced “ **Application Streams** ” which allows developers tools, frameworks and languages to be updated frequently without impacting the core resources of base OS. In other words, application streams will help to segregate the users space packages from OS Kernel Space. + +Apart from this, there are many new features which are noticed in RHEL 8 like: + + * XFS File system supports copy-on-write of file extents + * Introduction of Stratis filesystem, Buildah, Podman, and Skopeo + * Yum utility is based on DNF + * Chrony replace NTP. + * Cockpit is the default Web Console tool for Server management. + * OpenSSL 1.1.1 & TLS 1.3 support + * PHP 7.2 + * iptables replaced by nftables + + + +### Minimum System Requirements for RHEL 8: + + * 4 GB RAM + * 20 GB unallocated disk space + * 64-bit x86 or ARM System + + + +**Note:** RHEL 8 supports the following architectures: + + * AMD or Intel x86 64-bit + * 64-bit ARM + * IBM Power Systems, Little Endian & IBM Z + + + +In this article we will demonstrate how to install RHEL 8 step by step with screenshots. + +### RHEL 8 Installation Steps with Screenshots + +### Step:1) Download RHEL 8.0 ISO file + +Download RHEL 8 iso file from its official web site, + + + +I am assuming you have the active subscription if not then register yourself for evaluation and then download ISO file + +### Step:2) Create Installation bootable media (USB or DVD) + +Once you have downloaded RHEL 8 ISO file, make it bootable by burning it either into a USB drive or DVD. Reboot the target system where you want to install RHEL 8 and then go to its bios settings and set the boot medium as USB or DVD, + +### Step:3) Choose “Install Red Hat Enterprise Linux 8.0” option + +When the system boots up with installation media (USB or DVD), we will get the following screen, choose “ **Install Red Hat Enterprise Linux 8.0** ” and hit enter, + + + +### Step:4) Choose your preferred language for RHEL 8 installation + +In this step, you need to choose a language that you want to use for RHEL 8 installation, so make a selection that suits to your setup. + + + +Click on Continue + +### Step:5) Preparing RHEL 8 Installation + +In this step we will decide the installation destination for RHEL 8, apart from this we can configure the followings: + + * Time Zone + * Kdump (enabled/disabled) + * Software Selection (Packages) + * Networking and Hostname + * Security Policies & System purpose + + + + + +By default, installer will automatically pick time zone and will enable the **kdump** , if wish to change the time zone then click on “ **Time & Date**” option and set your preferred time zone and then click on Done. + + + +To configure IP address and Hostname click on “ **Network & Hostname**” option from installation summary screen, + +If your system is connected to any switch or modem, then it will try to get IP from DHCP server otherwise we can configure IP manually. + +Mention the hostname that you want to set and then click on “ **Apply”**. Once you are done with IP address and hostname configuration click on “Done” + + + +To define the installation disk and partition scheme for RHEL 8, click on “ **Installation Destination** ” option, + + + +Click on Done + +As we can see I have around 60 GB free disk space on sda drive, I will be creating following customize lvm based partitions on this disk, + + * /boot = 2GB (xfs file system) + * / = 20 GB (xfs file system) + * /var = 10 GB (xfs file system) + * /home = 15 GB (xfs file system) + * /tmp = 5 GB (xfs file system) + * Swap = 2 GB (xfs file system) + + + +**Note:** If you don’t want to create manual partitions then select “ **Automatic** ” option from Storage Configuration Tab + + + +Let’s create our first partition as /boot of size 2 GB, Select LVM as mount point partitioning scheme and then click on + “plus” symbol, + + + +Click on “ **Add mount point** ” + + + +To create next partition as / of size 20 GB, click on + symbol and specify the details as shown below, + + + +Click on “Add mount point” + + + +As we can see installer has created the Volume group as “ **rhel_rhel8** “, if you want to change this name then click on Modify option and specify the desired name and then click on Save + + + +Now onward all partitions will be part of Volume Group “ **VolGrp** ” + +Similarly create next three partitions **/home** , **/var** and **/tmp** of size 15GB, 10 GB and 5 GB respectively + +**/home partition:** + + + +**/var partition:** + + + +**/tmp partition:** + + + +Now finally create last partition as swap of size of 2 GB, + + + +Click on “Add mount point” + +Once you are done with partition creations, click on Done on Next screen, example is shown below + + + +In the next window, choose “ **Accept Changes** ” + + + +### Step:6) Select Software Packages and Choose Security Policy and System purpose + +After accepting the changes in above step, we will be redirected to installation summary window. + +By default, installer will select “ **Server with GUI”** as software packages and if you want to change it then click on “ **Software Selection** ” option and choose your preferred “ **Basic Environment** ” + + + +Click on Done + +If you want to set the security policies during the installation, the choose the required profile from Security polices option else you can leave as it is. + +From “ **System Purpose** ” option specify the Role, Red Hat Service Level Agreement and Usage. Though You can leave this option as it is. + + + +Click on Done to proceed further. + +### Step:7) Choose “Begin Installation” option to start installation + +From the Installation summary window click on “Begin Installation” option to start the installation, + + + +As we can see below RHEL 8 Installation is started & is in progress + + + +Set the root password, + + + +Specify the local user details like its Full Name, user name and its password, + + + +Once the installation is completed, installer will prompt us to reboot the system, + + + +Click on “Reboot” to restart your system and don’t forget to change boot medium from bios settings so that system boots up with hard disk. + +### Step:8) Initial Setup after installation + +When the system is rebooted first time after the successful installation then we will get below window there we need to accept the license (EULA), + + + +Click on Done, + +In the next Screen click on “ **Finish Configuration** ” + + + +### Step:8) Login Screen of RHEL 8 Server after Installation + +As we have installed RHEL 8 Server with GUI, so we will get below login screen, use the same user name and password that we created during the installation + + + +After the login we will get couple of Welcome Screen and follow the screen instructions and then finally we will get the following screen, + + + +Click on “Start Using Red Hat Enterprise Linux” + + + +This confirms that we have successfully installed RHEL 8, that’s all from this article. We will be writing articles on RHEL 8 in the coming future till then please do share your feedback and comments on this article. + +Read Also :** [How to Setup Local Yum/DNF Repository on RHEL 8 Server Using DVD or ISO File][1]** + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/rhel-8-installation-steps-screenshots/ + +作者:[Pradeep Kumar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/setup-local-yum-dnf-repository-rhel-8/ From da43fe1df1d02716b7bdea06fef87c6ac353aa83 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 12:23:11 +0800 Subject: [PATCH 1046/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190504=20Fedo?= =?UTF-8?q?ra=2030=20Workstation=20Installation=20Guide=20with=20Screensho?= =?UTF-8?q?ts=20sources/tech/20190504=20Fedora=2030=20Workstation=20Instal?= =?UTF-8?q?lation=20Guide=20with=20Screenshots.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ion Installation Guide with Screenshots.md | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 sources/tech/20190504 Fedora 30 Workstation Installation Guide with Screenshots.md diff --git a/sources/tech/20190504 Fedora 30 Workstation Installation Guide with Screenshots.md b/sources/tech/20190504 Fedora 30 Workstation Installation Guide with Screenshots.md new file mode 100644 index 0000000000..9e0ebd4381 --- /dev/null +++ b/sources/tech/20190504 Fedora 30 Workstation Installation Guide with Screenshots.md @@ -0,0 +1,207 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora 30 Workstation Installation Guide with Screenshots) +[#]: via: (https://www.linuxtechi.com/fedora-30-workstation-installation-guide/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +Fedora 30 Workstation Installation Guide with Screenshots +====== + +If you are a **Fedora distribution** lover and always try the things at Fedora Workstation and Servers, then it is good news for you as Fedora has released its latest OS edition as **Fedora 30** for the Workstation and Server. One of the important updates in Fedora 30 from its previous release is that it has introduced **Fedora CoreOS** as a replacement of Fedora Atomic host. + +Some other noticeable updates in Fedora 30 are listed beneath: + + * Updated Desktop Gnome 3.32 + * New Linux Kernel 5.0.9 + * Updated Bash Version 5.0, PHP 7.3 & GCC 9 + * Updated Python 3.7.3, JDK12, Ruby 2.6 Mesa 19.0.2 and Golang 1.12 + * Improved DNF (Default Package Manager) + + + +In this article we will walk through the Fedora 30 workstation Installation steps for laptop or desktop. + +**Following are the minimum system requirement for Fedora 30 workstation,** + + * 1GHz Processor (Recommended 2 GHz Dual Core processor) + * 2 GB RAM + * 15 GB unallocated Hard Disk + * Bootable Media (USB / DVD) + * nternet Connection (Optional) + + + +Let’s Jump into Installation steps, + +### Step:1) Download Fedora 30 Workstation ISO File + +Download the Fedora 30 Workstation ISO file on your system from its Official Web Site + + + +Once the ISO file is downloaded, then burn it either in USB drive or DVD and make it bootable. + +### Step:2) Boot Your Target System with Bootable media (USB Drive or DVD) + +Reboot your target machine (i.e. machine where you want to install Fedora 30), Set the boot medium as USB or DVD from Bios settings so system boots up with bootable media. + +### Step:3) Choose Start Fedora-Workstation-30 Live + +When the system boots up with bootable media then we will get the following screen, to begin with installation on your system’s hard disk, choose “ **Start Fedora-Workstation-30 Live** “, + + + +### Step:4) Select Install to Hard Drive Option + +Select “ **Install to Hard Drive** ” option to install Fedora 30 on your system’s hard disk, you can also try Fedora on your system without installing it, for that select “ **Try Fedora** ” Option + + + +### Step:5) Choose appropriate language for your Fedora 30 Installation + +In this step choose your language which will be used during Fedora 30 Installation, + + + +Click on Continue + +### Step:6) Choose Installation destination and partition Scheme + +In the next window we will be present the following screen, here we will choose our installation destination, means on which hard disk we will do installation + + + +In the next screen we will see the local available hard disk, select the disk that suits your installation and then choose how you want to create partitions on it from storage configuration tab. + +If you choose “ **Automatic** ” partition scheme, then installer will create the necessary partition for your system automatically but if you want to create your own customize partition scheme then choose “ **Custom** ” option, + + + +Click on Done + +In this article I will demonstrate how to create [**LVM**][1] based custom partitions, in my case I have around 40 GB unallocated hard drive, so I will be creating following partitions on it, + + * /boot = 2 GB (ext4 file system) + * /home = 15 GB (ext4 file system) + * /var = 10 GB (ext4 file system) + * / = 10 GB (ext4 file system) + * Swap = 2 GB + + + + + +Select “ **LVM** ” as partitioning scheme and then click on plus (+) symbol, + +Specify the mount point as /boot and partition size as 2 GB and then click on “Add mount point” + + + + + +Now create next partition as /home of size 15 GB, Click on + symbol + + + +Click on “ **Add mount point** ” + + + +If you might have noticed, /home partition is created as LVM partition under default Volume Group, if you wish to change default Volume Group name then click on “ **Modify** ” option from Volume Group Tab, + +Mention the Volume Group name you want to set and then click on Save. Now onward all the LVM partition will be part of fedora30 volume group. + + + +Similarly create the next two partitions **/var** and **/** of size 10 GB respectively, + +**/var partition:** + + + +**/ (slash) partition:** + + + +Now create the last partition as swap of size 2 GB, + + + +In the next window, click on Done + + + +In the next screen, choose “ **Accept Changes** ” + + + +Now we will get Installation Summary window, here you can also change the time zone that suits to your installation and then click on “ **Begin Installation** ” + + + +### Step:7) Fedora 30 Installation started + +In this step we can see Fedora 30 Installation has been started and it is in progress, + + + +Once the Installation is completed, you will be prompted to restart your system + + + +Click on Quit and reboot your system. + +Don’t forget the Change boot medium from Bios settings so your system boots up with hard disk. + +### Step:8) Welcome message and login Screen after reboot + +When we first time reboot Fedora 30 system after the successful installation, we will get below welcome screen, + + + +Click on Next + +In the next screen you can Sync your online accounts or else you can skip, + + + +In the next window you will be required to specify the local account (user name) and its password, later this account will be used to login to the system + + + + + +Click on Next + +And finally, we will get below screen which confirms that we are ready to use Fedora 30, + + + +Click on “ **Start Using Fedora** ” + + + +Above Gnome Desktop Screen confirms that we have successfully installed Fedora 30 Workstation, now explore it and have fun 😊 + +In Fedora 30 workstation, if you want to install any packages or software from command line use DNF command. + +Read More On: **[26 DNF Command Examples for Package Management in Fedora Linux][2]** + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/fedora-30-workstation-installation-guide/ + +作者:[Pradeep Kumar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/lvm-good-way-to-utilize-disks-space/ +[2]: https://www.linuxtechi.com/dnf-command-examples-rpm-management-fedora-linux/ From 34d92e80e443cbfed0ea64e9418908fe16425adc Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 12:23:23 +0800 Subject: [PATCH 1047/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190501=20Moni?= =?UTF-8?q?tor=20and=20Manage=20Docker=20Containers=20with=20Portainer.io?= =?UTF-8?q?=20(GUI=20tool)=20=E2=80=93=20Part-1=20sources/tech/20190501=20?= =?UTF-8?q?Monitor=20and=20Manage=20Docker=20Containers=20with=20Portainer?= =?UTF-8?q?.io=20(GUI=20tool)=20-=20Part-1.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s with Portainer.io (GUI tool) - Part-1.md | 247 ++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 sources/tech/20190501 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-1.md diff --git a/sources/tech/20190501 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-1.md b/sources/tech/20190501 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-1.md new file mode 100644 index 0000000000..27bf04eb05 --- /dev/null +++ b/sources/tech/20190501 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-1.md @@ -0,0 +1,247 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Monitor and Manage Docker Containers with Portainer.io (GUI tool) – Part-1) +[#]: via: (https://www.linuxtechi.com/monitor-manage-docker-containers-portainer-part1/) +[#]: author: (Shashidhar Soppin https://www.linuxtechi.com/author/shashidhar/) + +Monitor and Manage Docker Containers with Portainer.io (GUI tool) – Part-1 +====== + +As **Docker** usage and adoption is growing faster and faster, monitoring **Docker container** images is becoming more challenging. As multiple Docker container images are getting created day-by-day, monitoring them is very important. There are already some in built tools and technologies, but configuring them is little complex. As micro-services based architecture is becoming the de-facto standard in coming days, learning such tool adds one more arsenal to your tool-set. + +Based on the above scenarios, there was in need of one light weight and robust tool requirement was growing. So Portainer.io addressed this. “ **Portainer.io** “,(Latest version is 1.20.2) the tool is very light weight(with 2-3 commands only one can configure it) and has become popular among Docker users. + +**This tool has advantages over other tools; some of these are as below** , + + * Light weight (requires only 2-3 commands to be required to run to install this tool) {Also installation image is only around 26-30MB of size) + * Robust and easy to use + * Can be used for Docker monitor and Build + * This tool provides us a detailed overview of your Docker environments + * This tool allows us to manage your containers, images, networks and volumes. + * Portainer is simple to deploy – this requires just one Docker command (can be run from anywhere.) + * Complete Docker-container environment can be monitored easily + + + +**Portainer is also equipped with** , + + * Community support + * Enterprise support + * Has professional services available(along with partner OEM services) + + + +**Functionality and features of Portainer tool are,** + + 1. It comes-up with nice Dashboard, easy to use and monitor. + 2. Many in-built templates for ease of operation and creation + 3. Support of services (OEM, Enterprise level) + 4. Monitoring of Containers, Images, Networks, Volume and configuration at almost real-time. + 5. Also includes Docker-Swarm monitoring + 6. User management with many fancy capabilities + + + +**Read Also :[How to Install Docker CE on Ubuntu 16.04 / 18.04 LTS System][1]** + +### How to install and configure Portainer.io on Ubuntu Linux / RHEL / CentOS + +**Note:** This installation is done on Ubuntu 18.04 but the installation on RHEL & CentOS would be same. We are assuming Docker CE is already installed on your system. + +``` +root@linuxtechi:~$ lsb_release -a +No LSB modules are available. +Distributor ID: Ubuntu +Description: Ubuntu 18.04 LTS +Release: 18.04 +Codename: bionic +root@linuxtechi:~$ +``` + +Create the Volume for portainer + +``` +root@linuxtechi:~$ sudo docker volume create portainer_data +portainer_data +root@linuxtechi:~$ +``` + +Launch and start Portainer Container using the beneath docker command, + +``` +root@linuxtechi:~$ sudo docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer +Unable to find image 'portainer/portainer:latest' locally +latest: Pulling from portainer/portainer +d1e017099d17: Pull complete +0b1e707a06d2: Pull complete +Digest: sha256:d6cc2c20c0af38d8d557ab994c419c799a10fe825e4aa57fea2e2e507a13747d +Status: Downloaded newer image for portainer/portainer:latest +35286de9f2e21d197309575bb52b5599fec24d4f373cc27210d98abc60244107 +root@linuxtechi:~$ +``` + +Once the complete installation is done, use the ip of host or Docker using port 9000 of the Docker engine where portainer is running using your browser. + +**Note:** If OS firewall is enabled on your Docker host then make sure 9000 port is allowed else its GUI will not come up. + +In my case, IP address of my Docker Host / Engine is “192.168.1.16” so URL will be, + + + +[![Portainer-Login-User-Name-Password][2]][3] + +Please make sure that you enter 8-character passwords. Let the admin be the user as it is and then click “Create user”. + +Now the following screen appears, in this select “Local” rectangle box. + +[![Connect-Portainer-Local-Docker][4]][5] + +Click on “Connect” + +Nice GUI with admin as user home screen appears as below, + +[![Portainer-io-Docker-Monitor-Dashboard][6]][7] + +Now Portainer is ready to launch and manage your Docker containers and it can also be used for containers monitoring. + +### Bring-up container image on Portainer tool + +[![Portainer-Endpoints][8]][9] + +Now check the present status, there are two container images are already running, if you create one more that appears instantly. + +From your command line kick-start one or two containers as below, + +``` +root@linuxtechi:~$ sudo docker run --name test -it debian +Unable to find image 'debian:latest' locally +latest: Pulling from library/debian +e79bb959ec00: Pull complete +Digest: sha256:724b0fbbda7fda6372ffed586670573c59e07a48c86d606bab05db118abe0ef5 +Status: Downloaded newer image for debian:latest +root@linuxtechi:/# +``` + +Now click Refresh button (Are you sure message appears, click “continue” on this) in Portainer GUI, you will now see 3 container images as highlighted below, + +[![Portainer-io-new-container-image][10]][11] + +Click on the “ **containers** ” (in which it is red circled above), next window appears with “ **Dashboard Endpoint summary** ” + +[![Portainer-io-Docker-Container-Dash][12]][13] + +In this page, click on “ **Containers** ” as highlighted in red color. Now you are ready to monitor your container image. + +### Simple Docker container image monitoring + +From the above step, it appears that a fancy and nice looking “Container List” page appears as below, + +[![Portainer-Container-List][14]][15] + +All the container images can be controlled from here (stop, start, etc) + +**1)** Now from this page, stop the earlier started {“test” container (this was the debian image that we started earlier)} + +To do this select the check box in front of this image and click stop button from above, + +[![Stop-Container-Portainer-io-dashboard][16]][17] + +From the command line option, you will see that this image has been stopped or exited now, + +``` +root@linuxtechi:~$ sudo docker container ls -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +d45902e717c0 debian "bash" 21 minutes ago Exited (0) 49 seconds ago test +08b96eddbae9 centos:7 "/bin/bash" About an hour ago Exited (137) 9 minutes ago mycontainer2 +35286de9f2e2 portainer/portainer "/portainer" 2 hours ago Up About an hour 0.0.0.0:9000->9000/tcp compassionate_benz +root@linuxtechi:~$ +``` + +**2)** Now start the stopped containers (test & mycontainer2) from Portainer GUI, + +Select the check box in front of stopped containers, and the click on Start + +[![Start-Containers-Portainer-GUI][18]][19] + +You will get a quick window saying, “ **Container successfully started** ” and with running state + +[![Conatiner-Started-successfully-Portainer-GUI][20]][21] + +### Various other options and features are explored as below step-by-step + +**1)** Click on “ **Images** ” which is highlighted, you will get the below window, + +[![Docker-Container-Images-Portainer-GUI][22]][23] + +This is the list of container images that are available but some may not running. These images can be imported, exported or uploaded to various locations, below screen shot shows the same, + +[![Upload-Docker-Container-Image-Portainer-GUI][24]][25] + +**2)** Click on “ **volumes”** which is highlighted, you will get the below window, + +[![Volume-list-Portainer-io-gui][26]][27] + +**3)** Volumes can be added easily with following option, click on add volume button, below window appears, + +Provide the name as “ **myvol** ” in the name box and click on “ **create the volume** ” button. + +[![Volume-Creation-Portainer-io-gui][28]][29] + +The newly created volume appears as below, (with unused state) + +[![Volume-unused-Portainer-io-gui][30]][31] + +#### Conclusion: + +As from the above installation steps, configuration and playing around with various options you can see how easy and fancy looking is Portainer.io tool is. This provides multiple features and options to explore on building, monitoring docker container. As explained this is very light weight tool, so doesn’t add any overload to host system. Next set-of options will be explored in part-2 of this series. + +Read Also: **[Monitor and Manage Docker Containers with Portainer.io (GUI tool) – Part-2][32]** + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/monitor-manage-docker-containers-portainer-part1/ + +作者:[Shashidhar Soppin][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.linuxtechi.com/author/shashidhar/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Login-User-Name-Password-1024x681.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Login-User-Name-Password.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Connect-Portainer-Local-Docker-1024x538.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Connect-Portainer-Local-Docker.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-Docker-Monitor-Dashboard-1024x544.jpg +[7]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-Docker-Monitor-Dashboard.jpg +[8]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Endpoints-1024x252.jpg +[9]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Endpoints.jpg +[10]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-new-container-image-1024x544.jpg +[11]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-new-container-image.jpg +[12]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-Docker-Container-Dash-1024x544.jpg +[13]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-Docker-Container-Dash.jpg +[14]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Container-List-1024x538.jpg +[15]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Container-List.jpg +[16]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Stop-Container-Portainer-io-dashboard-1024x447.jpg +[17]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Stop-Container-Portainer-io-dashboard.jpg +[18]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Start-Containers-Portainer-GUI-1024x449.jpg +[19]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Start-Containers-Portainer-GUI.jpg +[20]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Conatiner-Started-successfully-Portainer-GUI-1024x538.jpg +[21]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Conatiner-Started-successfully-Portainer-GUI.jpg +[22]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Docker-Container-Images-Portainer-GUI-1024x544.jpg +[23]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Docker-Container-Images-Portainer-GUI.jpg +[24]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Upload-Docker-Container-Image-Portainer-GUI-1024x544.jpg +[25]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Upload-Docker-Container-Image-Portainer-GUI.jpg +[26]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-list-Portainer-io-gui-1024x544.jpg +[27]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-list-Portainer-io-gui.jpg +[28]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-Creation-Portainer-io-gui-1024x544.jpg +[29]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-Creation-Portainer-io-gui.jpg +[30]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-unused-Portainer-io-gui-1024x544.jpg +[31]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-unused-Portainer-io-gui.jpg +[32]: https://www.linuxtechi.com/monitor-manage-docker-containers-portainer-io-part-2/ From 523a8f6f081a7caf1d916faa62c929390dd948e0 Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Thu, 20 Jun 2019 16:35:50 +0800 Subject: [PATCH 1048/1154] Update 20190111 Top 5 Linux Distributions for Productivity.md --- .../20190111 Top 5 Linux Distributions for Productivity.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md index 06dbc19f3e..4fa47c7b9b 100644 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md @@ -12,11 +12,11 @@ ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_main.jpg?itok=2IKyg_7_) -必须承认的是,这样一个热门的话题其实很难被总结出来。为什么呢?首先,Linux 在设计层面就是一种有生产力的操作系统。由于她极强的可靠性和稳定的平台,使得工作的开展变得简易化。其次为了衡量工作的效率,你需要考虑到哪项工作需要得到生产力方面的助推。是普通办公?开发类工作?学校事务?数据挖掘?或者是人力资源?你可以看到这一问题变得复杂起来了。 +必须承认的是,这样一个热门的话题其实很难被总结出来。为什么呢?首先,Linux 在设计层面就是一种有生产力的操作系统。由于它极强的可靠性和稳定的平台,使得工作的开展变得简易化。其次为了衡量工作的效率,你需要考虑到哪项工作需要得到生产力方面的助推。是普通办公?开发类工作?学校事务?数据挖掘?或者是人力资源?你可以看到这一问题变得复杂起来了。 I have to confess, this particular topic is a tough one to address. Why? First off, Linux is a productive operating system by design. Thanks to an incredibly reliable and stable platform, getting work done is easy. Second, to gauge effectiveness, you have to consider what type of work you need a productivity boost for. General office work? Development? School? Data mining? Human resources? You see how this question can get somewhat complicated. -然而,这并不意味着 +然而,这并不意味着那些 That doesn’t mean, however, that some distributions aren’t able to do a better job of configuring and presenting that underlying operating system into an efficient platform for getting work done. Quite the contrary. Some distributions do a much better job of “getting out of the way,” so you don’t find yourself in a work-related hole, having to dig yourself out and catch up before the end of day. These distributions help strip away the complexity that can be found in Linux, thereby making your workflow painless. @@ -95,6 +95,8 @@ And because you can select which desktop you want (from GNOME, Xfce, KDE, Cinnam ### Education +如果你是一名老师或者学生,抑或是其他从事与教育相关工作的人士,你需要适当的工具来变得更具创造力。之前,有 Edubuntu 这样的版本。这一版本从未跌出教育类相关发行版排名的前列。然而,自从 Ubuntu 14.04 版之后这一发行版就再也没有更新。幸运的是,现在有一款基于 openSUSE 的新的以教育为基础的发行版有望夺摘得桂冠。这一改版叫做 [openSUSE:Education-Li-f-e][16] (Linux For Education - Figure 5), 它基于 openSUSE Leap 42.1 (所以它可能稍微有一点过时)。 + If you are a teacher or student, or otherwise involved in education, you need the right tools to be productive. Once upon a time, there existed the likes of Edubuntu. That distribution never failed to be listed in the top of education-related lists. However, that distro hasn’t been updated since it was based on Ubuntu 14.04. Fortunately, there’s a new education-based distribution ready to take that title, based on openSUSE. This spin is called [openSUSE:Education-Li-f-e][16] (Linux For Education - Figure 5), and is based on openSUSE Leap 42.1 (so it is slightly out of date). openSUSE:Education-Li-f-e includes tools like: From 0699a8d3bea45767f6153edb8eddb8c6df498e69 Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Thu, 20 Jun 2019 17:01:07 +0800 Subject: [PATCH 1049/1154] Update 20190111 Top 5 Linux Distributions for Productivity.md --- ... 5 Linux Distributions for Productivity.md | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md index 4fa47c7b9b..d73c26ee09 100644 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md @@ -93,11 +93,39 @@ Figure 4: SSH’ing into a remote server on Debian. And because you can select which desktop you want (from GNOME, Xfce, KDE, Cinnamon, MATE, LXDE), you can be sure to have the interface that best matches your work habits. -### Education +### 教育 -如果你是一名老师或者学生,抑或是其他从事与教育相关工作的人士,你需要适当的工具来变得更具创造力。之前,有 Edubuntu 这样的版本。这一版本从未跌出教育类相关发行版排名的前列。然而,自从 Ubuntu 14.04 版之后这一发行版就再也没有更新。幸运的是,现在有一款基于 openSUSE 的新的以教育为基础的发行版有望夺摘得桂冠。这一改版叫做 [openSUSE:Education-Li-f-e][16] (Linux For Education - Figure 5), 它基于 openSUSE Leap 42.1 (所以它可能稍微有一点过时)。 +如果你是一名老师或者学生,抑或是其他从事与教育相关工作的人士,你需要适当的工具来变得更具创造力。之前,有 Edubuntu 这样的版本。这一版本从未跌出教育类相关发行版排名的前列。然而,自从 Ubuntu 14.04 版之后这一发行版就再也没有更新。还好,现在有一款基于 openSUSE 的新的以教育为基础的发行版有望夺摘得桂冠。这一改版叫做 [openSUSE:Education-Li-f-e][16] (Linux For Education - Figure 5), 它基于 openSUSE Leap 42.1 (所以它可能稍微有一点过时)。 -If you are a teacher or student, or otherwise involved in education, you need the right tools to be productive. Once upon a time, there existed the likes of Edubuntu. That distribution never failed to be listed in the top of education-related lists. However, that distro hasn’t been updated since it was based on Ubuntu 14.04. Fortunately, there’s a new education-based distribution ready to take that title, based on openSUSE. This spin is called [openSUSE:Education-Li-f-e][16] (Linux For Education - Figure 5), and is based on openSUSE Leap 42.1 (so it is slightly out of date). +openSUSE:Education-Li-f-e 包含了一下工具: + + * Brain Workshop(大脑工坊) - 一种基于 dual n-back 模式的大脑训练软件(译注:dual n-back 训练是一种科学的智力训练方法,可以改善人的工作记忆和流体智力) + + * GCompris - 一种针对青少年的教育软件包 + + * gElemental - 一款元素周期表查看工具 + + * iGNUit - 一款通用的记忆卡片工具 + + * Little Wizard - 基于 Pascal 语言的少儿编程开发环境 + + * Stellarium - 天文模拟器 + + * TuxMath - 数学入门游戏 + + * TuxPaint - 一款少儿绘画软件 + + * TuxType - 一款为少儿准备的打字入门软件 + + * wxMaxima - A cross platform GUI for the computer algebra system + + * Inkscape - Vector graphics program + + * GIMP - Graphic image manipulation program + + * Pencil - GUI prototyping tool + + * Hugin - Panorama photo stitching and HDR merging program openSUSE:Education-Li-f-e includes tools like: From 917a1ac963e6a9a7d97b10c98468425addd997eb Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 17:40:28 +0800 Subject: [PATCH 1050/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190519=20The?= =?UTF-8?q?=20three=20Rs=20of=20remote=20work=20sources/tech/20190519=20Th?= =?UTF-8?q?e=20three=20Rs=20of=20remote=20work.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190519 The three Rs of remote work.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20190519 The three Rs of remote work.md diff --git a/sources/tech/20190519 The three Rs of remote work.md b/sources/tech/20190519 The three Rs of remote work.md new file mode 100644 index 0000000000..f40f8b652e --- /dev/null +++ b/sources/tech/20190519 The three Rs of remote work.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The three Rs of remote work) +[#]: via: (https://dave.cheney.net/2019/05/19/the-three-rs-of-remote-work) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +The three Rs of remote work +====== + +I started working remotely in 2012. Since then I’ve worked for big companies and small, organisations with outstanding remote working cultures, and others that probably would have difficulty spelling the word without predictive text. I broadly classify my experiences into three tiers; + +### Little r remote + +The first kind of remote work I call _little r_ remote. + +Your company has an office, but it’s not convenient or you don’t want to work from there. It could be the commute is too long, or its in the next town over, or perhaps a short plane flight away. Sometimes you might go into the office for a day or two a week, and should something serious arise you could join your co-workers onsite for an extended period of time. + +If you often hear people say they are going to work from home to get some work done, that’s little r remote. + +### Big R remote + +The next category I call _Big R_ remote. Big R remote differs mainly from little r remote by the tyranny of distance. It’s not impossible to visit your co-workers in person, but it is inconvenient. Meeting face to face requires a day’s flying. Passports and boarder crossings are frequently involved. The expense and distance necessitates week long sprints and commensurate periods of jetlag recuperation. + +Because of timezone differences meetings must be prearranged and periods of overlap closely guarded. Communication becomes less spontaneous and care must be taken to avoid committing to unsustainable working hours. + +### Gothic ℜ remote + +The final category is basically Big R remote working on hard mode. Everything that was hard about Big R remote, timezone, travel schedules, public holidays, daylight savings, video call latency, cultural and language barriers is multiplied for each remote worker. + +In person meetings are so rare that without a focus on written asynchronous communication progress can repeatedly stall for days, if not weeks, as miscommunication leads to disillusionment and loss of trust. + +In my experience, for knowledge workers, little r remote work offers many benefits over [the open office hell scape][1] du jour. Big R remote takes a serious commitment by all parties and if you are the first employee in that category you will bare most of the cost to making Big R remote work for you. + +Gothic ℜ remote working should probably be avoided unless all those involved have many years of working in that style _and_ the employer is committed to restructuring the company as a remote first organisation. It is not possible to succeed in a Gothic ℜ remote role without a culture of written communication and asynchronous decision making mandated, _and consistently enforced,_ by the leaders of the company. + +#### Related posts: + + 1. [How to dial remote SSL/TLS services in Go][2] + 2. [How does the go build command work ?][3] + 3. [Why Slack is inappropriate for open source communications][4] + 4. [The office coffee model of concurrent garbage collection][5] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/05/19/the-three-rs-of-remote-work + +作者:[Dave Cheney][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://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/davecheney/status/761693088666357760 +[2]: https://dave.cheney.net/2010/10/05/how-to-dial-remote-ssltls-services-in-go (How to dial remote SSL/TLS services in Go) +[3]: https://dave.cheney.net/2013/10/15/how-does-the-go-build-command-work (How does the go build command work ?) +[4]: https://dave.cheney.net/2017/04/11/why-slack-is-inappropriate-for-open-source-communications (Why Slack is inappropriate for open source communications) +[5]: https://dave.cheney.net/2018/12/28/the-office-coffee-model-of-concurrent-garbage-collection (The office coffee model of concurrent garbage collection) From 9311c36c56c6785cbaed67ecdb3df004af83124f Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 17:40:36 +0800 Subject: [PATCH 1051/1154] add done: 20190519 The three Rs of remote work.md --- sources/tech/20190610 Constant Time.md | 281 +++++++++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 sources/tech/20190610 Constant Time.md diff --git a/sources/tech/20190610 Constant Time.md b/sources/tech/20190610 Constant Time.md new file mode 100644 index 0000000000..f19207fb58 --- /dev/null +++ b/sources/tech/20190610 Constant Time.md @@ -0,0 +1,281 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Constant Time) +[#]: via: (https://dave.cheney.net/2019/06/10/constant-time) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Constant Time +====== + +This essay is a derived from my [dotGo 2019 presentation][1] about my favourite feature in Go. + +* * * + +Many years ago Rob Pike remarked, + +> “Numbers are just numbers, you’ll never see `0x80ULL` in a `.go` source file”. + +—Rob Pike, [The Go Programming Language][2] + +Beyond this pithy observation lies the fascinating world of Go’s constants. Something that is perhaps taken for granted because, as Rob noted, is Go numbers–constants–just work. +In this post I intend to show you a few things that perhaps you didn’t know about Go’s `const` keyword. + +## What’s so great about constants? + +To kick things off, why are constants good? Three things spring to mind: + + * _Immutability_. Constants are one of the few ways we have in Go to express immutability to the compiler. + * _Clarity_. Constants give us a way to extract magic numbers from our code, giving them names and semantic meaning. + * _Performance_. The ability to express to the compiler that something will not change is key as it unlocks optimisations such as constant folding, constant propagation, branch and dead code elimination. + + + +But these are generic use cases for constants, they apply to any language. Let’s talk about some of the properties of Go’s constants. + +### A Challenge + +To introduce the power of Go’s constants let’s try a little challenge: declare a _constant_ whose value is the number of bits in the natural machine word. + +We can’t use `unsafe.SizeOf` as it is not a constant expression. We could use a build tag and laboriously record the natural word size of each Go platform, or we could do something like this: + +``` +const uintSize = 32 << (^uint(0) >> 32 & 1) +``` + +There are many versions of this expression in Go codebases. They all work roughly the same way. If we’re on a 64 bit platform then the exclusive or of the number zero–all zero bits–is a number with all bits set, sixty four of them to be exact. + +``` +1111111111111111111111111111111111111111111111111111111111111111 +``` + +If we shift that value thirty two bits to the right, we get another value with thirty two ones in it. + +``` +0000000000000000000000000000000011111111111111111111111111111111 +``` + +Anding that with a number with one bit in the final position give us, the same thing, `1`, + +``` +0000000000000000000000000000000011111111111111111111111111111111 & 1 = 1 +``` + +Finally we shift the number thirty two one place to the right, giving us 641. + +``` +32 << 1 = 64 +``` + +This expression is an example of a _constant expression_. All of these operations happen at compile time and the result of the expression is itself a constant. If you look in the in runtime package, in particular the garbage collector, you’ll see how constant expressions are used to set up complex invariants based on the word size of the machine the code is compiled on. + +So, this is a neat party trick, but most compilers will do this kind of constant folding at compile time for you. Let’s step it up a notch. + +## Constants are values + +In Go, constants are values and each value has a type. In Go, user defined types can declare their own methods. Thus, a constant value can have a method set. If you’re surprised by this, let me show you an example that you probably use every day. + +``` +const timeout = 500 * time.Millisecond +fmt.Println("The timeout is", timeout) // 500ms +``` + +In the example the untyped literal constant `500` is multiplied by `time.Millisecond`, itself a constant of type `time.Duration`. The rule for assignments in Go are, unless otherwise declared, the type on the left hand side of the assignment operator is inferred from the type on the right.`500` is an untyped constant so it is converted to a `time.Duration` then multiplied with the constant `time.Millisecond`. + +Thus `timeout` is a constant of type `time.Duration` which holds the value `500000000`. +Why then does `fmt.Println` print `500ms`, not `500000000`? + +The answer is `time.Duration` has a `String` method. Thus any `time.Duration` value, even a constant, knows how to pretty print itself. + +Now we know that constant values are typed, and because types can declare methods, we can derive that _constant values can fulfil interfaces_. In fact we just saw an example of this. `fmt.Println` doesn’t assert that a value has a `String` method, it asserts the value implements the `Stringer` interface. + +Let’s talk a little about how we can use this property to make our Go code better, and to do that I’m going to take a brief digression into the Singleton pattern. + +## Singletons + +I’m generally not a fan of the singleton pattern, in Go or any language. Singletons complicate testing and create unnecessary coupling between packages. I feel the singleton pattern is often used _not_ to create a singular instance of a thing, but instead to create a place to coordinate registration. `net/http.DefaultServeMux` is a good example of this pattern. + +``` +package http + +// DefaultServeMux is the default ServeMux used by Serve. +var DefaultServeMux = &defaultServeMux + +var defaultServeMux ServeMux +``` + +There is nothing singular about `http.defaultServerMux`, nothing prevents you from creating another `ServeMux`. In fact the `http` package provides a helper that will create as many `ServeMux`‘s as you want. + +``` +// NewServeMux allocates and returns a new ServeMux. +func NewServeMux() *ServeMux { return new(ServeMux) } +``` + +`http.DefaultServeMux` is not a singleton. Never the less there is a case for things which are truely singletons because they can only represent a single thing. A good example of this are the file descriptors of a process; 0, 1, and 2 which represent stdin, stdout, and stderr respectively. + +It doesn’t matter what names you give them, `1` is always stdout, and there can only ever be one file descriptor `1`. Thus these two operations are identical: + +``` +fmt.Fprintf(os.Stdout, "Hello dotGo\n") +syscall.Write(1, []byte("Hello dotGo\n")) +``` + +So let’s look at how the `os` package defines `Stdin`, `Stdout`, and `Stderr`: + +``` +package os + +var ( + Stdin = NewFile(uintptr(syscall.Stdin), "/dev/stdin") + Stdout = NewFile(uintptr(syscall.Stdout), "/dev/stdout") + Stderr = NewFile(uintptr(syscall.Stderr), "/dev/stderr") +) +``` + +There are a few problems with this declaration. Firstly their type is `*os.File` not the respective `io.Reader` or `io.Writer` interfaces. People have long complained that this makes replacing them with alternatives problematic. However the notion of replacing these variables is precisely the point of this digression. Can you safely change the value of `os.Stdout` once your program is running without causing a data race? + +I argue that, in the general case, you cannot. In general, if something is unsafe to do, as programmers we shouldn’t let our users think that it is safe, [lest they begin to depend on that behaviour][3]. + +Could we change the definition of `os.Stdout` and friends so that they retain the observable behaviour of reading and writing, but remain immutable? It turns out, we can do this easily with constants. + +``` +type readfd int + +func (r readfd) Read(buf []byte) (int, error) { + return syscall.Read(int(r), buf) +} + +type writefd int + +func (w writefd) Write(buf []byte) (int, error) { + return syscall.Write(int(w), buf) +} + +const ( + Stdin = readfd(0) + Stdout = writefd(1) + Stderr = writefd(2) +) + +func main() { + fmt.Fprintf(Stdout, "Hello world") +} +``` + +In fact this change causes only one compilation failure in the standard library.2 + +## Sentinel error values + +Another case of things which look like constants but really aren’t, are sentinel error values. `io.EOF`, `sql.ErrNoRows`, `crypto/x509.ErrUnsupportedAlgorithm`, and so on are all examples of sentinel error values. They all fall into a category of _expected_ errors, and because they are expected, you’re expected to check for them. + +To compare the error you have with the one you were expecting, you need to import the package that defines that error. Because, by definition, sentinel errors are exported public variables, any code that imports, for example, the `io` package could change the value of `io.EOF`. + +``` +package nelson + +import "io" + +func init() { + io.EOF = nil // haha! +} +``` + +I’ll say that again. If I know the name of `io.EOF` I can import the package that declares it, which I must if I want to compare it to my error, and thus I could change `io.EOF`‘s value. Historically convention and a bit of dumb luck discourages people from writing code that does this, but technically there is nothing to prevent you from doing so. + +Replacing `io.EOF` is probably going to be detected almost immediately. But replacing a less frequently used sentinel error may cause some interesting side effects: + +``` +package innocent + +import "crypto/rsa" + +func init() { + rsa.ErrVerification = nil // 🤔 +} +``` + +If you were hoping the race detector will spot this subterfuge, I suggest you talk to the folks writing testing frameworks who replace `os.Stdout` without it triggering the race detector. + +## Fungibility + +I want to digress for a moment to talk about _the_ most important property of constants. Constants aren’t just immutable, its not enough that we cannot overwrite their declaration, +Constants are _fungible_. This is a tremendously important property that doesn’t get nearly enough attention. + +Fungible means identical. Money is a great example of fungibility. If you were to lend me 10 bucks, and I later pay you back, the fact that you gave me a 10 dollar note and I returned to you 10 one dollar bills, with respect to its operation as a financial instrument, is irrelevant. Things which are fungible are by definition equal and equality is a powerful property we can leverage for our programs. + +``` +var myEOF = errors.New("EOF") // io/io.go line 38 +fmt.Println(myEOF == io.EOF) // false +``` + +Putting aside the effect of malicious actors in your code base the key design challenge with sentinel errors is they behave like _singletons_ , not _constants_. Even if we follow the exact procedure used by the `io` package to create our own EOF value, `myEOF` and `io.EOF` are not equal. `myEOF` and `io.EOF` are not fungible, they cannot be interchanged. Programs can spot the difference. + +When you combine the lack of immutability, the lack of fungibility, the lack of equality, you have a set of weird behaviours stemming from the fact that sentinel error values in Go are not constant expressions. But what if they were? + +## Constant errors + +Ideally a sentinel error value should behave as a constant. It should be immutable and fungible. Let’s recap how the built in `error` interface works in Go. + +``` +type error interface { + Error() string +} +``` + +Any type with an `Error() string` method fulfils the `error` interface. This includes user defined types, it includes types derived from primitives like string, and it includes constant strings. With that background, consider this error implementation: + +``` +type Error string + +func (e Error) Error() string { + return string(e) +} +``` + +We can use this error type as a constant expression: + +``` +const err = Error("EOF") +``` + +Unlike `errors.errorString`, which is a struct, a compact struct literal initialiser is not a constant expression and cannot be used. + +``` +const err2 = errors.errorString{"EOF"} // doesn't compile +``` + +As constants of this `Error` type are not variables, they are immutable. + +``` +const err = Error("EOF") +err = Error("not EOF") // doesn't compile +``` + +Additionally, two constant strings are always equal if their contents are equal: + +``` +const str1 = "EOF" +const str2 = "EOF" +fmt.Println(str1 == str2) // true +``` + +which means two constants of a type derived from string with the same contents are also equal. + +``` +type Error string + +const err1 = Error("EOF") +const err2 = Error("EOF") + fmt.Println(err1 == err2) // true``` + +``` +Said another way, equal constant `Error` values are the same, in the way that the literal constant `1` is the same as every other literal constant `1`. + +Now we have all the pieces we need to make sentinel errors, like `io.EOF`, and `rsa.ErrVerfication`, immutable, fungible, constant expressions. +``` + + % git diff + diff --git a/src/io/io.go b/src/io/io.go + inde \ No newline at end of file From 550c61a6e7272f9f62be6e147603a188eb261b74 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 17:40:46 +0800 Subject: [PATCH 1052/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190514=20Why?= =?UTF-8?q?=20bother=20writing=20tests=20at=20all=3F=20sources/tech/201905?= =?UTF-8?q?14=20Why=20bother=20writing=20tests=20at=20all.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0190514 Why bother writing tests at all.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20190514 Why bother writing tests at all.md diff --git a/sources/tech/20190514 Why bother writing tests at all.md b/sources/tech/20190514 Why bother writing tests at all.md new file mode 100644 index 0000000000..2b80dbaf40 --- /dev/null +++ b/sources/tech/20190514 Why bother writing tests at all.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why bother writing tests at all?) +[#]: via: (https://dave.cheney.net/2019/05/14/why-bother-writing-tests-at-all) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Why bother writing tests at all? +====== + +In previous posts and presentations I talked about [how to test][1], and [when to test][2]. To conclude this series of I’m going to ask the question, _why test at all?_ + +### Even if you don’t, someone _will_ test your software + +I’m sure no-one reading this post thinks that software should be delivered without being tested first. Even if that were true, your customers are going to test it, or at least use it. If nothing else, it would be good to discover any issues with the code before your customers do. If not for the reputation of your company, at least for your professional pride. + +So, if we agree that software should be tested, the question becomes: _who_ should do that testing? + +### The majority of testing should be performed by development teams + +I argue that the majority of the testing should be done by development groups. Moreover, testing should be automated, and thus the majority of these tests should be unit style tests. + +To be clear, I am _not_ saying you shouldn’t write integration, functional, or end to end tests. I’m also _not_ saying that you shouldn’t have a QA group, or integration test engineers. However at a recent software conference, in a room of over 1,000 engineers, nobody raised their hand when I asked if they considered themselves in a pure quality assurance role. + +You might argue that the audience was self selecting, that QA engineers did not feel a software conference was relevant–or welcoming–to them. However, I think this proves my point, the days of [one developer to one test engineer][3] are gone and not coming back. + +If development teams aren’t writing the majority of tests, who is? + +### Manual testing should not be the majority of your testing because manual testing is O(n) + +Thus, if individual contributors are expected to test the software they write, why do we need to automate it? Why is a manual testing plan not good enough? + +Manual testing of software or manual verification of a defect is not sufficient because it does not scale. As the number of manual tests grows, engineers are tempted to skip them or only execute the scenarios they _think_ are could be affected. Manual testing is expensive in terms of time, thus dollars, and it is boring. 99.9% of the tests that passed last time are _expected_ to pass again. Manual testing is looking for a needle in a haystack, except you don’t stop when you find the first needle. + +This means that your first response when given a bug to fix or a feature to implement should be to write a failing test. This doesn’t need to be a unit test, but it should be an automated test. Once you’ve fixed the bug, or added the feature, now have the test case to prove it worked–and you can check them in together. + +### Tests are the critical component that ensure you can always ship your master branch + +As a development team, you are judged on your ability to deliver working software to the business. No, seriously, the business could care less about OOP vs FP, CI/CD, table tennis or limited run La Croix. + +Your super power is, at any time, anyone on the team should be confident that the master branch of your code is shippable. This means at any time they can deliver a release of your software to the business and the business can recoup its investment in your development R&D. + +I cannot emphasise this enough. If you want the non technical parts of the business to believe you are heros, you must never create a situation where you say “well, we can’t release right now because we’re in the middle of an important refactoring. It’ll be a few weeks. We hope.” + +Again, I’m not saying you cannot refactor, but at every stage your product must be shippable. Your tests have to pass. It may not have all the desired features, but the features that are there should work as described on the tin. + +### Tests lock in behaviour + +Your tests are the contract about what your software does and does not do. Unit tests should lock in the behaviour of the package’s API. Integration tests do the same for complex interactions. Tests describe, in code, what the program promises to do. + +If there is a unit test for each input permutation, you have defined the contract for what the code will do _in code_ , not documentation. This is a contract anyone on your team can assert by simply running the tests. At any stage you _know_ with a high degree of confidence that the behaviour people relied on before your change continues to function after your change. + +### Tests give you confidence to change someone else’s code + +Lastly, and this is the biggest one, for programmers working on a piece of code that has been through many hands. Tests give you the confidence to make changes. + +Even though we’ve never met, something I know about you, the reader, is you will eventually leave your current employer. Maybe you’ll be moving on to a new role, or perhaps a promotion, perhaps you’ll move cities, or follow your partner overseas. Whatever the reason, the succession of the maintenance of programs you write is key. + +If people cannot maintain our code then as you and I move from job to job we’ll leave behind programs which cannot be maintained. This goes beyond advocacy for a language or tool. Programs which cannot be changed, programs which are too hard to onboard new developers, or programs which feel like career digression to work on them will reach only one end state–they are a dead end. They represent a balance sheet loss for the business. They will be replaced. + +If you worry about who will maintain your code after you’re gone, write good tests. + +#### Related posts: + + 1. [Writing table driven tests in Go][4] + 2. [Prefer table driven tests][5] + 3. [Automatically run your package’s tests with inotifywait][6] + 4. [The value of TDD][7] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/05/14/why-bother-writing-tests-at-all + +作者:[Dave Cheney][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://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/2019/05/07/prefer-table-driven-tests +[2]: https://dave.cheney.net/paste/absolute-unit-test-london-gophers.pdf +[3]: https://docs.microsoft.com/en-us/azure/devops/learn/devops-at-microsoft/evolving-test-practices-microsoft +[4]: https://dave.cheney.net/2013/06/09/writing-table-driven-tests-in-go (Writing table driven tests in Go) +[5]: https://dave.cheney.net/2019/05/07/prefer-table-driven-tests (Prefer table driven tests) +[6]: https://dave.cheney.net/2016/06/21/automatically-run-your-packages-tests-with-inotifywait (Automatically run your package’s tests with inotifywait) +[7]: https://dave.cheney.net/2016/04/11/the-value-of-tdd (The value of TDD) From 5b8af4c927ecae18916d5878c734d6239bf262e5 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 17:40:57 +0800 Subject: [PATCH 1053/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190507=20Pref?= =?UTF-8?q?er=20table=20driven=20tests=20sources/tech/20190507=20Prefer=20?= =?UTF-8?q?table=20driven=20tests.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190507 Prefer table driven tests.md | 521 ++++++++++++++++++ 1 file changed, 521 insertions(+) create mode 100644 sources/tech/20190507 Prefer table driven tests.md diff --git a/sources/tech/20190507 Prefer table driven tests.md b/sources/tech/20190507 Prefer table driven tests.md new file mode 100644 index 0000000000..0a41860207 --- /dev/null +++ b/sources/tech/20190507 Prefer table driven tests.md @@ -0,0 +1,521 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Prefer table driven tests) +[#]: via: (https://dave.cheney.net/2019/05/07/prefer-table-driven-tests) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Prefer table driven tests +====== + +I’m a big fan of testing, specifically [unit testing][1] and TDD ([done correctly][2], of course). A practice that has grown around Go projects is the idea of a table driven test. This post explores the how and why of writing a table driven test. + +Let’s say we have a function that splits strings: + +``` +// Split slices s into all substrings separated by sep and +// returns a slice of the substrings between those separators. +func Split(s, sep string) []string { + var result []string + i := strings.Index(s, sep) + for i > -1 { + result = append(result, s[:i]) + s = s[i+len(sep):] + i = strings.Index(s, sep) + } + return append(result, s) +} +``` + +In Go, unit tests are just regular Go functions (with a few rules) so we write a unit test for this function starting with a file in the same directory, with the same package name, `strings`. + +``` +package split + +import ( + "reflect" + "testing" +) + +func TestSplit(t *testing.T) { + got := Split("a/b/c", "/") + want := []string{"a", "b", "c"} + if !reflect.DeepEqual(want, got) { + t.Fatalf("expected: %v, got: %v", want, got) + } +} +``` + +Tests are just regular Go functions with a few rules: + + 1. The name of the test function must start with `Test`. + 2. The test function must take one argument of type `*testing.T`. A `*testing.T` is a type injected by the testing package itself, to provide ways to print, skip, and fail the test. + + + +In our test we call `Split` with some inputs, then compare it to the result we expected. + +### Code coverage + +The next question is, what is the coverage of this package? Luckily the go tool has a built in branch coverage. We can invoke it like this: + +``` +% go test -coverprofile=c.out +PASS +coverage: 100.0% of statements +ok split 0.010s +``` + +Which tells us we have 100% branch coverage, which isn’t really surprising, there’s only one branch in this code. + +If we want to dig in to the coverage report the go tool has several options to print the coverage report. We can use `go tool cover -func` to break down the coverage per function: + +``` +% go tool cover -func=c.out +split/split.go:8: Split 100.0% +total: (statements) 100.0% +``` + +Which isn’t that exciting as we only have one function in this package, but I’m sure you’ll find more exciting packages to test. + +#### Spray some .bashrc on that + +This pair of commands is so useful for me I have a shell alias which runs the test coverage and the report in one command: + +``` +cover () { + local t=$(mktemp -t cover) + go test $COVERFLAGS -coverprofile=$t $@ \ + && go tool cover -func=$t \ + && unlink $t +} +``` + +### Going beyond 100% coverage + +So, we wrote one test case, got 100% coverage, but this isn’t really the end of the story. We have good branch coverage but we probably need to test some of the boundary conditions. For example, what happens if we try to split it on comma? + +``` +func TestSplitWrongSep(t *testing.T) { + got := Split("a/b/c", ",") + want := []string{"a/b/c"} + if !reflect.DeepEqual(want, got) { + t.Fatalf("expected: %v, got: %v", want, got) + } +} +``` + +Or, what happens if there are no separators in the source string? + +``` +func TestSplitNoSep(t *testing.T) { + got := Split("abc", "/") + want := []string{"abc"} + if !reflect.DeepEqual(want, got) { + t.Fatalf("expected: %v, got: %v", want, got) + } +} +``` + +We’re starting build a set of test cases that exercise boundary conditions. This is good. + +### Introducing table driven tests + +However the there is a lot of duplication in our tests. For each test case only the input, the expected output, and name of the test case change. Everything else is boilerplate. What we’d like to to set up all the inputs and expected outputs and feel them to a single test harness. This is a great time to introduce table driven testing. + +``` +func TestSplit(t *testing.T) { + type test struct { + input string + sep string + want []string + } + + tests := []test{ + {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + {input: "abc", sep: "/", want: []string{"abc"}}, + } + + for _, tc := range tests { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %v, got: %v", tc.want, got) + } + } +} +``` + +We declare a structure to hold our test inputs and expected outputs. This is our table. The `tests` structure is usually a local declaration because we want to reuse this name for other tests in this package. + +In fact, we don’t even need to give the type a name, we can use an anonymous struct literal to reduce the boilerplate like this: + +``` +func TestSplit(t *testing.T) { + tests := []struct { + input string + sep string + want []string + }{ + {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + {input: "abc", sep: "/", want: []string{"abc"}}, + } + + for _, tc := range tests { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %v, got: %v", tc.want, got) + } + } +} +``` + +Now, adding a new test is a straight forward matter; simply add another line the `tests` structure. For example, what will happen if our input string has a trailing separator? + +``` +{input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, +{input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, +{input: "abc", sep: "/", want: []string{"abc"}}, +{input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, // trailing sep +``` + +But, when we run `go test`, we get + +``` +% go test +--- FAIL: TestSplit (0.00s) + split_test.go:24: expected: [a b c], got: [a b c ] +``` + +Putting aside the test failure, there are a few problems to talk about. + +The first is by rewriting each test from a function to a row in a table we’ve lost the name of the failing test. We added a comment in the test file to call out this case, but we don’t have access to that comment in the `go test` output. + +There are a few ways to resolve this. You’ll see a mix of styles in use in Go code bases because the table testing idiom is evolving as people continue to experiment with the form. + +### Enumerating test cases + +As tests are stored in a slice we can print out the index of the test case in the failure message: + +``` +func TestSplit(t *testing.T) { + tests := []struct { + input string + sep . string + want []string + }{ + {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + {input: "abc", sep: "/", want: []string{"abc"}}, + {input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, + } + + for i, tc := range tests { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("test %d: expected: %v, got: %v", i+1, tc.want, got) + } + } +} +``` + +Now when we run `go test` we get this + +``` +% go test +--- FAIL: TestSplit (0.00s) + split_test.go:24: test 4: expected: [a b c], got: [a b c ] +``` + +Which is a little better. Now we know that the fourth test is failing, although we have to do a little bit of fudging because slice indexing—​and range iteration—​is zero based. This requires consistency across your test cases; if some use zero base reporting and others use one based, it’s going to be confusing. And, if the list of test cases is long, it could be difficult to count braces to figure out exactly which fixture constitutes test case number four. + +### Give your test cases names + +Another common pattern is to include a name field in the test fixture. + +``` +func TestSplit(t *testing.T) { + tests := []struct { + name string + input string + sep string + want []string + }{ + {name: "simple", input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + {name: "wrong sep", input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + {name: "no sep", input: "abc", sep: "/", want: []string{"abc"}}, + {name: "trailing sep", input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, + } + + for _, tc := range tests { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("%s: expected: %v, got: %v", tc.name, tc.want, got) + } + } +} +``` + +Now when the test fails we have a descriptive name for what the test was doing. We no longer have to try to figure it out from the output—​also, now have a string we can search on. + +``` +% go test +--- FAIL: TestSplit (0.00s) + split_test.go:25: trailing sep: expected: [a b c], got: [a b c ] +``` + +We can dry this up even more using a map literal syntax: + +``` +func TestSplit(t *testing.T) { + tests := map[string]struct { + input string + sep string + want []string + }{ + "simple": {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + "wrong sep": {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + "no sep": {input: "abc", sep: "/", want: []string{"abc"}}, + "trailing sep": {input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, + } + + for name, tc := range tests { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("%s: expected: %v, got: %v", name, tc.want, got) + } + } +} +``` + +Using a map literal syntax we define our test cases not as a slice of structs, but as map of test names to test fixtures. There’s also a side benefit of using a map that is going to potentially improve the utility of our tests. + +Map iteration order is _undefined_ 1 This means each time we run `go test`, our tests are going to be potentially run in a different order. + +This is super useful for spotting conditions where test pass when run in statement order, but not otherwise. If you find that happens you probably have some global state that is being mutated by one test with subsequent tests depending on that modification. + +### Introducing sub tests + +Before we fix the failing test there are a few other issues to address in our table driven test harness. + +The first is we’re calling `t.Fatalf` when one of the test cases fails. This means after the first failing test case we stop testing the other cases. Because test cases are run in an undefined order, if there is a test failure, it would be nice to know if it was the only failure or just the first. + +The testing package would do this for us if we go to the effort to write out each test case as its own function, but that’s quite verbose. The good news is since Go 1.7 a new feature was added that lets us do this easily for table driven tests. They’re called [sub tests][3]. + +``` +func TestSplit(t *testing.T) { + tests := map[string]struct { + input string + sep string + want []string + }{ + "simple": {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + "wrong sep": {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + "no sep": {input: "abc", sep: "/", want: []string{"abc"}}, + "trailing sep": {input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %v, got: %v", tc.want, got) + } + }) + } +} +``` + +As each sub test now has a name we get that name automatically printed out in any test runs. + +``` +% go test +--- FAIL: TestSplit (0.00s) + --- FAIL: TestSplit/trailing_sep (0.00s) + split_test.go:25: expected: [a b c], got: [a b c ] +``` + +Each subtest is its own anonymous function, therefore we can use `t.Fatalf`, `t.Skipf`, and all the other `testing.T`helpers, while retaining the compactness of a table driven test. + +#### Individual sub test cases can be executed directly + +Because sub tests have a name, you can run a selection of sub tests by name using the `go test -run` flag. + +``` +% go test -run=.*/trailing -v +=== RUN TestSplit +=== RUN TestSplit/trailing_sep +--- FAIL: TestSplit (0.00s) + --- FAIL: TestSplit/trailing_sep (0.00s) + split_test.go:25: expected: [a b c], got: [a b c ] +``` + +### Comparing what we got with what we wanted + +Now we’re ready to fix the test case. Let’s look at the error. + +``` +--- FAIL: TestSplit (0.00s) + --- FAIL: TestSplit/trailing_sep (0.00s) + split_test.go:25: expected: [a b c], got: [a b c ] +``` + +Can you spot the problem? Clearly the slices are different, that’s what `reflect.DeepEqual` is upset about. But spotting the actual difference isn’t easy, you have to spot that extra space after `c`. This might look simple in this simple example, but it is any thing but when you’re comparing two complicated deeply nested gRPC structures. + +We can improve the output if we switch to the `%#v` syntax to view the value as a Go(ish) declaration: + +``` +got := Split(tc.input, tc.sep) +if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %#v, got: %#v", tc.want, got) +} +``` + +Now when we run our test it’s clear that the problem is there is an extra blank element in the slice. + +``` +% go test +--- FAIL: TestSplit (0.00s) + --- FAIL: TestSplit/trailing_sep (0.00s) + split_test.go:25: expected: []string{"a", "b", "c"}, got: []string{"a", "b", "c", ""} +``` + +But before we go to fix our test failure I want to talk a little bit more about choosing the right way to present test failures. Our `Split` function is simple, it takes a primitive string and returns a slice of strings, but what if it worked with structs, or worse, pointers to structs? + +Here is an example where `%#v` does not work as well: + +``` +func main() { + type T struct { + I int + } + x := []*T{{1}, {2}, {3}} + y := []*T{{1}, {2}, {4}} + fmt.Printf("%v %v\n", x, y) + fmt.Printf("%#v %#v\n", x, y) +} +``` + +The first `fmt.Printf`prints the unhelpful, but expected slice of addresses; `[0xc000096000 0xc000096008 0xc000096010] [0xc000096018 0xc000096020 0xc000096028]`. However our `%#v` version doesn’t fare any better, printing a slice of addresses cast to `*main.T`;`[]*main.T{(*main.T)(0xc000096000), (*main.T)(0xc000096008), (*main.T)(0xc000096010)} []*main.T{(*main.T)(0xc000096018), (*main.T)(0xc000096020), (*main.T)(0xc000096028)}` + +Because of the limitations in using any `fmt.Printf` verb, I want to introduce the [go-cmp][4] library from Google. + +The goal of the cmp library is it is specifically to compare two values. This is similar to `reflect.DeepEqual`, but it has more capabilities. Using the cmp pacakge you can, of course, write: + +``` +func main() { + type T struct { + I int + } + x := []*T{{1}, {2}, {3}} + y := []*T{{1}, {2}, {4}} + fmt.Println(cmp.Equal(x, y)) // false +} +``` + +But far more useful for us with our test function is the `cmp.Diff` function which will produce a textual description of what is different between the two values, recursively. + +``` +func main() { + type T struct { + I int + } + x := []*T{{1}, {2}, {3}} + y := []*T{{1}, {2}, {4}} + diff := cmp.Diff(x, y) + fmt.Printf(diff) +} +``` + +Which instead produces: + +``` +% go run +{[]*main.T}[2].I: + -: 3 + +: 4 +``` + +Telling us that at element 2 of the slice of `T`s the `I`field was expected to be 3, but was actually 4. + +Putting this all together we have our table driven go-cmp test + +``` +func TestSplit(t *testing.T) { + tests := map[string]struct { + input string + sep string + want []string + }{ + "simple": {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + "wrong sep": {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + "no sep": {input: "abc", sep: "/", want: []string{"abc"}}, + "trailing sep": {input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + got := Split(tc.input, tc.sep) + diff := cmp.Diff(tc.want, got) + if diff != "" { + t.Fatalf(diff) + } + }) + } +} +``` + +Running this we get + +``` +% go test +--- FAIL: TestSplit (0.00s) + --- FAIL: TestSplit/trailing_sep (0.00s) + split_test.go:27: {[]string}[?->3]: + -: + +: "" +FAIL +exit status 1 +FAIL split 0.006s +``` + +Using `cmp.Diff` our test harness isn’t just telling us that what we got and what we wanted were different. Our test is telling us that the strings are different lengths, the third index in the fixture shouldn’t exist, but the actual output we got an empty string, “”. From here fixing the test failure is straight forward. + + 1. Please don’t email me to argue that map iteration order is _random_. [It’s not][5]. + + + +#### Related posts: + + 1. [Writing table driven tests in Go][6] + 2. [Internets of Interest #7: Ian Cooper on Test Driven Development][7] + 3. [Automatically run your package’s tests with inotifywait][8] + 4. [How to write benchmarks in Go][9] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/05/07/prefer-table-driven-tests + +作者:[Dave Cheney][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://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/2019/04/03/absolute-unit-test +[2]: https://www.youtube.com/watch?v=EZ05e7EMOLM +[3]: https://blog.golang.org/subtests +[4]: https://github.com/google/go-cmp +[5]: https://golang.org/ref/spec#For_statements +[6]: https://dave.cheney.net/2013/06/09/writing-table-driven-tests-in-go (Writing table driven tests in Go) +[7]: https://dave.cheney.net/2018/10/15/internets-of-interest-7-ian-cooper-on-test-driven-development (Internets of Interest #7: Ian Cooper on Test Driven Development) +[8]: https://dave.cheney.net/2016/06/21/automatically-run-your-packages-tests-with-inotifywait (Automatically run your package’s tests with inotifywait) +[9]: https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go (How to write benchmarks in Go) From ab8f35e70159da5108ebfcdea2c3ca3f940d290c Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 17:41:32 +0800 Subject: [PATCH 1054/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190218=20Talk?= =?UTF-8?q?,=20then=20code=20sources/tech/20190218=20Talk,=20then=20code.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190218 Talk, then code.md | 64 ++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/tech/20190218 Talk, then code.md diff --git a/sources/tech/20190218 Talk, then code.md b/sources/tech/20190218 Talk, then code.md new file mode 100644 index 0000000000..18ed81e43c --- /dev/null +++ b/sources/tech/20190218 Talk, then code.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Talk, then code) +[#]: via: (https://dave.cheney.net/2019/02/18/talk-then-code) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Talk, then code +====== + +The open source projects that I contribute to follow a philosophy which I describe as _talk, then code_. I think this is generally a good way to develop software and I want to spend a little time talking about the benefits of this methodology. + +### Avoiding hurt feelings + +The most important reason for discussing the change you want to make is it avoids hurt feelings. Often I see a contributor work hard in isolation on a pull request only to find their work is rejected. This can be for a bunch of reasons; the PR is too large, the PR doesn’t follow the local style, the PR fixes an issue which wasn’t important to the project or was recently fixed indirectly, and many more. + +The underlying cause of all these issues is a lack of communication. The goal of the _talk, then code_ philosophy is not to impede or frustrate, but to ensure that a feature lands correctly the first time, without incurring significant maintenance debt, and neither the author of the change, or the reviewer, has to carry the emotional burden of dealing with hurt feelings when a change appears out of the blue with an implicit “well, I’ve done the work, all you have to do is merge it, right?” + +### What does discussion look like? + +Every new feature or bug fix should be discussed with the maintainer(s) of the project before work commences. It’s fine to experiment privately, but do not send a change without discussing it first. + +The definition of _talk_ for simple changes can be as little as a design sketch in a GitHub issue. If your PR fixes a bug, you should link to the bug it fixes. If there isn’t one, you should raise a bug and wait for the maintainers to acknowledge it before sending a PR. This might seem a little backward–who wouldn’t want a bug fixed–but consider the bug could be a misunderstanding in how the software works or it could be a symptom of a larger problem that needs further investigation. + +For more complicated changes, especially feature requests, I recommend that a design document be circulated and agreed upon before sending code. This doesn’t have to be a full blown document, a sketch in an issue may be sufficient, but the key is to reach agreement using words, before locking it in stone with code. + +In all cases you shouldn’t proceed to send code until there is a positive agreement from the maintainer that the approach is one they are happy with. A pull request is for life, not just for Christmas. + +### Code review, not design by committee + +A code review is not the place for arguments about design. This is for two reasons. First, most code review tools are not suitable for long comment threads, GitHub’s PR interface is very bad at this, Gerrit is better, but few have a team of admins to maintain a Gerrit instance. More importantly, disagreements at the code review stage suggests there wasn’t agreement on how the change should be implemented. + +* * * + +Talk about what you want to code, then code what you talked about. Please don’t do it the other way around. + +### Related posts: + + 1. [How to include C code in your Go package][1] + 2. [Let’s talk about logging][2] + 3. [The value of TDD][3] + 4. [Suggestions for contributing to an Open Source project][4] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/02/18/talk-then-code + +作者:[Dave Cheney][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://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/2013/09/07/how-to-include-c-code-in-your-go-package (How to include C code in your Go package) +[2]: https://dave.cheney.net/2015/11/05/lets-talk-about-logging (Let’s talk about logging) +[3]: https://dave.cheney.net/2016/04/11/the-value-of-tdd (The value of TDD) +[4]: https://dave.cheney.net/2016/03/12/suggestions-for-contributing-to-an-open-source-project (Suggestions for contributing to an Open Source project) From 33d271a9689586d1cce139460e5670000fcb0d62 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 17:41:44 +0800 Subject: [PATCH 1055/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190129=20You?= =?UTF-8?q?=20shouldn=E2=80=99t=20name=20your=20variables=20after=20their?= =?UTF-8?q?=20types=20for=20the=20same=20reason=20you=20wouldn=E2=80=99t?= =?UTF-8?q?=20name=20your=20pets=20=E2=80=9Cdog=E2=80=9D=20or=20=E2=80=9Cc?= =?UTF-8?q?at=E2=80=9D=20sources/tech/20190129=20You=20shouldn-t=20name=20?= =?UTF-8?q?your=20variables=20after=20their=20types=20for=20the=20same=20r?= =?UTF-8?q?eason=20you=20wouldn-t=20name=20your=20pets=20-dog-=20or=20-cat?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...u wouldn-t name your pets -dog- or -cat.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20190129 You shouldn-t name your variables after their types for the same reason you wouldn-t name your pets -dog- or -cat.md diff --git a/sources/tech/20190129 You shouldn-t name your variables after their types for the same reason you wouldn-t name your pets -dog- or -cat.md b/sources/tech/20190129 You shouldn-t name your variables after their types for the same reason you wouldn-t name your pets -dog- or -cat.md new file mode 100644 index 0000000000..75ad9e93c6 --- /dev/null +++ b/sources/tech/20190129 You shouldn-t name your variables after their types for the same reason you wouldn-t name your pets -dog- or -cat.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (You shouldn’t name your variables after their types for the same reason you wouldn’t name your pets “dog” or “cat”) +[#]: via: (https://dave.cheney.net/2019/01/29/you-shouldnt-name-your-variables-after-their-types-for-the-same-reason-you-wouldnt-name-your-pets-dog-or-cat) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +You shouldn’t name your variables after their types for the same reason you wouldn’t name your pets “dog” or “cat” +====== + +The name of a variable should describe its contents, not the _type_ of the contents. Consider this example: + +``` +var usersMap map[string]*User +``` + +What are some good properties of this declaration? We can see that it’s a map, and it has something to do with the `*User` type, so that’s probably good. But `usersMap` _is_ a map and Go, being a statically typed language, won’t let us accidentally use a map where a different type is required, so the `Map` suffix as a safety precaution is redundant. + +Now, consider what happens if we declare other variables using this pattern: + +``` +var ( + companiesMap map[string]*Company + productsMap map[string]*Products +) +``` + +Now we have three map type variables in scope, `usersMap`, `companiesMap`, and `productsMap`, all mapping `string`s to different `struct` types. We know they are maps, and we also know that their declarations prevent us from using one in place of another—​the compiler will throw an error if we try to use `companiesMap` where the code is expecting a `map[string]*User`. In this situation it’s clear that the `Map` suffix does not improve the clarity of the code, its just extra boilerplate to type. + +My suggestion is avoid any suffix that resembles the _type_ of the variable. Said another way, if `users` isn’t descriptive enough, then `usersMap` won’t be either. + +This advice also applies to function parameters. For example: + +``` +type Config struct { + // +} + +func WriteConfig(w io.Writer, config *Config) +``` + +Naming the `*Config` parameter `config` is redundant. We know it’s a pointer to a `Config`, it says so right there in the declaration. Instead consider if `conf` will do, or maybe just `c` if the lifetime of the variable is short enough. + +This advice is more than just a desire for brevity. If there is more that one `*Config` in scope at any one time, calling them `config1` and `config2` is less descriptive than calling them `original` and `updated` . The latter are less likely to be accidentally transposed—something the compiler won’t catch—while the former differ only in a one character suffix. + +Finally, don’t let package names steal good variable names. The name of an imported identifier includes its package name. For example the `Context` type in the `context` package will be known as `context.Context` when imported into another package . This makes it impossible to use `context` as a variable or type, unless of course you rename the import, but that’s throwing good after bad. This is why the local declaration for `context.Context` types is traditionally `ctx`. eg. + +``` +func WriteLog(ctx context.Context, message string) +``` + +* * * + +A variable’s name should be independent of its type. You shouldn’t name your variables after their types for the same reason you wouldn’t name your pets “dog” or “cat”. You shouldn’t include the name of your type in the name of your variable for the same reason. + +### Related posts: + + 1. [On declaring variables][1] + 2. [Go, without package scoped variables][2] + 3. [A whirlwind tour of Go’s runtime environment variables][3] + 4. [Declaration scopes in Go][4] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/01/29/you-shouldnt-name-your-variables-after-their-types-for-the-same-reason-you-wouldnt-name-your-pets-dog-or-cat + +作者:[Dave Cheney][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://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/2014/05/24/on-declaring-variables (On declaring variables) +[2]: https://dave.cheney.net/2017/06/11/go-without-package-scoped-variables (Go, without package scoped variables) +[3]: https://dave.cheney.net/2015/11/29/a-whirlwind-tour-of-gos-runtime-environment-variables (A whirlwind tour of Go’s runtime environment variables) +[4]: https://dave.cheney.net/2016/12/15/declaration-scopes-in-go (Declaration scopes in Go) From 7ac74c903ba8ffc45da368a357b0d980074ae34e Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 17:41:55 +0800 Subject: [PATCH 1056/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190127=20Elim?= =?UTF-8?q?inate=20error=20handling=20by=20eliminating=20errors=20sources/?= =?UTF-8?q?tech/20190127=20Eliminate=20error=20handling=20by=20eliminating?= =?UTF-8?q?=20errors.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...te error handling by eliminating errors.md | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 sources/tech/20190127 Eliminate error handling by eliminating errors.md diff --git a/sources/tech/20190127 Eliminate error handling by eliminating errors.md b/sources/tech/20190127 Eliminate error handling by eliminating errors.md new file mode 100644 index 0000000000..6eac4740eb --- /dev/null +++ b/sources/tech/20190127 Eliminate error handling by eliminating errors.md @@ -0,0 +1,204 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Eliminate error handling by eliminating errors) +[#]: via: (https://dave.cheney.net/2019/01/27/eliminate-error-handling-by-eliminating-errors) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Eliminate error handling by eliminating errors +====== + +Go 2 aims to improve the overhead of [error handling][1], but do you know what is better than an improved syntax for handling errors? Not needing to handle errors at all. Now, I’m not saying “delete your error handling code”, instead I’m suggesting changing your code so you don’t have as many errors to handle. + +This article draws inspiration from a chapter in John Ousterhout’s, _[A philosophy of Software Design,][2]_ “Define Errors Out of Existence”. I’m going to try to apply his advice to Go. + +* * * + +Here’s a function to count the number of lines in a file, + +``` +func CountLines(r io.Reader) (int, error) { + var ( + br = bufio.NewReader(r) + lines int + err error + ) + + for { + _, err = br.ReadString('\n') + lines++ + if err != nil { + break + } + } + + if err != io.EOF { + return 0, err + } + return lines, nil + } +``` + +We construct a `bufio.Reader`, then sit in a loop calling the `ReadString` method, incrementing a counter until we reach the end of the file, then we return the number of lines read. That’s the code we _wanted_ to write, instead `CountLines` is made more complicated by its error handling. For example, there is this strange construction: + +``` +_, err = br.ReadString('\n') +lines++ +if err != nil { + break +} +``` + +We increment the count of lines _before_ checking the error—​that looks odd. The reason we have to write it this way is `ReadString` will return an error if it encounters an end-of-file—`io.EOF`—before hitting a newline character. This can happen if there is no trailing newline. + +To address this problem, we rearrange the logic to increment the line count, then see if we need to exit the loop.1 + +But we’re not done checking errors yet. `ReadString` will return `io.EOF` when it hits the end of the file. This is expected, `ReadString` needs some way of saying _stop, there is nothing more to read_. So before we return the error to the caller of `CountLine`, we need to check if the error was _not_ `io.EOF`, and in that case propagate it up, otherwise we return `nil` to say that everything worked fine. This is why the final line of the function is not simply + +``` +return lines, err +``` + +I think this is a good example of Russ Cox’s [observation that error handling can obscure the operation of the function][3]. Let’s look at an improved version. + +``` +func CountLines(r io.Reader) (int, error) { + sc := bufio.NewScanner(r) + lines := 0 + + for sc.Scan() { + lines++ + } + + return lines, sc.Err() +} +``` + +This improved version switches from using `bufio.Reader` to `bufio.Scanner`. Under the hood `bufio.Scanner` uses `bufio.Reader` adding a layer of abstraction which helps remove the error handling which obscured the operation of our previous version of `CountLines` 2 + +The method `sc.Scan()` returns `true` if the scanner _has_ matched a line of text and _has not_ encountered an error. So, the body of our `for` loop will be called only when there is a line of text in the scanner’s buffer. This means our revised `CountLines` correctly handles the case where there is no trailing newline, It also correctly handles the case where the file is empty. + +Secondly, as `sc.Scan` returns `false` once an error is encountered, our `for` loop will exit when the end-of-file is reached or an error is encountered. The `bufio.Scanner` type memoises the first error it encounters and we recover that error once we’ve exited the loop using the `sc.Err()` method. + +Lastly, `buffo.Scanner` takes care of handling `io.EOF` and will convert it to a `nil` if the end of file was reached without encountering another error. + +* * * + +My second example is inspired by Rob Pikes’ _[Errors are values][4]_ blog post. + +When dealing with opening, writing and closing files, the error handling is present but not overwhelming as, the operations can be encapsulated in helpers like `ioutil.ReadFile` and `ioutil.WriteFile`. However, when dealing with low level network protocols it often becomes necessary to build the response directly using I/O primitives, thus the error handling can become repetitive. Consider this fragment of a HTTP server which is constructing a HTTP/1.1 response. + +``` +type Header struct { + Key, Value string +} + +type Status struct { + Code int + Reason string +} + +func WriteResponse(w io.Writer, st Status, headers []Header, body io.Reader) error { + _, err := fmt.Fprintf(w, "HTTP/1.1 %d %s\r\n", st.Code, st.Reason) + if err != nil { + return err + } + + for _, h := range headers { + _, err := fmt.Fprintf(w, "%s: %s\r\n", h.Key, h.Value) + if err != nil { + return err + } + } + + if _, err := fmt.Fprint(w, "\r\n"); err != nil { + return err + } + + _, err = io.Copy(w, body) + return err +} +``` + +First we construct the status line using `fmt.Fprintf`, and check the error. Then for each header we write the header key and value, checking the error each time. Lastly we terminate the header section with an additional `\r\n`, check the error, and copy the response body to the client. Finally, although we don’t need to check the error from `io.Copy`, we do need to translate it from the two return value form that `io.Copy` returns into the single return value that `WriteResponse` expects. + +Not only is this a lot of repetitive work, each operation—fundamentally writing bytes to an `io.Writer`—has a different form of error handling. But we can make it easier on ourselves by introducing a small wrapper type. + +``` +type errWriter struct { + io.Writer + err error +} + +func (e *errWriter) Write(buf []byte) (int, error) { + if e.err != nil { + return 0, e.err + } + + var n int + n, e.err = e.Writer.Write(buf) + return n, nil +} +``` + +`errWriter` fulfils the `io.Writer` contract so it can be used to wrap an existing `io.Writer`. `errWriter` passes writes through to its underlying writer until an error is detected. From that point on, it discards any writes and returns the previous error. + +``` +func WriteResponse(w io.Writer, st Status, headers []Header, body io.Reader) error { + ew := &errWriter{Writer: w} + fmt.Fprintf(ew, "HTTP/1.1 %d %s\r\n", st.Code, st.Reason) + + for _, h := range headers { + fmt.Fprintf(ew, "%s: %s\r\n", h.Key, h.Value) + } + + fmt.Fprint(ew, "\r\n") + io.Copy(ew, body) + + return ew.err +} +``` + +Applying `errWriter` to `WriteResponse` dramatically improves the clarity of the code. Each of the operations no longer needs to bracket itself with an error check. Reporting the error is moved to the end of the function by inspecting the `ew.err` field, avoiding the annoying translation from `io.Copy`’s return values. + +* * * + +When you find yourself faced with overbearing error handling, try to extract some of the operations into a helper type. + + 1. This logic _still_ isn’t correct, can you spot the bug? + 2. `bufio.Scanner` can scan for any pattern, by default it looks for newlines. + + + +### Related posts: + + 1. [Error handling vs. exceptions redux][5] + 2. [Stack traces and the errors package][6] + 3. [Subcommand handling in Go][7] + 4. [Constant errors][8] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/01/27/eliminate-error-handling-by-eliminating-errors + +作者:[Dave Cheney][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://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://go.googlesource.com/proposal/+/master/design/go2draft-error-handling-overview.md +[2]: https://www.amazon.com/Philosophy-Software-Design-John-Ousterhout/dp/1732102201 +[3]: https://www.youtube.com/watch?v=6wIP3rO6On8 +[4]: https://blog.golang.org/errors-are-values +[5]: https://dave.cheney.net/2014/11/04/error-handling-vs-exceptions-redux (Error handling vs. exceptions redux) +[6]: https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package (Stack traces and the errors package) +[7]: https://dave.cheney.net/2013/11/07/subcommand-handling-in-go (Subcommand handling in Go) +[8]: https://dave.cheney.net/2016/04/07/constant-errors (Constant errors) From 1f10664638ccb1ff9e9720a753a8e469f2294e25 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 17:42:07 +0800 Subject: [PATCH 1057/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190108=20Avoi?= =?UTF-8?q?d=20package=20names=20like=20base,=20util,=20or=20common=20sour?= =?UTF-8?q?ces/tech/20190108=20Avoid=20package=20names=20like=20base,=20ut?= =?UTF-8?q?il,=20or=20common.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ackage names like base, util, or common.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sources/tech/20190108 Avoid package names like base, util, or common.md diff --git a/sources/tech/20190108 Avoid package names like base, util, or common.md b/sources/tech/20190108 Avoid package names like base, util, or common.md new file mode 100644 index 0000000000..b2c70b0b2e --- /dev/null +++ b/sources/tech/20190108 Avoid package names like base, util, or common.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Avoid package names like base, util, or common) +[#]: via: (https://dave.cheney.net/2019/01/08/avoid-package-names-like-base-util-or-common) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Avoid package names like base, util, or common +====== + +Writing a good Go package starts with its name. Think of your package’s name as an elevator pitch, you have to describe what it does using just one word. + +A common cause of poor package names are _utility packages_. These are packages where helpers and utility code congeal. These packages contain an assortment of unrelated functions, as such their utility is hard to describe in terms of what the package _provides_. This often leads to a package’s name being derived from what the package _contains_ —utilities. + +Package names like `utils` or `helpers` are commonly found in projects which have developed deep package hierarchies and want to share helper functions without introducing import loops. Extracting utility functions to new package breaks the import loop, but as the package stems from a design problem in the project, its name doesn’t reflect its purpose, only its function in breaking the import cycle. + +> [A little] duplication is far cheaper than the wrong abstraction. + +— [Sandy Metz][1] + +My recommendation to improve the name of `utils` or `helpers` packages is to analyse where they are imported and move the relevant functions into the calling package. Even if this results in some code duplication this is preferable to introducing an import dependency between two packages. In the case where utility functions are used in many places, prefer multiple packages, each focused on a single aspect with a correspondingly descriptive name. + +Packages with names like `base` or `common` are often found when functionality common to two or more related facilities, for example common types between a client and server or a server and its mock, has been refactored into a separate package. Instead the solution is to reduce the number of packages by combining client, server, and common code into a single package named after the facility the package provides. + +For example, the `net/http` package does not have `client` and `server` packages, instead it has `client.go` and `server.go` files, each holding their respective types. `transport.go` holds for the common message transport code used by both HTTP clients and servers. + +Name your packages after what they _provide_ , not what they _contain_. + +### Related posts: + + 1. [Simple profiling package moved, updated][2] + 2. [The package level logger anti pattern][3] + 3. [How to include C code in your Go package][4] + 4. [Why I think Go package management is important][5] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/01/08/avoid-package-names-like-base-util-or-common + +作者:[Dave Cheney][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://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://www.sandimetz.com/blog/2016/1/20/the-wrong-abstraction +[2]: https://dave.cheney.net/2014/10/22/simple-profiling-package-moved-updated (Simple profiling package moved, updated) +[3]: https://dave.cheney.net/2017/01/23/the-package-level-logger-anti-pattern (The package level logger anti pattern) +[4]: https://dave.cheney.net/2013/09/07/how-to-include-c-code-in-your-go-package (How to include C code in your Go package) +[5]: https://dave.cheney.net/2013/10/10/why-i-think-go-package-management-is-important (Why I think Go package management is important) From 7650a5d0c2d8e510323e007b18755f26b642e85a Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 17:42:32 +0800 Subject: [PATCH 1058/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020181228=20The?= =?UTF-8?q?=20office=20coffee=20model=20of=20concurrent=20garbage=20collec?= =?UTF-8?q?tion=20sources/tech/20181228=20The=20office=20coffee=20model=20?= =?UTF-8?q?of=20concurrent=20garbage=20collection.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... model of concurrent garbage collection.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20181228 The office coffee model of concurrent garbage collection.md diff --git a/sources/tech/20181228 The office coffee model of concurrent garbage collection.md b/sources/tech/20181228 The office coffee model of concurrent garbage collection.md new file mode 100644 index 0000000000..825eb4b536 --- /dev/null +++ b/sources/tech/20181228 The office coffee model of concurrent garbage collection.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The office coffee model of concurrent garbage collection) +[#]: via: (https://dave.cheney.net/2018/12/28/the-office-coffee-model-of-concurrent-garbage-collection) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +The office coffee model of concurrent garbage collection +====== + +Garbage collection is a field with its own terminology. Concepts like like _mutator_ s, _card marking_ , and _write barriers_ create a hurdle to understanding how garbage collectors work. Here’s an analogy to explain the operations of a concurrent garbage collector using everyday items found in the workplace. + +Before we discuss the operation of _concurrent_ garbage collection, let’s introduce the dramatis personae. In offices around the world you’ll find one of these: + +![][1] + +In the workplace coffee is a natural resource. Employees visit the break room and fill their cups as required. That is, until the point someone goes to fill their cup only to discover the pot is _empty_! + +Immediately the office is thrown into chaos. Meeting are called. Investigations are held. The perpetrator who took the last cup without refilling the machine is found and [reprimanded][2]. Despite many passive aggressive notes the situation keeps happening, thus a committee is formed to decide if a larger coffee pot should be requisitioned. Once the coffee maker is again full office productivity slowly returns to normal. + +This is the model of _stop the world_ garbage collection. The various parts of your program proceed through their day consuming memory, or in our analogy coffee, without a care about the next allocation that needs to be made. Eventually one unlucky attempt to allocate memory is made only to find the heap, or the coffee pot, exhausted, triggering a stop the world garbage collection. + +* * * + +Down the road at a more enlightened workplace, management have adopted a different strategy for mitigating their break room’s coffee problems. Their policy is simple: if the pot is more than half full, fill your cup and be on your way. However, if the pot is less than half full, _before_ filling your cup, you must add a little coffee and a little water to the top of the machine. In this way, by the time the next person arrives for their re-up, the level in the pot will hopefully have risen higher than when the first person found it. + +This policy does come at a cost to office productivity. Rather than filling their cup and hoping for the best, each worker may, depending on the aggregate level of consumption in the office, have to spend a little time refilling the percolator and topping up the water. However, this is time spent by a person who was already heading to the break room. It costs a few extra minutes to maintain the coffee machine, but does not impact their officemates who aren’t in need of caffeination. If several people take a break at the same time, they will all find the level in the pot below the half way mark and all proceed to top up the coffee maker–the more consumption, the greater the rate the machine will be refilled, although this takes a little longer as the break room becomes congested. + +This is the model of _concurrent garbage collection_ as practiced by the Go runtime (and probably other language runtimes with concurrent collectors). Rather than each heap allocation proceeding blindly until the heap is exhausted, leading to a long stop the world pause, concurrent collection algorithms spread the work of walking the heap to find memory which is no longer reachable over the parts of the program allocating memory. In this way the parts of the program which allocate memory each pay a small cost–in terms of latency–for those allocations rather than the whole program being forced to halt when the heap is exhausted. + +Lastly, in keeping with the office coffee model, if the rate of coffee consumption in the office is so high that management discovers that their staff are always in the break room trying desperately to refill the coffee machine, it’s time to invest in a machine with a bigger pot–or in garbage collection terms, grow the heap. + +### Related posts: + + 1. [Visualising the Go garbage collector][3] + 2. [A whirlwind tour of Go’s runtime environment variables][4] + 3. [Why is a Goroutine’s stack infinite ?][5] + 4. [Introducing Go 2.0][6] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2018/12/28/the-office-coffee-model-of-concurrent-garbage-collection + +作者:[Dave Cheney][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://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/wp-content/uploads/2018/12/20181204175004_79256.jpg +[2]: https://www.youtube.com/watch?v=ww86iaucd2A +[3]: https://dave.cheney.net/2014/07/11/visualising-the-go-garbage-collector (Visualising the Go garbage collector) +[4]: https://dave.cheney.net/2015/11/29/a-whirlwind-tour-of-gos-runtime-environment-variables (A whirlwind tour of Go’s runtime environment variables) +[5]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutine’s stack infinite ?) +[6]: https://dave.cheney.net/2016/10/25/introducing-go-2-0 (Introducing Go 2.0) From 2e560198a131f869be9c6b6c5bcd8ce919d90050 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 20 Jun 2019 18:59:15 +0800 Subject: [PATCH 1059/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190620=20Crac?= =?UTF-8?q?ks=20appear=20in=20Intel=E2=80=99s=20grip=20on=20supercomputing?= =?UTF-8?q?=20sources/talk/20190620=20Cracks=20appear=20in=20Intel-s=20gri?= =?UTF-8?q?p=20on=20supercomputing.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ppear in Intel-s grip on supercomputing.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md diff --git a/sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md b/sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md new file mode 100644 index 0000000000..5ff550d3fc --- /dev/null +++ b/sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cracks appear in Intel’s grip on supercomputing) +[#]: via: (https://www.networkworld.com/article/3403443/cracks-appear-in-intels-grip-on-supercomputing.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Cracks appear in Intel’s grip on supercomputing +====== +New competitors threaten to take Intel’s dominance in the high-performance computing (HPC) world, and we’re not even talking about AMD (yet). +![Randy Wong/LLNL][1] + +It’s June, so it’s that time again for the twice-yearly Top 500 supercomputer list, where bragging rights are established or, in most cases, reaffirmed. The list constantly shifts as new trends appear, and one of them might be a break in Intel’s dominance. + +[Supercomputers in the top 10 list][2] include a lot of IBM Power-based systems, and almost all run Nvidia GPUs. But there’s more going on than that. + +For starters, an ARM supercomputer has shown up, at #156. [Astra][3] at Sandia National Laboratories is an HPE system running Cavium (now Marvell) ThunderX2 processors. It debuted on the list at #204 last November, but thanks to upgrades, it has moved up the list. It won’t be the last ARM server to show up, either. + +**[ Also see:[10 of the world's fastest supercomputers][2] | Get daily insights: [Sign up for Network World newsletters][4] ]** + +Second is the appearance of four Nvidia DGX servers, with the [DGX SuperPOD][5] ranking the highest at #22. [DGX systems][6] are basically compact GPU boxes with a Xeon just to boot the thing. The GPUs do all the heavy lifting. + +AMD hasn’t shown up yet with the Epyc processors, but it will, given Cray is building them for the government. + +This signals a breaking up of the hold Intel has had on the high-performance computing (HPC) market for a long time, said Ashish Nadkarni, group vice president in IDC's worldwide infrastructure practice. “The Intel hold has already been broken up by all the accelerators in the supercomputing space. The more accelerators they use, the less need they have for Xeons. They can go with other processors that do justice to those accelerators,” he told me. + +With so much work in HPC and artificial intelligence (AI) being done by GPUs, the x86 processor becomes just a boot processor in a way. I wasn’t kidding about the DGX box. It’s got one Xeon and eight Tesla GPUs. And the Xeon is an E5, a midrange part. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][7] ]** + +“They don’t need high-end Xeons in servers any more, although there’s a lot of supercomputers that just use CPUs. The fact is there are so many options now,” said Nadkarni. One example of an all-CPU system is [Frontera][8], a Dell-based system at the Texas Advanced Computing Center in Austin. + +The top two computers, Sierra and Summit, both run IBM Power9 RISC processors, as well as Nvidia GPUs. All told, Nvidia is in 125 of the 500 supercomputers, including five of the top 10, the fastest computer in the world, the fastest in Europe (Piz Daint) and the fastest in Japan (ABCI). + +Lenovo was the top hardware provider, beating out Dell, HPE, and IBM combined. That’s because of its large presence in its native China. Nadkari said Lenovo, which acquired the IBM x86 server business in 2014, has benefitted from the IBM installed base, which has continued wanting the same tech from Lenovo under new ownership. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403443/cracks-appear-in-intels-grip-on-supercomputing.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/10/sierra875x500-100778404-large.jpg +[2]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html +[3]: https://www.top500.org/system/179565 +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.top500.org/system/179691 +[6]: https://www.networkworld.com/article/3196088/nvidias-new-volta-based-dgx-1-supercomputer-puts-400-servers-in-a-box.html +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[8]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html#slide7 +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 0510dd29620f314b088f9de12b02f47e3fbbe2b3 Mon Sep 17 00:00:00 2001 From: Name1e5s Date: Thu, 20 Jun 2019 21:15:35 +0800 Subject: [PATCH 1060/1154] [Translating] A Quick Look at Elvish Shell --- sources/tech/20190528 A Quick Look at Elvish Shell.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20190528 A Quick Look at Elvish Shell.md b/sources/tech/20190528 A Quick Look at Elvish Shell.md index 778965d442..82927332a7 100644 --- a/sources/tech/20190528 A Quick Look at Elvish Shell.md +++ b/sources/tech/20190528 A Quick Look at Elvish Shell.md @@ -1,3 +1,4 @@ +Translating by name1e5s [#]: collector: (lujun9972) [#]: translator: ( ) [#]: reviewer: ( ) From dffa4d6d087b4dd98b87514007e97490272a0398 Mon Sep 17 00:00:00 2001 From: yuqi Date: Thu, 20 Jun 2019 23:33:22 +0800 Subject: [PATCH 1061/1154] 20190301 Emacs for (even more of) the win.md translating complete --- ...190301 Emacs for (even more of) the win.md | 84 ------------------- ...190301 Emacs for (even more of) the win.md | 83 ++++++++++++++++++ 2 files changed, 83 insertions(+), 84 deletions(-) delete mode 100644 sources/tech/20190301 Emacs for (even more of) the win.md create mode 100644 translated/tech/20190301 Emacs for (even more of) the win.md diff --git a/sources/tech/20190301 Emacs for (even more of) the win.md b/sources/tech/20190301 Emacs for (even more of) the win.md deleted file mode 100644 index 995d678073..0000000000 --- a/sources/tech/20190301 Emacs for (even more of) the win.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (oneforalone) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Emacs for (even more of) the win) -[#]: via: (https://so.nwalsh.com/2019/03/01/emacs) -[#]: author: (Norman Walsh https://so.nwalsh.com) - -Emacs for (even more of) the win -====== - -I use Emacs every day. I rarely notice it. But when I do, it usually brings me joy. - ->If you are a professional writer…Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish. - -I’ve been using [Emacs][1] for well over twenty years. I use it for writing almost anything and everything (I edit Scala and Java in [IntelliJ][2]). I read my email in it. If it can be done in Emacs, that’s where I prefer to do it. - -Although I’ve used Emacs for literally decades, I realized around the new year that very little about my use of Emacs had changed in the past decade or more. New editing modes had come along, of course, I’d picked up a package or two, and I did adopt [Helm][3] a few years ago, but mostly it just did all the heavy lifting that I required of it, day in and day out without complaining or getting in my way. On the one hand, that’s a testament to how good it is. On the other hand, that’s an invitation to dig in and see what I’ve missed. - -At about the same time, I resolved to improve several aspects of my work life: - - * **Better meeting management.** I’m lead on a couple of projects at work and those projects have meetings, both regularly scheduled and ad hoc; some of them I run, some of them, I only attend. - -I realized I’d become sloppy about my participation in meetings. It’s all too easy sit in a room where there’s a meeting going on but actually read email and work on other items. (I strongly oppose the “no laptops” rule in meetings, but that’s a topic for another day.) - -There are a couple of problems with sloppy participation. First, it’s disrespectful to the person who convened the meeting and the other participants. That’s actually sufficient reason not to do it, but I think there’s another problem: it disguises the cost of meetings. - -If you’re in a meeting but also answering your email and maybe fixing a bug, then that meeting didn’t cost anything (or as much). If meetings are cheap, then there will be more of them. - -I want fewer, shorter meetings. I don’t want to disguise their cost, I want them to be perceived as damned expensive and to be avoided unless absolutely necessary. - -Sometimes, they are absolutely necessary. And I appreciate that a quick meeting can sometimes resolve an issue quickly. But if I have ten short meetings a day, let’s not pretend that I’m getting anything else productive accomplished. - -I resolved to take notes at all the meetings I attend. I’m not offering to take minutes, necessarily, but I am taking minutes of a sort. It keeps me focused on the meeting and not catching up on other things. - - * **Better time management.** There are lots and lots of things that I need or want to do, both professionally and personally. I’ve historically kept track off some of them in issue lists, some in saved email threads (in Emacs and [Gmail][4], for slightly different types of reminders), in my calendar, on “todo lists” of various sorts on my phone, and on little scraps of paper. And probably other places as well. - -I resolved to keep them all in one place. Not because I think there’s one place that’s uniformly best or better, but because I hope to accomplish two things. First, by having them all in one place, I hope to be able to develop a better and more holistic view of where I’m putting my energies. Second, because I want to develop a habitn. “A settled or regular tendency or practice, especially one that is hard to give up.” of recording, tracking, and preserving them. - - * **Better accountability.** If you work in certain science or engineering disciplines, you will have developed the habit of keeping a [lab notebook][5]. Alas, I did not. But I resolved to do so. - -I’m not interested in the legal aspects that encourage bound pages or scribing only in permanent marker. What I’m interested in is developing the habit of keeping a record. My goal is to have a place to jot down ideas and design sketches and the like. If I have sudden inspiration or if I think of an edge case that isn’t in the test suite, I want my instinct to be to write it in my journal instead of scribbling it on a scrap of paper or promising myself that I’ll remember it. - - - - -This confluence of resolutions led me quickly and more-or-less directly to [Org][6]. There is a large, active, and loyal community of Org users. I’ve played with it in the past (I even [wrote about it][7], at least in passing, a couple of years ago) and I tinkered long enough to [integrate MarkLogic][8] into it. (Boy has that paid off in the last week or two!) - -But I never used it. - -I am now using it. I take minutes in it, I record all of my todo items in it, and I keep a journal in it. I’m not sure there’s much value in me attempting to wax eloquent about it or enumerate all its features, you’ll find plenty of either with a quick web search. - -If you use Emacs, you should be using Org. If you don’t use Emacs, I’m confident you wouldn’t be the first person who started because of Org. It does a lot. It takes a little time to learn your way around and remember the shortcuts, but I think it’s worth it. (And if you carry an [iOS][9] device in your pocket, I recommend [beorg][10] for recording items while you’re on the go.) - -Naturally, I worked out how to [get XML out of it][11]⊕“Worked out” sure is a funny way to spell “hacked together in elisp.”. And from there, how to turn it back into the markup my weblog expects (and do so at the push of a button in Emacs, of course). So this is the first posting written in Org. It won’t be the last. - -P.S. Happy birthday [little weblog][12]. - --------------------------------------------------------------------------------- - -via: https://so.nwalsh.com/2019/03/01/emacs - -作者:[Norman Walsh][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://so.nwalsh.com -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Emacs -[2]: https://en.wikipedia.org/wiki/IntelliJ_IDEA -[3]: https://emacs-helm.github.io/helm/ -[4]: https://en.wikipedia.org/wiki/Gmail -[5]: https://en.wikipedia.org/wiki/Lab_notebook -[6]: https://en.wikipedia.org/wiki/Org-mode -[7]: https://www.balisage.net/Proceedings/vol17/html/Walsh01/BalisageVol17-Walsh01.html -[8]: https://github.com/ndw/ob-ml-marklogic/ -[9]: https://en.wikipedia.org/wiki/IOS -[10]: https://beorgapp.com/ -[11]: https://github.com/ndw/org-to-xml -[12]: https://so.nwalsh.com/2017/03/01/helloWorld diff --git a/translated/tech/20190301 Emacs for (even more of) the win.md b/translated/tech/20190301 Emacs for (even more of) the win.md new file mode 100644 index 0000000000..16313fc019 --- /dev/null +++ b/translated/tech/20190301 Emacs for (even more of) the win.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: (oneforalone) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Emacs for (even more of) the win) +[#]: via: (https://so.nwalsh.com/2019/03/01/emacs) +[#]: author: (Norman Walsh https://so.nwalsh.com) + +Emacs 的胜利(或是更多) +====== + +我天天用 Emacs,但我却从意识到。但是每当我用 Emacs 时,它都给我带来了很多乐趣。 + +>如果你是个职业作家……Emacs 与其它的编辑器的相比就如皓日与群星一样。不仅更大、更亮,它轻而易举就让其他所有的东西都消失了。 + +我用 [Emacs][1] 已有二十多年了。我用它来写几乎所有的东西(Scala 和 Java 我用 [IntelliJ][2])。看邮件的话我是能在 Emacs 里看就在里面看。 + +尽管我用 Emacs 已有数十年,我在新年前后才意识到,在过去10年或更长时间里,我对 Emacs 的使用几乎没有什么变化。当然,新的编辑模式出现了,我就会选一两个插件,几年前我确实是用了 [Helm][3],但大多数时候,它只是完成了我需要的所有繁重工作,日复一日,没有抱怨,也没有妨碍我。一方面,这证明了它有多好。另一方面,这是一个邀请,让我深入挖掘,看看我错过了什么。 + +于此同时,我也决定从以下几方面改进我的工作方式: + + * **更好的议程管理** 我在工作中负责几个项目,这些项目有定期和临时的会议;有些我是我主持的,有些我只要参加就可以。 + +我意识到我对开会变得草率起来了了。坐在一个有会议要开的房间里实在是太容易了,但实际上你可以阅读电子邮件,处理其他事情。(我强烈反对在会议中“禁止携带笔记本电脑”的这条规定,但这就是另一个话题。) + +草率地去开会有几个问题。首先,这是对主持会议的人和其他参与者的不尊重。实际上这是不这么做的完美理由,但我还有意识到令一个问题:它忽视了会议的成本。 + +如果你在开会,但同时还要回复电子邮件,也许还要改 bug,那么这个会议就不需要花费任何东西(或同样多的钱)。如果会议成本低廉,那么会议数量将会更多。 + +我想要少点、短些的会议。我不想忽视它们的成本,我想让开会变得很有价值,除非绝对必要,否则就可以避免。 + +有时,开会是很有必要的。而且我认为一个简短的会能够很快的解决问题。但是,如果我一天有十个短会的话,那还是不要说我做了些有成果的事吧。 + +我决定在我参加的所有的会上做笔记。我并不是说一定要做会议记录,而是我在做某种会议记录。这会让我把注意力集中在开会上,而忽略其他事。 + + * **更好的时间管理** 我有很多要做和想做的事,或工作的或私人的。之前,我有在问题清单和邮件进程(Emacs 和 [Gmail][4] 中,用于一些稍微不同的提醒)、日历、手机上各种各样的“待办事项列表”和小纸片上记录过它们。可能还有其他地方。 + +我决定把它们放在一起。不是说我认为有一个地方就最好或更好,而是说我想完成两件事。首先,把它们都放在一个地方,我能够对我把精力放在哪里有一个更好、更全面的看法。第二,也是因为我想养成一个习惯。固定的或有规律的倾向或行为,尤指难以放弃的。记录、跟踪并保存它们。 + + * **更好的说明** 如果你在某些科学或工程领域工作,你就会养成记笔记的习惯。唉,我没有。但我决定这么做。 + +我对法律上鼓励装订页面或做永久标记并不感兴趣。我感兴趣的是养成做记录的习惯。我的目标是有一个地方记下想法和设计草图等。如果我突然有了灵感,或者我想到了一个不在测试套件中的边缘案例,我希望我的本能是把它写在我的日志中,而不是草草写在一张小纸片上,或者向自己保证我会记住它。 + + + +这些决心让我很快或多或少地转到了 [Org][6]。Org 有一个庞大的、活跃的、忠诚的用户社区。我以前也用过它(顺带一提,我有[写过][7]它,至少在几年前),我花了很长的一段时间(将 [MarkLogic 集成][8]到其中。(天哪,这在过去的一两个星期里得到了回报!) + +但我从没用过 Org。 + +我现在正在用它。我用了几分钟,我把所有要做的事情都记录下来,我还记了日记。我不确定我试图对它进行边界或列举它的所有特性有多大价值,你可以通过网页快速地搜索找到很多。 + +如果你用 Emacs,那你也应该用 Org。如果没用过Emacs,我相信你不会是第一个因 Org 而使用 Emacs 的人。Org 可以做很多。它需要一点时间来学习你的方法和快捷键,但我认为这是值得的。(如果你的口袋中有一台 [iOS][9] 设备,我推荐你在忙的时候使用 [beorg][10] 来记录。) + +当然,我想出了如何[将 XML 从其中提取出来][11]⊕“working out” 确实是“用 elisp 来编程”的一种有趣的拼写方式。然后,如何将它转换回我的 weblog 期望的标记(当然,在 Emacs 中按下一个按钮就可以做到)。这是第一次用 Org 写的帖子。这也不会是最后一次。 + +附注:生日快乐,[小博客][12]。 + +-------------------------------------------------------------------------------- + +via: https://so.nwalsh.com/2019/03/01/emacs + +作者:[Norman Walsh][a] +选题:[lujun9972][b] +译者:[oneforalone](https://github.com/oneforalone) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://so.nwalsh.com +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Emacs +[2]: https://en.wikipedia.org/wiki/IntelliJ_IDEA +[3]: https://emacs-helm.github.io/helm/ +[4]: https://en.wikipedia.org/wiki/Gmail +[5]: https://en.wikipedia.org/wiki/Lab_notebook +[6]: https://en.wikipedia.org/wiki/Org-mode +[7]: https://www.balisage.net/Proceedings/vol17/html/Walsh01/BalisageVol17-Walsh01.html +[8]: https://github.com/ndw/ob-ml-marklogic/ +[9]: https://en.wikipedia.org/wiki/IOS +[10]: https://beorgapp.com/ +[11]: https://github.com/ndw/org-to-xml +[12]: https://so.nwalsh.com/2017/03/01/helloWorld From 23faef53e58505349f8508b4fe6b5cffb8814c9f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Jun 2019 01:29:11 +0800 Subject: [PATCH 1062/1154] PRF:20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md @wxy --- ...music lovers- Headphone, amps, and more.md | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md b/translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md index d81d9e27d4..b491d64758 100644 --- a/translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md +++ b/translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Open hardware for musicians and music lovers: Headphone, amps, and more) @@ -10,40 +10,39 @@ 音乐家和音乐爱好者的开放硬件:耳机、放大器等 ====== -从 3D 打印乐器到将隔空播放声音的设备,有很多可以通过开放硬件项目来制造音乐的方法。 +> 从 3D 打印乐器到无线播放声音的设备,有很多通过开放硬件项目来奏乐的方法。 ![][1] -这个世界到处都是很棒的[开源音乐播放器][2],但为什么只是将开源用在播放音乐上呢?你还可以使用开源硬件制造音乐。本文中描述的所有工具都是经过了[开源硬件协会][3](OSHWA)认证的。这意味着你可以自由地构建它们,重新组合它们,或者用它们做任何其他事情。 +这个世界到处都是很棒的[开源音乐播放器][2],但为什么只是将开源用在播放音乐上呢?你还可以使用开源硬件奏乐。本文中描述的所有工具都是经过了[开源硬件协会][3](OSHWA)认证的。这意味着你可以自由地构建它们,重新组合它们,或者用它们做任何其他事情。 ### 开源乐器 -当你想制作音乐时,乐器始终是一个好的起点。如果你更倾向于传统的的乐器,那么[F-F-Fiddle][4]可能适合你。 +当你想奏乐时使用乐器总是最好的方式之一。如果你喜欢传统的的乐器,那么 [F-F-Fiddle][4] 可能适合你。 ![F-f-fiddle][5] -F-F-Fiddle 是一款全尺寸电子小提琴,你可以使用标准桌面 3D 打印机制作([熔丝制造][6])。如果你觉得眼见为真,那么这里有一个 F-F-Fiddle 的视频: https://youtu.be/8NDWVcJJS2Y +F-F-Fiddle 是一款全尺寸电子小提琴,你可以使用标准的桌面 3D 打印机制作(采用[熔丝制造][6])。如果你想眼见为真,那么这里有一个 F-F-Fiddle 的视频: https://img.linux.net.cn/static/video/The%20F-F-Fiddle-8NDWVcJJS2Y.mp4 -精通小提琴,但还对一些更具异国情调的东西感兴趣?[开源特雷门琴][7]Open Theremin怎么样? +如果你精通小提琴,但还对一些更具异国情调的东西感兴趣?[开源的特雷门琴][7]Open Theremin怎么样? ![Open Theremin][8] 与所有特雷门琴一样,开源特雷门琴可让你在不触碰乐器的情况下播放音乐。当然,它特别擅长为你的下一个科幻视频或空间主题派对制作[令人毛骨悚然的空间声音][9]。 -[Waft][10] 的操作类似,也可以远程控制声音。它使用[激光雷达][11]来测量手与传感器的距离。看看这个: https://vimeo.com/203705197 +[Waft][10] 的操作类似,也可以远程控制声音。它使用[激光雷达][11]来测量手与传感器的距离。看看这个: https://img.linux.net.cn/static/video/Waft%20Prototype%2012-Feb-2017-203705197.mp4 Waft 是特雷门琴吗?我不确定算不算,特雷门琴高手可以在下面的评论里发表一下看法。 -如果特雷门琴对你来说太熟悉了,[SIGNUM][12]可能就是你想要的。用其开发人员的话说,SIGNUM 通过将不可见的无线通信转换为可听信号来“揭示加密的信息代码和人/机通信的语言”。 +如果特雷门琴对你来说太熟悉了,[SIGNUM][12] 可能就是你想要的。用其开发人员的话说,SIGNUM 通过将不可见的无线通信转换为可听信号来“揭示加密的信息代码和人/机通信的语言”。 ![SIGNUM][13] -这是演示: https://vimeo.com/142831757 - +这是演示: https://img.linux.net.cn/static/video/SIGNUM_Portable%20Analog%20Instrumentation%20Amplifier-142831757.mp4 ### 输入 -无论你使用什么乐器,都需要将其插入某些东西。如果你想要连接到树莓派,请尝试 [AudioSense-Pi][14],它允许你一次将多个输入和输出连接到你的树莓派。 +无论你使用什么乐器,都需要将其接到某些东西上。如果你想要连接到树莓派,请尝试 [AudioSense-Pi][14],它允许你一次将多个输入和输出连接到你的树莓派。 ![AudioSense-Pi][15] @@ -55,7 +54,7 @@ Waft 是特雷门琴吗?我不确定算不算,特雷门琴高手可以在下 ### 耳机 -制作所有这些音乐很棒,但你还需要考虑如何听它。幸运的是,[EQ-1耳机][18]是开源和可以 3D 打印的。 +制作所有这些音乐很棒,但你还需要考虑如何听它。幸运的是,[EQ-1耳机][18]是开源,支持 3D 打印。 ![EQ-1 headphones][19] @@ -68,7 +67,7 @@ via: https://opensource.com/article/19/6/hardware-music 作者:[Michael Weinberg][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9f1b862afcdbd2789bc3747dd0c09947464f7d54 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Jun 2019 01:31:40 +0800 Subject: [PATCH 1063/1154] PUB:20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md @wxy https://linux.cn/article-10998-1.html --- ...r musicians and music lovers- Headphone, amps, and more.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md (98%) diff --git a/translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md b/published/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md similarity index 98% rename from translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md rename to published/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md index b491d64758..03a5f4dd47 100644 --- a/translated/tech/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md +++ b/published/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10998-1.html) [#]: subject: (Open hardware for musicians and music lovers: Headphone, amps, and more) [#]: via: (https://opensource.com/article/19/6/hardware-music) [#]: author: (Michael Weinberg https://opensource.com/users/mweinberg) From c38b3d8b8023023bcc64b135ecf0b6ec264779d2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Jun 2019 01:44:49 +0800 Subject: [PATCH 1064/1154] PRF:20190612 Installing alternative versions of RPMs in Fedora.md @geekpi --- ... alternative versions of RPMs in Fedora.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md b/translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md index 23f95600d7..831723db0f 100644 --- a/translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md +++ b/translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md @@ -1,24 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Installing alternative versions of RPMs in Fedora) [#]: via: (https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/) [#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) -在 Fedora 中安装替代版本的 RPM +在 Fedora 中安装替代版本的 RPM 包 ====== ![][1] -[模块化][2](Modularity)使 Fedora 能够在仓库中提供替代版本的 RPM 软件包。为每个 Fedroa 版本原生构建了多个不同的应用、语言运行时和工具版本。 +[模块化][2]Modularity使 Fedora 能够在仓库中提供替代版本的 RPM 软件包。每个 Fedroa 版本可以原生构建不同应用、语言运行时和工具版本的多个版本。 -Fedora Magazine 大约一年前就写了 [Fedora 28 服务器版的模块化][3]。那时,它只是一个有附加内容的可选仓库,并且明确只支持服务器版。到目前为止,它已经发生了很多变化,现在**模块化是 Fedora 发行版的核心部分**。一些软件包已完全变成模块。在编写本文时,Fedora 30 的 49,464 个二进制 RPM 软件包中的 1,119(2.26%)来自一个模块([关于这个数字的更多信息][4])。 +Fedora Magazine 大约一年前就写了 [Fedora 28 服务器版的模块化][3]。那时,它只是一个有附加内容的可选仓库,并且明确只支持服务器版。到目前为止,它已经发生了很多变化,现在**模块化是 Fedora 发行版的核心部分**。一些软件包已完全变成模块。在编写本文时,Fedora 30 的 49,464 个二进制 RPM 软件包中的 1,119(2.26%)来自模块([关于这个数字的更多信息][4])。 ### 模块化基础知识 -由于许多软件包有不同的版本会让人难以承受(并且难以管理),所以包被分组为**模块**,这代表一个应用程序、一个语言运行时或任何其他合理的组。 +由于许多软件包有不同的版本会让人难以承受(并且难以管理),所以包被分组为**模块**,它可以代表一个应用程序、一个语言运行时或任何其他合理的组。 模块通常有多个**流**,这通常代表软件的主要版本。它可以并行使用,但在给定系统上只能安装每个模块的一个流。 @@ -28,9 +28,9 @@ Fedora Magazine 大约一年前就写了 [Fedora 28 服务器版的模块化][3] ### 实际使用模块化 -当你在 Fedora 系统上安装 RPM 软件包时,它很可能它来自模块流。你可能没有注意到的原因之一是模块化的核心原则之一是在你要了解之前保持不可见。 +当你在 Fedora 系统上安装 RPM 软件包时,它很可能它来自模块流。你可能没有注意到的原因之一是模块化的核心原则之一是在你探究之前保持不可见。 -让我们比较以下两种情况。首先,安装流行的 _i3_ 平铺窗口管理器,然后安装极简化的 _dwm_ 窗口管理器: +让我们比较以下两种情况。首先,安装流行的 i3 平铺窗口管理器,然后安装极简化的 dwm 窗口管理器: ``` $ sudo dnf install i3 @@ -38,7 +38,7 @@ $ sudo dnf install i3 Done! ``` -正如所料,上面的命令会在系统上安装 _i3_ 包及其依赖项。这里没有其他事情发生。但另一个会怎么样? +正如所料,上面的命令会在系统上安装 i3 包及其依赖项。这里没有其他事情发生。但另一个会怎么样? ``` $ sudo dnf install dwm @@ -49,11 +49,11 @@ Enabling module streams: Done! ``` -感觉是一样的,但后台发生了一些事情 。它启用了默认的 _dwm_ 模块流 (_6.1_),并且安装了模块中的 _dwm_ 包。 +感觉是一样的,但后台发生了一些事情 。它启用了默认的 dwm 模块流(6.1),并且安装了模块中的 dwm 包。 为了保持透明,输出中有一条关于模块自动启用的消息。但除此之外,用户不需要了解模块化的任何信息,以便按照他们一贯的方式使用他们的系统。 -但如果他们使用模块化方式呢?让我们看看如何安装不同版本的 _dwm_。 +但如果他们使用模块化方式呢?让我们看看如何安装不同版本的 dwm。 使用以下命令查看可用的模块流: @@ -68,9 +68,9 @@ dwm 6.2 ... Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled ``` -输出显示 _dwm_ 模块有四个流,_6.1_ 是默认值。 +输出显示 dwm 模块有四个流,6.1 是默认值。 -要安装不同版本的 _dwm_ 包,例如,安装 _6.2_ 的流。启用他,然后使用以下两个命令安装软件包: +要安装不同版本的 dwm 包,例如,安装 6.2 的流。启用它,然后使用以下两个命令安装软件包: ``` $ sudo dnf module enable dwm:6.2 @@ -120,7 +120,7 @@ via: https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/ 作者:[Adam Šamalík][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/) 荣誉推出 @@ -128,6 +128,6 @@ via: https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/ [b]: https://github.com/lujun9972 [1]: https://fedoramagazine.org/wp-content/uploads/2019/06/modularity-f30-816x345.jpg [2]: https://docs.pagure.org/modularity -[3]: https://fedoramagazine.org/modularity-fedora-28-server-edition/ +[3]: https://linux.cn/article-10479-1.html [4]: https://blog.samalik.com/2019/06/12/counting-modularity-packages.html [5]: https://docs.fedoraproject.org/en-US/modularity/using-modules/ From 3c9e3f6e0dfa6d49acdddb62bac4da1e9a229a1d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Jun 2019 01:45:21 +0800 Subject: [PATCH 1065/1154] PUB:20190612 Installing alternative versions of RPMs in Fedora.md @geekpi https://linux.cn/article-10999-1.html --- ...90612 Installing alternative versions of RPMs in Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190612 Installing alternative versions of RPMs in Fedora.md (98%) diff --git a/translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md b/published/20190612 Installing alternative versions of RPMs in Fedora.md similarity index 98% rename from translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md rename to published/20190612 Installing alternative versions of RPMs in Fedora.md index 831723db0f..54406f13ba 100644 --- a/translated/tech/20190612 Installing alternative versions of RPMs in Fedora.md +++ b/published/20190612 Installing alternative versions of RPMs in Fedora.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10999-1.html) [#]: subject: (Installing alternative versions of RPMs in Fedora) [#]: via: (https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/) [#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) From 0be233d8d85b4d2c756245b056949a4955f578dd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Jun 2019 02:12:51 +0800 Subject: [PATCH 1066/1154] PRF:20190508 Why startups should release their code as open source.md @chen-ni --- ...hould release their code as open source.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/translated/tech/20190508 Why startups should release their code as open source.md b/translated/tech/20190508 Why startups should release their code as open source.md index f5da2b2148..7256e60b3a 100644 --- a/translated/tech/20190508 Why startups should release their code as open source.md +++ b/translated/tech/20190508 Why startups should release their code as open source.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why startups should release their code as open source) @@ -9,32 +9,34 @@ 为什么初创公司应该将代码开源 ====== -Dokit 曾经怀疑将自己的知识开源可能是一个失败的商业决策,然而正是这个选择奠定了它的成功。 + +> Dokit 曾经怀疑将自己的知识开源可能是一个失败的商业决策,然而正是这个选择奠定了它的成功。 + ![open source button on keyboard][1] -回想一个项目开展最初期的细节并不是一件容易的事情,但有时候可以帮助你更清晰地理解这个项目。如果让我来说,关于 [Dokit][2] 这个用来创建用户手册和文档的平台的最早的想法来自我的童年。小时候我家里都是 Meccano(译注:一种类似乐高的拼装玩具)和飞机模型之类的玩具,对于我来说,游戏中很重要的一部分就是动手制作,把独立的零件组装在一起来创造一个新的东西。我父亲在一家 DIY 公司工作,所以家里的很多东西也都和建筑、修理,以及使用说明书有关。小的时候父母还让我参加了童子军,在那里我们制作桌子和帐篷,还有泥巴做的烧烤炉,这些事情都培养了我在共同学习中感受到的乐趣,就像我在开源活动中感受到的一样。 +回想一个项目开展最初期的细节并不是一件容易的事情,但这有时候可以帮助你更清晰地理解这个项目。如果让我来说,关于 [Dokit][2] 这个用来创建用户手册和文档的平台的最早的想法来自我的童年。小时候我家里都是 Meccano(LCTT 译注:一种类似乐高的拼装玩具)和飞机模型之类的玩具,对于我来说,游戏中很重要的一部分就是动手制作,把独立的零件组装在一起来创造一个新的东西。我父亲在一家 DIY 公司工作,所以家里到处都建筑、修理,以及使用说明书。小的时候父母还让我参加了童子军,在那里我们制作桌子和帐篷,还有泥巴做的烧烤炉,这些事情都培养了我在共同学习中感受到的乐趣,就像我在开源活动中感受到的一样。 -在童年学到的修理东西和回收产品的艺术后来成为了我工作的一部分。后来我决心要用线上的方式,还原这种在家里或者小组里学习如何制作和修理东西时的那种非常棒的感觉。Dokit 就从这个想法中诞生了。 +在童年学到的修理东西和回收产品的本领成为了我工作的一部分。后来我决心要用线上的方式,还原这种在家里或者小组里学习如何制作和修理东西时的那种非常棒的感觉。Dokit 就从这个想法中诞生了。 ### 创业初期 -事情并非一帆风顺,在我们的公司于 2017 年成立之后,我很快就意识到那些最庞大、最值得奋斗的目标一般来说也总是最困难的。如果想要实现我们的计划 —— 彻底改变 [人们旧有的编写和发行说明书和用户手册的方式][3],并且在这个细分市场(我们非常清楚这一点)里取得最大的影响力 —— 那么确立一个主导任务就十分关键,它关乎项目的组织方式。我们据此做出了第一个重要决策:首先 [在短时间内使用一个已有的开源框架 MediaWiki 制作产品原型来验证我们的想法][4],然后将我们的全部代码都作为开源项目发布。 +事情并非一帆风顺,在我们的公司于 2017 年成立之后,我很快就意识到那些最庞大、最值得奋斗的目标一般来说也总是最困难的。如果想要实现我们的计划 —— 彻底改变 [老式的说明书和用户手册的编写和发行方式][3],并且在这个细分市场(我们非常清楚这一点)里取得最大的影响力 —— 那么确立一个主导任务就十分关键,它关乎项目的组织方式。我们据此做出了第一个重要决策:首先 [在短时间内使用一个已有的开源框架 MediaWiki 制作产品原型来验证我们的想法][4],然后将我们的全部代码都作为开源项目发布。 -当时 [MediaWiki][5] 已经在正常运作了,事后看来,这一点让我们的决策变得容易了许多。这个平台已经拥有我们设想的最小可用产品(MVP)所需要的 90% 的功能,并且在全世界范围内有 15000 名活跃的开发者。MediaWiki 因为是维基百科的驱动引擎而小有名气,如果没有来自它的支持,事情对我们来说无疑会困难很多。还有一个许多公司都在使用的文档平台 Confluence 也有一些不错的功能,但是最终还是不难在这两者之间做出选择。 +当时 [MediaWiki][5] 已经在正常运作了,事后看来,这一点让我们的决策变得容易了许多。这个平台已经拥有我们设想的最小可用产品(MVP)所需要的 90% 的功能,并且在全世界范围内有 15000 名活跃的开发者。MediaWiki 因为是维基百科的驱动引擎而小有名气,如果没有来自它的支持,事情对我们来说无疑会困难很多。还有一个许多公司都在使用的文档平台 Confluence 也有一些不错的功能,但是最终在这两者之间做出选择还是很容易的。 -出于对 Github 的信赖,我们把自己平台的初始版本完全放在了这个社区上。我们甚至还没有真正开始进行推广,就已经可以看到世界各地的制造者开始使用我们的平台,这种令人激动的感觉似乎说明我们的选择是正确的。尽管 [制造商以及 Fablab 运动][6](译注: Fablab 是一种向个人提供包括 3D 打印在内的电子化制造服务的小型工坊)都在鼓励用户积极分享说明材料,并且在 [Fablab 契约][7] 中也写明了这一点,现实中像模像样的文档还是不太多见。 +出于对社区的信赖,我们把自己平台的初始版本完全放在了 GitHub 上。我们甚至还没有真正开始进行推广,就已经可以看到世界各地的创客们开始使用我们的平台,这种令人激动的感觉似乎说明我们的选择是正确的。尽管 [创客以及 Fablab 运动][6](LCTT 译注:Fablab 是一种向个人提供包括 3D 打印在内的电子化制造服务的小型工坊)都在鼓励用户积极分享说明材料,并且在 [Fablab 章程][7] 中也写明了这一点,但现实中像模像样的文档还是不太多见。 -人们喜欢使用我们这个平台的首要原因是它可以解决一个非常实在的问题:一个本来还不错的项目,却使用了非常糟糕的文档 —— 其实这个项目本来可以变得更好的。对我们来说,这有点儿像是在修复 DIY 以及动手爱好者社区里的一个裂缝。在我们的平台发布后的一年之内,Fablabs、[Wikifab][8]、[Open Source Ecology][9]、[Les Petits Debrouillards][10]、[Ademe][11] 以及 [Low-Tech Lab][12] 都在他们的服务器上安装了我们的工具,用来制作逐步引导的教程。 +人们喜欢使用我们这个平台的首要原因是它可以解决一个非常实在的问题:一个本来还不错的项目,却使用了非常糟糕的文档 —— 其实这个项目本来可以变得更好的。对我们来说,这有点儿像是在修复创客及 DIY 社区里的一个裂缝。在我们的平台发布后的一年之内,Fablabs、[Wikifab][8]、[Open Source Ecology][9]、[Les Petits Debrouillards][10]、[Ademe][11] 以及 [Low-Tech Lab][12] 都在他们的服务器上安装了我们的工具,用来制作逐步引导的教程。 -甚至在我们还没有发新闻稿之前,我们的其中一个用户 Wikifab 就开始在全国性媒体上收到“DIY 界的维基百科”这样的称赞了。仅仅两年之内,我们看到有数百的社区都在他们自己的 Dokits 上开展了项目,从有意思的、搞笑的,到那种很正式的产品手册都有。这种社区的力量正是我们想要驾驭的,并且有这么多的项目 —— 从风力涡轮机到宠物喂食器 —— 都在使用我们创建的平台编写非常有吸引力的产品手册,这件事情真的令我们赞叹不已。 +甚至在我们还没有发新闻稿之前,我们的其中一个用户 Wikifab 就开始在全国性媒体上收到“DIY 界的维基百科”这样的称赞了。短短两年之内,我们看到有数百的社区都在他们自己的 Dokits 上开展了项目,从有意思的、搞笑的,到那种很正式的产品手册都有。这种社区的力量正是我们想要驾驭的,并且有这么多的项目 —— 从风力涡轮机到宠物喂食器 —— 都在使用我们创建的平台编写非常有吸引力的产品手册,这件事情真的令我们赞叹不已。 ### 项目开源 回头看看前两年的成功,很明显选择开源是我们能迅速取得成果的关键因素。最有价值的事情就是在开源项目中获得反馈的能力了。如果一段代码无法正常运行,[会有人立刻告诉我们][14]。如果可以从这些已经在使用你提供的服务的人那里学到这么多东西,为什么还要需要等着和顾问们开会呢? -Github 社区对我们这个项目的关注程度也反映出了这个市场的潜力(包括利润上的潜力)。[巴黎有非常好的、成长迅速的开发者社区][15](译注:Dokit 是一家设立在巴黎的公司),但是开源将我们从一个只有数千当地人的小池子里带到了全世界数百万的开发者身边,他们都将成为我们的创作中的一部分。与此同时,代码的开放性也让我们的用户和客户更加放心,因为即使我们这个公司不在了,代码仍然会存续下去。 +社区对我们这个项目的关注程度也反映出了这个市场的潜力(包括利润上的潜力)。[巴黎有一个非常好的、成长迅速的开发者社区][15](LCTT 译注:Dokit 是一家设立在巴黎的公司),但是开源将我们从一个只有数千当地人的小池子里带到了全世界数百万的开发者身边,他们都将成为我们的创作中的一部分。与此同时,代码的开放性也让我们的用户和客户更加放心,因为即使我们这个公司不在了,代码仍然会存续下去。 -如果说上面这些都是在我们之前对开源的预期之中的话,其实这一路上也有不少惊喜。因为开源,我们获得了更多的客户、声望以及精准推广,这种推广本来以我们有限的预算是负担不起的,现在却不需要我们支付费用。开放代码还优化了我们的招聘流程,因为在雇佣之前就可以通过我们的代码来测试候选人,并且被雇佣之后的入职过程也会更加顺利。 +如果说上面这些都是在我们之前对开源的预期之中的话,其实这一路上也有不少惊喜。因为开源,我们获得了更多的客户、声望以及精准推广,这种推广本来以我们有限的预算是负担不起的,现在却不需要我们支付费用。我们发现开源代码还改善了我们的招聘流程,因为在雇佣之前就可以通过我们的代码来测试候选人,并且被雇佣之后的入职过程也会更加顺利。 开发者在完全公开的情况下写代码,既有一点尴尬,同时也很团结,这对我们提升产品质量很有帮助。人们可以互相发表意见和反馈,并且因为工作都是完全公开的,人们似乎会尽可能地想做到最好。为了不断优化、不断重构 Dokit 的运行方式,我们明白未来应该在对社区的支持上做得更好。 @@ -44,7 +46,7 @@ Github 社区对我们这个项目的关注程度也反映出了这个市场的 在创业初期,我们对将自己的知识免费分发出去这件事还是非常担心的。事实证明正好相反 —— 正是开源让我们能够迅速构建起一个可持续的初创企业。Dokit 平台的设计初衷是通过社区的支持,让它的用户有信心去构建、组装、修理和创造全新的发明。事后看来,我们用开源的方式去构建了 Dokit 这个平台,这和 Dokit 本身想做的其实正好是同一件事情。 -如同修理或者组装一件实体产品一样,只有当你对自己的方法有信心的时候,事情才会越来越顺利。现在,在我们创业的第三个年头,我们开始注意到全世界对这个领域的兴趣在增加,因为它迎合了出于不断变化的居家和生活方式的需求而 [想要使用、重复利用以及组装产品的新一代客户][16]。我们正是在通过线上社区的支持,创造一个让大家能够在自己动手做东西的时候感到更加有信心的平台。 +如同修理或者组装一件实体产品一样,只有当你对自己的方法有信心的时候,事情才会越来越顺利。现在,在我们创业的第三个年头,我们开始注意到全世界对这个领域的兴趣在增加,因为它迎合了出于不断变化的居家和生活方式的需求而 [想要使用或重复利用以及组装产品的新一代客户][16]。我们正是在通过线上社区的支持,创造一个让大家能够在自己动手做东西的时候感到更加有信心的平台。 -------------------------------------------------------------------------------- @@ -53,7 +55,7 @@ via: https://opensource.com/article/19/5/startups-release-code 作者:[Clément Flipo][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/) 荣誉推出 From 5a04dbce29b3856950663acfcbfafba0b6f22d49 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Jun 2019 02:16:14 +0800 Subject: [PATCH 1067/1154] PUB:20190508 Why startups should release their code as open source.md @chen-ni https://linux.cn/article-11000-1.html --- ...8 Why startups should release their code as open source.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190508 Why startups should release their code as open source.md (99%) diff --git a/translated/tech/20190508 Why startups should release their code as open source.md b/published/20190508 Why startups should release their code as open source.md similarity index 99% rename from translated/tech/20190508 Why startups should release their code as open source.md rename to published/20190508 Why startups should release their code as open source.md index 7256e60b3a..ff12c65320 100644 --- a/translated/tech/20190508 Why startups should release their code as open source.md +++ b/published/20190508 Why startups should release their code as open source.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11000-1.html) [#]: subject: (Why startups should release their code as open source) [#]: via: (https://opensource.com/article/19/5/startups-release-code) [#]: author: (Clément Flipo https://opensource.com/users/cl%C3%A9ment-flipo) From 09c76244b9c30499a1aab19c4296438c16b4346e Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 21 Jun 2019 09:10:42 +0800 Subject: [PATCH 1068/1154] translated --- ...19 Get the latest Ansible 2.8 in Fedora.md | 60 ------------------- ...19 Get the latest Ansible 2.8 in Fedora.md | 60 +++++++++++++++++++ 2 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md create mode 100644 translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md diff --git a/sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md b/sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md deleted file mode 100644 index 7feffbf41b..0000000000 --- a/sources/tech/20190619 Get the latest Ansible 2.8 in Fedora.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Get the latest Ansible 2.8 in Fedora) -[#]: via: (https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/) -[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) - -Get the latest Ansible 2.8 in Fedora -====== - -![][1] - -Ansible is one of the most popular automation engines in the world. It lets you automate virtually anything, from setup of a local system to huge groups of platforms and apps. It’s cross platform, so you can use it with all sorts of operating systems. Read on for more information on how to get the latest Ansible in Fedora, some of its changes and improvements, and how to put it to use. - -### Releases and features - -Ansible 2.8 was recently released with many fixes, features, and enhancements. It was available in Fedora mere days afterward as an official update in Fedora 29 and 30, as well as EPEL. The follow-on version 2.8.1 released two weeks ago. Again, the new release was available within a few days in Fedora. - -Installation is, of course, easy to do from the official Fedora repositories [using sudo][2]: - -``` -$ sudo dnf -y install ansible -``` - -The 2.8 release has a long list of changes, and you can read them in the [Porting Guide for 2.8][3]. But they include some goodies, such as _Python interpreter discovery._ Ansible 2.8 now tries to figure out which Python is preferred by the platform it runs on. In cases where that fails, Ansible uses a fallback list. However, you can still use a variable _ansible_python_interpreter_ to set the Python interpreter. - -Another change makes Ansible more consistent across platforms. Since _sudo_ is more exclusive to UNIX/Linux, and other platforms don’t have it, _become_ is now used in more places. This includes command line switches. For example, _–ask-sudo-pass_ has become _–ask-become-pass_ , and the prompt is now _BECOME password:_ instead. - -There are many more features in the 2.8 and 2.8.1 releases. Do check out the [official changelog on GitHub][4] for all the details. - -### Using Ansible - -Maybe you’re not sure if Ansible is something you could really use. Don’t worry, you might not be alone in thinking that, because it’s so powerful. But it turns out that it’s not hard to use it even for simple or individual setups like a home with a couple computers (or even just one!). - -We covered this topic earlier in the Fedora magazine as well: - -> [Using Ansible to set up a workstation][5] - -Give Ansible a try and see what you think. The great part about it is that Fedora stays quite up to date with the latest releases. Happy automating! - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/ - -作者:[Paul W. Frields][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/pfrields/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/ansible28-816x345.jpg -[2]: https://fedoramagazine.org/howto-use-sudo/ -[3]: https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html -[4]: https://github.com/ansible/ansible/blob/stable-2.8/changelogs/CHANGELOG-v2.8.rst -[5]: https://fedoramagazine.org/using-ansible-setup-workstation/ diff --git a/translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md b/translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md new file mode 100644 index 0000000000..d189875e73 --- /dev/null +++ b/translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get the latest Ansible 2.8 in Fedora) +[#]: via: (https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +在 Fedora 中获取最新的 Ansible 2.8 +====== + +![][1] + +Ansible 是世界上最受欢迎的自动化引擎之一。它能让你自动化几乎任何事情,从本地系统的设置到大量的平台和应用。它是跨平台的,因此你可以将其用于各种操作系统。继续阅读以获取有关如何在 Fedora 中获取最新 Ansible,一些更改和改进,以及如何使用它。 + +### 发布版本和功能 + +最近发布了 Ansible 2.8,其中包含许多修复,功能和增强。仅仅几天之后,它就可在 Fedora 29 和 30 以及 EPEL 中获取。两周前发布了后续版本 2.8.1。同样,新版本在几天内就可以在 Fedora 中获取。 + +[使用 sudo][2] 能够非常容易地从官方仓库安装: + +``` +$ sudo dnf -y install ansible +``` + +2.8 版本有很长的更新列表,你可以在 [2.8 的迁移指南][3]中阅读查看。但其中包含了一些好东西,比如 _Python 解释器发现_ 。Ansible 2.8 现在会试图找出哪个 Python 是它运行的平台的首选。如果失败,Ansible 会使用后备列表。但是,你仍然可以使用变量 _ansible_python_interpreter_ 来设置 Python 解释器。 + +另一个变化使 Ansible 在各个平台上更加一致。由于 _sudo_ 专用于 UNIX/Linux,而其他平台并没有,因此现在在更多地方使用 _become_。这包括了命令行开关。例如,_-ask-sudo-pass_ 已变成了 _-ask-become-pass_,提示符也变成了 _BECOME password:_。 + +2.8 和 2.8.1 版本中还有许多其他功能。有关所有细节,请查看 [GitHub 上的官方更新日志][4]。 + +### 使用 Ansible + +也许你不确定 Ansible 是否可以实际使用。别担心,你并不是唯一一个这样想的,因为它太强大了。但事实证明,它并不难以使用,在一个家庭内的几台电脑(甚至一台电脑)上设置都可以。 + +我们之前在 Fedora Magazine 中也讨论过这个话题: + +> [使用 Ansible 设置工作站][5] + +试试看 Ansible,说下你的想法。很重要的一部分是让 Fedora 保持最新版本。自动化快乐! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/ + +作者:[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/2019/06/ansible28-816x345.jpg +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html +[4]: https://github.com/ansible/ansible/blob/stable-2.8/changelogs/CHANGELOG-v2.8.rst +[5]: https://fedoramagazine.org/using-ansible-setup-workstation/ From 9c5d31d06f6fa91ea409d84fc2d4adebeae7a6c7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 21 Jun 2019 09:37:56 +0800 Subject: [PATCH 1069/1154] translating --- .../tech/20190614 Personal assistant with Mycroft and Fedora.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190614 Personal assistant with Mycroft and Fedora.md b/sources/tech/20190614 Personal assistant with Mycroft and Fedora.md index f7f0edebfc..25feafdc93 100644 --- a/sources/tech/20190614 Personal assistant with Mycroft and Fedora.md +++ b/sources/tech/20190614 Personal assistant with Mycroft and Fedora.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 372aca73b38bdfbb96b7cbb1554b178e4a48aa3b Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Jun 2019 15:49:23 +0800 Subject: [PATCH 1070/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190620=20Carr?= =?UTF-8?q?ier=20services=20help=20expand=20healthcare,=20with=205G=20in?= =?UTF-8?q?=20the=20offing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md --- ...xpand healthcare, with 5G in the offing.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md diff --git a/sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md b/sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md new file mode 100644 index 0000000000..072b172fda --- /dev/null +++ b/sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Carrier services help expand healthcare, with 5G in the offing) +[#]: via: (https://www.networkworld.com/article/3403366/carrier-services-help-expand-healthcare-with-5g-in-the-offing.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Carrier services help expand healthcare, with 5G in the offing +====== +Many telehealth initiatives tap into wireless networking supplied by service providers that may start offering services such as Citizen's Band and 5G to support remote medical care. +![Thinkstock][1] + +There are connectivity options aplenty for most types of [IoT][2] deployment, but the idea of simply handing the networking part of the equation off to a national licensed wireless carrier could be the best one for certain kinds of deployments in the medical field. + +Telehealth systems, for example, are still a relatively new facet of modern medicine, but they’re already among the most important applications that use carrier networks to deliver care. One such system is operated by the University of Mississippi Medical Center, for the treatment and education of diabetes patients. + +**[More on wireless:[The time of 5G is almost here][3]]** + +**[ Now read[20 hot jobs ambitious IT pros should shoot for][4]. ]** + +Greg Hall is the director of IT at UMMC’s center for telehealth. He said that the remote patient monitoring system is relatively simple by design – diabetes patients receive a tablet computer that they can use to input and track their blood sugar levels, alert clinicians to symptoms like nerve pain or foot sores, and even videoconference with their doctors directly. The tablet connects via Verizon, AT&T or CSpire – depending on who’s got the best coverage in a given area – back to UMMC’s servers. + +According to Hall, there are multiple advantages to using carrier connectivity instead of unlicensed (i.e. purpose-built [Wi-Fi][5] or other technology) to connect patients – some of whom live in remote parts of the state – to their caregivers. + +“We weren’t expecting everyone who uses the service to have Wi-Fi,” he said, “and they can take their tablet with them if they’re traveling.” + +The system serves about 250 patients in Mississippi, up from roughly 175 in the 2015 pilot program that got the effort off the ground. Nor is it strictly limited to diabetes care – Hall said that it’s already been extended to patients suffering from chronic obstructive pulmonary disease, asthma and even used for prenatal care, with further expansion in the offing. + +“The goal of our program isn’t just the monitoring piece, but also the education piece, teaching a person to live with their [condition] and thrive,” he said. + +It hasn’t all been smooth sailing. One issue was caused by the natural foliage of the area, as dense areas of pine trees can cause transmission problems, thanks to their needles being a particularly troublesome length and interfering with 2.5GHz wireless signals. But Hall said that the team has been able to install signal boosters or repeaters to overcome that obstacle. + +Neurologist Dr. Allen Gee’s practice in Wyoming attempts to address a similar issue – far-flung patients with medical needs that might not be addressed by the sparse local-care options. From his main office in Cody, he said, he can cover half the state via telepresence, using a purpose-built system that is based on cellular-data connectivity from TCT, Spectrum and AT&T, as well as remote audiovisual equipment and a link to electronic health records stored in distant locations. That allows him to receive patient data, audio/visual information and even imaging diagnostics remotely. Some specialists in the state are able to fly to those remote locations, others are not. + +While Gee’s preference is to meet with patients in person, that’s just not always possible, he said. + +“Medical specialists don’t get paid for windshield time,” he noted. “Being able to transfer information from an EHR facilitates the process of learning about the patient.” + +### 5G is coming** + +** + +According to Alan Stewart-Brown, vice president at infrastructure management vendor Opengear, there’s a lot to like about current carrier networks for medical use – particularly wide coverage and a lack of interference – but there are bigger things to come. + +“We have customers that have equipment in ambulances for instance, where they’re livestreaming patients’ vital signs to consoles that doctors can monitor,” he said. “They’re using carrier 4G for that right now and it works well enough, but there are limitations, namely latency, which you don’t get on [5G][6].” + +Beyond the simple fact of increased throughput and lower latency, widespread 5G deployments could open a wide array of new possibilities for medical technology, mostly involving real-time, very-high-definition video streaming. These include medical VR, remote surgery and the like. + +“The process you use to do things like real-time video – right now on a 4G network, that may or may not have a delay,” said Stewart-Brown. “Once you can get rid of the delay, the possibilities are endless as to what you can use the technology for.” + +### Citizens band + +Ron Malenfant, chief architect for service provider IoT at Cisco, agreed that the future of 5G for medical IoT is bright, but said that the actual applications of the technology have to be carefully thought out. + +“The use cases need to be worked on,” he said. “The innovative [companies] are starting to say ‘OK, what does 5G mean to me’ and starting to plan use cases.” + +One area that the carriers themselves have been eyeing recently is the CBRS band of radio frequencies, which sits around 3.5GHz. It’s what’s referred to as “lightly licensed” spectrum, in that parts of it are used for things like CB radio and other parts are the domain of the U.S. armed forces, and it could be used to build private networks for institutional users like hospitals, instead of deploying small but expensive 4G cells. The idea is that the institutions would be able to lease those frequencies for their specific area from the carrier directly for private LTE/CBRS networks, and, eventually 5G, Malenfant said. + +There’s also the issue, of course, that there are still a huge amount of unknowns around 5G, which isn’t expected to supplant LTE in the U.S. for at least another year or so. The medical field’s stiff regulatory requirements could also prove a stumbling block for the adoption of newer wireless technology. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403366/carrier-services-help-expand-healthcare-with-5g-in-the-offing.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/07/stethoscope_mobile_healthcare_ipad_tablet_doctor_patient-100765655-large.jpg +[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[4]: https://www.networkworld.com/article/3276025/careers/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[5]: https://www.networkworld.com/article/3238664/80211-wi-fi-standards-and-speeds-explained.html +[6]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From e57d2418436b603c63f42b37b0ef7bd98dd7a836 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Jun 2019 15:49:43 +0800 Subject: [PATCH 1071/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190620=20Seve?= =?UTF-8?q?ral=20deals=20solidify=20the=20hybrid=20cloud=E2=80=99s=20statu?= =?UTF-8?q?s=20as=20the=20cloud=20of=20choice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md --- ...d cloud-s status as the cloud of choice.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md diff --git a/sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md b/sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md new file mode 100644 index 0000000000..ade07dcb10 --- /dev/null +++ b/sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Several deals solidify the hybrid cloud’s status as the cloud of choice) +[#]: via: (https://www.networkworld.com/article/3403354/several-deals-solidify-the-hybrid-clouds-status-as-the-cloud-of-choice.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Several deals solidify the hybrid cloud’s status as the cloud of choice +====== +On-premises and cloud connections are being built by all the top vendors to bridge legacy and modern systems, creating hybrid cloud environments. +![Getty Images][1] + +The hybrid cloud market is expected to grow from $38.27 billion in 2017 to $97.64 billion by 2023, at a Compound Annual Growth Rate (CAGR) of 17.0% during the forecast period, according to Markets and Markets. + +The research firm said the hybrid cloud is rapidly becoming a leading cloud solution, as it provides various benefits, such as cost, efficiency, agility, mobility, and elasticity. One of the many reasons is the need for interoperability standards between cloud services and existing systems. + +Unless you are a startup company and can be born in the cloud, you have legacy data systems that need to be bridged, which is where the hybrid cloud comes in. + +So, in very short order we’ve seen a bunch of new alliances involving the old and new guard, reiterating that the need for hybrid solutions remains strong. + +**[ Read also:[What hybrid cloud means in practice][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** + +### HPE/Google + +In April, the Hewlett Packard Enterprise (HPE) and Google announced a deal where HPE introduced a variety of server solutions for Google Cloud’s Anthos, along with a consumption-based model for the validated HPE on-premises infrastructure that is integrated with Anthos. + +Following up with that, the two just announced a strategic partnership to create a hybrid cloud for containers by combining HPE’s on-premises infrastructure, Cloud Data Services, and GreenLake consumption model with Anthos. This allows for: + + * Bi-directional data mobility for data mobility and consistent data services between on-premises and cloud + * Application workload mobility to move containerized app workloads across on-premises and multi-cloud environments + * Multi-cloud flexibility, offering the choice of HPE Cloud Volumes and Anthos for what works best for the workload + * Unified hybrid management through Anthos, so customers can get a unified and consistent view of their applications and workloads regardless of where they reside + * Charged as a service via HPE GreenLake + + + +### IBM/Cisco + +This is a furthering of an already existing partnership between IBM and Cisco designed to deliver a common and secure developer experience across on-premises and public cloud environments for building modern applications. + +[Cisco said it will support IBM Cloud Private][4], an on-premises container application development platform, on Cisco HyperFlex and HyperFlex Edge hyperconverged infrastructure. This includes support for IBM Cloud Pak for Applications. IBM Cloud Paks deliver enterprise-ready containerized software solutions and developer tools for building apps and then easily moving to any cloud—public or private. + +This architecture delivers a common and secure Kubernetes experience across on-premises (including edge) and public cloud environments. IBM’s Multicloud Manager covers monitoring and management of clusters and container-based applications running from on-premises to the edge, while Cisco’s Virtual Application Centric Infrastructure (ACI) will allow customers to extend their network fabric from on-premises to the IBM Cloud. + +### IBM/Equinix + +Equinix expanded its collaboration with IBM Cloud to bring private and scalable connectivity to global enterprises via Equinix Cloud Exchange Fabric (ECX Fabric). This provides private connectivity to IBM Cloud, including Direct Link Exchange, Direct Link Dedicated and Direct Link Dedicated Hosting, that is secure and scalable. + +ECX Fabric is an on-demand, SDN-enabled interconnection service that allows any business to connect between its own distributed infrastructure and any other company’s distributed infrastructure, including cloud providers. Direct Link provides IBM customers with a connection between their network and IBM Cloud. So ECX Fabric provides IBM customers with a secured and scalable network connection to the IBM Cloud service. + +At the same time, ECX Fabric provides secure connections to other cloud providers, and most customers prefer a multi-vendor approach to avoid vendor lock-in. + +“Each of the partnerships focus on two things: 1) supporting a hybrid-cloud platform for their existing customers by reducing the friction to leveraging each solution and 2) leveraging the unique strength that each company brings. Each of the solutions are unique and would be unlikely to compete directly with other partnerships,” said Tim Crawford, president of Avoa, an IT consultancy. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403354/several-deals-solidify-the-hybrid-clouds-status-as-the-cloud-of-choice.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/cloud_hand_plus_sign_private-100787051-large.jpg +[2]: https://www.networkworld.com/article/3249495/what-hybrid-cloud-mean-practice +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/3403363/cisco-connects-with-ibm-in-to-simplify-hybrid-cloud-deployment.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 7b40a0b00748cb5ddde2c1032f82b583e6538a11 Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Fri, 21 Jun 2019 17:05:58 +0800 Subject: [PATCH 1072/1154] Update 20190111 Top 5 Linux Distributions for Productivity.md --- ... 5 Linux Distributions for Productivity.md | 58 ++++--------------- 1 file changed, 12 insertions(+), 46 deletions(-) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md index d73c26ee09..5bbae53e33 100644 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md @@ -14,23 +14,19 @@ 必须承认的是,这样一个热门的话题其实很难被总结出来。为什么呢?首先,Linux 在设计层面就是一种有生产力的操作系统。由于它极强的可靠性和稳定的平台,使得工作的开展变得简易化。其次为了衡量工作的效率,你需要考虑到哪项工作需要得到生产力方面的助推。是普通办公?开发类工作?学校事务?数据挖掘?或者是人力资源?你可以看到这一问题变得复杂起来了。 -I have to confess, this particular topic is a tough one to address. Why? First off, Linux is a productive operating system by design. Thanks to an incredibly reliable and stable platform, getting work done is easy. Second, to gauge effectiveness, you have to consider what type of work you need a productivity boost for. General office work? Development? School? Data mining? Human resources? You see how this question can get somewhat complicated. +然而,这并不意味着那些基于推动底层操作系统成为更为高效平台的发行版们可以在配置和呈现方面做的更好。恰恰相反,许多发行版在偏离生产力这条道路上越走越远,所以你不会意识到你自己处在工作的窘境中,而是继续挖掘自己的潜力在工期结束之前拼命赶上进度。这些 Linux 发行版可以帮助你化繁为简,因此或许可以减少你工作流程中的痛点。 -然而,这并不意味着那些 +让我们来看一下这些发行版并为你找出适合你的最佳选择。为了更具条理,我按照生产力诉求把他们分成了几类。这项任务本身也是一种挑战,因为每个人在生产力提升上的需要是千差万别的。然而,我所关注的是下列的几项: -That doesn’t mean, however, that some distributions aren’t able to do a better job of configuring and presenting that underlying operating system into an efficient platform for getting work done. Quite the contrary. Some distributions do a much better job of “getting out of the way,” so you don’t find yourself in a work-related hole, having to dig yourself out and catch up before the end of day. These distributions help strip away the complexity that can be found in Linux, thereby making your workflow painless. + * 普通生产力: 适于从事复杂工作并希望提升工作效率。 -Let’s take a look at the distros I consider to be your best bet for productivity. To help make sense of this, I’ve divided them into categories of productivity. That task itself was challenging, because everyone’s productivity varies. For the purposes of this list, however, I’ll look at: + * 平面设计: 适于从事设计创造和图像处理的人们。 - * General Productivity: For those who just need to work efficiently on multiple tasks. + * 开发: 适于那些使用 Linux 桌面发行版来进行编程工作。 - * Graphic Design: For those that work with the creation and manipulation of graphic images. + * 管理人员: 适于那些需要某些版本来促进一体化的管理任务的人员。 - * Development: For those who use their Linux desktops for programming. - - * Administration: For those who need a distribution to facilitate their system administration tasks. - - * Education: For those who need a desktop distribution to make them more productive in an educational environment. + * 教育: 适于那些需要桌面发行版可以助力他们在教育领域更创造力的人们。 @@ -117,45 +113,15 @@ openSUSE:Education-Li-f-e 包含了一下工具: * TuxType - 一款为少儿准备的打字入门软件 - * wxMaxima - A cross platform GUI for the computer algebra system + * wxMaxima - 一个跨平台的计算机代数系统 - * Inkscape - Vector graphics program + * Inkscape - 矢量图形编辑软件 - * GIMP - Graphic image manipulation program + * GIMP - 图像处理软件(译注:被誉为 Linux 上的 PhotoShop) * Pencil - GUI prototyping tool - * Hugin - Panorama photo stitching and HDR merging program - -openSUSE:Education-Li-f-e includes tools like: - - * Brain Workshop - A dual n-back brain exercise - - * GCompris - An educational software suite for young children - - * gElemental - A periodic table viewer - - * iGNUit - A general purpose flash card program - - * Little Wizard - Development environment for children based on Pascal - - * Stellarium - An astronomical sky simulator - - * TuxMath - An math tutor game - - * TuxPaint - A drawing program for young children - - * TuxType - An educational typing tutor for children - - * wxMaxima - A cross platform GUI for the computer algebra system - - * Inkscape - Vector graphics program - - * GIMP - Graphic image manipulation program - - * Pencil - GUI prototyping tool - - * Hugin - Panorama photo stitching and HDR merging program + * Hugin - 全景照片拼接及 HDR 效果混合软件 ![Education][18] @@ -166,7 +132,7 @@ Figure 5: The openSUSE:Education-Li-f-e distro has plenty of tools to help you b Also included with openSUSE:Education-Li-f-e is the [KIWI-LTSP Server][19]. The KIWI-LTSP Server is a flexible, cost effective solution aimed at empowering schools, businesses, and organizations all over the world to easily install and deploy desktop workstations. Although this might not directly aid the student to be more productive, it certainly enables educational institutions be more productive in deploying desktops for students to use. For more information on setting up KIWI-LTSP, check out the openSUSE [KIWI-LTSP quick start guide][20]. -Learn more about Linux through the free ["Introduction to Linux" ][21]course from The Linux Foundation and edX. +Learn more about Linux through the free ["Introduction to Linux"][21]course from The Linux Foundation and edX. -------------------------------------------------------------------------------- From a5e0fdd94e3405b23b454c82c20cdf50de70af4a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 Jun 2019 17:12:21 +0800 Subject: [PATCH 1073/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190621=207=20?= =?UTF-8?q?infrastructure=20performance=20and=20scaling=20tools=20you=20sh?= =?UTF-8?q?ould=20be=20using?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190621 7 infrastructure performance and scaling tools you should be using.md --- ...e and scaling tools you should be using.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20190621 7 infrastructure performance and scaling tools you should be using.md diff --git a/sources/tech/20190621 7 infrastructure performance and scaling tools you should be using.md b/sources/tech/20190621 7 infrastructure performance and scaling tools you should be using.md new file mode 100644 index 0000000000..3a9003ae9c --- /dev/null +++ b/sources/tech/20190621 7 infrastructure performance and scaling tools you should be using.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 infrastructure performance and scaling tools you should be using) +[#]: via: (https://opensource.com/article/19/6/performance-scaling-tools) +[#]: author: (Pradeep SurisettyPeter Portante https://opensource.com/users/psuriset/users/aakarsh/users/portante/users/anaga) + +7 infrastructure performance and scaling tools you should be using +====== +These open source tools will help you feel confident in your +infrastructure's performance as it scales up. +![Several images of graphs.][1] + +[Sysadmins][2], [site reliability engineers][3] (SREs), and cloud operators all too often struggle to feel confident in their infrastructure as it scales up. Also too often, they think the only way to solve their challenges is to write a tool for in-house use. Fortunately, there are options. There are many open source tools available to test an infrastructure's performance. Here are my favorites. + +### Pbench + +Pbench is a performance testing harness to make executing benchmarks and performance tools easier and more convenient. In short, it: + + * Excels at running micro-benchmarks on large scales of hosts (bare-metal, virtual machines, containers, etc.) while automating a potentially large set of benchmark parameters + * Focuses on installing, configuring, and executing benchmark code and performance tools and not on provisioning or orchestrating the testbed (e.g., OpenStack, RHEV, RHEL, Docker, etc.) + * Is designed to work in concert with provisioning tools like BrowBeat or Ansible playbooks + + + +Pbench's [documentation][4] includes installation and user guides, and the code is [maintained on GitHub][5], where the team welcomes contributions and issues. + +### Ripsaw + +Baselining is a critical aspect of infrastructure reliability. Ripsaw is a performance benchmark Operator for launching workloads on Kubernetes. It deploys as a Kuberentes Operator that then deploys common workloads, including specific applications (e.g., Couchbase) or general performance tests (e.g., Uperf) to measure and establish a performance baseline. + +Ripsaw is [maintained on GitHub][6]. You can also find its maintainers on the [Kubernetes Slack][7], where they are active contributors. + +### OpenShift Scale + +The collection of tools in OpenShift Scale, OpenShift's open source solution for performance testing, do everything from spinning up OpenShift on OpenStack installations (TripleO Install and ShiftStack Install), installing on Amazon Web Services (AWS), or providing containerized tooling, like running Pbench on your cluster or doing cluster limits testing, network tests, storage tests, metric tests with Prometheus, logging, and concurrent build testing. + +Scale's CI suite is flexible enough to both add workloads and include your workloads when deploying to Azure or anywhere else you might run. You can see the full suite of tools [on GitHub][8]. + +### Browbeat + +[Browbeat][9] calls itself "a performance tuning and analysis tool for OpenStack." You can use it to analyze and tune the deployment of your workloads. It also automates the deployment of standard monitoring and data analysis tools like Grafana and Graphite. Browbeat is [maintained on GitHub][10]. + +### Smallfile + +Smallfile is a filesystem workload generator targeted for scale-out, distributed storage. It has been used to test a number of open filesystem technologies, including GlusterFS, CephFS, Network File System (NFS), Server Message Block (SMB), and OpenStack Cinder volumes. It is [maintained on GitHub][11]. + +### Ceph Benchmarking Tool + +Ceph Benchmarking Tool (CBT) is a testing harness that can automate tasks for testing [Ceph][12] cluster performance. It records system metrics with collectl, and it can collect more information with tools including perf, blktrace, and valgrind. CBT can also do advanced testing that includes automated object storage daemon outages, erasure-coded pools, and cache-tier configurations. + +Contributors have extended CBT to use [Pbench monitoring tools and Ansible][13] and to run the [Smallfile benchmark][14]. A separate Grafana visualization dashboard uses Elasticsearch data generated by [Automated Ceph Test][15]. + +### satperf + +Satellite-performance (satperf) is a set of Ansible playbooks and helper scripts to deploy Satellite 6 environments and measure the performance of selected actions, such as concurrent registrations, remote execution, Puppet operations, repository synchronizations and promotions, and more. You can find Satperf [on GitHub][16]. + +### Conclusion + +Sysadmins, SREs, and cloud operators face a wide variety of challenges as they work to scale their infrastructure, but luckily there is also a wide variety of tools to help them get past those common issues. Any of these seven tools should help you get started testing your infrastructure's performance as it scales. + +Are there other open source performance and scaling tools that should be on this list? Add your favorites in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/performance-scaling-tools + +作者:[Pradeep SurisettyPeter Portante][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/psuriset/users/aakarsh/users/portante/users/anaga +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_scale_performance.jpg?itok=R7jyMeQf (Several images of graphs.) +[2]: /16/12/yearbook-10-open-source-sysadmin-tools +[3]: /article/19/5/life-performance-engineer +[4]: https://distributed-system-analysis.github.io/pbench/ +[5]: https://github.com/distributed-system-analysis/pbench +[6]: https://github.com/cloud-bulldozer/ripsaw +[7]: https://github.com/cloud-bulldozer/ripsaw#community +[8]: https://github.com/openshift-scale +[9]: https://browbeatproject.org/ +[10]: https://github.com/cloud-bulldozer/browbeat +[11]: https://github.com/distributed-system-analysis/smallfile +[12]: https://ceph.com/ +[13]: https://github.com/acalhounRH/cbt +[14]: https://nuget.pkg.github.com/bengland2/cbt/tree/smallfile +[15]: https://github.com/acalhounRH/automated_ceph_test +[16]: https://github.com/redhat-performance/satperf From 51e27c15c72e017ea8e67cb04d068681d4583a6e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 Jun 2019 17:13:12 +0800 Subject: [PATCH 1074/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190621=20The?= =?UTF-8?q?=20state=20of=20open=20source=20translation=20tools=20for=20con?= =?UTF-8?q?tributors=20to=20your=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190621 The state of open source translation tools for contributors to your project.md --- ... tools for contributors to your project.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20190621 The state of open source translation tools for contributors to your project.md diff --git a/sources/tech/20190621 The state of open source translation tools for contributors to your project.md b/sources/tech/20190621 The state of open source translation tools for contributors to your project.md new file mode 100644 index 0000000000..07bac654fc --- /dev/null +++ b/sources/tech/20190621 The state of open source translation tools for contributors to your project.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The state of open source translation tools for contributors to your project) +[#]: via: (https://opensource.com/article/19/6/translation-platforms-matter) +[#]: author: (Jean-Baptiste Holcroft https://opensource.com/users/jibec/users/jibec) + +The state of open source translation tools for contributors to your project +====== +There are almost 100 languages with more than 10 million speakers. How +many of your active contributors speak one? +![Team of people around the world][1] + +In the world of free software, many people speak English: It is the **one** language. English helps us cross borders to meet others. However, this language is also a barrier for the majority of people. + +Some master it while others don't. Complex English terms are, in general, a barrier to the understanding and propagation of knowledge. Whenever you use an uncommon English word, ask yourself about your real mastery of what you are explaining, and the unintentional barriers you build in the process. + +_“If you talk to a man in a language he understands, that goes to his head. If you talk to him in his language, that goes to his heart.”_ — Nelson Mandela + +We are 7 billion humans, and less than 400 million of us are English natives. The wonders done day after day by free/libre open source contributors deserve to reach the hearts of the [6.6 billion people][2] for whom English is not their mother tongue. In this day and age, we have the technology to help translate all types of content: websites, documentation, software, and even sounds and images. Even if I do not translate of all of these media personally, I do not know of any real limits. The only prerequisite for getting this content translated is both the willingness of the creators and the collective will of the users, customers, and—in the case of free software—the contributors. + +### Why successful translation requires real tooling + +Some projects are stuck in the stone ages and require translators to use [Git][3], [Mercurial][4], or other development tools. These tools don’t meet the needs of translation communities. Let’s help these projects evolve, as discussed in the section "A call for action." + +Other projects have integrated translation platforms, which are key tools for linguistic diversity and existence. These tools understand the needs of translators and serve as a bridge to the development world. They make translation contribution easy, and keep those doing the translations motivated over time. + +This aspect is important: There are almost 100 languages with more than 10 million speakers. Do you really believe that your project can have an active contributor for each of these languages? Unless you are a huge organization, like Mozilla or LibreOffice, there is no chance. The translators who help you also help two, ten, or a hundred other projects. They need tools to be effective, such as [translation memories][5], progress reports, alerts, ways to collaborate, and knowing that what they do is useful. + +### Translation platforms are in trouble + +However, the translation platforms distributed as free software are disappearing in favor of closed platforms. These platforms set their rules and efforts according to what will bring them the most profit. + +Linguistic and cultural diversity does not bring money: It opens doors and allows local development. It emancipates populations and can ensure the survival of certain cultures and languages. In the 21st century, is your culture really alive if it does not exist in cyberspace? + +The short history of translation platforms is not pretty: + + * In 2011, Transifex ceased to be open when they decided to no longer publish their source code. + * Since September 2017, the [Pootle][6] project seems to have stalled. + * In October 2018, the [Zanata][7] project shut down because it had not succeeded in building a community of technical contributors capable of taking over when corporate funding was halted. + + + +In particular, the [Fedora Project][8]—which I work closely with—has ridden the roller coaster from Transifex to Zanata and is now facing another move and more challenges. + +Two significant platforms remain: + + * [Pontoon][9]: Dedicated to the Mozilla use case (large community, common project). + * [Weblate][10]: A generic platform created by developer [Michal Čihař][11] (a generic purpose platform). + + + +These two tools are of high quality and are technically up-to-date, but Mozilla’s Pontoon is not designed to appeal to the greatest number of people. This project is dedicated to the specific challenges Mozilla faces.  + +### A call for action + +There is an urgent need for large communities to share resources to perpetuate Weblate as free software and promote its adoption. Support is also needed for other tools, such as [po4a][12], the [Translate Toolkit][13], and even our old friend [gettext][14]. Will we accept a sword of Damocles hanging over our heads? Will we continue to consume years of free work without giving a cent in return? Or will we take the lead in bringing security to our communities? + +**What you can do as a contributor**: Promote Weblate as an open source translation platform, and help your beloved project use it. [Hosting is free for open source projects][15]. + +**What you can do as a developer**: Make sure all of your project’s content can be translated into any language. Think about this issue from the beginning, as all tools don’t provide the same internationalization features. + +**What you can do as an entity with a budget**: Whether you’re a company or just part of the community, pay for the support, hosting, or development of the tools you use. Even if the amount is symbolic, doing this will lower the risks. In particular, [here is the info for Weblate][16]. (Note: I’m not involved with the Weblate project other than bug reports and translation.) + +**What to do if you’re a language enthusiast**: Contact me to help create an open source language organization to promote our tools and their usage, and find money to fund them. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/translation-platforms-matter + +作者:[Jean-Baptiste Holcroft][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/jibec/users/jibec +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_global_people_gis_location.png?itok=Rl2IKo12 (Team of people around the world) +[2]: https://www.ethnologue.com/statistics/size +[3]: https://git-scm.com +[4]: https://www.mercurial-scm.org +[5]: https://en.wikipedia.org/wiki/Translation_memory +[6]: http://pootle.translatehouse.org +[7]: http://zanata.org +[8]: https://getfedora.org +[9]: https://github.com/mozilla/pontoon/ +[10]: https://weblate.org +[11]: https://cihar.com +[12]: https://po4a.org +[13]: http://docs.translatehouse.org/projects/translate-toolkit/en/latest/ +[14]: https://www.gnu.org/software/gettext/ +[15]: http://hosted.weblate.org/ +[16]: https://weblate.org/en/hosting/ From 27ba6ca84bd024c4c0017bcd74f2458b28b53e8c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 Jun 2019 17:13:41 +0800 Subject: [PATCH 1075/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190620=20How?= =?UTF-8?q?=20to=20SSH=20into=20a=20running=20container?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190620 How to SSH into a running container.md --- ...620 How to SSH into a running container.md | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 sources/tech/20190620 How to SSH into a running container.md diff --git a/sources/tech/20190620 How to SSH into a running container.md b/sources/tech/20190620 How to SSH into a running container.md new file mode 100644 index 0000000000..f0b4cdafc2 --- /dev/null +++ b/sources/tech/20190620 How to SSH into a running container.md @@ -0,0 +1,185 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to SSH into a running container) +[#]: via: (https://opensource.com/article/19/6/how-ssh-running-container) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/bcotton) + +How to SSH into a running container +====== +SSH is probably not the best way to run commands in a container; try +this instead. +![cubes coming together to create a larger cube][1] + +Containers have shifted the way we think about virtualization. You may remember the days (or you may still be living them) when a virtual machine was the full stack, from virtualized BIOS, operating system, and kernel up to each virtualized network interface controller (NIC). You logged into the virtual box just as you would your own workstation. It was a very direct and simple analogy. + +And then containers came along, [starting with LXC][2] and culminating in the Open Container Initiative ([OCI][3]), and that's when things got complicated. + +### Idempotency + +In the world of containers, the "virtual machine" is only mostly virtual. Everything that doesn't need to be virtualized is borrowed from the host machine. Furthermore, the container itself is usually meant to be ephemeral and idempotent, so it stores no persistent data, and its state is defined by configuration files on the host machine. + +If you're used to the old ways of virtual machines, then you naturally expect to log into a virtual machine in order to interact with it. But containers are ephemeral, so anything you do in a container is forgotten, by design, should the container need to be restarted or respawned. + +The commands controlling your container infrastructure (such as **oc, crictl**, **lxc**, and **docker**) provide an interface to run important commands to restart services, view logs, confirm the existence and permissions modes of an important file, and so on. You should use the tools provided by your container infrastructure to interact with your application, or else edit configuration files and relaunch. That's what containers are designed to do. + +For instance, the open source forum software [Discourse][4] is officially distributed as a container image. The Discourse software is _stateless_, so its installation is self-contained within **/var/discourse**. As long as you have a backup of **/var/discourse**, you can always restore the forum by relaunching the container. The container holds no persistent data, and its configuration file is **/var/discourse/containers/app.yml**. + +Were you to log into the container and edit any of the files it contains, all changes would be lost if the container had to be restarted. + +LXC containers you're building from scratch are more flexible, with configuration files (in a location defined by you) passed to the container when you launch it. + +A build system like [Jenkins][5] usually has a default configuration file, such as **jenkins.yaml**, providing instructions for a base container image that exists only to build and run tests on source code. After the builds are done, the container goes away. + +Now that you know you don't need SSH to interact with your containers, here's an overview of what tools are available (and some notes about using SSH in spite of all the fancy tools that make it redundant). + +### OpenShift web console + +[OpenShift 4][6] offers an open source toolchain for container creation and maintenance, including an interactive web console. + +When you log into your web console, navigate to your project overview and click the **Applications** tab for a list of pods. Select a (running) pod to open the application's **Details** panel. + +![Pod details in OpenShift][7] + +Click the **Terminal** tab at the top of the **Details** panel to open an interactive shell in your container. + +![A terminal in a running container][8] + +If you prefer a browser-based experience for Kubernetes management, you can learn more through interactive lessons available at [learn.openshift.com][9]. + +### OpenShift oc + +If you prefer a command-line interface experience, you can use the **oc** command to interact with containers from the terminal. + +First, get a list of running pods (or refer to the web console for a list of active pods). To get that list, enter: + + +``` +`$ oc get pods` +``` + +You can view the logs of a resource (a pod, build, or container). By default, **oc logs** returns the logs from the first container in the pod you specify. To select a single container, add the **\--container** option: + + +``` +`$ oc logs --follow=true example-1-e1337 --container app` +``` + +You can also view logs from all containers in a pod with: + + +``` +`$ oc logs --follow=true example-1-e1337 --all-containers` +``` + +#### Execute commands + +You can execute commands remotely with: + + +``` +$ oc exec example-1-e1337 --container app hostname +        example.local +``` + +This is similar to running SSH non-interactively: you get to run the command you want to run without an interactive shell taking over your environment. + +#### Remote shell + +You can attach to a running container. This still does _not_ open a shell in the container, but it does run commands directly. For example: + + +``` +`$ oc attach example-1-e1337 --container app` +``` + +If you need a true interactive shell in a container, you can open a remote shell with the **oc rsh** command as long as the container includes a shell. By default, **oc rsh** launches **/bin/sh**: + + +``` +`$ oc rsh example-1-e1337 --container app` +``` + +### Kubernetes + +If you're using Kubernetes directly, you can use the **kubetcl** **exec** command to run a Bash shell in your pod. + +First, confirm that your pod is running: + + +``` +`$ kubectl get pods` +``` + +As long as the pod containing your application is listed, you can use the **exec** command to launch a shell in the container. Using the name **example-pod** as the pod name, enter: + + +``` +$ kubectl exec --stdin=false --tty=false +  example-pod -- /bin/bash +[root@example.local][10]:/# ls +bin   core etc   lib    root  srv +boot  dev  home  lib64  sbin  tmp  var +``` + +### Docker + +The **docker** command is similar to **kubectl**. With the **dockerd** daemon running, get the name of the running container (you may have to use **sudo** to escalate privileges if you're not in the appropriate group): + + +``` +$ docker ps +CONTAINER ID    IMAGE       COMMAND      NAME +678ac5cca78e    centos     "/bin/bash"   example-centos +``` + +Using the container name, you can run a command in the container: + + +``` +$ docker exec example/centos cat /etc/os-release +CentOS Linux release 7.6 +NAME="CentOS Linux" +VERSION="7" +ID="centos" +ID_LIKE="rhel fedora" +VERSION_ID="7" +[...] +``` + +Or you can launch a Bash shell for an interactive session: + + +``` +`$ docker exec -it example-centos /bin/bash` +``` + +### Containers and appliances + +The important thing to remember when dealing with the cloud is that containers are essentially runtimes rather than virtual machines. While they have much in common with a Linux system (because they _are_ a Linux system!), they rarely translate directly to the commands and workflow you may have developed on your Linux workstation. However, like appliances, containers have an interface to help you develop, maintain, and monitor them, so get familiar with the front-end commands and services until you're happily interacting with them just as easily as ****you interact with virtual (or bare-metal) machines. Soon, you'll wonder why everything isn't developed to be ephemeral. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/how-ssh-running-container + +作者:[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/bcotton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) +[2]: https://opensource.com/article/18/11/behind-scenes-linux-containers +[3]: https://www.opencontainers.org/ +[4]: http://discourse.org +[5]: http://jenkins.io +[6]: https://www.openshift.com/learn/get-started +[7]: https://opensource.com/sites/default/files/uploads/openshift-pod-access.jpg (Pod details in OpenShift) +[8]: https://opensource.com/sites/default/files/uploads/openshift-pod-terminal.jpg (A terminal in a running container) +[9]: http://learn.openshift.com +[10]: mailto:root@example.local From 85daa85d9c870dac384233aebd1438ce09c7de4a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 Jun 2019 17:17:10 +0800 Subject: [PATCH 1076/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190620=20You?= =?UTF-8?q?=20can't=20buy=20DevOps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190620 You can-t buy DevOps.md --- sources/tech/20190620 You can-t buy DevOps.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20190620 You can-t buy DevOps.md diff --git a/sources/tech/20190620 You can-t buy DevOps.md b/sources/tech/20190620 You can-t buy DevOps.md new file mode 100644 index 0000000000..36717058a0 --- /dev/null +++ b/sources/tech/20190620 You can-t buy DevOps.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (You can't buy DevOps) +[#]: via: (https://opensource.com/article/19/6/you-cant-buy-devops) +[#]: author: (Julie Gunderson https://opensource.com/users/juliegund) + +You can't buy DevOps +====== +But plenty of people are happy to sell it to you. Here's why it's not +for sale. +![Coffee shop photo][1] + +![DevOps price tag graphic][2] + +Making a move to [DevOps][3] can be a daunting undertaking, with many organizations not knowing the right place to start. I recently had some fun taking a few "DevOps assessments" to see what solutions they offered. I varied my answers—from an organization that fully embraces DevOps to one at the beginning of the journey. Some of the assessments provided real value, linking me back to articles on culture and methodologies, while others merely offered me a tool promising to bring all my DevOps dreams into reality. + +Tools are absolutely essential to the DevOps journey; for instance, tools can continuously deliver, automate, or monitor your environment. However, **DevOps is not a product**, and tools alone will not enable the processes necessary to realize the full value of DevOps. People are what matter most; you can't do DevOps without building the people, mindset, and culture first. + +### Don't 'win' at DevOps; become a champion + +As a DevOps advocate at PagerDuty, I am proud to be a part of an organization with a strong commitment to DevOps methodologies, well beyond just "checking the boxes" of tool adoption. + +I recently had a conversation with PagerDuty CEO Jennifer Tejada about being a winner versus a champion. She talked about how winning is fantastic—you get a trophy, a title, or maybe even a few million dollars (if it's the lottery). However, in the big picture, winning is all about short-term goals, while being a champion means focusing on long-term successes or outcomes. This got me thinking about how to apply this principle to organizations embracing DevOps. + +One of my favorite examples of DevOps tooling is XebiaLabs' [Periodic Table of DevOps Tools][4]: + +[![Periodic Table of DevOps][5]][4] + +(Click table for interactive version.) + +The table shows that numerous tools fit into DevOps. However, too many times, I have heard about organizations "transforming to DevOps" by purchasing tools. While tooling is an essential part of the DevOps journey, a tool alone does not create a DevOps environment. You have to consider all the factors that make a DevOps team function well: collaboration, breaking down silos, defined processes, ownership, and automation, along with continuous improvement/continuous delivery. + +Deciding to purchase tooling is a great step in the right direction; what is more important is to define the "why" or the end goal behind decisions first. Which brings us back to the mentality of a champion; look at Olympic gold medalist Michael Phelps, for example. Phelps is the most decorated Olympian of all time and holds 39 world records. To achieve these accomplishments, Phelps didn't stop at one, two, or even 20 wins; he aimed to be a champion. This was all done through commitment, practice, and focusing on the desired end state. + +### DevOps defined + +There are hundreds of definitions for DevOps, but almost everyone can agree on the core tenet outlined in the [State of DevOps Report][6]: + +> "DevOps is a set of principles aimed at building culture and processes to help teams work more efficiently and deliver better software faster." + +You can't change culture and processes with a credit card. Tooling can enable an organization to collaborate better or automate or continuously deliver; however, without the right mindset and adoption, a tool's full capability may not be achievable. + +For example, one of my former colleagues heard how amazing Slack is for teams transforming to DevOps by opening up channels for collaboration. He convinced his manager that Slack would solve all of their communication woes. However, six months into the Slack adoption, most teams were still using Skype, including the manager. Slack ended up being more of a place to talk about brewing beer than a tool to bring the product to market faster. The issue was not Slack; it was the lack of buy-in from the team and organization and knowledge around the product's full functionality. + +Purchasing a tool can definitely be a win for a team, but purchasing a tool is not purchasing DevOps. Making tooling and best practices work for the team and achieving short- and long-term goals are where our conversation around being a champion comes up. This brings us back to the why, the overall and far-reaching goal for the team or organization. Once you identify the goal, how do you get buy-in from key stakeholders? After you achieve buy-in, how do you implement the solution? + +### Organizational change + +#### + +[![Change management comic by Randy Glasbergen][7]][8] + +Change is hard for many organizations and individuals; moreover, meaningful change does not happen overnight. It is important to understand how people and organizations process change. In the [Kotter 8-Step Process for Leading Change][9], it's about articulating the need for a change, creating urgency around the why, then starting small and finding and developing internal champions, _before_ trying to prove wins or, in this case, purchasing a tool. + +If people in an organization are not aware of a problem or that there's a better way of operating, it will be hard to get the buy-in necessary and motivate team members to adopt new ideas and take action. People may be perfectly content with the current state; perhaps the processes in place are adequate or, at a minimum, the current state is a known factor. However, for the overall team to function well and achieve its shared goal in a faster, more agile way, new mechanisms must be put into place first. + +![Kotter 8-Step Process for Leading Change][10] + +### How to be a DevOps champion + +Being a champion in the DevOps world means going beyond the win and delving deeper into the team/organizational structure and culture, thereby identifying outlying issues beyond tools, and then working with others to embrace the right change that leads to defined results. Go back to the beginning and define the end goal. Here are a few sample questions you can ask to get started: + + * What are your core values? + * Why are you trying to become a more agile company or team? + * What obstacles is your team or organization facing? + * What will the tool or process accomplish? + * How are people communicating and collaborating? + * Are there silos and why? + * How are you championing the customer? + * Are employees empowered? + + + +After defining the end state, find other like-minded individuals to be part of your champion team, and don't lose sight of what you are trying to accomplish. When making any change, make sure to start small, e.g., with one team or a test environment. By starting small and building on the wins, internal champions will start creating themselves. + +Remember, companies are happy and eager to try to sell you DevOps, but at the end of the day, DevOps is not a product. It is a fully embraced methodology and mindset of automation, collaboration, people, and processes. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/you-cant-buy-devops + +作者:[Julie Gunderson][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/juliegund +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee-shop-devops.png?itok=CPefJZJL (Coffee shop photo) +[2]: https://opensource.com/sites/default/files/uploads/devops-pricetag.jpg (DevOps price tag graphic) +[3]: https://opensource.com/resources/devops +[4]: https://xebialabs.com/periodic-table-of-devops-tools/ +[5]: https://opensource.com/sites/default/files/uploads/periodic-table-of-devops-tools.png (Periodic Table of DevOps) +[6]: https://puppet.com/resources/whitepaper/state-of-devops-report +[7]: https://opensource.com/sites/default/files/uploads/cartoon.png (Change management comic by Randy Glasbergen) +[8]: https://images.app.goo.gl/JiMaWAenNkLcmkZJ9 +[9]: https://www.kotterinc.com/8-steps-process-for-leading-change/ +[10]: https://opensource.com/sites/default/files/uploads/kotter-process.png (Kotter 8-Step Process for Leading Change) From 0583c018d6a278840343b94c55a5bfaf34662bfb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 Jun 2019 17:17:50 +0800 Subject: [PATCH 1077/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190620=20How?= =?UTF-8?q?=20to=20use=20OpenSSL:=20Hashes,=20digital=20signatures,=20and?= =?UTF-8?q?=20more?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190620 How to use OpenSSL- Hashes, digital signatures, and more.md --- ...L- Hashes, digital signatures, and more.md | 337 ++++++++++++++++++ 1 file changed, 337 insertions(+) create mode 100644 sources/tech/20190620 How to use OpenSSL- Hashes, digital signatures, and more.md diff --git a/sources/tech/20190620 How to use OpenSSL- Hashes, digital signatures, and more.md b/sources/tech/20190620 How to use OpenSSL- Hashes, digital signatures, and more.md new file mode 100644 index 0000000000..724c97bc01 --- /dev/null +++ b/sources/tech/20190620 How to use OpenSSL- Hashes, digital signatures, and more.md @@ -0,0 +1,337 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use OpenSSL: Hashes, digital signatures, and more) +[#]: via: (https://opensource.com/article/19/6/cryptography-basics-openssl-part-2) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +How to use OpenSSL: Hashes, digital signatures, and more +====== +Dig deeper into the details of cryptography with OpenSSL: Hashes, +digital signatures, digital certificates, and more +![A person working.][1] + +The [first article in this series][2] introduced hashes, encryption/decryption, digital signatures, and digital certificates through the OpenSSL libraries and command-line utilities. This second article drills down into the details. Let’s begin with hashes, which are ubiquitous in computing, and consider what makes a hash function _cryptographic_. + +### Cryptographic hashes + +The download page for the OpenSSL source code () contains a table with recent versions. Each version comes with two hash values: 160-bit SHA1 and 256-bit SHA256. These values can be used to verify that the downloaded file matches the original in the repository: The downloader recomputes the hash values locally on the downloaded file and then compares the results against the originals. Modern systems have utilities for computing such hashes. Linux, for instance, has **md5sum** and **sha256sum**. OpenSSL itself provides similar command-line utilities. + +Hashes are used in many areas of computing. For example, the Bitcoin blockchain uses SHA256 hash values as block identifiers. To mine a Bitcoin is to generate a SHA256 hash value that falls below a specified threshold, which means a hash value with at least N leading zeroes. (The value of N can go up or down depending on how productive the mining is at a particular time.) As a point of interest, today’s miners are hardware clusters designed for generating SHA256 hashes in parallel. During a peak time in 2018, Bitcoin miners worldwide generated about 75 million terahashes per second—yet another incomprehensible number. + +Network protocols use hash values as well—often under the name **checksum**—to support message integrity; that is, to assure that a received message is the same as the one sent. The message sender computes the message’s checksum and sends the results along with the message. The receiver recomputes the checksum when the message arrives. If the sent and the recomputed checksum do not match, then something happened to the message in transit, or to the sent checksum, or to both. In this case, the message and its checksum should be sent again, or at least an error condition should be raised. (Low-level network protocols such as UDP do not bother with checksums.) + +Other examples of hashes are familiar. Consider a website that requires users to authenticate with a password, which the user enters in their browser. Their password is then sent, encrypted, from the browser to the server via an HTTPS connection to the server. Once the password arrives at the server, it's decrypted for a database table lookup. + +What should be stored in this lookup table? Storing the passwords themselves is risky. It’s far less risky is to store a hash generated from a password, perhaps with some _salt_ (extra bits) added to taste before the hash value is computed. Your password may be sent to the web server, but the site can assure you that the password is not stored there. + +Hash values also occur in various areas of security. For example, hash-based message authentication code ([HMAC][3]) uses a hash value and a secret cryptographic key to authenticate a message sent over a network. HMAC codes, which are lightweight and easy to use in programs, are popular in web services. An X509 digital certificate includes a hash value known as the _fingerprint_, which can facilitate certificate verification. An in-memory truststore could be implemented as a lookup table keyed on such fingerprints—as a _hash map_, which supports constant-time lookups. The fingerprint from an incoming certificate can be compared against the truststore keys for a match. + +What special property should a _cryptographic hash function_ have? It should be _one-way_, which means very difficult to invert. A cryptographic hash function should be relatively straightforward to compute, but computing its inverse—the function that maps the hash value back to the input bitstring—should be computationally intractable. Here is a depiction, with **chf** as a cryptographic hash function and my password **foobar** as the sample input: + + +``` +        +---+ +foobar—>|chf|—>hash value ## straightforward +        +--–+ +``` + +By contrast, the inverse operation is infeasible: + + +``` +            +-----------+ +hash value—>|chf inverse|—>foobar ## intractable +            +-----------+ +``` + +Recall, for example, the SHA256 hash function. For an input bitstring of any length N > 0, this function generates a fixed-length hash value of 256 bits; hence, this hash value does not reveal even the input bitstring’s length N, let alone the value of each bit in the string. By the way, SHA256 is not susceptible to a [_length extension attack_][4]. The only effective way to reverse engineer a computed SHA256 hash value back to the input bitstring is through a brute-force search, which means trying every possible input bitstring until a match with the target hash value is found. Such a search is infeasible on a sound cryptographic hash function such as SHA256. + +Now, a final review point is in order. Cryptographic hash values are statistically rather than unconditionally unique, which means that it is unlikely but not impossible for two different input bitstrings to yield the same hash value—a _collision_. The [_birthday problem_][5] offers a nicely counter-intuitive example of collisions. There is extensive research on various hash algorithms’ _collision resistance_. For example, MD5 (128-bit hash values) has a breakdown in collision resistance after roughly 221 hashes. For SHA1 (160-bit hash values), the breakdown starts at about 261 hashes. + +A good estimate of the breakdown in collision resistance for SHA256 is not yet in hand. This fact is not surprising. SHA256 has a range of 2256 distinct hash values, a number whose decimal representation has a whopping 78 digits! So, can collisions occur with SHA256 hashing? Of course, but they are extremely unlikely. + +In the command-line examples that follow, two input files are used as bitstring sources: **hashIn1.txt** and **hashIn2.txt**. The first file contains **abc** and the second contains **1a2b3c**. + +These files contain text for readability, but binary files could be used instead. + +Using the Linux **sha256sum** utility on these two files at the command line—with the percent sign (**%**) as the prompt—produces the following hash values (in hex): + + +``` +% sha256sum hashIn1.txt +9e83e05bbf9b5db17ac0deec3b7ce6cba983f6dc50531c7a919f28d5fb3696c3 hashIn1.txt + +% sha256sum hashIn2.txt +3eaac518777682bf4e8840dd012c0b104c2e16009083877675f00e995906ed13 hashIn2.txt +``` + +The OpenSSL hashing counterparts yield the same results, as expected: + + +``` +% openssl dgst -sha256 hashIn1.txt +SHA256(hashIn1.txt)= 9e83e05bbf9b5db17ac0deec3b7ce6cba983f6dc50531c7a919f28d5fb3696c3 + +% openssl dgst -sha256 hashIn2.txt +SHA256(hashIn2.txt)= 3eaac518777682bf4e8840dd012c0b104c2e16009083877675f00e995906ed13 +``` + +This examination of cryptographic hash functions sets up a closer look at digital signatures and their relationship to key pairs. + +### Digital signatures + +As the name suggests, a digital signature can be attached to a document or some other electronic artifact (e.g., a program) to vouch for its authenticity. Such a signature is thus analogous to a hand-written signature on a paper document. To verify the digital signature is to confirm two things. First, that the vouched-for artifact has not changed since the signature was attached because it is based, in part, on a cryptographic _hash_ of the document. Second, that the signature belongs to the person (e.g., Alice) who alone has access to the private key in a pair. By the way, digitally signing code (source or compiled) has become a common practice among programmers. + +Let’s walk through how a digital signature is created. As mentioned before, there is no digital signature without a public and private key pair. When using OpenSSL to create these keys, there are two separate commands: one to create a private key, and another to extract the matching public key from the private one. These key pairs are encoded in base64, and their sizes can be specified during this process. + +The private key consists of numeric values, two of which (a _modulus_ and an _exponent_) make up the public key. Although the private key file contains the public key, the extracted public key does _not_ reveal the value of the corresponding private key. + +The resulting file with the private key thus contains the full key pair. Extracting the public key into its own file is practical because the two keys have distinct uses, but this extraction also minimizes the danger that the private key might be publicized by accident. + +Next, the pair’s private key is used to process a hash value for the target artifact (e.g., an email), thereby creating the signature. On the other end, the receiver’s system uses the pair’s public key to verify the signature attached to the artifact. + +Now for an example. To begin, generate a 2048-bit RSA key pair with OpenSSL: + +**openssl genpkey -out privkey.pem -algorithm rsa 2048** + +We can drop the **-algorithm rsa** flag in this example because **genpkey** defaults to the type RSA. The file’s name (**privkey.pem**) is arbitrary, but the Privacy Enhanced Mail (PEM) extension **pem** is customary for the default PEM format. (OpenSSL has commands to convert among formats if needed.) If a larger key size (e.g., 4096) is in order, then the last argument of **2048** could be changed to **4096**. These sizes are always powers of two. + +Here’s a slice of the resulting **privkey.pem** file, which is in base64: + + +``` +\-----BEGIN PRIVATE KEY----- +MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBANnlAh4jSKgcNj/Z +JF4J4WdhkljP2R+TXVGuKVRtPkGAiLWE4BDbgsyKVLfs2EdjKL1U+/qtfhYsqhkK +… +\-----END PRIVATE KEY----- +``` + +The next command then extracts the pair’s public key from the private one: + +**openssl rsa -in privkey.pem -outform PEM -pubout -out pubkey.pem** + +The resulting **pubkey.pem** file is small enough to show here in full: + + +``` +\-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZ5QIeI0ioHDY/2SReCeFnYZJY +z9kfk11RrilUbT5BgIi1hOAQ24LMilS37NhHYyi9VPv6rX4WLKoZCmkeYaWk/TR5 +4nbH1E/AkniwRoXpeh5VncwWMuMsL5qPWGY8fuuTE27GhwqBiKQGBOmU+MYlZonO +O0xnAKpAvysMy7G7qQIDAQAB +\-----END PUBLIC KEY----- +``` + +Now, with the key pair at hand, the digital signing is easy—in this case with the source file **client.c** as the artifact to be signed: + +**openssl dgst -sha256 -sign privkey.pem -out sign.sha256 client.c** + +The digest for the **client.c** source file is SHA256, and the private key resides in the **privkey.pem** file created earlier. The resulting binary signature file is **sign.sha256**, an arbitrary name. To get a readable (if base64) version of this file, the follow-up command is: + +**openssl enc -base64 -in sign.sha256 -out sign.sha256.base64** + +The file **sign.sha256.base64** now contains: + + +``` +h+e+3UPx++KKSlWKIk34fQ1g91XKHOGFRmjc0ZHPEyyjP6/lJ05SfjpAJxAPm075 +VNfFwysvqRGmL0jkp/TTdwnDTwt756Ej4X3OwAVeYM7i5DCcjVsQf5+h7JycHKlM +o/Jd3kUIWUkZ8+Lk0ZwzNzhKJu6LM5KWtL+MhJ2DpVc= +``` + +Or, the executable file **client** could be signed instead, and the resulting base64-encoded signature would differ as expected: + + +``` +VMVImPgVLKHxVBapJ8DgLNJUKb98GbXgehRPD8o0ImADhLqlEKVy0HKRm/51m9IX +xRAN7DoL4Q3uuVmWWi749Vampong/uT5qjgVNTnRt9jON112fzchgEoMb8CHNsCT +XIMdyaPtnJZdLALw6rwMM55MoLamSc6M/MV1OrJnk/g= +``` + +The final step in this process is to verify the digital signature with the public key. The hash used to sign the artifact (in this case, the executable **client** program) should be recomputed as an essential step in the verification since the verification process should indicate whether the artifact has changed since being signed. + +There are two OpenSSL commands used for this purpose. The first decodes the base64 signature: + +**openssl enc -base64 -d -in sign.sha256.base64 -out sign.sha256** + +The second verifies the signature: + +**openssl dgst -sha256 -verify pubkey.pem -signature sign.sha256 client** + +The output from this second command is, as it should be: + + +``` +`Verified OK` +``` + +To understand what happens when verification fails, a short but useful exercise is to replace the executable **client** file in the last OpenSSL command with the source file **client.c** and then try to verify. Another exercise is to change the **client** program, however slightly, and try again. + +### Digital certificates + +A digital certificate brings together the pieces analyzed so far: hash values, key pairs, digital signatures, and encryption/decryption. The first step toward a production-grade certificate is to create a certificate signing request (CSR), which is then sent to a certificate authority (CA). To do this for the example with OpenSSL, run: + +**openssl req -out myserver.csr -new -newkey rsa:4096 -nodes -keyout myserverkey.pem** + +This example generates a CSR document and stores the document in the file **myserver.csr** (base64 text). The purpose here is this: the CSR document requests that the CA vouch for the identity associated with the specified domain name—the common name (CN) in CA-speak. + +A new key pair also is generated by this command, although an existing pair could be used. Note that the use of **server** in names such as **myserver.csr** and **myserverkey.pem** hints at the typical use of digital certificates: as vouchers for the identity of a web server associated with a domain such as [www.google.com][6]. + +The same command, however, creates a CSR regardless of how the digital certificate might be used. It also starts an interactive question/answer session that prompts for relevant information about the domain name to link with the requester’s digital certificate. This interactive session can be short-circuited by providing the essentials as part of the command, with backslashes as continuations across line breaks. The **-subj** flag introduces the required information: + + +``` +% openssl req -new +-newkey rsa:2048 -nodes -keyout privkeyDC.pem +-out myserver.csr +-subj "/C=US/ST=Illinois/L=Chicago/O=Faulty Consulting/OU=IT/CN=myserver.com" +``` + +The resulting CSR document can be inspected and verified before being sent to a CA. This process creates the digital certificate with the desired format (e.g., X509), signature, validity dates, and so on: + +**openssl req -text -in myserver.csr -noout -verify** + +Here’s a slice of the output: + + +``` +verify OK +Certificate Request: +Data: +Version: 0 (0x0) +Subject: C=US, ST=Illinois, L=Chicago, O=Faulty Consulting, OU=IT, CN=myserver.com +Subject Public Key Info: +Public Key Algorithm: rsaEncryption +Public-Key: (2048 bit) +Modulus: +00:ba:36:fb:57:17:65:bc:40:30:96:1b:6e🇩🇪73: +… +Exponent: 65537 (0x10001) +Attributes: +a0:00 +Signature Algorithm: sha256WithRSAEncryption +… +``` + +### A self-signed certificate + +During the development of an HTTPS web site, it is convenient to have a digital certificate on hand without going through the CA process. A self-signed certificate fills the bill during the HTTPS handshake’s authentication phase, although any modern browser warns that such a certificate is worthless. Continuing the example, the OpenSSL command for a self-signed certificate—valid for a year and with an RSA public key—is: + +**openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:4096 -keyout myserver.pem -out myserver.crt** + +The OpenSSL command below presents a readable version of the generated certificate: + +**openssl x509 -in myserver.crt -text -noout** + +Here’s part of the output for the self-signed certificate: + + +``` +Certificate: +Data: +Version: 3 (0x2) +Serial Number: 13951598013130016090 (0xc19e087965a9055a) +Signature Algorithm: sha256WithRSAEncryption +Issuer: C=US, ST=Illinois, L=Chicago, O=Faulty Consulting, OU=IT, CN=myserver.com +Validity +Not Before: Apr 11 17:22:18 2019 GMT +Not After : Apr 10 17:22:18 2020 GMT +Subject: C=US, ST=Illinois, L=Chicago, O=Faulty Consulting, OU=IT, CN=myserver.com +Subject Public Key Info: +Public Key Algorithm: rsaEncryption +Public-Key: (4096 bit) +Modulus: +00:ba:36:fb:57:17:65:bc:40:30:96:1b:6e🇩🇪73: +… +Exponent: 65537 (0x10001) +X509v3 extensions: +X509v3 Subject Key Identifier: +3A:32:EF:3D:EB:DF:65:E5:A8:96:D7:D7:16:2C:1B:29:AF:46:C4:91 +X509v3 Authority Key Identifier: +keyid:3A:32:EF:3D:EB:DF:65:E5:A8:96:D7:D7:16:2C:1B:29:AF:46:C4:91 + +        X509v3 Basic Constraints: +            CA:TRUE +Signature Algorithm: sha256WithRSAEncryption +     3a:eb:8d:09:53:3b:5c:2e:48:ed:14:ce:f9:20:01:4e:90:c9: +     ... +``` + +As mentioned earlier, an RSA private key contains values from which the public key is generated. However, a given public key does _not_ give away the matching private key. For an introduction to the underlying mathematics, see . + +There is an important correspondence between a digital certificate and the key pair used to generate the certificate, even if the certificate is only self-signed: + + * The digital certificate contains the _exponent_ and _modulus_ values that make up the public key. These values are part of the key pair in the originally-generated PEM file, in this case, the file **myserver.pem**. + * The exponent is almost always 65,537 (as in this case) and so can be ignored. + * The modulus from the key pair should match the modulus from the digital certificate. + + + +The modulus is a large value and, for readability, can be hashed. Here are two OpenSSL commands that check for the same modulus, thereby confirming that the digital certificate is based upon the key pair in the PEM file: + + +``` +% openssl x509 -noout -modulus -in myserver.crt | openssl sha1 ## modulus from CRT +(stdin)= 364d21d5e53a59d482395b1885aa2c3a5d2e3769 + +% openssl rsa -noout -modulus -in myserver.pem | openssl sha1 ## modulus from PEM +(stdin)= 364d21d5e53a59d482395b1885aa2c3a5d2e3769 +``` + +The resulting hash values match, thereby confirming that the digital certificate is based upon the specified key pair. + +### Back to the key distribution problem + +Let’s return to an issue raised at the end of Part 1: the TLS handshake between the **client** program and the Google web server. There are various handshake protocols, and even the Diffie-Hellman version at work in the **client** example offers wiggle room. Nonetheless, the **client** example follows a common pattern. + +To start, during the TLS handshake, the **client** program and the web server agree on a cipher suite, which consists of the algorithms to use. In this case, the suite is **ECDHE-RSA-AES128-GCM-SHA256**. + +The two elements of interest now are the RSA key-pair algorithm and the AES128 block cipher used for encrypting and decrypting messages if the handshake succeeds. Regarding encryption/decryption, this process comes in two flavors: symmetric and asymmetric. In the symmetric flavor, the _same_ key is used to encrypt and decrypt, which raises the _key distribution problem_ in the first place: How is the key to be distributed securely to both parties? In the asymmetric flavor, one key is used to encrypt (in this case, the RSA public key) but a different key is used to decrypt (in this case, the RSA private key from the same pair). + +The **client** program has the Google web server’s public key from an authenticating certificate, and the web server has the private key from the same pair. Accordingly, the **client** program can send an encrypted message to the web server, which alone can readily decrypt this message. + +In the TLS situation, the symmetric approach has two significant advantages: + + * In the interaction between the **client** program and the Google web server, the authentication is one-way. The Google web server sends three certificates to the **client** program, but the **client** program does not send a certificate to the web server; hence, the web server has no public key from the client and can’t encrypt messages to the client. + * Symmetric encryption/decryption with AES128 is nearly a _thousand times faster_ than the asymmetric alternative using RSA keys. + + + +The TLS handshake combines the two flavors of encryption/decryption in a clever way. During the handshake, the **client** program generates random bits known as the pre-master secret (PMS). Then the **client** program encrypts the PMS with the server’s public key and sends the encrypted PMS to the server, which in turn decrypts the PMS message with its private key from the RSA pair: + + +``` +              +-------------------+ encrypted PMS  +--------------------+ +client PMS--->|server’s public key|--------------->|server’s private key|--->server PMS +              +-------------------+                +--------------------+ +``` + +At the end of this process, the **client** program and the Google web server now have the same PMS bits. Each side uses these bits to generate a _master secret_ and, in short order, a symmetric encryption/decryption key known as the _session key_. There are now two distinct but identical session keys, one on each side of the connection. In the **client** example, the session key is of the AES128 variety. Once generated on both the **client** program’s and Google web server’s sides, the session key on each side keeps the conversation between the two sides confidential. A handshake protocol such as Diffie-Hellman allows the entire PMS process to be repeated if either side (e.g., the **client** program) or the other (in this case, the Google web server) calls for a restart of the handshake. + +### Wrapping up + +The OpenSSL operations illustrated at the command line are available, too, through the API for the underlying libraries. These two articles have emphasized the utilities to keep the examples short and to focus on the cryptographic topics. If you have an interest in security issues, OpenSSL is a fine place to start—and to stay. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2 + +作者:[Marty Kalin][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/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_os_rh2x.png?itok=jbRfXinl (A person working.) +[2]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 +[3]: https://en.wikipedia.org/wiki/HMAC +[4]: https://en.wikipedia.org/wiki/Length_extension_attack +[5]: https://en.wikipedia.org/wiki/Birthday_problem +[6]: http://www.google.com From 5e259f7616b0050f2933fc191dee26d660c474d2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 Jun 2019 17:20:46 +0800 Subject: [PATCH 1078/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190621=20Bash?= =?UTF-8?q?=20Script=20to=20Monitor=20Memory=20Usage=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md --- ...Script to Monitor Memory Usage on Linux.md | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md diff --git a/sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md b/sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md new file mode 100644 index 0000000000..ded8050ee7 --- /dev/null +++ b/sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md @@ -0,0 +1,175 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Bash Script to Monitor Memory Usage on Linux) +[#]: via: (https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-usage-and-send-email/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Bash Script to Monitor Memory Usage 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 two shell script to monitor Memory utilization on Linux system. + +When the system reaches the given threshold then it will trigger a mail to given email id. + +### Method-1 : Linux Bash Script To Monitor Memory Utilization And Send an Email + +If you want to only get current Memory utilization percentage through mail when the system reaches the given threshold, use the following script. + +This is very simple, straightforward and one line script. I preferred to go with this method in most of the time. + +It will trigger an email when your system reaches `80%` of Memory utilization. + +``` +*/5 * * * * /usr/bin/free | awk '/Mem/{printf("RAM Usage: %.2f%\n"), $3/$2*100}' | awk '{print $3}' | awk '{ if($1 > 80) print $0;}' | mail -s "High Memory Alert" [email protected] +``` + +**Note:** You need to change the email id instead of ours. Also, you can change the Memory utilization threshold value as per your requirement. + +**Output:** You will be getting an email alert similar to below. + +``` +High Memory Alert: 80.40% +``` + +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]** + + + +### Method-2 : Linux Bash Script To Monitor Memory Utilization And Send an Email + +If you want to get more information about the Memory utilization in the mail alert. + +Then use the following script, which includes top Memory utilization process details based on the top Command and ps Command. + +This will instantly gives you an idea what is going on your system. + +It will trigger an email when your system reaches `80%` of Memory utilization. + +**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/memory-alert.sh + +#!/bin/sh +ramusage=$(free | awk '/Mem/{printf("RAM Usage: %.2f\n"), $3/$2*100}'| awk '{print $3}') + +if [ "$ramusage" > 20 ]; then + +SUBJECT="ATTENTION: Memory Utilization is High on $(hostname) at $(date)" + +MESSAGE="/tmp/Mail.out" + +TO="[email protected]" + + echo "Memory Current Usage is: $ramusage%" >> $MESSAGE + + echo "" >> $MESSAGE + + echo "------------------------------------------------------------------" >> $MESSAGE + + echo "Top Memory Consuming Process Using top command" >> $MESSAGE + + echo "------------------------------------------------------------------" >> $MESSAGE + + echo "$(top -b -o +%MEM | head -n 20)" >> $MESSAGE + + echo "" >> $MESSAGE + + echo "------------------------------------------------------------------" >> $MESSAGE + + echo "Top Memory Consuming Process Using ps command" >> $MESSAGE + + echo "------------------------------------------------------------------" >> $MESSAGE + + echo "$(ps -eo pid,ppid,%mem,%Memory,cmd --sort=-%mem | head)" >> $MESSAGE + + mail -s "$SUBJECT" "$TO" < $MESSAGE + + rm /tmp/Mail.out + + fi +``` + +Finally add a **[cronjob][2]** to automate this. It will run every 5 minutes. + +``` +# crontab -e +*/5 * * * * /bin/bash /opt/scripts/memory-alert.sh +``` + +**Note:** You will be getting an email alert 5 mins later since the script has scheduled to run every 5 minutes (But it’s not exactly 5 mins and it depends the timing). + +Say for example. If your system reaches the given limit at 8.25 then you will be getting an email alert in another 5 mins. Hope it’s clear now. + +**Output:** You will be getting an email alert similar to below. + +``` +Memory Current Usage is: 80.71% + ++------------------------------------------------------------------+ +Top Memory Consuming Process Using top command ++------------------------------------------------------------------+ +top - 12:00:58 up 5 days, 9:03, 1 user, load average: 1.82, 2.60, 2.83 +Tasks: 314 total, 1 running, 313 sleeping, 0 stopped, 0 zombie +%Cpu0 : 8.3 us, 12.5 sy, 0.0 ni, 75.0 id, 0.0 wa, 0.0 hi, 4.2 si, 0.0 st +%Cpu1 : 13.6 us, 4.5 sy, 0.0 ni, 81.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu2 : 21.7 us, 21.7 sy, 0.0 ni, 56.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu3 : 13.6 us, 9.1 sy, 0.0 ni, 77.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu4 : 17.4 us, 8.7 sy, 0.0 ni, 73.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu5 : 20.8 us, 4.2 sy, 0.0 ni, 70.8 id, 0.0 wa, 0.0 hi, 4.2 si, 0.0 st +%Cpu6 : 9.1 us, 0.0 sy, 0.0 ni, 90.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu7 : 17.4 us, 4.3 sy, 0.0 ni, 78.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +KiB Mem : 16248588 total, 5015964 free, 6453404 used, 4779220 buff/cache +KiB Swap: 17873388 total, 16928620 free, 944768 used. 6423008 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND +17163 daygeek 20 2033204 487736 282888 S 10.0 3.0 8:26.07 /usr/lib/firefox/firefox -contentproc -childID 15 -isForBrowser -prefsLen 9408 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /u+ + 1121 daygeek 20 4191388 419180 100552 S 5.0 2.6 126:02.84 /usr/bin/gnome-shell + 1902 daygeek 20 1701644 327216 82536 S 20.0 2.0 153:27.92 /opt/google/chrome/chrome + 2969 daygeek 20 1051116 324656 92388 S 15.0 2.0 149:38.09 /opt/google/chrome/chrome --type=renderer --field-trial-handle=10346122902703263820,11905758137655502112,131072 --service-pipe-token=1339861+ + 1068 daygeek 20 1104856 309552 278072 S 5.0 1.9 143:47.42 /usr/lib/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -verbose 3 +27246 daygeek 20 907344 265600 108276 S 30.0 1.6 10:42.80 /opt/google/chrome/chrome --type=renderer --field-trial-handle=10346122902703263820,11905758137655502112,131072 --service-pipe-token=8587368+ + ++------------------------------------------------------------------+ +Top Memory Consuming Process Using ps command ++------------------------------------------------------------------+ + PID PPID %MEM %CPU CMD + 8223 1 6.4 6.8 /usr/lib/firefox/firefox --new-window +13948 1121 6.3 1.2 /usr/bin/../lib/notepadqq/notepadqq-bin + 8671 8223 4.4 7.5 /usr/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 6999 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab +17163 8223 3.0 0.6 /usr/lib/firefox/firefox -contentproc -childID 15 -isForBrowser -prefsLen 9408 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab + 1121 1078 2.5 1.6 /usr/bin/gnome-shell +17937 8223 2.5 0.8 /usr/lib/firefox/firefox -contentproc -childID 16 -isForBrowser -prefsLen 9410 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab + 8499 8223 2.2 0.6 /usr/lib/firefox/firefox -contentproc -childID 4 -isForBrowser -prefsLen 6635 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab + 8306 8223 2.2 0.8 /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab + 9198 8223 2.1 0.6 /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 8604 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-usage-and-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/ +[2]: https://www.2daygeek.com/crontab-cronjob-to-schedule-jobs-in-linux/ From c4db5dcc1d48da7ab178e4a5f6ab054e4eb06381 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 Jun 2019 17:21:21 +0800 Subject: [PATCH 1079/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190621=20Thre?= =?UTF-8?q?e=20Ways=20to=20Lock=20and=20Unlock=20User=20Account=20in=20Lin?= =?UTF-8?q?ux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190621 Three Ways to Lock and Unlock User Account in Linux.md --- ...o Lock and Unlock User Account in Linux.md | 307 ++++++++++++++++++ 1 file changed, 307 insertions(+) create mode 100644 sources/tech/20190621 Three Ways to Lock and Unlock User Account in Linux.md diff --git a/sources/tech/20190621 Three Ways to Lock and Unlock User Account in Linux.md b/sources/tech/20190621 Three Ways to Lock and Unlock User Account in Linux.md new file mode 100644 index 0000000000..4f791da9c6 --- /dev/null +++ b/sources/tech/20190621 Three Ways to Lock and Unlock User Account in Linux.md @@ -0,0 +1,307 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Three Ways to Lock and Unlock User Account in Linux) +[#]: via: (https://www.2daygeek.com/lock-unlock-disable-enable-user-account-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Three Ways to Lock and Unlock User Account in Linux +====== + +If password policy had already implemented in your organization, then you no need to look for this options. + +However, if you had set up lock period for 24 hours, in this case you might need to unlock the user’s account manually. + +This tutorial will help you to manually lock and unlock users account in Linux. + +This can be done using the following two Linux Commands in three ways. + + * **`passwd:`**The passwd command is used to update user’s authentication tokens. This task is achieved by calling the Linux-PAM and Libuser API + * **`usermod:`**The usermod command is used to modify/update given user’s account information. It used to add a user to a specific group, etc., + + + +To exprement this, we are choosing `daygeek` user account. Let’s see, how to do step by step. + +Make a note, you have to use corresponding user account which you need to lock or unlock instead of ours. + +You can check the given user account is available or not in system by using `id Command`. Yes, my account is available in the system. + +``` +# id daygeek + +uid=2240(daygeek) gid=2243(daygeek) groups=2243(daygeek),2244(ladmin) +``` + +### Method-1: How To Lock, Unlock and Check Status of the Given User Account in Linux Using passwd Command? + +The passwd command is one of the frequently used command by Linux administrator very often. + +It used to update user’s authentication tokens in the `/etc/shadow` file. + +Run the passwd command with the `-l` switch to lock the given user account. + +``` +# passwd -l daygeek + +Locking password for user daygeek. +passwd: Success +``` + +You can check the locked account status either passwd command or grep the given user name from /etc/shadow file. + +Checking the user account locked status using passwd command. + +``` +# passwd -S daygeek +or +# passwd --status daygeek + +daygeek LK 2019-05-30 7 90 7 -1 (Password locked.) +``` + +This will output a short information about the status of the password for a given account. + + * **`LK:`**` ` Password locked + * **`NP:`**` ` No password + * **`PS:`**` ` Password set + + + +Checking the locked user account status using `/etc/shadow` file. Two exclamation mark will be added in front of the password, if the account is already locked. + +``` +# grep daygeek /etc/shadow + +daygeek:!!$6$tGvVUhEY$PIkpI43HPaEoRrNJSRpM3H0YWOsqTqXCxtER6rak5PMaAoyQohrXNB0YoFCmAuh406n8XOvBBldvMy9trmIV00:18047:7:90:7::: +``` + +Run the passwd command with the `-u` switch to unlock the given user account. + +``` +# passwd -u daygeek + +Unlocking password for user daygeek. +passwd: Success +``` + +### Method-2: How To Lock, Unlock and Check Status of the Given User Account in Linux Using usermod Command? + +Even, the usermod command also frequently used by Linux administrator very often. + +The usermod command is used to modify/update given user’s account information. It used to add a user to a specific group, etc., + +Run the usermod command with the `-L` switch to lock the given user account. + +``` +# usermod --lock daygeek +or +# usermod -L daygeek +``` + +You can check the locked account status either passwd command or grep the given user name from /etc/shadow file. + +Checking the user account locked status using passwd command. + +``` +# passwd -S daygeek +or +# passwd --status daygeek + +daygeek LK 2019-05-30 7 90 7 -1 (Password locked.) +``` + +This will output a short information about the status of the password for a given account. + + * **`LK:`**` ` Password locked + * **`NP:`**` ` No password + * **`PS:`**` ` Password set + + + +Checking the locked user account status using /etc/shadow file. Two exclamation mark will be added in front of the password, if the account is already locked. + +``` +# grep daygeek /etc/shadow + +daygeek:!!$6$tGvVUhEY$PIkpI43HPaEoRrNJSRpM3H0YWOsqTqXCxtER6rak5PMaAoyQohrXNB0YoFCmAuh406n8XOvBBldvMy9trmIV00:18047:7:90:7::: +``` + +Run the usermod command with the `-U` switch to unlock the given user account. + +``` +# usermod --unlock daygeek +or +# usermod -U daygeek +``` + +### Method-3: How To Disable, Enable SSH Access To the Given User Account in Linux Using usermod Command? + +Even, the usermod command also frequently used by Linux administrator very often. + +The usermod command is used to modify/update given user’s account information. It used to add a user to a specific group, etc., + +Alternativly this can be done by assigning the `nologin` shell to the given user. To do so, run the below command. + +``` +# usermod -s /sbin/nologin daygeek +``` + +You can check the locked user account details by greping the given user name from /etc/passwd file. + +``` +# grep daygeek /etc/passwd + +daygeek:x:2240:2243::/home/daygeek:/sbin/nologin +``` + +We can enable the user ssh access by assigning back to the old shell. + +``` +# usermod -s /bin/bash daygeek +``` + +### How To Lock, Unlock and Check Status of Multiple User Account in Linux Using Shell Script? + +If you would like to lock/unlock more than one account then you need to look for script. + +Yes, we can write a small shell script to perform this. To do so, use the following shell script. + +Create The Users list. Each user should be in separate line. + +``` +$ cat user-lists.txt + +u1 +u2 +u3 +u4 +u5 +``` + +Use the following shell script to lock multiple users account in Linux. + +``` +# user-lock.sh + +#!/bin/bash +for user in `cat user-lists.txt` +do +passwd -l $user +done +``` + +Set an executable permission to `user-lock.sh` file. + +``` +# chmod + user-lock.sh +``` + +Finally run the script to achieve this. + +``` +# sh user-lock.sh + +Locking password for user u1. +passwd: Success +Locking password for user u2. +passwd: Success +Locking password for user u3. +passwd: Success +Locking password for user u4. +passwd: Success +Locking password for user u5. +passwd: Success +``` + +Use the following shell script to check locked users account in Linux. + +``` +# vi user-lock-status.sh + +#!/bin/bash +for user in `cat user-lists.txt` +do +passwd -S $user +done +``` + +Set an executable permission to `user-lock-status.sh` file. + +``` +# chmod + user-lock-status.sh +``` + +Finally run the script to achieve this. + +``` +# sh user-lock-status.sh + +u1 LK 2019-06-10 0 99999 7 -1 (Password locked.) +u2 LK 2019-06-10 0 99999 7 -1 (Password locked.) +u3 LK 2019-06-10 0 99999 7 -1 (Password locked.) +u4 LK 2019-06-10 0 99999 7 -1 (Password locked.) +u5 LK 2019-06-10 0 99999 7 -1 (Password locked.) +``` + +Use the following shell script to unlock multiple users account in Linux. + +``` +# user-unlock.sh + +#!/bin/bash +for user in `cat user-lists.txt` +do +passwd -u $user +done +``` + +Set an executable permission to `user-unlock.sh` file. + +``` +# chmod + user-unlock.sh +``` + +Finally run the script to achieve this. + +``` +# sh user-unlock.sh + +Unlocking password for user u1. +passwd: Success +Unlocking password for user u2. +passwd: Success +Unlocking password for user u3. +passwd: Success +Unlocking password for user u4. +passwd: Success +Unlocking password for user u5. +passwd: Success +``` + +Run the same shell script `user-lock-status.sh` to check these locked user accounts got unlocked in Linux. + +``` +# sh user-lock-status.sh + +u1 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) +u2 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) +u3 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) +u4 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) +u5 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/lock-unlock-disable-enable-user-account-linux/ + +作者:[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 From f57d8b4ffc5125a0389771ce37c522f450d325da Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Jun 2019 19:16:56 +0800 Subject: [PATCH 1080/1154] PRF:20190619 Get the latest Ansible 2.8 in Fedora.md @geekpi --- ...0190619 Get the latest Ansible 2.8 in Fedora.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md b/translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md index d189875e73..90076868b4 100644 --- a/translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md +++ b/translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Get the latest Ansible 2.8 in Fedora) @@ -12,11 +12,11 @@ ![][1] -Ansible 是世界上最受欢迎的自动化引擎之一。它能让你自动化几乎任何事情,从本地系统的设置到大量的平台和应用。它是跨平台的,因此你可以将其用于各种操作系统。继续阅读以获取有关如何在 Fedora 中获取最新 Ansible,一些更改和改进,以及如何使用它。 +Ansible 是世界上最受欢迎的自动化引擎之一。它能让你自动化几乎任何事情,从本地系统的设置到大量的平台和应用。它是跨平台的,因此你可以将其用于各种操作系统。请继续阅读以获取有关如何在 Fedora 中获取最新 Ansible,以及它的一些更改和改进,以及如何使用它。 ### 发布版本和功能 -最近发布了 Ansible 2.8,其中包含许多修复,功能和增强。仅仅几天之后,它就可在 Fedora 29 和 30 以及 EPEL 中获取。两周前发布了后续版本 2.8.1。同样,新版本在几天内就可以在 Fedora 中获取。 +Ansible 2.8 最近发布了,其中包含许多修复、功能和增强。仅仅几天之后,它就可在 Fedora 29 和 30 以及 EPEL 中获取。两周前发布了后续版本 2.8.1。同样,新版本在几天内就可以在 Fedora 中获取。 [使用 sudo][2] 能够非常容易地从官方仓库安装: @@ -24,9 +24,9 @@ Ansible 是世界上最受欢迎的自动化引擎之一。它能让你自动化 $ sudo dnf -y install ansible ``` -2.8 版本有很长的更新列表,你可以在 [2.8 的迁移指南][3]中阅读查看。但其中包含了一些好东西,比如 _Python 解释器发现_ 。Ansible 2.8 现在会试图找出哪个 Python 是它运行的平台的首选。如果失败,Ansible 会使用后备列表。但是,你仍然可以使用变量 _ansible_python_interpreter_ 来设置 Python 解释器。 +2.8 版本有很长的更新列表,你可以在 [2.8 的迁移指南][3]中阅读查看。但其中包含了一些好东西,比如 *Python 解释器发现功能* 。Ansible 2.8 现在会试图找出哪个 Python 是它所运行的平台的首选版本。如果失败,Ansible 会使用后备列表。但是,你仍然可以使用变量 `ansible_python_interpreter` 来设置 Python 解释器。 -另一个变化使 Ansible 在各个平台上更加一致。由于 _sudo_ 专用于 UNIX/Linux,而其他平台并没有,因此现在在更多地方使用 _become_。这包括了命令行开关。例如,_-ask-sudo-pass_ 已变成了 _-ask-become-pass_,提示符也变成了 _BECOME password:_。 +另一个变化使 Ansible 在各个平台上更加一致。由于 `sudo` 专用于 UNIX/Linux,而其他平台并没有,因此现在在更多地方使用 `become`。这包括了命令行开关。例如,`-ask-sudo-pass` 已变成了 `-ask-become-pass`,提示符也变成了 `BECOME password:`。 2.8 和 2.8.1 版本中还有许多其他功能。有关所有细节,请查看 [GitHub 上的官方更新日志][4]。 @@ -36,7 +36,7 @@ $ sudo dnf -y install ansible 我们之前在 Fedora Magazine 中也讨论过这个话题: -> [使用 Ansible 设置工作站][5] +- [使用 Ansible 设置工作站][5] 试试看 Ansible,说下你的想法。很重要的一部分是让 Fedora 保持最新版本。自动化快乐! @@ -47,7 +47,7 @@ via: https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/ 作者:[Paul W. Frields][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/) 荣誉推出 From 52064c4a480115f8960bfa069f0678fbb85e48b2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Jun 2019 19:17:35 +0800 Subject: [PATCH 1081/1154] PUB:20190619 Get the latest Ansible 2.8 in Fedora.md @geekpi https://linux.cn/article-11002-1.html --- .../20190619 Get the latest Ansible 2.8 in Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190619 Get the latest Ansible 2.8 in Fedora.md (97%) diff --git a/translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md b/published/20190619 Get the latest Ansible 2.8 in Fedora.md similarity index 97% rename from translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md rename to published/20190619 Get the latest Ansible 2.8 in Fedora.md index 90076868b4..dd851a1dde 100644 --- a/translated/tech/20190619 Get the latest Ansible 2.8 in Fedora.md +++ b/published/20190619 Get the latest Ansible 2.8 in Fedora.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11002-1.html) [#]: subject: (Get the latest Ansible 2.8 in Fedora) [#]: via: (https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/) [#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) From 5453702bf78a34aff1513441cd2a1e43e5e11529 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 Jun 2019 02:06:28 +0800 Subject: [PATCH 1082/1154] PRF:20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md @LuuMing --- ...eech Recognition-Speech-to-Text Systems.md | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md b/translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md index 0067324e41..bc5db34108 100644 --- a/translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md +++ b/translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (luuming) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 Good Open Source Speech Recognition/Speech-to-Text Systems) @@ -8,16 +8,15 @@ [#]: author: (Simon James https://fosspost.org/author/simonjames) 5 款不错的开源语音识别/语音文字转换系统 - ====== ![](https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/open-source-speech-recognition-speech-to-text.png?resize=1237%2C527&ssl=1) -语音文字转换speech-to-text(STT)系统就像它名字所蕴含的那样,是一种将说出的单词转换为文本文件以供后续用途的方式。 +语音文字转换speech-to-text(STT)系统就像它名字所蕴含的意思那样,是一种将说出的单词转换为文本文件以供后续用途的方式。 语音文字转换技术非常有用。它可以用到许多应用中,例如自动转录,使用自己的声音写书籍或文本,用生成的文本文件和其他工具做复杂的分析等。 -在过去,语音文字转换技术以专有软件和库为主导,开源替代品并不存在或是有严格的限制并且没有社区。这一点正在发生改变,当今有许多开源语音文字转换工具和库可以让你立即使用。 +在过去,语音文字转换技术以专有软件和库为主导,要么没有开源替代品,要么有着严格的限制,也没有社区。这一点正在发生改变,当今有许多开源语音文字转换工具和库可以让你随时使用。 这里我列出了 5 个。 @@ -27,74 +26,74 @@ ![5 Good Open Source Speech Recognition/Speech-to-Text Systems 15 open source speech recognition][1] -该项目由 Firefox 浏览器背后的组织 Mozilla 团队开发。它 100% 自由并且使用 TensorFlow 机器学习框架实现。 +该项目由 Firefox 浏览器的开发组织 Mozilla 团队开发。它是 100% 的自由开源软件,其名字暗示使用了 TensorFlow 机器学习框架实现去功能。 -换句话说,你可以用它训练自己的模型获得更好的效果,甚至可以用它转换其它的语言。你也可以轻松的将它集成到自己的 Tensorflow 机器学习项目中。可惜的是项目当前默认仅支持英语。 +换句话说,你可以用它训练自己的模型获得更好的效果,甚至可以用它来转换其它的语言。你也可以轻松的将它集成到自己的 Tensorflow 机器学习项目中。可惜的是项目当前默认仅支持英语。 -它也支持许多编程语言,例如 Python(3.6)。可以让你在数秒之内获取: +它也支持许多编程语言,例如 Python(3.6)。可以让你在数秒之内完成工作: ``` pip3 install deepspeech deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio my_audio_file.wav ``` -你也可以通过 npm 安装它: +你也可以通过 `npm` 安装它: ``` npm install deepspeech ``` -想要获得更多信息,请参考[项目主页][2]。 +- [项目主页][2] #### Kaldi ![5 Good Open Source Speech Recognition/Speech-to-Text Systems 17 open source speech recognition][3] -Kaldi 是一个用 C++ 写的开源语音识别软件,并且在 Apache 公共许可下发布。它可以运行在 Windows,macOS 和 Linux 上。它的开发始于 2009。 +Kaldi 是一个用 C++ 编写的开源语音识别软件,并且在 Apache 公共许可证下发布。它可以运行在 Windows、macOS 和 Linux 上。它的开发始于 2009。 -Kaldi 超过其他语音识别软件的主要特点是可扩展和模块化。社区提供了大量的三方模块可以用来完成你的任务。Kaldi 也支持深度神经网络,并且在它的网站上提供了[出色的文档][4]。 +Kaldi 超过其他语音识别软件的主要特点是可扩展和模块化。社区提供了大量的可以用来完成你的任务的第三方模块。Kaldi 也支持深度神经网络,并且在它的网站上提供了[出色的文档][4]。 -虽然代码主要由 C++ 完成,但它通过 Bash 和 Python 脚本进行了封装。因此,如果你仅仅想使用基本的语音到文字转换功能,你就会发现通过 Python 或 Bash 能够轻易的完成。 +虽然代码主要由 C++ 完成,但它通过 Bash 和 Python 脚本进行了封装。因此,如果你仅仅想使用基本的语音到文字转换功能,你就会发现通过 Python 或 Bash 能够轻易的实现。 -[Project’s homepage][5]. +- [项目主页][5] #### Julius ![5 Good Open Source Speech Recognition/Speech-to-Text Systems 19 open source speech recognition][6] -可能是有史以来最古老的语音识别软件之一。它的发展始于 1991 年的京都大学,之后在 2005 年将所有权转移到了一个独立的项目组。 +它可能是有史以来最古老的语音识别软件之一。它的开发始于 1991 年的京都大学,之后在 2005 年将所有权转移到了一个独立的项目组。 -Julius 的主要特点包括了执行实时 STT 的能力,低内存占用(20000 单词少于 64 MB),输出最优词N-best word/词图Word-graph的能力,当作服务器单元运行的能力和很多东西。这款软件主要为学术和研究所设计。由 C 语言写成,并且可以运行在 Linux,Windows,macOS 甚至 Android(在智能手机上)。 +Julius 的主要特点包括了执行实时 STT 的能力,低内存占用(20000 单词少于 64 MB),能够输出最优词N-best word词图Word-graph,能够作为服务器单元运行等等。这款软件主要为学术和研究所设计。由 C 语言写成,并且可以运行在 Linux、Windows、macOS 甚至 Android(在智能手机上)。 -它当前仅支持英语和日语。软件或许易于从 Linux 发行版的仓库中安装。只要在软件包管理器中搜索 julius 即可。最新的版本[发布][7]于大约一个半月之前。 +它当前仅支持英语和日语。软件应该能够从 Linux 发行版的仓库中轻松安装。只要在软件包管理器中搜索 julius 即可。最新的版本[发布][7]于本文发布前大约一个半月之前。 -[Project’s homepage][8]. +- [项目主页][8] #### Wav2Letter++ ![5 Good Open Source Speech Recognition/Speech-to-Text Systems 21 open source speech recognition][9] -如果你在寻找一个更加时髦的,那么这款一定适合。Wav2Letter++ 是一款由 Facebook 的 AI 研究团队于 2 个月之前发布的开源语言识别软件。代码在 BSD 许可下发布。 +如果你在寻找一个更加时髦的,那么这款一定适合。Wav2Letter++ 是一款由 Facebook 的 AI 研究团队于 2 个月之前发布的开源语言识别软件。代码在 BSD 许可证下发布。 -Facebook 描述它的库是“最快最先进state-of-the-art的语音识别系统”。构建它时的想法使其能在默认情况下对性能进行优化。Facebook 最新的机器学习库 [FlashLight][11] 也被用作 Wav2Letter++ 的底层核心。 +Facebook 描述它的库是“最快、最先进state-of-the-art的语音识别系统”。构建它时的理念使其默认针对性能进行了优化。Facebook 最新的机器学习库 [FlashLight][11] 也被用作 Wav2Letter++ 的底层核心。 -Wav2Letter++ 需要你先为所描述的语言建立一个模型来训练算法。没有任何一种语言(包括英语)的预训练模型,它仅仅是个机器学习驱动的文本语音转换工具,它用 C++ 写成,因此命名为 Wav2Letter++。 +Wav2Letter++ 需要你先为所描述的语言建立一个模型来训练算法。没有任何一种语言(包括英语)的预训练模型,它仅仅是个机器学习驱动的文本语音转换工具,它用 C++ 写成,因此被命名为 Wav2Letter++。 -[Project’s homepage][12]. +- [项目主页][12] #### DeepSpeech2 ![5 Good Open Source Speech Recognition/Speech-to-Text Systems 23 open source speech recognition][13] -中国巨头百度的研究人员也在开发他们自己的语音文字转换引擎,叫做“DeepSpeech2”。它是一个端对端的开源引擎,使用“PaddlePaddle”深度学习框架进行英语或汉语的文字转换。代码在 BSD 许可下发布。 +中国软件巨头百度的研究人员也在开发他们自己的语音文字转换引擎,叫做“DeepSpeech2”。它是一个端对端的开源引擎,使用“PaddlePaddle”深度学习框架进行英语或汉语的文字转换。代码在 BSD 许可证下发布。 -引擎可以训练在任何模型之上,并且可以用于任何想要的语言。模型并未随代码一同发布。你要像其他软件那样自己建立模型。DeepSpeech2 的源代码由 Python 写成,如果你使用过就会非常容易上手。 +该引擎可以在你想用的任何模型和任何语言上训练。模型并未随代码一同发布。你要像其他软件那样自己建立模型。DeepSpeech2 的源代码由 Python 写成,如果你使用过就会非常容易上手。 -[Project’s homepage][14]. +- [项目主页][14] ### 总结 -语音识别领域仍然主要地由专有软件巨头所占据,比如 Google 和 IBM(它们为此提供了闭源商业服务),但是开源同类软件很有前途。这 5 款开源语音识别引擎应当能够帮助你构建应用,随着时间推移,它们会不断地发展。在几年之后,我们希望开源成为这些技术中的常态,就像其他行业那样。 +语音识别领域仍然主要由专有软件巨头所占据,比如 Google 和 IBM(它们为此提供了闭源商业服务),但是开源同类软件很有前途。这 5 款开源语音识别引擎应当能够帮助你构建应用,随着时间推移,它们会不断地发展。在几年之后,我们希望开源成为这些技术中的常态,就像其他行业那样。 如果你对清单有其他的建议或评论,我们很乐意在下面听到。 @@ -104,8 +103,8 @@ via: https://fosspost.org/lists/open-source-speech-recognition-speech-to-text 作者:[Simon James][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/LuuMing) -校对:[校对者ID](https://github.com/校对者ID) +译者:[LuuMing](https://github.com/LuuMing) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0f87ade02a0734e00be7ece2b19e4d07e12ff464 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 Jun 2019 02:07:01 +0800 Subject: [PATCH 1083/1154] PUB:20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md @LuuMing https://linux.cn/article-11004-1.html --- ...d Open Source Speech Recognition-Speech-to-Text Systems.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md (99%) diff --git a/translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md b/published/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md similarity index 99% rename from translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md rename to published/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md index bc5db34108..07d273c666 100644 --- a/translated/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md +++ b/published/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (luuming) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11004-1.html) [#]: subject: (5 Good Open Source Speech Recognition/Speech-to-Text Systems) [#]: via: (https://fosspost.org/lists/open-source-speech-recognition-speech-to-text) [#]: author: (Simon James https://fosspost.org/author/simonjames) From e01055cad9b8b92827fc722439750bd9172b36de Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 22 Jun 2019 14:54:05 +0800 Subject: [PATCH 1084/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190622=20Open?= =?UTF-8?q?=20Source=20Slack=20Alternative=20Mattermost=20Gets=20$50M=20Fu?= =?UTF-8?q?nding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md --- ...lternative Mattermost Gets -50M Funding.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md diff --git a/sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md b/sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md new file mode 100644 index 0000000000..993e30d5ec --- /dev/null +++ b/sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open Source Slack Alternative Mattermost Gets $50M Funding) +[#]: via: (https://itsfoss.com/mattermost-funding/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Open Source Slack Alternative Mattermost Gets $50M Funding +====== + +[Mattermost][1], which presents itself as an open source alternative to [Slack][2] raised $50M in series B funding. This is definitely something to get excited for. + +[Slack][3] is a cloud-based team collaboration software that is mainly used for internal team communication. Enterprises, startups and even open source projects worldwide use it interact with colleagues and project members. Slack is free with limited features while the paid enterprise version has premium features. + +[Slack is valued at $20 billion][4] in June, 2019. You can guess the kind of impact it has made in the tech industry and certainly more products are trying to compete with Slack. + +### $50 million for an open source project + +![][5] + +Personally, I was not aware of Mattermost. But, when [VentureBeat][6] reported the story, it made me curious. The funding was led by [Y Combinator’s][7] Continuity with a new investor Battery Ventures and was joined by the existing investors – Redpoint and S28 Captial. + +With the [announcement][8], they also mentioned: + +> With today’s announcement, Mattermost becomes YC’s largest ever Series B investment, and more importantly, their largest open source investment to date. + +To give you some specifics, here’s what VentureBeat mentioned: + +> The capital infusion follows a $20 million series A in February and a $3.5 million seed round in February 2017 and brings the Palo Alto, California-based company’s total raised to roughly $70 million. + +If you are curious about their plans, you should go through their [official announcement post][8]. + +Even though it all sounds good, what is Mattermost? Maybe you didn’t know about it, until now. So, let us take a brief look at it: + +### A quick look at Mattermost + +![Mattermost][9] + +As mentioned, it is an open source Slack alternative. + +At first glance, it almost resembles the look and feel of Slack. Well, that’s the point here – you will have an open source solution that you’re comfortable using. + +It even integrates with some of the popular DevOps tools like Git, Bots, and CI/CD. In addition to the functionality, it focuses on security and privacy as well. + +[][10] + +Suggested read  Zettlr - Markdown Editor for Writers and Researchers + +Also, similar to Slack, it supports integration with multiple apps and services. + +Sounds promising? I think so. + +#### Pricing: Enterprise Edition vs Team Edition + +If you want them (Mattermost) to host it (or want priority support), you should opt for the Enterprise edition. However, if you want to host it without spending a penny, you can download the [Team edition][11] and install it on your Linux-based cloud/VPS server. + +Of course, we are not here to review it in-depth. However, I do want to mention that the enterprise edition is quite affordable. + +![][12] + +**Wrapping Up** + +Mattermost is definitely impressive. And, with a whopping $50M funding, it may become the next big thing in the open source community for users who were on the lookout for a secure and open source messaging platform with efficient team collaboration support. + +What do you think about this news? Is it something exciting for you? Were you already aware of Mattermost as a slack alternative? + +Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/mattermost-funding/ + +作者:[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://mattermost.com/ +[2]: https://itsfoss.com/slack-use-linux/ +[3]: https://slack.com +[4]: https://www.ft.com/content/98747b36-9368-11e9-aea1-2b1d33ac3271 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-wallpaper.png?resize=800%2C450&ssl=1 +[6]: https://venturebeat.com/2019/06/19/mattermost-raises-50-million-to-advance-its-open-source-slack-alternative/ +[7]: https://www.ycombinator.com/ +[8]: https://mattermost.com/blog/yc-leads-50m-series-b-in-mattermost-as-open-source-slack-alternative/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-screenshot.jpg?fit=800%2C497&ssl=1 +[10]: https://itsfoss.com/zettlr-markdown-editor/ +[11]: https://mattermost.com/download/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-enterprise-plan.jpg?fit=800%2C325&ssl=1 From 4bcf8dd064a8c069fad1a9f0190b72c50fdcb6c6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 22 Jun 2019 14:56:11 +0800 Subject: [PATCH 1085/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190612=20BitT?= =?UTF-8?q?orrent=20Client=20Deluge=202.0=20Released:=20Here=E2=80=99s=20W?= =?UTF-8?q?hat=E2=80=99s=20New?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md --- ... Deluge 2.0 Released- Here-s What-s New.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md diff --git a/sources/tech/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md b/sources/tech/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md new file mode 100644 index 0000000000..52fcdc0569 --- /dev/null +++ b/sources/tech/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: 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/) + +BitTorrent Client Deluge 2.0 Released: Here’s What’s New +====== + +You probably already know that [Deluge][1] is one of the [best Torrent clients available for Linux users][2]. However, the last stable release was almost two years back. + +Even though it was in active development, a major stable release wasn’t there – until recently. The latest version while we write this happens to be 2.0.2. So, if you haven’t downloaded the latest stable version – do try it out. + +In either case, if you’re curious, let us talk about what’s new. + +![Deluge][3] + +### Major improvements in Deluge 2.0 + +The new release introduces multi-user support – which was a much needed addition. + +In addition to that, there has been several performance improvements to handle more torrents with faster loading times. + +Also, with version 2.0, Deluge used Python 3 with minimal support for Python 2.7. Even for the user interface, they migrated from GTK UI to GTK3. + +As per the release notes, there are several more significant additions/improvements, which include: + + * Multi-user support. + * Performance updates to handle thousands of torrents with faster loading times. + * A New Console UI which emulates GTK/Web UIs. + * GTK UI migrated to GTK3 with UI improvements and additions. + * Magnet pre-fetching to allow file selection when adding torrent. + * Fully support libtorrent 1.2 release. + * Language switching support. + * Improved documentation hosted on ReadTheDocs. + * AutoAdd plugin replaces built-in functionality. + + + +### How to install or upgrade to Deluge 2.0 + +![][4] + +You should follow the official [installation guide][5] (using PPA or PyPi) for any Linux distro. However, if you are upgrading, you should go through the note mentioned in the release note: + +“_Deluge 2.0 is not compatible with Deluge 1.x clients or daemons so these will require upgrading too._ _Also_ _third-party Python scripts may not be compatible if they directly connect to the Deluge client and will need migrating._“ + +So, they insist to always make a backup of your [config][6] before a major version upgrade to guard against data loss. + +[][7] + +Suggested read  Ubuntu's Snap Apps Website Gets Much Needed Improvements + +And, if you are an author of a plugin, you need to upgrade it make it compatible with the new release. + +Direct download app packages not yet available for Windows and Mac OS. However, the release note mentions that they are being worked on. + +As an alternative, you can install them manually by following the [installation guide][5] in the updated official documentation. + +**Wrapping Up** + +What do you think about the latest stable release? Do you utilize Deluge as your BitTorrent client? Or do you find something else as a better alternative? + +Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/deluge-2-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://dev.deluge-torrent.org/ +[2]: https://itsfoss.com/best-torrent-ubuntu/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/deluge.jpg?fit=800%2C410&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/Deluge-2-release.png?resize=800%2C450&ssl=1 +[5]: https://deluge.readthedocs.io/en/latest/intro/01-install.html +[6]: https://dev.deluge-torrent.org/wiki/Faq#WheredoesDelugestoreitssettingsconfig +[7]: https://itsfoss.com/snap-store/ From 02dd6e82bba2fb140c5986e7f7ee3aecf35a2635 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 22 Jun 2019 15:10:42 +0800 Subject: [PATCH 1086/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190409=20VSCo?= =?UTF-8?q?dium:=20100%=20Open=20Source=20Version=20of=20Microsoft=20VS=20?= =?UTF-8?q?Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md --- ...pen Source Version of Microsoft VS Code.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md diff --git a/sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md b/sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md new file mode 100644 index 0000000000..e9ec3e4a85 --- /dev/null +++ b/sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md @@ -0,0 +1,123 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (VSCodium: 100% Open Source Version of Microsoft VS Code) +[#]: via: (https://itsfoss.com/vscodium/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +VSCodium: 100% Open Source Version of Microsoft VS Code +====== + +_**Brief: VSCodium is a fork of Microsoft’s popular Visual Studio Code editor. It’s identical to VS Code with the single biggest difference that unlike VS Code, VSCodium doesn’t track your usage data.**_ + +Microsoft’s [Visual Studio Code][1] is an excellent editor not only for web developers but also for other programmers. Due to its features, it’s considered one of the best open source code editors. + +Yes, it’s one of the many open source products from Microsoft. You can [easily install Visual Studio Code in Linux][2] thanks to the ready to use binaries in the form of DEB, RPM and Snap packages. + +And there is a problem which might not be an issue for a regular user but significant to an open source purist. + +The ready to use binaries Microsoft provides are not open source. + +Confused? Let me explain. + +The source code of VS Code is open sourced under MIT license. You can access it on the [GitHub][3]. However, the [installation files that Microsoft has created contain proprietary telemetry/tracking][4]. + +This tracking basically collects usage data and sends it to Microsoft to ‘help improve their products and services’. Telemetry reporting is common with software products these days. Even [Ubuntu does that but with more transparency][5]. + +You can [disable the telemetry in VS Code][6] but can you trust Microsoft completely? If the answer is no, then what are your options? + +You can build it from the source code and thus keep everything open source. But [installing from source code][7] is not always the prettiest option specially in today’s world when we are so used to of having binaries. + +Another option is to use VSCodium! + +### VSCodium: 100% open source form of Visual Studio Code + +![][8] + +[VSCodium][9] is a fork of Microsoft’s Visual Studio Code. This project’s sole aim is to provide you with ready to use binaries without Microsoft’s telemetry code. + +[][10] + +Suggested read  SuiteCRM: An Open Source CRM Takes Aim At Salesforce + +This solves the problem where you want to use VS Code without the proprietary code from Microsoft but you are not comfortable with building it from the source. + +Since [VSCodium is a fork of VS Code][11], it looks and functions exactly the same as VS Code. + +Here’s a screenshot of the first run of VS Code and VSCodium side by side in Ubuntu. Can you distinguish one from another? + +![Can you guess which is VSCode and VSCodium?][12] + +If you have not been able to distinguish between the two, look at the bottom. + +![That’s Microsoft][13] + +Apart from this and the logo of the two applications, there is no other noticeable difference. + +![VSCodium and VS Code in GNOME Menu][14] + +#### Installing VSCodium on Linux + +While VSCodium is available in some distributions like Parrot OS, you’ll have to add additional repositories in other Linux distributions. + +On Ubuntu and Debian based distributions, you can use the following commands to install VSCodium. + +First, add the GPG key of the repository: + +``` +wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add - +``` + +And then add the repository itself: + +``` +echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list +``` + +Now update your system and install VSCodium: + +``` +sudo apt update && sudo apt install codium +``` + +You can find the [installation instructions for other distributions on its page][15]. You should also read the [instructions about migrating from VS Code to VSCodium][16]. + +**What do you think of VSCodium?** + +Personally, I like the concept of VSCodium. To use the cliche, the project has its heart in the right place. I think, Linux distributions committed to open source may even start including it in their official repository. + +What do you think? Is it worth switching to VSCodium or would you rather opt out of the telemetry and continue using VS Code? + +And please, no “I use Vim” comments :D + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/vscodium/ + +作者:[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://code.visualstudio.com/ +[2]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[3]: https://github.com/Microsoft/vscode +[4]: https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005 +[5]: https://itsfoss.com/ubuntu-data-collection-stats/ +[6]: https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting +[7]: https://itsfoss.com/install-software-from-source-code/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium.png?resize=800%2C450&ssl=1 +[9]: https://vscodium.com/ +[10]: https://itsfoss.com/suitecrm-ondemand/ +[11]: https://github.com/VSCodium/vscodium +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium-vs-vscode.png?resize=800%2C450&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/microsoft-vscode-tracking.png?resize=800%2C259&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium-and-vscode.jpg?resize=800%2C220&ssl=1 +[15]: https://vscodium.com/#install +[16]: https://vscodium.com/#migrate From 23da63d4c005d368c25dcd3cf1139bb728bcb94a Mon Sep 17 00:00:00 2001 From: chen ni Date: Sat, 22 Jun 2019 15:16:44 +0800 Subject: [PATCH 1087/1154] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8E=9F=E6=96=87?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这里在从原网站复制过来的时候多出来了一段 --- sources/tech/20190416 Can schools be agile.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/tech/20190416 Can schools be agile.md b/sources/tech/20190416 Can schools be agile.md index ca9db0c33f..8223973619 100644 --- a/sources/tech/20190416 Can schools be agile.md +++ b/sources/tech/20190416 Can schools be agile.md @@ -39,8 +39,6 @@ So why a tendency to ignore (or be outright hostile toward) ideas that come from I, for example, have certainly faced criticism in the past for suggesting that we look to other professions for ideas and inspiration that can help us better meet the needs of students. A common refrain is something like: "You're trying to treat our students like widgets!" But how could our students be treated any more like widgets than they already are? They matriculate through school in age-based cohorts, going from siloed class to class each day by the sound of a shrill bell, and receive grades based on arbitrary tests that emphasize sameness over individuality. -What I'm advocating is a clear-eyed and objective look at any idea from any sector with potential to help us better meet the needs of individual students, not that we somehow run our schools like businesses. - It may be news to many inside of education, but widgets—abstract units of production that evoke the idea of assembly line standardization—are not a significant part of the modern manufacturing sector. Thanks to the culture of continuous improvement described above, modern, advanced manufacturing delivers just what the individual customer wants, at a competitive price, exactly when she wants it. If we adapted this model to our schools, teachers would be more likely to collaborate and constantly refine their unique paths of growth for all students based on just-in-time needs and desires—regardless of the time, subject, or any other traditional norm. What I'm advocating is a clear-eyed and objective look at any idea from any sector with potential to help us better meet the needs of individual students, not that we somehow run our schools like businesses. In order for this to happen effectively, however, we need to scrutinize a leadership structure that has frankly remained stagnant for over 100 years. From 431aec897ae979b287f5ca5257a609b57f31a85d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 22 Jun 2019 15:29:05 +0800 Subject: [PATCH 1088/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190622=20Clou?= =?UTF-8?q?dflare's=20random=20number=20generator,=20robotics=20data=20vis?= =?UTF-8?q?ualization,=20npm=20token=20scanning,=20and=20more=20news?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md --- ...tion, npm token scanning, and more news.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md diff --git a/sources/tech/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md b/sources/tech/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md new file mode 100644 index 0000000000..af595d310b --- /dev/null +++ b/sources/tech/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cloudflare's random number generator, robotics data visualization, npm token scanning, and more news) +[#]: via: (https://opensource.com/article/19/6/news-june-22) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Cloudflare's random number generator, robotics data visualization, npm token scanning, and more news +====== +Catch up on the biggest open source headlines from the past two weeks. +![Weekly news roundup with TV][1] + +In this edition of our open source news roundup, we take a look Cloudflare's open source random number generator, more open source robotics data, new npm functionality, and more! + +### Cloudflare announces open source random number generator project + +Is there such a thing as a truly random number? Internet security and services provider Cloudflare things so. To prove it, the company has formed [The League of Entropy][2], an open source project to create a generator for random numbers. + +The League consists of Cloudflare and "five other organisations — predominantly universities and security companies." They share random numbers, using an open source tool called [Drand][3] (short for Distributed Randomness Beacon Daemon). The numbers are then "composited into one random number" on the basis that "several random numbers are more random than one random number." While the League's random number generator isn't intended "for any kind of password or cryptographic seed generation," Cloudflare's CEO Matthew Prince points out that if "you need a way of having a known random source, this is a really valuable tool." + +### Cruise open sources robotics data analysis tool + +Projects involved in creating self-driving vehicles generate petabytes of data. And with amounts of data that large comes the challenge of quickly and effectively analyzing it. To make the task easier, General Motors subsidiary Cruise has made its Webviz data visualization tool "[freely available to developers][4] in need of a modular robotics analysis solution." + +Webviz "takes as input any bag file (the message format used by the popular Robot Operating System) and outputs charts and graphs." It "contains a collection of general panels (which visualize data) applicable to most robotics developers," said Esther Weon, a software engineer at Cruise. The company also plans to "release a public API that’ll allow developers to build custom panels themselves." + +The code for Webviz is [available on GitHub][5], where you can download or contribute to the project. + +### npm provides more security + +The team behind npm, the site providing JavaScript package hosting, has a new collaboration with GitHub to automatically scan for exposed tokens that could give hackers access that doesn't belong to them. The project includes a handy automatic revoke of leaked credentials them if are still valid. This could drastically reduce vulnerabilities in the JavaScript community. For instructions on how to participate, see the [original article][6]. + +Note that this news was found via the [Changelog news][7]. + +### Better end of life tracking via open source + +A new project, [endoflife.date][8], aims to overcome the complexity of end of life (EOL) announcements for software. It's part tracker, part public announcement on what good documentation looks like for software. As the README states: "The reason this site exists is because this information is very often hidden away. If you're releasing something on a regular basis: + + 1. List only supported releases. + 2. Give EoL dates/policy if possible. + 3. Hide unsupported releases behind a few extra clicks. + 4. Mention security/active release difference if needed." + + + +Check out the [source code][9] for more information. + +### In other news + + * [Medicine needs to embrace open source][10] + * [Using geospatial data to create safer roads][11] + * [Embracing open source could be a big competitive advantage for businesses][12] + + + +_Thanks, as always, to Opensource.com staff members and moderators for their help this week._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/news-june-22 + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i (Weekly news roundup with TV) +[2]: https://thenextweb.com/dd/2019/06/17/cloudflares-new-open-source-project-helps-anyone-obtain-truly-random-numbers/ +[3]: https://github.com/dedis/drand +[4]: https://venturebeat.com/2019/06/18/cruise-open-sources-webview-a-tool-for-robotics-data-analysis/ +[5]: https://github.com/cruise-automation/webviz +[6]: https://blog.npmjs.org/post/185680936500/protecting-package-publishers-npm-token-security +[7]: https://changelog.com/news/npm-token-scanning-extending-to-github-NAoe +[8]: https://endoflife.date/ +[9]: https://github.com/captn3m0/endoflife.date +[10]: https://www.zdnet.com/article/medicine-needs-to-embrace-open-source/ +[11]: https://itbrief.co.nz/story/using-geospatial-data-to-create-safer-roads +[12]: https://www.fastcompany.com/90364152/embracing-open-source-could-be-a-big-competitive-advantage-for-businesses From 969d7f2316d1417854df33258436d3fd62957382 Mon Sep 17 00:00:00 2001 From: chen ni Date: Sat, 22 Jun 2019 16:52:57 +0800 Subject: [PATCH 1089/1154] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8E=9F=E6=96=87?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190416 Can schools be agile.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/tech/20190416 Can schools be agile.md b/sources/tech/20190416 Can schools be agile.md index 8223973619..adcd4f4117 100644 --- a/sources/tech/20190416 Can schools be agile.md +++ b/sources/tech/20190416 Can schools be agile.md @@ -49,8 +49,6 @@ While I certainly appreciate the argument that education is an animal significan Not surprisingly, a go-to resource I recommend to any school wanting to begin or accelerate this process is _The Open Organization_ by Jim Whitehurst. Not only does the book provide a window into how educators can create more open, inclusive leadership structures—where mutual respect enables nimble decisions to be made per real-time data—but it does so in language easily adaptable to the rather strange lexicon that's second nature to educators. Open organization thinking provides pragmatic ways any organization can empower members to be more open: sharing ideas and resources, embracing a culture of collaborative participation as a top priority, developing an innovation mindset through rapid prototyping, valuing ideas based on merit rather than the rank of the person proposing them, and building a strong sense of community that's baked into the organization's DNA. Such an open organization crowd-sources ideas from both inside and outside its formal structure and creates the type of environment that enables localized, student-centered innovations to thrive. -We simply can't rely on solutions and practices we developed in a factory-model paradigm. - Here's the bottom line: Essential to a culture of continuous improvement is recognizing that what we've done in the past may not be suitable in a rapidly changing future. For educators, that means we simply can't rely on solutions and practices we developed in a factory-model paradigm. We must acknowledge countless examples of best practices from other sectors—such as non-profits, the military, the medical profession, and yes, even business—that can at least _inform_ how we rethink what we do in the best interest of students. By moving beyond the traditionally sanctioned "eduspeak" world, we create opportunities for considering perspectives. We can better see the forest for the trees, taking a more objective look at the problems we face, as well as acknowledging what we do very well. Intentionally considering ideas from all sources—from first year classroom teachers to the latest NYT Business & Management Leadership bestseller—offers us a powerful way to engage existing talent within our schools to help overcome the institutionalized inertia that has prevented more positive change from taking hold in our schools and districts. From 359e0506a2a403d56de7a17a3c2009ee00b32598 Mon Sep 17 00:00:00 2001 From: ninifly <18328038336@163.com> Date: Sat, 22 Jun 2019 21:44:30 +0800 Subject: [PATCH 1090/1154] =?UTF-8?q?Revert=20"=E8=B6=85=E6=9C=9F=E5=9B=9E?= =?UTF-8?q?=E6=94=B6:=20sources/tech/20131228=20Introduction=20to=20Clojur?= =?UTF-8?q?e=20-=20Modern=20dialect=20of=20Lisp=20(Part=201).md"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Introduction to Clojure - Modern dialect of Lisp (Part 1).md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md b/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md index 5e5f4df763..0fb3c6469d 100644 --- a/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md +++ b/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ninifly) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c442d0643e5d1a04fd648ca8a697d1fdfdca6de9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 22 Jun 2019 21:51:17 +0800 Subject: [PATCH 1091/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190619=20Gett?= =?UTF-8?q?ing=20started=20with=20OpenSSL:=20Cryptography=20basics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md --- ...arted with OpenSSL- Cryptography basics.md | 342 ++++++++++++++++++ 1 file changed, 342 insertions(+) create mode 100644 sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md diff --git a/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md b/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md new file mode 100644 index 0000000000..0f3da1b13e --- /dev/null +++ b/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md @@ -0,0 +1,342 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with OpenSSL: Cryptography basics) +[#]: via: (https://opensource.com/article/19/6/cryptography-basics-openssl-part-1) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu/users/akritiko/users/clhermansen) + +Getting started with OpenSSL: Cryptography basics +====== +Need a primer on cryptography basics, especially regarding OpenSSL? Read +on. +![A lock on the side of a building][1] + +This article is the first of two on cryptography basics using [OpenSSL][2], a production-grade library and toolkit popular on Linux and other systems. (To install the most recent version of OpenSSL, see [here][3].) OpenSSL utilities are available at the command line, and programs can call functions from the OpenSSL libraries. The sample program for this article is in C, the source language for the OpenSSL libraries. + +The two articles in this series cover—collectively—cryptographic hashes, digital signatures, encryption and decryption, and digital certificates. You can find the code and command-line examples in a ZIP file from [my website][4]. + +Let’s start with a review of the SSL in the OpenSSL name. + +### A quick history + +[Secure Socket Layer (SSL)][5] is a cryptographic protocol that [Netscape][6] released in 1995. This protocol layer can sit atop HTTP, thereby providing the _S_ for _secure_ in HTTPS. The SSL protocol provides various security services, including two that are central in HTTPS: + + * Peer authentication (aka mutual challenge): Each side of a connection authenticates the identity of the other side. If Alice and Bob are to exchange messages over SSL, then each first authenticates the identity of the other. + * Confidentiality: A sender encrypts messages before sending these over a channel. The receiver then decrypts each received message. This process safeguards network conversations. Even if eavesdropper Eve intercepts an encrypted message from Alice to Bob (a _man-in-the-middle_ attack), Eve finds it computationally infeasible to decrypt this message. + + + +These two key SSL services, in turn, are tied to others that get less attention. For example, SSL supports message integrity, which assures that a received message is the same as the one sent. This feature is implemented with hash functions, which likewise come with the OpenSSL toolkit. + +SSL is versioned (e.g., SSLv2 and SSLv3), and in 1999 Transport Layer Security (TLS) emerged as a similar protocol based upon SSLv3. TLSv1 and SSLv3 are alike, but not enough so to work together. Nonetheless, it is common to refer to SSL/TLS as if they are one and the same protocol. For example, OpenSSL functions often have SSL in the name even when TLS rather than SSL is in play. Furthermore, calling OpenSSL command-line utilities begins with the term **openssl**. + +The documentation for OpenSSL is spotty beyond the **man** pages, which become unwieldy given how big the OpenSSL toolkit is. Command-line and code examples are one way to bring the main topics into focus together. Let’s start with a familiar example—accessing a web site with HTTPS—and use this example to pick apart the cryptographic pieces of interest. + +### An HTTPS client + +The **client** program shown here connects over HTTPS to Google: + + +``` +/* compilation: gcc -o client client.c -lssl -lcrypto */ + +#include <stdio.h> + +#include <stdlib.h> + +#include <openssl/bio.h> /* BasicInput/Output streams */ + +#include <openssl/err.h> /* errors */ + +#include <openssl/ssl.h> /* core library */ + +#define BuffSize 1024 + +void report_and_exit(const char* msg) { +  [perror][7](msg); +  ERR_print_errors_fp(stderr); +  [exit][8](-1); +} + +void init_ssl() { +  SSL_load_error_strings(); +  SSL_library_init(); +} + +void cleanup(SSL_CTX* ctx, BIO* bio) { +  SSL_CTX_free(ctx); +  BIO_free_all(bio); +} + +void secure_connect(const char* hostname) { +  char name[BuffSize]; +  char request[BuffSize]; +  char response[BuffSize]; + +  const SSL_METHOD* method = TLSv1_2_client_method(); +  if (NULL == method) report_and_exit("TLSv1_2_client_method..."); + +  SSL_CTX* ctx = SSL_CTX_new(method); +  if (NULL == ctx) report_and_exit("SSL_CTX_new..."); + +  BIO* bio = BIO_new_ssl_connect(ctx); +  if (NULL == bio) report_and_exit("BIO_new_ssl_connect..."); + +  SSL* ssl = NULL; + +  /* link bio channel, SSL session, and server endpoint */ + +  [sprintf][9](name, "%s:%s", hostname, "https"); +  BIO_get_ssl(bio, &ssl); /* session */ +  SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* robustness */ +  BIO_set_conn_hostname(bio, name); /* prepare to connect */ + +  /* try to connect */ +  if (BIO_do_connect(bio) <= 0) { +    cleanup(ctx, bio); +    report_and_exit("BIO_do_connect..."); +  } + +  /* verify truststore, check cert */ +  if (!SSL_CTX_load_verify_locations(ctx, +                                      "/etc/ssl/certs/ca-certificates.crt", /* truststore */ +                                      "/etc/ssl/certs/")) /* more truststore */ +    report_and_exit("SSL_CTX_load_verify_locations..."); + +  long verify_flag = SSL_get_verify_result(ssl); +  if (verify_flag != X509_V_OK) +    [fprintf][10](stderr, +            "##### Certificate verification error (%i) but continuing...\n", +            (int) verify_flag); + +  /* now fetch the homepage as sample data */ +  [sprintf][9](request, +          "GET / HTTP/1.1\x0D\x0AHost: %s\x0D\x0A\x43onnection: Close\x0D\x0A\x0D\x0A", +          hostname); +  BIO_puts(bio, request); + +  /* read HTTP response from server and print to stdout */ +  while (1) { +    [memset][11](response, '\0', sizeof(response)); +    int n = BIO_read(bio, response, BuffSize); +    if (n <= 0) break; /* 0 is end-of-stream, < 0 is an error */ +  [puts][12](response); +  } + +  cleanup(ctx, bio); +} + +int main() { +  init_ssl(); + +  const char* hostname = "www.google.com:443"; +  [fprintf][10](stderr, "Trying an HTTPS connection to %s...\n", hostname); +  secure_connect(hostname); + +return 0; +} +``` + +This program can be compiled and executed from the command line (note the lowercase L in **-lssl** and **-lcrypto**): + +**gcc** **-o** **client client.c -lssl** **-lcrypto** + +This program tries to open a secure connection to the web site [www.google.com][13]. As part of the TLS handshake with the Google web server, the **client** program receives one or more digital certificates, which the program tries (but, on my system, fails) to verify. Nonetheless, the **client** program goes on to fetch the Google homepage through the secure channel. This program depends on the security artifacts mentioned earlier, although only a digital certificate stands out in the code. The other artifacts remain behind the scenes and are clarified later in detail. + +Generally, a client program in C or C++ that opened an HTTP (non-secure) channel would use constructs such as a _file descriptor_ for a _network socket_, which is an endpoint in a connection between two processes (e.g., the client program and the Google web server). A file descriptor, in turn, is a non-negative integer value that identifies, within a program, any file-like construct that the program opens. Such a program also would use a structure to specify details about the web server’s address. + +None of these relatively low-level constructs occurs in the client program, as the OpenSSL library wraps the socket infrastructure and address specification in high-level security constructs. The result is a straightforward API. Here’s a first look at the security details in the example **client** program. + + * The program begins by loading the relevant OpenSSL libraries, with my function **init_ssl** making two calls into OpenSSL: + +**SSL_library_init(); SSL_load_error_strings();** + + * The next initialization step tries to get a security _context_, a framework of information required to establish and maintain a secure channel to the web server. **TLS 1.2** is used in the example, as shown in this call to an OpenSSL library function: + +**const SSL_METHOD* method = TLSv1_2_client_method(); /* TLS 1.2 */** + +If the call succeeds, then the **method** pointer is passed to the library function that creates the context of type **SSL_CTX**: + +**SSL_CTX*** **ctx** **= SSL_CTX_new(method);** + +The **client** program checks for errors on each of these critical library calls, and then the program terminates if either call fails. + + * Two other OpenSSL artifacts now come into play: a security session of type **SSL**, which manages the secure connection from start to finish; and a secured stream of type **BIO** (Basic Input/Output), which is used to communicate with the web server. The **BIO** stream is generated with this call: + +**BIO* bio = BIO_new_ssl_connect(ctx);** + +Note that the all-important context is the argument. The **BIO** type is the OpenSSL wrapper for the **FILE** type in C. This wrapper secures the input and output streams between the **client** program and Google's web server. + + * With the **SSL_CTX** and **BIO** in hand, the program then links these together in an **SSL** session. Three library calls do the work: + +**BIO_get_ssl(bio, &ssl); /* get a TLS session */** + +**SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* for robustness */** + +**BIO_set_conn_hostname(bio, name); /* prepare to connect to Google */** + +The secure connection itself is established through this call: + +**BIO_do_connect(bio);** + +If this last call does not succeed, the **client** program terminates; otherwise, the connection is ready to support a confidential conversation between the **client** program and the Google web server. + + + + +During the handshake with the web server, the **client** program receives one or more digital certificates that authenticate the server’s identity. However, the **client** program does not send a certificate of its own, which means that the authentication is one-way. (Web servers typically are configured _not_ to expect a client certificate.) Despite the failed verification of the web server’s certificate, the **client** program continues by fetching the Google homepage through the secure channel to the web server. + +Why does the attempt to verify a Google certificate fail? A typical OpenSSL installation has the directory **/etc/ssl/certs**, which includes the **ca-certificates.crt** file. The directory and the file together contain digital certificates that OpenSSL trusts out of the box and accordingly constitute a _truststore_. The truststore can be updated as needed, in particular, to include newly trusted certificates and to remove ones no longer trusted. + +The client program receives three certificates from the Google web server, but the OpenSSL truststore on my machine does not contain exact matches. As presently written, the **client** program does not pursue the matter by, for example, verifying the digital signature on a Google certificate (a signature that vouches for the certificate). If that signature were trusted, then the certificate containing it should be trusted as well. Nonetheless, the client program goes on to fetch and then to print Google’s homepage. The next section gets into more detail. + +### The hidden security pieces in the client program + +Let’s start with the visible security artifact in the client example—the digital certificate—and consider how other security artifacts relate to it. The dominant layout standard for a digital certificate is X509, and a production-grade certificate is issued by a certificate authority (CA) such as [Verisign][14]. + +A digital certificate contains various pieces of information (e.g., activation and expiration dates, and a domain name for the owner), including the issuer’s identity and _digital signature_, which is an encrypted _cryptographic hash_ value. A certificate also has an unencrypted hash value that serves as its identifying _fingerprint_. + +A hash value results from mapping an arbitrary number of bits to a fixed-length digest. What the bits represent (an accounting report, a novel, or maybe a digital movie) is irrelevant. For example, the Message Digest version 5 (MD5) hash algorithm maps input bits of whatever length to a 128-bit hash value, whereas the SHA1 (Secure Hash Algorithm version 1) algorithm maps input bits to a 160-bit value. Different input bits result in different—indeed, statistically unique—hash values. The next article goes into further detail and focuses on what makes a hash function _cryptographic_. + +Digital certificates differ in type (e.g., _root_, _intermediate_, and _end-entity_ certificates) and form a hierarchy that reflects these types. As the name suggests, a _root_ certificate sits atop the hierarchy, and the certificates under it inherit whatever trust the root certificate has. The OpenSSL libraries and most modern programming languages have an X509 type together with functions that deal with such certificates. The certificate from Google has an X509 format, and the **client** program checks whether this certificate is **X509_V_OK**. + +X509 certificates are based upon public-key infrastructure (PKI), which includes algorithms—RSA is the dominant one—for generating _key pairs_: a public key and its paired private key. A public key is an identity: [Amazon’s][15] public key identifies it, and my public key identifies me. A private key is meant to be kept secret by its owner. + +The keys in a pair have standard uses. A public key can be used to encrypt a message, and the private key from the same pair can then be used to decrypt the message. A private key also can be used to sign a document or other electronic artifact (e.g., a program or an email), and the public key from the pair can then be used to verify the signature. The following two examples fill in some details. + +In the first example, Alice distributes her public key to the world, including Bob. Bob then encrypts a message with Alice’s public key, sending the encrypted message to Alice. The message encrypted with Alice’s public key is decrypted with her private key, which (by assumption) she alone has, like so: + + +``` +             +------------------+ encrypted msg  +-------------------+ +Bob's msg--->|Alice's public key|--------------->|Alice's private key|---> Bob's msg +             +------------------+                +-------------------+ +``` + +Decrypting the message without Alice’s private key is possible in principle, but infeasible in practice given a sound cryptographic key-pair system such as RSA. + +Now, for the second example, consider signing a document to certify its authenticity. The signature algorithm uses a private key from a pair to process a cryptographic hash of the document to be signed: + + +``` +                    +-------------------+ +Hash of document--->|Alice's private key|--->Alice's digital signature of the document +                    +-------------------+ +``` + +Assume that Alice digitally signs a contract sent to Bob. Bob then can use Alice’s public key from the key pair to verify the signature: + + +``` +                                             +------------------+ +Alice's digital signature of the document--->|Alice's public key|--->verified or not +                                             +------------------+ +``` + +It is infeasible to forge Alice’s signature without Alice’s private key: hence, it is in Alice’s interest to keep her private key secret. + +None of these security pieces, except for digital certificates, is explicit in the **client** program. The next article fills in the details with examples that use the OpenSSL utilities and library functions. + +### OpenSSL from the command line + +In the meantime, let’s take a look at OpenSSL command-line utilities: in particular, a utility to inspect the certificates from a web server during the TLS handshake. Invoking the OpenSSL utilities begins with the **openssl** command and then adds a combination of arguments and flags to specify the desired operation. + +Consider this command: + +**openssl list-cipher-algorithms** + +The output is a list of associated algorithms that make up a _cipher suite_. Here’s the start of the list, with comments to clarify the acronyms: + + +``` +AES-128-CBC ## Advanced Encryption Standard, Cipher Block Chaining +AES-128-CBC-HMAC-SHA1 ## Hash-based Message Authentication Code with SHA1 hashes +AES-128-CBC-HMAC-SHA256 ## ditto, but SHA256 rather than SHA1 +... +``` + +The next command, using the argument **s_client**, opens a secure connection to **[www.google.com][13]** and prints screens full of information about this connection: + +**openssl s_client -connect [www.google.com:443][16] -showcerts** + +The port number 443 is the standard one used by web servers for receiving HTTPS rather than HTTP connections. (For HTTP, the standard port is 80.) The network address **[www.google.com:443][16]** also occurs in the **client** program's code. If the attempted connection succeeds, the three digital certificates from Google are displayed together with information about the secure session, the cipher suite in play, and related items. For example, here is a slice of output from near the start, which announces that a _certificate chain_ is forthcoming. The encoding for the certificates is base64: + + +``` +Certificate chain + 0 s:/C=US/ST=California/L=Mountain View/O=Google LLC/CN=www.google.com + i:/C=US/O=Google Trust Services/CN=Google Internet Authority G3 +\-----BEGIN CERTIFICATE----- +MIIEijCCA3KgAwIBAgIQdCea9tmy/T6rK/dDD1isujANBgkqhkiG9w0BAQsFADBU +MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMSUw +... +``` + +A major web site such as Google usually sends multiple certificates for authentication. + +The output ends with summary information about the TLS session, including specifics on the cipher suite: + + +``` +SSL-Session: +    Protocol : TLSv1.2 +    Cipher : ECDHE-RSA-AES128-GCM-SHA256 +    Session-ID: A2BBF0E4991E6BBBC318774EEE37CFCB23095CC7640FFC752448D07C7F438573 +... +``` + +The protocol **TLS 1.2** is used in the **client** program, and the **Session-ID** uniquely identifies the connection between the **openssl** utility and the Google web server. The **Cipher** entry can be parsed as follows: + + * **ECDHE** (Elliptic Curve Diffie Hellman Ephemeral) is an effective and efficient algorithm for managing the TLS handshake. In particular, ECDHE solves the _key-distribution problem_ by ensuring that both parties in a connection (e.g., the client program and the Google web server) use the same encryption/decryption key, which is known as the _session key_. The follow-up article digs into the details. + + * **RSA** (Rivest Shamir Adleman) is the dominant public-key cryptosystem and named after the three academics who first described the system in the late 1970s. The key-pairs in play are generated with the RSA algorithm. + + * **AES128** (Advanced Encryption Standard) is a _block cipher_ that encrypts and decrypts blocks of bits. (The alternative is a _stream cipher_, which encrypts and decrypts bits one at a time.) The cipher is _symmetric_ in that the same key is used to encrypt and to decrypt, which raises the key-distribution problem in the first place. AES supports key sizes of 128 (used here), 192, and 256 bits: the larger the key, the better the protection. + +Key sizes for symmetric cryptosystems such as AES are, in general, smaller than those for asymmetric (key-pair based) systems such as RSA. For example, a 1024-bit RSA key is relatively small, whereas a 256-bit key is currently the largest for AES. + + * **GCM** (Galois Counter Mode) handles the repeated application of a cipher (in this case, AES128) during a secured conversation. AES128 blocks are only 128-bits in size, and a secure conversation is likely to consist of multiple AES128 blocks from one side to the other. GCM is efficient and commonly paired with AES128. + + * **SHA256** (Secure Hash Algorithm 256 bits) is the cryptographic hash algorithm in play. The hash values produced are 256 bits in size, although even larger values are possible with SHA. + + + + +Cipher suites are in continual development. Not so long ago, for example, Google used the RC4 stream cipher (Ron’s Cipher version 4 after Ron Rivest from RSA). RC4 now has known vulnerabilities, which presumably accounts, at least in part, for Google’s switch to AES128. + +### Wrapping up + +This first look at OpenSSL, through a secure C web client and various command-line examples, has brought to the fore a handful of topics in need of more clarification. [The next article gets into the details][17], starting with cryptographic hashes and ending with a fuller discussion of how digital certificates address the key distribution challenge. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 + +作者:[Marty Kalin][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/mkalindepauledu/users/akritiko/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_3reasons.png?itok=k6F3-BqA (A lock on the side of a building) +[2]: https://www.openssl.org/ +[3]: https://www.howtoforge.com/tutorial/how-to-install-openssl-from-source-on-linux/ +[4]: http://condor.depaul.edu/mkalin +[5]: https://en.wikipedia.org/wiki/Transport_Layer_Security +[6]: https://en.wikipedia.org/wiki/Netscape +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/sprintf.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/memset.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html +[13]: http://www.google.com +[14]: https://www.verisign.com +[15]: https://www.amazon.com +[16]: http://www.google.com:443 +[17]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2 From 77287aa0a2fc1e97685753030ee89f3549c5344d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 22 Jun 2019 21:57:34 +0800 Subject: [PATCH 1092/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190605=20How?= =?UTF-8?q?=20to=20navigate=20the=20Kubernetes=20learning=20curve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190605 How to navigate the Kubernetes learning curve.md --- ... navigate the Kubernetes learning curve.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20190605 How to navigate the Kubernetes learning curve.md diff --git a/sources/tech/20190605 How to navigate the Kubernetes learning curve.md b/sources/tech/20190605 How to navigate the Kubernetes learning curve.md new file mode 100644 index 0000000000..0fde8d1383 --- /dev/null +++ b/sources/tech/20190605 How to navigate the Kubernetes learning curve.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to navigate the Kubernetes learning curve) +[#]: via: (https://opensource.com/article/19/6/kubernetes-learning-curve) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux/users/fatherlinux) + +How to navigate the Kubernetes learning curve +====== +Kubernetes is like a dump truck. It's elegant for solving the problems +it's designed for, but you have to master the learning curve first. +![Dump truck rounding a turn in the road][1] + +In _[Kubernetes is a dump truck][2]_, I talked about how a tool can be elegant for the problem it was designed to solve—once you learn how to use it. In part 2 of this series, I'm going a little deeper into the Kubernetes' learning curve. + +The journey to [Kubernetes][3] often starts with running one container on one host. You quickly discover how easy it is to run new versions of software, how easy it is to share that software with others, and how easy it is for those users to run it the way you intended. + +But then you need + + * Two containers + * Two hosts + + + +It's easy to fire up one web server on port 80 with a container, but what happens when you need to fire up a second container on port 80? What happens when you are building a production environment and you need the containerized web server to fail over to a second host? The short answer, in either case, is you have to move into container orchestration. + +Inevitably, when you start to handle the two containers or two hosts problem, you'll introduce complexity and, hence, a learning curve. The two services (a more generalized version of a container) / two hosts problem has been around for a long time and has always introduced complexity. + +Historically, this would have involved load balancers, clustering software, and even clustered file systems. Configuration logic for every service is embedded in every system (load balancers, cluster software, and file systems). Running 60 or 70 services, clustered, behind load balancers is complex. Adding another new service is also complex. Worse, decommissioning a service is a nightmare. Thinking back on my days of troubleshooting production MySQL and Apache servers with logic embedded in three, four, or five different places, all in different formats, still makes my head hurt. + +Kubernetes elegantly solves all these problems with one piece of software: + + 1. Two services (containers): Check + 2. Two servers (high availability): Check + 3. Single source of configuration: Check + 4. Standard configuration format: Check + 5. Networking: Check + 6. Storage: Check + 7. Dependencies (what services talk to what databases): Check + 8. Easy provisioning: Check + 9. Easy de-provisioning: Check (perhaps Kubernetes' _most_ powerful piece) + + + +Wait, it's starting to look like Kubernetes is pretty elegant and pretty powerful. _It is._ You can model an entire miniature IT universe in Kubernetes. + +![Kubernetes business model][4] + +So yes, there is a learning curve when starting to use a giant dump truck (or any professional equipment). There's also a learning curve to use Kubernetes, but it's worth it because you can solve so many problems with one tool. If you are apprehensive about the learning curve, think through all the underlying networking, storage, and security problems in IT infrastructure and envision their solutions today—they're not easier. Especially when you introduce more and more services, faster and faster. Velocity is the goal nowadays, so give special consideration to the provisioning and de-provisioning problem. + +But don't confuse the learning curve for building or equipping Kubernetes (picking the right mud flaps for your dump truck can be hard, LOL) with the learning curve for using it. Learning to build your own Kubernetes with so many different choices at so many different layers (container engine, logging, monitoring, service mesh, storage, networking), and then maintaining updated selections of each component every six months, might not be worth the investment—but learning to use it is absolutely worth it. + +I eat, sleep, and breathe Kubernetes and containers every day, and even I struggle to keep track of all the major new projects announced literally almost every day. But there isn't a day that I'm not excited about the operational benefits of having a single tool to model an entire IT miniverse. Also, remember Kubernetes has matured a ton and will continue to do so. Like Linux and OpenStack before it, the interfaces and de facto projects at each layer will mature and become easier to select. + +In the third article in this series, I'll dig into what you need to know before you drive your Kubernetes "truck." + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/kubernetes-learning-curve + +作者:[Scott McCarty][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/fatherlinux/users/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dumptruck_car_vehicle_storage_container_road.jpg?itok=TWK0CbX_ (Dump truck rounding a turn in the road) +[2]: https://opensource.com/article/19/6/kubernetes-dump-truck +[3]: https://kubernetes.io/ +[4]: https://opensource.com/sites/default/files/uploads/developer_native_experience_-_mapped_to_traditional_1.png (Kubernetes business model) From 5ccf646b5f1f7fe24d95ca1073b5e3273fee1630 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 22 Jun 2019 21:58:32 +0800 Subject: [PATCH 1093/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190604=20Kube?= =?UTF-8?q?rnetes=20is=20a=20dump=20truck:=20Here's=20why?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md --- ... Kubernetes is a dump truck- Here-s why.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md diff --git a/sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md b/sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md new file mode 100644 index 0000000000..40aef2d614 --- /dev/null +++ b/sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kubernetes is a dump truck: Here's why) +[#]: via: (https://opensource.com/article/19/6/kubernetes-dump-truck) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) + +Kubernetes is a dump truck: Here's why +====== +Dump trucks are an elegant solution to a wide range of essential +business problems. +![Dump truck with kids standing in the foreground][1] + +As we approach Kubernetes anniversary on Friday, June 7 this week let's start with this. + +Dump trucks are elegant. Seriously, stay with me for a minute. They solve a wide array of technical problems in an elegant way. They can move dirt, gravel, rocks, coal, construction material, or road barricades. They can even pull trailers with other pieces of heavy equipment on them. You can load a dump truck with five tons of dirt and drive across the country with it. For a nerd like me, that's elegance. + +But, they're not easy to use. Dump trucks require a special driver's license. They're also not easy to equip or maintain. There are a ton of options when you buy a dump truck and a lot of maintenance. But, they're elegant for moving dirt. + +You know what's not elegant for moving dirt? A late-model, compact sedan. They're way easier to buy. Easier to drive. Easier to maintain. But, they're terrible at carrying dirt. It would take 200 trips to carry five tons of dirt, and nobody would want the car after that. + +Alright, you're sold on using a dump truck, but you want to build it yourself. I get it. I'm a nerd and I love building things. But… + +If you owned a construction company, you wouldn't build your own dump trucks. You definitely wouldn't maintain the supply chain to rebuild dump trucks (that's a big supply chain). But you would learn to drive one. + +OK, my analogy is crude but easy to understand. Ease of use is relative. Ease of maintenance is relative. Ease of configuration is relative. It really depends on what you are trying to do. [Kubernetes][2] is no different. + +Building Kubernetes once isn't too hard. Equipping Kubernetes? Well, that gets harder. What did you think of KubeCon? How many new projects were announced? Which ones are "real"? Which ones should you learn? How deeply do you understand Harbor, TikV, NATD, Vitess, Open Policy Agent? Not to mention Envoy, eBPF, and a bunch of the underlying technologies in Linux? It feels a lot like building dump trucks in 1904 with the industrial revolution in full swing. Figuring out what screws, bolts, metal, and pistons to use. (Steampunk, anyone?) + +Building and equipping Kubernetes, like a dump truck, is a technical problem you probably shouldn't be tackling if you are in financial services, retail, biological research, food services, and so forth. But, learning how to drive Kubernetes is definitely something you should be learning. + +Kubernetes, like a dump truck, is elegant for the wide variety of technical problems it can solve (and the ecosystem it drags along). So, I'll leave you with a quote that one of my computer science professors told us in my first year of college. She said, "one day, you will look at a piece of code and say to yourself, 'now that's elegant!'" + +Kubernetes is elegant. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/kubernetes-dump-truck + +作者:[Scott McCarty][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/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dump_truck_car_container_kubernetes.jpg?itok=4BdmyVGd (Dump truck with kids standing in the foreground) +[2]: https://kubernetes.io/ From adfd26a2fda18bd17da694600f19518329bee0e0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 Jun 2019 07:53:22 +0800 Subject: [PATCH 1094/1154] Rename sources/tech/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md to sources/news/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md --- ...otics data visualization, npm token scanning, and more news.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md (100%) diff --git a/sources/tech/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md b/sources/news/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md similarity index 100% rename from sources/tech/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md rename to sources/news/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md From 58e2e63d15870149ae7f7ababbfd09be5dc7826c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 Jun 2019 07:59:09 +0800 Subject: [PATCH 1095/1154] Rename sources/tech/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md to sources/news/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md --- ...12 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md (100%) diff --git a/sources/tech/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md b/sources/news/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md similarity index 100% rename from sources/tech/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md rename to sources/news/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md From 8a71f4d45ab9cce8863266ad256e943e0d707152 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 Jun 2019 08:05:13 +0800 Subject: [PATCH 1096/1154] Rename sources/tech/20190618 Why your workplace arguments aren-t as effective as you-d like.md to sources/talk/20190618 Why your workplace arguments aren-t as effective as you-d like.md --- ... your workplace arguments aren-t as effective as you-d like.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20190618 Why your workplace arguments aren-t as effective as you-d like.md (100%) diff --git a/sources/tech/20190618 Why your workplace arguments aren-t as effective as you-d like.md b/sources/talk/20190618 Why your workplace arguments aren-t as effective as you-d like.md similarity index 100% rename from sources/tech/20190618 Why your workplace arguments aren-t as effective as you-d like.md rename to sources/talk/20190618 Why your workplace arguments aren-t as effective as you-d like.md From 7b8a7625d54123f5f998d037d56508826a8c07fe Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 Jun 2019 08:06:57 +0800 Subject: [PATCH 1097/1154] Rename sources/tech/20190619 Codethink open sources part of onboarding process.md to sources/news/20190619 Codethink open sources part of onboarding process.md --- .../20190619 Codethink open sources part of onboarding process.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20190619 Codethink open sources part of onboarding process.md (100%) diff --git a/sources/tech/20190619 Codethink open sources part of onboarding process.md b/sources/news/20190619 Codethink open sources part of onboarding process.md similarity index 100% rename from sources/tech/20190619 Codethink open sources part of onboarding process.md rename to sources/news/20190619 Codethink open sources part of onboarding process.md From 72f40cf246a03a9333283014e97d7b9a5b1e7999 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 08:28:25 +0800 Subject: [PATCH 1098/1154] APL:20190621 Bash Script to Monitor Memory Usage on Linux.md --- .../20190621 Bash Script to Monitor Memory Usage on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md b/sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md index ded8050ee7..2f943bd32b 100644 --- a/sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md +++ b/sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f6ca4188a04875179f5932ea3af7cafc8882ef1d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 08:45:28 +0800 Subject: [PATCH 1099/1154] TSL:20190621 Bash Script to Monitor Memory Usage on Linux.md --- ...Script to Monitor Memory Usage on Linux.md | 82 +++++++------------ 1 file changed, 29 insertions(+), 53 deletions(-) rename {sources => translated}/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md (69%) diff --git a/sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md b/translated/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md similarity index 69% rename from sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md rename to translated/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md index 2f943bd32b..47071fdf42 100644 --- a/sources/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md +++ b/translated/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md @@ -7,58 +7,50 @@ [#]: via: (https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-usage-and-send-email/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Bash Script to Monitor Memory Usage on Linux +在 Linux 上用 Bash 脚本监控内存使用情况 ====== -There are many open source monitoring tools are currently available in market to monitor Linux systems performance. +目前市场上有许多开源监控工具可用于监控 Linux 系统的性能。当系统达到指定的阈值限制时,它可以发送电子邮件警报。它可以监视 CPU 利用率、内存利用率、交换利用率、磁盘空间利用率等所有内容。 -It will send an email alert when the system reaches the specified threshold limit. +如果你只有很少的系统并且想要监视它们,那么编写一个小的 shell 脚本可以使你的任务变得非常简单。 -It monitors everything such as CPU utilization, Memory utilization, swap utilization, disk space utilization and much more. +在本教程中,我们添加了两个 shell 脚本来监视 Linux 系统上的内存利用率。当系统达到给定阈值时,它将给特定电子邮件地址发邮件。 -If you only have few systems and want to monitor them then writing a small shell script can make your task very easy. +### 方法-1:用 Linux Bash 脚本监视内存利用率并发送电子邮件 -In this tutorial we have added two shell script to monitor Memory utilization on Linux system. +如果只想在系统达到给定阈值时通过邮件获取当前内存利用率百分比,请使用以下脚本。 -When the system reaches the given threshold then it will trigger a mail to given email id. +这是非常简单直接的单行脚本。在大多数情况下,我更喜欢使用这种方法。 -### Method-1 : Linux Bash Script To Monitor Memory Utilization And Send an Email - -If you want to only get current Memory utilization percentage through mail when the system reaches the given threshold, use the following script. - -This is very simple, straightforward and one line script. I preferred to go with this method in most of the time. - -It will trigger an email when your system reaches `80%` of Memory utilization. +当你的系统达到内存利用率的 80% 时,它将触发一封电子邮件。 ``` -*/5 * * * * /usr/bin/free | awk '/Mem/{printf("RAM Usage: %.2f%\n"), $3/$2*100}' | awk '{print $3}' | awk '{ if($1 > 80) print $0;}' | mail -s "High Memory Alert" [email protected] +*/5 * * * * /usr/bin/free | awk '/Mem/{printf("RAM Usage: %.2f%\n"), $3/$2*100}' | awk '{print $3}' | awk '{ if($1 > 80) print $0;}' | mail -s "High Memory Alert" 2daygeek@gmail.com ``` -**Note:** You need to change the email id instead of ours. Also, you can change the Memory utilization threshold value as per your requirement. +**注意:**你需要更改电子邮件地址而不是我们的电子邮件地址。此外,你可以根据你的要求更改内存利用率阈值。 -**Output:** You will be getting an email alert similar to below. +**输出:**你将收到类似下面的电子邮件提醒。 ``` High Memory Alert: 80.40% ``` -We had added many useful shell scripts in the past. If you want to check those, navigate to the below link. +我们过去添加了许多有用的 shel l脚本。如果要查看这些内容,请导航至以下链接。 - * **[How to automate day to day activities using shell scripts?][1]** + * [如何使用 shell 脚本自动执行日常活动?][1] +### 方法-2:用 Linux Bash 脚本监视内存利用率并发送电子邮件 +如果要在邮件警报中获取有关内存利用率的更多信息。 -### Method-2 : Linux Bash Script To Monitor Memory Utilization And Send an Email +使用以下脚本,其中包括基于 `top` 命令和 `ps` 命令的最高内存利用率进程详细信息。 -If you want to get more information about the Memory utilization in the mail alert. +这将立即让你了解系统的运行情况。 -Then use the following script, which includes top Memory utilization process details based on the top Command and ps Command. +当你的系统达到内存利用率的 “80%” 时,它将触发一封电子邮件。 -This will instantly gives you an idea what is going on your system. - -It will trigger an email when your system reaches `80%` of Memory utilization. - -**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/memory-alert.sh @@ -68,53 +60,37 @@ ramusage=$(free | awk '/Mem/{printf("RAM Usage: %.2f\n"), $3/$2*100}'| awk '{pri if [ "$ramusage" > 20 ]; then -SUBJECT="ATTENTION: Memory Utilization is High on $(hostname) at $(date)" - -MESSAGE="/tmp/Mail.out" - -TO="[email protected]" - + SUBJECT="ATTENTION: Memory Utilization is High on $(hostname) at $(date)" + MESSAGE="/tmp/Mail.out" + TO="2daygeek@gmail.com" echo "Memory Current Usage is: $ramusage%" >> $MESSAGE - echo "" >> $MESSAGE - echo "------------------------------------------------------------------" >> $MESSAGE - echo "Top Memory Consuming Process Using top command" >> $MESSAGE - echo "------------------------------------------------------------------" >> $MESSAGE - echo "$(top -b -o +%MEM | head -n 20)" >> $MESSAGE - echo "" >> $MESSAGE - echo "------------------------------------------------------------------" >> $MESSAGE - echo "Top Memory Consuming Process Using ps command" >> $MESSAGE - echo "------------------------------------------------------------------" >> $MESSAGE - echo "$(ps -eo pid,ppid,%mem,%Memory,cmd --sort=-%mem | head)" >> $MESSAGE - mail -s "$SUBJECT" "$TO" < $MESSAGE - rm /tmp/Mail.out - - fi +fi ``` -Finally add a **[cronjob][2]** to automate this. It will run every 5 minutes. +最后添加一个 [cron 任务][2] 来自动执行此操作。它将每 5 分钟运行一次。 ``` # crontab -e */5 * * * * /bin/bash /opt/scripts/memory-alert.sh ``` -**Note:** You will be getting an email alert 5 mins later since the script has scheduled to run every 5 minutes (But it’s not exactly 5 mins and it depends the timing). +**注意:**由于脚本计划每 5 分钟运行一次,因此你将在 5 分钟后收到电子邮件提醒(但不是 5 分钟,而是取决于具体时间)。 -Say for example. If your system reaches the given limit at 8.25 then you will be getting an email alert in another 5 mins. Hope it’s clear now. +比如说。 如果你的系统达到 8.25 的给定限制,那么你将在再过 5 分钟收到电子邮件警报。 希望现在说清楚了。 -**Output:** You will be getting an email alert similar to below. +**输出:**你将收到类似下面的电子邮件提醒。 ``` Memory Current Usage is: 80.71% @@ -133,7 +109,7 @@ Tasks: 314 total, 1 running, 313 sleeping, 0 stopped, 0 zombie %Cpu6 : 9.1 us, 0.0 sy, 0.0 ni, 90.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu7 : 17.4 us, 4.3 sy, 0.0 ni, 78.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 16248588 total, 5015964 free, 6453404 used, 4779220 buff/cache -KiB Swap: 17873388 total, 16928620 free, 944768 used. 6423008 avail Mem +KiB Swap: 17873388 total, 16928620 free, 944768 used. 6423008 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 17163 daygeek 20 2033204 487736 282888 S 10.0 3.0 8:26.07 /usr/lib/firefox/firefox -contentproc -childID 15 -isForBrowser -prefsLen 9408 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /u+ @@ -164,7 +140,7 @@ via: https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-us 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b49846ba26bf6944e2b558460ed55cdf1dde07ff Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 08:54:25 +0800 Subject: [PATCH 1100/1154] PRF:20190621 Bash Script to Monitor Memory Usage on Linux.md @wxy --- ...Script to Monitor Memory Usage on Linux.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md b/translated/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md index 47071fdf42..ce95199f6d 100644 --- a/translated/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md +++ b/translated/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md @@ -1,15 +1,17 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Bash Script to Monitor Memory Usage on Linux) [#]: via: (https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-usage-and-send-email/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -在 Linux 上用 Bash 脚本监控内存使用情况 +用 Bash 脚本监控 Linux 上的内存使用情况 ====== +![](https://img.linux.net.cn/data/attachment/album/201906/23/085446setqkshf5zk0tn2x.jpg) + 目前市场上有许多开源监控工具可用于监控 Linux 系统的性能。当系统达到指定的阈值限制时,它可以发送电子邮件警报。它可以监视 CPU 利用率、内存利用率、交换利用率、磁盘空间利用率等所有内容。 如果你只有很少的系统并且想要监视它们,那么编写一个小的 shell 脚本可以使你的任务变得非常简单。 @@ -20,7 +22,7 @@ 如果只想在系统达到给定阈值时通过邮件获取当前内存利用率百分比,请使用以下脚本。 -这是非常简单直接的单行脚本。在大多数情况下,我更喜欢使用这种方法。 +这是个非常简单直接的单行脚本。在大多数情况下,我更喜欢使用这种方法。 当你的系统达到内存利用率的 80% 时,它将触发一封电子邮件。 @@ -28,7 +30,7 @@ */5 * * * * /usr/bin/free | awk '/Mem/{printf("RAM Usage: %.2f%\n"), $3/$2*100}' | awk '{print $3}' | awk '{ if($1 > 80) print $0;}' | mail -s "High Memory Alert" 2daygeek@gmail.com ``` -**注意:**你需要更改电子邮件地址而不是我们的电子邮件地址。此外,你可以根据你的要求更改内存利用率阈值。 +**注意:**你需要更改电子邮件地址而不是使用我们的电子邮件地址。此外,你可以根据你的要求更改内存利用率阈值。 **输出:**你将收到类似下面的电子邮件提醒。 @@ -36,21 +38,19 @@ High Memory Alert: 80.40% ``` -我们过去添加了许多有用的 shel l脚本。如果要查看这些内容,请导航至以下链接。 +我们过去添加了许多有用的 shell 脚本。如果要查看这些内容,请导航至以下链接。  * [如何使用 shell 脚本自动执行日常活动?][1] ### 方法-2:用 Linux Bash 脚本监视内存利用率并发送电子邮件 -如果要在邮件警报中获取有关内存利用率的更多信息。 - -使用以下脚本,其中包括基于 `top` 命令和 `ps` 命令的最高内存利用率进程详细信息。 +如果要在邮件警报中获取有关内存利用率的更多信息。使用以下脚本,其中包括基于 `top` 命令和 `ps` 命令的最高内存利用率和进程详细信息。 这将立即让你了解系统的运行情况。 当你的系统达到内存利用率的 “80%” 时,它将触发一封电子邮件。 -**注意:**你需要更改电子邮件地址而不是我们的电子邮件地址。 此外,你可以根据你的要求更改内存利用率阈值。 +**注意:**你需要更改电子邮件地址而不是使用我们的电子邮件地址。此外,你可以根据你的要求更改内存利用率阈值。 ``` # vi /opt/scripts/memory-alert.sh @@ -86,9 +86,9 @@ fi */5 * * * * /bin/bash /opt/scripts/memory-alert.sh ``` -**注意:**由于脚本计划每 5 分钟运行一次,因此你将在 5 分钟后收到电子邮件提醒(但不是 5 分钟,而是取决于具体时间)。 +**注意:**由于脚本计划每 5 分钟运行一次,因此你将在最多 5 分钟后收到电子邮件提醒(但不是 5 分钟,取决于具体时间)。 -比如说。 如果你的系统达到 8.25 的给定限制,那么你将在再过 5 分钟收到电子邮件警报。 希望现在说清楚了。 +比如说,如果你的系统达到 8.25 的给定限制,那么你将在 5 分钟内收到电子邮件警报。希望现在说清楚了。 **输出:**你将收到类似下面的电子邮件提醒。 @@ -141,7 +141,7 @@ via: https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-us 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From aa8f174b15d0b02ea1699a9f05eb72d43ff132f9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 08:55:54 +0800 Subject: [PATCH 1101/1154] PUB:20190621 Bash Script to Monitor Memory Usage on Linux.md @wxy https://linux.cn/article-11007-1.html --- .../20190621 Bash Script to Monitor Memory Usage on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190621 Bash Script to Monitor Memory Usage on Linux.md (99%) diff --git a/translated/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md b/published/20190621 Bash Script to Monitor Memory Usage on Linux.md similarity index 99% rename from translated/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md rename to published/20190621 Bash Script to Monitor Memory Usage on Linux.md index ce95199f6d..ee2a3cba8c 100644 --- a/translated/tech/20190621 Bash Script to Monitor Memory Usage on Linux.md +++ b/published/20190621 Bash Script to Monitor Memory Usage on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11007-1.html) [#]: subject: (Bash Script to Monitor Memory Usage on Linux) [#]: via: (https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-usage-and-send-email/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 9ca37b911cef7d645efb54b8f60119d8332d9ab3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 09:01:23 +0800 Subject: [PATCH 1102/1154] APL:20190617 Exploring -run on Linux --- sources/tech/20190617 Exploring -run on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190617 Exploring -run on Linux.md b/sources/tech/20190617 Exploring -run on Linux.md index e2b497930c..57a153ac9a 100644 --- a/sources/tech/20190617 Exploring -run on Linux.md +++ b/sources/tech/20190617 Exploring -run on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b7edd0d3aad667e86a900f912f21af49b3714d28 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 09:21:48 +0800 Subject: [PATCH 1103/1154] TSL:20190617 Exploring -run on Linux.md --- .../tech/20190617 Exploring -run on Linux.md | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) rename {sources => translated}/tech/20190617 Exploring -run on Linux.md (53%) diff --git a/sources/tech/20190617 Exploring -run on Linux.md b/translated/tech/20190617 Exploring -run on Linux.md similarity index 53% rename from sources/tech/20190617 Exploring -run on Linux.md rename to translated/tech/20190617 Exploring -run on Linux.md index 57a153ac9a..59704c3b02 100644 --- a/sources/tech/20190617 Exploring -run on Linux.md +++ b/translated/tech/20190617 Exploring -run on Linux.md @@ -7,14 +7,16 @@ [#]: via: (https://www.networkworld.com/article/3403023/exploring-run-on-linux.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -Exploring /run on Linux +探索 Linux 上的 /run ====== -There's been a small but significant change in how Linux systems work with respect to runtime data. + +> Linux 系统在运行时数据方面的工作方式发生了微小但重大的变化。 + ![Sandra Henry-Stocker][1] -If you haven’t been paying close attention, you might not have noticed a small but significant change in how Linux systems work with respect to runtime data. A re-arrangement of how and where it’s accessible in the file system started taking hold about eight years ago. And while this change might not have been big enough of a splash to wet your socks, it provides some additional consistency in the Linux file system and is worthy of some exploration. +如果你没有密切关注,你可能没有注意到 Linux 系统在运行时数据方面的工作方式有一些小但重大的变化。 它重新组织了文件系统中可访问的方式和位置,而这个变化在大约八年前就开始了。虽然这种变化可能不足以让你的袜子变湿,但它在 Linux 文件系统中提供了更多一致性,值得进行一些探索。 -To get started, cd your way over to /run. If you use df to check it out, you’ll see something like this: +要开始,请转到 `/run`。如果你使用 `df` 来检查它,你会看到这样的输出: ``` $ df -k . @@ -22,18 +24,16 @@ Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 609984 2604 607380 1% /run ``` -Identified as a “tmpfs” (temporary file system), we know that the files and directories in /run are not stored on disk but only in volatile memory. They represent data kept in memory (or disk-based swap) that takes on the appearance of a mounted file system to allow it to be more accessible and easier to manage. +它被识别为 “tmpfs”(临时文件系统),因此我们知道 `/run` 中的文件和目录没有存储在磁盘上,而只存储在内存中。它们表示保存在内存(或基于磁盘的交换空间)中的数据,它看起来像是一个已挂载的文件系统,这个可以使其更易于访问和管理。 -**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** - -/run is home to a wide assortment of data. For example, if you take a look at /run/user, you will notice a group of directories with numeric names. +`/run` 是各种各样数据的家园。例如,如果你查看 `/run/user`,你会注意到一组带有数字名称的目录。 ``` $ ls /run/user 1000 1002 121 ``` -A long file listing will clarify the significance of these numbers. +使用长文件列表可以发现这些数字的重要性。 ``` $ ls -l @@ -43,9 +43,9 @@ drwx------ 5 dory dory 120 Jun 16 16:14 1002 drwx------ 8 gdm gdm 220 Jun 14 12:18 121 ``` -This allows us to see that each directory is related to a user who is currently logged in or to the display manager, gdm. The numbers represent their UIDs. The content of each of these directories are files that are used by running processes. +我们看到每个目录与当前登录的用户或显示管理器 gdm 相关。数字代表他们的 UID。每个目录的内容都是运行中的进程所使用的文件。 -The /run/user files represent only a very small portion of what you’ll find in /run. There are lots of other files, as well. A handful contain the process IDs for various system processes. +`/run/user` 文件只是你在 `/run` 中找到的一小部分。还有很多其他文件。有一些文件包含了各种系统进程的进程 ID。 ``` $ ls *.pid @@ -53,7 +53,7 @@ acpid.pid atopacctd.pid crond.pid rsyslogd.pid atd.pid atop.pid gdm3.pid sshd.pid ``` -As shown below, that sshd.pid file listed above contains the process ID for the ssh daemon (sshd). +如下所示,上面列出的 `sshd.pid` 文件包含 ssh 守护程序(`sshd`)的进程 ID。 ``` $ cat sshd.pid @@ -67,7 +67,7 @@ dory 18232 18109 0 16:14 ? 00:00:00 sshd: dory@pts/1 shs 19276 10923 0 16:50 pts/0 00:00:00 grep --color=auto sshd ``` -Some of the subdirectories within /run can only be accessed with root authority such as /run/sudo. Running as root, for example, we can see some files related to real or attempted sudo usage: +`/run` 中的某些子目录只能使用 root 权限访问,例如 `/run/sudo`。例如,以 root 身份运行我们可以看到一些与真实或尝试使用 `sudo` 相关的文件: ``` /run/sudo/ts# ls -l @@ -76,7 +76,7 @@ total 8 -rw------- 1 root shs 168 Jun 17 08:33 shs ``` -In keeping with the shift to using /run, some of the old locations for runtime data are now symbolic links. /var/run is now a pointer to /run and /var/lock a pointer to /run/lock, allowing old references to work as expected. +为了与 `/run` 的变化保持一致,一些运行时数据的旧位置现在是符号链接。`/var/run` 现在是指向 `/run` 的指针,`/var/lock` 指向 `/run/lock` 的指针,可以保证旧的引用按预期工作。 ``` $ ls -l /var @@ -98,11 +98,7 @@ drwxrwxrwt 8 root root 4096 Jun 17 00:00 tmp drwxr-xr-x 3 root root 4096 Jan 19 12:14 www ``` -While minor as far as technical changes go, the transition to using /run simply allows for a better organization of runtime data in the Linux file system. - -**[ Now read this:[Invaluable tips and tricks for troubleshooting Linux][3] ]** - -Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind. +虽然技术上的变化很小,但转换到使用 `/run` 只是为了在 Linux 文件系统中更好地组织运行时数据。 -------------------------------------------------------------------------------- @@ -110,7 +106,7 @@ via: https://www.networkworld.com/article/3403023/exploring-run-on-linux.html 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cbd2076322eae64b72eedc040c339e7e5a2e739d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 09:28:06 +0800 Subject: [PATCH 1104/1154] PRF:20190617 Exploring -run on Linux.md @wxy --- translated/tech/20190617 Exploring -run on Linux.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/tech/20190617 Exploring -run on Linux.md b/translated/tech/20190617 Exploring -run on Linux.md index 59704c3b02..162b8c0479 100644 --- a/translated/tech/20190617 Exploring -run on Linux.md +++ b/translated/tech/20190617 Exploring -run on Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Exploring /run on Linux) @@ -12,7 +12,7 @@ > Linux 系统在运行时数据方面的工作方式发生了微小但重大的变化。 -![Sandra Henry-Stocker][1] +![](https://img.linux.net.cn/data/attachment/album/201906/23/092816aqczi984w30j8k12.jpg) 如果你没有密切关注,你可能没有注意到 Linux 系统在运行时数据方面的工作方式有一些小但重大的变化。 它重新组织了文件系统中可访问的方式和位置,而这个变化在大约八年前就开始了。虽然这种变化可能不足以让你的袜子变湿,但它在 Linux 文件系统中提供了更多一致性,值得进行一些探索。 @@ -107,7 +107,7 @@ via: https://www.networkworld.com/article/3403023/exploring-run-on-linux.html 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a8b3ad9a25136518647810b0bd1e8a50ebd44e50 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 09:29:35 +0800 Subject: [PATCH 1105/1154] PUB:20190617 Exploring -run on Linux.md @wxy https://linux.cn/article-11008-1.html --- translated/tech/20190617 Exploring -run on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20190617 Exploring -run on Linux.md b/translated/tech/20190617 Exploring -run on Linux.md index 162b8c0479..575d5ffd0b 100644 --- a/translated/tech/20190617 Exploring -run on Linux.md +++ b/translated/tech/20190617 Exploring -run on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11008-1.html) [#]: subject: (Exploring /run on Linux) [#]: via: (https://www.networkworld.com/article/3403023/exploring-run-on-linux.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 8dcf79bf209b0c2fe7283eb97962f9702f280b97 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 09:47:15 +0800 Subject: [PATCH 1106/1154] PUB:20190617 Exploring -run on Linux.md @wxy https://linux.cn/article-11008-1.html --- .../tech => published}/20190617 Exploring -run on Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20190617 Exploring -run on Linux.md (100%) diff --git a/translated/tech/20190617 Exploring -run on Linux.md b/published/20190617 Exploring -run on Linux.md similarity index 100% rename from translated/tech/20190617 Exploring -run on Linux.md rename to published/20190617 Exploring -run on Linux.md From bebf3fd734dd1dd8141085139011062a8b578a45 Mon Sep 17 00:00:00 2001 From: yizhuyan Date: Sun, 23 Jun 2019 12:25:43 +0800 Subject: [PATCH 1107/1154] Create 20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md --- ...nstalled Or Not On Debian-Ubuntu System.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md diff --git a/translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md b/translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md new file mode 100644 index 0000000000..0dbaa6bcbb --- /dev/null +++ b/translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: (yizhuoyan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (如何在Debian/Ubuntu系统中检查程序包是否安装?) +[#]: via: (https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + + +如何在Debian/Ubuntu系统中检查程序包是否安装? +====== + +我们近期发布了一篇关于批量程序包安装的文章。在此同时,关于如何获取系统上已安装了的程序包信息,我也做了些调查然后找到了些方法。我会把这些方法分享在我们的网站上,希望能帮助到其他人。 + +有很多种方法可以检查程序包是否已安装,我找到了7种命令,您可以从中选择您喜欢的使用。 + +如下: + + * **`apt-cache :`** 可用于查询APT缓存或程序包的元数据。 + * **`apt :`** 在基于Debian的系统中是安装,下载,删除,搜索和管理包的强有力的工具。 + * **`dpkg-query :`** 一个查询dpkg数据库的工具。 + * **`dpkg :`** Debian系统的包管理工具 + * **`which :`** 返回在终端中输入命令时执行的可执行文件的全路径 + * **`whereis :`** 可用于搜索指定命令的二进制文件,源码文件和帮助文件。 + * **`locate :`** locate命令比find命令快,因为其使用updatedb数据库搜索,而find命令在实际系统中搜索。 + + + +## 方法一、使用`apt-cache `命令 + +`apt-cache `命令用于从APT的内部数据库中查询**APT缓存**和**包元数据**,将会搜索和显示指定包的信息,包括是否安装,程序包版本,源码仓库信息等。 + +下面的示例清楚的显示`nano`包已经在系统中安装了以及对应安装的版本号。 + +``` +# apt-cache policy nano +nano: + Installed: 2.9.3-2 + Candidate: 2.9.3-2 + Version table: + *** 2.9.3-2 500 + 500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages + 100 /var/lib/dpkg/status +``` + +### 方法二、使用`apt`命令 + + + +`apt`是一个功能强大的命令行工具,可用于安装,下载,删除,搜索,管理程序包以及查询关于程序包的信息,类似对于`libapt-pkg`库的所有功能的底层访问。其包含一些与包管理相关的但很少用到的命令行功能。 + +``` +# apt -qq list nano +nano/bionic,now 2.9.3-2 amd64 [installed] +``` + +### 方法三、使用`dpkg-query`命令 + +`dpkg-query` 是显示`dpkg`数据库中程序包信息列表的一个工具。 + +下面示例中的输出的第一列`ii`,表示查询的程序包已安装了。 + +``` +# dpkg-query --list | grep -i nano +ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico +``` + +### 方法四、使用`dpkg`命令 + +`dpkg`(**d**ebian **p**ac**k**a**g**e)是一个安装,构建,删除和管理Debian包的工具,但和其他包管理系统不同的是,其不能自动下载和安装包或包依赖。 + +下面示例中的输出的第一列`ii`,表示查询的包已安装了。 + +``` +# dpkg -l | grep -i nano +ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico +``` + +### 方法五、使用`which`命令 + + + +`which`命令返回在终端中输入命令时执行的可执行文件的全路径。这对于你想要给可执行文件创建桌面快捷方式或符号链接时非常有用。 + +`which`命令仅在当前用户`PATH`环境变量配置的目录列表中搜索,而不是在所有用户的目录中搜索。意思是当你登入你自己账号时 ,其不会在`root`用户文件或目录中搜索。 + +如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 + +``` +# which nano +/bin/nano +``` + +### 方法六、使用`whereis`命令 + +`whereis`命令用于针对指定命令搜索对应的程序二进制文件,源码文件以及帮助文件等。 + +如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 + +``` +# whereis nano +nano: /bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz +``` + +### 方法七、使用`locate`命令 + +`locate`命令比`find`命令快,因为其在**updatedb**数据库中搜索,而find命令在实际系统中进行搜索。 + +对于获取指定文件,其使用数据库而不是在特定目录路径中搜索。 + +`locate`命令不会预安装在大多数系统中,需要手动安装。 + +`locate`使用的数据库会根据定时任务定期更新。当然,我们也可以手动更新。 + +如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 + +``` +# locate --basename '\nano' +/usr/bin/nano +/usr/share/nano +/usr/share/doc/nano +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[yizhuoyan][translator] +校对:[校对者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 +[translator]:https://github.com/yizhuoyan From dc37186e1dcaf44769a7b32f196b4e591338e847 Mon Sep 17 00:00:00 2001 From: yizhuyan Date: Sun, 23 Jun 2019 12:28:16 +0800 Subject: [PATCH 1108/1154] Delete 20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 已翻译完毕 --- ...nstalled Or Not On Debian-Ubuntu System.md | 141 ------------------ 1 file changed, 141 deletions(-) delete mode 100644 sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md diff --git a/sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md b/sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md deleted file mode 100644 index dfc3e62dce..0000000000 --- a/sources/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md +++ /dev/null @@ -1,141 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Check Whether The Given Package Is Installed Or Not On Debian/Ubuntu System?) -[#]: via: (https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Check Whether The Given Package Is Installed Or Not On Debian/Ubuntu System? -====== - -We have recently published an article about bulk package installation. - -While doing that, i was struggled to get the installed package information and did a small google search and found few methods about it. - -I would like to share it in our website so, that it will be helpful for others too. - -There are numerous ways we can achieve this. - -I have add seven ways to achieve this. However, you can choose the preferred method for you. - -Those methods are listed below. - - * **`apt-cache Command:`** apt-cache command is used to query the APT cache or package metadata. - * **`apt Command:`** APT is a powerful command-line tool for installing, downloading, removing, searching and managing packages on Debian based systems. - * **`dpkg-query Command:`** dpkg-query is a tool to query the dpkg database. - * **`dpkg Command:`** dpkg is a package manager for Debian based systems. - * **`which Command:`** The which command returns the full path of the executable that would have been executed when the command had been entered in terminal. - * **`whereis Command:`** The whereis command used to search the binary, source, and man page files for a given command. - * **`locate Command:`** locate command works faster than the find command because it uses updatedb database, whereas the find command searches in the real system. - - - -### Method-1 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using apt-cache Command? - -apt-cache command is used to query the APT cache or package metadata from APT’s internal database. - -It will search and display an information about the given package. It shows whether the package is installed or not, installed package version, source repository information. - -The below output clearly showing that `nano` package has already installed in the system. Since installed part is showing the installed version of nano package. - -``` -# apt-cache policy nano -nano: - Installed: 2.9.3-2 - Candidate: 2.9.3-2 - Version table: - *** 2.9.3-2 500 - 500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages - 100 /var/lib/dpkg/status -``` - -### Method-2 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using apt Command? - -APT is a powerful command-line tool for installing, downloading, removing, searching and managing as well as querying information about packages as a low-level access to all features of the libapt-pkg library. It’s contains some less used command-line utilities related to package management. - -``` -# apt -qq list nano -nano/bionic,now 2.9.3-2 amd64 [installed] -``` - -### Method-3 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using dpkg-query Command? - -dpkg-query is a tool to show information about packages listed in the dpkg database. - -In the below output first column showing `ii`. It means, the given package has already installed in the system. - -``` -# dpkg-query --list | grep -i nano -ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico -``` - -### Method-4 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using dpkg Command? - -DPKG stands for Debian Package is a tool to install, build, remove and manage Debian packages, but unlike other package management systems, it cannot automatically download and install packages or their dependencies. - -In the below output first column showing `ii`. It means, the given package has already installed in the system. - -``` -# dpkg -l | grep -i nano -ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico -``` - -### Method-5 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using which Command? - -The which command returns the full path of the executable that would have been executed when the command had been entered in terminal. - -It’s very useful when you want to create a desktop shortcut or symbolic link for executable files. - -Which command searches the directories listed in the current user’s PATH environment variable not for all the users. I mean, when you are logged in your own account and you can’t able to search for root user file or directory. - -If the following output shows the given package binary or executable file location then the given package has already installed in the system. If not, the package is not installed in system. - -``` -# which nano -/bin/nano -``` - -### Method-6 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using whereis Command? - -The whereis command used to search the binary, source, and man page files for a given command. - -If the following output shows the given package binary or executable file location then the given package has already installed in the system. If not, the package is not installed in system. - -``` -# whereis nano -nano: /bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz -``` - -### Method-7 : How To Check Whether The Given Package Is Installed Or Not On Ubuntu System Using locate Command? - -locate command works faster than the find command because it uses updatedb database, whereas the find command searches in the real system. - -It uses a database rather than hunting individual directory paths to get a given file. - -locate command doesn’t pre-installed in most of the distributions so, use your distribution package manager to install it. - -The database is updated regularly through cron. Even, we can update it manually. - -If the following output shows the given package binary or executable file location then the given package has already installed in the system. If not, the package is not installed in system. - -``` -# locate --basename '\nano' -/usr/bin/nano -/usr/share/nano -/usr/share/doc/nano -``` --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/ - -作者:[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 From 00a9339103716f39934d59e231bdbdca28e70a78 Mon Sep 17 00:00:00 2001 From: Lingxu Meng Date: Sun, 23 Jun 2019 16:44:41 +1000 Subject: [PATCH 1109/1154] Finish translating --- ... send email from the Linux command line.md | 171 ------------------ ... send email from the Linux command line.md | 168 +++++++++++++++++ 2 files changed, 168 insertions(+), 171 deletions(-) delete mode 100644 sources/tech/20190614 How to send email from the Linux command line.md create mode 100644 translated/tech/20190614 How to send email from the Linux command line.md diff --git a/sources/tech/20190614 How to send email from the Linux command line.md b/sources/tech/20190614 How to send email from the Linux command line.md deleted file mode 100644 index 7bdb9448f8..0000000000 --- a/sources/tech/20190614 How to send email from the Linux command line.md +++ /dev/null @@ -1,171 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Modrisco) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to send email from the Linux command line) -[#]: via: (https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How to send email from the Linux command line -====== -Linux offers several commands that allow you to send email from the command line. Here's look at some that offer interesting options. -![Molnia/iStock][1] - -There are several ways to send email from the Linux command line. Some are very simple and others more complicated, but offer some very useful features. The choice depends on what you want to do -– whether you want to get a quick message off to a co-worker or send a more complicated message with an attachment to a large group of people. Here's a look at some of the options: - -### mail - -The easiest way to send a simple message from the Linux command line is to use the **mail** command. Maybe you need to remind your boss that you're leaving a little early that day. You could use a command like this one: - -``` -$ echo "Reminder: Leaving at 4 PM today" | mail -s "early departure" myboss -``` - -**[ Two-Minute Linux Tips:[Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]** - -Another option is to grab your message text from a file that contains the content you want to send: - -``` -$ mail -s "Reminder:Leaving early" myboss < reason4leaving -``` - -In both cases, the -s options allows you to provide a subject line for your message. - -### sendmail - -Using **sendmail** , you can send a quick message (with no subject) using a command like this (replacing "recip" with your intended recipient: - -``` -$ echo "leaving now" | sendmail recip -``` - -You can send just a subject line (with no message content) with a command like this: - -``` -$ echo "Subject: leaving now" | sendmail recip -``` - -You can also use sendmail on the command line to send a message complete with a subject line. However, when using this approach, you would add your subject line to the file you intend to send as in this example file: - -``` -Subject: Requested lyrics -I would just like to say that, in my opinion, longer hair and other flamboyant -affectations of appearance are nothing more ... -``` - -Then you would send the file like this (where the lyrics file contains your subject line and text): - -``` -$ sendmail recip < lyrics -``` - -Sendmail can be quite verbose in its output. If you're desperately curious and want to see the interchange between the sending and receiving systems, add the -v (verbose) option: - -``` -$ sendmail -v recip@emailsite.com < lyrics -``` - -### mutt - -An especially nice tool for command line emailing is the **mutt** command, though you will likely have to install it first. Mutt has a convenient advantage in that it can allow you to include attachments. - -To use mutt to send a quick messsage: - -``` -$ echo "Please check last night's backups" | mutt -s "backup check" recip -``` - -To get content from a file: - -``` -$ mutt -s "Agenda" recip < agenda -``` - -To add an attachment with mutt, use the -a option. You can even add more than one – as shown in this command: - -``` -$ mutt -s "Agenda" recip -a agenda -a speakers < msg -``` - -In the command above, the "msg" file includes content for the email. If you don't have any additional content to provide, you can do this instead: - -``` -$ echo "" | mutt -s "Agenda" recip -a agenda -a speakers -``` - -The other useful option that you have with mutt is that it provides a way to send carbon copies (using the -c option) and blind carbon copies (using the -b option). - -``` -$ mutt -s "Minutes from last meeting" recip@somesite.com -c myboss < mins -``` - -### telnet - -If you want to get deep into the details of sending email, you can use **telnet** to carry on the email exchange operation, but you'll need to, as they say, "learn the lingo." Mail servers expect a sequence of commands that include things like introducing yourself ( **EHLO** command), providing the email sender ( **MAIL FROM** command), specifying the email recipient ( **RCPT TO** command), and then adding the message ( **DATA** ) and ending the message with a "." as the only character on the line. Not every email server will respond to these requests. This approach is generally used only for troubleshooting. - -``` -$ telnet emailsite.org 25 -Trying 192.168.0.12... -Connected to emailsite. -Escape character is '^]'. -220 localhost ESMTP Sendmail 8.15.2/8.15.2/Debian-12; Wed, 12 Jun 2019 16:32:13 -0400; (No UCE/UBE) logging access from: mysite(OK)-mysite [192.168.0.12] -EHLO mysite.org <== introduce yourself -250-localhost Hello mysite [127.0.0.1], pleased to meet you -250-ENHANCEDSTATUSCODES -250-PIPELINING -250-EXPN -250-VERB -250-8BITMIME -250-SIZE -250-DSN -250-ETRN -250-AUTH DIGEST-MD5 CRAM-MD5 -250-DELIVERBY -250 HELP -MAIL FROM: me@mysite.org <== specify sender -250 2.1.0 shs@mysite.org... Sender ok -RCPT TO: recip <== specify recipient -250 2.1.5 recip... Recipient ok -DATA <== start message -354 Enter mail, end with "." on a line by itself -This is a test message. Please deliver it for me. -. <== end message -250 2.0.0 x5CKWDds029287 Message accepted for delivery -quit <== end exchange -``` - -### Sending email to multiple recipients - -If you want to send email from the Linux command line to a large group of recipients, you can always use a loop to make the job easier as in this example using mutt. - -``` -$ for recip in `cat recips` -do - mutt -s "Minutes from May meeting" $recip < May_minutes -done -``` - -### Wrap-up - -There are quite a few ways to send email from the Linux command line. Some tools provide quite a few options. - -Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/Modrisco) -校对:[校对者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/2017/08/email_image_blue-100732096-large.jpg -[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua -[3]: https://www.facebook.com/NetworkWorld/ -[4]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190614 How to send email from the Linux command line.md b/translated/tech/20190614 How to send email from the Linux command line.md new file mode 100644 index 0000000000..ddeef7571f --- /dev/null +++ b/translated/tech/20190614 How to send email from the Linux command line.md @@ -0,0 +1,168 @@ +[#]: collector: (lujun9972) +[#]: translator: (Modrisco) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to send email from the Linux command line) +[#]: via: (https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何用 Linux 命令行发电子邮件 +====== +Linux 提供了几种命令允许您通过终端发送电子邮件,下面来展示一些有趣的方法。 + +![Molnia/iStock][1] + +Linux 可以用多种方式通过命令行发送电子邮件。有一些方法十分简单,有一些相对会复杂一些,不过仍旧提供了很多有用的特性。选择哪一种方式取决于你想要什么 —— 向同事快速发送消息,还是向一批人群发带有附件的更复杂的信息。接下来看一看几种可行方案: + +### mail + +发送一条简单消息最便捷的 Linux 命令是 `mail`。假设你需要提醒老板你今天得早点走,你可以使用这样的一条命令: + +``` +$ echo "Reminder: Leaving at 4 PM today" | mail -s "early departure" myboss +``` + +另一种方式是从一个文件中提取出你想要发送的文本信息: + +``` +$ mail -s "Reminder:Leaving early" myboss < reason4leaving +``` + +在以上两种情况中,你都可以通过 -s 来为邮件添加标题。 + +### sendmail + +使用 `sendmail` 命令可以发送一封不包含标题的快信。(用目标收件人替换 `recip`): + +``` +$ echo "leaving now" | sendmail recip +``` + +你可以用这条命令发送一条只有标题,没有内容的信息: + +``` +$ echo "Subject: leaving now" | sendmail recip +``` + +你也可以用 `sendmail` 发送一条包含一条标题行的完整信息。不过使用这个方法时,你的标题行会被添加到要发送的文件中,如下例所示: + +``` +Subject: Requested lyrics +I would just like to say that, in my opinion, longer hair and other flamboyant +affectations of appearance are nothing more ... +``` + +你也可以发送这样的文件(lyric 文件包含标题和正文): + +``` +$ sendmail recip < lyrics +``` + +`sendmain` 的输出可能会很冗长。如果你感到好奇并希望查看发送系统和接收系统之间的交互,请添加 `-v` (verbose)选项。 + +``` +$ sendmail -v recip@emailsite.com < lyrics +``` + +### mutt + +`mutt` 是通过命令行发送邮件的一个很好的工具,在使用前你需要安装它。 `mutt` 的一个很方便的优势就是它允许你在邮件中添加附件。 + +使用 `mutt` 发送一条快速信息: + +``` +$ echo "Please check last night's backups" | mutt -s "backup check" recip +``` + +从文件中获取内容: + +``` +$ mutt -s "Agenda" recip < agenda +``` + +使用 `-a` 选项在 `mutt` 中添加附件。你甚至可以添加不止一个附件 —— 如下一条命令所示: + +``` +$ mutt -s "Agenda" recip -a agenda -a speakers < msg +``` + +在以上的命令中,`msg` 文件包含了邮件中的正文。如果你没有其他补充的内容,你可以这样来代替之前的命令: + +``` +$ echo "" | mutt -s "Agenda" recip -a agenda -a speakers +``` + +`mutt` 另一个有用的功能是可以添加抄送(`-c`)和密送(`-b`)。 + +``` +$ mutt -s "Minutes from last meeting" recip@somesite.com -c myboss < mins +``` + +### telnet + +如果你想深入了解发送电子邮件的细节,你可以使用 `telnet` 来进行电子邮件交互操作。但正如所说的那样,你需要“学习术语”。邮件服务器期望一系列命令,其中包括自我介绍(`EHLO` 命令)、提供发件人(`MAIL FROM` 命令)、指定收件人(`RCPT TO` 命令),然后添加消息(`DATA`)并以 `.` 结束消息。并不是所有的电子邮件服务器都会响应这些请求。此方法通常仅用于故障排除。 + +``` +$ telnet emailsite.org 25 +Trying 192.168.0.12... +Connected to emailsite. +Escape character is '^]'. +220 localhost ESMTP Sendmail 8.15.2/8.15.2/Debian-12; Wed, 12 Jun 2019 16:32:13 -0400; (No UCE/UBE) logging access from: mysite(OK)-mysite [192.168.0.12] +EHLO mysite.org <== introduce yourself +250-localhost Hello mysite [127.0.0.1], pleased to meet you +250-ENHANCEDSTATUSCODES +250-PIPELINING +250-EXPN +250-VERB +250-8BITMIME +250-SIZE +250-DSN +250-ETRN +250-AUTH DIGEST-MD5 CRAM-MD5 +250-DELIVERBY +250 HELP +MAIL FROM: me@mysite.org <== specify sender +250 2.1.0 shs@mysite.org... Sender ok +RCPT TO: recip <== specify recipient +250 2.1.5 recip... Recipient ok +DATA <== start message +354 Enter mail, end with "." on a line by itself +This is a test message. Please deliver it for me. +. <== end message +250 2.0.0 x5CKWDds029287 Message accepted for delivery +quit <== end exchange +``` + +### 向多个收件人发送电子邮件 + +如果你希望通过 Linux 命令行向一大组收件人发送电子邮件,你可以使用一个循环来帮助你完成任务,如下面应用在 `mutt` 中的例子: + +``` +$ for recip in `cat recips` +do + mutt -s "Minutes from May meeting" $recip < May_minutes +done +``` + +### 总结 + +有很多方法可以从 Linux 命令行发送电子邮件。有些工具提供了相当多的选项。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[Modrisco](https://github.com/Modrisco) +校对:[校对者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/2017/08/email_image_blue-100732096-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From f04c723abe56d1b29ba84a9e28c0a3a75f169593 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 Jun 2019 20:33:07 +0800 Subject: [PATCH 1110/1154] Rename sources/talk/20190423 Edge computing is in most industries- future.md to translated/talk/20190423 Edge computing is in most industries- future.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ninifly 这次我帮你挪啦 --- .../talk/20190423 Edge computing is in most industries- future.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20190423 Edge computing is in most industries- future.md (100%) diff --git a/sources/talk/20190423 Edge computing is in most industries- future.md b/translated/talk/20190423 Edge computing is in most industries- future.md similarity index 100% rename from sources/talk/20190423 Edge computing is in most industries- future.md rename to translated/talk/20190423 Edge computing is in most industries- future.md From 305ea6d0bdf0aded499b45fa585c58eb8ed4bd6e Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sun, 23 Jun 2019 06:23:37 -0700 Subject: [PATCH 1111/1154] Apply for Translating Apply for Translating --- .../20190531 Learn Python with these awesome resources.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190531 Learn Python with these awesome resources.md b/sources/tech/20190531 Learn Python with these awesome resources.md index 8bcd1d2bbf..3b8704cb49 100644 --- a/sources/tech/20190531 Learn Python with these awesome resources.md +++ b/sources/tech/20190531 Learn Python with these awesome resources.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tomjlw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -45,7 +45,7 @@ via: https://opensource.com/article/19/5/resources-learning-python 作者:[Don Watkins][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tomjlw](https://github.com/tomjlw) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 19d87708ad3edb74002101380fe35ffb81bba812 Mon Sep 17 00:00:00 2001 From: sea0 <4127401@qq.com> Date: Sun, 23 Jun 2019 22:45:46 +0800 Subject: [PATCH 1112/1154] Update 20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md Apply to be translating owner --- ...pen Source Slack Alternative Mattermost Gets -50M Funding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md b/sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md index 993e30d5ec..5d0d25f9d7 100644 --- a/sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md +++ b/sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wahailin) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From bfe39bf0bdd5d1a688d9c3b4c7adca3f0329a1fb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 23:13:31 +0800 Subject: [PATCH 1113/1154] PRF:20190423 Edge computing is in most industries- future.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ninifly 恭喜你完成了第一篇翻译!可以参照我的校对细节了解格式等要求。 --- ...computing is in most industries- future.md | 47 +++++++++---------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/translated/talk/20190423 Edge computing is in most industries- future.md b/translated/talk/20190423 Edge computing is in most industries- future.md index f94e35ef05..f2245bb0b2 100644 --- a/translated/talk/20190423 Edge computing is in most industries- future.md +++ b/translated/talk/20190423 Edge computing is in most industries- future.md @@ -1,56 +1,51 @@ [#]: collector: (lujun9972) -[#]: translator: (ninifly ) -[#]: reviewer: ( ) +[#]: translator: (ninifly) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Edge computing is in most industries’ future) -[#]: via: (https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html#tk.rss_all) +[#]: via: (https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html) [#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) 边缘计算是大多数行业的未来 ====== -几乎每个行业都能够在加速数字化转型的进程中利用边缘计算的优势。 -![iStock][1] -边缘计算的发展将取得一次巨大的飞跃。现在,公司在传统数据中心或云之外生成了10%的数据。但在未来六年内,这一比例将升至75%。 -[according to Gartner][2]. +> 几乎每个行业都可以利用边缘计算来加速数字化转型。 -这很大程度上取决于处理来自设备数据的需要,比如物联网数据传感器。 -早起采用这一方法的人包括: +![](https://img.linux.net.cn/data/attachment/album/201906/23/231224cdl3kwedn0hw2lie.jpg) - * **制造商:** 设备与传感器在这个行业似乎是特有的,因此需要为生产数据找到更快速的方法也就不足为奇。最近 [_Automation World_][3]研究发现43%的制造商已经部署了边缘计算。最流行的事例包括了生产数据分析与设备数据分析。 +边缘计算的发展将取得一次巨大的飞跃。[据 Gartner 数据][2],现在公司有 10% 的数据是在传统数据中心或云之外生成的。但在未来六年内,这一比例将升至 75%。 - * **零售商** : 与大多数深受数字化运营需求影响的产业一样,零售商被迫革新其客户体验。为了达到那一目的,这些组织“正在积极投资靠近买家的计算能力”[writes Dave Johns on][4], 施耐德电气公司IT部门执行副总裁说。他列举了一些例子,例如在试衣间的增强现实镜,给提供了不同的服装选择,而不用顾客试用这些服装。又如用于显示店内交通的基于信标的热图。 +这很大程度上取决于处理来自设备数据的需要,比如物联网(IoT)数据传感器。早期采用这一方法的包括: +* **制造商**:设备与传感器似乎是这个行业特有的,因此需要为产生的数据找到更快速的方法也就不足为奇。一份 [Automation World][3] 最近的研究发现 43% 的制造商已经部署了边缘计算项目。最常用用途包括生产/制造数据分析与设备数据分析。 +* **零售商**:与大多数深受数字化运营需求影响的产业一样,零售商也不得不革新了其客户体验。为此,这些组织“正在积极投资贴近于买家的计算能力”,施耐德电气公司 IT 部门执行副总裁 [Dave Johnson][4] 如是说。他列举了一些例子,例如在试衣间的增强现实(AR)镜子,提供了不同的服装选择,而不用顾客试用这些服装。又如用于显示店内导航的基于信标的热图。 +* **医疗保健机构**:随着医疗保健成本的不断上升,这一行业已经具备了提高生产能力与成本效率方面的创新能力。管理咨询公司[麦肯锡已经确定][5],至少有 11 个有益于患者、医疗机构或两者的医疗保健用例。举两个例子:提高护理效率并有助于优化设备的跟踪移动医疗设备;跟踪用户锻炼并提供健康建议的可穿戴设备。 +虽然以上这些是明显的用例,随着边缘计算市场的扩大,采用它的行业也会增加。 - * **医疗保健机构** : 随着医疗成本的不断上升,这一行业已经在具备在提高生产能力与成本效率方面的创新能力。管理咨询公司已经确定,[McKinsey & Co. has identified][5] 至少有11个有益于患者、医疗机构或者两者都有的医疗保健用例。举两个例子:跟踪移动医疗设备提高护理效率,同时也有助于优化设备;可穿戴设备跟踪用户锻炼并提供健康的建议。 +### 数字化转型的优势 +随着边缘计算的快速处理能力完全符合数字化转型的目标:提高效率、生产能力和加速产品上市和客户体验。以下是一些有潜力的应用及将被边缘计算改变的行业: +**农业**:农民和组织已经使用无人机将农田和气候环境传给灌溉设备。其他的应用可能包括了对工人、牲畜和设备的监测与位置跟踪,从而改善生产能力、效率和成本。 -虽然以上这些是明显的用例,随着边缘计算市场的扩大,使用它的行业也会增加。 +**能源**:在这一领域有许多的潜在的应用,可以使消费者与供应商都受益。例如,智能电表有助于业主更好地管理能源使用,同时减少电网运营商对手动抄表的需求。同样的,水管上的传感器能够监测到漏水,同时提供实时漏水数据。 -**数字化转型的优势** +**金融服务**:银行正在采取交互式 ATM 机,这种交互式 ATM 机能够快速地处理数据以提供更好的用户体验。在管理层次,可以更快速地分析交易数据中的欺诈行为。 -随着边缘计算的快速处理能力完全符合数字化转型的提高效率、生产能力和市场发展速度和客户体验。以下是一些有潜力的应用及将被边缘计算改变的行业: +**物流**:由于消费者需要更快速地交付商品和服务,物流公司将需要转换其地图和寻路功能以获取实时数据,尤其在最后一公里计划和跟踪方面。这可能涉及到基于街道、包裹及汽车的传感器数据传输处理过程。 -**农业** :农名和组织已经使用无人机将农田和气候环境传给灌溉设备。其他的应用可能包括了工人、牲畜和设备的监测与位置跟踪从而改善生产能力、效率和成本。 -**能源** : 在这一领域有许多的潜在的应用,可以使消费者与供应商都受益。例如,智能电表有助于业主更好地管理能源使用,同时减少电网运营商对手动抄表的需求。 同样的,水管上的传感器能够监测到泄露,同时提供实时漏水数据。 - -**金融服务** : 银行正在采取交互式ATM机,这种交互式ATM机能够快速地处理数据以提供更好的用户体验。在管理层次,可以更快速地分析交易数据中的欺诈行为。 - -**物流** : 由于消费者需要更快速地提供商品和服务,物流公司将需要转换映射和路由功能以获取实时数据,尤其在最后一公里计划和轨迹方面。这可能涉及到街道、数据包及汽车基于传感器的数据传输过程。 - -得益于边缘计算,所有行业都有转型的潜力。但是,这将取决于他们如何处理计算机基础设施。在APC.com发现如何克服任何IT阻碍。 +得益于边缘计算,所有行业都有转型的潜力。但是,这将取决于他们如何处理计算基础设施。可以在 [APC.com][6] 找到如何克服任何 IT 阻碍的解决方案。 -------------------------------------------------------------------------------- -via: https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html#tk.rss_all +via: https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html 作者:[Anne Taylor][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[ninifly](https://github.com/ninifly) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 242b5cffccdc57f3ba584236007b0c94d761f2e0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 23:15:38 +0800 Subject: [PATCH 1114/1154] PUB:20190423 Edge computing is in most industries- future.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ninifly 本文首发地址: https://linux.cn/article-11009-1.html 你的 LCTT 专页地址: https://linux.cn/lctt/ninifly 请注册领取 LCCN: https://lctt.linux.cn/ --- .../20190423 Edge computing is in most industries- future.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190423 Edge computing is in most industries- future.md (98%) diff --git a/translated/talk/20190423 Edge computing is in most industries- future.md b/published/20190423 Edge computing is in most industries- future.md similarity index 98% rename from translated/talk/20190423 Edge computing is in most industries- future.md rename to published/20190423 Edge computing is in most industries- future.md index f2245bb0b2..c27a689af9 100644 --- a/translated/talk/20190423 Edge computing is in most industries- future.md +++ b/published/20190423 Edge computing is in most industries- future.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (ninifly) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11009-1.html) [#]: subject: (Edge computing is in most industries’ future) [#]: via: (https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html) [#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) From 3294ae543d23890bc8c78b2f986b302085f8fc51 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 23:56:12 +0800 Subject: [PATCH 1115/1154] PRF:20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md @yizhuoyan --- ...nstalled Or Not On Debian-Ubuntu System.md | 78 +++++++++---------- 1 file changed, 37 insertions(+), 41 deletions(-) diff --git a/translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md b/translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md index 0dbaa6bcbb..b71a8b2907 100644 --- a/translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md +++ b/translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md @@ -1,37 +1,37 @@ [#]: collector: (lujun9972) [#]: translator: (yizhuoyan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -[#]: subject: (如何在Debian/Ubuntu系统中检查程序包是否安装?) +[#]: subject: (How To Check Whether The Given Package Is Installed Or Not On Debian/Ubuntu System?) [#]: via: (https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -如何在Debian/Ubuntu系统中检查程序包是否安装? +如何在 Debian/Ubuntu 系统中检查程序包是否安装? ====== +![](https://img.linux.net.cn/data/attachment/album/201906/23/235541yl41p73z5jv78y8p.jpg) + 我们近期发布了一篇关于批量程序包安装的文章。在此同时,关于如何获取系统上已安装了的程序包信息,我也做了些调查然后找到了些方法。我会把这些方法分享在我们的网站上,希望能帮助到其他人。 -有很多种方法可以检查程序包是否已安装,我找到了7种命令,您可以从中选择您喜欢的使用。 +有很多种方法可以检查程序包是否已安装,我找到了 7 种命令,你可以从中选择你喜欢的使用。 -如下: +如下: - * **`apt-cache :`** 可用于查询APT缓存或程序包的元数据。 - * **`apt :`** 在基于Debian的系统中是安装,下载,删除,搜索和管理包的强有力的工具。 - * **`dpkg-query :`** 一个查询dpkg数据库的工具。 - * **`dpkg :`** Debian系统的包管理工具 - * **`which :`** 返回在终端中输入命令时执行的可执行文件的全路径 - * **`whereis :`** 可用于搜索指定命令的二进制文件,源码文件和帮助文件。 - * **`locate :`** locate命令比find命令快,因为其使用updatedb数据库搜索,而find命令在实际系统中搜索。 + * `apt-cache`:可用于查询 APT 缓存或程序包的元数据。 + * `apt`:是基于 Debian 的系统中的安装、下载、删除、搜索和管理包的强有力的工具。 + * `dpkg-query`:一个查询 dpkg 数据库的工具。 + * `dpkg`:基于 Debian 的系统的包管理工具。 + * `which`:返回在终端中输入命令时执行的可执行文件的全路径。 + * `whereis`:可用于搜索指定命令的二进制文件、源码文件和帮助文件。 + * `locate`:比 `find` 命令快,因为其使用 `updatedb` 数据库搜索,而 `find`命令在实际系统中搜索。 +### 方法一、使用 apt-cache 命令 +`apt-cache` 命令用于从 APT 内部数据库中查询**APT 缓存**和**包的元数据**,将会搜索和显示指定包的信息,包括是否安装、程序包版本、源码仓库信息等。 -## 方法一、使用`apt-cache `命令 - -`apt-cache `命令用于从APT的内部数据库中查询**APT缓存**和**包元数据**,将会搜索和显示指定包的信息,包括是否安装,程序包版本,源码仓库信息等。 - -下面的示例清楚的显示`nano`包已经在系统中安装了以及对应安装的版本号。 +下面的示例清楚的显示 `nano` 包已经在系统中安装了以及对应安装的版本号。 ``` # apt-cache policy nano @@ -44,46 +44,42 @@ nano: 100 /var/lib/dpkg/status ``` -### 方法二、使用`apt`命令 +### 方法二、使用 apt 命令 - - -`apt`是一个功能强大的命令行工具,可用于安装,下载,删除,搜索,管理程序包以及查询关于程序包的信息,类似对于`libapt-pkg`库的所有功能的底层访问。其包含一些与包管理相关的但很少用到的命令行功能。 +`apt` 是一个功能强大的命令行工具,可用于安装、下载、删除、搜索、管理程序包以及查询关于程序包的信息,类似对于 `libapt-pkg` 库的所有功能的底层访问。其包含一些与包管理相关的但很少用到的命令行功能。 ``` # apt -qq list nano nano/bionic,now 2.9.3-2 amd64 [installed] ``` -### 方法三、使用`dpkg-query`命令 +### 方法三、使用 dpkg-query 命令 -`dpkg-query` 是显示`dpkg`数据库中程序包信息列表的一个工具。 +`dpkg-query` 是显示 `dpkg` 数据库中程序包信息列表的一个工具。 -下面示例中的输出的第一列`ii`,表示查询的程序包已安装了。 +下面示例中的输出的第一列 `ii`,表示查询的程序包已安装了。 ``` # dpkg-query --list | grep -i nano ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico ``` -### 方法四、使用`dpkg`命令 +### 方法四、使用 dpkg 命令 -`dpkg`(**d**ebian **p**ac**k**a**g**e)是一个安装,构建,删除和管理Debian包的工具,但和其他包管理系统不同的是,其不能自动下载和安装包或包依赖。 +`dpkg`(**d**ebian **p**ac**k**a**g**e)是一个安装、构建、删除和管理 Debian 包的工具,但和其他包管理系统不同的是,其不能自动下载和安装包或包依赖。 -下面示例中的输出的第一列`ii`,表示查询的包已安装了。 +下面示例中的输出的第一列 `ii`,表示查询的包已安装了。 ``` # dpkg -l | grep -i nano ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico ``` -### 方法五、使用`which`命令 +### 方法五、使用 which 命令 +`which` 命令返回在终端中输入命令时执行的可执行文件的全路径。这对于你想要给可执行文件创建桌面快捷方式或符号链接时非常有用。 - -`which`命令返回在终端中输入命令时执行的可执行文件的全路径。这对于你想要给可执行文件创建桌面快捷方式或符号链接时非常有用。 - -`which`命令仅在当前用户`PATH`环境变量配置的目录列表中搜索,而不是在所有用户的目录中搜索。意思是当你登入你自己账号时 ,其不会在`root`用户文件或目录中搜索。 +`which` 命令仅在当前用户 `PATH` 环境变量配置的目录列表中搜索,而不是在所有用户的目录中搜索。这意思是当你登入你自己账号时,其不会在 `root` 用户文件或目录中搜索。 如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 @@ -92,9 +88,9 @@ ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico /bin/nano ``` -### 方法六、使用`whereis`命令 +### 方法六、使用 whereis 命令 -`whereis`命令用于针对指定命令搜索对应的程序二进制文件,源码文件以及帮助文件等。 +`whereis` 命令用于针对指定命令搜索对应的程序二进制文件、源码文件以及帮助文件等。 如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 @@ -103,15 +99,15 @@ ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico nano: /bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz ``` -### 方法七、使用`locate`命令 +### 方法七、使用 locate 命令 -`locate`命令比`find`命令快,因为其在**updatedb**数据库中搜索,而find命令在实际系统中进行搜索。 +`locate` 命令比 `find` 命令快,因为其在 `updatedb` 数据库中搜索,而 `find` 命令在实际系统中进行搜索。 对于获取指定文件,其使用数据库而不是在特定目录路径中搜索。 -`locate`命令不会预安装在大多数系统中,需要手动安装。 +`locate` 命令不会预安装在大多数系统中,需要手动安装。 -`locate`使用的数据库会根据定时任务定期更新。当然,我们也可以手动更新。 +`locate` 使用的数据库会根据定时任务定期更新。当然,我们也可以手动更新。 如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 @@ -121,17 +117,17 @@ nano: /bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/na /usr/share/nano /usr/share/doc/nano ``` + -------------------------------------------------------------------------------- via: https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[yizhuoyan][translator] -校对:[校对者ID](https://github.com/校对者ID) +译者:[yizhuoyan](https://github.com/yizhuoyan) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 -[translator]:https://github.com/yizhuoyan From 50cee921dd0cb19e44f500c0b70aca71fb226897 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Jun 2019 23:57:15 +0800 Subject: [PATCH 1116/1154] PUB:20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md @yizhuoyan https://linux.cn/article-11010-1.html --- ...ven Package Is Installed Or Not On Debian-Ubuntu System.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md (98%) diff --git a/translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md b/published/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md similarity index 98% rename from translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md rename to published/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md index b71a8b2907..a0f55d4b7b 100644 --- a/translated/tech/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md +++ b/published/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (yizhuoyan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11010-1.html) [#]: subject: (How To Check Whether The Given Package Is Installed Or Not On Debian/Ubuntu System?) [#]: via: (https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From 72fa15a6e9e2283e41a4c2f99f6f49f098ef4661 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Jun 2019 00:50:48 +0800 Subject: [PATCH 1117/1154] APL:20190604 Kubernetes is a dump truck- Here-s why --- sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md b/sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md index 40aef2d614..84a6809004 100644 --- a/sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md +++ b/sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c66099076788f7bb51aed46f810fc674241d5f91 Mon Sep 17 00:00:00 2001 From: sea0 <4127401@qq.com> Date: Mon, 24 Jun 2019 01:06:29 +0800 Subject: [PATCH 1118/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lternative Mattermost Gets -50M Funding.md | 95 ------------------- ...lternative Mattermost Gets -50M Funding.md | 92 ++++++++++++++++++ 2 files changed, 92 insertions(+), 95 deletions(-) delete mode 100644 sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md create mode 100644 translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md diff --git a/sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md b/sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md deleted file mode 100644 index 5d0d25f9d7..0000000000 --- a/sources/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wahailin) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open Source Slack Alternative Mattermost Gets $50M Funding) -[#]: via: (https://itsfoss.com/mattermost-funding/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Open Source Slack Alternative Mattermost Gets $50M Funding -====== - -[Mattermost][1], which presents itself as an open source alternative to [Slack][2] raised $50M in series B funding. This is definitely something to get excited for. - -[Slack][3] is a cloud-based team collaboration software that is mainly used for internal team communication. Enterprises, startups and even open source projects worldwide use it interact with colleagues and project members. Slack is free with limited features while the paid enterprise version has premium features. - -[Slack is valued at $20 billion][4] in June, 2019. You can guess the kind of impact it has made in the tech industry and certainly more products are trying to compete with Slack. - -### $50 million for an open source project - -![][5] - -Personally, I was not aware of Mattermost. But, when [VentureBeat][6] reported the story, it made me curious. The funding was led by [Y Combinator’s][7] Continuity with a new investor Battery Ventures and was joined by the existing investors – Redpoint and S28 Captial. - -With the [announcement][8], they also mentioned: - -> With today’s announcement, Mattermost becomes YC’s largest ever Series B investment, and more importantly, their largest open source investment to date. - -To give you some specifics, here’s what VentureBeat mentioned: - -> The capital infusion follows a $20 million series A in February and a $3.5 million seed round in February 2017 and brings the Palo Alto, California-based company’s total raised to roughly $70 million. - -If you are curious about their plans, you should go through their [official announcement post][8]. - -Even though it all sounds good, what is Mattermost? Maybe you didn’t know about it, until now. So, let us take a brief look at it: - -### A quick look at Mattermost - -![Mattermost][9] - -As mentioned, it is an open source Slack alternative. - -At first glance, it almost resembles the look and feel of Slack. Well, that’s the point here – you will have an open source solution that you’re comfortable using. - -It even integrates with some of the popular DevOps tools like Git, Bots, and CI/CD. In addition to the functionality, it focuses on security and privacy as well. - -[][10] - -Suggested read  Zettlr - Markdown Editor for Writers and Researchers - -Also, similar to Slack, it supports integration with multiple apps and services. - -Sounds promising? I think so. - -#### Pricing: Enterprise Edition vs Team Edition - -If you want them (Mattermost) to host it (or want priority support), you should opt for the Enterprise edition. However, if you want to host it without spending a penny, you can download the [Team edition][11] and install it on your Linux-based cloud/VPS server. - -Of course, we are not here to review it in-depth. However, I do want to mention that the enterprise edition is quite affordable. - -![][12] - -**Wrapping Up** - -Mattermost is definitely impressive. And, with a whopping $50M funding, it may become the next big thing in the open source community for users who were on the lookout for a secure and open source messaging platform with efficient team collaboration support. - -What do you think about this news? Is it something exciting for you? Were you already aware of Mattermost as a slack alternative? - -Let us know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/mattermost-funding/ - -作者:[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://mattermost.com/ -[2]: https://itsfoss.com/slack-use-linux/ -[3]: https://slack.com -[4]: https://www.ft.com/content/98747b36-9368-11e9-aea1-2b1d33ac3271 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-wallpaper.png?resize=800%2C450&ssl=1 -[6]: https://venturebeat.com/2019/06/19/mattermost-raises-50-million-to-advance-its-open-source-slack-alternative/ -[7]: https://www.ycombinator.com/ -[8]: https://mattermost.com/blog/yc-leads-50m-series-b-in-mattermost-as-open-source-slack-alternative/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-screenshot.jpg?fit=800%2C497&ssl=1 -[10]: https://itsfoss.com/zettlr-markdown-editor/ -[11]: https://mattermost.com/download/ -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-enterprise-plan.jpg?fit=800%2C325&ssl=1 diff --git a/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md b/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md new file mode 100644 index 0000000000..6b430cc7a0 --- /dev/null +++ b/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: (wahailin) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open Source Slack Alternative Mattermost Gets $50M Funding) +[#]: via: (https://itsfoss.com/mattermost-funding/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Slack 开源替代品 Mattermost 获得 5000 万美元融资 +====== + +[Mattermost][1],作为 [Slack][2] 的开源替代品,获得了 5000 万美元的B轮融资。这个消息极其令人振奋。 + +[Slack][3] 是一个基于云的团队内部沟通协作软件。企业、创业公司、甚至全球化的开源项目都在使用Slack进行同事及项目成员间的沟通。 + +[Slack 在 2019 年 6 月的估值为 200 亿美元][4],由此可见其在科技行业的巨大影响,当然也就有更多产品想与之竞争。 + +### 5000 万美元开源项目 + +![][5] + +就我个人而言,我并不知道 MatterMost 这个产品。但 [VentureBeat][6] 对这则新闻的报道,激发了我的好奇心。 这次融资由 [Y Combinator’s][7] 与一家新的投资方 BattleVentures 牵头,现有投资者 Redpoint 和 S28 Captial 共同加入。 + + +在[公告][8]中,他们也提到: + +> 今天的公告中,Mattermost 成为了 YC 历次 B 轮投资中投资额最高的项目。 + +下面是摘自 VentureBeat 的报道,你可以从中了解到一些细节: + +> 本次资本注入,是继 2017 年 2 月的种子轮 350 万融资和今年 2 月份的 2000 万 A 轮融资之后进行的,并使得这家总部位于美国加州帕罗奥图(Palo Alto)的公司融资总额达到了约 7000 万美元。 + +如果你对他们的规划感兴趣,可以阅读[官方公告][8]。 + +尽管听起来很不错,但可能你并不知道 Mattermost 是什么。所以我们先来作个简单了解: + +### Mattermost 快览 + +![Mattermost][9] + +前面已经提到,Mattermost 是 Slack 的开源替代品。 + +乍一看,它几乎照搬了 Slack 的界面外观,没错,这就是关键所在,你将拥有你乐于使用的软件的开源方案。 + +它甚至集成了一些流行的 DevOps 工具,如 Git、Bots 和 CI/CD。除了这些功能外,它还关注安全性和隐私。 + +同样,和 Slack 类似,它支持和多种应用程序与服务的集成。 + +听起来很有前景?我也这么认为。 + +#### 定价:企业版和团队版 + +如果你想让 Mattermost 对其托管(或获得优先支持),应选择企业版。但如果你想使用非付费托管,可以下载[团队版][11],并安装到基于 Linux 的云服务器或 VPS 服务器上。 + +当然,我们不会在此进行深入探究。我确想在此提及的是,企业版并不昂贵。 + +![][12] + +**总结** + +MatterMost 无疑相当出色,有了 5000 万巨额资金的注入,对于那些正在寻求安全的并能提供高效团队协作支持的开源通讯平台的开源社区用户,Mattermost 很可能成为下一个大事件。 + +你觉得这条新闻怎么样?对你来说有价值吗?你是否已了解 Mattermost 是 Slack 的替代品? + +请在下面的评论中给出你的想法。 + +-------------------------------------------------------------------------------- + +来源: + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wahailin](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://mattermost.com/ +[2]: https://itsfoss.com/slack-use-linux/ +[3]: https://slack.com +[4]: https://www.ft.com/content/98747b36-9368-11e9-aea1-2b1d33ac3271 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-wallpaper.png?resize=800%2C450&ssl=1 +[6]: https://venturebeat.com/2019/06/19/mattermost-raises-50-million-to-advance-its-open-source-slack-alternative/ +[7]: https://www.ycombinator.com/ +[8]: https://mattermost.com/blog/yc-leads-50m-series-b-in-mattermost-as-open-source-slack-alternative/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-screenshot.jpg?fit=800%2C497&ssl=1 +[10]: https://itsfoss.com/zettlr-markdown-editor/ +[11]: https://mattermost.com/download/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-enterprise-plan.jpg?fit=800%2C325&ssl=1 From e0600ef7f64ae827946d42e32d59fb30b224a4f1 Mon Sep 17 00:00:00 2001 From: sea0 <4127401@qq.com> Date: Mon, 24 Jun 2019 01:07:40 +0800 Subject: [PATCH 1119/1154] Update 20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md --- ...pen Source Slack Alternative Mattermost Gets -50M Funding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md b/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md index 6b430cc7a0..e9ebcd7bfa 100644 --- a/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md +++ b/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md @@ -71,7 +71,7 @@ MatterMost 无疑相当出色,有了 5000 万巨额资金的注入,对于那 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[wahailin](https://github.com/译者ID) +译者:[wahailin](https://github.com/wahailin) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8db7a3a042a5415a138013f5c3e56e395880a51a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Jun 2019 01:23:22 +0800 Subject: [PATCH 1120/1154] TSL:20190604 Kubernetes is a dump truck- Here-s why.md --- ... Kubernetes is a dump truck- Here-s why.md | 52 ------------------ ... Kubernetes is a dump truck- Here-s why.md | 53 +++++++++++++++++++ 2 files changed, 53 insertions(+), 52 deletions(-) delete mode 100644 sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md create mode 100644 translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md diff --git a/sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md b/sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md deleted file mode 100644 index 84a6809004..0000000000 --- a/sources/tech/20190604 Kubernetes is a dump truck- Here-s why.md +++ /dev/null @@ -1,52 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Kubernetes is a dump truck: Here's why) -[#]: via: (https://opensource.com/article/19/6/kubernetes-dump-truck) -[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) - -Kubernetes is a dump truck: Here's why -====== -Dump trucks are an elegant solution to a wide range of essential -business problems. -![Dump truck with kids standing in the foreground][1] - -As we approach Kubernetes anniversary on Friday, June 7 this week let's start with this. - -Dump trucks are elegant. Seriously, stay with me for a minute. They solve a wide array of technical problems in an elegant way. They can move dirt, gravel, rocks, coal, construction material, or road barricades. They can even pull trailers with other pieces of heavy equipment on them. You can load a dump truck with five tons of dirt and drive across the country with it. For a nerd like me, that's elegance. - -But, they're not easy to use. Dump trucks require a special driver's license. They're also not easy to equip or maintain. There are a ton of options when you buy a dump truck and a lot of maintenance. But, they're elegant for moving dirt. - -You know what's not elegant for moving dirt? A late-model, compact sedan. They're way easier to buy. Easier to drive. Easier to maintain. But, they're terrible at carrying dirt. It would take 200 trips to carry five tons of dirt, and nobody would want the car after that. - -Alright, you're sold on using a dump truck, but you want to build it yourself. I get it. I'm a nerd and I love building things. But… - -If you owned a construction company, you wouldn't build your own dump trucks. You definitely wouldn't maintain the supply chain to rebuild dump trucks (that's a big supply chain). But you would learn to drive one. - -OK, my analogy is crude but easy to understand. Ease of use is relative. Ease of maintenance is relative. Ease of configuration is relative. It really depends on what you are trying to do. [Kubernetes][2] is no different. - -Building Kubernetes once isn't too hard. Equipping Kubernetes? Well, that gets harder. What did you think of KubeCon? How many new projects were announced? Which ones are "real"? Which ones should you learn? How deeply do you understand Harbor, TikV, NATD, Vitess, Open Policy Agent? Not to mention Envoy, eBPF, and a bunch of the underlying technologies in Linux? It feels a lot like building dump trucks in 1904 with the industrial revolution in full swing. Figuring out what screws, bolts, metal, and pistons to use. (Steampunk, anyone?) - -Building and equipping Kubernetes, like a dump truck, is a technical problem you probably shouldn't be tackling if you are in financial services, retail, biological research, food services, and so forth. But, learning how to drive Kubernetes is definitely something you should be learning. - -Kubernetes, like a dump truck, is elegant for the wide variety of technical problems it can solve (and the ecosystem it drags along). So, I'll leave you with a quote that one of my computer science professors told us in my first year of college. She said, "one day, you will look at a piece of code and say to yourself, 'now that's elegant!'" - -Kubernetes is elegant. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/6/kubernetes-dump-truck - -作者:[Scott McCarty][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/fatherlinux -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dump_truck_car_container_kubernetes.jpg?itok=4BdmyVGd (Dump truck with kids standing in the foreground) -[2]: https://kubernetes.io/ diff --git a/translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md b/translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md new file mode 100644 index 0000000000..3a629dfc93 --- /dev/null +++ b/translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kubernetes is a dump truck: Here's why) +[#]: via: (https://opensource.com/article/19/6/kubernetes-dump-truck) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) + +为什么说 Kubernetes 是一辆翻斗车 +====== + +> 翻斗车是解决各种基本业务问题的优雅解决方案。 + +![Dump truck with kids standing in the foreground][1] + +这篇文章写于 Kubernetes 的生日(6 月 7 日星期五)前夕。 + +翻斗车很优雅。说真的,不信你听我说。它们以优雅的方式解决了各种各样的技术问题。它们可以搬动泥土、砾石、岩石、煤炭、建筑材料或道路上的障碍。它们甚至可以拉动拖车及它们上面的其他重型设备。你可以给一辆翻斗车装上五吨泥土,然后自驾游遍全国。对于像我这样的电脑极客来说,那就是优雅。 + +但是,它们并不容易使用。驾驶翻斗车需要特殊的驾驶执照。它们也不容易装配和维护。购买翻斗车和各种维护时要做很多选择。但是,它们可以优雅的搬动那些垃圾。 + +你知道搬动垃圾有什么不优雅的地方吗?假如你有一款新型的紧凑型轿车,它们到处可以买到,易于驾驶、更易于维护。但是,用它们来装泥土就很糟糕。这需要跑 200 趟才能运走 5 吨垃圾,而且,之后没人再会想要这辆车了。 + +好吧,你可以买一辆出售的翻斗车,而不是想自己造一辆。但是我不同,我是个极客,我喜欢自己造东西。但…… + +如果你拥有一家建筑公司,你就不会想着自己造一辆翻斗车。你肯定不会维持一条供应链来重构翻斗车(这可是一条很大的供应链)。但你可以学会驾驶一辆。 + +好吧,我的这个比喻很粗糙,但很容易理解。易用性是相对的,易于维护是相对的,易于装配也是相对的。这实际上取决于你想要做什么。[Kubernetes][2] 也不例外。 + +一次性构建 Kubernetes 并不太难。配置好 Kubernetes 呢?好吧,这稍微难一些。你如何看待 KubeCon?它们又宣布了多少新项目?哪些是“真实的”呢?而你应该学习哪些?你对 Harbour、TikV、NATD、Vitess,开放策略代理有多深入的了解?更不用说 Envoy、eBPF 和 Linux 中的一系列底层技术?这就像是 1904 年工业革命爆发时建造翻斗车一样,你要弄清楚使用的螺钉、螺栓、金属和活塞。(有没有蒸汽朋克在这里吗?) + +像翻斗车一样构造和配置 Kubernetes 是一个技术问题,如果你从事金融服务、零售、生物研究、食品服务等等,这可能不是你应该做的事情。但是,学习如何驾驶 Kubernetes 肯定是你应该学习的东西。 + +Kubernetes 就像一辆翻斗车,因其可以解决的各种技术问题(以及它所拖带的生态系统)而优雅。所以,我会给你一句引用的话,这是我的一位计算机科学教授在我大学的第一年告诉我们的,她说,“有一天,你会看到一段代码并对自己说,‘真特么优雅!’” + +Kubernetes 很优雅。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/kubernetes-dump-truck + +作者:[Scott McCarty][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dump_truck_car_container_kubernetes.jpg?itok=4BdmyVGd (Dump truck with kids standing in the foreground) +[2]: https://kubernetes.io/ From 3a9e4224b8fa3c9a26623efa8a78bcb11482101f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Jun 2019 01:29:00 +0800 Subject: [PATCH 1121/1154] PRF:20190604 Kubernetes is a dump truck- Here-s why.md @wxy --- .../tech/20190604 Kubernetes is a dump truck- Here-s why.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md b/translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md index 3a629dfc93..a5146b077c 100644 --- a/translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md +++ b/translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Kubernetes is a dump truck: Here's why) @@ -12,7 +12,7 @@ > 翻斗车是解决各种基本业务问题的优雅解决方案。 -![Dump truck with kids standing in the foreground][1] +![](https://img.linux.net.cn/data/attachment/album/201906/24/012846v737bts00uwk3qd7.jpg) 这篇文章写于 Kubernetes 的生日(6 月 7 日星期五)前夕。 @@ -43,7 +43,7 @@ via: https://opensource.com/article/19/6/kubernetes-dump-truck 作者:[Scott McCarty][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 259bff1c6a8f59aa65721d9ef60d3f0ddda57fa2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Jun 2019 01:29:56 +0800 Subject: [PATCH 1122/1154] PUB:20190604 Kubernetes is a dump truck- Here-s why.md @wxy https://linux.cn/article-11011-1.html --- .../20190604 Kubernetes is a dump truck- Here-s why.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190604 Kubernetes is a dump truck- Here-s why.md (98%) diff --git a/translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md b/published/20190604 Kubernetes is a dump truck- Here-s why.md similarity index 98% rename from translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md rename to published/20190604 Kubernetes is a dump truck- Here-s why.md index a5146b077c..b8f0930300 100644 --- a/translated/tech/20190604 Kubernetes is a dump truck- Here-s why.md +++ b/published/20190604 Kubernetes is a dump truck- Here-s why.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11011-1.html) [#]: subject: (Kubernetes is a dump truck: Here's why) [#]: via: (https://opensource.com/article/19/6/kubernetes-dump-truck) [#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) From 7a0bd3e7751619ced812ac796d583d4801822771 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 24 Jun 2019 08:59:08 +0800 Subject: [PATCH 1123/1154] translated --- ...sonal assistant with Mycroft and Fedora.md | 94 ------------------- ...sonal assistant with Mycroft and Fedora.md | 94 +++++++++++++++++++ 2 files changed, 94 insertions(+), 94 deletions(-) delete mode 100644 sources/tech/20190614 Personal assistant with Mycroft and Fedora.md create mode 100644 translated/tech/20190614 Personal assistant with Mycroft and Fedora.md diff --git a/sources/tech/20190614 Personal assistant with Mycroft and Fedora.md b/sources/tech/20190614 Personal assistant with Mycroft and Fedora.md deleted file mode 100644 index 25feafdc93..0000000000 --- a/sources/tech/20190614 Personal assistant with Mycroft and Fedora.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Personal assistant with Mycroft and Fedora) -[#]: via: (https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/) -[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) - -Personal assistant with Mycroft and Fedora -====== - -![][1] - -Looking for an open source personal assistant ? [Mycroft][2] is allowing you to run an open source service which gives you better control of your data. - -### Install Mycroft on Fedora - -Mycroft is currently not available in the official package collection, but it can be easily installed from the project source. The first step is to download the source from Mycroft’s GitHub repository. - -``` -$ git clone https://github.com/MycroftAI/mycroft-core.git -``` - -Mycroft is a Python application and the project provides a script that takes care of creating a virtual environment before installing Mycroft and its dependencies. - -``` -$ cd mycroft-core -$ ./dev_setup.sh -``` - -The installation script prompts the user to help him with the installation process. It is recommended to run the stable version and get automatic updates. - -When prompted to install locally the Mimic text-to-speech engine, answer No. Since as described in the installation process this can take a long time and Mimic is available as an rpm package in Fedora so it can be installed using dnf. - -``` -$ sudo dnf install mimic -``` - -### Starting Mycroft - -After the installation is complete, the Mycroft services can be started using the following script. - -``` -$ ./start-mycroft.sh all -``` - -In order to start using Mycroft the device running the service needs to be registered. To do that an account is needed and can be created at . - -Once the account created, it is possible to add a new device at the following address [https://account.mycroft.ai/devices.][3] Adding a new device requires a pairing code that will be spoken to you by your device after starting all the services. - -![][4] - -The device is now ready to be used. - -### Using Mycroft - -Mycroft provides a set of [skills][5] that are enabled by default or can be downloaded from the [Marketplace][5]. To start you can simply ask Mycroft how is doing, or what the weather is. - -``` -Hey Mycroft, how are you ? - -Hey Mycroft, what's the weather like ? -``` - -If you are interested in how things works, the _start-mycroft.sh_ script provides a _cli_ option that lets you interact with the services using the command line. It is also displaying logs which is really useful for debugging. - -Mycroft is always trying to learn new skills, and there are many way to help by [contributing][6] the Mycroft community. - -* * * - -Photo by [Przemyslaw Marczynski][7] on [Unsplash][8] - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/ - -作者:[Clément Verna][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/cverna/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/mycroft-816x345.jpg -[2]: https://mycroft.ai/ -[3]: https://account.mycroft.ai/devices -[4]: https://fedoramagazine.org/wp-content/uploads/2019/06/Screenshot_2019-06-14-Account.png -[5]: https://market.mycroft.ai/skills -[6]: https://mycroft.ai/contribute/ -[7]: https://unsplash.com/@pemmax?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[8]: https://unsplash.com/search/photos/ai?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20190614 Personal assistant with Mycroft and Fedora.md b/translated/tech/20190614 Personal assistant with Mycroft and Fedora.md new file mode 100644 index 0000000000..58a589b6df --- /dev/null +++ b/translated/tech/20190614 Personal assistant with Mycroft and Fedora.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Personal assistant with Mycroft and Fedora) +[#]: via: (https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) + +在 Fedora 中使用私人助理 Mycroft +====== + +![][1] + +还在找开源的私人助理么?[Mycroft][2] 让你运行开源服务,从而更好地控制你的数据。 + +### 在 Fedora 上安装 Mycroft + +Mycroft 目前不存在于官方软件包集合中,但它可以轻松地从源码安装。第一步是从 Mycroft 的 GitHub 仓库下载源码。 + +``` +$ git clone https://github.com/MycroftAI/mycroft-core.git +``` + +Mycroft 是一个 Python 应用,它提供了一个脚本负责在安装 Mycroft 及其依赖项之前创建虚拟环境。 + +``` +$ cd mycroft-core +$ ./dev_setup.sh +``` + +安装脚本会提示用户帮助他完成安装过程。建议运行稳定版本并获取自动更新。 + +当提示在本地安装 Mimic 文字转语音引擎时,请回答否。因为根据安装描述,这可能需要很长时间,并且 Mimic 有适合 Fedora 的 rpm 包,因此可以使用 dnf 进行安装。 + +``` +$ sudo dnf install mimic +``` + +### 开始使用 Mycroft + +安装完成后,可以使用以下脚本启动 Mycroft 服务。 + +``` +$ ./start-mycroft.sh all +``` + +要开始使用 Mycroft,需要注册运行服务的设备。因此需要一个帐户,可以在 中创建。 + +创建帐户后,可以在 [https://account.mycroft.ai/devices][3] 中添加新设备。添加新设备需要配对码,你的设备会在所有服务启动后告诉你。 + +![][4] + +现在可以使用该设备了。 + +### 使用 Mycroft + +Mycroft 提供了一组默认启用的[技能][5],它们或者可以从[市场][5]下载。刚开始,你可以简单地向 Mycroft 问好,或天气如何。 + +``` +Hey Mycroft, how are you ? + +Hey Mycroft, what's the weather like ? +``` + +如果你对它是如何工作的感兴趣,_start-mycroft.sh_ 脚本提供了一个_命令行_选项,它能让你使用命令行交互。它也会显示用于调试的有用信息。 + +Mycroft 总在学习新技能,并且有很多方法给 Mycroft 社区做[贡献][6]。 + +* * * + +由 [Przemyslaw Marczynski][7] 摄影,发布于 [Unsplash][8] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/ + +作者:[Clément Verna][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/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/mycroft-816x345.jpg +[2]: https://mycroft.ai/ +[3]: https://account.mycroft.ai/devices +[4]: https://fedoramagazine.org/wp-content/uploads/2019/06/Screenshot_2019-06-14-Account.png +[5]: https://market.mycroft.ai/skills +[6]: https://mycroft.ai/contribute/ +[7]: https://unsplash.com/@pemmax?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/ai?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From e551bf1dc34eb24cfb24ef5add67400d79d74f98 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 24 Jun 2019 09:08:14 +0800 Subject: [PATCH 1124/1154] translating --- ...9 VSCodium- 100- Open Source Version of Microsoft VS Code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md b/sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md index e9ec3e4a85..2365c992e2 100644 --- a/sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md +++ b/sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6adfd99944d349126831dce9d6689113520db516 Mon Sep 17 00:00:00 2001 From: Liwen Jiang Date: Sun, 23 Jun 2019 19:52:29 -0700 Subject: [PATCH 1125/1154] Submitted Translated Passage for Review Submitted Translated Passage for Review --- ...arn Python with these awesome resources.md | 90 ------------------- ...arn Python with these awesome resources.md | 87 ++++++++++++++++++ 2 files changed, 87 insertions(+), 90 deletions(-) delete mode 100644 sources/tech/20190531 Learn Python with these awesome resources.md create mode 100644 translated/tech/20190531 Learn Python with these awesome resources.md diff --git a/sources/tech/20190531 Learn Python with these awesome resources.md b/sources/tech/20190531 Learn Python with these awesome resources.md deleted file mode 100644 index 3b8704cb49..0000000000 --- a/sources/tech/20190531 Learn Python with these awesome resources.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tomjlw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Learn Python with these awesome resources) -[#]: via: (https://opensource.com/article/19/5/resources-learning-python) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -Learn Python with these awesome resources -====== -Expand your Python knowledge by adding these resources to your personal -learning network. -![Book list, favorites][1] - -I've been using and teaching Python for a long time now, but I'm always interested in increasing my knowledge about this practical and useful programming language. That's why I've been trying to expand my Python [personal learning network][2] (PLN), a concept that describes informal and mutually beneficial networks for sharing information. - -Educators [Kelly Paredes][3] and [Sean Tibor][4] recently talked about how to build your Python PLN on their podcast, [Teaching Python][5], which I subscribed to after meeting them at [PyCon 2019][6] in Cleveland (and adding them to my Python PLN). This podcast inspired me to think more about the people in my Python PLN, including those I met recently at PyCon. - -I'll share some of the places I've met members of my PLN; maybe they can become part of your Python PLN, too. - -### Young Coders mentors - -[Betsy Waliszewski][7], the event coordinator for the Python Foundation, is a member of my Python PLN. When we ran into each other at PyCon2019, because I'm a teacher, she recommended I check out the [Young Coders][8] workshop for kids ages 12 and up. There, I met [Katie Cunningham][9], who was running the program, which taught participants how to set up and configure a Raspberry Pi and use Python. The young students also received two books: _[Python for Kids][10]_ by Jason Briggs and _[Learn to Program with Minecraft][11]_ by Craig Richardson. I'm always looking for new ways to improve my teaching, so I quickly picked up two copies of the Minecraft book at [NoStarch Press][12]' booth at the conference. Katie is a great teacher and a prolific author with a wonderful [YouTube][13] channel full of Python training videos. - -I added Katie to my PLN, along with two other people I met at the Young Coders workshop: [Nat Dunn][14] and [Sean Valentine][15]. Like Katie, they were volunteering their time to introduce young programmers to Python. Nat is the president of [Webucator][16], an IT training company that has been a sponsor of the Python Software Foundation for several years and sponsored the PyCon 2018 Education Summit. He decided to teach at Young Coders after teaching Python to his 13-year-old son and 14-year-old nephew. Sean is the director of strategic initiatives at the [Hidden Genius Project][17], a technology and leadership mentoring program for black male youth. Sean said many Hidden Genius participants "built projects using Python, so we saw [Young Coders] as a great opportunity to partner." Learning about the Hidden Genius Project has inspired me to think deeper about the implications of coding and its power to change lives. - -### Open Spaces meetups - -I found PyCon's [Open Spaces][18], self-organizing, impromptu hour-long meetups, just as useful as the official programmed events. One of my favorites was about the [Circuit Playground Express][19] device, which was part of our conference swag bags. I am fascinated by this device, and the Open Space provided an avenue to learn more. The organizers offered a worksheet and a [GitHub][20] repo with all the tools we needed to be successful, as well as an opportunity for hands-on learning and direction to explore this unique hardware. - -This meetup whetted my appetite to learn even more about programming the Circuit Playground Express, so after PyCon, I reached out on Twitter to [Nina Zakharenko][21], who [presented a keynote][22] at the conference about programming the device. Nina has been in my Python PLN since last fall when I heard her talk at [All Things Open][23], and I recently signed up for her [Python Fundamentals][24] class to add to my learning. Nina recommended I add [Kattni Rembor][25], whose [code examples][26] are helping me learn to program with CircuitPython, to my Python PLN. - -### Other resources from my PLN - -I also met fellow [Opensource.com][27] Community Moderator [Moshe Zadka][28] at PyCon2019 and talked with him at length. He shared several new Python resources, including _[How to Think Like a Computer Scientist][29]_. Community Moderator [Seth Kenlon][30] is another member of my PLN; he has published many great [Python articles][31], and I recommend you follow him, too. - -My Python personal learning network continues to grow each day. Besides the folks I have already mentioned, I recommend you follow [Al Sweigart][32], [Eric Matthes][33], and [Adafruit][34] because they share great content. I also recommend the book _[Make: Getting Started with Adafruit Circuit Playground Express][35]_ and [Podcast.__init__][36], a podcast all about the Python community, both of which I learned about from my PLN. - -Who is in your Python PLN? Please share your favorites in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/5/resources-learning-python - -作者:[Don Watkins][a] -选题:[lujun9972][b] -译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/reading_book_stars_list.png?itok=Iwa1oBOl (Book list, favorites) -[2]: https://en.wikipedia.org/wiki/Personal_learning_network -[3]: https://www.teachingpython.fm/hosts/kellypared -[4]: https://twitter.com/smtibor -[5]: https://www.teachingpython.fm/20 -[6]: https://us.pycon.org/2019/ -[7]: https://www.linkedin.com/in/betsywaliszewski -[8]: https://us.pycon.org/2019/events/letslearnpython/ -[9]: https://www.linkedin.com/in/kcunning/ -[10]: https://nostarch.com/pythonforkids -[11]: https://nostarch.com/programwithminecraft -[12]: https://nostarch.com/ -[13]: https://www.youtube.com/c/KatieCunningham -[14]: https://www.linkedin.com/in/natdunn/ -[15]: https://www.linkedin.com/in/sean-valentine-b370349b/ -[16]: https://www.webucator.com/ -[17]: http://www.hiddengeniusproject.org/ -[18]: https://us.pycon.org/2019/events/open-spaces/ -[19]: https://www.adafruit.com/product/3333 -[20]: https://github.com/adafruit/PyCon2019 -[21]: https://twitter.com/nnja -[22]: https://www.youtube.com/watch?v=35mXD40SvXM -[23]: https://allthingsopen.org/ -[24]: https://frontendmasters.com/courses/python/ -[25]: https://twitter.com/kattni -[26]: https://github.com/kattni/ChiPy_2018 -[27]: http://Opensource.com -[28]: https://opensource.com/users/moshez -[29]: http://openbookproject.net/thinkcs/python/english3e/ -[30]: https://opensource.com/users/seth -[31]: https://www.google.com/search?source=hp&ei=gVToXPq-FYXGsAW-mZ_YAw&q=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&oq=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&gs_l=psy-ab.12...627.15303..15584...1.0..0.176.2802.4j21......0....1..gws-wiz.....0..35i39j0j0i131j0i67j0i20i263.r2SAW3dxlB4 -[32]: http://alsweigart.com/ -[33]: https://twitter.com/ehmatthes?lang=en -[34]: https://twitter.com/adafruit -[35]: https://www.adafruit.com/product/3944 -[36]: https://www.pythonpodcast.com/episodes/ diff --git a/translated/tech/20190531 Learn Python with these awesome resources.md b/translated/tech/20190531 Learn Python with these awesome resources.md new file mode 100644 index 0000000000..927355886d --- /dev/null +++ b/translated/tech/20190531 Learn Python with these awesome resources.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learn Python with these awesome resources) +[#]: via: (https://opensource.com/article/19/5/resources-learning-python) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +通过这些精品资源学习 Python +====== +通过将这些资源加入你自己的私人学习网络以拓展你的 Python 知识 +![书单,最爱][1] + +我使用和教 Python 已有很长时间了,但我总是感兴趣于增加我对这门实用语言的知识。这就是为什么我一直试着拓展我的 Python [私人学习网络][2](PLN),一个描述非正式的互惠型分享信息网络的概念。 + +教育学家 [Kelly Paredes][3] 和 [Sean Tibor][4] 最近讨论关于如何在他们的播客 [Teaching Python][5] 上搭建 Python PLN。我在克里夫兰的 [PyCon 2019][6] 遇到他们之后就订阅了这个频道(并把它们假如我的 Python PLN)。这个播客鼓励我考虑更多关于我的 Python PLN 中的人,包括那些我最近在 PyCon 遇到的。 + +我会分享一些我遇到我的 PLN 的地方;可能它们也可以变成你的 Python PLN 的一部分。 + +### Young Coders 导师 +Python 基金会的活动协调者 [Betsy Waliszewski][7] 是我的 Python PLN 中的一员。当我们在 PyCon2019 碰到彼此时,因为我是个老师她推荐我看看为十二岁及以上的孩子打造的 [Young Coders][8] 工作室。在那我遇到了负责这个教参与者如何搭建并配置树莓派并使用 Python 项目的 [Katie Cunningham][9]。年轻学生也会收到两本书 Jason Briggs 的 _[Python for Kids][10]_ 和 Craig Richardson 的 _[Learn to Program with Minecraft][11]_。我总是寻找提升我教学水平的新方式,因此我在会议上的 [NoStarch Press][12] 展台迅速拿了两本 Minecraft 书的抄本。Katie 是一名优秀的教师以及一名熟练的有着惊艳的充满 Python 培训视频的 [YouTube][13] 频道作者。 + +我把 Kattie 与另外两个我在 Young Coders 工作室碰到的人加入我的 PLN:[Nat Dunn][14] 和 [Sean Valentine][15]。像 Katie 一样,他们志愿将他们的时间用来把 Python 介绍给青年程序员。Nat 是 [Webucator][16],一家成为 Python 软件基金会赞助商好几年并赞助了 PyCon 2018 教育峰会的 IT 培训公司的主席。他在教他的13岁儿子和14岁外甥 Python 后决定在 Young Coders 教学。Sean 是 [Hidden Genius Project][17],一个为黑人男青年而打造的科技及领导力教导项目,的战略倡议指导。Sean 说许多 Hidden Genius 参与者“用 Python打造项目因此我们将 [Young Coders] 看成一个对合作商的好机会”。了解 Hidden Genius Project 鼓励我更深层次地思考编程的未来以及其改变生活的威力。 + +### Open Spaces 会面 +我发现 PyCon 的 [Open Spaces][18] 一小时左右的自序即兴会面跟正式的项目活动一样有用。我的最爱之一是关于 [Circuit Playground Express][19] 设备,它是我们会议主题包的一部分。我着迷于这个设备并且 Open Space 提供了学习它的一条大道。组织者提供工作表和拥有成功所需要的所有工具的 [Github][20] 仓库,也提供了一个上手学习的机会以及探索这个独特硬件的方向。 + +这次会面满足了我想要了解更多关于编程 Circuit Playground Express 的胃口,因此在 PyCon 之后, 我在 Twitter 上接触到了在会议上就有关编程这个设备发表主旨演讲的 [Nina Zakharenko][21]。Nina 自从去年秋天我在 [All Things Open][23] 上听过她的演讲就在我的 Python PLN 里了。我最近报名了她的[Python 基础][24]课程以加深我的学习。Nina 推荐我将 [Kattni Rembor][25] 加入我的 Python PLN。他的[示例代码][26]正帮助我学习用 CircuitPython 编程。 + +### 我 PLN 中的其他资源 + +我在 PyCon 2019 也遇见了下属 [Opensource.com][27] 社区的主席 [Moshe Zadka][28] 并和他来了场长谈。他分享了几个新的 Python 资源,包括 _[如何像电脑科学家一样思考][29]_ 社区主席[Seth Kenlon][30] 是我的 PLN 中的另一名成员;他发表了许多优秀的 [Python 文章][31]我也推荐你关注他。 + +我的 Python每天都在继续扩大。除了我已经提到的,我同样推荐你关注 [Al Sweigart][32],[Eric Matthes][33],以及 [Adafruit][34] 因为他们分享优质内容。我也推荐这本书 _[制作:由 Adafruit Circuit Playground Express 开始][35]_ 和 [Podcast.__init__][36],一个关于 Python 社区的播客。这两个都是我从我的 PLN 中了解到的。 + +谁在你的 Python PLN 中?请在留言区分享你的最爱。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/resources-learning-python + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/reading_book_stars_list.png?itok=Iwa1oBOl (Book list, favorites) +[2]: https://en.wikipedia.org/wiki/Personal_learning_network +[3]: https://www.teachingpython.fm/hosts/kellypared +[4]: https://twitter.com/smtibor +[5]: https://www.teachingpython.fm/20 +[6]: https://us.pycon.org/2019/ +[7]: https://www.linkedin.com/in/betsywaliszewski +[8]: https://us.pycon.org/2019/events/letslearnpython/ +[9]: https://www.linkedin.com/in/kcunning/ +[10]: https://nostarch.com/pythonforkids +[11]: https://nostarch.com/programwithminecraft +[12]: https://nostarch.com/ +[13]: https://www.youtube.com/c/KatieCunningham +[14]: https://www.linkedin.com/in/natdunn/ +[15]: https://www.linkedin.com/in/sean-valentine-b370349b/ +[16]: https://www.webucator.com/ +[17]: http://www.hiddengeniusproject.org/ +[18]: https://us.pycon.org/2019/events/open-spaces/ +[19]: https://www.adafruit.com/product/3333 +[20]: https://github.com/adafruit/PyCon2019 +[21]: https://twitter.com/nnja +[22]: https://www.youtube.com/watch?v=35mXD40SvXM +[23]: https://allthingsopen.org/ +[24]: https://frontendmasters.com/courses/python/ +[25]: https://twitter.com/kattni +[26]: https://github.com/kattni/ChiPy_2018 +[27]: http://Opensource.com +[28]: https://opensource.com/users/moshez +[29]: http://openbookproject.net/thinkcs/python/english3e/ +[30]: https://opensource.com/users/seth +[31]: https://www.google.com/search?source=hp&ei=gVToXPq-FYXGsAW-mZ_YAw&q=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&oq=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&gs_l=psy-ab.12...627.15303..15584...1.0..0.176.2802.4j21......0....1..gws-wiz.....0..35i39j0j0i131j0i67j0i20i263.r2SAW3dxlB4 +[32]: http://alsweigart.com/ +[33]: https://twitter.com/ehmatthes?lang=en +[34]: https://twitter.com/adafruit +[35]: https://www.adafruit.com/product/3944 +[36]: https://www.pythonpodcast.com/episodes/ From 8bc3c68a126b045d76cf734993eb331f4df6e945 Mon Sep 17 00:00:00 2001 From: chen ni Date: Mon, 24 Jun 2019 12:55:27 +0800 Subject: [PATCH 1126/1154] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E5=8E=9F=E6=96=87=E6=97=B6=E7=B2=98=E8=B4=B4=E8=BF=87=E6=9D=A5?= =?UTF-8?q?=E7=9A=84=E5=B9=BF=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190416 Can schools be agile.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/tech/20190416 Can schools be agile.md b/sources/tech/20190416 Can schools be agile.md index adcd4f4117..9b45f2c430 100644 --- a/sources/tech/20190416 Can schools be agile.md +++ b/sources/tech/20190416 Can schools be agile.md @@ -57,8 +57,6 @@ Relentlessly pursuing methods of continuous improvement should not be a behavior I'm eagerly awaiting the day when I enter a school, recognize that spirit, and smile to myself as I say, "I've seen this before." -Experiential learning using open source is fraught with opportunities for disaster. - -------------------------------------------------------------------------------- via: https://opensource.com/open-organization/19/4/education-culture-agile From 6cea616f6fde93672a07ce055f57ac61a689d836 Mon Sep 17 00:00:00 2001 From: chen ni Date: Mon, 24 Jun 2019 12:58:48 +0800 Subject: [PATCH 1127/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190416 Can schools be agile.md | 56 +++++++++---------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/sources/tech/20190416 Can schools be agile.md b/sources/tech/20190416 Can schools be agile.md index 9b45f2c430..354490db5b 100644 --- a/sources/tech/20190416 Can schools be agile.md +++ b/sources/tech/20190416 Can schools be agile.md @@ -7,55 +7,51 @@ [#]: via: (https://opensource.com/open-organization/19/4/education-culture-agile) [#]: author: (Ben Owens https://opensource.com/users/engineerteacher/users/ke4qqq/users/n8chz/users/don-watkins) -Can schools be agile? +学校可以变得敏捷吗? ====== -We certainly don't need to run our schools like businesses—but we could -benefit from educational organizations more focused on continuous -improvement. +我们一定不会希望用商业的方式运作我们的学校 —— 但是更加注重持续改进的教育机构是可以让我们受益的。 ![][1] -We've all had those _deja vu_ moments that make us think "I've seen this before!" I experienced them often in the late 1980s, when I first began my career in industry. I was caught up in a wave of organizational change, where the U.S. manufacturing sector was experimenting with various models that asked leaders, managers, and engineers like me to rethink how we approached things like quality, cost, innovation, and shareholder value. It seems as if every year (sometimes, more frequently) we'd study yet another book to identify the "best practices" necessary for making us leaner, flatter, more nimble, and more responsive to the needs of the customer. +我们都有过那种感觉一件事情“似曾相识”的经历。在 1980 年代末期我经常会有这种感觉,那时候我刚刚进入工业领域不久。当时正赶上一波组织变革的热潮,美国制造业在尝试各种各样不同的模型,让企业领导、经理人和像我这样的工程师重新思考我们应该如何处理质量、成本、创新以及股东价值这样的问题。我们似乎每一年(有时候更加频繁)都需要通过学习一本书来找到让我们更精简、更扁平、更灵活以及更加能满足顾客需求的“最佳方案”。 -Many of the approaches were so transformational that their core principles still resonate with me today. Specific ideas and methods from thought leaders such as John Kotter, Peter Drucker, Edwards Demming, and Peter Senge were truly pivotal for our ability to rethink our work, as were the adoption of process improvement methods such as Six Sigma and those embodied in the "Toyota Way." +这里面的很多方法都带来了巨大的改进,我至今仍然赞同它们的核心原则。像 John Kotter、Peter Drucker、Edwards Demming 和 Peter Senge 这样的思想领袖提出的某些思想和策略,还有我们采用的像 Six Sigma 以及在“丰田模式”里可以找到的一些流程优化方法,对我们改进工作都起到了十分关键的作用。 -But others seemed to simply repackage these same ideas with a sexy new twist—hence my _deja vu_. +但是其他人似乎只是在同样的思想上进行了润色和调整,然后重新包装了一下 —— 所以我才会有那种 *似曾相识* 的感觉。但是当我成为了一名教师之后,我遇到了一个 *没有* 给我那种似曾相识的感觉的地方:教育界。事实上我十分惊讶地发现,在我的这个新职业里,“持续不断的改进”并 *不像* 在我之前的职业里那样重要了(特别是对于像我这种授课老师职级的人来说)。 -And yet when I began my career as a teacher, I encountered a context that _didn't_ give me that feeling: education. In fact, I was surprised to find that "getting better all the time" was _not_ the same high priority in my new profession that it was in my old one (particularly at the level of my role as a classroom teacher). +为什么教育机构很少努力营造一种不断改进的文化氛围呢?我能想到几个原因,在这里我列举两个。 -Why aren't more educational organizations working to create cultures of continuous improvement? I can think of several reasons, but let me address two. +### 不再做生产线上的元件 -### Widgets no more +这种不断改进的文化氛围遇到的第一个阻碍是,教育界普遍不愿意从其它行业借鉴可以为自己所用的思想 —— 特别是来自商界的思想。第二个阻碍是,主导教育界的仍然是一种自上而下的、等级制度森严的领导模式。人们往往只能在小范围哪讨论这种系统性的、持续的改进方案,比如包括校长、助理校长、学校监管人(LCTT 译注:美国地方政府下设的一种官职,每个学校监管人管理一定数量的学校,接受学校校长的汇报)等等在内的学校领导和区域领袖。但是一小群人的参与是远远不足以带来整个组织层面的文化改革的。 -The first barrier to a culture of continuous improvement is education's general reticence to look at other professions for ideas it can adapt and adopt—especially ideas from the business community. The second is education's predominant leadership model, which remains predominantly top-down and rooted in hierarchy. Conversations about systemic, continuous improvement tend to be the purview of a relatively small group of school or district leaders: principals, assistant principals, superintendents, and the like. But widespread organizational culture change can't occur if only one small group is involved in it. +在进一步展开观点之前,我想强调一下,上面所做的概括一定是存在例外情况 的(我自己就见到过很多),不过我觉得任何一个教育界的利益相关者都应该会同意以下两点基本假设: -Before unpacking these points a bit further, I'd like to emphasize that there are certainly exceptions to the above generalization (many I have seen first hand) and that there are two basic assumptions that I think any education stakeholder should be able to agree with: + 1. 为学生提供高质量的、公平的教育和教学系统的工作所涉及到的任何人都应该将持续不断的改进作为思维方式里的重要部分; + 2. 如果学校领导在做决策的时候可以更多地参考那些离学生最近的工作者的意见,那么学生以及学生所在的社区都将更加受益; - 1. Continuous improvement must be an essential mindset for _anyone_ involved in the work of providing high-quality and equitable teaching and learning systems for students, and - 2. Decisions by leaders of our schools will more greatly benefit students and the communities in which they live when those decisions are informed and influenced by those who work closest with students. +那么教育界人士为什么会倾向于忽视(或者公然地敌视)教育界之外的思想呢? + +比如我过去就曾经提议应该向别的行业借鉴一些思想和灵感来帮助我们更好地迎合学生的需求,并且果然遭到了批评。我经常得到的回应是:“你这是在把我们的学生当成生产线上的元件来对待呀!”但是我们的学生现在就是在被当作生产线上的元件对待,并且已经无以复加了。他们按照被年龄划分的群体考入大学,每天根据刺耳的铃声的指示去上一节又一节孤立的课程,并且由一些武断的、强调同一性而不是个性的考试来评判他们的成绩。 + +很多教育界人士可能不知道,生产线元件这种会让人想到流水线标准化作业的东西已经不是现代制造业里的重要组成部分了。得益于上面提到的不断改进的文化氛围,现代先进制造业已经可以做到在单个顾客产生需求的时候,以合理的价格有针对性地提供她所需要的商品。如果我们的学校也可以采用这种模式,教师们之间就更可能会产生协作,并且可以基于学生即时的需求和兴趣,不断完善每一个学生独特的成长和进步路线,而不受时间、课题或者其它传统规范的限制。 + +我并不是要呼吁大家像经营商业一样经营我们的学校。我所主张的是,用一种清晰而客观的态度去看待任何行业的任何思想,只要它们有可能帮助我们更好地迎合学生个体的需求。不过,如果想有效率地实现这个目标,我们需要仔细研究这个 100 多年来都停滞不前的领导结构。 +### 把不断改进作为努力的目标 -So why a tendency to ignore (or be outright hostile toward) ideas that come from outside the education space? +有一种说法认为教育和其它行业之间存在着巨大的差异,我虽然赞同这种说法,但同时也相信“重新思考组织和领导结构”这件事情对于任何一个希望对利益相关者负责(并且可以及时作出响应)的主体来说都是适用的。大多数其它行业都已经在重新审视它们传统的、封闭的、等级森严的结构,并且采用可以鼓励员工基于共有的优秀目标发挥自主性的组织结构 —— 这种组织结构对于不断改进来说十分关键。我们的学校和行政区是时候放开眼界了,而不应该拘泥于只听到来自内部的声音,因为它们的用意虽然是好的,但都没有脱离现有的范式。 -I, for example, have certainly faced criticism in the past for suggesting that we look to other professions for ideas and inspiration that can help us better meet the needs of students. A common refrain is something like: "You're trying to treat our students like widgets!" But how could our students be treated any more like widgets than they already are? They matriculate through school in age-based cohorts, going from siloed class to class each day by the sound of a shrill bell, and receive grades based on arbitrary tests that emphasize sameness over individuality. +对于任何希望开始或者加速这个转变过程的学校,我推荐一本很好的书:Jim Whitehurst 的《开放的组织》(这不应该让你感到意外)。这本书不仅可以帮助我们理解教育者如何创造更加开放、覆盖面更广的领导领导结构 —— 在这样的结构下,互相尊重让人们可以基于实时数据作出更加灵活的决策 —— 并且它所使用的语言风格也和教育者们所习惯使用的奇怪的词汇库非常契合(这种词汇库简直是教育者们第二天性)。任何组织都可以借鉴开放组织的思维提供的实用主义方法让组织成员更加开放:分享想法和资源、拥抱以共同协作为核心的文化、通过快速制作原型来开发创新思维、基于价值(而不是提出者的职级)来评估一个想法,以及创造一种融入到组织 DNA 里的很强的社区观念。通过众包的方式,这样的开放组织不仅可以从组织内部,也能够从组织外部收集想法,创造一种可以让本地化的、以学生为中心的创新蓬勃发展的环境。 -It may be news to many inside of education, but widgets—abstract units of production that evoke the idea of assembly line standardization—are not a significant part of the modern manufacturing sector. Thanks to the culture of continuous improvement described above, modern, advanced manufacturing delivers just what the individual customer wants, at a competitive price, exactly when she wants it. If we adapted this model to our schools, teachers would be more likely to collaborate and constantly refine their unique paths of growth for all students based on just-in-time needs and desires—regardless of the time, subject, or any other traditional norm. +最重要的事情是:在快速变化的未来,我们在过去所做的事情不一定仍然适用了 —— 认清楚这一点对于创造一个不断改进的文化氛围是十分关键的。对于教育者来说,这意味着我们不能只是简单地依赖在针对工厂模型发展出来的解决方案和实践方式了。我们必须从其它行业(比如说非营利组织、军事、医疗以及商业 —— 没错,甚至是商业)里借鉴数不清的最佳方案,这样至少应该能让我们*知道*如何找到让学生受益最大的办法。从教育界传统的陈词滥调里超脱出来,才有机会拥有更广阔的视角。我们可以更好地顾全大局,用更客观地视角看待我们遇到的问题,同时也知道我们在什么方面已经做得很不错。 -What I'm advocating is a clear-eyed and objective look at any idea from any sector with potential to help us better meet the needs of individual students, not that we somehow run our schools like businesses. In order for this to happen effectively, however, we need to scrutinize a leadership structure that has frankly remained stagnant for over 100 years. +通过有意识地借鉴各路思想 —— 从一年级教师到纽约时报上最新的商业、管理、领导力畅销书 —— 我们可以更好地发掘和运用校内人才,以帮助我们克服阻碍了我们的学校和区域进步的制度里的惰性。 -### Toward continuous improvement +坚持不懈地追求不断改进这件事情,不应该只局限于那种努力在一个全球化的、创新的经济环境中争取竞争力的机构,或者是负责运营学校的少数几个人。当机构里的每一个人都能不断思考怎样才能让今天比昨天做得更好的时候,这就是一个拥有优秀的文化氛围的机构。这种非常有注重协作性和创新的文化氛围,正是我们希望在这些负责改变年轻人命运的机构身上看到的。 -While I certainly appreciate the argument that education is an animal significantly different from other professions, I also believe that rethinking an organizational and leadership structure is an applicable exercise for any entity wanting to remain responsible (and responsive) to the needs of its stakeholders. Most other professions have taken a hard look at their traditional, closed, hierarchical structures and moved to ones that encourage collective autonomy per shared goals of excellence—organizational elements essential for continuous improvement. It's time our schools and districts do the same by expanding their horizon beyond sources that, while well intended, are developed from a lens of the current paradigm. -Not surprisingly, a go-to resource I recommend to any school wanting to begin or accelerate this process is _The Open Organization_ by Jim Whitehurst. Not only does the book provide a window into how educators can create more open, inclusive leadership structures—where mutual respect enables nimble decisions to be made per real-time data—but it does so in language easily adaptable to the rather strange lexicon that's second nature to educators. Open organization thinking provides pragmatic ways any organization can empower members to be more open: sharing ideas and resources, embracing a culture of collaborative participation as a top priority, developing an innovation mindset through rapid prototyping, valuing ideas based on merit rather than the rank of the person proposing them, and building a strong sense of community that's baked into the organization's DNA. Such an open organization crowd-sources ideas from both inside and outside its formal structure and creates the type of environment that enables localized, student-centered innovations to thrive. - -Here's the bottom line: Essential to a culture of continuous improvement is recognizing that what we've done in the past may not be suitable in a rapidly changing future. For educators, that means we simply can't rely on solutions and practices we developed in a factory-model paradigm. We must acknowledge countless examples of best practices from other sectors—such as non-profits, the military, the medical profession, and yes, even business—that can at least _inform_ how we rethink what we do in the best interest of students. By moving beyond the traditionally sanctioned "eduspeak" world, we create opportunities for considering perspectives. We can better see the forest for the trees, taking a more objective look at the problems we face, as well as acknowledging what we do very well. - -Intentionally considering ideas from all sources—from first year classroom teachers to the latest NYT Business & Management Leadership bestseller—offers us a powerful way to engage existing talent within our schools to help overcome the institutionalized inertia that has prevented more positive change from taking hold in our schools and districts. - -Relentlessly pursuing methods of continuous improvement should not be a behavior confined to organizations fighting to remain competitive in a global, innovation economy, nor should it be left to a select few charged with the operation of our schools. When everyone in an organization is always thinking about what they can do differently _today_ to improve what they did _yesterday_ , then you have an organization living a culture of excellence. That's the kind of radically collaborative and innovative culture we should especially expect for organizations focused on changing the lives of young people. - -I'm eagerly awaiting the day when I enter a school, recognize that spirit, and smile to myself as I say, "I've seen this before." +我非常期待,有朝一日我能在学校里感受到这种精神,然后微笑着对自己说:“这种感觉多么似曾相识啊。” -------------------------------------------------------------------------------- @@ -63,7 +59,7 @@ via: https://opensource.com/open-organization/19/4/education-culture-agile 作者:[Ben Owens][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[chen-ni](https://github.com/chen-ni) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1d9470cc17ae536fcc6829ed8df12413e8f1a239 Mon Sep 17 00:00:00 2001 From: chen ni Date: Mon, 24 Jun 2019 13:05:09 +0800 Subject: [PATCH 1128/1154] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190416 Can schools be agile.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20190416 Can schools be agile.md b/sources/tech/20190416 Can schools be agile.md index 354490db5b..83f051f11f 100644 --- a/sources/tech/20190416 Can schools be agile.md +++ b/sources/tech/20190416 Can schools be agile.md @@ -22,7 +22,7 @@ ### 不再做生产线上的元件 -这种不断改进的文化氛围遇到的第一个阻碍是,教育界普遍不愿意从其它行业借鉴可以为自己所用的思想 —— 特别是来自商界的思想。第二个阻碍是,主导教育界的仍然是一种自上而下的、等级制度森严的领导模式。人们往往只能在小范围哪讨论这种系统性的、持续的改进方案,比如包括校长、助理校长、学校监管人(LCTT 译注:美国地方政府下设的一种官职,每个学校监管人管理一定数量的学校,接受学校校长的汇报)等等在内的学校领导和区域领袖。但是一小群人的参与是远远不足以带来整个组织层面的文化改革的。 +这种不断改进的文化氛围遇到的第一个阻碍是,教育界普遍不愿意从其它行业借鉴可以为自己所用的思想 —— 特别是来自商界的思想。第二个阻碍是,主导教育界的仍然是一种自上而下的、等级制度森严的领导模式。人们往往只能在小范围内讨论这种系统性的、持续的改进方案,比如包括校长、助理校长、学校监管人(LCTT 译注:美国地方政府下设的一种官职,每个学校监管人管理一定数量的学校,接受学校校长的汇报)等等在内的学校领导和区域领袖。但是一小群人的参与是远远不足以带来整个组织层面的文化改革的。 在进一步展开观点之前,我想强调一下,上面所做的概括一定是存在例外情况 的(我自己就见到过很多),不过我觉得任何一个教育界的利益相关者都应该会同意以下两点基本假设: @@ -33,7 +33,7 @@ 比如我过去就曾经提议应该向别的行业借鉴一些思想和灵感来帮助我们更好地迎合学生的需求,并且果然遭到了批评。我经常得到的回应是:“你这是在把我们的学生当成生产线上的元件来对待呀!”但是我们的学生现在就是在被当作生产线上的元件对待,并且已经无以复加了。他们按照被年龄划分的群体考入大学,每天根据刺耳的铃声的指示去上一节又一节孤立的课程,并且由一些武断的、强调同一性而不是个性的考试来评判他们的成绩。 -很多教育界人士可能不知道,生产线元件这种会让人想到流水线标准化作业的东西已经不是现代制造业里的重要组成部分了。得益于上面提到的不断改进的文化氛围,现代先进制造业已经可以做到在单个顾客产生需求的时候,以合理的价格有针对性地提供她所需要的商品。如果我们的学校也可以采用这种模式,教师们之间就更可能会产生协作,并且可以基于学生即时的需求和兴趣,不断完善每一个学生独特的成长和进步路线,而不受时间、课题或者其它传统规范的限制。 +很多教育界人士可能不知道,生产线元件这种会让人想到流水线标准化作业的东西已经不是现代制造业里的重要组成部分了。得益于上面提到的不断改进的文化氛围,现代先进制造业已经可以做到在单个顾客产生需求的时候,以合理的价格有针对性地提供她所需要的商品。如果我们的学校也可以采用这种模式,教师们之间就更可能会进行协作,并且可以基于学生即时的需求和兴趣,不断完善每一个学生独特的成长和进步路线,而不受时间、课题或者其它传统规范的限制。 我并不是要呼吁大家像经营商业一样经营我们的学校。我所主张的是,用一种清晰而客观的态度去看待任何行业的任何思想,只要它们有可能帮助我们更好地迎合学生个体的需求。不过,如果想有效率地实现这个目标,我们需要仔细研究这个 100 多年来都停滞不前的领导结构。 @@ -44,7 +44,7 @@ 对于任何希望开始或者加速这个转变过程的学校,我推荐一本很好的书:Jim Whitehurst 的《开放的组织》(这不应该让你感到意外)。这本书不仅可以帮助我们理解教育者如何创造更加开放、覆盖面更广的领导领导结构 —— 在这样的结构下,互相尊重让人们可以基于实时数据作出更加灵活的决策 —— 并且它所使用的语言风格也和教育者们所习惯使用的奇怪的词汇库非常契合(这种词汇库简直是教育者们第二天性)。任何组织都可以借鉴开放组织的思维提供的实用主义方法让组织成员更加开放:分享想法和资源、拥抱以共同协作为核心的文化、通过快速制作原型来开发创新思维、基于价值(而不是提出者的职级)来评估一个想法,以及创造一种融入到组织 DNA 里的很强的社区观念。通过众包的方式,这样的开放组织不仅可以从组织内部,也能够从组织外部收集想法,创造一种可以让本地化的、以学生为中心的创新蓬勃发展的环境。 -最重要的事情是:在快速变化的未来,我们在过去所做的事情不一定仍然适用了 —— 认清楚这一点对于创造一个不断改进的文化氛围是十分关键的。对于教育者来说,这意味着我们不能只是简单地依赖在针对工厂模型发展出来的解决方案和实践方式了。我们必须从其它行业(比如说非营利组织、军事、医疗以及商业 —— 没错,甚至是商业)里借鉴数不清的最佳方案,这样至少应该能让我们*知道*如何找到让学生受益最大的办法。从教育界传统的陈词滥调里超脱出来,才有机会拥有更广阔的视角。我们可以更好地顾全大局,用更客观地视角看待我们遇到的问题,同时也知道我们在什么方面已经做得很不错。 +最重要的事情是:在快速变化的未来,我们在过去所做的事情不一定仍然适用了 —— 认清楚这一点对于创造一个不断改进的文化氛围是十分关键的。对于教育者来说,这意味着我们不能只是简单地依赖在针对工厂模型发展出来的解决方案和实践方式了。我们必须从其它行业(比如说非营利组织、军事、医疗以及商业 —— 没错,甚至是商业)里借鉴数不清的最佳方案,这样至少应该能让我们 *知道* 如何找到让学生受益最大的办法。从教育界传统的陈词滥调里超脱出来,才有机会拥有更广阔的视角。我们可以更好地顾全大局,用更客观地视角看待我们遇到的问题,同时也知道我们在什么方面已经做得很不错。 通过有意识地借鉴各路思想 —— 从一年级教师到纽约时报上最新的商业、管理、领导力畅销书 —— 我们可以更好地发掘和运用校内人才,以帮助我们克服阻碍了我们的学校和区域进步的制度里的惰性。 From a155f2ba5eb6244d6f964d6396caebfde2e02842 Mon Sep 17 00:00:00 2001 From: chen ni Date: Mon, 24 Jun 2019 13:05:46 +0800 Subject: [PATCH 1129/1154] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {sources => translated}/tech/20190416 Can schools be agile.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190416 Can schools be agile.md (100%) diff --git a/sources/tech/20190416 Can schools be agile.md b/translated/tech/20190416 Can schools be agile.md similarity index 100% rename from sources/tech/20190416 Can schools be agile.md rename to translated/tech/20190416 Can schools be agile.md From 4b87f145e154dbe1839c2949f47eafc12dd6dc46 Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Mon, 24 Jun 2019 16:58:36 +0800 Subject: [PATCH 1130/1154] Update 20190111 Top 5 Linux Distributions for Productivity.md --- ... 5 Linux Distributions for Productivity.md | 65 +++++++++---------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md index 5bbae53e33..40f5d63791 100644 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md @@ -29,69 +29,68 @@ * 教育: 适于那些需要桌面发行版可以助力他们在教育领域更创造力的人们。 +诚然,有很多很多类别的发行版可供挑选,其中的很多可能用起来十分得心应手,但这五种或许是你最为需要的。 -Yes, there are more categories to be had, many of which can get very niche-y, but these five should fill most of your needs. +### 普通生产力 -### General Productivity +对普通的生产力诉求来说,你不会找到比 [Ubuntu][1] 更为高效的了。在这个类别中首推 Ubuntu 最基础的原因是因为它实现了桌面操作系统、软件、服务的无缝集成。你可能会问为什么我不选择同类别的 Linux Mint 呢?因为 Ubuntu 现在默认的的桌面环境为 GNOME 桌面,而它拥有 GNOME 许多扩展程序的优势的加成(图 1)。 -For general productivity, you won’t get much more efficient than [Ubuntu][1]. The primary reason for choosing Ubuntu for this category is the seamless integration of apps, services, and desktop. You might be wondering why I didn’t choose Linux Mint for this category? Because Ubuntu now defaults to the GNOME desktop, it gains the added advantage of GNOME Extensions (Figure 1). ![GNOME Clipboard][3] -Figure 1: The GNOME Clipboard Indicator extension in action. +图 1:运行中的 GNOME 桌面的剪切板管理工具。 -[Used with permission][4] +[经许可使用][4] -These extensions go a very long way to aid in boosting productivity (so Ubuntu gets the nod over Mint). But Ubuntu didn’t just accept a vanilla GNOME desktop. Instead, they tweaked it to make it slightly more efficient and user-friendly, out of the box. And because Ubuntu contains just the right mixture of default, out-of-the-box, apps (that just work), it makes for a nearly perfect platform for productivity. +这些扩展程序在提升生产力方面做了很多努力(所以 Ubuntu 比 Linux Mint 获得了更多的认可)。但是 Ubuntu 不仅仅支持 vanilla 版本的 GNOME 桌面。事实上,他们致力于将它改进的更为轻量化、更为高效、以及用户友好度更高、开箱即用。总而言之,由于 Ubuntu 正确的融合了多种特性,开箱即用,完善的软件支持(仅对工作方面而言),这些特性使它几乎成为了生产力领域最为完美的一个平台。 -Whether you need to write a paper, work on a spreadsheet, code a new app, work on your company website, create marketing images, administer a server or network, or manage human resources from within your company HR tool, Ubuntu has you covered. The Ubuntu desktop distribution also doesn’t require the user to jump through many hoops to get things working … it simply works (and quite well). Finally, thanks to it’s Debian base, Ubuntu makes installing third-party apps incredibly easy. +不管你是要写一篇文档,制作一张电子表格,写一个新的软件,开啊公司的网站,设计商用的图形,管理一个服务器或是网络,抑或是在你的公司内从事人力资源管理工作, Ubuntu 都可以满足你的需求。Ubuntu 桌面发行版也并不要求你耗费很大的精力才能开始开始开展工作…他只是纯粹的工作(并且十分优秀)。最后,得益于 Debian 的基础,使得 Ubuntu 上安装第三方的软件十分简便。 -Although Ubuntu tends to be the go-to for nearly every list of “top distributions for X,” it’s very hard to argue against this particular distribution topping the list of general productivity distributions. +很难反对这一特殊的发行版在生产力发行版列表中独占鳌头,尽管 Ubuntu 几乎已经成为几乎所有“顶级发行版”列表的榜首。 -### Graphic Design +### 平面设计 -If you’re looking to up your graphic design productivity, you can’t go wrong with [Fedora Design Suite][5]. This Fedora respin was created by the team responsible for all Fedora-related art work. Although the default selection of apps isn’t a massive collection of tools, those it does include are geared specifically for the creation and manipulation of images. +如果你正在寻求提升你的平面设计效率,你不能错过[Fedora设计套件][5]。这一 Fedora 的衍生版是由负责 Fedora 艺术类项目的团队亲自操刀制作的。虽然默认选择的应用程序并不是一个庞大的工具集合,但它所包含的工具都是创建和处理图像专用的。 -With apps like GIMP, Inkscape, Darktable, Krita, Entangle, Blender, Pitivi, Scribus, and more (Figure 2), you’ll find everything you need to get your image editing jobs done and done well. But Fedora Design Suite doesn’t end there. This desktop platform also includes a bevy of tutorials that cover countless subjects for many of the installed applications. For anyone trying to be as productive as possible, this is some seriously handy information to have at the ready. I will say, however, the tutorial entry in the GNOME Favorites is nothing more than a link to [this page][6]. +有了GIMP、Inkscape、Darktable、Krita、Entangle、Blender、Pitivi、Scribus等应用程序(图 2),您将发现完成图像编辑工作所需要的一切都已经准备好了,而且准备得很好。但是Fedora设计套件并不仅限于此。这个桌面平台还包括一堆教程,涵盖了许多已安装的应用程序。对于任何想要尽可能提高效率的人来说,这将是一些非常有用的信息。不过,我要说的是,GNOME Favorites中的教程不过是[此页][6]链接的内容。 ![Fedora Design Suite Favorites][8] -Figure 2: The Fedora Design Suite Favorites menu includes plenty of tools for getting your graphic design on. +图 2: Fedora Design Suite Favorites菜单包含了许多工具,可以让您用于图形设计。 -[Used with permission][4] +[经许可使用][4] -Those that work with a digital camera will certainly appreciate the inclusion of the Entangle app, which allows you to control your DSLR from the desktop. +那些使用数码相机的用户肯定会喜欢Entangle应用程序,它可以让你在电脑上上控制单反相机。 -### Development +### 开发人员 -Nearly all Linux distributions are great platforms for programmers. However, one particular distributions stands out, above the rest, as one of the most productive tools you’ll find for the task. That OS comes from [System76][9] and it’s called [Pop!_OS][10]. Pop!_OS is tailored specifically for creators, but not of the artistic type. Instead, Pop!_OS is geared toward creators who specialize in developing, programming, and making. If you need an environment that is not only perfected suited for your development work, but includes a desktop that’s sure to get out of your way, you won’t find a better option than Pop!_OS (Figure 3). +几乎所有的Linux发行版对于程序员来说都是很好的编程平台。然而,有一种特定的发行版脱颖而出,并超越了其他发行版,它将是您见过的用于编程类最有效率的工具之一。这个操作系统来自[System76][9](译注:一家美国的计算机制造商),名为[Pop!_OS][10]。Pop!_OS是专门为创作者定制的,但不是针对艺术类。相反,Pop!_OS面向专门从事开发、编程和软件制作的程序员。如果您需要一个既能完美的胜任开发平台又包含桌面操作系统的开发环境,Pop!_OS 将会是您的不二选择。 (图 3) -What might surprise you (given how “young” this operating system is), is that Pop!_OS is also one of the single most stable GNOME-based platforms you’ll ever use. This means Pop!_OS isn’t just for creators and makers, but anyone looking for a solid operating system. One thing that many users will greatly appreciate with Pop!_OS, is that you can download an ISO specifically for your video hardware. If you have Intel hardware, [download][10] the version for Intel/AMD. If your graphics card is NVIDIA, download that specific release. Either way, you are sure go get a solid platform for which to create your masterpiece. +可能会让您感到惊讶(考虑到这个操作系统是多么“年轻”)的是Pop!_OS也是您使用过的基于 GNOME平台的最稳定系统的之一。这意味着 Pop!_OS 不只是为创造者和制造者准备的,也是为任何想要一个可靠的操作系统的人准备的。你可以下载针对你的硬件的专门 ISO 文件,这一点是许多用户十分欣赏的。如果你有英特尔硬件,[下载][10]Intel或AMD的版本。如果您的显卡是NVIDIA,请下载该特定版本。不管怎样,您肯定会得到针对不同平台进行特殊定制的稳定的版本。 ![Pop!_OS][12] -Figure 3: The Pop!_OS take on GNOME Overview. +图 3: 装有 GNOME 桌面的 Pop!_OS 一览。 -[Used with permission][4] +[经许可使用][4] -Interestingly enough, with Pop!_OS, you won’t find much in the way of pre-installed development tools. You won’t find an included IDE, or many other dev tools. You can, however, find all the development tools you need in the Pop Shop. +有趣的是,在 Pop!_OS 中,您不会找到太多预装的开发工具。你也不会找到IDE或许多其他开发工具。但是,您可以在Pop 商店中中找到所需的所有开发工具。 -### Administration - -If you’re looking to find one of the most productive distributions for admin tasks, look no further than [Debian][13]. Why? Because Debian is not only incredibly reliable, it’s one of those distributions that gets out of your way better than most others. Debian is the perfect combination of ease of use and unlimited possibility. On top of which, because this is the distribution for which so many others are based, you can bet if there’s an admin tool you need for a task, it’s available for Debian. Of course, we’re talking about general admin tasks, which means most of the time you’ll be using a terminal window to SSH into your servers (Figure 4) or a browser to work with web-based GUI tools on your network. Why bother making use of a desktop that’s going to add layers of complexity (such as SELinux in Fedora, or YaST in openSUSE)? Instead, chose simplicity. +### 管理人员 +如果你正在寻找适合管理领域的最生产力的发行版本,[Debian][13]将会是你的不二之选。为什么这么说呢?因为 Debian 不仅仅拥有无与伦比的可靠性,它也是众多能从苦海中将你解救出来的最好的一个版本。Debian是易用性和无限可能性的完美结合。最重要的是,因为它是许多其他发行版的基础,所以可以打赌的是,如果您需要一个任务的管理工具,那么它一定支持 Debian 系统。当然,我们讨论的是一般管理任务,这意味着大多数时候您需要使用终端窗口 SSH 连接到服务器(图4),或者在浏览器上使用网络上基于web的GUI工具。既然如此为什么还要使用一个复杂的桌面呢(比如Fedora中的SELinux或openSUSE中的YaST)呢?所以,应选择更为简洁易用的那一种。 ![Debian][15] -Figure 4: SSH’ing into a remote server on Debian. +图 4: 在 Debian 系统上通过SSH 连接到远程服务器。 -[Used with permission][4] +[经授权使用][4] -And because you can select which desktop you want (from GNOME, Xfce, KDE, Cinnamon, MATE, LXDE), you can be sure to have the interface that best matches your work habits. +你可以选择你想要的不同的桌面(包括GNOME, Xfce, KDE, Cinnamon, MATE, LXDE),确保你所使用的桌面外观最适合你的工作习惯。 ### 教育 -如果你是一名老师或者学生,抑或是其他从事与教育相关工作的人士,你需要适当的工具来变得更具创造力。之前,有 Edubuntu 这样的版本。这一版本从未跌出教育类相关发行版排名的前列。然而,自从 Ubuntu 14.04 版之后这一发行版就再也没有更新。还好,现在有一款基于 openSUSE 的新的以教育为基础的发行版有望夺摘得桂冠。这一改版叫做 [openSUSE:Education-Li-f-e][16] (Linux For Education - Figure 5), 它基于 openSUSE Leap 42.1 (所以它可能稍微有一点过时)。 +如果你是一名老师或者学生,抑或是其他从事与教育相关工作的人士,你需要适当的工具来变得更具创造力。之前,有 Edubuntu 这样的版本。这一版本位列教育类相关发行版排名的前列。然而,自从 Ubuntu 14.04 版之后这一发行版就再也没有更新。还好,现在有一款基于 openSUSE 的新的以教育为基础的发行版有望夺摘得桂冠。这一改版叫做 [openSUSE:Education-Li-f-e][16] (Linux For Education - 图 5), 它基于 openSUSE Leap 42.1 (所以它可能稍微有一点过时)。 openSUSE:Education-Li-f-e 包含了一下工具: @@ -119,20 +118,20 @@ openSUSE:Education-Li-f-e 包含了一下工具: * GIMP - 图像处理软件(译注:被誉为 Linux 上的 PhotoShop) - * Pencil - GUI prototyping tool + * Pencil - GUI 模型制作工具 * Hugin - 全景照片拼接及 HDR 效果混合软件 ![Education][18] -Figure 5: The openSUSE:Education-Li-f-e distro has plenty of tools to help you be productive in or for school. +图 5: openSUSE:Education-Li-f-e 发行版拥有大量的工具可以帮你在学校中变得更为高效。 -[Used with permission][4] +[经许可使用][4] -Also included with openSUSE:Education-Li-f-e is the [KIWI-LTSP Server][19]. The KIWI-LTSP Server is a flexible, cost effective solution aimed at empowering schools, businesses, and organizations all over the world to easily install and deploy desktop workstations. Although this might not directly aid the student to be more productive, it certainly enables educational institutions be more productive in deploying desktops for students to use. For more information on setting up KIWI-LTSP, check out the openSUSE [KIWI-LTSP quick start guide][20]. +同时还集成在 openSUSE:Education-Li-f-e 中的还有 [KIWI-LTSP Server][19] 。Also included with openSUSE:Education-Li-f-e is the [KIWI-LTSP Server][19]. KIWI-LTSP KIWI-LTSP服务器是一个灵活的、成本有效的解决方案,旨在使全世界的学校、企业和组织能够轻松地安装和部署桌面工作站。虽然这可能不会直接帮助学生变得更具创造力,但它肯定会使教育机构在部署供学生使用的桌面时更有效率。有关配置 KIWI-LTSP 的更多信息,请查看openSUSE [KIWI-LTSP quick start guide][20]. -Learn more about Linux through the free ["Introduction to Linux"][21]course from The Linux Foundation and edX. +通过 Linux 基金会和 edX 的免费["入门介绍"][21]课程来了解更多关于 Linux 的知识。 -------------------------------------------------------------------------------- @@ -140,7 +139,7 @@ via: https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productiv 作者:[Jack Wallen][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[qfzy1233](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fc08149d062103335c034901f853d1db14d737b5 Mon Sep 17 00:00:00 2001 From: qfzy1233 Date: Mon, 24 Jun 2019 17:04:03 +0800 Subject: [PATCH 1131/1154] Rename sources/tech/20190111 Top 5 Linux Distributions for Productivity.md to translated/tech/20190111 Top 5 Linux Distributions for Productivity.md --- .../tech/20190111 Top 5 Linux Distributions for Productivity.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190111 Top 5 Linux Distributions for Productivity.md (100%) diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/translated/tech/20190111 Top 5 Linux Distributions for Productivity.md similarity index 100% rename from sources/tech/20190111 Top 5 Linux Distributions for Productivity.md rename to translated/tech/20190111 Top 5 Linux Distributions for Productivity.md From 8ad00bd28e3fbcc3cc7bb45ebb82ced71240b61a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Jun 2019 21:13:54 +0800 Subject: [PATCH 1132/1154] translate done: 20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md --- ... Tray Indicator For Your Tasks on Linux.md | 187 ------------------ ... Tray Indicator For Your Tasks on Linux.md | 187 ++++++++++++++++++ 2 files changed, 187 insertions(+), 187 deletions(-) delete mode 100644 sources/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md create mode 100644 translated/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md diff --git a/sources/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md b/sources/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md deleted file mode 100644 index d9d42b7a2f..0000000000 --- a/sources/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md +++ /dev/null @@ -1,187 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Create a Custom System Tray Indicator For Your Tasks on Linux) -[#]: via: (https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux) -[#]: author: (M.Hanny Sabbagh https://fosspost.org/author/mhsabbagh) - -Create a Custom System Tray Indicator For Your Tasks on Linux -====== - -System Tray icons are still considered to be an amazing functionality today. By just right-clicking on the icon, and then selecting which actions you would like to take, you may ease your life a lot and save many unnecessary clicks on daily basis. - -When talking about useful system tray icons, examples like Skype, Dropbox and VLC do come to mind: - -![Create a Custom System Tray Indicator For Your Tasks on Linux 11][1] - -However, system tray icons can actually be quite a lot more useful; By simply building one yourself for your own needs. In this tutorial, we’ll explain how to do that for you in very simple steps. - -### Prerequisites - -We are going to build a custom system tray indicator using Python. Python is probably installed by default on all the major Linux distributions, so just check it’s there (version 2.7). Additionally, we’ll need the gir1.2-appindicator3 package installed. It’s the library allowing us to easily create system tray indicators. - -To install it on Ubuntu/Mint/Debian: - -``` -sudo apt-get install gir1.2-appindicator3 -``` - -On Fedora: - -``` -sudo dnf install libappindicator-gtk3 -``` - -For other distributions, just search for any packages containing appindicator. - -On GNOME Shell, system tray icons are removed starting from 3.26. You’ll need to install the [following extension][2] (Or possibly other extensions) to re-enable the feature on your desktop. Otherwise, you won’t be able to see the indicator we are going to create here. - -### Basic Code - -Here’s the basic code of the indicator: - -``` -#!/usr/bin/python -import os -from gi.repository import Gtk as gtk, AppIndicator3 as appindicator - -def main(): - indicator = appindicator.Indicator.new("customtray", "semi-starred-symbolic", appindicator.IndicatorCategory.APPLICATION_STATUS) - indicator.set_status(appindicator.IndicatorStatus.ACTIVE) - indicator.set_menu(menu()) - gtk.main() - -def menu(): - menu = gtk.Menu() - - command_one = gtk.MenuItem('My Notes') - command_one.connect('activate', note) - menu.append(command_one) - - exittray = gtk.MenuItem('Exit Tray') - exittray.connect('activate', quit) - menu.append(exittray) - - menu.show_all() - return menu - -def note(_): - os.system("gedit $HOME/Documents/notes.txt") - -def quit(_): - gtk.main_quit() - -if __name__ == "__main__": - main() -``` - -We’ll explain how the code works later. But for know, just save it in a text file under the name tray.py, and run it using Python: - -``` -python tray.py -``` - -You’ll see the indicator working as follows: - -![Create a Custom System Tray Indicator For Your Tasks on Linux 13][3] - -Now, to explain how we did the magic: - - * The first 3 lines of the code are nothing more than just specifying the Python path and importing the libraries we are going to use in our indicator. - - * def main() : This is the main function of the indicator. Under it we write the code to initialize and build the indicator. - - * indicator = appindicator.Indicator.new(“customtray”, “semi-starred-symbolic”, appindicator.IndicatorCategory.APPLICATION_STATUS) : Here we are specially creating a new indicator and calling it `customtray` . This is the special name of the indicator so that the system doesn’t mix it with other indicators that may be running. Also, we used the `semi-starred-symbolic` icon name as the default icon for our indicator. You could possibly change thing to any other things; Say `firefox` (if you want to see Firefox icon being used for the indicator), or any other icon name you would like. The last part regarding the `APPLICATION_STATUS` is just ordinary code for the categorization/scope of that indicator. - - * `indicator.set_status(appindicator.IndicatorStatus.ACTIVE)` : This line just turns the indicator on. - - * `indicator.set_menu(menu())` : Here, we are saying that we want to use the `menu()` function (which we’ll define later) for creating the menu items of our indicator. This is important so that when you click on the indicator, you can see a list of possible actions to take. - - * `gtk.main()` : Just run the main GTK loop. - - * Under `menu()` you’ll see that we are creating the actions/items we want to provide using our indicator. `command_one = gtk.MenuItem(‘My Notes’)` simply initializes the first menu item with the text “My notes”, and then `command_one.connect(‘activate’, note)` connects the `activate` signal of that menu item to the `note()` function defined later; In other words, we are telling our system here: “When this menu item is clicked, run the note() function”. Finally, `menu.append(command_one)` adds that menu item to the list. - - * The lines regarding `exittray` are just for creating an exit menu item to close the indicator any time you want. - - * `menu.show_all()` and `return menu` are just ordinary codes for returning the menu list to the indicator. - - * Under `note(_)` you’ll see the code that must be executed when the “My Notes” menu item is clicked. Here, we just wrote `os.system(“gedit $HOME/Documents/notes.txt”)` ; The `os.system` function is a function that allows us to run shell commands from inside Python, so here we wrote a command to open a file called `notes.txt` under the `Documents` folder in our home directory using the `gedit` editor. This for example can be your daily notes taking program from now on! - -### Adding your Needed Tasks - -There are only 2 things you need to touch in the code: - - 1. Define a new menu item under `menu()` for your desired task. - - 2. Create a new function to run a specific action when that menu item is clicked. - - -So, let’s say that you want to create a new menu item, which when clicked, plays a specific video/audio file on your hard disk using VLC? To do it, simply add the following 3 lines in line 17: - -``` -command_two = gtk.MenuItem('Play video/audio') -command_two.connect('activate', play) -menu.append(command_two) -``` - -And the following lines in line 30: - -``` -def play(_): - os.system("vlc /home//Videos/somevideo.mp4") -``` - -Replace /home//Videos/somevideo.mp4 with the path to the video/audio file you want. Now save the file and run the indicator again: - -``` -python tray.py -``` - -This is how you’ll see it now: - -![Create a Custom System Tray Indicator For Your Tasks on Linux 15][4] - -And when you click on the newly-created menu item, VLC will start playing! - -To create other items/tasks, simply redo the steps again. Just be careful to replace command_two with another name, like command_three, so that no clash between variables happen. And then define new separate functions like what we did with the play(_) function. - -The possibilities are endless from here; I am using this way for example to fetch some data from the web (using the urllib2 library) and display them for me any time. I am also using it for playing an mp3 file in the background using the mpg123 command, and I am defining another menu item to killall mpg123 to stop playing that audio whenever I want. CS:GO on Steam for example takes a huge time to exit (the window doesn’t close automatically), so as a workaround for this, I simply minimize the window and click on a menu item that I created which will execute killall -9 csgo_linux64. - -You can use this indicator for anything: Updating your system packages, possibly running some other scripts any time you want.. Literally anything. - -### Autostart on Boot - -We want our system tray indicator to start automatically on boot, we don’t want to run it manually each time. To do that, simply add the following command to your startup applications (after you replace the path to the tray.py file with yours): - -``` -nohup python /home//tray.py & -``` - -The very next time you reboot your system, the indicator will start working automatically after boot! - -### Conclusion - -You now know how to create your own system tray indicator for any task that you may want. This method should save you a lot of time depending on the nature and number of tasks you need to run on daily basis. Some users may prefer creating aliases from the command line, but this will require you to always open the terminal window or have a drop-down terminal emulator available, while here, the system tray indicator is always working and available for you. - -Have you used this method to run your tasks before? Would love to hear your thoughts. - - --------------------------------------------------------------------------------- - -via: https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux - -作者:[M.Hanny Sabbagh][a] -选题:[lujun9972][b] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fosspost.org/author/mhsabbagh -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/Screenshot-at-2019-02-28-0808.png?resize=407%2C345&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 12) -[2]: https://extensions.gnome.org/extension/1031/topicons/ -[3]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/03/Screenshot-at-2019-03-02-1041.png?resize=434%2C140&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 14) -[4]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/03/Screenshot-at-2019-03-02-1141.png?resize=440%2C149&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 16) diff --git a/translated/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md b/translated/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md new file mode 100644 index 0000000000..a3efed0db0 --- /dev/null +++ b/translated/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md @@ -0,0 +1,187 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create a Custom System Tray Indicator For Your Tasks on Linux) +[#]: via: (https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux) +[#]: author: (M.Hanny Sabbagh https://fosspost.org/author/mhsabbagh) + +在 Linux 上为你的任务创建一个自定义的系统托盘指示器 +====== + +时至今日系统托盘图标依然很有用。只需要右击图标,然后选择想要的动作即可,你可以大幅简化你的生活并且减少日常行为中的大量无用的点击。 + +一说到有用的系统托盘图标,我们很容易就想到 Skype,Dropbox 和 VLC: + +![Create a Custom System Tray Indicator For Your Tasks on Linux 11][1] + +然而系统托盘图标实际上要更有用得多; 你可以根据自己的需求创建自己的系统托盘图标。本指导将会教你通过简单的几个步骤来实现这一目的。 + +### 前置条件 + +我们将要用 Python 来实现一个自定义的系统托盘指示器。Python 默认在所有主流的 Linux 发行版中都有安装,因此你只需要确定一下它已经确实被安装好了(版本为 2.7)。另外,我们还需要安装好 gir1.2-appindicator3 包。该库能够让我们很容易就能创建系统图标指示器。 + +在 Ubuntu/Mint/Debian 上安装: + +``` +sudo apt-get install gir1.2-appindicator3 +``` + +在 Fedora 上安装: + +``` +sudo dnf install libappindicator-gtk3 +``` + +对于其他发行版,只需要搜索包含 appindicator 的包就行了。 + +在 GNOME Shell 3.26 开始,系统托盘图标被删除了。你需要安装 [这个扩展 ][2] (或者其他扩展) 来为桌面启用该功能。否则你无法看到我们创建的指示器。 + +### 基础代码 + +下面是指示器的基础代码: + +``` +#!/usr/bin/python +import os +from gi.repository import Gtk as gtk, AppIndicator3 as appindicator + +def main(): + indicator = appindicator.Indicator.new("customtray", "semi-starred-symbolic", appindicator.IndicatorCategory.APPLICATION_STATUS) + indicator.set_status(appindicator.IndicatorStatus.ACTIVE) + indicator.set_menu(menu()) + gtk.main() + +def menu(): + menu = gtk.Menu() + + command_one = gtk.MenuItem('My Notes') + command_one.connect('activate', note) + menu.append(command_one) + + exittray = gtk.MenuItem('Exit Tray') + exittray.connect('activate', quit) + menu.append(exittray) + + menu.show_all() + return menu + +def note(_): + os.system("gedit $HOME/Documents/notes.txt") + +def quit(_): + gtk.main_quit() + +if __name__ == "__main__": + main() +``` + +我们待会会解释一下代码是怎么工作的。但是现在,让我们将该文本保存为 tray.py,然后使用 Python 运行之: + +``` +python tray.py +``` + +我们会看到指示器运行起来了,如下图所示: + +![Create a Custom System Tray Indicator For Your Tasks on Linux 13][3] + +现在,让我们解释一下魔术的原理: + + * 前三行代码仅仅用来指明 Python 的路径并且导入需要的库。 + + * def main() : 此为指示器的主函数。该函数的代码用来初始化并创建指示器。 + + * indicator = appindicator.Indicator.new(“customtray”,“semi-starred-symbolic”,appindicator.IndicatorCategory.APPLICATION_STATUS) : 这里我们指明创建一个名为 `customtray` 的指示器。这是指示器的唯一名称这样系统就不会与其他运行中的指示器搞混了。同时我们使用名为 `semi-starred-symbolic` 的图标作为指示器的默认图标。你可以将之改成任何其他值; 比如 `firefox` (如果你希望该指示器使用 FireFox 的图标),或任何其他希望的图标名。最后与 `APPLICATION_STATUS` 相关的部分是指明指示器类别/范围的常规代码。 + + * `indicator.set_status(appindicator.IndicatorStatus.ACTIVE)` : 这一行激活指示器。 + + * `indicator.set_menu(menu())` : 这里我的是我们想使用 `menu()` 函数 (我们会在后面定义) 来为我们的指示器创建菜单项。这很重要,可以让你右击指示器后看到一个可以实施行为的列别。 + + * `gtk.main()` : 运行 GTK 主循环。 + + * 在 `menu()` 中我们定义了想要指示器提供的行为或项目。`command_one = gtk.MenuItem(‘My Notes’)` 仅仅使用文本 “My notes” 来初始化第一个菜单项,接下来 `command_one.connect(‘activate’,note)` 将菜单的 `activate` 信号与后面定义的 `note()` 函数相连接; 换句话说,我们告诉我们的系统:“当该菜单项被点击,运行 note() 函数”。最后,`menu.append(command_one)` 将菜单项添加到列表中。 + + * `exittray` 相关的行是为了创建一个退出的菜单项让你在想要的时候关闭指示器。 + + * `menu.show_all()` 以及 `return menu` 只是返回菜单项给指示器的常规代码。 + + * 在 `note(_)` 下面是点击 “My Notes” 菜单项时需要执行的代码。这里只是 `os.system(“gedit $HOME/Documents/notes.txt”)` 这一句话; `os.system` 函数允许你在 Python 中运行 shell 命令,因此这里我们写了一行命令来使用 `gedit` 打开 home 目录下 `Documents` 目录中名为 `notes.txt` 的文件。例如,这个可以称为你今后的日常笔记程序了! + +### 添加你所需要的任务 + +你只需要修改代码中的两块地方: + + 1。在 `menu()` 中为你想要的任务定义新的菜单项。 + + 2。创建一个新的函数让给该菜单项被点击时执行特定的行为。 + + +所以,比如说你想要创建一个新菜单项,在点击后,会使用 VLC 播放硬盘中某个特定的视频/音频文件?要做到这一点,只需要在地 17 行处添加下面三行内容: + +``` +command_two = gtk.MenuItem('Play video/audio') +command_two.connect('activate', play) +menu.append(command_two) +``` + +然后在地 30 行添加下面内容: + +``` +def play(_): + os.system("vlc /home//Videos/somevideo.mp4") +``` + +将 /home//Videos/somevideo.mp4 替换成你想要播放的视频/音频文件路径。现在保存该文件然后再次运行该指示器: + +``` +python tray.py +``` + +你将会看到: + +![Create a Custom System Tray Indicator For Your Tasks on Linux 15][4] + +而且当你点击新创建的菜单项时,VLC 会开始播放! + +要创建其他项目/任务,只需要重复上面步骤即可。但是要小心,需要用其他命令来为 command_two 改名,比如 command_three,这样在变量之间才不会产生冲突。然后定义新函数,就像 play(_) 函数那样。 + +从这里开始的可能性是无穷的; 比如我用这种方法来从网上获取数据(使用 urllib2 库) 并显示出来。我也用它来在后台使用 mpg123 命令播放 mp3 文件,而且我还定义了另一个菜单项来杀掉所有的 mpg123 来随时停止播放音频。比如 Steam 上的 CS:GO 退出很费时间(窗口并不会自动关闭),因此,作为一个变通的方法,我只是最小化窗口然后点击某个自建的菜单项,它会执行 killall -9 csgo_linux64 命令。 + +你可以使用这个指示器来做任何事情:升级系统包,运行其他脚本。字面上的任何事情。 + +### 自动启动 + +我们希望系统托盘指示器能在系统启动后自动启动,而不用每次都手工运行。要做到这一点,只需要在自启动应用程序中添加下面命令即可(但是你需要将 tray.py 的路径替换成你自己的路径): + +``` +nohup python /home//tray.py & +``` + +下次重启系统,指示器会在系统启动后自动开始工作了! + +### 结论 + +你现在知道了如何为你想要的任务创建自己的系统托盘指示器了。根据每天需要运行的任务的性质和数量,此方法可以节省大量时间。有些人偏爱从命令行创建别名,但是这需要你每次都打开终端窗口或者需要有一个可用的下拉式终端仿真器,而这里,这个系统托盘指示器一直在工作,随时可用。 + +你以前用过这个方法来运行你的任务吗?很想听听你的想法。 + + +-------------------------------------------------------------------------------- + +via: https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux + +作者:[M.Hanny Sabbagh][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fosspost.org/author/mhsabbagh +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/Screenshot-at-2019-02-28-0808.png?resize=407%2C345&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 12) +[2]: https://extensions.gnome.org/extension/1031/topicons/ +[3]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/03/Screenshot-at-2019-03-02-1041.png?resize=434%2C140&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 14) +[4]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/03/Screenshot-at-2019-03-02-1141.png?resize=440%2C149&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 16) From 29ad5c041f38e185c7332a10b3ab50b91f5d1800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Mon, 24 Jun 2019 21:47:25 +0800 Subject: [PATCH 1133/1154] Transalted --- ...emove Unwanted or Junk Files) on Ubuntu.md | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) rename {sources => translated}/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md (52%) diff --git a/sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md b/translated/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md similarity index 52% rename from sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md rename to translated/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md index 12d8fe588b..c8ddd01d91 100644 --- a/sources/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md +++ b/translated/tech/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md @@ -7,28 +7,28 @@ [#]: 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 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu +5种简单的方法来在 Ubuntu 上释放空间(移除不想要的或没有用的文件) ====== -Most of us may perform this action whenever we fall into out of disk space on system. +我们中的大多数人可能在系统磁盘存储不足的情况下执行这个操作。 -Most of us may perform this action whenever we are running out of space on Linux system +我们中的大多数人可能在 Linux 系统磁盘存储不足的情况下执行这个操作。 -It should be performed frequently, to make space for installing a new application and dealing with other files. +它应该被经常执行,来为安装一个新的应用程序和处理其它文件弥补磁盘存储空间。 -Housekeeping is one of the routine task of Linux administrator, which allow them to maintain the disk utilization is in under threshold. +内务处理是 Linux 管理员的一个日常任务,管理员允许内务处理在阈值下维持磁盘利用率。 -There are several ways we can clean up our system space. +这里有一些我们可以清理我们系统空间的方法。 -There is no need to clean up your system when you have TB of storage capacity. +当你有 TB 级存储容量时,不需要清理你的系统。 -But if your have limited space then freeing up disk space becomes a necessity. +但是,如果你空间有限,那么释放磁盘空间,变的不可避免。 -In this article, I’ll show you some of the easiest or simple ways to clean up your Ubuntu system and get more space. +在这篇文章中,我将向你展示一些最容易的或简单的方法来清理你的 Ubuntu 系统,获得更多空间。 -### How To Check Free Space On Ubuntu Systems? +### 在 Ubuntu 系统上如何检查可用的空间? -Use **[df Command][1]** to check current disk utilization on your system. +在你的系统上使用 **[df 命令][1]** 来检查当前磁盘利用率。 ``` $ df -h @@ -41,18 +41,18 @@ tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 997M 0 997M 0% /sys/fs/cgroup ``` -GUI users can use “Disk Usage Analyzer tool” to view current usage. +图形界面用户可以使用“磁盘利用率分析器工具”来查看当前利用率。 [![][2]![][2]][3] -### 1) Remove The Packages That Are No Longer Required +### 1) 移除不再需要的软件包 -The following command removes the dependency libs and packages that are no longer required by the system. +下面的命令移除系统不再需要依赖的库和软件包。 -These packages were installed automatically to satisfy the dependencies of an installed package. +这些软件包自动地安装来使一个被安装软件包满足的依赖关系。 -Also, it removes old Linux kernels that were installed in the system. +同样,它移除安装在系统中的旧的 Linux 内核。 -It removes orphaned packages which are not longer needed from the system, but not purges them. +它移除不再被系统需要的孤立的软件包,但是不清除它们。 ``` $ sudo apt-get autoremove @@ -71,7 +71,7 @@ After this operation, 189 MB disk space will be freed. Do you want to continue? [Y/n] ``` -To purge them, use the `--purge` option together with the command for that. +为清除它们,与命令一起使用 `--purge` 选项。 ``` $ sudo apt-get autoremove --purge @@ -90,67 +90,67 @@ After this operation, 189 MB disk space will be freed. Do you want to continue? [Y/n] ``` -### 2) Empty The Trash Can +### 2) 清空回收站 -There might a be chance, that you may have a large amount of useless data residing in your trash can. +这可能有风险,你可能有大量的无用数据存在于你的回收站中。 -It takes up your system space. This is one of the best way to clear up those and get some free space on your system. +它占用你的系统空间。这是最好的一个方法来在你的系统上清理这些无用的数据,并获取一些可用的空间。 -To clean up this, simple use the file manager to empty your trash can. +为清理这些,简单地使用文件管理器来清空你的回收站。 [![][2]![][2]][4] -### 3) Clean up the APT cache +### 3) 清理 APT 缓存文件 -Ubuntu uses **[APT Command][5]** (Advanced Package Tool) for package management like installing, removing, searching, etc,. +Ubuntu 使用 **[APT 命令][5]** (高级软件包工具)用于软件包管理,像:安装,移除,搜索等等。 -By default every Linux operating system keeps a cache of downloaded and installed packages on their respective directory. +默认情况下,每个 Linux 操作系统在它们各自的命令保留下载和安装的软件包的缓冲。 -Ubuntu also does the same, it keeps every updates it downloads and installs in a cache on your disk. +Ubuntu 也做相同的事,它以缓冲的形式在你的磁盘上保留它下载和安装的每次更新。 -Ubuntu system keeps a cache of DEB packages in /var/cache/apt/archives directory. +Ubuntu 在 /var/cache/apt/archives 目录中保留 DEB 软件包的缓冲文件。 -Over time, this cache can quickly grow and hold a lot of space on your system. +随着时间推移,这些缓存可能快速增长,并在你的系统上占有很多空间。 -Run the following command to check the current utilization of APT cache. +运行下面的命令来检查当前 APT 缓存文件的使用率。 ``` $ sudo du -sh /var/cache/apt 147M /var/cache/apt ``` -It cleans obsolete deb-packages. I mean to say, less than clean. +它清理过时的 deb 软件包。我想说,一点都清理不干净。 ``` $ sudo apt-get autoclean ``` -It removes all packages kept in the apt cache. +它移除所有在 apt 缓存中的软件包。 ``` $ sudo apt-get clean ``` -### 4) Uninstall the unused applications +### 4) 卸载不使用的应用程序 -I would request you to check the installed packages and games on your system and delete them if you are using rarely. +我可能要求你来检查在你的系统上安装的软件包和游戏,,删除它们,如果你很少使用。 -This can be easily done via “Ubuntu Software Center”. +这可以简单地完成,通过 “Ubuntu 软件中心”。 [![][2]![][2]][6] -### 5) Clean up the thumbnail cache +### 5) 清理缩略图缓存 -The cache folder is a place where programs stored data they may need again, it is kept for speed but is not essential to keep. It can be generated again or downloaded again. +缓存文件夹是程序存储它们可能再次需要的数据的地方,它是为速度保留的,而不是必需保留的。它可以被再次生成或再次下载。 -If it’s really filling up your hard drive then you can delete things without worrying. +假如它真的填满你的硬盘,那么你可以删除一些东西而不用担心。 -Run the following command to check the current utilization of APT cache. +运行下面的命令来检查当前 APT 缓存的利用率。 ``` $ du -sh ~/.cache/thumbnails/ 412K /home/daygeek/.cache/thumbnails/ ``` -Run the following command to delete them permanently from your system. +运行下面的命令来从你的系统中永久地删除它们。 ``` $ rm -rf ~/.cache/thumbnails/* @@ -162,7 +162,7 @@ via: https://www.2daygeek.com/linux-remove-delete-unwanted-junk-files-free-up-sp 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[robsean](https://github.com/robsean) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0a6897257420d4b4f7819a3bd181f710a8bd1139 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Jun 2019 22:12:47 +0800 Subject: [PATCH 1134/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190331=20Code?= =?UTF-8?q?cademy=20vs.=20The=20BBC=20Micro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20190331 Codecademy vs. The BBC Micro.md --- .../20190331 Codecademy vs. The BBC Micro.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/talk/20190331 Codecademy vs. The BBC Micro.md diff --git a/sources/talk/20190331 Codecademy vs. The BBC Micro.md b/sources/talk/20190331 Codecademy vs. The BBC Micro.md new file mode 100644 index 0000000000..e4720315cc --- /dev/null +++ b/sources/talk/20190331 Codecademy vs. The BBC Micro.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Codecademy vs. The BBC Micro) +[#]: via: (https://twobithistory.org/2019/03/31/bbc-micro.html) +[#]: author: (Two-Bit History https://twobithistory.org) + +Codecademy vs. The BBC Micro +====== + +In the late 1970s, the computer, which for decades had been a mysterious, hulking machine that only did the bidding of corporate overlords, suddenly became something the average person could buy and take home. An enthusiastic minority saw how great this was and rushed to get a computer of their own. For many more people, the arrival of the microcomputer triggered helpless anxiety about the future. An ad from a magazine at the time promised that a home computer would “give your child an unfair advantage in school.” It showed a boy in a smart blazer and tie eagerly raising his hand to answer a question, while behind him his dim-witted classmates look on sullenly. The ad and others like it implied that the world was changing quickly and, if you did not immediately learn how to use one of these intimidating new devices, you and your family would be left behind. + +In the UK, this anxiety metastasized into concern at the highest levels of government about the competitiveness of the nation. The 1970s had been, on the whole, an underwhelming decade for Great Britain. Both inflation and unemployment had been high. Meanwhile, a series of strikes put London through blackout after blackout. A government report from 1979 fretted that a failure to keep up with trends in computing technology would “add another factor to our poor industrial performance.”1 The country already seemed to be behind in the computing arena—all the great computer companies were American, while integrated circuits were being assembled in Japan and Taiwan. + +In an audacious move, the BBC, a public service broadcaster funded by the government, decided that it would solve Britain’s national competitiveness problems by helping Britons everywhere overcome their aversion to computers. It launched the _Computer Literacy Project_ , a multi-pronged educational effort that involved several TV series, a few books, a network of support groups, and a specially built microcomputer known as the BBC Micro. The project was so successful that, by 1983, an editor for BYTE Magazine wrote, “compared to the US, proportionally more of Britain’s population is interested in microcomputers.”2 The editor marveled that there were more people at the Fifth Personal Computer World Show in the UK than had been to that year’s West Coast Computer Faire. Over a sixth of Great Britain watched an episode in the first series produced for the _Computer Literacy Project_ and 1.5 million BBC Micros were ultimately sold.3 + +[An archive][1] containing every TV series produced and all the materials published for the _Computer Literacy Project_ was put on the web last year. I’ve had a huge amount of fun watching the TV series and trying to imagine what it would have been like to learn about computing in the early 1980s. But what’s turned out to be more interesting is how computing was _taught_. Today, we still worry about technology leaving people behind. Wealthy tech entrepreneurs and governments spend lots of money trying to teach kids “to code.” We have websites like Codecademy that make use of new technologies to teach coding interactively. One would assume that this approach is more effective than a goofy ’80s TV series. But is it? + +### The Computer Literacy Project + +The microcomputer revolution began in 1975 with the release of [the Altair 8800][2]. Only two years later, the Apple II, TRS-80, and Commodore PET had all been released. Sales of the new computers exploded. In 1978, the BBC explored the dramatic societal changes these new machines were sure to bring in a documentary called “Now the Chips Are Down.” + +The documentary was alarming. Within the first five minutes, the narrator explains that microelectronics will “totally revolutionize our way of life.” As eerie synthesizer music plays, and green pulses of electricity dance around a magnified microprocessor on screen, the narrator argues that the new chips are why “Japan is abandoning its ship building, and why our children will grow up without jobs to go to.” The documentary goes on to explore how robots are being used to automate car assembly and how the European watch industry has lost out to digital watch manufacturers in the United States. It castigates the British government for not doing more to prepare the country for a future of mass unemployment. + +The documentary was supposedly shown to the British Cabinet.4 Several government agencies, including the Department of Industry and the Manpower Services Commission, became interested in trying to raise awareness about computers among the British public. The Manpower Services Commission provided funds for a team from the BBC’s education division to travel to Japan, the United States, and other countries on a fact-finding trip. This research team produced a report that cataloged the ways in which microelectronics would indeed mean major changes for industrial manufacturing, labor relations, and office work. In late 1979, it was decided that the BBC should make a ten-part TV series that would help regular Britons “learn how to use and control computers and not feel dominated by them.”5 The project eventually became a multimedia endeavor similar to the _Adult Literacy Project_ , an earlier BBC undertaking involving both a TV series and supplemental courses that helped two million people improve their reading. + +The producers behind the _Computer Literacy Project_ were keen for the TV series to feature “hands-on” examples that viewers could try on their own if they had a microcomputer at home. These examples would have to be in BASIC, since that was the language (really the entire shell) used on almost all microcomputers. But the producers faced a thorny problem: Microcomputer manufacturers all had their own dialects of BASIC, so no matter which dialect they picked, they would inevitably alienate some large fraction of their audience. The only real solution was to create a new BASIC—BBC BASIC—and a microcomputer to go along with it. Members of the British public would be able to buy the new microcomputer and follow along without worrying about differences in software or hardware. + +The TV producers and presenters at the BBC were not capable of building a microcomputer on their own. So they put together a specification for the computer they had in mind and invited British microcomputer companies to propose a new machine that met the requirements. The specification called for a relatively powerful computer because the BBC producers felt that the machine should be able to run real, useful applications. Technical consultants for the _Computer Literacy Project_ also suggested that, if it had to be a BASIC dialect that was going to be taught to the entire nation, then it had better be a good one. (They may not have phrased it exactly that way, but I bet that’s what they were thinking.) BBC BASIC would make up for some of BASIC’s usual shortcomings by allowing for recursion and local variables.6 + +The BBC eventually decided that a Cambridge-based company called Acorn Computers would make the BBC Micro. In choosing Acorn, the BBC passed over a proposal from Clive Sinclair, who ran a company called Sinclair Research. Sinclair Research had brought mass-market microcomputing to the UK in 1980 with the Sinclair ZX80. Sinclair’s new computer, the ZX81, was cheap but not powerful enough for the BBC’s purposes. Acorn’s new prototype computer, known internally as the Proton, would be more expensive but more powerful and expandable. The BBC was impressed. The Proton was never marketed or sold as the Proton because it was instead released in December 1981 as the BBC Micro, also affectionately called “The Beeb.” You could get a 16k version for £235 and a 32k version for £335. + +In 1980, Acorn was an underdog in the British computing industry. But the BBC Micro helped establish the company’s legacy. Today, the world’s most popular microprocessor instruction set is the ARM architecture. “ARM” now stands for “Advanced RISC Machine,” but originally it stood for “Acorn RISC Machine.” ARM Holdings, the company behind the architecture, was spun out from Acorn in 1990. + +![Picture of the BBC Micro.][3] _A bad picture of a BBC Micro, taken by me at the Computer History Museum +in Mountain View, California._ + +### The Computer Programme + +A dozen different TV series were eventually produced as part of the _Computer Literacy Project_ , but the first of them was a ten-part series known as _The Computer Programme_. The series was broadcast over ten weeks at the beginning of 1982. A million people watched each week-night broadcast of the show; a quarter million watched the reruns on Sunday and Monday afternoon. + +The show was hosted by two presenters, Chris Serle and Ian McNaught-Davis. Serle plays the neophyte while McNaught-Davis, who had professional experience programming mainframe computers, plays the expert. This was an inspired setup. It made for [awkward transitions][4]—Serle often goes directly from a conversation with McNaught-Davis to a bit of walk-and-talk narration delivered to the camera, and you can’t help but wonder whether McNaught-Davis is still standing there out of frame or what. But it meant that Serle could voice the concerns that the audience would surely have. He can look intimidated by a screenful of BASIC and can ask questions like, “What do all these dollar signs mean?” At several points during the show, Serle and McNaught-Davis sit down in front of a computer and essentially pair program, with McNaught-Davis providing hints here and there while Serle tries to figure it out. It would have been much less relatable if the show had been presented by a single, all-knowing narrator. + +The show also made an effort to demonstrate the many practical applications of computing in the lives of regular people. By the early 1980s, the home computer had already begun to be associated with young boys and video games. The producers behind _The Computer Programme_ sought to avoid interviewing “impressively competent youngsters,” as that was likely “to increase the anxieties of older viewers,” a demographic that the show was trying to attract to computing.7 In the first episode of the series, Gill Nevill, the show’s “on location” reporter, interviews a woman that has bought a Commodore PET to help manage her sweet shop. The woman (her name is Phyllis) looks to be 60-something years old, yet she has no trouble using the computer to do her accounting and has even started using her PET to do computer work for other businesses, which sounds like the beginning of a promising freelance career. Phyllis says that she wouldn’t mind if the computer work grew to replace her sweet shop business since she enjoys the computer work more. This interview could instead have been an interview with a teenager about how he had modified _Breakout_ to be faster and more challenging. But that would have been encouraging to almost nobody. On the other hand, if Phyllis, of all people, can use a computer, then surely you can too. + +While the show features lots of BASIC programming, what it really wants to teach its audience is how computing works in general. The show explains these general principles with analogies. In the second episode, there is an extended discussion of the Jacquard loom, which accomplishes two things. First, it illustrates that computers are not based only on magical technology invented yesterday—some of the foundational principles of computing go back two hundred years and are about as simple as the idea that you can punch holes in card to control a weaving machine. Second, the interlacing of warp and weft threads is used to demonstrate how a binary choice (does the weft thread go above or below the warp thread?) is enough, when repeated over and over, to produce enormous variation. This segues, of course, into a discussion of how information can be stored using binary digits. + +Later in the show there is a section about a steam organ that plays music encoded in a long, segmented roll of punched card. This time the analogy is used to explain subroutines in BASIC. Serle and McNaught-Davis lay out the whole roll of punched card on the floor in the studio, then point out the segments where it looks like a refrain is being repeated. McNaught-Davis explains that a subroutine is what you would get if you cut out those repeated segments of card and somehow added an instruction to go back to the original segment that played the refrain for the first time. This is a brilliant explanation and probably one that stuck around in people’s minds for a long time afterward. + +I’ve picked out only a few examples, but I think in general the show excels at demystifying computers by explaining the principles that computers rely on to function. The show could instead have focused on teaching BASIC, but it did not. This, it turns out, was very much a conscious choice. In a retrospective written in 1983, John Radcliffe, the executive producer of the _Computer Literacy Project_ , wrote the following: + +> If computers were going to be as important as we believed, some genuine understanding of this new subject would be important for everyone, almost as important perhaps as the capacity to read and write. Early ideas, both here and in America, had concentrated on programming as the main route to computer literacy. However, as our thinking progressed, although we recognized the value of “hands-on” experience on personal micros, we began to place less emphasis on programming and more on wider understanding, on relating micros to larger machines, encouraging people to gain experience with a range of applications programs and high-level languages, and relating these to experience in the real world of industry and commerce…. Our belief was that once people had grasped these principles, at their simplest, they would be able to move further forward into the subject. + +Later, Radcliffe writes, in a similar vein: + +> There had been much debate about the main explanatory thrust of the series. One school of thought had argued that it was particularly important for the programmes to give advice on the practical details of learning to use a micro. But we had concluded that if the series was to have any sustained educational value, it had to be a way into the real world of computing, through an explanation of computing principles. This would need to be achieved by a combination of studio demonstration on micros, explanation of principles by analogy, and illustration on film of real-life examples of practical applications. Not only micros, but mini computers and mainframes would be shown. + +I love this, particularly the part about mini-computers and mainframes. The producers behind _The Computer Programme_ aimed to help Britons get situated: Where had computing been, and where was it going? What can computers do now, and what might they do in the future? Learning some BASIC was part of answering those questions, but knowing BASIC alone was not seen as enough to make someone computer literate. + +### Computer Literacy Today + +If you google “learn to code,” the first result you see is a link to Codecademy’s website. If there is a modern equivalent to the _Computer Literacy Project_ , something with the same reach and similar aims, then it is Codecademy. + +“Learn to code” is Codecademy’s tagline. I don’t think I’m the first person to point this out—in fact, I probably read this somewhere and I’m now ripping it off—but there’s something revealing about using the word “code” instead of “program.” It suggests that the important thing you are learning is how to decode the code, how to look at a screen’s worth of Python and not have your eyes glaze over. I can understand why to the average person this seems like the main hurdle to becoming a professional programmer. Professional programmers spend all day looking at computer monitors covered in gobbledygook, so, if I want to become a professional programmer, I better make sure I can decipher the gobbledygook. But dealing with syntax is not the most challenging part of being a programmer, and it quickly becomes almost irrelevant in the face of much bigger obstacles. Also, armed only with knowledge of a programming language’s syntax, you may be able to _read_ code but you won’t be able to _write_ code to solve a novel problem. + +I recently went through Codecademy’s “Code Foundations” course, which is the course that the site recommends you take if you are interested in programming (as opposed to web development or data science) and have never done any programming before. There are a few lessons in there about the history of computer science, but they are perfunctory and poorly researched. (Thank heavens for [this noble internet vigilante][5], who pointed out a particularly egregious error.) The main focus of the course is teaching you about the common structural elements of programming languages: variables, functions, control flow, loops. In other words, the course focuses on what you would need to know to start seeing patterns in the gobbledygook. + +To be fair to Codecademy, they offer other courses that look meatier. But even courses such as their “Computer Science Path” course focus almost exclusively on programming and concepts that can be represented in programs. One might argue that this is the whole point—Codecademy’s main feature is that it gives you little interactive programming lessons with automated feedback. There also just isn’t enough room to cover more because there is only so much you can stuff into somebody’s brain in a little automated lesson. But the producers at the BBC tasked with kicking off the _Computer Literacy Project_ also had this problem; they recognized that they were limited by their medium and that “the amount of learning that would take place as a result of the television programmes themselves would be limited.”8 With similar constraints on the volume of information they could convey, they chose to emphasize general principles over learning BASIC. Couldn’t Codecademy replace a lesson or two with an interactive visualization of a Jacquard loom weaving together warp and weft threads? + +I’m banging the drum for “general principles” loudly now, so let me just explain what I think they are and why they are important. There’s a book by J. Clark Scott about computers called _But How Do It Know?_ The title comes from the anecdote that opens the book. A salesman is explaining to a group of people that a thermos can keep hot food hot and cold food cold. A member of the audience, astounded by this new invention, asks, “But how do it know?” The joke of course is that the thermos is not perceiving the temperature of the food and then making a decision—the thermos is just constructed so that cold food inevitably stays cold and hot food inevitably stays hot. People anthropomorphize computers in the same way, believing that computers are digital brains that somehow “choose” to do one thing or another based on the code they are fed. But learning a few things about how computers work, even at a rudimentary level, takes the homunculus out of the machine. That’s why the Jacquard loom is such a good go-to illustration. It may at first seem like an incredible device. It reads punch cards and somehow “knows” to weave the right pattern! The reality is mundane: Each row of holes corresponds to a thread, and where there is a hole in that row the corresponding thread gets lifted. Understanding this may not help you do anything new with computers, but it will give you the confidence that you are not dealing with something magical. We should impart this sense of confidence to beginners as soon as we can. + +Alas, it’s possible that the real problem is that nobody wants to learn about the Jacquard loom. Judging by how Codecademy emphasizes the professional applications of what it teaches, many people probably start using Codecademy because they believe it will help them “level up” their careers. They believe, not unreasonably, that the primary challenge will be understanding the gobbledygook, so they want to “learn to code.” And they want to do it as quickly as possible, in the hour or two they have each night between dinner and collapsing into bed. Codecademy, which after all is a business, gives these people what they are looking for—not some roundabout explanation involving a machine invented in the 18th century. + +The _Computer Literacy Project_ , on the other hand, is what a bunch of producers and civil servants at the BBC thought would be the best way to educate the nation about computing. I admit that it is a bit elitist to suggest we should laud this group of people for teaching the masses what they were incapable of seeking out on their own. But I can’t help but think they got it right. Lots of people first learned about computing using a BBC Micro, and many of these people went on to become successful software developers or game designers. [As I’ve written before][6], I suspect learning about computing at a time when computers were relatively simple was a huge advantage. But perhaps another advantage these people had is shows like _The Computer Programme_ , which strove to teach not just programming but also how and why computers can run programs at all. After watching _The Computer Programme_ , you may not understand all the gobbledygook on a computer screen, but you don’t really need to because you know that, whatever the “code” looks like, the computer is always doing the same basic thing. After a course or two on Codecademy, you understand some flavors of gobbledygook, but to you a computer is just a magical machine that somehow turns gobbledygook into running software. That isn’t computer literacy. + +_If you enjoyed this post, more like it come out every four weeks! Follow[@TwoBitHistory][7] on Twitter or subscribe to the [RSS feed][8] to make sure you know when a new post is out._ + +_Previously on TwoBitHistory…_ + +> FINALLY some new damn content, amirite? +> +> Wanted to write an article about how Simula bought us object-oriented programming. It did that, but early Simula also flirted with a different vision for how OOP would work. Wrote about that instead! +> +> — TwoBitHistory (@TwoBitHistory) [February 1, 2019][9] + + 1. Robert Albury and David Allen, Microelectronics, report (1979). ↩ + + 2. Gregg Williams, “Microcomputing, British Style”, Byte Magazine, 40, January 1983, accessed on March 31, 2019, . ↩ + + 3. John Radcliffe, “Toward Computer Literacy,” Computer Literacy Project Achive, 42, accessed March 31, 2019, [https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards Computer Literacy.pdf][10]. ↩ + + 4. David Allen, “About the Computer Literacy Project,” Computer Literacy Project Archive, accessed March 31, 2019, . ↩ + + 5. ibid. ↩ + + 6. Williams, 51. ↩ + + 7. Radcliffe, 11. ↩ + + 8. Radcliffe, 5. ↩ + + + + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2019/03/31/bbc-micro.html + +作者:[Two-Bit History][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://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/ +[2]: /2018/07/22/dawn-of-the-microcomputer.html +[3]: /images/beeb.jpg +[4]: https://twitter.com/TwoBitHistory/status/1112372000742404098 +[5]: https://twitter.com/TwoBitHistory/status/1111305774939234304 +[6]: /2018/09/02/learning-basic.html +[7]: https://twitter.com/TwoBitHistory +[8]: https://twobithistory.org/feed.xml +[9]: https://twitter.com/TwoBitHistory/status/1091148050221944832?ref_src=twsrc%5Etfw +[10]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards%20Computer%20Literacy.pdf From a32fcca576a6321dc882294a3e09ef13483820a0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Jun 2019 23:11:41 +0800 Subject: [PATCH 1135/1154] PRF:20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md @wxy --- ...e State Of Smart Contracts Now) -Part 6.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md b/translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md index 3748d28dd8..63dab46960 100644 --- a/translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md +++ b/translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Blockchain 2.0 – Ongoing Projects (The State Of Smart Contracts Now) [Part 6]) @@ -12,15 +12,15 @@ ![The State Of Smart Contracts Now][1] -继续我们的[前面的关于智能合约的文章][2],这篇文章旨在讨论智能合约的形势,重点介绍目前正在该领域进行开发的一些项目和公司。如本系列前一篇文章中讨论的,智能合约是在区块链网络上存在并执行的程序。我们探讨了智能合约的工作原理以及它们优于传统数字平台的原因。这里描述的公司分布于各种各样的行业中,但是大多涉及到身份管理系统、金融服务、众筹系统等,因为这些是被认为最适合切换到基于区块链的数据库系统的领域。 +继续我们的[前面的关于智能合约的文章][2],这篇文章旨在讨论智能合约的发展形势,重点介绍目前正在该领域进行开发的一些项目和公司。如本系列前一篇文章中讨论的,智能合约是在区块链网络上存在并执行的程序。我们探讨了智能合约的工作原理以及它们优于传统数字平台的原因。这里描述的公司分布于各种各样的行业中,但是大多涉及到身份管理系统、金融服务、众筹系统等,因为这些是被认为最适合切换到基于区块链的数据库系统的领域。 ### 开放平台 -诸如 [Counterparty][8] 和 Solidity(以太坊)等平台是完全公用的构建模块,开发者可以以之创建自己的智能合约。大量的开发人员参与此类项目使这些项目成为开发智能合约、设计自己的加密货币令牌系统以及为区块链创建协议以实现功能的事实标准。许多值得称赞的项目都来源于它们。摩根大通派生自以太坊的 [Quorum][9],就是一个例子。而瑞波是另一个例子。 +诸如 [Counterparty][8] 和 Solidity(以太坊)等平台是完全公用的构建模块,开发者可以以之创建自己的智能合约。大量的开发人员参与此类项目使这些项目成为开发智能合约、设计自己的加密货币令牌系统,以及创建区块链运行协议的事实标准。许多值得称赞的项目都来源于它们。摩根大通派生自以太坊的 [Quorum][9],就是一个例子。而瑞波是另一个例子。 ### 管理金融交易 -通过互联网转账加密货币被吹捧为在未来几年的常态。与此相关的不足之处是: +通过互联网转账加密货币被吹捧为在未来几年会成为常态。与此相关的不足之处是: * 身份和钱包地址是匿名的。如果接收方不履行交易,则付款人没有任何第一追索权。 * 错误交易(如果无法追踪任何交易)。 @@ -32,17 +32,17 @@ ### 金融服务 -小额融资和小额保险项目的发展将改善世界上大多数贫穷或没有银行账户的人的银行金融服务。据估计,社会中较贫穷的“无银行账户”人群可以为银行和机构的增加 3800 亿美元收入 [^5]。这一金额取代了通过银行切换到区块链 DLT 预期可以节省的运营费用。 +小额融资和小额保险项目的发展将改善世界上大多数贫穷或没有银行账户的人的银行金融服务。据估计,社会中较贫穷的“无银行账户”人群可以为银行和机构的增加 3800 亿美元收入 [^5]。这一金额要远远超过银行切换到区块链分布式账本技术(DLT)预期可以节省的运营费用。 -位于美国中西部的 BankQu Inc. 的口号是“通过身份而尊严”。他们的平台允许个人设置他们自己的数字身份记录,其中所有交易将在区块链上实时审查和处理。在底层代码上记录并为其用户构建唯一的在线标识,从而实现超快速的交易和结算。BankQu 案例研究探讨了他们如何以这种方式帮助个人和公司,可以在[这里][3]看到。 +位于美国中西部的 BankQu Inc. 的口号是“通过身份而尊严”。他们的平台允许个人建立他们自己的数字身份记录,其中所有交易将在区块链上实时审查和处理。在底层代码上记录并为其用户构建唯一的在线标识,从而实现超快速的交易和结算。BankQu 案例研究探讨了他们如何以这种方式帮助个人和公司,可以在[这里][3]看到。 -[Stratumn][12] 正在帮助保险公司通过自动执行早期由人类微观管理的任务来提供更好的保险服务。通过自动化、端到端可追溯性和高效的数据隐私方法,他们彻底改变了保险索赔的结算方式。改善客户体验以及显著降低成本,为客户和相关公司带来双赢局面。 +[Stratumn][12] 正在帮助保险公司通过自动化早期由人类微观管理的任务来提供更好的保险服务。通过自动化、端到端可追溯性和高效的数据隐私方法,他们彻底改变了保险索赔的结算方式。改善客户体验以及显著降低成本为客户和相关的公司带来双赢局面。 -法国保险公司 [AXA][14] 目前正在试行类似的努力。其产品 [fizzy][13] 允许用户以少量费用订阅其服务并输入他们的航班详细信息。如果航班延误或遇到其他问题,该程序会自动搜索在线数据库,检查保险条款并将保险金额记入用户的帐户。这样就消除了用户或客户在手动检查条款后提出索赔的要求,并且一旦这样的系统成为主流,就不需要长期提出索赔,增加了航空公司的责任。 +法国保险公司 [AXA][14] 目前正在试行类似的努力。其产品 [fizzy][13] 允许用户以少量费用订阅其服务并输入他们的航班详细信息。如果航班延误或遇到其他问题,该程序会自动搜索在线数据库,检查保险条款并将保险金额记入用户的帐户。这样就用户或客户无需在手动检查条款后提出索赔,并且就长期而言,一旦这样的系统成为主流,就增加了航空公司的责任心。 ### 跟踪所有权 -理论上可以利用 DLT 中的带时间戳的数据块来跟踪从创建到最终用户消费的媒体。Peertracks 公司 和 Mycelia 公司目前正在帮助音乐家发布内容,而不必担心其内容被盗或被滥用。他们帮助艺术家直接向粉丝和客户销售,同时获得工作报酬,而无需通过权利和唱片公司 [^9]。 +理论上可以利用 DLT 中的带时间戳的数据块来跟踪媒体的创建到最终用户消费。Peertracks 公司和 Mycelia 公司目前正在帮助音乐家发布内容,而不必担心其内容被盗或被滥用。他们帮助艺术家直接向粉丝和客户销售,同时获得工作报酬,而无需通过权利和唱片公司 [^9]。 ### 身份管理平台 @@ -56,7 +56,7 @@ [Share & Charge][18] ([Slock.It][19]) 是一家欧洲的区块链初创公司。他们的移动应用程序允许房主和其他个人投入资金建立充电站与其他正在寻找快速充电的人分享他们的资源。这不仅使业主能够收回他们的一些投资,而且还允许 EV 司机在其近地域获得更多的充电点,从而允许供应商以方便的方式满足需求。一旦“客户”完成对其车辆的充电,相关的硬件就会创建一个由数据组成的安全时间戳块,并且在该平台上工作的智能合约会自动将相应的金额记入所有者账户。记录所有此类交易的跟踪并保持适当的安全验证。有兴趣的读者可以看一下[这里][6],了解他们产品背后的技术角度。该公司的平台将逐步使用户能够与有需要的个人分享其他产品和服务,并从中获得被动收入。 -我们在这里看到的公司,以及一个很短的正在进行中的项目的清单,这些项目利用智能合约和区块链数据库系统。诸如此类的平台有助于构建一个安全的“盒子”,其中包含仅由用户自己和上面的代码或智能合约访问的信息。基于触发器对信息进行实时审查、检查,并且算法由系统执行。这样的平台具有最小化的人为监督,这是在安全数字自动化方面朝着正确方向迈出的急需的一步,这在以前从未被考虑过如此规模。 +我们在这里看到的公司,以及一个很短的正在进行中的项目的清单,这些项目利用智能合约和区块链数据库系统。诸如此类的平台有助于构建一个安全的“盒子”,其中包含仅由用户自己、其上的代码或智能合约访问的信息。基于触发器对信息进行实时审查、检查,并且算法由系统执行。这样的平台人为监督最小化,这是在安全数字自动化方面朝着正确方向迈出的急需的一步,这在以前从未被考虑过如此规模。 下一篇文章将阐述不同类型的区块链。单击以下链接以了解有关此主题的更多信息。 @@ -70,10 +70,10 @@ via: https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/ -作者:[editor][a] +作者:[ostechnix][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9e3baa702c43d3575ecf569fa2e51dde5e44cea2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Jun 2019 23:12:09 +0800 Subject: [PATCH 1136/1154] PUB:20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md @wxy https://linux.cn/article-11013-1.html --- ...ing Projects (The State Of Smart Contracts Now) -Part 6.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md (99%) diff --git a/translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md b/published/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md similarity index 99% rename from translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md rename to published/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md index 63dab46960..dbc3c03306 100644 --- a/translated/talk/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md +++ b/published/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11013-1.html) [#]: subject: (Blockchain 2.0 – Ongoing Projects (The State Of Smart Contracts Now) [Part 6]) [#]: via: (https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/) [#]: author: (editor https://www.ostechnix.com/author/editor/) From 1b69a97ce36e3f17f6a269538400b13999705e0c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Jun 2019 23:32:28 +0800 Subject: [PATCH 1137/1154] PRF:20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wahailin 恭喜您完成了第一篇贡献! --- ...lternative Mattermost Gets -50M Funding.md | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md b/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md index e9ebcd7bfa..0aafeeedf9 100644 --- a/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md +++ b/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (wahailin) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Open Source Slack Alternative Mattermost Gets $50M Funding) [#]: via: (https://itsfoss.com/mattermost-funding/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Slack 开源替代品 Mattermost 获得 5000 万美元融资 +Slack 的开源替代品 Mattermost 获得 5000 万美元融资 ====== -[Mattermost][1],作为 [Slack][2] 的开源替代品,获得了 5000 万美元的B轮融资。这个消息极其令人振奋。 +[Mattermost][1],作为 [Slack][2] 的开源替代品,获得了 5000 万美元的 B 轮融资。这个消息极其令人振奋。 -[Slack][3] 是一个基于云的团队内部沟通协作软件。企业、创业公司、甚至全球化的开源项目都在使用Slack进行同事及项目成员间的沟通。 +[Slack][3] 是一个基于云的团队内部沟通协作软件。企业、初创企业、甚至全球化的开源项目都在使用 Slack 进行同事及项目成员间的沟通。 [Slack 在 2019 年 6 月的估值为 200 亿美元][4],由此可见其在科技行业的巨大影响,当然也就有更多产品想与之竞争。 @@ -20,16 +20,15 @@ Slack 开源替代品 Mattermost 获得 5000 万美元融资 ![][5] -就我个人而言,我并不知道 MatterMost 这个产品。但 [VentureBeat][6] 对这则新闻的报道,激发了我的好奇心。 这次融资由 [Y Combinator’s][7] 与一家新的投资方 BattleVentures 牵头,现有投资者 Redpoint 和 S28 Captial 共同加入。 - +就我个人而言,我并不知道 MatterMost 这个产品。但 [VentureBeat][6] 对这则新闻的报道,激发了我的好奇心。这次融资由 [Y Combinator][7] 的 Continuity 与一家新的投资方 BattleVentures 领投,现有投资者 Redpoint 和 S28 Captial 共同跟投。 在[公告][8]中,他们也提到: -> 今天的公告中,Mattermost 成为了 YC 历次 B 轮投资中投资额最高的项目。 +> 今天的公告中,Mattermost 成为了 YC 有史以来规模最大的 B 轮投资项目,更重要的是,它是 YC 迄今为止投资额最高的开源项目。 下面是摘自 VentureBeat 的报道,你可以从中了解到一些细节: -> 本次资本注入,是继 2017 年 2 月的种子轮 350 万融资和今年 2 月份的 2000 万 A 轮融资之后进行的,并使得这家总部位于美国加州帕罗奥图(Palo Alto)的公司融资总额达到了约 7000 万美元。 +> 本次资本注入,是继 2017 年 2 月的种子轮 350 万融资和今年 2 月份的 2000 万 A 轮融资之后进行的,并使得这家总部位于美国加州帕罗奥图Palo Alto的公司融资总额达到了约 7000 万美元。 如果你对他们的规划感兴趣,可以阅读[官方公告][8]。 @@ -41,9 +40,9 @@ Slack 开源替代品 Mattermost 获得 5000 万美元融资 前面已经提到,Mattermost 是 Slack 的开源替代品。 -乍一看,它几乎照搬了 Slack 的界面外观,没错,这就是关键所在,你将拥有你乐于使用的软件的开源方案。 +乍一看,它几乎照搬了 Slack 的界面外观,没错,这就是关键所在,你将拥有你可以轻松使用的软件的开源解决方案。 -它甚至集成了一些流行的 DevOps 工具,如 Git、Bots 和 CI/CD。除了这些功能外,它还关注安全性和隐私。 +它甚至集成了一些流行的 DevOps 工具,如 Git、自动机器人和 CI/CD。除了这些功能外,它还关注安全性和隐私。 同样,和 Slack 类似,它支持和多种应用程序与服务的集成。 @@ -51,15 +50,15 @@ Slack 开源替代品 Mattermost 获得 5000 万美元融资 #### 定价:企业版和团队版 -如果你想让 Mattermost 对其托管(或获得优先支持),应选择企业版。但如果你想使用非付费托管,可以下载[团队版][11],并安装到基于 Linux 的云服务器或 VPS 服务器上。 +如果你希望由 Mattermost 托管该服务(或获得优先支持),应选择其企业版。但如果你不想使用付费托管,可以下载[团队版][11],并将其安装到基于 Linux 的云服务器或 VPS 服务器上。 当然,我们不会在此进行深入探究。我确想在此提及的是,企业版并不昂贵。 ![][12] -**总结** +### 总结 -MatterMost 无疑相当出色,有了 5000 万巨额资金的注入,对于那些正在寻求安全的并能提供高效团队协作支持的开源通讯平台的开源社区用户,Mattermost 很可能成为下一个大事件。 +MatterMost 无疑相当出色,有了 5000 万巨额资金的注入,对于那些正在寻求安全的并能提供高效团队协作支持的开源通讯平台的用户,Mattermost 很可能成为开源社区重要的部分。 你觉得这条新闻怎么样?对你来说有价值吗?你是否已了解 Mattermost 是 Slack 的替代品? @@ -67,12 +66,12 @@ MatterMost 无疑相当出色,有了 5000 万巨额资金的注入,对于那 -------------------------------------------------------------------------------- -来源: +via: https://itsfoss.com/mattermost-funding/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[wahailin](https://github.com/wahailin) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 20bda0ca900f5bacf7ee2b1aed4f908fe7d30bbf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Jun 2019 23:33:54 +0800 Subject: [PATCH 1138/1154] PUB:20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wahailin 本文首发地址: https://linux.cn/article-11014-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/wahailin 请注册领取 LCCN:https://lctt.linux.cn/ --- ...n Source Slack Alternative Mattermost Gets -50M Funding.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md (98%) diff --git a/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md b/published/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md similarity index 98% rename from translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md rename to published/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md index 0aafeeedf9..8d6b7aad8a 100644 --- a/translated/tech/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md +++ b/published/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wahailin) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11014-1.html) [#]: subject: (Open Source Slack Alternative Mattermost Gets $50M Funding) [#]: via: (https://itsfoss.com/mattermost-funding/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 1147da078c62c141a4cfd9475f4c13643918cb90 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Jun 2019 00:26:39 +0800 Subject: [PATCH 1139/1154] PRF:20190531 Learn Python with these awesome resources.md @tomjlw --- ...arn Python with these awesome resources.md | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/translated/tech/20190531 Learn Python with these awesome resources.md b/translated/tech/20190531 Learn Python with these awesome resources.md index 927355886d..d4fc5bdad7 100644 --- a/translated/tech/20190531 Learn Python with these awesome resources.md +++ b/translated/tech/20190531 Learn Python with these awesome resources.md @@ -1,38 +1,42 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Learn Python with these awesome resources) [#]: via: (https://opensource.com/article/19/5/resources-learning-python) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) -通过这些精品资源学习 Python +学习 Python 的精品 PLN 资源 ====== -通过将这些资源加入你自己的私人学习网络以拓展你的 Python 知识 -![书单,最爱][1] -我使用和教 Python 已有很长时间了,但我总是感兴趣于增加我对这门实用语言的知识。这就是为什么我一直试着拓展我的 Python [私人学习网络][2](PLN),一个描述非正式的互惠型分享信息网络的概念。 +> 通过将这些资源加入你自己的私人学习网络以拓展 Python 知识。 -教育学家 [Kelly Paredes][3] 和 [Sean Tibor][4] 最近讨论关于如何在他们的播客 [Teaching Python][5] 上搭建 Python PLN。我在克里夫兰的 [PyCon 2019][6] 遇到他们之后就订阅了这个频道(并把它们假如我的 Python PLN)。这个播客鼓励我考虑更多关于我的 Python PLN 中的人,包括那些我最近在 PyCon 遇到的。 +![](https://img.linux.net.cn/data/attachment/album/201906/25/002706hrx0d3dfrxeid3nj.jpg) -我会分享一些我遇到我的 PLN 的地方;可能它们也可以变成你的 Python PLN 的一部分。 +我使用和教授 Python 已有很长时间了,但我总是乐于增加我对这门实用语言的知识。这就是为什么我一直试着拓展我的 Python [个人学习网络][2]personal learning network(PLN),这是一个描述用于分享信息的非正式的互惠型网络的概念。 + +教育学家 [Kelly Paredes][3] 和 [Sean Tibor][4] 最近在他们的播客 [Teaching Python][5] 上谈到了如何搭建 Python PLN。我在克里夫兰的 [PyCon 2019][6] 遇到他们之后就订阅了这个频道(并把它们加入到我的 Python PLN 当中)。这个播客激发了我对 Python PLN 中的人的思考,包括那些我最近在 PyCon 遇到的人们。 + +我会分享一些我找到 PLN 成员的地方;可能它们也可以变成你的 Python PLN 的一部分。 ### Young Coders 导师 -Python 基金会的活动协调者 [Betsy Waliszewski][7] 是我的 Python PLN 中的一员。当我们在 PyCon2019 碰到彼此时,因为我是个老师她推荐我看看为十二岁及以上的孩子打造的 [Young Coders][8] 工作室。在那我遇到了负责这个教参与者如何搭建并配置树莓派并使用 Python 项目的 [Katie Cunningham][9]。年轻学生也会收到两本书 Jason Briggs 的 _[Python for Kids][10]_ 和 Craig Richardson 的 _[Learn to Program with Minecraft][11]_。我总是寻找提升我教学水平的新方式,因此我在会议上的 [NoStarch Press][12] 展台迅速拿了两本 Minecraft 书的抄本。Katie 是一名优秀的教师以及一名熟练的有着惊艳的充满 Python 培训视频的 [YouTube][13] 频道作者。 -我把 Kattie 与另外两个我在 Young Coders 工作室碰到的人加入我的 PLN:[Nat Dunn][14] 和 [Sean Valentine][15]。像 Katie 一样,他们志愿将他们的时间用来把 Python 介绍给青年程序员。Nat 是 [Webucator][16],一家成为 Python 软件基金会赞助商好几年并赞助了 PyCon 2018 教育峰会的 IT 培训公司的主席。他在教他的13岁儿子和14岁外甥 Python 后决定在 Young Coders 教学。Sean 是 [Hidden Genius Project][17],一个为黑人男青年而打造的科技及领导力教导项目,的战略倡议指导。Sean 说许多 Hidden Genius 参与者“用 Python打造项目因此我们将 [Young Coders] 看成一个对合作商的好机会”。了解 Hidden Genius Project 鼓励我更深层次地思考编程的未来以及其改变生活的威力。 +Python 基金会的活动协调者 [Betsy Waliszewski][7] 是我的 Python PLN 中的一员。当我们在 PyCon2019 见到时,因为我是个老师,她推荐我看看为十二岁及以上的孩子打造的 [Young Coders][8] 工作室。在那我遇到了正在负责这个计划的 [Katie Cunningham][9],它会教参与者如何搭建和配置树莓派并使用 Python 项目。年轻学生也会收到两本书 Jason Briggs 的 《[Python for Kids][10]》 和 Craig Richardson 的 《[Learn to Program with Minecraft][11]》。我一直寻找提升我教学水平的新方式,因此我在该会议上的 [NoStarch Press][12] 展台迅速拿到了两本 Minecraft 书。Katie 是一名优秀的教师,也是一名多产作家,拥有一个充满 Python 培训视频的 [YouTube][13] 精彩频道。 -### Open Spaces 会面 -我发现 PyCon 的 [Open Spaces][18] 一小时左右的自序即兴会面跟正式的项目活动一样有用。我的最爱之一是关于 [Circuit Playground Express][19] 设备,它是我们会议主题包的一部分。我着迷于这个设备并且 Open Space 提供了学习它的一条大道。组织者提供工作表和拥有成功所需要的所有工具的 [Github][20] 仓库,也提供了一个上手学习的机会以及探索这个独特硬件的方向。 +我把 Kattie 与我在 Young Coders 工作室碰到的另外两个人加入我的 PLN:[Nat Dunn][14] 和 [Sean Valentine][15]。像 Katie 一样,他们自愿花时间把 Python 介绍给青年程序员们。Nat 是 [Webucator][16] 的总裁,这是一家 IT 培训公司,多年来一直是 Python 软件基金会赞助商,并赞助了 PyCon 2018 教育峰会。在将 Python 教他 13 岁的儿子和 14 岁的侄子之后,他决定在 Young Coders 任教。Sean 是 [Hidden Genius 项目][17] 的战略计划总监,这是一个针对黑人男性青年的技术及领导力打造的教导项目。Sean 说许多 Hidden Genius 参与者“用 Python 打造项目因此我们认为 [Young Coders] 是一个很好的合作机会”。了解 Hidden Genius 项目激发了我更深层次地思考编程的未来以及其改变生活的威力。 -这次会面满足了我想要了解更多关于编程 Circuit Playground Express 的胃口,因此在 PyCon 之后, 我在 Twitter 上接触到了在会议上就有关编程这个设备发表主旨演讲的 [Nina Zakharenko][21]。Nina 自从去年秋天我在 [All Things Open][23] 上听过她的演讲就在我的 Python PLN 里了。我最近报名了她的[Python 基础][24]课程以加深我的学习。Nina 推荐我将 [Kattni Rembor][25] 加入我的 Python PLN。他的[示例代码][26]正帮助我学习用 CircuitPython 编程。 +### Open Spaces 聚会 -### 我 PLN 中的其他资源 +我发现 PyCon 的 [Open Spaces][18] —— 这是一个一小时左右的自组织的即兴聚会 —— 跟正式的项目活动一样有用。我的最爱之一是 [Circuit Playground Express][19] 设备,它是我们会议主题包的一部分。我很喜欢这个设备,并且 Open Space 提供了学习它的一条大道。组织者提供了工作表和一个 [Github][20] 仓库,其中包含有我们成功所需要的所有工具,也提供了一个上手实践的机会以及探索这个独特硬件的方向。 -我在 PyCon 2019 也遇见了下属 [Opensource.com][27] 社区的主席 [Moshe Zadka][28] 并和他来了场长谈。他分享了几个新的 Python 资源,包括 _[如何像电脑科学家一样思考][29]_ 社区主席[Seth Kenlon][30] 是我的 PLN 中的另一名成员;他发表了许多优秀的 [Python 文章][31]我也推荐你关注他。 +这次会面激起了了我对学习 Circuit Playground Express 更新信息的兴趣,因此在 PyCon 之后, 我在 Twitter 上接触到了在会议上就该设备编程发表主旨演讲的 [Nina Zakharenko][21]。Nina 自从去年秋天我在 [All Things Open][23] 上听过她的演讲后就在我的 Python PLN 里了。我最近报名参加了她的 [Python 基础][24]课程以加深我的学习。Nina 推荐我将 [Kattni Rembor][25] 加入我的 Python PLN。他的[示例代码][26]正帮助我学习用 CircuitPython 编程。 -我的 Python每天都在继续扩大。除了我已经提到的,我同样推荐你关注 [Al Sweigart][32],[Eric Matthes][33],以及 [Adafruit][34] 因为他们分享优质内容。我也推荐这本书 _[制作:由 Adafruit Circuit Playground Express 开始][35]_ 和 [Podcast.__init__][36],一个关于 Python 社区的播客。这两个都是我从我的 PLN 中了解到的。 +### 我的 PLN 中的其他资源 + +我在 PyCon 2019 也遇见了 [Opensource.com][27] 社区版主 [Moshe Zadka][28],并和他来了场长谈。他分享了几个新的 Python 资源,包括 [如何像电脑科学家一样思考][29]。社区版主 [Seth Kenlon][30] 是我的 PLN 中的另一名成员;他发表了许多优秀的 [Python 文章][31],我也推荐你关注他。 + +我的 Python PLN 每天都在持续扩大。除了我已经提到的,我同样推荐你关注 [Al Sweigart][32]、[Eric Matthes][33] 以及 [Adafruit][34]他们分享的优质内容。我也推荐这本书《[制作:由 Adafruit Circuit Playground Express 开始][35]》和《[Podcast.\_\_init\_\_][36]》,这是一个关于 Python 社区的播客。这两个都是我从我的 PLN 中了解到的。 谁在你的 Python PLN 中?请在留言区分享你的最爱。 @@ -43,7 +47,7 @@ via: https://opensource.com/article/19/5/resources-learning-python 作者:[Don Watkins][a] 选题:[lujun9972][b] 译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a4a2c1583acb3cec5c3a0bd3d7768e74f9208095 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Jun 2019 00:27:16 +0800 Subject: [PATCH 1140/1154] PUB:20190531 Learn Python with these awesome resources.md @tomjlw https://linux.cn/article-11015-1.html --- .../20190531 Learn Python with these awesome resources.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190531 Learn Python with these awesome resources.md (99%) diff --git a/translated/tech/20190531 Learn Python with these awesome resources.md b/published/20190531 Learn Python with these awesome resources.md similarity index 99% rename from translated/tech/20190531 Learn Python with these awesome resources.md rename to published/20190531 Learn Python with these awesome resources.md index d4fc5bdad7..80aaa801f4 100644 --- a/translated/tech/20190531 Learn Python with these awesome resources.md +++ b/published/20190531 Learn Python with these awesome resources.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tomjlw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11015-1.html) [#]: subject: (Learn Python with these awesome resources) [#]: via: (https://opensource.com/article/19/5/resources-learning-python) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) From a5e47aba6a4cf57ccaf19f789cac4332af46d0bb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 Jun 2019 00:51:58 +0800 Subject: [PATCH 1141/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190624=20Usin?= =?UTF-8?q?g=20i3=20with=20multiple=20monitors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190624 Using i3 with multiple monitors.md --- ...0190624 Using i3 with multiple monitors.md | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 sources/tech/20190624 Using i3 with multiple monitors.md diff --git a/sources/tech/20190624 Using i3 with multiple monitors.md b/sources/tech/20190624 Using i3 with multiple monitors.md new file mode 100644 index 0000000000..a1407008e7 --- /dev/null +++ b/sources/tech/20190624 Using i3 with multiple monitors.md @@ -0,0 +1,192 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using i3 with multiple monitors) +[#]: via: (https://fedoramagazine.org/using-i3-with-multiple-monitors/) +[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) + +Using i3 with multiple monitors +====== + +![][1] + +Are you using multiple monitors with your Linux workstation? Seeing many things at once might be beneficial. But there are often much more windows in our workflows than physical monitors — and that’s a good thing, because seeing too many things at once might be distracting. So being able to switch what we see on individual monitors seems crucial. + +Let’s talk about i3 — a popular tiling window manager that works great with multiple monitors. And there is one handy feature that many other window managers don’t have — the ability to switch workspaces on individual monitors independently. + +### Quick introduction to i3 + +The [Fedora Magazine has already covered i3][2] about three years ago. And it was one of the most popular articles ever published! Even though that’s not always the case, i3 is pretty stable and that article is still very accurate today. So — not to repeat ourselves too much — this article only covers the very minimum to get i3 up and running, and you’re welcome to go ahead and read it if you’re new to i3 and want to learn more about the basics. + +To install i3 on your system, run the following command: + +``` +$ sudo dnf install i3 +``` + +When that’s done, log out, and on the log in screen choose i3 as your window manager and log back in again. + +When you run i3 for the first time, you’ll be asked if you wish to proceed with automatic configuration — answer yes here. After that, you’ll be asked to choose a “mod key”. If you’re not sure here, just accept the default which sets you Windows/Super key as the mod key. You’ll use this key for mostly all the shortcuts within the window manager. + +At this point, you should see a little bar at the bottom and an empty screen. Let’s have a look at some of the basic shortcuts. + +Open a terminal using: + +``` +$mod + enter +``` + +Switch to a second workspace using: + +``` +$mod + 2 +``` + +Open firefox in two steps, first by: + +``` +$mod + d +``` + +… and then by typing “firefox” and pressing enter. + +Move it to the first workspace by: + +``` +$mod + shift + 1 +``` + +… and switch to the first workspace by: + +``` +$mod + 1 +``` + +At this point, you’ll see a terminal and a firefox window side by side. To close a window, press: + +``` +$mod + shift + q +``` + +There are more shortcuts, but these should give you the minimum to get started with i3. + +Ah! And to exit i3 (to log out) press: + +``` +$mod + shift + e +``` + +… and then confirm using your mouse at the top-right corner. + +### Getting multiple screens to work + +Now that we have i3 up and running, let’s put all those screens to work! + +To do that, we’ll need to use the command line as i3 is very lightweight and doesn’t have gui to manage additional screens. But don’t worry if that sounds difficult — it’s actually quite straightforward! + +The command we’ll use is called xrandr. If you don’t have xrandr on your system, install it by running: + +``` +$ sudo dnf install xrandr +``` + +When that’s installed, let’s just go ahead and run it: + +``` +$ xrandr +``` + +The output lists all the available outputs, and also indicated which have a screen attached to them (a monitor connected with a cable) by showing supported resolutions. Good news is that we don’t need to really care about the specific resolutions to make the them work. + +This specific example shows a primary screen of a laptop (named eDP1), and a second monitor connected to the HDMI-2 output, physically positioned right of the laptop. To turn it on, run the following command: + +``` +$ xrandr --output HDMI-2 --auto --right-of eDP1 +``` + +And that’s it! Your screen is now active. + +![Second screen active. The commands shown on this screenshot are slightly different than in the article, as they set a smaller resolution to make the screenshots more readable.][3] + +### Managing workspaces on multiple screens + +Switching workspaces and creating new ones on multiple screens is very similar to having just one screen. New workspaces get created on the screen that’s currently active — the one that has your mouse cursor on it. + +So, to switch to a specific workspace (or to create a new one in case it doesn’t exist), press: + +``` +$mod + NUMBER +``` + +And you can switch workspaces on individual monitors independently! + +![Workspace 2 on the left screen, workspace 4 on the right screen.][4] + +![Left screen switched to workspace 3, right screen still showing workspace 4.][5] + +![Right screen switched to workspace 4, left screen still showing workspace 3.][6] + +### Moving workspaces between monitors + +The same way we can move windows to different workspaces by the following command: + +``` +$mod + shift + NUMBER +``` + +… we can move workspaces to different screens as well. However, there is no default shortcut for this action — so we have to create it first. + +To create a custom shortcut, you’ll need to open the configuration file in a text editor of your choice (this article uses _vim_): + +``` +$ vim ~/.config/i3/config +``` + +And add the following lines to the very bottom of the configuration file: + +``` +# Moving workspaces between screens +bindsym $mod+p move workspace to output right +``` + +Save, close, and to reload and apply the configuration, press: + +``` +$mod + shift + r +``` + +Now you’ll be able to move your active workspace to the second monitor by: + +``` +$mod + p +``` + +![Workspace 2 with Firefox on the left screen][7] + +![Workspace 2 with Firefox moved to the second screen][8] + +And that’s it! Enjoy your new multi-monitor experience, and to learn more about i3, you’re welcome to read the previous article about i3 on the Fedora Magazine, or consult the official i3 documentation. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-i3-with-multiple-monitors/ + +作者:[Adam Šamalík][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/asamalik/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/i3-title-816x345.jpg +[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/06/0-1-1024x384.png +[4]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-1-1024x384.png +[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-2-1024x384.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-3-1024x384.png +[7]: https://fedoramagazine.org/wp-content/uploads/2019/06/2-1-1024x384.png +[8]: https://fedoramagazine.org/wp-content/uploads/2019/06/2-2-1024x384.png From d4e5f2d2276f0e2625c105356f471e05b0d0f5ea Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 Jun 2019 00:52:40 +0800 Subject: [PATCH 1142/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190624=20With?= =?UTF-8?q?=20Upgraded=20Specs,=20Raspberry=20Pi=204=20Takes=20Aim=20at=20?= =?UTF-8?q?Desktop=20Segment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190624 With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment.md --- ...berry Pi 4 Takes Aim at Desktop Segment.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20190624 With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment.md diff --git a/sources/tech/20190624 With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment.md b/sources/tech/20190624 With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment.md new file mode 100644 index 0000000000..38bdb01b27 --- /dev/null +++ b/sources/tech/20190624 With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment) +[#]: via: (https://itsfoss.com/raspberry-pi-4/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment +====== + +_**Brief: Raspberry Pi 4 is here with the upgraded technical specifications. You get up to 4 GB of RAM and you can connect two 4K displays with it. With the new hardware, you should be more comfortable using it as a desktop. Starting price remains the $35 like the previous models.**_ + +The Raspberry Pi Foundation has just launched the new [Raspberry Pi 4 Model B][1]. + +It comes with some impressive upgrades which makes one of the most powerful [single board computers][2] under $40. + +![Raspberry Pi 4][3] + +### What’s new in Raspberry Pi 4? + +The Raspberry Pi 4 now supports a dual 4K monitor setup – if that is what you are looking for. In addition to this, you get a more powerful processor which can be coupled with up to 4 GB of RAM. That’s almost equivalent to a mid-end laptop. + +The upgraded specification makes it a competitor in the [Linux mini-PC][4] segment while the same price tag of $35 gives it an edge over [other single board computers][2]. + +Right after the launch, it’s almost out of stock at major online stores. So, let us take a look at what makes it so impressive. + +#### Raspberry Pi 4 key specifications + +![Raspberry Pi 4 Tech Specs][5] + + * Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz + * Up to 4GB RAM (choices are 1 GB, 2 GB and 4 GB) + * WiFi and Bluetooth 5.0 + * 2 USB 3.0 and a USB 2.0 ports + * 40 pin GPIO header (backward compatible) + * 2 micro-HDMI ports (supports 4K displays) + * USB-C (power supply) + * Gigabit Ethernet + + + +If you are curious to know more, do check out the [official tech specs][6] on their website. + +### Pricing and availability + +The pricing for just the Raspberry Pi 4 board starts from $35 and depending on the choice of RAM (1-4 GB), the cost shall vary. + + * Raspberry Pi 4 with 1 GB RAM: $35 + * Raspberry Pi 4 with 2 GB RAM: $45 + * Raspberry Pi 4 with 4 GB RAM: $55 + + + +Raspberry Pi 4 is available from different vendors depending on your country. It’s getting out of stock so you should either hurry up or wait for a few days/weeks. You can get purchase information on its official webpage. + +[Buy Raspberry Pi 4][1] + +You should note that [you need to have additional accessories in order to run Raspberry Pi][7]. This is why there are several starter kits available to give you all the necessary supporting accessories. + +[][8] + +Suggested read  Raspberry Pi Gets RAM Upgrade, In The Same Price + +#### Raspberry Pi 4 desktop Kit + +![Raspberry Pi 4 Desktop Kit][9] + +You can also purchase the official Raspberry Pi 4 desktop kit that comes with a Raspberry Pi 4, its case, keyboard, mouse, micro HDMI cables, USB-C power supply, user guide and 16GB [microSD card with Raspbian installed][10]. + +![Raspberry Pi Branded Desktop Kit][11] + +The entire kit is in red and white color and it looks pretty (if you care for the looks). You can get the purchase information on Raspberry Pi website. + +[Raspberry Pi 4 Desktop Kit][12] + +#### Raspberry Pi 4 is promising + +With all that spec buff, it is definitely going to be one of the best out there. Also, instead of getting an entry-level desktop, Raspberry Pi 4 will be a better choice. You can easily access your documents, manage your spreadsheets, and do a lot of things at a cheaper price tag. + +I’m definitely considering to purchase the Raspberry Pi 4 as a spare (but a powerful) entry-level desktop. Well, I won’t be going for the 4K dual monitor setup, but it surely is capable of that, at least on paper. + +What do you think about the new Raspberry Pi 4 Model B? Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-4/ + +作者:[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.raspberrypi.org/products/raspberry-pi-4-model-b/ +[2]: https://itsfoss.com/raspberry-pi-alternatives/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspberry-pi-4.jpeg?resize=800%2C449&ssl=1 +[4]: https://itsfoss.com/linux-based-mini-pc/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspberry-pi-4-tech-specs.jpg?ssl=1 +[6]: https://www.raspberrypi.org/products/raspberry-pi-4-model-b/specifications/ +[7]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/ +[8]: https://itsfoss.com/raspberry-pi-gets-ram-upgrade-in-the-same-price/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspberry-pi-4-desktop-kit.jpg?resize=800%2C427&ssl=1 +[10]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspberry-pi-desktop-kit-official.jpg?ssl=1 +[12]: https://www.raspberrypi.org/products/raspberry-pi-4-desktop-kit/ From 600cd5a1c57aaf5bd2068a786800ee92ef575f68 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 Jun 2019 00:53:09 +0800 Subject: [PATCH 1143/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190624=20Book?= =?UTF-8?q?=20Review:=20A=20Byte=20of=20Vim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190624 Book Review- A Byte of Vim.md --- .../20190624 Book Review- A Byte of Vim.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20190624 Book Review- A Byte of Vim.md diff --git a/sources/tech/20190624 Book Review- A Byte of Vim.md b/sources/tech/20190624 Book Review- A Byte of Vim.md new file mode 100644 index 0000000000..e221a3bc6f --- /dev/null +++ b/sources/tech/20190624 Book Review- A Byte of Vim.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Book Review: A Byte of Vim) +[#]: via: (https://itsfoss.com/book-review-a-byte-of-vim/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Book Review: A Byte of Vim +====== + +[Vim][1] is a tool that is both simple and very powerful. Most new users will be intimidated by it because it doesn’t ‘work’ like regular graphical text editors. The ‘unusual’ keyboard shortcuts makes people wonder about [how to save and exit Vim][2]. But once you master Vim, there is nothing like it. + +There are numerous [Vim resources available online][3]. We have covered some Vim tricks on It’s FOSS as well. Apart from online resources, plenty of books have been dedicated to this editor as well. Today, we will look at one of such book that is designed to make Vim easy for most users to understand. The book we will be discussing is [A Byte of Vim][4] by [Swaroop C H][5]. + +The author [Swaroop C H][6] has worked in computing for over a decade. He previously worked at Yahoo and Adobe. Out of college, he made money by selling Linux CDs. He started a number of businesses, including an iPod charger named ion. He is currently an engineering manager for the AI team at [Helpshift][7]. + +### A Byte of Vim + +![][8] + +Like all good books, A Byte of Vim starts by talking about what Vim is: “a computer program used for writing any kind of text”. He does on to say, “What makes Vim special is that it is one of those few software which is both simple and powerful.” + +Before diving into telling how to use Vim, Swaroop tells the reader how to install Vim for Windows, Mac, Linux, and BSD. Once the installation is complete, he runs you through how to launch Vim and how to create your first file. + +Next, Swaroop discusses the different modes of Vim and how to navigate around your document using Vim’s keyboard shortcuts. This is followed by the basics of editing a document with Vim, including the Vim version of cut/copy/paste and undo/redo. + +Once the editing basics are covered, Swaroop talks about using Vim to edit multiple parts of a single document. You can also multiple tabs and windows to edit multiple documents at the same time. + +[][9] + +Suggested read  Bring Your Old Computer Back to Life With 4MLinux + +The book also covers extending the functionality of Vim through scripting and installing plugins. There are two ways to using scripts in Vim, use Vim’s built-in scripting language or using a programming language like Python or Perl to access Vim’s internals. There are five types of Vim plugins that can be written or downloaded: vimrc, global plugin, filetype plugin, syntax highlighting plugin, and compiler plugin. + +In a separate section, Swaroop C H covers the features of Vim that make it good for programming. These features include syntax highlighting, smart indentation, support for shell commands, omnicompletion, and the ability to be used as an IDE. + +#### Getting the ‘A Byte of Vim’ book and contributing to it + +A Byte of Book is licensed under [Creative Commons 4.0][10]. You can read an online version of the book for free on [the author’s website][4]. You can also download a [PDF][11], [Epub][12], or [Mobi][13] for free. + +[Get A Byte of Vim for FREE][4] + +If you prefer reading a [hard copy][14], you have that option, as well. + +Please note that the _**original version of A Byte of Vim was written in 2008**_ and converted to PDf. Unfortunately, Swaroop C H lost the original source files and he is working to convert the book to [Markdown][15]. If you would like to help, please visit the [book’s GitHub page][16]. + +Preview | Product | Price | +---|---|---|--- +![Mastering Vim Quickly: From WTF to OMG in no time][17] ![Mastering Vim Quickly: From WTF to OMG in no time][17] | [Mastering Vim Quickly: From WTF to OMG in no time][18] | $34.00[][19] | [Buy on Amazon][20] + +#### Conclusion + +When I first stared into the angry maw that is Vim, I did not have a clue what to do. I wish that I had known about A Byte of Vim then. This book is a good resource for anyone learning about Linux, especially if you are getting into the command line. + +Have you read [A Byte of Vim][4] by Swaroop C H? If yes, how do you find it? If not, what is your favorite book on an open source topic? Let us know in the comments below. + +[][21] + +Suggested read  Iridium Browser: A Browser for the Privacy Conscious + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][22]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/book-review-a-byte-of-vim/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://www.vim.org/ +[2]: https://itsfoss.com/how-to-exit-vim/ +[3]: https://linuxhandbook.com/basic-vim-commands/ +[4]: https://vim.swaroopch.com/ +[5]: https://swaroopch.com/ +[6]: https://swaroopch.com/about/ +[7]: https://www.helpshift.com/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/Byte-of-vim-book.png?resize=800%2C450&ssl=1 +[9]: https://itsfoss.com/4mlinux-review/ +[10]: https://creativecommons.org/licenses/by/4.0/ +[11]: https://www.gitbook.com/download/pdf/book/swaroopch/byte-of-vim +[12]: https://www.gitbook.com/download/epub/book/swaroopch/byte-of-vim +[13]: https://www.gitbook.com/download/mobi/book/swaroopch/byte-of-vim +[14]: https://swaroopch.com/buybook/ +[15]: https://itsfoss.com/best-markdown-editors-linux/ +[16]: https://github.com/swaroopch/byte-of-vim#status-incomplete +[17]: https://i2.wp.com/images-na.ssl-images-amazon.com/images/I/41itW8furUL._SL160_.jpg?ssl=1 +[18]: https://www.amazon.com/Mastering-Vim-Quickly-WTF-time/dp/1983325740?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=1983325740 (Mastering Vim Quickly: From WTF to OMG in no time) +[19]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[20]: https://www.amazon.com/Mastering-Vim-Quickly-WTF-time/dp/1983325740?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=1983325740 (Buy on Amazon) +[21]: https://itsfoss.com/iridium-browser-review/ +[22]: http://reddit.com/r/linuxusersgroup From 5632081070900f9a3229f621f4699a6065da7e29 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 Jun 2019 00:53:48 +0800 Subject: [PATCH 1144/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190624=20How?= =?UTF-8?q?=20to=20Install=20and=20Configure=20KVM=20on=20RHEL=208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190624 How to Install and Configure KVM on RHEL 8.md --- ... to Install and Configure KVM on RHEL 8.md | 256 ++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 sources/tech/20190624 How to Install and Configure KVM on RHEL 8.md diff --git a/sources/tech/20190624 How to Install and Configure KVM on RHEL 8.md b/sources/tech/20190624 How to Install and Configure KVM on RHEL 8.md new file mode 100644 index 0000000000..3021561dd8 --- /dev/null +++ b/sources/tech/20190624 How to Install and Configure KVM on RHEL 8.md @@ -0,0 +1,256 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install and Configure KVM on RHEL 8) +[#]: via: (https://www.linuxtechi.com/install-configure-kvm-on-rhel-8/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +How to Install and Configure KVM on RHEL 8 +====== + +**KVM** is an open source virtualization technology which converts your Linux machine into a type-1 bare-metal hypervisor that allows you to run multiple virtual machines (VMs) or guest VMs + + + +KVM stands for **Kernel based Virtual machine**, as the name suggests KVM is a kernel module, once it is loaded into the kernel , then your Linux machine will start working as a KVM hypervisor. In this article we will demonstrate how to install KVM on RHEL 8 system but before start installing KVM on your RHEL 8 system first we have to make sure that your system’s processor supports hardware virtualization extensions like **Intel VT** or **AMD-V** and enabled it from BIOS. + +**RHEL 8 KVM Lab Details:** + + * OS = RHEL 8 + * Hostname = rhel8-kvm + * Ethernet Cards = ens32 –  192.168.1.4 & ens36 – 192.168..1.12 + * RAM = 4 GB + * CPU = 2 + * Disk = 40 GB Free Space (/var/libvirtd) + + + +Let’s Jump into the KVM installation steps + +### Step:1) Verify Hardware Virtualization is enabled or not + +Open the terminal and execute the beneath egrep command + +``` +[root@linuxtechi ~]# egrep -c '(vmx|svm)' /proc/cpuinfo +2 +[root@linuxtechi ~]# +``` + +If output of above egrep command is equal to 1 or more than 1 then this confirms that hardware virtualization is enabled and supported. + +Alternate way to check whether hardware virtualization is enabled or not , execute the beneath command, + +``` +[root@linuxtechi ~]# lscpu | grep Virtualization: +Virtualization: VT-x +[root@linuxtechi opt]# +``` + +If there is no output in above command then it confirms that Virtualization is not enabled from BIOS. + +**Note:** To enable hardware virtualization reboot your system, go to bios settings and then look for Intel VT or AMD virtualization option and enable one of this option which which suits to your system architecture. + +### Step:2) Install KVM and its dependent packages using dnf + +Run the following dnf command to install KVM and its dependent packages, + +``` +[root@linuxtechi ~]# dnf install qemu-kvm qemu-img libvirt virt-install libvirt-client virt-manager -y +``` + +Once above packages has been installed successfully, then run the below command to confirm whether KVM module has been loaded into the kernel or not, + +``` +root@linuxtechi ~]# lsmod | grep -i kvm +kvm_intel 245760 0 +kvm 745472 1 kvm_intel +irqbypass 16384 1 kvm +[root@linuxtechi ~]# +``` + +### Step:3) Enable and Start libvirtd service + +Run the following systemctl command to enable and start libvirtd service, + +``` +[root@linuxtechi ~]# systemctl enable libvirtd +[root@linuxtechi ~]# systemctl start libvirtd +``` + +### Step:4) Create Network bridge and attach Interface to it  + +In RHEL 8, network scripts are deprecated, We have to use Network Manager (nmcli / nmtui) to configure network and network bridges. + +I have two Ethernet cards on my server, ens36 will attached to bridge br0 and ens32 will be used for management . + +``` +[root@linuxtechi ~]# nmcli connection show +NAME UUID TYPE DEVICE +ens32 1d21959d-e2ea-4129-bb89-163486c8d7bc ethernet ens32 +ens36 1af408b6-c98e-47ce-bca7-5141b721f8d4 ethernet ens36 +virbr0 d0f05de4-4b3b-4710-b904-2524b5ad11bf bridge virbr0 +[root@linuxtechi ~]# +``` + +Delete the existing connection of interface “ens36” + +``` +[root@linuxtechi ~]# nmcli connection delete ens36 +Connection 'ens36' (1af408b6-c98e-47ce-bca7-5141b721f8d4) successfully deleted. +[root@linuxtechi ~]# +``` + +Create a Network Bridge with name “**br0**” using mcli command, + +``` +[root@linuxtechi ~]# nmcli connection add type bridge autoconnect yes con-name br0 ifname br0 +Connection 'br0' (62c14e9d-3e72-41c2-8ecf-d17978ad02da) successfully added. +[root@linuxtechi ~]# +``` + +Assign the same IP of ens36 to the bridge interface using following nmcli commands, + +``` +[root@linuxtechi ~]# nmcli connection modify br0 ipv4.addresses 192.168.1.12/24 ipv4.method manual +[root@linuxtechi ~]# nmcli connection modify br0 ipv4.gateway 192.168.1.1 +[root@linuxtechi ~]# nmcli connection modify br0 ipv4.dns 192.168.1.1 +``` + +Add ens36 interface as bridge salve to the network bridge br0, + +``` +[root@linuxtechi ~]# nmcli connection add type bridge-slave autoconnect yes con-name ens36 ifname ens36 master br0 +Connection 'ens36' (0c2065bc-ad39-47a7-9a3e-85c80cd73c94) successfully added. +[root@linuxtechi ~]# +``` + +Now bring up the network bridge using beneath nmcli command, + +``` +[root@linuxtechi ~]# nmcli connection up br0 +Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/9) +[root@linuxtechi ~]# +``` + +Verify the connections using following command, + +``` +[root@linuxtechi ~]# nmcli connection show +NAME UUID TYPE DEVICE +br0 00bcff8f-af85-49ad-9196-974de2d9d9d1 bridge br0 +ens32 1d21959d-e2ea-4129-bb89-163486c8d7bc ethernet ens32 +ens36 eaef13c9-c24e-4a3f-ae85-21bf0610471e ethernet ens36 +virbr0 d0f05de4-4b3b-4710-b904-2524b5ad11bf bridge virbr0 +[root@linuxtechi ~]# +``` + +View the bridge (br0) details and status using ip command, + +![rhel-8-bridge-details][1] + +**Note:** If you want to use network-scripts in RHEL 8 system then install network-scripts packages, + +``` +~ ]# dnf install network-scripts -y +``` + +### Step:5) Creating and Managing KVM Virtual Machines + +In RHEL 8 there are different ways to create and manage KVM virtual machines, + + * virt-manager (GUI) + * Command Line tools (**virt-install** & **virsh**) + + + +During the KVM installation we have already installed virt-manager and virt-install packages. + +### Creating Virtual Machines using virt-manager GUI tool: + +Run the virt-manager command from command line or Access virt-manager from RHEL 8 Desktop + +[![Access-Virt-Manager-RHEL8][2]][3] + +Click on Monitor Icon to create a new guest VM (Virtual Machine), + +Choose Local Installation Media as ISO, + +[![Choose-ISO-KVM-RHEL8][4]][5] + +Click on forward, + +In the next screen, browse the OS installation ISO file , in my case i have placed Ubuntu 18.04 LTS server ISO file under /opt folder, + +[![Installation-ISO-File-RHEL8-KVM][6]][7] + +click on Forward to Proceed further, + +In the next window you will be prompted to specify RAM and vCPU for your virtual machine, so specify the values that suits your installation and then click on Forward, + +[![Specify-RAM-CPU-KVM-RHEL8][8]][9] + +In next window specify disk size for your Virtual Machine and the click on Forward, in my case i am giving disk space for my VM as 20 GB, + +[![Disk-Image-RHEL8-KVM-VM][10]][11] + +In the next window, specify the name of VM and choose the Network that you want to attach to VM’s Ethernet card, as we had created network bridge “br0” for vms networking, so choose bridge“br0”. + +[![Network-Selection-KVM-RHEL8][12]][13] + +Click on Finish to proceed with VM creation and its OS installation, + +[![OS-Installation-KVM-VM-RHEL8][14]][15] + +Follow the screen Instructions and complete the Installation. + +**Creating KVM Virtual Machine from Command Line** + +if you are fan of command line then there is a command line tool for you called “**virt-install**” to create virtual machines. Once the Virtual machines are provisioned then vms can be managed via command line tool “[virsh][16]“. + +Let’s assume we want to create CentOS 7 VM using virt-install, i have already placed CentOS 7 ISO file under /opt folder, + +Execute beneath command to provision a VM + +``` +[root@linuxtechi ~]# virt-install -n CentOS7-Server --description "CentOS 7 Virtual Machine" --os-type=Linux --os-variant=rhel7 --ram=1096 --vcpus=1 --disk path=/var/lib/libvirt/images/centos7-server.img,bus=virtio,size=20 --network bridge:br0 --graphics none --location /opt/CentOS-7-x86_64-DVD-1511.iso --extra-args console=ttyS0 +``` + +Output of command would be something like below, + +![Virt-Install-KVM-RHEL8][17] + +Follow screen instructions to complete CentOS 7 Installation. That’s all from this tutorial, i hope these steps helped you to setup KVM on your RHEL 8 system, please do share your feedback and comments. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/install-configure-kvm-on-rhel-8/ + +作者:[Pradeep Kumar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/wp-content/uploads/2019/06/rhel-8-bridge-details-1024x628.jpg +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Access-Virt-Manager-RHEL8-1024x471.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Access-Virt-Manager-RHEL8.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Choose-ISO-KVM-RHEL8-1024x479.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Choose-ISO-KVM-RHEL8.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Installation-ISO-File-RHEL8-KVM-1024x477.jpg +[7]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Installation-ISO-File-RHEL8-KVM.jpg +[8]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Specify-RAM-CPU-KVM-RHEL8-1024x478.jpg +[9]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Specify-RAM-CPU-KVM-RHEL8.jpg +[10]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Disk-Image-RHEL8-KVM-VM-1024x483.jpg +[11]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Disk-Image-RHEL8-KVM-VM.jpg +[12]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Network-Selection-KVM-RHEL8-1024x482.jpg +[13]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Network-Selection-KVM-RHEL8.jpg +[14]: https://www.linuxtechi.com/wp-content/uploads/2019/06/OS-Installation-KVM-VM-RHEL8-1024x479.jpg +[15]: https://www.linuxtechi.com/wp-content/uploads/2019/06/OS-Installation-KVM-VM-RHEL8.jpg +[16]: https://www.linuxtechi.com/create-revert-delete-kvm-virtual-machine-snapshot-virsh-command/ +[17]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Virt-Install-KVM-RHEL8.jpg From 934a0f45b15ec236842aa1794db46b396bf7c836 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 Jun 2019 00:54:28 +0800 Subject: [PATCH 1145/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190624=20Chec?= =?UTF-8?q?k=20your=20password=20security=20with=20Have=20I=20Been=20Pwned?= =?UTF-8?q?=3F=20and=20pass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190624 Check your password security with Have I Been Pwned- and pass.md --- ...curity with Have I Been Pwned- and pass.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20190624 Check your password security with Have I Been Pwned- and pass.md diff --git a/sources/tech/20190624 Check your password security with Have I Been Pwned- and pass.md b/sources/tech/20190624 Check your password security with Have I Been Pwned- and pass.md new file mode 100644 index 0000000000..d4557725ba --- /dev/null +++ b/sources/tech/20190624 Check your password security with Have I Been Pwned- and pass.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Check your password security with Have I Been Pwned? and pass) +[#]: via: (https://opensource.com/article/19/6/check-passwords) +[#]: author: (Brian "bex" Exelbierd https://opensource.com/users/bexelbie/users/jason-baker/users/admin/users/mtsouk) + +Check your password security with Have I Been Pwned? and pass +====== +Periodically checking for password compromise is an excellent way to +help ward off most attackers in most threat models. +![Password lock][1] + +Password security involves a broad set of practices, and not all of them are appropriate or possible for everyone. Therefore, the best strategy is to develop a threat model by thinking through your most significant risks—who and what you are protecting against—then model your security approach on the activities that are most effective against those specific threats. The Electronic Frontier Foundation (EFF) has a [great series on threat modeling][2] that I encourage everyone to read. + +In my threat model, I am very concerned about the security of my passwords against (among other things) [dictionary attacks][3], in which an attacker uses a list of likely or known passwords to try to break into a system. One way to stop dictionary attacks is to have your service provider rate-limit or deny login attempts after a certain number of failures. Another way is not to use passwords in the "known passwords" dataset. + +### Check password security with HIBP + +[Troy Hunt][4] created [Have I Been Pwned?][5] (HIBP) to notify people when their information is found in leaked data dumps and breaches. If you haven't already registered, you should, as the mere act of registering exposes nothing. Troy has built a collection of over 550 million real-world passwords from this data. These are passwords that real people used and were exposed by data that was stolen or accidentally made public. + +The site _does not_ publish the plaintext password list, but it doesn't have to. By definition, this data is already out there. If you've ever reused a password or used a "common" password, then you are at risk because someone is building a dictionary of these passwords to try right now. + +Recently, Firefox and HIBP announced they are [teaming up][6] to make breach searches easier. And the National Institutes of Standards and Technology (NIST) recommends that you [check passwords][7] against those known to be compromised and change them if they are found. HIBP supports this via a password-checking feature that is exposed via an API, so it is easy to use. + +Now, it would be a bad idea to send the website a full list of your passwords. While I trust [HaveIBeenPwned.com][5], it could be compromised one day. Instead, the site uses a process called [k-Anonymity][8] that allows you to check your passwords without exposing them. This is a three-step process. First, let's review the steps, and then we can use the **pass-pwned** plugin to do it for us: + + 1. Create a hash value of your password. A hash value is just a way of turning arbitrary data—your password—into a fixed data representation—the hash value. A cryptographic hash function is collision-resistant, meaning it creates a unique hash value for every input. The algorithm used for the hash is a one-way transformation, which makes it hard to know the input value if you only have the hash value. For example, using the SHA-1 algorithm that HIBP uses, the password **hunter2** becomes **F3BBBD66A63D4BF1747940578EC3D0103530E21D**. + 2. Send the first five characters (**F3BBB** in our example) to the site, and the site will send back a list of all the hash values that start with those five characters. This way, the site can't know which hash values you are interested in. The k-Anonymity process ensures there is so much statistical noise that it is hard for a compromised site to determine which password you inquired about. For example, our query returns a list of 527 potential matches from HIBP. + 3. Search through the list of results to see if your hash is there. If it is, your password has been compromised. If it isn't, the password isn't in a publicly known data breach. HIBP returns a bonus in its data: a count of how many times the password has been seen in data breaches. Astoundingly, **hunter2** has been seen 17,043 times! + + + +### Check password security with pass + +I use [**pass**][9], a [GNU Privacy Guard][10]-based password manager. It has many extensions, which are available on the [**pass** website][11] and as a separately maintained [awesome-style list][12]. One of these extensions is [**pass-pwned**][13], which will check your passwords with HIBP. Both **pass** and **pass-pwned** are packaged for Fedora 29, 30, and Rawhide. You can install the extension with: + + +``` +`sudo dnf install pass pass-pwned` +``` + +or you can follow the manual instructions on their respective websites. + +If you're just getting started with **pass**, read [Managing passwords the open source way][14] for a great overview. + +The following will quickly set up **pass** and check a stored password. This example assumes you already have a GPG key. + + +``` +# Setup a pass password store +$ pass init <GPG key email> + +# Add the password, "hunter2" to the store +$ pass insert awesome-site.com + +# Install the pass-pwned extension +# Download the bash script from the upstream and then review it +$ mkdir ~/.password-store/.extensions +$ wget -O ~/.password-store/.extensions/pwned.bash +$ vim ~/.password-store/.extensions/pwned.bash + +# If everything is OK, set it executable and enable pass extensions +$ chmod u+x ~/.password-store/.extensions/pwned.bash +$ echo 'export PASSWORD_STORE_ENABLE_EXTENSIONS="true"' >> ~/.bash_profile +$ source ~/.bash_profile + +# Check the password +$ pass pwned awesome-site.com +Password found in haveibeenpwned 17043 times + +# Change this password to something randomly generated and verify it +$ pass generate -i awesoem-site.com +The generated password for awesome-site.com is: +<REDACTED> +$ pass pwned awesome-site.com +Password not found in haveibeenpwned +``` + +Congratulations, your password is now more secure than it was before! You can also [use wildcards to check multiple passwords][15] at once. + +Periodically checking for password compromise is an excellent way to help ward off most attackers in most threat models. If your password management system doesn't make it this easy, you may want to upgrade to something like **pass**. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/check-passwords + +作者:[Brian "bex" Exelbierd][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/bexelbie/users/jason-baker/users/admin/users/mtsouk +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/password.jpg?itok=ec6z6YgZ (Password lock) +[2]: https://ssd.eff.org/en/module/your-security-plan +[3]: https://en.wikipedia.org/wiki/Dictionary_attack +[4]: https://www.troyhunt.com/ +[5]: https://haveibeenpwned.com/ +[6]: https://www.troyhunt.com/were-baking-have-i-been-pwned-into-firefox-and-1password/ +[7]: https://pages.nist.gov/800-63-FAQ/#q-b5 +[8]: https://blog.cloudflare.com/validating-leaked-passwords-with-k-anonymity/ +[9]: https://www.passwordstore.org/ +[10]: https://gnupg.org/ +[11]: https://www.passwordstore.org/#extensions +[12]: https://github.com/tijn/awesome-password-store +[13]: https://github.com/alzeih/pass-pwned +[14]: https://opensource.com/life/14/7/managing-passwords-open-source-way +[15]: https://github.com/alzeih/pass-pwned/issues/3 From 4fee4007f4b5801d1fbca9ecf6c6e29f9ccedf7b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 Jun 2019 00:55:43 +0800 Subject: [PATCH 1146/1154] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190624=20Rasp?= =?UTF-8?q?berry=20Pi=204=20is=20here!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190624 Raspberry Pi 4 is here.md --- .../tech/20190624 Raspberry Pi 4 is here.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20190624 Raspberry Pi 4 is here.md diff --git a/sources/tech/20190624 Raspberry Pi 4 is here.md b/sources/tech/20190624 Raspberry Pi 4 is here.md new file mode 100644 index 0000000000..35748c7d25 --- /dev/null +++ b/sources/tech/20190624 Raspberry Pi 4 is here.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Raspberry Pi 4 is here!) +[#]: via: (https://opensource.com/article/19/6/raspberry-pi-4) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +Raspberry Pi 4 is here! +====== +A new version of the $35 computer features a 1.5GHz Arm chip and support +for dual-HDMI 4K displays, Gigabit Ethernet, and much more. +![Raspberry Pi 4 board][1] + +The latest version of the Raspberry Pi—Raspberry Pi 4—was released today, earlier than anticipated, featuring a new 1.5GHz Arm chip and VideoCore GPU with some brand new additions: dual-HDMI 4K display output; USB3 ports; Gigabit Ethernet; and multiple RAM options up to 4GB. + +![Raspberry Pi 4 case][2] + +The Raspberry Pi 4 is a very powerful single-board computer and starts at the usual price of $35. That gets you the standard 1GB RAM, or you can pay $45 for the 2GB model or $55 for the 4GB model—premium-priced models are a first for Raspberry Pi. + +The specs at-a-glance: + + * 64-bit BCM2711 quad-core A72 CPU @ 1.5GHz + * VideoCore VI GPU + * Gigabit Ethernet port + * 1GB, 2GB, or 4GB LPDDR4 RAM + * Two Micro-HDMI ports + * Two USB3 ports + * Two USB2 ports + * Dual-band (2.4GHz and 5GHz) WiFi + * Bluetooth 5.0 + * USB Type C power port + * CSI camera interface + * DSI display interface + * MicroSD card slot + * Power-over-Ethernet pins + * Full compatibility with all previous Raspberry Pi models + + + +### USB and networking + +The Raspberry Pi 4 has the benefit of having USB3; it's powered by a USB Type C cable and provides two USB3 ports and two USB2 ports. You can now connect USB3 hard drives and other peripherals and get faster connectivity. + +![Raspberry Pi 4 USBs][3] + +The BCM2835-based chip in Raspberry Pi 1 to 3 provided just one native USB port and no Ethernet, so a USB hub on the board provided more USB ports and an Ethernet port. The 3B+ added a dedicated LAN chip, which gave it Gigabit Ethernet, but this was limited to USB2 speeds. The Pi 4 has dedicated Gigabit Ethernet, and because it's no longer throttled over USB, its networking speeds are much faster. + +The Pi 4 takes advantage of the technology built into the 3B+ that made it the first single-board computer with dual-band WiFi. This means you can connect to both 2.4GHz and 5GHz networks. + +### Displays + +When the first Raspberry Pi launched, the balance of its CPU and GPU performance was tipped heavily in favor of the GPU. The VideoCore IV was a very powerful graphics processor, capable of full-HD 1080p multimedia, which is why the Pi has always been popular as a home media center. The Pi 2 rebalanced things somewhat and brought the CPU in line, taking the Pi from a single-core to a quad-core Arm chip. The Pi 4 takes both factors a big step forward. The new VideoCore VI GPU gives the Pi 4K video and allows two displays via the board's two Micro-HDMI ports (selected to keep the board the same size), so you'll need an adapter or a Micro-to-full HDMI cable to use an HDMI monitor. + +Dual displays are a godsend when you need more screen real estate to keep eye contact with multiple windows—if you're programming you might have your code on one screen and the website or app you're building; your database; your web browser; your emails, or anything else on the other. For the first time, development on Raspberry Pi won't be limited to a single monitor. It's also handy if you want to build a Pi-based project with different things on different screens. + +The Pi also has a Display Serial Interface (DSI) port to drive another special display—not another monitor per se, but the official Raspberry Pi touch screen display connected via a flex cable. + +### Raspbian Buster + +This Raspberry Pi 4's launch coincides with a major Debian release, and the fact the new Pi supports OpenGL ES 3 means it makes sense for any software developed for the Pi 4 to target Raspbian Buster. Buster brings a few user interface tweaks and a whole host of software upgrades, including Python 3.7. + +![Raspbian Buster][4] + +### Open source graphics drivers + +Over the last five years, Eric Anholt has been working to write open source graphics drivers for the Raspberry Pi. Now, Raspbian can use this driver to deliver accelerated web browsing, desktop graphics, and 3D applications on the Pi. This replaces a large chunk of closed-source code that was previously required. Huge thanks to Eric and Broadcom for this effort. + +Previously, the Raspberry Pi 4 was expected to be yet another year away, but the chip design turned out to be ready for production much earlier than anticipated, so here it is! + +* * * + +_The Raspberry Pi 4 is on sale now. Which model will you opt for? Let us know your plans in the comments!_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/raspberry-pi-4 + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry-pi-4_lead.jpg?itok=2bkk43om (Raspberry Pi 4 board) +[2]: https://opensource.com/sites/default/files/uploads/raspberry-pi-4-case.jpg (Raspberry Pi 4 case) +[3]: https://opensource.com/sites/default/files/uploads/raspberry-pi-4-usb.jpg (Raspberry Pi 4 USBs) +[4]: https://opensource.com/sites/default/files/uploads/raspbian-buster.png (Raspbian Buster) From 3884a8974dc458d9393828f44cf912319da4244d Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Jun 2019 08:55:03 +0800 Subject: [PATCH 1147/1154] translating --- ...pen Source Version of Microsoft VS Code.md | 123 ------------------ ...pen Source Version of Microsoft VS Code.md | 118 +++++++++++++++++ 2 files changed, 118 insertions(+), 123 deletions(-) delete mode 100644 sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md create mode 100644 translated/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md diff --git a/sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md b/sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md deleted file mode 100644 index 2365c992e2..0000000000 --- a/sources/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md +++ /dev/null @@ -1,123 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (VSCodium: 100% Open Source Version of Microsoft VS Code) -[#]: via: (https://itsfoss.com/vscodium/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -VSCodium: 100% Open Source Version of Microsoft VS Code -====== - -_**Brief: VSCodium is a fork of Microsoft’s popular Visual Studio Code editor. It’s identical to VS Code with the single biggest difference that unlike VS Code, VSCodium doesn’t track your usage data.**_ - -Microsoft’s [Visual Studio Code][1] is an excellent editor not only for web developers but also for other programmers. Due to its features, it’s considered one of the best open source code editors. - -Yes, it’s one of the many open source products from Microsoft. You can [easily install Visual Studio Code in Linux][2] thanks to the ready to use binaries in the form of DEB, RPM and Snap packages. - -And there is a problem which might not be an issue for a regular user but significant to an open source purist. - -The ready to use binaries Microsoft provides are not open source. - -Confused? Let me explain. - -The source code of VS Code is open sourced under MIT license. You can access it on the [GitHub][3]. However, the [installation files that Microsoft has created contain proprietary telemetry/tracking][4]. - -This tracking basically collects usage data and sends it to Microsoft to ‘help improve their products and services’. Telemetry reporting is common with software products these days. Even [Ubuntu does that but with more transparency][5]. - -You can [disable the telemetry in VS Code][6] but can you trust Microsoft completely? If the answer is no, then what are your options? - -You can build it from the source code and thus keep everything open source. But [installing from source code][7] is not always the prettiest option specially in today’s world when we are so used to of having binaries. - -Another option is to use VSCodium! - -### VSCodium: 100% open source form of Visual Studio Code - -![][8] - -[VSCodium][9] is a fork of Microsoft’s Visual Studio Code. This project’s sole aim is to provide you with ready to use binaries without Microsoft’s telemetry code. - -[][10] - -Suggested read  SuiteCRM: An Open Source CRM Takes Aim At Salesforce - -This solves the problem where you want to use VS Code without the proprietary code from Microsoft but you are not comfortable with building it from the source. - -Since [VSCodium is a fork of VS Code][11], it looks and functions exactly the same as VS Code. - -Here’s a screenshot of the first run of VS Code and VSCodium side by side in Ubuntu. Can you distinguish one from another? - -![Can you guess which is VSCode and VSCodium?][12] - -If you have not been able to distinguish between the two, look at the bottom. - -![That’s Microsoft][13] - -Apart from this and the logo of the two applications, there is no other noticeable difference. - -![VSCodium and VS Code in GNOME Menu][14] - -#### Installing VSCodium on Linux - -While VSCodium is available in some distributions like Parrot OS, you’ll have to add additional repositories in other Linux distributions. - -On Ubuntu and Debian based distributions, you can use the following commands to install VSCodium. - -First, add the GPG key of the repository: - -``` -wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add - -``` - -And then add the repository itself: - -``` -echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list -``` - -Now update your system and install VSCodium: - -``` -sudo apt update && sudo apt install codium -``` - -You can find the [installation instructions for other distributions on its page][15]. You should also read the [instructions about migrating from VS Code to VSCodium][16]. - -**What do you think of VSCodium?** - -Personally, I like the concept of VSCodium. To use the cliche, the project has its heart in the right place. I think, Linux distributions committed to open source may even start including it in their official repository. - -What do you think? Is it worth switching to VSCodium or would you rather opt out of the telemetry and continue using VS Code? - -And please, no “I use Vim” comments :D - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/vscodium/ - -作者:[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://code.visualstudio.com/ -[2]: https://itsfoss.com/install-visual-studio-code-ubuntu/ -[3]: https://github.com/Microsoft/vscode -[4]: https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005 -[5]: https://itsfoss.com/ubuntu-data-collection-stats/ -[6]: https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting -[7]: https://itsfoss.com/install-software-from-source-code/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium.png?resize=800%2C450&ssl=1 -[9]: https://vscodium.com/ -[10]: https://itsfoss.com/suitecrm-ondemand/ -[11]: https://github.com/VSCodium/vscodium -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium-vs-vscode.png?resize=800%2C450&ssl=1 -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/microsoft-vscode-tracking.png?resize=800%2C259&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium-and-vscode.jpg?resize=800%2C220&ssl=1 -[15]: https://vscodium.com/#install -[16]: https://vscodium.com/#migrate diff --git a/translated/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md b/translated/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md new file mode 100644 index 0000000000..1790ac3066 --- /dev/null +++ b/translated/tech/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (VSCodium: 100% Open Source Version of Microsoft VS Code) +[#]: via: (https://itsfoss.com/vscodium/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +VSCodium:Microsoft VS Code 的 100% 开源版本 +====== + +_ **简介:VSCodium 是微软流行的 Visual Studio Code 编辑器的一个分支。它与 VS Code 完全相同,唯一不同的是,VSCodium 不跟踪你的使用数据。** _ + +微软的 [Visual Studio Code][1] 是一个出色的编辑器,不仅对于 Web 开发人员,也适合其他程序员。由于它的功能,它被认为是最好的开源代码编辑器之一。 + +是的,它是微软众多开源产品之一。因为有 DEB、RPM 和 Snap 包形式的二进制文件,你可以[在 Linux 中轻松安装 Visual Studio Code][2]。 + +但它存在一个问题,对于普通用户而言可能不是问题,但对于纯粹开源主义者而言是重要的。 + +Microsoft 提供的即用二进制文件不是开源的。 + +由困惑么?让我解释下。 + +VS Code 的源码是在 MIT 许可下开源的。你可以在 [GitHub][3] 上访问它。但是,[Microsoft 创建的安装包含专有的跟踪程序][4]。 + +此跟踪基本上用来收集使用数据并将其发送给 Microsoft 以“帮助改进其产品和服务”。如今,远程报告在软件产品中很常见。即使 [Ubuntu 也这样做,但它透明度更高][5]。 + +你可以[在 VS Code 中禁用远程报告][6]但是你能完全信任微软吗?如果答案是否定的,那你有什么选择? + +你可以从源代码构建它,从而保持所有开源。但是[从源代码安装][7]并不总是如今最好的选择,因为我们习惯于使用二进制文件。 + +另一种选择是使用 VSCodium! + +### VSCodium:100% 开源形式的 Visual Studio Code + +![][8] + +[VSCodium][9] 是微软 Visual Studio Code 的一个分支。该项目的唯一目的是为你提供现成的二进制文件,而没有 Microsoft 的远程收集代码。 + +这解决了你想在没有 Microsoft 的专有代码的情况下使用 VS Code 但你不习惯从源代码构建它的问题, + +由于 [VSCodium 是 VS Code 的一个分支][11],它的外观和功能与 VS Code 完全相同。 + +这是 Ubuntu 中第一次运行 VS Code 和 VSCodium 的截图。你能分辨出来吗? + +![Can you guess which is VSCode and VSCodium?][12] + +如果你无法区分这两者,请看下面。 + +![That’s Microsoft][13] + +除此之外,还有两个应用的 logo,没有其他明显的区别。 + +![VSCodium and VS Code in GNOME Menu][14] + +#### 在 Linux 上安装 VSCodium + +虽然 VSCodium 存在于某些发行版(如 Parrot OS)中,但你必须在其他 Linux 发行版中添加额外的仓库。 + +在基于 Ubuntu 和 Debian 的发行版上,你可以使用以下命令安装 VSCodium。 + +首先,添加仓库的 GPG 密钥: + +``` +wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add - +``` + +然后添加仓库: + +``` +echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list +``` + +现在更新你的系统并安装 VSCodium: + +``` +sudo apt update && sudo apt install codium +``` + +你可以在它的页面上找到[其他发行版的安装说明][15]。你还应该阅读[有关从 VS Code 迁移到 VSCodium 的说明][16]。 + +**你如何看待 VSCodium?** + +就个人而言,我喜欢 VSCodium 的概念。说的老套一点,它的初心是好的。我认为,致力于开源的 Linux 发行版甚至可能开始将其包含在官方仓库中。 + +你怎么看?是否值得切换到 VSCodium 或者你选择关闭远程报告并继续使用 VS Code? + +请不要出现“我使用 Vim” 的评论 :D + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/vscodium/ + +作者:[Abhishek Prakash][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/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://code.visualstudio.com/ +[2]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[3]: https://github.com/Microsoft/vscode +[4]: https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005 +[5]: https://itsfoss.com/ubuntu-data-collection-stats/ +[6]: https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting +[7]: https://itsfoss.com/install-software-from-source-code/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium.png?resize=800%2C450&ssl=1 +[9]: https://vscodium.com/ +[11]: https://github.com/VSCodium/vscodium +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium-vs-vscode.png?resize=800%2C450&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/microsoft-vscode-tracking.png?resize=800%2C259&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium-and-vscode.jpg?resize=800%2C220&ssl=1 +[15]: https://vscodium.com/#install +[16]: https://vscodium.com/#migrate From 3f8a759d9090441cac15a43e91e4bab2d59220a0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Jun 2019 09:01:07 +0800 Subject: [PATCH 1148/1154] translating --- sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md b/sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md index 984fb771dc..b8c28c7d5d 100644 --- a/sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md +++ b/sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 27bae6319e303aaad73ee4004a306728c62bea0b Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Tue, 25 Jun 2019 20:53:08 +0800 Subject: [PATCH 1149/1154] =?UTF-8?q?=E3=80=90=E7=A7=BB=E9=99=A4=E3=80=912?= =?UTF-8?q?0190610=20Applications=20for=20writing=20Markdown.md=20?= =?UTF-8?q?=E5=8E=9F=E6=96=87=20=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91201906?= =?UTF-8?q?10=20Applications=20for=20writing=20Markdown.md=20=E8=AF=91?= =?UTF-8?q?=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- ...90610 Applications for writing Markdown.md | 76 ------------------- ...90610 Applications for writing Markdown.md | 76 +++++++++++++++++++ 2 files changed, 76 insertions(+), 76 deletions(-) delete mode 100644 sources/tech/20190610 Applications for writing Markdown.md create mode 100644 translated/tech/20190610 Applications for writing Markdown.md diff --git a/sources/tech/20190610 Applications for writing Markdown.md b/sources/tech/20190610 Applications for writing Markdown.md deleted file mode 100644 index 782ee8a0ee..0000000000 --- a/sources/tech/20190610 Applications for writing Markdown.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (murphyzhao) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Applications for writing Markdown) -[#]: via: (https://fedoramagazine.org/applications-for-writing-markdown/) -[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) - -Applications for writing Markdown -====== - -![][1] - -Markdown is a lightweight markup language that is useful for adding formatting while still maintaining readability when viewing as plain text. Markdown (and Markdown derivatives) are used extensively as the priumary form of markup of documents on services like GitHub and pagure. By design, Markdown is easily created and edited in a text editor, however, there are a multitude of editors available that provide a formatted preview of Markdown markup, and / or provide a text editor that highlights the markdown syntax. - -This article covers 3 desktop applications for Fedora Workstation that help out when editing Markdown. - -### UberWriter - -[UberWriter][2] is a minimal Markdown editor and previewer that allows you to edit in text, and preview the rendered document. - -![][3] - -The editor itself has inline previews built in, so text marked up as bold is displayed bold. The editor also provides inline previews for images, formulas, footnotes, and more. Ctrl-clicking one of these items in the markup provides an instant preview of that element to appear. - -In addition to the editor features, UberWriter also features a full screen mode and a focus mode to help minimise distractions. Focus mode greys out all but the current paragraph to help you focus on that element in your document - -Install UberWriter on Fedora from the 3rd-party Flathub repositories. It can be installed directly from the Software application after [setting up your system to install from Flathub][4] - -### Marker - -Marker is a Markdown editor that provides a simple text editor to write Markdown in, and provides a live preview of the rendered document. The interface is designed with a split screen layout with the editor on the left, and the live preview on the right. - -![][5] - -Additionally, Marker allows you to export you document in a range of different formats, including HTML, PDF, and the Open Document Format (ODF). - -Install Marker on Fedora from the 3rd-party Flathub repositories. It can be installed directly from the Software application after [setting up your system to install from Flathub][4] - -### Ghostwriter - -Where the previous editors are more focussed on a minimal user experice, Ghostwriter provides many more features and options to play with. Ghostwriter provides a text editor that is partially styled as you write in Markdown format. Bold text is bold, and headings are in a larger font to assist in writing the markup. - -![][6] - -It also provides a split screen with a live updating preview of the rendered document. - -![][7] - -Ghostwriter also includes a range of other features, including the ability to choose the Markdown flavour that the preview is rendered in, as well as the stylesheet used to render the preview too. - -Additionally, it provides a format menu (and keyboard shortcuts) to insert some of the frequent markdown ‘tags’ like bold, bullets, and italics. - -Install Ghostwriter on Fedora from the 3rd-party Flathub repositories. It can be installed directly from the Software application after [setting up your system to install from Flathub][4] - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/applications-for-writing-markdown/ - -作者:[Ryan Lerch][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/ryanlerch/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/markdownapps.png-816x345.jpg -[2]: https://uberwriter.github.io/uberwriter/#1 -[3]: https://fedoramagazine.org/wp-content/uploads/2019/06/uberwriter-editor-1.png -[4]: https://fedoramagazine.org/install-flathub-apps-fedora/ -[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/marker-screenshot-1024x500.png -[6]: https://fedoramagazine.org/wp-content/uploads/2019/06/ghostwriter-1024x732.png -[7]: https://fedoramagazine.org/wp-content/uploads/2019/06/ghostwriter2-1024x566.png diff --git a/translated/tech/20190610 Applications for writing Markdown.md b/translated/tech/20190610 Applications for writing Markdown.md new file mode 100644 index 0000000000..c11ce19b1c --- /dev/null +++ b/translated/tech/20190610 Applications for writing Markdown.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: (murphyzhao) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Applications for writing Markdown) +[#]: via: (https://fedoramagazine.org/applications-for-writing-markdown/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +撰写 Markdown 的软件 +====== + +![][1] + +Markdown 是一种轻量级标记语言,添加格式后,以纯文本格式查看时依然保持可读性。Markdown(和 Markdown 衍生物)被广泛用作 GitHub 和 pagure 等服务上文档标记的主要形式。根据设计,可以在文本编辑器中轻松创建和编辑 Markdown,但是,有许多编辑器可以提供 Markdown 标记的格式化预览,或提供 markdown 语法高亮显示。 + +本文介绍了针对 Fedora 平台的 3 个桌面应用程序,以帮助编辑 Markdown。 + +### UberWriter + +[UberWriter][2] 是一个小巧的 Markdown 编辑器和预览器,允许您编辑文本,并预览渲染的文档。 + +![][3] + +编辑器本身具有内置的内联预览,因此标记为粗体的文本以粗体显示。编辑器还提供图像、公式、脚注等标记的内联预览。按住 Ctrl 键单击其中的一个标记可以即时预览要显示的元素。 + +除了编辑器功能外,UberWriter 还具有全屏模式和聚焦模式,有助于最大限度地减少干扰。焦点模式将以灰色显示除当前段落以外的所有内容,以帮助您专注于文档中当前元素。 + +从第三方 Flathub 存储库安装 UberWriter 到 Fedora 平台。在将系统[设置为从 Flathub 安装][4]后,可以直接从 Software 应用程序中安装它。 + +### Marker + +Marker 是一个 Markdown 编辑器,它提供了一个简单的文本编辑器来编写 Markdown,并提供渲染文档的实时预览。界面采用分屏设计,左侧为编辑器,右侧为实时预览。 + +![][5] + +此外,Marker 允许您以各种格式导出文档,包括 HTML、PDF 和开放文档格式(ODF)。 + +从第三方 Flathub 存储库安装 Marker 到 Fedora 平台。在将系统[设置为从 Flathub 安装][4]后,可以直接从 Software 应用程序中安装它。 + +### Ghostwriter + +以前的编辑更专注于最小的用户体验,Ghostwriter 提供了更多的功能和选项。Ghostwriter 提供了一个文本编辑器,当您以 Markdown 格式书写时,编辑器将 Markdown 部分样式化。粗体标记文本显示为粗体,标题标记显示为较大的字体,以帮助编写 Markdown 标记。 + +![][6] + +它还提供了一个分屏,包含渲染文档的实时更新预览。 + +![][7] + +Ghostwriter 还包括一系列其他功能,包括能够选择渲染预览的 Markdown 风格,以及用于渲染预览的样式表。 + +此外,它还提供了一个格式菜单(和键盘快捷键)来插入一些频繁的 Markdown 标记,如粗体、项目符号和斜体。 + +从第三方 Flathub 存储库安装 Ghostwriter 到 Fedora 平台。在将系统[设置为从 Flathub 安装][4]后,可以直接从 Software 应用程序中安装它。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/applications-for-writing-markdown/ + +作者:[Ryan Lerch][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/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/markdownapps.png-816x345.jpg +[2]: https://uberwriter.github.io/uberwriter/#1 +[3]: https://fedoramagazine.org/wp-content/uploads/2019/06/uberwriter-editor-1.png +[4]: https://fedoramagazine.org/install-flathub-apps-fedora/ +[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/marker-screenshot-1024x500.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/06/ghostwriter-1024x732.png +[7]: https://fedoramagazine.org/wp-content/uploads/2019/06/ghostwriter2-1024x566.png From f9aa65239a4c09300f6b425f2847c72d5149521d Mon Sep 17 00:00:00 2001 From: chen ni Date: Tue, 25 Jun 2019 22:36:28 +0800 Subject: [PATCH 1150/1154] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20190619 Leading in the Python community.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190619 Leading in the Python community.md b/sources/tech/20190619 Leading in the Python community.md index 98fa8c5dba..3ce59e8d68 100644 --- a/sources/tech/20190619 Leading in the Python community.md +++ b/sources/tech/20190619 Leading in the Python community.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chen-ni) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3510576e84185885d564da97ecde9adb18c4ff2b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Jun 2019 23:19:44 +0800 Subject: [PATCH 1151/1154] Rename sources/tech/20190624 Raspberry Pi 4 is here.md to sources/news/20190624 Raspberry Pi 4 is here.md --- sources/{tech => news}/20190624 Raspberry Pi 4 is here.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20190624 Raspberry Pi 4 is here.md (100%) diff --git a/sources/tech/20190624 Raspberry Pi 4 is here.md b/sources/news/20190624 Raspberry Pi 4 is here.md similarity index 100% rename from sources/tech/20190624 Raspberry Pi 4 is here.md rename to sources/news/20190624 Raspberry Pi 4 is here.md From ab25a4399d81ce470901ac5118df4ff19afd2e07 Mon Sep 17 00:00:00 2001 From: "GJ.Zhang" Date: Tue, 25 Jun 2019 23:20:04 +0800 Subject: [PATCH 1152/1154] Update 20190609 How to set ulimit and file descriptors limit on Linux Servers.md --- ...to set ulimit and file descriptors limit on Linux Servers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190609 How to set ulimit and file descriptors limit on Linux Servers.md b/sources/tech/20190609 How to set ulimit and file descriptors limit on Linux Servers.md index 1b732b566d..d7dab7ce06 100644 --- a/sources/tech/20190609 How to set ulimit and file descriptors limit on Linux Servers.md +++ b/sources/tech/20190609 How to set ulimit and file descriptors limit on Linux Servers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zgj1024) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 89e662d3c73bc3a8b20685964cea4ff4feda1b9a Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 26 Jun 2019 08:50:34 +0800 Subject: [PATCH 1153/1154] translated --- ... Use Firefox Send with ffsend in Fedora.md | 126 ----------------- ... Use Firefox Send with ffsend in Fedora.md | 127 ++++++++++++++++++ 2 files changed, 127 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md create mode 100644 translated/tech/20190531 Use Firefox Send with ffsend in Fedora.md diff --git a/sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md b/sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md deleted file mode 100644 index b8c28c7d5d..0000000000 --- a/sources/tech/20190531 Use Firefox Send with ffsend in Fedora.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use Firefox Send with ffsend in Fedora) -[#]: via: (https://fedoramagazine.org/use-firefox-send-with-ffsend-in-fedora/) -[#]: author: (Sylvia Sánchez https://fedoramagazine.org/author/lailah/) - -Use Firefox Send with ffsend in Fedora -====== - -![][1] - -_ffsend_ is the command line client of Firefox Send. This article will show how Firefox Send and _ffsend_ work. It’ll also detail how it can be installed and used in Fedora. - -### What are Firefox Send and ffsend ? - -Firefox Send is a file sharing tool from Mozilla that allows sending encrypted files to other users. You can install Send on your own server, or use the Mozilla-hosted link [send.firefox.com][2]. The hosted version officially supports files up to 1 GB, and links that expire after a configurable download count (default of 1) or 24 hours, and then all the files on the Send server are deleted. This tool is still _in experimental phase_ , and therefore shouldn’t be used in production or to share important or sensitive data. - -While Firefox Send is the tool itself and can be used with a web interface, _ffsend_ is a command-line utility you can use with scripts and arguments. It has a wide range of configuration options and can be left working in the background without any human intervention. - -### How does it work? - -FFSend can both upload and download files. The remote host can use either the Firefox tool or another web browser to download the file. Neither Firefox Send nor _ffsend_ require the use of Firefox. - -It’s important to highlight that _ffsend_ uses client-side encryption. This means that files are encrypted _before_ they’re uploaded. You share secrets together with the link, so be careful when sharing, because anyone with the link will be able to download the file. As an extra layer of protection, you can protect the file with a password by using the following argument: - -``` -ffsend password URL -p PASSWORD -``` - -### Other features - -There are a few other features worth mentioning. Here’s a list: - - * Configurable download limit, between 1 and 20 times, before the link expires - * Built-in extract and archiving functions - * Track history of shared files - * Inspect or delete shared files - * Folders can be shared as well, either as they are or as compressed files - * Generate a QR code, for easier download on a mobile phone - - - -### How to install in Fedora - -While Fedora Send works with Firefox without installing anything extra, you’ll need to install the CLI tool to use _ffsend_. This tool is in the official repositories, so you only need a simple _dnf_ command [with][3] _[sudo][3]_. - -``` -$ sudo dnf install ffsend -``` - -After that, you can use _ffsend_ from the terminal . - -### Upload a file - -Uploading a file is a simple as - -``` -$ ffsend upload /etc/os-release -Upload complete -Share link: https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg -``` - -The file now can be easily share using the Share link URL. - -## Downloading a file - -Downloading a file is as simple as uploading. - -``` -$ ffsend download https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg -Download complete -``` - -Before downloading a file it might be useful to check if the file exist and get information about it. _ffsend_ provides 2 handy commands for that. - -``` -$ ffsend exists https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ -Exists: true -Password: false -$ ffsend info https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ -ID: 88a6324e2a99ebb6 -Downloads: 0 of 1 -Expiry: 23h59m (86388s -``` - -## Upload history - -_ffsend_ also provides a way to check the history of the uploads made with the tools. This can be really useful if you upload a lot of files during a scripted tasks for example and you want to keep track of each files download status. - -``` -$ ffsend history -LINK EXPIRY - 1 https://send.firefox.com/download/#8TJ9QNw 23h59m - 2 https://send.firefox.com/download/KZIA-PaQ 23h54m -``` - -## Delete a file - -Another useful feature is the possibility to delete a file. - -``` -ffsend delete https://send.firefox.com/download/2d9faa7f34bb1478/#phITKvaYBjCGSRI8TJ9QNw -``` - -Firefox Send is a great service and the _ffsend_ tools makes it really convenient to use from the terminal. More examples and documentation is available on _ffsend_ ‘s [Gitlab repository][4]. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/use-firefox-send-with-ffsend-in-fedora/ - -作者:[Sylvia Sánchez][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/lailah/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/firefox-send-816x345.png -[2]: http://send.firefox.com/ -[3]: https://fedoramagazine.org/howto-use-sudo/ -[4]: https://gitlab.com/timvisee/ffsend diff --git a/translated/tech/20190531 Use Firefox Send with ffsend in Fedora.md b/translated/tech/20190531 Use Firefox Send with ffsend in Fedora.md new file mode 100644 index 0000000000..87175d5d90 --- /dev/null +++ b/translated/tech/20190531 Use Firefox Send with ffsend in Fedora.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Firefox Send with ffsend in Fedora) +[#]: via: (https://fedoramagazine.org/use-firefox-send-with-ffsend-in-fedora/) +[#]: author: (Sylvia Sánchez https://fedoramagazine.org/author/lailah/) + +在 Fedora 中利用 ffsend 使用 Firefox Send +====== + +![][1] + +_ffsend_ 是 Firefox Send 的命令行客户端。本文将展示 Firefox Send 和 _ffsend_ 如何工作。还会详细介绍如何在 Fedora 中安装和使用它。 + +### 什么是 Firefox Send 和 ffsend? + +Firefox Send 是 Mozilla 的一个文件共享工具,它能将加密文件发送给其他用户。你可以在自己的服务器上安装 Send,也可以使用 Mozilla 托管的链接 [send.firefox.com][2]。它最大支持 1GB 的文件,链接会在可配置的下载次数(默认值为 1)或 24 小时后过期,然后会删除发送服务器上的所有文件。此工具仍_处于实验阶段_,因此不应在生产中使用或共享重要或敏感数据。 + +虽然 Firefox Send 本身就是工具,并且可以在 Web 中使用,但 _ffsend_ 是一个可以与脚本和参数一起使用的命令行程序。它有多种配置选项,并且可以在后台工作而无需任何人为干预。 + +### 它如何工作? + +ffsend 可以上传和下载文件。远程主机可以使用 Firefox 工具或其他 Web 浏览器来下载文件。 Firefox Send 和 _ffsend_ 都不需要使用 Firefox。 + +值得一提 _ffsend_ 使用了客户端加密。这意味着文件在上传_前_被加密。链接中就有密钥,因此在共享时要小心,因为任何有链接的人都可以下载该文件。作为额外的保护,你可以使用以下参数使用密码保护文件: + +``` +ffsend password URL -p PASSWORD +``` + +### 其他功能 + +还有一些值得一提的其他功能: + + * 链接到期前可配置的下载限制,范围从 1 到 20 次之间 +  * 内置解压和归档功能 +  * 跟踪共享文件的历史记录 +  * 检查或删除共享文件 +  * 文件夹也可以按原样共享,也可以作为压缩文件共享 +  * 生成 QR 码,便于在手机上下载 + + + +### 如何在 Fedora 中安装 + +虽然 Fedora Send 可以在 Firefox 中使用而无需安装其他,但你需要安装 CLI 工具才能使用 _ffsend_。此工具在官方仓库中,因此你只需使用 _dnf_ 命令,并使用 _[sudo][3]_。 + +``` +$ sudo dnf install ffsend +``` + +之后,你可以在终端使用 _ffsend_。 + + +### 上传文件 + +上传文件很简单。 + +``` +$ ffsend upload /etc/os-release +Upload complete +Share link: https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg +``` + +现在可以使用 “Share link” URL 轻松共享该文件。 + +## 下载文件 + +下载文件和上传一样简单。 + +``` +$ ffsend download https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg +Download complete +``` + +在下载之前,检查文件是否存在并获取有关它的信息会有用。 _ffsend_ 为此提供了 2 个方便的命令。 + +``` +$ ffsend exists https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ +Exists: true +Password: false +$ ffsend info https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ +ID: 88a6324e2a99ebb6 +Downloads: 0 of 1 +Expiry: 23h59m (86388s +``` + +## 上传历史 + +_ffsend_ 还提供了一种查看使用工具上传的历史记录的方法。例如,如果你用脚本上传了大量文件并且想要跟踪每个文件的下载状态,那么这非常有用。 + +``` +$ ffsend history +LINK EXPIRY + 1 https://send.firefox.com/download/#8TJ9QNw 23h59m + 2 https://send.firefox.com/download/KZIA-PaQ 23h54m +``` + +## 删除文件 + +另一个有用的功能是删除文件。 + +``` +ffsend delete https://send.firefox.com/download/2d9faa7f34bb1478/#phITKvaYBjCGSRI8TJ9QNw +``` + +Firefox Send 是一项很棒的服务,_ffsend_ 使得它在终端使用起来非常方便。[Gitlab 仓库[4]中有关于 _ffsend_ 的的更多示例和文档。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-firefox-send-with-ffsend-in-fedora/ + +作者:[Sylvia Sánchez][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/lailah/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/firefox-send-816x345.png +[2]: http://send.firefox.com/ +[3]: https://fedoramagazine.org/howto-use-sudo/ +[4]: https://gitlab.com/timvisee/ffsend From a90d6a4ba70b0af44535b8b71dca90c90a6f6040 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 26 Jun 2019 08:57:38 +0800 Subject: [PATCH 1154/1154] translating --- sources/tech/20190624 Using i3 with multiple monitors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190624 Using i3 with multiple monitors.md b/sources/tech/20190624 Using i3 with multiple monitors.md index a1407008e7..abc6dcd23c 100644 --- a/sources/tech/20190624 Using i3 with multiple monitors.md +++ b/sources/tech/20190624 Using i3 with multiple monitors.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( )